[vtk6] 01/01: Imported Debian patch 6.2.0+dfsg1-11.1

Gianfranco Costamagna locutusofborg at moszumanska.debian.org
Mon Apr 11 13:18:37 UTC 2016


This is an automated email from the git hooks/post-receive script.

locutusofborg pushed a commit to annotated tag debian/6.2.0+dfsg1-11.1
in repository vtk6.

commit 5935f807af7bf7b788bdebec13ea0681d1f1d2b2
Author: Tobias Frost <tobi at debian.org>
Date:   Sun Apr 10 20:10:50 2016 +0200

    Imported Debian patch 6.2.0+dfsg1-11.1
---
 .gitignore                                         |    1 -
 Accelerators/Dax/module.cmake                      |   40 +-
 Accelerators/Dax/vtkDaxContour.cxx                 |    1 -
 Accelerators/Dax/vtkDaxThreshold.cxx               |    2 +-
 Accelerators/Piston/CMakeLists.txt                 |    9 -
 Accelerators/Piston/module.cmake                   |   40 +-
 Accelerators/Piston/vtkDataSetToPiston.cxx         |    1 -
 Accelerators/Piston/vtkPistonAlgorithm.cxx         |    2 -
 Accelerators/Piston/vtkPistonContour.cxx           |    1 -
 Accelerators/Piston/vtkPistonDataObject.cxx        |    2 -
 Accelerators/Piston/vtkPistonMapper.cxx            |    2 -
 Accelerators/Piston/vtkPistonReference.h           |    1 -
 Accelerators/Piston/vtkPistonScalarsColors.cxx     |    1 -
 Accelerators/Piston/vtkPistonSlice.cxx             |    1 -
 Accelerators/Piston/vtkPistonSort.h                |    2 +-
 Accelerators/Piston/vtkPistonThreshold.cxx         |    1 -
 Accelerators/Piston/vtkPistonToDataSet.cxx         |    1 -
 CMake/ExternalData.cmake                           |  536 +---
 CMake/ExternalData_config.cmake.in                 |    1 -
 CMake/FindADIOS.cmake                              |    4 +
 CMake/FindJsonCpp.cmake                            |   17 +-
 CMake/FindOpenMP.cmake                             |  358 ---
 CMake/FindTBB.cmake                                |  568 ++--
 CMake/android.toolchain.cmake                      |   19 +-
 CMake/vtkBackends.cmake                            |   30 +-
 CMake/vtkCompilerExtras.cmake                      |   11 +-
 CMake/vtkExternalData.cmake                        |   12 +-
 CMake/vtkModuleMacros.cmake                        |   13 +-
 CMake/vtkModuleRemote.cmake                        |  159 -
 CMake/vtkModuleTop.cmake                           |    2 +-
 CMake/vtkPythonWrapping.cmake                      |    5 -
 CMake/vtkQt.cmake                                  |    1 +
 CMake/vtkTestingMacros.cmake                       |   17 +-
 CMake/vtkVersion.cmake                             |    2 +-
 CMakeLists.txt                                     |   24 +-
 CONTRIBUTING.md                                    |   81 +-
 Charts/Core/CMakeLists.txt                         |    1 -
 Charts/Core/Testing/Cxx/CMakeLists.txt             |    2 -
 Charts/Core/Testing/Cxx/TestAreaPlot.cxx           |   98 -
 Charts/Core/Testing/Cxx/TestAxes.cxx               |    5 +-
 Charts/Core/Testing/Cxx/TestChartTileScaling.cxx   |   88 -
 .../Testing/Data/Baseline/TestAreaPlot.png.md5     |    1 -
 Charts/Core/Testing/Data/Baseline/TestAxes.png.md5 |    2 +-
 .../Core/Testing/Data/Baseline/TestBagPlot.png.md5 |    2 +-
 .../Testing/Data/Baseline/TestBarGraph.png.md5     |    2 +-
 .../Data/Baseline/TestBarGraphHorizontal.png.md5   |    2 +-
 .../Data/Baseline/TestBarGraphSelection.png.md5    |    2 +-
 .../Core/Testing/Data/Baseline/TestBoxPlot.png.md5 |    2 +-
 .../Testing/Data/Baseline/TestChartDouble.png.md5  |    2 +-
 .../Data/Baseline/TestChartDoubleColors.png.md5    |    2 +-
 .../Data/Baseline/TestChartDoubleColors_1.png.md5  |    2 +-
 .../Data/Baseline/TestChartDoubleColors_2.png.md5  |    1 -
 .../Data/Baseline/TestChartDouble_1.png.md5        |    2 +-
 .../Data/Baseline/TestChartDouble_2.png.md5        |    2 +-
 .../Testing/Data/Baseline/TestChartMatrix.png.md5  |    2 +-
 .../Data/Baseline/TestChartTileScaling.png.md5     |    1 -
 .../Testing/Data/Baseline/TestChartUnicode.png.md5 |    2 +-
 .../Data/Baseline/TestChartXYInvertedAxis.png.md5  |    2 +-
 .../Baseline/TestChartXYInvertedAxis_1.png.md5     |    1 -
 .../Testing/Data/Baseline/TestChartXYZ_1.png.md5   |    1 -
 .../Testing/Data/Baseline/TestChartXYZ_2.png.md5   |    1 -
 .../Testing/Data/Baseline/TestChartsOn3D.png.md5   |    2 +-
 .../Baseline/TestColorTransferFunction.png.md5     |    2 +-
 .../Baseline/TestColorTransferFunction_1.png.md5   |    1 +
 .../Baseline/TestColorTransferFunction_2.png.md5   |    1 +
 .../Baseline/TestColorTransferFunction_3.png.md5   |    1 +
 .../Core/Testing/Data/Baseline/TestContext.png.md5 |    2 +-
 .../Data/Baseline/TestContextUnicode.png.md5       |    2 +-
 .../Core/Testing/Data/Baseline/TestDiagram.png.md5 |    2 +-
 .../Testing/Data/Baseline/TestDiagram_1.png.md5    |    1 +
 .../Data/Baseline/TestFunctionalBagPlot.png.md5    |    2 +-
 .../Testing/Data/Baseline/TestHistogram2D.png.md5  |    2 +-
 .../Data/Baseline/TestInteractiveChartXYZ.png.md5  |    2 +-
 .../Data/Baseline/TestLegendHiddenPlots.png.md5    |    2 +-
 .../Testing/Data/Baseline/TestLinePlot.png.md5     |    2 +-
 .../Testing/Data/Baseline/TestLinePlot2.png.md5    |    2 +-
 .../Testing/Data/Baseline/TestLinePlot3D_1.png.md5 |    1 -
 .../Testing/Data/Baseline/TestLinePlot3D_2.png.md5 |    1 -
 .../Data/Baseline/TestLinePlotAxisFonts.png.md5    |    2 +-
 .../Data/Baseline/TestLinePlotAxisFonts_1.png.md5  |    2 +-
 .../Data/Baseline/TestLinePlotColors.png.md5       |    2 +-
 .../Data/Baseline/TestLinePlotDouble.png.md5       |    2 +-
 .../Data/Baseline/TestLinePlotDouble2.png.md5      |    2 +-
 .../Data/Baseline/TestLinePlotDouble_1.png.md5     |    2 +-
 .../Data/Baseline/TestLinePlotDouble_2.png.md5     |    2 +-
 .../Data/Baseline/TestLinePlotInteraction.png.md5  |    2 +-
 .../Baseline/TestLinePlotInteraction_1.png.md5     |    1 +
 .../Data/Baseline/TestLinePlotSelection.png.md5    |    2 +-
 .../Data/Baseline/TestLinePlotSelection2.png.md5   |    2 +-
 .../Data/Baseline/TestLinePlotSelection2_1.png.md5 |    2 +-
 .../Data/Baseline/TestLinePlotSelection_1.png.md5  |    2 +-
 .../Baseline/TestMultipleChartRenderers.png.md5    |    2 +-
 .../Baseline/TestMultipleChartRenderers_1.png.md5  |    1 +
 .../Data/Baseline/TestMultipleRenderers.png.md5    |    2 +-
 .../Data/Baseline/TestMultipleRenderers_1.png.md5  |    2 +-
 .../Data/Baseline/TestMultipleRenderers_2.png.md5  |    1 +
 .../Baseline/TestMultipleScalarsToColors.png.md5   |    2 +-
 .../Data/Baseline/TestParallelCoordinates.png.md5  |    2 +-
 .../Baseline/TestParallelCoordinatesColors.png.md5 |    2 +-
 .../Baseline/TestParallelCoordinatesDouble.png.md5 |    2 +-
 .../Testing/Data/Baseline/TestPieChart.png.md5     |    2 +-
 .../Testing/Data/Baseline/TestPieChart_1.png.md5   |    1 +
 .../Testing/Data/Baseline/TestPlotMatrix.png.md5   |    2 +-
 .../Testing/Data/Baseline/TestScatterPlot.png.md5  |    2 +-
 .../Data/Baseline/TestScatterPlotColors.png.md5    |    2 +-
 .../Data/Baseline/TestScatterPlotMatrix.png.md5    |    2 +-
 .../Baseline/TestScatterPlotMatrixVehicles.png.md5 |    2 +-
 .../Baseline/TestScatterPlotMatrixVisible.png.md5  |    2 +-
 .../Data/Baseline/TestScatterPlotMatrix_1.png.md5  |    2 +-
 .../Data/Baseline/TestScatterPlotMatrix_2.png.md5  |    2 +-
 .../Data/Baseline/TestScatterPlotMatrix_3.png.md5  |    1 +
 .../Data/Baseline/TestScientificPlot.png.md5       |    2 +-
 .../Data/Baseline/TestStackedBarGraph.png.md5      |    2 +-
 .../Testing/Data/Baseline/TestStackedPlot.png.md5  |    2 +-
 .../Testing/Data/Baseline/TestSurfacePlot.png.md5  |    2 +-
 .../Testing/Data/Baseline/TestZoomAxis.png.md5     |    2 +-
 .../Testing/Data/Baseline/TestZoomAxis_1.png.md5   |    2 +-
 Charts/Core/vtkAxis.cxx                            |  130 +-
 Charts/Core/vtkAxis.h                              |   17 +
 Charts/Core/vtkChart.h                             |    3 +-
 Charts/Core/vtkChartBox.cxx                        |    6 +-
 Charts/Core/vtkChartLegend.cxx                     |   16 -
 Charts/Core/vtkChartParallelCoordinates.cxx        |    7 +-
 Charts/Core/vtkChartPie.cxx                        |    6 +-
 Charts/Core/vtkChartXY.cxx                         |   80 +-
 Charts/Core/vtkChartXYZ.cxx                        |    1 -
 Charts/Core/vtkColorLegend.cxx                     |    1 -
 Charts/Core/vtkPlot.cxx                            |   15 +-
 Charts/Core/vtkPlot.h                              |   34 -
 Charts/Core/vtkPlotArea.cxx                        |  614 ----
 Charts/Core/vtkPlotArea.h                          |  116 -
 Charts/Core/vtkPlotBag.cxx                         |   54 +-
 Charts/Core/vtkPlotBag.h                           |    6 -
 Charts/Core/vtkPlotFunctionalBag.cxx               |    4 +-
 Charts/Core/vtkPlotHistogram2D.cxx                 |    5 -
 Charts/Core/vtkPlotLine.cxx                        |   67 +-
 Charts/Core/vtkPlotLine.h                          |   14 -
 Charts/Core/vtkPlotPoints.cxx                      |    2 +-
 Charts/Core/vtkScatterPlotMatrix.cxx               |   21 +-
 Charts/Core/vtkScatterPlotMatrix.h                 |    8 +-
 Common/Color/vtkNamedColors.cxx                    |    1 +
 .../Data/Baseline/TestParametricFunctions.png.md5  |    2 +-
 .../Baseline/TestParametricFunctions_1.png.md5     |    1 +
 .../Baseline/TestParametricFunctions_2.png.md5     |    1 +
 Common/Core/CMakeLists.txt                         |  119 +-
 Common/Core/SMP/Kaapi/vtkSMPThreadLocal.h.in       |   12 +-
 Common/Core/SMP/OpenMP/vtkAtomic.cxx               |  174 -
 Common/Core/SMP/OpenMP/vtkAtomic.h.in              |  293 --
 Common/Core/SMP/OpenMP/vtkSMPThreadLocal.h.in      |  173 -
 Common/Core/SMP/OpenMP/vtkSMPThreadLocalImpl.cxx   |  274 --
 Common/Core/SMP/OpenMP/vtkSMPThreadLocalImpl.h.in  |  188 --
 Common/Core/SMP/OpenMP/vtkSMPTools.cxx             |   63 -
 Common/Core/SMP/OpenMP/vtkSMPToolsInternal.h.in    |   78 -
 Common/Core/SMP/Sequential/vtkAtomic.cxx           |  284 --
 Common/Core/SMP/Sequential/vtkAtomic.h.in          |  580 ----
 Common/Core/SMP/Sequential/vtkAtomicInt.cxx        |  255 ++
 Common/Core/SMP/Sequential/vtkAtomicInt.h.in       |  379 +++
 Common/Core/SMP/Simple/vtkSMPThreadLocal.h.in      |   12 +-
 Common/Core/SMP/TBB/vtkAtomic.h.in                 |  238 --
 Common/Core/SMP/TBB/vtkAtomicInt.h.in              |   94 +
 Common/Core/SMP/TBB/vtkSMPThreadLocal.h.in         |    4 +-
 Common/Core/Testing/Cxx/CMakeLists.txt             |    2 -
 .../Testing/Cxx/TestAngularPeriodicDataArray.cxx   |  148 -
 Common/Core/Testing/Cxx/TestAtomic.cxx             |   56 +-
 .../Core/Testing/Cxx/TestLookupTableThreaded.cxx   |   61 -
 Common/Core/Testing/Cxx/UnitTestMath.cxx           |    6 -
 Common/Core/Testing/Python/CMakeLists.txt          |    3 -
 Common/Core/Testing/Python/TestArrays.py           |   61 -
 Common/Core/Testing/Python/TestEmptyInput.py       |  535 ---
 Common/Core/Testing/Python/TestSetGet.py           |  444 ---
 Common/Core/Testing/Tcl/CMakeLists.txt             |    4 +-
 Common/Core/vtkAbstractArray.h                     |    7 +-
 Common/Core/vtkAngularPeriodicDataArray.h          |   90 -
 Common/Core/vtkAngularPeriodicDataArray.txx        |  160 -
 Common/Core/vtkAtomicTypeConcepts.h                |   38 -
 Common/Core/vtkAtomicTypes.h                       |   28 -
 Common/Core/vtkBitArray.cxx                        |    8 +-
 Common/Core/vtkBitArray.h                          |    5 +-
 Common/Core/vtkByteSwap.cxx                        |    4 +-
 Common/Core/vtkByteSwap.h                          |    4 +-
 Common/Core/vtkConfigure.h.in                      |   17 +-
 Common/Core/vtkDataArray.cxx                       |    2 +-
 Common/Core/vtkDataArray.h                         |    6 +-
 Common/Core/vtkDataArrayIteratorMacro.h            |    2 +-
 Common/Core/vtkDataArrayPrivate.txx                |   21 +-
 Common/Core/vtkDataArrayTemplate.txx               |   15 +-
 Common/Core/vtkGarbageCollector.cxx                |   12 +-
 Common/Core/vtkGarbageCollector.h                  |    6 +-
 Common/Core/vtkIdList.h                            |    5 +-
 Common/Core/vtkIntArray.h                          |    4 -
 Common/Core/vtkLargeInteger.cxx                    |    2 +-
 Common/Core/vtkLongArray.h                         |    5 -
 Common/Core/vtkLongLongArray.h                     |    4 -
 Common/Core/vtkLookupTable.cxx                     |   39 +-
 Common/Core/vtkLookupTable.h                       |    7 +-
 Common/Core/vtkMath.cxx                            |   48 +-
 Common/Core/vtkMath.h                              |   19 +
 Common/Core/vtkOStrStreamWrapper.cxx               |    2 +-
 Common/Core/vtkObject.cxx                          |   12 +-
 Common/Core/vtkObject.h                            |    8 +-
 Common/Core/vtkObjectBase.h                        |    5 +-
 Common/Core/vtkPeriodicDataArray.h                 |  279 --
 Common/Core/vtkPeriodicDataArray.txx               |  621 ----
 Common/Core/vtkPoints.cxx                          |   59 +-
 Common/Core/vtkPoints.h                            |    6 +-
 Common/Core/vtkPoints2D.h                          |    2 +-
 Common/Core/vtkPriorityQueue.cxx                   |    2 +-
 Common/Core/vtkPriorityQueue.h                     |    4 +-
 Common/Core/vtkSMPTools.h                          |    4 +-
 Common/Core/vtkScalarsToColors.cxx                 |    2 +-
 Common/Core/vtkSetGet.h                            |   56 +-
 Common/Core/vtkShortArray.h                        |    4 -
 Common/Core/vtkStringArray.cxx                     |   15 +-
 Common/Core/vtkStringArray.h                       |    2 +-
 Common/Core/vtkTimeStamp.cxx                       |    6 +-
 Common/Core/vtkType.h                              |   32 +-
 Common/Core/vtkTypeTraits.h                        |    6 +-
 Common/Core/vtkTypedArray.h                        |    9 +
 Common/Core/vtkTypedArray.h.in                     |    5 -
 Common/Core/vtkTypedDataArray.txx                  |    4 +-
 Common/Core/vtkUnicodeStringArray.h                |    2 +-
 Common/Core/vtkUnsignedIntArray.h                  |    4 -
 Common/Core/vtkUnsignedLongArray.h                 |    6 -
 Common/Core/vtkUnsignedLongLongArray.h             |    4 -
 Common/Core/vtkUnsignedShortArray.h                |    4 -
 Common/Core/vtkUnsigned__Int64Array.h              |    6 -
 Common/Core/vtkVariant.cxx                         |    2 +-
 Common/Core/vtkVariantArray.cxx                    |   17 +-
 Common/Core/vtkVariantArray.h                      |    2 +-
 Common/Core/vtkVoidArray.cxx                       |    5 +-
 Common/Core/vtkWin32ProcessOutputWindow.cxx        |    2 +-
 Common/Core/vtkWindow.cxx                          |    2 +-
 Common/Core/vtkWindow.h                            |    9 +-
 Common/Core/vtk__Int64Array.h                      |    5 -
 Common/DataModel/CMakeLists.txt                    |    4 +-
 Common/DataModel/Testing/Cxx/CMakeLists.txt        |    9 -
 Common/DataModel/Testing/Cxx/CellLocator.cxx       |  275 ++
 Common/DataModel/Testing/Cxx/CellLocator2.cxx      |  199 ++
 Common/DataModel/Testing/Cxx/TestAMRBox.cxx        |   19 +
 Common/DataModel/Testing/Cxx/TestCellLocator.cxx   |  308 --
 .../Testing/Cxx/TestCompositeDataSets.cxx          |    2 +-
 .../Testing/Cxx/TestInterpolationDerivs.cxx        |   10 +-
 .../Testing/Cxx/TestInterpolationFunctions.cxx     |   16 +-
 .../DataModel/Testing/Cxx/TestPentagonalPrism.cxx  |  621 ----
 Common/DataModel/Testing/Cxx/TestPolyhedron0.cxx   |  114 +-
 .../Testing/Cxx/TestQuadraticPolygonFilters.cxx    |    3 +-
 .../Testing/Cxx/TestSmoothErrorMetric.cxx          |   51 +-
 Common/DataModel/Testing/Cxx/TestTriangle.cxx      |   31 -
 Common/DataModel/Testing/Cxx/UnitTestCells.cxx     | 1365 --------
 Common/DataModel/Testing/Cxx/otherCellPosition.cxx |    6 +-
 .../Testing/Data/Baseline/TestCellLocator.png.md5  |    1 -
 .../Baseline/TestKdTreeRepresentation_1.png.md5    |    1 -
 .../TestMeanValueCoordinatesInterpolation1.png.md5 |    1 -
 .../TestMeanValueCoordinatesInterpolation2.png.md5 |    1 -
 .../Baseline/TestQuadraticPolygonFilters.png.md5   |    2 +-
 .../Data/Baseline/TestSmoothErrorMetric.png.md5    |    1 -
 Common/DataModel/module.cmake                      |    2 -
 Common/DataModel/vtkAMRInformation.cxx             |    5 +-
 Common/DataModel/vtkAMRUtilities.cxx               |   74 +-
 Common/DataModel/vtkAnimationScene.cxx             |    2 +-
 Common/DataModel/vtkBiQuadraticQuad.cxx            |    9 +-
 .../vtkBiQuadraticQuadraticHexahedron.cxx          |    5 +-
 Common/DataModel/vtkBiQuadraticQuadraticWedge.cxx  |    1 -
 Common/DataModel/vtkBiQuadraticTriangle.cxx        |    2 +-
 Common/DataModel/vtkBox.cxx                        |    2 +-
 Common/DataModel/vtkCell.h                         |    8 +-
 Common/DataModel/vtkCellArray.h                    |    2 +-
 Common/DataModel/vtkCellLinks.cxx                  |    2 +-
 Common/DataModel/vtkCellLinks.h                    |    2 +-
 Common/DataModel/vtkCellLocator.h                  |   79 +-
 Common/DataModel/vtkCellTypes.cxx                  |    4 +-
 Common/DataModel/vtkCellTypes.h                    |    6 +-
 Common/DataModel/vtkColor.h                        |   79 +
 Common/DataModel/vtkCompositeDataSet.h             |    2 +-
 Common/DataModel/vtkConvexPointSet.cxx             |   12 +-
 Common/DataModel/vtkCylinder.h                     |    3 +-
 Common/DataModel/vtkDataObject.h                   |   15 +-
 Common/DataModel/vtkDataObjectTree.h               |    2 +-
 Common/DataModel/vtkDataSet.cxx                    |  362 +--
 Common/DataModel/vtkDataSet.h                      |   82 +-
 Common/DataModel/vtkDataSetAttributes.h            |   27 -
 Common/DataModel/vtkEdgeTable.cxx                  |    2 +-
 Common/DataModel/vtkEmptyCell.cxx                  |   39 +-
 Common/DataModel/vtkEmptyCell.h                    |    6 +
 Common/DataModel/vtkExplicitCell.cxx               |   37 +
 Common/DataModel/vtkExplicitCell.h                 |   75 +
 Common/DataModel/vtkFieldData.cxx                  |    9 +-
 Common/DataModel/vtkFieldData.h                    |    2 +-
 Common/DataModel/vtkGenericAttribute.h             |    2 +-
 Common/DataModel/vtkGenericAttributeCollection.cxx |    2 +-
 Common/DataModel/vtkGenericAttributeCollection.h   |    2 +-
 Common/DataModel/vtkGenericDataSet.cxx             |    2 +-
 Common/DataModel/vtkGenericDataSet.h               |    2 +-
 Common/DataModel/vtkHexagonalPrism.cxx             |    3 +-
 Common/DataModel/vtkHexahedron.cxx                 |    2 +-
 Common/DataModel/vtkHyperOctree.cxx                |    6 +-
 Common/DataModel/vtkHyperOctree.h                  |    2 +-
 Common/DataModel/vtkHyperTree.cxx                  |    6 +-
 Common/DataModel/vtkHyperTree.h                    |    2 +-
 Common/DataModel/vtkHyperTreeGrid.cxx              |    9 +-
 Common/DataModel/vtkHyperTreeGrid.h                |    2 +-
 Common/DataModel/vtkImageData.cxx                  |   13 -
 Common/DataModel/vtkImageData.h                    |    8 +-
 Common/DataModel/vtkKdTree.cxx                     |    8 +-
 Common/DataModel/vtkLine.cxx                       |    5 +-
 Common/DataModel/vtkMarchingCubesCases.h           |   21 +
 Common/DataModel/vtkMarchingSquaresCases.h         |   21 +
 Common/DataModel/vtkOverlappingAMR.cxx             |    5 +-
 Common/DataModel/vtkPentagonalPrism.cxx            |  290 +-
 Common/DataModel/vtkPentagonalPrism.h              |    8 +-
 Common/DataModel/vtkPixel.cxx                      |    2 +-
 Common/DataModel/vtkPointLocator.cxx               |    2 +-
 Common/DataModel/vtkPointSet.cxx                   |    7 +-
 Common/DataModel/vtkPointSet.h                     |    2 +-
 Common/DataModel/vtkPolyData.cxx                   |   25 +-
 Common/DataModel/vtkPolyData.h                     |    9 +-
 Common/DataModel/vtkPolyLine.cxx                   |   14 +
 Common/DataModel/vtkPolyLine.h                     |    6 +
 Common/DataModel/vtkPolyVertex.cxx                 |   17 +-
 Common/DataModel/vtkPolyVertex.h                   |    6 +
 Common/DataModel/vtkPolygon.cxx                    |   30 +-
 Common/DataModel/vtkPolygon.h                      |    2 +
 Common/DataModel/vtkPolyhedron.cxx                 |   39 +-
 Common/DataModel/vtkPyramid.cxx                    |    3 +-
 Common/DataModel/vtkQuad.cxx                       |    1 -
 Common/DataModel/vtkQuadraticHexahedron.cxx        |    5 +-
 Common/DataModel/vtkQuadraticPolygon.cxx           |    5 +-
 Common/DataModel/vtkQuadraticPyramid.cxx           |   98 +-
 Common/DataModel/vtkQuadraticPyramid.h             |    4 +-
 Common/DataModel/vtkQuadraticQuad.cxx              |    3 +
 Common/DataModel/vtkQuadraticTetra.cxx             |    4 +-
 Common/DataModel/vtkQuadraticTriangle.cxx          |    5 +-
 Common/DataModel/vtkQuadraticWedge.cxx             |    1 -
 Common/DataModel/vtkRect.h                         |   48 +
 Common/DataModel/vtkRectilinearGrid.h              |    2 +-
 Common/DataModel/vtkReebGraph.cxx                  |    6 +-
 Common/DataModel/vtkStructuredGrid.cxx             |  187 +-
 Common/DataModel/vtkStructuredGrid.h               |   50 +-
 .../vtkStructuredVisibilityConstraint.cxx          |  102 +
 .../DataModel/vtkStructuredVisibilityConstraint.h  |  178 +
 Common/DataModel/vtkTable.h                        |    2 +-
 Common/DataModel/vtkTriQuadraticHexahedron.cxx     |    4 +-
 Common/DataModel/vtkTriangle.cxx                   |  116 +-
 Common/DataModel/vtkTriangleStrip.cxx              |   15 +
 Common/DataModel/vtkTriangleStrip.h                |    6 +
 Common/DataModel/vtkUniformGrid.cxx                |  261 +-
 Common/DataModel/vtkUniformGrid.h                  |   60 +-
 Common/DataModel/vtkUniformGridAMR.cxx             |   10 +-
 Common/DataModel/vtkUnstructuredGrid.cxx           |   33 +-
 Common/DataModel/vtkUnstructuredGrid.h             |   12 +-
 .../DataModel/vtkUnstructuredGridCellIterator.cxx  |    4 +-
 Common/DataModel/vtkVector.h                       |   57 +
 Common/DataModel/vtkVertex.cxx                     |    4 +-
 Common/DataModel/vtkVoxel.cxx                      |    2 +-
 Common/DataModel/vtkWedge.cxx                      |    1 -
 Common/ExecutionModel/vtkCompositeDataPipeline.cxx |   15 +-
 .../vtkStreamingDemandDrivenPipeline.cxx           |   19 +-
 .../ExecutionModel/vtkThreadedImageAlgorithm.cxx   |    4 +-
 Common/ExecutionModel/vtkTrivialProducer.cxx       |   19 +-
 .../ExecutionModel/vtkUniformGridPartitioner.cxx   |    2 +-
 Common/Math/CMakeLists.txt                         |    6 +
 Common/Math/Testing/Cxx/CMakeLists.txt             |    8 +
 .../Math/Testing/Cxx/TestFastNumericConversion.cxx |  204 ++
 Common/Math/Testing/Cxx/TestQuaternion.cxx         |    2 +-
 Common/Math/vtkFastNumericConversion.cxx           |  119 +
 Common/Math/vtkFastNumericConversion.h             |  477 +++
 Common/Math/vtkPolynomialSolversUnivariate.cxx     |   14 +-
 Common/Misc/Testing/Cxx/UnitTestFunctionParser.cxx |    4 +-
 Common/Misc/vtkContourValues.cxx                   |   18 +-
 Common/Misc/vtkFunctionParser.cxx                  |    6 +-
 Common/Misc/vtkHeap.cxx                            |   22 +-
 Common/Misc/vtkHeap.h                              |    2 +-
 Common/Transforms/vtkIdentityTransform.cxx         |   12 +-
 Common/Transforms/vtkThinPlateSplineTransform.cxx  |    2 +-
 Common/Transforms/vtkTransform.cxx                 |    2 +-
 .../dev/changes_6.3/ghosts_and_blanking.md         |  174 -
 Documentation/dev/git/README.md                    |   38 -
 Documentation/dev/git/dashboard.md                 |   45 -
 Documentation/dev/git/data.md                      |  330 --
 Documentation/dev/git/develop.md                   |  385 ---
 Documentation/dev/git/download.md                  |   50 -
 Domains/Chemistry/Testing/Cxx/CMakeLists.txt       |    9 -
 .../Chemistry/Testing/Cxx/TestPeriodicTable.cxx    |    2 +-
 Domains/Chemistry/vtkMoleculeMapper.cxx            |    1 -
 Domains/Chemistry/vtkOpenQubeMoleculeSource.cxx    |    4 +-
 .../ChemistryOpenGL2/glsl/vtkSphereMapperVS.glsl   |   27 +-
 .../ChemistryOpenGL2/glsl/vtkStickMapperVS.glsl    |   53 +-
 Domains/ChemistryOpenGL2/vtkOpenGLMoleculeMapper.h |    2 +-
 Domains/ChemistryOpenGL2/vtkOpenGLSphereMapper.cxx |  163 +-
 Domains/ChemistryOpenGL2/vtkOpenGLSphereMapper.h   |   20 +-
 Domains/ChemistryOpenGL2/vtkOpenGLStickMapper.cxx  |  323 +-
 Domains/ChemistryOpenGL2/vtkOpenGLStickMapper.h    |   20 +-
 Examples/GUI/Cocoa/CMakeLists.txt                  |    2 +-
 Examples/GUI/Cocoa/Documentation/Instructions.rtf  |   24 +-
 Examples/GUI/Cocoa/PrefixHeader.pch                |    6 +-
 .../Cocoa/SimpleCocoaVTK.xcodeproj/project.pbxproj |  302 +-
 Examples/GUI/Qt/Events/CMakeLists.txt              |    2 +-
 Examples/GUI/Qt/FourPaneViewer/CMakeLists.txt      |    2 +-
 Examples/GUI/Qt/GraphicsView/CMakeLists.txt        |    6 +-
 .../GUI/Qt/GraphicsView/GraphLayoutViewItem.cpp    |    1 +
 Examples/GUI/Qt/GraphicsView/TreeRingViewItem.cpp  |    1 +
 Examples/GUI/Qt/GraphicsView/vtkclasses.xml        |    2 +
 Examples/GUI/Qt/GraphicsView/vtklibrary.xml        |    2 +
 Examples/GUI/Qt/ImageViewer/CMakeLists.txt         |    2 +-
 Examples/GUI/Qt/SimpleView/CMakeLists.txt          |    3 +-
 Examples/HyperTree/Cxx/Sphere/CMakeLists.txt       |    2 +-
 Examples/Infovis/Cxx/CustomLinkView/CMakeLists.txt |    2 +-
 Examples/Infovis/Cxx/EasyView/CMakeLists.txt       |    2 +-
 Examples/Infovis/Cxx/StatsView/CMakeLists.txt      |    2 +-
 Examples/Infovis/Python/vtkclasses.xml             |    2 +
 Examples/Infovis/Python/vtklibrary.xml             |    2 +
 .../SMP/Cxx/vtkOverlappingAMR2.cxx                 |    2 +-
 .../SMP/Cxx/vtkSMPMinMaxTree.cxx                   |    3 +-
 .../SMP/Cxx/vtkUniformGridAMR2.cxx                 |   10 +-
 .../Cxx/Baseline/TestFilledContours_1.png.md5      |    1 -
 .../AMR/Testing/Cxx/TestAMRGhostLayerStripping.cxx |   21 +-
 Filters/AMR/vtkAMRResampleFilter.cxx               |    5 +-
 Filters/AMR/vtkAMRSliceFilter.cxx                  |   30 +-
 Filters/AMR/vtkImageToAMR.cxx                      |    2 +-
 Filters/Core/CMakeLists.txt                        |    1 +
 Filters/Core/Testing/Cxx/CMakeLists.txt            |    3 +-
 Filters/Core/Testing/Cxx/TestGhostArray.cxx        |   81 +
 .../Testing/Cxx/TestImplicitPolyDataDistance.cxx   |  173 +-
 .../Core/Testing/Cxx/TestSMPPipelineContour.cxx    |    2 +-
 .../Baseline/TestImplicitPolyDataDistance.png.md5  |    1 -
 Filters/Core/Testing/Python/CMakeLists.txt         |    1 -
 Filters/Core/Testing/Python/probe.py               |   90 -
 Filters/Core/vtkAppendFilter.cxx                   |    5 +-
 Filters/Core/vtkAppendPolyData.cxx                 |  140 +-
 Filters/Core/vtkAppendPolyData.h                   |   16 +-
 Filters/Core/vtkCellDataToPointData.cxx            |   10 +-
 Filters/Core/vtkContourFilter.cxx                  |    2 -
 Filters/Core/vtkDelaunay2D.cxx                     |    4 +-
 Filters/Core/vtkDelaunay3D.cxx                     |    2 +-
 Filters/Core/vtkFeatureEdges.cxx                   |   21 +-
 Filters/Core/vtkGhostArray.h                       |  128 +
 Filters/Core/vtkGlyph2D.cxx                        |    8 +-
 Filters/Core/vtkGlyph3D.cxx                        |   21 +-
 Filters/Core/vtkGlyph3D.h                          |    4 +-
 Filters/Core/vtkImplicitPolyDataDistance.cxx       |   17 +-
 Filters/Core/vtkPointDataToCellData.cxx            |    4 +-
 Filters/Core/vtkProbeFilter.cxx                    |   21 +-
 Filters/Core/vtkStructuredGridAppend.cxx           |   11 +-
 Filters/Core/vtkSynchronizedTemplates3D.cxx        |   35 +-
 Filters/Extraction/vtkExtractArraysOverTime.cxx    |   13 +-
 Filters/Extraction/vtkExtractCells.cxx             |   28 +-
 Filters/Extraction/vtkExtractDataSets.cxx          |   12 +-
 Filters/Extraction/vtkExtractEdges.cxx             |    2 +-
 Filters/Extraction/vtkExtractGeometry.cxx          |    2 +-
 Filters/Extraction/vtkExtractSelectedFrustum.cxx   |    4 +-
 .../Extraction/vtkExtractSelectedThresholds.cxx    |    2 +-
 Filters/Extraction/vtkExtractVectorComponents.cxx  |    2 +-
 Filters/FlowPaths/Testing/Cxx/CMakeLists.txt       |    1 -
 .../Cxx/TestAMRInterpolatedVelocityField.cxx       |   16 +-
 .../Testing/Cxx/TestStreamTracerSurface.cxx        |  102 -
 .../Data/Baseline/TestStreamTracerSurface.png.md5  |    1 -
 .../vtkAbstractInterpolatedVelocityField.cxx       |  300 +-
 .../vtkAbstractInterpolatedVelocityField.h         |   29 -
 .../vtkCachingInterpolatedVelocityField.cxx        |  141 +-
 .../vtkCachingInterpolatedVelocityField.h          |    8 +-
 Filters/FlowPaths/vtkInterpolatedVelocityField.cxx |   17 -
 Filters/FlowPaths/vtkInterpolatedVelocityField.h   |    4 -
 Filters/FlowPaths/vtkModifiedBSPTree.cxx           |   42 +-
 Filters/FlowPaths/vtkModifiedBSPTree.h             |   44 +-
 Filters/FlowPaths/vtkParticleTracerBase.cxx        |  100 +-
 Filters/FlowPaths/vtkParticleTracerBase.h          |   21 +-
 Filters/FlowPaths/vtkStreamTracer.cxx              |  120 +-
 Filters/FlowPaths/vtkStreamTracer.h                |    9 -
 .../vtkTemporalInterpolatedVelocityField.cxx       |  165 +-
 .../vtkTemporalInterpolatedVelocityField.h         |    8 +-
 .../Cxx/BoxClipTriangulateAndInterpolate.cxx       |    2 +
 Filters/General/Testing/Cxx/TestTessellator.cxx    |    2 +-
 .../Testing/Cxx/TestYoungsMaterialInterface.cxx    |    2 +-
 .../BoxClipTriangulateAndInterpolate_1.png.md5     |    1 -
 Filters/General/Testing/Python/blankGrid.py        |    2 +-
 Filters/General/Testing/Python/splitVectors.py     |    6 -
 .../Testing/Python/testDataSetTriangleFilter.py    |    4 +-
 Filters/General/Testing/Tcl/splitVectors.tcl       |   15 +-
 .../Testing/Tcl/testDataSetTriangleFilter.tcl      |    2 +-
 Filters/General/module.cmake                       |    2 +-
 .../General/vtkApproximatingSubdivisionFilter.cxx  |   20 +
 Filters/General/vtkBlankStructuredGrid.cxx         |   29 +-
 .../General/vtkBlankStructuredGridWithImage.cxx    |   26 +-
 Filters/General/vtkCellTreeLocator.cxx             |   30 +
 Filters/General/vtkContourTriangulator.cxx         |   12 +-
 Filters/General/vtkDicer.cxx                       |    4 +-
 Filters/General/vtkDicer.h                         |    2 +-
 Filters/General/vtkGradientFilter.cxx              |   21 +
 Filters/General/vtkImageMarchingCubes.cxx          |    9 +-
 Filters/General/vtkMultiThreshold.cxx              |    2 +-
 Filters/General/vtkOBBTree.cxx                     |    2 +-
 Filters/General/vtkOBBTree.h                       |   94 +-
 Filters/General/vtkRectilinearGridToTetrahedra.cxx |   16 +-
 Filters/General/vtkTableBasedClipCases.h           |   20 +-
 Filters/General/vtkTemporalStatistics.cxx          |    3 +-
 Filters/General/vtkTessellatorFilter.cxx           |   10 +-
 Filters/Generic/module.cmake                       |    1 +
 Filters/Generic/vtkGenericGlyph3DFilter.cxx        |   15 +-
 Filters/Geometry/Testing/Cxx/CMakeLists.txt        |    1 -
 .../Testing/Cxx/TestDataSetSurfaceFieldData.cxx    |  193 --
 .../Cxx/TestStructuredAMRGridConnectivity.cxx      |   75 +-
 .../Testing/Cxx/TestStructuredGridConnectivity.cxx |   69 +-
 .../Cxx/TestUniformGridGhostDataGenerator.cxx      |    1 +
 Filters/Geometry/Testing/Python/TestGhostPoints.py |    4 +-
 Filters/Geometry/vtkDataSetSurfaceFilter.cxx       |   35 +-
 Filters/Geometry/vtkDataSetSurfaceFilter.h         |    3 +-
 Filters/Geometry/vtkGeometryFilter.cxx             |   66 +-
 Filters/Geometry/vtkGeometryFilter.h               |    4 +-
 Filters/Geometry/vtkImageDataToUniformGrid.cxx     |   39 +-
 .../Geometry/vtkStructuredAMRGridConnectivity.cxx  |   65 +-
 Filters/Geometry/vtkStructuredGridConnectivity.cxx |   55 +-
 Filters/Geometry/vtkStructuredGridConnectivity.h   |    6 -
 .../vtkStructuredGridGhostDataGenerator.cxx        |   10 +-
 .../Geometry/vtkUniformGridGhostDataGenerator.cxx  |   10 +-
 .../Geometry/vtkUnstructuredGridGeometryFilter.cxx |   16 +-
 .../Data/Baseline/TestPolyDataSilhouette_1.png.md5 |    1 -
 Filters/Hybrid/vtkGreedyTerrainDecimation.cxx      |    1 -
 Filters/Hybrid/vtkPolyDataSilhouette.cxx           |   49 +-
 Filters/Hybrid/vtkTemporalFractal.cxx              |    4 +-
 Filters/Hybrid/vtkTemporalInterpolator.cxx         |   14 +-
 Filters/Hybrid/vtkTransformToGrid.cxx              |    2 +-
 Filters/Hybrid/vtkWeightedTransformFilter.cxx      |   10 -
 ...tHyperTreeGridTernary2DFullMaterialBits.png.md5 |    2 +-
 Filters/HyperTree/module.cmake                     |    2 +-
 Filters/Matlab/vtkMatlabEngineFilter.cxx           |    6 +-
 .../Baseline/TestQuadRotationalExtrusion_1.png.md5 |    1 -
 .../Baseline/TestRotationalExtrusion_1.png.md5     |    1 -
 .../Modeling/vtkBandedPolyDataContourFilter.cxx    |    4 +-
 Filters/Modeling/vtkButterflySubdivisionFilter.cxx |    5 +-
 Filters/Modeling/vtkDijkstraGraphGeodesicPath.cxx  |    6 +-
 Filters/Modeling/vtkDijkstraImageGeodesicPath.cxx  |    4 +-
 Filters/Modeling/vtkLinearExtrusionFilter.cxx      |    2 +-
 Filters/Modeling/vtkLoopSubdivisionFilter.cxx      |   10 +-
 Filters/Parallel/CMakeLists.txt                    |    2 -
 Filters/Parallel/Testing/Cxx/CMakeLists.txt        |    5 -
 Filters/Parallel/Testing/Cxx/DistributedData.cxx   |    1 +
 .../Testing/Cxx/DistributedDataRenderPass.cxx      |    1 +
 .../Parallel/Testing/Cxx/ParallelResampling.cxx    |    1 +
 .../Testing/Cxx/TestAngularPeriodicFilter.cxx      |  145 -
 Filters/Parallel/Testing/Cxx/TransmitImageData.cxx |    1 +
 .../Testing/Cxx/TransmitImageDataRenderPass.cxx    |    1 +
 .../Testing/Cxx/TransmitRectilinearGrid.cxx        |    1 +
 .../Testing/Cxx/TransmitStructuredGrid.cxx         |    1 +
 .../Baseline/TestAngularPeriodicFilter.png.md5     |    1 -
 .../Baseline/TestAngularPeriodicFilter_1.png.md5   |    1 -
 Filters/Parallel/Testing/Python/TestCutMaterial.py |    2 +-
 .../Parallel/Testing/Python/TestExtrudePiece.py    |    8 -
 Filters/Parallel/Testing/Python/testTransmit.py    |    2 +-
 Filters/Parallel/Testing/Tcl/TestCutMaterial.tcl   |    2 +-
 Filters/Parallel/Testing/Tcl/TestExtrudePiece.tcl  |   15 +-
 Filters/Parallel/module.cmake                      |    2 -
 Filters/Parallel/vtkAngularPeriodicFilter.cxx      |  399 ---
 Filters/Parallel/vtkAngularPeriodicFilter.h        |  156 -
 Filters/Parallel/vtkCollectGraph.cxx               |    4 +-
 Filters/Parallel/vtkExtractCTHPart.cxx             |    8 +-
 Filters/Parallel/vtkExtractPolyDataPiece.cxx       |    8 +-
 .../Parallel/vtkExtractUnstructuredGridPiece.cxx   |   14 +-
 Filters/Parallel/vtkExtractUserDefinedPiece.cxx    |   11 +-
 Filters/Parallel/vtkPCellDataToPointData.cxx       |   18 +
 Filters/Parallel/vtkPKdTree.cxx                    |    2 +-
 Filters/Parallel/vtkPLinearExtrusionFilter.cxx     |   14 +
 Filters/Parallel/vtkPPolyDataNormals.cxx           |   14 +
 Filters/Parallel/vtkPSphereSource.cxx              |    2 +-
 Filters/Parallel/vtkPSphereSource.h                |    2 +-
 Filters/Parallel/vtkPeriodicFilter.cxx             |  148 -
 Filters/Parallel/vtkPeriodicFilter.h               |  124 -
 Filters/Parallel/vtkPipelineSize.cxx               |    2 -
 Filters/Parallel/vtkPipelineSize.h                 |    2 +-
 .../Parallel/vtkTransmitStructuredDataPiece.cxx    |    4 +-
 Filters/ParallelFlowPaths/module.cmake             |    2 +-
 .../ParallelFlowPaths/vtkPParticleTracerBase.cxx   |  232 +-
 Filters/ParallelFlowPaths/vtkPParticleTracerBase.h |   14 +-
 Filters/ParallelFlowPaths/vtkPStreamTracer.cxx     |   27 +-
 .../ParallelGeometry/Testing/Cxx/CMakeLists.txt    |    1 -
 .../Cxx/TestPStructuredGridConnectivity.cxx        |   14 +-
 .../Cxx/TestPUniformGridGhostDataGenerator.cxx     |    9 +
 .../Cxx/TestPUnstructuredGridConnectivity.cxx      |    4 +-
 .../TestPUnstructuredGridGhostDataGenerator.cxx    |    4 +-
 .../vtkPStructuredGridConnectivity.cxx             |    7 +-
 .../vtkPStructuredGridGhostDataGenerator.cxx       |   10 +-
 .../vtkPUniformGridGhostDataGenerator.cxx          |   10 +-
 .../vtkMemoryLimitImageDataStreamer.cxx            |    6 +-
 .../vtkMemoryLimitImageDataStreamer.h              |    2 +-
 Filters/ParallelMPI/vtkDistributedDataFilter.cxx   |  101 +-
 .../vtkStructuredImplicitConnectivity.cxx          |   14 +-
 Filters/Programmable/vtkProgrammableFilter.cxx     |   11 +-
 Filters/SMP/CMakeLists.txt                         |    1 -
 Filters/SMP/Testing/Cxx/CMakeLists.txt             |    1 -
 .../TestThreadedSynchronizedTemplatesCutter3D.cxx  |  129 -
 Filters/SMP/vtkSMPMergePoints.h                    |    4 +-
 Filters/SMP/vtkThreadedSynchronizedTemplates3D.cxx |   44 +-
 Filters/SMP/vtkThreadedSynchronizedTemplates3D.h   |    4 +-
 .../vtkThreadedSynchronizedTemplatesCutter3D.cxx   |  751 -----
 .../SMP/vtkThreadedSynchronizedTemplatesCutter3D.h |   78 -
 .../Testing/Cxx/TestCellDistanceSelector2D.cxx     |    2 +-
 Filters/Selection/module.cmake                     |    1 +
 Filters/Sources/CMakeLists.txt                     |    1 -
 Filters/Sources/Testing/Cxx/CMakeLists.txt         |    2 -
 .../Testing/Cxx/TestGlyphSource2DResolution.cxx    |  151 -
 Filters/Sources/Testing/Cxx/TestPolyLineSource.cxx |  122 -
 .../Baseline/TestGlyphSource2DResolution.png.md5   |    1 -
 .../Testing/Data/Baseline/squadViewer.png.md5      |    2 +-
 Filters/Sources/Testing/Python/CMakeLists.txt      |    5 -
 Filters/Sources/Testing/Python/OSCone.py           |    1 -
 Filters/Sources/Testing/Python/squadViewer.py      |  190 --
 Filters/Sources/Testing/Tcl/CMakeLists.txt         |   10 +-
 Filters/Sources/Testing/Tcl/Disk.tcl               |   40 +
 Filters/Sources/Testing/Tcl/OSCone.tcl             |   23 +
 Filters/Sources/Testing/Tcl/TestButtonSource.tcl   |  101 +
 Filters/Sources/Testing/Tcl/TestPlatonicSolids.tcl |  117 +
 .../Testing/Tcl/TestRegularPolygonSource.tcl       |   61 +
 Filters/Sources/Testing/Tcl/coneResolution.tcl     |   69 +
 Filters/Sources/Testing/Tcl/glyph2D.tcl            |  114 +
 Filters/Sources/module.cmake                       |    2 +-
 Filters/Sources/vtkConeSource.cxx                  |    1 -
 Filters/Sources/vtkEllipticalButtonSource.cxx      |    2 +-
 Filters/Sources/vtkGlyphSource2D.cxx               |   28 +-
 Filters/Sources/vtkGlyphSource2D.h                 |    8 -
 Filters/Sources/vtkGraphToPolyData.cxx             |    2 +-
 Filters/Sources/vtkHyperTreeGridSource.cxx         |    4 +-
 Filters/Sources/vtkParametricFunctionSource.cxx    |    3 -
 Filters/Sources/vtkPolyLineSource.cxx              |  166 -
 Filters/Sources/vtkPolyLineSource.h                |   74 -
 Filters/Sources/vtkSelectionSource.cxx             |    4 +-
 .../vtkBivariateLinearTableThreshold.cxx           |    8 +-
 Filters/Statistics/vtkContingencyStatistics.cxx    |    6 +-
 .../vtkHighestDensityRegionsStatistics.cxx         |   27 +-
 .../vtkHighestDensityRegionsStatistics.h           |   24 +-
 Filters/Statistics/vtkOrderStatistics.cxx          |    5 +-
 Filters/Statistics/vtkOrderStatistics.h            |    2 +-
 Filters/Statistics/vtkPCAStatistics.cxx            |    2 +-
 Filters/Statistics/vtkStatisticsAlgorithm.cxx      |    6 +-
 Filters/Statistics/vtkStatisticsAlgorithm.h        |    5 +-
 Filters/Statistics/vtkStreamingStatistics.h        |    3 +
 Filters/StatisticsGnuR/CMakeLists.txt              |    2 -
 Filters/StatisticsGnuR/vtkRAdapter.h               |    8 +-
 Filters/StatisticsGnuR/vtkRInterface.cxx           |    2 +-
 Filters/Texture/Testing/Python/socbal.py           |    2 +-
 Filters/Texture/Testing/Tcl/socbal.tcl             |    2 +-
 GUISupport/Qt/CMakeLists.txt                       |    4 +-
 GUISupport/Qt/QVTKInteractorAdapter.cxx            |   40 -
 GUISupport/Qt/QVTKWidget.cxx                       |   13 -
 GUISupport/Qt/Testing/Cxx/CMakeLists.txt           |    2 +-
 GUISupport/QtOpenGL/CMakeLists.txt                 |    6 +-
 GUISupport/QtOpenGL/QVTKGraphicsItem.cxx           |   13 -
 GUISupport/QtOpenGL/QVTKWidget2.cxx                |   30 +-
 GUISupport/QtOpenGL/QVTKWidget2.h                  |    3 -
 GUISupport/QtOpenGL/module.cmake                   |    2 +-
 GUISupport/QtSQL/CMakeLists.txt                    |    4 +-
 GUISupport/QtSQL/Testing/Cxx/CMakeLists.txt        |    2 +-
 GUISupport/QtWebkit/CMakeLists.txt                 |    2 +-
 .../Data/Baseline/TestLabeledGeoView2D.png.md5     |    2 +-
 .../Data/Baseline/TestLabeledGeoView2D_1.png.md5   |    1 +
 .../Data/Baseline/TestLabeledGeoView2D_2.png.md5   |    1 +
 .../Data/Baseline/TestLabeledGeoView2D_3.png.md5   |    1 +
 .../Data/Baseline/TestLabeledGeoView2D_4.png.md5   |    1 +
 .../Data/Baseline/TestLabeledGeoView2D_5.png.md5   |    1 +
 Geovis/Core/module.cmake                           |    1 +
 Geovis/Core/vtkGlobeSource.cxx                     |   26 +-
 IO/ADIOS/ADIOSScalar.cxx                           |   62 +-
 IO/ADIOS/ADIOSScalar.h                             |    6 +-
 IO/ADIOS/ADIOSVarInfo.cxx                          |   81 +-
 IO/ADIOS/ADIOSVarInfo.h                            |   26 +-
 IO/ADIOS/ADIOSWriter.cxx                           |   30 +-
 IO/ADIOS/Testing/Cxx/TestADIOSSphereWR.cxx         |    4 +-
 IO/ADIOS/vtkADIOSReader.cxx                        |   38 +-
 IO/ADIOS/vtkADIOSUtilities.h                       |    4 +-
 IO/ADIOS/vtkADIOSWriter.cxx                        |  109 +-
 IO/ADIOS/vtkADIOSWriter.h                          |   21 +
 IO/AMR/vtkAMRBaseReader.cxx                        |   56 +-
 IO/AMR/vtkAMRBaseReader.h                          |   11 -
 IO/AMR/vtkAMREnzoReader.h                          |    5 -
 IO/AMR/vtkAMRFlashReader.h                         |    5 -
 IO/Core/CMakeLists.txt                             |    2 -
 IO/Core/vtkAbstractPolyDataReader.cxx              |   33 -
 IO/Core/vtkAbstractPolyDataReader.h                |   54 -
 IO/Core/vtkSortFileNames.cxx                       |    8 +-
 IO/Core/vtkWriter.cxx                              |    3 +-
 IO/EnSight/vtkEnSightMasterServerReader.cxx        |    2 +-
 IO/EnSight/vtkEnSightReader.cxx                    |   17 +-
 IO/EnSight/vtkEnSightReader.h                      |    2 -
 IO/EnSight/vtkGenericEnSightReader.cxx             |   49 +-
 IO/EnSight/vtkGenericEnSightReader.h               |    6 -
 IO/Exodus/CMakeLists.txt                           |   10 +-
 IO/Exodus/Testing/Python/CMakeLists.txt            |    1 -
 IO/Exodus/Testing/Python/TestExodusWithNaN.py      |   20 -
 IO/Exodus/vtkExodusIIReader.cxx                    |   55 +-
 IO/Exodus/vtkExodusIIReader.h                      |   22 +-
 IO/Exodus/vtkExodusIIWriter.cxx                    |  298 +-
 IO/Exodus/vtkExodusIIWriter.h                      |    2 -
 IO/Exodus/vtkModelMetadata.cxx                     |   12 -
 IO/Exodus/vtkModelMetadata.h                       |    4 -
 IO/Export/Testing/Cxx/CMakeLists.txt               |   51 +-
 IO/Export/Testing/Cxx/TestRIBExporter.cxx          |  328 --
 IO/Export/Testing/Cxx/UnitTestRIB.cxx              |  401 ---
 .../Baseline/TestContextGL2PS-rasterRef.png.md5    |    2 +-
 .../Baseline/TestContextGL2PS-rasterRef_1.png.md5  |    1 +
 .../Testing/Data/Baseline/TestContextGL2PS.png.md5 |    2 +-
 .../TestGL2PSExporterRaster-rasterRef.png.md5      |    2 +-
 .../TestGL2PSExporterRaster-rasterRef_1.png.md5    |    2 +-
 .../TestGL2PSExporterRaster-rasterRef_2.png.md5    |    1 +
 .../Data/Baseline/TestGL2PSExporterRaster.png.md5  |    2 +-
 .../TestGL2PSExporterRasterExclusion.png.md5       |    2 +-
 .../TestGL2PSExporterVector-rasterRef.png.md5      |    2 +-
 .../TestGL2PSExporterVector-rasterRef_1.png.md5    |    2 +-
 .../TestGL2PSExporterVector-rasterRef_2.png.md5    |    1 +
 .../TestGL2PSExporterVector-rasterRef_3.png.md5    |    1 +
 .../Data/Baseline/TestGL2PSExporterVector.png.md5  |    2 +-
 ...TestGL2PSExporterVolumeRaster-rasterRef.png.md5 |    2 +-
 ...stGL2PSExporterVolumeRaster-rasterRef_1.png.md5 |    1 +
 ...stGL2PSExporterVolumeRaster-rasterRef_2.png.md5 |    1 +
 ...stGL2PSExporterVolumeRaster-rasterRef_3.png.md5 |    1 +
 ...stGL2PSExporterVolumeRaster-rasterRef_4.png.md5 |    1 +
 .../Baseline/TestGL2PSExporterVolumeRaster.png.md5 |    2 +-
 .../TestGL2PSExporterVolumeRaster_1.png.md5        |    2 +-
 .../TestGL2PSLabeledDataMapper-rasterRef.png.md5   |    2 +-
 .../Baseline/TestGL2PSLabeledDataMapper.png.md5    |    2 +-
 .../Baseline/TestGL2PSTextActor-rasterRef.png.md5  |    2 +-
 .../Data/Baseline/TestGL2PSTextActor.png.md5       |    2 +-
 .../TestGL2PSTextActor3D-rasterRef.png.md5         |    2 +-
 .../Baseline/TestLinePlotGL2PS-rasterRef.png.md5   |    2 +-
 .../Data/Baseline/TestLinePlotGL2PS.png.md5        |    2 +-
 .../Data/Baseline/TestLinePlotGL2PS_1.png.md5      |    2 +-
 .../Testing/Data/Baseline/TestRIBExporter.tif.md5  |    1 -
 .../TestStackedPlotGL2PS-rasterRef.png.md5         |    2 +-
 .../TestStackedPlotGL2PS-rasterRef_1.png.md5       |    1 +
 .../Data/Baseline/TestStackedPlotGL2PS.png.md5     |    2 +-
 IO/Export/Testing/Data/Input/bozo.sl               |   35 -
 IO/Export/Testing/Data/Input/dented.sl             |   25 -
 IO/Export/module.cmake                             |    1 +
 IO/Export/vtkGL2PSExporter.cxx                     |   39 +-
 IO/Export/vtkOOGLExporter.cxx                      |  104 +
 IO/Export/vtkRIBExporter.cxx                       |  111 +-
 IO/Export/vtkRIBExporter.h                         |    8 +-
 IO/Export/vtkRIBLight.h                            |    5 +-
 IO/Export/vtkRIBProperty.cxx                       |  132 +-
 IO/Export/vtkRIBProperty.h                         |   50 +-
 IO/Export/vtkX3DExporter.cxx                       |    9 +-
 IO/FFMPEG/vtkFFMPEGWriter.cxx                      |    2 -
 IO/GDAL/CMakeLists.txt                             |    2 +-
 IO/GDAL/vtkGDAL.h                                  |    6 +-
 IO/GDAL/vtkGDALRasterReader.cxx                    |   36 +-
 IO/Geometry/CMakeLists.txt                         |    8 +
 .../Cxx/TestIncrementalOctreePointLocator.cxx      |    5 -
 IO/Geometry/Testing/Cxx/TestWindBladeReader.cxx    |    1 -
 IO/Geometry/module.cmake                           |    1 +
 IO/Geometry/vtkAVSucdReader.cxx                    |   48 +-
 IO/Geometry/vtkCGMWriter.cxx                       |    1 +
 IO/Geometry/vtkChacoReader.cxx                     |   24 +-
 IO/Geometry/vtkMFIXReader.cxx                      |   22 +-
 IO/Geometry/vtkMFIXReader.h                        |    5 +
 IO/Geometry/vtkMultiBlockPLOT3DReader.cxx          | 2819 ++++++++++++++++
 IO/Geometry/vtkMultiBlockPLOT3DReader.h            |  353 ++
 IO/Geometry/vtkMultiBlockPLOT3DReaderInternals.cxx |  395 +++
 IO/Geometry/vtkMultiBlockPLOT3DReaderInternals.h   |   72 +
 IO/Geometry/vtkOBJReader.h                         |   13 +-
 IO/Geometry/vtkOpenFOAMReader.cxx                  |   92 +-
 IO/Geometry/vtkParticleReader.cxx                  |    4 -
 IO/Geometry/vtkPlot3DMetaReader.cxx                |  501 +++
 IO/Geometry/vtkPlot3DMetaReader.h                  |  138 +
 IO/Geometry/vtkSTLReader.cxx                       |    6 +-
 IO/Geometry/vtkSTLReader.h                         |   12 +-
 IO/Geometry/vtkSTLWriter.cxx                       |    1 -
 IO/Geometry/vtkWindBladeReader.cxx                 |   32 +-
 IO/Image/Testing/Cxx/CMakeLists.txt                |    4 -
 IO/Image/Testing/Cxx/TestCompressedTIFFReader.cxx  |   66 -
 IO/Image/Testing/Cxx/TestNIFTIReaderWriter.cxx     |   76 +-
 .../Data/Baseline/TestCompressedTIFFReader.png.md5 |    1 -
 IO/Image/vtkDICOMImageReader.cxx                   |   27 +-
 IO/Image/vtkImageImport.cxx                        |    2 +-
 IO/Image/vtkImageReader2.cxx                       |   14 +-
 IO/Image/vtkMetaImageReader.cxx                    |   12 -
 IO/Image/vtkNIFTIImageReader.cxx                   |  107 +-
 IO/Image/vtkNIFTIImageReader.h                     |   14 -
 IO/Image/vtkNIFTIImageWriter.cxx                   |   98 +-
 IO/Image/vtkNIFTIImageWriter.h                     |   14 -
 IO/Image/vtkTIFFReader.cxx                         |   86 +-
 IO/Image/vtkTIFFWriter.cxx                         |  323 +-
 IO/Image/vtkTIFFWriter.h                           |   11 -
 IO/Image/vtkVolume16Reader.cxx                     |    4 +-
 IO/Import/CMakeLists.txt                           |    7 -
 IO/Import/Testing/Cxx/CMakeLists.txt               |   30 -
 IO/Import/Testing/Cxx/TestOBJImporter.cxx          |   99 -
 IO/Import/Testing/Data/Input/boxes_1.obj.md5       |    1 -
 IO/Import/Testing/Data/Input/boxes_1.obj.mtl.md5   |    1 -
 IO/Import/Testing/Data/Input/boxes_2.obj.md5       |    1 -
 IO/Import/Testing/Data/Input/boxes_2.obj.mtl.md5   |    1 -
 .../Testing/Data/Input/boxes_3_no_mtl.obj.md5      |    1 -
 .../Data/Input/boxes_4_mtl_no_texture.obj.md5      |    1 -
 .../Data/Input/boxes_4_mtl_no_texture.obj.mtl.md5  |    1 -
 IO/Import/Testing/Data/Input/flare.jpg.md5         |    1 -
 IO/Import/Testing/Data/Input/map1024.png.md5       |    1 -
 IO/Import/module.cmake                             |    3 -
 IO/Import/vtk3DSImporter.cxx                       |    8 +-
 IO/Import/vtkOBJImporter.cxx                       |  986 ------
 IO/Import/vtkOBJImporter.h                         |   90 -
 IO/Import/vtkOBJImporterInternals.cxx              |  323 --
 IO/Import/vtkOBJImporterInternals.h                |  159 -
 IO/Infovis/vtkDIMACSGraphWriter.cxx                |   23 +-
 IO/Infovis/vtkDelimitedTextReader.cxx              |   12 +
 IO/Infovis/vtkFixedWidthTextReader.cxx             |    2 +-
 IO/Infovis/vtkNewickTreeWriter.cxx                 |   23 +-
 IO/LSDyna/CMakeLists.txt                           |   10 +-
 IO/LSDyna/private/LSDynaFamily.cxx                 |    6 +-
 IO/LSDyna/private/LSDynaFamily.h                   |    2 +-
 IO/LSDyna/vtkLSDynaPart.cxx                        |   10 +-
 IO/LSDyna/vtkLSDynaPartCollection.cxx              |    2 +-
 IO/LSDyna/vtkLSDynaReader.cxx                      |    1 -
 IO/Legacy/Testing/Cxx/CMakeLists.txt               |    4 +-
 .../Testing/Cxx/TestLegacyGhostCellsImport.cxx     |   80 -
 .../Baseline/TestLegacyGhostCellsImport.png.md5    |    1 -
 IO/Legacy/vtkDataReader.cxx                        |   70 +-
 IO/Legacy/vtkDataReader.h                          |   22 +-
 IO/Legacy/vtkDataWriter.cxx                        |   23 +-
 IO/Legacy/vtkLegacyReaderVersion.h                 |   24 -
 IO/Legacy/vtkStructuredGridReader.cxx              |   19 +-
 IO/Legacy/vtkStructuredGridWriter.cxx              |   22 +
 IO/Legacy/vtkStructuredGridWriter.h                |    1 +
 .../Testing/Data/Baseline/TestMNITagPoints.png.md5 |    2 +-
 IO/MINC/vtkMNITagPointWriter.cxx                   |    5 +-
 IO/MINC/vtkMNITransformReader.cxx                  |    7 +-
 IO/MPIImage/Testing/Cxx/ParallelIso.cxx            |    2 +-
 IO/MPIParallel/CMakeLists.txt                      |   53 +-
 .../Testing/Cxx/TestPWindBladeReader.cxx           |    1 -
 IO/MPIParallel/Testing/Python/CMakeLists.txt       |    3 -
 IO/MPIParallel/Testing/Python/Plot3DMPIIO.py       |   61 -
 IO/MPIParallel/module.cmake                        |    4 +-
 IO/MPIParallel/vtkMPIMultiBlockPLOT3DReader.cxx    |  345 --
 IO/MPIParallel/vtkMPIMultiBlockPLOT3DReader.h      |   73 -
 IO/NetCDF/vtkMPASReader.cxx                        |    5 +-
 IO/NetCDF/vtkNetCDFCAMReader.cxx                   |  177 +-
 IO/NetCDF/vtkNetCDFCAMReader.h                     |    8 +-
 IO/NetCDF/vtkNetCDFCFReader.cxx                    |   10 -
 IO/PLY/vtkPLY.cxx                                  |    4 +-
 IO/PLY/vtkPLYReader.h                              |   13 +-
 IO/PLY/vtkPLYWriter.cxx                            |    7 +-
 IO/Parallel/CMakeLists.txt                         |    8 -
 .../Testing/Python/TestPDataSetReaderGrid.py       |    8 +-
 IO/Parallel/module.cmake                           |    2 -
 IO/Parallel/vtkEnSightWriter.cxx                   |    9 +-
 IO/Parallel/vtkMultiBlockPLOT3DReader.cxx          | 3391 --------------------
 IO/Parallel/vtkMultiBlockPLOT3DReader.h            |  372 ---
 IO/Parallel/vtkMultiBlockPLOT3DReaderInternals.cxx |  411 ---
 IO/Parallel/vtkMultiBlockPLOT3DReaderInternals.h   |   92 -
 IO/Parallel/vtkPDataSetReader.cxx                  |   39 +-
 IO/Parallel/vtkPImageWriter.cxx                    |    6 +-
 IO/Parallel/vtkPImageWriter.h                      |    2 +-
 IO/Parallel/vtkPlot3DMetaReader.cxx                |  513 ---
 IO/Parallel/vtkPlot3DMetaReader.h                  |  138 -
 IO/ParallelExodus/vtkPExodusIIReader.cxx           |   41 +-
 IO/ParallelExodus/vtkPExodusIIReader.h             |    9 +
 IO/ParallelNetCDF/vtkPNetCDFPOPReader.cxx          |    7 +-
 IO/ParallelXML/vtkXMLPMultiBlockDataWriter.cxx     |   54 +-
 IO/ParallelXML/vtkXMLPMultiBlockDataWriter.h       |   20 -
 IO/PostgreSQL/vtkPostgreSQLDatabase.cxx            |    5 +-
 IO/PostgreSQL/vtkPostgreSQLQuery.cxx               |    7 +-
 IO/SQL/Testing/Data/Input/simple_table.vtk.md5     |    2 +-
 IO/SQL/vtkSQLGraphReader.h                         |    2 +-
 IO/SQL/vtkSQLQuery.cxx                             |    5 +-
 IO/SQL/vtkSQLiteQuery.cxx                          |    5 +-
 IO/SQL/vtkTableToSQLiteWriter.cxx                  |   10 +-
 IO/VPIC/vtkVPICReader.cxx                          |   11 +-
 IO/Video/vtkMILVideoSource.cxx                     |    7 +-
 IO/Video/vtkVideoSource.cxx                        |    2 +-
 IO/Video/vtkWin32VideoSource.cxx                   |   19 +-
 IO/XML/Testing/Cxx/CMakeLists.txt                  |    2 -
 IO/XML/Testing/Cxx/TestXMLGhostCellsImport.cxx     |  125 -
 IO/XML/Testing/Cxx/TestXMLToString.cxx             |   21 -
 .../Data/Baseline/TestXMLGhostCellsImport.png.md5  |    1 -
 IO/XML/vtkXMLCompositeDataReader.h                 |   11 +
 IO/XML/vtkXMLDataReader.cxx                        |   69 +-
 IO/XML/vtkXMLDataReader.h                          |   18 +-
 IO/XML/vtkXMLPDataReader.cxx                       |   12 +-
 IO/XML/vtkXMLPolyDataReader.cxx                    |   14 +-
 IO/XML/vtkXMLReader.cxx                            |   36 +-
 IO/XML/vtkXMLReader.h                              |    7 +-
 IO/XML/vtkXMLReaderVersion.h                       |   24 -
 IO/XML/vtkXMLStructuredDataReader.cxx              |   40 +-
 IO/XML/vtkXMLStructuredDataReader.h                |    8 +-
 IO/XML/vtkXMLStructuredDataWriter.cxx              |    7 -
 IO/XML/vtkXMLUniformGridAMRReader.cxx              |    6 +-
 IO/XML/vtkXMLUniformGridAMRReader.h                |    6 +
 IO/XML/vtkXMLUnstructuredDataReader.cxx            |   10 +-
 IO/XML/vtkXMLUnstructuredDataWriter.cxx            |   16 +-
 IO/XML/vtkXMLWriter.cxx                            |   66 +-
 IO/XML/vtkXMLWriter.h                              |    8 -
 IO/XML/vtkXMLWriterC.cxx                           |   12 +-
 IO/XMLParser/vtkXMLDataParser.cxx                  |   14 +-
 IO/Xdmf2/README-VTK.txt                            |    3 +-
 IO/Xdmf2/Testing/Cxx/CMakeLists.txt                |    8 +-
 .../Testing/Cxx/TestTemporalXdmfReaderWriter.cxx   |  105 -
 IO/Xdmf2/Testing/Cxx/XdmfTestVTKIO.cxx             |    8 +-
 IO/Xdmf2/vtkXdmfHeavyData.cxx                      |  123 +-
 IO/Xdmf2/vtkXdmfHeavyData.h                        |    8 +-
 IO/Xdmf2/vtkXdmfReader.cxx                         |   37 +-
 IO/Xdmf2/vtkXdmfReader.h                           |   21 -
 IO/Xdmf2/vtkXdmfReaderInternal.cxx                 |   42 +-
 IO/Xdmf2/vtkXdmfReaderInternal.h                   |   21 +-
 IO/Xdmf2/vtkXdmfWriter.cxx                         |  208 +-
 IO/Xdmf2/vtkXdmfWriter.h                           |   28 -
 Imaging/Color/vtkImageMapToWindowLevelColors.cxx   |    9 +-
 .../Core/Testing/Python/TestChangeInformation.py   |    1 -
 Imaging/Core/Testing/Python/resampledTexture.py    |    2 +-
 Imaging/Core/Testing/Tcl/TestChangeInformation.tcl |    1 -
 Imaging/Core/vtkImageBSplineInterpolator.cxx       |    5 +-
 Imaging/Core/vtkImageBlend.cxx                     |   12 +-
 Imaging/Core/vtkImageInterpolator.cxx              |    2 -
 Imaging/Core/vtkImageInterpolatorInternals.h       |    2 +-
 Imaging/Core/vtkImageMapToColors.cxx               |    3 -
 Imaging/Core/vtkImageResize.cxx                    |    3 -
 Imaging/Core/vtkImageReslice.cxx                   |    6 +-
 Imaging/Core/vtkImageStencilData.cxx               |   11 -
 Imaging/Core/vtkImageStencilData.h                 |    1 -
 Imaging/Core/vtkImageStencilIterator.txx           |    1 -
 Imaging/General/vtkImageMedian3D.cxx               |  133 +-
 Imaging/General/vtkImageSlabReslice.h              |    7 +
 Imaging/Hybrid/CMakeLists.txt                      |    1 -
 .../Data/Baseline/TestCheckerboardSplatter.png.md5 |    1 -
 Imaging/Hybrid/Testing/Python/CMakeLists.txt       |    1 -
 .../Testing/Python/TestCheckerboardSplatter.py     |   71 -
 Imaging/Hybrid/vtkCheckerboardSplatter.cxx         |  929 ------
 Imaging/Hybrid/vtkCheckerboardSplatter.h           |  298 --
 Imaging/Hybrid/vtkGaussianSplatter.cxx             |  157 +-
 Imaging/Hybrid/vtkGaussianSplatter.h               |   46 +-
 Imaging/Hybrid/vtkSampleFunction.cxx               |  385 +--
 Imaging/Hybrid/vtkSampleFunction.h                 |    6 +
 Imaging/Hybrid/vtkSliceCubes.cxx                   |    2 +-
 .../vtkImageNonMaximumSuppression.cxx              |    2 +-
 Imaging/Morphological/vtkImageSeedConnectivity.h   |   12 +-
 Imaging/Morphological/vtkImageSkeleton2D.cxx       |   16 +-
 Imaging/Statistics/vtkImageHistogram.cxx           |    4 +-
 Imaging/Statistics/vtkImageHistogramStatistics.cxx |   12 +-
 Infovis/BoostGraphAlgorithms/module.cmake          |    1 +
 Infovis/Core/vtkThresholdTable.cxx                 |    5 -
 .../vtkCirclePackFrontChainLayoutStrategy.cxx      |    4 +-
 Infovis/Layout/vtkCosmicTreeLayoutStrategy.cxx     |    2 +-
 Interaction/Widgets/CMakeLists.txt                 |    4 -
 Interaction/Widgets/Testing/Cxx/CMakeLists.txt     |   12 -
 .../Widgets/Testing/Cxx/ImagePlaneWidget.cxx       |    2 +-
 .../Widgets/Testing/Cxx/TerrainPolylineEditor.cxx  |  519 +++
 .../Widgets/Testing/Cxx/TestButtonWidget.cxx       |    2 +-
 .../Testing/Cxx/TestImageActorContourWidget.cxx    |    2 +-
 .../Testing/Cxx/TestImplicitPlaneWidget2b.cxx      |    2 +-
 .../Testing/Cxx/TestResliceCursorWidget2.cxx       |    7 +-
 .../Testing/Cxx/TestResliceCursorWidget3.cxx       |    6 +-
 .../Widgets/Testing/Cxx/TestSplineWidget.cxx       |    2 +-
 .../Widgets/Testing/Cxx/WidgetTestingMacros.h      |   48 +-
 .../Testing/Cxx/vtkPolyLineRepresentationTest1.cxx |  216 --
 .../Widgets/Testing/Cxx/vtkPolyLineWidgetTest1.cxx |   21 -
 .../Testing/Cxx/vtkSplineRepresentationTest1.cxx   |    9 +-
 .../Data/Baseline/TestBrokenLineWidget.png.md5     |    2 +-
 .../Data/Baseline/TestBrokenLineWidget_1.png.md5   |    2 +-
 .../Data/Baseline/TestBrokenLineWidget_2.png.md5   |    2 +-
 .../Data/Baseline/TestBrokenLineWidget_3.png.md5   |    1 -
 .../Baseline/TestCellCentersPointPlacer.png.md5    |    2 +-
 .../Baseline/TestOrientationMarkerWidget_3.png.md5 |    1 -
 .../Baseline/TestOrientationMarkerWidget_4.png.md5 |    1 -
 .../Data/Baseline/TestParallelopipedWidget.png.md5 |    2 +-
 .../Baseline/TestRectilinearWipeWidget_2.png.md5   |    1 -
 .../Data/Baseline/TestScalarBarWidget.png.md5      |    2 +-
 .../Testing/Data/Baseline/TestSphereWidget.png.md5 |    2 +-
 .../Data/Baseline/TestSphereWidget_1.png.md5       |    2 +-
 .../Data/Baseline/TestSphereWidget_2.png.md5       |    2 +-
 .../Data/Baseline/TestSphereWidget_3.png.md5       |    2 +-
 .../Data/Baseline/TestSphereWidget_4.png.md5       |    1 -
 .../Testing/Data/Baseline/TestSplineWidget.png.md5 |    2 +-
 .../Data/Baseline/TestSplineWidget_1.png.md5       |    1 +
 .../Testing/Data/Baseline/TestTextWidget.png.md5   |    2 +-
 Interaction/Widgets/module.cmake                   |    2 +-
 .../Widgets/vtkBiDimensionalRepresentation2D.cxx   |   10 +-
 Interaction/Widgets/vtkCaptionRepresentation.cxx   |   11 +-
 Interaction/Widgets/vtkCurveRepresentation.cxx     |  993 ------
 Interaction/Widgets/vtkCurveRepresentation.h       |  264 --
 .../vtkEllipsoidTensorProbeRepresentation.cxx      |    1 -
 Interaction/Widgets/vtkImageTracerWidget.cxx       |   25 +
 Interaction/Widgets/vtkImageTracerWidget.h         |    8 +
 .../Widgets/vtkImplicitPlaneRepresentation.cxx     |   10 -
 Interaction/Widgets/vtkPolyLineRepresentation.cxx  |  297 --
 Interaction/Widgets/vtkPolyLineRepresentation.h    |   93 -
 Interaction/Widgets/vtkPolyLineWidget.cxx          |  249 --
 Interaction/Widgets/vtkPolyLineWidget.h            |   73 -
 Interaction/Widgets/vtkResliceCursor.cxx           |  185 +-
 Interaction/Widgets/vtkResliceCursorPicker.cxx     |    4 +-
 Interaction/Widgets/vtkScalarBarRepresentation.cxx |   85 +-
 Interaction/Widgets/vtkScalarBarRepresentation.h   |   13 -
 Interaction/Widgets/vtkSphereRepresentation.cxx    |   38 +-
 Interaction/Widgets/vtkSphereRepresentation.h      |    4 +-
 Interaction/Widgets/vtkSplineRepresentation.cxx    |  940 +++++-
 Interaction/Widgets/vtkSplineRepresentation.h      |  184 +-
 Interaction/Widgets/vtkTextRepresentation.cxx      |   16 +-
 .../Data/Baseline/TestPolyDataPieces.png.md5       |    2 +-
 Parallel/Core/Testing/Python/TestPolyDataPieces.py |    7 +-
 Parallel/Core/Testing/Tcl/TestPolyDataPieces.tcl   |    8 +-
 Parallel/Core/vtkCommunicator.cxx                  |  152 +-
 Parallel/Core/vtkCommunicator.h                    |  520 +--
 Parallel/Core/vtkMultiProcessController.cxx        |   14 +-
 Parallel/Core/vtkMultiProcessController.h          |  632 ----
 Parallel/Core/vtkMultiProcessStream.cxx            |    7 +-
 Parallel/Core/vtkSocketCommunicator.cxx            |    7 +-
 Parallel/Core/vtkSubGroup.cxx                      |    5 +-
 .../Testing/Cxx/ExerciseMultiProcessController.cxx |    8 +-
 .../Cxx/TestDistributedDataShadowMapPass.cxx       |    1 +
 Parallel/MPI/vtkMPICommunicator.cxx                |    7 +-
 Parallel/MPI4Py/CMakeLists.txt                     |    1 -
 README.html                                        |  565 ++++
 README.md                                          |   73 -
 Remote/CMakeLists.txt                              |    7 -
 Remote/PoissonReconstruction.remote.cmake          |   10 -
 Remote/README.md                                   |   20 -
 Remote/vtkAddon.remote.cmake                       |    9 -
 Remote/vtkDICOM.remote.cmake                       |   10 -
 .../Testing/Cxx/TestCornerAnnotation.cxx           |   56 +-
 .../Data/Baseline/TestBarChartActor.png.md5        |    2 +-
 .../Data/Baseline/TestBarChartActor_1.png.md5      |    1 -
 .../Testing/Data/Baseline/TestCaptionActor.png.md5 |    2 +-
 .../Data/Baseline/TestCaptionActor2D.png.md5       |    2 +-
 .../Data/Baseline/TestCaptionActor_1.png.md5       |    2 +-
 .../Data/Baseline/TestCaptionActor_2.png.md5       |    1 +
 .../Data/Baseline/TestCornerAnnotation.png.md5     |    2 +-
 .../Data/Baseline/TestLegendBoxActor.png.md5       |    2 +-
 .../Data/Baseline/TestLegendBoxActor_1.png.md5     |    1 -
 .../Data/Baseline/TestLegendScaleActor.png.md5     |    2 +-
 .../Data/Baseline/TestPieChartActor.png.md5        |    2 +-
 .../Data/Baseline/TestPieChartActor_1.png.md5      |    1 -
 .../Testing/Data/Baseline/TestScalarBar.png.md5    |    2 +-
 .../Testing/Data/Baseline/TestScalarBar_1.png.md5  |    2 +-
 .../Testing/Data/Baseline/TestScalarBar_2.png.md5  |    2 +-
 .../Data/Baseline/TestSpiderPlotActor.png.md5      |    2 +-
 .../Testing/Data/Baseline/TestXYPlotActor.png.md5  |    2 +-
 .../Data/Baseline/TestXYPlotActor_1.png.md5        |    1 -
 .../Data/Baseline/TestXYPlotActor_2.png.md5        |    1 -
 .../Testing/Data/Baseline/cubeAxes.png.md5         |    2 +-
 .../Testing/Data/Baseline/cubeAxes_1.png.md5       |    1 -
 .../Testing/Data/Baseline/xyPlot.png.md5           |    2 +-
 .../Testing/Data/Baseline/xyPlot2.png.md5          |    2 +-
 .../Testing/Data/Baseline/xyPlot2_1.png.md5        |    2 +-
 .../Testing/Data/Baseline/xyPlot3.png.md5          |    2 +-
 .../Testing/Data/Baseline/xyPlot3_1.png.md5        |    1 +
 .../Testing/Data/Baseline/xyPlot4.png.md5          |    2 +-
 .../Testing/Data/Baseline/xyPlot4_1.png.md5        |    2 +-
 Rendering/Annotation/Testing/Tcl/cubeAxes.tcl      |    4 +-
 Rendering/Annotation/module.cmake                  |    4 +-
 Rendering/Annotation/vtkAxisActor.cxx              |   13 +-
 Rendering/Annotation/vtkAxisActor2D.cxx            |    6 +-
 Rendering/Annotation/vtkBarChartActor.cxx          |    1 -
 Rendering/Annotation/vtkCornerAnnotation.cxx       |  146 +-
 Rendering/Annotation/vtkCornerAnnotation.h         |   13 +-
 Rendering/Annotation/vtkCubeAxesActor.cxx          |    6 +-
 Rendering/Annotation/vtkLegendBoxActor.cxx         |   25 +-
 Rendering/Annotation/vtkLegendScaleActor.cxx       |    7 -
 Rendering/Annotation/vtkPieChartActor.cxx          |    2 +-
 Rendering/Annotation/vtkScalarBarActor.cxx         |    7 +-
 Rendering/Annotation/vtkScalarBarActorInternal.h   |    1 +
 Rendering/Annotation/vtkSpiderPlotActor.cxx        |    1 +
 Rendering/Annotation/vtkXYPlotActor.cxx            |   23 +-
 Rendering/Context2D/vtkContext2D.cxx               |   26 -
 Rendering/Context2D/vtkContext2D.h                 |   10 -
 Rendering/Context2D/vtkContextDevice2D.h           |    9 -
 Rendering/Context2D/vtkContextDevice3D.h           |    7 -
 Rendering/Context2D/vtkContextMouseEvent.h         |    4 +
 Rendering/Context2D/vtkContextScene.cxx            |   11 -
 Rendering/Context2D/vtkContextScene.h              |    8 -
 .../ContextOpenGL/vtkOpenGLContextDevice2D.cxx     |   90 +-
 Rendering/ContextOpenGL/vtkOpenGLContextDevice2D.h |   13 +-
 .../vtkOpenGLContextDevice2DPrivate.h              |   11 +-
 .../ContextOpenGL/vtkOpenGLContextDevice3D.cxx     |   38 -
 Rendering/ContextOpenGL/vtkOpenGLContextDevice3D.h |    6 -
 Rendering/ContextOpenGL2/CMakeLists.txt            |    2 +
 .../ContextOpenGL2/vtkOpenGL2ContextDevice2D.cxx   |  189 ++
 .../ContextOpenGL2/vtkOpenGL2ContextDevice2D.h     |   85 +
 Rendering/ContextOpenGL2/vtkOpenGLContextActor.cxx |   47 +-
 Rendering/ContextOpenGL2/vtkOpenGLContextActor.h   |    4 -
 .../ContextOpenGL2/vtkOpenGLContextBufferId.cxx    |    7 +
 .../ContextOpenGL2/vtkOpenGLContextDevice2D.cxx    | 1259 +++-----
 .../ContextOpenGL2/vtkOpenGLContextDevice2D.h      |   47 +-
 .../vtkOpenGLContextDevice2DPrivate.h              |   37 +-
 .../ContextOpenGL2/vtkOpenGLContextDevice3D.cxx    |  512 +--
 .../ContextOpenGL2/vtkOpenGLContextDevice3D.h      |   53 -
 Rendering/Core/Testing/Cxx/CMakeLists.txt          |   11 +-
 Rendering/Core/Testing/Cxx/RGrid.cxx               |   44 +-
 .../TestColorByStringArrayDefaultLookupTable.cxx   |    5 -
 .../Core/Testing/Cxx/TestColorTransferFunction.cxx |   50 -
 .../Testing/Cxx/TestCompositePolyDataMapper2.cxx   |    2 +-
 .../Cxx/TestCompositePolyDataMapper2Scalars.cxx    |  168 -
 .../Core/Testing/Cxx/TestGlyph3DMapperPicking.cxx  |    2 +-
 .../Core/Testing/Cxx/TestLabeledContourMapper.cxx  |   29 +-
 .../TestLabeledContourMapperWithActorMatrix.cxx    |  127 -
 Rendering/Core/Testing/Cxx/TestOSConeCxx.cxx       |    1 -
 .../Core/Testing/Cxx/TestOrderedTriangulator.cxx   |    6 +-
 .../Core/Testing/Data/Baseline/ScalarBar.png.md5   |    2 +-
 .../TestCompositePolyDataMapper2Scalars.png.md5    |    1 -
 .../TestCompositePolyDataMapper2Scalars_1.png.md5  |    1 -
 .../Testing/Data/Baseline/TestEdgeFlags_1.png.md5  |    1 -
 .../Data/Baseline/TestLabeledContourMapper.png.md5 |    2 +-
 ...TestLabeledContourMapperWithActorMatrix.png.md5 |    1 -
 .../Data/Baseline/TestLeaderActor2D.png.md5        |    2 +-
 .../TestTranslucentLUTAlphaBlending.png.md5        |    2 +-
 .../TestTranslucentLUTTextureAlphaBlending.png.md5 |    2 +-
 Rendering/Core/Testing/Data/Baseline/cells.png.md5 |    2 +-
 Rendering/Core/Testing/Python/cells.py             |   22 +-
 Rendering/Core/Testing/Tcl/CMakeLists.txt          |    1 +
 Rendering/Core/Testing/Tcl/TestGLSLShader.tcl      |   38 +
 .../Tcl/TestGenericVertexAttributesGLSL.tcl        |   78 +
 .../Core/Testing/Tcl/TestParallelCoordinates.tcl   |   46 +
 Rendering/Core/Testing/Tcl/cells.tcl               |  752 +++++
 Rendering/Core/module.cmake                        |    1 -
 Rendering/Core/vtkColorTransferFunction.cxx        |   38 +-
 Rendering/Core/vtkCoordinate.cxx                   |   11 +-
 Rendering/Core/vtkGraphMapper.cxx                  |   21 +-
 Rendering/Core/vtkHardwareSelector.cxx             |   67 +-
 Rendering/Core/vtkHardwareSelector.h               |   28 +-
 Rendering/Core/vtkImageActor.cxx                   |    6 +-
 Rendering/Core/vtkImageSlice.cxx                   |    7 +-
 Rendering/Core/vtkImageSliceMapper.cxx             |    9 +-
 Rendering/Core/vtkInteractorEventRecorder.cxx      |   67 +-
 Rendering/Core/vtkInteractorEventRecorder.h        |    5 -
 Rendering/Core/vtkInteractorStyle.cxx              |   14 +-
 Rendering/Core/vtkLabeledContourMapper.cxx         |  460 +--
 Rendering/Core/vtkLabeledContourMapper.h           |   37 +-
 Rendering/Core/vtkMapper.cxx                       |  122 +-
 Rendering/Core/vtkMapper.h                         |   13 +-
 Rendering/Core/vtkPainterDeviceAdapter.h           |   38 +
 Rendering/Core/vtkPointGaussianMapper.cxx          |    3 -
 Rendering/Core/vtkPointGaussianMapper.h            |   18 +-
 Rendering/Core/vtkProp.h                           |    8 +
 Rendering/Core/vtkProp3D.cxx                       |   36 +-
 Rendering/Core/vtkRenderWindow.cxx                 |   56 +-
 Rendering/Core/vtkRenderWindow.h                   |   53 +-
 Rendering/Core/vtkRenderer.cxx                     |   19 +-
 Rendering/Core/vtkRenderer.h                       |   29 +-
 Rendering/Core/vtkStringToImage.h                  |    8 +-
 Rendering/Core/vtkTextActor.cxx                    |   68 +-
 Rendering/Core/vtkTextActor.h                      |    1 -
 Rendering/Core/vtkTextActor3D.cxx                  |   57 +-
 Rendering/Core/vtkTextActor3D.h                    |   11 +-
 Rendering/Core/vtkTextMapper.cxx                   |  162 +-
 Rendering/Core/vtkTextMapper.h                     |   40 +-
 Rendering/Core/vtkTextProperty.h                   |    4 +-
 Rendering/Core/vtkTextPropertyCollection.h         |    4 +-
 Rendering/Core/vtkTextRenderer.cxx                 |    4 +
 Rendering/Core/vtkTextRenderer.h                   |   46 +-
 Rendering/Core/vtkTexture.h                        |    6 -
 Rendering/Core/vtkWindowToImageFilter.cxx          |  171 +-
 Rendering/External/CMakeLists.txt                  |    8 -
 Rendering/External/Testing/Cxx/CMakeLists.txt      |    2 +-
 .../External/Testing/Cxx/TestGLUTRenderWindow.cxx  |   46 +-
 .../Data/Baseline/TestGLUTRenderWindow.png.md5     |    2 +-
 Rendering/External/module.cmake                    |   15 +-
 Rendering/External/vtkExternalLight.cxx            |  151 -
 Rendering/External/vtkExternalLight.h              |  205 --
 Rendering/External/vtkExternalOpenGLCamera.cxx     |   22 +-
 Rendering/External/vtkExternalOpenGLCamera.h       |    4 +-
 .../External/vtkExternalOpenGLRenderWindow.cxx     |   25 -
 Rendering/External/vtkExternalOpenGLRenderWindow.h |   27 +-
 Rendering/External/vtkExternalOpenGLRenderer.cxx   |  390 +--
 Rendering/External/vtkExternalOpenGLRenderer.h     |   39 +-
 Rendering/FreeType/Testing/Cxx/CMakeLists.txt      |   20 +-
 .../FreeType/Testing/Cxx/TestFTStringToPath.cxx    |    6 +-
 .../FreeType/Testing/Cxx/TestFontDPIScaling.cxx    |  225 --
 .../Testing/Cxx/TestFreeTypeTextMapper.cxx         |   15 -
 .../Testing/Cxx/TestFreeTypeTextMapperNoMath.cxx   |   15 -
 Rendering/FreeType/Testing/Cxx/TestTextActor.cxx   |   21 -
 Rendering/FreeType/Testing/Cxx/TestTextActor3D.cxx |   21 -
 Rendering/FreeType/Testing/Cxx/TestTextMapper.cxx  |  145 -
 .../Data/Baseline/OverlayTextOnImage.png.md5       |    2 +-
 .../Data/Baseline/TestFTStringToPath.png.md5       |    2 +-
 .../Data/Baseline/TestFontDPIScaling.png.md5       |    1 -
 .../Data/Baseline/TestFreeTypeTextMapper.png.md5   |    2 +-
 .../Baseline/TestFreeTypeTextMapperNoMath.png.md5  |    2 +-
 .../TestMathTextFreeTypeTextRenderer.png.md5       |    2 +-
 .../TestMathTextFreeTypeTextRendererNoMath.png.md5 |    2 +-
 .../Testing/Data/Baseline/TestTextActor.png.md5    |    2 +-
 .../Baseline/TestTextActor3DAlphaBlending.png.md5  |    2 +-
 .../TestTextActor3DAlphaBlending_1.png.md5         |    1 -
 .../Baseline/TestTextActor3DDepthPeeling.png.md5   |    2 +-
 .../Baseline/TestTextActor3DDepthPeeling_1.png.md5 |    1 -
 .../Baseline/TestTextActorAlphaBlending.png.md5    |    2 +-
 .../Baseline/TestTextActorDepthPeeling.png.md5     |    2 +-
 .../Testing/Data/Baseline/TestTextMapper.png.md5   |    1 -
 .../Testing/Data/Baseline/multiLineText.png.md5    |    2 +-
 .../Testing/Data/Baseline/multiLineText_1.png.md5  |    1 -
 Rendering/FreeType/module.cmake                    |    9 +-
 Rendering/FreeType/vtkFreeTypeStringToImage.cxx    |   35 +-
 Rendering/FreeType/vtkFreeTypeStringToImage.h      |    8 +-
 Rendering/FreeType/vtkFreeTypeTools.cxx            |  593 ++--
 Rendering/FreeType/vtkFreeTypeTools.h              |   55 +-
 Rendering/FreeType/vtkFreeTypeUtilities.cxx        |   56 +-
 Rendering/FreeType/vtkFreeTypeUtilities.h          |    7 +
 .../FreeType/vtkMathTextFreeTypeTextRenderer.cxx   |   98 +-
 .../FreeType/vtkMathTextFreeTypeTextRenderer.h     |    9 +-
 Rendering/FreeType/vtkMathTextUtilities.cxx        |    2 +-
 Rendering/FreeType/vtkMathTextUtilities.h          |   19 +-
 .../FreeType/vtkTextRendererStringToImage.cxx      |   33 +-
 Rendering/FreeType/vtkTextRendererStringToImage.h  |    8 +-
 Rendering/FreeType/vtkVectorText.cxx               | 1453 ++++-----
 .../Baseline/TestSystemFontRendering_4.png.md5     |    1 -
 Rendering/FreeTypeOpenGL/CMakeLists.txt            |   15 +
 Rendering/FreeTypeOpenGL/module.cmake              |   15 +
 .../FreeTypeOpenGL/vtkOpenGLFreeTypeTextMapper.cxx |  614 ++++
 .../FreeTypeOpenGL/vtkOpenGLFreeTypeTextMapper.h   |   78 +
 Rendering/FreeTypeOpenGL2/CMakeLists.txt           |   15 +
 Rendering/FreeTypeOpenGL2/module.cmake             |   20 +
 .../vtkOpenGLFreeTypeTextMapper.cxx                |  609 ++++
 .../FreeTypeOpenGL2/vtkOpenGLFreeTypeTextMapper.h  |   78 +
 Rendering/GL2PS/vtkGL2PSContextDevice2D.cxx        |   14 +-
 Rendering/GL2PS/vtkGL2PSUtilities.cxx              |    9 +-
 Rendering/LIC/Testing/Cxx/TestImageDataLIC2D.cxx   |    5 +-
 .../LIC/Testing/Cxx/vtkSurfaceLICTestDriver.cxx    |    1 +
 Rendering/LIC/vtkImageDataLIC2D.cxx                |   55 +-
 Rendering/LIC/vtkImageDataLIC2D.h                  |    2 -
 Rendering/LIC/vtkLineIntegralConvolution2D.cxx     |    6 +-
 Rendering/LIC/vtkStructuredGridLIC2D.cxx           |    2 +-
 Rendering/LIC/vtkSurfaceLICPainter.cxx             |   22 +-
 Rendering/LICOpenGL2/CMakeLists.txt                |   62 -
 Rendering/LICOpenGL2/Testing/Cxx/CMakeLists.txt    |  374 ---
 .../LICOpenGL2/Testing/Cxx/TestImageDataLIC2D.cxx  |  404 ---
 .../LICOpenGL2/Testing/Cxx/TestImageDataLIC2D.h    |   24 -
 .../Testing/Cxx/TestStructuredGridLIC2DXSlice.cxx  |   55 -
 .../Testing/Cxx/TestStructuredGridLIC2DYSlice.cxx  |   54 -
 .../Testing/Cxx/TestStructuredGridLIC2DZSlice.cxx  |   54 -
 .../LICOpenGL2/Testing/Cxx/TestSurfaceLIC.cxx      |  252 --
 Rendering/LICOpenGL2/Testing/Cxx/TestSurfaceLIC.h  |   20 -
 .../Cxx/vtkStructuredGridLIC2DTestDriver.cxx       |  335 --
 .../Testing/Cxx/vtkStructuredGridLIC2DTestDriver.h |   26 -
 .../Testing/Cxx/vtkSurfaceLICTestDriver.cxx        |  397 ---
 .../Testing/Cxx/vtkSurfaceLICTestDriver.h          |   61 -
 .../Data/Baseline/TestImageDataLIC2D.png.md5       |    1 -
 .../Data/Baseline/TestImageDataLIC2D_1.png.md5     |    1 -
 .../Baseline/TestStructuredGridLIC2DXSlice.png.md5 |    1 -
 .../TestStructuredGridLIC2DXSlice_1.png.md5        |    1 -
 .../Baseline/TestStructuredGridLIC2DYSlice.png.md5 |    1 -
 .../TestStructuredGridLIC2DYSlice_1.png.md5        |    1 -
 .../Baseline/TestStructuredGridLIC2DZSlice.png.md5 |    1 -
 .../TestStructuredGridLIC2DZSlice_1.png.md5        |    1 -
 .../Testing/Data/Baseline/TestSurfaceLIC.png.md5   |    1 -
 ...SurfaceLICCurvedContrastEnhancedBlended.png.md5 |    1 -
 ...CurvedContrastEnhancedBlendedSmallGrain.png.md5 |    1 -
 ...dContrastEnhancedColorBlendedSmallGrain.png.md5 |    1 -
 ...trastEnhancedColorBlendedSmallGrainMask.png.md5 |    1 -
 ...edContrastEnhancedColorMappedSmallGrain.png.md5 |    1 -
 ...ntrastEnhancedColorMappedSmallGrainMask.png.md5 |    1 -
 ...tSurfaceLICCurvedContrastEnhancedMapped.png.md5 |    1 -
 ...CCurvedContrastEnhancedMappedSmallGrain.png.md5 |    1 -
 ...stEnhancedMappedSmallVectorNormalizeOff.png.md5 |    1 -
 ...LICCurvedContrastEnhancedSmallGrainMask.png.md5 |    1 -
 .../Baseline/TestSurfaceLICCurvedDefaults.png.md5  |    1 -
 .../TestSurfaceLICCurvedDefaultsColor.png.md5      |    1 -
 ...faceLICCurvedEnhancedVectorNormalizeOff.png.md5 |    1 -
 ...faceLICMultiBlockContrastEnhancedPerlin.png.md5 |    1 -
 .../TestSurfaceLICPlanarContrastEnhanced.png.md5   |    1 -
 .../Baseline/TestSurfaceLICPlanarDefaults.png.md5  |    1 -
 .../TestSurfaceLICPlanarVectorNormalizeOff.png.md5 |    1 -
 ...anarVectorNormalizeOffMediumGrainPerlin.png.md5 |    1 -
 ...narVectorNormalizeOffMediumGrainUniform.png.md5 |    1 -
 Rendering/LICOpenGL2/module.cmake                  |   20 -
 .../LICOpenGL2/vtkCompositeSurfaceLICMapper.cxx    |  553 ----
 .../LICOpenGL2/vtkCompositeSurfaceLICMapper.h      |  152 -
 Rendering/LICOpenGL2/vtkImageDataLIC2D.cxx         |  686 ----
 Rendering/LICOpenGL2/vtkImageDataLIC2D.h           |  140 -
 .../LICOpenGL2/vtkLineIntegralConvolution2D.cxx    | 2073 ------------
 .../LICOpenGL2/vtkLineIntegralConvolution2D.h      |  400 ---
 .../vtkLineIntegralConvolution2D_AA.glsl           |   95 -
 .../vtkLineIntegralConvolution2D_AAH.glsl          |   63 -
 .../vtkLineIntegralConvolution2D_AAV.glsl          |   63 -
 .../vtkLineIntegralConvolution2D_CE.glsl           |   45 -
 .../vtkLineIntegralConvolution2D_EE.glsl           |   80 -
 .../vtkLineIntegralConvolution2D_LIC0.glsl         |   96 -
 .../vtkLineIntegralConvolution2D_LICI.glsl         |  128 -
 .../vtkLineIntegralConvolution2D_LICN.glsl         |   39 -
 .../vtkLineIntegralConvolution2D_VT.glsl           |   38 -
 Rendering/LICOpenGL2/vtkPainterCommunicator.h      |   72 -
 Rendering/LICOpenGL2/vtkPixelTransfer.cxx          |   32 -
 Rendering/LICOpenGL2/vtkPixelTransfer.h            |  233 --
 Rendering/LICOpenGL2/vtkStructuredGridLIC2D.cxx    |  780 -----
 Rendering/LICOpenGL2/vtkStructuredGridLIC2D.h      |  163 -
 .../LICOpenGL2/vtkStructuredGridLIC2D_fs.glsl      |  165 -
 Rendering/LICOpenGL2/vtkSurfaceLICComposite.cxx    |  425 ---
 Rendering/LICOpenGL2/vtkSurfaceLICComposite.h      |  270 --
 Rendering/LICOpenGL2/vtkSurfaceLICMapper.cxx       | 3340 -------------------
 Rendering/LICOpenGL2/vtkSurfaceLICMapper.h         |  524 ---
 Rendering/LICOpenGL2/vtkSurfaceLICMapper_CE.glsl   |  112 -
 Rendering/LICOpenGL2/vtkSurfaceLICMapper_DCpy.glsl |   44 -
 Rendering/LICOpenGL2/vtkSurfaceLICMapper_SC.glsl   |  209 --
 Rendering/LICOpenGL2/vtkTextureIO.cxx              |  174 -
 Rendering/LICOpenGL2/vtkTextureIO.h                |   86 -
 .../Data/Baseline/TestDynamic2DLabelMapper.png.md5 |    2 +-
 .../Data/Baseline/TestLabelPlacementMapper.png.md5 |    2 +-
 .../Baseline/TestLabelPlacementMapper2D.png.md5    |    2 +-
 .../Baseline/TestLabelPlacementMapper2D_1.png.md5  |    2 +-
 .../Baseline/TestLabelPlacementMapper2D_2.png.md5  |    1 +
 ...estLabelPlacementMapperCoincidentPoints.png.md5 |    2 +-
 .../Testing/Data/Baseline/TestLabelPlacer.png.md5  |    2 +-
 .../Data/Baseline/TestLabelPlacer2D.png.md5        |    2 +-
 .../Data/Baseline/TestLabelPlacer2D_1.png.md5      |    1 +
 .../Data/Baseline/TestLabelPlacer2D_2.png.md5      |    1 +
 .../Data/Baseline/TestLabelPlacer2D_3.png.md5      |    1 +
 .../TestLabelPlacerCoincidentPoints.png.md5        |    2 +-
 .../Testing/Data/Baseline/labeledContours.png.md5  |    2 +-
 .../Data/Baseline/labeledContours_1.png.md5        |    1 +
 .../Data/Baseline/labeledContours_2.png.md5        |    1 +
 .../Data/Baseline/labeledContours_3.png.md5        |    1 +
 .../Testing/Data/Baseline/labeledMesh.png.md5      |    2 +-
 .../Testing/Data/Baseline/labeledMesh_1.png.md5    |    1 +
 Rendering/Label/module.cmake                       |    1 +
 Rendering/Label/vtkDynamic2DLabelMapper.cxx        |   33 +-
 Rendering/Label/vtkFreeTypeLabelRenderStrategy.cxx |   19 +-
 Rendering/Label/vtkFreeTypeLabelRenderStrategy.h   |    4 +-
 Rendering/Label/vtkLabelHierarchy.cxx              |   19 +-
 Rendering/Label/vtkLabelHierarchyPrivate.h         |   11 +-
 Rendering/Label/vtkLabelPlacementMapper.cxx        |   16 +-
 Rendering/Label/vtkLabelPlacementMapper.h          |    6 -
 Rendering/Label/vtkLabelPlacer.cxx                 |   10 +-
 Rendering/Label/vtkLabeledDataMapper.cxx           |   12 +-
 Rendering/Label/vtkLabeledTreeMapDataMapper.cxx    |   20 +-
 Rendering/Matplotlib/Testing/Cxx/CMakeLists.txt    |    2 -
 .../Testing/Cxx/TestGL2PSFontDPIScaling.cxx        |  244 --
 .../Testing/Cxx/TestGL2PSMathTextScaling.cxx       |   12 +-
 .../Testing/Cxx/TestScalarBarCombinatorics.cxx     |    2 +-
 .../Matplotlib/Testing/Cxx/TestStringToPath.cxx    |    4 +-
 .../TestGL2PSFontDPIScaling-rasterRef.png.md5      |    1 -
 .../Data/Baseline/TestGL2PSFontDPIScaling.png.md5  |    1 -
 .../Data/Baseline/TestGL2PSMathTextOutput.png.md5  |    2 +-
 .../Baseline/TestGL2PSMathTextOutput_1.png.md5     |    1 +
 .../TestGL2PSMathTextScaling-rasterRef.png.md5     |    2 +-
 .../Data/Baseline/TestGL2PSMathTextScaling.png.md5 |    2 +-
 .../Baseline/TestGL2PSMathTextScaling_1.png.md5    |    1 +
 .../Baseline/TestIndexedLookupScalarBar.png.md5    |    2 +-
 .../Baseline/TestScalarBarCombinatorics.png.md5    |    2 +-
 .../Testing/Data/Fonts/DejaVuSans.ttf.md5          |    1 -
 Rendering/Matplotlib/module.cmake                  |    2 +-
 .../Matplotlib/vtkMatplotlibMathTextUtilities.cxx  |  139 +-
 .../Matplotlib/vtkMatplotlibMathTextUtilities.h    |   44 +-
 Rendering/OpenGL/CMakeLists.txt                    |    3 -
 Rendering/OpenGL/Testing/Cxx/CMakeLists.txt        |    1 +
 .../OpenGL/Testing/Cxx/LoadOpenGLExtension.cxx     |    4 +-
 Rendering/OpenGL/Testing/Cxx/TestValuePasses.cxx   |    2 +-
 Rendering/OpenGL/Testing/Cxx/TimeRenderer.cxx      |    4 +-
 .../Data/Baseline/TestFreetypeTextMapper.png.md5   |    2 +-
 .../Baseline/TestFreetypeTextMapperBigger.png.md5  |    2 +-
 .../Data/Baseline/TestFreetypeTextOverlay.png.md5  |    2 +-
 .../Testing/Python/TestFreetypeTextMapper.py       |    2 +-
 .../Testing/Python/TestFreetypeTextMapperBigger.py |    2 +-
 .../Testing/Python/TestFreetypeTextOverlay.py      |    2 +-
 .../OpenGL/Testing/Tcl/TestFreetypeTextMapper.tcl  |    2 +-
 .../Testing/Tcl/TestFreetypeTextMapperBigger.tcl   |    2 +-
 .../OpenGL/Testing/Tcl/TestFreetypeTextOverlay.tcl |    2 +-
 Rendering/OpenGL/module.cmake                      |    1 +
 Rendering/OpenGL/vtkCarbonRenderWindow.cxx         |    3 +
 Rendering/OpenGL/vtkCocoaGLView.h                  |   17 +-
 Rendering/OpenGL/vtkCocoaGLView.mm                 |   65 +-
 Rendering/OpenGL/vtkCocoaRenderWindow.mm           |    8 +-
 Rendering/OpenGL/vtkCocoaRenderWindowInteractor.mm |    6 +-
 Rendering/OpenGL/vtkDataTransferHelper.h           |    2 +-
 Rendering/OpenGL/vtkOSOpenGLRenderWindow.cxx       |    7 +-
 Rendering/OpenGL/vtkOpenGLGlyph3DMapper.cxx        |   11 +-
 Rendering/OpenGL/vtkOpenGLImageMapper.cxx          |    5 +-
 Rendering/OpenGL/vtkOpenGLLabeledContourMapper.h   |    6 +-
 Rendering/OpenGL/vtkOpenGLPainterDeviceAdapter.cxx |   96 +
 Rendering/OpenGL/vtkOpenGLPainterDeviceAdapter.h   |   36 +
 Rendering/OpenGL/vtkOpenGLRenderWindow.cxx         |   76 +-
 Rendering/OpenGL/vtkOpenGLRenderWindow.h           |   14 +
 Rendering/OpenGL/vtkOpenGLRenderer.cxx             |   13 +-
 Rendering/OpenGL/vtkOpenGLState.cxx                |   20 +-
 Rendering/OpenGL/vtkShadowMapBakerPass.cxx         |   20 +-
 Rendering/OpenGL/vtkTDxMacDevice.cxx               |    4 +-
 Rendering/OpenGL/vtkTDxWinDevice.cxx               |    8 +-
 Rendering/OpenGL/vtkUniformVariables.cxx           |   15 +-
 Rendering/OpenGL/vtkValuePainter.cxx               |    1 -
 Rendering/OpenGL/vtkWin32OpenGLRenderWindow.cxx    |   10 +-
 Rendering/OpenGL/vtkWin32OpenGLRenderWindow.h      |    2 -
 Rendering/OpenGL/vtkXOpenGLRenderWindow.cxx        |   21 +-
 Rendering/OpenGL/vtkXRenderWindowTclInteractor.cxx |    2 +-
 Rendering/OpenGL2/CMakeLists.txt                   |   59 +-
 .../Testing/Cxx/TestPointGaussianMapper.cxx        |   87 +-
 Rendering/OpenGL2/Testing/Cxx/TestVBOPLYMapper.cxx |    6 +-
 .../Data/Baseline/TestPointGaussianMapper.png.md5  |    2 +-
 Rendering/OpenGL2/glsl/readme.txt                  |   49 -
 .../OpenGL2/glsl/vtkDepthPeelingPassFinalFS.glsl   |    7 +-
 .../glsl/vtkDepthPeelingPassIntermediateFS.glsl    |   23 +-
 Rendering/OpenGL2/glsl/vtkGaussianBlurPassFS.glsl  |    5 +-
 Rendering/OpenGL2/glsl/vtkGlyph3DVS.glsl           |   65 -
 Rendering/OpenGL2/glsl/vtkPointGaussianVS.glsl     |   19 +-
 Rendering/OpenGL2/glsl/vtkPolyData2DFS.glsl        |   45 -
 Rendering/OpenGL2/glsl/vtkPolyData2DVS.glsl        |   48 -
 Rendering/OpenGL2/glsl/vtkPolyDataFS.glsl          |   78 -
 Rendering/OpenGL2/glsl/vtkPolyDataVS.glsl          |   58 -
 Rendering/OpenGL2/glsl/vtkPolyDataWideLineGS.glsl  |   96 -
 .../glsl/vtkSobelGradientMagnitudePass1FS.glsl     |    3 -
 .../glsl/vtkSobelGradientMagnitudePass2FS.glsl     |    9 +-
 Rendering/OpenGL2/glsl/vtkTextureObjectFS.glsl     |    5 +-
 .../OpenGL2/glsl/vtkglGlyph3DVSFragmentLit.glsl    |   65 +
 Rendering/OpenGL2/glsl/vtkglPolyData2DFS.glsl      |   33 +
 Rendering/OpenGL2/glsl/vtkglPolyData2DVS.glsl      |   46 +
 .../OpenGL2/glsl/vtkglPolyDataFSHeadlight.glsl     |   80 +
 .../OpenGL2/glsl/vtkglPolyDataFSLightKit.glsl      |  100 +
 .../OpenGL2/glsl/vtkglPolyDataFSNoLighting.glsl    |   58 +
 .../glsl/vtkglPolyDataFSPositionalLights.glsl      |  139 +
 .../OpenGL2/glsl/vtkglPolyDataVSFragmentLit.glsl   |   63 +
 .../OpenGL2/glsl/vtkglPolyDataVSNoLighting.glsl    |   51 +
 Rendering/OpenGL2/vtkCameraPass.cxx                |    5 +-
 Rendering/OpenGL2/vtkCocoaGLView.h                 |   17 +-
 Rendering/OpenGL2/vtkCocoaGLView.mm                |   65 +-
 Rendering/OpenGL2/vtkCocoaRenderWindow.mm          |   18 +-
 .../OpenGL2/vtkCocoaRenderWindowInteractor.mm      |    6 +-
 Rendering/OpenGL2/vtkCompositePolyDataMapper2.cxx  |  323 +-
 Rendering/OpenGL2/vtkCompositePolyDataMapper2.h    |   25 +-
 Rendering/OpenGL2/vtkDataTransferHelper.cxx        |  588 ----
 Rendering/OpenGL2/vtkDataTransferHelper.h          |  216 --
 Rendering/OpenGL2/vtkDepthPeelingPass.cxx          |  166 +-
 Rendering/OpenGL2/vtkDepthPeelingPass.h            |   11 +-
 Rendering/OpenGL2/vtkEGLRenderWindow.cxx           |    2 -
 Rendering/OpenGL2/vtkFrameBufferObject.cxx         |   24 +-
 Rendering/OpenGL2/vtkFrameBufferObject.h           |    8 +-
 Rendering/OpenGL2/vtkFrameBufferObject2.cxx        |  731 -----
 Rendering/OpenGL2/vtkFrameBufferObject2.h          |  315 --
 Rendering/OpenGL2/vtkGaussianBlurPass.cxx          |   22 +-
 Rendering/OpenGL2/vtkGaussianBlurPass.h            |    9 +-
 .../OpenGL2/vtkGenericCompositePolyDataMapper2.cxx |   88 +-
 .../OpenGL2/vtkGenericCompositePolyDataMapper2.h   |   18 +-
 Rendering/OpenGL2/vtkGenericOpenGLRenderWindow.cxx |  230 --
 Rendering/OpenGL2/vtkGenericOpenGLRenderWindow.h   |  126 -
 Rendering/OpenGL2/vtkIOSGLView.h                   |   70 +
 Rendering/OpenGL2/vtkIOSGLView.mm                  |  431 +++
 Rendering/OpenGL2/vtkIOSRenderWindow.mm            |    3 +-
 Rendering/OpenGL2/vtkImageProcessingPass.cxx       |    3 +-
 Rendering/OpenGL2/vtkOSOpenGLRenderWindow.cxx      |    7 +-
 Rendering/OpenGL2/vtkOpenGLActor.cxx               |   16 +-
 Rendering/OpenGL2/vtkOpenGLActor.h                 |    7 +
 Rendering/OpenGL2/vtkOpenGLBufferObject.cxx        |  151 -
 Rendering/OpenGL2/vtkOpenGLBufferObject.h          |  142 -
 Rendering/OpenGL2/vtkOpenGLCamera.cxx              |    2 +-
 Rendering/OpenGL2/vtkOpenGLError.h.in              |    9 -
 Rendering/OpenGL2/vtkOpenGLGlyph3DHelper.cxx       |  336 +-
 Rendering/OpenGL2/vtkOpenGLGlyph3DHelper.h         |   46 +-
 Rendering/OpenGL2/vtkOpenGLGlyph3DMapper.cxx       |    7 +-
 Rendering/OpenGL2/vtkOpenGLHardwareSelector.cxx    |   31 -
 Rendering/OpenGL2/vtkOpenGLHardwareSelector.h      |    2 -
 Rendering/OpenGL2/vtkOpenGLHelper.cxx              |   43 -
 Rendering/OpenGL2/vtkOpenGLHelper.h                |   47 -
 Rendering/OpenGL2/vtkOpenGLImageMapper.cxx         |    8 -
 Rendering/OpenGL2/vtkOpenGLImageMapper.h           |    5 -
 Rendering/OpenGL2/vtkOpenGLImageSliceMapper.cxx    |   31 +-
 Rendering/OpenGL2/vtkOpenGLImageSliceMapper.h      |    1 +
 Rendering/OpenGL2/vtkOpenGLIndexBufferObject.cxx   |  526 ---
 Rendering/OpenGL2/vtkOpenGLIndexBufferObject.h     |  117 -
 .../OpenGL2/vtkOpenGLLabeledContourMapper.cxx      |  174 -
 Rendering/OpenGL2/vtkOpenGLLabeledContourMapper.h  |   63 -
 Rendering/OpenGL2/vtkOpenGLPointGaussianMapper.cxx |  531 +--
 Rendering/OpenGL2/vtkOpenGLPointGaussianMapper.h   |    8 +-
 Rendering/OpenGL2/vtkOpenGLPolyDataMapper.cxx      | 2082 ++++--------
 Rendering/OpenGL2/vtkOpenGLPolyDataMapper.h        |  195 +-
 Rendering/OpenGL2/vtkOpenGLPolyDataMapper2D.cxx    |  572 +---
 Rendering/OpenGL2/vtkOpenGLPolyDataMapper2D.h      |   54 +-
 Rendering/OpenGL2/vtkOpenGLProperty.cxx            |    2 +-
 Rendering/OpenGL2/vtkOpenGLRenderUtilities.cxx     |  100 -
 Rendering/OpenGL2/vtkOpenGLRenderUtilities.h       |   59 -
 Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx        |  305 +-
 Rendering/OpenGL2/vtkOpenGLRenderWindow.h          |   44 +-
 Rendering/OpenGL2/vtkOpenGLRenderer.cxx            |    8 +-
 Rendering/OpenGL2/vtkOpenGLShaderCache.cxx         |  212 +-
 Rendering/OpenGL2/vtkOpenGLShaderCache.h           |   33 +-
 Rendering/OpenGL2/vtkOpenGLTexture.cxx             |    3 +-
 Rendering/OpenGL2/vtkOpenGLVertexArrayObject.cxx   |  446 ---
 Rendering/OpenGL2/vtkOpenGLVertexArrayObject.h     |   90 -
 Rendering/OpenGL2/vtkOpenGLVertexBufferObject.cxx  |  246 --
 Rendering/OpenGL2/vtkOpenGLVertexBufferObject.h    |   78 -
 Rendering/OpenGL2/vtkRenderbuffer.cxx              |   46 +-
 Rendering/OpenGL2/vtkShader.cxx                    |   24 +-
 Rendering/OpenGL2/vtkShader.h                      |    9 +-
 Rendering/OpenGL2/vtkShaderProgram.cxx             |  137 +-
 Rendering/OpenGL2/vtkShaderProgram.h               |   28 -
 .../OpenGL2/vtkSobelGradientMagnitudePass.cxx      |   35 +-
 Rendering/OpenGL2/vtkSobelGradientMagnitudePass.h  |   11 +-
 Rendering/OpenGL2/vtkTextureObject.cxx             |  349 +-
 Rendering/OpenGL2/vtkTextureObject.h               |   39 +-
 Rendering/OpenGL2/vtkTextureUnitManager.cxx        |   44 +-
 Rendering/OpenGL2/vtkTextureUnitManager.h          |   14 +-
 Rendering/OpenGL2/vtkWin32OpenGLRenderWindow.cxx   |  162 +-
 Rendering/OpenGL2/vtkWin32OpenGLRenderWindow.h     |    2 -
 .../vtkWin32OpenGLRenderWindowInteractor.cxx       | 1068 ++++++
 .../OpenGL2/vtkWin32OpenGLRenderWindowInteractor.h |  158 +
 .../OpenGL2/vtkWin32RenderWindowInteractor.cxx     | 1068 ------
 Rendering/OpenGL2/vtkWin32RenderWindowInteractor.h |  158 -
 Rendering/OpenGL2/vtkXOpenGLRenderWindow.cxx       |  339 +-
 .../OpenGL2/vtkXOpenGLRenderWindowInteractor.cxx   |  901 ++++++
 .../OpenGL2/vtkXOpenGLRenderWindowInteractor.h     |  199 ++
 Rendering/OpenGL2/vtkXRenderWindowInteractor.cxx   |  901 ------
 Rendering/OpenGL2/vtkXRenderWindowInteractor.h     |  199 --
 Rendering/OpenGL2/vtkglBufferObject.cxx            |  133 +
 Rendering/OpenGL2/vtkglBufferObject.h              |  129 +
 Rendering/OpenGL2/vtkglVBOHelper.cxx               |  707 ++++
 Rendering/OpenGL2/vtkglVBOHelper.h                 |  151 +
 Rendering/OpenGL2/vtkglVertexArrayObject.cxx       |  447 +++
 Rendering/OpenGL2/vtkglVertexArrayObject.h         |   85 +
 Rendering/Parallel/CMakeLists.txt                  |    2 +-
 .../Testing/Cxx/TestClientServerRendering.cxx      |    1 +
 .../Cxx/TestDistributedDataCompositeZPass.cxx      |    1 +
 .../Parallel/Testing/Cxx/TestPCompositeZPass.cxx   |    1 +
 .../Parallel/Testing/Cxx/TestPShadowMapPass.cxx    |    1 +
 .../Parallel/Testing/Cxx/TestParallelRendering.cxx |    1 +
 .../Testing/Cxx/TestSimplePCompositeZPass.cxx      |    1 +
 Rendering/Parallel/vtkCompositeRGBAPass.cxx        |   52 +-
 Rendering/Parallel/vtkCompositeZPass.cxx           |   64 +-
 Rendering/Parallel/vtkCompositeZPass.h             |   11 +-
 Rendering/Parallel/vtkSynchronizedRenderers.cxx    |    4 +-
 Rendering/Parallel/vtkSynchronizedRenderers.h      |    2 +-
 Rendering/ParallelLIC/CMakeLists.txt               |   25 +-
 Rendering/ParallelLIC/module.cmake                 |    8 +-
 Rendering/ParallelLIC/vtkPSurfaceLICComposite.cxx  |  103 +-
 Rendering/ParallelLIC/vtkPSurfaceLICComposite.h    |   12 +-
 .../vtkPSurfaceLICComposite_CompFS.glsl            |   38 -
 Rendering/ParallelLIC/vtkPSurfaceLICMapper.cxx     |  172 -
 Rendering/ParallelLIC/vtkPSurfaceLICMapper.h       |   87 -
 Rendering/Qt/CMakeLists.txt                        |    2 +-
 Rendering/Qt/vtkQtInitialization.cxx               |    5 +-
 Rendering/Qt/vtkQtStringToImage.cxx                |   25 +-
 Rendering/Qt/vtkQtStringToImage.h                  |    8 +-
 Rendering/Tk/CMakeLists.txt                        |    4 +-
 .../Testing/Data/Baseline/TestTextActor3D.png.md5  |    1 -
 Rendering/Tk/Testing/Python/CMakeLists.txt         |    2 -
 Rendering/Tk/Testing/Python/TestTextActor3D.py     |  243 --
 Rendering/Tk/Testing/Python/cursor3D.py            |  274 --
 Rendering/Tk/Testing/Tcl/TestTextActor3D.tcl       |  206 ++
 Rendering/Tk/module.cmake                          |    2 +-
 Rendering/Tk/vtkXRenderWindowTclInteractor.cxx     |    2 +-
 Rendering/Volume/CMakeLists.txt                    |    7 -
 Rendering/Volume/Testing/Cxx/CMakeLists.txt        |   45 +-
 .../Volume/Testing/Cxx/TestGPURayCastAdditive.cxx  |   41 +-
 .../Volume/Testing/Cxx/TestGPURayCastAdditive1.cxx |  162 +
 .../Testing/Cxx/TestGPURayCastCameraInside.cxx     |  968 ------
 .../Cxx/TestGPURayCastCameraInsideSmallSpacing.cxx | 1628 ----------
 .../Volume/Testing/Cxx/TestGPURayCastClipping.cxx  |   22 +-
 .../Volume/Testing/Cxx/TestGPURayCastCropping1.cxx |   22 +-
 .../Testing/Cxx/TestGPURayCastDataTypesMinIP1.cxx  |  293 ++
 .../Testing/Cxx/TestGPURayCastMapperBenchmark.cxx  |    9 +-
 .../Testing/Cxx/TestGPURayCastReleaseResources.cxx |  111 -
 .../TestGPURayCastThreeComponentsIndependent.cxx   |  853 -----
 .../Cxx/TestGPURayCastTwoComponentsDependent.cxx   |  846 -----
 .../Cxx/TestGPURayCastTwoComponentsIndependent.cxx |  631 ----
 .../Testing/Cxx/TestGPURayCastVolumeUpdate.cxx     |  805 +++++
 .../Testing/Cxx/TestGPUVolumeRayCastMapper.cxx     | 1310 --------
 .../Cxx/TestSmartVolumeMapperWindowLevel.cxx       |   12 -
 .../Baseline/TestGPURayCastCameraInside.png.md5    |    1 -
 .../TestGPURayCastCameraInsideSmallSpacing.png.md5 |    1 -
 .../Data/Baseline/TestGPURayCastClipping.png.md5   |    2 +-
 .../Data/Baseline/TestGPURayCastCropping1.png.md5  |    2 +-
 ...TestGPURayCastIndependentComponentMinIP.png.md5 |    2 +-
 .../TestGPURayCastReleaseResources.png.md5         |    1 -
 ...estGPURayCastThreeComponentsIndependent.png.md5 |    1 -
 .../TestGPURayCastTwoComponentsDependent.png.md5   |    1 -
 .../TestGPURayCastTwoComponentsIndependent.png.md5 |    1 -
 .../Baseline/TestGPURayCastVolumeUpdate.png.md5    |    2 +-
 .../Baseline/TestGPURayCastVolumeUpdate_1.png.md5  |    2 +-
 .../Baseline/TestGPUVolumeRayCastMapper.png.md5    |    1 -
 .../Baseline/TestGPUVolumeRayCastMapper_1.png.md5  |    1 -
 Rendering/Volume/module.cmake                      |    9 +
 Rendering/Volume/vtkEncodedGradientEstimator.cxx   |   35 +-
 Rendering/Volume/vtkEncodedGradientShader.cxx      |   10 +-
 .../Volume/vtkFixedPointVolumeRayCastMapper.cxx    |    3 +
 Rendering/Volume/vtkGPUVolumeRayCastMapper.cxx     |   38 +-
 Rendering/Volume/vtkHAVSVolumeMapper.cxx           |    8 +-
 .../Volume/vtkRecursiveSphereDirectionEncoder.cxx  |   20 +-
 .../vtkUnstructuredGridBunykRayCastFunction.cxx    |   22 +-
 .../vtkUnstructuredGridLinearRayIntegrator.cxx     |    3 +-
 .../vtkUnstructuredGridPartialPreIntegration.cxx   |   12 +-
 .../vtkUnstructuredGridVolumeRayCastMapper.cxx     |   17 +-
 .../vtkUnstructuredGridVolumeZSweepMapper.cxx      |   28 +-
 Rendering/Volume/vtkVolumeRayCastMapper.cxx        |   19 +-
 .../vtkVolumeRayCastSpaceLeapingImageFilter.cxx    |   32 +-
 Rendering/Volume/vtkVolumeTextureMapper.cxx        |   21 +-
 Rendering/Volume/vtkVolumeTextureMapper2D.cxx      |   12 +-
 Rendering/VolumeAMR/module.cmake                   |    4 +-
 Rendering/VolumeAMR/vtkAMRVolumeMapper.cxx         |   16 +-
 Rendering/VolumeAMR/vtkAMRVolumeMapper.h           |   14 +
 .../vtkOpenGLGPUVolumeRayCastMapper.cxx            |  121 +-
 .../VolumeOpenGL/vtkOpenGLHAVSVolumeMapper.cxx     |   17 +-
 Rendering/VolumeOpenGL/vtkSmartVolumeMapper.cxx    |   12 -
 Rendering/VolumeOpenGL/vtkSmartVolumeMapper.h      |   11 -
 Rendering/VolumeOpenGL2/shaders/raycasterfs.glsl   |   35 +-
 Rendering/VolumeOpenGL2/shaders/raycastervs.glsl   |   11 +-
 .../shaders/vtkglProjectedTetrahedraFS.glsl        |    6 +-
 .../vtkOpenGLGPUVolumeRayCastMapper.cxx            | 1031 ++----
 .../vtkOpenGLProjectedTetrahedraMapper.cxx         |   88 +-
 .../vtkOpenGLProjectedTetrahedraMapper.h           |    8 +-
 .../vtkOpenGLRayCastImageDisplayHelper.cxx         |  511 ++-
 .../vtkOpenGLRayCastImageDisplayHelper.h           |   11 +-
 .../vtkOpenGLVolumeGradientOpacityTable.h          |   20 +-
 .../VolumeOpenGL2/vtkOpenGLVolumeOpacityTable.h    |   22 +-
 Rendering/VolumeOpenGL2/vtkOpenGLVolumeRGBTable.h  |   20 +-
 Rendering/VolumeOpenGL2/vtkSmartVolumeMapper.cxx   |   68 +-
 Rendering/VolumeOpenGL2/vtkSmartVolumeMapper.h     |   89 +-
 Rendering/VolumeOpenGL2/vtkVolumeMask.h            |   13 +-
 Rendering/VolumeOpenGL2/vtkVolumeShaderComposer.h  |  869 ++---
 Rendering/VolumeOpenGL2/vtkVolumeStateRAII.h       |    7 +-
 Rendering/VolumeOpenGLNew/CMakeLists.txt           |   54 +
 Rendering/VolumeOpenGLNew/module.cmake             |   35 +
 Rendering/VolumeOpenGLNew/shaders/raycasterfs.glsl |  105 +
 Rendering/VolumeOpenGLNew/shaders/raycastervs.glsl |   60 +
 Rendering/VolumeOpenGLNew/shaders/shader.frag      |    9 +
 Rendering/VolumeOpenGLNew/shaders/shader.vert      |   14 +
 .../vtkOpenGLGPUVolumeRayCastMapper.cxx            | 2185 +++++++++++++
 .../vtkOpenGLGPUVolumeRayCastMapper.h              |   94 +
 .../vtkOpenGLGradientOpacityTable.h                |  201 ++
 Rendering/VolumeOpenGLNew/vtkOpenGLOpacityTable.h  |  242 ++
 Rendering/VolumeOpenGLNew/vtkOpenGLRGBTable.h      |  156 +
 Rendering/VolumeOpenGLNew/vtkVolumeMask.h          |  349 ++
 Rendering/VolumeOpenGLNew/vtkVolumeShader.cxx      |  215 ++
 Rendering/VolumeOpenGLNew/vtkVolumeShader.h        |   58 +
 .../VolumeOpenGLNew/vtkVolumeShaderComposer.h      | 1086 +++++++
 Rendering/VolumeOpenGLNew/vtkVolumeStateRAII.h     |  102 +
 Testing/Data/CuspySurface.vtp.md5                  |    1 -
 Testing/Data/XDMF/temporalStaticMeshes.h5.md5      |    1 -
 Testing/Data/XDMF/temporalStaticMeshes.xmf.md5     |    1 -
 Testing/Data/al_foam_smallest.0.tif.md5            |    1 -
 Testing/Data/cyl_with_NaN.g.md5                    |    1 -
 Testing/Data/ghost_cells.vtk.md5                   |    1 -
 Testing/Data/ghost_cells.vtu.md5                   |    1 -
 Testing/Data/golf.csv.md5                          |    1 -
 Testing/Data/periodicPiece.vtu.md5                 |    1 -
 Testing/Data/planar_rgb.nii.gz.md5                 |    1 -
 Testing/GenericBridge/vtkBridgeAttribute.cxx       |    7 +-
 Testing/GenericBridge/vtkBridgeAttribute.h         |    2 +-
 Testing/GenericBridge/vtkBridgeCell.cxx            |    5 +-
 Testing/Rendering/vtkTesting.cxx                   |   82 +-
 Testing/Rendering/vtkTesting.h                     |    2 +-
 ThirdParty/VPIC/VPICView.cxx                       |    4 -
 ThirdParty/alglib/alglib/apvt.h                    |   12 +-
 ThirdParty/ftgl/src/FTFont.h                       |    2 +-
 ThirdParty/ftgl/src/FTSize.h                       |    2 +-
 ThirdParty/glew/vtk_glew.h.in                      |    7 -
 ThirdParty/jsoncpp/CMakeLists.txt                  |    3 +-
 ThirdParty/verdict/vtkverdict/README-VTK.txt       |    3 +-
 ThirdParty/verdict/vtkverdict/V_TetMetric.cpp      |  302 +-
 ThirdParty/xdmf2/vtkxdmf2/README-VTK.txt           |    3 +-
 Utilities/Benchmarks/GLBenchmarking.cxx            |    2 +
 Utilities/Benchmarks/TimingTests.cxx               |    3 +-
 Utilities/Benchmarks/module.cmake                  |    1 +
 Utilities/Benchmarks/vtkRenderTimingTests.h        |   39 +-
 Utilities/DICOMParser/DICOMAppHelper.cxx           |   81 +-
 Utilities/DICOMParser/DICOMParser.cxx              |   40 +-
 Utilities/DICOMParser/DICOMParser.h                |    5 -
 Utilities/Doxygen/doxyfile.in                      |    1 -
 Utilities/KWSys/vtksys/Base64.c                    |   24 +-
 Utilities/KWSys/vtksys/Base64.h.in                 |   18 +-
 Utilities/KWSys/vtksys/CONTRIBUTING.rst            |   35 -
 Utilities/KWSys/vtksys/CPU.h.in                    |   10 +-
 Utilities/KWSys/vtksys/Directory.cxx               |   28 +-
 Utilities/KWSys/vtksys/DynamicLoader.cxx           |    4 -
 Utilities/KWSys/vtksys/EncodingC.c                 |    4 +-
 Utilities/KWSys/vtksys/FStream.hxx.in              |   10 +-
 Utilities/KWSys/vtksys/Glob.cxx                    |  115 +-
 Utilities/KWSys/vtksys/Glob.hxx.in                 |   53 +-
 Utilities/KWSys/vtksys/Process.h.in                |    9 -
 Utilities/KWSys/vtksys/ProcessUNIX.c               |  364 +--
 Utilities/KWSys/vtksys/ProcessWin32.c              |  576 ++--
 Utilities/KWSys/vtksys/README.txt                  |    2 -
 Utilities/KWSys/vtksys/SharedForward.h.in          |   18 +-
 Utilities/KWSys/vtksys/SystemInformation.cxx       |   27 +-
 Utilities/KWSys/vtksys/SystemTools.cxx             |   96 +-
 Utilities/KWSys/vtksys/SystemTools.hxx.in          |    7 +-
 Utilities/KWSys/vtksys/Terminal.c                  |    1 -
 Utilities/KWSys/vtksys/hashtable.hxx.in            |    4 +-
 Utilities/KWSys/vtksys/kwsysPlatformTestsCXX.cxx   |    4 -
 Utilities/KWSys/vtksys/testHashSTL.cxx             |    4 +-
 Utilities/Maintenance/VTKTestsByLanguage.py        |  464 ---
 Utilities/Maintenance/WhatModulesVTK.py            |   69 +-
 Utilities/Maintenance/semanticDiffVersion.py       |    2 +-
 Utilities/MetaIO/vtkmetaio/metaBlob.cxx            |    2 +-
 Utilities/MetaIO/vtkmetaio/metaCommand.cxx         |    3 +-
 Utilities/MetaIO/vtkmetaio/metaContour.h           |    2 +-
 Utilities/MetaIO/vtkmetaio/metaDTITube.cxx         |    1 -
 Utilities/MetaIO/vtkmetaio/metaEvent.h             |    8 +-
 Utilities/MetaIO/vtkmetaio/metaImageUtils.cxx      |    2 +-
 Utilities/MetaIO/vtkmetaio/metaLandmark.cxx        |    3 +-
 Utilities/MetaIO/vtkmetaio/metaMesh.cxx            |    1 -
 Utilities/MetaIO/vtkmetaio/metaMesh.h              |    6 +-
 Utilities/MetaIO/vtkmetaio/metaOutput.cxx          |    5 +-
 Utilities/MetaIO/vtkmetaio/metaOutput.h            |    8 +-
 Utilities/MetaIO/vtkmetaio/metaTubeGraph.h         |    2 +-
 Utilities/MetaIO/vtkmetaio/metaUtils.cxx           |    8 -
 Utilities/MetaIO/vtkmetaio/tests/CMakeLists.txt    |   47 +
 .../MetaIO/vtkmetaio/tests/testMeta10Contour.cxx   |   97 +
 .../MetaIO/vtkmetaio/tests/testMeta11Form.cxx      |   93 +
 .../MetaIO/vtkmetaio/tests/testMeta12Array.cxx     |   46 +
 .../MetaIO/vtkmetaio/tests/testMeta1Utils.cxx      |  228 ++
 .../MetaIO/vtkmetaio/tests/testMeta2Object.cxx     |  132 +
 .../MetaIO/vtkmetaio/tests/testMeta3Image.cxx      |   39 +
 Utilities/MetaIO/vtkmetaio/tests/testMeta4Tube.cxx |   97 +
 Utilities/MetaIO/vtkmetaio/tests/testMeta5Blob.cxx |   55 +
 .../MetaIO/vtkmetaio/tests/testMeta6Surface.cxx    |   90 +
 Utilities/MetaIO/vtkmetaio/tests/testMeta7Line.cxx |   68 +
 .../MetaIO/vtkmetaio/tests/testMeta8Scene.cxx      |   85 +
 .../MetaIO/vtkmetaio/tests/testMeta9Landmark.cxx   |   55 +
 Utilities/Python/vtkPython.h                       |   10 +-
 .../PythonInterpreter/vtkPythonInterpreter.cxx     |    8 +-
 Utilities/PythonInterpreter/vtkPythonInterpreter.h |    3 +-
 .../vtkPythonStdStreamCaptureHelper.h              |   24 -
 Utilities/Scripts/SetupExternalData.sh             |    4 +-
 Utilities/Scripts/SetupGitAliases.sh               |   20 +-
 Utilities/Scripts/git-gerrit-push                  |  167 +-
 Utilities/SetupForDevelopment.sh                   |   12 +-
 .../vtkTclTest2Py/vtkConvertTclTestToPy.cmake      |   74 +
 Views/Core/vtkView.cxx                             |    2 +-
 Views/Infovis/Testing/Cxx/CMakeLists.txt           |    9 +-
 .../Baseline/TestCoincidentGraphLayoutView.png.md5 |    2 +-
 .../Testing/Data/Baseline/TestColumnTree.png.md5   |    2 +-
 .../Data/Baseline/TestConeLayoutStrategy.png.md5   |    2 +-
 .../Data/Baseline/TestConeLayoutStrategy_1.png.md5 |    2 +-
 .../Data/Baseline/TestConeLayoutStrategy_2.png.md5 |    1 +
 .../Data/Baseline/TestDendrogramItem.png.md5       |    2 +-
 .../Data/Baseline/TestDendrogramItem_1.png.md5     |    1 -
 .../Data/Baseline/TestGraphLayoutView.png.md5      |    2 +-
 .../Baseline/TestHeatmapCategoryLegend.png.md5     |    2 +-
 .../Testing/Data/Baseline/TestHeatmapItem.png.md5  |    2 +-
 .../Data/Baseline/TestHeatmapScalarLegend.png.md5  |    2 +-
 .../Baseline/TestHierarchicalGraphView.png.md5     |    2 +-
 .../Testing/Data/Baseline/TestIcicleView.png.md5   |    2 +-
 .../Testing/Data/Baseline/TestIcicleView_1.png.md5 |    1 +
 .../Testing/Data/Baseline/TestIcicleView_2.png.md5 |    1 +
 .../Testing/Data/Baseline/TestIcicleView_3.png.md5 |    1 +
 .../Testing/Data/Baseline/TestIcicleView_4.png.md5 |    1 +
 .../Testing/Data/Baseline/TestIcicleView_5.png.md5 |    1 +
 .../Testing/Data/Baseline/TestNetworkViews.png.md5 |    2 +-
 .../Baseline/TestParallelCoordinatesView.png.md5   |    2 +-
 .../Baseline/TestParallelCoordinatesView_1.png.md5 |    1 -
 .../Baseline/TestParallelCoordinatesView_2.png.md5 |    1 -
 .../Baseline/TestSpanTreeLayoutStrategy.png.md5    |    2 +-
 .../Data/Baseline/TestTanglegramItem.png.md5       |    2 +-
 .../Data/Baseline/TestTanglegramItem_1.png.md5     |    1 -
 .../Baseline/TestTreeHeatmapAutoCollapse.png.md5   |    2 +-
 .../Data/Baseline/TestTreeHeatmapItem.png.md5      |    2 +-
 .../Testing/Data/Baseline/TestTreeMapView.png.md5  |    2 +-
 .../Data/Baseline/TestTreeMapView_1.png.md5        |    1 +
 .../Data/Baseline/TestTreeMapView_2.png.md5        |    1 +
 .../Data/Baseline/TestTreeMapView_3.png.md5        |    1 +
 .../Testing/Data/Baseline/TestTreeRingView.png.md5 |    2 +-
 .../Data/Baseline/TestTreeRingView_1.png.md5       |    1 +
 Views/Infovis/module.cmake                         |    1 +
 Views/Infovis/vtkSCurveSpline.cxx                  |   15 +-
 Views/Infovis/vtkTreeHeatmapItem.cxx               |    2 +-
 Views/Qt/CMakeLists.txt                            |    2 +-
 Views/Qt/vtkQtAnnotationView.cxx                   |    5 +-
 Views/Qt/vtkQtListView.cxx                         |    5 +-
 Views/Qt/vtkQtRecordView.cxx                       |    5 +-
 Views/Qt/vtkQtTableRepresentation.cxx              |    5 +-
 Views/Qt/vtkQtTableView.cxx                        |    5 +-
 Views/Qt/vtkQtTreeView.cxx                         |   25 +-
 Wrapping/Java/CMakeLists.txt                       |   26 +-
 Wrapping/Java/MakeJavacResponseFile.cmake          |   29 -
 Wrapping/Python/CMakeLists.txt                     |   51 +-
 Wrapping/Python/dummy.cxx                          |    4 -
 Wrapping/Python/vtk/test/Testing.py                |    7 +-
 Wrapping/Python/vtk/util/_argparse.py              | 2361 --------------
 Wrapping/PythonCore/PyVTKMutableObject.cxx         |    2 +-
 Wrapping/PythonCore/PyVTKNamespace.cxx             |    2 +-
 Wrapping/PythonCore/PyVTKObject.cxx                |    2 +-
 Wrapping/PythonCore/PyVTKTemplate.cxx              |    2 +-
 Wrapping/PythonCore/vtkPythonOverload.cxx          |    1 -
 Wrapping/PythonCore/vtkPythonUtil.cxx              |    4 +-
 Wrapping/Tcl/vtkTclUtil.cxx                        |    4 +-
 Wrapping/Tools/CMakeLists.txt                      |    1 -
 Wrapping/Tools/hints                               |   19 +-
 Wrapping/Tools/vtkParse.tab.c                      |    5 +-
 Wrapping/Tools/vtkParse.y                          |    2 +-
 Wrapping/Tools/vtkParseExtras.c                    |  520 +--
 Wrapping/Tools/vtkParseExtras.h                    |   63 +-
 Wrapping/Tools/vtkParseHierarchy.c                 |   10 +-
 Wrapping/Tools/vtkParseJava.c                      |    6 -
 Wrapping/Tools/vtkParseMerge.c                     |  767 -----
 Wrapping/Tools/vtkParseMerge.h                     |   81 -
 Wrapping/Tools/vtkParsePreprocess.c                |    2 +
 Wrapping/Tools/vtkWrap.c                           |   34 +-
 Wrapping/Tools/vtkWrap.h                           |    9 -
 Wrapping/Tools/vtkWrapHierarchy.c                  |    1 -
 Wrapping/Tools/vtkWrapJava.c                       |    5 -
 Wrapping/Tools/vtkWrapPython.c                     |    4 -
 Wrapping/Tools/vtkWrapPythonMethod.c               |    4 +-
 Wrapping/Tools/vtkWrapPythonMethodDef.c            |    2 +-
 Wrapping/Tools/vtkWrapPythonTemplate.c             |    2 +-
 Wrapping/Tools/vtkWrapPythonType.c                 |    5 +-
 Wrapping/Tools/vtkWrapTcl.c                        |    5 -
 Wrapping/Tools/vtkWrapText.c                       |    2 +-
 debian/changelog                                   |   12 -
 debian/control                                     |   40 +-
 debian/libvtk6-dev.install                         |   44 +-
 debian/libvtk6-java.install                        |    6 +-
 debian/libvtk6-jni.install                         |    1 -
 debian/libvtk6-jni.lintian-overrides               |    3 -
 debian/libvtk6-qt-dev.install                      |    6 +-
 .../{libvtk6.3-qt.install => libvtk6.2-qt.install} |    0
 debian/libvtk6.2-qt.lintian-overrides              |    3 +
 debian/{libvtk6.3.install => libvtk6.2.install}    |    0
 debian/libvtk6.2.lintian-overrides                 |    5 +
 debian/libvtk6.3-qt.lintian-overrides              |    3 -
 debian/libvtk6.3.lintian-overrides                 |    5 -
 debian/patches/104_fix_gcc_version_6.patch         |   10 +-
 debian/patches/105_unforce_embedded_glew.patch     |   16 -
 debian/patches/10_allpatches.patch                 |   12 +
 debian/patches/30_matplotlib.patch                 |   18 +-
 debian/patches/40_use_system_sqlite.patch          |   88 +-
 debian/patches/60_use_system_mpi4py.patch          |   12 +-
 debian/patches/70_fix_ftbfs_gcc49.patch            |   26 +-
 debian/patches/80_fix_arm_compilation.patch        |    6 +-
 debian/patches/95_ffmpeg_2.9.patch                 |   20 +-
 .../96_concurrent_vtkLookupTableMapData_fix.patch  |  198 ++
 debian/patches/97_fix_latex_doxygen.patch          |    4 +-
 debian/patches/series                              |    4 +-
 debian/python-vtk6.install                         |    4 +-
 debian/rules                                       |   13 +-
 debian/tcl-vtk6.install                            |    4 +-
 debian/vtk6-doc.docs                               |    2 +-
 debian/vtk6.install                                |   10 +-
 debian/watch                                       |    2 +-
 1813 files changed, 41271 insertions(+), 81827 deletions(-)

diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index 845ca06..0000000
--- a/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-.pc
diff --git a/Accelerators/Dax/module.cmake b/Accelerators/Dax/module.cmake
index d63c926..6a9910c 100644
--- a/Accelerators/Dax/module.cmake
+++ b/Accelerators/Dax/module.cmake
@@ -1,21 +1,19 @@
-if(NOT VTK_LEGACY_REMOVE)
-  vtk_module(vtkAcceleratorsDax
-    IMPLEMENTS
-      vtkFiltersCore
-    DEPENDS
-      vtkCommonCore
-      vtkCommonDataModel
-      vtkCommonExecutionModel
-      vtkFiltersCore
-      vtkFiltersGeometry
-    TEST_DEPENDS
-      vtkTestingCore
-      vtkTestingRendering
-      vtkRenderingVolume
-      vtkRenderingVolumeOpenGL
-      vtkIOLegacy
-      vtkIOXML
-      vtkImagingSources
-    EXCLUDE_FROM_ALL
-    )
-endif()
+vtk_module(vtkAcceleratorsDax
+  IMPLEMENTS
+    vtkFiltersCore
+  DEPENDS
+    vtkCommonCore
+    vtkCommonDataModel
+    vtkCommonExecutionModel
+    vtkFiltersCore
+    vtkFiltersGeometry
+  TEST_DEPENDS
+    vtkTestingCore
+    vtkTestingRendering
+    vtkRenderingVolume
+    vtkRenderingVolumeOpenGL
+    vtkIOLegacy
+    vtkIOXML
+    vtkImagingSources
+  EXCLUDE_FROM_ALL
+  )
diff --git a/Accelerators/Dax/vtkDaxContour.cxx b/Accelerators/Dax/vtkDaxContour.cxx
index 3198534..3e6d7c9 100644
--- a/Accelerators/Dax/vtkDaxContour.cxx
+++ b/Accelerators/Dax/vtkDaxContour.cxx
@@ -39,7 +39,6 @@ namespace vtkDax {
 //------------------------------------------------------------------------------
 vtkDaxContour::vtkDaxContour()
   {
-  VTK_LEGACY_BODY(vtkDaxContour::vtkDaxContour, "VTK 6.3");
   }
 
 //------------------------------------------------------------------------------
diff --git a/Accelerators/Dax/vtkDaxThreshold.cxx b/Accelerators/Dax/vtkDaxThreshold.cxx
index 0dde4f4..f8bff1f 100644
--- a/Accelerators/Dax/vtkDaxThreshold.cxx
+++ b/Accelerators/Dax/vtkDaxThreshold.cxx
@@ -35,7 +35,7 @@ vtkStandardNewMacro(vtkDaxThreshold)
 //------------------------------------------------------------------------------
 vtkDaxThreshold::vtkDaxThreshold()
 {
-  VTK_LEGACY_BODY(vtkDaxContour::vtkDaxContour, "VTK 6.3");
+
 }
 
 //------------------------------------------------------------------------------
diff --git a/Accelerators/Piston/CMakeLists.txt b/Accelerators/Piston/CMakeLists.txt
index 3f96657..f214744 100644
--- a/Accelerators/Piston/CMakeLists.txt
+++ b/Accelerators/Piston/CMakeLists.txt
@@ -1,12 +1,3 @@
-
-if(VTK_LEGACY_REMOVE)
-  message(STATUS
-          "vtkAcceleratorsPiston can not be enabled as it has been "
-          "marked for deprecation and legacy code has been disabled in this "
-          "build.")
-  return()
-endif()
-
 find_package(CUDA REQUIRED)
 find_path(PISTON_INCLUDE
   PistonCodingStyle.xml
diff --git a/Accelerators/Piston/module.cmake b/Accelerators/Piston/module.cmake
index d3d1877..9b21d5a 100644
--- a/Accelerators/Piston/module.cmake
+++ b/Accelerators/Piston/module.cmake
@@ -1,21 +1,19 @@
-if(NOT VTK_LEGACY_REMOVE)
-  vtk_module(vtkAcceleratorsPiston
-    DEPENDS
-      vtkCommonCore
-      vtkCommonDataModel
-      vtkCommonExecutionModel
-      vtkRenderingCore
-      vtkRenderingOpenGL
-      vtkIOImage #from piston
-      vtkImagingHybrid #from piston
-    TEST_DEPENDS
-      vtkTestingRendering
-      vtkInteractionStyle
-      vtkInteractionWidgets
-      vtkImagingSources
-      vtkParallelCore
-      vtkParallelMPI
-      vtkRenderingParallel
-    EXCLUDE_FROM_ALL
-    )
-endif()
+vtk_module(vtkAcceleratorsPiston
+  DEPENDS
+    vtkCommonCore
+    vtkCommonDataModel
+    vtkCommonExecutionModel
+    vtkRenderingCore
+    vtkRenderingOpenGL
+    vtkIOImage #from piston
+    vtkImagingHybrid #from piston
+  TEST_DEPENDS
+    vtkTestingRendering
+    vtkInteractionStyle
+    vtkInteractionWidgets
+    vtkImagingSources
+    vtkParallelCore
+    vtkParallelMPI
+    vtkRenderingParallel
+  EXCLUDE_FROM_ALL
+  )
diff --git a/Accelerators/Piston/vtkDataSetToPiston.cxx b/Accelerators/Piston/vtkDataSetToPiston.cxx
index 804b251..f7c62d2 100644
--- a/Accelerators/Piston/vtkDataSetToPiston.cxx
+++ b/Accelerators/Piston/vtkDataSetToPiston.cxx
@@ -37,7 +37,6 @@ vtkStandardNewMacro(vtkDataSetToPiston);
 //----------------------------------------------------------------------------
 vtkDataSetToPiston::vtkDataSetToPiston()
 {
-  VTK_LEGACY_BODY(vtkDataSetToPiston::vtkDataSetToPiston, "VTK 6.3");
 }
 
 //----------------------------------------------------------------------------
diff --git a/Accelerators/Piston/vtkPistonAlgorithm.cxx b/Accelerators/Piston/vtkPistonAlgorithm.cxx
index 9baa7e4..cc36282 100644
--- a/Accelerators/Piston/vtkPistonAlgorithm.cxx
+++ b/Accelerators/Piston/vtkPistonAlgorithm.cxx
@@ -29,8 +29,6 @@ vtkStandardNewMacro(vtkPistonAlgorithm);
 //----------------------------------------------------------------------------
 vtkPistonAlgorithm::vtkPistonAlgorithm()
 {
-  VTK_LEGACY_BODY(vtkPistonAlgorithm::vtkPistonAlgorithm, "VTK 6.3");
-
   // by default assume filters have one input and one output
   // subclasses that deviate should modify this setting
   this->SetNumberOfInputPorts(1);
diff --git a/Accelerators/Piston/vtkPistonContour.cxx b/Accelerators/Piston/vtkPistonContour.cxx
index 838b0ac..1cecd84 100644
--- a/Accelerators/Piston/vtkPistonContour.cxx
+++ b/Accelerators/Piston/vtkPistonContour.cxx
@@ -29,7 +29,6 @@ namespace vtkpiston {
 //----------------------------------------------------------------------------
 vtkPistonContour::vtkPistonContour()
 {
-  VTK_LEGACY_BODY(vtkPistonContour::vtkPistonContour, "VTK 6.3");
   this->IsoValue = 0.0;
 }
 
diff --git a/Accelerators/Piston/vtkPistonDataObject.cxx b/Accelerators/Piston/vtkPistonDataObject.cxx
index 14e2426..b382048 100644
--- a/Accelerators/Piston/vtkPistonDataObject.cxx
+++ b/Accelerators/Piston/vtkPistonDataObject.cxx
@@ -26,8 +26,6 @@ vtkStandardNewMacro(vtkPistonDataObject);
 //----------------------------------------------------------------------------
 vtkPistonDataObject::vtkPistonDataObject()
 {
-  VTK_LEGACY_BODY(vtkPistonDataObject::vtkPistonDataObject, "VTK 6.3");
-
   //cerr << "PDO(" << this << ") Create" << endl;
   this->Information->Set(vtkDataObject::DATA_EXTENT_TYPE(), VTK_PIECES_EXTENT);
   this->Information->Set(vtkDataObject::DATA_PIECE_NUMBER(), -1);
diff --git a/Accelerators/Piston/vtkPistonMapper.cxx b/Accelerators/Piston/vtkPistonMapper.cxx
index 00c1ad2..9be0aae 100644
--- a/Accelerators/Piston/vtkPistonMapper.cxx
+++ b/Accelerators/Piston/vtkPistonMapper.cxx
@@ -115,8 +115,6 @@ void vtkPistonMapper::InitCudaGL(vtkRenderWindow *rw)
 //-----------------------------------------------------------------------------
 vtkPistonMapper::vtkPistonMapper()
 {
-  VTK_LEGACY_BODY(vtkPistonMapper::vtkPistonMapper, "VTK 6.3");
-
   //cerr << "PM(" << this << ") create" << endl;
   vtkMath::UninitializeBounds(this->Bounds);
   this->Center[0] = this->Center[1] = this->Center[2] = 0.0;
diff --git a/Accelerators/Piston/vtkPistonReference.h b/Accelerators/Piston/vtkPistonReference.h
index 92d2abb..758800d 100644
--- a/Accelerators/Piston/vtkPistonReference.h
+++ b/Accelerators/Piston/vtkPistonReference.h
@@ -38,7 +38,6 @@ public:
 
     vtkPistonReference() : mtime(0), type(-1), data(NULL)
     {
-      VTK_LEGACY_BODY(vtkPistonReference::vtkPistonReference, "VTK 6.3");
       //cerr << "TR(" << this << ") CREATE" << endl;
     }
 
diff --git a/Accelerators/Piston/vtkPistonScalarsColors.cxx b/Accelerators/Piston/vtkPistonScalarsColors.cxx
index af943e0..402e64b 100644
--- a/Accelerators/Piston/vtkPistonScalarsColors.cxx
+++ b/Accelerators/Piston/vtkPistonScalarsColors.cxx
@@ -15,7 +15,6 @@ vtkPistonScalarsColors::vtkPistonScalarsColors() : vtkObject(),
   NumberOfValues(256),
   LookupTable(0)
 {
-  VTK_LEGACY_BODY(vtkPistonScalarsColors::vtkPistonScalarsColors, "VTK 6.3");
   this->TableRange[0] = this->TableRange[1] = 0.0;
   this->ComputeColorsTime.Modified();
   this->ComputeColorsfTime.Modified();
diff --git a/Accelerators/Piston/vtkPistonSlice.cxx b/Accelerators/Piston/vtkPistonSlice.cxx
index 6976a1c..54018ec 100644
--- a/Accelerators/Piston/vtkPistonSlice.cxx
+++ b/Accelerators/Piston/vtkPistonSlice.cxx
@@ -30,7 +30,6 @@ namespace vtkpiston {
 //----------------------------------------------------------------------------
 vtkPistonSlice::vtkPistonSlice()
 {
-  VTK_LEGACY_BODY(vtkPistonSlice::vtkPistonSlice, "VTK 6.3");
   this->Plane = vtkPlane::New();
   this->Offset = 0.0;
 }
diff --git a/Accelerators/Piston/vtkPistonSort.h b/Accelerators/Piston/vtkPistonSort.h
index 942b78a..04573cc 100644
--- a/Accelerators/Piston/vtkPistonSort.h
+++ b/Accelerators/Piston/vtkPistonSort.h
@@ -33,7 +33,7 @@ public:
   void PrintSelf(ostream& os, vtkIndent indent);
 
 protected:
-  vtkPistonSort() {VTK_LEGACY_BODY(vtkPistonSort::vtkPistonSort, "VTK 6.3");}
+  vtkPistonSort() {}
   ~vtkPistonSort() {}
 
   // Description:
diff --git a/Accelerators/Piston/vtkPistonThreshold.cxx b/Accelerators/Piston/vtkPistonThreshold.cxx
index 84b1f5a..665bd89 100644
--- a/Accelerators/Piston/vtkPistonThreshold.cxx
+++ b/Accelerators/Piston/vtkPistonThreshold.cxx
@@ -29,7 +29,6 @@ namespace vtkpiston {
 //----------------------------------------------------------------------------
 vtkPistonThreshold::vtkPistonThreshold()
 {
-  VTK_LEGACY_BODY(vtkPistonThreshold::vtkPistonThreshold, "VTK 6.3");
   this->MinValue = 0.0;
   this->MaxValue = 0.0;
 }
diff --git a/Accelerators/Piston/vtkPistonToDataSet.cxx b/Accelerators/Piston/vtkPistonToDataSet.cxx
index 1983c53..607314e 100644
--- a/Accelerators/Piston/vtkPistonToDataSet.cxx
+++ b/Accelerators/Piston/vtkPistonToDataSet.cxx
@@ -37,7 +37,6 @@ vtkStandardNewMacro(vtkPistonToDataSet);
 //----------------------------------------------------------------------------
 vtkPistonToDataSet::vtkPistonToDataSet()
 {
-  VTK_LEGACY_BODY(vtkPistonToDataSet::vtkPistonToDataSet, "VTK 6.3");
   this->OutputDataSetType = VTK_POLY_DATA;
 }
 
diff --git a/CMake/ExternalData.cmake b/CMake/ExternalData.cmake
index 6e1830a..df72c93 100644
--- a/CMake/ExternalData.cmake
+++ b/CMake/ExternalData.cmake
@@ -1,309 +1,144 @@
-#.rst:
-# ExternalData
-# ------------
-#
-# .. only:: html
-#
-#    .. contents::
-#
-# Manage data files stored outside source tree
-#
-# Introduction
-# ^^^^^^^^^^^^
-#
-# Use this module to unambiguously reference data files stored outside
-# the source tree and fetch them at build time from arbitrary local and
-# remote content-addressed locations.  Functions provided by this module
-# recognize arguments with the syntax ``DATA{<name>}`` as references to
-# external data, replace them with full paths to local copies of those
-# data, and create build rules to fetch and update the local copies.
-#
-# For example:
-#
-# .. code-block:: cmake
-#
-#  include(ExternalData)
-#  set(ExternalData_URL_TEMPLATES "file:///local/%(algo)/%(hash)"
-#                                 "file:////host/share/%(algo)/%(hash)"
-#                                 "http://data.org/%(algo)/%(hash)")
-#  ExternalData_Add_Test(MyData
-#    NAME MyTest
-#    COMMAND MyExe DATA{MyInput.png}
+# - Manage data files stored outside source tree
+# Use this module to unambiguously reference data files stored outside the
+# source tree and fetch them at build time from arbitrary local and remote
+# content-addressed locations.  Functions provided by this module recognize
+# arguments with the syntax "DATA{<name>}" as references to external data,
+# replace them with full paths to local copies of those data, and create build
+# rules to fetch and update the local copies.
+#
+# The DATA{} syntax is literal and the <name> is a full or relative path
+# within the source tree.  The source tree must contain either a real data
+# file at <name> or a "content link" at <name><ext> containing a hash of the
+# real file using a hash algorithm corresponding to <ext>.  For example, the
+# argument "DATA{img.png}" may be satisfied by either a real "img.png" file in
+# the current source directory or a "img.png.md5" file containing its MD5 sum.
+#
+# The 'ExternalData_Expand_Arguments' function evaluates DATA{} references
+# in its arguments and constructs a new list of arguments:
+#  ExternalData_Expand_Arguments(
+#    <target>   # Name of data management target
+#    <outVar>   # Output variable
+#    [args...]  # Input arguments, DATA{} allowed
 #    )
-#  ExternalData_Add_Target(MyData)
-#
-# When test ``MyTest`` runs the ``DATA{MyInput.png}`` argument will be
-# replaced by the full path to a real instance of the data file
-# ``MyInput.png`` on disk.  If the source tree contains a content link
-# such as ``MyInput.png.md5`` then the ``MyData`` target creates a real
-# ``MyInput.png`` in the build tree.
-#
-# Module Functions
-# ^^^^^^^^^^^^^^^^
-#
-# .. command:: ExternalData_Expand_Arguments
-#
-#   The ``ExternalData_Expand_Arguments`` function evaluates ``DATA{}``
-#   references in its arguments and constructs a new list of arguments::
-#
-#     ExternalData_Expand_Arguments(
-#       <target>   # Name of data management target
-#       <outVar>   # Output variable
-#       [args...]  # Input arguments, DATA{} allowed
-#       )
-#
-#   It replaces each ``DATA{}`` reference in an argument with the full path of
-#   a real data file on disk that will exist after the ``<target>`` builds.
-#
-# .. command:: ExternalData_Add_Test
-#
-#   The ``ExternalData_Add_Test`` function wraps around the CMake
-#   :command:`add_test` command but supports ``DATA{}`` references in
-#   its arguments::
-#
-#     ExternalData_Add_Test(
-#       <target>   # Name of data management target
-#       ...        # Arguments of add_test(), DATA{} allowed
-#       )
-#
-#   It passes its arguments through ``ExternalData_Expand_Arguments`` and then
-#   invokes the :command:`add_test` command using the results.
-#
-# .. command:: ExternalData_Add_Target
-#
-#   The ``ExternalData_Add_Target`` function creates a custom target to
-#   manage local instances of data files stored externally::
-#
-#     ExternalData_Add_Target(
-#       <target>   # Name of data management target
-#       )
-#
-#   It creates custom commands in the target as necessary to make data
-#   files available for each ``DATA{}`` reference previously evaluated by
-#   other functions provided by this module.
-#   Data files may be fetched from one of the URL templates specified in
-#   the ``ExternalData_URL_TEMPLATES`` variable, or may be found locally
-#   in one of the paths specified in the ``ExternalData_OBJECT_STORES``
-#   variable.
-#
-# Module Variables
-# ^^^^^^^^^^^^^^^^
-#
-# The following variables configure behavior.  They should be set before
-# calling any of the functions provided by this module.
-#
-# .. variable:: ExternalData_BINARY_ROOT
-#
-#   The ``ExternalData_BINARY_ROOT`` variable may be set to the directory to
-#   hold the real data files named by expanded ``DATA{}`` references.  The
-#   default is ``CMAKE_BINARY_DIR``.  The directory layout will mirror that of
-#   content links under ``ExternalData_SOURCE_ROOT``.
-#
-# .. variable:: ExternalData_CUSTOM_SCRIPT_<key>
-#
-#   Specify a full path to a ``.cmake`` custom fetch script identified by
-#   ``<key>`` in entries of the ``ExternalData_URL_TEMPLATES`` list.
-#   See `Custom Fetch Scripts`_.
-#
-# .. variable:: ExternalData_LINK_CONTENT
-#
-#   The ``ExternalData_LINK_CONTENT`` variable may be set to the name of a
-#   supported hash algorithm to enable automatic conversion of real data
-#   files referenced by the ``DATA{}`` syntax into content links.  For each
-#   such ``<file>`` a content link named ``<file><ext>`` is created.  The
-#   original file is renamed to the form ``.ExternalData_<algo>_<hash>`` to
-#   stage it for future transmission to one of the locations in the list
-#   of URL templates (by means outside the scope of this module).  The
-#   data fetch rule created for the content link will use the staged
-#   object if it cannot be found using any URL template.
-#
-# .. variable:: ExternalData_OBJECT_STORES
-#
-#   The ``ExternalData_OBJECT_STORES`` variable may be set to a list of local
-#   directories that store objects using the layout ``<dir>/%(algo)/%(hash)``.
-#   These directories will be searched first for a needed object.  If the
-#   object is not available in any store then it will be fetched remotely
-#   using the URL templates and added to the first local store listed.  If
-#   no stores are specified the default is a location inside the build
-#   tree.
-#
-# .. variable:: ExternalData_SERIES_PARSE
-#               ExternalData_SERIES_PARSE_PREFIX
-#               ExternalData_SERIES_PARSE_NUMBER
-#               ExternalData_SERIES_PARSE_SUFFIX
-#               ExternalData_SERIES_MATCH
-#
-#   See `Referencing File Series`_.
-#
-# .. variable:: ExternalData_SOURCE_ROOT
-#
-#   The ``ExternalData_SOURCE_ROOT`` variable may be set to the highest source
-#   directory containing any path named by a ``DATA{}`` reference.  The
-#   default is ``CMAKE_SOURCE_DIR``.  ``ExternalData_SOURCE_ROOT`` and
-#   ``CMAKE_SOURCE_DIR`` must refer to directories within a single source
-#   distribution (e.g.  they come together in one tarball).
-#
-# .. variable:: ExternalData_TIMEOUT_ABSOLUTE
-#
-#   The ``ExternalData_TIMEOUT_ABSOLUTE`` variable sets the download
-#   absolute timeout, in seconds, with a default of ``300`` seconds.
-#   Set to ``0`` to disable enforcement.
-#
-# .. variable:: ExternalData_TIMEOUT_INACTIVITY
-#
-#   The ``ExternalData_TIMEOUT_INACTIVITY`` variable sets the download
-#   inactivity timeout, in seconds, with a default of ``60`` seconds.
-#   Set to ``0`` to disable enforcement.
-#
-# .. variable:: ExternalData_URL_ALGO_<algo>_<key>
-#
-#   Specify a custom URL component to be substituted for URL template
-#   placeholders of the form ``%(algo:<key>)``, where ``<key>`` is a
-#   valid C identifier, when fetching an object referenced via hash
-#   algorithm ``<algo>``.  If not defined, the default URL component
-#   is just ``<algo>`` for any ``<key>``.
-#
-# .. variable:: ExternalData_URL_TEMPLATES
-#
-#   The ``ExternalData_URL_TEMPLATES`` may be set to provide a list of
-#   of URL templates using the placeholders ``%(algo)`` and ``%(hash)``
-#   in each template.  Data fetch rules try each URL template in order
-#   by substituting the hash algorithm name for ``%(algo)`` and the hash
-#   value for ``%(hash)``.  Alternatively one may use ``%(algo:<key>)``
-#   with ``ExternalData_URL_ALGO_<algo>_<key>`` variables to gain more
-#   flexibility in remote URLs.
-#
-# Referencing Files
-# ^^^^^^^^^^^^^^^^^
-#
-# Referencing Single Files
-# """"""""""""""""""""""""
-#
-# The ``DATA{}`` syntax is literal and the ``<name>`` is a full or relative path
-# within the source tree.  The source tree must contain either a real
-# data file at ``<name>`` or a "content link" at ``<name><ext>`` containing a
-# hash of the real file using a hash algorithm corresponding to ``<ext>``.
-# For example, the argument ``DATA{img.png}`` may be satisfied by either a
-# real ``img.png`` file in the current source directory or a ``img.png.md5``
-# file containing its MD5 sum.
-#
-# Referencing File Series
-# """""""""""""""""""""""
-#
-# The ``DATA{}`` syntax can be told to fetch a file series using the form
-# ``DATA{<name>,:}``, where the ``:`` is literal.  If the source tree
-# contains a group of files or content links named like a series then a
-# reference to one member adds rules to fetch all of them.  Although all
-# members of a series are fetched, only the file originally named by the
-# ``DATA{}`` argument is substituted for it.  The default configuration
-# recognizes file series names ending with ``#.ext``, ``_#.ext``, ``.#.ext``,
-# or ``-#.ext`` where ``#`` is a sequence of decimal digits and ``.ext`` is
-# any single extension.  Configure it with a regex that parses ``<number>``
-# and ``<suffix>`` parts from the end of ``<name>``::
+# It replaces each DATA{} reference in an argument with the full path of a
+# real data file on disk that will exist after the <target> builds.
+#
+# The 'ExternalData_Add_Test' function wraps around the CMake add_test()
+# command but supports DATA{} references in its arguments:
+#  ExternalData_Add_Test(
+#    <target>   # Name of data management target
+#    ...        # Arguments of add_test(), DATA{} allowed
+#    )
+# It passes its arguments through ExternalData_Expand_Arguments and then
+# invokes add_test() using the results.
 #
+# The 'ExternalData_Add_Target' function creates a custom target to manage
+# local instances of data files stored externally:
+#  ExternalData_Add_Target(
+#    <target>   # Name of data management target
+#    )
+# It creates custom commands in the target as necessary to make data files
+# available for each DATA{} reference previously evaluated by other functions
+# provided by this module.  A list of URL templates must be provided in the
+# variable ExternalData_URL_TEMPLATES using the placeholders "%(algo)" and
+# "%(hash)" in each template.  Data fetch rules try each URL template in order
+# by substituting the hash algorithm name for "%(algo)" and the hash value for
+# "%(hash)".
+#
+# The following hash algorithms are supported:
+#    %(algo)     <ext>     Description
+#    -------     -----     -----------
+#    MD5         .md5      Message-Digest Algorithm 5, RFC 1321
+# Note that the hashes are used only for unique data identification and
+# download verification.  This is not security software.
+#
+# Example usage:
+#   include(ExternalData)
+#   set(ExternalData_URL_TEMPLATES "file:///local/%(algo)/%(hash)"
+#                                  "http://data.org/%(algo)/%(hash)")
+#   ExternalData_Add_Test(MyData
+#     NAME MyTest
+#     COMMAND MyExe DATA{MyInput.png}
+#     )
+#   ExternalData_Add_Target(MyData)
+# When test "MyTest" runs the "DATA{MyInput.png}" argument will be replaced by
+# the full path to a real instance of the data file "MyInput.png" on disk.  If
+# the source tree contains a content link such as "MyInput.png.md5" then the
+# "MyData" target creates a real "MyInput.png" in the build tree.
+#
+# The DATA{} syntax can be told to fetch a file series using the form
+# "DATA{<name>,:}", where the ":" is literal.  If the source tree contains a
+# group of files or content links named like a series then a reference to one
+# member adds rules to fetch all of them.  Although all members of a series
+# are fetched, only the file originally named by the DATA{} argument is
+# substituted for it.  The default configuration recognizes file series names
+# ending with "#.ext", "_#.ext", ".#.ext", or "-#.ext" where "#" is a sequence
+# of decimal digits and ".ext" is any single extension.  Configure it with a
+# regex that parses <number> and <suffix> parts from the end of <name>:
 #  ExternalData_SERIES_PARSE = regex of the form (<number>)(<suffix>)$
-#
-# For more complicated cases set::
-#
+# For more complicated cases set:
 #  ExternalData_SERIES_PARSE = regex with at least two () groups
 #  ExternalData_SERIES_PARSE_PREFIX = <prefix> regex group number, if any
 #  ExternalData_SERIES_PARSE_NUMBER = <number> regex group number
 #  ExternalData_SERIES_PARSE_SUFFIX = <suffix> regex group number
-#
 # Configure series number matching with a regex that matches the
-# ``<number>`` part of series members named ``<prefix><number><suffix>``::
-#
+# <number> part of series members named <prefix><number><suffix>:
 #  ExternalData_SERIES_MATCH = regex matching <number> in all series members
-#
-# Note that the ``<suffix>`` of a series does not include a hash-algorithm
+# Note that the <suffix> of a series does not include a hash-algorithm
 # extension.
 #
-# Referencing Associated Files
-# """"""""""""""""""""""""""""
-#
-# The ``DATA{}`` syntax can alternatively match files associated with the
-# named file and contained in the same directory.  Associated files may
-# be specified by options using the syntax
-# ``DATA{<name>,<opt1>,<opt2>,...}``.  Each option may specify one file by
-# name or specify a regular expression to match file names using the
-# syntax ``REGEX:<regex>``.  For example, the arguments::
-#
-#  DATA{MyData/MyInput.mhd,MyInput.img}                   # File pair
-#  DATA{MyData/MyFrames00.png,REGEX:MyFrames[0-9]+\\.png} # Series
-#
-# will pass ``MyInput.mha`` and ``MyFrames00.png`` on the command line but
-# ensure that the associated files are present next to them.
-#
-# Referencing Directories
-# """""""""""""""""""""""
-#
-# The ``DATA{}`` syntax may reference a directory using a trailing slash and
-# a list of associated files.  The form ``DATA{<name>/,<opt1>,<opt2>,...}``
-# adds rules to fetch any files in the directory that match one of the
-# associated file options.  For example, the argument
-# ``DATA{MyDataDir/,REGEX:.*}`` will pass the full path to a ``MyDataDir``
-# directory on the command line and ensure that the directory contains
-# files corresponding to every file or content link in the ``MyDataDir``
-# source directory.
-#
-# Hash Algorithms
-# ^^^^^^^^^^^^^^^
-#
-# The following hash algorithms are supported::
-#
-#  %(algo)     <ext>     Description
-#  -------     -----     -----------
-#  MD5         .md5      Message-Digest Algorithm 5, RFC 1321
-#  SHA1        .sha1     US Secure Hash Algorithm 1, RFC 3174
-#  SHA224      .sha224   US Secure Hash Algorithms, RFC 4634
-#  SHA256      .sha256   US Secure Hash Algorithms, RFC 4634
-#  SHA384      .sha384   US Secure Hash Algorithms, RFC 4634
-#  SHA512      .sha512   US Secure Hash Algorithms, RFC 4634
-#
-# Note that the hashes are used only for unique data identification and
-# download verification.
-#
-# .. _`ExternalData Custom Fetch Scripts`:
-#
-# Custom Fetch Scripts
-# ^^^^^^^^^^^^^^^^^^^^
-#
-# When a data file must be fetched from one of the URL templates
-# specified in the ``ExternalData_URL_TEMPLATES`` variable, it is
-# normally downloaded using the :command:`file(DOWNLOAD)` command.
-# One may specify usage of a custom fetch script by using a URL
-# template of the form ``ExternalDataCustomScript://<key>/<loc>``.
-# The ``<key>`` must be a C identifier, and the ``<loc>`` must
-# contain the ``%(algo)`` and ``%(hash)`` placeholders.
-# A variable corresponding to the key, ``ExternalData_CUSTOM_SCRIPT_<key>``,
-# must be set to the full path to a ``.cmake`` script file.  The script
-# will be included to perform the actual fetch, and provided with
-# the following variables:
-#
-# .. variable:: ExternalData_CUSTOM_LOCATION
-#
-#   When a custom fetch script is loaded, this variable is set to the
-#   location part of the URL, which will contain the substituted hash
-#   algorithm name and content hash value.
-#
-# .. variable:: ExternalData_CUSTOM_FILE
-#
-#   When a custom fetch script is loaded, this variable is set to the
-#   full path to a file in which the script must store the fetched
-#   content.  The name of the file is unspecified and should not be
-#   interpreted in any way.
-#
-# The custom fetch script is expected to store fetched content in the
-# file or set a variable:
-#
-# .. variable:: ExternalData_CUSTOM_ERROR
-#
-#   When a custom fetch script fails to fetch the requested content,
-#   it must set this variable to a short one-line message describing
-#   the reason for failure.
+# The DATA{} syntax can alternatively match files associated with the named
+# file and contained in the same directory.  Associated files may be specified
+# by options using the syntax DATA{<name>,<opt1>,<opt2>,...}.  Each option may
+# specify one file by name or specify a regular expression to match file names
+# using the syntax REGEX:<regex>.  For example, the arguments
+#   DATA{MyData/MyInput.mhd,MyInput.img}                   # File pair
+#   DATA{MyData/MyFrames00.png,REGEX:MyFrames[0-9]+\\.png} # Series
+# will pass MyInput.mha and MyFrames00.png on the command line but ensure
+# that the associated files are present next to them.
+#
+# The DATA{} syntax may reference a directory using a trailing slash and a
+# list of associated files.  The form DATA{<name>/,<opt1>,<opt2>,...} adds
+# rules to fetch any files in the directory that match one of the associated
+# file options.  For example, the argument DATA{MyDataDir/,REGEX:.*} will pass
+# the full path to a MyDataDir directory on the command line and ensure that
+# the directory contains files corresponding to every file or content link in
+# the MyDataDir source directory.
+#
+# The variable ExternalData_LINK_CONTENT may be set to the name of a supported
+# hash algorithm to enable automatic conversion of real data files referenced
+# by the DATA{} syntax into content links.  For each such <file> a content
+# link named "<file><ext>" is created.  The original file is renamed to the
+# form ".ExternalData_<algo>_<hash>" to stage it for future transmission to
+# one of the locations in the list of URL templates (by means outside the
+# scope of this module).  The data fetch rule created for the content link
+# will use the staged object if it cannot be found using any URL template.
+#
+# The variable ExternalData_OBJECT_STORES may be set to a list of local
+# directories that store objects using the layout <dir>/%(algo)/%(hash).
+# These directories will be searched first for a needed object.  If the object
+# is not available in any store then it will be fetched remotely using the URL
+# templates and added to the first local store listed.  If no stores are
+# specified the default is a location inside the build tree.
+#
+# The variable ExternalData_SOURCE_ROOT may be set to the highest source
+# directory containing any path named by a DATA{} reference.  The default is
+# CMAKE_SOURCE_DIR.  ExternalData_SOURCE_ROOT and CMAKE_SOURCE_DIR must refer
+# to directories within a single source distribution (e.g. they come together
+# in one tarball).
+#
+# The variable ExternalData_BINARY_ROOT may be set to the directory to hold
+# the real data files named by expanded DATA{} references.  The default is
+# CMAKE_BINARY_DIR.  The directory layout will mirror that of content links
+# under ExternalData_SOURCE_ROOT.
+#
+# Variables ExternalData_TIMEOUT_INACTIVITY and ExternalData_TIMEOUT_ABSOLUTE
+# set the download inactivity and absolute timeouts, in seconds.  The defaults
+# are 60 seconds and 300 seconds, respectively.  Set either timeout to 0
+# seconds to disable enforcement.
 
 #=============================================================================
-# Copyright 2010-2015 Kitware, Inc.
+# Copyright 2010-2013 Kitware, Inc.
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -342,63 +177,12 @@ function(ExternalData_add_test target)
 endfunction()
 
 function(ExternalData_add_target target)
-  if(NOT ExternalData_URL_TEMPLATES AND NOT ExternalData_OBJECT_STORES)
-    message(FATAL_ERROR
-      "Neither ExternalData_URL_TEMPLATES nor ExternalData_OBJECT_STORES is set!")
+  if(NOT ExternalData_URL_TEMPLATES)
+    message(FATAL_ERROR "ExternalData_URL_TEMPLATES is not set!")
   endif()
   if(NOT ExternalData_OBJECT_STORES)
     set(ExternalData_OBJECT_STORES ${CMAKE_BINARY_DIR}/ExternalData/Objects)
   endif()
-  set(_ExternalData_CONFIG_CODE "")
-
-  # Store custom script configuration.
-  foreach(url_template IN LISTS ExternalData_URL_TEMPLATES)
-    if("${url_template}" MATCHES "^ExternalDataCustomScript://([^/]*)/(.*)$")
-      set(key "${CMAKE_MATCH_1}")
-      if(key MATCHES "^[A-Za-z_][A-Za-z0-9_]*$")
-        if(ExternalData_CUSTOM_SCRIPT_${key})
-          if(IS_ABSOLUTE "${ExternalData_CUSTOM_SCRIPT_${key}}")
-            string(CONCAT _ExternalData_CONFIG_CODE "${_ExternalData_CONFIG_CODE}\n"
-              "set(ExternalData_CUSTOM_SCRIPT_${key} \"${ExternalData_CUSTOM_SCRIPT_${key}}\")")
-          else()
-            message(FATAL_ERROR
-              "No ExternalData_CUSTOM_SCRIPT_${key} is not set to a full path:\n"
-              " ${ExternalData_CUSTOM_SCRIPT_${key}}")
-          endif()
-        else()
-          message(FATAL_ERROR
-            "No ExternalData_CUSTOM_SCRIPT_${key} is set for URL template:\n"
-            " ${url_template}")
-        endif()
-      else()
-        message(FATAL_ERROR
-          "Bad ExternalDataCustomScript key '${key}' in URL template:\n"
-          " ${url_template}\n"
-          "The key must be a valid C identifier.")
-      endif()
-    endif()
-
-    # Store custom algorithm name to URL component maps.
-    if("${url_template}" MATCHES "%\\(algo:([^)]*)\\)")
-      set(key "${CMAKE_MATCH_1}")
-      if(key MATCHES "^[A-Za-z_][A-Za-z0-9_]*$")
-        string(REPLACE "|" ";" _algos "${_ExternalData_REGEX_ALGO}")
-        foreach(algo ${_algos})
-          if(DEFINED ExternalData_URL_ALGO_${algo}_${key})
-            string(CONCAT _ExternalData_CONFIG_CODE "${_ExternalData_CONFIG_CODE}\n"
-              "set(ExternalData_URL_ALGO_${algo}_${key} \"${ExternalData_URL_ALGO_${algo}_${key}}\")")
-          endif()
-        endforeach()
-      else()
-        message(FATAL_ERROR
-          "Bad %(algo:${key}) in URL template:\n"
-          " ${url_template}\n"
-          "The transform name must be a valid C identifier.")
-      endif()
-    endif()
-  endforeach()
-
-  # Store configuration for use by build-time script.
   set(config ${CMAKE_CURRENT_BINARY_DIR}/${target}_config.cmake)
   configure_file(${_ExternalData_SELF_DIR}/ExternalData_config.cmake.in ${config} @ONLY)
 
@@ -482,7 +266,8 @@ function(ExternalData_expand_arguments target outArgsVar)
       foreach(piece IN LISTS pieces)
         if("x${piece}" MATCHES "^x${data_regex}$")
           # Replace this DATA{}-piece with a file path.
-          _ExternalData_arg("${target}" "${piece}" "${CMAKE_MATCH_1}" file)
+          string(REGEX REPLACE "${data_regex}" "\\1" data "${piece}")
+          _ExternalData_arg("${target}" "${piece}" "${data}" file)
           set(outArg "${outArg}${file}")
         else()
           # No replacement needed for this piece.
@@ -621,10 +406,11 @@ function(_ExternalData_arg target arg options var_file)
   set(associated_files "")
   set(associated_regex "")
   foreach(opt ${options})
-    # Regular expression to match associated files.
-    if("x${opt}" MATCHES "^xREGEX:([^:/]+)$")
-      list(APPEND associated_regex "${CMAKE_MATCH_1}")
-    elseif(opt STREQUAL ":")
+    if("x${opt}" MATCHES "^xREGEX:[^:/]+$")
+      # Regular expression to match associated files.
+      string(REGEX REPLACE "^REGEX:" "" regex "${opt}")
+      list(APPEND associated_regex "${regex}")
+    elseif("x${opt}" MATCHES "^x:$")
       # Activate series matching.
       set(series_option "${opt}")
     elseif("x${opt}" MATCHES "^[^][:/*?]+$")
@@ -831,9 +617,8 @@ endif()
 if(ExternalData_CONFIG)
   include(${ExternalData_CONFIG})
 endif()
-if(NOT ExternalData_URL_TEMPLATES AND NOT ExternalData_OBJECT_STORES)
-  message(FATAL_ERROR
-    "Neither ExternalData_URL_TEMPLATES nor ExternalData_OBJECT_STORES is set!")
+if(NOT ExternalData_URL_TEMPLATES)
+  message(FATAL_ERROR "No ExternalData_URL_TEMPLATES set!")
 endif()
 
 function(_ExternalData_link_or_copy src dst)
@@ -908,30 +693,6 @@ function(_ExternalData_download_file url file err_var msg_var)
   set("${msg_var}" "${msg}" PARENT_SCOPE)
 endfunction()
 
-function(_ExternalData_custom_fetch key loc file err_var msg_var)
-  if(NOT ExternalData_CUSTOM_SCRIPT_${key})
-    set(err 1)
-    set(msg "No ExternalData_CUSTOM_SCRIPT_${key} set!")
-  elseif(NOT EXISTS "${ExternalData_CUSTOM_SCRIPT_${key}}")
-    set(err 1)
-    set(msg "No '${ExternalData_CUSTOM_SCRIPT_${key}}' exists!")
-  else()
-    set(ExternalData_CUSTOM_LOCATION "${loc}")
-    set(ExternalData_CUSTOM_FILE "${file}")
-    unset(ExternalData_CUSTOM_ERROR)
-    include("${ExternalData_CUSTOM_SCRIPT_${key}}")
-    if(DEFINED ExternalData_CUSTOM_ERROR)
-      set(err 1)
-      set(msg "${ExternalData_CUSTOM_ERROR}")
-    else()
-      set(err 0)
-      set(msg "no error")
-    endif()
-  endif()
-  set("${err_var}" "${err}" PARENT_SCOPE)
-  set("${msg_var}" "${msg}" PARENT_SCOPE)
-endfunction()
-
 function(_ExternalData_download_object name hash algo var_obj)
   # Search all object stores for an existing object.
   foreach(dir ${ExternalData_OBJECT_STORES})
@@ -954,22 +715,8 @@ function(_ExternalData_download_object name hash algo var_obj)
   foreach(url_template IN LISTS ExternalData_URL_TEMPLATES)
     string(REPLACE "%(hash)" "${hash}" url_tmp "${url_template}")
     string(REPLACE "%(algo)" "${algo}" url "${url_tmp}")
-    if(url MATCHES "^(.*)%\\(algo:([A-Za-z_][A-Za-z0-9_]*)\\)(.*)$")
-      set(lhs "${CMAKE_MATCH_1}")
-      set(key "${CMAKE_MATCH_2}")
-      set(rhs "${CMAKE_MATCH_3}")
-      if(DEFINED ExternalData_URL_ALGO_${algo}_${key})
-        set(url "${lhs}${ExternalData_URL_ALGO_${algo}_${key}}${rhs}")
-      else()
-        set(url "${lhs}${algo}${rhs}")
-      endif()
-    endif()
     message(STATUS "Fetching \"${url}\"")
-    if(url MATCHES "^ExternalDataCustomScript://([A-Za-z_][A-Za-z0-9_]*)/(.*)$")
-      _ExternalData_custom_fetch("${CMAKE_MATCH_1}" "${CMAKE_MATCH_2}" "${tmp}" err errMsg)
-    else()
-      _ExternalData_download_file("${url}" "${tmp}" err errMsg)
-    endif()
+    _ExternalData_download_file("${url}" "${tmp}" err errMsg)
     set(tried "${tried}\n  ${url}")
     if(err)
       set(tried "${tried} (${errMsg})")
@@ -999,9 +746,6 @@ function(_ExternalData_download_object name hash algo var_obj)
     set(obj "${staged}")
     message(STATUS "Staged object: \"${obj}\"")
   else()
-    if(NOT tried)
-      set(tried "\n  (No ExternalData_URL_TEMPLATES given)")
-    endif()
     message(FATAL_ERROR "Object ${algo}=${hash} not found at:${tried}")
   endif()
 
diff --git a/CMake/ExternalData_config.cmake.in b/CMake/ExternalData_config.cmake.in
index 4434e4b..0858f53 100644
--- a/CMake/ExternalData_config.cmake.in
+++ b/CMake/ExternalData_config.cmake.in
@@ -2,4 +2,3 @@ set(ExternalData_OBJECT_STORES "@ExternalData_OBJECT_STORES@")
 set(ExternalData_URL_TEMPLATES "@ExternalData_URL_TEMPLATES@")
 set(ExternalData_TIMEOUT_INACTIVITY "@ExternalData_TIMEOUT_INACTIVITY@")
 set(ExternalData_TIMEOUT_ABSOLUTE "@ExternalData_TIMEOUT_ABSOLUTE@")
- at _ExternalData_CONFIG_CODE@
diff --git a/CMake/FindADIOS.cmake b/CMake/FindADIOS.cmake
index 9a0e949..f182fa4 100644
--- a/CMake/FindADIOS.cmake
+++ b/CMake/FindADIOS.cmake
@@ -225,6 +225,10 @@ if(ADIOS_FOUND)
         unset(_LIB_DIR)
     endforeach()
 
+    #add libraries which are already using cmake format
+    string(REGEX MATCHALL "/([A-Za-z_0-9/\\.-]+)\\.([a|so]+)" _ADIOS_LIBS_SUB "${ADIOS_LINKFLAGS}")
+    list(APPEND ADIOS_LIBRARIES "${_ADIOS_LIBS_SUB}")
+
     # add the version string
     execute_process(COMMAND ${ADIOS_CONFIG} -v
                     OUTPUT_VARIABLE ADIOS_VERSION
diff --git a/CMake/FindJsonCpp.cmake b/CMake/FindJsonCpp.cmake
index e75b9f2..e4e7ab4 100644
--- a/CMake/FindJsonCpp.cmake
+++ b/CMake/FindJsonCpp.cmake
@@ -19,21 +19,8 @@ find_library(JsonCpp_LIBRARY
 set(JsonCpp_INCLUDE_DIRS ${JsonCpp_INCLUDE_DIR})
 set(JsonCpp_LIBRARIES "${JsonCpp_LIBRARY}")
 
-set(_JsonCpp_version_args)
-if (EXISTS "${JsonCpp_INCLUDE_DIR}/json/version.h")
-  file(STRINGS "${JsonCpp_INCLUDE_DIR}/json/version.h" _JsonCpp_version_contents REGEX "JSONCPP_VERSION_[A-Z]+")
-  foreach (_JsonCpp_version_part MAJOR MINOR PATCH)
-    string(REGEX REPLACE ".*# *define +JSONCPP_VERSION_${_JsonCpp_version_part} +([0-9]+).*" "\\1" JsonCpp_VERSION_${_JsonCpp_version_part} "${_JsonCpp_version_contents}")
-  endforeach ()
-
-  set(JsonCpp_VERSION_STRING "${JsonCpp_VERSION_MAJOR}.${JsonCpp_VERSION_MINOR}.${JsonCpp_VERSION_PATCH}")
-
-  set(_JsonCpp_version_args VERSION_VAR JsonCpp_VERSION_STRING)
-endif ()
-
 include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(JsonCpp
-  REQUIRED_VARS JsonCpp_LIBRARIES JsonCpp_INCLUDE_DIRS
-  ${_JsonCpp_version_args})
+find_package_handle_standard_args(JsonCpp DEFAULT_MSG
+  JsonCpp_LIBRARIES JsonCpp_INCLUDE_DIRS)
 
 mark_as_advanced(JsonCpp_INCLUDE_DIR JsonCpp_LIBRARY)
diff --git a/CMake/FindOpenMP.cmake b/CMake/FindOpenMP.cmake
deleted file mode 100644
index 5f83c44..0000000
--- a/CMake/FindOpenMP.cmake
+++ /dev/null
@@ -1,358 +0,0 @@
-#.rst:
-# FindOpenMP
-# ----------
-#
-# Finds OpenMP support
-#
-# This module can be used to detect OpenMP support in a compiler.  If
-# the compiler supports OpenMP, the flags required to compile with
-# OpenMP support are returned in variables for the different languages.
-# The variables may be empty if the compiler does not need a special
-# flag to support OpenMP.
-#
-# The following variables are set:
-#
-# ::
-#
-#    OpenMP_C_FLAGS - flags to add to the C compiler for OpenMP support
-#    OpenMP_C_LIBRARIES - OpenMP C libraries to link against
-#    OpenMP_CXX_FLAGS - flags to add to the CXX compiler for OpenMP support
-#    OpenMP_CXX_LIBRARIES - OpenMP CXX libraries to link against
-#    OpenMP_Fortran_FLAGS - flags to add to the Fortran compiler for OpenMP support
-#    OpenMP_Fortran_LIBRARIES - OpenMP Fortran libraries to link against
-#    OPENMP_FOUND - true if openmp is detected
-#
-# The following internal variables are set, if detected:
-#    OpenMP_C_SPEC_DATE - specification date of OpenMP version of C compiler
-#    OpenMP_CXX_SPEC_DATE - specification date of OpenMP version of CXX compiler
-#    OpenMP_Fortran_SPEC_DATE - specification date of OpenMP version of Fortran compiler
-#
-#
-#
-# Supported compilers can be found at
-# http://openmp.org/wp/openmp-compilers/
-# Specification dates for each version can be found at
-# http://openmp.org/wp/openmp-specifications/
-
-#=============================================================================
-# Copyright 2009 Kitware, Inc.
-# Copyright 2008-2009 André Rigland Brodtkorb <Andre.Brodtkorb at ifi.uio.no>
-# Copyright 2012 Rolf Eike Beer <eike at sf-mail.de>
-# Copyright 2014 Nicolas Bock <nicolasbock at gmail.com>
-#
-# 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.)
-
-
-set(_OPENMP_REQUIRED_VARS)
-set(CMAKE_REQUIRED_QUIET_SAVE ${CMAKE_REQUIRED_QUIET})
-set(CMAKE_REQUIRED_QUIET ${OpenMP_FIND_QUIETLY})
-
-function(_OPENMP_FLAG_CANDIDATES LANG)
-  set(OpenMP_FLAG_CANDIDATES
-    #Empty, if compiler automatically accepts openmp
-    " "
-    #GNU
-    "-fopenmp"
-    #Microsoft Visual Studio
-    "/openmp"
-    #Intel windows
-    "-Qopenmp"
-    #PathScale, Intel
-    "-openmp"
-    #Sun
-    "-xopenmp"
-    #HP
-    "+Oopenmp"
-    #IBM XL C/c++
-    "-qsmp"
-    #Portland Group, MIPSpro
-    "-mp"
-  )
-
-  set(OMP_FLAG_GNU "-fopenmp")
-  set(OMP_FLAG_HP "+Oopenmp")
-  if(WIN32)
-    set(OMP_FLAG_Intel "-Qopenmp")
-  elseif(CMAKE_${LANG}_COMPILER_ID STREQUAL "Intel" AND
-         "${CMAKE_${LANG}_COMPILER_VERSION}" VERSION_LESS "15.0.0.20140528")
-    set(OMP_FLAG_Intel "-openmp")
-  else()
-    set(OMP_FLAG_Intel "-qopenmp")
-  endif()
-  set(OMP_FLAG_MIPSpro "-mp")
-  set(OMP_FLAG_MSVC "/openmp")
-  set(OMP_FLAG_PathScale "-openmp")
-  set(OMP_FLAG_PGI "-mp")
-  set(OMP_FLAG_SunPro "-xopenmp")
-  set(OMP_FLAG_XL "-qsmp")
-  set(OMP_FLAG_Cray " ")
-
-  # Move the flag that matches the compiler to the head of the list,
-  # this is faster and doesn't clutter the output that much. If that
-  # flag doesn't work we will still try all.
-  if(OMP_FLAG_${CMAKE_${LANG}_COMPILER_ID})
-    list(REMOVE_ITEM OpenMP_FLAG_CANDIDATES "${OMP_FLAG_${CMAKE_${LANG}_COMPILER_ID}}")
-    list(INSERT OpenMP_FLAG_CANDIDATES 0 "${OMP_FLAG_${CMAKE_${LANG}_COMPILER_ID}}")
-  endif()
-
-  set(OpenMP_${LANG}_FLAG_CANDIDATES "${OpenMP_FLAG_CANDIDATES}" PARENT_SCOPE)
-endfunction()
-
-# sample openmp source code to test
-set(OpenMP_C_TEST_SOURCE
-"
-#include <omp.h>
-int main() {
-#ifdef _OPENMP
-  return 0;
-#else
-  breaks_on_purpose
-#endif
-}
-")
-
-# same in Fortran
-set(OpenMP_Fortran_TEST_SOURCE
-  "
-      program test
-      use omp_lib
-      integer :: n
-      n = omp_get_num_threads()
-      end program test
-  "
-  )
-
-set(OpenMP_C_CXX_CHECK_VERSION_SOURCE
-"
-#include <stdio.h>
-#include <omp.h>
-const char ompver_str[] = { 'I', 'N', 'F', 'O', ':', 'O', 'p', 'e', 'n', 'M',
-                            'P', '-', 'd', 'a', 't', 'e', '[',
-                            ('0' + ((_OPENMP/100000)%10)),
-                            ('0' + ((_OPENMP/10000)%10)),
-                            ('0' + ((_OPENMP/1000)%10)),
-                            ('0' + ((_OPENMP/100)%10)),
-                            ('0' + ((_OPENMP/10)%10)),
-                            ('0' + ((_OPENMP/1)%10)),
-                            ']', '\\0' };
-int main(int argc, char *argv[])
-{
-  printf(\"%s\\n\", ompver_str);
-  return 0;
-}
-")
-
-set(OpenMP_Fortran_CHECK_VERSION_SOURCE
-"
-      program omp_ver
-      use omp_lib
-      integer, parameter :: zero = ichar('0')
-      integer, parameter :: ompv = openmp_version
-      character, dimension(24), parameter :: ompver_str =&
-      (/ 'I', 'N', 'F', 'O', ':', 'O', 'p', 'e', 'n', 'M', 'P', '-',&
-         'd', 'a', 't', 'e', '[',&
-         char(zero + mod(ompv/100000, 10)),&
-         char(zero + mod(ompv/10000, 10)),&
-         char(zero + mod(ompv/1000, 10)),&
-         char(zero + mod(ompv/100, 10)),&
-         char(zero + mod(ompv/10, 10)),&
-         char(zero + mod(ompv/1, 10)), ']' /)
-      print *, ompver_str
-      end program omp_ver
-")
-
-function(_OPENMP_GET_SPEC_DATE LANG SPEC_DATE)
-  set(WORK_DIR ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/FindOpenMP)
-  if("${LANG}" STREQUAL "C")
-    set(SRC_FILE ${WORK_DIR}/ompver.c)
-    file(WRITE ${SRC_FILE} "${OpenMP_C_CXX_CHECK_VERSION_SOURCE}")
-  elseif("${LANG}" STREQUAL "CXX")
-    set(SRC_FILE ${WORK_DIR}/ompver.cpp)
-    file(WRITE ${SRC_FILE} "${OpenMP_C_CXX_CHECK_VERSION_SOURCE}")
-  else() # ("${LANG}" STREQUAL "Fortran")
-    set(SRC_FILE ${WORK_DIR}/ompver.f90)
-    file(WRITE ${SRC_FILE} "${OpenMP_Fortran_CHECK_VERSION_SOURCE}")
-  endif()
-
-  set(BIN_FILE ${WORK_DIR}/ompver_${LANG}.bin)
-  try_compile(OpenMP_TRY_COMPILE_RESULT ${CMAKE_BINARY_DIR} ${SRC_FILE}
-              COMPILE_DEFINITIONS ${OpenMP_${LANG}_FLAGS}
-              LINK_LIBRARIES "${OpenMP_${LANG}_LIBRARIES}"
-              COPY_FILE ${BIN_FILE})
-
-  if(${OpenMP_TRY_COMPILE_RESULT})
-    file(STRINGS ${BIN_FILE} specstr LIMIT_COUNT 1 REGEX "INFO:OpenMP-date")
-    set(regex_spec_date ".*INFO:OpenMP-date\\[0*([^]]*)\\].*")
-    if("${specstr}" MATCHES "${regex_spec_date}")
-      set(${SPEC_DATE} "${CMAKE_MATCH_1}" PARENT_SCOPE)
-    endif()
-  endif()
-endfunction()
-
-
-# check c compiler
-if(CMAKE_C_COMPILER_LOADED)
-  # if these are set then do not try to find them again,
-  # by avoiding any try_compiles for the flags
-  if(OpenMP_C_FLAGS)
-    unset(OpenMP_C_FLAG_CANDIDATES)
-  else()
-    _OPENMP_FLAG_CANDIDATES("C")
-    include(CheckCSourceCompiles)
-  endif()
-
-  foreach(FLAG IN LISTS OpenMP_C_FLAG_CANDIDATES)
-    set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
-    set(CMAKE_REQUIRED_FLAGS "${FLAG}")
-    unset(OpenMP_FLAG_DETECTED CACHE)
-    if(NOT CMAKE_REQUIRED_QUIET)
-      message(STATUS "Try OpenMP C flag = [${FLAG}]")
-    endif()
-    check_c_source_compiles("${OpenMP_C_TEST_SOURCE}" OpenMP_FLAG_DETECTED)
-    set(CMAKE_REQUIRED_FLAGS "${SAFE_CMAKE_REQUIRED_FLAGS}")
-    if(OpenMP_FLAG_DETECTED)
-      set(OpenMP_C_FLAGS_INTERNAL "${FLAG}")
-      break()
-    endif()
-  endforeach()
-
-  set(OpenMP_C_FLAGS "${OpenMP_C_FLAGS_INTERNAL}"
-    CACHE STRING "C compiler flags for OpenMP parallization")
-
-  list(APPEND _OPENMP_REQUIRED_VARS OpenMP_C_FLAGS)
-  unset(OpenMP_C_FLAG_CANDIDATES)
-
-  if (NOT "x${CMAKE_C_COMPILER_ID}" STREQUAL "xMSVC")
-    set(OpenMP_C_LIBRARY "${OpenMP_C_FLAGS}" CACHE
-      STRING "C library for OpenMP")
-    list(APPEND _OPENMP_REQUIRED_VARS OpenMP_C_LIBRARY)
-  endif()
-  set(OpenMP_C_LIBRARIES "${OpenMP_C_LIBRARY}")
-
-  if (NOT OpenMP_C_SPEC_DATE)
-    _OPENMP_GET_SPEC_DATE("C" OpenMP_C_SPEC_DATE_INTERNAL)
-    set(OpenMP_C_SPEC_DATE "${OpenMP_C_SPEC_DATE_INTERNAL}" CACHE
-      INTERNAL "C compiler's OpenMP specification date")
-  endif()
-endif()
-
-# check cxx compiler
-if(CMAKE_CXX_COMPILER_LOADED)
-  # if these are set then do not try to find them again,
-  # by avoiding any try_compiles for the flags
-  if(OpenMP_CXX_FLAGS)
-    unset(OpenMP_CXX_FLAG_CANDIDATES)
-  else()
-    _OPENMP_FLAG_CANDIDATES("CXX")
-    include(CheckCXXSourceCompiles)
-
-    # use the same source for CXX as C for now
-    set(OpenMP_CXX_TEST_SOURCE ${OpenMP_C_TEST_SOURCE})
-  endif()
-
-  foreach(FLAG IN LISTS OpenMP_CXX_FLAG_CANDIDATES)
-    set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
-    set(CMAKE_REQUIRED_FLAGS "${FLAG}")
-    unset(OpenMP_FLAG_DETECTED CACHE)
-    if(NOT CMAKE_REQUIRED_QUIET)
-      message(STATUS "Try OpenMP CXX flag = [${FLAG}]")
-    endif()
-    check_cxx_source_compiles("${OpenMP_CXX_TEST_SOURCE}" OpenMP_FLAG_DETECTED)
-    set(CMAKE_REQUIRED_FLAGS "${SAFE_CMAKE_REQUIRED_FLAGS}")
-    if(OpenMP_FLAG_DETECTED)
-      set(OpenMP_CXX_FLAGS_INTERNAL "${FLAG}")
-      break()
-    endif()
-  endforeach()
-
-  set(OpenMP_CXX_FLAGS "${OpenMP_CXX_FLAGS_INTERNAL}"
-    CACHE STRING "C++ compiler flags for OpenMP parallization")
-
-  list(APPEND _OPENMP_REQUIRED_VARS OpenMP_CXX_FLAGS)
-  unset(OpenMP_CXX_FLAG_CANDIDATES)
-  unset(OpenMP_CXX_TEST_SOURCE)
-  unset(OpenMP_C_TEST_SOURCE)
-
-  if (NOT "x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC")
-    set(OpenMP_CXX_LIBRARY "${OpenMP_CXX_FLAGS}" CACHE
-      STRING "CXX library for OpenMP")
-    list(APPEND _OPENMP_REQUIRED_VARS OpenMP_CXX_LIBRARY)
-  endif()
-  set(OpenMP_CXX_LIBRARIES "${OpenMP_CXX_LIBRARY}")
-
-  if (NOT OpenMP_CXX_SPEC_DATE)
-    _OPENMP_GET_SPEC_DATE("CXX" OpenMP_CXX_SPEC_DATE_INTERNAL)
-    set(OpenMP_CXX_SPEC_DATE "${OpenMP_CXX_SPEC_DATE_INTERNAL}" CACHE
-      INTERNAL "C++ compiler's OpenMP specification date")
-  endif()
-  unset(OpenMP_C_CXX_CHECK_VERSION_SOURCE)
-endif()
-
-# check Fortran compiler
-if(CMAKE_Fortran_COMPILER_LOADED)
-  # if these are set then do not try to find them again,
-  # by avoiding any try_compiles for the flags
-  if(OpenMP_Fortran_FLAGS)
-    unset(OpenMP_Fortran_FLAG_CANDIDATES)
-  else()
-    _OPENMP_FLAG_CANDIDATES("Fortran")
-    include(CheckFortranSourceCompiles)
-  endif()
-
-  foreach(FLAG IN LISTS OpenMP_Fortran_FLAG_CANDIDATES)
-    set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
-    set(CMAKE_REQUIRED_FLAGS "${FLAG}")
-    unset(OpenMP_FLAG_DETECTED CACHE)
-    if(NOT CMAKE_REQUIRED_QUIET)
-      message(STATUS "Try OpenMP Fortran flag = [${FLAG}]")
-    endif()
-    check_fortran_source_compiles("${OpenMP_Fortran_TEST_SOURCE}" OpenMP_FLAG_DETECTED)
-    set(CMAKE_REQUIRED_FLAGS "${SAFE_CMAKE_REQUIRED_FLAGS}")
-    if(OpenMP_FLAG_DETECTED)
-      set(OpenMP_Fortran_FLAGS_INTERNAL "${FLAG}")
-      break()
-    endif()
-  endforeach()
-
-  set(OpenMP_Fortran_FLAGS "${OpenMP_Fortran_FLAGS_INTERNAL}"
-    CACHE STRING "Fortran compiler flags for OpenMP parallization")
-
-  list(APPEND _OPENMP_REQUIRED_VARS OpenMP_Fortran_FLAGS)
-  unset(OpenMP_Fortran_FLAG_CANDIDATES)
-  unset(OpenMP_Fortran_TEST_SOURCE)
-
-  set(OpenMP_Fortran_LIBRARY "${OpenMP_Fortran_FLAGS}" CACHE
-    STRING "Fortran library for OpenMP")
-  list(APPEND _OPENMP_REQUIRED_VARS OpenMP_Fortran_LIBRARY)
-  set(OpenMP_Fortran_LIBRARIES "${OpenMP_Fortran_LIBRARY}")
-
-  if (NOT OpenMP_Fortran_SPEC_DATE)
-    _OPENMP_GET_SPEC_DATE("Fortran" OpenMP_Fortran_SPEC_DATE_INTERNAL)
-    set(OpenMP_Fortran_SPEC_DATE "${OpenMP_Fortran_SPEC_DATE_INTERNAL}" CACHE
-      INTERNAL "Fortran compiler's OpenMP specification date")
-  endif()
-  unset(OpenMP_Fortran_CHECK_VERSION_SOURCE)
-endif()
-
-set(CMAKE_REQUIRED_QUIET ${CMAKE_REQUIRED_QUIET_SAVE})
-
-if(_OPENMP_REQUIRED_VARS)
-  include(FindPackageHandleStandardArgs)
-
-  find_package_handle_standard_args(OpenMP
-                                    REQUIRED_VARS ${_OPENMP_REQUIRED_VARS})
-
-  mark_as_advanced(${_OPENMP_REQUIRED_VARS})
-
-  unset(_OPENMP_REQUIRED_VARS)
-else()
-  message(SEND_ERROR "FindOpenMP requires C or CXX language to be enabled")
-endif()
diff --git a/CMake/FindTBB.cmake b/CMake/FindTBB.cmake
index c81a735..0fb112c 100644
--- a/CMake/FindTBB.cmake
+++ b/CMake/FindTBB.cmake
@@ -1,345 +1,283 @@
-# - Find ThreadingBuildingBlocks include dirs and libraries
-# Use this module by invoking find_package with the form:
-#  find_package(TBB
-#    [REQUIRED]             # Fail with error if TBB is not found
-#    )                      #
-# Once done, this will define
+# Locate Intel Threading Building Blocks include paths and libraries
+# FindTBB.cmake can be found at https://code.google.com/p/findtbb/
+# Written by Hannes Hofmann <hannes.hofmann _at_ informatik.uni-erlangen.de>
+# Improvements by Gino van den Bergen <gino _at_ dtecta.com>,
+#   Florian Uhlig <F.Uhlig _at_ gsi.de>,
+#   Jiri Marsik <jiri.marsik89 _at_ gmail.com>
+
+# The MIT License
 #
-#  TBB_FOUND - system has TBB
-#  TBB_INCLUDE_DIRS - the TBB include directories
-#  TBB_LIBRARIES - TBB libraries to be lined, doesn't include malloc or
-#                  malloc proxy
+# Copyright (c) 2011 Hannes Hofmann
 #
-#  TBB_VERSION_MAJOR - Major Product Version Number
-#  TBB_VERSION_MINOR - Minor Product Version Number
-#  TBB_INTERFACE_VERSION - Engineering Focused Version Number
-#  TBB_COMPATIBLE_INTERFACE_VERSION - The oldest major interface version
-#                                     still supported. This uses the engineering
-#                                     focused interface version numbers.
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
 #
-#  TBB_MALLOC_FOUND - system has TBB malloc library
-#  TBB_MALLOC_INCLUDE_DIRS - the TBB malloc include directories
-#  TBB_MALLOC_LIBRARIES - The TBB malloc libraries to be lined
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
 #
-#  TBB_MALLOC_PROXY_FOUND - system has TBB malloc proxy library
-#  TBB_MALLOC_PROXY_INCLUDE_DIRS = the TBB malloc proxy include directories
-#  TBB_MALLOC_PROXY_LIBRARIES - The TBB malloc proxy libraries to be lined
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+
+# GvdB: This module uses the environment variable TBB_ARCH_PLATFORM which defines architecture and compiler.
+#   e.g. "ia32/vc8" or "em64t/cc4.1.0_libc2.4_kernel2.6.16.21"
+#   TBB_ARCH_PLATFORM is set by the build script tbbvars[.bat|.sh|.csh], which can be found
+#   in the TBB installation directory (TBB_INSTALL_DIR).
 #
+# GvdB: Mac OS X distribution places libraries directly in lib directory.
 #
-# This module reads hints about search locations from variables:
-#  ENV TBB_ARCH_PLATFORM - for eg. set it to "mic" for Xeon Phi builds
-#  ENV TBB_ROOT or just TBB_ROOT - root directory of tbb installation
-#  ENV TBB_BUILD_PREFIX - specifies the build prefix for user built tbb
-#                         libraries. Should be specified with ENV TBB_ROOT
-#                         and optionally...
-#  ENV TBB_BUILD_DIR - if build directory is different than ${TBB_ROOT}/build
-#
-#
-# Modified by Robert Maynard from the original OGRE source
-#
-#-------------------------------------------------------------------
-# This file is part of the CMake build system for OGRE
-#     (Object-oriented Graphics Rendering Engine)
-# For the latest info, see http://www.ogre3d.org/
-#
-# The contents of this file are placed in the public domain. Feel
-# free to make use of it in any way you like.
-#-------------------------------------------------------------------
-#
-#=============================================================================
-# Copyright 2010-2012 Kitware, Inc.
-# Copyright 2012      Rolf Eike Beer <eike at sf-mail.de>
-#
-# 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.)
-
-
-#=============================================================================
-#  FindTBB helper functions and macros
-#
+# For backwards compatibility, you may explicitely set the CMake variables TBB_ARCHITECTURE and TBB_COMPILER.
+# TBB_ARCHITECTURE [ ia32 | em64t | itanium ]
+#   which architecture to use
+# TBB_COMPILER e.g. vc9 or cc3.2.3_libc2.3.2_kernel2.4.21 or cc4.0.1_os10.4.9
+#   which compiler to use (detected automatically on Windows)
+
+# This module respects
+# TBB_INSTALL_DIR or $ENV{TBB21_INSTALL_DIR} or $ENV{TBB_INSTALL_DIR}
+
+# This module defines
+# TBB_INCLUDE_DIRS, where to find task_scheduler_init.h, etc.
+# TBB_LIBRARY_DIRS, where to find libtbb, libtbbmalloc
+# TBB_DEBUG_LIBRARY_DIRS, where to find libtbb_debug, libtbbmalloc_debug
+# TBB_INSTALL_DIR, the base TBB install directory
+# TBB_LIBRARIES, the libraries to link against to use TBB.
+# TBB_DEBUG_LIBRARIES, the libraries to link against to use TBB with debug symbols.
+# TBB_FOUND, If false, don't try to use TBB.
+# TBB_INTERFACE_VERSION, as defined in tbb/tbb_stddef.h
+
+
+if (WIN32)
+    # has em64t/vc8 em64t/vc9
+    # has ia32/vc7.1 ia32/vc8 ia32/vc9
+    set(_TBB_DEFAULT_INSTALL_DIR "C:/Program Files/Intel/TBB" "C:/Program Files (x86)/Intel/TBB")
+    set(_TBB_LIB_NAME "tbb")
+    set(_TBB_LIB_MALLOC_NAME "${_TBB_LIB_NAME}malloc")
+    set(_TBB_LIB_DEBUG_NAME "${_TBB_LIB_NAME}_debug")
+    set(_TBB_LIB_MALLOC_DEBUG_NAME "${_TBB_LIB_MALLOC_NAME}_debug")
+    if (MSVC71)
+        set (_TBB_COMPILER "vc7.1")
+    endif()
+    if (MSVC80)
+        set(_TBB_COMPILER "vc8")
+    endif()
+    if (MSVC90)
+        set(_TBB_COMPILER "vc9")
+    endif()
+    if(MSVC10)
+        set(_TBB_COMPILER "vc10")
+    endif()
+    # Todo: add other Windows compilers such as ICL.
+    set(_TBB_ARCHITECTURE ${TBB_ARCHITECTURE})
+endif ()
 
-#===============================================
-# Do the final processing for the package find.
-#===============================================
-macro(findpkg_finish PREFIX)
-  # skip if already processed during this run
-  if (NOT ${PREFIX}_FOUND)
-    if (${PREFIX}_INCLUDE_DIR AND ${PREFIX}_LIBRARY)
-      set(${PREFIX}_FOUND TRUE)
-      set (${PREFIX}_INCLUDE_DIRS ${${PREFIX}_INCLUDE_DIR})
-      set (${PREFIX}_LIBRARIES ${${PREFIX}_LIBRARY})
+if (UNIX)
+    if (APPLE)
+        # MAC
+        set(_TBB_DEFAULT_INSTALL_DIR "/Library/Frameworks/Intel_TBB.framework/Versions")
+        # libs: libtbb.dylib, libtbbmalloc.dylib, *_debug
+        set(_TBB_LIB_NAME "tbb")
+        set(_TBB_LIB_MALLOC_NAME "${_TBB_LIB_NAME}malloc")
+        set(_TBB_LIB_DEBUG_NAME "${_TBB_LIB_NAME}_debug")
+        set(_TBB_LIB_MALLOC_DEBUG_NAME "${_TBB_LIB_MALLOC_NAME}_debug")
+        # default flavor on apple: ia32/cc4.0.1_os10.4.9
+        # Jiri: There is no reason to presume there is only one flavor and
+        #       that user's setting of variables should be ignored.
+        if(NOT TBB_COMPILER)
+            set(_TBB_COMPILER "cc4.0.1_os10.4.9")
+        else ()
+            set(_TBB_COMPILER ${TBB_COMPILER})
+        endif()
+        if(NOT TBB_ARCHITECTURE)
+            set(_TBB_ARCHITECTURE "ia32")
+        else()
+            set(_TBB_ARCHITECTURE ${TBB_ARCHITECTURE})
+        endif()
     else ()
-      if (${PREFIX}_FIND_REQUIRED AND NOT ${PREFIX}_FIND_QUIETLY)
-        message(FATAL_ERROR "Required library ${PREFIX} not found.")
-      endif ()
+        # LINUX
+        set(_TBB_DEFAULT_INSTALL_DIR "/opt/intel/tbb" "/usr/local/include" "/usr/include")
+        set(_TBB_LIB_NAME "tbb")
+        set(_TBB_LIB_MALLOC_NAME "${_TBB_LIB_NAME}malloc")
+        set(_TBB_LIB_DEBUG_NAME "${_TBB_LIB_NAME}_debug")
+        set(_TBB_LIB_MALLOC_DEBUG_NAME "${_TBB_LIB_MALLOC_NAME}_debug")
+        # has em64t/cc3.2.3_libc2.3.2_kernel2.4.21 em64t/cc3.3.3_libc2.3.3_kernel2.6.5 em64t/cc3.4.3_libc2.3.4_kernel2.6.9 em64t/cc4.1.0_libc2.4_kernel2.6.16.21
+        # has ia32/*
+        # has itanium/*
+        set(_TBB_COMPILER ${TBB_COMPILER})
+        set(_TBB_ARCHITECTURE ${TBB_ARCHITECTURE})
     endif ()
+endif ()
 
-   #mark the following variables as internal variables
-   mark_as_advanced(${PREFIX}_INCLUDE_DIR
-                    ${PREFIX}_LIBRARY
-                    ${PREFIX}_LIBRARY_DEBUG
-                    ${PREFIX}_LIBRARY_RELEASE)
-  endif ()
-endmacro(findpkg_finish)
-
-#===============================================
-# Generate debug names from given RELEASEease names
-#===============================================
-macro(get_debug_names PREFIX)
-  foreach(i ${${PREFIX}})
-    set(${PREFIX}_DEBUG ${${PREFIX}_DEBUG} ${i}d ${i}D ${i}_d ${i}_D ${i}_debug ${i})
-  endforeach(i)
-endmacro(get_debug_names)
-
-#===============================================
-# See if we have env vars to help us find tbb
-#===============================================
-macro(getenv_path VAR)
-   set(ENV_${VAR} $ENV{${VAR}})
-   # replace won't work if var is blank
-   if (ENV_${VAR})
-     string( REGEX REPLACE "\\\\" "/" ENV_${VAR} ${ENV_${VAR}} )
-   endif ()
-endmacro(getenv_path)
-
-#===============================================
-# Couple a set of RELEASEease AND debug libraries
-#===============================================
-macro(make_library_set PREFIX)
-  if (${PREFIX}_RELEASE AND ${PREFIX}_DEBUG)
-    set(${PREFIX} optimized ${${PREFIX}_RELEASE} debug ${${PREFIX}_DEBUG})
-  elseif (${PREFIX}_RELEASE)
-    set(${PREFIX} ${${PREFIX}_RELEASE})
-  elseif (${PREFIX}_DEBUG)
-    set(${PREFIX} ${${PREFIX}_DEBUG})
-  endif ()
-endmacro(make_library_set)
-
-
-#=============================================================================
-#  Now to actually find TBB
-#
-
-# Get path, convert backslashes as ${ENV_${var}}
-getenv_path(TBB_ROOT)
+if (CMAKE_SYSTEM MATCHES "SunOS.*")
+# SUN
+# not yet supported
+# has em64t/cc3.4.3_kernel5.10
+# has ia32/*
+endif ()
 
-# initialize search paths
-set(TBB_PREFIX_PATH ${TBB_ROOT} ${ENV_TBB_ROOT})
-set(TBB_INC_SEARCH_PATH "")
-set(TBB_LIB_SEARCH_PATH "")
 
+#-- Clear the public variables
+set (TBB_FOUND "NO")
 
-# If user built from sources
-set(TBB_BUILD_PREFIX $ENV{TBB_BUILD_PREFIX})
-if (TBB_BUILD_PREFIX AND ENV_TBB_ROOT)
-  getenv_path(TBB_BUILD_DIR)
-  if (NOT ENV_TBB_BUILD_DIR)
-    set(ENV_TBB_BUILD_DIR ${ENV_TBB_ROOT}/build)
-  endif ()
 
-  # include directory under ${ENV_TBB_ROOT}/include
-  list(APPEND TBB_LIB_SEARCH_PATH
-    ${ENV_TBB_BUILD_DIR}/${TBB_BUILD_PREFIX}_release
-    ${ENV_TBB_BUILD_DIR}/${TBB_BUILD_PREFIX}_debug)
+#-- Find TBB install dir and set ${_TBB_INSTALL_DIR} and cached ${TBB_INSTALL_DIR}
+# first: use CMake variable TBB_INSTALL_DIR
+if (TBB_INSTALL_DIR)
+    set (_TBB_INSTALL_DIR ${TBB_INSTALL_DIR})
 endif ()
-
-
-# For Windows, let's assume that the user might be using the precompiled
-# TBB packages from the main website. These use a rather awkward directory
-# structure (at least for automatically finding the right files) depending
-# on platform and compiler, but we'll do our best to accommodate it.
-# Not adding the same effort for the precompiled linux builds, though. Those
-# have different versions for CC compiler versions and linux kernels which
-# will never adequately match the user's setup, so there is no feasible way
-# to detect the "best" version to use. The user will have to manually
-# select the right files. (Chances are the distributions are shipping their
-# custom version of tbb, anyway, so the problem is probably nonexistant.)
-if (WIN32 AND MSVC)
-  set(COMPILER_PREFIX "vc7.1")
-  if (MSVC_VERSION EQUAL 1400)
-    set(COMPILER_PREFIX "vc8")
-  elseif(MSVC_VERSION EQUAL 1500)
-    set(COMPILER_PREFIX "vc9")
-  elseif(MSVC_VERSION EQUAL 1600)
-    set(COMPILER_PREFIX "vc10")
-  elseif(MSVC_VERSION EQUAL 1700)
-    set(COMPILER_PREFIX "vc11")
-  elseif(MSVC_VERSION EQUAL 1800)
-    set(COMPILER_PREFIX "vc12")
-  elseif(MSVC_VERSION EQUAL 1900)
-    set(COMPILER_PREFIX "vc14")
-  endif ()
-
-  # for each prefix path, add ia32/64\${COMPILER_PREFIX}\lib to the lib search path
-  foreach (dir ${TBB_PREFIX_PATH})
-    if (CMAKE_CL_64)
-      list(APPEND TBB_LIB_SEARCH_PATH ${dir}/ia64/${COMPILER_PREFIX}/lib)
-      list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib/ia64/${COMPILER_PREFIX})
-      list(APPEND TBB_LIB_SEARCH_PATH ${dir}/intel64/${COMPILER_PREFIX}/lib)
-      list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib/intel64/${COMPILER_PREFIX})
-    else ()
-      list(APPEND TBB_LIB_SEARCH_PATH ${dir}/ia32/${COMPILER_PREFIX}/lib)
-      list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib/ia32/${COMPILER_PREFIX})
+# second: use environment variable
+if (NOT _TBB_INSTALL_DIR)
+    if (NOT "$ENV{TBB_INSTALL_DIR}" STREQUAL "")
+        set (_TBB_INSTALL_DIR $ENV{TBB_INSTALL_DIR})
     endif ()
-  endforeach ()
-endif ()
-
-# For OS X binary distribution, choose libc++ based libraries for Maverics and
-# above and AppleClang
-if (${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" AND
-    NOT ${CMAKE_SYSTEM_VERSION} LESS 13.0)
-  set (USE_LIBCXX OFF)
-  cmake_policy(GET CMP0025 POLICY_VAR)
-
-  if ("${POLICY_VAR}" STREQUAL "NEW")
-    if (${CMAKE_CXX_COMPILER_ID} STREQUAL "AppleClang")
-      set (USE_LIBCXX ON)
+    # Intel recommends setting TBB21_INSTALL_DIR
+    if (NOT "$ENV{TBB21_INSTALL_DIR}" STREQUAL "")
+        set (_TBB_INSTALL_DIR $ENV{TBB21_INSTALL_DIR})
     endif ()
-  else ()
-    if (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
-      set (USE_LIBCXX ON)
+    if (NOT "$ENV{TBB22_INSTALL_DIR}" STREQUAL "")
+        set (_TBB_INSTALL_DIR $ENV{TBB22_INSTALL_DIR})
+    endif ()
+    if (NOT "$ENV{TBB30_INSTALL_DIR}" STREQUAL "")
+        set (_TBB_INSTALL_DIR $ENV{TBB30_INSTALL_DIR})
     endif ()
-  endif ()
-
-  if (${USE_LIBCXX})
-    foreach (dir ${TBB_PREFIX_PATH})
-      list (APPEND TBB_LIB_SEARCH_PATH ${dir}/lib/libc++ ${dir}/libc++/lib)
-    endforeach ()
-  endif ()
 endif ()
-
-# check compiler ABI
-if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND
-    CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.4)
-  set(COMPILER_PREFIX "gcc4.1")
-else () # Assume compatibility with 4.4 for other compilers
-  set(COMPILER_PREFIX "gcc4.4")
+# third: try to find path automatically
+if (NOT _TBB_INSTALL_DIR)
+    if (_TBB_DEFAULT_INSTALL_DIR)
+        set (_TBB_INSTALL_DIR ${_TBB_DEFAULT_INSTALL_DIR})
+    endif ()
 endif ()
-
-# if platform architecture is explicitly specified
-set(TBB_ARCH_PLATFORM $ENV{TBB_ARCH_PLATFORM})
-if (TBB_ARCH_PLATFORM)
-  foreach (dir ${TBB_PREFIX_PATH})
-    list(APPEND TBB_LIB_SEARCH_PATH ${dir}/${TBB_ARCH_PLATFORM}/lib)
-    list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib/${TBB_ARCH_PLATFORM})
-  endforeach ()
+# sanity check
+if (NOT _TBB_INSTALL_DIR)
+    message ("ERROR: Unable to find Intel TBB install directory. ${_TBB_INSTALL_DIR}")
+else ()
+# finally: set the cached CMake variable TBB_INSTALL_DIR
+if (NOT TBB_INSTALL_DIR)
+    set (TBB_INSTALL_DIR ${_TBB_INSTALL_DIR} CACHE PATH "Intel TBB install directory")
+    mark_as_advanced(TBB_INSTALL_DIR)
 endif ()
 
-foreach (dir ${TBB_PREFIX_PATH})
-  if (CMAKE_SIZEOF_VOID_P EQUAL 8)
-    list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib/intel64)
-    list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib/intel64/${COMPILER_PREFIX})
-    list(APPEND TBB_LIB_SEARCH_PATH ${dir}/intel64/lib)
-    list(APPEND TBB_LIB_SEARCH_PATH ${dir}/intel64/${COMPILER_PREFIX}/lib)
-  else ()
-    list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib/ia32)
-    list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib/ia32/${COMPILER_PREFIX})
-    list(APPEND TBB_LIB_SEARCH_PATH ${dir}/ia32/lib)
-    list(APPEND TBB_LIB_SEARCH_PATH ${dir}/ia32/${COMPILER_PREFIX}/lib)
-  endif ()
-endforeach ()
-
-# add general search paths
-foreach (dir ${TBB_PREFIX_PATH})
-  list(APPEND TBB_LIB_SEARCH_PATH ${dir}/lib ${dir}/Lib ${dir}/lib/tbb
-    ${dir}/Libs)
-  list(APPEND TBB_INC_SEARCH_PATH ${dir}/include ${dir}/Include
-    ${dir}/include/tbb)
-endforeach ()
-
-set(TBB_LIBRARY_NAMES tbb)
-get_debug_names(TBB_LIBRARY_NAMES)
-
 
+#-- A macro to rewrite the paths of the library. This is necessary, because
+#   find_library() always found the em64t/vc9 version of the TBB libs
+macro(TBB_CORRECT_LIB_DIR var_name)
+#    if (NOT "${_TBB_ARCHITECTURE}" STREQUAL "em64t")
+        string(REPLACE em64t "${_TBB_ARCHITECTURE}" ${var_name} ${${var_name}})
+#    endif ()
+    string(REPLACE ia32 "${_TBB_ARCHITECTURE}" ${var_name} ${${var_name}})
+    string(REPLACE vc7.1 "${_TBB_COMPILER}" ${var_name} ${${var_name}})
+    string(REPLACE vc8 "${_TBB_COMPILER}" ${var_name} ${${var_name}})
+    string(REPLACE vc9 "${_TBB_COMPILER}" ${var_name} ${${var_name}})
+    string(REPLACE vc10 "${_TBB_COMPILER}" ${var_name} ${${var_name}})
+endmacro()
+
+
+#-- Look for include directory and set ${TBB_INCLUDE_DIR}
+set (TBB_INC_SEARCH_DIR ${_TBB_INSTALL_DIR}/include)
+# Jiri: tbbvars now sets the CPATH environment variable to the directory
+#       containing the headers.
 find_path(TBB_INCLUDE_DIR
-          NAMES tbb/tbb.h
-          PATHS ${TBB_INC_SEARCH_PATH})
-
-find_library(TBB_LIBRARY_RELEASE
-             NAMES ${TBB_LIBRARY_NAMES}
-             PATHS ${TBB_LIB_SEARCH_PATH})
-find_library(TBB_LIBRARY_DEBUG
-             NAMES ${TBB_LIBRARY_NAMES_DEBUG}
-             PATHS ${TBB_LIB_SEARCH_PATH})
-make_library_set(TBB_LIBRARY)
+    tbb/task_scheduler_init.h
+    PATHS ${TBB_INC_SEARCH_DIR} ENV CPATH
+)
+mark_as_advanced(TBB_INCLUDE_DIR)
+
+
+#-- Look for libraries
+# GvdB: $ENV{TBB_ARCH_PLATFORM} is set by the build script tbbvars[.bat|.sh|.csh]
+if (NOT $ENV{TBB_ARCH_PLATFORM} STREQUAL "")
+    set (_TBB_LIBRARY_DIR
+         ${_TBB_INSTALL_DIR}/lib/$ENV{TBB_ARCH_PLATFORM}
+         ${_TBB_INSTALL_DIR}/$ENV{TBB_ARCH_PLATFORM}/lib
+        )
+endif ()
+# Jiri: This block isn't mutually exclusive with the previous one
+#       (hence no else), instead I test if the user really specified
+#       the variables in question.
+if ((NOT ${TBB_ARCHITECTURE} STREQUAL "") AND (NOT ${TBB_COMPILER} STREQUAL ""))
+    # HH: deprecated
+    message(STATUS "[Warning] FindTBB.cmake: The use of TBB_ARCHITECTURE and TBB_COMPILER is deprecated and may not be supported in future versions. Please set \$ENV{TBB_ARCH_PLATFORM} (using tbbvars.[bat|csh|sh]).")
+    # Jiri: It doesn't hurt to look in more places, so I store the hints from
+    #       ENV{TBB_ARCH_PLATFORM} and the TBB_ARCHITECTURE and TBB_COMPILER
+    #       variables and search them both.
+    set (_TBB_LIBRARY_DIR "${_TBB_INSTALL_DIR}/${_TBB_ARCHITECTURE}/${_TBB_COMPILER}/lib" ${_TBB_LIBRARY_DIR})
+endif ()
 
-findpkg_finish(TBB)
+# GvdB: Mac OS X distribution places libraries directly in lib directory.
+list(APPEND _TBB_LIBRARY_DIR ${_TBB_INSTALL_DIR}/lib)
+
+# Jiri: No reason not to check the default paths. From recent versions,
+#       tbbvars has started exporting the LIBRARY_PATH and LD_LIBRARY_PATH
+#       variables, which now point to the directories of the lib files.
+#       It all makes more sense to use the ${_TBB_LIBRARY_DIR} as a HINTS
+#       argument instead of the implicit PATHS as it isn't hard-coded
+#       but computed by system introspection. Searching the LIBRARY_PATH
+#       and LD_LIBRARY_PATH environment variables is now even more important
+#       that tbbvars doesn't export TBB_ARCH_PLATFORM and it facilitates
+#       the use of TBB built from sources.
+find_library(TBB_LIBRARY ${_TBB_LIB_NAME} HINTS ${_TBB_LIBRARY_DIR}
+        PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH)
+find_library(TBB_MALLOC_LIBRARY ${_TBB_LIB_MALLOC_NAME} HINTS ${_TBB_LIBRARY_DIR}
+        PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH)
+
+#Extract path from TBB_LIBRARY name
+get_filename_component(TBB_LIBRARY_DIR ${TBB_LIBRARY} PATH)
+
+#TBB_CORRECT_LIB_DIR(TBB_LIBRARY)
+#TBB_CORRECT_LIB_DIR(TBB_MALLOC_LIBRARY)
+mark_as_advanced(TBB_LIBRARY TBB_MALLOC_LIBRARY)
+
+#-- Look for debug libraries
+# Jiri: Changed the same way as for the release libraries.
+find_library(TBB_LIBRARY_DEBUG ${_TBB_LIB_DEBUG_NAME} HINTS ${_TBB_LIBRARY_DIR}
+        PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH)
+find_library(TBB_MALLOC_LIBRARY_DEBUG ${_TBB_LIB_MALLOC_DEBUG_NAME} HINTS ${_TBB_LIBRARY_DIR}
+        PATHS ENV LIBRARY_PATH ENV LD_LIBRARY_PATH)
+
+# Jiri: Self-built TBB stores the debug libraries in a separate directory.
+#       Extract path from TBB_LIBRARY_DEBUG name
+get_filename_component(TBB_LIBRARY_DEBUG_DIR ${TBB_LIBRARY_DEBUG} PATH)
+
+#TBB_CORRECT_LIB_DIR(TBB_LIBRARY_DEBUG)
+#TBB_CORRECT_LIB_DIR(TBB_MALLOC_LIBRARY_DEBUG)
+mark_as_advanced(TBB_LIBRARY_DEBUG TBB_MALLOC_LIBRARY_DEBUG)
+
+
+if (TBB_INCLUDE_DIR)
+    if (TBB_LIBRARY)
+        set (TBB_FOUND "YES")
+        set (TBB_LIBRARIES ${TBB_LIBRARY} ${TBB_MALLOC_LIBRARY} ${TBB_LIBRARIES})
+        set (TBB_DEBUG_LIBRARIES ${TBB_LIBRARY_DEBUG} ${TBB_MALLOC_LIBRARY_DEBUG} ${TBB_DEBUG_LIBRARIES})
+        set (TBB_INCLUDE_DIRS ${TBB_INCLUDE_DIR} CACHE PATH "TBB include directory" FORCE)
+        set (TBB_LIBRARY_DIRS ${TBB_LIBRARY_DIR} CACHE PATH "TBB library directory" FORCE)
+        # Jiri: Self-built TBB stores the debug libraries in a separate directory.
+        set (TBB_DEBUG_LIBRARY_DIRS ${TBB_LIBRARY_DEBUG_DIR} CACHE PATH "TBB debug library directory" FORCE)
+        mark_as_advanced(TBB_INCLUDE_DIRS TBB_LIBRARY_DIRS TBB_DEBUG_LIBRARY_DIRS TBB_LIBRARIES TBB_DEBUG_LIBRARIES)
+        message(STATUS "Found Intel TBB")
+    endif ()
+endif ()
 
-#if we haven't found TBB no point on going any further
 if (NOT TBB_FOUND)
-  return()
+    message("ERROR: Intel TBB NOT found!")
+    message(STATUS "Looked for Threading Building Blocks in ${_TBB_INSTALL_DIR}")
+    # do only throw fatal, if this pkg is REQUIRED
+    if (TBB_FIND_REQUIRED)
+        message(FATAL_ERROR "Could NOT find TBB library.")
+    endif ()
 endif ()
 
-#=============================================================================
-# Look for TBB's malloc package
-set(TBB_MALLOC_LIBRARY_NAMES tbbmalloc)
-get_debug_names(TBB_MALLOC_LIBRARY_NAMES)
-
-find_path(TBB_MALLOC_INCLUDE_DIR
-          NAMES tbb/tbb.h
-          PATHS ${TBB_INC_SEARCH_PATH})
-
-find_library(TBB_MALLOC_LIBRARY_RELEASE
-             NAMES ${TBB_MALLOC_LIBRARY_NAMES}
-             PATHS ${TBB_LIB_SEARCH_PATH})
-find_library(TBB_MALLOC_LIBRARY_DEBUG
-             NAMES ${TBB_MALLOC_LIBRARY_NAMES_DEBUG}
-             PATHS ${TBB_LIB_SEARCH_PATH})
-make_library_set(TBB_MALLOC_LIBRARY)
-
-findpkg_finish(TBB_MALLOC)
-
-#=============================================================================
-# Look for TBB's malloc proxy package
-set(TBB_MALLOC_PROXY_LIBRARY_NAMES tbbmalloc_proxy)
-get_debug_names(TBB_MALLOC_PROXY_LIBRARY_NAMES)
-
-find_path(TBB_MALLOC_PROXY_INCLUDE_DIR
-          NAMES tbb/tbbmalloc_proxy.h
-          PATHS ${TBB_INC_SEARCH_PATH})
-
-find_library(TBB_MALLOC_PROXY_LIBRARY_RELEASE
-             NAMES ${TBB_MALLOC_PROXY_LIBRARY_NAMES}
-             PATHS ${TBB_LIB_SEARCH_PATH})
-find_library(TBB_MALLOC_PROXY_LIBRARY_DEBUG
-             NAMES ${TBB_MALLOC_PROXY_LIBRARY_NAMES_DEBUG}
-             PATHS ${TBB_LIB_SEARCH_PATH})
-make_library_set(TBB_MALLOC_PROXY_LIBRARY)
-
-findpkg_finish(TBB_MALLOC_PROXY)
-
-
-#=============================================================================
-#parse all the version numbers from tbb
-if(NOT TBB_VERSION)
-
- #only read the start of the file
- file(READ
-      "${TBB_INCLUDE_DIR}/tbb/tbb_stddef.h"
-      TBB_VERSION_CONTENTS
-      LIMIT 2048)
-
-  string(REGEX REPLACE
-    ".*#define TBB_VERSION_MAJOR ([0-9]+).*" "\\1"
-    TBB_VERSION_MAJOR "${TBB_VERSION_CONTENTS}")
-
-  string(REGEX REPLACE
-    ".*#define TBB_VERSION_MINOR ([0-9]+).*" "\\1"
-    TBB_VERSION_MINOR "${TBB_VERSION_CONTENTS}")
-
-  string(REGEX REPLACE
-        ".*#define TBB_INTERFACE_VERSION ([0-9]+).*" "\\1"
-        TBB_INTERFACE_VERSION "${TBB_VERSION_CONTENTS}")
-
-  string(REGEX REPLACE
-        ".*#define TBB_COMPATIBLE_INTERFACE_VERSION ([0-9]+).*" "\\1"
-        TBB_COMPATIBLE_INTERFACE_VERSION "${TBB_VERSION_CONTENTS}")
+endif ()
 
-endif()
+if (TBB_FOUND)
+        set(TBB_INTERFACE_VERSION 0)
+        FILE(READ "${TBB_INCLUDE_DIRS}/tbb/tbb_stddef.h" _TBB_VERSION_CONTENTS)
+        STRING(REGEX REPLACE ".*#define TBB_INTERFACE_VERSION ([0-9]+).*" "\\1" TBB_INTERFACE_VERSION "${_TBB_VERSION_CONTENTS}")
+        set(TBB_INTERFACE_VERSION "${TBB_INTERFACE_VERSION}")
+endif ()
diff --git a/CMake/android.toolchain.cmake b/CMake/android.toolchain.cmake
index a04ed08..07100ee 100644
--- a/CMake/android.toolchain.cmake
+++ b/CMake/android.toolchain.cmake
@@ -198,22 +198,7 @@ endif()
 # inherit settings in recursive loads
 get_property( _CMAKE_IN_TRY_COMPILE GLOBAL PROPERTY IN_TRY_COMPILE )
 if( _CMAKE_IN_TRY_COMPILE )
-  # walk up to try to find the config file
-  set (go_up "/")
-  set (go_up_length 0)
-  set (found FALSE)
-  while (NOT found AND go_up_length LESS 30)
-    if (EXISTS "${CMAKE_CURRENT_BINARY_DIR}/${go_up}android.toolchain.config.cmake")
-      include("${CMAKE_CURRENT_BINARY_DIR}/${go_up}android.toolchain.config.cmake")
-      set (found TRUE)
-    endif()
-    if (EXISTS "${CMAKE_CURRENT_BINARY_DIR}/${go_up}CMakeFiles/android.toolchain.config.cmake")
-      include("${CMAKE_CURRENT_BINARY_DIR}/${go_up}CMakeFiles/android.toolchain.config.cmake")
-      set (found TRUE)
-    endif()
-    set (go_up "${go_up}../")
-    string(LENGTH ${go_up} go_up_length)
-  endwhile()
+ include( "${CMAKE_CURRENT_SOURCE_DIR}/../android.toolchain.config.cmake" OPTIONAL )
 endif()
 
 # this one is important
@@ -231,7 +216,7 @@ set( CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "" )
 set( CMAKE_SKIP_RPATH TRUE CACHE BOOL "If set, runtime paths are not added when using shared libraries." )
 
 # NDK search paths
-set( ANDROID_SUPPORTED_NDK_VERSIONS ${ANDROID_EXTRA_NDK_VERSIONS} -r10e -r10d -r10c -r10b -r10 -r9d -r9c -r9b -r9 -r8e -r8d -r8c -r8b -r8 -r7c -r7b -r7 -r6b -r6 -r5c -r5b -r5 "" )
+set( ANDROID_SUPPORTED_NDK_VERSIONS ${ANDROID_EXTRA_NDK_VERSIONS} -r10d -r10c -r10b -r10 -r9d -r9c -r9b -r9 -r8e -r8d -r8c -r8b -r8 -r7c -r7b -r7 -r6b -r6 -r5c -r5b -r5 "" )
 if( NOT DEFINED ANDROID_NDK_SEARCH_PATHS )
  if( CMAKE_HOST_WIN32 )
   file( TO_CMAKE_PATH "$ENV{PROGRAMFILES}" ANDROID_NDK_SEARCH_PATHS )
diff --git a/CMake/vtkBackends.cmake b/CMake/vtkBackends.cmake
index 187424b..d096616 100644
--- a/CMake/vtkBackends.cmake
+++ b/CMake/vtkBackends.cmake
@@ -10,32 +10,14 @@
 # module name, i.e. vtkRenderingOpenGL for OpenGL and vtkRenderingOpenGL2
 # for OpenGL2.
 
-# is the current backend not a valid value?
-set (_options ${VTK_BACKENDS} "None")
-list (FIND _options "${VTK_RENDERING_BACKEND}"  _index)
-if (${_index} EQUAL -1)
-
-  # has the application defined a desired default for the backend?
-  # if not, use VTKs default of OpenGL
-  if(NOT DEFINED VTK_RENDERING_BACKEND_DEFAULT)
-    set(VTK_RENDERING_BACKEND_DEFAULT "OpenGL")
-  endif()
-
-  # if it is in the cache as a bad value we need to reset it
-  if(DEFINED VTK_RENDERING_BACKEND)
-    message(STATUS "The cache contains an illegal value for VTK_RENDERING_BACKEND, forcing it to the default value of '${VTK_RENDERING_BACKEND_DEFAULT}'.")
-    set(VTK_RENDERING_BACKEND "${VTK_RENDERING_BACKEND_DEFAULT}" CACHE STRING
-        "Choose the rendering backend." FORCE)
-  else()
-    # otherwise just initialize it to the default determined above
-    message(STATUS "Setting rendering backend to '${VTK_RENDERING_BACKEND_DEFAULT}' as none was specified.")
-    set(VTK_RENDERING_BACKEND "${VTK_RENDERING_BACKEND_DEFAULT}" CACHE STRING
-      "Choose the rendering backend.")
-  endif()
-
+# Set a default backend type if none was specified, populate the enum.
+if(NOT VTK_RENDERING_BACKEND)
+  message(STATUS "Setting rendering backend to 'OpenGL' as none was specified.")
+  set(VTK_RENDERING_BACKEND "OpenGL" CACHE STRING
+    "Choose the rendering backend." FORCE)
   # Set the possible values of rendering backends for cmake-gui
   set_property(CACHE VTK_RENDERING_BACKEND PROPERTY
-    STRINGS ${_options})
+    STRINGS ${VTK_BACKENDS} "None")
 endif()
 
 # Now iterate through and enable the one that was selected.
diff --git a/CMake/vtkCompilerExtras.cmake b/CMake/vtkCompilerExtras.cmake
index e39bd30..4e0ea4e 100644
--- a/CMake/vtkCompilerExtras.cmake
+++ b/CMake/vtkCompilerExtras.cmake
@@ -14,17 +14,12 @@ if(CMAKE_COMPILER_IS_GNUCXX)
 
   # If we are compiling on Linux then set some extra linker flags too
   if(CMAKE_SYSTEM_NAME MATCHES Linux)
-    option(VTK_LINKER_FATAL_WARNINGS "Specify if linker warnings must be considered as errors." OFF)
-    mark_as_advanced(VTK_LINKER_FATAL_WARNINGS)
-    if(VTK_LINKER_FATAL_WARNINGS)
-      set(VTK_EXTRA_SHARED_LINKER_FLAGS "-Wl,--fatal-warnings")
-    endif()
     set(CMAKE_SHARED_LINKER_FLAGS
-      "${VTK_EXTRA_SHARED_LINKER_FLAGS} -Wl,--no-undefined -lc ${CMAKE_SHARED_LINKER_FLAGS}")
+      "-Wl,--fatal-warnings -Wl,--no-undefined -lc ${CMAKE_SHARED_LINKER_FLAGS}")
     set(CMAKE_MODULE_LINKER_FLAGS
-      "${VTK_EXTRA_SHARED_LINKER_FLAGS} -Wl,--no-undefined -lc ${CMAKE_SHARED_LINKER_FLAGS}")
+      "-Wl,--fatal-warnings -Wl,--no-undefined -lc ${CMAKE_SHARED_LINKER_FLAGS}")
     set (CMAKE_EXE_LINKER_FLAGS
-      "${VTK_EXTRA_SHARED_LINKER_FLAGS} -Wl,--no-undefined -lc ${CMAKE_SHARED_LINKER_FLAGS}")
+      "-Wl,--fatal-warnings -Wl,--no-undefined -lc ${CMAKE_SHARED_LINKER_FLAGS}")
   endif()
 
   # Now check if we can use visibility to selectively export symbols
diff --git a/CMake/vtkExternalData.cmake b/CMake/vtkExternalData.cmake
index de4864b..98c0345 100644
--- a/CMake/vtkExternalData.cmake
+++ b/CMake/vtkExternalData.cmake
@@ -56,15 +56,13 @@ set(ExternalData_URL_TEMPLATES "" CACHE STRING
   "Additional URL templates for the ExternalData CMake script to look for testing data. E.g.
 file:///var/bigharddrive/%(algo)/%(hash)")
 mark_as_advanced(ExternalData_URL_TEMPLATES)
-if(NOT VTK_FORBID_DOWNLOADS)
-  list(APPEND ExternalData_URL_TEMPLATES
-    # Data published by MIDAS
-    "http://midas3.kitware.com/midas/api/rest?method=midas.bitstream.download&checksum=%(hash)&algorithm=%(algo)"
+list(APPEND ExternalData_URL_TEMPLATES
+  # Data published by MIDAS
+  "http://midas3.kitware.com/midas/api/rest?method=midas.bitstream.download&checksum=%(hash)&algorithm=%(algo)"
 
-    # Data published by developers using git-gitlab-push.
-    "http://www.vtk.org/files/ExternalData/%(algo)/%(hash)"
+  # Data published by developers using git-gerrit-push.
+  "http://www.vtk.org/files/ExternalData/%(algo)/%(hash)"
   )
-endif()
 
 # Tell ExternalData commands to transform raw files to content links.
 # TODO: Condition this feature on presence of our pre-commit hook.
diff --git a/CMake/vtkModuleMacros.cmake b/CMake/vtkModuleMacros.cmake
index 556d4b1..14d21da 100644
--- a/CMake/vtkModuleMacros.cmake
+++ b/CMake/vtkModuleMacros.cmake
@@ -563,9 +563,8 @@ function(vtk_module_library name)
   foreach(arg ${ARGN})
     get_filename_component(src "${arg}" ABSOLUTE)
 
-    get_source_file_property(_skip_install ${src} SKIP_HEADER_INSTALL)
     string(REGEX REPLACE "\\.(cxx|mm)$" ".h" hdr "${src}")
-    if("${hdr}" MATCHES "\\.h$" AND EXISTS "${hdr}" AND NOT _skip_install)
+    if("${hdr}" MATCHES "\\.h$" AND EXISTS "${hdr}")
       list(APPEND _hdrs "${hdr}")
     elseif("${src}" MATCHES "\\.txx$" AND EXISTS "${src}")
       list(APPEND _hdrs "${src}")
@@ -782,7 +781,6 @@ macro(vtk_module_third_party _pkg)
   set(_libs "")
   set(_nolibs 0)
   set(_subdir 1)
-  set(_version "")
   set(_components "")
   set(_optional_components "")
   set(_doing "")
@@ -792,16 +790,9 @@ macro(vtk_module_third_party _pkg)
     elseif("${arg}" STREQUAL "NO_ADD_SUBDIRECTORY")
       set(_doing "")
       set(_subdir 0)
-    elseif("${arg}" STREQUAL "VERSION")
-      set(_doing "version")
     elseif("${arg}" STREQUAL "NO_LIBRARIES")
       set(_doing "")
       set(_nolibs 1)
-    elseif("${_doing}" STREQUAL "version")
-      if (_version)
-        message(AUTHOR_WARNING "Duplicate 'VERSION' keyword")
-      endif ()
-      set(_version "${arg}")
     elseif("${_doing}" STREQUAL "LIBRARIES")
       list(APPEND _libs "${arg}")
     elseif("${_doing}" STREQUAL "INCLUDE_DIRS")
@@ -836,7 +827,7 @@ macro(vtk_module_third_party _pkg)
         list(APPEND __extra_args ${_optional_components})
       endif()
     endif()
-    find_package(${_pkg} ${_version} REQUIRED ${__extra_args})
+    find_package(${_pkg} REQUIRED ${__extra_args})
     if(NOT ${_upper}_FOUND AND NOT ${_pkg}_FOUND)
       message(FATAL_ERROR "VTK_USE_SYSTEM_${_upper} is ON but ${_pkg} is not found!")
     endif()
diff --git a/CMake/vtkModuleRemote.cmake b/CMake/vtkModuleRemote.cmake
deleted file mode 100644
index ae9b47d..0000000
--- a/CMake/vtkModuleRemote.cmake
+++ /dev/null
@@ -1,159 +0,0 @@
-# Function to fetch remote modules.
-
-# Helper to perform the initial git clone and checkout.
-function(_git_clone git_executable git_repository git_tag module_dir)
-  execute_process(
-    COMMAND "${git_executable}" clone "${git_repository}" "${module_dir}"
-    RESULT_VARIABLE error_code
-    OUTPUT_QUIET
-    ERROR_VARIABLE git_clone_error
-    )
-  if(error_code)
-    message(FATAL_ERROR "Failed to clone repository: '${git_repository}' Clone error is: '${git_clone_error}'")
-  Endif()
-
-  execute_process(
-    COMMAND "${git_executable}" checkout ${git_tag}
-    WORKING_DIRECTORY "${module_dir}"
-    RESULT_VARIABLE error_code
-    OUTPUT_QUIET
-    ERROR_QUIET
-    )
-  if(error_code)
-    message(FATAL_ERROR "Failed to checkout tag: '${git_tag}'")
-  endif()
-
-  execute_process(
-    COMMAND "${git_executable}" submodule init
-    WORKING_DIRECTORY "${module_dir}"
-    RESULT_VARIABLE error_code
-    )
-  if(error_code)
-    message(FATAL_ERROR "Failed to init submodules in: '${module_dir}'")
-  endif()
-
-  execute_process(
-    COMMAND "${git_executable}" submodule update --recursive
-    WORKING_DIRECTORY "${module_dir}"
-    RESULT_VARIABLE error_code
-    )
-  if(error_code)
-    message(FATAL_ERROR "Failed to update submodules in: '${module_dir}'")
-  endif()
-endfunction()
-
-# Helper to perform a git update.  Checks the current Git revision against the
-# desired revision and only performs a fetch and checkout if needed.
-function(_git_update git_executable git_repository git_tag module_dir)
-  execute_process(
-    COMMAND "${git_executable}" rev-parse --verify ${git_tag}
-    WORKING_DIRECTORY "${module_dir}"
-    RESULT_VARIABLE error_code
-    OUTPUT_VARIABLE tag_hash
-    )
-  if(error_code)
-    message(FATAL_ERROR "Failed to get the hash for tag '${module_dir}'")
-  endif()
-  execute_process(
-    COMMAND "${git_executable}" rev-parse --verify HEAD
-    WORKING_DIRECTORY "${module_dir}"
-    RESULT_VARIABLE error_code
-    OUTPUT_VARIABLE head_hash
-    )
-  if(error_code)
-    message(FATAL_ERROR "Failed to get the hash for ${git_repository} HEAD")
-  endif()
-
-  # Is the hash checkout out that we want?
-  if(NOT (tag_hash STREQUAL head_hash))
-    execute_process(
-      COMMAND "${git_executable}" fetch "${git_repository}"
-      WORKING_DIRECTORY "${module_dir}"
-      RESULT_VARIABLE error_code
-      )
-    if(error_code)
-      message(FATAL_ERROR "Failed to fetch repository '${git_repository}'")
-    endif()
-
-    execute_process(
-      COMMAND "${git_executable}" checkout ${git_tag}
-      WORKING_DIRECTORY "${module_dir}"
-      RESULT_VARIABLE error_code
-      )
-    if(error_code)
-      message(FATAL_ERROR "Failed to checkout tag: '${git_tag}'")
-    endif()
-
-    execute_process(
-      COMMAND "${git_executable}" submodule update --recursive
-      WORKING_DIRECTORY "${module_dir}"
-      RESULT_VARIABLE error_code
-      )
-    if(error_code)
-      message(FATAL_ERROR "Failed to update submodules in: '${module_dir}'")
-    endif()
-  endif()
-endfunction()
-
-# Helper function to fetch a module stored in a Git repository.
-# Git fetches are only performed when required.
-function(_fetch_with_git git_executable git_repository git_tag module_dir)
-  if("${git_tag}" STREQUAL "" OR "${git_repository}" STREQUAL "")
-    message(FATAL_ERROR "Tag or repository for git checkout should not be empty.")
-  endif()
-
-  # If we don't have a clone yet.
-  if(NOT EXISTS "${module_dir}")
-    _git_clone("${git_executable}" "${git_repository}" "${git_tag}" "${module_dir}")
-    message(STATUS " The remote module: ${git_repository} is cloned into the directory ${module_dir}")
-  else() # We already have a clone, but we need to check that it has the right revision.
-    _git_update("${git_executable}" "${git_repository}" "${git_tag}" "${module_dir}")
-  endif()
-endfunction()
-
-# Download and turn on a remote module.
-#
-# The module CMake option is created: Module_${module_name}, which defaults to OFF.
-# Once set to ON, the module is downloaded into the Remote module group.
-#
-# A module name and description are required.  The description will show up in
-# the CMake user interface.
-#
-# The following options are currently supported:
-#    [GIT_REPOSITORY url]        # URL of git repo
-#    [GIT_TAG tag]               # Git branch name, commit id or tag
-function(vtk_fetch_module _name _description)
-  option(Module_${_name} "${_description}" OFF)
-  mark_as_advanced(Module_${_name})
-
-
-  # Fetch_$_remote_module} is deprecated. To maintain backward compatibility:
-  if(Fetch_${_name})
-    message(WARNING "Fetch_${_name} is deprecated, please use Module_${_name} to download and enable the remote module.")
-    set(Module_${_name} ON CACHE FORCE "${_description}")
-  endif()
-
-  if(Module_${_name})
-    vtk_download_attempt_check(Module_${_name})
-    include(CMakeParseArguments)
-    cmake_parse_arguments(_fetch_options "" "GIT_REPOSITORY;GIT_TAG" "" ${ARGN})
-    find_package(Git)
-    if(NOT GIT_EXECUTABLE)
-      message(FATAL_ERROR "error: could not find git for clone of ${_name}")
-    endif()
-    execute_process(
-      COMMAND "${GIT_EXECUTABLE}" --version
-      OUTPUT_VARIABLE ov
-      OUTPUT_STRIP_TRAILING_WHITESPACE
-      )
-    string(REGEX REPLACE "^git version (.+)$" "\\1" _version "${ov}")
-    if("${_version}" VERSION_LESS 1.6.6)
-      message(FATAL_ERROR "Git version 1.6.6 or later is required.")
-    endif()
-    _fetch_with_git("${GIT_EXECUTABLE}"
-      "${_fetch_options_GIT_REPOSITORY}"
-      "${_fetch_options_GIT_TAG}"
-      "${VTK_SOURCE_DIR}/Remote/${_name}"
-      )
-  endif()
-endfunction()
diff --git a/CMake/vtkModuleTop.cmake b/CMake/vtkModuleTop.cmake
index e1381d6..c70ec42 100644
--- a/CMake/vtkModuleTop.cmake
+++ b/CMake/vtkModuleTop.cmake
@@ -496,7 +496,7 @@ if (NOT VTK_INSTALL_NO_DEVELOPMENT)
     DESTINATION ${VTK_INSTALL_PACKAGE_DIR})
   get_property(VTK_TARGETS GLOBAL PROPERTY VTK_TARGETS)
   if(VTK_TARGETS)
-    install(EXPORT ${VTK_INSTALL_EXPORT_NAME}  DESTINATION ${VTK_INSTALL_PACKAGE_DIR} FILE ${VTK_INSTALL_EXPORT_NAME}.cmake)
+    install(EXPORT ${VTK_INSTALL_EXPORT_NAME}  DESTINATION ${VTK_INSTALL_PACKAGE_DIR})
   else()
     set(CMAKE_CONFIGURABLE_FILE_CONTENT "# No targets!")
     configure_file(${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in
diff --git a/CMake/vtkPythonWrapping.cmake b/CMake/vtkPythonWrapping.cmake
index 217dfcf..944e345 100644
--- a/CMake/vtkPythonWrapping.cmake
+++ b/CMake/vtkPythonWrapping.cmake
@@ -65,11 +65,6 @@ function(vtk_add_python_wrapping module_name)
   target_link_libraries(${module_name}PythonD LINK_PUBLIC ${module_name}
     vtkWrappingPythonCore ${extra_links} ${VTK_PYTHON_LIBRARIES})
 
-  if (MSVC)
-    set_target_properties(${module_name}PythonD
-      PROPERTIES STATIC_LIBRARY_FLAGS ${CMAKE_MODULE_LINKER_FLAGS})
-  endif()
-
   _vtk_add_python_module(${module_name}Python ${module_name}PythonInit.cxx)
   target_link_libraries(${module_name}Python ${module_name}PythonD)
   if(CMAKE_HAS_TARGET_INCLUDES)
diff --git a/CMake/vtkQt.cmake b/CMake/vtkQt.cmake
index 5c72a76..6e24b5d 100644
--- a/CMake/vtkQt.cmake
+++ b/CMake/vtkQt.cmake
@@ -1,4 +1,5 @@
 set(VTK_QT_VERSION "4" CACHE STRING "Expected Qt version")
+mark_as_advanced(VTK_QT_VERSION)
 
 set_property(CACHE VTK_QT_VERSION PROPERTY STRINGS 4 5)
 
diff --git a/CMake/vtkTestingMacros.cmake b/CMake/vtkTestingMacros.cmake
index 2882cea..8cb5e2b 100644
--- a/CMake/vtkTestingMacros.cmake
+++ b/CMake/vtkTestingMacros.cmake
@@ -185,7 +185,6 @@ function(vtk_add_test_mpi exename _tests)
     set_tests_properties(${vtk-module}Cxx-MPI-${vtk_test_prefix}${test_name}
       PROPERTIES
         LABELS "${${vtk-module}_TEST_LABELS}"
-        PROCESSORS ${numprocs}
       )
     list(APPEND ${_tests} "${test_file}")
 
@@ -370,14 +369,9 @@ endfunction()
 #   The 'vtk_test_prefix' variable may be set to create separate tests from a
 #   single test name (e.g., running with different arguments), but should be
 #   used only when required.
-#
-#   Before calling this function, you can define VTK_PYTHON_EXE to point the
-#   executable (or generator expression for the executable) to run for the test.
-#   If VTK_PYTHON_EXE is not defined, `vtkpython` is assumed i.e.
-#   ($<TARGET_FILE:vtkpython>)
 function(vtk_add_test_python)
-  if (NOT DEFINED VTK_PYTHON_EXE)
-    set(VTK_PYTHON_EXE "\$<TARGET_FILE:vtkpython>")
+  if(NOT VTK_PYTHON_EXE)
+    message(FATAL_ERROR "VTK_PYTHON_EXE not set")
   endif()
   set(python_options
     NO_DATA
@@ -452,10 +446,6 @@ function(vtk_add_test_python)
   endforeach()
 endfunction()
 
-#   Before calling this function, you can define VTK_PYTHON_EXE to point the
-#   executable (or generator expression for the executable) to run for the test.
-#   If VTK_PYTHON_EXE is not defined, `vtkpython` is assumed i.e.
-#   ($<TARGET_FILE:pvtkpython>)
 function(vtk_add_test_python_mpi)
   set(_vtk_test_python_suffix "-MPI")
 
@@ -469,9 +459,6 @@ function(vtk_add_test_python_mpi)
     ${VTK_MPI_PRENUMPROC_FLAGS} ${VTK_MPI_NUMPROC_FLAG} ${numprocs}
     ${VTK_MPI_PREFLAGS})
 
-  if (NOT DEFINED VTK_PYTHON_EXE)
-    set(VTK_PYTHON_EXE "\$<TARGET_FILE:pvtkpython>")
-  endif()
   vtk_add_test_python(${ARGN})
 endfunction()
 
diff --git a/CMake/vtkVersion.cmake b/CMake/vtkVersion.cmake
index c573ea2..001edde 100644
--- a/CMake/vtkVersion.cmake
+++ b/CMake/vtkVersion.cmake
@@ -1,4 +1,4 @@
 # VTK version number components.
 set(VTK_MAJOR_VERSION 6)
-set(VTK_MINOR_VERSION 3)
+set(VTK_MINOR_VERSION 2)
 set(VTK_BUILD_VERSION 0)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d8a5713..d622370 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -44,18 +44,6 @@ set(CMAKE_MODULE_PATH ${VTK_CMAKE_DIR} ${CMAKE_MODULE_PATH})
 include(vtkModuleMacros)
 include(vtkExternalData)
 
-#-----------------------------------------------------------------------------
-# Forbid downloading resources from the network during a build. This helps
-# when building on systems without network connectivity to determine which
-# resources much be obtained manually and made available to the build.
-option(VTK_FORBID_DOWNLOADS "Do not download source code or data from the network" OFF)
-mark_as_advanced(VTK_FORBID_DOWNLOADS)
-macro(vtk_download_attempt_check _name)
-  if(VTK_FORBID_DOWNLOADS)
-    message(SEND_ERROR "Attempted to download ${_name} when VTK_FORBID_DOWNLOADS is ON")
-  endif()
-endmacro()
-
 # Set a default build type if none was specified
 if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
   message(STATUS "Setting build type to 'Debug' as none was specified.")
@@ -206,9 +194,6 @@ else()
   option(BUILD_SHARED_LIBS "Build VTK with shared libraries." ON)
 endif()
 
-# default to not using the system GLEW as ours has fixes in it right now
-set(VTK_USE_SYSTEM_GLEW OFF CACHE BOOL "do not use a system glew" FORCE)
-
 set(VTK_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
 
 #-----------------------------------------------------------------------------
@@ -267,10 +252,6 @@ if (CMAKE_CROSSCOMPILING AND NOT COMPILE_TOOLS_IMPORTED)
 endif()
 
 #-----------------------------------------------------------------------------
-# Add the Remote Subdirectory
-add_subdirectory(Remote)
-
-#-----------------------------------------------------------------------------
 # Do we try to use system libraries by default?
 option(VTK_USE_SYSTEM_LIBRARIES "Use the system's libraries by default." OFF)
 mark_as_advanced(VTK_USE_SYSTEM_LIBRARIES)
@@ -313,8 +294,8 @@ CHECK_CXX_SOURCE_RUNS("${VTK_REQUIRE_LARGE_FILE_SUPPORT_FILE}"
 SET(VTK_REQUIRE_LARGE_FILE_SUPPORT ${CMAKE_REQUIRE_LARGE_FILE_SUPPORT})
 
 #-----------------------------------------------------------------------------
-# Does the const_reverse_iterator have the comparison operators? They were not
-# present in older versions of gcc (ex: Apple fork of gcc 4.2).
+# Does the const_reverse_iterator have the comparison operators? Before GCC
+# 4.1 they were not present.
 include(CheckCXXSourceCompiles)
 set(VTK_CONST_REVERSE_ITERATOR_COMPARISON_FILE
 "#include <vector>
@@ -476,6 +457,7 @@ endif()
 if(VTK_WRAP_PYTHON)
   set(VTK_WRAP_PYTHON_EXE vtkWrapPython)
   set(VTK_WRAP_PYTHON_INIT_EXE vtkWrapPythonInit)
+  set(VTK_PYTHON_EXE vtkpython)
   # Force the WrappingPythonCore module to on if wrapping is on
   set(Module_vtkWrappingPythonCore ON CACHE BOOL "Core Python wrapping library"
     FORCE)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index f3eb8ef..bb656d1 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,73 +1,16 @@
-Contributing to VTK
-===================
+Contributing
+------------
 
-This page documents at a very high level how to contribute to VTK.
-Please check our [developer instructions][] for a more detailed guide to
-developing and contributing to the project, and our [VTK Git README][]
-for additional information.
+Our project uses Gerrit for code review, and CDash at Home to test proposed
+patches before they are merged. Please check our [development][Development]
+guide for details on developing and contributing to the project.
 
-1.  Register [GitLab Access] to create an account and select a user name.
-
-2.  [Fork VTK][] into your user's namespace on GitLab.
-
-3.  Follow the [download instructions][] to create a
-    local clone of the main VTK repository:
-
-        $ git clone https://gitlab.kitware.com/vtk/vtk.git VTK
-        $ cd VTK
-    The main repository will be configured as your `origin` remote.
-
-    For more information see: [Setup][]
-
-4.  Run the [developer setup script][] to prepare your VTK work tree and
-    create Git command aliases used below:
-
-        $ ./Utilities/SetupForDevelopment.sh
-    This will prompt for your GitLab user name and configure a remote
-    called `gitlab` to refer to it.
-
-    For more information see: [Setup][]
-
-5.  Edit files and create commits (repeat as needed):
-
-        $ edit file1 file2 file3
-        $ git add file1 file2 file3
-        $ git commit
-
-    For more information see: [Create a Topic][]
-
-6.  Push commits in your topic branch to your fork in GitLab:
-
-        $ git gitlab-push
-
-    For more information see: [Share a Topic][]
-
-7.  Visit your fork in GitLab, browse to the "**Merge Requests**" link on the
-    left, and use the "**New Merge Request**" button in the upper right to
-    create a Merge Request.
-
-    For more information see: [Create a Merge Request][]
-
-
-VTK uses GitLab for code review and Buildbot to test proposed
-patches before they are merged.
-
-Our [Wiki][] is used to document features, flesh out designs and host other
-documentation. Our API is documented using [Doxygen][] with updated
-documentation generated nightly. We have several [Mailing Lists][]
+Our [wiki][Wiki] is used to document features, flesh out designs and host other
+documentation. Our API is [documented using Doxygen][Doxygen] with updated
+documentation generated nightly. We have several [mailing lists][MailingLists]
 to coordinate development and to provide support.
 
-[VTK Git README]: Documentation/dev/git/README.md
-[developer instructions]: Documentation/dev/git/develop.md
-[GitLab Access]: https://gitlab.kitware.com/users/sign_in
-[Fork VTK]: https://gitlab.kitware.com/vtk/vtk/fork/new
-[download instructions]: Documentation/dev/git/download.md#clone
-[developer setup script]: /Utilities/SetupForDevelopment.sh
-[Setup]: Documentation/dev/git/develop.md#Setup
-[Create a Topic]: Documentation/dev/git/develop.md#create-a-topic
-[Share a Topic]: Documentation/dev/git/develop.md#share-a-topic
-[Create a Merge Request]: Documentation/dev/git/develop.md#create-a-merge-request
-
-[Wiki]: http://www.vtk.org/Wiki/VTK
-[Doxygen]: http://www.vtk.org/doc/nightly/html
-[Mailing Lists]: http://www.vtk.org/VTK/help/mailing.html
+  [Development]: https://docs.google.com/a/kitware.com/document/d/1nzinw-dR5JQRNi_gb8qwLL5PnkGMK2FETlQGLr10tZw/view "Development guide"
+  [Wiki]:  http://www.vtk.org/Wiki/VTK "VTK wiki"
+  [Doxygen]: http://www.vtk.org/doc/nightly/html "API documentation"
+  [MailingLists]: http://www.vtk.org/VTK/help/mailing.html "Mailing Lists"
diff --git a/Charts/Core/CMakeLists.txt b/Charts/Core/CMakeLists.txt
index f051224..62bf092 100644
--- a/Charts/Core/CMakeLists.txt
+++ b/Charts/Core/CMakeLists.txt
@@ -24,7 +24,6 @@ set(Module_SRCS
   vtkPiecewisePointHandleItem.cxx
   vtkPlot.cxx
   vtkPlot3D.cxx
-  vtkPlotArea.cxx
   vtkPlotBag.cxx
   vtkPlotBar.cxx
   vtkPlotBox.cxx
diff --git a/Charts/Core/Testing/Cxx/CMakeLists.txt b/Charts/Core/Testing/Cxx/CMakeLists.txt
index 9a2262e..2b31f60 100644
--- a/Charts/Core/Testing/Cxx/CMakeLists.txt
+++ b/Charts/Core/Testing/Cxx/CMakeLists.txt
@@ -40,7 +40,6 @@ vtk_add_test_cxx(${vtk-module}CxxTests tests
   TestContextScene.cxx,NO_DATA,NO_VALID
   TestControlPointsItem.cxx,NO_DATA,NO_VALID
   TestControlPointsItemEvents.cxx,NO_DATA,NO_VALID
-  TestAreaPlot.cxx
   TestAxes.cxx
   TestBagPlot.cxx
   TestBarGraph.cxx
@@ -52,7 +51,6 @@ vtk_add_test_cxx(${vtk-module}CxxTests tests
   TestChartDouble.cxx
   TestChartDoubleColors.cxx
   TestChartMatrix.cxx
-  TestChartTileScaling.cxx
   TestChartUnicode.cxx
   TestChartsOn3D.cxx
   TestChartXYInvertedAxis.cxx
diff --git a/Charts/Core/Testing/Cxx/TestAreaPlot.cxx b/Charts/Core/Testing/Cxx/TestAreaPlot.cxx
deleted file mode 100644
index 0f5b4e8..0000000
--- a/Charts/Core/Testing/Cxx/TestAreaPlot.cxx
+++ /dev/null
@@ -1,98 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    TestAreaPlot.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 "vtkAxis.h"
-#include "vtkBrush.h"
-#include "vtkCharArray.h"
-#include "vtkChartXY.h"
-#include "vtkContextScene.h"
-#include "vtkContextView.h"
-#include "vtkFloatArray.h"
-#include "vtkNew.h"
-#include "vtkPlotArea.h"
-#include "vtkPlot.h"
-#include "vtkRenderWindow.h"
-#include "vtkRenderWindowInteractor.h"
-#include "vtkSmartPointer.h"
-#include "vtkTable.h"
-
-#include <algorithm>
-//----------------------------------------------------------------------------
-int TestAreaPlot( int, char * [] )
-{
-  // Set up a 2D scene, add an XY chart to it
-  vtkNew<vtkContextView> view;
-  view->GetRenderWindow()->SetSize(400, 300);
-  vtkNew<vtkChartXY> chart;
-  view->GetScene()->AddItem(chart.GetPointer());
-
-  // Create a table with some points in it...
-  vtkNew<vtkTable> table;
-  vtkNew<vtkFloatArray> arrX;
-  arrX->SetName("X Axis");
-  table->AddColumn(arrX.GetPointer());
-  vtkNew<vtkFloatArray> arrC;
-  arrC->SetName("Cosine");
-  table->AddColumn(arrC.GetPointer());
-  vtkNew<vtkFloatArray> arrS;
-  arrS->SetName("Sine");
-  table->AddColumn(arrS.GetPointer());
-  vtkNew<vtkFloatArray> arrS2;
-  arrS2->SetName("Sine2");
-  table->AddColumn(arrS2.GetPointer());
-  vtkNew<vtkFloatArray> arrS3;
-  arrS3->SetName("Sine3");
-  table->AddColumn(arrS3.GetPointer());
-  vtkNew<vtkFloatArray> arr1;
-  arr1->SetName("One");
-  table->AddColumn(arr1.GetPointer());
-
-  vtkNew<vtkCharArray> validMask;
-  validMask->SetName("ValidMask");
-  table->AddColumn(validMask.GetPointer());
-
-  // Test charting with a few more points...
-  int numPoints = 69;
-  float inc = 7.5 / (numPoints-1);
-  table->SetNumberOfRows(numPoints);
-  for (int i = 0; i < numPoints; ++i)
-    {
-    table->SetValue(i, 0, i * inc + 0.01);
-    table->SetValue(i, 1, cos(i * inc) + 0.01);
-    table->SetValue(i, 2, sin(i * inc) + 0.01);
-    table->SetValue(i, 3, sin(i * inc) + 0.5);
-    table->SetValue(i, 4, sin(i * inc) * sin(i * inc) + 0.01);
-    table->SetValue(i, 5, 1.0);
-
-    validMask->SetValue(i, (i > 30 && i < 40) ? 0 : 1);
-    }
-
-  // Add multiple line plots, setting the colors etc
-  vtkPlotArea* area = vtkPlotArea::SafeDownCast(chart->AddPlot(vtkChart::AREA));
-  area->SetInputData(table.GetPointer());
-  area->SetInputArray(0, "X Axis");
-  area->SetInputArray(1, "Sine");
-  area->SetInputArray(2, "Sine2");
-  area->SetValidPointMaskName("ValidMask");
-  area->GetBrush()->SetColorF(0.5, 0.5, 0.5, 0.5);
-  chart->GetAxis(vtkAxis::LEFT)->SetLogScale(true);
-
-  // Render the scene and compare the image to a reference image
-  view->GetRenderWindow()->SetMultiSamples(0);
-  view->GetInteractor()->Initialize();
-  view->GetInteractor()->Start();
-
-  return EXIT_SUCCESS;
-}
diff --git a/Charts/Core/Testing/Cxx/TestAxes.cxx b/Charts/Core/Testing/Cxx/TestAxes.cxx
index d19bf0a..6800429 100644
--- a/Charts/Core/Testing/Cxx/TestAxes.cxx
+++ b/Charts/Core/Testing/Cxx/TestAxes.cxx
@@ -55,7 +55,7 @@ int TestAxes(int , char * [])
     vtkAxis *axis = axesVertical[i].GetPointer();
     axis->SetPoint1(vtkVector2f(i * 69 + 30, 10));
     axis->SetPoint2(vtkVector2f(i * 69 + 30, 290));
-    axis->SetPosition((i % 2) ? vtkAxis::LEFT : vtkAxis::RIGHT);
+    axis->SetPosition(i % 2 ? vtkAxis::LEFT : vtkAxis::RIGHT);
     axis->SetRange(NULL); // check that NULL pointers don't cause trouble
     axis->SetRange(-1, 50);
 
@@ -93,7 +93,7 @@ int TestAxes(int , char * [])
     vtkAxis *axis = axesHorizontal[i].GetPointer();
     axis->SetPoint1(vtkVector2f(310, i * 50 + 30));
     axis->SetPoint2(vtkVector2f(490, i * 50 + 30));
-    axis->SetPosition((i % 2) ? vtkAxis::TOP : vtkAxis::BOTTOM);
+    axis->SetPosition(i % 2 ? vtkAxis::TOP : vtkAxis::BOTTOM);
     axis->SetRange(-1, 50);
 
     view->GetScene()->AddItem(axis);
@@ -161,7 +161,6 @@ int TestAxes(int , char * [])
   vtkNew<vtkAxis> logAxis;
   double plainRange[2] = {0.1, 1000.0};
   double logRange[2];
-  logAxis->SetScene(view->GetScene());
   logAxis->SetUnscaledRange(plainRange);
   logAxis->LogScaleOn();
   logAxis->GetUnscaledRange(NULL); // Insure NULL pointers are ignored.
diff --git a/Charts/Core/Testing/Cxx/TestChartTileScaling.cxx b/Charts/Core/Testing/Cxx/TestChartTileScaling.cxx
deleted file mode 100644
index f553bf7..0000000
--- a/Charts/Core/Testing/Cxx/TestChartTileScaling.cxx
+++ /dev/null
@@ -1,88 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    TestLinePlot.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 "vtkChartXY.h"
-#include "vtkContextScene.h"
-#include "vtkContextView.h"
-#include "vtkFloatArray.h"
-#include "vtkNew.h"
-#include "vtkPlot.h"
-#include "vtkPNGWriter.h"
-#include "vtkRenderWindow.h"
-#include "vtkRenderWindowInteractor.h"
-#include "vtkSmartPointer.h"
-#include "vtkTable.h"
-
-//------------------------------------------------------------------------------
-// This test mainly checks that the tick marks have the same relative spacing
-// regardless of the current vtkRenderWindow::TileScale. Take care if replacing
-// baselines, as the tick spacing should match the result obtained without the
-// SetTileScale call.
-//
-// Note: At the moment (6/2/2015), there is an issue with the data / gridmarks
-// not rendering properly at the tile 'seams', as can be seen in the 'valid'
-// baseline. Just noting that this is expected for now.
-//
-int TestChartTileScaling( int, char *[])
-{
-  vtkNew<vtkContextView> view;
-  view->GetRenderWindow()->SetMultiSamples(0);
-  // Needed for image export to work on all platforms:
-  view->GetRenderWindow()->SwapBuffersOff();
-  view->GetRenderWindow()->SetSize(400, 300);
-  // Set tile scale up.
-  view->GetRenderWindow()->SetTileScale(2);
-
-  vtkNew<vtkChartXY> chart;
-  view->GetScene()->AddItem(chart.GetPointer());
-
-  // Create a table with some points in it...
-  vtkNew<vtkTable> table;
-  vtkNew<vtkFloatArray> arrX;
-  arrX->SetName("X Axis");
-  table->AddColumn(arrX.GetPointer());
-  vtkNew<vtkFloatArray> arrS;
-  arrS->SetName("Sine");
-  table->AddColumn(arrS.GetPointer());
-  vtkNew<vtkFloatArray> arr1;
-  arr1->SetName("One");
-  table->AddColumn(arr1.GetPointer());
-
-  // Test charting with a few more points...
-  int numPoints = 69;
-  float inc = 7.5 / (numPoints-1);
-  table->SetNumberOfRows(numPoints);
-  for (int i = 0; i < numPoints; ++i)
-    {
-    table->SetValue(i, 0, i * inc);
-    table->SetValue(i, 1, sin(i * inc) + 0.0);
-    table->SetValue(i, 2, 1.0);
-    }
-
-  // Add multiple line plots, setting the colors etc
-  vtkPlot *line = chart->AddPlot(vtkChart::LINE);
-  line->SetInputData(table.GetPointer(), 0, 1);
-  line->SetColor(0, 255, 0, 255);
-  line->SetWidth(1.0);
-  line = chart->AddPlot(vtkChart::LINE);
-  line->SetInputData(table.GetPointer(), 0, 2);
-  line->SetColor(255, 0, 0, 255);
-  line->SetWidth(5.0);
-
-  view->GetInteractor()->Initialize();
-  view->GetInteractor()->Start();
-
-  return EXIT_SUCCESS;
-}
diff --git a/Charts/Core/Testing/Data/Baseline/TestAreaPlot.png.md5 b/Charts/Core/Testing/Data/Baseline/TestAreaPlot.png.md5
deleted file mode 100644
index ca2687b..0000000
--- a/Charts/Core/Testing/Data/Baseline/TestAreaPlot.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-177bd117be463e49c4c292accf0f3f6e
diff --git a/Charts/Core/Testing/Data/Baseline/TestAxes.png.md5 b/Charts/Core/Testing/Data/Baseline/TestAxes.png.md5
index daf637d..31eed49 100644
--- a/Charts/Core/Testing/Data/Baseline/TestAxes.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestAxes.png.md5
@@ -1 +1 @@
-6ec7f93769712a584917d238847cd3b4
+d93140c7f35391d1b3074226e51e7f2c
diff --git a/Charts/Core/Testing/Data/Baseline/TestBagPlot.png.md5 b/Charts/Core/Testing/Data/Baseline/TestBagPlot.png.md5
index c5fd3ca..7fca4e4 100644
--- a/Charts/Core/Testing/Data/Baseline/TestBagPlot.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestBagPlot.png.md5
@@ -1 +1 @@
-f1f8236e4066f5ce14c5b866d1020317
+4e320f7efda9ccf279c8d668de7ebd95
diff --git a/Charts/Core/Testing/Data/Baseline/TestBarGraph.png.md5 b/Charts/Core/Testing/Data/Baseline/TestBarGraph.png.md5
index 4c4496a..a53f820 100644
--- a/Charts/Core/Testing/Data/Baseline/TestBarGraph.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestBarGraph.png.md5
@@ -1 +1 @@
-a1dffc11a99c5de0d7894bd8212a16fd
+5f78619f364215b009c366583b4f7306
diff --git a/Charts/Core/Testing/Data/Baseline/TestBarGraphHorizontal.png.md5 b/Charts/Core/Testing/Data/Baseline/TestBarGraphHorizontal.png.md5
index 00222a2..ff404f1 100644
--- a/Charts/Core/Testing/Data/Baseline/TestBarGraphHorizontal.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestBarGraphHorizontal.png.md5
@@ -1 +1 @@
-7b26c11b65f9cb38d5fc34dad4f7995e
+df13908b54ba93960c4d029eb43c1dcf
diff --git a/Charts/Core/Testing/Data/Baseline/TestBarGraphSelection.png.md5 b/Charts/Core/Testing/Data/Baseline/TestBarGraphSelection.png.md5
index 72310be..85f7a81 100644
--- a/Charts/Core/Testing/Data/Baseline/TestBarGraphSelection.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestBarGraphSelection.png.md5
@@ -1 +1 @@
-00044aaeeff1242ffae6a69705bf6380
+19b58255f782eb3fad37da9813882ef0
diff --git a/Charts/Core/Testing/Data/Baseline/TestBoxPlot.png.md5 b/Charts/Core/Testing/Data/Baseline/TestBoxPlot.png.md5
index 1e5777a..de3de1e 100644
--- a/Charts/Core/Testing/Data/Baseline/TestBoxPlot.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestBoxPlot.png.md5
@@ -1 +1 @@
-08dd93eb0237c2ffd089711e127bfff1
+94400c10e2afe09ce3a6265ab624f225
\ No newline at end of file
diff --git a/Charts/Core/Testing/Data/Baseline/TestChartDouble.png.md5 b/Charts/Core/Testing/Data/Baseline/TestChartDouble.png.md5
index 9b9482e..9ca77d7 100644
--- a/Charts/Core/Testing/Data/Baseline/TestChartDouble.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestChartDouble.png.md5
@@ -1 +1 @@
-b7b7055285612449c0c456658d63ad43
+10dc4af829ac21253fa58cc524080090
diff --git a/Charts/Core/Testing/Data/Baseline/TestChartDoubleColors.png.md5 b/Charts/Core/Testing/Data/Baseline/TestChartDoubleColors.png.md5
index 9fa2d85..22e8f20 100644
--- a/Charts/Core/Testing/Data/Baseline/TestChartDoubleColors.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestChartDoubleColors.png.md5
@@ -1 +1 @@
-38af8cbdffdf4d1a108400c324d0899e
+34c525d0d4ab1466f17391c3b682eea4
diff --git a/Charts/Core/Testing/Data/Baseline/TestChartDoubleColors_1.png.md5 b/Charts/Core/Testing/Data/Baseline/TestChartDoubleColors_1.png.md5
index 6f4d082..2018017 100644
--- a/Charts/Core/Testing/Data/Baseline/TestChartDoubleColors_1.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestChartDoubleColors_1.png.md5
@@ -1 +1 @@
-5cc74159b77d0f74612f85478d3f3251
+9341cb712a4a841c76b6d1496da473cb
diff --git a/Charts/Core/Testing/Data/Baseline/TestChartDoubleColors_2.png.md5 b/Charts/Core/Testing/Data/Baseline/TestChartDoubleColors_2.png.md5
deleted file mode 100644
index 1e5285e..0000000
--- a/Charts/Core/Testing/Data/Baseline/TestChartDoubleColors_2.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-0342753c8fb24adcfe2ff29118e35e5a
diff --git a/Charts/Core/Testing/Data/Baseline/TestChartDouble_1.png.md5 b/Charts/Core/Testing/Data/Baseline/TestChartDouble_1.png.md5
index b51cf35..2fc4238 100644
--- a/Charts/Core/Testing/Data/Baseline/TestChartDouble_1.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestChartDouble_1.png.md5
@@ -1 +1 @@
-ef9846c7ad2590ba1ca118c9420e0e3d
+77750f5e04b728265603d17ab96f91e1
diff --git a/Charts/Core/Testing/Data/Baseline/TestChartDouble_2.png.md5 b/Charts/Core/Testing/Data/Baseline/TestChartDouble_2.png.md5
index e7c0771..766b2ac 100644
--- a/Charts/Core/Testing/Data/Baseline/TestChartDouble_2.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestChartDouble_2.png.md5
@@ -1 +1 @@
-598579b76b45500d1b5bc98ca8bd4a49
+e3fb6c525afff74227c333463d21fa6d
diff --git a/Charts/Core/Testing/Data/Baseline/TestChartMatrix.png.md5 b/Charts/Core/Testing/Data/Baseline/TestChartMatrix.png.md5
index 982d605..3779d31 100644
--- a/Charts/Core/Testing/Data/Baseline/TestChartMatrix.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestChartMatrix.png.md5
@@ -1 +1 @@
-9a850f9714cc60876d69edc0bb08d5b0
+9fa01ddf00af7c5447dc914020b46e76
diff --git a/Charts/Core/Testing/Data/Baseline/TestChartTileScaling.png.md5 b/Charts/Core/Testing/Data/Baseline/TestChartTileScaling.png.md5
deleted file mode 100644
index 44a7d41..0000000
--- a/Charts/Core/Testing/Data/Baseline/TestChartTileScaling.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-abdf30e792cd5edf076ea2b8e3de8885
diff --git a/Charts/Core/Testing/Data/Baseline/TestChartUnicode.png.md5 b/Charts/Core/Testing/Data/Baseline/TestChartUnicode.png.md5
index 8429702..c431886 100644
--- a/Charts/Core/Testing/Data/Baseline/TestChartUnicode.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestChartUnicode.png.md5
@@ -1 +1 @@
-98b59db57cdb8906ed50670d07a87a2b
+f94310e233df17e2ec8044351c91e2bb
diff --git a/Charts/Core/Testing/Data/Baseline/TestChartXYInvertedAxis.png.md5 b/Charts/Core/Testing/Data/Baseline/TestChartXYInvertedAxis.png.md5
index 8da3674..d7f52de 100644
--- a/Charts/Core/Testing/Data/Baseline/TestChartXYInvertedAxis.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestChartXYInvertedAxis.png.md5
@@ -1 +1 @@
-2ee5ef96d1759518b1847a4e48b35a5f
+05817e4d4f392afa2894494030348931
diff --git a/Charts/Core/Testing/Data/Baseline/TestChartXYInvertedAxis_1.png.md5 b/Charts/Core/Testing/Data/Baseline/TestChartXYInvertedAxis_1.png.md5
deleted file mode 100644
index 73ba0dd..0000000
--- a/Charts/Core/Testing/Data/Baseline/TestChartXYInvertedAxis_1.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-dc2ceada65184cab01ebbe94e7bbf434
diff --git a/Charts/Core/Testing/Data/Baseline/TestChartXYZ_1.png.md5 b/Charts/Core/Testing/Data/Baseline/TestChartXYZ_1.png.md5
deleted file mode 100644
index f9a9c68..0000000
--- a/Charts/Core/Testing/Data/Baseline/TestChartXYZ_1.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-ee2b7ffa5b400362881e002aea66d069
diff --git a/Charts/Core/Testing/Data/Baseline/TestChartXYZ_2.png.md5 b/Charts/Core/Testing/Data/Baseline/TestChartXYZ_2.png.md5
deleted file mode 100644
index 05f8c6d..0000000
--- a/Charts/Core/Testing/Data/Baseline/TestChartXYZ_2.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-195825e6ce2b8326742cd76920582f81
diff --git a/Charts/Core/Testing/Data/Baseline/TestChartsOn3D.png.md5 b/Charts/Core/Testing/Data/Baseline/TestChartsOn3D.png.md5
index 01c5722..4877bb1 100644
--- a/Charts/Core/Testing/Data/Baseline/TestChartsOn3D.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestChartsOn3D.png.md5
@@ -1 +1 @@
-214b8972d40722062fc38e67370277ac
+aa7814798b1c1ed2c7e57a841ae43458
diff --git a/Charts/Core/Testing/Data/Baseline/TestColorTransferFunction.png.md5 b/Charts/Core/Testing/Data/Baseline/TestColorTransferFunction.png.md5
index c9e7496..f0e7ad0 100644
--- a/Charts/Core/Testing/Data/Baseline/TestColorTransferFunction.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestColorTransferFunction.png.md5
@@ -1 +1 @@
-c5994ee130fb6f9e11785268c7083b1f
+e19210aeb365b595004571f4ad5b042c
diff --git a/Charts/Core/Testing/Data/Baseline/TestColorTransferFunction_1.png.md5 b/Charts/Core/Testing/Data/Baseline/TestColorTransferFunction_1.png.md5
new file mode 100644
index 0000000..66b8604
--- /dev/null
+++ b/Charts/Core/Testing/Data/Baseline/TestColorTransferFunction_1.png.md5
@@ -0,0 +1 @@
+3bd29e2faa82021db0f5495cee066204
diff --git a/Charts/Core/Testing/Data/Baseline/TestColorTransferFunction_2.png.md5 b/Charts/Core/Testing/Data/Baseline/TestColorTransferFunction_2.png.md5
new file mode 100644
index 0000000..f7d2426
--- /dev/null
+++ b/Charts/Core/Testing/Data/Baseline/TestColorTransferFunction_2.png.md5
@@ -0,0 +1 @@
+b24dd5c39b098f71f319cb1983579c91
diff --git a/Charts/Core/Testing/Data/Baseline/TestColorTransferFunction_3.png.md5 b/Charts/Core/Testing/Data/Baseline/TestColorTransferFunction_3.png.md5
new file mode 100644
index 0000000..5adfe59
--- /dev/null
+++ b/Charts/Core/Testing/Data/Baseline/TestColorTransferFunction_3.png.md5
@@ -0,0 +1 @@
+29b648b39163bd11d914bfb70d54e091
diff --git a/Charts/Core/Testing/Data/Baseline/TestContext.png.md5 b/Charts/Core/Testing/Data/Baseline/TestContext.png.md5
index f8ec63b..e5da86f 100644
--- a/Charts/Core/Testing/Data/Baseline/TestContext.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestContext.png.md5
@@ -1 +1 @@
-13255260c17509758478ba1a26d67746
+6ef36222ddd240a18a3b4220e401b53e
diff --git a/Charts/Core/Testing/Data/Baseline/TestContextUnicode.png.md5 b/Charts/Core/Testing/Data/Baseline/TestContextUnicode.png.md5
index 68d9588..837f8cc 100644
--- a/Charts/Core/Testing/Data/Baseline/TestContextUnicode.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestContextUnicode.png.md5
@@ -1 +1 @@
-267b3039b269817dcb0997e2fb3c9fe6
+df6e79b865f0c883cdfcdc9731473b73
diff --git a/Charts/Core/Testing/Data/Baseline/TestDiagram.png.md5 b/Charts/Core/Testing/Data/Baseline/TestDiagram.png.md5
index 7f904f8..722909d 100644
--- a/Charts/Core/Testing/Data/Baseline/TestDiagram.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestDiagram.png.md5
@@ -1 +1 @@
-6f5c555418de9d68e3f2870b9b988257
+190c0599f7247b53162380f08677abd8
diff --git a/Charts/Core/Testing/Data/Baseline/TestDiagram_1.png.md5 b/Charts/Core/Testing/Data/Baseline/TestDiagram_1.png.md5
new file mode 100644
index 0000000..952311c
--- /dev/null
+++ b/Charts/Core/Testing/Data/Baseline/TestDiagram_1.png.md5
@@ -0,0 +1 @@
+415eddccd5bc61b6e37ef6ebce651168
diff --git a/Charts/Core/Testing/Data/Baseline/TestFunctionalBagPlot.png.md5 b/Charts/Core/Testing/Data/Baseline/TestFunctionalBagPlot.png.md5
index 4a0fe13..8e80a64 100644
--- a/Charts/Core/Testing/Data/Baseline/TestFunctionalBagPlot.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestFunctionalBagPlot.png.md5
@@ -1 +1 @@
-f674b816293f146d83d87c8dcb6e5383
+4715ec4f1d4b60ccb206a9867c476a32
diff --git a/Charts/Core/Testing/Data/Baseline/TestHistogram2D.png.md5 b/Charts/Core/Testing/Data/Baseline/TestHistogram2D.png.md5
index 3311621..a9bf63c 100644
--- a/Charts/Core/Testing/Data/Baseline/TestHistogram2D.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestHistogram2D.png.md5
@@ -1 +1 @@
-a7f0877d744e789cab1f21d356e20373
+d5d7979379107fb96c6ed41dccba8a53
diff --git a/Charts/Core/Testing/Data/Baseline/TestInteractiveChartXYZ.png.md5 b/Charts/Core/Testing/Data/Baseline/TestInteractiveChartXYZ.png.md5
index f1ce2bf..3ab1740 100644
--- a/Charts/Core/Testing/Data/Baseline/TestInteractiveChartXYZ.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestInteractiveChartXYZ.png.md5
@@ -1 +1 @@
-5487588b6d595d4561907648f85f916a
+c0cfe1790b3bd4e9c7703b2a0c2fc0ff
diff --git a/Charts/Core/Testing/Data/Baseline/TestLegendHiddenPlots.png.md5 b/Charts/Core/Testing/Data/Baseline/TestLegendHiddenPlots.png.md5
index 0e12ffd..ac65805 100644
--- a/Charts/Core/Testing/Data/Baseline/TestLegendHiddenPlots.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestLegendHiddenPlots.png.md5
@@ -1 +1 @@
-daedcaba59e02986570b84b189608525
+737c9ead54fac70c21eeec3ecd0f9bc0
diff --git a/Charts/Core/Testing/Data/Baseline/TestLinePlot.png.md5 b/Charts/Core/Testing/Data/Baseline/TestLinePlot.png.md5
index 20ea157..bbfb707 100644
--- a/Charts/Core/Testing/Data/Baseline/TestLinePlot.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestLinePlot.png.md5
@@ -1 +1 @@
-9733be220d1d416ecda43b9a9c04f539
+dc17f39f128c67e91624f31a288d99f4
diff --git a/Charts/Core/Testing/Data/Baseline/TestLinePlot2.png.md5 b/Charts/Core/Testing/Data/Baseline/TestLinePlot2.png.md5
index 3558dd0..950aa91 100644
--- a/Charts/Core/Testing/Data/Baseline/TestLinePlot2.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestLinePlot2.png.md5
@@ -1 +1 @@
-e72ca9e8086c3d32200c3f246e3a5be0
+9a7c69553f081f0e9dcc5da9efa11c34
diff --git a/Charts/Core/Testing/Data/Baseline/TestLinePlot3D_1.png.md5 b/Charts/Core/Testing/Data/Baseline/TestLinePlot3D_1.png.md5
deleted file mode 100644
index 7e5ed17..0000000
--- a/Charts/Core/Testing/Data/Baseline/TestLinePlot3D_1.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-1e922aa0006fcc2ce09f80cca1bc79a8
diff --git a/Charts/Core/Testing/Data/Baseline/TestLinePlot3D_2.png.md5 b/Charts/Core/Testing/Data/Baseline/TestLinePlot3D_2.png.md5
deleted file mode 100644
index b466187..0000000
--- a/Charts/Core/Testing/Data/Baseline/TestLinePlot3D_2.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-af24804916f9f6054597dd44b07f975c
diff --git a/Charts/Core/Testing/Data/Baseline/TestLinePlotAxisFonts.png.md5 b/Charts/Core/Testing/Data/Baseline/TestLinePlotAxisFonts.png.md5
index c718424..f6b867f 100644
--- a/Charts/Core/Testing/Data/Baseline/TestLinePlotAxisFonts.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestLinePlotAxisFonts.png.md5
@@ -1 +1 @@
-562a62602457483dcaaa464bc7c3514e
+071b95ec444cef08e1de149331e0500f
diff --git a/Charts/Core/Testing/Data/Baseline/TestLinePlotAxisFonts_1.png.md5 b/Charts/Core/Testing/Data/Baseline/TestLinePlotAxisFonts_1.png.md5
index 6ee4d47..5ea22bf 100644
--- a/Charts/Core/Testing/Data/Baseline/TestLinePlotAxisFonts_1.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestLinePlotAxisFonts_1.png.md5
@@ -1 +1 @@
-a33f70c410fb45d7ea65ac7a59bef297
+113b7ab360b0321ab7a6cfe214a9907a
diff --git a/Charts/Core/Testing/Data/Baseline/TestLinePlotColors.png.md5 b/Charts/Core/Testing/Data/Baseline/TestLinePlotColors.png.md5
index cfdb83a..537f466 100644
--- a/Charts/Core/Testing/Data/Baseline/TestLinePlotColors.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestLinePlotColors.png.md5
@@ -1 +1 @@
-4ebe59930fab8b44354ad3ddea39a687
+c2b4ec8d2f32072cf52583b578ac4f09
diff --git a/Charts/Core/Testing/Data/Baseline/TestLinePlotDouble.png.md5 b/Charts/Core/Testing/Data/Baseline/TestLinePlotDouble.png.md5
index 4d611b6..57c8dad 100644
--- a/Charts/Core/Testing/Data/Baseline/TestLinePlotDouble.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestLinePlotDouble.png.md5
@@ -1 +1 @@
-878dac98f8dfdd7be1985179d2593cdc
+6f9f5b172bfe165a145dc5b54db4102e
diff --git a/Charts/Core/Testing/Data/Baseline/TestLinePlotDouble2.png.md5 b/Charts/Core/Testing/Data/Baseline/TestLinePlotDouble2.png.md5
index dcdeb0b..b9c40ae 100644
--- a/Charts/Core/Testing/Data/Baseline/TestLinePlotDouble2.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestLinePlotDouble2.png.md5
@@ -1 +1 @@
-66538857290b252e064f339a4d480ae4
+0b399b11f2729294bb6f6c76f0ae14e9
diff --git a/Charts/Core/Testing/Data/Baseline/TestLinePlotDouble_1.png.md5 b/Charts/Core/Testing/Data/Baseline/TestLinePlotDouble_1.png.md5
index 0f3b517..b0513bc 100644
--- a/Charts/Core/Testing/Data/Baseline/TestLinePlotDouble_1.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestLinePlotDouble_1.png.md5
@@ -1 +1 @@
-09cf5623d0bfbb3c043a092b3b9e7676
+3adab4f70db3f1a43d81d03cceb12925
diff --git a/Charts/Core/Testing/Data/Baseline/TestLinePlotDouble_2.png.md5 b/Charts/Core/Testing/Data/Baseline/TestLinePlotDouble_2.png.md5
index 521f634..45163cd 100644
--- a/Charts/Core/Testing/Data/Baseline/TestLinePlotDouble_2.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestLinePlotDouble_2.png.md5
@@ -1 +1 @@
-67662c8b3968b3575649c08ea19c4ddd
+d3127b249857e531db71874b2d13bd60
diff --git a/Charts/Core/Testing/Data/Baseline/TestLinePlotInteraction.png.md5 b/Charts/Core/Testing/Data/Baseline/TestLinePlotInteraction.png.md5
index e2747c1..9e6983d 100644
--- a/Charts/Core/Testing/Data/Baseline/TestLinePlotInteraction.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestLinePlotInteraction.png.md5
@@ -1 +1 @@
-183b0843b6c6d15717bea9f47a942d41
+8ab957b3f559361f08f134d4b67711b5
diff --git a/Charts/Core/Testing/Data/Baseline/TestLinePlotInteraction_1.png.md5 b/Charts/Core/Testing/Data/Baseline/TestLinePlotInteraction_1.png.md5
new file mode 100644
index 0000000..b17163a
--- /dev/null
+++ b/Charts/Core/Testing/Data/Baseline/TestLinePlotInteraction_1.png.md5
@@ -0,0 +1 @@
+1f489d6f2076ec631f445d6cb5a6b3f2
diff --git a/Charts/Core/Testing/Data/Baseline/TestLinePlotSelection.png.md5 b/Charts/Core/Testing/Data/Baseline/TestLinePlotSelection.png.md5
index fa31af6..00ed026 100644
--- a/Charts/Core/Testing/Data/Baseline/TestLinePlotSelection.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestLinePlotSelection.png.md5
@@ -1 +1 @@
-68187b50e757da9e3801469652cb753f
+c18f079349a9e3fe0f583a7bd7386bd9
diff --git a/Charts/Core/Testing/Data/Baseline/TestLinePlotSelection2.png.md5 b/Charts/Core/Testing/Data/Baseline/TestLinePlotSelection2.png.md5
index 006247a..74a8ece 100644
--- a/Charts/Core/Testing/Data/Baseline/TestLinePlotSelection2.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestLinePlotSelection2.png.md5
@@ -1 +1 @@
-d82bf6adeed89c7905ea93f061731156
+fb00609ecc98c6e69924562f485e52b9
diff --git a/Charts/Core/Testing/Data/Baseline/TestLinePlotSelection2_1.png.md5 b/Charts/Core/Testing/Data/Baseline/TestLinePlotSelection2_1.png.md5
index b8623ef..0ba828e 100644
--- a/Charts/Core/Testing/Data/Baseline/TestLinePlotSelection2_1.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestLinePlotSelection2_1.png.md5
@@ -1 +1 @@
-17020f1b46a2d6bdbed67abbef065b0c
+3c65f3f6e4be39bf05bf557d8e4fcca7
diff --git a/Charts/Core/Testing/Data/Baseline/TestLinePlotSelection_1.png.md5 b/Charts/Core/Testing/Data/Baseline/TestLinePlotSelection_1.png.md5
index 9e94a30..658e947 100644
--- a/Charts/Core/Testing/Data/Baseline/TestLinePlotSelection_1.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestLinePlotSelection_1.png.md5
@@ -1 +1 @@
-32e33a782041be03ced33784e1cb2a98
+502c99d73fbfb7102cdc94dff55263ec
diff --git a/Charts/Core/Testing/Data/Baseline/TestMultipleChartRenderers.png.md5 b/Charts/Core/Testing/Data/Baseline/TestMultipleChartRenderers.png.md5
index 6591236..8eec868 100644
--- a/Charts/Core/Testing/Data/Baseline/TestMultipleChartRenderers.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestMultipleChartRenderers.png.md5
@@ -1 +1 @@
-188fd03bd16efdf766c0514167e039bc
+761c93dca5da98d3da0fa93a0efabc54
diff --git a/Charts/Core/Testing/Data/Baseline/TestMultipleChartRenderers_1.png.md5 b/Charts/Core/Testing/Data/Baseline/TestMultipleChartRenderers_1.png.md5
new file mode 100644
index 0000000..9a33ffc
--- /dev/null
+++ b/Charts/Core/Testing/Data/Baseline/TestMultipleChartRenderers_1.png.md5
@@ -0,0 +1 @@
+8d759b92809629757242ec967d983542
diff --git a/Charts/Core/Testing/Data/Baseline/TestMultipleRenderers.png.md5 b/Charts/Core/Testing/Data/Baseline/TestMultipleRenderers.png.md5
index eefd54d..1b13188 100644
--- a/Charts/Core/Testing/Data/Baseline/TestMultipleRenderers.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestMultipleRenderers.png.md5
@@ -1 +1 @@
-268f49560d77178a83bcc4eedda5c634
+9f901dbaac0a896020e02d184a7a63ae
diff --git a/Charts/Core/Testing/Data/Baseline/TestMultipleRenderers_1.png.md5 b/Charts/Core/Testing/Data/Baseline/TestMultipleRenderers_1.png.md5
index b509a8f..ec241b7 100644
--- a/Charts/Core/Testing/Data/Baseline/TestMultipleRenderers_1.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestMultipleRenderers_1.png.md5
@@ -1 +1 @@
-e5678490f4330ee1ab8a2dd0afad1dd9
+f70a70dcefd69ba7f6707b31b4cbd6f7
diff --git a/Charts/Core/Testing/Data/Baseline/TestMultipleRenderers_2.png.md5 b/Charts/Core/Testing/Data/Baseline/TestMultipleRenderers_2.png.md5
new file mode 100644
index 0000000..a25c193
--- /dev/null
+++ b/Charts/Core/Testing/Data/Baseline/TestMultipleRenderers_2.png.md5
@@ -0,0 +1 @@
+5f51999f99eff694ea18f8a4cbdcbccb
diff --git a/Charts/Core/Testing/Data/Baseline/TestMultipleScalarsToColors.png.md5 b/Charts/Core/Testing/Data/Baseline/TestMultipleScalarsToColors.png.md5
index 0177d97..76d4040 100644
--- a/Charts/Core/Testing/Data/Baseline/TestMultipleScalarsToColors.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestMultipleScalarsToColors.png.md5
@@ -1 +1 @@
-9d2de86b4e58da13986fee8ad0ad8351
+98907c3079a153fb665e006dab066d46
diff --git a/Charts/Core/Testing/Data/Baseline/TestParallelCoordinates.png.md5 b/Charts/Core/Testing/Data/Baseline/TestParallelCoordinates.png.md5
index e8ef492..bffa4cb 100644
--- a/Charts/Core/Testing/Data/Baseline/TestParallelCoordinates.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestParallelCoordinates.png.md5
@@ -1 +1 @@
-b794b442db126a384e49a0379b4ebde2
+3db1fbe01c1b0f9071e7e2836e8717a0
diff --git a/Charts/Core/Testing/Data/Baseline/TestParallelCoordinatesColors.png.md5 b/Charts/Core/Testing/Data/Baseline/TestParallelCoordinatesColors.png.md5
index d97c9ab..1b73ae3 100644
--- a/Charts/Core/Testing/Data/Baseline/TestParallelCoordinatesColors.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestParallelCoordinatesColors.png.md5
@@ -1 +1 @@
-3829dd3462a812104b435692cf3b3b13
+5c02cfd9cd922c32115deaf0083d8d64
diff --git a/Charts/Core/Testing/Data/Baseline/TestParallelCoordinatesDouble.png.md5 b/Charts/Core/Testing/Data/Baseline/TestParallelCoordinatesDouble.png.md5
index b9d3503..5c7d4f0 100644
--- a/Charts/Core/Testing/Data/Baseline/TestParallelCoordinatesDouble.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestParallelCoordinatesDouble.png.md5
@@ -1 +1 @@
-fd11c765b7040b74dcd81aebbb4a9b9f
+9cd5211af09ae828a74e02b2dc4f98b4
diff --git a/Charts/Core/Testing/Data/Baseline/TestPieChart.png.md5 b/Charts/Core/Testing/Data/Baseline/TestPieChart.png.md5
index a60ed99..7e760b1 100644
--- a/Charts/Core/Testing/Data/Baseline/TestPieChart.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestPieChart.png.md5
@@ -1 +1 @@
-473bc80449191d4ab4138a8b43d2a864
+844cebf7252d631f5b71e1d531b78e22
diff --git a/Charts/Core/Testing/Data/Baseline/TestPieChart_1.png.md5 b/Charts/Core/Testing/Data/Baseline/TestPieChart_1.png.md5
new file mode 100644
index 0000000..824d4ae
--- /dev/null
+++ b/Charts/Core/Testing/Data/Baseline/TestPieChart_1.png.md5
@@ -0,0 +1 @@
+6e472a149250d32a30a767b9dea4fb8b
diff --git a/Charts/Core/Testing/Data/Baseline/TestPlotMatrix.png.md5 b/Charts/Core/Testing/Data/Baseline/TestPlotMatrix.png.md5
index fb9b46a..7909b64 100644
--- a/Charts/Core/Testing/Data/Baseline/TestPlotMatrix.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestPlotMatrix.png.md5
@@ -1 +1 @@
-d37f82f68118ba55b9ec0016abee3ce7
+f8e3b6138a259b7aec19e1ea5d5d04e9
diff --git a/Charts/Core/Testing/Data/Baseline/TestScatterPlot.png.md5 b/Charts/Core/Testing/Data/Baseline/TestScatterPlot.png.md5
index 9c6abf0..53c9dae 100644
--- a/Charts/Core/Testing/Data/Baseline/TestScatterPlot.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestScatterPlot.png.md5
@@ -1 +1 @@
-9eea8002e9169b898a30f52c5498e115
+d6668cb1d7889fbc4adc52385b0dad07
diff --git a/Charts/Core/Testing/Data/Baseline/TestScatterPlotColors.png.md5 b/Charts/Core/Testing/Data/Baseline/TestScatterPlotColors.png.md5
index 51de0fa..be85543 100644
--- a/Charts/Core/Testing/Data/Baseline/TestScatterPlotColors.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestScatterPlotColors.png.md5
@@ -1 +1 @@
-4d06dccbb5954dca5787e187289fd91d
+1245cfbf37f063a924601db09d6d1efa
diff --git a/Charts/Core/Testing/Data/Baseline/TestScatterPlotMatrix.png.md5 b/Charts/Core/Testing/Data/Baseline/TestScatterPlotMatrix.png.md5
index 907411a..7e70560 100644
--- a/Charts/Core/Testing/Data/Baseline/TestScatterPlotMatrix.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestScatterPlotMatrix.png.md5
@@ -1 +1 @@
-74c5fcc50a9e99a75630847214cc46f9
+1996fbb5169cc985d9847162c36ea673
diff --git a/Charts/Core/Testing/Data/Baseline/TestScatterPlotMatrixVehicles.png.md5 b/Charts/Core/Testing/Data/Baseline/TestScatterPlotMatrixVehicles.png.md5
index 09d7569..3a4cef7 100644
--- a/Charts/Core/Testing/Data/Baseline/TestScatterPlotMatrixVehicles.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestScatterPlotMatrixVehicles.png.md5
@@ -1 +1 @@
-7049505b949330ad4c6dd36c1af7b8df
+7580d4e48d57ae1eb778f14f7fdc752a
diff --git a/Charts/Core/Testing/Data/Baseline/TestScatterPlotMatrixVisible.png.md5 b/Charts/Core/Testing/Data/Baseline/TestScatterPlotMatrixVisible.png.md5
index 6f08c53..61618c3 100644
--- a/Charts/Core/Testing/Data/Baseline/TestScatterPlotMatrixVisible.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestScatterPlotMatrixVisible.png.md5
@@ -1 +1 @@
-c6db89e945055102d94635f6576f58dc
+bde888bbdd0f4667be426baecaf5f725
diff --git a/Charts/Core/Testing/Data/Baseline/TestScatterPlotMatrix_1.png.md5 b/Charts/Core/Testing/Data/Baseline/TestScatterPlotMatrix_1.png.md5
index df6a952..ff035db 100644
--- a/Charts/Core/Testing/Data/Baseline/TestScatterPlotMatrix_1.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestScatterPlotMatrix_1.png.md5
@@ -1 +1 @@
-1bcd0484b4d1c8d66d8cad214dbb6d1a
+2cb4d4567c1519c0fbe0aeea94a3daa0
diff --git a/Charts/Core/Testing/Data/Baseline/TestScatterPlotMatrix_2.png.md5 b/Charts/Core/Testing/Data/Baseline/TestScatterPlotMatrix_2.png.md5
index 68f15ce..5e3dd0b 100644
--- a/Charts/Core/Testing/Data/Baseline/TestScatterPlotMatrix_2.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestScatterPlotMatrix_2.png.md5
@@ -1 +1 @@
-a72c8c2f17abf6b5b33a6e673907045f
+6e741958a647dfa1a64730e12db6b388
diff --git a/Charts/Core/Testing/Data/Baseline/TestScatterPlotMatrix_3.png.md5 b/Charts/Core/Testing/Data/Baseline/TestScatterPlotMatrix_3.png.md5
new file mode 100644
index 0000000..3ef77e2
--- /dev/null
+++ b/Charts/Core/Testing/Data/Baseline/TestScatterPlotMatrix_3.png.md5
@@ -0,0 +1 @@
+e14446e625334b9435ae9e25d0596825
diff --git a/Charts/Core/Testing/Data/Baseline/TestScientificPlot.png.md5 b/Charts/Core/Testing/Data/Baseline/TestScientificPlot.png.md5
index 6b5b82b..104e060 100644
--- a/Charts/Core/Testing/Data/Baseline/TestScientificPlot.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestScientificPlot.png.md5
@@ -1 +1 @@
-78bc41dad07f29039255386ce401a2c0
+7ab792ab4e4ede6a94573f85c7173546
diff --git a/Charts/Core/Testing/Data/Baseline/TestStackedBarGraph.png.md5 b/Charts/Core/Testing/Data/Baseline/TestStackedBarGraph.png.md5
index 544e412..1bfb6a5 100644
--- a/Charts/Core/Testing/Data/Baseline/TestStackedBarGraph.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestStackedBarGraph.png.md5
@@ -1 +1 @@
-db5b22ac4e57d859410a9aeca1ba706b
+0fa5cde7810a637734c6c3bb65fa5551
diff --git a/Charts/Core/Testing/Data/Baseline/TestStackedPlot.png.md5 b/Charts/Core/Testing/Data/Baseline/TestStackedPlot.png.md5
index aa04e9e..3102dad 100644
--- a/Charts/Core/Testing/Data/Baseline/TestStackedPlot.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestStackedPlot.png.md5
@@ -1 +1 @@
-3f7e3acf6d2e78a4084218979b41068d
+b15d1b92e43b8057a0970b210eef0e96
diff --git a/Charts/Core/Testing/Data/Baseline/TestSurfacePlot.png.md5 b/Charts/Core/Testing/Data/Baseline/TestSurfacePlot.png.md5
index 5db8d41..9dea874 100644
--- a/Charts/Core/Testing/Data/Baseline/TestSurfacePlot.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestSurfacePlot.png.md5
@@ -1 +1 @@
-84248d244fdb99a6e6033c730ab01dd9
+ecb1636a54d19208c010606cef06700a
diff --git a/Charts/Core/Testing/Data/Baseline/TestZoomAxis.png.md5 b/Charts/Core/Testing/Data/Baseline/TestZoomAxis.png.md5
index 50165f3..5b1059b 100644
--- a/Charts/Core/Testing/Data/Baseline/TestZoomAxis.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestZoomAxis.png.md5
@@ -1 +1 @@
-78536392754a59b91c609386a0813efc
+ddaa4755e611ee0bf902f15acb8a5728
diff --git a/Charts/Core/Testing/Data/Baseline/TestZoomAxis_1.png.md5 b/Charts/Core/Testing/Data/Baseline/TestZoomAxis_1.png.md5
index 234dc31..f861914 100644
--- a/Charts/Core/Testing/Data/Baseline/TestZoomAxis_1.png.md5
+++ b/Charts/Core/Testing/Data/Baseline/TestZoomAxis_1.png.md5
@@ -1 +1 @@
-e268742c63a67a605347204a388e73fa
+986b61a336562cc8ae8627f1dc1f8e62
diff --git a/Charts/Core/vtkAxis.cxx b/Charts/Core/vtkAxis.cxx
index 3602856..d48f605 100644
--- a/Charts/Core/vtkAxis.cxx
+++ b/Charts/Core/vtkAxis.cxx
@@ -18,7 +18,6 @@
 #include "vtkMath.h"
 #include "vtkNew.h"
 #include "vtkContext2D.h"
-#include "vtkContextScene.h"
 #include "vtkPen.h"
 #include "vtkChart.h"
 #include "vtkTextProperty.h"
@@ -156,12 +155,9 @@ void vtkAxis::SetPosition(int position)
 
 void vtkAxis::SetPoint1(const vtkVector2f &pos)
 {
-  if (this->Position1 != pos)
-    {
-    this->Position1 = pos;
-    this->Resized = true;
-    this->Modified();
-    }
+  this->Position1 = pos;
+  this->Resized = true;
+  this->Modified();
 }
 
 void vtkAxis::SetPoint1(float x, float y)
@@ -176,12 +172,9 @@ vtkVector2f vtkAxis::GetPosition1()
 
 void vtkAxis::SetPoint2(const vtkVector2f &pos)
 {
-  if (this->Position2 != pos)
-    {
-    this->Position2 = pos;
-    this->Resized = true;
-    this->Modified();
-    }
+  this->Position2 = pos;
+  this->Resized = true;
+  this->Modified();
 }
 
 void vtkAxis::SetPoint2(float x, float y)
@@ -821,6 +814,44 @@ bool vtkAxis::SetCustomTickPositions(vtkDoubleArray *positions,
     }
 }
 
+#ifndef VTK_LEGACY_REMOVE
+//-----------------------------------------------------------------------------
+void vtkAxis::SetTickPositions(vtkDoubleArray* array)
+{
+  VTK_LEGACY_REPLACED_BODY(vtkAxis::SetTickPositions, "VTK 6.0",
+                           vtkAxis::SetCustomTickPositions);
+  if (!array)
+    {
+    this->TickPositions->SetNumberOfTuples(0);
+    }
+  else
+    {
+    this->TickPositions->DeepCopy(array);
+    }
+  this->CustomTickLabels = true;
+  this->TickMarksDirty = false;
+  this->Modified();
+}
+
+//-----------------------------------------------------------------------------
+void vtkAxis::SetTickLabels(vtkStringArray* array)
+{
+  VTK_LEGACY_REPLACED_BODY(vtkAxis::SetTickLabels, "VTK 6.0",
+                           vtkAxis::SetCustomTickPositions);
+  if (!array)
+    {
+    this->TickLabels->SetNumberOfTuples(0);
+    }
+  else
+    {
+    this->TickLabels->DeepCopy(array);
+    }
+  this->CustomTickLabels = true;
+  this->TickMarksDirty = false;
+  this->Modified();
+}
+#endif // VTK_LEGACY_REMOVE
+
 //-----------------------------------------------------------------------------
 vtkRectf vtkAxis::GetBoundingRect(vtkContext2D* painter)
 {
@@ -885,7 +916,6 @@ void vtkAxis::UpdateLogScaleActive(bool alwaysUpdateMinMaxFromUnscaled)
     if (!this->LogScaleActive)
       {
       this->LogScaleActive = true;
-      this->TickMarksDirty = true;
       needUpdate = true;
       }
     if (needUpdate || alwaysUpdateMinMaxFromUnscaled)
@@ -936,7 +966,6 @@ void vtkAxis::UpdateLogScaleActive(bool alwaysUpdateMinMaxFromUnscaled)
     if (this->LogScaleActive)
       {
       this->LogScaleActive = false;
-      this->TickMarksDirty = true;
       needUpdate = true;
       }
     if (needUpdate || alwaysUpdateMinMaxFromUnscaled)
@@ -1365,38 +1394,18 @@ double vtkAxis::NiceMinMax(double &min, double &max, float pixelRange,
 //-----------------------------------------------------------------------------
 double vtkAxis::CalculateNiceMinMax(double &min, double &max)
 {
-  if (this->NumberOfTicks > 0)
-    {
-    // An exact number of ticks was requested, use the min/max and exact number.
-    min = this->Minimum;
-    max = this->Maximum;
-    double range = fabs(max - min);
-    return range / double(this->NumberOfTicks - 1);
-    }
-
-  vtkVector2i tileScale(1);
-  if (!this->Scene)
-    {
-    vtkWarningMacro("vtkAxis needs a vtkContextScene to determine window "
-                    "properties. Assuming no tile scaling is set.");
-    }
-  else
-    {
-    tileScale = this->Scene->GetLogicalTileScale();
-    }
-
   float pixelRange = 0;
   float tickPixelSpacing = 0;
   if (this->Position == vtkAxis::LEFT || this->Position == vtkAxis::RIGHT
       || this->Position == vtkAxis::PARALLEL)
     {
     pixelRange = this->Position2.GetY() - this->Position1.GetY();
-    tickPixelSpacing = 30 * tileScale.GetX();
+    tickPixelSpacing = 30;
     }
   else
     {
     pixelRange = this->Position2.GetX() - this->Position1.GetX();
-    tickPixelSpacing = 45 * tileScale.GetY();
+    tickPixelSpacing = 45;
     }
 
   double niceTickSpacing = 0.0;
@@ -1411,7 +1420,18 @@ double vtkAxis::CalculateNiceMinMax(double &min, double &max)
       vtkAxis::NiceMinMax(min, max, pixelRange, tickPixelSpacing);
     }
 
-  return niceTickSpacing;
+  if (this->NumberOfTicks > 0)
+    {
+    // An exact number of ticks was requested, use the min/max and exact number.
+    min = this->Minimum;
+    max = this->Maximum;
+    double range = fabs(max - min);
+    return range / double(this->NumberOfTicks - 1);
+    }
+  else
+    {
+    return niceTickSpacing;
+    }
 }
 
 //-----------------------------------------------------------------------------
@@ -1587,25 +1607,25 @@ void vtkAxis::GenerateLogScaleTickMarks(int order,
     double value = result * pow(10.0, static_cast<double>(order));
     this->TickPositions->InsertNextValue(log10(value));
 
-    if (niceTickMark)
+    // Now create a label for the tick position
+    vtksys_ios::ostringstream ostr;
+    ostr.imbue(std::locale::classic());
+    if (this->Notation > 0)
       {
-      // Now create a label for the tick position
-      vtksys_ios::ostringstream ostr;
-      ostr.imbue(std::locale::classic());
-      if (this->Notation > 0)
-        {
-        ostr.precision(this->Precision);
-        }
-      if (this->Notation == SCIENTIFIC_NOTATION)
-        {
-        ostr.setf(vtksys_ios::ios::scientific, vtksys_ios::ios::floatfield);
-        }
-      else if (this->Notation == FIXED_NOTATION)
-        {
-        ostr.setf(ios::fixed, ios::floatfield);
-        }
-      ostr << value;
+      ostr.precision(this->Precision);
+      }
+    if (this->Notation == SCIENTIFIC_NOTATION)
+      {
+      ostr.setf(vtksys_ios::ios::scientific, vtksys_ios::ios::floatfield);
+      }
+    else if (this->Notation == FIXED_NOTATION)
+      {
+      ostr.setf(ios::fixed, ios::floatfield);
+      }
+    ostr << value;
 
+    if (niceTickMark)
+      {
       this->TickLabels->InsertNextValue(ostr.str());
       }
     else
diff --git a/Charts/Core/vtkAxis.h b/Charts/Core/vtkAxis.h
index 3bbc041..6e9e8bb 100644
--- a/Charts/Core/vtkAxis.h
+++ b/Charts/Core/vtkAxis.h
@@ -293,6 +293,13 @@ public:
     STANDARD_NOTATION = 0,
     SCIENTIFIC_NOTATION,
     FIXED_NOTATION,
+
+#ifndef VTK_LEGACY_REMOVE
+    // deprecated, use the *_NOTATION versions above
+    STANDARD = STANDARD_NOTATION,
+    SCIENTIFIC = SCIENTIFIC_NOTATION,
+    MIXED = FIXED_NOTATION
+#endif
   };
 
   // Description:
@@ -383,6 +390,16 @@ public:
                                       vtkStringArray* labels = 0);
 
   // Description:
+  // Set the tick positions (in plot coordinates).
+  // \deprecated 6.0 Use the two parameter SetTickPositions function.
+  VTK_LEGACY(virtual void SetTickPositions(vtkDoubleArray* positions));
+
+  // Description:
+  // Set the tick labels for the axis.
+  // \deprecated 6.0 Use the two parameter SetTickPositions function.
+  VTK_LEGACY(virtual void SetTickLabels(vtkStringArray* labels));
+
+  // Description:
   // Request the space the axes require to be drawn. This is returned as a
   // vtkRectf, with the corner being the offset from Point1, and the width/
   // height being the total width/height required by the axis. In order to
diff --git a/Charts/Core/vtkChart.h b/Charts/Core/vtkChart.h
index 4d208d1..df91569 100644
--- a/Charts/Core/vtkChart.h
+++ b/Charts/Core/vtkChart.h
@@ -53,8 +53,7 @@ public:
     BAR,
     STACKED,
     BAG,
-    FUNCTIONALBAG,
-    AREA};
+    FUNCTIONALBAG};
 
   // Description:
   // Enum of valid chart action types.
diff --git a/Charts/Core/vtkChartBox.cxx b/Charts/Core/vtkChartBox.cxx
index 38d22d5..93562a3 100644
--- a/Charts/Core/vtkChartBox.cxx
+++ b/Charts/Core/vtkChartBox.cxx
@@ -75,7 +75,6 @@ vtkChartBox::vtkChartBox()
 {
   this->Storage = new vtkChartBox::Private;
   this->Storage->Plot->SetParent(this);
-  this->AddItem(this->Storage->YAxis.GetPointer());
   this->GeometryValid = false;
   this->Selection = vtkIdTypeArray::New();
   this->SelectedColumn = -1;
@@ -399,10 +398,7 @@ void vtkChartBox::UpdateGeometry(vtkContext2D* painter)
 
     // Take up the entire window right now, this could be made configurable
     this->SetGeometry(geometry.GetData());
-
-    vtkVector2i tileScale = this->Scene->GetLogicalTileScale();
-    this->SetBorders(leftBorder, 30 * tileScale.GetY(),
-                     0, 20 * tileScale.GetY());
+    this->SetBorders(leftBorder, 30, 0, 20);
 
     int nbPlots = static_cast<int>(this->Storage->XPosition.size());
     // Iterate through the axes and set them up to span the chart area.
diff --git a/Charts/Core/vtkChartLegend.cxx b/Charts/Core/vtkChartLegend.cxx
index 4c89672..44286ff 100644
--- a/Charts/Core/vtkChartLegend.cxx
+++ b/Charts/Core/vtkChartLegend.cxx
@@ -144,12 +144,6 @@ bool vtkChartLegend::Paint(vtkContext2D *painter)
   // Draw all of the legend labels and marks
   for(size_t i = 0; i < this->Storage->ActivePlots.size(); ++i)
     {
-    if (!this->Storage->ActivePlots[i]->GetLegendVisibility())
-      {
-      // skip if legend is not visible.
-      continue;
-      }
-
     vtkStringArray *labels = this->Storage->ActivePlots[i]->GetLabels();
     for (vtkIdType l = 0; labels && (l < labels->GetNumberOfValues()); ++l)
       {
@@ -194,11 +188,6 @@ vtkRectf vtkChartLegend::GetBoundingRect(vtkContext2D *painter)
   // metrics, but these could be cached.
   for(size_t i = 0; i < this->Storage->ActivePlots.size(); ++i)
     {
-    if (!this->Storage->ActivePlots[i]->GetLegendVisibility())
-      {
-      // skip if legend is not visible.
-      continue;
-      }
     vtkStringArray *labels = this->Storage->ActivePlots[i]->GetLabels();
     for (vtkIdType l = 0; labels && (l < labels->GetNumberOfTuples()); ++l)
       {
@@ -215,11 +204,6 @@ vtkRectf vtkChartLegend::GetBoundingRect(vtkContext2D *painter)
   int numLabels = 0;
   for(size_t i = 0; i < this->Storage->ActivePlots.size(); ++i)
     {
-    if (!this->Storage->ActivePlots[i]->GetLegendVisibility())
-      {
-      // skip if legend is not visible.
-      continue;
-      }
     numLabels += this->Storage->ActivePlots[i]->GetNumberOfLabels();
     }
 
diff --git a/Charts/Core/vtkChartParallelCoordinates.cxx b/Charts/Core/vtkChartParallelCoordinates.cxx
index 3f7709e..521b41d 100644
--- a/Charts/Core/vtkChartParallelCoordinates.cxx
+++ b/Charts/Core/vtkChartParallelCoordinates.cxx
@@ -116,7 +116,6 @@ void vtkChartParallelCoordinates::Update()
     for (std::vector<vtkAxis *>::iterator it = this->Storage->Axes.begin();
          it != this->Storage->Axes.end(); ++it)
       {
-      this->RemoveItem(*it);
       (*it)->Delete();
       }
     this->Storage->Axes.clear();
@@ -126,7 +125,6 @@ void vtkChartParallelCoordinates::Update()
       {
       vtkAxis* axis = vtkAxis::New();
       axis->SetPosition(vtkAxis::PARALLEL);
-      this->AddItem(axis);
       this->Storage->Axes.push_back(axis);
       }
     this->Storage->AxesSelections.resize(this->Storage->Axes.size(),
@@ -355,10 +353,7 @@ void vtkChartParallelCoordinates::UpdateGeometry()
     {
     // Take up the entire window right now, this could be made configurable
     this->SetGeometry(geometry.GetData());
-
-    vtkVector2i tileScale = this->Scene->GetLogicalTileScale();
-    this->SetBorders(60 * tileScale.GetX(), 50 * tileScale.GetY(),
-                     60 * tileScale.GetX(), 20 * tileScale.GetY());
+    this->SetBorders(60, 50, 60, 20);
 
     // Iterate through the axes and set them up to span the chart area.
     int xStep = (this->Point2[0] - this->Point1[0]) /
diff --git a/Charts/Core/vtkChartPie.cxx b/Charts/Core/vtkChartPie.cxx
index b11ec05..058b913 100644
--- a/Charts/Core/vtkChartPie.cxx
+++ b/Charts/Core/vtkChartPie.cxx
@@ -98,11 +98,7 @@ bool vtkChartPie::Paint(vtkContext2D *painter)
     {
     // Take up the entire window right now, this could be made configurable
     this->SetGeometry(geometry);
-
-    vtkVector2i tileScale = this->Scene->GetLogicalTileScale();
-    this->SetBorders(20 * tileScale.GetX(), 20 * tileScale.GetY(),
-                     20 * tileScale.GetX(), 20 * tileScale.GetY());
-
+    this->SetBorders(20, 20, 20, 20);
     // Put the legend in the top corner of the chart
     vtkRectf rect = this->Legend->GetBoundingRect(painter);
     this->Legend->SetPoint(this->Point2[0] - rect.GetWidth(),
diff --git a/Charts/Core/vtkChartXY.cxx b/Charts/Core/vtkChartXY.cxx
index 57d067a..fa1dddc 100644
--- a/Charts/Core/vtkChartXY.cxx
+++ b/Charts/Core/vtkChartXY.cxx
@@ -32,7 +32,6 @@
 #include "vtkVector.h"
 #include "vtkVectorOperators.h"
 
-#include "vtkPlotArea.h"
 #include "vtkPlotBar.h"
 #include "vtkPlotBag.h"
 #include "vtkPlotFunctionalBag.h"
@@ -315,8 +314,11 @@ void vtkChartXY::Update()
 
   if (this->AutoAxes)
     {
-    vtkTuple<bool, 4> visibilities(false);
-    for (int i = 0; i < static_cast<int>(this->ChartPrivate->PlotCorners.size()); ++i)
+    for (int i = 0; i < 4; ++i)
+      {
+      this->ChartPrivate->axes[i]->SetVisible(false);
+      }
+    for (size_t i = 0; i < this->ChartPrivate->PlotCorners.size(); ++i)
       {
       int visible = 0;
       for (unsigned int j = 0;
@@ -330,14 +332,18 @@ void vtkChartXY::Update()
         }
       if (visible)
         {
-        visibilities[i % 4] = true;
-        visibilities[(i+1) % 4] = true;
+        if (i < 3)
+          {
+          this->ChartPrivate->axes[i]->SetVisible(true);
+          this->ChartPrivate->axes[i+1]->SetVisible(true);
+          }
+        else
+          {
+          this->ChartPrivate->axes[0]->SetVisible(true);
+          this->ChartPrivate->axes[3]->SetVisible(true);
+          }
         }
       }
-    for (int i = 0; i < 4; ++i)
-      {
-      this->ChartPrivate->axes[i]->SetVisible(visibilities[i]);
-      }
     }
 }
 
@@ -390,7 +396,6 @@ bool vtkChartXY::Paint(vtkContext2D *painter)
     }
 
   this->UpdateLayout(painter);
-
   // Recalculate the plot transform, min and max values if necessary
   if (!this->PlotTransformValid)
     {
@@ -402,14 +407,6 @@ bool vtkChartXY::Paint(vtkContext2D *painter)
     this->RecalculatePlotTransforms();
     }
 
-  // Now that plot transforms, including whether to use log scaling and the
-  // shift-scale factors, have been updated, we give the vtkPlot instances an
-  // opportunity to update caches.
-  for (size_t i = 0; i < this->ChartPrivate->plots.size(); ++i)
-    {
-    this->ChartPrivate->plots[i]->UpdateCache();
-    }
-
   // Update the clipping if necessary
   this->ChartPrivate->Clip->SetClip(this->Point1[0], this->Point1[1],
                                     this->Point2[0]-this->Point1[0],
@@ -833,9 +830,6 @@ bool vtkChartXY::UpdateLayout(vtkContext2D* painter)
   // their bounds, and to update the chart in response to that.
   bool changed = false;
 
-  vtkVector2i tileScale = this->Scene->GetLogicalTileScale();
-  vtkVector2i hiddenAxisBorder = tileScale * this->HiddenAxisBorder;
-
   // Axes
   if (this->LayoutStrategy == vtkChart::FILL_SCENE ||
       this->LayoutStrategy == vtkChart::FILL_RECT)
@@ -865,20 +859,13 @@ bool vtkChartXY::UpdateLayout(vtkContext2D* painter)
         painter->ComputeStringBounds(this->Title, bounds);
         if (bounds[3] > 0)
           {
-          border += (5 * tileScale.GetY()) /* title margin */
+          border += 5 /* title margin */
                     + bounds[3]; // add the title text height to the border.
           }
         }
 
-      if (i == vtkAxis::TOP || i == vtkAxis::BOTTOM)
-        {
-        border = std::max(border, hiddenAxisBorder.GetY());
-        }
-      else
-        {
-        border = std::max(border, hiddenAxisBorder.GetX());
-        }
-
+      border = border < this->HiddenAxisBorder ? this->HiddenAxisBorder :
+                                                 border;
       if (this->ChartPrivate->Borders[i] != border)
         {
         this->ChartPrivate->Borders[i] = border;
@@ -891,8 +878,8 @@ bool vtkChartXY::UpdateLayout(vtkContext2D* painter)
     {
     if (this->DrawAxesAtOrigin)
       {
-      this->SetBorders(hiddenAxisBorder.GetX(),
-                       hiddenAxisBorder.GetY(),
+      this->SetBorders(this->HiddenAxisBorder,
+                       this->HiddenAxisBorder,
                        this->ChartPrivate->Borders[2],
                        this->ChartPrivate->Borders[3]);
       // Get the screen coordinates for the origin, and move the axes there.
@@ -977,8 +964,6 @@ int vtkChartXY::GetLegendBorder(vtkContext2D* painter, int axisPosition)
     return 0;
     }
 
-  vtkVector2i tileScale = this->Scene->GetLogicalTileScale();
-
   int padding = 10;
   vtkVector2i legendSize(0, 0);
   vtkVector2i legendAlignment(this->Legend->GetHorizontalAlignment(),
@@ -992,12 +977,12 @@ int vtkChartXY::GetLegendBorder(vtkContext2D* painter, int axisPosition)
   if (axisPosition == vtkAxis::LEFT &&
       legendAlignment.GetX() == vtkChartLegend::LEFT)
     {
-    return legendSize.GetX() + padding * tileScale.GetX();
+    return legendSize.GetX() + padding;
     }
   else if (axisPosition == vtkAxis::RIGHT &&
            legendAlignment.GetX() == vtkChartLegend::RIGHT)
     {
-    return legendSize.GetX() + padding * tileScale.GetX();
+    return legendSize.GetX() + padding;
     }
   else if ((axisPosition == vtkAxis::TOP || axisPosition == vtkAxis::BOTTOM) &&
            (legendAlignment.GetX() == vtkChartLegend::LEFT ||
@@ -1008,12 +993,12 @@ int vtkChartXY::GetLegendBorder(vtkContext2D* painter, int axisPosition)
   else if (axisPosition == vtkAxis::TOP &&
            legendAlignment.GetY() == vtkChartLegend::TOP)
     {
-    return legendSize.GetY() + padding * tileScale.GetY();
+    return legendSize.GetY() + padding;
     }
   else if (axisPosition == vtkAxis::BOTTOM &&
            legendAlignment.GetY() == vtkChartLegend::BOTTOM)
     {
-    return legendSize.GetY() + padding * tileScale.GetY();
+    return legendSize.GetY() + padding;
     }
   else
     {
@@ -1172,14 +1157,6 @@ vtkPlot * vtkChartXY::AddPlot(int type)
       plot = bag;
       break;
       }
-    case AREA:
-      {
-      vtkPlotArea* area = vtkPlotArea::New();
-      area->SetParent(this);
-      area->GetBrush()->SetColor(color.GetData());
-      plot = area;
-      break;
-      }
 
     default:
       plot = NULL;
@@ -1970,7 +1947,7 @@ bool vtkChartXY::MouseButtonReleaseEvent(const vtkContextMouseEvent &mouse)
             {
             vtkPlot* plot = vtkPlot::SafeDownCast(this->ChartPrivate->
                                                   PlotCorners[i]->GetItem(j));
-            if (plot && plot->GetVisible() && plot->GetSelectable())
+            if (plot && plot->GetVisible())
               {
               // There is only really one old selection in this mode.
               if (i == 0 && j == 0)
@@ -2025,7 +2002,7 @@ bool vtkChartXY::MouseButtonReleaseEvent(const vtkContextMouseEvent &mouse)
             {
             vtkPlot* plot = vtkPlot::SafeDownCast(this->ChartPrivate->
                                                   PlotCorners[i]->GetItem(j));
-            if (plot && plot->GetVisible() && plot->GetSelectable())
+            if (plot && plot->GetVisible())
               {
               oldSelection->DeepCopy(plot->GetSelection());
               // Populate the selection using the appropriate shape.
@@ -2083,7 +2060,7 @@ bool vtkChartXY::MouseButtonReleaseEvent(const vtkContextMouseEvent &mouse)
             {
             vtkPlot* plot = vtkPlot::SafeDownCast(this->ChartPrivate->
                                                   PlotCorners[i]->GetItem(j));
-            if (plot && plot->GetVisible() && plot->GetSelectable())
+            if (plot && plot->GetVisible())
               {
               bool selected = false;
               // Populate the selection using the appropriate shape.
@@ -2118,9 +2095,6 @@ bool vtkChartXY::MouseButtonReleaseEvent(const vtkContextMouseEvent &mouse)
             }
           }
         }
-      vtkIdType* ptrSelection =
-        reinterpret_cast<vtkIdType *>(accumulateSelection->GetVoidPointer(0));
-      std::sort(ptrSelection, ptrSelection + accumulateSelection->GetNumberOfTuples());
       // Now add the accumulated selection to the old selection
       vtkChartSelectionHelper::BuildSelection(this->AnnotationLink,
                                               selectionMode,
diff --git a/Charts/Core/vtkChartXYZ.cxx b/Charts/Core/vtkChartXYZ.cxx
index bd4840e..369f188 100644
--- a/Charts/Core/vtkChartXYZ.cxx
+++ b/Charts/Core/vtkChartXYZ.cxx
@@ -706,7 +706,6 @@ void vtkChartXYZ::DetermineWhichAxesToLabel()
                 break;
               case 2:
                 ++k;
-                break;
               default:
                 break;
               }
diff --git a/Charts/Core/vtkColorLegend.cxx b/Charts/Core/vtkColorLegend.cxx
index 5de2341..a9e8d9e 100644
--- a/Charts/Core/vtkColorLegend.cxx
+++ b/Charts/Core/vtkColorLegend.cxx
@@ -37,7 +37,6 @@ vtkColorLegend::vtkColorLegend()
   this->Interpolate = true;
   this->Axis = vtkSmartPointer<vtkAxis>::New();
   this->Axis->SetPosition(vtkAxis::RIGHT);
-  this->AddItem(this->Axis);
   this->SetInline(false);
   this->SetHorizontalAlignment(vtkChartLegend::RIGHT);
   this->SetVerticalAlignment(vtkChartLegend::BOTTOM);
diff --git a/Charts/Core/vtkPlot.cxx b/Charts/Core/vtkPlot.cxx
index 5f9542a..5b07d6f 100644
--- a/Charts/Core/vtkPlot.cxx
+++ b/Charts/Core/vtkPlot.cxx
@@ -27,6 +27,7 @@
 #include "vtkNew.h"
 #include "vtksys/ios/sstream"
 
+vtkCxxSetObjectMacro(vtkPlot, Selection, vtkIdTypeArray);
 vtkCxxSetObjectMacro(vtkPlot, XAxis, vtkAxis);
 vtkCxxSetObjectMacro(vtkPlot, YAxis, vtkAxis);
 
@@ -46,7 +47,6 @@ vtkPlot::vtkPlot() : ShiftScale(0.0, 0.0, 1.0, 1.0)
   this->Labels = NULL;
   this->UseIndexForXSeries = false;
   this->Data = vtkSmartPointer<vtkContextMapper2D>::New();
-  this->Selectable = true;
   this->Selection = NULL;
   this->XAxis = NULL;
   this->YAxis = NULL;
@@ -54,8 +54,6 @@ vtkPlot::vtkPlot() : ShiftScale(0.0, 0.0, 1.0, 1.0)
   this->TooltipDefaultLabelFormat = "%l: %x,  %y";
   this->TooltipNotation = vtkAxis::STANDARD_NOTATION;
   this->TooltipPrecision = 6;
-
-  this->LegendVisibility = true;
 }
 
 //-----------------------------------------------------------------------------
@@ -498,16 +496,6 @@ void vtkPlot::SetInputArray(int index, const vtkStdString &name)
 }
 
 //-----------------------------------------------------------------------------
-void vtkPlot::SetSelection(vtkIdTypeArray *id)
-{
-  if (!this->GetSelectable())
-    {
-    return;
-    }
-  vtkSetObjectBodyMacro(Selection,vtkIdTypeArray,id);
-}
-
-//-----------------------------------------------------------------------------
 void vtkPlot::SetShiftScale(const vtkRectd &shiftScale)
 {
   if (shiftScale != this->ShiftScale)
@@ -538,5 +526,4 @@ vtkVariant vtkPlot::GetProperty(const vtkStdString&)
 void vtkPlot::PrintSelf(ostream &os, vtkIndent indent)
 {
   this->Superclass::PrintSelf(os, indent);
-  os << indent << "LegendVisibility: " << this->LegendVisibility << endl;
 }
diff --git a/Charts/Core/vtkPlot.h b/Charts/Core/vtkPlot.h
index 16099b4..b365245 100644
--- a/Charts/Core/vtkPlot.h
+++ b/Charts/Core/vtkPlot.h
@@ -47,14 +47,6 @@ public:
   virtual void PrintSelf(ostream &os, vtkIndent indent);
 
   // Description:
-  // Set whether the plot renders an entry in the legend. Default is true.
-  // vtkPlot::PaintLegend will get called to render the legend marker on when
-  // this is true.
-  vtkSetMacro(LegendVisibility, bool);
-  vtkGetMacro(LegendVisibility, bool);
-  vtkBooleanMacro(LegendVisibility, bool);
-
-  // Description:
   // Paint legend event for the plot, called whenever the legend needs the
   // plot items symbol/mark/line drawn. A rect is supplied with the lower left
   // corner of the rect (elements 0 and 1) and with width x height (elements 2
@@ -218,19 +210,6 @@ public:
   // column in the vtkTable.
   virtual void SetInputArray(int index, const vtkStdString &name);
 
-  // Description:
-  // Set whether the plot can be selected. True by default.
-  // If not, then SetSelection(), SelectPoints() or SelectPointsInPolygon()
-  // won't have any effect.
-  // \sa SetSelection(), SelectPoints(), SelectPointsInPolygon()
-  vtkSetMacro(Selectable,bool);
-  vtkGetMacro(Selectable,bool);
-  vtkBooleanMacro(Selectable,bool);
-
-  // Description:
-  // Sets the list of points that must be selected.
-  // If Selectable is false, then this method does nothing.
-  // \sa SetSelectable()
   virtual void SetSelection(vtkIdTypeArray *id);
   vtkGetObjectMacro(Selection, vtkIdTypeArray);
 
@@ -289,13 +268,6 @@ public:
     return this->GetBounds(bounds);
     }
 
-  // Description:
-  // Subclasses that build data caches to speed up painting should override this
-  // method to update such caches. This is called on each Paint, hence
-  // subclasses must add checks to avoid rebuilding of cache, unless necessary.
-  // Default implementation is empty.
-  virtual void UpdateCache() {}
-
 //BTX
   // Description:
   // A General setter/getter that should be overridden. It can silently drop
@@ -354,10 +326,6 @@ protected:
   vtkSmartPointer<vtkContextMapper2D> Data;
 
   // Description:
-  // Whether plot points can be selected or not.
-  bool Selectable;
-
-  // Description:
   // Selected indices for the table the plot is rendering
   vtkIdTypeArray *Selection;
 
@@ -386,8 +354,6 @@ protected:
   // The current shift in origin and scaling factor applied to the plot.
   vtkRectd ShiftScale;
 
-  bool LegendVisibility;
-
 private:
   vtkPlot(const vtkPlot &); // Not implemented.
   void operator=(const vtkPlot &); // Not implemented.
diff --git a/Charts/Core/vtkPlotArea.cxx b/Charts/Core/vtkPlotArea.cxx
deleted file mode 100644
index 5dc372d..0000000
--- a/Charts/Core/vtkPlotArea.cxx
+++ /dev/null
@@ -1,614 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkPlotArea.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 "vtkPlotArea.h"
-
-#include "vtkAxis.h"
-#include "vtkBoundingBox.h"
-#include "vtkBrush.h"
-#include "vtkCharArray.h"
-#include "vtkContext2D.h"
-#include "vtkContextMapper2D.h"
-#include "vtkDataArrayIteratorMacro.h"
-#include "vtkFloatArray.h"
-#include "vtkMath.h"
-#include "vtkNew.h"
-#include "vtkObjectFactory.h"
-#include "vtkPen.h"
-#include "vtkPoints2D.h"
-#include "vtkTable.h"
-#include "vtkWeakPointer.h"
-#include "vtkVectorOperators.h"
-
-#include <vector>
-#include <set>
-#include <cmath>
-#include <algorithm>
-
-namespace
-{
-  inline bool vtkIsBadPoint(const vtkVector2f& vec)
-    {
-    return (vtkMath::IsNan(vec.GetX()) || vtkMath::IsInf(vec.GetX()) ||
-      vtkMath::IsNan(vec.GetY()) || vtkMath::IsInf(vec.GetY()));
-    }
-} // end of namespace
-
-// Keeps all data-dependent meta-data that's updated in
-// vtkPlotArea::Update.
-class vtkPlotArea::vtkTableCache
-{
-  // PIMPL for STL vector...
-  struct vtkIndexedVector2f
-    {
-    size_t index;
-    vtkVector2f pos;
-    static bool compVector3fX(
-      const vtkIndexedVector2f& v1, const vtkIndexedVector2f& v2)
-      {
-      if (v1.pos.GetX() < v2.pos.GetX())
-        {
-        return true;
-        }
-      else
-        {
-        return false;
-        }
-      }
-    // See if the point is within tolerance.
-    static bool inRange(const vtkVector2f& point, const vtkVector2f& tol,
-      const vtkVector2f& current)
-      {
-      if (current.GetX() > point.GetX() - tol.GetX() && current.GetX() < point.GetX() + tol.GetX() &&
-        current.GetY() > point.GetY() - tol.GetY() && current.GetY() < point.GetY() + tol.GetY())
-        {
-        return true;
-        }
-      else
-        {
-        return false;
-        }
-      }
-    };
-
-  // DataStructure used to store sorted points.
-  class VectorPIMPL : public std::vector<vtkIndexedVector2f>
-  {
-public:
-  void Initialize(vtkVector2f* array, size_t n)
-    {
-    this->reserve(n);
-    for (size_t i = 0; i < n; ++i)
-      {
-      vtkIndexedVector2f tmp;
-      tmp.index = i;
-      tmp.pos = array[i];
-      this->push_back(tmp);
-      }
-    }
-
-  //-----------------------------------------------------------------------------
-  vtkIdType GetNearestPoint(
-    const vtkVector2f& point, const vtkVector2f& tol, vtkVector2f* location)
-    {
-    // Set up our search array, use the STL lower_bound algorithm
-    VectorPIMPL::iterator low;
-    VectorPIMPL &v = *this;
-
-    // Get the lowest point we might hit within the supplied tolerance
-    vtkIndexedVector2f lowPoint;
-    lowPoint.index = 0;
-    lowPoint.pos = vtkVector2f(point.GetX()-tol.GetX(), 0.0f);
-    low = std::lower_bound(v.begin(), v.end(), lowPoint, vtkIndexedVector2f::compVector3fX);
-
-    // Now consider the y axis
-    float highX = point.GetX() + tol.GetX();
-    while (low != v.end())
-      {
-      if (vtkIndexedVector2f::inRange(point, tol, (*low).pos))
-        {
-        *location = (*low).pos;
-        return static_cast<int>((*low).index);
-        }
-      else if (low->pos.GetX() > highX)
-        {
-        break;
-        }
-      ++low;
-      }
-    return -1;
-    }
-  };
-private:
-  vtkTimeStamp DataMTime;
-  vtkTimeStamp BoundsMTime;
-
-  // Unscaled data bounds.
-  vtkBoundingBox DataBounds;
-
-  vtkRectd ShiftScale;
-
-  vtkTuple<double, 2> GetDataRange(vtkDataArray* array)
-    {
-    assert(array);
-
-    if (this->ValidPointMask)
-      {
-      assert(array->GetNumberOfTuples() == this->ValidPointMask->GetNumberOfTuples());
-      switch (array->GetDataType())
-        {
-        vtkDataArrayIteratorMacro(array,
-          return this->ComputeArrayRange(vtkDABegin, vtkDAEnd, this->ValidPointMask));
-        }
-      }
-    else
-      {
-      switch (array->GetDataType())
-        {
-        vtkDataArrayIteratorMacro(array,
-          return this->ComputeArrayRange(vtkDABegin, vtkDAEnd));
-        }
-      }
-    vtkTuple<double, 2> range;
-    range[0] = VTK_DOUBLE_MAX;
-    range[1] = VTK_DOUBLE_MIN;
-    return range;
-    }
-
-  template <class Iterator>
-  vtkTuple<double, 2> ComputeArrayRange(Iterator begin, Iterator end, vtkCharArray* mask)
-    {
-    vtkTuple<double, 2> range;
-    range[0] = VTK_DOUBLE_MAX;
-    range[1] = VTK_DOUBLE_MIN;
-    vtkIdType index=0;
-    for (Iterator iter=begin; iter != end; ++iter, ++index)
-      {
-      if (mask->GetValue(index) != 0)
-        {
-        range[0] = std::min(range[0], static_cast<double>(*iter));
-        range[1] = std::max(range[1], static_cast<double>(*iter));
-        }
-      }
-    return range;
-    }
-
-  template <class Iterator>
-  vtkTuple<double, 2> ComputeArrayRange(Iterator begin, Iterator end)
-    {
-    vtkTuple<double, 2> range;
-    range[0] = VTK_DOUBLE_MAX;
-    range[1] = VTK_DOUBLE_MIN;
-    vtkIdType index=0;
-    for (Iterator iter=begin; iter != end; ++iter, ++index)
-      {
-      range[0] = std::min(range[0], static_cast<double>(*iter));
-      range[1] = std::max(range[1], static_cast<double>(*iter));
-      }
-    return range;
-    }
-
-  template <class Iterator>
-  void CopyToPoints(
-    float* data, int data_increment, Iterator begin, Iterator end, const vtkVector2d& ss, bool useLog)
-    {
-    if (useLog)
-      {
-      for (Iterator iter = begin; iter != end; ++iter, data+= data_increment)
-        {
-        *data = log10(static_cast<float>((*iter + ss[0]) * ss[1]));
-        }
-      }
-    else
-      {
-      for (Iterator iter = begin; iter != end; ++iter, data+= data_increment)
-        {
-        *data = static_cast<float>((*iter + ss[0]) * ss[1]);
-        }
-      }
-    }
-
-  template <class T>
-  class RangeIterator
-    {
-    T Value;
-  public:
-    RangeIterator(const T& val) : Value(val)
-      {}
-    T operator*() const
-      { return this->Value; }
-    bool operator==(const RangeIterator& other) const
-      { return this->Value == other.Value; }
-    bool operator!=(const RangeIterator& other) const
-      { return this->Value != other.Value; }
-    RangeIterator<T>& operator++()
-      { ++this->Value; return (*this); }
-    };
-
-  VectorPIMPL SortedPoints;
-public:
-  // Array which marks valid points in the array. If NULL (the default), all
-  // points in the input array are considered valid.
-  vtkWeakPointer<vtkCharArray> ValidPointMask;
-
-  // References to input arrays.
-  vtkTuple<vtkWeakPointer<vtkDataArray>, 3> InputArrays;
-
-  // Array for the points. These maintain the points that form the QuadStrip for
-  // the area plot.
-  vtkNew<vtkPoints2D> Points;
-
-  // Set of point ids that are invalid or masked out.
-  std::vector<vtkIdType> BadPoints;
-
-
-  vtkTableCache()
-    {
-    this->Reset();
-    }
-
-  void Reset()
-    {
-    this->ValidPointMask = NULL;
-    this->Points->Initialize();
-    this->Points->SetDataTypeToFloat();
-    this->BadPoints.clear();
-    }
-
-  bool IsInputDataValid() const
-    {
-    return this->InputArrays[1] != NULL && this->InputArrays[2] != NULL;
-    }
-
-  bool SetPoints(vtkDataArray* x, vtkDataArray* y1, vtkDataArray* y2)
-    {
-    if (y1 == NULL || y2 == NULL)
-      {
-      return false;
-      }
-
-    vtkIdType numTuples = y1->GetNumberOfTuples();
-
-    // sanity check.
-    assert((x == NULL || x->GetNumberOfTuples() == numTuples) && y2->GetNumberOfTuples() == numTuples);
-
-    this->InputArrays[0] = x;
-    this->InputArrays[1] = y1;
-    this->InputArrays[2] = y2;
-    this->Points->SetNumberOfPoints(numTuples * 2);
-    this->SortedPoints.clear();
-    this->DataMTime.Modified();
-    return true;
-    }
-
-  void GetDataBounds(double bounds[4])
-    {
-    if (this->DataMTime > this->BoundsMTime)
-      {
-      vtkTuple<double, 2> rangeX, rangeY1, rangeY2;
-      if (this->InputArrays[0])
-        {
-        rangeX = this->GetDataRange(this->InputArrays[0]);
-        }
-      else
-        {
-        rangeX[0] = 0; rangeX[1] = (this->Points->GetNumberOfPoints()/2-1);
-        }
-      rangeY1 = this->GetDataRange(this->InputArrays[1]);
-      rangeY2 = this->GetDataRange(this->InputArrays[2]);
-
-      this->DataBounds.Reset();
-      this->DataBounds.SetMinPoint(rangeX[0], std::min(rangeY1[0], rangeY2[0]), 0);
-      this->DataBounds.SetMaxPoint(rangeX[1], std::max(rangeY1[1], rangeY2[1]), 0);
-      this->BoundsMTime.Modified();
-      }
-    double bds[6];
-    this->DataBounds.GetBounds(bds);
-    std::copy(bds, bds+4, bounds);
-    }
-
-  void UpdateCache(vtkPlotArea* self)
-    {
-    const vtkRectd& ss = self->GetShiftScale();
-    vtkAxis* xaxis = self->GetXAxis();
-    vtkAxis* yaxis = self->GetYAxis();
-
-    if (this->Points->GetMTime()> this->DataMTime &&
-      this->Points->GetMTime() > xaxis->GetMTime() &&
-      this->Points->GetMTime() > yaxis->GetMTime() &&
-      ss == this->ShiftScale)
-      {
-      // nothing to do.
-      return;
-      }
-
-    vtkTuple<bool, 2> useLog;
-    useLog[0] = xaxis->GetLogScaleActive();
-    useLog[1] = yaxis->GetLogScaleActive();
-
-    vtkIdType numTuples = this->InputArrays[1]->GetNumberOfTuples();
-    assert(this->Points->GetNumberOfPoints() == 2*numTuples);
-
-    float* data = reinterpret_cast<float*>(this->Points->GetVoidPointer(0));
-    if (this->InputArrays[0])
-      {
-      switch (this->InputArrays[0]->GetDataType())
-        {
-        vtkDataArrayIteratorMacro(this->InputArrays[0],
-          this->CopyToPoints(
-            data, 4, vtkDABegin, vtkDAEnd, vtkVector2d(ss[0], ss[2]), useLog[0]);
-          this->CopyToPoints(
-            &data[2], 4, vtkDABegin, vtkDAEnd, vtkVector2d(ss[0], ss[2]), useLog[0]);
-          );
-        }
-      }
-    else
-      {
-      this->CopyToPoints(
-        data, 4, RangeIterator<vtkIdType>(0), RangeIterator<vtkIdType>(numTuples),
-        vtkVector2d(ss[0], ss[2]), useLog[0]);
-      this->CopyToPoints(
-        &data[2], 4, RangeIterator<vtkIdType>(0), RangeIterator<vtkIdType>(numTuples),
-        vtkVector2d(ss[0], ss[2]), useLog[0]);
-      }
-
-    switch (this->InputArrays[1]->GetDataType())
-      {
-      vtkDataArrayIteratorMacro(this->InputArrays[1],
-        this->CopyToPoints(
-          &data[1], 4, vtkDABegin, vtkDAEnd, vtkVector2d(ss[1], ss[3]), useLog[1]));
-      }
-    switch (this->InputArrays[2]->GetDataType())
-      {
-      vtkDataArrayIteratorMacro(this->InputArrays[2],
-        this->CopyToPoints(
-          &data[3], 4, vtkDABegin, vtkDAEnd, vtkVector2d(ss[1], ss[3]), useLog[1]));
-      }
-
-    // Set the bad-points mask.
-    vtkVector2f* vec2f = reinterpret_cast<vtkVector2f*>(this->Points->GetVoidPointer(0));
-    for (vtkIdType cc=0; cc < numTuples; cc++)
-      {
-      bool is_bad = (this->ValidPointMask && this->ValidPointMask->GetValue(cc) == 0);
-      is_bad =  is_bad || vtkIsBadPoint(vec2f[2*cc]);
-      is_bad =  is_bad || vtkIsBadPoint(vec2f[2*cc + 1]);
-      if (is_bad)
-        {
-        // this ensures that the GetNearestPoint() fails for masked out points.
-        vec2f[2*cc] = vtkVector2f(vtkMath::Nan(), vtkMath::Nan());
-        vec2f[2*cc + 1] = vtkVector2f(vtkMath::Nan(), vtkMath::Nan());
-        this->BadPoints.push_back(cc);
-        }
-      }
-
-    this->ShiftScale = ss;
-    this->Points->Modified();
-    this->SortedPoints.clear();
-    }
-
-  vtkIdType GetNearestPoint(
-    const vtkVector2f& point, const vtkVector2f& tol, vtkVector2f* location)
-    {
-    if (this->Points->GetNumberOfPoints() == 0)
-      {
-      return -1;
-      }
-
-    if (this->SortedPoints.size() == 0)
-      {
-      float* data = reinterpret_cast<float*>(this->Points->GetVoidPointer(0));
-      this->SortedPoints.Initialize(reinterpret_cast<vtkVector2f*>(data),
-        this->Points->GetNumberOfPoints());
-      std::sort(this->SortedPoints.begin(), this->SortedPoints.end(),
-        vtkIndexedVector2f::compVector3fX);
-      }
-    return this->SortedPoints.GetNearestPoint(point, tol, location);
-    }
-};
-
-vtkStandardNewMacro(vtkPlotArea);
-//----------------------------------------------------------------------------
-vtkPlotArea::vtkPlotArea()
-  : TableCache(new vtkPlotArea::vtkTableCache())
-{
-  this->TooltipDefaultLabelFormat = "%l: %x:(%a, %b)";
-}
-
-//----------------------------------------------------------------------------
-vtkPlotArea::~vtkPlotArea()
-{
-  delete this->TableCache;
-  this->TableCache = NULL;
-}
-
-//----------------------------------------------------------------------------
-void vtkPlotArea::Update()
-{
-  if (!this->Visible)
-    {
-    return;
-    }
-
-  vtkTable* table = this->GetInput();
-  if (!table)
-    {
-    vtkDebugMacro("Update event called with no input table set.");
-    this->TableCache->Reset();
-    return;
-    }
-
-  if (this->Data->GetMTime() > this->UpdateTime ||
-    table->GetMTime() > this->UpdateTime ||
-    this->GetMTime() > this->UpdateTime)
-    {
-    vtkTableCache& cache = (*this->TableCache);
-
-    cache.Reset();
-    cache.ValidPointMask = (this->ValidPointMaskName.empty() == false)?
-      vtkCharArray::SafeDownCast(table->GetColumnByName(this->ValidPointMaskName)) : NULL;
-    cache.SetPoints(
-      this->UseIndexForXSeries? NULL: this->Data->GetInputArrayToProcess(0, table),
-      this->Data->GetInputArrayToProcess(1, table),
-      this->Data->GetInputArrayToProcess(2, table));
-    this->UpdateTime.Modified();
-    }
-}
-
-//----------------------------------------------------------------------------
-void vtkPlotArea::UpdateCache()
-{
-  vtkTableCache& cache = (*this->TableCache);
-  if (!this->Visible || !cache.IsInputDataValid())
-    {
-    return;
-    }
-  cache.UpdateCache(this);
-}
-
-//----------------------------------------------------------------------------
-void vtkPlotArea::GetBounds(double bounds[4])
-{
-  vtkTableCache& cache = (*this->TableCache);
-  if (!this->Visible || !cache.IsInputDataValid())
-    {
-    return;
-    }
-  cache.GetDataBounds(bounds);
-}
-
-//----------------------------------------------------------------------------
-bool vtkPlotArea::Paint(vtkContext2D *painter)
-{
-  vtkTableCache& cache = (*this->TableCache);
-  if (!this->Visible || !cache.IsInputDataValid() || cache.Points->GetNumberOfPoints() == 0)
-    {
-    return false;
-    }
-  painter->ApplyPen(this->Pen);
-  painter->ApplyBrush(this->Brush);
-
-  vtkIdType start = 0;
-  for (std::vector<vtkIdType>::iterator iter = cache.BadPoints.begin();
-    iter != cache.BadPoints.end(); ++iter)
-    {
-    vtkIdType end = *iter;
-    if ((end-start) >= 2)
-      {
-      painter->DrawQuadStrip(
-        reinterpret_cast<float*>(cache.Points->GetVoidPointer(2*2*start)),
-        (end-start)*2);
-      }
-    start = end;
-    }
-  if (cache.Points->GetNumberOfPoints() - (2*start) > 4)
-    {
-    painter->DrawQuadStrip(
-      reinterpret_cast<float*>(cache.Points->GetVoidPointer(2*2*start)),
-      cache.Points->GetNumberOfPoints() - (2*start));
-    }
-  return true;
-}
-
-//-----------------------------------------------------------------------------
-bool vtkPlotArea::PaintLegend(vtkContext2D *painter, const vtkRectf& rect,
-                              int vtkNotUsed(legendIndex))
-{
-  painter->ApplyPen(this->Pen);
-  painter->ApplyBrush(this->Brush);
-  painter->DrawRect(rect[0], rect[1], rect[2], rect[3]);
-  return true;
-}
-
-//----------------------------------------------------------------------------
-vtkIdType vtkPlotArea::GetNearestPoint(
-  const vtkVector2f& point, const vtkVector2f& tolerance, vtkVector2f* location)
-{
-  vtkTableCache& cache = (*this->TableCache);
-  if (!this->Visible || !cache.IsInputDataValid() || cache.Points->GetNumberOfPoints() == 0)
-    {
-    return -1;
-    }
-  return cache.GetNearestPoint(point, tolerance, location);
-}
-
-
-//-----------------------------------------------------------------------------
-vtkStdString vtkPlotArea::GetTooltipLabel(const vtkVector2d &plotPos,
-                                      vtkIdType seriesIndex,
-                                      vtkIdType segmentIndex)
-{
-  vtkStdString tooltipLabel;
-  vtkStdString format = this->Superclass::GetTooltipLabel(plotPos, seriesIndex, segmentIndex);
-
-  vtkIdType idx = (seriesIndex / 2) * 2;
-
-  vtkTableCache& cache = (*this->TableCache);
-  const vtkVector2f* data = reinterpret_cast<vtkVector2f*>(cache.Points->GetVoidPointer(0));
-
-  // Parse TooltipLabelFormat and build tooltipLabel
-  bool escapeNext = false;
-  for (size_t i = 0; i < format.length(); ++i)
-    {
-    if (escapeNext)
-      {
-      switch (format[i])
-        {
-        case 'a':
-          tooltipLabel += this->GetNumber(data[idx].GetY(), this->YAxis);
-          break;
-        case 'b':
-          tooltipLabel += this->GetNumber(data[idx+1].GetY(), this->YAxis);
-          break;
-        default: // If no match, insert the entire format tag
-          tooltipLabel += "%";
-          tooltipLabel += format[i];
-          break;
-        }
-      escapeNext = false;
-      }
-    else
-      {
-      if (format[i] == '%')
-        {
-        escapeNext = true;
-        }
-      else
-        {
-        tooltipLabel += format[i];
-        }
-      }
-    }
-  return tooltipLabel;
-}
-
-//----------------------------------------------------------------------------
-void vtkPlotArea::SetColor(
-  unsigned char r, unsigned char g, unsigned char b, unsigned char a)
-{
-  this->Brush->SetColor(r, g, b, a);
-  this->Superclass::SetColor(r, g, b, a);
-}
-
-//----------------------------------------------------------------------------
-void vtkPlotArea::SetColor(double r,  double g, double b)
-{
-  this->Brush->SetColorF(r, g, b);
-  this->Superclass::SetColor(r, g, b);
-}
-
-//----------------------------------------------------------------------------
-void vtkPlotArea::PrintSelf(ostream& os, vtkIndent indent)
-{
-  this->Superclass::PrintSelf(os, indent);
-}
diff --git a/Charts/Core/vtkPlotArea.h b/Charts/Core/vtkPlotArea.h
deleted file mode 100644
index 818ff18..0000000
--- a/Charts/Core/vtkPlotArea.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkPlotArea.h
-
-  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.
-
-=========================================================================*/
-// .NAME vtkPlotArea - draws an area plot.
-// .SECTION Description
-// vtkPlotArea is used to render an area plot. An area plot (sometimes called a
-// range plot) renders a filled region between the selected ymin and ymax
-// arrays.
-// To specify the x array and ymin/ymax arrays, use the SetInputArray method
-// with array index as 0, 1, or 2, respectively.
-
-#ifndef vtkPlotArea_h
-#define vtkPlotArea_h
-
-#include "vtkPlot.h"
-
-class VTKCHARTSCORE_EXPORT vtkPlotArea : public vtkPlot
-{
-public:
-  static vtkPlotArea* New();
-  vtkTypeMacro(vtkPlotArea, vtkPlot);
-  void PrintSelf(ostream& os, vtkIndent indent);
-
-  // Description:
-  // Convenience method to set the input arrays. vtkPlotArea supports the
-  // following indices:
-  // \li 0: x-axis,
-  // \li 1: y-axis,
-  // \li 2: y-axis.
-  using Superclass::SetInputArray;
-
-  // Description:
-  // Overridden to set the brush color.
-  virtual void SetColor(unsigned char r, unsigned char g, unsigned char b,
-                        unsigned char a);
-  virtual void SetColor(double r,  double g, double b);
-
-  // Description:
-  // Get/set the valid point mask array name.
-  vtkGetMacro(ValidPointMaskName, vtkStdString)
-  vtkSetMacro(ValidPointMaskName, vtkStdString)
-
-  // Description:
-  // Perform any updates to the item that may be necessary before rendering.
-  virtual void Update();
-
-  // Description:
-  // Get the bounds for this plot as (Xmin, Xmax, Ymin, Ymax).
-  virtual void GetBounds(double bounds[4]);
-
-  // Description:
-  // Subclasses that build data caches to speed up painting should override this
-  // method to update such caches. This is called on each Paint, hence
-  // subclasses must add checks to avoid rebuilding of cache, unless necessary.
-  virtual void UpdateCache();
-
-  // Description:
-  // Paint event for the XY plot, called whenever the chart needs to be drawn
-  virtual bool Paint(vtkContext2D *painter);
-
-  // Description:
-  // Paint legend event for the plot, called whenever the legend needs the
-  // plot items symbol/mark/line drawn. A rect is supplied with the lower left
-  // corner of the rect (elements 0 and 1) and with width x height (elements 2
-  // and 3). The plot can choose how to fill the space supplied. The index is used
-  // by Plots that return more than one label.
-  virtual bool PaintLegend(vtkContext2D *painter, const vtkRectf& rect,
-                           int legendIndex);
-
-//BTX
-
-  // Description:
-  // Function to query a plot for the nearest point to the specified coordinate.
-  // Returns the index of the data series with which the point is associated, or
-  // -1 if no point was found.
-  virtual vtkIdType GetNearestPoint(const vtkVector2f& point,
-                                    const vtkVector2f& tolerance,
-                                    vtkVector2f* location);
-
-  // Description:
-  // Generate and return the tooltip label string for this plot
-  // The segmentIndex parameter is ignored, except for vtkPlotBar
-  virtual vtkStdString GetTooltipLabel(const vtkVector2d &plotPos,
-                                       vtkIdType seriesIndex,
-                                       vtkIdType segmentIndex);
-protected:
-  vtkPlotArea();
-  ~vtkPlotArea();
-
-  // Description:
-  // Name of the valid point mask array.
-  vtkStdString ValidPointMaskName;
-
-private:
-  vtkPlotArea(const vtkPlotArea&); // Not implemented.
-  void operator=(const vtkPlotArea&); // Not implemented.
-
-  class vtkTableCache;
-  vtkTableCache* TableCache;
-
-  vtkTimeStamp UpdateTime;
-//ETX
-};
-
-#endif
diff --git a/Charts/Core/vtkPlotBag.cxx b/Charts/Core/vtkPlotBag.cxx
index 0ce8600..6a7ef5d 100644
--- a/Charts/Core/vtkPlotBag.cxx
+++ b/Charts/Core/vtkPlotBag.cxx
@@ -43,7 +43,6 @@ vtkPlotBag::vtkPlotBag()
   this->MedianPoints = vtkPoints2D::New();
   this->Q3Points = vtkPoints2D::New();
   this->TooltipDefaultLabelFormat = "%C, %l (%x, %y): %z";
-  this->BagVisible = true;
   this->Brush->SetColor(255, 0, 0);
   this->Brush->SetOpacity(255);
   this->Pen->SetColor(0, 0, 0);
@@ -235,37 +234,34 @@ bool vtkPlotBag::Paint(vtkContext2D *painter)
     return false;
     }
 
-  if (this->BagVisible)
+  unsigned char bcolor[4];
+  this->Brush->GetColor(bcolor);
+
+  // Draw the 2 bags
+  this->Brush->SetOpacity(255);
+  this->Brush->SetColor(bcolor[0] / 2, bcolor[1] / 2, bcolor[2] / 2);
+  painter->ApplyPen(this->LinePen);
+  painter->ApplyBrush(this->Brush);
+  if (this->Q3Points->GetNumberOfPoints() > 2)
     {
-    unsigned char bcolor[4];
-    this->Brush->GetColor(bcolor);
-
-    // Draw the 2 bags
-    this->Brush->SetOpacity(255);
-    this->Brush->SetColor(bcolor[0] / 2, bcolor[1] / 2, bcolor[2] / 2);
-    painter->ApplyPen(this->LinePen);
-    painter->ApplyBrush(this->Brush);
-    if (this->Q3Points->GetNumberOfPoints() > 2)
-      {
-      painter->DrawPolygon(this->Q3Points);
-      }
-    else if (this->Q3Points->GetNumberOfPoints() == 2)
-      {
-      painter->DrawLine(this->Q3Points);
-      }
+    painter->DrawPolygon(this->Q3Points);
+    }
+  else if (this->Q3Points->GetNumberOfPoints() == 2)
+    {
+    painter->DrawLine(this->Q3Points);
+    }
 
-    this->Brush->SetColor(bcolor);
-    this->Brush->SetOpacity(128);
-    painter->ApplyBrush(this->Brush);
+  this->Brush->SetColor(bcolor);
+  this->Brush->SetOpacity(128);
+  painter->ApplyBrush(this->Brush);
 
-    if (this->MedianPoints->GetNumberOfPoints() > 2)
-      {
-      painter->DrawPolygon(this->MedianPoints);
-      }
-    else if (this->MedianPoints->GetNumberOfPoints() == 2)
-      {
-      painter->DrawLine(this->MedianPoints);
-      }
+  if (this->MedianPoints->GetNumberOfPoints() > 2)
+    {
+    painter->DrawPolygon(this->MedianPoints);
+    }
+  else if (this->MedianPoints->GetNumberOfPoints() == 2)
+    {
+    painter->DrawLine(this->MedianPoints);
     }
 
   painter->ApplyPen(this->Pen);
diff --git a/Charts/Core/vtkPlotBag.h b/Charts/Core/vtkPlotBag.h
index 448974f..d85f256 100644
--- a/Charts/Core/vtkPlotBag.h
+++ b/Charts/Core/vtkPlotBag.h
@@ -92,11 +92,6 @@ public:
                             vtkIdType yColumn,
                             vtkIdType densityColumn);
 
-  // Description:
-  // Set/get the visibility of the bags.
-  // True by default.
-  vtkSetMacro(BagVisible, bool);
-  vtkGetMacro(BagVisible, bool);
 
   // Description:
   // Set/get the vtkPen object that controls how this plot draws boundary lines.
@@ -116,7 +111,6 @@ protected:
 
   void UpdateTableCache(vtkDataArray*);
 
-  bool BagVisible;
   vtkPoints2D* MedianPoints;
   vtkPoints2D* Q3Points;
   vtkPen* LinePen;
diff --git a/Charts/Core/vtkPlotFunctionalBag.cxx b/Charts/Core/vtkPlotFunctionalBag.cxx
index 2370c48..3f33841 100644
--- a/Charts/Core/vtkPlotFunctionalBag.cxx
+++ b/Charts/Core/vtkPlotFunctionalBag.cxx
@@ -276,7 +276,7 @@ vtkIdType vtkPlotFunctionalBag::GetNearestPoint(const vtkVector2f& point,
 //-----------------------------------------------------------------------------
 bool vtkPlotFunctionalBag::SelectPoints(const vtkVector2f& min, const vtkVector2f& max)
 {
-  if (!this->IsBag())
+  if (this->BagPoints->GetNumberOfPoints() == 0)
     {
     return this->Line->SelectPoints(min, max);
     }
@@ -286,7 +286,7 @@ bool vtkPlotFunctionalBag::SelectPoints(const vtkVector2f& min, const vtkVector2
 //-----------------------------------------------------------------------------
 bool vtkPlotFunctionalBag::SelectPointsInPolygon(const vtkContextPolygon &polygon)
 {
-  if (!this->IsBag())
+  if (this->BagPoints->GetNumberOfPoints() == 0)
     {
     return this->Line->SelectPointsInPolygon(polygon);
     }
diff --git a/Charts/Core/vtkPlotHistogram2D.cxx b/Charts/Core/vtkPlotHistogram2D.cxx
index bffcd2a..596335c 100644
--- a/Charts/Core/vtkPlotHistogram2D.cxx
+++ b/Charts/Core/vtkPlotHistogram2D.cxx
@@ -93,7 +93,6 @@ vtkScalarsToColors * vtkPlotHistogram2D::GetTransferFunction()
   return this->TransferFunction;
 }
 
-//-----------------------------------------------------------------------------
 void vtkPlotHistogram2D::GetBounds(double bounds[4])
 {
   if (this->Input)
@@ -235,10 +234,6 @@ vtkStdString vtkPlotHistogram2D::GetTooltipLabel(const vtkVector2d &plotPos,
 //-----------------------------------------------------------------------------
 void vtkPlotHistogram2D::GenerateHistogram()
 {
-  if (!this->Input)
-    {
-    return;
-    }
   if (!this->Output)
     {
     this->Output = vtkSmartPointer<vtkImageData>::New();
diff --git a/Charts/Core/vtkPlotLine.cxx b/Charts/Core/vtkPlotLine.cxx
index 2ad9356..450315a 100644
--- a/Charts/Core/vtkPlotLine.cxx
+++ b/Charts/Core/vtkPlotLine.cxx
@@ -30,7 +30,6 @@ vtkStandardNewMacro(vtkPlotLine);
 vtkPlotLine::vtkPlotLine()
 {
   this->MarkerStyle = vtkPlotPoints::NONE;
-  this->PolyLine = true;
 }
 
 //-----------------------------------------------------------------------------
@@ -56,7 +55,7 @@ bool vtkPlotLine::Paint(vtkContext2D *painter)
     {
     // draw lines skipping bad points
     float *points = static_cast<float *>(this->Points->GetVoidPointer(0));
-    const int pointSize = 2;
+
     vtkIdType lastGood = 0;
 
     for (vtkIdType i = 0; i < this->BadPoints->GetNumberOfTuples(); i++)
@@ -66,32 +65,7 @@ bool vtkPlotLine::Paint(vtkContext2D *painter)
       // render from last good point to one before this bad point
       if (id - lastGood > 2)
         {
-        int start = lastGood + 1;
-        int numberOfPoints = id - start;
-        if (!this->PolyLine)
-          {
-          // Start at the next point if the last bad point was the first point
-          // of a line segment.
-          if (start % 2 == 0)
-            {
-            ++start;
-            --numberOfPoints;
-            }
-          // Stops at the previous point if the next bad point is the second point
-          // of a line segment.
-          if (numberOfPoints % 2 == 1)
-            {
-            --numberOfPoints;
-            }
-          }
-        if (this->PolyLine)
-          {
-          painter->DrawPoly(points + pointSize * start, numberOfPoints);
-          }
-        else if (start < this->Points->GetNumberOfPoints() && numberOfPoints > 0)
-          {
-          painter->DrawLines(points + pointSize * start, numberOfPoints);
-          }
+        painter->DrawPoly(points + 2 * (lastGood + 1), id - lastGood - 1);
         }
 
       lastGood = id;
@@ -100,45 +74,14 @@ bool vtkPlotLine::Paint(vtkContext2D *painter)
     // render any trailing good points
     if (this->Points->GetNumberOfPoints() - lastGood > 2)
       {
-      int start = lastGood + 1;
-      int numberOfPoints = this->Points->GetNumberOfPoints() - start;
-      if (!this->PolyLine)
-        {
-        // Start at the next point if the last bad point was the first point
-        // of a line segment.
-        if (start % 2 == 0)
-          {
-          ++start;
-          --numberOfPoints;
-          }
-        // Stops at the previous point if the next bad point is the second point
-        // of a line segment.
-        if (numberOfPoints % 2 == 1)
-          {
-          --numberOfPoints;
-          }
-        }
-      if (this->PolyLine)
-        {
-        painter->DrawPoly(points + pointSize * start, numberOfPoints);
-        }
-      else if (start < this->Points->GetNumberOfPoints() && numberOfPoints > 0)
-        {
-        painter->DrawLines(points + pointSize * start, numberOfPoints);
-        }
+      painter->DrawPoly(points + 2 * (lastGood + 1),
+                        this->Points->GetNumberOfPoints() - lastGood - 1);
       }
     }
   else
     {
     // draw lines between all points
-    if (this->PolyLine)
-      {
-      painter->DrawPoly(this->Points);
-      }
-    else
-      {
-      painter->DrawLines(this->Points);
-      }
+    painter->DrawPoly(this->Points);
     }
 
   return this->vtkPlotPoints::Paint(painter);
diff --git a/Charts/Core/vtkPlotLine.h b/Charts/Core/vtkPlotLine.h
index 6eee087..5711835 100644
--- a/Charts/Core/vtkPlotLine.h
+++ b/Charts/Core/vtkPlotLine.h
@@ -47,25 +47,11 @@ public:
   virtual bool PaintLegend(vtkContext2D *painter, const vtkRectf& rect,
                            int legendIndex);
 
-  // Description:
-  // Turn on/off flag to control whether the points define a poly line
-  // (true) or multiple line segments (false).
-  // If true (default), a segment is drawn between each points
-  // (e.g. [P1P2, P2P3, P3P4...].) If false, a segment is drawn for each pair
-  // of points (e.g. [P1P2, P3P4,...].)
-  vtkSetMacro(PolyLine,bool);
-  vtkGetMacro(PolyLine,bool);
-  vtkBooleanMacro(PolyLine,bool);
-
 //BTX
 protected:
   vtkPlotLine();
   ~vtkPlotLine();
 
-  // Description:
-  // Poly line (true) or line segments(false).
-  bool PolyLine;
-
 private:
   vtkPlotLine(const vtkPlotLine &); // Not implemented.
   void operator=(const vtkPlotLine &); // Not implemented.
diff --git a/Charts/Core/vtkPlotPoints.cxx b/Charts/Core/vtkPlotPoints.cxx
index 9724965..0131bf9 100644
--- a/Charts/Core/vtkPlotPoints.cxx
+++ b/Charts/Core/vtkPlotPoints.cxx
@@ -882,7 +882,7 @@ void vtkPlotPoints::FindBadPoints()
     }
 
   // If there are bad points copy them, if not ensure the pointer is null.
-  if (!bad.empty())
+  if (bad.size() > 0)
     {
     if (!this->BadPoints)
       {
diff --git a/Charts/Core/vtkScatterPlotMatrix.cxx b/Charts/Core/vtkScatterPlotMatrix.cxx
index d052bdd..5e4f53e 100644
--- a/Charts/Core/vtkScatterPlotMatrix.cxx
+++ b/Charts/Core/vtkScatterPlotMatrix.cxx
@@ -387,15 +387,6 @@ bool vtkScatterPlotMatrix::Paint(vtkContext2D *painter)
   return Superclass::Paint(painter);
 }
 
-void vtkScatterPlotMatrix::SetScene(vtkContextScene *scene)
-{
-  // The internal axis shouldn't be a child as it isn't rendered with the
-  // chart, but it does need access to the scene.
-  this->Private->TestAxis->SetScene(scene);
-
-  this->Superclass::SetScene(scene);
-}
-
 bool vtkScatterPlotMatrix::SetActivePlot(const vtkVector2i &pos)
 {
   if (pos.GetX() + pos.GetY() + 1 < this->Size.GetX() && pos.GetX() < this->Size.GetX() &&
@@ -782,6 +773,18 @@ void vtkScatterPlotMatrix::ProcessEvents(vtkObject *, unsigned long event,
     }
 }
 
+#ifndef VTK_LEGACY_REMOVE
+vtkAnnotationLink* vtkScatterPlotMatrix::GetActiveAnnotationLink()
+{
+  // Never made it into a release, deprecating for shorter, more consistent
+  // naming of the function.
+  VTK_LEGACY_REPLACED_BODY(vtkScatterPlotMatrix::GetActiveAnnotationLink,
+                           "VTK 5.8",
+                           vtkScatterPlotMatrix::GetAnnotationLink);
+  return this->GetAnnotationLink();
+}
+#endif
+
 vtkAnnotationLink* vtkScatterPlotMatrix::GetAnnotationLink()
 {
   return this->Private->Link.GetPointer();
diff --git a/Charts/Core/vtkScatterPlotMatrix.h b/Charts/Core/vtkScatterPlotMatrix.h
index 196157f..3f1d5e0 100644
--- a/Charts/Core/vtkScatterPlotMatrix.h
+++ b/Charts/Core/vtkScatterPlotMatrix.h
@@ -63,8 +63,6 @@ public:
   // Paint event for the chart matrix.
   virtual bool Paint(vtkContext2D *painter);
 
-  virtual void SetScene(vtkContextScene *scene);
-
   // Description:
   // Set the active plot, the one that will be displayed in the top-right.
   // This defaults to (0, n-2), the plot below the first histogram on the left.
@@ -76,6 +74,12 @@ public:
   virtual vtkVector2i GetActivePlot();
 
   // Description:
+  // Get the active AnnotationLink from the big chart, which
+  // is the only active AnnotationLink in the matrix.
+  // @deprecated Replaced by GetAnnotationLink(), never in a VTK release.
+  VTK_LEGACY(vtkAnnotationLink* GetActiveAnnotationLink());
+
+  // Description:
   // Get the AnnotationLink for the scatter plot matrix, this gives you access
   // to the currently selected points in the scatter plot matrix.
   vtkAnnotationLink* GetAnnotationLink();
diff --git a/Common/Color/vtkNamedColors.cxx b/Common/Color/vtkNamedColors.cxx
index b1d6d3b..7cfa886 100644
--- a/Common/Color/vtkNamedColors.cxx
+++ b/Common/Color/vtkNamedColors.cxx
@@ -141,6 +141,7 @@ public:
     if ( !name.empty() && color.GetSize() == 4 )
       {
       vtkStdString s = this->ToLowercase(name);
+      std::vector<unsigned char> uv;
       unsigned char r, g, b, a;
       r = static_cast<unsigned char>(color.GetRed() * 255.0);
       g = static_cast<unsigned char>(color.GetGreen() * 255.0);
diff --git a/Common/ComputationalGeometry/Testing/Data/Baseline/TestParametricFunctions.png.md5 b/Common/ComputationalGeometry/Testing/Data/Baseline/TestParametricFunctions.png.md5
index eb8c024..c6289e7 100644
--- a/Common/ComputationalGeometry/Testing/Data/Baseline/TestParametricFunctions.png.md5
+++ b/Common/ComputationalGeometry/Testing/Data/Baseline/TestParametricFunctions.png.md5
@@ -1 +1 @@
-b20c642fc0a5d402a56b873d6855c3ce
+4469214ccba6086be4b499e119553ff1
diff --git a/Common/ComputationalGeometry/Testing/Data/Baseline/TestParametricFunctions_1.png.md5 b/Common/ComputationalGeometry/Testing/Data/Baseline/TestParametricFunctions_1.png.md5
new file mode 100644
index 0000000..2b37658
--- /dev/null
+++ b/Common/ComputationalGeometry/Testing/Data/Baseline/TestParametricFunctions_1.png.md5
@@ -0,0 +1 @@
+6a379064093cb0f639dd0aa85336422a
diff --git a/Common/ComputationalGeometry/Testing/Data/Baseline/TestParametricFunctions_2.png.md5 b/Common/ComputationalGeometry/Testing/Data/Baseline/TestParametricFunctions_2.png.md5
new file mode 100644
index 0000000..c73ae04
--- /dev/null
+++ b/Common/ComputationalGeometry/Testing/Data/Baseline/TestParametricFunctions_2.png.md5
@@ -0,0 +1 @@
+23a261a88f125c0b83a2ccfb83f248c1
diff --git a/Common/Core/CMakeLists.txt b/Common/Core/CMakeLists.txt
index e945113..d4ce9e1 100644
--- a/Common/Core/CMakeLists.txt
+++ b/Common/Core/CMakeLists.txt
@@ -27,97 +27,60 @@ set(vtkCommonCore_EXPORT_OPTIONS
   )
 
 # Choose which multi-threaded parallelism library to use
-set(VTK_SMP_IMPLEMENTATION_TYPE_DOC_STRING "Which multi-threaded parallelism implementation to use. Options are Sequential, Simple, Kaapi, OpenMP or TBB")
-
-set(VTK_SMP_IMPLEMENTATION_TYPE "Sequential" CACHE STRING ${VTK_SMP_IMPLEMENTATION_TYPE_DOC_STRING})
-
-set_property(CACHE VTK_SMP_IMPLEMENTATION_TYPE PROPERTY STRINGS Sequential Simple Kaapi OpenMP TBB)
+set(VTK_SMP_IMPLEMENTATION_TYPE "Sequential" CACHE STRING
+  "Which multi-threaded parallelism implementation to use. Options are Sequential, Simple, Kaapi or TBB"
+)
+set_property(CACHE VTK_SMP_IMPLEMENTATION_TYPE PROPERTY STRINGS Sequential Simple Kaapi TBB)
 
 if( NOT ("${VTK_SMP_IMPLEMENTATION_TYPE}" STREQUAL "Kaapi" OR
-         "${VTK_SMP_IMPLEMENTATION_TYPE}" STREQUAL "OpenMP" OR
          "${VTK_SMP_IMPLEMENTATION_TYPE}" STREQUAL "TBB" OR
          "${VTK_SMP_IMPLEMENTATION_TYPE}" STREQUAL "Simple") )
-  set(VTK_SMP_IMPLEMENTATION_TYPE "Sequential" CACHE STRING ${VTK_SMP_IMPLEMENTATION_TYPE_DOC_STRING} FORCE)
+  set(VTK_SMP_IMPLEMENTATION_TYPE "Sequential")
 endif()
 
-set(VTK_SMP_SOURCES "")
-set(VTK_SMP_HEADERS "")
-set(VTK_SMP_USE_DEFAULT_ATOMICS ON)
-
 if ("${VTK_SMP_IMPLEMENTATION_TYPE}" STREQUAL "TBB")
   find_package(TBB REQUIRED)
-  set(VTK_SMP_IMPLEMENTATION_LIBRARIES ${TBB_LIBRARIES})
+  set(VTK_SMP_IMPLEMENTATION_LIBRARIES "")
+  if (TBB_LIBRARY)
+    list(APPEND VTK_SMP_IMPLEMENTATION_LIBRARIES optimized ${TBB_LIBRARY})
+  endif()
+  if (TBB_LIBRARY_DEBUG)
+    list(APPEND VTK_SMP_IMPLEMENTATION_LIBRARIES debug ${TBB_LIBRARY_DEBUG})
+  endif()
+  set(VTK_SMP_ATOMIC_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/SMP/TBB")
   include_directories(${TBB_INCLUDE_DIRS})
   # This needs to be here because all modules that include vtkAtomic.h
   # need to include tbb/atomic.h
   list(APPEND vtkCommonCore_SYSTEM_INCLUDE_DIRS ${TBB_INCLUDE_DIRS})
-
-  set(VTK_SMP_USE_DEFAULT_ATOMICS OFF)
-  set(VTK_SMP_IMPLEMENTATION_DIR "${CMAKE_CURRENT_SOURCE_DIR}/SMP/TBB")
-  set(VTK_SMP_SOURCES ${VTK_SMP_IMPLEMENTATION_DIR}/vtkSMPTools.cxx)
-  set(VTK_SMP_HEADERS_TO_CONFIG
-    vtkAtomic.h vtkSMPToolsInternal.h vtkSMPThreadLocal.h)
-
-elseif ("${VTK_SMP_IMPLEMENTATION_TYPE}" STREQUAL "OpenMP")
-  find_package(OpenMP REQUIRED)
-  add_definitions(${OpenMP_CXX_FLAGS})
-  set(VTK_SMP_IMPLEMENTATION_LIBRARIES "${OpenMP_CXX_LIBRARIES}")
-
-  set(VTK_SMP_IMPLEMENTATION_DIR "${CMAKE_CURRENT_SOURCE_DIR}/SMP/OpenMP")
-  set(VTK_SMP_SOURCES ${VTK_SMP_IMPLEMENTATION_DIR}/vtkSMPTools.cxx
-    ${VTK_SMP_IMPLEMENTATION_DIR}/vtkSMPThreadLocalImpl.cxx)
-  set(VTK_SMP_HEADERS_TO_CONFIG
-    vtkSMPToolsInternal.h vtkSMPThreadLocal.h vtkSMPThreadLocalImpl.h)
-
-  if (OpenMP_CXX_SPEC_DATE AND NOT ${OpenMP_CXX_SPEC_DATE} LESS 201107)
-    set(VTK_SMP_USE_DEFAULT_ATOMICS OFF)
-    list(APPEND VTK_SMP_SOURCES ${VTK_SMP_IMPLEMENTATION_DIR}/vtkAtomic.cxx)
-    list(APPEND VTK_SMP_HEADERS_TO_CONFIG vtkAtomic.h)
-  else()
-    message(WARNING "Required OpenMP version (3.1) for atomics not detected. Using default atomics implementation.")
-  endif()
-
 elseif ("${VTK_SMP_IMPLEMENTATION_TYPE}" STREQUAL "Kaapi")
   find_package(XKaapi REQUIRED)
   include_directories(${XKAAPI_INCLUDE_DIRS})
   set(VTK_SMP_IMPLEMENTATION_LIBRARIES ${XKAAPI_LIBRARIES})
+  set(VTK_SMP_ATOMIC_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/SMP/Sequential")
   list(APPEND vtkCommonCore_SYSTEM_INCLUDE_DIRS ${XKAAPI_INCLUDE_DIRS})
-
-  set(VTK_SMP_IMPLEMENTATION_DIR "${CMAKE_CURRENT_SOURCE_DIR}/SMP/Kaapi")
-  set(VTK_SMP_SOURCES ${VTK_SMP_IMPLEMENTATION_DIR}/vtkSMPTools.cxx)
-  set(VTK_SMP_HEADERS_TO_CONFIG vtkSMPToolsInternal.h vtkSMPThreadLocal.h)
-
 elseif ("${VTK_SMP_IMPLEMENTATION_TYPE}" STREQUAL "Simple")
   set(VTK_SMP_IMPLEMENTATION_LIBRARIES)
-
-  set(VTK_SMP_IMPLEMENTATION_DIR "${CMAKE_CURRENT_SOURCE_DIR}/SMP/Simple")
-  set(VTK_SMP_SOURCES ${VTK_SMP_IMPLEMENTATION_DIR}/vtkSMPTools.cxx)
-  set(VTK_SMP_HEADERS_TO_CONFIG vtkSMPToolsInternal.h vtkSMPThreadLocal.h)
-
+  set(VTK_SMP_ATOMIC_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/SMP/Sequential")
   message(WARNING "The Simple backend for SMP operations is an experimental backend that is mainly used for debugging currently. We recommend that you use either the TBB or the Kaapi backend for production work. Use the Sequential backend if you would like to turn off any SMP parallelism.")
-
 elseif ("${VTK_SMP_IMPLEMENTATION_TYPE}" STREQUAL "Sequential")
   set(VTK_SMP_IMPLEMENTATION_LIBRARIES)
-  set(VTK_SMP_IMPLEMENTATION_DIR "${CMAKE_CURRENT_SOURCE_DIR}/SMP/Sequential")
-  set(VTK_SMP_SOURCES ${VTK_SMP_IMPLEMENTATION_DIR}/vtkSMPTools.cxx)
-  set(VTK_SMP_HEADERS_TO_CONFIG vtkSMPToolsInternal.h vtkSMPThreadLocal.h)
+  set(VTK_SMP_ATOMIC_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/SMP/Sequential")
 endif()
 
-if (${VTK_SMP_USE_DEFAULT_ATOMICS})
-  set(VTK_ATOMICS_DEFAULT_IMPL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/SMP/Sequential")
-  list(APPEND VTK_SMP_SOURCES ${VTK_ATOMICS_DEFAULT_IMPL_DIR}/vtkAtomic.cxx)
-  configure_file(${VTK_ATOMICS_DEFAULT_IMPL_DIR}/vtkAtomic.h.in
-    ${CMAKE_CURRENT_BINARY_DIR}/vtkAtomic.h COPYONLY)
-  list(APPEND VTK_SMP_HEADERS ${CMAKE_CURRENT_BINARY_DIR}/vtkAtomic.h)
+if(EXISTS ${VTK_SMP_ATOMIC_DIRECTORY}/vtkAtomicInt.cxx)
+  set(VTK_ATOMIC_CXX_FILE ${VTK_SMP_ATOMIC_DIRECTORY}/vtkAtomicInt.cxx)
+else()
+  set(VTK_ATOMIC_CXX_FILE "")
 endif()
 
-foreach (HDR_FILE ${VTK_SMP_HEADERS_TO_CONFIG})
-  configure_file(${VTK_SMP_IMPLEMENTATION_DIR}/${HDR_FILE}.in
-    ${CMAKE_CURRENT_BINARY_DIR}/${HDR_FILE} COPYONLY)
-  list(APPEND VTK_SMP_HEADERS ${CMAKE_CURRENT_BINARY_DIR}/${HDR_FILE})
-endforeach()
+configure_file(${VTK_SMP_ATOMIC_DIRECTORY}/vtkAtomicInt.h.in
+  ${CMAKE_CURRENT_BINARY_DIR}/vtkAtomicInt.h COPYONLY)
+
+configure_file(SMP/${VTK_SMP_IMPLEMENTATION_TYPE}/vtkSMPThreadLocal.h.in
+  ${CMAKE_CURRENT_BINARY_DIR}/vtkSMPThreadLocal.h COPYONLY)
 
-list(APPEND VTK_SMP_HEADERS vtkSMPTools.h vtkSMPThreadLocalObject.h)
+configure_file(SMP/${VTK_SMP_IMPLEMENTATION_TYPE}/vtkSMPToolsInternal.h.in
+  ${CMAKE_CURRENT_BINARY_DIR}/vtkSMPToolsInternal.h COPYONLY)
 
 #-----------------------------------------------------------------------------
 
@@ -126,7 +89,6 @@ include_directories(${VTK_SOURCE_DIR}/ThirdParty/utf8/source)
 SET(Module_SRCS
   vtkAbstractArray.cxx
   vtkAnimationCue.cxx
-  vtkAngularPeriodicDataArray.txx
   vtkArrayCoordinates.cxx
   vtkArray.cxx
   vtkArrayExtents.cxx
@@ -210,7 +172,6 @@ SET(Module_SRCS
   vtkOutputWindow.cxx
   vtkOverrideInformationCollection.cxx
   vtkOverrideInformation.cxx
-  vtkPeriodicDataArray.txx
   vtkPoints2D.cxx
   vtkPoints.cxx
   vtkPriorityQueue.cxx
@@ -248,8 +209,13 @@ SET(Module_SRCS
   vtkTypeTemplate.h
   vtkType.h
   vtkSystemIncludes.h
-  ${VTK_SMP_SOURCES}
-  ${VTK_SMP_HEADERS}
+  ${VTK_ATOMIC_CXX_FILE}
+  vtkSMPThreadLocalObject.h
+  vtkSMPTools.h
+  SMP/${VTK_SMP_IMPLEMENTATION_TYPE}/vtkSMPTools.cxx
+  ${CMAKE_CURRENT_BINARY_DIR}/vtkSMPToolsInternal.h
+  ${CMAKE_CURRENT_BINARY_DIR}/vtkSMPThreadLocal.h
+  ${CMAKE_CURRENT_BINARY_DIR}/vtkAtomicInt.h
   ${CMAKE_CURRENT_BINARY_DIR}/vtkConfigure.h
   ${CMAKE_CURRENT_BINARY_DIR}/vtkMathConfigure.h
   ${CMAKE_CURRENT_BINARY_DIR}/vtkVersionMacros.h
@@ -257,7 +223,6 @@ SET(Module_SRCS
 
 set(${vtk-module}_HDRS
   vtkABI.h
-  vtkAngularPeriodicDataArray.h
   vtkArrayInterpolate.h
   vtkArrayInterpolate.txx
   vtkArrayIteratorIncludes.h
@@ -266,8 +231,6 @@ set(${vtk-module}_HDRS
   vtkArrayIteratorTemplateImplicit.txx
   vtkArrayPrint.h
   vtkArrayPrint.txx
-  vtkAtomicTypeConcepts.h
-  vtkAtomicTypes.h
   vtkAutoInit.h
   vtkDataArrayIteratorMacro.h
   vtkDataArrayTemplateImplicit.txx
@@ -276,7 +239,6 @@ set(${vtk-module}_HDRS
   vtkMappedDataArray.h
   vtkMathUtilities.h
   vtkNew.h
-  vtkPeriodicDataArray.h
   vtkSetGet.h
   vtkSmartPointer.h
   vtkTemplateAliasMacro.h
@@ -554,7 +516,6 @@ set_source_files_properties(
   vtkDataArrayPrivate.txx
 
   vtkABI.h
-  vtkAngularPeriodicDataArray.txx
   vtkArrayInterpolate.h
   vtkArrayInterpolate.txx
   vtkArrayIteratorIncludes.h
@@ -563,8 +524,6 @@ set_source_files_properties(
   vtkArrayIteratorTemplateImplicit.txx
   vtkArrayPrint.h
   vtkArrayPrint.txx
-  vtkAtomicTypeConcepts.h
-  vtkAtomicTypes.h
   vtkAutoInit.h
   vtkDataArrayTemplate.txx
   vtkDataArrayTemplateHelper.cxx
@@ -575,7 +534,6 @@ set_source_files_properties(
   vtkMathUtilities.h
   vtkMappedDataArray.txx
   vtkNew.h
-  vtkPeriodicDataArray.txx
   vtkSetGet.h
   vtkSmartPointer.h
   vtkSparseArray.txx
@@ -597,8 +555,13 @@ set_source_files_properties(
   vtkMathConfigure.h
   vtkVersionMacros.h
   vtkTypeTemplate.h
-  ${VTK_SMP_SOURCES}
-  ${VTK_SMP_HEADERS}
+  vtkSMPThreadLocalObject.h
+  vtkSMPTools.h
+  SMP/${VTK_SMP_IMPLEMENTATION_TYPE}/vtkSMPTools.cxx
+  ${CMAKE_CURRENT_BINARY_DIR}/vtkSMPToolsInternal.h
+  ${CMAKE_CURRENT_BINARY_DIR}/vtkSMPThreadLocal.h
+  ${CMAKE_CURRENT_BINARY_DIR}/vtkAtomicInt.h
+  ${VTK_ATOMIC_CXX_FILE}
 
   WRAP_EXCLUDE
   )
diff --git a/Common/Core/SMP/Kaapi/vtkSMPThreadLocal.h.in b/Common/Core/SMP/Kaapi/vtkSMPThreadLocal.h.in
index 5e9dc7c..4df3a5d 100644
--- a/Common/Core/SMP/Kaapi/vtkSMPThreadLocal.h.in
+++ b/Common/Core/SMP/Kaapi/vtkSMPThreadLocal.h.in
@@ -73,7 +73,7 @@
 #ifndef vtkSMPThreadLocal_h
 #define vtkSMPThreadLocal_h
 
-#include "vtkAtomicTypes.h"
+#include "vtkAtomicInt.h"
 #include "vtkSystemIncludes.h"
 
 #include <vector>
@@ -90,7 +90,7 @@ class vtkSMPThreadLocal
 public:
   // Description:
   // Default constructor. Creates a default exemplar.
-  vtkSMPThreadLocal() : Count(0)
+  vtkSMPThreadLocal() : NumInitialized(0)
     {
       this->Initialize();
     }
@@ -99,7 +99,7 @@ public:
   // Constructor that allows the specification of an exemplar object
   // which is used when constructing objects when Local() is first called.
   // Note that a copy of the exemplar is created using its copy constructor.
-  vtkSMPThreadLocal(const T& exemplar) : Count(0), Exemplar(exemplar)
+  vtkSMPThreadLocal(const T& exemplar) : NumInitialized(0), Exemplar(exemplar)
     {
       this->Initialize();
     }
@@ -119,7 +119,7 @@ public:
         {
         this->Internal[tid] = this->Exemplar;
         this->Initialized[tid] = true;
-        ++this->Count;
+        ++this->NumInitialized;
         }
       return this->Internal[tid];
     }
@@ -128,7 +128,7 @@ public:
   // Return the number of thread local objects that have been initialized
   size_t size() const
     {
-      return this->Count.load();
+      return this->NumInitialized.load();
     }
 
   // Description:
@@ -238,7 +238,7 @@ public:
 private:
   TLS Internal;
   std::vector<unsigned char> Initialized;
-  vtkAtomicIdType Count;
+  vtkAtomicInt<size_t> NumInitialized;
   T Exemplar;
 
   void Initialize()
diff --git a/Common/Core/SMP/OpenMP/vtkAtomic.cxx b/Common/Core/SMP/OpenMP/vtkAtomic.cxx
deleted file mode 100644
index b963612..0000000
--- a/Common/Core/SMP/OpenMP/vtkAtomic.cxx
+++ /dev/null
@@ -1,174 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkAtomic.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 "vtkAtomic.h"
-
-namespace detail
-{
-
-vtkTypeInt64 AtomicOps<8>::AddAndFetch(vtkTypeInt64 *ref, vtkTypeInt64 val)
-{
-  vtkTypeInt64 result;
-# pragma omp atomic capture
-  {
-    (*ref) += val;
-    result = *ref;
-  }
-# pragma omp flush
-  return result;
-}
-
-vtkTypeInt64 AtomicOps<8>::SubAndFetch(vtkTypeInt64 *ref, vtkTypeInt64 val)
-{
-  vtkTypeInt64 result;
-# pragma omp atomic capture
-  {
-    (*ref) -= val;
-    result = *ref;
-  }
-# pragma omp flush
-  return result;
-}
-
-vtkTypeInt64 AtomicOps<8>::PreIncrement(vtkTypeInt64 *ref)
-{
-  vtkTypeInt64 result;
-# pragma omp atomic capture
-  result = ++(*ref);
-# pragma omp flush
-  return result;
-}
-
-vtkTypeInt64 AtomicOps<8>::PreDecrement(vtkTypeInt64 *ref)
-{
-  vtkTypeInt64 result;
-# pragma omp atomic capture
-  result = --(*ref);
-# pragma omp flush
-  return result;
-}
-
-vtkTypeInt64 AtomicOps<8>::PostIncrement(vtkTypeInt64 *ref)
-{
-  vtkTypeInt64 result;
-# pragma omp atomic capture
-  result = (*ref)++;
-# pragma omp flush
-  return result;
-}
-
-vtkTypeInt64 AtomicOps<8>::PostDecrement(vtkTypeInt64 *ref)
-{
-  vtkTypeInt64 result;
-# pragma omp atomic capture
-  result = (*ref)--;
-# pragma omp flush
-  return result;
-}
-
-vtkTypeInt64 AtomicOps<8>::Load(const vtkTypeInt64 *ref)
-{
-  vtkTypeInt64 result;
-# pragma omp flush
-# pragma omp atomic read
-  result = *ref;
-  return result;
-}
-
-void AtomicOps<8>::Store(vtkTypeInt64 *ref, vtkTypeInt64 val)
-{
-# pragma omp atomic write
-  *ref = val;
-# pragma omp flush
-}
-
-
-vtkTypeInt32 AtomicOps<4>::AddAndFetch(vtkTypeInt32 *ref, vtkTypeInt32 val)
-{
-  vtkTypeInt32 result;
-# pragma omp atomic capture
-  {
-    (*ref) += val;
-    result = *ref;
-  }
-# pragma omp flush
-  return result;
-}
-
-vtkTypeInt32 AtomicOps<4>::SubAndFetch(vtkTypeInt32 *ref, vtkTypeInt32 val)
-{
-  vtkTypeInt32 result;
-# pragma omp atomic capture
-  {
-    (*ref) -= val;
-    result = *ref;
-  }
-# pragma omp flush
-  return result;
-}
-
-vtkTypeInt32 AtomicOps<4>::PreIncrement(vtkTypeInt32 *ref)
-{
-  vtkTypeInt32 result;
-# pragma omp atomic capture
-  result = ++(*ref);
-# pragma omp flush
-  return result;
-}
-
-vtkTypeInt32 AtomicOps<4>::PreDecrement(vtkTypeInt32 *ref)
-{
-  vtkTypeInt32 result;
-# pragma omp atomic capture
-  result = --(*ref);
-# pragma omp flush
-  return result;
-}
-
-vtkTypeInt32 AtomicOps<4>::PostIncrement(vtkTypeInt32 *ref)
-{
-  vtkTypeInt32 result;
-# pragma omp atomic capture
-  result = (*ref)++;
-# pragma omp flush
-  return result;
-}
-
-vtkTypeInt32 AtomicOps<4>::PostDecrement(vtkTypeInt32 *ref)
-{
-  vtkTypeInt32 result;
-# pragma omp atomic capture
-  result = (*ref)--;
-# pragma omp flush
-  return result;
-}
-
-vtkTypeInt32 AtomicOps<4>::Load(const vtkTypeInt32 *ref)
-{
-  vtkTypeInt32 result;
-# pragma omp flush
-# pragma omp atomic read
-  result = *ref;
-  return result;
-}
-
-void AtomicOps<4>::Store(vtkTypeInt32 *ref, vtkTypeInt32 val)
-{
-# pragma omp atomic write
-  *ref = val;
-# pragma omp flush
-}
-
-}
diff --git a/Common/Core/SMP/OpenMP/vtkAtomic.h.in b/Common/Core/SMP/OpenMP/vtkAtomic.h.in
deleted file mode 100644
index 7502e14..0000000
--- a/Common/Core/SMP/OpenMP/vtkAtomic.h.in
+++ /dev/null
@@ -1,293 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkAtomic.h
-
-  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.
-
-=========================================================================*/
-// .NAME vtkAtomic -
-// .SECTION Description
-
-#ifndef vtkAtomic_h
-#define vtkAtomic_h
-
-#include "vtkCommonCoreModule.h" // For export macro
-#include "vtkAtomicTypeConcepts.h"
-#include "vtkSystemIncludes.h"
-
-#include <cstddef>
-
-
-#ifndef __WRAP__
-namespace detail
-{
-
-template <size_t size> class AtomicOps;
-
-template <> class VTKCOMMONCORE_EXPORT AtomicOps<8>
-{
-public:
-  typedef vtkTypeInt64 atomic_type;
-
-  static vtkTypeInt64 AddAndFetch(vtkTypeInt64 *ref, vtkTypeInt64 val);
-  static vtkTypeInt64 SubAndFetch(vtkTypeInt64 *ref, vtkTypeInt64 val);
-  static vtkTypeInt64 PreIncrement(vtkTypeInt64 *ref);
-  static vtkTypeInt64 PreDecrement(vtkTypeInt64 *ref);
-  static vtkTypeInt64 PostIncrement(vtkTypeInt64 *ref);
-  static vtkTypeInt64 PostDecrement(vtkTypeInt64 *ref);
-  static vtkTypeInt64 Load(const vtkTypeInt64 *ref);
-  static void Store(vtkTypeInt64 *ref, vtkTypeInt64 val);
-};
-
-template <> class VTKCOMMONCORE_EXPORT AtomicOps<4>
-{
-public:
-  typedef vtkTypeInt32 atomic_type;
-
-  static vtkTypeInt32 AddAndFetch(vtkTypeInt32 *ref, vtkTypeInt32 val);
-  static vtkTypeInt32 SubAndFetch(vtkTypeInt32 *ref, vtkTypeInt32 val);
-  static vtkTypeInt32 PreIncrement(vtkTypeInt32 *ref);
-  static vtkTypeInt32 PreDecrement(vtkTypeInt32 *ref);
-  static vtkTypeInt32 PostIncrement(vtkTypeInt32 *ref);
-  static vtkTypeInt32 PostDecrement(vtkTypeInt32 *ref);
-  static vtkTypeInt32 Load(const vtkTypeInt32 *ref);
-  static void Store(vtkTypeInt32 *ref, vtkTypeInt32 val);
-};
-
-} // detail
-#endif // __WRAP__
-
-
-template <typename T> class vtkAtomic : vtk::atomic::detail::IntegralType<T>
-{
-private:
-  typedef detail::AtomicOps<sizeof(T)> Impl;
-
-public:
-  vtkAtomic() : Atomic(0)
-  {
-  }
-
-  vtkAtomic(T val) : Atomic(static_cast<typename Impl::atomic_type>(val))
-  {
-  }
-
-  vtkAtomic(const vtkAtomic<T> &atomic)
-    : Atomic(static_cast<typename Impl::atomic_type>(atomic.load()))
-  {
-  }
-
-  T operator++()
-  {
-    return static_cast<T>(Impl::PreIncrement(&this->Atomic));
-  }
-
-  T operator++(int)
-  {
-    return static_cast<T>(Impl::PostIncrement(&this->Atomic));
-  }
-
-  T operator--()
-  {
-    return static_cast<T>(Impl::PreDecrement(&this->Atomic));
-  }
-
-  T operator--(int)
-  {
-    return static_cast<T>(Impl::PostDecrement(&this->Atomic));
-  }
-
-  T operator+=(T val)
-  {
-    return static_cast<T>(Impl::AddAndFetch(&this->Atomic,
-      static_cast<typename Impl::atomic_type>(val)));
-  }
-
-  T operator-=(T val)
-  {
-    return static_cast<T>(Impl::SubAndFetch(&this->Atomic,
-      static_cast<typename Impl::atomic_type>(val)));
-  }
-
-  operator T() const
-  {
-    return static_cast<T>(Impl::Load(&this->Atomic));
-  }
-
-  T operator=(T val)
-  {
-    Impl::Store(&this->Atomic, static_cast<typename Impl::atomic_type>(val));
-    return val;
-  }
-
-  vtkAtomic<T>& operator=(const vtkAtomic<T> &atomic)
-  {
-    this->store(atomic.load());
-    return *this;
-  }
-
-  T load() const
-  {
-    return static_cast<T>(Impl::Load(&this->Atomic));
-  }
-
-  void store(T val)
-  {
-    Impl::Store(&this->Atomic, static_cast<typename Impl::atomic_type>(val));
-  }
-
-private:
-  typename Impl::atomic_type Atomic;
-};
-
-
-template <typename T> class vtkAtomic<T*>
-{
-private:
-  typedef detail::AtomicOps<sizeof(T*)> Impl;
-
-public:
-  vtkAtomic() : Atomic(0)
-  {
-  }
-
-  vtkAtomic(T* val)
-    : Atomic(reinterpret_cast<typename Impl::atomic_type>(val))
-  {
-  }
-
-  vtkAtomic(const vtkAtomic<T*> &atomic)
-    : Atomic(reinterpret_cast<typename Impl::atomic_type>(atomic.load()))
-  {
-  }
-
-  T* operator++()
-  {
-    return reinterpret_cast<T*>(Impl::AddAndFetch(&this->Atomic, sizeof(T)));
-  }
-
-  T* operator++(int)
-  {
-    T* val = reinterpret_cast<T*>(Impl::AddAndFetch(&this->Atomic, sizeof(T)));
-    return --val;
-  }
-
-  T* operator--()
-  {
-    return reinterpret_cast<T*>(Impl::SubAndFetch(&this->Atomic, sizeof(T)));
-  }
-
-  T* operator--(int)
-  {
-    T* val = reinterpret_cast<T*>(Impl::AddAndFetch(&this->Atomic, sizeof(T)));
-    return ++val;
-  }
-
-  T* operator+=(std::ptrdiff_t val)
-  {
-    return reinterpret_cast<T*>(Impl::AddAndFetch(&this->Atomic,
-                                                  val * sizeof(T)));
-  }
-
-  T* operator-=(std::ptrdiff_t val)
-  {
-    return reinterpret_cast<T*>(Impl::SubAndFetch(&this->Atomic,
-                                                  val * sizeof(T)));
-  }
-
-  operator T*() const
-  {
-    return reinterpret_cast<T*>(Impl::Load(&this->Atomic));
-  }
-
-  T* operator=(T* val)
-  {
-    Impl::Store(&this->Atomic,
-                reinterpret_cast<typename Impl::atomic_type>(val));
-    return val;
-  }
-
-  vtkAtomic<T*>& operator=(const vtkAtomic<T*> &atomic)
-  {
-    this->store(atomic.load());
-    return *this;
-  }
-
-  T* load() const
-  {
-    return reinterpret_cast<T*>(Impl::Load(&this->Atomic));
-  }
-
-  void store(T* val)
-  {
-    Impl::Store(&this->Atomic,
-                reinterpret_cast<typename Impl::atomic_type>(val));
-  }
-
-private:
-  typename Impl::atomic_type Atomic;
-};
-
-
-template <> class vtkAtomic<void*>
-{
-private:
-  typedef detail::AtomicOps<sizeof(void*)> Impl;
-
-public:
-  vtkAtomic() : Atomic(0)
-  {
-  }
-
-  vtkAtomic(void* val)
-    : Atomic(reinterpret_cast<Impl::atomic_type>(val))
-  {
-  }
-
-  vtkAtomic(const vtkAtomic<void*> &atomic)
-    : Atomic(reinterpret_cast<Impl::atomic_type>(atomic.load()))
-  {
-  }
-
-  operator void*() const
-  {
-    return reinterpret_cast<void*>(Impl::Load(&this->Atomic));
-  }
-
-  void* operator=(void* val)
-  {
-    Impl::Store(&this->Atomic,
-                reinterpret_cast<Impl::atomic_type>(val));
-    return val;
-  }
-
-  vtkAtomic<void*>& operator=(const vtkAtomic<void*> &atomic)
-  {
-    this->store(atomic.load());
-    return *this;
-  }
-
-  void* load() const
-  {
-    return reinterpret_cast<void*>(Impl::Load(&this->Atomic));
-  }
-
-  void store(void* val)
-  {
-    Impl::Store(&this->Atomic,
-                reinterpret_cast<Impl::atomic_type>(val));
-  }
-
-private:
-  Impl::atomic_type Atomic;
-};
-
-#endif
-// VTK-HeaderTest-Exclude: vtkAtomic.h
diff --git a/Common/Core/SMP/OpenMP/vtkSMPThreadLocal.h.in b/Common/Core/SMP/OpenMP/vtkSMPThreadLocal.h.in
deleted file mode 100644
index 4baf855..0000000
--- a/Common/Core/SMP/OpenMP/vtkSMPThreadLocal.h.in
+++ /dev/null
@@ -1,173 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkSMPThreadLocal.h
-
-  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.
-
-=========================================================================*/
-// .NAME vtkSMPThreadLocal - A thread local storage implementation using
-// platform specific facilities.
-// .SECTION Description
-// A thread local object is one that maintains a copy of an object of the
-// template type for each thread that processes data. vtkSMPThreadLocal
-// creates storage for all threads but the actual objects are created
-// the first time Local() is called. Note that some of the vtkSMPThreadLocal
-// API is not thread safe. It can be safely used in a multi-threaded
-// environment because Local() returns storage specific to a particular
-// thread, which by default will be accessed sequentially. It is also
-// thread-safe to iterate over vtkSMPThreadLocal as long as each thread
-// creates its own iterator and does not change any of the thread local
-// objects.
-//
-// A common design pattern in using a thread local storage object is to
-// write/accumulate data to local object when executing in parallel and
-// then having a sequential code block that iterates over the whole storage
-// using the iterators to do the final accumulation.
-
-#ifndef vtkSMPThreadLocal_h
-#define vtkSMPThreadLocal_h
-
-#include "vtkSMPThreadLocalImpl.h"
-#include "vtkSMPToolsInternal.h"
-
-template <typename T>
-class vtkSMPThreadLocal
-{
-public:
-  // Description:
-  // Default constructor. Creates a default exemplar.
-  vtkSMPThreadLocal() : Backend(vtk::detail::smp::GetNumberOfThreads())
-  {
-  }
-
-  // Description:
-  // Constructor that allows the specification of an exemplar object
-  // which is used when constructing objects when Local() is first called.
-  // Note that a copy of the exemplar is created using its copy constructor.
-  vtkSMPThreadLocal(const T& exemplar)
-    : Backend(vtk::detail::smp::GetNumberOfThreads()), Exemplar(exemplar)
-  {
-  }
-
-  ~vtkSMPThreadLocal()
-  {
-    detail::ThreadSpecificStorageIterator it;
-    it.SetThreadSpecificStorage(Backend);
-    for (it.SetToBegin(); !it.GetAtEnd(); it.Forward())
-      {
-      delete reinterpret_cast<T*>(it.GetStorage());
-      }
-  }
-
-  // Description:
-  // Returns an object of type T that is local to the current thread.
-  // This needs to be called mainly within a threaded execution path.
-  // It will create a new object (local to the tread so each thread
-  // get their own when calling Local) which is a copy of exemplar as passed
-  // to the constructor (or a default object if no exemplar was provided)
-  // the first time it is called. After the first time, it will return
-  // the same object.
-  T& Local()
-  {
-    detail::StoragePointerType &ptr = this->Backend.GetStorage();
-    T *local = reinterpret_cast<T*>(ptr);
-    if (!ptr)
-      {
-       ptr = local = new T(this->Exemplar);
-      }
-    return *local;
-  }
-
-  // Description:
-  // Return the number of thread local objects that have been initialized
-  size_t size() const
-  {
-    return this->Backend.Size();
-  }
-
-  // Description:
-  // Subset of the standard iterator API.
-  // The most common design pattern is to use iterators in a sequential
-  // code block and to use only the thread local objects in parallel
-  // code blocks.
-  // It is thread safe to iterate over the thread local containers
-  // as long as each thread uses its own iterator and does not modify
-  // objects in the container.
-  class iterator
-  {
-  public:
-    iterator& operator++()
-    {
-      this->Impl.Forward();
-      return *this;
-    }
-
-    iterator operator++(int)
-    {
-      iterator copy = *this;
-      this->Impl.Forward();
-      return copy;
-    }
-
-    bool operator==(const iterator& other)
-    {
-      return this->Impl == other.Impl;
-    }
-
-    bool operator!=(const iterator& other)
-    {
-      return !(this->Impl == other.Impl);
-    }
-
-    T& operator*()
-    {
-      return *reinterpret_cast<T*>(this->Impl.GetStorage());
-    }
-
-    T* operator->()
-    {
-      return reinterpret_cast<T*>(this->Impl.GetStorage());
-    }
-
-  private:
-    detail::ThreadSpecificStorageIterator Impl;
-
-    friend class vtkSMPThreadLocal<T>;
-  };
-
-  // Description:
-  // Returns a new iterator pointing to the beginning of
-  // the local storage container. Thread safe.
-  iterator begin()
-  {
-    iterator it;
-    it.Impl.SetThreadSpecificStorage(Backend);
-    it.Impl.SetToBegin();
-    return it;
-  }
-
-  // Description:
-  // Returns a new iterator pointing to past the end of
-  // the local storage container. Thread safe.
-  iterator end()
-  {
-    iterator it;
-    it.Impl.SetThreadSpecificStorage(Backend);
-    it.Impl.SetToEnd();
-    return it;
-  }
-
-private:
-  detail::ThreadSpecific Backend;
-  T Exemplar;
-};
-
-#endif
-// VTK-HeaderTest-Exclude: vtkSMPThreadLocal.h
diff --git a/Common/Core/SMP/OpenMP/vtkSMPThreadLocalImpl.cxx b/Common/Core/SMP/OpenMP/vtkSMPThreadLocalImpl.cxx
deleted file mode 100644
index fb5716c..0000000
--- a/Common/Core/SMP/OpenMP/vtkSMPThreadLocalImpl.cxx
+++ /dev/null
@@ -1,274 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkSMPThreadLocalImpl.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 "vtkSMPThreadLocalImpl.h"
-
-#include <omp.h>
-
-#include <algorithm>
-
-namespace detail
-{
-
-static ThreadIdType GetThreadId()
-{
-  static int threadPrivateData;
-#pragma omp threadprivate(threadPrivateData)
-  return &threadPrivateData;
-}
-
-
-// 32 bit FNV-1a hash function
-inline HashType GetHash(ThreadIdType id)
-{
-  const HashType offset_basis = 2166136261u;
-  const HashType FNV_prime = 16777619u;
-
-  unsigned char *bp = reinterpret_cast<unsigned char*>(&id);
-  unsigned char *be = bp + sizeof(id);
-  HashType hval = offset_basis;
-  while (bp < be)
-    {
-    hval ^= static_cast<HashType>(*bp++);
-    hval *= FNV_prime;
-    }
-
-  return hval;
-}
-
-
-class LockGuard
-{
-public:
-  LockGuard(omp_lock_t &lock, bool wait) : Lock(lock), Status(0)
-  {
-    if (wait)
-      {
-      omp_set_lock(&this->Lock);
-      this->Status = 1;
-      }
-    else
-      {
-      this->Status = omp_test_lock(&this->Lock);
-      }
-  }
-
-  bool Success() const
-  {
-    return this->Status != 0;
-  }
-
-  void Release()
-  {
-    if (this->Status)
-      {
-      omp_unset_lock(&this->Lock);
-      this->Status = 0;
-      }
-  }
-
-  ~LockGuard()
-  {
-    this->Release();
-  }
-
-private:
-  // not copyable
-  LockGuard(const LockGuard&);
-  void operator=(const LockGuard&);
-
-  omp_lock_t &Lock;
-  int Status;
-};
-
-
-Slot::Slot()
-  : ThreadId(0), Storage(0)
-{
-  omp_init_lock(&this->ModifyLock);
-}
-
-Slot::~Slot()
-{
-  omp_destroy_lock(&this->ModifyLock);
-}
-
-
-HashTableArray::HashTableArray(size_t sizeLg)
-  : Size(1u << sizeLg), SizeLg(sizeLg), NumberOfEntries(0), Prev(NULL)
-{
-  this->Slots = new Slot[this->Size];
-}
-
-HashTableArray::~HashTableArray()
-{
-  delete [] this->Slots;
-}
-
-// Recursively lookup the slot containing threadId in the HashTableArray
-// linked list -- array
-static Slot* LookupSlot(HashTableArray *array, ThreadIdType threadId,
-                        size_t hash)
-{
-  if (!array)
-    {
-    return NULL;
-    }
-
-  size_t mask = array->Size - 1u;
-  Slot *slot = NULL;
-
-  // since load factor is maintained bellow 0.5, this loop should hit an
-  // empty slot if the queried slot does not exist in this array
-  for (size_t idx = hash & mask; ; idx = (idx + 1) & mask) // linear probing
-    {
-    slot = array->Slots + idx;
-    ThreadIdType slotThreadId = slot->ThreadId.load(); // atomic read
-    if (!slotThreadId) // empty slot means threadId doesn't exist in this array
-      {
-      slot = LookupSlot(array->Prev, threadId, hash);
-      break;
-      }
-    else if (slotThreadId == threadId)
-      {
-      break;
-      }
-    }
-
-  return slot;
-}
-
-// Lookup threadId. Try to acquire a slot if it doesn't already exist.
-// Does not block. Returns NULL if acquire fails due to high load factor.
-// Returns true in 'firstAccess' if threadID did not exist previously.
-static Slot* AcquireSlot(HashTableArray *array, ThreadIdType threadId,
-                         size_t hash, bool &firstAccess)
-{
-  size_t mask = array->Size - 1u;
-  Slot *slot = NULL;
-  firstAccess = false;
-
-  for (size_t idx = hash & mask; ; idx = (idx + 1) & mask)
-    {
-    slot = array->Slots + idx;
-    ThreadIdType slotThreadId = slot->ThreadId.load(); // atomic read
-    if (!slotThreadId) // unused?
-      {
-      // empty slot means threadId does not exist, try to acquire the slot
-      LockGuard lguard(slot->ModifyLock, false); // try to get exclusive access
-      if (lguard.Success())
-        {
-        size_t size = ++array->NumberOfEntries; // atomic
-        if ((size * 2) > array->Size) // load factor is above threshold
-          {
-          --array->NumberOfEntries; // atomic revert
-          return NULL; // indicate need for resizing
-          }
-
-        if (!slot->ThreadId.load()) // not acquired in the meantime?
-          {
-          slot->ThreadId.store(threadId); // atomically acquire
-          // check previous arrays for the entry
-          Slot *prevSlot = LookupSlot(array->Prev, threadId, hash);
-          if (prevSlot)
-            {
-            slot->Storage = prevSlot->Storage;
-            // Do not clear PrevSlot's ThreadId as our technique of stopping
-            // linear probing at empty slots relies on slots not being
-            // "freed". Instead, clear previous slot's storage pointer as
-            // ThreadSpecificStorageIterator relies on this information to
-            // ensure that it doesn't iterate over the same thread's storage
-            // more than once.
-            prevSlot->Storage = NULL;
-            }
-          else // first time access
-            {
-            slot->Storage = NULL;
-            firstAccess = true;
-            }
-          break;
-          }
-        }
-      }
-    else if (slotThreadId == threadId)
-      {
-      break;
-      }
-    }
-
-  return slot;
-}
-
-
-ThreadSpecific::ThreadSpecific(unsigned numThreads)
-  : Count(0)
-{
-  // lastSetBit = floor(log2(numThreads))
-  int lastSetBit = 0;
-  for (int i = (sizeof(unsigned) * 8) - 1; i >= 0; --i)
-    {
-    if (numThreads & (1u << i))
-      {
-      lastSetBit = i;
-      break;
-      }
-    }
-
-  // initial size should be more than twice the number of threads
-  size_t initSizeLg = (lastSetBit + 2);
-  this->Root = new HashTableArray(initSizeLg);
-}
-
-ThreadSpecific::~ThreadSpecific()
-{
-  HashTableArray *array = this->Root;
-  while (array)
-    {
-    HashTableArray *tofree = array;
-    array = array->Prev;
-    delete tofree;
-    }
-}
-
-StoragePointerType& ThreadSpecific::GetStorage()
-{
-  ThreadIdType threadId = GetThreadId();
-  size_t hash = GetHash(threadId);
-
-  Slot *slot = NULL;
-  while (!slot)
-    {
-    bool firstAccess = false;
-    HashTableArray *array = this->Root.load();
-    slot = AcquireSlot(array, threadId, hash, firstAccess);
-    if (!slot) // not enough room, resize
-      {
-#     pragma omp critical (HashTableResize)
-      if (this->Root == array)
-        {
-        HashTableArray *newArray = new HashTableArray(array->SizeLg + 1);
-        newArray->Prev = array;
-        this->Root.store(newArray); // atomic copy
-        }
-      }
-    else if (firstAccess)
-      {
-      ++this->Count; // atomic increment
-      }
-    }
-  return slot->Storage;
-}
-
-} // detail
diff --git a/Common/Core/SMP/OpenMP/vtkSMPThreadLocalImpl.h.in b/Common/Core/SMP/OpenMP/vtkSMPThreadLocalImpl.h.in
deleted file mode 100644
index d018785..0000000
--- a/Common/Core/SMP/OpenMP/vtkSMPThreadLocalImpl.h.in
+++ /dev/null
@@ -1,188 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkSMPThreadLocalImpl.h
-
-  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.
-
-=========================================================================*/
-
-// Thread Specific Storage is implemented as a Hash Table, with the Thread Id
-// as the key and a Pointer to the data as the value. The Hash Table implements
-// Open Addressing with Linear Probing. A fixed-size array (HashTableArray) is
-// used as the hash table. The size of this array is allocated to be large
-// enough to store thread specific data for all the threads with a Load Factor
-// of 0.5. In case the number of threads changes dynamically and the current
-// array is not able to accommodate more entries, a new array is allocated that
-// is twice the size of the current array. To avoid rehashing and blocking the
-// threads, a rehash is not performed immediately. Instead, a linked list of
-// hash table arrays is maintained with the current array at the root and older
-// arrays along the list. All lookups are sequentially performed along the
-// linked list. If the root array does not have an entry, it is created for
-// faster lookup next time. The ThreadSpecific::GetStorage() function is thread
-// safe and only blocks when a new array needs to be allocated, which should be
-// rare.
-
-#ifndef vtkSMPThreadLocalImpl_h
-#define vtkSMPThreadLocalImpl_h
-
-#include "vtkCommonCoreModule.h" // For export macro
-#include "vtkAtomic.h"
-#include "vtkConfigure.h"
-#include "vtkSystemIncludes.h"
-
-#include <omp.h>
-
-
-namespace detail
-{
-
-typedef void* ThreadIdType;
-typedef vtkTypeUInt32 HashType;
-typedef void* StoragePointerType;
-
-
-struct Slot
-{
-  vtkAtomic<ThreadIdType> ThreadId;
-  omp_lock_t ModifyLock;
-  StoragePointerType Storage;
-
-  Slot();
-  ~Slot();
-
-private:
-  // not copyable
-  Slot(const Slot&);
-  void operator=(const Slot&);
-};
-
-
-struct HashTableArray
-{
-  size_t Size, SizeLg;
-  vtkAtomic<size_t> NumberOfEntries;
-  Slot *Slots;
-  HashTableArray *Prev;
-
-  explicit HashTableArray(size_t sizeLg);
-  ~HashTableArray();
-
-private:
-  // disallow copying
-  HashTableArray(const HashTableArray&);
-  void operator=(const HashTableArray&);
-};
-
-
-class VTKCOMMONCORE_EXPORT ThreadSpecific
-{
-public:
-  explicit ThreadSpecific(unsigned numThreads);
-  ~ThreadSpecific();
-
-  StoragePointerType& GetStorage();
-  size_t Size() const;
-
-private:
-  vtkAtomic<HashTableArray*> Root;
-  vtkAtomic<size_t> Count;
-
-  friend class ThreadSpecificStorageIterator;
-};
-
-inline size_t ThreadSpecific::Size() const
-{
-  return this->Count;
-}
-
-
-class ThreadSpecificStorageIterator
-{
-public:
-  ThreadSpecificStorageIterator()
-    : ThreadSpecificStorage(NULL), CurrentArray(NULL), CurrentSlot(0)
-  {
-  }
-
-  void SetThreadSpecificStorage(ThreadSpecific &threadSpecifc)
-  {
-    this->ThreadSpecificStorage = &threadSpecifc;
-  }
-
-  void SetToBegin()
-  {
-    this->CurrentArray = this->ThreadSpecificStorage->Root;
-    this->CurrentSlot = 0;
-    if (!this->CurrentArray->Slots->Storage)
-      {
-      this->Forward();
-      }
-  }
-
-  void SetToEnd()
-  {
-    this->CurrentArray = NULL;
-    this->CurrentSlot = 0;
-  }
-
-  bool GetInitialized() const
-  {
-    return this->ThreadSpecificStorage != NULL;
-  }
-
-  bool GetAtEnd() const
-  {
-    return this->CurrentArray == NULL;
-  }
-
-  void Forward()
-  {
-    for (;;)
-      {
-      if (++this->CurrentSlot >= this->CurrentArray->Size)
-        {
-        this->CurrentArray = this->CurrentArray->Prev;
-        this->CurrentSlot = 0;
-        if (!this->CurrentArray)
-          {
-          break;
-          }
-        }
-      Slot *slot = this->CurrentArray->Slots + this->CurrentSlot;
-      if (slot->Storage)
-        {
-        break;
-        }
-      }
-  }
-
-  StoragePointerType& GetStorage() const
-  {
-    Slot *slot = this->CurrentArray->Slots + this->CurrentSlot;
-    return slot->Storage;
-  }
-
-  bool operator==(const ThreadSpecificStorageIterator &it) const
-  {
-    return (this->ThreadSpecificStorage == it.ThreadSpecificStorage) &&
-           (this->CurrentArray == it.CurrentArray) &&
-           (this->CurrentSlot == it.CurrentSlot);
-  }
-
-private:
-  ThreadSpecific *ThreadSpecificStorage;
-  HashTableArray *CurrentArray;
-  size_t CurrentSlot;
-};
-
-} // detail;
-
-#endif
-// VTK-HeaderTest-Exclude: vtkSMPThreadLocalImpl.h
diff --git a/Common/Core/SMP/OpenMP/vtkSMPTools.cxx b/Common/Core/SMP/OpenMP/vtkSMPTools.cxx
deleted file mode 100644
index f5b0992..0000000
--- a/Common/Core/SMP/OpenMP/vtkSMPTools.cxx
+++ /dev/null
@@ -1,63 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkSMPTools.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 "vtkSMPTools.h"
-
-#include <omp.h>
-
-#include <algorithm>
-
-namespace
-{
-int vtkSMPNumberOfSpecifiedThreads = 0;
-}
-
-void vtkSMPTools::Initialize(int numThreads)
-{
-# pragma omp single
-  if (numThreads)
-    {
-    vtkSMPNumberOfSpecifiedThreads = numThreads;
-    omp_set_num_threads(numThreads);
-    }
-}
-
-int vtkSMPTools::GetEstimatedNumberOfThreads()
-{
-  return vtk::detail::smp::GetNumberOfThreads();
-}
-
-int vtk::detail::smp::GetNumberOfThreads()
-{
-  return vtkSMPNumberOfSpecifiedThreads ? vtkSMPNumberOfSpecifiedThreads :
-         omp_get_max_threads();
-}
-
-void vtk::detail::smp::vtkSMPTools_Impl_For_OpenMP(vtkIdType first,
-  vtkIdType last, vtkIdType grain, ExecuteFunctorPtrType functorExecuter,
-  void *functor)
-{
-  if (grain <= 0)
-    {
-    vtkIdType estimateGrain = (last - first)/(omp_get_max_threads() * 4);
-    grain = (estimateGrain > 0) ? estimateGrain : 1;
-    }
-
-# pragma omp parallel for schedule(runtime)
-  for (vtkIdType from = first; from < last; from += grain)
-    {
-    functorExecuter(functor, from, grain, last);
-    }
-}
diff --git a/Common/Core/SMP/OpenMP/vtkSMPToolsInternal.h.in b/Common/Core/SMP/OpenMP/vtkSMPToolsInternal.h.in
deleted file mode 100644
index 9d2a3a3..0000000
--- a/Common/Core/SMP/OpenMP/vtkSMPToolsInternal.h.in
+++ /dev/null
@@ -1,78 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkSMPToolsInternal.h
-
-  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.
-
-=========================================================================*/
-
-#ifndef vtkSMPToolsInternal_h
-#define vtkSMPToolsInternal_h
-
-#include "vtkCommonCoreModule.h" // For export macro
-
-#ifndef __WRAP__
-namespace vtk
-{
-namespace detail
-{
-namespace smp
-{
-
-typedef void (*ExecuteFunctorPtrType)(void *, vtkIdType, vtkIdType, vtkIdType);
-
-int VTKCOMMONCORE_EXPORT GetNumberOfThreads();
-void VTKCOMMONCORE_EXPORT vtkSMPTools_Impl_For_OpenMP(vtkIdType first,
-  vtkIdType last, vtkIdType grain, ExecuteFunctorPtrType functorExecuter,
-  void *functor);
-
-
-template <typename FunctorInternal>
-void ExecuteFunctor(void *functor, vtkIdType from, vtkIdType grain,
-                    vtkIdType last)
-{
-  vtkIdType to = from + grain;
-  if (to > last)
-    {
-    to = last;
-    }
-
-  FunctorInternal &fi = *reinterpret_cast<FunctorInternal*>(functor);
-  fi.Execute(from, to);
-}
-
-template <typename FunctorInternal>
-static void vtkSMPTools_Impl_For(vtkIdType first, vtkIdType last,
-                                 vtkIdType grain, FunctorInternal& fi)
-{
-  vtkIdType n = last - first;
-  if (n <= 0)
-    {
-    return;
-    }
-
-  if (grain >= n)
-    {
-    fi.Execute(first, last);
-    }
-  else
-    {
-    vtkSMPTools_Impl_For_OpenMP(first, last, grain,
-                                ExecuteFunctor<FunctorInternal>, &fi);
-    }
-}
-
-}
-}
-}
-#endif // __WRAP__
-
-#endif
-// VTK-HeaderTest-Exclude: vtkSMPToolsInternal.h
diff --git a/Common/Core/SMP/Sequential/vtkAtomic.cxx b/Common/Core/SMP/Sequential/vtkAtomic.cxx
deleted file mode 100644
index 8f50ed7..0000000
--- a/Common/Core/SMP/Sequential/vtkAtomic.cxx
+++ /dev/null
@@ -1,284 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkAtomic.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 "vtkAtomic.h"
-
-
-#if !defined(VTK_GCC_ATOMICS_32) && !defined(VTK_APPLE_ATOMICS_32) &&\
-    !defined(VTK_WINDOWS_ATOMICS_32)
-# define VTK_LOCK_BASED_ATOMICS_32
-#endif
-
-#if !defined(VTK_GCC_ATOMICS_64) && !defined(VTK_APPLE_ATOMICS_64) &&\
-    !defined(VTK_WINDOWS_ATOMICS_64)
-# define VTK_LOCK_BASED_ATOMICS_64
-#endif
-
-
-#if defined(VTK_WINDOWS_ATOMICS_32) || defined(VTK_WINDOWS_ATOMICS_64)
-# include "vtkWindows.h"
-#endif
-
-#if defined(VTK_LOCK_BASED_ATOMICS_32) || defined(VTK_LOCK_BASED_ATOMICS_64)
-
-#include "vtkSimpleCriticalSection.h"
-
-class CriticalSectionGuard
-{
-public:
-  CriticalSectionGuard(vtkSimpleCriticalSection &cs) : CriticalSection(cs)
-  {
-    this->CriticalSection.Lock();
-  }
-
-  ~CriticalSectionGuard()
-  {
-    this->CriticalSection.Unlock();
-  }
-
-private:
-  // not copyable
-  CriticalSectionGuard(const CriticalSectionGuard&);
-  void operator=(const CriticalSectionGuard&);
-
-  vtkSimpleCriticalSection &CriticalSection;
-};
-
-#if defined(VTK_LOCK_BASED_ATOMICS_64)
-detail::AtomicOps<8>::atomic_type::atomic_type(vtkTypeInt64 init)
-  : var(init)
-{
-  this->csec = new vtkSimpleCriticalSection;
-}
-
-detail::AtomicOps<8>::atomic_type::~atomic_type()
-{
-  delete this->csec;
-}
-#endif
-
-#if defined(VTK_LOCK_BASED_ATOMICS_32)
-detail::AtomicOps<4>::atomic_type::atomic_type(vtkTypeInt32 init)
-  : var(init)
-{
-  this->csec = new vtkSimpleCriticalSection;
-}
-
-detail::AtomicOps<4>::atomic_type::~atomic_type()
-{
-  delete this->csec;
-}
-#endif
-
-#endif // VTK_LOCK_BASED_ATOMICS
-
-
-namespace detail
-{
-
-#if defined(VTK_WINDOWS_ATOMICS_64) || defined(VTK_LOCK_BASED_ATOMICS_64)
-
-vtkTypeInt64 AtomicOps<8>::AddAndFetch(atomic_type *ref, vtkTypeInt64 val)
-{
-#if defined(VTK_WINDOWS_ATOMICS_64)
-# if defined(VTK_HAS_INTERLOCKEDADD)
-  return InterlockedAdd64(ref, val);
-# else
-  return InterlockedExchangeAdd64(ref, val) + val;
-# endif
-#else
-  CriticalSectionGuard csg(*ref->csec);
-  return ref->var += val;
-#endif
-}
-
-vtkTypeInt64 AtomicOps<8>::SubAndFetch(atomic_type *ref, vtkTypeInt64 val)
-{
-#if defined(VTK_WINDOWS_ATOMICS_64)
-# if defined(VTK_HAS_INTERLOCKEDADD)
-  return InterlockedAdd64(ref, -val);
-# else
-  return InterlockedExchangeAdd64(ref, -val) - val;
-# endif
-#else
-  CriticalSectionGuard csg(*ref->csec);
-  return ref->var -= val;
-#endif
-}
-
-vtkTypeInt64 AtomicOps<8>::PreIncrement(atomic_type *ref)
-{
-#if defined(VTK_WINDOWS_ATOMICS_64)
-  return InterlockedIncrement64(ref);
-#else
-  CriticalSectionGuard csg(*ref->csec);
-  return ++(ref->var);
-#endif
-}
-
-vtkTypeInt64 AtomicOps<8>::PreDecrement(atomic_type *ref)
-{
-#if defined(VTK_WINDOWS_ATOMICS_64)
-  return InterlockedDecrement64(ref);
-#else
-  CriticalSectionGuard csg(*ref->csec);
-  return --(ref->var);
-#endif
-}
-
-vtkTypeInt64 AtomicOps<8>::PostIncrement(atomic_type *ref)
-{
-#if defined(VTK_WINDOWS_ATOMICS_64)
-  vtkTypeInt64 val = InterlockedIncrement64(ref);
-  return --val;
-#else
-  CriticalSectionGuard csg(*ref->csec);
-  return (ref->var)++;
-#endif
-}
-
-vtkTypeInt64 AtomicOps<8>::PostDecrement(atomic_type *ref)
-{
-#if defined(VTK_WINDOWS_ATOMICS_64)
-  vtkTypeInt64 val = InterlockedDecrement64(ref);
-  return ++val;
-#else
-  CriticalSectionGuard csg(*ref->csec);
-  return (ref->var)--;
-#endif
-}
-
-vtkTypeInt64 AtomicOps<8>::Load(const atomic_type *ref)
-{
-#if defined(VTK_WINDOWS_ATOMICS_64)
-  vtkTypeInt64 val;
-  InterlockedExchange64(&val, *ref);
-  return val;
-#else
-  CriticalSectionGuard csg(*ref->csec);
-  return ref->var;
-#endif
-}
-
-void AtomicOps<8>::Store(atomic_type *ref, vtkTypeInt64 val)
-{
-#if defined(VTK_WINDOWS_ATOMICS_64)
-  InterlockedExchange64(ref, val);
-#else
-  CriticalSectionGuard csg(*ref->csec);
-  ref->var = val;
-#endif
-}
-
-#endif // defined(VTK_WINDOWS_ATOMICS_64) || defined(VTK_LOCK_BASED_ATOMICS_64)
-
-
-#if defined(VTK_WINDOWS_ATOMICS_32) || defined(VTK_LOCK_BASED_ATOMICS_32)
-
-vtkTypeInt32 AtomicOps<4>::AddAndFetch(atomic_type *ref, vtkTypeInt32 val)
-{
-#if defined(VTK_WINDOWS_ATOMICS_32)
-# if defined(VTK_HAS_INTERLOCKEDADD)
-  return InterlockedAdd(reinterpret_cast<long*>(ref), val);
-# else
-  return InterlockedExchangeAdd(reinterpret_cast<long*>(ref), val) + val;
-# endif
-#else
-  CriticalSectionGuard csg(*ref->csec);
-  return ref->var += val;
-#endif
-}
-
-vtkTypeInt32 AtomicOps<4>::SubAndFetch(atomic_type *ref, vtkTypeInt32 val)
-{
-#if defined(VTK_WINDOWS_ATOMICS_32)
-# if defined(VTK_HAS_INTERLOCKEDADD)
-  return InterlockedAdd(reinterpret_cast<long*>(ref), -val);
-# else
-  return InterlockedExchangeAdd(reinterpret_cast<long*>(ref), -val) - val;
-# endif
-#else
-  CriticalSectionGuard csg(*ref->csec);
-  return ref->var -= val;
-#endif
-}
-
-vtkTypeInt32 AtomicOps<4>::PreIncrement(atomic_type *ref)
-{
-#if defined(VTK_WINDOWS_ATOMICS_32)
-  return InterlockedIncrement(reinterpret_cast<long*>(ref));
-#else
-  CriticalSectionGuard csg(*ref->csec);
-  return ++(ref->var);
-#endif
-}
-
-vtkTypeInt32 AtomicOps<4>::PreDecrement(atomic_type *ref)
-{
-#if defined(VTK_WINDOWS_ATOMICS_32)
-  return InterlockedDecrement(reinterpret_cast<long*>(ref));
-#else
-  CriticalSectionGuard csg(*ref->csec);
-  return --(ref->var);
-#endif
-}
-
-vtkTypeInt32 AtomicOps<4>::PostIncrement(atomic_type *ref)
-{
-#if defined(VTK_WINDOWS_ATOMICS_32)
-  vtkTypeInt32 val = InterlockedIncrement(reinterpret_cast<long*>(ref));
-  return --val;
-#else
-  CriticalSectionGuard csg(*ref->csec);
-  return (ref->var)++;
-#endif
-}
-
-vtkTypeInt32 AtomicOps<4>::PostDecrement(atomic_type *ref)
-{
-#if defined(VTK_WINDOWS_ATOMICS_32)
-  vtkTypeInt32 val = InterlockedDecrement(reinterpret_cast<long*>(ref));
-  return ++val;
-#else
-  CriticalSectionGuard csg(*ref->csec);
-  return (ref->var)--;
-#endif
-}
-
-vtkTypeInt32 AtomicOps<4>::Load(const atomic_type *ref)
-{
-#if defined(VTK_WINDOWS_ATOMICS_32)
-  long val;
-  InterlockedExchange(&val, *ref);
-  return val;
-#else
-  CriticalSectionGuard csg(*ref->csec);
-  return ref->var;
-#endif
-}
-
-void AtomicOps<4>::Store(atomic_type *ref, vtkTypeInt32 val)
-{
-#if defined(VTK_WINDOWS_ATOMICS_32)
-  InterlockedExchange(reinterpret_cast<long*>(ref), val);
-#else
-  CriticalSectionGuard csg(*ref->csec);
-  ref->var = val;
-#endif
-}
-
-#endif // defined(VTK_WINDOWS_ATOMICS_32) || defined(VTK_LOCK_BASED_ATOMICS_32)
-
-} // namespace detail
diff --git a/Common/Core/SMP/Sequential/vtkAtomic.h.in b/Common/Core/SMP/Sequential/vtkAtomic.h.in
deleted file mode 100644
index bf0b622..0000000
--- a/Common/Core/SMP/Sequential/vtkAtomic.h.in
+++ /dev/null
@@ -1,580 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkAtomic.h
-
-  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.
-
-=========================================================================*/
-// .NAME vtkAtomic - Provides support for atomic integers
-// .SECTION Description
-// Objects of atomic types are C++ objects that are free from data races;
-// that is, if one thread writes to an atomic object while another thread
-// reads from it, the behavior is well-defined. vtkAtomic provides
-// a subset of the std::atomic API and implementation for the following types,
-// 32 bit signed and unsigned integers, 64 bit signed and unsigned integers,
-// and pointers. For these types, vtkAtomic defines a
-// number of operations that happen atomically - without interruption
-// by another thread. Furthermore, these operations happen in a
-// sequentially-consistent way and use full memory fences. This means
-// that operations relating to atomic variables happen in the specified
-// order and the results are made visible to other processing cores to
-// guarantee proper sequential operation. Other memory access patterns
-// supported by std::atomic are not currently supported.
-//
-// Note that when atomic operations are not available on a particular
-// platform or compiler, mutexes, which are significantly slower, are used
-// as a fallback.
-
-#ifndef vtkAtomic_h
-#define vtkAtomic_h
-
-#include "vtkCommonCoreModule.h" // For export macro
-#include "vtkAtomicTypeConcepts.h"
-#include "vtkConfigure.h"
-#include "vtkSystemIncludes.h"
-#include "vtkType.h"
-
-#include <cstddef>
-
-
-// Assume 64-bit atomic operations are not available on 32 bit platforms
-#if defined(VTK_HAVE_SYNC_BUILTINS)
-# define VTK_GCC_ATOMICS_32
-# if VTK_SIZEOF_VOID_P == 8
-#   define VTK_GCC_ATOMICS_64
-# endif
-#elif defined(__APPLE__)
-# include <libkern/OSAtomic.h>
-# define VTK_APPLE_ATOMICS_32
-# if VTK_SIZEOF_VOID_P == 8
-#   define VTK_APPLE_ATOMICS_64
-# endif
-#elif defined(_WIN32) && defined(_MSC_VER)
-# define VTK_WINDOWS_ATOMICS_32
-# if VTK_SIZEOF_VOID_P == 8
-#   define VTK_WINDOWS_ATOMICS_64
-# endif
-#endif
-
-
-#if defined(_WIN32) && defined(_MSC_VER)
-//  disable warning about the padding due to alignment
-# pragma warning(disable:4324)
-# define VTK_ALIGN(X) __declspec(align(X))
-#elif defined(__GNUC__) // gcc compatible compiler
-# define VTK_ALIGN(X) __attribute__ ((aligned (X)))
-#else
-# define VTK_ALIGN(X)
-#endif
-
-
-class vtkSimpleCriticalSection;
-
-
-#ifndef __WRAP__
-namespace detail
-{
-
-template <size_t size> class AtomicOps;
-
-#if defined(VTK_GCC_ATOMICS_64)
-template <> class AtomicOps<8>
-{
-public:
-  typedef vtkTypeInt64 VTK_ALIGN(8) atomic_type;
-  typedef vtkTypeInt64 value_type;
-
-  static value_type AddAndFetch(value_type *ref, value_type val)
-  {
-    return __sync_add_and_fetch(ref, val);
-  }
-
-  static value_type SubAndFetch(value_type *ref, value_type val)
-  {
-    return __sync_sub_and_fetch(ref, val);
-  }
-
-  static value_type PreIncrement(value_type *ref)
-  {
-    return __sync_add_and_fetch(ref, 1);
-  }
-
-  static value_type PreDecrement(value_type *ref)
-  {
-    return __sync_sub_and_fetch(ref, 1);
-  }
-
-  static value_type PostIncrement(value_type *ref)
-  {
-    return __sync_fetch_and_add(ref, 1);
-  }
-
-  static value_type PostDecrement(value_type *ref)
-  {
-    return __sync_fetch_and_sub(ref, 1);
-  }
-
-  static value_type Load(const value_type *ref)
-  {
-    __sync_synchronize();
-    return *static_cast<const volatile value_type *>(ref);
-  }
-
-  static void Store(value_type *ref, value_type val)
-  {
-    *static_cast<volatile value_type*>(ref) = val;
-    __sync_synchronize();
-  }
-};
-
-#elif defined(VTK_APPLE_ATOMICS_64)
-template <> class AtomicOps<8>
-{
-public:
-  typedef vtkTypeInt64 VTK_ALIGN(8) atomic_type;
-  typedef vtkTypeInt64 value_type;
-
-  static vtkTypeInt64 AddAndFetch(vtkTypeInt64 *ref, vtkTypeInt64 val)
-  {
-    return OSAtomicAdd64Barrier(val, ref);
-  }
-
-  static vtkTypeInt64 SubAndFetch(vtkTypeInt64 *ref, vtkTypeInt64 val)
-  {
-    return OSAtomicAdd64Barrier(-val, ref);
-  }
-
-  static vtkTypeInt64 PreIncrement(vtkTypeInt64 *ref)
-  {
-    return OSAtomicIncrement64Barrier(ref);
-  }
-
-  static vtkTypeInt64 PreDecrement(vtkTypeInt64 *ref)
-  {
-    return OSAtomicDecrement64Barrier(ref);
-  }
-
-  static vtkTypeInt64 PostIncrement(vtkTypeInt64 *ref)
-  {
-    vtkTypeInt64 val = OSAtomicIncrement64Barrier(ref);
-    return --val;
-  }
-
-  static vtkTypeInt64 PostDecrement(vtkTypeInt64 *ref)
-  {
-    vtkTypeInt64 val = OSAtomicDecrement64Barrier(ref);
-    return ++val;
-  }
-
-  static vtkTypeInt64 Load(const vtkTypeInt64 *ref);
-  {
-    OSMemoryBarrier();
-    return *static_cast<const volatile vtkTypeInt64*>(ref);
-  }
-
-  static void Store(vtkTypeInt64 *ref, vtkTypeInt64 val);
-  {
-    *static_cast<volatile vtkTypeInt64*>(ref) = val;
-    OSMemoryBarrier();
-  }
-};
-
-#else
-
-template <> class VTKCOMMONCORE_EXPORT AtomicOps<8>
-{
-public:
-#if defined(VTK_WINDOWS_ATOMICS_64)
-  typedef vtkTypeInt64 VTK_ALIGN(8) atomic_type;
-#else
-  struct VTKCOMMONCORE_EXPORT atomic_type
-  {
-    vtkTypeInt64 var;
-    vtkSimpleCriticalSection *csec;
-
-    atomic_type(vtkTypeInt64 init);
-    ~atomic_type();
-  };
-#endif
-  typedef vtkTypeInt64 value_type;
-
-  static vtkTypeInt64 AddAndFetch(atomic_type *ref, vtkTypeInt64 val);
-  static vtkTypeInt64 SubAndFetch(atomic_type *ref, vtkTypeInt64 val);
-  static vtkTypeInt64 PreIncrement(atomic_type *ref);
-  static vtkTypeInt64 PreDecrement(atomic_type *ref);
-  static vtkTypeInt64 PostIncrement(atomic_type *ref);
-  static vtkTypeInt64 PostDecrement(atomic_type *ref);
-  static vtkTypeInt64 Load(const atomic_type *ref);
-  static void Store(atomic_type *ref, vtkTypeInt64 val);
-};
-
-#endif
-
-#if defined(VTK_GCC_ATOMICS_32)
-template <> class AtomicOps<4>
-{
-public:
-  typedef vtkTypeInt32 VTK_ALIGN(4) atomic_type;
-  typedef vtkTypeInt32 value_type;
-
-  static value_type AddAndFetch(value_type *ref, value_type val)
-  {
-    return __sync_add_and_fetch(ref, val);
-  }
-
-  static value_type SubAndFetch(value_type *ref, value_type val)
-  {
-    return __sync_sub_and_fetch(ref, val);
-  }
-
-  static value_type PreIncrement(value_type *ref)
-  {
-    return __sync_add_and_fetch(ref, 1);
-  }
-
-  static value_type PreDecrement(value_type *ref)
-  {
-    return __sync_sub_and_fetch(ref, 1);
-  }
-
-  static value_type PostIncrement(value_type *ref)
-  {
-    return __sync_fetch_and_add(ref, 1);
-  }
-
-  static value_type PostDecrement(value_type *ref)
-  {
-    return __sync_fetch_and_sub(ref, 1);
-  }
-
-  static value_type Load(const value_type *ref)
-  {
-    __sync_synchronize();
-    return *static_cast<const volatile value_type *>(ref);
-  }
-
-  static void Store(value_type *ref, value_type val)
-  {
-    *static_cast<volatile value_type*>(ref) = val;
-    __sync_synchronize();
-  }
-};
-
-#elif defined(VTK_APPLE_ATOMICS_32)
-template <> class AtomicOps<4>
-{
-public:
-  typedef vtkTypeInt32 VTK_ALIGN(4) atomic_type;
-  typedef vtkTypeInt32 value_type;
-
-  static vtkTypeInt32 AddAndFetch(vtkTypeInt32 *ref, vtkTypeInt32 val)
-  {
-    return OSAtomicAdd32Barrier(val, ref);
-  }
-
-  static vtkTypeInt32 SubAndFetch(vtkTypeInt32 *ref, vtkTypeInt32 val)
-  {
-    return OSAtomicAdd32Barrier(-val, ref);
-  }
-
-  static vtkTypeInt32 PreIncrement(vtkTypeInt32 *ref)
-  {
-    return OSAtomicIncrement32Barrier(ref);
-  }
-
-  static vtkTypeInt32 PreDecrement(vtkTypeInt32 *ref)
-  {
-    return OSAtomicDecrement32Barrier(ref);
-  }
-
-  static vtkTypeInt32 PostIncrement(vtkTypeInt32 *ref)
-  {
-    vtkTypeInt32 val = OSAtomicIncrement32Barrier(ref);
-    return --val;
-  }
-
-  static vtkTypeInt32 PostDecrement(vtkTypeInt32 *ref)
-  {
-    vtkTypeInt32 val = OSAtomicDecrement32Barrier(ref);
-    return ++val;
-  }
-
-  static vtkTypeInt32 Load(const vtkTypeInt32 *ref);
-  {
-    OSMemoryBarrier();
-    return *static_cast<const volatile vtkTypeInt32*>(ref);
-  }
-
-  static void Store(vtkTypeInt32 *ref, vtkTypeInt32 val);
-  {
-    *static_cast<volatile vtkTypeInt32*>(ref) = val;
-    OSMemoryBarrier();
-  }
-};
-
-#else
-
-template <> class VTKCOMMONCORE_EXPORT AtomicOps<4>
-{
-public:
-#if defined(VTK_WINDOWS_ATOMICS_32)
-  typedef vtkTypeInt32 VTK_ALIGN(4) atomic_type;
-#else
-  struct VTKCOMMONCORE_EXPORT atomic_type
-  {
-    vtkTypeInt32 var;
-    vtkSimpleCriticalSection *csec;
-
-    atomic_type(vtkTypeInt32 init);
-    ~atomic_type();
-  };
-#endif
-  typedef vtkTypeInt32 value_type;
-
-  static vtkTypeInt32 AddAndFetch(atomic_type *ref, vtkTypeInt32 val);
-  static vtkTypeInt32 SubAndFetch(atomic_type *ref, vtkTypeInt32 val);
-  static vtkTypeInt32 PreIncrement(atomic_type *ref);
-  static vtkTypeInt32 PreDecrement(atomic_type *ref);
-  static vtkTypeInt32 PostIncrement(atomic_type *ref);
-  static vtkTypeInt32 PostDecrement(atomic_type *ref);
-  static vtkTypeInt32 Load(const atomic_type *ref);
-  static void Store(atomic_type *ref, vtkTypeInt32 val);
-};
-
-#endif
-}
-#endif // __WRAP__
-
-template <typename T> class vtkAtomic : vtk::atomic::detail::IntegralType<T>
-{
-private:
-  typedef detail::AtomicOps<sizeof(T)> Impl;
-
-public:
-  vtkAtomic() : Atomic(0)
-  {
-  }
-
-  vtkAtomic(T val) : Atomic(static_cast<typename Impl::value_type>(val))
-  {
-  }
-
-  vtkAtomic(const vtkAtomic<T> &atomic)
-    : Atomic(static_cast<typename Impl::value_type>(atomic.load()))
-  {
-  }
-
-  T operator++()
-  {
-    return static_cast<T>(Impl::PreIncrement(&this->Atomic));
-  }
-
-  T operator++(int)
-  {
-    return static_cast<T>(Impl::PostIncrement(&this->Atomic));
-  }
-
-  T operator--()
-  {
-    return static_cast<T>(Impl::PreDecrement(&this->Atomic));
-  }
-
-  T operator--(int)
-  {
-    return static_cast<T>(Impl::PostDecrement(&this->Atomic));
-  }
-
-  T operator+=(T val)
-  {
-    return static_cast<T>(Impl::AddAndFetch(&this->Atomic,
-      static_cast<typename Impl::value_type>(val)));
-  }
-
-  T operator-=(T val)
-  {
-    return static_cast<T>(Impl::SubAndFetch(&this->Atomic,
-      static_cast<typename Impl::value_type>(val)));
-  }
-
-  operator T() const
-  {
-    return static_cast<T>(Impl::Load(&this->Atomic));
-  }
-
-  T operator=(T val)
-  {
-    Impl::Store(&this->Atomic, static_cast<typename Impl::value_type>(val));
-    return val;
-  }
-
-  vtkAtomic<T>& operator=(const vtkAtomic<T> &atomic)
-  {
-    this->store(atomic.load());
-    return *this;
-  }
-
-  T load() const
-  {
-    return static_cast<T>(Impl::Load(&this->Atomic));
-  }
-
-  void store(T val)
-  {
-    Impl::Store(&this->Atomic, static_cast<typename Impl::value_type>(val));
-  }
-
-private:
-  typename Impl::atomic_type Atomic;
-};
-
-
-template <typename T> class vtkAtomic<T*>
-{
-private:
-  typedef detail::AtomicOps<sizeof(T*)> Impl;
-
-public:
-  vtkAtomic() : Atomic(0)
-  {
-  }
-
-  vtkAtomic(T* val)
-    : Atomic(reinterpret_cast<typename Impl::value_type>(val))
-  {
-  }
-
-  vtkAtomic(const vtkAtomic<T*> &atomic)
-    : Atomic(reinterpret_cast<typename Impl::value_type>(atomic.load()))
-  {
-  }
-
-  T* operator++()
-  {
-    return reinterpret_cast<T*>(Impl::AddAndFetch(&this->Atomic, sizeof(T)));
-  }
-
-  T* operator++(int)
-  {
-    T* val = reinterpret_cast<T*>(Impl::AddAndFetch(&this->Atomic, sizeof(T)));
-    return --val;
-  }
-
-  T* operator--()
-  {
-    return reinterpret_cast<T*>(Impl::SubAndFetch(&this->Atomic, sizeof(T)));
-  }
-
-  T* operator--(int)
-  {
-    T* val = reinterpret_cast<T*>(Impl::AddAndFetch(&this->Atomic, sizeof(T)));
-    return ++val;
-  }
-
-  T* operator+=(std::ptrdiff_t val)
-  {
-    return reinterpret_cast<T*>(Impl::AddAndFetch(&this->Atomic,
-                                                  val * sizeof(T)));
-  }
-
-  T* operator-=(std::ptrdiff_t val)
-  {
-    return reinterpret_cast<T*>(Impl::SubAndFetch(&this->Atomic,
-                                                  val * sizeof(T)));
-  }
-
-  operator T*() const
-  {
-    return reinterpret_cast<T*>(Impl::Load(&this->Atomic));
-  }
-
-  T* operator=(T* val)
-  {
-    Impl::Store(&this->Atomic,
-                reinterpret_cast<typename Impl::value_type>(val));
-    return val;
-  }
-
-  vtkAtomic<T*>& operator=(const vtkAtomic<T*> &atomic)
-  {
-    this->store(atomic.load());
-    return *this;
-  }
-
-  T* load() const
-  {
-    return reinterpret_cast<T*>(Impl::Load(&this->Atomic));
-  }
-
-  void store(T* val)
-  {
-    Impl::Store(&this->Atomic,
-                reinterpret_cast<typename Impl::value_type>(val));
-  }
-
-private:
-  typename Impl::atomic_type Atomic;
-};
-
-
-template <> class vtkAtomic<void*>
-{
-private:
-  typedef detail::AtomicOps<sizeof(void*)> Impl;
-
-public:
-  vtkAtomic() : Atomic(0)
-  {
-  }
-
-  vtkAtomic(void* val)
-    : Atomic(reinterpret_cast<Impl::value_type>(val))
-  {
-  }
-
-  vtkAtomic(const vtkAtomic<void*> &atomic)
-    : Atomic(reinterpret_cast<Impl::value_type>(atomic.load()))
-  {
-  }
-
-  operator void*() const
-  {
-    return reinterpret_cast<void*>(Impl::Load(&this->Atomic));
-  }
-
-  void* operator=(void* val)
-  {
-    Impl::Store(&this->Atomic,
-                reinterpret_cast<Impl::value_type>(val));
-    return val;
-  }
-
-  vtkAtomic<void*>& operator=(const vtkAtomic<void*> &atomic)
-  {
-    this->store(atomic.load());
-    return *this;
-  }
-
-  void* load() const
-  {
-    return reinterpret_cast<void*>(Impl::Load(&this->Atomic));
-  }
-
-  void store(void* val)
-  {
-    Impl::Store(&this->Atomic,
-                reinterpret_cast<Impl::value_type>(val));
-  }
-
-private:
-  Impl::atomic_type Atomic;
-};
-
-#endif
-// VTK-HeaderTest-Exclude: vtkAtomic.h
diff --git a/Common/Core/SMP/Sequential/vtkAtomicInt.cxx b/Common/Core/SMP/Sequential/vtkAtomicInt.cxx
new file mode 100644
index 0000000..da835c6
--- /dev/null
+++ b/Common/Core/SMP/Sequential/vtkAtomicInt.cxx
@@ -0,0 +1,255 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+  Module:    vtkAtomicInt.h
+
+  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 "vtkAtomicInt.h"
+
+#if !defined(VTK_HAS_ATOMIC64) || !defined(VTK_HAS_ATOMIC32)
+# include "vtkSimpleCriticalSection.h"
+#elif defined(VTK_WINDOWS_ATOMIC)
+# include "vtkWindows.h"
+#endif
+
+namespace detail
+{
+
+#if !defined(VTK_HAS_ATOMIC32)
+vtkAtomicIntImpl<vtkTypeInt32>::vtkAtomicIntImpl()
+{
+  this->AtomicInt32CritSec = new vtkSimpleCriticalSection;
+}
+
+vtkAtomicIntImpl<vtkTypeInt32>::~vtkAtomicIntImpl()
+{
+  delete this->AtomicInt32CritSec;
+}
+
+vtkTypeInt32 vtkAtomicIntImpl<vtkTypeInt32>::operator++()
+{
+  if (!this->AtomicInt32CritSec)
+    {
+    return 0;
+    }
+  vtkTypeInt32 val;
+  this->AtomicInt32CritSec->Lock();
+  val = ++this->Value;
+  this->AtomicInt32CritSec->Unlock();
+  return val;
+}
+
+vtkTypeInt32 vtkAtomicIntImpl<vtkTypeInt32>::operator--()
+{
+  if (!this->AtomicInt32CritSec)
+    {
+    return 0;
+    }
+  vtkTypeInt32 val;
+  this->AtomicInt32CritSec->Lock();
+  val = --this->Value;
+  this->AtomicInt32CritSec->Unlock();
+  return val;
+}
+
+vtkTypeInt32 vtkAtomicIntImpl<vtkTypeInt32>::operator+=(vtkTypeInt32 val)
+{
+  if (!this->AtomicInt32CritSec)
+    {
+    return 0;
+    }
+  vtkTypeInt32 val2;
+  this->AtomicInt32CritSec->Lock();
+  val2 = (this->Value += val);
+  this->AtomicInt32CritSec->Unlock();
+  return val2;
+}
+
+vtkTypeInt32 vtkAtomicIntImpl<vtkTypeInt32>::load() const
+{
+  if (!this->AtomicInt32CritSec)
+    {
+    return 0;
+    }
+  vtkTypeInt32 val;
+  this->AtomicInt32CritSec->Lock();
+  val = this->Value;
+  this->AtomicInt32CritSec->Unlock();
+  return val;
+}
+
+void vtkAtomicIntImpl<vtkTypeInt32>::store(vtkTypeInt32 val)
+{
+  if (!this->AtomicInt32CritSec)
+    {
+    return;
+    }
+  this->AtomicInt32CritSec->Lock();
+  this->Value = val;
+  this->AtomicInt32CritSec->Unlock();
+}
+#elif defined (VTK_WINDOWS_ATOMIC)
+vtkAtomicIntImpl<vtkTypeInt32>::vtkAtomicIntImpl()
+{
+}
+
+vtkAtomicIntImpl<vtkTypeInt32>::~vtkAtomicIntImpl()
+{
+}
+
+vtkTypeInt32 vtkAtomicIntImpl<vtkTypeInt32>::operator++()
+{
+  return InterlockedIncrement((long*)&this->Value);
+}
+
+vtkTypeInt32 vtkAtomicIntImpl<vtkTypeInt32>::operator--()
+{
+  return InterlockedDecrement((long*)&this->Value);
+}
+
+vtkTypeInt32 vtkAtomicIntImpl<vtkTypeInt32>::operator+=(vtkTypeInt32 val)
+{
+# if defined(VTK_HAS_INTERLOCKEDADD)
+  return InterlockedAdd((long*)&this->Value, val);
+# else
+  return InterlockedExchangeAdd((long*)&this->Value, val) + val;
+# endif
+}
+
+vtkTypeInt32 vtkAtomicIntImpl<vtkTypeInt32>::load() const
+{
+  long retval;
+  InterlockedExchange(&retval, this->Value);
+  return retval;
+}
+
+void vtkAtomicIntImpl<vtkTypeInt32>::store(vtkTypeInt32 val)
+{
+  InterlockedExchange((long*)&this->Value, val);
+}
+#endif // !defined(VTK_HAS_ATOMIC32)
+
+#if !defined(VTK_HAS_ATOMIC64)
+vtkAtomicIntImpl<vtkTypeInt64>::vtkAtomicIntImpl()
+{
+  this->AtomicInt64CritSec = new vtkSimpleCriticalSection;
+}
+
+vtkAtomicIntImpl<vtkTypeInt64>::~vtkAtomicIntImpl()
+{
+  delete this->AtomicInt64CritSec;
+}
+
+vtkTypeInt64 vtkAtomicIntImpl<vtkTypeInt64>::operator++()
+{
+  if (!this->AtomicInt64CritSec)
+    {
+    return 0;
+    }
+  vtkTypeInt64 val;
+  this->AtomicInt64CritSec->Lock();
+  val = ++this->Value;
+  this->AtomicInt64CritSec->Unlock();
+  return val;
+}
+
+
+vtkTypeInt64 vtkAtomicIntImpl<vtkTypeInt64>::operator--()
+{
+  if (!this->AtomicInt64CritSec)
+    {
+    return 0;
+    }
+  vtkTypeInt64 val;
+  this->AtomicInt64CritSec->Lock();
+  val = --this->Value;
+  this->AtomicInt64CritSec->Unlock();
+  return val;
+}
+
+vtkTypeInt64 vtkAtomicIntImpl<vtkTypeInt64>::operator+=(vtkTypeInt64 val)
+{
+  if (!this->AtomicInt64CritSec)
+    {
+    return 0;
+    }
+  vtkTypeInt64 val2;
+  this->AtomicInt64CritSec->Lock();
+  val2 = (this->Value += val);
+  this->AtomicInt64CritSec->Unlock();
+  return val2;
+}
+
+vtkTypeInt64 vtkAtomicIntImpl<vtkTypeInt64>::load() const
+{
+  if (!this->AtomicInt64CritSec)
+    {
+    return 0;
+    }
+  vtkTypeInt64 val;
+  this->AtomicInt64CritSec->Lock();
+  val = this->Value;
+  this->AtomicInt64CritSec->Unlock();
+  return val;
+}
+
+void vtkAtomicIntImpl<vtkTypeInt64>::store(vtkTypeInt64 val)
+{
+  if (!this->AtomicInt64CritSec)
+    {
+    return;
+    }
+  this->AtomicInt64CritSec->Lock();
+  this->Value = val;
+  this->AtomicInt64CritSec->Unlock();
+}
+#elif defined (VTK_WINDOWS_ATOMIC)
+vtkAtomicIntImpl<vtkTypeInt64>::vtkAtomicIntImpl()
+{
+}
+
+vtkAtomicIntImpl<vtkTypeInt64>::~vtkAtomicIntImpl()
+{
+}
+
+vtkTypeInt64 vtkAtomicIntImpl<vtkTypeInt64>::operator++()
+{
+  return InterlockedIncrement64(&this->Value);
+}
+
+
+vtkTypeInt64 vtkAtomicIntImpl<vtkTypeInt64>::operator--()
+{
+  return InterlockedDecrement64(&this->Value);
+}
+
+vtkTypeInt64 vtkAtomicIntImpl<vtkTypeInt64>::operator+=(vtkTypeInt64 val)
+{
+# if defined(VTK_HAS_INTERLOCKEDADD)
+  return InterlockedAdd64(&this->Value, val);
+# else
+  return InterlockedExchangeAdd64(&this->Value, val) + val;
+# endif
+}
+
+vtkTypeInt64 vtkAtomicIntImpl<vtkTypeInt64>::load() const
+{
+  vtkTypeInt64 retval;
+  InterlockedExchange64(&retval, this->Value);
+  return retval;
+}
+
+void vtkAtomicIntImpl<vtkTypeInt64>::store(vtkTypeInt64 val)
+{
+  InterlockedExchange64(&this->Value, val);
+}
+#endif // !defined(VTK_HAS_ATOMIC64)
+}
diff --git a/Common/Core/SMP/Sequential/vtkAtomicInt.h.in b/Common/Core/SMP/Sequential/vtkAtomicInt.h.in
new file mode 100644
index 0000000..784eec1
--- /dev/null
+++ b/Common/Core/SMP/Sequential/vtkAtomicInt.h.in
@@ -0,0 +1,379 @@
+ /*=========================================================================
+
+  Program:   Visualization Toolkit
+  Module:    vtkAtomicInt.h
+
+  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.
+
+=========================================================================*/
+// .NAME vtkAtomicInt - Provides support for atomic integers
+// .SECTION Description
+// Objects of atomic types are C++ objects that are free from data races;
+// that is, if one thread writes to an atomic object while another thread
+// reads from it, the behavior is well-defined. vtkAtomicInt provides
+// a subset of the std::atomic API and implementation, mainly for 32 bit
+// and 64 bit signed integers. For these types, vtkAtomicInt defines a
+// number of operations that happen atomically - without interruption
+// by another thread. Furthermore, these operations happen in a
+// sequentially-consistent way and use full memory fences. This means
+// that operations relating to atomic variables happen in the specified
+// order and the results are made visible to other processing cores to
+// guarantee proper sequential operation. Other memory access patterns
+// supported by std::atomic are not currently supported.
+//
+// Note that when atomic operations are not available on a particular
+// platform or compiler, mutexes, which are significantly slower, are used
+// as a fallback.
+
+#ifndef vtkAtomicInt_h
+#define vtkAtomicInt_h
+
+#include "vtkCommonCoreModule.h" // For export macro
+#include "vtkSystemIncludes.h"
+#include "vtkConfigure.h"
+
+#if defined(__APPLE__)
+# include <libkern/OSAtomic.h>
+#endif
+
+#if (defined(_WIN32)  && !defined(__MINGW32__))
+# define VTK_WINDOWS_ATOMIC
+# if defined(_MSC_VER)
+#  pragma warning(disable:4324) // disable warning about the padding due to alignment
+# endif
+#endif
+
+#if defined(VTK_WINDOWS_ATOMIC) || defined(__APPLE__) || defined(VTK_HAVE_SYNC_BUILTINS)
+# define VTK_HAS_ATOMIC32
+#endif
+
+// Overall, we assume that 64 bit atomic operations are not available on 32
+// bit systems.
+#if VTK_SIZEOF_VOID_P == 8
+# if defined(VTK_WINDOWS_ATOMIC) || defined(__APPLE__) || defined(VTK_HAVE_SYNC_BUILTINS)
+#  define VTK_HAS_ATOMIC64
+# endif
+#endif
+
+#if !defined(VTK_HAS_ATOMIC64) || !defined(VTK_HAS_ATOMIC32)
+class vtkSimpleCriticalSection;
+#endif
+
+// Below are the actual implementations of 32 and 64 bit atomic operations.
+namespace detail
+{
+#if defined (VTK_WINDOWS_ATOMIC)
+# define VTK__ALIGN32 __declspec(align(32))
+#else
+# define VTK__ALIGN32
+#endif
+
+template <typename T> class vtkAtomicIntImpl;
+
+template <>
+#if defined(VTK_HAS_ATOMIC32) && !defined(VTK_WINDOWS_ATOMIC)
+class vtkAtomicIntImpl<vtkTypeInt32>
+#else
+class VTKCOMMONCORE_EXPORT vtkAtomicIntImpl<vtkTypeInt32>
+#endif
+{
+public:
+
+  // Description:
+  // Atomic pre-increment.
+#if defined(VTK_HAS_ATOMIC32) && !defined(VTK_WINDOWS_ATOMIC)
+  vtkTypeInt32 operator++()
+    {
+# if defined(__APPLE__)
+    return OSAtomicIncrement32Barrier(&this->Value);
+
+// GCC, CLANG, etc
+# elif defined(VTK_HAVE_SYNC_BUILTINS)
+    return __sync_add_and_fetch(&this->Value, 1);
+
+# endif
+    }
+
+  // Description:
+  // Atomic pre-decrement.
+  vtkTypeInt32 operator--()
+    {
+# if defined(__APPLE__)
+    return OSAtomicDecrement32Barrier(&this->Value);
+
+// GCC, CLANG, etc
+# elif defined(VTK_HAVE_SYNC_BUILTINS)
+    return __sync_sub_and_fetch(&this->Value, 1);
+
+# endif
+    }
+
+  // Description:
+  // Atomic add. Returns value after addition.
+  vtkTypeInt32 operator+=(vtkTypeInt32 val)
+    {
+# if defined(__APPLE__)
+    return OSAtomicAdd32Barrier(val, &this->Value);
+
+// GCC, CLANG, etc
+# elif defined(VTK_HAVE_SYNC_BUILTINS)
+    return __sync_add_and_fetch(&this->Value, val);
+
+# endif
+    }
+
+  // Description:
+  // Atomic fetch.
+  vtkTypeInt32 load() const
+    {
+# if defined(__APPLE__)
+    vtkTypeInt32 retval = 0;
+    OSAtomicCompareAndSwap32Barrier(retval, this->Value, &retval);
+    return retval;
+
+// GCC, CLANG, etc
+# elif defined(VTK_HAVE_SYNC_BUILTINS)
+    vtkTypeInt32 retval = 0;
+    __sync_val_compare_and_swap(&retval, retval, this->Value);
+    return retval;
+
+# endif
+    }
+
+  // Description:
+  // Atomic save.
+  void store(vtkTypeInt32 val)
+    {
+# if defined(__APPLE__)
+    OSAtomicCompareAndSwap32Barrier(this->Value, val, &this->Value);
+
+// GCC, CLANG, etc
+# elif defined(VTK_HAVE_SYNC_BUILTINS)
+  __sync_val_compare_and_swap(&this->Value, this->Value, val);
+
+#endif
+    }
+
+#else // defined(VTK_HAS_ATOMIC32) && !defined(VTK_WINDOWS_ATOMIC)
+
+  // These methods are for when using a mutex. Same as above.
+  // A virtual descructor is used becase the mutex is constructed
+  // with new to avoid including windows header in the .h file.
+  vtkAtomicIntImpl<vtkTypeInt32>();
+  virtual ~vtkAtomicIntImpl<vtkTypeInt32>();
+  vtkTypeInt32 operator++();
+  vtkTypeInt32 operator--();
+  vtkTypeInt32 operator+=(vtkTypeInt32 val);
+  vtkTypeInt32 load() const;
+  void store(vtkTypeInt32 val);
+
+#endif // defined(VTK_HAS_ATOMIC32) && !defined(VTK_WINDOWS_ATOMIC)
+
+protected:
+  // Explicitely aligning Value on Windows is probably not necessary
+  // since the compiler should automatically do it. Just being extra
+  // cautious since the InterlockedXXX() functions require alignment.
+  VTK__ALIGN32 vtkTypeInt32 Value;
+
+#if !defined(VTK_HAS_ATOMIC32)
+  vtkSimpleCriticalSection* AtomicInt32CritSec;
+#endif
+};
+
+#if defined (VTK_WINDOWS_ATOMIC)
+# define VTK__ALIGN64 __declspec(align(64))
+#else
+# define VTK__ALIGN64
+#endif
+
+template <>
+#if defined(VTK_HAS_ATOMIC64) && !defined(VTK_WINDOWS_ATOMIC)
+class vtkAtomicIntImpl<vtkTypeInt64>
+#else
+class VTKCOMMONCORE_EXPORT vtkAtomicIntImpl<vtkTypeInt64>
+#endif
+{
+public:
+
+  // Description:
+  // Atomic pre-increment.
+#if defined(VTK_HAS_ATOMIC64) && !defined(VTK_WINDOWS_ATOMIC)
+  vtkTypeInt64 operator++()
+    {
+# if defined(__APPLE__)
+    return OSAtomicIncrement64Barrier(&this->Value);
+
+// GCC, CLANG, etc
+# elif defined(VTK_HAVE_SYNC_BUILTINS)
+    return __sync_add_and_fetch(&this->Value, 1);
+
+# endif
+   }
+
+  // Description:
+  // Atomic pre-decrement.
+  vtkTypeInt64 operator--()
+    {
+# if defined(__APPLE__)
+    return OSAtomicDecrement64Barrier(&this->Value);
+
+// GCC, CLANG, etc
+# elif defined(VTK_HAVE_SYNC_BUILTINS)
+    return __sync_sub_and_fetch(&this->Value, 1);
+
+# endif
+    }
+
+  // Description:
+  // Atomic add. Returns value after addition.
+  vtkTypeInt64 operator+=(vtkTypeInt64 val)
+    {
+# if defined(__APPLE__)
+    return OSAtomicAdd64Barrier(val, &this->Value);
+
+// GCC, CLANG, etc
+# elif defined(VTK_HAVE_SYNC_BUILTINS)
+    return __sync_add_and_fetch(&this->Value, val);
+
+# endif
+    }
+
+  // Description:
+  // Atomic fetch.
+  vtkTypeInt64 load() const
+    {
+# if defined(__APPLE__)
+  vtkTypeInt64 retval = 0;
+  OSAtomicCompareAndSwap64Barrier(retval, this->Value, &retval);
+  return retval;
+
+// GCC, CLANG, etc
+# elif defined(VTK_HAVE_SYNC_BUILTINS)
+  vtkTypeInt64 retval = 0;
+  __sync_val_compare_and_swap(&retval, retval, this->Value);
+  return retval;
+
+# endif
+    }
+
+  // Description:
+  // Atomic store.
+  void store(vtkTypeInt64 val)
+    {
+# if defined(__APPLE__)
+  OSAtomicCompareAndSwap64Barrier(this->Value, val, &this->Value);
+
+// GCC, CLANG, etc
+# elif defined(VTK_HAVE_SYNC_BUILTINS)
+  __sync_val_compare_and_swap(&this->Value, this->Value, val);
+
+# endif
+    }
+
+#else // defined(VTK_HAS_ATOMIC64) && !defined(VTK_WINDOWS_ATOMIC)
+
+  // These methods are for when using a mutex. Same as above.
+  // A virtual descructor is used becase the mutex is constructed
+  // with new to avoid including windows header in the .h file.
+  vtkAtomicIntImpl<vtkTypeInt64>();
+  virtual ~vtkAtomicIntImpl<vtkTypeInt64>();
+  vtkTypeInt64 operator++();
+  vtkTypeInt64 operator--();
+  vtkTypeInt64 operator+=(vtkTypeInt64 val);
+  vtkTypeInt64 load() const;
+  void store(vtkTypeInt64 val);
+
+#endif // defined(VTK_HAS_ATOMIC64) && !defined(VTK_WINDOWS_ATOMIC)
+
+protected:
+ // Explicitely aligning Value on Windows is probably not necessary
+  // since the compiler should automatically do it. Just being extra
+  // cautious since the InterlockedXXX() functions require alignment.
+  VTK__ALIGN64 vtkTypeInt64 Value;
+
+#if !defined(VTK_HAS_ATOMIC64)
+  vtkSimpleCriticalSection* AtomicInt64CritSec;
+#endif
+};
+}
+
+template <typename T>
+class vtkAtomicInt: public detail::vtkAtomicIntImpl<T>
+{
+  typedef detail::vtkAtomicIntImpl<T> Superclass;
+
+public:
+  // Description:
+  // Default constructor. Not atomic.
+  vtkAtomicInt()
+    {
+    this->Value = 0;
+    }
+
+  // Description:
+  // Constructor with initialization. Not atomic.
+  vtkAtomicInt(T val)
+    {
+    this->Value = val;
+    }
+
+  // Description:
+  // Atomic pre-increment.
+  T operator++()
+    {
+    return this->Superclass::operator++();
+    }
+
+  // Description:
+  // Atomic post-increment.
+  T operator++(int)
+    {
+    return this->operator++() - 1;
+    }
+
+  // Description:
+  // Atomic pre-decrement.
+  T operator--()
+    {
+    return this->Superclass::operator--();
+    }
+
+  // Description:
+  // Atomic post-decrement.
+  T operator--(int)
+    {
+    return this->operator--() + 1;
+    }
+
+  // Description:
+  // Atomic subtraction. Returns value after.
+  T operator-=(T val)
+    {
+    return this->operator+=(-val);
+    }
+
+  // Description:
+  // Atomic load.
+  operator T() const
+    {
+    return this->load();
+    }
+
+  // Description:
+  // Atomic save.
+  T operator=(T val)
+    {
+    this->store(val);
+    return val;
+    }
+};
+
+
+#endif
+// VTK-HeaderTest-Exclude: vtkAtomicInt.h
diff --git a/Common/Core/SMP/Simple/vtkSMPThreadLocal.h.in b/Common/Core/SMP/Simple/vtkSMPThreadLocal.h.in
index 3a245ee..15fd542 100644
--- a/Common/Core/SMP/Simple/vtkSMPThreadLocal.h.in
+++ b/Common/Core/SMP/Simple/vtkSMPThreadLocal.h.in
@@ -78,7 +78,7 @@
 
 #include "vtkCommonCoreModule.h" // For export macro
 
-#include "vtkAtomicTypes.h"
+#include "vtkAtomicInt.h"
 #include "vtkSystemIncludes.h"
 #include "vtkMultiThreader.h"
 
@@ -95,7 +95,7 @@ class vtkSMPThreadLocal
 public:
   // Description:
   // Default constructor. Creates a default exemplar.
-  vtkSMPThreadLocal() : Count(0)
+  vtkSMPThreadLocal() : NumInitialized(0)
     {
       this->Initialize();
     }
@@ -104,7 +104,7 @@ public:
   // Constructor that allows the specification of an exemplar object
   // which is used when constructing objects when Local() is first called.
   // Note that a copy of the exemplar is created using its copy constructor.
-  vtkSMPThreadLocal(const T& exemplar) : Count(0), Exemplar(exemplar)
+  vtkSMPThreadLocal(const T& exemplar) : NumInitialized(0), Exemplar(exemplar)
     {
       this->Initialize();
     }
@@ -124,7 +124,7 @@ public:
         {
         this->Internal[tid] = this->Exemplar;
         this->Initialized[tid] = true;
-        ++this->Count;
+        ++this->NumInitialized;
         }
       return this->Internal[tid];
     }
@@ -133,7 +133,7 @@ public:
   // Return the number of thread local objects that have been initialized
   size_t size() const
     {
-      return this->Count.load();
+      return this->NumInitialized.load();
     }
 
   // Description:
@@ -243,7 +243,7 @@ public:
 private:
   TLS Internal;
   std::vector<unsigned char> Initialized;
-  vtkAtomicIdType Count;
+  vtkAtomicInt<size_t> NumInitialized;
   T Exemplar;
 
   void Initialize()
diff --git a/Common/Core/SMP/TBB/vtkAtomic.h.in b/Common/Core/SMP/TBB/vtkAtomic.h.in
deleted file mode 100644
index 542e42c..0000000
--- a/Common/Core/SMP/TBB/vtkAtomic.h.in
+++ /dev/null
@@ -1,238 +0,0 @@
- /*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkAtomic.h
-
-  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.
-
-=========================================================================*/
-// .NAME vtkAtomic -
-// .SECTION Description
-
-#ifndef vtkAtomic_h
-#define vtkAtomic_h
-
-#include "vtkAtomicTypeConcepts.h"
-
-#include <tbb/atomic.h>
-
-#include <cstddef>
-
-
-template <typename T> class vtkAtomic : vtk::atomic::detail::IntegralType<T>
-{
-public:
-  vtkAtomic()
-  {
-    this->Atomic = 0;
-  }
-
-  vtkAtomic(T val)
-  {
-    this->Atomic = val;
-  }
-
-  vtkAtomic(const vtkAtomic<T> &atomic)
-  {
-    this->Atomic = atomic.Atomic;
-  }
-
-  T operator++()
-  {
-    return ++this->Atomic;
-  }
-
-  T operator++(int)
-  {
-    return this->Atomic++;
-  }
-
-  T operator--()
-  {
-    return --this->Atomic;
-  }
-
-  T operator--(int)
-  {
-    return this->Atomic--;
-  }
-
-  T operator+=(T val)
-  {
-    return this->Atomic += val;
-  }
-
-  T operator-=(T val)
-  {
-    return this->Atomic -= val;
-  }
-
-  operator T() const
-  {
-    return this->Atomic;
-  }
-
-  T operator=(T val)
-  {
-    this->Atomic = val;
-    return val;
-  }
-
-  vtkAtomic<T>& operator=(const vtkAtomic<T> &atomic)
-  {
-    this->Atomic = atomic.Atomic;
-    return *this;
-  }
-
-  T load() const
-  {
-    return this->Atomic;
-  }
-
-  void store(T val)
-  {
-    this->Atomic = val;
-  }
-
-private:
-  tbb::atomic<T> Atomic;
-};
-
-
-template <typename T> class vtkAtomic<T*>
-{
-public:
-  vtkAtomic()
-  {
-    this->Atomic = 0;
-  }
-
-  vtkAtomic(T* val)
-  {
-    this->Atomic = val;
-  }
-
-  vtkAtomic(const vtkAtomic<T*> &atomic)
-  {
-    this->Atomic = atomic.Atomic;
-  }
-
-  T* operator++()
-  {
-    return ++this->Atomic;
-  }
-
-  T* operator++(int)
-  {
-    return this->Atomic++;
-  }
-
-  T* operator--()
-  {
-    return --this->Atomic;
-  }
-
-  T* operator--(int)
-  {
-    return this->Atomic--;
-  }
-
-  T* operator+=(std::ptrdiff_t val)
-  {
-    return this->Atomic += val;
-  }
-
-  T* operator-=(std::ptrdiff_t val)
-  {
-    return this->Atomic -= val;
-  }
-
-  operator T*() const
-  {
-    return this->Atomic;
-  }
-
-  T* operator=(T* val)
-  {
-    this->Atomic = val;
-    return val;
-  }
-
-  vtkAtomic<T*>& operator=(const vtkAtomic<T*> &atomic)
-  {
-    this->Atomic = atomic.Atomic;
-    return *this;
-  }
-
-  T* load() const
-  {
-    return this->Atomic;
-  }
-
-  void store(T* val)
-  {
-    this->Atomic = val;
-  }
-
-private:
-  tbb::atomic<T*> Atomic;
-};
-
-
-template <> class vtkAtomic<void*>
-{
-public:
-  vtkAtomic()
-  {
-    this->Atomic = 0;
-  }
-
-  vtkAtomic(void* val)
-  {
-    this->Atomic = val;
-  }
-
-  vtkAtomic(const vtkAtomic<void*> &atomic)
-  {
-    this->Atomic = atomic.Atomic;
-  }
-
-  operator void*() const
-  {
-    return this->Atomic;
-  }
-
-  void* operator=(void* val)
-  {
-    this->Atomic = val;
-    return val;
-  }
-
-  vtkAtomic<void*>& operator=(const vtkAtomic<void*> &atomic)
-  {
-    this->Atomic = atomic.Atomic;
-    return *this;
-  }
-
-  void* load() const
-  {
-    return this->Atomic;
-  }
-
-  void store(void* val)
-  {
-    this->Atomic = val;
-  }
-
-private:
-  tbb::atomic<void*> Atomic;
-};
-
-#endif
-// VTK-HeaderTest-Exclude: vtkAtomic.h
diff --git a/Common/Core/SMP/TBB/vtkAtomicInt.h.in b/Common/Core/SMP/TBB/vtkAtomicInt.h.in
new file mode 100644
index 0000000..15706c4
--- /dev/null
+++ b/Common/Core/SMP/TBB/vtkAtomicInt.h.in
@@ -0,0 +1,94 @@
+ /*=========================================================================
+
+  Program:   Visualization Toolkit
+  Module:    vtkAtomicInt.h
+
+  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.
+
+=========================================================================*/
+// .NAME vtkAtomicInt -
+// .SECTION Description
+
+#ifndef vtkAtomicInt_h
+#define vtkAtomicInt_h
+
+#include <tbb/atomic.h>
+
+template <typename T> class vtkAtomicInt
+{
+public:
+  vtkAtomicInt()
+    {
+      this->Atomic = 0;
+    }
+
+  vtkAtomicInt(const T val)
+    {
+      this->Atomic = val;
+    }
+
+  T operator++()
+  {
+    return ++this->Atomic;
+  }
+
+  T operator++(int)
+  {
+    return this->Atomic++;
+  }
+
+  T operator--()
+  {
+    return --this->Atomic;
+  }
+
+  T operator--(int)
+  {
+    return this->Atomic--;
+  }
+
+  T operator+=(T val)
+  {
+    return this->Atomic += val;
+  }
+
+  T operator-=(T val)
+  {
+    return this->Atomic -= val;
+  }
+
+  operator T() const
+  {
+    return this->Atomic;
+  }
+
+  T operator=(T val)
+  {
+    this->Atomic = val;
+    return val;
+  }
+
+  T load() const
+    {
+      return this->Atomic;
+    }
+
+  void store(T val)
+    {
+      this->Atomic = val;
+    }
+
+
+private:
+  tbb::atomic<T> Atomic;
+};
+
+
+#endif
+// VTK-HeaderTest-Exclude: vtkAtomicInt.h
diff --git a/Common/Core/SMP/TBB/vtkSMPThreadLocal.h.in b/Common/Core/SMP/TBB/vtkSMPThreadLocal.h.in
index 1dff00f..5ba3b54 100644
--- a/Common/Core/SMP/TBB/vtkSMPThreadLocal.h.in
+++ b/Common/Core/SMP/TBB/vtkSMPThreadLocal.h.in
@@ -73,12 +73,12 @@
 #ifndef vtkSMPThreadLocal_h
 #define vtkSMPThreadLocal_h
 
-#if defined(_MSC_VER) && _MSC_VER <= 1700
+#if _MSC_VER >= 1400 && _MSC_VER <= 1700
 #pragma warning(push)
 #pragma warning(disable : 4345)
 #endif
 #include <tbb/enumerable_thread_specific.h>
-#if defined(_MSC_VER) && _MSC_VER <= 1700
+#if _MSC_VER >= 1400 && _MSC_VER <= 1700
 #pragma warning(pop)
 #endif
 
diff --git a/Common/Core/Testing/Cxx/CMakeLists.txt b/Common/Core/Testing/Cxx/CMakeLists.txt
index cd2075e..c43ab1b 100644
--- a/Common/Core/Testing/Cxx/CMakeLists.txt
+++ b/Common/Core/Testing/Cxx/CMakeLists.txt
@@ -7,7 +7,6 @@ set(TestXMLFileOutputWindow_ARGS ${CMAKE_BINARY_DIR}/Testing/Temporary/XMLFileOu
 vtk_add_test_cxx(${vtk-module}CxxTests tests
   NO_DATA NO_VALID NO_OUTPUT
   UnitTestMath.cxx
-  TestAngularPeriodicDataArray.cxx
   TestArrayAPI.cxx
   TestArrayAPIConvenience.cxx
   TestArrayAPIDense.cxx
@@ -33,7 +32,6 @@ vtk_add_test_cxx(${vtk-module}CxxTests tests
   TestGarbageCollector.cxx
   # TestInstantiator.cxx # Have not enabled instantiators.
   TestLookupTable.cxx
-  TestLookupTableThreaded.cxx
   TestMath.cxx
   TestMinimalStandardRandomSequence.cxx
   TestNew.cxx
diff --git a/Common/Core/Testing/Cxx/TestAngularPeriodicDataArray.cxx b/Common/Core/Testing/Cxx/TestAngularPeriodicDataArray.cxx
deleted file mode 100644
index 3378635..0000000
--- a/Common/Core/Testing/Cxx/TestAngularPeriodicDataArray.cxx
+++ /dev/null
@@ -1,148 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    TestDistancePolyDataFilter.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 "vtkAngularPeriodicDataArray.h"
-#include "vtkDoubleArray.h"
-#include "vtkFloatArray.h"
-#include "vtkNew.h"
-
-#include <limits>
-
-int TestAngularPeriodicDataArray(int, char * [])
-{
-  vtkNew<vtkDoubleArray> array;
-  vtkNew<vtkFloatArray> floatArray;
-  vtkNew<vtkAngularPeriodicDataArray<double> > angularPeriodicDataArray;
-  vtkNew<vtkAngularPeriodicDataArray<float> > angularPeriodicDataArray2;
-  array->SetNumberOfComponents(3);
-  floatArray->SetNumberOfComponents(3);
-
-  double tmp[3];
-  tmp[0] = 7.77777777777;
-  tmp[1] = 12.3;
-  tmp[2] = 0.95;
-
-  array->InsertNextTuple(tmp);
-  floatArray->InsertNextTuple(tmp);
-
-  angularPeriodicDataArray->InitializeArray(array.Get());
-  angularPeriodicDataArray->SetAngle(37.8152145);
-
-  angularPeriodicDataArray2->InitializeArray(floatArray.Get());
-  angularPeriodicDataArray2->SetAngle(55.5769061);
-  angularPeriodicDataArray2->SetAxis(VTK_PERIODIC_ARRAY_AXIS_Y);
-
-  double pTmp[3];
-  angularPeriodicDataArray->GetTupleValue(0, pTmp);
-  float pTmp2[3];
-  angularPeriodicDataArray2->GetTupleValue(0, pTmp2);
-
-  double dEpsilon = std::numeric_limits<double>::epsilon() * 20.0;
-  float fEpsilon = std::numeric_limits<float>::epsilon() * 20.f;
-
-  double range[6];
-  angularPeriodicDataArray->GetRange(range, 0);
-  angularPeriodicDataArray->GetRange(range + 2, 1);
-  angularPeriodicDataArray->GetRange(range + 4, 2);
-
-  if (std::abs(pTmp[0] - 7.77777777777) >= dEpsilon ||
-      std::abs(pTmp[1] - 9.1344434349507945825) >= dEpsilon ||
-      std::abs(pTmp[2] - 8.29182990260197883) >= dEpsilon ||
-      std::abs(pTmp2[0] - 5.18041563034058) >= fEpsilon ||
-      std::abs(pTmp2[1] - 12.3) >= fEpsilon ||
-      std::abs(pTmp2[2] - -5.87874317169189) >= fEpsilon ||
-      std::abs(range[0] - 7.77777777777) >= dEpsilon ||
-      std::abs(range[2] - 9.1344434349507945825) >= dEpsilon ||
-      std::abs(range[4] - 8.29182990260197883) >= dEpsilon
-      )
-    {
-    cerr.precision(20);
-    cerr << "Error in vtkAngularPeriodicDataArray : " << endl
-         << "Double Array : " << endl << std::abs(pTmp[0] - 7.77777777777) << " "
-         << std::abs(pTmp[1] - 9.13444343495079) << " "
-         << std::abs(pTmp[2] - 8.29182990260198) << endl << "Float Array : "
-         << std::abs(pTmp2[0] - 5.180415) << " "<< std::abs(pTmp2[1] - 12.3)
-         << " " << std::abs(pTmp2[2] - -5.878743) << endl
-         << "Range : " << endl << std::abs(range[0] - 7.77777777777)
-         << std::abs(range[2] - 9.13444343495079) << " "
-         << std::abs(range[4] - 8.29182990260198) << endl
-         << "Epsilon : " << fEpsilon << " " << dEpsilon << endl;
-    return 1;
-    }
-
-
-  tmp[0] = 1.;
-  tmp[1] = 1.;
-  tmp[2] = 1.;
-  angularPeriodicDataArray2->SetCenter(tmp);
-  angularPeriodicDataArray2->GetTupleValue(0, pTmp2);
-
-  if (std::abs(pTmp2[0] - 4.7902297) >= fEpsilon ||
-      std::abs(pTmp2[1] - 12.3) >= fEpsilon ||
-      std::abs(pTmp2[2] - -4.6191568) >= fEpsilon
-     )
-    {
-    cerr << "Error in vtkAngularPeriodicDataArray : " << endl
-         << "Non Zero origin rotation : " << endl << std::abs(pTmp2[0] - 4.7902297) << " "
-         << std::abs(pTmp2[1] - 12.3) << " "
-         << std::abs(pTmp2[2] - -4.6191568) << endl;
-    return 1;
-    }
-
-  vtkNew<vtkDoubleArray> tensorArray;
-  vtkNew<vtkAngularPeriodicDataArray<double> > tensorPArray;
-
-  tensorArray->SetNumberOfComponents(9);
-
-  double tmp3[9];
-  tmp3[0] = 7.77777777777;
-  tmp3[1] = 12.3;
-  tmp3[2] = 0.95;
-  tmp3[3] = -4.325;
-  tmp3[4] = -0.00023;
-  tmp3[5] = 17.88;
-  tmp3[6] = 4030.5;
-  tmp3[7] = 1.1;
-  tmp3[8] = 19.19191919;
-
-  tensorArray->InsertNextTuple(tmp3);
-  tensorPArray->InitializeArray(tensorArray.Get());
-  tensorPArray->SetAngle(32);
-  tensorPArray->SetAxis(VTK_PERIODIC_ARRAY_AXIS_Z);
-  tensorPArray->SetCenter(tmp);
-
-  double pTmp3[9];
-  tensorPArray->GetTupleValue(0, pTmp3);
-  if (std::abs(pTmp3[0] - 2.0096597239047708783) >= dEpsilon ||
-      std::abs(pTmp3[1] - 13.555918489185591724) >= dEpsilon ||
-      std::abs(pTmp3[2] - -8.6693107531410973365) >= dEpsilon ||
-      std::abs(pTmp3[3] - -3.0690815108144087198) >= dEpsilon ||
-      std::abs(pTmp3[4] - 5.7678880538652288479) >= dEpsilon ||
-      std::abs(pTmp3[5] - 15.666523260298440334) >= dEpsilon ||
-      std::abs(pTmp3[6] - 3417.4749403678183626) >= dEpsilon ||
-      std::abs(pTmp3[7] - 2136.7724473977045818) >= dEpsilon ||
-      std::abs(pTmp3[8] - 19.19191919) >= dEpsilon)
-    {
-      cerr.precision(20);
-      cerr << "Error while rotating tensor : " << std::abs(pTmp3[0] - 2.0096597239047708783) << " " <<
-      std::abs(pTmp3[1] - 13.555918489185591724) << " " <<
-      std::abs(pTmp3[2] - -8.6693107531410973365) << " " <<
-      std::abs(pTmp3[3] - -3.0690815108144087198) << " " <<
-      std::abs(pTmp3[4] - 5.7678880538652288479) << " " <<
-      std::abs(pTmp3[5] - 15.666523260298440334) << " " <<
-      std::abs(pTmp3[6] - 3417.4749403678183626) << " " <<
-      std::abs(pTmp3[7] - 2136.7724473977045818) << " " <<
-      std::abs(pTmp3[8] - 19.19191919) << " " << dEpsilon << endl;
-    }
-  return 0;
-}
diff --git a/Common/Core/Testing/Cxx/TestAtomic.cxx b/Common/Core/Testing/Cxx/TestAtomic.cxx
index ee75bf4..7893631 100644
--- a/Common/Core/Testing/Cxx/TestAtomic.cxx
+++ b/Common/Core/Testing/Cxx/TestAtomic.cxx
@@ -1,7 +1,7 @@
 /*=========================================================================
 
   Program:   Visualization Toolkit
-  Module:    TestAtomic.cxx
+  Module:    otherArrays.cxx
 
   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
   All rights reserved.
@@ -12,27 +12,24 @@
      PURPOSE.  See the above copyright notice for more information.
 
 =========================================================================*/
-#include "vtkAtomicTypes.h"
+#include "vtkAtomicInt.h"
 #include "vtkNew.h"
 #include "vtkObjectFactory.h"
 #include "vtkMultiThreader.h"
 
-#include <algorithm>
-
 static int Total = 0;
 static vtkTypeInt64 Total64 = 0;
-static vtkAtomicInt32 TotalAtomic(0);
-static vtkAtomicInt64 TotalAtomic64(0);
+static vtkAtomicInt<vtkTypeInt32> TotalAtomic(0);
+static vtkAtomicInt<vtkTypeInt64> TotalAtomic64(0);
 static const int Target = 1000000;
-static int Values32[Target+1];
-static int Values64[Target+1];
-static unsigned long MTimeValues[Target];
+static int Values32[Target+2];
+static int Values64[Target+2];
 static int NumThreads = 5;
 
+static vtkObject* AnObject;
 
 VTK_THREAD_RETURN_TYPE MyFunction(void *)
 {
-  vtkNew<vtkObject> AnObject;
   for (int i=0; i<Target/NumThreads; i++)
     {
     Total++;
@@ -43,8 +40,10 @@ VTK_THREAD_RETURN_TYPE MyFunction(void *)
     idx = ++TotalAtomic64;
     Values64[idx] = 1;
 
+    //AnObject->Register(0);
+    //AnObject->UnRegister(0);
+
     AnObject->Modified();
-    MTimeValues[idx - 1] = AnObject->GetMTime();
     }
 
   return VTK_THREAD_RETURN_VALUE;
@@ -101,7 +100,13 @@ int TestAtomic(int, char*[])
   Total64 = 0;
   TotalAtomic64 = 0;
 
-  for (int i=0; i<=Target; i++)
+  AnObject = vtkObject::New();
+
+  //cout << AnObject->GetReferenceCount() << endl;
+
+  int beforeMTime = AnObject->GetMTime();
+
+  for (int i=0; i<Target; i++)
     {
     Values32[i] = 0;
     Values64[i] = 0;
@@ -120,7 +125,7 @@ int TestAtomic(int, char*[])
 
   // Making sure that atomic incr returned unique
   // values each time. We expect all numbers from
-  // 1 to Target to be 2.
+  // 1 to Target-1 to be 2.
   if (Values32[0] != 0)
     {
       cout << "Expecting Values32[0] to be 0. Got "
@@ -133,7 +138,7 @@ int TestAtomic(int, char*[])
            << Values64[0] << endl;
       return 1;
     }
-  for (int i=1; i<=Target; i++)
+  for (int i=1; i<Target; i++)
     {
     if (Values32[i] != 2)
       {
@@ -149,20 +154,16 @@ int TestAtomic(int, char*[])
       }
     }
 
-  unsigned long *from = MTimeValues, *to = MTimeValues + Target;
-  std::sort(from, to);
-  if (std::unique(from, to) != to)
-    {
-    cout << "Found duplicate MTime Values" << endl;
-    return 1;
-    }
-
   mt->SetSingleMethod(MyFunction4, NULL);
   mt->SingleMethodExecute();
 
   cout << Total << " " << TotalAtomic.load() << endl;
   cout << Total64 << " " << TotalAtomic64.load() << endl;
 
+  //cout << AnObject->GetReferenceCount() << endl;
+
+  cout << "MTime: " << AnObject->GetMTime() << endl;
+
   if (TotalAtomic.load() != Target)
     {
     return 1;
@@ -173,5 +174,16 @@ int TestAtomic(int, char*[])
     return 1;
     }
 
+  if (AnObject->GetReferenceCount() != 1)
+    {
+    return 1;
+    }
+
+  if ((int)AnObject->GetMTime() != Target + beforeMTime + 2)
+    {
+    return 1;
+    }
+
+  AnObject->Delete();
   return 0;
 }
diff --git a/Common/Core/Testing/Cxx/TestLookupTableThreaded.cxx b/Common/Core/Testing/Cxx/TestLookupTableThreaded.cxx
deleted file mode 100644
index 280160e..0000000
--- a/Common/Core/Testing/Cxx/TestLookupTableThreaded.cxx
+++ /dev/null
@@ -1,61 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    TestLookupTableThreaded.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 "vtkLookupTable.h"
-#include "vtkMultiThreader.h"
-#include "vtkNew.h"
-
-namespace {
-
-vtkLookupTable * lut;
-
-VTK_THREAD_RETURN_TYPE ThreadedMethod(void *)
-{
-  int numberOfValues = 25;
-  double* input = new double[numberOfValues];
-  for (int i = 0; i < numberOfValues; ++i)
-    {
-    input[i] = static_cast<double>(i);
-    }
-  unsigned char* output = new unsigned char[4*numberOfValues];
-  int inputType = VTK_DOUBLE;
-  int inputIncrement = 1;
-  int outputFormat = VTK_RGBA;
-
-  lut->MapScalarsThroughTable2(input, output, inputType, numberOfValues,
-                               inputIncrement, outputFormat);
-
-  delete[] input;
-  delete[] output;
-
-  return VTK_THREAD_RETURN_VALUE;
-}
-
-} // end anonymous namespace
-
-int TestLookupTableThreaded(int, char* [])
-{
-  lut = vtkLookupTable::New();
-  lut->SetNumberOfTableValues( 1024 );
-
-  vtkNew<vtkMultiThreader> threader;
-  threader->SetSingleMethod( ThreadedMethod, NULL );
-  threader->SetNumberOfThreads( 4 );
-  threader->SingleMethodExecute();
-
-  lut->Delete();
-
-  return EXIT_SUCCESS;
-}
diff --git a/Common/Core/Testing/Cxx/UnitTestMath.cxx b/Common/Core/Testing/Cxx/UnitTestMath.cxx
index 2d01c64..a630165 100644
--- a/Common/Core/Testing/Cxx/UnitTestMath.cxx
+++ b/Common/Core/Testing/Cxx/UnitTestMath.cxx
@@ -2108,12 +2108,6 @@ int InvertMatrix()
     }
   if (vtkMath::InvertMatrix(mat, matI, NDimension, tmp1, tmp2) == 0)
     {
-    delete [] mat;
-    delete [] orig;
-    delete [] matI;
-    delete [] ident;
-    delete [] tmp1;
-    delete [] tmp2;
     return status;
     }
   vtkMath::MultiplyMatrix(orig,
diff --git a/Common/Core/Testing/Python/CMakeLists.txt b/Common/Core/Testing/Python/CMakeLists.txt
index 7ad57f2..0cad241 100644
--- a/Common/Core/Testing/Python/CMakeLists.txt
+++ b/Common/Core/Testing/Python/CMakeLists.txt
@@ -1,9 +1,7 @@
 vtk_add_test_python(
   NO_DATA NO_VALID NO_OUTPUT
   PythonSmoke.py
-  TestArrays.py
   TestArrayArguments.py
-  TestEmptyInput.py
   TestEnums.py
   TestExecuteMethodFinalizeCrash.py
   TestGhost.py
@@ -14,7 +12,6 @@ vtk_add_test_python(
   TestOperators.py
   TestOverloads.py
   TestPointers.py
-  TestSetGet.py
   TestStrings.py
   TestSubClass.py
   TestSwigPointer.py
diff --git a/Common/Core/Testing/Python/TestArrays.py b/Common/Core/Testing/Python/TestArrays.py
deleted file mode 100755
index 9a130b0..0000000
--- a/Common/Core/Testing/Python/TestArrays.py
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/usr/bin/env python
-
-import vtk
-from vtk.util.misc import vtkGetDataRoot
-VTK_DATA_ROOT = vtkGetDataRoot()
-
-arrayType = ['Bit', 'Char', 'Double', 'Float', 'Int', 'Long', 'Short',\
- 'UnsignedChar', 'UnsignedInt', 'UnsignedLong', 'UnsignedShort']
-
-for array in arrayType:
-    print array, 'array'
-    vtkClass = 'vtk' + array + 'Array'
-    a = getattr(vtk, vtkClass)()
-    a.Allocate(1,1)
-    a.SetNumberOfComponents(3)
-    a.SetNumberOfTuples(4)
-
-    # InsertComponent
-    k = 0
-    for i in range(0, a.GetNumberOfTuples()):
-        for j in range(0, a.GetNumberOfComponents()):
-            a.InsertComponent(i, j, 1)
-            k += 1
-
-    # SetComponent
-    k = 0
-    for i in range(0, a.GetNumberOfTuples()):
-        for j in range(0, a.GetNumberOfComponents()):
-            a.SetComponent(i, j, 1)
-            k += 1
-
-    # DeepCopy
-    b = getattr(vtk, vtkClass)()
-    b.Allocate(1000, 100)
-    # force a resize
-    b.InsertComponent(2001, 0, 1)
-    b.DeepCopy(a)
-
-    # NewInstance
-    m = b.NewInstance()
-    m.UnRegister(b)
-
-    # confirm the deep copy
-    k = 0
-    for i in range(0, a.GetNumberOfTuples()):
-        for j in range(0, a.GetNumberOfComponents()):
-            if a.GetComponent(i, j) != b.GetComponent(i, j):
-                s = '%s: bad component %d, %d' % (array, i, j)
-                print s
-            k += 1
-
-    b.InsertComponent(2001, 0, 1)
-    b.Resize(3000)
-
-    a.Squeeze()
-    a.Initialize()
-
-    a = None
-    b = None
-
-exit()
diff --git a/Common/Core/Testing/Python/TestEmptyInput.py b/Common/Core/Testing/Python/TestEmptyInput.py
deleted file mode 100755
index 9a7d777..0000000
--- a/Common/Core/Testing/Python/TestEmptyInput.py
+++ /dev/null
@@ -1,535 +0,0 @@
-#!/usr/bin/env python
-
-import sys
-import inspect
-import re
-import optparse
-
-import vtk
-from pydoc import classname
-
-'''
-   This is a translation from the TCL code of the same name.
-   The original TCL code uses catch {...}
-   catch returns 1 if an error occurred an 0 if no error.
-   In this code TryUpdate(), TryShutdown(), TrySetInputData and
-   TestOne() emulate this by returning False if an error occurred
-   and True if no error occurred.
-'''
-vtk.vtkObject.GlobalWarningDisplayOff()
-
-def RedirectVTKMessages():
-    """ Can be used to redirect VTK related error messages to a
-    file."""
-    log = vtk.vtkFileOutputWindow()
-    log.SetFlush(1)
-    log.AppendOff()
-    log.SetFileName('TestEmptyInput-err.log')
-    log.SetInstance(log)
-
-
-commonExceptions = set([
-"vtkDistributedDataFilter",  # core dump
-"vtkDataEncoder",  # Use after free error.
-"vtkWebApplication",  # Thread issues - calls vtkDataEncoder
-
- # These give an HDF5 no file name error.
-"vtkAMRFlashParticlesReader",
-"vtkAMREnzoParticlesReader",
-"vtkAMRFlashReader"
-])
-
-classLinuxExceptions = set([
-"vtkAMREnzoReader"  # core dump
-])
-
-# In the case of Windows, these classes cause a crash.
-classWindowsExceptions = set([
-"vtkWin32VideoSource",  # Update() works the first time but a subsequent run calls up the webcam which crashes on close.
-
-"vtkCMLMoleculeReader",
-"vtkCPExodusIIInSituReader",
-"vtkMINCImageWriter",
-"vtkQtInitialization"
-])
-
-classExceptions = set()
-
-emptyPD = vtk.vtkPolyData()
-emptyID = vtk.vtkImageData()
-emptySG = vtk.vtkStructuredGrid()
-emptyUG = vtk.vtkUnstructuredGrid()
-emptyRG = vtk.vtkRectilinearGrid()
-
-# This will hold the classes to be tested.
-vtkClasses = set()
-classNames = None
-classesTested = set()
-
-# Keep a record of the classes tested.
-nonexistentClasses = set()
-abstractClasses = set()
-noConcreteImplementation = set()
-noShutdown = set()
-noObserver = set()
-# Is a vtkAlgorithm but EmptyInput failed.
-isVtkAlgorithm = set()
-emptyInputWorked = set()
-emptyInputFailed = set()
-#------------------------
-# These variables are used for further record keeping
-# should users wish to investigate or debug further.
-noUpdate = set()
-noSetInput = set()
-
-# A dictionary consisting of a key and five booleans corresponding to
-# whether SetInput() using emptyPD, emptyID, emptySG, emptyUG, emptyRG
-# worked.
-inputStatus = dict()
-
-# A dictionary consisting of a key and five booleans corresponding to
-# whether Update() using emptyPD, emptyID, emptySG, emptyUG, emptyRG
-# worked if SetInput() worked.
-updateStatus = dict()
-#-----------------------
-
-# Controls the verbosity of the output.
-verbose = False
-
-
-class ErrorObserver:
-   '''
-   See: http://public.kitware.com/pipermail/vtkusers/2012-June/074703.html
-   '''
-   def __init__(self):
-       self.__ErrorOccurred = False
-       self.__ErrorMessage = None
-       self.CallDataType = 'string0'
-
-   def __call__(self, obj, event, message):
-       self.__ErrorOccurred = True
-       self.__ErrorMessage = message
-
-   def ErrorOccurred(self):
-       occ = self.__ErrorOccurred
-       self.__ErrorOccurred = False
-       return occ
-
-   def ErrorMessage(self):
-       return self.__ErrorMessage
-
-def GetVTKClasses():
-    '''
-    :return: a set of all the VTK classes.
-    '''
-    # This pattern will get the name and type of the member in the vtk classes.
-    pattern = r'\<vtkclass (.*)\.(.*)\>'
-    regEx = re.compile(pattern)
-    vtkClasses = inspect.getmembers(
-                    vtk, inspect.isclass and not inspect.isabstract)
-    res = set()
-    for name, obj in vtkClasses:
-            result = re.match(regEx, repr(obj))
-            if result:
-                res.add(result.group(2))
-    return res
-
-def GetVTKClassGroups(vtkClasses, subStr):
-    '''
-    :param: vtkClasses - the set of VTK classes
-    :param: subStr - the substring for the VTK class to match e.g Readers
-    :return: a set of all the VTK classes that are readers.
-    '''
-    res = set()
-    for obj in list(vtkClasses):
-            if obj.find(subStr) > -1:
-                res.add(obj)
-    return res
-
-def FilterClasses(allClasses, filter):
-    '''
-    :param: vtkCLasses - the set of VTK classes
-    :param: filters - a list of substrings of classes to be removed
-    :return: a set of all the VTK classes that do not have the substrings
-     in their names.
-    '''
-    res = allClasses
-    for f in filter:
-        c = GetVTKClassGroups(allClasses, f)
-        res = res - c
-    return res
-
-def TryUpdate(b, e):
-    '''
-    The method Update() is tried on the instantiated class.
-
-    Some classes do not have an Update method, if this is the case,
-    Python will generate an AttributeError, in this case, the name
-    of the class is stored in the global variable noUpdate and false
-    is returned.
-
-    If an error occurs on Update() then the error handler
-    will be triggered and in this case false is returned.
-
-    :param: b - the class on which Update() will be tried.
-    :param: e - the error handler.
-    :return: True if the update was successful, False otherwise.
-    '''
-    try:
-        b.Update()
-        if e.ErrorOccurred():
-            return False
-        else:
-            return True
-    except AttributeError:
-        # No Update() method
-        noUpdate.add(b.GetClassName())
-        return False
-    except:
-        raise
-
-def TryShutdown(b, e):
-    '''
-    The method Shutdown() is tried on the instantiated class.
-
-    Some classes do not have an Shutdown method, if this is the case,
-    Python will generate an AttributeError, in this case, the name
-    of the class is stored in the global variable noUpdate and False
-    is returned.
-
-    If an error occurs on Shutdown() then the error handler
-    will be triggered and in this case False is returned.
-
-    :param: b - the class on which Shutdown() will be tried.
-    :param: e - the error handler.
-    :return: True if the update was successful, False otherwise.
-    '''
-    try:
-        b.Shutdown()
-        if e.ErrorOccurred():
-            return False
-        else:
-            return True
-    except AttributeError:
-        # No Shutdown() method
-        noShutdown.add(b.GetClassName())
-        return False
-    except:
-        raise
-
-def TrySetInputData(b, e, d):
-    '''
-    The method SetInputData() is tried on the instantiated class.
-
-    Some classes do not have an SetInputData method, if this is the case,
-    Python will generate an AttributeError, in this case, the name
-    of the class is stored in the global variable noUpdate and False
-    is returned.
-
-    If an error occurs on SetInputData() then the error handler
-    will be triggered and in this case False is returned.
-
-    :param: b - the class on which SetInputData() will be tried.
-    :param: e - the error handler.
-    :param: d - input data.
-    :return: True if the update was successful, False otherwise.
-    '''
-    try:
-        b.SetInputData(d)
-        if e.ErrorOccurred():
-            return False
-        else:
-            return True
-    except AttributeError:
-        # No SetInputData() method
-        noSetInput.add(b.GetClassName())
-        return False
-    except:
-        raise
-
-def TestOne(cname):
-    '''
-    Test the named class.
-
-    Some classes will generate a TypeError or an AttributeError,
-    in this case, the name of the class is stored in the global variable
-    abstractClasses or noConcreteImplementation with False being returned.
-
-    Return values:
-    0: If not any of the SetInput() tests and the corresponding
-             Update() are both true.
-    1: If at least one of SetInput() tests and the corresponding
-             Update() are both true.
-    2: No observer could be added.
-    3: If it is an abstract class.
-    4: No concrete implementation.
-    5: Class does not exist.
-
-    :param: cname - the name of the class to be tested.
-    :return: One of the above return values.
-    '''
-    try:
-        b = getattr(vtk, cname)()
-        e = ErrorObserver()
-        isAlgorithm = False
-        # A record of whether b.SetInput() worked or not.
-        # The indexing corresponds to using
-        # emptyPD, emptyID, emptySG, emptyUG, emptyRG in SetInput()
-        iStatus = [False, False, False, False, False]
-        # A record of whether b.Update() worked or not.
-        # The indexing corresponds to:
-        # [emptyPD, emptyID, emptySG, emptyUG, emptyRG]
-        uStatus = [False, False, False, False, False]
-        try:
-            b.AddObserver('ErrorEvent', e)
-        except AttributeError:
-            noObserver.add(cname)
-            return 2
-        except:
-            raise
-        if b.IsA("vtkAlgorithm"):
-            u = TryUpdate(b, e)
-            if u:
-                isAlgorithm = True
-
-        if TrySetInputData(b, e, emptyPD):
-            iStatus[0] = True
-            u = TryUpdate(b, e)
-            if u:
-                uStatus[0] = True
-
-        if TrySetInputData(b, e, emptyID):
-            iStatus[1] = True
-            u = TryUpdate(b, e)
-            if u:
-                uStatus[1] = True
-
-        if TrySetInputData(b, e, emptySG):
-            iStatus[2] = True
-            u = TryUpdate(b, e)
-            if u:
-                uStatus[2] = True
-
-        if TrySetInputData(b, e, emptyUG):
-            iStatus[3] = True
-            u = TryUpdate(b, e)
-            if u:
-                uStatus[3] = True
-
-        if TrySetInputData(b, e, emptyRG):
-            iStatus[4] = True
-            u = TryUpdate(b, e)
-            if u:
-                uStatus[4] = True
-
-        # If thread creation moves away from the vtkGeoSource constructor, then
-        # this ShutDown call will not be necessary...
-        #
-        if b.IsA("vtkGeoSource"):
-            TryShutdown(b, e)
-
-        inputStatus[cname] = iStatus
-        updateStatus[cname] = uStatus
-        ok = False
-        # We require input and update to work for success.
-        mergeStatus = map(lambda pair: pair[0] & pair[1], zip(iStatus, uStatus))
-        for value in mergeStatus:
-            ok |= value
-        if not(ok) and isAlgorithm:
-                isVtkAlgorithm.add(cname)
-        if ok:
-            emptyInputWorked.add(cname)
-        else:
-            emptyInputFailed.add(cname)
-        b = None
-        if ok:
-             return 1
-        return 0
-    except TypeError:
-        # Trapping abstract classes.
-        abstractClasses.add(cname)
-        return 3
-    except NotImplementedError:
-        # No concrete implementation
-        noConcreteImplementation.add(cname)
-        return 4
-    except AttributeError:
-        # Class does not exist
-        nonexistentClasses.add(cname)
-        return 5
-    except:
-        raise
-
-def TestEmptyInput(batch, batchNo=0, batchSize=0):
-    '''
-    Test each class in batch for empty input.
-
-    :param: batch - the set of classes to be tested.
-    :param: batchNo - if the set of classes is a subgroup then this
-                     is the index of the subgroup.
-    :param: batchSize - if the set of classes is a subgroup then this
-                     is the size of the subgroup.
-    '''
-    baseIdx = batchNo * batchSize
-    idx = baseIdx
-    for a in batch:
-        batchIdx = idx - baseIdx
-        # res = " Testing -- {:4d} - {:s}".format(idx,a)
-        # There is no format method in Python 2.5
-        res = " Testing -- %4d - %s" % (idx, a)
-        if (batchIdx < len(batch) - 1):
-            # nextRes = " Next -- {:4d} - {:s}".format(idx + 1,list(batch)[batchIdx +1])
-            nextRes = " Next -- %4d - %s" % (idx + 1, list(batch)[batchIdx + 1])
-        else:
-            nextRes = "No next"
-#         if verbose:
-#             print res, nextRes
-        classesTested.add(a)
-        ok = TestOne(a)
-        if ok == 0:
-            if verbose:
-                print res + ' - Fail'
-        elif ok == 1:
-            if verbose:
-                print res + ' - Ok'
-        elif ok == 2:
-            if verbose:
-                print res + ' - no observer could be added.'
-        elif ok == 3:
-            if verbose:
-                print res + ' - is Abstract'
-        elif ok == 4:
-            if verbose:
-                print res + ' - No concrete implementation'
-        elif ok == 5:
-            if verbose:
-                print res + ' - Does not exist'
-        else:
-            if verbose:
-                print res + ' - Unknown status'
-        idx += 1
-
-def BatchTest(vtkClasses, batchNo, batchSize):
-    '''
-    Batch the classes into groups of batchSize.
-
-    :param: batchNo - if the set of classes is a subgroup then this
-                     is the index of the subgroup.
-    :param: batchSize - if the set of classes is a subgroup then this
-                     is the size of the subgroup.
-    '''
-    idx = 0
-    total = 0;
-    batch = set()
-    for a in vtkClasses:
-        currentBatchNo = idx // batchSize;
-        if currentBatchNo == batchNo:
-            batch.add(a)
-            total += 1
-            if total == batchSize:
-                TestEmptyInput(batch, batchNo, batchSize)
-                print total
-                batch = set()
-                total = 0
-        idx += 1
-    if batch:
-        TestEmptyInput(batch, batchNo, batchSize)
-        print total
-
-def PrintResultSummary():
-    print '-' * 40
-    print 'Empty Input worked:', len(emptyInputWorked)
-    print 'Empty Input failed:', len(emptyInputFailed)
-    print 'Abstract classes: ', len(abstractClasses)
-    print 'Non-existent classes: ', len(nonexistentClasses)
-    print 'No concrete implementation: ', len(noConcreteImplementation)
-    print 'No observer could be added: ', len(noObserver)
-    print '-' * 40
-    print 'Total number of classes tested: ', len(classesTested)  # , classesTested
-    print '-' * 40
-    print 'Excluded from testing: ', len(classExceptions)
-    print '-' * 40
-
-def ProgramOptions():
-    desc = """
-    %prog Tests each VTK class for empty input using various data structures.
-    """
-    parser = optparse.OptionParser(description=desc)
-    parser.set_defaults(verbose=False)
-
-    parser.add_option('-c', '--classnames',
-        help='The name of the class or a list of classes in quotes separated by commas.',
-        type='string',
-        dest='classnames',
-        default=None,
-        action='store')
-    parser.add_option('-q', '--quiet',
-        help='Do not print status messages to stdout (default)',
-        dest='verbose',
-        action="store_false")
-    parser.add_option('-v', '--verbose',
-        help='Print status messages to stdout',
-        dest='verbose',
-        action="store_true")
-
-    (opts, args) = parser.parse_args()
-
-    return (True, opts)
-
-def CheckPythonVersion(ver):
-    '''
-    Check the Python version.
-
-    :param: ver - the minimum required version number as hexadecimal.
-    :return: True if if the Python version is greater than or equal to ver.
-    '''
-    if sys.hexversion < ver:
-        return False
-    return True
-
-def main(argv=None):
-    if not CheckPythonVersion(0x02060000):
-        print 'This program requires Python 2.6 or greater.'
-        return
-
-    global classExceptions
-    global vtkClasses
-    global classNames
-    global verbose
-
-    if argv is None:
-        argv = sys.argv
-
-    (res, opts) = ProgramOptions()
-    if opts.classnames:
-        cn = [x.strip() for x in opts.classnames.split(',')]
-        classNames = set(cn)
-    if opts.verbose:
-        verbose = opts.verbose
-
-    print 'CTEST_FULL_OUTPUT (Avoid ctest truncation of output)'
-
-    # RedirectVTKMessages()
-    if classNames:
-        TestEmptyInput(classNames)
-    else:
-        classExceptions = commonExceptions.union(classLinuxExceptions)
-        classExceptions = classExceptions.union(classWindowsExceptions)
-
-        vtkClasses = GetVTKClasses()
-#         filter = ['Reader', 'Writer', 'Array_I', 'Qt']
-#         vtkClasses = FilterClasses(vtkClasses, filter)
-        vtkClasses = vtkClasses - classExceptions
-        TestEmptyInput(vtkClasses)
-#         In Windows
-#         0-10, 10-17, 17-18, 18-23 in steps of 100 work but not if called
-#         in a loop.
-#         intervals = [[18,20]]# [[0,10]], [10,17], [17,18], [18,20]]
-#         for j in intervals:
-#             for i in range(j[0],j[1]):
-#                 BatchTest(vtkClasses, i, 100)
-
-    PrintResultSummary()
-
-if __name__ == '__main__':
-    sys.exit(main())
diff --git a/Common/Core/Testing/Python/TestSetGet.py b/Common/Core/Testing/Python/TestSetGet.py
deleted file mode 100755
index d975b4e..0000000
--- a/Common/Core/Testing/Python/TestSetGet.py
+++ /dev/null
@@ -1,444 +0,0 @@
-#!/usr/bin/env python
-
-import sys
-import inspect
-import re
-import optparse
-
-import vtk
-from pydoc import classname
-
-'''
-   This is a translation from the TCL code of the same name.
-'''
-vtk.vtkObject.GlobalWarningDisplayOff()
-
-def RedirectVTKMessages():
-    '''
-    Can be used to redirect VTK related error messages to a
-    file.
-    '''
-    log = vtk.vtkFileOutputWindow()
-    log.SetFlush(1)
-    log.AppendOff()
-    log.SetFileName('TestSetGet-err.log')
-    log.SetInstance(log)
-
-
-commonExceptions = set([
-"vtkDistributedDataFilter",  # core dump
-"vtkDataEncoder",  # Use after free error.
-"vtkWebApplication",  # Thread issues - calls vtkDataEncoder
-"vtkView",  # vtkView.SetRepresentation(None) fails
-
-"vtkGenericAttributeCollection",  # Assert error
-"vtkOverlappingAMR",
-
- # These give an HDF5 no file name error.
-"vtkAMRFlashParticlesReader",
-"vtkAMREnzoParticlesReader",
-"vtkAMRFlashReader",
-
-# core dump in release mode, issue is vtkChartMatrix.GetChart() & vtkScatterPlotMatrix.SetActivePlot()
-"vtkChartMatrix",
-"vtkScatterPlotMatrix"
-])
-
-classLinuxExceptions = set([
-"vtkAMREnzoReader"  # core dump
-])
-
-# In the case of Windows, these classes cause a crash.
-classWindowsExceptions = set([
-"vtkWin32VideoSource",  # Update() works the first time but a subsequent run calls up the webcam which crashes on close.
-
-"vtkCMLMoleculeReader",
-"vtkCPExodusIIInSituReader",
-"vtkMINCImageWriter",
-"vtkQtInitialization"
-])
-
-classExceptions = set()
-
-# This will hold the classes to be tested.
-vtkClasses = set()
-classNames = None
-classesTested = set()
-
-# Keep a record of the classes tested.
-nonexistentClasses = set()
-abstractClasses = set()
-noConcreteImplementation = set()
-noObserver = set()
-setGetWorked = set()
-setGetFailed = set()
-
-#------------------------
-# These variables are used for further record keeping
-# should users wish to investigate or debug further.
-noGetSetPairs = set()
-# These will be a list of the get/set functions keyed on class name.
-getParameterFail = dict()
-setParameterFail = dict()
-#------------------------
-
-# Controls the verbosity of the output.
-verbose = False
-
-
-class ErrorObserver:
-   '''
-   See: http://public.kitware.com/pipermail/vtkusers/2012-June/074703.html
-   '''
-   def __init__(self):
-       self.__ErrorOccurred = False
-       self.__ErrorMessage = None
-       self.CallDataType = 'string0'
-
-   def __call__(self, obj, event, message):
-       self.__ErrorOccurred = True
-       self.__ErrorMessage = message
-
-   def ErrorOccurred(self):
-       occ = self.__ErrorOccurred
-       self.__ErrorOccurred = False
-       return occ
-
-   def ErrorMessage(self):
-       return self.__ErrorMessage
-
-def GetVTKClasses():
-    '''
-    :return: a set of all the VTK classes.
-    '''
-    # This pattern will get the name and type of the member in the vtk classes.
-    pattern = r'\<vtkclass (.*)\.(.*)\>'
-    regEx = re.compile(pattern)
-    vtkClasses = inspect.getmembers(
-                    vtk, inspect.isclass and not inspect.isabstract)
-    res = set()
-    for name, obj in vtkClasses:
-            result = re.match(regEx, repr(obj))
-            if result:
-                res.add(result.group(2))
-    return res
-
-def GetVTKClassGroups(vtkClasses, subStr):
-    '''
-    :param: vtkClasses - the set of VTK classes
-    :param: subStr - the substring for the VTK class to match e.g Readers
-    :return: a set of all the VTK classes that are e.g. Readers.
-    '''
-    res = set()
-    for obj in list(vtkClasses):
-            if obj.find(subStr) > -1:
-                res.add(obj)
-    return res
-
-def FilterClasses(allClasses, filter):
-    '''
-    :param: vtkCLasses - the set of VTK classes
-    :param: filters - a list of substrings of classes to be removed
-    :return: a set of all the VTK classes that do not have the substrings
-     in their names.
-    '''
-    res = allClasses
-    for f in filter:
-        c = GetVTKClassGroups(allClasses, f)
-        res = res - c
-    return res
-
-def TestOne(cname):
-    '''
-    Test the named class looking for complementary Set/Get pairs to test.
-
-    The test is essentially this: Set(Get()).
-
-    Some classes will generate a TypeError or an AttributeError,
-    in this case, the name of the class is stored in the global variable
-    abstractClasses or noConcreteImplementation with False being returned.
-
-    If Set... or Get... fails a record of this is kept in the global classes:
-    setParameterFail and getParameterFail
-
-    Return values:
-    0: If not any of the Set(Get()) tests work.
-    1: If at least one of Set(Get()) tests works.
-    2: No observer could be added.
-    3: If it is an abstract class.
-    4: No concrete implementation.
-    5: Class does not exist.
-
-    :param: cname - the name of the class to be tested.
-    :return: One of the above return values.
-    '''
-    try:
-        b = getattr(vtk, cname)()
-        e = ErrorObserver()
-        try:
-            b.AddObserver('ErrorEvent', e)
-        except AttributeError:
-            noObserver.add(cname)
-            return 2
-        except:
-            raise
-
-        getPattern = r'(^Set(.*)$)'
-        getRegEx = re.compile(getPattern)
-        setPattern = r'(^Get(.*)$)'
-        setRegEx = re.compile(setPattern)
-
-        methods = [method for method in dir(getattr(vtk, cname))
-                    if callable(getattr(getattr(vtk, cname), method))]
-        # Partition the Set/Get functions into separate sets.
-        gets = set()
-        sets = set()
-        for m in methods:
-            result = re.match(getRegEx, m)
-            if result:
-                gets.add(result.group(2))
-            result = re.match(setRegEx, m)
-            if result:
-                sets.add(result.group(2))
-
-        ok = False
-        # These are our Set... Get... functions.
-        matchingGetSet = set.intersection(gets, sets)
-        setGetStatus = False
-        if matchingGetSet:
-            for m in set.intersection(gets, sets):
-                # Get...() with no parameters.
-                try:
-                    x = getattr(b, 'Get' + m)()
-                    try:
-                        if type(x) is tuple:
-                            x = list(x)
-                            getattr(b, 'Set' + m)(*x)
-                        else:
-                            getattr(b, 'Set' + m)(x)
-                        setGetStatus |= True
-                    except TypeError:
-                        # The parameter passed is of the wrong type
-                        # or wrong number of parameters.
-                        try:
-                            value = setParameterFail[cname]
-                            value.add('Set' + m)
-                            setParameterFail[cname] = value
-                        except KeyError:
-                            # Key is not present
-                            setParameterFail[cname] = set(['Set' + m])
-                    except Exception, err:
-                        print cname, 'Set' + m, err
-                except TypeError:
-                    # Get...() takes 1 or more arguments.
-                    try:
-                        value = getParameterFail[cname]
-                        value.add('Get' + m)
-                        getParameterFail[cname] = value
-                    except KeyError:
-                        # Key is not present
-                        getParameterFail[cname] = set(['Get' + m])
-                except Exception, err:
-                    print cname, 'Get' + m, err
-            ok = setGetStatus
-        else:
-            noGetSetPairs.add(cname)
-
-        b = None
-        if ok:
-            setGetWorked.add(cname)
-            return 1
-        setGetFailed.add(cname)
-        return 0
-    except TypeError:
-        # Trapping abstract classes.
-        abstractClasses.add(cname)
-        return 3
-    except NotImplementedError:
-        # No concrete implementation
-        noConcreteImplementation.add(cname)
-        return 4
-    except AttributeError:
-        # Class does not exist
-        nonexistentClasses.add(cname)
-        return 5
-    except:
-        raise
-
-def TestSetGet(batch, batchNo=0, batchSize=0):
-    '''
-    Test Set/Get pairs in each batch.
-
-    If at least one of the Set(Get()) tests pass, the name of the
-    class is added to the global variable setGetWorked otherwise
-    to the global variable setGetFailed.
-
-    :param: batch - the set of classes to be tested.
-    :param: batchNo - if the set of classes is a subgroup then this
-                     is the index of the subgroup.
-    :param: batchSize - if the set of classes is a subgroup then this
-                     is the size of the subgroup.
-    '''
-    baseIdx = batchNo * batchSize
-    idx = baseIdx
-    for a in batch:
-        batchIdx = idx - baseIdx
-        # res = " Testing -- {:4d} - {:s}".format(idx,a)
-        # There is no format method in Python 2.5
-        res = " Testing -- %4d - %s" % (idx, a)
-        if (batchIdx < len(batch) - 1):
-            # nextRes = " Next -- {:4d} - {:s}".format(idx + 1,list(batch)[batchIdx +1])
-            nextRes = " Next -- %4d - %s" % (idx + 1, list(batch)[batchIdx + 1])
-        else:
-            nextRes = "No next"
-#         if verbose:
-#             print res, nextRes
-        classesTested.add(a)
-        ok = TestOne(a)
-        if ok == 0:
-            if verbose:
-                print res + ' - Fail'
-        elif ok == 1:
-            if verbose:
-                print res + ' - Ok'
-        elif ok == 2:
-            if verbose:
-                print res + ' - no observer could be added.'
-        elif ok == 3:
-            if verbose:
-                print res + ' - is Abstract'
-        elif ok == 4:
-            if verbose:
-                print res + ' - No concrete implementation'
-        elif ok == 5:
-            if verbose:
-                print res + ' - Does not exist'
-        else:
-            if verbose:
-                print res + ' - Unknown status'
-        idx += 1
-#        print nextRes
-
-def BatchTest(vtkClasses, batchNo, batchSize):
-    '''
-    Batch the classes into groups of batchSize.
-
-    :param: batchNo - if the set of classes is a subgroup then this
-                     is the index of the subgroup.
-    :param: batchSize - if the set of classes is a subgroup then this
-                     is the size of the subgroup.
-    '''
-    idx = 0
-    total = 0;
-    batch = set()
-    for a in vtkClasses:
-        currentBatchNo = idx // batchSize;
-        if currentBatchNo == batchNo:
-            batch.add(a)
-            total += 1
-            if total == batchSize:
-                TestSetGet(batch, batchNo, batchSize)
-                batch = set()
-                total = 0
-        idx += 1
-    if batch:
-        TestSetGet(batch, batchNo, batchSize)
-
-def PrintResultSummary():
-    print '-' * 40
-    print 'Set(Get()) worked:', len(setGetWorked)
-    print 'Set(Get()) failed:', len(setGetFailed)
-    print 'Abstract classes: ', len(abstractClasses)
-    print 'Non-existent classes: ', len(nonexistentClasses)
-    print 'No concrete implementation: ', len(noConcreteImplementation)
-    print 'No observer could be added: ', len(noObserver)
-    print '-' * 40
-    print 'Total number of classes tested: ', len(classesTested)
-    print '-' * 40
-    print 'Excluded from testing: ', len(classExceptions)
-    print '-' * 40
-
-def ProgramOptions():
-    desc = """
-    %prog Tests each VTK class for Set(Get()) where Get() has no parameters.
-    """
-    parser = optparse.OptionParser(description=desc)
-    parser.set_defaults(verbose=False)
-
-    parser.add_option('-c', '--classnames',
-        help='The name of the class or a list of classes in quotes separated by commas.',
-        type='string',
-        dest='classnames',
-        default=None,
-        action='store')
-    parser.add_option('-q', '--quiet',
-        help='Do not print status messages to stdout (default)',
-        dest='verbose',
-        action="store_false")
-    parser.add_option('-v', '--verbose',
-        help='Print status messages to stdout',
-        dest='verbose',
-        action="store_true")
-
-    (opts, args) = parser.parse_args()
-
-    return (True, opts)
-
-def CheckPythonVersion(ver):
-    '''
-    Check the Python version.
-
-    :param: ver - the minimum required version number as hexadecimal.
-    :return: True if if the Python version is greater than or equal to ver.
-    '''
-    if sys.hexversion < ver:
-        return False
-    return True
-
-def main(argv=None):
-    if not CheckPythonVersion(0x02060000):
-        print 'This program requires Python 2.6 or greater.'
-        return
-
-    global classExceptions
-    global vtkClasses
-    global classNames
-    global verbose
-
-    if argv is None:
-        argv = sys.argv
-
-    (res, opts) = ProgramOptions()
-    if opts.classnames:
-        cn = [x.strip() for x in opts.classnames.split(',')]
-        classNames = set(cn)
-    if opts.verbose:
-        verbose = opts.verbose
-
-    print 'CTEST_FULL_OUTPUT (Avoid ctest truncation of output)'
-
-    # RedirectVTKMessages()
-    if classNames:
-        TestSetGet(classNames)
-    else:
-        classExceptions = commonExceptions.union(classLinuxExceptions)
-        classExceptions = classExceptions.union(classWindowsExceptions)
-
-        vtkClasses = GetVTKClasses()
-#         filter = ['Reader', 'Writer', 'Array_I', 'Qt']
-#         vtkClasses = FilterClasses(vtkClasses, filter)
-        vtkClasses = vtkClasses - classExceptions
-        TestSetGet(vtkClasses)
-#         In Windows
-#         0-10, 10-17, 17-18, 18-23 in steps of 100 work but not if called
-#         in a loop.
-#         intervals = [[0,10]]  # [[0,10]], [10,17], [17,18], [18,20]]
-#         for j in intervals:
-#             for i in range(j[0], j[1]):
-#                 BatchTest(vtkClasses, i, 100)
-#                 print vtkClasses
-
-    PrintResultSummary()
-
-if __name__ == '__main__':
-    sys.exit(main())
diff --git a/Common/Core/Testing/Tcl/CMakeLists.txt b/Common/Core/Testing/Tcl/CMakeLists.txt
index 5c0c1a4..b80f52e 100644
--- a/Common/Core/Testing/Tcl/CMakeLists.txt
+++ b/Common/Core/Testing/Tcl/CMakeLists.txt
@@ -1,8 +1,8 @@
 vtk_add_test_tcl(
   NO_DATA NO_RT
   TestArrays.tcl
-#  TestEmptyInput.tcl
-#  TestSetGet.tcl
+  TestEmptyInput.tcl
+  TestSetGet.tcl
   TestString.tcl
   TestIgnoreBTX.tcl
   otherInterp.tcl
diff --git a/Common/Core/vtkAbstractArray.h b/Common/Core/vtkAbstractArray.h
index df6a537..f9c9f13 100644
--- a/Common/Core/vtkAbstractArray.h
+++ b/Common/Core/vtkAbstractArray.h
@@ -240,10 +240,7 @@ public:
   // Description:
   // Reset to an empty state, without freeing any memory.
   void Reset()
-    {
-      this->MaxId = -1;
-      this->DataChanged();
-    }
+    {this->MaxId = -1;}
 
   // Description:
   // Return the size of the data.
@@ -273,7 +270,7 @@ public:
   virtual void ExportToVoidPointer(void *vtkNotUsed(out_ptr)) {}
 
   // Description:
-  // Return the memory in kibibytes (1024 bytes) consumed by this data array. Used to
+  // Return the memory in kilobytes consumed by this data array. Used to
   // support streaming and reading/writing data. The value returned is
   // guaranteed to be greater than or equal to the memory required to
   // actually represent the data represented by this object. The
diff --git a/Common/Core/vtkAngularPeriodicDataArray.h b/Common/Core/vtkAngularPeriodicDataArray.h
deleted file mode 100644
index 4c4d5e9..0000000
--- a/Common/Core/vtkAngularPeriodicDataArray.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkAngularPeriodicDataArray.h
-
-  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.
-
-=========================================================================*/
-
-// .NAME vtkAngularPeriodicDataArray - Map native an Array into an angulat
-// periodic array
-//
-// .SECTION Description
-// Map an array into a periodic array. Data from the original array aare
-// rotated (on the fly) by the specified angle along the specified axis
-// around the specified point. Lookup is not implemented.
-// Creating the array is virtually free, accessing a tuple require some
-// computation.
-
-#ifndef vtkAngularPeriodicDataArray_h
-#define vtkAngularPeriodicDataArray_h
-
-#include "vtkPeriodicDataArray.h"   // Parent
-
-#define VTK_PERIODIC_ARRAY_AXIS_X 0
-#define VTK_PERIODIC_ARRAY_AXIS_Y 1
-#define VTK_PERIODIC_ARRAY_AXIS_Z 2
-
-class vtkMatrix3x3;
-
-template <class Scalar>
-class vtkAngularPeriodicDataArray: public vtkPeriodicDataArray<Scalar>
-{
-public:
-  vtkMappedDataArrayNewInstanceMacro(vtkAngularPeriodicDataArray<Scalar>);
-  static vtkAngularPeriodicDataArray *New();
-  virtual void PrintSelf(ostream &os, vtkIndent indent);
-
-  // Description:
-  // Set/Get the rotation angle in degrees. Default is 0.
-  void SetAngle(double angle);
-  vtkGetMacro(Angle, double);
-
-  // Description:
-  // Set/Get the rotation center. Default is 0,0,0.
-  void SetCenter(double* center);
-  vtkGetVector3Macro(Center, double);
-
-  // Description:
-  // Set/Get the rotation axis. Default is VTK_PERIODIC_ARRAY_AXIS_X axis.
-  void SetAxis(int axis);
-  vtkGetMacro(Axis, int);
-  void SetAxisToX(void) { this->SetAxisType(VTK_PERIODIC_ARRAY_AXIS_X); }
-  void SetAxisToY(void) { this->SetAxisType(VTK_PERIODIC_ARRAY_AXIS_Y); }
-  void SetAxisToZ(void) { this->SetAxisType(VTK_PERIODIC_ARRAY_AXIS_Z); }
-
-protected:
-  vtkAngularPeriodicDataArray();
-  ~vtkAngularPeriodicDataArray();
-
-  // Description:
-  // Transform the provided tuple
-  virtual void Transform(Scalar* tuple);
-
-  // Description:
-  // Update rotation matrix from Axis, Angle and Center
-  void UpdateRotationMatrix();
-
-private:
-  vtkAngularPeriodicDataArray(const vtkAngularPeriodicDataArray &); // Not implemented.
-  void operator=(const vtkAngularPeriodicDataArray &); // Not implemented.
-
-  double Angle;            // Rotation angle in degrees
-  double AngleInRadians;   // Rotation angle in radians
-  double Center[3];        // Rotation center
-  int Axis;                // Rotation Axis
-
-  vtkMatrix3x3* RotationMatrix;
-};
-
-#include "vtkAngularPeriodicDataArray.txx"
-
-#endif //vtkAngularPeriodicDataArray_h
-// VTK-HeaderTest-Exclude: vtkAngularPeriodicDataArray.h
diff --git a/Common/Core/vtkAngularPeriodicDataArray.txx b/Common/Core/vtkAngularPeriodicDataArray.txx
deleted file mode 100644
index c7e4069..0000000
--- a/Common/Core/vtkAngularPeriodicDataArray.txx
+++ /dev/null
@@ -1,160 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkAngularPeriodicDataArray.txx
-
-  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 "vtkMath.h"
-#include "vtkMatrix3x3.h"
-#include "vtkObjectFactory.h"
-
-#include <algorithm>
-
-//------------------------------------------------------------------------------
-// Can't use vtkStandardNewMacro on a templated class.
-template <class Scalar> vtkAngularPeriodicDataArray<Scalar>*
-vtkAngularPeriodicDataArray<Scalar>::New()
-{
-  VTK_STANDARD_NEW_BODY(vtkAngularPeriodicDataArray<Scalar>);
-}
-
-//------------------------------------------------------------------------------
-template <class Scalar> void vtkAngularPeriodicDataArray<Scalar>
-::PrintSelf(ostream &os, vtkIndent indent)
-{
-  this->vtkAngularPeriodicDataArray<Scalar>::Superclass::PrintSelf(os, indent);
-  os << indent << "Axis: " << this->Axis << "\n";
-  os << indent << "Angle: " << this->Angle << "\n";
-  os << indent << "Center: " <<
-    this->Center[0] << " " << this->Center[1] << " " << this->Center[2] << "\n";
-}
-
-//------------------------------------------------------------------------------
-template <class Scalar> void vtkAngularPeriodicDataArray<Scalar>::
-SetAngle(double angle)
-{
-  if (this->Angle != angle)
-    {
-    this->Angle = angle;
-    this->AngleInRadians = vtkMath::RadiansFromDegrees(angle);
-    this->InvalidateRange();
-    this->UpdateRotationMatrix();
-    this->Modified();
-    }
-}
-
-//------------------------------------------------------------------------------
-template <class Scalar> void vtkAngularPeriodicDataArray<Scalar>::
-SetAxis(int axis)
-{
-  if (this->Axis != axis)
-    {
-    this->Axis = axis;
-    this->InvalidateRange();
-    this->UpdateRotationMatrix();
-    this->Modified();
-    }
-}
-
-//------------------------------------------------------------------------------
-template <class Scalar> void vtkAngularPeriodicDataArray<Scalar>::
-SetCenter(double* center)
-{
-  if (center)
-    {
-    bool diff = false;
-    for (int i = 0; i < 3; i++)
-      {
-      if (this->Center[i] != center[i])
-        {
-        this->Center[i] = center[i];
-        diff = true;
-        }
-      }
-    if (diff)
-      {
-      this->InvalidateRange();
-      this->Modified();
-      }
-    }
-}
-
-//------------------------------------------------------------------------------
-template <class Scalar> void vtkAngularPeriodicDataArray<Scalar>::
-Transform(Scalar* pos)
-{
-  if (this->NumberOfComponents == 3)
-    {
-    // Axis rotation
-    int axis0 = (this->Axis + 1) % this->NumberOfComponents;
-    int axis1 = (this->Axis + 2) % this->NumberOfComponents;
-    double posx = static_cast<double>(pos[axis0]) - this->Center[axis0];
-    double posy = static_cast<double>(pos[axis1]) - this->Center[axis1];
-
-    pos[axis0] = this->Center[axis0] +
-      static_cast<Scalar>(cos(this->AngleInRadians) * posx - sin(this->AngleInRadians) * posy);
-    pos[axis1] = this->Center[axis1] +
-      static_cast<Scalar>(sin(this->AngleInRadians) * posx + cos(this->AngleInRadians) * posy);
-    if (this->Normalize)
-      {
-      vtkMath::Normalize(pos);
-      }
-    }
-  else if (this->NumberOfComponents == 9)
-    {
-    // Template type force a copy to a double array for tensor
-    double localPos [9];
-    double tmpMat [9];
-    double tmpMat2 [9];
-    std::copy(pos, pos + 9, localPos);
-    vtkMatrix3x3::Transpose(this->RotationMatrix->GetData(), tmpMat);
-    vtkMatrix3x3::Multiply3x3(this->RotationMatrix->GetData(), localPos, tmpMat2);
-    vtkMatrix3x3::Multiply3x3(tmpMat2, tmpMat, localPos);
-    std::copy(localPos, localPos + 9, pos);
-    }
-}
-
-//------------------------------------------------------------------------------
-template <class Scalar> void vtkAngularPeriodicDataArray<Scalar>::
-UpdateRotationMatrix()
-{
-  int axis0 = (this->Axis + 1) % 3;
-  int axis1 = (this->Axis + 2) % 3;
-  this->RotationMatrix->Identity();
-  this->RotationMatrix->SetElement(this->Axis, this->Axis, 1.);
-  this->RotationMatrix->SetElement(axis0, axis0, cos(this->AngleInRadians));
-  this->RotationMatrix->SetElement(axis0, axis1, -sin(this->AngleInRadians));
-  this->RotationMatrix->SetElement(axis1, axis0, sin(this->AngleInRadians));
-  this->RotationMatrix->SetElement(axis1, axis1, cos(this->AngleInRadians));
-}
-
-//------------------------------------------------------------------------------
-template <class Scalar> vtkAngularPeriodicDataArray<Scalar>
-::vtkAngularPeriodicDataArray()
-{
-  this->Axis = VTK_PERIODIC_ARRAY_AXIS_X;
-  this->Angle = 0.0;
-  this->AngleInRadians = 0.0;
-  this->Center[0] = 0.0;
-  this->Center[1] = 0.0;
-  this->Center[2] = 0.0;
-
-  this->RotationMatrix = vtkMatrix3x3::New();
-  this->RotationMatrix->Identity();
-}
-
-//------------------------------------------------------------------------------
-template <class Scalar> vtkAngularPeriodicDataArray<Scalar>
-::~vtkAngularPeriodicDataArray()
-{
-  this->RotationMatrix->Delete();
-}
diff --git a/Common/Core/vtkAtomicTypeConcepts.h b/Common/Core/vtkAtomicTypeConcepts.h
deleted file mode 100644
index fa1d3bc..0000000
--- a/Common/Core/vtkAtomicTypeConcepts.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkAtomicTypeConcepts.h
-
-  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 <limits>
-
-namespace vtk
-{
-namespace atomic
-{
-namespace detail
-{
-
-template <bool> struct CompileTimeCheck;
-template <> struct CompileTimeCheck<true> {};
-
-template <typename T> struct IntegralType
-{
-  CompileTimeCheck<std::numeric_limits<T>::is_specialized &&
-                   std::numeric_limits<T>::is_integer &&
-                   (sizeof(T) == 4 || sizeof(T) == 8)> c;
-};
-
-} // detail
-} // atomic
-} // vtk
-// VTK-HeaderTest-Exclude: vtkAtomicTypeConcepts.h
diff --git a/Common/Core/vtkAtomicTypes.h b/Common/Core/vtkAtomicTypes.h
deleted file mode 100644
index 6b9b9ab..0000000
--- a/Common/Core/vtkAtomicTypes.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkAtomicTypes.h
-
-  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.
-
-=========================================================================*/
-#ifndef vtkAtomicTypes_h
-#define vtkAtomicTypes_h
-
-#include "vtkAtomic.h"
-#include "vtkType.h"
-
-typedef vtkAtomic<vtkTypeInt32> vtkAtomicInt32;
-typedef vtkAtomic<vtkTypeUInt32> vtkAtomicUInt32;
-typedef vtkAtomic<vtkTypeInt64> vtkAtomicInt64;
-typedef vtkAtomic<vtkTypeUInt64> vtkAtomicUInt64;
-typedef vtkAtomic<vtkIdType> vtkAtomicIdType;
-
-#endif
-// VTK-HeaderTest-Exclude: vtkAtomicTypes.h
diff --git a/Common/Core/vtkBitArray.cxx b/Common/Core/vtkBitArray.cxx
index 2dd4b6c..8cad9de 100644
--- a/Common/Core/vtkBitArray.cxx
+++ b/Common/Core/vtkBitArray.cxx
@@ -61,7 +61,7 @@ vtkBitArray::vtkBitArray()
 //----------------------------------------------------------------------------
 vtkBitArray::~vtkBitArray()
 {
-  if (!this->SaveUserArray)
+  if ((this->Array) && (!this->SaveUserArray))
     {
     delete [] this->Array;
     }
@@ -131,7 +131,7 @@ int vtkBitArray::Allocate(vtkIdType sz, vtkIdType vtkNotUsed(ext))
 {
   if ( sz > this->Size )
     {
-    if (!this->SaveUserArray)
+    if (( this->Array != NULL ) && (!this->SaveUserArray))
       {
       delete [] this->Array;
       }
@@ -153,7 +153,7 @@ int vtkBitArray::Allocate(vtkIdType sz, vtkIdType vtkNotUsed(ext))
 // Release storage and reset array to initial state.
 void vtkBitArray::Initialize()
 {
-  if (!this->SaveUserArray)
+  if (( this->Array != NULL ) && (!this->SaveUserArray))
     {
     delete [] this->Array;
     }
@@ -191,7 +191,7 @@ void vtkBitArray::DeepCopy(vtkDataArray *ia)
 
   if ( this != ia )
     {
-    if (!this->SaveUserArray)
+    if ((this->Array) && (!this->SaveUserArray))
       {
       delete [] this->Array;
       }
diff --git a/Common/Core/vtkBitArray.h b/Common/Core/vtkBitArray.h
index 0db9887..732dbb1 100644
--- a/Common/Core/vtkBitArray.h
+++ b/Common/Core/vtkBitArray.h
@@ -280,10 +280,7 @@ inline void vtkBitArray::InsertValue(vtkIdType id, int i)
 {
   if ( id >= this->Size )
     {
-    if (!this->ResizeAndExtend(id+1))
-      {
-      return;
-      }
+    this->ResizeAndExtend(id+1);
     }
   if (i)
     {
diff --git a/Common/Core/vtkByteSwap.cxx b/Common/Core/vtkByteSwap.cxx
index 101f97d..c0df3d1 100644
--- a/Common/Core/vtkByteSwap.cxx
+++ b/Common/Core/vtkByteSwap.cxx
@@ -245,11 +245,11 @@ VTK_BYTE_SWAP_IMPL(unsigned char)
 VTK_BYTE_SWAP_IMPL(unsigned short)
 VTK_BYTE_SWAP_IMPL(unsigned int)
 VTK_BYTE_SWAP_IMPL(unsigned long)
-#if defined(VTK_TYPE_USE_LONG_LONG)
+#if defined(VTK_IMPL_USE_LONG_LONG)
 VTK_BYTE_SWAP_IMPL(long long)
 VTK_BYTE_SWAP_IMPL(unsigned long long)
 #endif
-#if defined(VTK_TYPE_USE___INT64)
+#if defined(VTK_IMPL_USE___INT64)
 VTK_BYTE_SWAP_IMPL(__int64)
 VTK_BYTE_SWAP_IMPL(unsigned __int64)
 #endif
diff --git a/Common/Core/vtkByteSwap.h b/Common/Core/vtkByteSwap.h
index c42b55a..1e43e28 100644
--- a/Common/Core/vtkByteSwap.h
+++ b/Common/Core/vtkByteSwap.h
@@ -54,11 +54,11 @@ public:
   VTK_BYTE_SWAP_DECL(unsigned short);
   VTK_BYTE_SWAP_DECL(unsigned int);
   VTK_BYTE_SWAP_DECL(unsigned long);
-#if defined(VTK_TYPE_USE_LONG_LONG)
+#if defined(VTK_DECL_USE_LONG_LONG)
   VTK_BYTE_SWAP_DECL(long long);
   VTK_BYTE_SWAP_DECL(unsigned long long);
 #endif
-#if defined(VTK_TYPE_USE___INT64)
+#if defined(VTK_DECL_USE___INT64)
   VTK_BYTE_SWAP_DECL(__int64);
   VTK_BYTE_SWAP_DECL(unsigned __int64);
 #endif
diff --git a/Common/Core/vtkConfigure.h.in b/Common/Core/vtkConfigure.h.in
index 0ad88d4..215ef46 100644
--- a/Common/Core/vtkConfigure.h.in
+++ b/Common/Core/vtkConfigure.h.in
@@ -186,17 +186,12 @@
    typedef long long vtkIOStreamSLL;
    typedef unsigned long long vtkIOStreamULL;
 # endif
-#endif
-
-/* The maximum length of a file name in bytes including the
- * terminating null.
- */
-#if defined(PATH_MAX) // Usually defined on Windows
-# define VTK_MAXPATH PATH_MAX
-#elif defined(MAXPATHLEN)  // Usually defined on linux
-# define VTK_MAXPATH MAXPATHLEN
-#else
-# define VTK_MAXPATH 32767 // Possible with Windows "extended paths"
+#elif defined(VTK_SIZEOF___INT64)
+# if defined(_MSC_VER) && (_MSC_VER < 1300)
+#  define VTK_IOSTREAM_NEED_OPERATORS_LL
+   typedef __int64 vtkIOStreamSLL;
+   typedef unsigned __int64 vtkIOStreamULL;
+# endif
 #endif
 
 #endif
diff --git a/Common/Core/vtkDataArray.cxx b/Common/Core/vtkDataArray.cxx
index f9230b8..a151e97 100644
--- a/Common/Core/vtkDataArray.cxx
+++ b/Common/Core/vtkDataArray.cxx
@@ -885,7 +885,7 @@ unsigned long vtkDataArray::GetActualMemorySize()
 
   size = vtkDataArray::GetDataTypeSize(this->GetDataType());
 
-  // kibibytes
+  // kilobytes
   return static_cast<unsigned long>(ceil((size*static_cast<double>(numPrims)
                                            )/1024.0));
 }
diff --git a/Common/Core/vtkDataArray.h b/Common/Core/vtkDataArray.h
index 6162270..ec25045 100644
--- a/Common/Core/vtkDataArray.h
+++ b/Common/Core/vtkDataArray.h
@@ -41,7 +41,6 @@ class vtkDoubleArray;
 class vtkIdList;
 class vtkInformationDoubleVectorKey;
 class vtkLookupTable;
-class vtkPoints;
 
 class VTKCOMMONCORE_EXPORT vtkDataArray : public vtkAbstractArray
 {
@@ -276,7 +275,7 @@ public:
   virtual void* WriteVoidPointer(vtkIdType id, vtkIdType number) = 0;
 
   // Description:
-  // Return the memory in kibibytes (1024 bytes) consumed by this data array. Used to
+  // Return the memory in kilobytes consumed by this data array. Used to
   // support streaming and reading/writing data. The value returned is
   // guaranteed to be greater than or equal to the memory required to
   // actually represent the data represented by this object. The
@@ -396,9 +395,6 @@ public:
   virtual int GetArrayType() { return DataArray; }
 
 protected:
-
-  friend class vtkPoints;
-
   // Description:
   // Compute the range for a specific component. If comp is set -1
   // then L2 norm is computed on all components. Call ClearRange
diff --git a/Common/Core/vtkDataArrayIteratorMacro.h b/Common/Core/vtkDataArrayIteratorMacro.h
index 58b1946..079fd7e 100644
--- a/Common/Core/vtkDataArrayIteratorMacro.h
+++ b/Common/Core/vtkDataArrayIteratorMacro.h
@@ -79,7 +79,7 @@
 #include "vtkDataArrayTemplate.h" // For all classes referred to in the macro
 #include "vtkSetGet.h" // For vtkTemplateMacro
 
-// Silence 'unused typedef' warnings on GCC.
+// Silence 'unused typedef' warnings on newer GCC.
 // use of the typedef in question depends on the macro
 // argument _call and thus should not be removed.
 #if defined(__GNUC__)
diff --git a/Common/Core/vtkDataArrayPrivate.txx b/Common/Core/vtkDataArrayPrivate.txx
index 283ae47..8c12569 100644
--- a/Common/Core/vtkDataArrayPrivate.txx
+++ b/Common/Core/vtkDataArrayPrivate.txx
@@ -29,21 +29,16 @@ namespace msvc
 // Those min and max functions replace std ones because their
 // implementation used to generate very slow code with MSVC.
 // See https://randomascii.wordpress.com/2013/11/24/stdmin-causing-three-times-slowdown-on-vc/
-// The comparison expression in min/max are written so that if the "condition" is false,
-// the "left" value is returned. This is consistent with STL's implementations
-// and also handles the cases where the right value may be a NaN properly.
-// All code using these methods should ensure that the "left" value is never
-// NaN.
 template <class ValueType>
 ValueType max(const ValueType& left, const ValueType& right)
 {
-  return right > left ? right : left;
+  return left > right ? left : right;
 }
 
 template <class ValueType>
 ValueType min(const ValueType& left, const ValueType& right)
 {
-  return right <= left ? right : left;
+  return left <= right ? left : right;
 }
 }
 #endif
@@ -79,8 +74,8 @@ struct ComputeScalarRange
       {
       for(int i = 0, j = 0; i < NumComps; ++i, j+=2)
         {
-        tempRange[j] = detail::min(tempRange[j], value[i]);
-        tempRange[j+1] = detail::max(tempRange[j+1], value[i]);
+        tempRange[j] = detail::min(value[i], tempRange[j]);
+        tempRange[j+1] = detail::max(value[i], tempRange[j+1]);
         }
       }
 
@@ -169,8 +164,8 @@ bool DoComputeScalarRange(InputIteratorType begin, InputIteratorType end,
       {
       for(int i = 0, j = 0; i < numComp; ++i, j+=2)
         {
-        tempRange[j] = detail::min(tempRange[j], value[i]);
-        tempRange[j+1] = detail::max(tempRange[j+1], value[i]);
+        tempRange[j] = detail::min(value[i], tempRange[j]);
+        tempRange[j+1] = detail::max(value[i], tempRange[j+1]);
         }
       }
 
@@ -215,8 +210,8 @@ bool DoComputeVectorRange(InputIteratorType begin, InputIteratorType end,
       const double t = static_cast<double>(value[i]);
       squaredSum += t * t;
       }
-    range[0] = detail::min(range[0], squaredSum);
-    range[1] = detail::max(range[1], squaredSum);
+    range[0] = detail::min(squaredSum, range[0]);
+    range[1] = detail::max(squaredSum, range[1]);
     }
 
   //now that we have computed the smallest and largest value, take the
diff --git a/Common/Core/vtkDataArrayTemplate.txx b/Common/Core/vtkDataArrayTemplate.txx
index dbf8402..a64ee4f 100644
--- a/Common/Core/vtkDataArrayTemplate.txx
+++ b/Common/Core/vtkDataArrayTemplate.txx
@@ -190,14 +190,15 @@ void vtkDataArrayTemplate<T>::PrintSelf(ostream& os, vtkIndent indent)
 template <typename T> vtkDataArrayTemplate<T> *
 vtkDataArrayTemplate<T>::FastDownCast(vtkAbstractArray *src)
 {
-  if ((src->GetArrayType() == vtkAbstractArray::DataArrayTemplate) &&
-      (src->GetDataType() == vtkTypeTraits<ValueType>::VTK_TYPE_ID))
+  switch (src->GetArrayType())
     {
-    return static_cast<vtkDataArrayTemplate<ValueType>*>(src);
-    }
-  else
-    {
-    return NULL;
+    case vtkAbstractArray::DataArrayTemplate:
+      if (src->GetDataType() == vtkTypeTraits<ValueType>::VTK_TYPE_ID)
+        {
+        return static_cast<vtkDataArrayTemplate<ValueType>*>(src);
+        }
+    default:
+      return NULL;
     }
 }
 
diff --git a/Common/Core/vtkGarbageCollector.cxx b/Common/Core/vtkGarbageCollector.cxx
index 8f0335b..920175d 100644
--- a/Common/Core/vtkGarbageCollector.cxx
+++ b/Common/Core/vtkGarbageCollector.cxx
@@ -60,9 +60,9 @@ static vtkGarbageCollectorSingleton* vtkGarbageCollectorSingletonInstance;
 //----------------------------------------------------------------------------
 // Global debug setting.  This flag specifies whether a collector
 // should print debugging output.  This must be default initialized to
-// false by the compiler and is therefore not initialized here.  The
+// zero by the compiler and is therefore not initialized here.  The
 // ClassInitialize and ClassFinalize methods handle it.
-static bool vtkGarbageCollectorGlobalDebugFlag;
+static int vtkGarbageCollectorGlobalDebugFlag;
 
 //----------------------------------------------------------------------------
 // The thread identifier of the main thread.  Delayed garbage
@@ -93,13 +93,13 @@ void vtkGarbageCollector::PrintSelf(ostream& os, vtkIndent indent)
 }
 
 //----------------------------------------------------------------------------
-void vtkGarbageCollector::SetGlobalDebugFlag(bool flag)
+void vtkGarbageCollector::SetGlobalDebugFlag(int flag)
 {
   vtkGarbageCollectorGlobalDebugFlag = flag;
 }
 
 //----------------------------------------------------------------------------
-bool vtkGarbageCollector::GetGlobalDebugFlag()
+int vtkGarbageCollector::GetGlobalDebugFlag()
 {
   return vtkGarbageCollectorGlobalDebugFlag;
 }
@@ -439,7 +439,7 @@ vtkGarbageCollectorImpl::~vtkGarbageCollectorImpl()
   this->Visited.clear();
 
   // Disable debugging to avoid destruction message.
-  this->SetDebug(false);
+  this->SetDebug(0);
 }
 
 //----------------------------------------------------------------------------
@@ -844,7 +844,7 @@ void vtkGarbageCollectorImpl::FlushEntryReferences(Entry* e)
 void vtkGarbageCollector::ClassInitialize()
 {
   // Set default debugging state.
-  vtkGarbageCollectorGlobalDebugFlag = false;
+  vtkGarbageCollectorGlobalDebugFlag = 0;
 
   // Record the id of the main thread.
   vtkGarbageCollectorMainThread = vtkMultiThreader::GetCurrentThreadID();
diff --git a/Common/Core/vtkGarbageCollector.h b/Common/Core/vtkGarbageCollector.h
index 225ebc1..e44dddb 100644
--- a/Common/Core/vtkGarbageCollector.h
+++ b/Common/Core/vtkGarbageCollector.h
@@ -131,10 +131,10 @@ public:
   static void DeferredCollectionPop();
 
   // Description:
-  // Set/Get global garbage collection debugging flag.  When set to true,
+  // Set/Get global garbage collection debugging flag.  When set to 1,
   // all garbage collection checks will produce debugging information.
-  static void SetGlobalDebugFlag(bool flag);
-  static bool GetGlobalDebugFlag();
+  static void SetGlobalDebugFlag(int flag);
+  static int GetGlobalDebugFlag();
 
 protected:
   vtkGarbageCollector();
diff --git a/Common/Core/vtkIdList.h b/Common/Core/vtkIdList.h
index 154ab8b..f34c11c 100644
--- a/Common/Core/vtkIdList.h
+++ b/Common/Core/vtkIdList.h
@@ -152,10 +152,7 @@ inline vtkIdType vtkIdList::InsertNextId(const vtkIdType vtkid)
 {
   if ( this->NumberOfIds >= this->Size )
     {
-    if (!this->Resize(this->NumberOfIds+1))
-      {
-      return this->NumberOfIds-1;
-      }
+    this->Resize(this->NumberOfIds+1);
     }
   this->Ids[this->NumberOfIds++] = vtkid;
   return this->NumberOfIds-1;
diff --git a/Common/Core/vtkIntArray.h b/Common/Core/vtkIntArray.h
index b2df8c3..ef54c46 100644
--- a/Common/Core/vtkIntArray.h
+++ b/Common/Core/vtkIntArray.h
@@ -17,10 +17,6 @@
 // vtkIntArray is an array of values of type int.  It provides
 // methods for insertion and retrieval of values and will
 // automatically resize itself to hold new data.
-//
-// The C++ standard does not define the exact size of the int type, so use
-// of this type directly is discouraged.  If an array of 32 bit integers is
-// needed, prefer vtkTypeInt32Array to this class.
 
 #ifndef vtkIntArray_h
 #define vtkIntArray_h
diff --git a/Common/Core/vtkLargeInteger.cxx b/Common/Core/vtkLargeInteger.cxx
index 017fb9f..518c512 100644
--- a/Common/Core/vtkLargeInteger.cxx
+++ b/Common/Core/vtkLargeInteger.cxx
@@ -387,7 +387,7 @@ int vtkLargeInteger::operator<(const vtkLargeInteger& n) const
 {
     if (this->Negative & !n.Negative) // try to make judgement using signs
         return 1;
-    else if ((!this->Negative) & n.Negative)
+    else if (!this->Negative & n.Negative)
         return 0;
     else if (this->Negative)
         return !this->IsSmaller(n);
diff --git a/Common/Core/vtkLongArray.h b/Common/Core/vtkLongArray.h
index cb470c4..84977e2 100644
--- a/Common/Core/vtkLongArray.h
+++ b/Common/Core/vtkLongArray.h
@@ -17,11 +17,6 @@
 // vtkLongArray is an array of values of type long.  It provides
 // methods for insertion and retrieval of values and will
 // automatically resize itself to hold new data.
-//
-// The C++ standard does not define the exact size of the long type, so use
-// of this type directly is discouraged.  If an array of 32 bit integers is
-// needed, prefer vtkTypeInt32Array to this class.  If an array of 64 bit
-// integers is needed, prefer vtkTypeInt64Array to this class.
 
 #ifndef vtkLongArray_h
 #define vtkLongArray_h
diff --git a/Common/Core/vtkLongLongArray.h b/Common/Core/vtkLongLongArray.h
index 155fc48..cae2a16 100644
--- a/Common/Core/vtkLongLongArray.h
+++ b/Common/Core/vtkLongLongArray.h
@@ -17,10 +17,6 @@
 // vtkLongLongArray is an array of values of type long long.
 // It provides methods for insertion and retrieval of values and will
 // automatically resize itself to hold new data.
-//
-// This class should not be used directly, as it only exists on systems
-// where the long long type is defined.  If you need a 64 bit integer
-// data array, use vtkTypeInt64Array instead.
 
 #ifndef vtkLongLongArray_h
 #define vtkLongLongArray_h
diff --git a/Common/Core/vtkLookupTable.cxx b/Common/Core/vtkLookupTable.cxx
index f003a0c..53d9663 100644
--- a/Common/Core/vtkLookupTable.cxx
+++ b/Common/Core/vtkLookupTable.cxx
@@ -102,8 +102,8 @@ int vtkLookupTable::IsOpaque()
     if (this->NanColor[3] < 1.0) { opaque = 0; }
     if (this->UseBelowRangeColor && this->BelowRangeColor[3] < 1.0) { opaque = 0; }
     if (this->UseAboveRangeColor && this->AboveRangeColor[3] < 1.0) { opaque = 0; }
-    vtkIdType size=this->Table->GetNumberOfTuples();
-    vtkIdType i=0;
+    int size=this->Table->GetNumberOfTuples();
+    int i=0;
     unsigned char *ptr=this->Table->GetPointer(0);
     while(opaque && i<size)
       {
@@ -195,11 +195,12 @@ int vtkLookupTable::Allocate(int sz, int ext)
 // Force the lookup table to rebuild
 void vtkLookupTable::ForceBuild()
 {
+  int i;
   double hue, sat, val, hinc, sinc, vinc, ainc;
   double rgba[4], alpha;
   unsigned char *c_rgba;
 
-  vtkIdType maxIndex = this->NumberOfColors - 1;
+  int maxIndex = this->NumberOfColors - 1;
 
   if( maxIndex )
     {
@@ -213,7 +214,7 @@ void vtkLookupTable::ForceBuild()
     hinc = sinc = vinc = ainc = 0.0;
     }
 
-  for (vtkIdType i = 0; i <= maxIndex; i++)
+  for (i = 0; i <= maxIndex; i++)
     {
     hue = this->HueRange[0] + i*hinc;
     sat = this->SaturationRange[0] + i*sinc;
@@ -569,7 +570,6 @@ void vtkLookupTable::SetTable(vtkUnsignedCharArray *table)
     this->Table = table;
     this->Table->Register(this);
     this->NumberOfColors = this->Table->GetNumberOfTuples();
-    this->ResizeTableForSpecialColors();
 
     // If InsertTime is not modified the array will be rebuilt.  So we
     // use the same approach that the SetTableValue function does.
@@ -641,8 +641,8 @@ namespace {
 
 //----------------------------------------------------------------------------
 template<class T>
-void vtkLookupTableMapData(vtkLookupTable *self,
-                           T *input, unsigned char *output, int length,
+void vtkLookupTableMapData(vtkLookupTable *self, T *input,
+                           unsigned char *output, int length,
                            int inIncr, int outFormat, TableParameters & p)
 {
   int i = length;
@@ -654,10 +654,14 @@ void vtkLookupTableMapData(vtkLookupTable *self,
   // end. When this function is called repeatedly with the same size
   // lookup table, memory reallocation will be done only one the first
   // call if at all.
-
   vtkUnsignedCharArray* lookupTable = self->GetTable();
   vtkIdType numberOfColors = lookupTable->GetNumberOfTuples();
-
+  vtkIdType neededSize = (numberOfColors + vtkLookupTable::NUMBER_OF_SPECIAL_COLORS) *
+    lookupTable->GetNumberOfComponents();
+  if (lookupTable->GetSize() < neededSize)
+    {
+    lookupTable->Resize(numberOfColors + vtkLookupTable::NUMBER_OF_SPECIAL_COLORS);
+    }
   unsigned char* table = lookupTable->GetPointer(0);
 
   // Writing directly to the memory location instead of adding them
@@ -1155,7 +1159,8 @@ void vtkLookupTable::MapScalarsThroughTable2(void *input,
           {
           newInput->SetValue(i, bitArray->GetValue(id));
           }
-        vtkLookupTableMapData(this, static_cast<unsigned char*>(newInput->GetPointer(0)),
+        vtkLookupTableMapData(this,
+                              static_cast<unsigned char*>(newInput->GetPointer(0)),
                               output, numberOfValues,
                               inputIncrement, outputFormat, p);
         newInput->Delete();
@@ -1164,7 +1169,7 @@ void vtkLookupTable::MapScalarsThroughTable2(void *input,
         break;
 
       vtkTemplateMacro(
-        vtkLookupTableMapData(this, static_cast<VTK_TT*>(input),output,
+        vtkLookupTableMapData(this,static_cast<VTK_TT*>(input),output,
                               numberOfValues, inputIncrement, outputFormat, p)
         );
       default:
@@ -1187,7 +1192,6 @@ void vtkLookupTable::SetNumberOfTableValues(vtkIdType number)
     }
   this->Modified();
   this->NumberOfColors = number;
-  this->ResizeTableForSpecialColors();
   this->Table->SetNumberOfTuples(number);
 }
 
@@ -1350,7 +1354,6 @@ void vtkLookupTable::DeepCopy(vtkScalarsToColors *obj)
     this->NanColor[i] = lut->NanColor[i];
     }
   this->Table->DeepCopy(lut->Table);
-  this->ResizeTableForSpecialColors();
 
   this->Superclass::DeepCopy(obj);
 }
@@ -1372,13 +1375,3 @@ void vtkLookupTable::GetIndexedColor(vtkIdType idx, double rgba[4])
     }
   this->GetNanColor(rgba);
 }
-
-//----------------------------------------------------------------------------
-void vtkLookupTable::ResizeTableForSpecialColors()
-{
-  vtkIdType neededColors = this->NumberOfColors + vtkLookupTable::NUMBER_OF_SPECIAL_COLORS;
-  if (this->Table->GetSize() < neededColors*this->Table->GetNumberOfComponents())
-    {
-    this->Table->Resize(neededColors);
-    }
-}
diff --git a/Common/Core/vtkLookupTable.h b/Common/Core/vtkLookupTable.h
index a07b6e2..f233c85 100644
--- a/Common/Core/vtkLookupTable.h
+++ b/Common/Core/vtkLookupTable.h
@@ -359,10 +359,6 @@ protected:
   int OpaqueFlag;
   vtkTimeStamp OpaqueFlagBuildTime;
 
-  // Description:
-  // Resize the LookupTable to have enough room for the out-of-range colors
-  void ResizeTableForSpecialColors();
-
 private:
   vtkLookupTable(const vtkLookupTable&);  // Not implemented.
   void operator=(const vtkLookupTable&);  // Not implemented.
@@ -377,3 +373,6 @@ inline unsigned char *vtkLookupTable::WritePointer(const vtkIdType id,
 }
 
 #endif
+
+
+
diff --git a/Common/Core/vtkMath.cxx b/Common/Core/vtkMath.cxx
index babefa8..0a66460 100644
--- a/Common/Core/vtkMath.cxx
+++ b/Common/Core/vtkMath.cxx
@@ -27,11 +27,9 @@
 #include "vtkDataArray.h"
 #include <cassert>
 #include <cmath>
-#include <vector>
 
 #include "vtkBoxMuellerRandomSequence.h"
 #include "vtkMinimalStandardRandomSequence.h"
-#include "vtkTypeTraits.h"
 
 vtkStandardNewMacro(vtkMath);
 
@@ -42,7 +40,6 @@ public:
   ~vtkMathInternal();
   vtkMinimalStandardRandomSequence *Uniform;
   vtkBoxMuellerRandomSequence *Gaussian;
-  std::vector<vtkTypeInt64> MemoizeFactorial;
 };
 
 vtkMathInternal::vtkMathInternal()
@@ -54,7 +51,6 @@ vtkMathInternal::vtkMathInternal()
   this->Uniform=static_cast<vtkMinimalStandardRandomSequence *>(
     this->Gaussian->GetUniformSequence());
   this->Uniform->SetSeedOnly(1177); // One authors home address
-  this->MemoizeFactorial.resize(21, 0);
 }
 
 vtkMathInternal::~vtkMathInternal()
@@ -187,30 +183,6 @@ double vtkMath::Gaussian( double mean, double std )
 }
 
 //----------------------------------------------------------------------------
-vtkTypeInt64 vtkMath::Factorial( int N )
-{
-  if (N > 20)
-    {
-    vtkGenericWarningMacro("Factorial(" << N << ") would overflow.");
-    return vtkTypeTraits<vtkTypeInt64>::Max();
-    }
-
-  if (N == 0)
-    {
-    return 1;
-    }
-
-  if (vtkMath::Internal.MemoizeFactorial[N] != 0)
-    {
-    return vtkMath::Internal.MemoizeFactorial[N];
-    }
-
-  vtkTypeInt64 r = vtkMath::Factorial(N - 1) * N;
-  vtkMath::Internal.MemoizeFactorial[N] = r;
-  return r;
-}
-
-//----------------------------------------------------------------------------
 // The number of combinations of n objects from a pool of m objects (m>n).
 //
 vtkTypeInt64 vtkMath::Binomial( int m, int n )
@@ -593,7 +565,7 @@ void vtkMath::LUSolveLinearSystem(double **A, int *index,
         sum -= A[i][j]*x[j];
         }
       }
-    else if (sum != 0.0)
+    else if (sum)
       {
       ii = i;
       }
@@ -3170,3 +3142,21 @@ bool vtkMath::IsFinite(double x)
   return !vtkMath::IsNan(x) && !vtkMath::IsInf(x);
 }
 #endif
+
+#ifndef VTK_LEGACY_REMOVE
+//-----------------------------------------------------------------------------
+double vtkMath::DoublePi()
+{
+  VTK_LEGACY_REPLACED_BODY(vtkMath::DoublePi, "VTK 6.0", vtkMath::Pi);
+  return vtkMath::Pi();
+}
+#endif
+
+#ifndef VTK_LEGACY_REMOVE
+//-----------------------------------------------------------------------------
+double vtkMath::DoubleTwoPi()
+{
+  VTK_LEGACY_BODY(vtkMath::DoubleTwoPi, "VTK 6.0");
+  return 2.0*vtkMath::Pi();
+};
+#endif
diff --git a/Common/Core/vtkMath.h b/Common/Core/vtkMath.h
index 5ea14d4..a357d56 100644
--- a/Common/Core/vtkMath.h
+++ b/Common/Core/vtkMath.h
@@ -81,6 +81,14 @@ public:
   static double Pi() { return 3.141592653589793; };
 
   // Description:
+  // Deprecated.  Use vtkMath::Pi() instead.
+  VTK_LEGACY(static double DoublePi());
+
+  // Description:
+  // Deprecated.  Use 2.0 * vtkMath::Pi() instead.
+  VTK_LEGACY(static double DoubleTwoPi());
+
+  // Description:
   // Convert degrees into radians
   static float RadiansFromDegrees( float degrees);
   static double RadiansFromDegrees( double degrees);
@@ -988,6 +996,17 @@ inline double vtkMath::DegreesFromRadians( double x )
 }
 
 //----------------------------------------------------------------------------
+inline vtkTypeInt64 vtkMath::Factorial( int N )
+{
+  vtkTypeInt64 r = 1;
+  while ( N > 1 )
+    {
+    r *= N--;
+    }
+  return r;
+}
+
+//----------------------------------------------------------------------------
 inline bool vtkMath::IsPowerOfTwo(vtkTypeUInt64 x)
 {
   return ((x != 0) & ((x & (x - 1)) == 0));
diff --git a/Common/Core/vtkOStrStreamWrapper.cxx b/Common/Core/vtkOStrStreamWrapper.cxx
index dcc2f9a..024ff22 100644
--- a/Common/Core/vtkOStrStreamWrapper.cxx
+++ b/Common/Core/vtkOStrStreamWrapper.cxx
@@ -32,7 +32,7 @@ vtkOStrStreamWrapper::vtkOStrStreamWrapper()
 //----------------------------------------------------------------------------
 vtkOStrStreamWrapper::~vtkOStrStreamWrapper()
 {
-  if(!this->Frozen)
+  if(this->Result && !this->Frozen)
     {
     delete [] this->Result;
     }
diff --git a/Common/Core/vtkObject.cxx b/Common/Core/vtkObject.cxx
index 80febd9..8b3eaf3 100644
--- a/Common/Core/vtkObject.cxx
+++ b/Common/Core/vtkObject.cxx
@@ -138,7 +138,7 @@ vtkObject *vtkObject::New()
 // to zero.
 vtkObject::vtkObject()
 {
-  this->Debug = false;
+  this->Debug = 0;
   this->SubjectHelper = NULL;
   this->Modified(); // Insures modified time > than any other time
   // initial reference count = 1 and reference counting on.
@@ -191,26 +191,26 @@ void vtkObject::PrintSelf(ostream& os, vtkIndent indent)
 // the modification time when enabling debug output.
 void vtkObject::DebugOn()
 {
-  this->Debug = true;
+  this->Debug = 1;
 }
 
 //----------------------------------------------------------------------------
 // Turn debugging output off.
 void vtkObject::DebugOff()
 {
-  this->Debug = false;
+  this->Debug = 0;
 }
 
 //----------------------------------------------------------------------------
 // Get the value of the debug flag.
-bool vtkObject::GetDebug()
+unsigned char vtkObject::GetDebug()
 {
   return this->Debug;
 }
 
 //----------------------------------------------------------------------------
-// Set the value of the debug flag. A true value turns debugging on.
-void vtkObject::SetDebug(bool debugFlag)
+// Set the value of the debug flag. A non-zero value turns debugging on.
+void vtkObject::SetDebug(unsigned char debugFlag)
 {
   this->Debug = debugFlag;
 }
diff --git a/Common/Core/vtkObject.h b/Common/Core/vtkObject.h
index eb46b54..cca9dc8 100644
--- a/Common/Core/vtkObject.h
+++ b/Common/Core/vtkObject.h
@@ -73,11 +73,11 @@ public:
 
   // Description:
   // Get the value of the debug flag.
-  bool GetDebug();
+  unsigned char GetDebug();
 
   // Description:
-  // Set the value of the debug flag. A true value turns debugging on.
-  void SetDebug(bool debugFlag);
+  // Set the value of the debug flag. A non-zero value turns debugging on.
+  void SetDebug(unsigned char debugFlag);
 
   // Description:
   // This method is called when vtkErrorMacro executes. It allows
@@ -223,7 +223,7 @@ protected:
   virtual void RegisterInternal(vtkObjectBase*, int check);
   virtual void UnRegisterInternal(vtkObjectBase*, int check);
 
-  bool     Debug;      // Enable debug messages
+  unsigned char     Debug;      // Enable debug messages
   vtkTimeStamp      MTime;      // Keep track of modification time
   vtkSubjectHelper *SubjectHelper; // List of observers on this object
 
diff --git a/Common/Core/vtkObjectBase.h b/Common/Core/vtkObjectBase.h
index 75725cd..8770c3a 100644
--- a/Common/Core/vtkObjectBase.h
+++ b/Common/Core/vtkObjectBase.h
@@ -41,10 +41,9 @@
 #define vtkObjectBase_h
 
 #include "vtkCommonCoreModule.h" // For export macro
+#include "vtkAtomicInt.h"
 #include "vtkIndent.h"
 #include "vtkSystemIncludes.h"
-#include "vtkAtomicTypes.h" // needs to be included after vtkSystemIncludes.h
-                            // for warning suppressions to work on Visual Studio
 
 class vtkGarbageCollector;
 class vtkGarbageCollectorToObjectBaseFriendship;
@@ -163,7 +162,7 @@ protected:
 
   virtual void CollectRevisions(ostream&) {} // Legacy; do not use!
 
-  vtkAtomicInt32 ReferenceCount;
+  vtkAtomicInt<vtkTypeInt32> ReferenceCount;
   vtkWeakPointerBase **WeakPointers;
 
   // Internal Register/UnRegister implementation that accounts for
diff --git a/Common/Core/vtkPeriodicDataArray.h b/Common/Core/vtkPeriodicDataArray.h
deleted file mode 100644
index f89250f..0000000
--- a/Common/Core/vtkPeriodicDataArray.h
+++ /dev/null
@@ -1,279 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkPeriodicDataArray.h
-
-  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.
-
-=========================================================================*/
-
-// .NAME vtkPeriodicDataArray - Map native an Array into an angulat
-// periodic array
-//
-// .SECTION Description
-// Map an array into a periodic array. Data from the original array aare
-// rotated (on the fly) by the specified angle along the specified axis
-// around the specified point. Lookup is not implemented.
-// Creating the array is virtually free, accessing a tuple require some
-// computation.
-
-#ifndef vtkPeriodicDataArray_h
-#define vtkPeriodicDataArray_h
-
-#include "vtkMappedDataArray.h"   // Parent
-#include "vtkDataArrayTemplate.h" // Template
-
-template <class Scalar>
-class vtkPeriodicDataArray:
-public vtkTypeTemplate <vtkPeriodicDataArray <Scalar>, vtkMappedDataArray <Scalar> >
-{
-public:
-  virtual void PrintSelf(ostream &os, vtkIndent indent);
-
-  // Description:
-  // Initialize the mapped array with the original input data array.
-  void InitializeArray(vtkDataArrayTemplate<Scalar>* inputData);
-
-  // Description:
-  // Initialize array with zero values
-  void Initialize();
-
-  // Description:
-  // Copy tuples values, selected by ptIds into provided array
-  void GetTuples(vtkIdList *ptIds, vtkAbstractArray *output);
-
-  // Description:
-  // Copy tuples from id p1 to id p2 included into provided array
-  void GetTuples(vtkIdType p1, vtkIdType p2, vtkAbstractArray *output);
-
-  // Description:
-  // No effect
-  void Squeeze();
-
-  // Description:
-  // Not implemented
-  vtkArrayIterator *NewIterator();
-
-  // Description:
-  // Not implemented
-  vtkIdType LookupValue(vtkVariant value);
-
-  // Description:
-  // Not implemented
-  void LookupValue(vtkVariant value, vtkIdList *ids);
-
-  // Description:
-  // Not implemented
-  vtkVariant GetVariantValue(vtkIdType idx);
-
-  // Description:
-  // Not implemented
-  void ClearLookup();
-
-  // Description:
-  // Return tuple at location i.
-  // Pointer valid until next call to this object
-  double* GetTuple(vtkIdType i);
-
-  // Description:
-  // Copy tuple at location i into user provided array
-  void GetTuple(vtkIdType i, double *tuple);
-
-  // Description:
-  // Not implemented
-  vtkIdType LookupTypedValue(Scalar value);
-
-  // Description:
-  // Not implemented
-  void LookupTypedValue(Scalar value, vtkIdList *ids);
-
-  // Description:
-  // Get value at index idx.
-  // Warning, it internally call GetTupleValue,
-  // so it is an inneficcient way if reading all data
-  Scalar GetValue(vtkIdType idx);
-
-  // Description:
-  // Get value at index idx as reference.
-  // Warning, it internally call GetTupleValue,
-  // so it is an inneficcient way if reading all data
-  Scalar& GetValueReference(vtkIdType idx);
-
-  // Description:
-  // Copy tuple value at location idx into provided array
-  void GetTupleValue(vtkIdType idx, Scalar *t);
-
-  // Description:
-  // Return the memory in kilobytes consumed by this data array.
-  unsigned long GetActualMemorySize();
-
-  // Description:
-  // Read only container, not supported.
-  int Allocate(vtkIdType sz, vtkIdType ext);
-
-  // Description:
-  // Read only container, not supported.
-  int Resize(vtkIdType numTuples);
-
-  // Description:
-  // Read only container, not supported.
-  void SetNumberOfTuples(vtkIdType number);
-
-  // Description:
-  // Read only container, not supported.
-  void SetTuple(vtkIdType i, vtkIdType j, vtkAbstractArray *source);
-
-  // Description:
-  // Read only container, not supported.
-  void SetTuple(vtkIdType i, const float *source);
-
-  // Description:
-  // Read only container, not supported.
-  void SetTuple(vtkIdType i, const double *source);
-
-  // Description:
-  // Read only container, not supported.
-  void InsertTuple(vtkIdType i, vtkIdType j, vtkAbstractArray *source);
-
-  // Description:
-  // Read only container, not supported.
-  void InsertTuple(vtkIdType i, const float *source);
-
-  // Description:
-  // Read only container, not supported.
-  void InsertTuple(vtkIdType i, const double *source);
-
-  // Description:
-  // Read only container, not supported.
-  void InsertTuples(vtkIdList *dstIds, vtkIdList *srcIds,
-                    vtkAbstractArray *source);
-
-  // Description:
-  // Read only container, not supported.
-  void InsertTuples(vtkIdType dstStart, vtkIdType n, vtkIdType srcStart,
-                    vtkAbstractArray* source);
-
-  // Description:
-  // Read only container, error.
-  vtkIdType InsertNextTuple(vtkIdType j, vtkAbstractArray *source);
-
-  // Description:
-  // Read only container, not supported.
-  vtkIdType InsertNextTuple(const float *source);
-
-  // Description:
-  // Read only container, not supported.
-  vtkIdType InsertNextTuple(const double *source);
-
-  // Description:
-  // Read only container, not supported.
-  void DeepCopy(vtkAbstractArray *aa);
-
-  // Description:
-  // Read only container, not supported.
-  void DeepCopy(vtkDataArray *da);
-
-  // Description:
-  // Read only container, not supported.
-  void InterpolateTuple(vtkIdType i, vtkIdList *ptIndices,
-                        vtkAbstractArray* source, double* weights);
-
-  // Description:
-  // Read only container, not supported.
-  void InterpolateTuple(vtkIdType i, vtkIdType id1, vtkAbstractArray *source1,
-                        vtkIdType id2, vtkAbstractArray *source2, double t);
-
-  // Description:
-  // Read only container, not supported.
-  void SetVariantValue(vtkIdType idx, vtkVariant value);
-
-  // Description:
-  // Read only container, not supported.
-  void RemoveTuple(vtkIdType id);
-
-  // Description:
-  // Read only container, not supported.
-  void RemoveFirstTuple();
-
-  // Description:
-  // Read only container, not supported.
-  void RemoveLastTuple();
-
-  // Description:
-  // Read only container, not supported.
-  void SetTupleValue(vtkIdType i, const Scalar *t);
-
-  // Description:
-  // Read only container, not supported.
-  void InsertTupleValue(vtkIdType i, const Scalar *t);
-
-  // Description:
-  // Read only container, not supported.
-  vtkIdType InsertNextTupleValue(const Scalar *t);
-
-  // Description:
-  // Read only container, not supported.
-  void SetValue(vtkIdType idx, Scalar value);
-
-  // Description:
-  // Read only container, not supported.
-  vtkIdType InsertNextValue(Scalar v);
-
-  // Description:
-  // Read only container, not supported.
-  void InsertValue(vtkIdType idx, Scalar v);
-
-  // Description:
-  // Set/Get normalize flag. Default: false
-  vtkSetMacro(Normalize, bool);
-  vtkGetMacro(Normalize, bool);
-
-protected:
-  vtkPeriodicDataArray();
-  ~vtkPeriodicDataArray();
-
-  // Description:
-  // Transform the provided tuple
-  virtual void Transform(Scalar* tuple) = 0;
-
-  // Description:
-  // Get the transformed range by components
-  virtual bool ComputeScalarRange(double* range);
-
-  // Description:
-  // Get the transformed range on all components
-  virtual bool ComputeVectorRange(double range[2]);
-
-  // Description:
-  // Update the transformed periodic range
-  virtual void ComputePeriodicRange();
-
-  // Description:
-  // Set the invalid range flag to false
-  void InvalidateRange();
-
-  bool Normalize; // If transformed vector must be normalized
-
-private:
-  vtkPeriodicDataArray(const vtkPeriodicDataArray &); // Not implemented.
-  void operator=(const vtkPeriodicDataArray &); // Not implemented.
-
-  Scalar* TempScalarArray; // Temporary array used by GetTupleValue methods
-  double* TempDoubleArray; // Temporary array used by GetTuple vethods
-  vtkIdType TempTupleIdx;  // Location of currently stored Temp Tuple to use as cache
-  vtkDataArrayTemplate<Scalar>* Data; // Original data
-
-  bool InvalidRange;
-  double PeriodicRange[6]; // Transformed periodic range
-};
-
-#include "vtkPeriodicDataArray.txx"
-
-#endif //vtkPeriodicDataArray_h
-// VTK-HeaderTest-Exclude: vtkPeriodicDataArray.h
diff --git a/Common/Core/vtkPeriodicDataArray.txx b/Common/Core/vtkPeriodicDataArray.txx
deleted file mode 100644
index 02d7cb6..0000000
--- a/Common/Core/vtkPeriodicDataArray.txx
+++ /dev/null
@@ -1,621 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkPeriodicDataArray.txx
-
-  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 "vtkIdList.h"
-#include "vtkVariant.h"
-
-//------------------------------------------------------------------------------
-template <class Scalar> void vtkPeriodicDataArray<Scalar>
-::PrintSelf(ostream &os, vtkIndent indent)
-{
-  this->vtkPeriodicDataArray<Scalar>::Superclass::PrintSelf(os, indent);
-
-  os << indent << "TempScalarArray: " << this->TempScalarArray << "\n";
-  os << indent << "TempDoubleArray: " << this->TempDoubleArray << "\n";
-}
-
-//------------------------------------------------------------------------------
-template <class Scalar> void vtkPeriodicDataArray<Scalar>
-::Initialize()
-{
-  delete[] this->TempScalarArray;
-  this->TempScalarArray = NULL;
-  delete[] this->TempDoubleArray;
-  this->TempDoubleArray = NULL;
-  this->TempTupleIdx = -1;
-
-  if (this->Data)
-    {
-    this->Data->Delete();
-    this->Data = 0;
-    }
-
-  this->MaxId = -1;
-  this->Size = 0;
-  this->InvalidRange = true;
-  this->Normalize = false;
-  this->Modified();
-}
-
-//------------------------------------------------------------------------------
-template <class Scalar> void vtkPeriodicDataArray<Scalar>
-::InitializeArray(vtkDataArrayTemplate<Scalar>* data)
-{
-  this->Initialize();
-  if (!data)
-    {
-    vtkErrorMacro(<< "No original data provided.");
-    return;
-    }
-
-  if (data->GetNumberOfComponents() != 3 && data->GetNumberOfComponents() != 9)
-    {
-    vtkWarningMacro(<< "Original data has " << data->GetNumberOfComponents() <<
-                    " components, Expecting 3 or 9.");
-    return;
-    }
-
-  this->NumberOfComponents = data->GetNumberOfComponents();
-  this->Size = data->GetSize();
-  this->MaxId = data->GetMaxId();
-  this->Data = data;
-  this->Data->Register(0);
-  this->TempScalarArray = new Scalar[this->NumberOfComponents];
-  this->TempDoubleArray = new double[this->NumberOfComponents];
-  this->SetName(data->GetName());
-  this->InvalidRange = true;
-  this->Modified();
-}
-
-//------------------------------------------------------------------------------
-template <class Scalar> bool vtkPeriodicDataArray<Scalar>::
-ComputeScalarRange(double* range)
-{
-  if (this->NumberOfComponents == 3)
-    {
-    if (this->InvalidRange)
-      {
-      this->ComputePeriodicRange();
-      }
-    for (int i = 0; i < 3; i++)
-      {
-      range[i * 2] = this->PeriodicRange[i * 2 + 0];
-      range[i * 2 + 1] = this->PeriodicRange[i * 2 + 1];
-      }
-    }
-  else
-    {
-    // Not implemented for tensor
-    for (int i = 0; i < this->NumberOfComponents; i++)
-      {
-      range[i * 2] = 0;
-      range[i * 2 + 1] = 1;
-      }
-    }
-  return true;
-}
-
-//------------------------------------------------------------------------------
-template <class Scalar> bool vtkPeriodicDataArray<Scalar>::
-ComputeVectorRange(double range[2])
-{
-  if (this->NumberOfComponents == 3)
-    {
-    if (this->InvalidRange)
-      {
-      this->ComputePeriodicRange();
-      }
-
-    range[0] = vtkTypeTraits<Scalar>::Max();
-    range[1] = vtkTypeTraits<Scalar>::Min();
-
-    for (int i = 0; i < 3; i++)
-      {
-      range[0] = std::min(this->PeriodicRange[i * 2], range[0]);
-      range[1] = std::max(this->PeriodicRange[i * 2 + 1], range[1]);
-      }
-    }
-  else
-    {
-    // Not implemented for tensor
-    range[0] = 0;
-    range[1] = 1;
-    }
-  return true;
-}
-//------------------------------------------------------------------------------
-template <class Scalar> void vtkPeriodicDataArray<Scalar>::
-ComputePeriodicRange()
-{
-  if (this->Data)
-    {
-    this->Data->GetRange(this->PeriodicRange, 0);
-    this->Data->GetRange(this->PeriodicRange + 2, 1);
-    this->Data->GetRange(this->PeriodicRange + 4, 2);
-    Scalar boxPoints [8][3];
-
-    boxPoints[0][0] = this->PeriodicRange[0];
-    boxPoints[0][1] = this->PeriodicRange[2];
-    boxPoints[0][2] = this->PeriodicRange[4];
-
-    boxPoints[1][0] = this->PeriodicRange[0];
-    boxPoints[1][1] = this->PeriodicRange[3];
-    boxPoints[1][2] = this->PeriodicRange[4];
-
-    boxPoints[2][0] = this->PeriodicRange[1];
-    boxPoints[2][1] = this->PeriodicRange[3];
-    boxPoints[2][2] = this->PeriodicRange[4];
-
-    boxPoints[3][0] = this->PeriodicRange[1];
-    boxPoints[3][1] = this->PeriodicRange[2];
-    boxPoints[3][2] = this->PeriodicRange[4];
-
-    boxPoints[4][0] = this->PeriodicRange[0];
-    boxPoints[4][1] = this->PeriodicRange[2];
-    boxPoints[4][2] = this->PeriodicRange[5];
-
-    boxPoints[5][0] = this->PeriodicRange[0];
-    boxPoints[5][1] = this->PeriodicRange[3];
-    boxPoints[5][2] = this->PeriodicRange[5];
-
-    boxPoints[6][0] = this->PeriodicRange[1];
-    boxPoints[6][1] = this->PeriodicRange[3];
-    boxPoints[6][2] = this->PeriodicRange[5];
-
-    boxPoints[7][0] = this->PeriodicRange[1];
-    boxPoints[7][1] = this->PeriodicRange[2];
-    boxPoints[7][2] = this->PeriodicRange[5];
-
-    for (int i = 0; i < 8; i++)
-      {
-      this->Transform(boxPoints[i]);
-      }
-
-    this->PeriodicRange[0] = this->PeriodicRange[2] = this->PeriodicRange[4] = VTK_DOUBLE_MAX;
-    this->PeriodicRange[1] = this->PeriodicRange[3] = this->PeriodicRange[5] = -VTK_DOUBLE_MAX;
-
-    for (int i = 0; i < 8; i++)
-      {
-      for (int j = 0; j < 3; j++)
-        {
-        if (boxPoints[i][j] < this->PeriodicRange[2 * j])
-          {
-          this->PeriodicRange[2 * j] = boxPoints[i][j];
-          }
-        if (boxPoints[i][j] > this->PeriodicRange[2 * j + 1])
-          {
-          this->PeriodicRange[2 * j + 1] = boxPoints[i][j];
-          }
-        }
-      }
-    this->InvalidRange = false;
-    }
-}
-
-
-//------------------------------------------------------------------------------
-template <class Scalar> void vtkPeriodicDataArray<Scalar>
-::GetTuples(vtkIdList *ptIds, vtkAbstractArray *output)
-{
-  vtkDataArray *da = vtkDataArray::FastDownCast(output);
-  if (!da)
-    {
-    vtkWarningMacro(<< "Input is not a vtkDataArray");
-    return;
-    }
-
-  if (da->GetNumberOfComponents() != this->GetNumberOfComponents())
-    {
-    vtkWarningMacro(<< "Incorrect number of components in input array.");
-    return;
-    }
-
-  const vtkIdType numPoints = ptIds->GetNumberOfIds();
-  double *tempData = new double[this->NumberOfComponents];
-  for (vtkIdType i = 0; i < numPoints; ++i)
-    {
-    this->GetTuple(ptIds->GetId(i), tempData);
-    da->SetTuple(i, tempData);
-    }
-  delete[] tempData;
-}
-
-//------------------------------------------------------------------------------
-template <class Scalar> void vtkPeriodicDataArray<Scalar>
-::GetTuples(vtkIdType p1, vtkIdType p2, vtkAbstractArray *output)
-{
-  vtkDataArray *da = vtkDataArray::FastDownCast(output);
-  if (!da)
-    {
-    vtkErrorMacro(<< "Input is not a vtkDataArray");
-    return;
-    }
-
-  if (da->GetNumberOfComponents() != this->GetNumberOfComponents())
-    {
-    vtkErrorMacro(<< "Incorrect number of components in input array.");
-    return;
-    }
-
-  double *tempData = new double[this->NumberOfComponents];
-  for (vtkIdType daTupleId = 0; p1 <= p2; ++p1)
-    {
-    this->GetTuple(p1, tempData);
-    da->SetTuple(daTupleId++, tempData);
-    }
-  delete[] tempData;
-}
-
-//------------------------------------------------------------------------------
-template <class Scalar> void vtkPeriodicDataArray<Scalar>
-::Squeeze()
-{
-}
-
-//------------------------------------------------------------------------------
-template <class Scalar> vtkArrayIterator*
-vtkPeriodicDataArray<Scalar>::NewIterator()
-{
-  vtkErrorMacro(<< "Not implemented.");
-  return NULL;
-}
-
-//------------------------------------------------------------------------------
-template <class Scalar> vtkIdType vtkPeriodicDataArray<Scalar>
-::LookupValue(vtkVariant)
-{
-  vtkErrorMacro("Lookup not implemented in this container.");
-  return -1;
-}
-
-//------------------------------------------------------------------------------
-template <class Scalar> void vtkPeriodicDataArray<Scalar>
-::LookupValue(vtkVariant, vtkIdList*)
-{
-  vtkErrorMacro("Lookup not implemented in this container.");
-}
-
-//------------------------------------------------------------------------------
-template <class Scalar> vtkVariant vtkPeriodicDataArray<Scalar>
-::GetVariantValue(vtkIdType idx)
-{
-  return vtkVariant(this->GetValueReference(idx));
-}
-
-//------------------------------------------------------------------------------
-template <class Scalar> void vtkPeriodicDataArray<Scalar>
-::ClearLookup()
-{
-  vtkErrorMacro("Lookup not implemented in this container.");
-}
-
-//------------------------------------------------------------------------------
-template <class Scalar> double* vtkPeriodicDataArray<Scalar>
-::GetTuple(vtkIdType i)
-{
-  if (this->TempTupleIdx != i)
-    {
-    this->GetTupleValue(i, this->TempScalarArray);
-    this->TempTupleIdx = i;
-    }
-  for (int j = 0; j < this->NumberOfComponents; j++)
-    {
-    this->TempDoubleArray[j] = static_cast<double>(this->TempScalarArray[j]);
-    }
-  return this->TempDoubleArray;
-}
-
-//------------------------------------------------------------------------------
-template <class Scalar> void vtkPeriodicDataArray<Scalar>
-::GetTuple(vtkIdType i, double *tuple)
-{
-  if (this->TempTupleIdx != i)
-    {
-    this->GetTupleValue(i, this->TempScalarArray);
-    this->TempTupleIdx = i;
-    }
-  for (int j = 0; j < this->NumberOfComponents; j++)
-    {
-    tuple[j] = static_cast<double>(this->TempScalarArray[j]);
-    }
-}
-
-//------------------------------------------------------------------------------
-template <class Scalar> vtkIdType vtkPeriodicDataArray<Scalar>
-::LookupTypedValue(Scalar)
-{
-  vtkErrorMacro("Lookup not implemented in this container.");
-  return 0;
-}
-
-//------------------------------------------------------------------------------
-template <class Scalar> void vtkPeriodicDataArray<Scalar>
-::LookupTypedValue(Scalar, vtkIdList*)
-{
-  vtkErrorMacro("Lookup not implemented in this container.");
-}
-
-//------------------------------------------------------------------------------
-template <class Scalar> Scalar vtkPeriodicDataArray<Scalar>
-::GetValue(vtkIdType idx)
-{
-  return this->GetValueReference(idx);
-}
-
-//------------------------------------------------------------------------------
-template <class Scalar> Scalar& vtkPeriodicDataArray<Scalar>
-::GetValueReference(vtkIdType idx)
-{
-  vtkIdType tupleIdx = idx / this->NumberOfComponents;
-  if (tupleIdx != this->TempTupleIdx)
-    {
-    this->GetTupleValue(tupleIdx, this->TempScalarArray);
-    this->TempTupleIdx = tupleIdx;
-    }
-  return this->TempScalarArray[idx % this->NumberOfComponents];
-}
-
-//------------------------------------------------------------------------------
-template <class Scalar> void vtkPeriodicDataArray<Scalar>
-::GetTupleValue(vtkIdType tupleId, Scalar *tuple)
-{
-  this->Data->GetTupleValue(tupleId, tuple);
-  this->Transform(tuple);
-}
-
-//------------------------------------------------------------------------------
-template <class Scalar> unsigned long int vtkPeriodicDataArray<Scalar>
-::GetActualMemorySize()
-{
-  return static_cast<unsigned long int>
-    ((this->NumberOfComponents * (sizeof(Scalar) + sizeof(double)) +
-      sizeof(*this)) / 1024);
-}
-
-//------------------------------------------------------------------------------
-template <class Scalar> int vtkPeriodicDataArray<Scalar>
-::Allocate(vtkIdType, vtkIdType)
-{
-  vtkErrorMacro("Read only container.");
-  return 0;
-}
-
-//------------------------------------------------------------------------------
-template <class Scalar> int vtkPeriodicDataArray<Scalar>
-::Resize(vtkIdType)
-{
-  vtkErrorMacro("Read only container.");
-  return 0;
-}
-
-//------------------------------------------------------------------------------
-template <class Scalar> void vtkPeriodicDataArray<Scalar>
-::SetNumberOfTuples(vtkIdType)
-{
-  vtkErrorMacro("Read only container.");
-}
-
-//------------------------------------------------------------------------------
-template <class Scalar> void vtkPeriodicDataArray<Scalar>
-::SetTuple(vtkIdType, vtkIdType, vtkAbstractArray *)
-{
-  vtkErrorMacro("Read only container.");
-}
-
-//------------------------------------------------------------------------------
-template <class Scalar> void vtkPeriodicDataArray<Scalar>
-::SetTuple(vtkIdType, const float *)
-{
-  vtkErrorMacro("Read only container.");
-}
-
-//------------------------------------------------------------------------------
-template <class Scalar> void vtkPeriodicDataArray<Scalar>
-::SetTuple(vtkIdType, const double *)
-{
-  vtkErrorMacro("Read only container.");
-}
-
-//------------------------------------------------------------------------------
-template <class Scalar> void vtkPeriodicDataArray<Scalar>
-::InsertTuple(vtkIdType, vtkIdType, vtkAbstractArray *)
-{
-  vtkErrorMacro("Read only container.");
-}
-
-//------------------------------------------------------------------------------
-template <class Scalar> void vtkPeriodicDataArray<Scalar>
-::InsertTuple(vtkIdType, const float *)
-{
-  vtkErrorMacro("Read only container.");
-}
-
-//------------------------------------------------------------------------------
-template <class Scalar> void vtkPeriodicDataArray<Scalar>
-::InsertTuple(vtkIdType, const double *)
-{
-  vtkErrorMacro("Read only container.");
-}
-
-//------------------------------------------------------------------------------
-template <class Scalar> void vtkPeriodicDataArray<Scalar>
-::InsertTuples(vtkIdList *, vtkIdList *, vtkAbstractArray *)
-{
-  vtkErrorMacro("Read only container.");
-}
-
-//------------------------------------------------------------------------------
-template <class Scalar> void vtkPeriodicDataArray<Scalar>
-::InsertTuples(vtkIdType, vtkIdType, vtkIdType, vtkAbstractArray *)
-{
-  vtkErrorMacro("Read only container.");
-}
-
-//------------------------------------------------------------------------------
-template <class Scalar> vtkIdType vtkPeriodicDataArray<Scalar>
-::InsertNextTuple(vtkIdType, vtkAbstractArray *)
-{
-  vtkErrorMacro("Read only container.");
-  return -1;
-}
-
-//------------------------------------------------------------------------------
-template <class Scalar> vtkIdType vtkPeriodicDataArray<Scalar>
-::InsertNextTuple(const float *)
-{
-  vtkErrorMacro("Read only container.");
-  return -1;
-}
-
-//------------------------------------------------------------------------------
-template <class Scalar> vtkIdType vtkPeriodicDataArray<Scalar>
-::InsertNextTuple(const double *)
-{
-  vtkErrorMacro("Read only container.");
-  return -1;
-}
-
-//------------------------------------------------------------------------------
-template <class Scalar> void vtkPeriodicDataArray<Scalar>
-::DeepCopy(vtkAbstractArray *)
-{
-  vtkErrorMacro("Read only container.");
-}
-
-//------------------------------------------------------------------------------
-template <class Scalar> void vtkPeriodicDataArray<Scalar>
-::DeepCopy(vtkDataArray *)
-{
-  vtkErrorMacro("Read only container.");
-}
-
-//------------------------------------------------------------------------------
-template <class Scalar> void vtkPeriodicDataArray<Scalar>
-::InterpolateTuple(vtkIdType, vtkIdList *, vtkAbstractArray *, double *)
-{
-  vtkErrorMacro("Read only container.");
-}
-
-//------------------------------------------------------------------------------
-template <class Scalar> void vtkPeriodicDataArray<Scalar>
-::InterpolateTuple(vtkIdType, vtkIdType, vtkAbstractArray*, vtkIdType,
-                   vtkAbstractArray*, double)
-{
-  vtkErrorMacro("Read only container.");
-}
-
-//------------------------------------------------------------------------------
-template <class Scalar> void vtkPeriodicDataArray<Scalar>
-::SetVariantValue(vtkIdType, vtkVariant)
-{
-  vtkErrorMacro("Read only container.");
-}
-
-//------------------------------------------------------------------------------
-template <class Scalar> void vtkPeriodicDataArray<Scalar>
-::RemoveTuple(vtkIdType)
-{
-  vtkErrorMacro("Read only container.");
-}
-
-//------------------------------------------------------------------------------
-template <class Scalar> void vtkPeriodicDataArray<Scalar>
-::RemoveFirstTuple()
-{
-  vtkErrorMacro("Read only container.");
-}
-
-//------------------------------------------------------------------------------
-template <class Scalar> void vtkPeriodicDataArray<Scalar>
-::RemoveLastTuple()
-{
-  vtkErrorMacro("Read only container.");
-}
-
-//------------------------------------------------------------------------------
-template <class Scalar> void vtkPeriodicDataArray<Scalar>
-::SetTupleValue(vtkIdType, const Scalar*)
-{
-  vtkErrorMacro("Read only container.");
-}
-
-//------------------------------------------------------------------------------
-template <class Scalar> void vtkPeriodicDataArray<Scalar>
-::InsertTupleValue(vtkIdType, const Scalar*)
-{
-  vtkErrorMacro("Read only container.");
-}
-
-//------------------------------------------------------------------------------
-template <class Scalar> vtkIdType vtkPeriodicDataArray<Scalar>
-::InsertNextTupleValue(const Scalar *)
-{
-  vtkErrorMacro("Read only container.");
-  return -1;
-}
-
-//------------------------------------------------------------------------------
-template <class Scalar> void vtkPeriodicDataArray<Scalar>
-::SetValue(vtkIdType, Scalar)
-{
-  vtkErrorMacro("Read only container.");
-}
-
-//------------------------------------------------------------------------------
-template <class Scalar> vtkIdType vtkPeriodicDataArray<Scalar>
-::InsertNextValue(Scalar)
-{
-  vtkErrorMacro("Read only container.");
-  return -1;
-}
-
-//------------------------------------------------------------------------------
-template <class Scalar> void vtkPeriodicDataArray<Scalar>
-::InsertValue(vtkIdType, Scalar)
-{
-  vtkErrorMacro("Read only container.");
-}
-
-//------------------------------------------------------------------------------
-template <class Scalar> void vtkPeriodicDataArray<Scalar>
-::InvalidateRange()
-{
-  this->InvalidRange = true;
-}
-
-//------------------------------------------------------------------------------
-template <class Scalar> vtkPeriodicDataArray<Scalar>
-::vtkPeriodicDataArray()
-{
-  this->NumberOfComponents = 0;
-  this->TempScalarArray = NULL;
-  this->TempDoubleArray = NULL;
-  this->TempTupleIdx = -1;
-  this->Data = 0;
-  this->MaxId = -1;
-  this->Size = 0;
-
-  this->InvalidRange = true;
-  this->Normalize = false;
-  this->PeriodicRange[0] = this->PeriodicRange[2] = this->PeriodicRange[4] =  VTK_DOUBLE_MAX;
-  this->PeriodicRange[1] = this->PeriodicRange[3] = this->PeriodicRange[5] = -VTK_DOUBLE_MAX;
-}
-
-//------------------------------------------------------------------------------
-template <class Scalar> vtkPeriodicDataArray<Scalar>
-::~vtkPeriodicDataArray()
-{
-  this->Initialize();
-}
diff --git a/Common/Core/vtkPoints.cxx b/Common/Core/vtkPoints.cxx
index 126598a..be574da 100644
--- a/Common/Core/vtkPoints.cxx
+++ b/Common/Core/vtkPoints.cxx
@@ -79,12 +79,59 @@ void vtkPoints::GetPoints(vtkIdList *ptIds, vtkPoints *outPoints)
   this->Data->GetTuples(ptIds, outPoints->Data);
 }
 
+namespace
+{
+  template <class T>
+  void InternalComputeBounds(vtkDataArray* array, double* bounds, T*)
+  {
+    bounds[0] = bounds[2] = bounds[4] =  VTK_DOUBLE_MAX;
+    bounds[1] = bounds[3] = bounds[5] = -VTK_DOUBLE_MAX;
+
+    vtkTypedDataArray<T>* tarray = vtkTypedDataArray<T>::FastDownCast(array);
+    if (tarray)
+      {
+      T x[3];
+      vtkIdType numPts = tarray->GetNumberOfTuples();
+      for (vtkIdType i = 0; i < numPts; i++)
+        {
+        tarray->GetTupleValue(i, x);
+        bounds[0] = x[0] < bounds[0] ? x[0] : bounds[0];
+        bounds[1] = x[0] > bounds[1] ? x[0] : bounds[1];
+        bounds[2] = x[1] < bounds[2] ? x[1] : bounds[2];
+        bounds[3] = x[1] > bounds[3] ? x[1] : bounds[3];
+        bounds[4] = x[2] < bounds[4] ? x[2] : bounds[4];
+        bounds[5] = x[2] > bounds[5] ? x[2] : bounds[5];
+        }
+      }
+    else
+      {
+      double x[3];
+      vtkIdType numPts = array->GetNumberOfTuples();
+      for (vtkIdType i = 0; i < numPts; i++)
+        {
+        array->GetTuple(i, x);
+        bounds[0] = x[0] < bounds[0] ? x[0] : bounds[0];
+        bounds[1] = x[0] > bounds[1] ? x[0] : bounds[1];
+        bounds[2] = x[1] < bounds[2] ? x[1] : bounds[2];
+        bounds[3] = x[1] > bounds[3] ? x[1] : bounds[3];
+        bounds[4] = x[2] < bounds[4] ? x[2] : bounds[4];
+        bounds[5] = x[2] > bounds[5] ? x[2] : bounds[5];
+        }
+      }
+  }
+}
+
 // Determine (xmin,xmax, ymin,ymax, zmin,zmax) bounds of points.
 void vtkPoints::ComputeBounds()
 {
   if (this->GetMTime() > this->ComputeTime)
     {
-    this->Data->ComputeScalarRange(this->Bounds);
+    switch (this->Data->GetDataType())
+      {
+      vtkTemplateMacro(
+        InternalComputeBounds(this->Data, this->Bounds, (VTK_TT*)0));
+      }
+
     this->ComputeTime.Modified();
     }
 }
@@ -103,16 +150,6 @@ void vtkPoints::GetBounds(double bounds[6])
   memcpy(bounds, this->Bounds, 6 * sizeof(double));
 }
 
-unsigned long int vtkPoints::GetMTime()
-{
-  unsigned long int doTime = this->Superclass::GetMTime();
-  if ( this->Data->GetMTime() > doTime )
-    {
-    doTime = this->Data->GetMTime();
-    }
-  return doTime;
-}
-
 int vtkPoints::Allocate(const vtkIdType sz, const vtkIdType ext)
 {
   int numComp = this->Data->GetNumberOfComponents();
diff --git a/Common/Core/vtkPoints.h b/Common/Core/vtkPoints.h
index 898b5a1..f3cbf4a 100644
--- a/Common/Core/vtkPoints.h
+++ b/Common/Core/vtkPoints.h
@@ -97,7 +97,7 @@ public:
   virtual void ShallowCopy(vtkPoints *ad);
 
   // Description:
-  // Return the memory in kibibytes (1024 bytes) consumed by this attribute data.
+  // Return the memory in kilobytes consumed by this attribute data.
   // Used to support streaming and reading/writing data. The value
   // returned is guaranteed to be greater than or equal to the
   // memory required to actually represent the data represented
@@ -188,10 +188,6 @@ public:
   // Return the bounds of the points.
   void GetBounds(double bounds[6]);
 
-  // Description:
-  // The modified time of the points.
-  unsigned long int GetMTime();
-
 protected:
   vtkPoints(int dataType = VTK_FLOAT);
   ~vtkPoints();
diff --git a/Common/Core/vtkPoints2D.h b/Common/Core/vtkPoints2D.h
index 569b433..9a29e97 100644
--- a/Common/Core/vtkPoints2D.h
+++ b/Common/Core/vtkPoints2D.h
@@ -97,7 +97,7 @@ public:
   virtual void ShallowCopy(vtkPoints2D *ad);
 
   // Description:
-  // Return the memory in kibibytes (1024 bytes) consumed by this attribute data.
+  // Return the memory in kilobytes consumed by this attribute data.
   // Used to support streaming and reading/writing data. The value
   // returned is guaranteed to be greater than or equal to the
   // memory required to actually represent the data represented
diff --git a/Common/Core/vtkPriorityQueue.cxx b/Common/Core/vtkPriorityQueue.cxx
index e530961..29f80c8 100644
--- a/Common/Core/vtkPriorityQueue.cxx
+++ b/Common/Core/vtkPriorityQueue.cxx
@@ -134,7 +134,7 @@ vtkIdType vtkPriorityQueue::Pop(vtkIdType location, double &priority)
     }
 
   // percolate down the tree from the specified location
-  vtkIdType lastNodeToCheck = (this->MaxId-1)/2;
+  int lastNodeToCheck = (this->MaxId-1)/2;
   for ( vtkIdType j=0, i=location; i <= lastNodeToCheck; i=j )
     {
     idx = 2*i + 1;
diff --git a/Common/Core/vtkPriorityQueue.h b/Common/Core/vtkPriorityQueue.h
index cbbaec4..f755a78 100644
--- a/Common/Core/vtkPriorityQueue.h
+++ b/Common/Core/vtkPriorityQueue.h
@@ -132,7 +132,7 @@ private:
 inline double vtkPriorityQueue::DeleteId(vtkIdType id)
 {
   double priority=VTK_DOUBLE_MAX;
-  vtkIdType loc;
+  int loc;
 
   if ( id <= this->ItemLocation->GetMaxId() &&
   (loc=this->ItemLocation->GetValue(id)) != -1 )
@@ -144,7 +144,7 @@ inline double vtkPriorityQueue::DeleteId(vtkIdType id)
 
 inline double vtkPriorityQueue::GetPriority(vtkIdType id)
 {
-  vtkIdType loc;
+  int loc;
 
   if ( id <= this->ItemLocation->GetMaxId() &&
   (loc=this->ItemLocation->GetValue(id)) != -1 )
diff --git a/Common/Core/vtkSMPTools.h b/Common/Core/vtkSMPTools.h
index b42ebce..b0e5855 100644
--- a/Common/Core/vtkSMPTools.h
+++ b/Common/Core/vtkSMPTools.h
@@ -27,8 +27,10 @@
 #include "vtkObject.h"
 
 #include "vtkSMPThreadLocal.h" // For Initialized
-#include "vtkSMPToolsInternal.h"
 
+class vtkSMPTools;
+
+#include "vtkSMPToolsInternal.h"
 
 #ifndef DOXYGEN_SHOULD_SKIP_THIS
 #ifndef __WRAP__
diff --git a/Common/Core/vtkScalarsToColors.cxx b/Common/Core/vtkScalarsToColors.cxx
index 54b5e83..cf5c5c0 100644
--- a/Common/Core/vtkScalarsToColors.cxx
+++ b/Common/Core/vtkScalarsToColors.cxx
@@ -239,7 +239,7 @@ vtkUnsignedCharArray *vtkScalarsToColors::MapScalars(vtkAbstractArray *scalars,
   // map scalars through lookup table only if needed
   if ((colorMode == VTK_COLOR_MODE_DEFAULT &&
        vtkUnsignedCharArray::SafeDownCast(dataArray) != NULL) ||
-      (colorMode == VTK_COLOR_MODE_DIRECT_SCALARS && dataArray))
+      colorMode == VTK_COLOR_MODE_DIRECT_SCALARS)
     {
     newColors = this->
       ConvertToRGBA(dataArray, scalars->GetNumberOfComponents(),
diff --git a/Common/Core/vtkSetGet.h b/Common/Core/vtkSetGet.h
index 0448806..2ca8d42 100644
--- a/Common/Core/vtkSetGet.h
+++ b/Common/Core/vtkSetGet.h
@@ -29,16 +29,6 @@
 #include "vtkSystemIncludes.h"
 #include <math.h>
 
-//----------------------------------------------------------------------------
-// Check for unsupported old compilers.
-#if defined(_MSC_VER) && _MSC_VER <= 1400
-# error VTK requires MSVC++ 9.0 aka Visual Studio 2008 or newer
-#endif
-
-#if defined(__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 1))
-# error VTK requires gcc 4.1 or newer
-#endif
-
 // Convert a macro representing a value to a string.
 //
 // Example: vtkQuoteMacro(__LINE__) will expand to "1234" whereas
@@ -260,7 +250,7 @@ virtual void Set##name (type _arg1, type _arg2) \
     this->name[1] = _arg2; \
     this->Modified(); \
     } \
-  } \
+  }; \
 void Set##name (type _arg[2]) \
   { \
   this->Set##name (_arg[0], _arg[1]); \
@@ -277,7 +267,7 @@ virtual void Get##name (type &_arg1, type &_arg2) \
     _arg1 = this->name[0]; \
     _arg2 = this->name[1]; \
   vtkDebugMacro(<< this->GetClassName() << " (" << this << "): returning " << #name " = (" << _arg1 << "," << _arg2 << ")"); \
-  } \
+  }; \
 virtual void Get##name (type _arg[2]) \
   { \
   this->Get##name (_arg[0], _arg[1]);\
@@ -294,7 +284,7 @@ virtual void Set##name (type _arg1, type _arg2, type _arg3) \
     this->name[2] = _arg3; \
     this->Modified(); \
     } \
-  } \
+  }; \
 virtual void Set##name (type _arg[3]) \
   { \
   this->Set##name (_arg[0], _arg[1], _arg[2]);\
@@ -312,7 +302,7 @@ virtual void Get##name (type &_arg1, type &_arg2, type &_arg3) \
     _arg2 = this->name[1]; \
     _arg3 = this->name[2]; \
   vtkDebugMacro(<< this->GetClassName() << " (" << this << "): returning " << #name " = (" << _arg1 << "," << _arg2 << "," << _arg3 << ")"); \
-  } \
+  }; \
 virtual void Get##name (type _arg[3]) \
   { \
   this->Get##name (_arg[0], _arg[1], _arg[2]);\
@@ -330,7 +320,7 @@ virtual void Set##name (type _arg1, type _arg2, type _arg3, type _arg4) \
     this->name[3] = _arg4; \
     this->Modified(); \
     } \
-  } \
+  }; \
 virtual void Set##name (type _arg[4]) \
   { \
   this->Set##name (_arg[0], _arg[1], _arg[2], _arg[3]);\
@@ -350,7 +340,7 @@ virtual void Get##name (type &_arg1, type &_arg2, type &_arg3, type &_arg4) \
     _arg3 = this->name[2]; \
     _arg4 = this->name[3]; \
   vtkDebugMacro(<< this->GetClassName() << " (" << this << "): returning " << #name " = (" << _arg1 << "," << _arg2 << "," << _arg3 << "," << _arg4 << ")"); \
-  } \
+  }; \
 virtual void Get##name (type _arg[4]) \
   { \
   this->Get##name (_arg[0], _arg[1], _arg[2], _arg[3]);\
@@ -370,7 +360,7 @@ virtual void Set##name (type _arg1, type _arg2, type _arg3, type _arg4, type _ar
     this->name[5] = _arg6; \
     this->Modified(); \
     } \
-  } \
+  }; \
 virtual void Set##name (type _arg[6]) \
   { \
   this->Set##name (_arg[0], _arg[1], _arg[2], _arg[3], _arg[4], _arg[5]);\
@@ -391,7 +381,7 @@ virtual void Get##name (type &_arg1, type &_arg2, type &_arg3, type &_arg4, type
     _arg5 = this->name[4]; \
     _arg6 = this->name[5]; \
   vtkDebugMacro(<< this->GetClassName() << " (" << this << "): returning " << #name " = (" << _arg1 << "," << _arg2 << "," << _arg3 << "," << _arg4 << "," << _arg5 <<"," << _arg6 << ")"); \
-  } \
+  }; \
 virtual void Get##name (type _arg[6]) \
   { \
   this->Get##name (_arg[0], _arg[1], _arg[2], _arg[3], _arg[4], _arg[5]);\
@@ -574,7 +564,7 @@ virtual vtkCoordinate *Get##name##Coordinate () \
     vtkDebugMacro(<< this->GetClassName() << " (" << this << "): returning " #name "Coordinate address " << this->name##Coordinate ); \
     return this->name##Coordinate; \
 } \
-virtual void Set##name(double x[3]) {this->Set##name(x[0],x[1],x[2]);} \
+virtual void Set##name(double x[3]) {this->Set##name(x[0],x[1],x[2]);}; \
 virtual void Set##name(double x, double y, double z) \
 { \
     this->name##Coordinate->SetValue(x,y,z); \
@@ -590,7 +580,7 @@ virtual vtkCoordinate *Get##name##Coordinate () \
     vtkDebugMacro(<< this->GetClassName() << " (" << this << "): returning " #name "Coordinate address " << this->name##Coordinate ); \
     return this->name##Coordinate; \
 } \
-virtual void Set##name(double x[2]) {this->Set##name(x[0],x[1]);} \
+virtual void Set##name(double x[2]) {this->Set##name(x[0],x[1]);}; \
 virtual void Set##name(double x, double y) \
 { \
     this->name##Coordinate->SetValue(x,y); \
@@ -647,6 +637,15 @@ virtual double *Get##name() \
   } \
   public:
 
+// Legacy versions of vtkTypeMacro and helpers.
+#if !defined(VTK_LEGACY_REMOVE)
+# define vtkExportedTypeRevisionMacro(thisClass,superclass,dllExport) \
+  vtkTypeMacro(thisClass,superclass)
+# define vtkTypeRevisionMacro(thisClass,superclass) \
+  vtkTypeMacro(thisClass,superclass)
+# define vtkCxxRevisionMacro(thisClass, revision)
+#endif
+
 // Macro to implement the instantiator's wrapper around the New()
 // method.  Use this macro if and only if vtkStandardNewMacro or
 // vtkObjectFactoryNewMacro is not used by the class.
@@ -792,7 +791,7 @@ virtual double *Get##name() \
 #else
   // Setup compile-time warnings for uses of deprecated methods if
   // possible on this compiler.
-# if defined(__GNUC__) && !defined(__INTEL_COMPILER)
+# if defined(__GNUC__) && !defined(__INTEL_COMPILER) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
 #  define VTK_LEGACY(method) method __attribute__((deprecated))
 # elif defined(_MSC_VER)
 #  define VTK_LEGACY(method) __declspec(deprecated) method
@@ -832,20 +831,5 @@ virtual double *Get##name() \
 // class is wrapped externally.
 #define VTK_WRAP_EXTERN
 
-//----------------------------------------------------------------------------
-// Switch case fall-through policy.
-
-// Use "VTK_FALLTHROUGH;" to annotate deliberate fall-through in switches,
-// use it analogously to "break;".  The trailing semi-colon is required.
-#if __cplusplus >= 201103L && defined(__has_warning)
-# if __has_feature(cxx_attributes) && __has_warning("-Wimplicit-fallthrough")
-#  define VTK_FALLTHROUGH [[clang::fallthrough]]
-# endif
-#endif
-
-#ifndef VTK_FALLTHROUGH
-# define VTK_FALLTHROUGH ((void)0)
-#endif
-
 #endif
 // VTK-HeaderTest-Exclude: vtkSetGet.h
diff --git a/Common/Core/vtkShortArray.h b/Common/Core/vtkShortArray.h
index a1d9e13..2a4a0b4 100644
--- a/Common/Core/vtkShortArray.h
+++ b/Common/Core/vtkShortArray.h
@@ -17,10 +17,6 @@
 // vtkShortArray is an array of values of type short.  It provides
 // methods for insertion and retrieval of values and will
 // automatically resize itself to hold new data.
-//
-// The C++ standard does not define the exact size of the short type,
-// so use of this type directly is discouraged.  If an array of 16 bit
-// integers is needed, prefer vtkTypeInt16Array to this class.
 
 #ifndef vtkShortArray_h
 #define vtkShortArray_h
diff --git a/Common/Core/vtkStringArray.cxx b/Common/Core/vtkStringArray.cxx
index 5e0ac18..f8e61c4 100644
--- a/Common/Core/vtkStringArray.cxx
+++ b/Common/Core/vtkStringArray.cxx
@@ -89,7 +89,7 @@ vtkStringArray::vtkStringArray()
 
 vtkStringArray::~vtkStringArray()
 {
-  if (!this->SaveUserArray)
+  if ((this->Array) && (!this->SaveUserArray))
     {
     delete [] this->Array;
     }
@@ -141,7 +141,7 @@ int vtkStringArray::Allocate(vtkIdType sz, vtkIdType)
 {
   if(sz > this->Size)
     {
-    if(!this->SaveUserArray)
+    if(this->Array && !this->SaveUserArray)
       {
       delete [] this->Array;
       }
@@ -166,7 +166,7 @@ int vtkStringArray::Allocate(vtkIdType sz, vtkIdType)
 
 void vtkStringArray::Initialize()
 {
-  if(!this->SaveUserArray)
+  if(this->Array && !this->SaveUserArray)
     {
     delete [] this->Array;
     }
@@ -211,7 +211,7 @@ void vtkStringArray::DeepCopy(vtkAbstractArray* aa)
     }
 
   // Free our previous memory.
-  if(!this->SaveUserArray)
+  if(this->Array && !this->SaveUserArray)
     {
     delete [] this->Array;
     }
@@ -456,10 +456,7 @@ void vtkStringArray::InsertValue(vtkIdType id, vtkStdString f)
 {
   if ( id >= this->Size )
     {
-    if (!this->ResizeAndExtend(id+1))
-      {
-      return;
-      }
+    this->ResizeAndExtend(id+1);
     }
   this->Array[id] = f;
   if ( id > this->MaxId )
@@ -496,7 +493,7 @@ unsigned long vtkStringArray::GetActualMemorySize( void )
     }
 
   return static_cast<unsigned long>(
-    ceil(static_cast<double>(totalSize) / 1024.0 )); // kibibytes
+    ceil(static_cast<double>(totalSize) / 1024.0 )); // kilobytes
 }
 
 // ----------------------------------------------------------------------------
diff --git a/Common/Core/vtkStringArray.h b/Common/Core/vtkStringArray.h
index cf446d8..685ea7d 100644
--- a/Common/Core/vtkStringArray.h
+++ b/Common/Core/vtkStringArray.h
@@ -231,7 +231,7 @@ public:
 //ETX
 
   // Description:
-  // Return the memory in kibibytes (1024 bytes) consumed by this data array. Used to
+  // Return the memory in kilobytes consumed by this data array. Used to
   // support streaming and reading/writing data. The value returned is
   // guaranteed to be greater than or equal to the memory required to
   // actually represent the data represented by this object. The
diff --git a/Common/Core/vtkTimeStamp.cxx b/Common/Core/vtkTimeStamp.cxx
index 9612e9f..f1386e5 100644
--- a/Common/Core/vtkTimeStamp.cxx
+++ b/Common/Core/vtkTimeStamp.cxx
@@ -20,7 +20,7 @@
 // We use the Schwarz Counter idiom to make sure that GlobalTimeStamp
 // is initialized before any other class uses it.
 
-#include "vtkAtomicTypes.h"
+#include "vtkAtomicInt.h"
 
 //-------------------------------------------------------------------------
 vtkTimeStamp* vtkTimeStamp::New()
@@ -33,9 +33,9 @@ vtkTimeStamp* vtkTimeStamp::New()
 void vtkTimeStamp::Modified()
 {
 #if VTK_SIZEOF_VOID_P == 8
-  static vtkAtomicInt64 GlobalTimeStamp(0);
+  static vtkAtomicInt<vtkTypeInt64> GlobalTimeStamp(0);
 #else
-  static vtkAtomicInt32 GlobalTimeStamp(0);
+  static vtkAtomicInt<vtkTypeInt32> GlobalTimeStamp(0);
 #endif
 
   this->ModifiedTime = (unsigned long)++GlobalTimeStamp;
diff --git a/Common/Core/vtkType.h b/Common/Core/vtkType.h
index 3525629..7401d1d 100644
--- a/Common/Core/vtkType.h
+++ b/Common/Core/vtkType.h
@@ -165,6 +165,12 @@
 # endif
 #endif
 
+/* Define compatibility names for these constants.  */
+#if !defined(VTK_LEGACY_REMOVE)
+# define VTK_LARGE_INTEGER VTK_INT_MAX
+# define VTK_LARGE_FLOAT VTK_FLOAT_MAX
+#endif
+
 /*--------------------------------------------------------------------------*/
 /* Define named types and constants corresponding to specific integer
    and floating-point sizes and signedness.  */
@@ -253,16 +259,16 @@ typedef double vtkTypeFloat64;
 /* Choose an implementation for vtkIdType.  */
 #define VTK_HAS_ID_TYPE
 #ifdef VTK_USE_64BIT_IDS
-# if defined(VTK_TYPE_USE_LONG_LONG) && VTK_SIZEOF_LONG_LONG == 8
-typedef long long vtkIdType;
-#  define VTK_SIZEOF_ID_TYPE VTK_SIZEOF_LONG_LONG
-#  define VTK_ID_MIN VTK_LONG_LONG_MIN
-#  define VTK_ID_MAX VTK_LONG_LONG_MAX
-# elif defined(VTK_SIZEOF_LONG) && VTK_SIZEOF_LONG == 8
+# if defined(VTK_SIZEOF_LONG) && VTK_SIZEOF_LONG == 8 && 0
 typedef long vtkIdType;
 #  define VTK_SIZEOF_ID_TYPE VTK_SIZEOF_LONG
 #  define VTK_ID_MIN VTK_LONG_MIN
 #  define VTK_ID_MAX VTK_LONG_MAX
+# elif defined(VTK_TYPE_USE_LONG_LONG) && VTK_SIZEOF_LONG_LONG == 8
+typedef long long vtkIdType;
+#  define VTK_SIZEOF_ID_TYPE VTK_SIZEOF_LONG_LONG
+#  define VTK_ID_MIN VTK_LONG_LONG_MIN
+#  define VTK_ID_MAX VTK_LONG_LONG_MAX
 # elif defined(VTK_TYPE_USE___INT64) && VTK_SIZEOF___INT64 == 8
 typedef __int64 vtkIdType;
 #  define VTK_SIZEOF_ID_TYPE VTK_SIZEOF___INT64
@@ -278,5 +284,19 @@ typedef int vtkIdType;
 # define VTK_ID_MAX VTK_INT_MAX
 #endif
 
+/*--------------------------------------------------------------------------*/
+/* Provide deprecated pre-VTK6 constant. */
+#if !defined(VTK_LEGACY_REMOVE)
+#  define VTK_LARGE_ID VTK_ID_MAX
+#endif
+
+/*--------------------------------------------------------------------------*/
+/* Define the type of floating point interface used for old and new
+   versions of VTK.  VTK 4.2 and older use float and VTK 4.4 and newer
+   use double for most of the API calls.  */
+#if !defined(VTK_LEGACY_REMOVE)
+#  define vtkFloatingPointType double
+#endif
+
 #endif
 // VTK-HeaderTest-Exclude: vtkType.h
diff --git a/Common/Core/vtkTypeTraits.h b/Common/Core/vtkTypeTraits.h
index 5f4d647..25b5442 100644
--- a/Common/Core/vtkTypeTraits.h
+++ b/Common/Core/vtkTypeTraits.h
@@ -123,7 +123,11 @@ VTK_TYPE_TRAITS(unsigned long, UNSIGNED_LONG, 0, UInt64, unsigned long, "%lu");
 # if VTK_SIZEOF_LONG_LONG == 8
 #  define VTK_TYPE_SIZED_LONG_LONG INT64
 #  define VTK_TYPE_SIZED_UNSIGNED_LONG_LONG UINT64
-#  define VTK_TYPE_LONG_LONG_FORMAT "%ll"
+#  if defined(_MSC_VER) && _MSC_VER < 1400
+#   define VTK_TYPE_LONG_LONG_FORMAT "%I64"
+#  else
+#   define VTK_TYPE_LONG_LONG_FORMAT "%ll"
+#  endif
 VTK_TYPE_TRAITS(long long, LONG_LONG, 1, Int64, long long,
                 VTK_TYPE_LONG_LONG_FORMAT "d");
 VTK_TYPE_TRAITS(unsigned long long, UNSIGNED_LONG_LONG, 0, UInt64,
diff --git a/Common/Core/vtkTypedArray.h b/Common/Core/vtkTypedArray.h
index b323078..07ef8cf 100644
--- a/Common/Core/vtkTypedArray.h
+++ b/Common/Core/vtkTypedArray.h
@@ -56,8 +56,17 @@ public:
   typedef typename vtkArray::CoordinateT CoordinateT;
   typedef typename vtkArray::SizeT SizeT;
 
+#if (defined(_MSC_VER) && _MSC_VER < 1400) || defined(__WRAP__)
+  vtkVariant GetVariantValue(vtkIdType i) { return this->vtkArray::GetVariantValue(i); }
+  vtkVariant GetVariantValue(vtkIdType i, vtkIdType j) { return this->vtkArray::GetVariantValue(i,j); }
+  vtkVariant GetVariantValue(vtkIdType i, vtkIdType j, vtkIdType k) { return this->vtkArray::GetVariantValue(i,j,k); }
+  void SetVariantValue(vtkIdType i, const vtkVariant& value) { this->vtkArray::SetVariantValue(i, value); }
+  void SetVariantValue(vtkIdType i, vtkIdType j, const vtkVariant& value) { this->vtkArray::SetVariantValue(i,j, value); }
+  void SetVariantValue(vtkIdType i, vtkIdType j, vtkIdType k, const vtkVariant& value) { this->vtkArray::SetVariantValue(i,j,k, value); }
+#else
   using vtkTypeTemplate<vtkTypedArray<T>, vtkArray>::GetVariantValue;
   using vtkTypeTemplate<vtkTypedArray<T>, vtkArray>::SetVariantValue;
+#endif
 
   void PrintSelf(ostream &os, vtkIndent indent);
 
diff --git a/Common/Core/vtkTypedArray.h.in b/Common/Core/vtkTypedArray.h.in
index 9576b90..c8a4a8c 100644
--- a/Common/Core/vtkTypedArray.h.in
+++ b/Common/Core/vtkTypedArray.h.in
@@ -17,11 +17,6 @@
 // vtkType at VTK_TYPE_NAME@Array is an array of values of type vtkType at VTK_TYPE_NAME@.  It
 // provides methods for insertion and retrieval of values and will
 // automatically resize itself to hold new data.
-//
-// This array should be preferred for data of type @VTK_TYPE_NAME@ as this
-// array will use the correct underlying datatype based on the desired number of bits
-// and the current platform.  The superclass of this type will change depending on the
-// machine and compiler in use so that the data contained always uses the proper type.
 
 #ifndef vtkType at VTK_TYPE_NAME@Array_h
 #define vtkType at VTK_TYPE_NAME@Array_h
diff --git a/Common/Core/vtkTypedDataArray.txx b/Common/Core/vtkTypedDataArray.txx
index 6a4d44a..6bfd4d5 100644
--- a/Common/Core/vtkTypedDataArray.txx
+++ b/Common/Core/vtkTypedDataArray.txx
@@ -68,9 +68,9 @@ vtkTypedDataArray<Scalar>::FastDownCast(vtkAbstractArray *source)
         {
         return static_cast<vtkTypedDataArray<Scalar>*>(source);
         }
-      break;
+    default:
+      return NULL;
     }
-  return NULL;
 }
 
 #endif //vtkTypedDataArray_txx
diff --git a/Common/Core/vtkUnicodeStringArray.h b/Common/Core/vtkUnicodeStringArray.h
index 83c25d8..40fa906 100644
--- a/Common/Core/vtkUnicodeStringArray.h
+++ b/Common/Core/vtkUnicodeStringArray.h
@@ -64,7 +64,7 @@ public:
   virtual void Squeeze();
   virtual int Resize(vtkIdType numTuples);
   virtual void SetVoidArray(void *array, vtkIdType size, int save);
-  virtual unsigned long GetActualMemorySize(); // in bytes
+  virtual unsigned long GetActualMemorySize();
   virtual int IsNumeric();
   virtual vtkArrayIterator* NewIterator();
   virtual vtkVariant GetVariantValue(vtkIdType idx);
diff --git a/Common/Core/vtkUnsignedIntArray.h b/Common/Core/vtkUnsignedIntArray.h
index 1a326e5..8844471 100644
--- a/Common/Core/vtkUnsignedIntArray.h
+++ b/Common/Core/vtkUnsignedIntArray.h
@@ -17,10 +17,6 @@
 // vtkUnsignedIntArray is an array of values of type unsigned int.  It
 // provides methods for insertion and retrieval of values and will
 // automatically resize itself to hold new data.
-//
-// The C++ standard does not define the exact size of the unsigned int type,
-// so use of this type directly is discouraged.  If an array of 32 bit unsigned
-// integers is needed, prefer vtkTypeUInt32Array to this class.
 
 #ifndef vtkUnsignedIntArray_h
 #define vtkUnsignedIntArray_h
diff --git a/Common/Core/vtkUnsignedLongArray.h b/Common/Core/vtkUnsignedLongArray.h
index 36741a2..6813a49 100644
--- a/Common/Core/vtkUnsignedLongArray.h
+++ b/Common/Core/vtkUnsignedLongArray.h
@@ -17,12 +17,6 @@
 // vtkUnsignedLongArray is an array of values of type unsigned long.
 // It provides methods for insertion and retrieval of values and will
 // automatically resize itself to hold new data.
-//
-// The C++ standard does not define the exact size of the unsigned long type,
-// so use of this type directly is discouraged.  If an array of 32 bit
-// unsigned integers is needed, prefer vtkTypeUInt32Array to this class.
-// If an array of 64 bit unsigned integers is needed, prefer
-// vtkUTypeInt64Array to this class.
 
 #ifndef vtkUnsignedLongArray_h
 #define vtkUnsignedLongArray_h
diff --git a/Common/Core/vtkUnsignedLongLongArray.h b/Common/Core/vtkUnsignedLongLongArray.h
index 215d743..bd4aa2d 100644
--- a/Common/Core/vtkUnsignedLongLongArray.h
+++ b/Common/Core/vtkUnsignedLongLongArray.h
@@ -17,10 +17,6 @@
 // vtkUnsignedLongLongArray is an array of values of type unsigned long long.
 // It provides methods for insertion and retrieval of values and will
 // automatically resize itself to hold new data.
-//
-// This class should not be used directly, as it only exists on systems
-// where the unsigned long long type is defined.  If you need an unsigned
-// 64 bit integer data array, use vtkTypeUInt64Array instead.
 
 #ifndef vtkUnsignedLongLongArray_h
 #define vtkUnsignedLongLongArray_h
diff --git a/Common/Core/vtkUnsignedShortArray.h b/Common/Core/vtkUnsignedShortArray.h
index 7c7171f..b730ad0 100644
--- a/Common/Core/vtkUnsignedShortArray.h
+++ b/Common/Core/vtkUnsignedShortArray.h
@@ -17,10 +17,6 @@
 // vtkUnsignedShortArray is an array of values of type unsigned short.
 // It provides methods for insertion and retrieval of values and will
 // automatically resize itself to hold new data.
-//
-// The C++ standard does not define the exact size of the unsigned short type,
-// so use of this type directly is discouraged.  If an array of 16 bit
-// unsigned integers is needed, prefer vtkTypeUInt16Array to this class.
 
 #ifndef vtkUnsignedShortArray_h
 #define vtkUnsignedShortArray_h
diff --git a/Common/Core/vtkUnsigned__Int64Array.h b/Common/Core/vtkUnsigned__Int64Array.h
index a8dc590..bcea679 100644
--- a/Common/Core/vtkUnsigned__Int64Array.h
+++ b/Common/Core/vtkUnsigned__Int64Array.h
@@ -17,12 +17,6 @@
 // vtkUnsigned__Int64Array is an array of values of type unsigned __int64.
 // It provides methods for insertion and retrieval of values and will
 // automatically resize itself to hold new data.
-//
-// This class is intended to give an array of unsigned 64 bit integers
-// on systems where unsigned __int64 is the only unsigned 64 bit integer
-// type. If an array of unsigned 64 bit
-// integers is needed, prefer vtkTypeUInt64Array, which will always uses
-// the system's most appropriate datatype for unsigned 64 bit integers.
 
 #ifndef vtkUnsigned__Int64Array_h
 #define vtkUnsigned__Int64Array_h
diff --git a/Common/Core/vtkVariant.cxx b/Common/Core/vtkVariant.cxx
index 045adf8..82a7004 100644
--- a/Common/Core/vtkVariant.cxx
+++ b/Common/Core/vtkVariant.cxx
@@ -974,7 +974,7 @@ template <typename T>
 T vtkVariantStringToNumeric(vtkStdString str, bool* valid, T* vtkNotUsed(ignored) = 0)
 {
   vtksys_ios::istringstream vstr(str);
-  T data = 0;
+  T data;
   vstr >> data;
   if(!vstr.eof())
     {
diff --git a/Common/Core/vtkVariantArray.cxx b/Common/Core/vtkVariantArray.cxx
index 3f3dd99..f10dbd5 100644
--- a/Common/Core/vtkVariantArray.cxx
+++ b/Common/Core/vtkVariantArray.cxx
@@ -102,7 +102,7 @@ vtkVariantArray::vtkVariantArray()
 //----------------------------------------------------------------------------
 vtkVariantArray::~vtkVariantArray()
 {
-  if (!this->SaveUserArray)
+  if ((this->Array) && (!this->SaveUserArray))
     {
     delete [] this->Array;
     }
@@ -120,7 +120,7 @@ int vtkVariantArray::Allocate(vtkIdType sz, vtkIdType)
 {
   if(sz > this->Size)
     {
-    if(!this->SaveUserArray)
+    if(this->Array && !this->SaveUserArray)
       {
       delete [] this->Array;
       }
@@ -143,7 +143,7 @@ int vtkVariantArray::Allocate(vtkIdType sz, vtkIdType)
 //----------------------------------------------------------------------------
 void vtkVariantArray::Initialize()
 {
-  if(!this->SaveUserArray)
+  if(this->Array && !this->SaveUserArray)
     {
     delete [] this->Array;
     }
@@ -443,7 +443,7 @@ void vtkVariantArray::DeepCopy(vtkAbstractArray *aa)
     }
 
   // Free our previous memory.
-  if(!this->SaveUserArray)
+  if(this->Array && !this->SaveUserArray)
     {
     delete [] this->Array;
     }
@@ -454,7 +454,7 @@ void vtkVariantArray::DeepCopy(vtkAbstractArray *aa)
   this->SaveUserArray = 0;
   this->Array = new vtkVariant[this->Size];
 
-  for (int i = 0; i < (this->MaxId+1); ++i)
+  for (int i = 0; i < this->Size; ++i)
     {
     this->Array[i] = va->Array[i];
     }
@@ -597,7 +597,7 @@ unsigned long vtkVariantArray::GetActualMemorySize()
   totalSize = numPrims*sizeof(vtkVariant);
 
   return static_cast<unsigned long>(
-    ceil(static_cast<double>(totalSize) / 1024.0)); // kibibytes
+    ceil(static_cast<double>(totalSize) / 1024.0)); // kilobytes
 }
 
 //----------------------------------------------------------------------------
@@ -639,10 +639,7 @@ void vtkVariantArray::InsertValue(vtkIdType id, vtkVariant value)
 {
   if ( id >= this->Size )
     {
-    if (!this->ResizeAndExtend(id+1))
-      {
-      return;
-      }
+    this->ResizeAndExtend(id+1);
     }
   this->Array[id] = value;
   if ( id > this->MaxId )
diff --git a/Common/Core/vtkVariantArray.h b/Common/Core/vtkVariantArray.h
index a2e0a87..e36c445 100644
--- a/Common/Core/vtkVariantArray.h
+++ b/Common/Core/vtkVariantArray.h
@@ -175,7 +175,7 @@ public:
                             int save);
 
   // Description:
-  // Return the memory in kibibytes (1024 bytes) consumed by this data array. Used to
+  // Return the memory in kilobytes consumed by this data array. Used to
   // support streaming and reading/writing data. The value returned is
   // guaranteed to be greater than or equal to the memory required to
   // actually represent the data represented by this object. The
diff --git a/Common/Core/vtkVoidArray.cxx b/Common/Core/vtkVoidArray.cxx
index 54f8b34..99b8e57 100644
--- a/Common/Core/vtkVoidArray.cxx
+++ b/Common/Core/vtkVoidArray.cxx
@@ -98,10 +98,7 @@ void vtkVoidArray::InsertVoidPointer(vtkIdType id, void* p)
 {
   if ( id >= this->Size )
     {
-    if (!this->ResizeAndExtend(id+1))
-      {
-      return;
-      }
+    this->ResizeAndExtend(id+1);
     }
   this->Array[id] = p;
   if ( id >= this->NumberOfPointers )
diff --git a/Common/Core/vtkWin32ProcessOutputWindow.cxx b/Common/Core/vtkWin32ProcessOutputWindow.cxx
index ee72cfb..0c01dd3 100644
--- a/Common/Core/vtkWin32ProcessOutputWindow.cxx
+++ b/Common/Core/vtkWin32ProcessOutputWindow.cxx
@@ -95,7 +95,7 @@ int vtkWin32ProcessOutputWindow::Initialize()
 
   // Construct the executable name from the process id, pointer to
   // this output window instance, and a count.  This should be unique.
-  sprintf(exeName, "vtkWin32OWP_%" PRIdword "_%p_%u.exe",
+  sprintf(exeName, "vtkWin32OWP_%"PRIdword"_%p_%u.exe",
           GetCurrentProcessId(), this, this->Count++);
 
   // Allocate a buffer to hold the executable path.
diff --git a/Common/Core/vtkWindow.cxx b/Common/Core/vtkWindow.cxx
index 4cad518..724267b 100644
--- a/Common/Core/vtkWindow.cxx
+++ b/Common/Core/vtkWindow.cxx
@@ -32,7 +32,7 @@ vtkWindow::vtkWindow()
   strcpy( this->WindowName, windowname );
   this->Erase = 1;
   this->DoubleBuffer = 0;
-  this->DPI = 72;
+  this->DPI = 120;
   this->TileViewport[0] = 0;
   this->TileViewport[1] = 0;
   this->TileViewport[2] = 1.0;
diff --git a/Common/Core/vtkWindow.h b/Common/Core/vtkWindow.h
index 5cbba4a..3f54942 100644
--- a/Common/Core/vtkWindow.h
+++ b/Common/Core/vtkWindow.h
@@ -120,14 +120,7 @@ public:
   // Return a best estimate to the dots per inch of the display
   // device being rendered (or printed).
   vtkGetMacro(DPI,int);
-  vtkSetClampMacro(DPI,int,1,VTK_INT_MAX);
-
-  // Description:
-  // Attempt to detect and set the DPI of the display device by querying the
-  // system. Note that this is not supported on all backends, and this method
-  // will return false if the DPI could not be detected. Use GetDPI() to
-  // inspect the detected value.
-  virtual bool DetectDPI() { return false; }
+  vtkSetClampMacro(DPI,int,1,3000);
 
   // Description:
   // Create a window in memory instead of on the screen. This may not be
diff --git a/Common/Core/vtk__Int64Array.h b/Common/Core/vtk__Int64Array.h
index 606d223..538277b 100644
--- a/Common/Core/vtk__Int64Array.h
+++ b/Common/Core/vtk__Int64Array.h
@@ -17,11 +17,6 @@
 // vtk__Int64Array is an array of values of type __int64.
 // It provides methods for insertion and retrieval of values and will
 // automatically resize itself to hold new data.
-//
-// This class is intended to give an array of 64 bit integers on systems
-// where __int64 is the only 64 bit integer type.  If an array of 64 bit
-// integers is needed, prefer vtkTypeInt64Array, which will always uses
-// the system's most appropriate datatype for 64 bit integers.
 
 #ifndef vtk__Int64Array_h
 #define vtk__Int64Array_h
diff --git a/Common/DataModel/CMakeLists.txt b/Common/DataModel/CMakeLists.txt
index ca7cbc9..9c4f1fd 100644
--- a/Common/DataModel/CMakeLists.txt
+++ b/Common/DataModel/CMakeLists.txt
@@ -45,6 +45,7 @@ set(Module_SRCS
   vtkEdgeListIterator.cxx
   vtkEdgeTable.cxx
   vtkEmptyCell.cxx
+  vtkExplicitCell.cxx
   vtkExtractStructuredGridHelper.cxx
   vtkFieldData.cxx
   vtkGenericAdaptorCell.cxx
@@ -160,6 +161,7 @@ set(Module_SRCS
   vtkStructuredGrid.cxx
   vtkStructuredPointsCollection.cxx
   vtkStructuredPoints.cxx
+  vtkStructuredVisibilityConstraint.cxx
   vtkSuperquadric.cxx
   vtkTable.cxx
   vtkTensor.cxx
@@ -226,6 +228,7 @@ set_source_files_properties(
   vtkDataSet
   vtkDataSetGhostGenerator
   vtkDistributedGraphHelper
+  vtkExplicitCell
   vtkGenericAttribute
   vtkGenericAdaptorCell
   vtkGenericCellIterator
@@ -278,7 +281,6 @@ set_source_files_properties(
 
 set_source_files_properties(
   vtkCellType.h
-  vtkBoundingBox.cxx
   vtkColor.h
   vtkRect.h
   vtkVector.h
diff --git a/Common/DataModel/Testing/Cxx/CMakeLists.txt b/Common/DataModel/Testing/Cxx/CMakeLists.txt
index 9d4a7b5..b4731c8 100644
--- a/Common/DataModel/Testing/Cxx/CMakeLists.txt
+++ b/Common/DataModel/Testing/Cxx/CMakeLists.txt
@@ -11,8 +11,6 @@ vtk_add_test_cxx(${vtk-module}CxxTests tests
   TestDispatchers.cxx
   TestGenericCell.cxx
   TestGraph.cxx
-  TestGraph2.cxx
-  TestGraphAttributes.cxx
   TestHigherOrderCell.cxx
   TestImageDataFindCell.cxx
   TestImageDataInterpolation.cxx
@@ -20,7 +18,6 @@ vtk_add_test_cxx(${vtk-module}CxxTests tests
   TestInterpolationDerivs.cxx
   TestInterpolationFunctions.cxx
   TestPath.cxx
-  TestPentagonalPrism.cxx
   TestPixelExtent.cxx
   TestPointLocators.cxx
   TestPolyDataRemoveCell.cxx
@@ -29,7 +26,6 @@ vtk_add_test_cxx(${vtk-module}CxxTests tests
   TestPolyhedron1.cxx
   TestQuadraticPolygon.cxx
   TestSelectionSubtract.cxx
-  TestTable.cxx
   TestTreeBFSIterator.cxx
   TestTreeDFSIterator.cxx
   TestTriangle.cxx
@@ -49,14 +45,9 @@ vtk_add_test_cxx(${vtk-module}CxxTests tests
   TestStructuredData.cxx
   TestDataObjectTypes.cxx
   TestPolyDataRemoveDeletedCells.cxx
-  UnitTestCells.cxx
   )
 vtk_add_test_cxx(${vtk-module}CxxTests data_tests
   TestCellIterators.cxx,NO_VALID,NO_OUTPUT
-  TestCellLocator.cxx,NO_DATA
-  TestMeanValueCoordinatesInterpolation1.cxx
-  TestMeanValueCoordinatesInterpolation2.cxx
-  TestSmoothErrorMetric.cxx
   TestQuadraticPolygonFilters.cxx
   )
 vtk_add_test_cxx(${vtk-module}CxxTests output_tests
diff --git a/Common/DataModel/Testing/Cxx/CellLocator.cxx b/Common/DataModel/Testing/Cxx/CellLocator.cxx
new file mode 100644
index 0000000..0309db8
--- /dev/null
+++ b/Common/DataModel/Testing/Cxx/CellLocator.cxx
@@ -0,0 +1,275 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+  Module:    CellLocator.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 "vtkGenericCell.h"
+#include "vtkPointData.h"
+
+#include "vtkActor.h"
+#include "vtkCellLocator.h"
+#include "vtkCleanPolyData.h"
+#include "vtkCubeSource.h"
+#include "vtkIdList.h"
+#include "vtkLinearSubdivisionFilter.h"
+#include "vtkMaskFields.h"
+#include "vtkNew.h"
+#include "vtkPolyData.h"
+#include "vtkPolyDataMapper.h"
+#include "vtkProperty.h"
+#include "vtkRenderWindow.h"
+#include "vtkRenderWindowInteractor.h"
+#include "vtkRenderer.h"
+#include "vtkRenderer.h"
+#include "vtkSphereSource.h"
+#include "vtkTransform.h"
+#include "vtkTransformPolyDataFilter.h"
+#include "vtkTriangleFilter.h"
+
+#include "vtkRegressionTestImage.h"
+#include "vtkDebugLeaks.h"
+
+// This test reproduces the cell locator bug in FindCellsAlongLine
+int TestFindCellsAlongLine()
+{ // returns 1 for success and 0 for failure
+  // Generate a surface mesh
+  vtkNew<vtkCubeSource> source;
+  vtkNew<vtkMaskFields> removearrays;
+  removearrays->SetInputConnection(source->GetOutputPort());
+  removearrays->CopyAllOff();
+
+  vtkNew<vtkCleanPolyData> clean;
+  clean->SetInputConnection(removearrays->GetOutputPort());
+
+  vtkNew<vtkTransform> trans;
+  trans->RotateX(6);
+  trans->RotateY(9);
+  trans->RotateZ(3);
+
+  vtkNew<vtkTransformPolyDataFilter> transformer;
+  transformer->SetInputConnection(clean->GetOutputPort());
+  transformer->SetTransform(trans.GetPointer());
+
+  vtkNew<vtkTriangleFilter> triangulator;
+  triangulator->SetInputConnection(transformer->GetOutputPort());
+
+  vtkNew<vtkLinearSubdivisionFilter> subdivide;
+  subdivide->SetInputConnection(triangulator->GetOutputPort());
+  subdivide->SetNumberOfSubdivisions(4);
+  subdivide->Update();
+
+  vtkNew<vtkPolyData> surface;
+  surface->DeepCopy(subdivide->GetOutput());
+
+  // Create the standard locator
+  vtkNew<vtkCellLocator> cellLocator;
+  cellLocator->SetDataSet(surface.GetPointer());
+  cellLocator->BuildLocator();
+
+  // This line (p1,p2) together with the surface mesh
+  // generated above reproduces the bug
+  double p1[] = {0.897227, 0.0973691, 0.0389687};
+  double p2[] = {0.342117, 0.492077, 0.423446};
+  vtkNew<vtkIdList> cellIds;
+  cellLocator->FindCellsAlongLine(p1, p2, 0.0, cellIds.GetPointer());
+
+  if(cellIds->GetNumberOfIds() != 4)
+    {
+    vtkGenericWarningMacro("Wrong amount of intersected Ids " << cellIds->GetNumberOfIds());
+    return 0;
+    }
+
+  // these ids are the ones that should be in the list.
+  // if we uniquely add them the list size should still be 4.
+  cellIds->InsertUniqueId(657);
+  cellIds->InsertUniqueId(856);
+  cellIds->InsertUniqueId(1885);
+  cellIds->InsertUniqueId(1887);
+
+  if(cellIds->GetNumberOfIds() != 4)
+    {
+    vtkGenericWarningMacro("Wrong cell Ids in the list " << cellIds->GetNumberOfIds());
+    return 0;
+    }
+
+  return 1;
+}
+
+int CellLocator( int argc, char *argv[] )
+{
+  // kuhnan's sample code used to test
+  // vtkCellLocator::IntersectWithLine(...9 params...)
+
+  // sphere1: the outer sphere
+  vtkSphereSource *sphere1 = vtkSphereSource::New();
+  sphere1->SetThetaResolution(100);
+  sphere1->SetPhiResolution(100);
+  sphere1->SetRadius(1);
+  sphere1->Update();
+
+  // sphere2: the inner sphere
+  vtkSphereSource *sphere2 = vtkSphereSource::New();
+  sphere2->SetThetaResolution(100);
+  sphere2->SetPhiResolution(100);
+  sphere2->SetRadius(0.8);
+  sphere2->Update();
+
+  // the normals obtained from the outer sphere
+  vtkDataArray *sphereNormals = sphere1->GetOutput()->GetPointData()->GetNormals();
+
+  // the cell locator
+  vtkCellLocator* locator = vtkCellLocator::New();
+  locator->SetDataSet(sphere2->GetOutput());
+  locator->CacheCellBoundsOn();
+  locator->AutomaticOn();
+  locator->BuildLocator();
+
+  // init the counter and ray length
+  int numIntersected = 0;
+  double rayLen = 0.2000001; // = 1 - 0.8 + error tolerance
+  int sub_id;
+  vtkIdType cell_id;
+  double param_t, intersect[3], paraCoord[3];
+  double sourcePnt[3], destinPnt[3], normalVec[3];
+  vtkGenericCell *cell = vtkGenericCell::New();
+
+  // this loop traverses each point on the outer sphere (sphere1)
+  // and  looks for an intersection on the inner sphere (sphere2)
+  for ( int i = 0; i < sphere1->GetOutput()->GetNumberOfPoints(); i ++ )
+    {
+    sphere1->GetOutput()->GetPoint(i, sourcePnt);
+    sphereNormals->GetTuple(i, normalVec);
+
+    // cast a ray in the negative direction toward sphere1
+    destinPnt[0] = sourcePnt[0] - rayLen * normalVec[0];
+    destinPnt[1] = sourcePnt[1] - rayLen * normalVec[1];
+    destinPnt[2] = sourcePnt[2] - rayLen * normalVec[2];
+
+    if ( locator->IntersectWithLine(sourcePnt, destinPnt, 0.0010, param_t,
+                                    intersect, paraCoord, sub_id, cell_id, cell) )
+    numIntersected ++;
+    }
+
+  if ( numIntersected != 9802 )
+    {
+    int numMissed = 9802 - numIntersected;
+    cerr << "ERROR: " << numMissed << " ray-sphere intersections missed!!!" << endl;
+    cerr << "If on a non-WinTel32 platform, try rayLen = 0.200001 or 0.20001 for a new test." << endl;
+    return 1;
+    }
+  else
+    cout << "Passed: a total of 9802 ray-sphere intersections detected." << endl;
+
+  sphereNormals = NULL;
+  cell->Delete();
+  sphere1->Delete();
+  sphere2->Delete();
+  locator->Delete();
+
+  // below: the initial tests
+
+  vtkRenderer *renderer = vtkRenderer::New();
+  vtkRenderWindow *renWin = vtkRenderWindow::New();
+    renWin->AddRenderer(renderer);
+  vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();
+    iren->SetRenderWindow(renWin);
+
+  vtkSphereSource *sphere = vtkSphereSource::New();
+    sphere->SetThetaResolution(8); sphere->SetPhiResolution(8);
+    sphere->SetRadius(1.0);
+    sphere->Update();
+  vtkPolyDataMapper *sphereMapper = vtkPolyDataMapper::New();
+    sphereMapper->SetInputConnection(sphere->GetOutputPort());
+  vtkActor *sphereActor = vtkActor::New();
+    sphereActor->SetMapper(sphereMapper);
+
+  vtkSphereSource *spot = vtkSphereSource::New();
+    spot->SetPhiResolution(6);
+    spot->SetThetaResolution(6);
+    spot->SetRadius(0.1);
+
+  vtkPolyDataMapper *spotMapper = vtkPolyDataMapper::New();
+    spotMapper->SetInputConnection(spot->GetOutputPort());
+
+  // Build a locator
+  vtkCellLocator *cellLocator = vtkCellLocator::New();
+  cellLocator->SetDataSet(sphere->GetOutput());
+  cellLocator->BuildLocator();
+
+  // Intersect with line
+  double p1[] = {2.0, 1.0, 3.0};
+  double p2[] = {0.0, 0.0, 0.0};
+  double t;
+  double ptline[3], pcoords[3];
+  int subId;
+  cellLocator->IntersectWithLine(p1, p2, 0.001, t, ptline, pcoords, subId);
+
+  vtkActor *intersectLineActor = vtkActor::New();
+    intersectLineActor->SetMapper(spotMapper);
+    intersectLineActor->SetPosition(ptline[0],ptline[1],ptline[2]);
+    intersectLineActor->GetProperty()->SetColor(1.0, 0.0, 0.0);
+
+  // Find closest point
+  vtkIdType cellId;
+  double dist;
+  p1[0] = -2.4; p1[1] = -0.9;
+  cellLocator->FindClosestPoint(p1, ptline, cellId, subId, dist);
+  vtkActor *closestPointActor = vtkActor::New();
+    closestPointActor->SetMapper(spotMapper);
+    closestPointActor->SetPosition(ptline[0],ptline[1],ptline[2]);
+    closestPointActor->GetProperty()->SetColor(0.0, 1.0, 0.0);
+
+  // Find closest point within radius
+  float radius = 5.0;
+  p1[0] = .2; p1[1] = 1.0; p1[2] = 1.0;
+  cellLocator->FindClosestPointWithinRadius(p1, radius, ptline, cellId, subId, dist);
+  vtkActor *closestPointActor2 = vtkActor::New();
+    closestPointActor2->SetMapper(spotMapper);
+    closestPointActor2->SetPosition(ptline[0],ptline[1],ptline[2]);
+    closestPointActor2->GetProperty()->SetColor(0.0, 1.0, 0.0);
+
+  renderer->AddActor(sphereActor);
+  renderer->AddActor(intersectLineActor);
+  renderer->AddActor(closestPointActor);
+  renderer->AddActor(closestPointActor2);
+  renderer->SetBackground(1,1,1);
+  renWin->SetSize(300,300);
+
+  // interact with data
+  renWin->Render();
+
+  int retVal = vtkRegressionTestImage( renWin );
+  if ( retVal == vtkRegressionTester::DO_INTERACTOR)
+    {
+    iren->Start();
+    }
+
+  // Clean up
+  renderer->Delete();
+  renWin->Delete();
+  iren->Delete();
+  sphere->Delete();
+  sphereMapper->Delete();
+  sphereActor->Delete();
+  spot->Delete();
+  spotMapper->Delete();
+  intersectLineActor->Delete();
+  closestPointActor->Delete();
+  closestPointActor2->Delete();
+  cellLocator->FreeSearchStructure();
+  cellLocator->Delete();
+
+  retVal = retVal & TestFindCellsAlongLine();
+
+  return !retVal;
+}
diff --git a/Common/DataModel/Testing/Cxx/CellLocator2.cxx b/Common/DataModel/Testing/Cxx/CellLocator2.cxx
new file mode 100644
index 0000000..cf15f4b
--- /dev/null
+++ b/Common/DataModel/Testing/Cxx/CellLocator2.cxx
@@ -0,0 +1,199 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+  Module:    CellLocator.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 "vtkGenericCell.h"
+#include "vtkPointData.h"
+
+#include "vtkActor.h"
+#include "vtkCellTreeLocator.h"
+#include "vtkPolyData.h"
+#include "vtkPolyDataMapper.h"
+#include "vtkProperty.h"
+#include "vtkRenderWindow.h"
+#include "vtkRenderWindowInteractor.h"
+#include "vtkRenderer.h"
+#include "vtkRenderer.h"
+#include "vtkSphereSource.h"
+
+#include "vtkRegressionTestImage.h"
+#include "vtkDebugLeaks.h"
+
+int CellLocator2( int argc, char *argv[] )
+{
+  // kuhnan's sample code used to test
+  // vtkCellLocator::IntersectWithLine(...9 params...)
+
+  // sphere1: the outer sphere
+  vtkSphereSource *sphere1 = vtkSphereSource::New();
+  sphere1->SetThetaResolution(100);
+  sphere1->SetPhiResolution(100);
+  sphere1->SetRadius(1);
+  sphere1->Update();
+
+  // sphere2: the inner sphere
+  vtkSphereSource *sphere2 = vtkSphereSource::New();
+  sphere2->SetThetaResolution(100);
+  sphere2->SetPhiResolution(100);
+  sphere2->SetRadius(0.8);
+  sphere2->Update();
+
+  // the normals obtained from the outer sphere
+  vtkDataArray *sphereNormals = sphere1->GetOutput()->GetPointData()->GetNormals();
+
+  // the cell locator
+  vtkCellTreeLocator* locator = vtkCellTreeLocator::New();
+  locator->SetDataSet(sphere2->GetOutput());
+  //locator->CacheCellBoundsOn();
+  locator->AutomaticOn();
+  locator->BuildLocator();
+
+  // init the counter and ray length
+  int numIntersected = 0;
+  double rayLen = 0.2000001; // = 1 - 0.8 + error tolerance
+  int sub_id;
+  vtkIdType cell_id;
+  double param_t, intersect[3], paraCoord[3];
+  double sourcePnt[3], destinPnt[3], normalVec[3];
+  vtkGenericCell *cell = vtkGenericCell::New();
+
+  // this loop traverses each point on the outer sphere (sphere1)
+  // and  looks for an intersection on the inner sphere (sphere2)
+  for ( int i = 0; i < sphere1->GetOutput()->GetNumberOfPoints(); i ++ )
+    {
+    sphere1->GetOutput()->GetPoint(i, sourcePnt);
+    sphereNormals->GetTuple(i, normalVec);
+
+    // cast a ray in the negative direction toward sphere1
+    destinPnt[0] = sourcePnt[0] - rayLen * normalVec[0];
+    destinPnt[1] = sourcePnt[1] - rayLen * normalVec[1];
+    destinPnt[2] = sourcePnt[2] - rayLen * normalVec[2];
+
+    if ( locator->IntersectWithLine(sourcePnt, destinPnt, 0.0010, param_t,
+                                    intersect, paraCoord, sub_id, cell_id, cell) )
+    numIntersected ++;
+    }
+
+  if ( numIntersected != 9802 )
+    {
+    int numMissed = 9802 - numIntersected;
+    cerr << "ERROR: " << numMissed << " ray-sphere intersections missed!!!" << endl;
+    cerr << "If on a non-WinTel32 platform, try rayLen = 0.200001 or 0.20001 for a new test." << endl;
+    return 1;
+    }
+  else
+    cout << "Passed: a total of 9802 ray-sphere intersections detected." << endl;
+
+  sphereNormals = NULL;
+  cell->Delete();
+  sphere1->Delete();
+  sphere2->Delete();
+  locator->Delete();
+
+  // below: the initial tests
+
+  //vtkRenderer *renderer = vtkRenderer::New();
+  //vtkRenderWindow *renWin = vtkRenderWindow::New();
+  //  renWin->AddRenderer(renderer);
+  //vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();
+  //  iren->SetRenderWindow(renWin);
+
+  //vtkSphereSource *sphere = vtkSphereSource::New();
+  //  sphere->SetThetaResolution(8); sphere->SetPhiResolution(8);
+  //  sphere->SetRadius(1.0);
+  //  sphere->Update();
+  //vtkPolyDataMapper *sphereMapper = vtkPolyDataMapper::New();
+  //  sphereMapper->SetInputConnection(sphere->GetOutputPort());
+  //vtkActor *sphereActor = vtkActor::New();
+  //  sphereActor->SetMapper(sphereMapper);
+  //
+  //vtkSphereSource *spot = vtkSphereSource::New();
+  //  spot->SetPhiResolution(6);
+  //  spot->SetThetaResolution(6);
+  //  spot->SetRadius(0.1);
+
+  //vtkPolyDataMapper *spotMapper = vtkPolyDataMapper::New();
+  //  spotMapper->SetInputConnection(spot->GetOutputPort());
+
+  //// Build a locator
+  //vtkCellLocator *cellLocator = vtkCellLocator::New();
+  //cellLocator->SetDataSet(sphere->GetOutput());
+  //cellLocator->BuildLocator();
+
+  //// Intersect with line
+  //double p1[] = {2.0, 1.0, 3.0};
+  //double p2[] = {0.0, 0.0, 0.0};
+  //double t;
+  //double ptline[3], pcoords[3];
+  //int subId;
+  //cellLocator->IntersectWithLine(p1, p2, 0.001, t, ptline, pcoords, subId);
+
+  //vtkActor *intersectLineActor = vtkActor::New();
+  //  intersectLineActor->SetMapper(spotMapper);
+  //  intersectLineActor->SetPosition(ptline[0],ptline[1],ptline[2]);
+  //  intersectLineActor->GetProperty()->SetColor(1.0, 0.0, 0.0);
+
+  //// Find closest point
+  //vtkIdType cellId;
+  //double dist;
+  //p1[0] = -2.4; p1[1] = -0.9;
+  //cellLocator->FindClosestPoint(p1, ptline, cellId, subId, dist);
+  //vtkActor *closestPointActor = vtkActor::New();
+  //  closestPointActor->SetMapper(spotMapper);
+  //  closestPointActor->SetPosition(ptline[0],ptline[1],ptline[2]);
+  //  closestPointActor->GetProperty()->SetColor(0.0, 1.0, 0.0);
+
+  //// Find closest point within radius
+  //float radius = 5.0;
+  //p1[0] = .2; p1[1] = 1.0; p1[2] = 1.0;
+  //cellLocator->FindClosestPointWithinRadius(p1, radius, ptline, cellId, subId, dist);
+  //vtkActor *closestPointActor2 = vtkActor::New();
+  //  closestPointActor2->SetMapper(spotMapper);
+  //  closestPointActor2->SetPosition(ptline[0],ptline[1],ptline[2]);
+  //  closestPointActor2->GetProperty()->SetColor(0.0, 1.0, 0.0);
+  //
+  //renderer->AddActor(sphereActor);
+  //renderer->AddActor(intersectLineActor);
+  //renderer->AddActor(closestPointActor);
+  //renderer->AddActor(closestPointActor2);
+  //renderer->SetBackground(1,1,1);
+  //renWin->SetSize(300,300);
+
+  //// interact with data
+  //renWin->Render();
+
+  //int retVal = vtkRegressionTestImage( renWin );
+  //if ( retVal == vtkRegressionTester::DO_INTERACTOR)
+  //  {
+  //  iren->Start();
+  //  }
+
+  //// Clean up
+  //renderer->Delete();
+  //renWin->Delete();
+  //iren->Delete();
+  //sphere->Delete();
+  //sphereMapper->Delete();
+  //sphereActor->Delete();
+  //spot->Delete();
+  //spotMapper->Delete();
+  //intersectLineActor->Delete();
+  //closestPointActor->Delete();
+  //closestPointActor2->Delete();
+  //cellLocator->FreeSearchStructure();
+  //cellLocator->Delete();
+
+ // return !retVal;
+ return 0;
+}
diff --git a/Common/DataModel/Testing/Cxx/TestAMRBox.cxx b/Common/DataModel/Testing/Cxx/TestAMRBox.cxx
index 9a308c2..1aebc4f 100644
--- a/Common/DataModel/Testing/Cxx/TestAMRBox.cxx
+++ b/Common/DataModel/Testing/Cxx/TestAMRBox.cxx
@@ -36,11 +36,13 @@ int TestAMRBoxEquality()
 {
   int rc = 0;
 
+  double X0[3];
   double h[3];
   int    lo[3];
   int    hi[3];
 
   vtkAMRBox A, B, C, A2D;
+  X0[0] = X0[1] = X0[2] = 0.0;
   h[0]  = h[1]  = h[2]  = 1.0;
   lo[0] = lo[1] = lo[2] = 8;
   hi[0] = hi[1] = hi[2] = 16;
@@ -48,6 +50,7 @@ int TestAMRBoxEquality()
   Construct3DAMRBox( B, lo, hi );
   Construct2DAMRBox( A2D, lo, hi );
 
+  X0[0] = X0[1] = X0[2] = 0.0;
   h[0]  = h[1]  = h[2]  = 1.0;
   lo[0] = lo[1] = lo[2] = 16;
   hi[0] = hi[1] = hi[2] = 32;
@@ -75,11 +78,13 @@ int TestAMRBoxEquality()
 int TestAMRBoxAssignmentOperator()
 {
   int rc = 0;
+  double X0[3];
   double h[3];
   int    lo[3];
   int    hi[3];
 
   vtkAMRBox A, B;
+  X0[0] = X0[1] = X0[2] = 0.0;
   h[0]  = h[1]  = h[2]  = 1.0;
   lo[0] = lo[1] = lo[2] = 8;
   hi[0] = hi[1] = hi[2] = 16;
@@ -97,6 +102,7 @@ int TestAMRBoxAssignmentOperator()
 int TestAMRBoxCoarsenRefineOperators()
 {
   int rc = 0;
+  double X0[3];
   double h[3];
   int    lo[3];
   int    hi[3];
@@ -104,12 +110,14 @@ int TestAMRBoxCoarsenRefineOperators()
   vtkAMRBox A, A0, Ar;
 
   // Here is the initial AMR box
+  X0[0] = X0[1] = X0[2] = 0.0;
   h[0]  = h[1]  = h[2]  = 1.0;
   lo[0] = lo[1] = lo[2] = 8;
   hi[0] = hi[1] = hi[2] = 16;
   Construct3DAMRBox( A, lo, hi);
 
   // Here is the refined AMR box
+  X0[0] = X0[1] = X0[2] = 0.0;
   h[0]  = h[1]  = h[2]  = 0.5;
   lo[0] = lo[1] = lo[2] = 16;
   hi[0] = hi[1] = hi[2] = 33;
@@ -147,6 +155,7 @@ int TestAMRBoxShiftOperator()
 {
   int rc = 0;
 
+  double X0[3];
   double h[3];
   int    lo[3];
   int    hi[3];
@@ -154,6 +163,7 @@ int TestAMRBoxShiftOperator()
   vtkAMRBox A, A0, Ashifted;
 
   // Here is the initial AMR box
+  X0[0] = X0[1] = X0[2] = 0.0;
   h[0]  = h[1]  = h[2]  = 1.0;
   lo[0] = lo[1] = lo[2] = 8;
   hi[0] = hi[1] = hi[2] = 16;
@@ -165,6 +175,7 @@ int TestAMRBoxShiftOperator()
   shift[0] = shift[1] = shift[2] = 3;
 
   // Here is the shifted AMR box
+  X0[0] = X0[1] = X0[2] = 0.0;
   h[0]  = h[1]  = h[2]  = 1.0;
   lo[0] = lo[1] = lo[2] = 11;
   hi[0] = hi[1] = hi[2] = 19;
@@ -196,6 +207,7 @@ int TestAMRBoxGrowShrinkOperators()
 {
   int rc = 0;
 
+  double X0[3];
   double h[3];
   int    lo[3];
   int    hi[3];
@@ -203,6 +215,7 @@ int TestAMRBoxGrowShrinkOperators()
   vtkAMRBox A, A0, Agrown;
 
   // Here is the initial AMR box
+  X0[0] = X0[1] = X0[2] = 0.0;
   h[0]  = h[1]  = h[2]  = 1.0;
   lo[0] = lo[1] = lo[2] = 8;
   hi[0] = hi[1] = hi[2] = 16;
@@ -211,6 +224,7 @@ int TestAMRBoxGrowShrinkOperators()
   A0 = A;
 
   // Here is the initial AMR box
+  X0[0] = X0[1] = X0[2] = 0.0;
   h[0]  = h[1]  = h[2]  = 1.0;
   lo[0] = lo[1] = lo[2] = 6;
   hi[0] = hi[1] = hi[2] = 18;
@@ -237,6 +251,7 @@ int TestAMRBoxIntersection()
 {
   int rc = 0;
 
+  double X0[3];
   double h[3];
   int    lo[3];
   int    hi[3];
@@ -244,6 +259,7 @@ int TestAMRBoxIntersection()
   vtkAMRBox A0, A, B, I;
 
   // Here is the initial AMR box
+  X0[0] = X0[1] = X0[2] = 0.0;
   h[0]  = h[1]  = h[2]  = 1.0;
   lo[0] = lo[1] = lo[2] = 8;
   hi[0] = hi[1] = hi[2] = 16;
@@ -267,6 +283,7 @@ int TestAMRBoxIntersection()
   B.Shift( 2,2,2 );
 
   // Here is the expected box after intersecting
+  X0[0] = X0[1] = X0[2] = 0.0;
   h[0]  = h[1]  = h[2]  = 1.0;
   lo[0] = lo[1] = lo[2] = 10;
   hi[0] = hi[1] = hi[2] = 16;
@@ -295,6 +312,7 @@ int TestAMRBoxIntersection()
 int TestAMRBoxSerialization()
 {
   int rc = 0;
+  double X0[3];
   double h[3];
   int    lo[3];
   int    hi[3];
@@ -302,6 +320,7 @@ int TestAMRBoxSerialization()
   vtkAMRBox A;
 
   // Here is the initial AMR box
+  X0[0] = X0[1] = X0[2] = 0.0;
   h[0]  = h[1]  = h[2]  = 1.0;
   lo[0] = lo[1] = lo[2] = 8;
   hi[0] = hi[1] = hi[2] = 16;
diff --git a/Common/DataModel/Testing/Cxx/TestCellLocator.cxx b/Common/DataModel/Testing/Cxx/TestCellLocator.cxx
deleted file mode 100644
index 65d1eab..0000000
--- a/Common/DataModel/Testing/Cxx/TestCellLocator.cxx
+++ /dev/null
@@ -1,308 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    TestCellLocator.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 "vtkSmartPointer.h"
-#include "vtkDataArray.h"
-#include "vtkGenericCell.h"
-#include "vtkPointData.h"
-
-#include "vtkActor.h"
-#include "vtkCellLocator.h"
-#include "vtkCleanPolyData.h"
-#include "vtkCubeSource.h"
-#include "vtkIdList.h"
-#include "vtkLinearSubdivisionFilter.h"
-#include "vtkMaskFields.h"
-#include "vtkPolyData.h"
-#include "vtkPolyDataMapper.h"
-#include "vtkProperty.h"
-#include "vtkRenderWindow.h"
-#include "vtkRenderWindowInteractor.h"
-#include "vtkRenderer.h"
-#include "vtkRenderer.h"
-#include "vtkSphereSource.h"
-#include "vtkTransform.h"
-#include "vtkTransformPolyDataFilter.h"
-#include "vtkTriangleFilter.h"
-
-#include "vtkRegressionTestImage.h"
-#include "vtkDebugLeaks.h"
-
-// This test reproduces the cell locator bug in FindCellsAlongLine
-int TestFindCellsAlongLine()
-{ // returns 1 for success and 0 for failure
-  // Generate a surface mesh
-  vtkSmartPointer<vtkCubeSource> source =
-    vtkSmartPointer<vtkCubeSource>::New();
-  vtkSmartPointer<vtkMaskFields> removearrays =
-    vtkSmartPointer<vtkMaskFields>::New();
-  removearrays->SetInputConnection(source->GetOutputPort());
-  removearrays->CopyAllOff();
-
-  vtkSmartPointer<vtkCleanPolyData> clean =
-    vtkSmartPointer<vtkCleanPolyData>::New();
-  clean->SetInputConnection(removearrays->GetOutputPort());
-
-  vtkSmartPointer<vtkTransform> trans =
-    vtkSmartPointer<vtkTransform>::New();
-  trans->RotateX(6);
-  trans->RotateY(9);
-  trans->RotateZ(3);
-
-  vtkSmartPointer<vtkTransformPolyDataFilter> transformer =
-    vtkSmartPointer<vtkTransformPolyDataFilter>::New();
-  transformer->SetInputConnection(clean->GetOutputPort());
-  transformer->SetTransform(trans.GetPointer());
-
-  vtkSmartPointer<vtkTriangleFilter> triangulator =
-    vtkSmartPointer<vtkTriangleFilter>::New();
-  triangulator->SetInputConnection(transformer->GetOutputPort());
-
-  vtkSmartPointer<vtkLinearSubdivisionFilter> subdivide =
-    vtkSmartPointer<vtkLinearSubdivisionFilter>::New();
-  subdivide->SetInputConnection(triangulator->GetOutputPort());
-  subdivide->SetNumberOfSubdivisions(4);
-  subdivide->Update();
-
-  vtkSmartPointer<vtkPolyData> surface =
-    vtkSmartPointer<vtkPolyData>::New();
-  surface->DeepCopy(subdivide->GetOutput());
-
-  // Create the standard locator
-  vtkSmartPointer<vtkCellLocator> cellLocator =
-    vtkSmartPointer<vtkCellLocator>::New();
-  cellLocator->SetDataSet(surface.GetPointer());
-  cellLocator->BuildLocator();
-
-  // This line (p1,p2) together with the surface mesh
-  // generated above reproduces the bug
-  double p1[] = {0.897227, 0.0973691, 0.0389687};
-  double p2[] = {0.342117, 0.492077, 0.423446};
-  vtkSmartPointer<vtkIdList> cellIds =
-    vtkSmartPointer<vtkIdList>::New();
-  cellLocator->FindCellsAlongLine(p1, p2, 0.0, cellIds.GetPointer());
-
-  if(cellIds->GetNumberOfIds() != 4)
-    {
-    vtkGenericWarningMacro("Wrong amount of intersected Ids " << cellIds->GetNumberOfIds());
-    return 0;
-    }
-
-  // these ids are the ones that should be in the list.
-  // if we uniquely add them the list size should still be 4.
-  cellIds->InsertUniqueId(657);
-  cellIds->InsertUniqueId(856);
-  cellIds->InsertUniqueId(1885);
-  cellIds->InsertUniqueId(1887);
-
-  if(cellIds->GetNumberOfIds() != 4)
-    {
-    vtkGenericWarningMacro("Wrong cell Ids in the list " << cellIds->GetNumberOfIds());
-    return 0;
-    }
-
-  return 1;
-}
-
-int TestCellLocator( int argc, char *argv[] )
-{
-  // kuhnan's sample code used to test
-  // vtkCellLocator::IntersectWithLine(...9 params...)
-
-  // sphere1: the outer sphere
-  vtkSmartPointer<vtkSphereSource> sphere1 =
-    vtkSmartPointer<vtkSphereSource>::New();
-  sphere1->SetThetaResolution(100);
-  sphere1->SetPhiResolution(100);
-  sphere1->SetRadius(1);
-  sphere1->Update();
-
-  // sphere2: the inner sphere
-  vtkSmartPointer<vtkSphereSource> sphere2 =
-    vtkSmartPointer<vtkSphereSource>::New();
-  sphere2->SetThetaResolution(100);
-  sphere2->SetPhiResolution(100);
-  sphere2->SetRadius(0.8);
-  sphere2->Update();
-
-  // the normals obtained from the outer sphere
-  vtkDataArray *sphereNormals = sphere1->GetOutput()->GetPointData()->GetNormals();
-
-  // the cell locator
-  vtkSmartPointer<vtkCellLocator> locator =
-    vtkSmartPointer<vtkCellLocator>::New();
-  locator->SetDataSet(sphere2->GetOutput());
-  locator->CacheCellBoundsOn();
-  locator->AutomaticOn();
-  locator->BuildLocator();
-
-  // init the counter and ray length
-  int numIntersected = 0;
-  double rayLen = 0.200001; // = 1 - 0.8 + error tolerance
-  int sub_id;
-  vtkIdType cell_id;
-  double param_t, intersect[3], paraCoord[3];
-  double sourcePnt[3], destinPnt[3], normalVec[3];
-  vtkSmartPointer<vtkGenericCell> cell =
-    vtkSmartPointer<vtkGenericCell>::New();
-
-  // this loop traverses each point on the outer sphere (sphere1)
-  // and  looks for an intersection on the inner sphere (sphere2)
-  std::cout << "NumberOfPoints: "
-            << sphere1->GetOutput()->GetNumberOfPoints() << std::endl;
-  for ( int i = 0; i < sphere1->GetOutput()->GetNumberOfPoints(); i ++ )
-    {
-    sphere1->GetOutput()->GetPoint(i, sourcePnt);
-    sphereNormals->GetTuple(i, normalVec);
-
-    // cast a ray in the negative direction toward sphere1
-    destinPnt[0] = sourcePnt[0] - rayLen * normalVec[0];
-    destinPnt[1] = sourcePnt[1] - rayLen * normalVec[1];
-    destinPnt[2] = sourcePnt[2] - rayLen * normalVec[2];
-
-    if ( locator->IntersectWithLine(sourcePnt, destinPnt, 0.0010, param_t,
-                                    intersect, paraCoord, sub_id, cell_id, cell) )
-      {
-      numIntersected ++;
-      }
-    else
-      {
-      std::cout << "Missed intersection: "
-                << sourcePnt[0] << ", "
-                << sourcePnt[1] << ", "
-                << sourcePnt[2] << std::endl;
-      std::cout << "To: "
-                << destinPnt[0] << ", "
-                << destinPnt[1] << ", "
-                << destinPnt[2] << std::endl;
-      std::cout << "Normal: "
-                << normalVec[0] << ", "
-                << normalVec[1] << ", "
-                << normalVec[2] << std::endl;
-      }
-    }
-
-  if ( numIntersected != sphere1->GetOutput()->GetNumberOfPoints() )
-    {
-    int numMissed = sphere1->GetOutput()->GetNumberOfPoints() - numIntersected;
-    std::cerr << "ERROR: "
-              << numMissed << " ray-sphere intersections missed!!!"
-              << std::endl;
-    std::cerr << "If on a non-WinTel32 platform, try rayLen = 0.200001 or 0.20001 for a new test." << std::endl;
-    return 1;
-    }
-  else
-    {
-    std::cout << "Passed: a total of "
-              << sphere1->GetOutput()->GetNumberOfPoints()
-              << " ray-sphere intersections detected." << std::endl;
-    }
-  sphereNormals = NULL;
-
-  // below: the initial tests
-
-  vtkSmartPointer<vtkRenderer> renderer =
-    vtkSmartPointer<vtkRenderer>::New();
-  vtkSmartPointer<vtkRenderWindow> renWin =
-    vtkSmartPointer<vtkRenderWindow>::New();
-  renWin->AddRenderer(renderer);
-  vtkSmartPointer<vtkRenderWindowInteractor> iren =
-    vtkSmartPointer<vtkRenderWindowInteractor>::New();
-  iren->SetRenderWindow(renWin);
-
-  vtkSmartPointer<vtkSphereSource> sphere =
-    vtkSmartPointer<vtkSphereSource>::New();
-  sphere->SetThetaResolution(8); sphere->SetPhiResolution(8);
-  sphere->SetRadius(1.0);
-  sphere->Update();
-
-  vtkSmartPointer<vtkPolyDataMapper> sphereMapper =
-    vtkSmartPointer<vtkPolyDataMapper>::New();
-  sphereMapper->SetInputConnection(sphere->GetOutputPort());
-
-  vtkSmartPointer<vtkActor> sphereActor =
-    vtkSmartPointer<vtkActor>::New();
-  sphereActor->SetMapper(sphereMapper);
-
-  vtkSmartPointer<vtkSphereSource> spot =
-    vtkSmartPointer<vtkSphereSource>::New();
-  spot->SetPhiResolution(6);
-  spot->SetThetaResolution(6);
-  spot->SetRadius(0.1);
-
-  vtkSmartPointer<vtkPolyDataMapper> spotMapper =
-    vtkSmartPointer<vtkPolyDataMapper>::New();
-  spotMapper->SetInputConnection(spot->GetOutputPort());
-
-  // Build a locator
-  vtkSmartPointer<vtkCellLocator> cellLocator =
-    vtkSmartPointer<vtkCellLocator>::New();
-  cellLocator->SetDataSet(sphere->GetOutput());
-  cellLocator->BuildLocator();
-
-  // Intersect with line
-  double p1[] = {2.0, 1.0, 3.0};
-  double p2[] = {0.0, 0.0, 0.0};
-  double t;
-  double ptline[3], pcoords[3];
-  int subId;
-  cellLocator->IntersectWithLine(p1, p2, 0.001, t, ptline, pcoords, subId);
-
-  vtkSmartPointer<vtkActor> intersectLineActor =
-    vtkSmartPointer<vtkActor>::New();
-  intersectLineActor->SetMapper(spotMapper);
-  intersectLineActor->SetPosition(ptline[0],ptline[1],ptline[2]);
-  intersectLineActor->GetProperty()->SetColor(1.0, 0.0, 0.0);
-
-  // Find closest point
-  vtkIdType cellId;
-  double dist;
-  p1[0] = -2.4; p1[1] = -0.9;
-  cellLocator->FindClosestPoint(p1, ptline, cellId, subId, dist);
-  vtkSmartPointer<vtkActor> closestPointActor =
-    vtkSmartPointer<vtkActor>::New();
-  closestPointActor->SetMapper(spotMapper);
-  closestPointActor->SetPosition(ptline[0],ptline[1],ptline[2]);
-  closestPointActor->GetProperty()->SetColor(0.0, 1.0, 0.0);
-
-  // Find closest point within radius
-  float radius = 5.0;
-  p1[0] = .2; p1[1] = 1.0; p1[2] = 1.0;
-  cellLocator->FindClosestPointWithinRadius(p1, radius, ptline, cellId, subId, dist);
-  vtkSmartPointer<vtkActor> closestPointActor2 =
-    vtkSmartPointer<vtkActor>::New();
-  closestPointActor2->SetMapper(spotMapper);
-  closestPointActor2->SetPosition(ptline[0],ptline[1],ptline[2]);
-  closestPointActor2->GetProperty()->SetColor(0.0, 1.0, 0.0);
-
-  renderer->AddActor(sphereActor);
-  renderer->AddActor(intersectLineActor);
-  renderer->AddActor(closestPointActor);
-  renderer->AddActor(closestPointActor2);
-  renderer->SetBackground(1,1,1);
-  renWin->SetSize(300,300);
-
-  // interact with data
-  renWin->Render();
-
-  int retVal = vtkRegressionTestImage( renWin );
-  if ( retVal == vtkRegressionTester::DO_INTERACTOR)
-    {
-    iren->Start();
-    }
-
-  retVal = retVal & TestFindCellsAlongLine();
-
-  return !retVal;
-}
diff --git a/Common/DataModel/Testing/Cxx/TestCompositeDataSets.cxx b/Common/DataModel/Testing/Cxx/TestCompositeDataSets.cxx
index e1a518f..8f68f89 100644
--- a/Common/DataModel/Testing/Cxx/TestCompositeDataSets.cxx
+++ b/Common/DataModel/Testing/Cxx/TestCompositeDataSets.cxx
@@ -52,7 +52,7 @@ bool TestDataObjectTreeIterator()
           {
           vtkNew<vtkUniformGrid> child;
           blocks[parent]->SetBlock(
-            block, (block % 2) ? NULL : child.GetPointer());
+            block, block % 2 ? NULL : child.GetPointer());
           blocks[parent]->GetMetaData(block)->Set(
             vtkCompositeDataSet::NAME(), blockName.c_str());
           ++numLeaves;
diff --git a/Common/DataModel/Testing/Cxx/TestInterpolationDerivs.cxx b/Common/DataModel/Testing/Cxx/TestInterpolationDerivs.cxx
index b12002a..04f1d00 100644
--- a/Common/DataModel/Testing/Cxx/TestInterpolationDerivs.cxx
+++ b/Common/DataModel/Testing/Cxx/TestInterpolationDerivs.cxx
@@ -38,6 +38,7 @@
 #include "vtkWedge.h"
 
 // Subclass of vtkNonLinearCell
+//#include "vtkExplicitCell.h"
 #include "vtkQuadraticEdge.h"
 #include "vtkQuadraticHexahedron.h"
 #include "vtkQuadraticPyramid.h"
@@ -60,7 +61,7 @@
 
 
 template <class TCell>
-int TestOneInterpolationDerivs(double eps = VTK_EPSILON)
+int TestOneInterpolationDerivs()
 {
   TCell *cell = TCell::New();
   int numPts = cell->GetNumberOfPoints();
@@ -77,7 +78,7 @@ int TestOneInterpolationDerivs(double eps = VTK_EPSILON)
       {
       sum += derivs[j];
       }
-    if( fabs(sum) > eps )
+    if( fabs(sum) > VTK_EPSILON )
       {
       ++r;
       }
@@ -92,7 +93,7 @@ int TestOneInterpolationDerivs(double eps = VTK_EPSILON)
     {
     sum += derivs[j];
     }
-  if( fabs(sum) > eps )
+  if( fabs(sum) > VTK_EPSILON )
     {
     ++r;
     }
@@ -123,13 +124,14 @@ int TestInterpolationDerivs(int, char *[])
   //r += TestOneInterpolationDerivs<vtkConvexPointSet>(); // not implemented
   r += TestOneInterpolationDerivs<vtkHexagonalPrism>();
   r += TestOneInterpolationDerivs<vtkHexahedron>();
-  r += TestOneInterpolationDerivs<vtkPentagonalPrism>(1.e-05);
+  r += TestOneInterpolationDerivs<vtkPentagonalPrism>();
   r += TestOneInterpolationDerivs<vtkPyramid>();
   //r += TestOneInterpolationDerivs<vtkTetra>();
   r += TestOneInterpolationDerivs<vtkVoxel>();
   r += TestOneInterpolationDerivs<vtkWedge>();
 
   // Subclasses of vtkNonLinearCell
+  //r += TestOneInterpolationDerivs<vtkExplicitCell>(); // not implemented
   r += TestOneInterpolationDerivs<vtkQuadraticEdge>();
   r += TestOneInterpolationDerivs<vtkQuadraticHexahedron>();
   r += TestOneInterpolationDerivs<vtkQuadraticPyramid>();
diff --git a/Common/DataModel/Testing/Cxx/TestInterpolationFunctions.cxx b/Common/DataModel/Testing/Cxx/TestInterpolationFunctions.cxx
index 5fc2277..a0e7649 100644
--- a/Common/DataModel/Testing/Cxx/TestInterpolationFunctions.cxx
+++ b/Common/DataModel/Testing/Cxx/TestInterpolationFunctions.cxx
@@ -38,6 +38,7 @@
 #include "vtkWedge.h"
 
 // Subclass of vtkNonLinearCell
+//#include "vtkExplicitCell.h"
 #include "vtkQuadraticEdge.h"
 #include "vtkQuadraticHexahedron.h"
 #include "vtkQuadraticPyramid.h"
@@ -57,7 +58,7 @@
 #include "vtkCubicLine.h"
 
 template <class TCell>
-int TestOneInterpolationFunction(double eps = VTK_EPSILON)
+int TestOneInterpolationFunction()
 {
   TCell *cell = TCell::New();
   int numPts = cell->GetNumberOfPoints();
@@ -74,22 +75,20 @@ int TestOneInterpolationFunction(double eps = VTK_EPSILON)
       sum += sf[j];
       if(j == i)
         {
-        if( fabs(sf[j] - 1) > eps)
+        if( fabs(sf[j] - 1) > VTK_EPSILON)
           {
-          std::cout << "fabs(sf[" << j << "] - 1): " << fabs(sf[j] - 1) << std::endl;
           ++r;
           }
         }
       else
         {
-        if( fabs(sf[j] - 0) > eps )
+        if( fabs(sf[j] - 0) > VTK_EPSILON )
           {
-          std::cout << "fabs(sf[" << j << "] - 0): " << fabs(sf[j] - 0) << std::endl;
           ++r;
           }
         }
       }
-    if( fabs(sum - 1) > eps )
+    if( fabs(sum - 1) > VTK_EPSILON )
       {
       ++r;
       }
@@ -104,7 +103,7 @@ int TestOneInterpolationFunction(double eps = VTK_EPSILON)
     {
     sum += sf[j];
     }
-  if( fabs(sum - 1) > eps )
+  if( fabs(sum - 1) > VTK_EPSILON )
     {
     ++r;
     }
@@ -134,13 +133,14 @@ int TestInterpolationFunctions(int, char *[])
   //r += TestOneInterpolationFunction<vtkConvexPointSet>(); // not implemented
   r += TestOneInterpolationFunction<vtkHexagonalPrism>();
   r += TestOneInterpolationFunction<vtkHexahedron>();
-  r += TestOneInterpolationFunction<vtkPentagonalPrism>(1.e-5);
+  r += TestOneInterpolationFunction<vtkPentagonalPrism>();
   r += TestOneInterpolationFunction<vtkPyramid>();
   r += TestOneInterpolationFunction<vtkTetra>();
   r += TestOneInterpolationFunction<vtkVoxel>();
   r += TestOneInterpolationFunction<vtkWedge>();
 
   // Subclass of vtkNonLinearCell
+  //r += TestOneInterpolationFunction<vtkExplicitCell>(); // not implemented
   r += TestOneInterpolationFunction<vtkQuadraticEdge>();
   r += TestOneInterpolationFunction<vtkQuadraticHexahedron>();
   r += TestOneInterpolationFunction<vtkQuadraticPyramid>();
diff --git a/Common/DataModel/Testing/Cxx/TestPentagonalPrism.cxx b/Common/DataModel/Testing/Cxx/TestPentagonalPrism.cxx
deleted file mode 100644
index 95c1a21..0000000
--- a/Common/DataModel/Testing/Cxx/TestPentagonalPrism.cxx
+++ /dev/null
@@ -1,621 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    TestPentagonalPrism.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 "vtkSmartPointer.h"
-#include "vtkCellType.h"
-
-#include "vtkPentagonalPrism.h"
-#include "vtkHexagonalPrism.h"
-
-#include "vtkMathUtilities.h"
-#include "vtkPoints.h"
-#include "vtkCellArray.h"
-#include <sstream>
-#include <vector>
-#include <string>
-#include <map>
-
-vtkSmartPointer<vtkPentagonalPrism> MakePentagonalPrism();
-vtkSmartPointer<vtkHexagonalPrism> MakeHexagonalPrism();
-
-template<typename T> int TestCell(const VTKCellType cellType, vtkSmartPointer<T> cell);
-
-//----------------------------------------------------------------------------
-int TestPentagonalPrism(int, char*[])
-{
-  std::map<std::string,int> results;
-
-  results["PentagonalPrism"] = TestCell<vtkPentagonalPrism>(VTK_PENTAGONAL_PRISM, MakePentagonalPrism());
-  results["HexagonalPrism"] = TestCell<vtkHexagonalPrism>(VTK_HEXAGONAL_PRISM, MakeHexagonalPrism());
-
-  int status = 0;
-  std::cout << "----- Unit Test Summary -----" << std::endl;
-  std::map <std::string, int>::iterator it;
-  for (it = results.begin(); it != results.end(); ++it)
-    {
-    std:: cout << std::setw(25)
-               << it->first << " "  << (it->second ? " FAILED" : " OK")
-               << std::endl;
-    if (it->second != 0)
-      {
-      ++status;
-      }
-    }
-  if (status)
-    {
-    return EXIT_FAILURE;
-    }
-  return EXIT_SUCCESS;
-}
-
-vtkSmartPointer<vtkPentagonalPrism> MakePentagonalPrism()
-{
-  vtkSmartPointer<vtkPentagonalPrism> aPentagonalPrism =
-    vtkSmartPointer<vtkPentagonalPrism>::New();
-
-  aPentagonalPrism->GetPointIds()->SetId(0,0);
-  aPentagonalPrism->GetPointIds()->SetId(1,1);
-  aPentagonalPrism->GetPointIds()->SetId(2,2);
-  aPentagonalPrism->GetPointIds()->SetId(3,3);
-  aPentagonalPrism->GetPointIds()->SetId(4,4);
-  aPentagonalPrism->GetPointIds()->SetId(5,5);
-  aPentagonalPrism->GetPointIds()->SetId(6,6);
-  aPentagonalPrism->GetPointIds()->SetId(7,7);
-  aPentagonalPrism->GetPointIds()->SetId(8,8);
-  aPentagonalPrism->GetPointIds()->SetId(9,9);
-
-  aPentagonalPrism->GetPoints()->SetPoint(0, 11, 10, 10);
-  aPentagonalPrism->GetPoints()->SetPoint(1, 13, 10, 10);
-  aPentagonalPrism->GetPoints()->SetPoint(2, 14, 12, 10);
-  aPentagonalPrism->GetPoints()->SetPoint(3, 12, 14, 10);
-  aPentagonalPrism->GetPoints()->SetPoint(4, 10, 12, 10);
-  aPentagonalPrism->GetPoints()->SetPoint(5, 11, 10, 14);
-  aPentagonalPrism->GetPoints()->SetPoint(6, 13, 10, 14);
-  aPentagonalPrism->GetPoints()->SetPoint(7, 14, 12, 14);
-  aPentagonalPrism->GetPoints()->SetPoint(8, 12, 14, 14);
-  aPentagonalPrism->GetPoints()->SetPoint(9, 10, 12, 14);
-
-  return aPentagonalPrism;
-}
-
-vtkSmartPointer<vtkHexagonalPrism> MakeHexagonalPrism()
-{
-  vtkSmartPointer<vtkHexagonalPrism> aHexagonalPrism =
-    vtkSmartPointer<vtkHexagonalPrism>::New();
-  aHexagonalPrism->GetPointIds()->SetId(0,0);
-  aHexagonalPrism->GetPointIds()->SetId(1,1);
-  aHexagonalPrism->GetPointIds()->SetId(2,2);
-  aHexagonalPrism->GetPointIds()->SetId(3,3);
-  aHexagonalPrism->GetPointIds()->SetId(4,4);
-  aHexagonalPrism->GetPointIds()->SetId(5,5);
-  aHexagonalPrism->GetPointIds()->SetId(6,6);
-  aHexagonalPrism->GetPointIds()->SetId(7,7);
-  aHexagonalPrism->GetPointIds()->SetId(8,8);
-  aHexagonalPrism->GetPointIds()->SetId(9,9);
-  aHexagonalPrism->GetPointIds()->SetId(10,10);
-  aHexagonalPrism->GetPointIds()->SetId(11,11);
-
-  aHexagonalPrism->GetPoints()->SetPoint(0, 11, 10, 10);
-  aHexagonalPrism->GetPoints()->SetPoint(1, 13, 10, 10);
-  aHexagonalPrism->GetPoints()->SetPoint(2, 14, 12, 10);
-  aHexagonalPrism->GetPoints()->SetPoint(3, 13, 14, 10);
-  aHexagonalPrism->GetPoints()->SetPoint(4, 11, 14, 10);
-  aHexagonalPrism->GetPoints()->SetPoint(5, 10, 12, 10);
-  aHexagonalPrism->GetPoints()->SetPoint(6, 11, 10, 14);
-  aHexagonalPrism->GetPoints()->SetPoint(7, 13, 10, 14);
-  aHexagonalPrism->GetPoints()->SetPoint(8, 14, 12, 14);
-  aHexagonalPrism->GetPoints()->SetPoint(9, 13, 14, 14);
-  aHexagonalPrism->GetPoints()->SetPoint(10, 11, 14, 14);
-  aHexagonalPrism->GetPoints()->SetPoint(11, 10, 12, 14);
-
-  return aHexagonalPrism;
-}
-
-template<typename T> int TestCell(const VTKCellType cellType,
-                                  vtkSmartPointer<T> aCell)
-{
-  int status = 0;;
-  std::cout << "Testing " << aCell->GetClassName() << std::endl;
-
-  std::cout << "  Testing Print of an unitialized cell...";
-  std::ostringstream cellPrint;
-  aCell->Print(cellPrint);
-  std::cout << "PASSED" << std::endl;
-
-  std::cout << "  Testing GetCellType...";
-  if (cellType != aCell->GetCellType())
-    {
-    std::cout << "Expected " << cellType
-              << " but got " << aCell->GetCellType()
-              << " FAILED" << std::endl;
-    ++status;
-    }
-  else
-    {
-    std::cout << "PASSED" << std::endl;
-    }
-
-  std::cout << "  Testing GetCellDimension...";
-  std::cout << aCell->GetCellDimension();
-  std::cout << "...PASSED" << std::endl;
-
-  std::cout << "  Testing IsLinear...";
-  if (aCell->IsLinear() != 1)
-    {
-    ++status;
-    std::cout << "...FAILED" << std::endl;
-    }
-  else
-    {
-    std::cout << "...PASSED" << std::endl;
-    }
-
-  std::cout << "  Testing IsPrimaryCell...";
-  std::cout << aCell->IsPrimaryCell();
-  std::cout << "...PASSED" << std::endl;
-
-  std::cout << "  Testing IsExplicitCell...";
-  std::cout << aCell->IsExplicitCell();
-  std::cout << "...PASSED" << std::endl;
-
-  std::cout << "  Testing RequiresInitialization...";
-  std::cout << aCell->RequiresInitialization();
-  std::cout << "...PASSED" << std::endl;
-
-  std::cout << "  Testing RequiresExplicitFaceRepresentation...";
-  std::cout << aCell->RequiresExplicitFaceRepresentation();
-  std::cout << "...PASSED" << std::endl;
-
-  if (aCell->RequiresInitialization())
-    {
-    aCell->Initialize();
-    }
-  std::cout << "  Testing GetNumberOfPoints...";
-  std::cout << aCell->GetNumberOfPoints();
-  std::cout << "...PASSED" << std::endl;
-
-  std::cout << "  Testing GetNumberOfEdges...";
-  std::cout << aCell->GetNumberOfEdges();
-  std::cout << "...PASSED" << std::endl;
-
-  std::cout << "  Testing GetNumberOfFaces...";
-  std::cout << aCell->GetNumberOfFaces();
-  std::cout << "...PASSED" << std::endl;
-
-  std::cout << "  Testing GetParametricCoords...";
-  double *parametricCoords = aCell->GetParametricCoords();
-  if (aCell->IsPrimaryCell() && parametricCoords == NULL)
-    {
-    ++status;
-    std::cout << "...FAILED" << std::endl;
-    }
-  else
-    {
-    double *pweights = new double[aCell->GetNumberOfPoints()];
-    // The pcoords should correspond to the cell points
-    for (int p = 0; p < aCell->GetNumberOfPoints(); ++p)
-      {
-      double vertex[3];
-      aCell->GetPoints()->GetPoint(p, vertex);
-      int subId = 0;
-      double x[3];
-      aCell->EvaluateLocation(subId, parametricCoords + 3 * p, x, pweights);
-      if (!vtkMathUtilities::FuzzyCompare(
-            x[0], vertex[0], 1.e-3) ||
-          !vtkMathUtilities::FuzzyCompare(
-            x[1], vertex[1], 1.e-3) ||
-          !vtkMathUtilities::FuzzyCompare(
-            x[2], vertex[2], 1.e-3))
-        {
-        std::cout << "EvaluateLocation failed...";
-        std::cout << "pcoords[" << p << "]: "
-                  << parametricCoords[3 * p] << " "
-                  << parametricCoords[3 * p  + 1] << " "
-                  << parametricCoords[3 * p + 2] << std::endl;
-        std::cout << "x[" << p << "]: "
-                  << x[0] << " " << x[1] << " " << x[2] << std::endl;
-        std::cout << "...FAILED" << std::endl;
-        ++status;
-        }
-      }
-    delete [] pweights;
-    std::cout << "...PASSED" << std::endl;
-    }
-
-  std::cout << "  Testing GetBounds...";
-  double bounds[6];
-  aCell->GetBounds(bounds);
-  std::cout << bounds[0] << "," << bounds[1] << " "
-            << bounds[2] << "," << bounds[3] << " "
-            << bounds[4] << "," << bounds[5];
-  std::cout << "...PASSED" << std::endl;
-
-  std::cout << "  Testing GetParametricCenter...";
-  double pcenter[3], center[3];
-  pcenter[0] = pcenter[1] = pcenter[2] = -12345.0;
-  aCell->GetParametricCenter(pcenter);
-  std::cout << pcenter[0] << ", " << pcenter[1] << ", " << pcenter[2];
-  double *cweights = new double[aCell->GetNumberOfPoints()];
-  int pSubId = 0;
-  aCell->EvaluateLocation(pSubId, pcenter, center, cweights);
-  if (center[0] < bounds[0] || center[0] > bounds[1] ||
-      center[1] < bounds[2] || center[1] > bounds[3] ||
-      center[2] < bounds[4] || center[2] > bounds[5])
-    {
-    std::cout << "The computed center is not within the bounds of the cell" << std::endl;
-    std::cout << "bounds: "
-              << bounds[0] << "," << bounds[1] << " "
-              << bounds[2] << "," << bounds[3] << " "
-              << bounds[4] << "," << bounds[5]
-              << std::endl;
-    std::cout << "parametric center "
-              << pcenter[0] << ", " << pcenter[1] << ", " << pcenter[2] << " "
-              << "center: "
-              << center[0] << ", " << center[1] << ", " << center[2]
-              << std::endl;
-    std::cout << "...FAILED" << std::endl;
-    }
-  else
-    {
-    std::cout << "...PASSED" << std::endl;
-    }
-  delete []cweights;
-
-  std::cout << "  Testing GetParametricDistance...";
-  double pd = aCell->GetParametricDistance(pcenter);
-  if (pd == 0.0)
-    {
-    std::cout << "...PASSED" << std::endl;
-    }
-  else
-    {
-    ++status;
-    std::cout << "...FAILED" << std::endl;
-    }
-
-  std::cout << "  Testing CellBoundaries...";
-  vtkSmartPointer<vtkIdList> cellIds =
-    vtkSmartPointer<vtkIdList>::New();
-  int cellStatus = aCell->CellBoundary(0, pcenter, cellIds);
-  if (aCell->GetCellDimension() > 0 && cellStatus != 1)
-    {
-    ++status;
-    std::cout << "FAILED" << std::endl;
-    }
-  else
-    {
-    for (int c = 0; c < cellIds->GetNumberOfIds(); ++c)
-      {
-      std::cout << " " << cellIds->GetId(c) << ", ";
-      }
-    std::cout << "PASSED" << std::endl;
-    }
-
-  std::cout << "  Testing Derivatives...";
-  // Create scalars and set first scalar to 1.0
-  double *scalars = new double[aCell->GetNumberOfPoints()];
-  *scalars = 1.0;
-  for (int s = 1; s < aCell->GetNumberOfPoints(); ++s)
-    {
-    *(scalars + s) = 0.0;
-    }
-  double *derivs = new double[3];
-  *derivs = -12345.;
-  aCell->Derivatives(0, pcenter, scalars, 1, derivs);
-  std::cout << " "
-            << derivs[0] << " "
-            << derivs[1] << " "
-            << derivs[2] << " ";
-  delete [] derivs;
-  delete [] scalars;
-  std::cout << "...PASSED" << std::endl;
-
-  std::cout << "  Testing EvaluateLocation vertex matches pcoord...";
-  int status5 = 0;
-  double *locations = aCell->GetParametricCoords();
-  if (locations)
-    {
-    double *lweights = new double[aCell->GetNumberOfPoints()];
-    for (int l = 0; l < aCell->GetNumberOfPoints(); ++l)
-      {
-      double point[3];
-      double vertex[3];
-      aCell->GetPoints()->GetPoint(l, vertex);
-      int subId = 0;
-      aCell->EvaluateLocation(subId, locations + 3 * l, point, lweights);
-      for (int v = 0; v < 3; ++v)
-        {
-        if (!vtkMathUtilities::FuzzyCompare(
-              point[v], vertex[v],
-              1.e-3))
-          {
-          std::cout << " " << point[0] << ", " << point[1] << ", " << point[2] << " != "
-                    << vertex[0] << ", " << vertex[1] << ", " << vertex[2] << " " ;
-          std::cout << "eps ratio is: " << (point[v] - vertex[v])
-            / std::numeric_limits<double>::epsilon() << std::endl;
-
-          ++status5;
-          break;
-          }
-        }
-      }
-    delete []lweights;
-    }
-  if (status5)
-    {
-    std::cout << "...FAILED" << std::endl;
-    ++status;
-    }
-  else
-    {
-    std::cout << "...PASSED"<< std::endl;
-    }
-
-  std::cout << "  Testing EvaluatePosition pcoord matches vertex...";
-  // Each vertex should corrrespond to a pcoord.
-  int subId = 0;
-  int status6 = 0;
-  double *weights = new double[aCell->GetNumberOfPoints()];
-  double *vlocations = aCell->GetParametricCoords();
-  for (int i = 0; i < aCell->GetNumberOfPoints(); ++i)
-    {
-    int status61 = 0;
-    double closestPoint[3];
-    double point[3];
-    double pcoords[3];
-    double dist2;
-    aCell->GetPoints()->GetPoint(i, point);
-    aCell->EvaluatePosition( point, closestPoint, subId, pcoords, dist2, weights);
-    for (int v = 0; v < 3; ++v)
-      {
-      if (!vtkMathUtilities::FuzzyCompare(
-            *(vlocations + 3 * i + v) ,pcoords[v],
-            1.e-3))
-        {
-        ++status61;
-        }
-      }
-    if (status61)
-      {
-      std::cout << std::endl
-                << *(vlocations + 3 * i + 0) << ", "
-                << *(vlocations + 3 * i + 1) << ", "
-                << *(vlocations + 3 * i + 2)
-                << " != "
-                << pcoords[0] << ", "
-                << pcoords[1] << ", "
-                << pcoords[2] << " " ;
-      ++status6;
-      }
-    }
-  if (status6)
-    {
-    ++status;
-    std::cout << "...FAILED" << std::endl;
-    }
-  else
-    {
-    std::cout << "...PASSED" << std::endl;
-    }
-
-  std::cout << "  Testing EvaluatePosition in/out test...";
-
-  int status2 = 0;
-  std::vector<double *> testPoints;
-  std::vector<int> inOuts;
-  std::vector<std::string> typePoint;
-
-  // First test cell points
-  for (int i = 0; i < aCell->GetNumberOfPoints(); ++i)
-    {
-    double *point = new double[3];
-    aCell->GetPoints()->GetPoint(i, point);
-    testPoints.push_back(point);
-    inOuts.push_back(1);
-    typePoint.push_back("cell point");
-    }
-  // Then test center of cell
-  if (aCell->GetNumberOfPoints() > 0)
-    {
-    double *tCenter = new double[3];
-    aCell->EvaluateLocation(subId, pcenter, tCenter, weights);
-    testPoints.push_back(tCenter);
-    inOuts.push_back(1);
-    typePoint.push_back("cell center");
-    // Test a point above the cell
-    if (aCell->GetCellDimension() == 2)
-      {
-      double *above = new double[3];
-      above[0] = tCenter[0]; above[1] = tCenter[1];
-      above[2] = tCenter[2] + aCell->GetLength2();
-      testPoints.push_back(above);
-      inOuts.push_back(0);
-      typePoint.push_back("point above cell");
-      }
-    }
-
-  // Test points at the center of each edge
-  for (int e = 0; e < aCell->GetNumberOfEdges(); ++e)
-    {
-    double *eCenter = new double[3];
-    vtkCell *c = aCell->GetEdge(e);
-    c->GetParametricCenter(pcenter);
-    c->EvaluateLocation(subId, pcenter, eCenter, weights);
-    testPoints.push_back(eCenter);
-    typePoint.push_back("edge center");
-    inOuts.push_back(1);
-    }
-
-  // Test points at the center of each face
-  for (int f = 0; f < aCell->GetNumberOfFaces(); ++f)
-    {
-    double *fCenter = new double[3];
-    vtkCell *c = aCell->GetFace(f);
-    c->GetParametricCenter(pcenter);
-    c->EvaluateLocation(subId, pcenter, fCenter, weights);
-    testPoints.push_back(fCenter);
-    inOuts.push_back(1);
-    typePoint.push_back("face center");
-    }
-
-  // Test a point outside the cell
-  if (aCell->GetNumberOfPoints() > 0)
-    {
-    double *outside = new double[3];
-    outside[0] = outside[1] = outside[2] = -12345.0;
-    testPoints.push_back(outside);
-    inOuts.push_back(0);
-    typePoint.push_back("outside point");
-    }
-  for (size_t p = 0; p < testPoints.size(); ++p)
-    {
-    double closestPoint[3], pcoords[3], dist2;
-    int inOut = aCell->EvaluatePosition( testPoints[p], closestPoint, subId, pcoords, dist2, weights);
-    if ((inOut == 0 || inOut == -1) && inOuts[p] == 0)
-      {
-      delete []testPoints[p];
-      continue;
-      }
-    else if (inOut == 1 && dist2 == 0.0 && inOuts[p] == 1)
-      {
-      delete []testPoints[p];
-      continue;
-      }
-    else if (inOut == 1 && dist2 != 0.0 && inOuts[p] == 0)
-      {
-      delete []testPoints[p];
-      continue;
-      }
-    // inOut failed
-    std::cout << typePoint[p] << " failed inOut: " << inOut << " "
-              << "point: " <<testPoints[p][0] << ", " << testPoints[p][1] << ", " << testPoints[p][2] << "-> "
-              << "pcoords: " << pcoords[0] << ", " << pcoords[1] << ", " << pcoords[2] << ": "
-              << "closestPoint: " << closestPoint[0] << ", " << closestPoint[1] << ", " << closestPoint[2] << " "
-              << "dist2: " << dist2;
-    std::cout << " weights: ";
-    for (int w = 0; w < aCell->GetNumberOfPoints(); ++w)
-      {
-      std::cout << weights[w] << " ";
-      }
-    std::cout << std::endl;
-    delete []testPoints[p];
-    status2 += 1;
-    }
-  if (status2)
-    {
-    ++status;
-    std::cout << "FAILED" << std::endl;
-    }
-  else
-    {
-    std::cout << "PASSED" << std::endl;
-    }
-
-  if (aCell->GetNumberOfPoints() > 0 &&
-      aCell->GetCellDimension() > 1)
-    {
-    std::cout << "  Testing IntersectWithLine...";
-    double tol = 1.e-5;
-    double t;
-    double startPoint[3];
-    double endPoint[3];
-    double intersection[3], pintersection[3];
-    aCell->GetParametricCenter(pcenter);
-    aCell->EvaluateLocation(subId, pcenter, startPoint, weights);
-    endPoint[0] = startPoint[0];
-    endPoint[1] = startPoint[1];
-    endPoint[2] = startPoint[2] + aCell->GetLength2();
-    startPoint[2] = startPoint[2] - aCell->GetLength2();
-    int status3 = 0;
-    int result =
-      aCell->IntersectWithLine(
-        startPoint, endPoint,
-        tol,
-        t,
-        intersection,
-        pintersection,
-        subId);
-    if (result == 0)
-      {
-      ++status3;
-      }
-    else
-      {
-      std::cout << " t: " << t << " ";
-      }
-    startPoint[2] = endPoint[2] + aCell->GetLength2();
-    result =
-      aCell->IntersectWithLine(
-        startPoint, endPoint,
-        tol,
-        t,
-        intersection,
-        pintersection,
-        subId);
-    if (result == 1)
-      {
-      ++status3;
-      }
-
-    if (status3 != 0)
-      {
-      ++status;
-      std::cout << "...FAILED" << std::endl;
-      }
-    else
-      {
-      std::cout << "...PASSED" << std::endl;
-      }
-    }
-
-  // Triangulate
-  std::cout << "  Testing Triangulate...";
-  int index = 0;
-  vtkSmartPointer<vtkIdList> ptIds =
-    vtkSmartPointer<vtkIdList>::New();
-  ptIds->SetNumberOfIds(100);
-  vtkSmartPointer<vtkPoints> triPoints =
-    vtkSmartPointer<vtkPoints>::New();
-  aCell->Triangulate(index, ptIds, triPoints);
-  int pts = ptIds->GetNumberOfIds();
-  if (aCell->GetCellDimension() == 0)
-    {
-    std::cout << "Generated " << pts << " Points";
-    }
-  else if (aCell->GetCellDimension() == 1)
-    {
-    std::cout << "Generated " << pts / 2 << " Lines";
-    }
-  else if (aCell->GetCellDimension() == 2)
-    {
-    std::cout << "Generated " << pts / 3 << " Triangles";
-    }
-  else if (aCell->GetCellDimension() == 3)
-    {
-    std::cout << "Generated " << pts / 4 << " Tetra";
-    }
-  std::cout << "...PASSED" << std::endl;
-
-  if (status)
-    {
-    std::cout << aCell->GetClassName() << " FAILED" << std::endl;
-    }
-  else
-    {
-    std::cout << aCell->GetClassName() << " PASSED" << std::endl;
-    }
-  delete []weights;
-  return status;
-}
diff --git a/Common/DataModel/Testing/Cxx/TestPolyhedron0.cxx b/Common/DataModel/Testing/Cxx/TestPolyhedron0.cxx
index a586f31..3acda23 100644
--- a/Common/DataModel/Testing/Cxx/TestPolyhedron0.cxx
+++ b/Common/DataModel/Testing/Cxx/TestPolyhedron0.cxx
@@ -99,20 +99,20 @@ int TestPolyhedron0( int argc, char* argv[] )
 
   vtkCellArray * cell = ugrid0->GetCells();
   vtkIdTypeArray * pids = cell->GetData();
-  std::cout << "num of cells: " << cell->GetNumberOfCells() << std::endl;
-  std::cout << "num of tuples: " << pids->GetNumberOfTuples() << std::endl;
+  cout << "num of cells: " << cell->GetNumberOfCells() << endl;
+  cout << "num of tuples: " << pids->GetNumberOfTuples() << endl;
   for (int i = 0; i < pids->GetNumberOfTuples(); i++)
     {
-    std::cout << pids->GetValue(i) << " ";
+    cout << pids->GetValue(i) << " ";
     }
-  std::cout << std::endl;
-  cell->Print(std::cout);
+  cout << endl;
+  cell->Print(cout);
 
   // Print out basic information
-  std::cout << "Testing polyhedron is a cube of with bounds "
+  cout << "Testing polyhedron is a cube of with bounds "
             << "[-5, 5, -5, 5, -10, 10]. It has "
             << polyhedron->GetNumberOfEdges() << " edges and "
-            << polyhedron->GetNumberOfFaces() << " faces." << std::endl;
+            << polyhedron->GetNumberOfFaces() << " faces." << endl;
 
   double p1[3] = {-100,0,0};
   double p2[3] = { 100,0,0};
@@ -129,7 +129,7 @@ int TestPolyhedron0( int argc, char* argv[] )
   writer->SetFileName("test.vtu");
   writer->SetDataModeToAscii();
   writer->Update();
-  std::cout << "finished writing the polyhedron mesh to test.vth "<< std::endl;
+  cout << "finished writing the polyhedron mesh to test.vth "<< endl;
 
   //
   // test reader
@@ -137,7 +137,7 @@ int TestPolyhedron0( int argc, char* argv[] )
     vtkSmartPointer<vtkXMLUnstructuredGridReader>::New();
   reader->SetFileName("test.vtu");
   reader->Update();
-  std::cout << "finished reading the polyhedron mesh from test.vth "<< std::endl;
+  cout << "finished reading the polyhedron mesh from test.vth "<< endl;
 
   vtkUnstructuredGrid * ugrid = reader->GetOutput();
   polyhedron = vtkPolyhedron::SafeDownCast(ugrid->GetCell(0));
@@ -153,7 +153,7 @@ int TestPolyhedron0( int argc, char* argv[] )
   int numInts = polyhedron->IntersectWithLine(p1,p2,tol,t,x,pc,subId); //should be 2
   if (numInts != 2)
     {
-    cerr << "Expect 2 intersections, but get " << numInts << std::endl;
+    cerr << "Expect 2 intersections, but get " << numInts << endl;
     return EXIT_FAILURE;
     }
 
@@ -162,7 +162,7 @@ int TestPolyhedron0( int argc, char* argv[] )
   if (inside)
     {
     cerr << "Expect point [" << p1[0] << ", " << p1[1] << ", " << p1[2]
-              << "] to be outside the polyhedral, but it's inside." << std::endl;
+              << "] to be outside the polyhedral, but it's inside." << endl;
     return EXIT_FAILURE;
     }
 
@@ -171,7 +171,7 @@ int TestPolyhedron0( int argc, char* argv[] )
   if (!inside)
     {
     cerr << "Expect point [" << p2[0] << ", " << p2[1] << ", " << p2[2]
-              << "] to be inside the polyhedral, but it's outside." << std::endl;
+              << "] to be inside the polyhedral, but it's outside." << endl;
     return EXIT_FAILURE;
     }
 
@@ -182,29 +182,29 @@ int TestPolyhedron0( int argc, char* argv[] )
     {
     double v;
     poly->GetPointData()->GetScalars()->GetTuple(i, &v);
-    std::cout << v << " ";
+    cout << v << " ";
     }
-  std::cout << std::endl;
+  cout << endl;
 
   // case 0: point on the polyhedron
   x[0] = 5.0; x[1] = 0.0; x[2] = 0.0;
   polyhedron->EvaluatePosition(x, closestPoint, subId, pc, dist2, weights);
 
-  std::cout << "weights for point ["
-            << x[0] << ", " << x[1] << ", " << x[2] << "]:" << std::endl;
+  cout << "weights for point ["
+            << x[0] << ", " << x[1] << ", " << x[2] << "]:" << endl;
   for (int i = 0; i < 8; i++)
     {
-    std::cout << weights[i] << " ";
+    cout << weights[i] << " ";
     }
-  std::cout << std::endl;
+  cout << endl;
 
   double refWeights[8] = {0.0, 0.0, 0.0, 0.0, 0.25, 0.25, 0.25, 0.25};
   for (int i = 0; i < 8; i++)
     {
     if (!compare_double(refWeights[i], weights[i], 0.00001))
       {
-      std::cout << "Error computing the weights for a point on the polyhedron."
-              << std::endl;
+      cout << "Error computing the weights for a point on the polyhedron."
+              << endl;
       return EXIT_FAILURE;
       }
     }
@@ -212,16 +212,16 @@ int TestPolyhedron0( int argc, char* argv[] )
   double refClosestPoint[3] = {5.0, 0.0, 0.0};
   if (!compare_doublevec(closestPoint, refClosestPoint, 0.00001))
     {
-    std::cout << "Error finding the closet point of a point on the polyhedron."
-              << std::endl;
+    cout << "Error finding the closet point of a point on the polyhedron."
+              << endl;
     return EXIT_FAILURE;
     }
 
   double refDist2 = 0.0;
   if (!compare_double(dist2, refDist2, 0.000001))
     {
-    std::cout << "Error computing the distance for a point on the polyhedron."
-              << std::endl;
+    cout << "Error computing the distance for a point on the polyhedron."
+              << endl;
     return EXIT_FAILURE;
     }
 
@@ -229,29 +229,29 @@ int TestPolyhedron0( int argc, char* argv[] )
   x[0] = 0.0; x[1] = 0.0; x[2] = 0.0;
   polyhedron->EvaluatePosition(x, closestPoint, subId, pc, dist2, weights);
 
-  std::cout << "weights for point ["
-            << x[0] << ", " << x[1] << ", " << x[2] << "]:" << std::endl;
+  cout << "weights for point ["
+            << x[0] << ", " << x[1] << ", " << x[2] << "]:" << endl;
   for (int i = 0; i < 8; i++)
     {
-    std::cout << weights[i] << " ";
+    cout << weights[i] << " ";
     }
-  std::cout << std::endl;
+  cout << endl;
 
   double refWeights1[8] = {0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125, 0.125};
   for (int i = 0; i < 8; i++)
     {
     if (!compare_double(refWeights1[i], weights[i], 0.00001))
       {
-      std::cout << "Error computing the weights for a point inside the polyhedron."
-              << std::endl;
+      cout << "Error computing the weights for a point inside the polyhedron."
+              << endl;
       return EXIT_FAILURE;
       }
     }
 
   if (!compare_double(dist2, refDist2, 0.000001))
     {
-    std::cout << "Error computing the distance for a point inside the polyhedron."
-              << std::endl;
+    cout << "Error computing the distance for a point inside the polyhedron."
+              << endl;
     return EXIT_FAILURE;
     }
 
@@ -259,13 +259,13 @@ int TestPolyhedron0( int argc, char* argv[] )
   x[0] = 8.0; x[1] = 0.0; x[2] = 0.0;
   polyhedron->EvaluatePosition(x, closestPoint, subId, pc, dist2, weights);
 
-  std::cout << "weights for point ["
-            << x[0] << ", " << x[1] << ", " << x[2] << "]:" << std::endl;
+  cout << "weights for point ["
+            << x[0] << ", " << x[1] << ", " << x[2] << "]:" << endl;
   for (int i = 0; i < 8; i++)
     {
-    std::cout << weights[i] << " ";
+    cout << weights[i] << " ";
     }
-  std::cout << std::endl;
+  cout << endl;
 
   double refWeights2[8] = {0.0307, 0.0307, 0.0307, 0.0307,
                            0.2193, 0.2193, 0.2193, 0.2193};
@@ -273,24 +273,24 @@ int TestPolyhedron0( int argc, char* argv[] )
     {
     if (!compare_double(refWeights2[i], weights[i], 0.0001))
       {
-      std::cout << "Error computing the weights for a point outside the polyhedron."
-              << std::endl;
+      cout << "Error computing the weights for a point outside the polyhedron."
+              << endl;
       return EXIT_FAILURE;
       }
     }
 
   if (!compare_doublevec(closestPoint, refClosestPoint, 0.00001))
     {
-    std::cout << "Error finding the closet point of a point outside the polyhedron."
-              << std::endl;
+    cout << "Error finding the closet point of a point outside the polyhedron."
+              << endl;
     return EXIT_FAILURE;
     }
 
   refDist2 = 9.0;
   if (!compare_double(dist2, refDist2, 0.000001))
     {
-    std::cout << "Error computing the distance for a point outside the polyhedron."
-              << std::endl;
+    cout << "Error computing the distance for a point outside the polyhedron."
+              << endl;
     return EXIT_FAILURE;
     }
 
@@ -301,8 +301,8 @@ int TestPolyhedron0( int argc, char* argv[] )
   double refPoint[3] = {8.0, 0.0, 0.0};
   if (!compare_doublevec(refPoint, x, 0.00001))
     {
-    std::cout << "Error evaluate the point location for its parameter coordinate."
-              << std::endl;
+    cout << "Error evaluate the point location for its parameter coordinate."
+              << endl;
     return EXIT_FAILURE;
     }
 
@@ -310,8 +310,8 @@ int TestPolyhedron0( int argc, char* argv[] )
     {
     if (!compare_double(refWeights2[i], weights1[i], 0.0001))
       {
-      std::cout << "Error computing the weights based on parameter coordinates."
-              << std::endl;
+      cout << "Error computing the weights based on parameter coordinates."
+              << endl;
       return EXIT_FAILURE;
       }
     }
@@ -328,19 +328,19 @@ int TestPolyhedron0( int argc, char* argv[] )
     }
   polyhedron->Derivatives(subId, pc, values, 1, deriv);
 
-  std::cout << "derivative for point ["
-            << x[0] << ", " << x[1] << ", " << x[2] << "]:" << std::endl;
+  cout << "derivative for point ["
+            << x[0] << ", " << x[1] << ", " << x[2] << "]:" << endl;
   for (int i = 0; i < 3; i++)
     {
-    std::cout << deriv[i] << " ";
+    cout << deriv[i] << " ";
     }
-  std::cout << std::endl;
+  cout << endl;
 
   double refDeriv[3] = {0.0, 0.0, 0.05};
   if (!compare_doublevec(refDeriv, deriv, 0.00001))
     {
-    std::cout << "Error computing derivative for a point inside the polyhedron."
-              << std::endl;
+    cout << "Error computing derivative for a point inside the polyhedron."
+              << endl;
     return EXIT_FAILURE;
     }
 
@@ -350,20 +350,20 @@ int TestPolyhedron0( int argc, char* argv[] )
   vtkSmartPointer<vtkIdList> tetraIdList = vtkSmartPointer<vtkIdList>::New();
   polyhedron->Triangulate(0, tetraIdList, tetraPoints);
 
-  std::cout << std::endl << "Triangulation result:" << std::endl;
+  cout << endl << "Triangulation result:" << endl;
 
   for (int i = 0; i < tetraPoints->GetNumberOfPoints(); i++)
     {
     double *pt = tetraPoints->GetPoint(i);
-    std::cout << "point #" << i << ": [" << pt[0] << ", "
-      << pt[1] << ", " << pt[2] << "]" << std::endl;
+    cout << "point #" << i << ": [" << pt[0] << ", "
+      << pt[1] << ", " << pt[2] << "]" << endl;
     }
 
   vtkIdType * ids = tetraIdList->GetPointer(0);
   for (int i = 0; i < tetraIdList->GetNumberOfIds(); i+=4)
     {
-    std::cout << "tetra #" << i/4 << ":" << ids[i] << " "
-      << ids[i+1] << " " << ids[i+2] << " " << ids[i+3] << std::endl;
+    cout << "tetra #" << i/4 << ":" << ids[i] << " "
+      << ids[i+1] << " " << ids[i+2] << " " << ids[i+3] << endl;
     }
 
   vtkSmartPointer<vtkUnstructuredGrid> tetraGrid =
diff --git a/Common/DataModel/Testing/Cxx/TestQuadraticPolygonFilters.cxx b/Common/DataModel/Testing/Cxx/TestQuadraticPolygonFilters.cxx
index e1f58c8..e3289a5 100644
--- a/Common/DataModel/Testing/Cxx/TestQuadraticPolygonFilters.cxx
+++ b/Common/DataModel/Testing/Cxx/TestQuadraticPolygonFilters.cxx
@@ -207,10 +207,9 @@ int TestQuadraticPolygonFilters(int argc, char* argv[])
   if ( retVal == vtkRegressionTester::DO_INTERACTOR )
     {
     iren->Start();
-    retVal = vtkRegressionTester::PASSED;
     }
 
-  return (retVal == vtkRegressionTester::PASSED) ? EXIT_SUCCESS : EXIT_FAILURE;
+  return retVal;
 }
 
 int TestPicker(vtkRenderWindow *renWin, vtkRenderer *renderer)
diff --git a/Common/DataModel/Testing/Cxx/TestSmoothErrorMetric.cxx b/Common/DataModel/Testing/Cxx/TestSmoothErrorMetric.cxx
index f06495b..67c584c 100644
--- a/Common/DataModel/Testing/Cxx/TestSmoothErrorMetric.cxx
+++ b/Common/DataModel/Testing/Cxx/TestSmoothErrorMetric.cxx
@@ -23,7 +23,6 @@
 
 //#define WRITE_GENERIC_RESULT
 
-#include "vtkSmartPointer.h"
 #include "vtkActor.h"
 #include "vtkDebugLeaks.h"
 #include "vtkPointData.h"
@@ -62,18 +61,14 @@
 int TestSmoothErrorMetric(int argc, char* argv[])
 {
   // Standard rendering classes
-  vtkSmartPointer<vtkRenderer> renderer =
-    vtkSmartPointer< vtkRenderer>::New();
-  vtkSmartPointer<vtkRenderWindow> renWin =
-    vtkSmartPointer< vtkRenderWindow>::New();
+  vtkRenderer *renderer = vtkRenderer::New();
+  vtkRenderWindow *renWin = vtkRenderWindow::New();
   renWin->AddRenderer(renderer);
-  vtkSmartPointer<vtkRenderWindowInteractor> iren =
-    vtkSmartPointer< vtkRenderWindowInteractor>::New();
+  vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();
   iren->SetRenderWindow(renWin);
 
   // Load the mesh geometry and data from a file
-  vtkSmartPointer<vtkXMLUnstructuredGridReader> reader =
-    vtkSmartPointer< vtkXMLUnstructuredGridReader>::New();
+  vtkXMLUnstructuredGridReader *reader = vtkXMLUnstructuredGridReader::New();
   char *cfname = vtkTestUtilities::ExpandDataFileName(argc, argv, "Data/quadraticTetra01.vtu");
 //  char *cfname = vtkTestUtilities::ExpandDataFileName(argc, argv, "Data/quadTet2.vtu");
 // char *cfname = vtkTestUtilities::ExpandDataFileName(argc, argv, "Data/Test2_Volume.vtu");
@@ -87,16 +82,17 @@ int TestSmoothErrorMetric(int argc, char* argv[])
   reader->Update();
 
   // Initialize the bridge
-  vtkSmartPointer<vtkBridgeDataSet> ds=
-    vtkSmartPointer<vtkBridgeDataSet>::New();
+  vtkBridgeDataSet *ds=vtkBridgeDataSet::New();
   ds->SetDataSet( reader->GetOutput() );
+  reader->Delete();
+
 
   // Set the smooth error metric thresholds:
   // 1. for the geometric error metric
-  vtkSmartPointer<vtkSmoothErrorMetric> smoothError=
-    vtkSmartPointer<vtkSmoothErrorMetric>::New();
+  vtkSmoothErrorMetric *smoothError=vtkSmoothErrorMetric::New();
   smoothError->SetAngleTolerance(179);
   ds->GetTessellator()->GetErrorMetrics()->AddItem(smoothError);
+  smoothError->Delete();
 
   // 2. for the attribute error metric
 //  vtkAttributesErrorMetric *attributesError=vtkAttributesErrorMetric::New();
@@ -113,8 +109,7 @@ int TestSmoothErrorMetric(int argc, char* argv[])
   ds->PrintSelf(cout,indent);
 
   // Create the filter
-  vtkSmartPointer<vtkGenericGeometryFilter> geom =
-    vtkSmartPointer< vtkGenericGeometryFilter>::New();
+  vtkGenericGeometryFilter *geom = vtkGenericGeometryFilter::New();
   geom->SetInputData(ds);
 
   geom->Update(); //So that we can call GetRange() on the scalars
@@ -122,18 +117,16 @@ int TestSmoothErrorMetric(int argc, char* argv[])
   assert(geom->GetOutput()!=0);
 
   // This creates a blue to red lut.
-  vtkSmartPointer<vtkLookupTable> lut =
-    vtkSmartPointer< vtkLookupTable>::New();
+  vtkLookupTable *lut = vtkLookupTable::New();
   lut->SetHueRange (0.667, 0.0);
 
-  vtkSmartPointer<vtkPolyDataMapper> mapper =
-    vtkSmartPointer< vtkPolyDataMapper>::New();
+  vtkPolyDataMapper *mapper = vtkPolyDataMapper::New();
+//  mapper->SetLookupTable(lut);
 
   mapper->ScalarVisibilityOff();
 
 #if 0
-  vtkSmartPointer<vtkPolyDataNormals> normalGenerator=
-    vtkSmartPointer<vtkPolyDataNormals>::New();
+  vtkPolyDataNormals *normalGenerator=vtkPolyDataNormals::New();
   normalGenerator->SetFeatureAngle(0.1);
   normalGenerator->SetSplitting(1);
   normalGenerator->SetConsistency(0);
@@ -158,15 +151,13 @@ int TestSmoothErrorMetric(int argc, char* argv[])
       }
     }
 
-  vtkSmartPointer<vtkActor> actor =
-    vtkSmartPointer< vtkActor>::New();
+  vtkActor *actor = vtkActor::New();
   actor->SetMapper(mapper);
   renderer->AddActor(actor);
 
 #ifdef WRITE_GENERIC_RESULT
   // Save the result of the filter in a file
-  vtkSmartPointer<vtkXMLPolyDataWriter> writer=
-    vtkSmartPointer<vtkXMLPolyDataWriter>::New();
+  vtkXMLPolyDataWriter *writer=vtkXMLPolyDataWriter::New();
   writer->SetInputConnection(geom->GetOutputPort());
   writer->SetFileName("geometry.vtp");
   writer->SetDataModeToAscii();
@@ -184,5 +175,15 @@ int TestSmoothErrorMetric(int argc, char* argv[])
     iren->Start();
     }
 
+  // Cleanup
+  renderer->Delete();
+  renWin->Delete();
+  iren->Delete();
+  mapper->Delete();
+  actor->Delete();
+  geom->Delete();
+  ds->Delete();
+  lut->Delete();
+
   return !retVal;
 }
diff --git a/Common/DataModel/Testing/Cxx/TestTriangle.cxx b/Common/DataModel/Testing/Cxx/TestTriangle.cxx
index 9273aad..56f7cb6 100644
--- a/Common/DataModel/Testing/Cxx/TestTriangle.cxx
+++ b/Common/DataModel/Testing/Cxx/TestTriangle.cxx
@@ -21,7 +21,6 @@
 #include "vtkPoints.h"
 #include <limits>
 #include "vtkSmartPointer.h"
-#include "vtkNew.h"
 
 template<class A>
 bool fuzzyCompare(A a, A b) {
@@ -119,35 +118,5 @@ int TestTriangle(int,char *[])
     return EXIT_FAILURE;
     }
 
-  // Testing degenerated triangle
-  double pntDeg0[3] = { 0, 0, -10 };
-  double pntDeg1[3] = { 0, 0, 0 };
-  double pntDeg2[3] = { 0, 0, 10 };
-  vtkNew<vtkTriangle> triangleDeg;
-  triangleDeg->GetPoints()->SetPoint(0, pntDeg0);
-  triangleDeg->GetPoints()->SetPoint(1, pntDeg1);
-  triangleDeg->GetPoints()->SetPoint(2, pntDeg2);
-
-  double p1[3] = { 0, 1, 1 };
-  double p2[3] = { 0, -1, 1 };
-  double t;
-  double x[3];
-  double pcoords[3];
-  int subId;
-  double dEpsilon = std::numeric_limits<double>::epsilon();
-  if (triangleDeg->IntersectWithLine(p1, p2, dEpsilon, t, x, pcoords, subId) != 1
-     || x[0] != 0 || x[1] != 0 || x[2] != 1 || t != 0.5 || pcoords[0] != 1.1
-     || pcoords[1] != 0.55 || pcoords[2] != 0)
-    {
-    cerr<<"Error while intersecting degenerated triangle"<<endl;
-    return EXIT_FAILURE;
-    }
-  double p1b[3] = { 0, 1, 10.001 };
-  double p2b[3] = { 0, -1, 10.001 };
-  if (triangleDeg->IntersectWithLine(p1b, p2b, dEpsilon, t, x, pcoords, subId) != 0)
-    {
-    cerr<<"Error while intersecting degenerated triangle"<<endl;
-    return EXIT_FAILURE;
-    }
   return EXIT_SUCCESS;
 }
diff --git a/Common/DataModel/Testing/Cxx/UnitTestCells.cxx b/Common/DataModel/Testing/Cxx/UnitTestCells.cxx
deleted file mode 100644
index 22fb9d5..0000000
--- a/Common/DataModel/Testing/Cxx/UnitTestCells.cxx
+++ /dev/null
@@ -1,1365 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    UnitTestCells.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 "vtkSmartPointer.h"
-#include "vtkCellType.h"
-
-#include "vtkEmptyCell.h"
-#include "vtkVertex.h"
-#include "vtkPolyVertex.h"
-#include "vtkLine.h"
-#include "vtkPolyLine.h"
-#include "vtkTriangle.h"
-#include "vtkTriangleStrip.h"
-#include "vtkPolygon.h"
-#include "vtkQuad.h"
-#include "vtkPixel.h"
-#include "vtkVoxel.h"
-#include "vtkHexahedron.h"
-#include "vtkPyramid.h"
-#include "vtkTetra.h"
-#include "vtkPolyhedron.h"
-#include "vtkPentagonalPrism.h"
-#include "vtkHexagonalPrism.h"
-#include "vtkWedge.h"
-#include "vtkPolyhedron.h"
-
-#include "vtkQuadraticEdge.h"
-#include "vtkQuadraticLinearQuad.h"
-#include "vtkQuadraticLinearWedge.h"
-#include "vtkQuadraticHexahedron.h"
-#include "vtkQuadraticPolygon.h"
-#include "vtkQuadraticPyramid.h"
-#include "vtkQuadraticQuad.h"
-#include "vtkQuadraticTetra.h"
-#include "vtkQuadraticTriangle.h"
-#include "vtkQuadraticWedge.h"
-
-#include "vtkBiQuadraticQuad.h"
-#include "vtkBiQuadraticQuadraticHexahedron.h"
-#include "vtkBiQuadraticQuadraticWedge.h"
-#include "vtkBiQuadraticTriangle.h"
-#include "vtkTriQuadraticHexahedron.h"
-
-#include "vtkCubicLine.h"
-
-#include "vtkMathUtilities.h"
-#include "vtkMath.h"
-#include "vtkPoints.h"
-#include "vtkCellArray.h"
-#include <sstream>
-#include <vector>
-#include <string>
-#include <map>
-
-static vtkSmartPointer<vtkEmptyCell> MakeEmptyCell();
-static vtkSmartPointer<vtkVertex> MakeVertex();
-static vtkSmartPointer<vtkPolyVertex> MakePolyVertex();
-static vtkSmartPointer<vtkLine> MakeLine();
-static vtkSmartPointer<vtkPolyLine> MakePolyLine();
-static vtkSmartPointer<vtkTriangle> MakeTriangle();
-static vtkSmartPointer<vtkTriangleStrip> MakeTriangleStrip();
-static vtkSmartPointer<vtkPolygon> MakePolygon();
-static vtkSmartPointer<vtkQuad> MakeQuad();
-static vtkSmartPointer<vtkPixel> MakePixel();
-static vtkSmartPointer<vtkVoxel> MakeVoxel();
-static vtkSmartPointer<vtkHexahedron> MakeHexahedron();
-static vtkSmartPointer<vtkPyramid> MakePyramid();
-static vtkSmartPointer<vtkTetra> MakeTetra();
-static vtkSmartPointer<vtkWedge> MakeWedge();
-static vtkSmartPointer<vtkPentagonalPrism> MakePentagonalPrism();
-static vtkSmartPointer<vtkHexagonalPrism> MakeHexagonalPrism();
-static vtkSmartPointer<vtkPolyhedron> MakeCube();
-static vtkSmartPointer<vtkPolyhedron> MakeDodecahedron();
-
-static vtkSmartPointer<vtkQuadraticEdge> MakeQuadraticEdge();
-static vtkSmartPointer<vtkQuadraticHexahedron> MakeQuadraticHexahedron();
-static vtkSmartPointer<vtkQuadraticPolygon> MakeQuadraticPolygon();
-static vtkSmartPointer<vtkQuadraticLinearQuad> MakeQuadraticLinearQuad();
-static vtkSmartPointer<vtkQuadraticLinearWedge> MakeQuadraticLinearWedge();
-static vtkSmartPointer<vtkQuadraticPyramid> MakeQuadraticPyramid();
-static vtkSmartPointer<vtkQuadraticQuad> MakeQuadraticQuad();
-static vtkSmartPointer<vtkQuadraticTetra> MakeQuadraticTetra();
-static vtkSmartPointer<vtkQuadraticTriangle> MakeQuadraticTriangle();
-static vtkSmartPointer<vtkQuadraticWedge> MakeQuadraticWedge();
-
-static vtkSmartPointer<vtkBiQuadraticQuad> MakeBiQuadraticQuad();
-static vtkSmartPointer<vtkBiQuadraticQuadraticHexahedron> MakeBiQuadraticQuadraticHexahedron();
-static vtkSmartPointer<vtkBiQuadraticQuadraticWedge> MakeBiQuadraticQuadraticWedge();
-static vtkSmartPointer<vtkBiQuadraticTriangle> MakeBiQuadraticTriangle();
-static vtkSmartPointer<vtkTriQuadraticHexahedron> MakeTriQuadraticHexahedron();
-static vtkSmartPointer<vtkCubicLine> MakeCubicLine();
-
-template<typename T> int TestOneCell(const VTKCellType cellType, vtkSmartPointer<T> cell, int linear = 1);
-//----------------------------------------------------------------------------
-int UnitTestCells(int, char*[])
-{
-  std::map<std::string,int> results;
-
-  results["EmptyCell"] = TestOneCell<vtkEmptyCell>(VTK_EMPTY_CELL, MakeEmptyCell());
-  results["Vertex"] = TestOneCell<vtkVertex>(VTK_VERTEX, MakeVertex());
-  results["PolyVertex"] = TestOneCell<vtkPolyVertex>(VTK_POLY_VERTEX, MakePolyVertex());
-  results["Line"] = TestOneCell<vtkLine>(VTK_LINE, MakeLine());
-  results["PolyLine"] = TestOneCell<vtkPolyLine>(VTK_POLY_LINE, MakePolyLine());
-  results["Triangle"] = TestOneCell<vtkTriangle>(VTK_TRIANGLE, MakeTriangle());
-  results["TriangleStrip"] = TestOneCell<vtkTriangleStrip>(VTK_TRIANGLE_STRIP, MakeTriangleStrip());
-  results["Polygon"] = TestOneCell<vtkPolygon>(VTK_POLYGON, MakePolygon());
-  results["Pixel"] = TestOneCell<vtkPixel>(VTK_PIXEL, MakePixel());
-  results["Quad"] = TestOneCell<vtkQuad>(VTK_QUAD, MakeQuad());
-  results["Tetra"] = TestOneCell<vtkTetra>(VTK_TETRA, MakeTetra());
-  results["Voxel"] = TestOneCell<vtkVoxel>(VTK_VOXEL, MakeVoxel());
-  results["Hexahedron"] = TestOneCell<vtkHexahedron>(VTK_HEXAHEDRON, MakeHexahedron());
-  results["Wedge"] = TestOneCell<vtkWedge>(VTK_WEDGE, MakeWedge());
-  results["Pyramid"] = TestOneCell<vtkPyramid>(VTK_PYRAMID, MakePyramid());
-  results["PentagonalPrism"] = TestOneCell<vtkPentagonalPrism>(VTK_PENTAGONAL_PRISM, MakePentagonalPrism());
-  results["HexagonalPrism"] = TestOneCell<vtkHexagonalPrism>(VTK_HEXAGONAL_PRISM, MakeHexagonalPrism());
-  results["Polyhedron(Cube)"] = TestOneCell<vtkPolyhedron>(VTK_POLYHEDRON, MakeCube());
-  results["Polyhedron(Dodecahedron)"] = TestOneCell<vtkPolyhedron>(VTK_POLYHEDRON, MakeDodecahedron());
-
-  results["QuadraticEdge"] = TestOneCell<vtkQuadraticEdge>(VTK_QUADRATIC_EDGE, MakeQuadraticEdge(), 0);
-  results["QuadraticHexahedron"] = TestOneCell<vtkQuadraticHexahedron>(VTK_QUADRATIC_HEXAHEDRON, MakeQuadraticHexahedron(), 0);
-  results["QuadraticPolygon"] = TestOneCell<vtkQuadraticPolygon>(VTK_QUADRATIC_POLYGON, MakeQuadraticPolygon(), 0);
-  results["QuadraticLinearQuad"] = TestOneCell<vtkQuadraticLinearQuad>(VTK_QUADRATIC_LINEAR_QUAD, MakeQuadraticLinearQuad(), 0);
-  results["QuadraticLinearWedge"] = TestOneCell<vtkQuadraticLinearWedge>(VTK_QUADRATIC_LINEAR_WEDGE, MakeQuadraticLinearWedge(), 0);
-  results["QuadraticPyramid"] = TestOneCell<vtkQuadraticPyramid>(VTK_QUADRATIC_PYRAMID, MakeQuadraticPyramid(), 0);
-  results["QuadraticQuad"] = TestOneCell<vtkQuadraticQuad>(VTK_QUADRATIC_QUAD, MakeQuadraticQuad(), 0);
-  results["QuadraticTetra"] = TestOneCell<vtkQuadraticTetra>(VTK_QUADRATIC_TETRA, MakeQuadraticTetra(), 0);
-  results["QuadraticTrangle"] = TestOneCell<vtkQuadraticTriangle>(VTK_QUADRATIC_TRIANGLE, MakeQuadraticTriangle(), 0);
-  results["QuadraticWedge"] = TestOneCell<vtkQuadraticWedge>(VTK_QUADRATIC_WEDGE, MakeQuadraticWedge(), 0);
-
-  results["BiQuadraticQuad"] = TestOneCell<vtkBiQuadraticQuad>(VTK_BIQUADRATIC_QUAD, MakeBiQuadraticQuad(), 0);
-  results["BiQuadraticQuadraticHexahedron"] = TestOneCell<vtkBiQuadraticQuadraticHexahedron>(VTK_BIQUADRATIC_QUADRATIC_HEXAHEDRON, MakeBiQuadraticQuadraticHexahedron(), 0);
-  results["BiQuadraticQuadraticWedge"] = TestOneCell<vtkBiQuadraticQuadraticWedge>(VTK_BIQUADRATIC_QUADRATIC_WEDGE, MakeBiQuadraticQuadraticWedge(), 0);
-  results["BiQuadraticTrangle"] = TestOneCell<vtkBiQuadraticTriangle>(VTK_BIQUADRATIC_TRIANGLE, MakeBiQuadraticTriangle(), 0);
-  results["CubicLine"] = TestOneCell<vtkCubicLine>(VTK_CUBIC_LINE, MakeCubicLine(), 0);
-
-  results["TriQuadraticHexahedron"] = TestOneCell<vtkTriQuadraticHexahedron>(VTK_TRIQUADRATIC_HEXAHEDRON, MakeTriQuadraticHexahedron(), 0);
-
-  int status = 0;
-  std::cout << "----- Unit Test Summary -----" << std::endl;
-  std::map <std::string, int>::iterator it;
-  for (it = results.begin(); it != results.end(); ++it)
-    {
-    std:: cout << std::setw(25) << it->first << " "  << (it->second ? " FAILED" : " OK") << std::endl;
-    if (it->second != 0)
-      {
-      ++status;
-      }
-    }
-  if (status)
-    {
-    return EXIT_FAILURE;
-    }
-  return EXIT_SUCCESS;
-}
-
-vtkSmartPointer<vtkEmptyCell> MakeEmptyCell()
-{
-  vtkSmartPointer<vtkEmptyCell> anEmptyCell =
-    vtkSmartPointer<vtkEmptyCell>::New();
-  return anEmptyCell;
-}
-
-vtkSmartPointer<vtkVertex> MakeVertex()
-{
-  vtkSmartPointer<vtkVertex> aVertex =
-    vtkSmartPointer<vtkVertex>::New();
-  aVertex->GetPointIds()->SetId(0,0);
-  aVertex->GetPoints()->SetPoint (0, 10.0, 20.0, 30.0);
-
-  return aVertex;;
-}
-
-vtkSmartPointer<vtkPolyVertex> MakePolyVertex()
-{
-  vtkSmartPointer<vtkPolyVertex> aPolyVertex =
-    vtkSmartPointer<vtkPolyVertex>::New();
-  aPolyVertex->GetPointIds()->SetNumberOfIds(2);
-  aPolyVertex->GetPointIds()->SetId(0,0);
-  aPolyVertex->GetPointIds()->SetId(1,1);
-
-  aPolyVertex->GetPoints()->SetNumberOfPoints(2);
-  aPolyVertex->GetPoints()->SetPoint (0, 10.0, 20.0, 30.0);
-  aPolyVertex->GetPoints()->SetPoint (1, 30.0, 20.0, 10.0);
-
-  return aPolyVertex;;
-}
-
-vtkSmartPointer<vtkLine> MakeLine()
-{
-  vtkSmartPointer<vtkLine> aLine =
-    vtkSmartPointer<vtkLine>::New();
-  aLine->GetPointIds()->SetId(0,0);
-  aLine->GetPointIds()->SetId(1,1);
-  aLine->GetPoints()->SetPoint (0, 10.0, 20.0, 30.0);
-  aLine->GetPoints()->SetPoint (1, 30.0, 20.0, 10.0);
-  return aLine;;
-}
-
-vtkSmartPointer<vtkPolyLine> MakePolyLine()
-{
-  vtkSmartPointer<vtkPolyLine> aPolyLine =
-    vtkSmartPointer<vtkPolyLine>::New();
-  aPolyLine->GetPointIds()->SetNumberOfIds(3);
-  aPolyLine->GetPointIds()->SetId(0,0);
-  aPolyLine->GetPointIds()->SetId(1,1);
-  aPolyLine->GetPointIds()->SetId(2,2);
-
-  aPolyLine->GetPoints()->SetNumberOfPoints(3);
-  aPolyLine->GetPoints()->SetPoint (0, 10.0, 20.0, 30.0);
-  aPolyLine->GetPoints()->SetPoint (1, 10.0, 30.0, 30.0);
-  aPolyLine->GetPoints()->SetPoint (2, 10.0, 30.0, 40.0);
-
-  return aPolyLine;;
-}
-
-vtkSmartPointer<vtkTriangle> MakeTriangle()
-{
-  vtkSmartPointer<vtkTriangle> aTriangle =
-    vtkSmartPointer<vtkTriangle>::New();
-  aTriangle->GetPoints()->SetPoint(0, -10.0, -10.0, 0.0);
-  aTriangle->GetPoints()->SetPoint(1, 10.0, -10.0, 0.0);
-  aTriangle->GetPoints()->SetPoint(2, 10.0, 10.0, 0.0);
-  aTriangle->GetPointIds()->SetId(0, 0);
-  aTriangle->GetPointIds()->SetId(1, 1);
-  aTriangle->GetPointIds()->SetId(2, 2);
-  return aTriangle;
-}
-
-vtkSmartPointer<vtkTriangleStrip> MakeTriangleStrip()
-{
-  vtkSmartPointer<vtkTriangleStrip> aTriangleStrip =
-    vtkSmartPointer<vtkTriangleStrip>::New();
-  aTriangleStrip->GetPointIds()->SetNumberOfIds(4);
-  aTriangleStrip->GetPointIds()->SetId(0,0);
-  aTriangleStrip->GetPointIds()->SetId(1,1);
-  aTriangleStrip->GetPointIds()->SetId(2,2);
-  aTriangleStrip->GetPointIds()->SetId(3,3);
-
-  aTriangleStrip->GetPoints()->SetNumberOfPoints(4);
-  aTriangleStrip->GetPoints()->SetPoint (0, 10.0, 10.0, 10.0);
-  aTriangleStrip->GetPoints()->SetPoint (1, 12.0, 10.0, 10.0);
-  aTriangleStrip->GetPoints()->SetPoint (2, 11.0, 12.0, 10.0);
-  aTriangleStrip->GetPoints()->SetPoint (3, 13.0, 10.0, 10.0);
-
-  return aTriangleStrip;
-}
-
-vtkSmartPointer<vtkPolygon> MakePolygon()
-{
-  vtkSmartPointer<vtkPolygon> aPolygon =
-    vtkSmartPointer<vtkPolygon>::New();
-  aPolygon->GetPointIds()->SetNumberOfIds(4);
-  aPolygon->GetPointIds()->SetId(0,0);
-  aPolygon->GetPointIds()->SetId(1,1);
-  aPolygon->GetPointIds()->SetId(2,2);
-  aPolygon->GetPointIds()->SetId(3,3);
-
-  aPolygon->GetPoints()->SetNumberOfPoints(4);
-  aPolygon->GetPoints()->SetPoint(0, 0.0, 0.0, 0.0);
-  aPolygon->GetPoints()->SetPoint(1, 10.0, 0.0, 0.0);
-  aPolygon->GetPoints()->SetPoint(2, 10.0, 10.0, 0.0);
-  aPolygon->GetPoints()->SetPoint(3, 0.0, 10.0, 0.0);
-
-  return aPolygon;
-}
-
-vtkSmartPointer<vtkQuad> MakeQuad()
-{
-  vtkSmartPointer<vtkQuad> aQuad =
-    vtkSmartPointer<vtkQuad>::New();
-  aQuad->GetPoints()->SetPoint(0, -10.0, -10.0, 0.0);
-  aQuad->GetPoints()->SetPoint(1, 10.0, -10.0, 0.0);
-  aQuad->GetPoints()->SetPoint(2, 10.0, 10.0, 0.0);
-  aQuad->GetPoints()->SetPoint(3, -10.0, 10.0, 0.0);
-  aQuad->GetPointIds()->SetId(0, 0);
-  aQuad->GetPointIds()->SetId(1, 1);
-  aQuad->GetPointIds()->SetId(2, 2);
-  aQuad->GetPointIds()->SetId(2, 3);
-  return aQuad;
-}
-
-vtkSmartPointer<vtkPixel> MakePixel()
-{
-  vtkSmartPointer<vtkPixel> aPixel =
-    vtkSmartPointer<vtkPixel>::New();
-  aPixel->GetPointIds()->SetId(0,0);
-  aPixel->GetPointIds()->SetId(1,1);
-  aPixel->GetPointIds()->SetId(2,3);
-  aPixel->GetPointIds()->SetId(3,2);
-
-  aPixel->GetPoints()->SetPoint (0, 10.0, 10.0, 10.0);
-  aPixel->GetPoints()->SetPoint (1, 12.0, 10.0, 10.0);
-  aPixel->GetPoints()->SetPoint (3, 12.0, 12.0, 10.0);
-  aPixel->GetPoints()->SetPoint (2, 10.0, 12.0, 10.0);
-  return aPixel;
-}
-
-vtkSmartPointer<vtkVoxel> MakeVoxel()
-{
-  vtkSmartPointer<vtkVoxel> aVoxel =
-    vtkSmartPointer<vtkVoxel>::New();
-  aVoxel->GetPointIds()->SetId(0,0);
-  aVoxel->GetPointIds()->SetId(1,1);
-  aVoxel->GetPointIds()->SetId(2,3);
-  aVoxel->GetPointIds()->SetId(3,2);
-  aVoxel->GetPointIds()->SetId(4,4);
-  aVoxel->GetPointIds()->SetId(5,5);
-  aVoxel->GetPointIds()->SetId(6,7);
-  aVoxel->GetPointIds()->SetId(7,6);
-
-  aVoxel->GetPoints()->SetPoint(0, 10, 10, 10);
-  aVoxel->GetPoints()->SetPoint(1, 12, 10, 10);
-  aVoxel->GetPoints()->SetPoint(3, 12, 12, 10);
-  aVoxel->GetPoints()->SetPoint(2, 10, 12, 10);
-  aVoxel->GetPoints()->SetPoint(4, 10, 10, 12);
-  aVoxel->GetPoints()->SetPoint(5, 12, 10, 12);
-  aVoxel->GetPoints()->SetPoint(7, 12, 12, 12);
-  aVoxel->GetPoints()->SetPoint(6, 10, 12, 12);
-  return aVoxel;
-}
-
-vtkSmartPointer<vtkHexahedron> MakeHexahedron()
-{
-  vtkSmartPointer<vtkHexahedron> aHexahedron =
-    vtkSmartPointer<vtkHexahedron>::New();
-  aHexahedron->GetPointIds()->SetId(0,0);
-  aHexahedron->GetPointIds()->SetId(1,1);
-  aHexahedron->GetPointIds()->SetId(2,2);
-  aHexahedron->GetPointIds()->SetId(3,3);
-  aHexahedron->GetPointIds()->SetId(4,4);
-  aHexahedron->GetPointIds()->SetId(5,5);
-  aHexahedron->GetPointIds()->SetId(6,6);
-  aHexahedron->GetPointIds()->SetId(7,7);
-
-  aHexahedron->GetPoints()->SetPoint(0, 10, 10, 10);
-  aHexahedron->GetPoints()->SetPoint(1, 12, 10, 10);
-  aHexahedron->GetPoints()->SetPoint(2, 12, 12, 10);
-  aHexahedron->GetPoints()->SetPoint(3, 10, 12, 10);
-  aHexahedron->GetPoints()->SetPoint(4, 10, 10, 12);
-  aHexahedron->GetPoints()->SetPoint(5, 12, 10, 12);
-  aHexahedron->GetPoints()->SetPoint(6, 12, 12, 12);
-  aHexahedron->GetPoints()->SetPoint(7, 10, 12, 12);
-
-  return aHexahedron;
-}
-
-vtkSmartPointer<vtkPyramid> MakePyramid()
-{
-  vtkSmartPointer<vtkPyramid> aPyramid =
-    vtkSmartPointer<vtkPyramid>::New();
-  aPyramid->GetPointIds()->SetId(0, 0);
-  aPyramid->GetPointIds()->SetId(1, 1);
-  aPyramid->GetPointIds()->SetId(2, 2);
-  aPyramid->GetPointIds()->SetId(3, 3);
-  aPyramid->GetPointIds()->SetId(4, 4);
-
-  aPyramid->GetPoints()->SetPoint(0, 0, 0, 0);
-  aPyramid->GetPoints()->SetPoint(1, 1, 0, 0);
-  aPyramid->GetPoints()->SetPoint(2, 1, 1, 0);
-  aPyramid->GetPoints()->SetPoint(3, 0, 1, 0);
-  aPyramid->GetPoints()->SetPoint(4, .5, .5, 1);
-
-  return aPyramid;
-}
-
-vtkSmartPointer<vtkQuadraticPyramid> MakeQuadraticPyramid()
-{
-  vtkSmartPointer<vtkQuadraticPyramid> aPyramid =
-    vtkSmartPointer<vtkQuadraticPyramid>::New();
-  for (int i = 0; i < 13; ++i)
-    {
-    aPyramid->GetPointIds()->SetId(i, i);
-    }
-
-  aPyramid->GetPoints()->SetPoint(0, 0, 0, 0);
-  aPyramid->GetPoints()->SetPoint(1, 1, 0, 0);
-  aPyramid->GetPoints()->SetPoint(2, 1, 1, 0);
-  aPyramid->GetPoints()->SetPoint(3, 0, 1, 0);
-  aPyramid->GetPoints()->SetPoint(4, .5, .5, 1);
-
-  aPyramid->GetPoints()->SetPoint(5, 0.5, 0.0, 0.0);
-  aPyramid->GetPoints()->SetPoint(6, 1.0, 0.5, 0.0);
-  aPyramid->GetPoints()->SetPoint(7, 0.5, 1.0, 0.0);
-  aPyramid->GetPoints()->SetPoint(8, 0.0, 0.5, 0.0);
-
-  aPyramid->GetPoints()->SetPoint(9,  0.5,  0.5,  0.5);
-  aPyramid->GetPoints()->SetPoint(10, 0.75, 0.5,  0.5);
-  aPyramid->GetPoints()->SetPoint(11, 0.75, 0.75, 0.5);
-  aPyramid->GetPoints()->SetPoint(12, 0.5,  0.75, 0.5);
-
-  return aPyramid;
-}
-
-vtkSmartPointer<vtkQuadraticEdge> MakeQuadraticEdge()
-{
-  vtkSmartPointer<vtkQuadraticEdge> anEdge =
-    vtkSmartPointer<vtkQuadraticEdge>::New();
-  for (int i = 0; i < 3; ++i)
-    {
-    anEdge->GetPointIds()->SetId(i, i);
-    }
-
-  anEdge->GetPoints()->SetPoint(0, 0, 0, 0);
-  anEdge->GetPoints()->SetPoint(1, 1, 0, 0);
-  anEdge->GetPoints()->SetPoint(2, .5, 0, 0);
-
-  return anEdge;
-}
-
-vtkSmartPointer<vtkQuadraticHexahedron> MakeQuadraticHexahedron()
-{
-  vtkSmartPointer<vtkQuadraticHexahedron> aHexahedron =
-    vtkSmartPointer<vtkQuadraticHexahedron>::New();
-  double *pcoords = aHexahedron->GetParametricCoords();
-  for (int i = 0; i < aHexahedron->GetNumberOfPoints(); ++i)
-    {
-    aHexahedron->GetPointIds()->SetId(i, i);
-    aHexahedron->GetPoints()->SetPoint(i,
-                                       *(pcoords + 3 * i) + vtkMath::Random(-.1,.1),
-                                       *(pcoords + 3 * i + 1) + vtkMath::Random(-.1,.1),
-                                       *(pcoords + 3 * i + 2) + vtkMath::Random(-.1,.1));
-         }
-  return aHexahedron;
-}
-
-vtkSmartPointer<vtkBiQuadraticQuadraticHexahedron> MakeBiQuadraticQuadraticHexahedron()
-{
-  vtkSmartPointer<vtkBiQuadraticQuadraticHexahedron> aHexahedron =
-    vtkSmartPointer<vtkBiQuadraticQuadraticHexahedron>::New();
-  double *pcoords = aHexahedron->GetParametricCoords();
-  for (int i = 0; i < aHexahedron->GetNumberOfPoints(); ++i)
-    {
-    aHexahedron->GetPointIds()->SetId(i, i);
-    aHexahedron->GetPoints()->SetPoint(i,
-                                       *(pcoords + 3 * i) + vtkMath::Random(-.1,.1),
-                                       *(pcoords + 3 * i + 1) + vtkMath::Random(-.1,.1),
-                                       *(pcoords + 3 * i + 2) + vtkMath::Random(-.1,.1));
-         }
-  return aHexahedron;
-}
-
-vtkSmartPointer<vtkTriQuadraticHexahedron> MakeTriQuadraticHexahedron()
-{
-  vtkSmartPointer<vtkTriQuadraticHexahedron> aHexahedron =
-    vtkSmartPointer<vtkTriQuadraticHexahedron>::New();
-  double *pcoords = aHexahedron->GetParametricCoords();
-  for (int i = 0; i < aHexahedron->GetNumberOfPoints(); ++i)
-    {
-    aHexahedron->GetPointIds()->SetId(i, i);
-    aHexahedron->GetPoints()->SetPoint(i,
-                                       *(pcoords + 3 * i) + vtkMath::Random(-.1,.1),
-                                       *(pcoords + 3 * i + 1) + vtkMath::Random(-.1,.1),
-                                       *(pcoords + 3 * i + 2) + vtkMath::Random(-.1,.1));
-         }
-  return aHexahedron;
-}
-
-vtkSmartPointer<vtkQuadraticPolygon> MakeQuadraticPolygon()
-{
-  vtkSmartPointer<vtkQuadraticPolygon> aPolygon =
-    vtkSmartPointer<vtkQuadraticPolygon>::New();
-
-  aPolygon->GetPointIds()->SetNumberOfIds(8);
-  aPolygon->GetPointIds()->SetId(0,0);
-  aPolygon->GetPointIds()->SetId(1,1);
-  aPolygon->GetPointIds()->SetId(2,2);
-  aPolygon->GetPointIds()->SetId(3,3);
-  aPolygon->GetPointIds()->SetId(4,4);
-  aPolygon->GetPointIds()->SetId(5,5);
-  aPolygon->GetPointIds()->SetId(6,6);
-  aPolygon->GetPointIds()->SetId(7,7);
-
-  aPolygon->GetPoints()->SetNumberOfPoints(8);
-  aPolygon->GetPoints()->SetPoint(0, 0.0, 0.0, 0.0);
-  aPolygon->GetPoints()->SetPoint(1, 2.0, 0.0, 0.0);
-  aPolygon->GetPoints()->SetPoint(2, 2.0, 2.0, 0.0);
-  aPolygon->GetPoints()->SetPoint(3, 0.0, 2.0, 0.0);
-  aPolygon->GetPoints()->SetPoint(4, 1.0, 0.0, 0.0);
-  aPolygon->GetPoints()->SetPoint(5, 2.0, 1.0, 0.0);
-  aPolygon->GetPoints()->SetPoint(6, 1.0, 2.0, 0.0);
-  aPolygon->GetPoints()->SetPoint(7, 0.0, 1.0, 0.0);
-  aPolygon->GetPoints()->SetPoint(5, 3.0, 1.0, 0.0);
-  return aPolygon;
-}
-
-vtkSmartPointer<vtkQuadraticLinearQuad> MakeQuadraticLinearQuad()
-{
-  vtkSmartPointer<vtkQuadraticLinearQuad> aLinearQuad =
-    vtkSmartPointer<vtkQuadraticLinearQuad>::New();
-  double *pcoords = aLinearQuad->GetParametricCoords();
-  for (int i = 0; i < aLinearQuad->GetNumberOfPoints(); ++i)
-    {
-    aLinearQuad->GetPointIds()->SetId(i, i);
-    aLinearQuad->GetPoints()->SetPoint(i,
-                                       *(pcoords + 3 * i),
-                                       *(pcoords + 3 * i + 1),
-                                       *(pcoords + 3 * i + 2));
-    }
-  return aLinearQuad;
-}
-
-vtkSmartPointer<vtkQuadraticLinearWedge> MakeQuadraticLinearWedge()
-{
-  vtkSmartPointer<vtkQuadraticLinearWedge> aLinearWedge =
-    vtkSmartPointer<vtkQuadraticLinearWedge>::New();
-  double *pcoords = aLinearWedge->GetParametricCoords();
-  for (int i = 0; i < 12; ++i)
-    {
-    aLinearWedge->GetPointIds()->SetId(i, i);
-    aLinearWedge->GetPoints()->SetPoint(i,
-                                       *(pcoords + 3 * i),
-                                       *(pcoords + 3 * i + 1),
-                                       *(pcoords + 3 * i + 2));
-    }
-  return aLinearWedge;
-}
-
-vtkSmartPointer<vtkQuadraticQuad> MakeQuadraticQuad()
-{
-  vtkSmartPointer<vtkQuadraticQuad> aQuad =
-    vtkSmartPointer<vtkQuadraticQuad>::New();
-  double *pcoords = aQuad->GetParametricCoords();
-  for (int i = 0; i < 8; ++i)
-    {
-    aQuad->GetPointIds()->SetId(i, i);
-    aQuad->GetPoints()->SetPoint(i,
-                                 *(pcoords + 3 * i) + vtkMath::Random(-.1, .1),
-                                 *(pcoords + 3 * i + 1) + vtkMath::Random(-.1, .1),
-                                 *(pcoords + 3 * i + 2));
-         }
-  return aQuad;
-}
-
-vtkSmartPointer<vtkQuadraticTetra> MakeQuadraticTetra()
-{
-  vtkSmartPointer<vtkQuadraticTetra> aTetra =
-    vtkSmartPointer<vtkQuadraticTetra>::New();
-  double *pcoords = aTetra->GetParametricCoords();
-  for (int i = 0; i < 10; ++i)
-    {
-    aTetra->GetPointIds()->SetId(i, i);
-    aTetra->GetPoints()->SetPoint(i,
-                                  *(pcoords + 3 * i) + vtkMath::Random(-.1, .1),
-                                 *(pcoords + 3 * i + 1) + vtkMath::Random(-.1, .1),
-                                 *(pcoords + 3 * i + 2) + vtkMath::Random(-.1, .1));
-         }
-  return aTetra;
-}
-
-vtkSmartPointer<vtkQuadraticTriangle> MakeQuadraticTriangle()
-{
-  vtkSmartPointer<vtkQuadraticTriangle> aTriangle =
-    vtkSmartPointer<vtkQuadraticTriangle>::New();
-  double *pcoords = aTriangle->GetParametricCoords();
-  for (int i = 0; i < aTriangle->GetNumberOfPoints(); ++i)
-    {
-    aTriangle->GetPointIds()->SetId(i, i);
-    aTriangle->GetPoints()->SetPoint(i,
-                                     *(pcoords + 3 * i),
-                                     *(pcoords + 3 * i + 1),
-                                     *(pcoords + 3 * i + 2));
-    }
-  return aTriangle;
-}
-
-vtkSmartPointer<vtkBiQuadraticTriangle> MakeBiQuadraticTriangle()
-{
-  vtkSmartPointer<vtkBiQuadraticTriangle> aTriangle =
-    vtkSmartPointer<vtkBiQuadraticTriangle>::New();
-  double *pcoords = aTriangle->GetParametricCoords();
-  for (int i = 0; i < aTriangle->GetNumberOfPoints(); ++i)
-    {
-    aTriangle->GetPointIds()->SetId(i, i);
-    aTriangle->GetPoints()->SetPoint(i,
-                                     *(pcoords + 3 * i),
-                                     *(pcoords + 3 * i + 1),
-                                     *(pcoords + 3 * i + 2));
-    }
-  return aTriangle;
-}
-
-vtkSmartPointer<vtkBiQuadraticQuad> MakeBiQuadraticQuad()
-{
-  vtkSmartPointer<vtkBiQuadraticQuad> aQuad =
-    vtkSmartPointer<vtkBiQuadraticQuad>::New();
-  double *pcoords = aQuad->GetParametricCoords();
-  for (int i = 0; i < aQuad->GetNumberOfPoints(); ++i)
-    {
-    aQuad->GetPointIds()->SetId(i, i);
-    aQuad->GetPoints()->SetPoint(i,
-                                 *(pcoords + 3 * i) + vtkMath::Random(-.1, .1),
-                                 *(pcoords + 3 * i + 1) + vtkMath::Random(-.1, .1),
-                                 *(pcoords + 3 * i + 2));
-         }
-  return aQuad;
-}
-
-vtkSmartPointer<vtkCubicLine> MakeCubicLine()
-{
-  vtkSmartPointer<vtkCubicLine> aLine =
-    vtkSmartPointer<vtkCubicLine>::New();
-  double *pcoords = aLine->GetParametricCoords();
-  for (int i = 0; i < aLine->GetNumberOfPoints(); ++i)
-    {
-    aLine->GetPointIds()->SetId(i, i);
-    aLine->GetPoints()->SetPoint(i,
-                                 *(pcoords + 3 * i),
-                                 *(pcoords + 3 * i + 1),
-                                 *(pcoords + 3 * i + 2));
-    }
-  return aLine;
-}
-
-vtkSmartPointer<vtkQuadraticWedge> MakeQuadraticWedge()
-{
-  vtkSmartPointer<vtkQuadraticWedge> aWedge =
-    vtkSmartPointer<vtkQuadraticWedge>::New();
-  double *pcoords = aWedge->GetParametricCoords();
-  for (int i = 0; i < aWedge->GetNumberOfPoints(); ++i)
-    {
-    aWedge->GetPointIds()->SetId(i, i);
-    aWedge->GetPoints()->SetPoint(i,
-                                  *(pcoords + 3 * i),
-                                  *(pcoords + 3 * i + 1),
-                                  *(pcoords + 3 * i + 2));
-    }
-  return aWedge;
-}
-
-vtkSmartPointer<vtkBiQuadraticQuadraticWedge> MakeBiQuadraticQuadraticWedge()
-{
-  vtkSmartPointer<vtkBiQuadraticQuadraticWedge> aWedge =
-    vtkSmartPointer<vtkBiQuadraticQuadraticWedge>::New();
-  double *pcoords = aWedge->GetParametricCoords();
-  for (int i = 0; i < aWedge->GetNumberOfPoints(); ++i)
-    {
-    aWedge->GetPointIds()->SetId(i, i);
-    aWedge->GetPoints()->SetPoint(i,
-                                  *(pcoords + 3 * i),
-                                  *(pcoords + 3 * i + 1),
-                                  *(pcoords + 3 * i + 2));
-    }
-  return aWedge;
-}
-
-vtkSmartPointer<vtkTetra> MakeTetra()
-{
-  vtkSmartPointer<vtkTetra> aTetra =
-    vtkSmartPointer<vtkTetra>::New();
-  aTetra->GetPointIds()->SetId(0,0);
-  aTetra->GetPointIds()->SetId(1,1);
-  aTetra->GetPointIds()->SetId(2,2);
-  aTetra->GetPointIds()->SetId(3,3);
-  aTetra->GetPoints()->SetPoint(0, 10.0, 10.0, 10.0);
-  aTetra->GetPoints()->SetPoint(1, 12.0, 10.0, 10.0);
-  aTetra->GetPoints()->SetPoint(2, 11.0, 12.0, 10.0);
-  aTetra->GetPoints()->SetPoint(3, 11.0, 11.0, 12.0);
-  return aTetra;
-}
-
-vtkSmartPointer<vtkWedge> MakeWedge()
-{
-  vtkSmartPointer<vtkWedge> aWedge =
-    vtkSmartPointer<vtkWedge>::New();
-  aWedge->GetPointIds()->SetId(0,0);
-  aWedge->GetPointIds()->SetId(1,1);
-  aWedge->GetPointIds()->SetId(2,2);
-  aWedge->GetPointIds()->SetId(3,3);
-  aWedge->GetPointIds()->SetId(4,4);
-  aWedge->GetPointIds()->SetId(5,5);
-
-  aWedge->GetPoints()->SetPoint(0, 10, 10, 10);
-  aWedge->GetPoints()->SetPoint(1, 12, 10, 10);
-  aWedge->GetPoints()->SetPoint(2, 11, 12, 10);
-  aWedge->GetPoints()->SetPoint(3, 10, 10, 12);
-  aWedge->GetPoints()->SetPoint(4, 12, 10, 12);
-  aWedge->GetPoints()->SetPoint(5, 11, 12, 12);
-  return aWedge;
-}
-
-vtkSmartPointer<vtkPolyhedron>MakeCube()
-{
-  vtkSmartPointer<vtkPolyhedron> aCube =
-    vtkSmartPointer<vtkPolyhedron>::New();
-
-  // create polyhedron (cube)
-  vtkSmartPointer<vtkPoints> points =
-    vtkSmartPointer<vtkPoints>::New();
-
-  aCube->GetPointIds()->SetNumberOfIds(8);
-  aCube->GetPointIds()->SetId(0, 0);
-  aCube->GetPointIds()->SetId(1, 1);
-  aCube->GetPointIds()->SetId(2, 2);
-  aCube->GetPointIds()->SetId(3, 3);
-  aCube->GetPointIds()->SetId(4, 4);
-  aCube->GetPointIds()->SetId(5, 5);
-  aCube->GetPointIds()->SetId(6, 6);
-  aCube->GetPointIds()->SetId(7, 7);
-
-  aCube->GetPoints()->SetNumberOfPoints(8);
-  aCube->GetPoints()->SetPoint(0, -1.0,-1.0,-1.0);
-  aCube->GetPoints()->SetPoint(1,  1.0,-1.0,-1.0);
-  aCube->GetPoints()->SetPoint(2,  1.0, 1.0,-1.0);
-  aCube->GetPoints()->SetPoint(3, -1.0, 1.0,-1.0);
-  aCube->GetPoints()->SetPoint(4, -1.0,-1.0, 1.0);
-  aCube->GetPoints()->SetPoint(5,  1.0,-1.0, 1.0);
-  aCube->GetPoints()->SetPoint(6,  1.0, 1.0, 1.0);
-  aCube->GetPoints()->SetPoint(7, -1.0, 1.0, 1.0);
-
-  vtkIdType faces[31] =
-    {6,              // number of faces
-     4, 0, 3, 2, 1,
-     4, 0, 4, 7, 3,
-     4, 4, 5, 6, 7,
-     4, 5, 1, 2, 6,
-     4, 0, 1, 5, 4,
-     4, 2, 3, 7, 6};
-
-  aCube->SetFaces(faces);
-  aCube->Initialize();
-  return aCube;
-}
-
-vtkSmartPointer<vtkPolyhedron>MakeDodecahedron()
-{
-  vtkSmartPointer<vtkPolyhedron> aDodecahedron =
-    vtkSmartPointer<vtkPolyhedron>::New();
-
-  // create polyhedron (dodecahedron)
-  vtkSmartPointer<vtkPoints> points =
-    vtkSmartPointer<vtkPoints>::New();
-
-  for (int i = 0; i < 20; ++i)
-    {
-    aDodecahedron->GetPointIds()->InsertNextId(i);
-    }
-
-  aDodecahedron->GetPoints()->InsertNextPoint(1.21412,    0,          1.58931);
-  aDodecahedron->GetPoints()->InsertNextPoint(0.375185,   1.1547,     1.58931);
-  aDodecahedron->GetPoints()->InsertNextPoint(-0.982247,  0.713644,   1.58931);
-  aDodecahedron->GetPoints()->InsertNextPoint(-0.982247,  -0.713644,  1.58931);
-  aDodecahedron->GetPoints()->InsertNextPoint(0.375185,   -1.1547,    1.58931);
-  aDodecahedron->GetPoints()->InsertNextPoint(1.96449,    0,          0.375185);
-  aDodecahedron->GetPoints()->InsertNextPoint(0.607062,   1.86835,    0.375185);
-  aDodecahedron->GetPoints()->InsertNextPoint(-1.58931,   1.1547,     0.375185);
-  aDodecahedron->GetPoints()->InsertNextPoint(-1.58931,   -1.1547,    0.375185);
-  aDodecahedron->GetPoints()->InsertNextPoint(0.607062,   -1.86835,   0.375185);
-  aDodecahedron->GetPoints()->InsertNextPoint(1.58931,    1.1547,     -0.375185);
-  aDodecahedron->GetPoints()->InsertNextPoint(-0.607062,  1.86835,    -0.375185);
-  aDodecahedron->GetPoints()->InsertNextPoint(-1.96449,   0,          -0.375185);
-  aDodecahedron->GetPoints()->InsertNextPoint(-0.607062,  -1.86835,   -0.375185);
-  aDodecahedron->GetPoints()->InsertNextPoint(1.58931,    -1.1547,    -0.375185);
-  aDodecahedron->GetPoints()->InsertNextPoint(0.982247,   0.713644,   -1.58931);
-  aDodecahedron->GetPoints()->InsertNextPoint(-0.375185,  1.1547,     -1.58931);
-  aDodecahedron->GetPoints()->InsertNextPoint(-1.21412,   0,          -1.58931);
-  aDodecahedron->GetPoints()->InsertNextPoint(-0.375185,  -1.1547,    -1.58931);
-  aDodecahedron->GetPoints()->InsertNextPoint(0.982247,   -0.713644,  -1.58931);
-
-  vtkIdType faces[73] =
-    {12,                   // number of faces
-     5, 0, 1, 2, 3, 4,     // number of ids on face, ids
-     5, 0, 5, 10, 6, 1,
-     5, 1, 6, 11, 7, 2,
-     5, 2, 7, 12, 8, 3,
-     5, 3, 8, 13, 9, 4,
-     5, 4, 9, 14, 5, 0,
-     5, 15, 10, 5, 14, 19,
-     5, 16, 11, 6, 10, 15,
-     5, 17, 12, 7, 11, 16,
-     5, 18, 13, 8, 12, 17,
-     5, 19, 14, 9, 13, 18,
-     5, 19, 18, 17, 16, 15};
-
-  aDodecahedron->SetFaces(faces);
-  aDodecahedron->Initialize();
-
-  return aDodecahedron;
-}
-
-vtkSmartPointer<vtkPentagonalPrism> MakePentagonalPrism()
-{
-  vtkSmartPointer<vtkPentagonalPrism> aPentagonalPrism =
-    vtkSmartPointer<vtkPentagonalPrism>::New();
-
-  aPentagonalPrism->GetPointIds()->SetId(0,0);
-  aPentagonalPrism->GetPointIds()->SetId(1,1);
-  aPentagonalPrism->GetPointIds()->SetId(2,2);
-  aPentagonalPrism->GetPointIds()->SetId(3,3);
-  aPentagonalPrism->GetPointIds()->SetId(4,4);
-  aPentagonalPrism->GetPointIds()->SetId(5,5);
-  aPentagonalPrism->GetPointIds()->SetId(6,6);
-  aPentagonalPrism->GetPointIds()->SetId(7,7);
-  aPentagonalPrism->GetPointIds()->SetId(8,8);
-  aPentagonalPrism->GetPointIds()->SetId(9,9);
-
-  aPentagonalPrism->GetPoints()->SetPoint(0, 11, 10, 10);
-  aPentagonalPrism->GetPoints()->SetPoint(1, 13, 10, 10);
-  aPentagonalPrism->GetPoints()->SetPoint(2, 14, 12, 10);
-  aPentagonalPrism->GetPoints()->SetPoint(3, 12, 14, 10);
-  aPentagonalPrism->GetPoints()->SetPoint(4, 10, 12, 10);
-  aPentagonalPrism->GetPoints()->SetPoint(5, 11, 10, 14);
-  aPentagonalPrism->GetPoints()->SetPoint(6, 13, 10, 14);
-  aPentagonalPrism->GetPoints()->SetPoint(7, 14, 12, 14);
-  aPentagonalPrism->GetPoints()->SetPoint(8, 12, 14, 14);
-  aPentagonalPrism->GetPoints()->SetPoint(9, 10, 12, 14);
-
-  return aPentagonalPrism;
-}
-
-vtkSmartPointer<vtkHexagonalPrism> MakeHexagonalPrism()
-{
-  vtkSmartPointer<vtkHexagonalPrism> aHexagonalPrism =
-    vtkSmartPointer<vtkHexagonalPrism>::New();
-  aHexagonalPrism->GetPointIds()->SetId(0,0);
-  aHexagonalPrism->GetPointIds()->SetId(1,1);
-  aHexagonalPrism->GetPointIds()->SetId(2,2);
-  aHexagonalPrism->GetPointIds()->SetId(3,3);
-  aHexagonalPrism->GetPointIds()->SetId(4,4);
-  aHexagonalPrism->GetPointIds()->SetId(5,5);
-  aHexagonalPrism->GetPointIds()->SetId(6,6);
-  aHexagonalPrism->GetPointIds()->SetId(7,7);
-  aHexagonalPrism->GetPointIds()->SetId(8,8);
-  aHexagonalPrism->GetPointIds()->SetId(9,9);
-  aHexagonalPrism->GetPointIds()->SetId(10,10);
-  aHexagonalPrism->GetPointIds()->SetId(11,11);
-
-  aHexagonalPrism->GetPoints()->SetPoint(0, 11, 10, 10);
-  aHexagonalPrism->GetPoints()->SetPoint(1, 13, 10, 10);
-  aHexagonalPrism->GetPoints()->SetPoint(2, 14, 12, 10);
-  aHexagonalPrism->GetPoints()->SetPoint(3, 13, 14, 10);
-  aHexagonalPrism->GetPoints()->SetPoint(4, 11, 14, 10);
-  aHexagonalPrism->GetPoints()->SetPoint(5, 10, 12, 10);
-  aHexagonalPrism->GetPoints()->SetPoint(6, 11, 10, 14);
-  aHexagonalPrism->GetPoints()->SetPoint(7, 13, 10, 14);
-  aHexagonalPrism->GetPoints()->SetPoint(8, 14, 12, 14);
-  aHexagonalPrism->GetPoints()->SetPoint(9, 13, 14, 14);
-  aHexagonalPrism->GetPoints()->SetPoint(10, 11, 14, 14);
-  aHexagonalPrism->GetPoints()->SetPoint(11, 10, 12, 14);
-
-  return aHexagonalPrism;
-}
-
-template<typename T> int TestOneCell(const VTKCellType cellType,
-                                  vtkSmartPointer<T> aCell,
-                                  int linear)
-{
-  int status = 0;
-  std::cout << "Testing " << aCell->GetClassName() << std::endl;
-
-  std::cout << "  Testing Print of an unitialized cell...";
-  std::ostringstream cellPrint;
-  aCell->Print(cellPrint);
-  std::cout << "PASSED" << std::endl;
-
-  std::cout << "  Testing GetCellType...";
-  if (cellType != aCell->GetCellType())
-    {
-    std::cout << "Expected " << cellType
-              << " but got " << aCell->GetCellType()
-              << " FAILED" << std::endl;
-    ++status;
-    }
-  else
-    {
-    std::cout << "PASSED" << std::endl;
-    }
-
-  std::cout << "  Testing GetCellDimension...";
-  std::cout << aCell->GetCellDimension();
-  std::cout << "...PASSED" << std::endl;
-
-  std::cout << "  Testing IsLinear...";
-  if (aCell->IsLinear() != 1 && linear)
-    {
-    ++status;
-    std::cout << "...FAILED" << std::endl;
-    }
-  else
-    {
-    std::cout << "...PASSED" << std::endl;
-    }
-
-  std::cout << "  Testing IsPrimaryCell...";
-  std::cout << aCell->IsPrimaryCell();
-  std::cout << "...PASSED" << std::endl;
-
-  std::cout << "  Testing IsExplicitCell...";
-  std::cout << aCell->IsExplicitCell();
-  std::cout << "...PASSED" << std::endl;
-
-  std::cout << "  Testing RequiresInitialization...";
-  std::cout << aCell->RequiresInitialization();
-  std::cout << "...PASSED" << std::endl;
-
-  std::cout << "  Testing RequiresExplicitFaceRepresentation...";
-  std::cout << aCell->RequiresExplicitFaceRepresentation();
-  std::cout << "...PASSED" << std::endl;
-
-  if (aCell->RequiresInitialization())
-    {
-    aCell->Initialize();
-    }
-  std::cout << "  Testing GetNumberOfPoints...";
-  std::cout << aCell->GetNumberOfPoints();
-  std::cout << "...PASSED" << std::endl;
-
-  std::cout << "  Testing GetNumberOfEdges...";
-  std::cout << aCell->GetNumberOfEdges();
-  std::cout << "...PASSED" << std::endl;
-
-  std::cout << "  Testing GetNumberOfFaces...";
-  std::cout << aCell->GetNumberOfFaces();
-  std::cout << "...PASSED" << std::endl;
-
-  if (std::string(aCell->GetClassName()) != "vtkEmptyCell" &&
-      std::string(aCell->GetClassName()) != "vtkVertex" &&
-      std::string(aCell->GetClassName()) != "vtkPolyhedron")
-    {
-    std::cout << "  Testing GetParametricCoords...";
-    double *parametricCoords = aCell->GetParametricCoords();
-    if (aCell->IsPrimaryCell() && parametricCoords == NULL)
-      {
-      ++status;
-      std::cout << "...FAILED" << std::endl;
-      }
-    else if (parametricCoords)
-      {
-      std::vector<double> pweights(aCell->GetNumberOfPoints());
-      // The pcoords should correspond to the cell points
-      for (int p = 0; p < aCell->GetNumberOfPoints(); ++p)
-        {
-        double vertex[3];
-        aCell->GetPoints()->GetPoint(p, vertex);
-        int subId = 0;
-        double x[3];
-        aCell->EvaluateLocation(subId, parametricCoords + 3 * p, x, &(*pweights.begin()));
-        if (!vtkMathUtilities::FuzzyCompare(
-              x[0], vertex[0], 1.e-3) ||
-            !vtkMathUtilities::FuzzyCompare(
-              x[1], vertex[1], 1.e-3) ||
-            !vtkMathUtilities::FuzzyCompare(
-              x[2], vertex[2], 1.e-3))
-          {
-          std::cout << "EvaluateLocation failed...";
-          std::cout << "pcoords[" << p << "]: "
-                    << parametricCoords[3 * p] << " "
-                    << parametricCoords[3 * p  + 1] << " "
-                    << parametricCoords[3 * p + 2] << std::endl;
-          std::cout << "x[" << p << "]: "
-                    << x[0] << " " << x[1] << " " << x[2] << std::endl;
-          std::cout << "...FAILED" << std::endl;
-          ++status;
-          }
-        }
-      std::cout << "...PASSED" << std::endl;
-      }
-    }
-  std::cout << "  Testing GetBounds...";
-  double bounds[6];
-  aCell->GetBounds(bounds);
-  std::cout << bounds[0] << "," << bounds[1] << " "
-            << bounds[2] << "," << bounds[3] << " "
-            << bounds[4] << "," << bounds[5];
-  std::cout << "...PASSED" << std::endl;
-
-  if (aCell->GetNumberOfPoints() > 0)
-    {
-    std::cout << "  Testing GetParametricCenter...";
-    double pcenter[3], center[3];
-    pcenter[0] = pcenter[1] = pcenter[2] = -12345.0;
-    aCell->GetParametricCenter(pcenter);
-    std::cout << pcenter[0] << ", " << pcenter[1] << ", " << pcenter[2];
-    std::vector<double> cweights(aCell->GetNumberOfPoints());
-    int pSubId = 0;
-    aCell->EvaluateLocation(pSubId, pcenter, center, &(*cweights.begin()));
-    std::cout << " -> " << center[0] << ", " << center[1] << ", " << center[2];
-    if (center[0] < bounds[0] || center[0] > bounds[1] ||
-        center[1] < bounds[2] || center[1] > bounds[3] ||
-        center[2] < bounds[4] || center[2] > bounds[5])
-      {
-      std::cout << " The computed center is not within the bounds of the cell" << std::endl;
-      std::cout << "bounds: "
-                << bounds[0] << "," << bounds[1] << " "
-                << bounds[2] << "," << bounds[3] << " "
-                << bounds[4] << "," << bounds[5]
-                << std::endl;
-      std::cout << "parametric center "
-                << pcenter[0] << ", " << pcenter[1] << ", " << pcenter[2] << " "
-                << "center: "
-                << center[0] << ", " << center[1] << ", " << center[2]
-                << std::endl;
-      std::cout << "...FAILED" << std::endl;
-      }
-    else
-      {
-      std::cout << "...PASSED" << std::endl;
-      }
-    }
-
-  std::cout << "  Testing GetParametricDistance...";
-  double pcenter[3];
-  aCell->GetParametricCenter(pcenter);
-  double pd = aCell->GetParametricDistance(pcenter);
-  if (pd == 0.0)
-    {
-    std::cout << "...PASSED" << std::endl;
-    }
-  else
-    {
-    ++status;
-    std::cout << "...FAILED" << std::endl;
-    }
-
-  std::cout << "  Testing CellBoundaries...";
-  vtkSmartPointer<vtkIdList> cellIds =
-    vtkSmartPointer<vtkIdList>::New();
-  int cellStatus = aCell->CellBoundary(0, pcenter, cellIds);
-  if (aCell->GetCellDimension() > 0 && cellStatus != 1)
-    {
-    ++status;
-    std::cout << "FAILED" << std::endl;
-    }
-  else
-    {
-    for (int c = 0; c < cellIds->GetNumberOfIds(); ++c)
-      {
-      std::cout << " " << cellIds->GetId(c) << ", ";
-      }
-    std::cout << "PASSED" << std::endl;
-    }
-
-  if (aCell->GetNumberOfPoints() > 0)
-    {
-    std::cout << "  Testing Derivatives...";
-    // Create scalars and set first scalar to 1.0
-    std::vector<double> scalars(aCell->GetNumberOfPoints());
-    scalars[0] = 1.0;
-    for (int s = 1; s < aCell->GetNumberOfPoints(); ++s)
-      {
-      scalars[s] = 0.0;
-      }
-    std::vector<double> derivs(3, -12345.0);
-    aCell->Derivatives(0, pcenter, &(*scalars.begin()), 1, &(*derivs.begin()));
-    if (derivs[0] == -12345. && derivs[1] == -12345. && derivs[2] == -12345.)
-      {
-      std::cout << " not computed";
-      }
-    else
-      {
-      std::cout << " "
-                << derivs[0] << " "
-                << derivs[1] << " "
-                << derivs[2] << " ";
-      }
-    std::cout << "...PASSED" << std::endl;
-    }
-
-  std::cout << "  Testing EvaluateLocation vertex matches pcoord...";
-  int status5 = 0;
-  double *locations = aCell->GetParametricCoords();
-  if (locations)
-    {
-    std::vector<double> lweights(aCell->GetNumberOfPoints());
-    for (int l = 0; l < aCell->GetNumberOfPoints(); ++l)
-      {
-      double point[3];
-      double vertex[3];
-      aCell->GetPoints()->GetPoint(l, vertex);
-      int subId = 0;
-      aCell->EvaluateLocation(subId, locations + 3 * l, point, &(*lweights.begin()));
-      for (int v = 0; v < 3; ++v)
-        {
-        if (!vtkMathUtilities::FuzzyCompare(
-              point[v], vertex[v],
-              1.e-3))
-          {
-          std::cout << " " << point[0] << ", " << point[1] << ", " << point[2] << " != "
-                    << vertex[0] << ", " << vertex[1] << ", " << vertex[2] << " " ;
-          std::cout << "eps ratio is: " << (point[v] - vertex[v])
-            / std::numeric_limits<double>::epsilon() << std::endl;
-
-          ++status5;
-          break;
-          }
-        }
-      }
-    }
-  if (status5)
-    {
-    std::cout << "...FAILED" << std::endl;
-    ++status;
-    }
-  else
-    {
-    std::cout << "...PASSED"<< std::endl;
-    }
-
-  std::cout << "  Testing EvaluatePosition pcoord matches vertex...";
-  // Each vertex should corrrespond to a pcoord.
-  int subId = 0;
-  int status6 = 0;
-  std::vector<double> weights(aCell->GetNumberOfPoints());
-  double *vlocations = aCell->GetParametricCoords();
-  if (vlocations)
-    {
-    for (int i = 0; i < aCell->GetNumberOfPoints(); ++i)
-      {
-      int status61 = 0;
-      double closestPoint[3];
-      double point[3];
-      double pcoords[3];
-      double dist2;
-      aCell->GetPoints()->GetPoint(i, point);
-      aCell->EvaluatePosition( point, closestPoint, subId, pcoords, dist2, &(*weights.begin()));
-      for (int v = 0; v < 3; ++v)
-        {
-        if (!vtkMathUtilities::FuzzyCompare(
-              *(vlocations + 3 * i + v) ,pcoords[v],
-              1.e-3))
-          {
-          ++status61;
-          }
-        }
-      if (status61)
-        {
-        std::cout << std::endl
-                  << *(vlocations + 3 * i + 0) << ", "
-                  << *(vlocations + 3 * i + 1) << ", "
-                  << *(vlocations + 3 * i + 2)
-                  << " != "
-                  << pcoords[0] << ", "
-                  << pcoords[1] << ", "
-                  << pcoords[2] << " " ;
-        ++status6;
-        }
-      }
-    }
-  if (status6)
-    {
-    ++status;
-    std::cout << "...FAILED" << std::endl;
-    }
-  else
-    {
-    std::cout << "...PASSED" << std::endl;
-    }
-
-  std::cout << "  Testing EvaluatePosition in/out test...";
-
-  int status2 = 0;
-  std::vector<std::vector<double> > testPoints;
-  std::vector<int> inOuts;
-  std::vector<std::string> typePoint;
-
-  // First test cell points
-  for (int i = 0; i < aCell->GetNumberOfPoints(); ++i)
-    {
-    std::vector<double> point(3);
-    aCell->GetPoints()->GetPoint(i, &(*point.begin()));
-    testPoints.push_back(point);
-    inOuts.push_back(1);
-    typePoint.push_back("cell point");
-    }
-  // Then test center of cell
-  if (aCell->GetNumberOfPoints() > 0)
-    {
-    std::vector<double> tCenter(3);
-    aCell->EvaluateLocation(subId, pcenter, &(*tCenter.begin()), &(*weights.begin()));
-    testPoints.push_back(tCenter);
-    inOuts.push_back(1);
-    typePoint.push_back("cell center");
-    // Test a point above the cell
-    if (aCell->GetCellDimension() == 2)
-      {
-      std::vector<double> above(3);
-      above[0] = tCenter[0]; above[1] = tCenter[1];
-      above[2] = tCenter[2] + aCell->GetLength2();
-      testPoints.push_back(above);
-      inOuts.push_back(0);
-      typePoint.push_back("point above cell");
-      }
-    }
-
-  // Test points at the center of each edge
-  for (int e = 0; e < aCell->GetNumberOfEdges(); ++e)
-    {
-    std::vector<double> eCenter(3);
-    vtkCell *c = aCell->GetEdge(e);
-    c->GetParametricCenter(pcenter);
-    c->EvaluateLocation(subId, pcenter, &(*eCenter.begin()), &(*weights.begin()));
-    testPoints.push_back(eCenter);
-    typePoint.push_back("edge center");
-    inOuts.push_back(1);
-    }
-
-  // Test points at the center of each face
-  for (int f = 0; f < aCell->GetNumberOfFaces(); ++f)
-    {
-    std::vector<double> fCenter(3);
-    vtkCell *c = aCell->GetFace(f);
-    c->GetParametricCenter(pcenter);
-    c->EvaluateLocation(subId, pcenter, &(*fCenter.begin()), &(*weights.begin()));
-    testPoints.push_back(fCenter);
-    inOuts.push_back(1);
-    typePoint.push_back("face center");
-    }
-
-  // Test a point outside the cell
-  if (aCell->GetNumberOfPoints() > 0)
-    {
-    std::vector<double> outside(3, -12345.0);
-    testPoints.push_back(outside);
-    inOuts.push_back(0);
-    typePoint.push_back("outside point");
-    }
-  for (size_t p = 0; p < testPoints.size(); ++p)
-    {
-    double closestPoint[3], pcoords[3], dist2;
-    int inOut = aCell->EvaluatePosition( &(*testPoints[p].begin()),
-                                         closestPoint, subId,
-                                         pcoords, dist2,
-                                         &(*weights.begin()));
-    if ((inOut == 0 || inOut == -1) && inOuts[p] == 0)
-      {
-      continue;
-      }
-    else if (inOut == 1 && dist2 == 0.0 && inOuts[p] == 1)
-      {
-      continue;
-      }
-    else if (inOut == 1 && dist2 != 0.0 && inOuts[p] == 0)
-      {
-      continue;
-      }
-    // inOut failed
-    std::cout << typePoint[p] << " failed inOut: " << inOut << " "
-              << "point: " <<testPoints[p][0] << ", " << testPoints[p][1] << ", " << testPoints[p][2] << "-> "
-              << "pcoords: " << pcoords[0] << ", " << pcoords[1] << ", " << pcoords[2] << ": "
-              << "closestPoint: " << closestPoint[0] << ", " << closestPoint[1] << ", " << closestPoint[2] << " "
-              << "dist2: " << dist2;
-    std::cout << " weights: ";
-    for (int w = 0; w < aCell->GetNumberOfPoints(); ++w)
-      {
-      std::cout << weights[w] << " ";
-      }
-    std::cout << std::endl;
-    status2 += 1;
-    }
-  if (status2)
-    {
-    ++status;
-    std::cout << "FAILED" << std::endl;
-    }
-  else
-    {
-    std::cout << "PASSED" << std::endl;
-    }
-
-  if (aCell->GetNumberOfPoints() > 0 &&
-      aCell->GetCellDimension() > 0)
-    {
-    std::cout << "  Testing IntersectWithLine...";
-    double tol = 1.e-5;
-    double t;
-    double startPoint[3];
-    double endPoint[3];
-    double intersection[3], pintersection[3];
-    aCell->GetParametricCenter(pcenter);
-    aCell->EvaluateLocation(subId, pcenter, startPoint, &(*weights.begin()));
-    endPoint[0] = startPoint[0];
-    endPoint[1] = startPoint[1];
-    endPoint[2] = startPoint[2] + aCell->GetLength2();
-    startPoint[2] = startPoint[2] - aCell->GetLength2();
-    int status3 = 0;
-    int result =
-      aCell->IntersectWithLine(
-        startPoint, endPoint,
-        tol,
-        t,
-        intersection,
-        pintersection,
-        subId);
-    if (result == 0)
-      {
-      ++status3;
-      }
-    else
-      {
-      std::cout << " t: " << t << " ";
-      }
-    startPoint[2] = endPoint[2] + aCell->GetLength2();
-    result =
-      aCell->IntersectWithLine(
-        startPoint, endPoint,
-        tol,
-        t,
-        intersection,
-        pintersection,
-        subId);
-    if (result == 1)
-      {
-      ++status3;
-      }
-
-    if (status3 != 0)
-      {
-      ++status;
-      std::cout << "...FAILED" << std::endl;
-      }
-    else
-      {
-      std::cout << "...PASSED" << std::endl;
-      }
-    }
-
-  // Triangulate
-  std::cout << "  Testing Triangulate...";
-  int index = 0;
-  vtkSmartPointer<vtkIdList> ptIds =
-    vtkSmartPointer<vtkIdList>::New();
-  ptIds->SetNumberOfIds(100);
-  vtkSmartPointer<vtkPoints> triPoints =
-    vtkSmartPointer<vtkPoints>::New();
-  aCell->Triangulate(index, ptIds, triPoints);
-  int pts = ptIds->GetNumberOfIds();
-  if (aCell->GetCellDimension() == 0)
-    {
-    std::cout << "Generated " << pts << " Points";
-    }
-  else if (aCell->GetCellDimension() == 1)
-    {
-    std::cout << "Generated " << pts / 2 << " Lines";
-    }
-  else if (aCell->GetCellDimension() == 2)
-    {
-    std::cout << "Generated " << pts / 3 << " Triangles";
-    }
-  else if (aCell->GetCellDimension() == 3)
-    {
-    std::cout << "Generated " << pts / 4 << " Tetra";
-    }
-  std::cout << "...PASSED" << std::endl;
-
-  if (status)
-    {
-    std::cout << aCell->GetClassName() << " FAILED" << std::endl;
-    }
-  else
-    {
-    std::cout << aCell->GetClassName() << " PASSED" << std::endl;
-    }
-  return status;
-}
diff --git a/Common/DataModel/Testing/Cxx/otherCellPosition.cxx b/Common/DataModel/Testing/Cxx/otherCellPosition.cxx
index 6d31cb2..8b67939 100644
--- a/Common/DataModel/Testing/Cxx/otherCellPosition.cxx
+++ b/Common/DataModel/Testing/Cxx/otherCellPosition.cxx
@@ -73,7 +73,7 @@ int TestOCP(ostream& strm)
 
   //Poly Vertex
   vtkPolyVertex *polyVertex = vtkPolyVertex::New();
-  double polyVertexCoords[3], polyVertexWeights[2];
+  double polyVertexCoords[1], polyVertexWeights[2];
   double polyVertexPoint[3][3] = {{10.0, 20.0, 30.0}, {30.0, 20.0, 10.0}, {0, 0, 0}};
   double polyVertexClosest[3];
 
@@ -215,7 +215,7 @@ int TestOCP(ostream& strm)
 
   //Quad
   vtkQuad *quad = vtkQuad::New();
-  double quadCoords[3], quadWeights[4], quadPosition[3];
+  double quadCoords[2], quadWeights[4], quadPosition[3];
   double quadPoint[5][3] = {{10.0, 10.0, 10.0}, {12.0, 10.0, 10.0}, {12.0, 12.0, 10.0}, {10, 12, 10}, {11, 11, 10.1}};
   double quadClosest[3];
 
@@ -277,7 +277,7 @@ int TestOCP(ostream& strm)
 
   //Polygon
   vtkPolygon *polygon = vtkPolygon::New();
-  double polygonCoords[3], polygonWeights[4], polygonPosition[3];
+  double polygonCoords[2], polygonWeights[4], polygonPosition[3];
   double polygonPoint[5][3] = {{0.0, 0.0, 0.0}, {1.0, 0.0, 0.0}, {1.0, 1.0, 0.0}, {0, 1, 0}, {.5, .5, 0}};
   double polygonClosest[3];
 
diff --git a/Common/DataModel/Testing/Data/Baseline/TestCellLocator.png.md5 b/Common/DataModel/Testing/Data/Baseline/TestCellLocator.png.md5
deleted file mode 100644
index 36f933a..0000000
--- a/Common/DataModel/Testing/Data/Baseline/TestCellLocator.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-ffcd833c4a47af8865c864b21ad1cd24
diff --git a/Common/DataModel/Testing/Data/Baseline/TestKdTreeRepresentation_1.png.md5 b/Common/DataModel/Testing/Data/Baseline/TestKdTreeRepresentation_1.png.md5
deleted file mode 100644
index 78835de..0000000
--- a/Common/DataModel/Testing/Data/Baseline/TestKdTreeRepresentation_1.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-edb81e27370b08c631311e615c842b59
diff --git a/Common/DataModel/Testing/Data/Baseline/TestMeanValueCoordinatesInterpolation1.png.md5 b/Common/DataModel/Testing/Data/Baseline/TestMeanValueCoordinatesInterpolation1.png.md5
deleted file mode 100644
index 0d171a8..0000000
--- a/Common/DataModel/Testing/Data/Baseline/TestMeanValueCoordinatesInterpolation1.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-e99e19acc4536e088781cdfb90d3fb6a
diff --git a/Common/DataModel/Testing/Data/Baseline/TestMeanValueCoordinatesInterpolation2.png.md5 b/Common/DataModel/Testing/Data/Baseline/TestMeanValueCoordinatesInterpolation2.png.md5
deleted file mode 100644
index 618a6b4..0000000
--- a/Common/DataModel/Testing/Data/Baseline/TestMeanValueCoordinatesInterpolation2.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-a0bef950f33de0aa57ebbf626b75fe8e
diff --git a/Common/DataModel/Testing/Data/Baseline/TestQuadraticPolygonFilters.png.md5 b/Common/DataModel/Testing/Data/Baseline/TestQuadraticPolygonFilters.png.md5
index 453f3ce..df9edc4 100644
--- a/Common/DataModel/Testing/Data/Baseline/TestQuadraticPolygonFilters.png.md5
+++ b/Common/DataModel/Testing/Data/Baseline/TestQuadraticPolygonFilters.png.md5
@@ -1 +1 @@
-016aee696ef983e502b3373c34857bf3
+d41d8cd98f00b204e9800998ecf8427e
diff --git a/Common/DataModel/Testing/Data/Baseline/TestSmoothErrorMetric.png.md5 b/Common/DataModel/Testing/Data/Baseline/TestSmoothErrorMetric.png.md5
deleted file mode 100644
index d816bf0..0000000
--- a/Common/DataModel/Testing/Data/Baseline/TestSmoothErrorMetric.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-d6e61e0337d73468f3d9141455c440f8
diff --git a/Common/DataModel/module.cmake b/Common/DataModel/module.cmake
index 6639aad..d1e20e9 100644
--- a/Common/DataModel/module.cmake
+++ b/Common/DataModel/module.cmake
@@ -11,12 +11,10 @@ vtk_module(vtkCommonDataModel
     vtkTestingRendering
     vtkInteractionStyle
     vtkCommonExecutionModel
-    vtkFiltersGeneric
     vtkFiltersModeling
     vtkIOGeometry
     vtkIOLegacy
     vtkIOXML
-    vtkTestingGenericBridge
     vtkRendering${VTK_RENDERING_BACKEND}
   KIT
     vtkCommon
diff --git a/Common/DataModel/vtkAMRInformation.cxx b/Common/DataModel/vtkAMRInformation.cxx
index 400b342..6f6aa3f 100644
--- a/Common/DataModel/vtkAMRInformation.cxx
+++ b/Common/DataModel/vtkAMRInformation.cxx
@@ -570,10 +570,9 @@ bool vtkAMRInformation::HasValidBounds()
 
 void vtkAMRInformation::SetGridDescription(int description)
 {
-  if (description < VTK_SINGLE_POINT || description > VTK_EMPTY)
+  if(this->GridDescription>=0 && description!=this->GridDescription)
     {
-    vtkErrorMacro("Invalid grid description for a vtkUniformGrid.");
-    return;
+    vtkErrorMacro("Inconsistent types of vtkUniformGrid");
     }
   this->GridDescription = description;
 }
diff --git a/Common/DataModel/vtkAMRUtilities.cxx b/Common/DataModel/vtkAMRUtilities.cxx
index 3f559af..7e14371 100644
--- a/Common/DataModel/vtkAMRUtilities.cxx
+++ b/Common/DataModel/vtkAMRUtilities.cxx
@@ -34,7 +34,6 @@
 #define JMAX(ext) ext[3]
 #define KMIN(ext) ext[4]
 #define KMAX(ext) ext[5]
-#define PRINT(x) cout<<"("<<myRank<<")"<<x<<endl;
 
 //------------------------------------------------------------------------------
 void vtkAMRUtilities::PrintSelf( std::ostream& os, vtkIndent indent )
@@ -409,48 +408,47 @@ void vtkAMRUtilities::BlankGridsAtLevel(vtkOverlappingAMR* amr, int levelIdx,
       }
     N = grid->GetNumberOfCells();
 
-    vtkUnsignedCharArray *ghosts = vtkUnsignedCharArray::New();
-    ghosts->SetNumberOfTuples(N);
-    ghosts->FillComponent(0, 0);
-    ghosts->SetName(vtkDataSetAttributes::GhostArrayName());
+    vtkUnsignedCharArray* vis = vtkUnsignedCharArray::New();
+    vis->SetName("visibility");
+    vis->SetNumberOfTuples( N );
+    vis->FillComponent(0,static_cast<char>(1));
+    grid->SetCellVisibilityArray(vis);
+    vis->Delete();
 
-    if (children.size() > dataSetIdx)
-      {
-      std::vector<unsigned int>& dsChildren = children[dataSetIdx];
-      std::vector<unsigned int>::iterator iter;
+    if (children.size() <= dataSetIdx)
+      continue;
 
-      // For each higher res box fill in the cells that
-      // it covers
-      for (iter=dsChildren.begin(); iter!=dsChildren.end(); iter++)
+    std::vector<unsigned int>& dsChildren = children[dataSetIdx];
+    std::vector<unsigned int>::iterator iter;
+
+    // For each higher res box fill in the cells that
+    // it covers
+    for (iter=dsChildren.begin(); iter!=dsChildren.end(); iter++)
+      {
+      vtkAMRBox ibox;;
+      int childGridIndex  = amr->GetCompositeIndex(levelIdx+1, *iter);
+      if(processMap[childGridIndex]<0)
         {
-        vtkAMRBox ibox;;
-        int childGridIndex  = amr->GetCompositeIndex(levelIdx+1, *iter);
-        if(processMap[childGridIndex]<0)
-          {
-          continue;
-          }
-        if (amr->GetAMRInfo()->GetCoarsenedAMRBox(levelIdx+1, *iter, ibox))
+        continue;
+        }
+      if (amr->GetAMRInfo()->GetCoarsenedAMRBox(levelIdx+1, *iter, ibox))
+        {
+        ibox.Intersect(box);
+        const int *loCorner=ibox.GetLoCorner();
+        int hi[3];
+        ibox.GetValidHiCorner(hi);
+        for( int iz=loCorner[2]; iz<=hi[2]; iz++ )
           {
-          ibox.Intersect(box);
-          const int *loCorner=ibox.GetLoCorner();
-          int hi[3];
-          ibox.GetValidHiCorner(hi);
-          for( int iz=loCorner[2]; iz<=hi[2]; iz++ )
+          for( int iy=loCorner[1]; iy<=hi[1]; iy++ )
             {
-            for( int iy=loCorner[1]; iy<=hi[1]; iy++ )
+            for( int ix=loCorner[0]; ix<=hi[0]; ix++ )
               {
-              for( int ix=loCorner[0]; ix<=hi[0]; ix++ )
-                {
-                vtkIdType id =  vtkAMRBox::GetCellLinearIndex(box,ix, iy, iz, grid->GetDimensions());
-                ghosts->SetValue(id, ghosts->GetValue(id) | vtkDataSetAttributes::REFINEDCELL);
-                } // END for x
-              } // END for y
-            } // END for z
-          }
-        } // Processing all higher boxes for a specific coarse grid
-      }
-
-    grid->GetCellData()->AddArray(ghosts);
-    ghosts->Delete();
+              vtkIdType id =  vtkAMRBox::GetCellLinearIndex(box,ix, iy, iz, grid->GetDimensions());
+              vis->SetValue(id, 0);
+              } // END for x
+            } // END for y
+          } // END for z
+        }
+      } // Processing all higher boxes for a specific coarse grid
     }
 }
diff --git a/Common/DataModel/vtkAnimationScene.cxx b/Common/DataModel/vtkAnimationScene.cxx
index a8bf8f0..f90e1b6 100644
--- a/Common/DataModel/vtkAnimationScene.cxx
+++ b/Common/DataModel/vtkAnimationScene.cxx
@@ -160,7 +160,7 @@ void vtkAnimationScene::Play()
 
   this->InPlay = 1;
   this->StopPlay = 0;
-  this->FrameRate = (this->FrameRate == 0.0) ? 1.0 : this->FrameRate;
+  this->FrameRate = (!this->FrameRate)? 1.0 : this->FrameRate;
   // the actual play loop, check for StopPlay flag.
 
   double currenttime = this->AnimationTime;
diff --git a/Common/DataModel/vtkBiQuadraticQuad.cxx b/Common/DataModel/vtkBiQuadraticQuad.cxx
index ee237d4..375d27a 100644
--- a/Common/DataModel/vtkBiQuadraticQuad.cxx
+++ b/Common/DataModel/vtkBiQuadraticQuad.cxx
@@ -414,9 +414,12 @@ vtkBiQuadraticQuad::Derivatives (int vtkNotUsed (subId),
 void vtkBiQuadraticQuad::InterpolationFunctions (double pcoords[3],
                                                  double weights[9])
 {
-  //Normally these coordinates are named r and s, but I chose x and y,
-  //because you can easily mark and paste these functions to the
-  //gnuplot splot function. :D
+  //VTK needs parametric coordinates to be between (0,1). Isoparametric
+  //shape functions are normaly formulated between (-1,1). But because we need
+  //to derivate these functions in x and y direction, we are formulating the
+  //shape functions in parametric coordinates. Normaly these coordinates are
+  //named r and s, but I chose x and y, because you can easily mark and
+  //paste these functions to the gnuplot splot function. :D
   double x = pcoords[0];
   double y = pcoords[1];
 
diff --git a/Common/DataModel/vtkBiQuadraticQuadraticHexahedron.cxx b/Common/DataModel/vtkBiQuadraticQuadraticHexahedron.cxx
index 5cb4323..2b48109 100644
--- a/Common/DataModel/vtkBiQuadraticQuadraticHexahedron.cxx
+++ b/Common/DataModel/vtkBiQuadraticQuadraticHexahedron.cxx
@@ -275,7 +275,7 @@ int vtkBiQuadraticQuadraticHexahedron::EvaluatePosition(double* x,
     d=vtkMath::Determinant3x3(rcol,scol,tcol);
     if ( fabs(d) < 1.e-20)
       {
-      vtkDebugMacro (<<"Determinant incorrect, iteration " << iteration);
+      vtkErrorMacro (<<"Determinant incorrect, iteration " << iteration);
       return -1;
       }
 
@@ -296,6 +296,7 @@ int vtkBiQuadraticQuadraticHexahedron::EvaluatePosition(double* x,
              (fabs(pcoords[1]) > VTK_DIVERGED) ||
              (fabs(pcoords[2]) > VTK_DIVERGED))
       {
+      vtkErrorMacro (<<"Newton did not converged, iteration " << iteration);
       return -1;
       }
 
@@ -312,6 +313,7 @@ int vtkBiQuadraticQuadraticHexahedron::EvaluatePosition(double* x,
   //  outside of element
   if ( !converged )
     {
+    vtkErrorMacro (<<"Newton did not converged, iteration " << iteration);
     return -1;
     }
 
@@ -547,6 +549,7 @@ void vtkBiQuadraticQuadraticHexahedron::JacobianInverse(double pcoords[3],
   // now find the inverse
   if ( vtkMath::InvertMatrix(m,inverse,3) == 0 )
     {
+    vtkErrorMacro(<<"Jacobian inverse not found");
     return;
     }
 }
diff --git a/Common/DataModel/vtkBiQuadraticQuadraticWedge.cxx b/Common/DataModel/vtkBiQuadraticQuadraticWedge.cxx
index d7d5039..0d5cf17 100644
--- a/Common/DataModel/vtkBiQuadraticQuadraticWedge.cxx
+++ b/Common/DataModel/vtkBiQuadraticQuadraticWedge.cxx
@@ -196,7 +196,6 @@ int vtkBiQuadraticQuadraticWedge::EvaluatePosition (double *x,
     d = vtkMath::Determinant3x3 (rcol, scol, tcol);
     if (fabs (d) < 1.e-20)
       {
-      vtkDebugMacro (<<"Determinant incorrect, iteration " << iteration);
       return -1;
       }
 
diff --git a/Common/DataModel/vtkBiQuadraticTriangle.cxx b/Common/DataModel/vtkBiQuadraticTriangle.cxx
index 56d78c3..ba068a8 100644
--- a/Common/DataModel/vtkBiQuadraticTriangle.cxx
+++ b/Common/DataModel/vtkBiQuadraticTriangle.cxx
@@ -151,7 +151,7 @@ int vtkBiQuadraticTriangle::EvaluatePosition(double* x, double* closestPoint,
       pcoords[0] = 0.5*pc0;
       pcoords[1] = 0.5 + 0.5*pc1;
       }
-    pcoords[2] = 0.0;
+    pcoords[2] = 1.0 - pcoords[0] - pcoords[1];
     this->InterpolationFunctions(pcoords,weights);
     }
 
diff --git a/Common/DataModel/vtkBox.cxx b/Common/DataModel/vtkBox.cxx
index d423b40..a096937 100644
--- a/Common/DataModel/vtkBox.cxx
+++ b/Common/DataModel/vtkBox.cxx
@@ -171,7 +171,7 @@ double vtkBox::EvaluateFunction(double x[3])
     else
       {
       dist = fabs(x[i]-minP[i]);
-      if ( dist > 0.0 )
+      if (dist)
         {
         inside = 0;
         }
diff --git a/Common/DataModel/vtkCell.h b/Common/DataModel/vtkCell.h
index 3a26212..f6e9c94 100644
--- a/Common/DataModel/vtkCell.h
+++ b/Common/DataModel/vtkCell.h
@@ -305,11 +305,15 @@ public:
   // Compute the interpolation functions/derivatives
   // (aka shape functions/derivatives)
   // No-ops at this level. Typically overridden in subclasses.
-  virtual void InterpolateFunctions(double vtkNotUsed(pcoords)[3], double* vtkNotUsed(weight))
+  virtual void InterpolateFunctions(double pcoords[3], double weights[3])
     {
+    (void)pcoords;
+    (void)weights;
     }
-  virtual void InterpolateDerivs(double vtkNotUsed(pcoords)[3], double* vtkNotUsed(derivs))
+  virtual void InterpolateDerivs(double pcoords[3], double derivs[3])
     {
+    (void)pcoords;
+    (void)derivs;
     }
 
   // left public for quick computational access
diff --git a/Common/DataModel/vtkCellArray.h b/Common/DataModel/vtkCellArray.h
index 266a969..de15bfe 100644
--- a/Common/DataModel/vtkCellArray.h
+++ b/Common/DataModel/vtkCellArray.h
@@ -220,7 +220,7 @@ public:
     {this->Ia->Squeeze();}
 
   // Description:
-  // Return the memory in kibibytes (1024 bytes) consumed by this cell array. Used to
+  // Return the memory in kilobytes consumed by this cell array. Used to
   // support streaming and reading/writing data. The value returned is
   // guaranteed to be greater than or equal to the memory required to
   // actually represent the data represented by this object. The
diff --git a/Common/DataModel/vtkCellLinks.cxx b/Common/DataModel/vtkCellLinks.cxx
index 78840a3..67b7d4d 100644
--- a/Common/DataModel/vtkCellLinks.cxx
+++ b/Common/DataModel/vtkCellLinks.cxx
@@ -267,7 +267,7 @@ unsigned long vtkCellLinks::GetActualMemorySize()
   size *= sizeof(int *); //references to cells
   size += (this->MaxId+1) * sizeof(vtkCellLinks::Link); //list of cell lists
 
-  return static_cast<unsigned long>( ceil(size/1024.0)); // kibibytes
+  return static_cast<unsigned long>( ceil(size/1024.0)); //kilobytes
 }
 
 //----------------------------------------------------------------------------
diff --git a/Common/DataModel/vtkCellLinks.h b/Common/DataModel/vtkCellLinks.h
index bac2002..49a2ef0 100644
--- a/Common/DataModel/vtkCellLinks.h
+++ b/Common/DataModel/vtkCellLinks.h
@@ -112,7 +112,7 @@ public:
   void Reset();
 
   // Description:
-  // Return the memory in kibibytes (1024 bytes) consumed by this cell links array.
+  // Return the memory in kilobytes consumed by this cell links array.
   // Used to support streaming and reading/writing data. The value
   // returned is guaranteed to be greater than or equal to the memory
   // required to actually represent the data represented by this object.
diff --git a/Common/DataModel/vtkCellLocator.h b/Common/DataModel/vtkCellLocator.h
index 371523c..89866e7 100644
--- a/Common/DataModel/vtkCellLocator.h
+++ b/Common/DataModel/vtkCellLocator.h
@@ -58,11 +58,47 @@ public:
   int GetNumberOfCellsPerBucket()
   { return this->NumberOfCellsPerNode; }
 
-  // Re-use any superclass signatures that we don't override.
+//BTX
+/*
+  if the borland compiler is ever removed, we can use these declarations
+  instead of reimplementaing the calls in this subclass
   using vtkAbstractCellLocator::IntersectWithLine;
-  using vtkAbstractCellLocator::FindCell;
   using vtkAbstractCellLocator::FindClosestPoint;
   using vtkAbstractCellLocator::FindClosestPointWithinRadius;
+*/
+//ETX
+
+  // Description:
+  // reimplemented from vtkAbstractCellLocator to support bad compilers
+  virtual int IntersectWithLine(
+    double a0[3], double a1[3], double tol,
+    double& t, double x[3], double pcoords[3],
+    int &subId)
+  {
+    return Superclass::
+      IntersectWithLine(a0, a1, tol,t, x, pcoords, subId);
+  }
+
+  // Description:
+  // reimplemented from vtkAbstractCellLocator to support bad compilers
+  virtual int IntersectWithLine(
+    double a0[3], double a1[3], double tol,
+    double& t, double x[3], double pcoords[3],
+    int &subId, vtkIdType &cellId)
+  {
+    return Superclass::
+      IntersectWithLine(a0, a1, tol,t, x, pcoords, subId, cellId);
+  }
+
+  // Description:
+  // reimplemented from vtkAbstractCellLocator to support bad compilers
+  virtual int IntersectWithLine(
+    const double a0[3], const double a1[3],
+    vtkPoints *points, vtkIdList *cellIds)
+  {
+    return Superclass::
+      IntersectWithLine(a0, a1, points, cellIds);
+  }
 
   // Description:
   // Return intersection point (if any) AND the cell which was intersected by
@@ -74,6 +110,16 @@ public:
                                 vtkGenericCell *cell);
 
   // Description:
+  // reimplemented from vtkAbstractCellLocator to support bad compilers
+  virtual void FindClosestPoint(
+    double x[3], double closestPoint[3],
+    vtkIdType &cellId, int &subId, double& dist2)
+  {
+    Superclass::
+      FindClosestPoint(x, closestPoint, cellId, subId, dist2);
+  }
+
+  // Description:
   // Return the closest point and the cell which is closest to the point x.
   // The closest point is somewhere on a cell, it need not be one of the
   // vertices of the cell.  This version takes in a vtkGenericCell
@@ -89,6 +135,29 @@ public:
     int &subId, double& dist2);
 
   // Description:
+  // reimplemented from vtkAbstractCellLocator to support bad compilers
+  virtual vtkIdType FindClosestPointWithinRadius(
+    double x[3], double radius,
+    double closestPoint[3], vtkIdType &cellId,
+    int &subId, double& dist2)
+  {
+    return Superclass::FindClosestPointWithinRadius
+      (x, radius, closestPoint, cellId, subId, dist2);
+  }
+
+  // Description:
+  // reimplemented from vtkAbstractCellLocator to support bad compilers
+  virtual vtkIdType FindClosestPointWithinRadius(
+    double x[3], double radius,
+    double closestPoint[3],
+    vtkGenericCell *cell, vtkIdType &cellId,
+    int &subId, double& dist2)
+  {
+    return Superclass::FindClosestPointWithinRadius
+      (x, radius, closestPoint, cell, cellId, subId, dist2);
+  }
+
+  // Description:
   // Return the closest point within a specified radius and the cell which is
   // closest to the point x. The closest point is somewhere on a cell, it
   // need not be one of the vertices of the cell. This method returns 1 if a
@@ -119,6 +188,12 @@ public:
   virtual int GetNumberOfBuckets(void);
 
   // Description:
+  // Returns the Id of the cell containing the point,
+  // returns -1 if no cell found. This interface uses a tolerance of zero
+  virtual vtkIdType FindCell(double x[3])
+    { return this->Superclass::FindCell(x); }
+
+  // Description:
   // Find the cell containing a given point. returns -1 if no cell found
   // the cell parameters are copied into the supplied variables, a cell must
   // be provided to store the information.
diff --git a/Common/DataModel/vtkCellTypes.cxx b/Common/DataModel/vtkCellTypes.cxx
index 822a0aa..a28caf6 100644
--- a/Common/DataModel/vtkCellTypes.cxx
+++ b/Common/DataModel/vtkCellTypes.cxx
@@ -57,7 +57,7 @@ static const char* vtkCellTypesStrings[] = {
   "vtkBiQuadraticQuadraticHexahedron",
   "vtkBiQuadraticTriangle",
   "vtkCubicLine",
-  "vtkQuadraticPolygon",
+  "UnknownClass",
   "UnknownClass",
   "UnknownClass",
   "UnknownClass",
@@ -277,7 +277,7 @@ unsigned long vtkCellTypes::GetActualMemorySize()
     size += this->LocationArray->GetActualMemorySize();
     }
 
-  return static_cast<unsigned long>(ceil(size/1024.0)); // kibibytes
+  return static_cast<unsigned long>(ceil(size/1024.0)); //kilobytes
 }
 
 
diff --git a/Common/DataModel/vtkCellTypes.h b/Common/DataModel/vtkCellTypes.h
index 7925ee9..eadfa92 100644
--- a/Common/DataModel/vtkCellTypes.h
+++ b/Common/DataModel/vtkCellTypes.h
@@ -96,7 +96,7 @@ public:
   void Reset();
 
   // Description:
-  // Return the memory in kibibytes (1024 bytes) consumed by this cell type array.
+  // Return the memory in kilobytes consumed by this cell type array.
   // Used to support streaming and reading/writing data. The value
   // returned is guaranteed to be greater than or equal to the memory
   // required to actually represent the data represented by this object.
@@ -145,9 +145,9 @@ private:
 //----------------------------------------------------------------------------
 inline int vtkCellTypes::IsType(unsigned char type)
 {
-  vtkIdType numTypes=this->GetNumberOfTypes();
+  int numTypes=this->GetNumberOfTypes();
 
-  for (vtkIdType i=0; i<numTypes; i++)
+  for (int i=0; i<numTypes; i++)
     {
     if ( type == this->GetCellType(i))
       {
diff --git a/Common/DataModel/vtkColor.h b/Common/DataModel/vtkColor.h
index 95a6a37..464a5e4 100644
--- a/Common/DataModel/vtkColor.h
+++ b/Common/DataModel/vtkColor.h
@@ -82,6 +82,18 @@ public:
   // Description:
   // Get the blue component of the color, i.e. element 2.
   const T& GetBlue() const { return this->Data[2]; }
+
+  // Description:
+  // Legacy method for getting the red component.
+  VTK_LEGACY(const T& Red() const);
+
+  // Description:
+  // Legacy method for getting the green component.
+  VTK_LEGACY(const T& Green() const);
+
+  // Description:
+  // Legacy method for getting the blue component.
+  VTK_LEGACY(const T& Blue() const);
 };
 
 // .NAME vtkColor4 - templated base type for storage of 4 component colors.
@@ -160,6 +172,22 @@ public:
   // Description:
   // Get the alpha component of the color, i.e. element 3.
   const T& GetAlpha() const { return this->Data[3]; }
+
+  // Description:
+  // Legacy method for getting the red component.
+  VTK_LEGACY(const T& Red() const);
+
+  // Description:
+  // Legacy method for getting the green component.
+  VTK_LEGACY(const T& Green() const);
+
+  // Description:
+  // Legacy method for getting the blue component.
+  VTK_LEGACY(const T& Blue() const);
+
+  // Description:
+  // Legacy method for getting the alpha component.
+  VTK_LEGACY(const T& Alpha() const);
 };
 
 // Description:
@@ -258,5 +286,56 @@ public:
     : vtkColor4<double>(r, g, b, a) {}
 };
 
+#ifndef VTK_LEGACY_REMOVE
+template<typename T>
+const T& vtkColor3<T>::Red() const
+{
+  VTK_LEGACY_REPLACED_BODY(vtkColor3::Red, "VTK 6.0", vtkColor3::GetRed);
+  return this->GetRed();
+}
+
+template<typename T>
+const T& vtkColor3<T>::Green() const
+{
+  VTK_LEGACY_REPLACED_BODY(vtkColor3::Green, "VTK 6.0", vtkColor3::GetGreen);
+  return this->GetGreen();
+}
+
+template<typename T>
+const T& vtkColor3<T>::Blue() const
+{
+  VTK_LEGACY_REPLACED_BODY(vtkColor3::Blue, "VTK 6.0", vtkColor3::GetBlue);
+  return this->GetBlue();
+}
+
+template<typename T>
+const T& vtkColor4<T>::Red() const
+{
+  VTK_LEGACY_REPLACED_BODY(vtkColor4::Red, "VTK 6.0", vtkColor4::GetRed);
+  return this->GetRed();
+}
+
+template<typename T>
+const T& vtkColor4<T>::Green() const
+{
+  VTK_LEGACY_REPLACED_BODY(vtkColor4::Green, "VTK 6.0", vtkColor4::GetGreen);
+  return this->GetGreen();
+}
+
+template<typename T>
+const T& vtkColor4<T>::Blue() const
+{
+  VTK_LEGACY_REPLACED_BODY(vtkColor4::Blue, "VTK 6.0", vtkColor4::GetBlue);
+  return this->GetBlue();
+}
+
+template<typename T>
+const T& vtkColor4<T>::Alpha() const
+{
+  VTK_LEGACY_REPLACED_BODY(vtkColor4::Alpha, "VTK 6.0", vtkColor4::GetAlpha);
+  return this->GetAlpha();
+}
+#endif // VTK_LEGACY_REMOVE
+
 #endif // vtkColor_h
 // VTK-HeaderTest-Exclude: vtkColor.h
diff --git a/Common/DataModel/vtkCompositeDataSet.h b/Common/DataModel/vtkCompositeDataSet.h
index e56f54f..2df4ec9 100644
--- a/Common/DataModel/vtkCompositeDataSet.h
+++ b/Common/DataModel/vtkCompositeDataSet.h
@@ -76,7 +76,7 @@ public:
 
 
   // Description:
-  // Return the actual size of the data in kibibytes (1024 bytes). This number
+  // Return the actual size of the data in kilobytes. This number
   // is valid only after the pipeline has updated.
   virtual unsigned long GetActualMemorySize();
 
diff --git a/Common/DataModel/vtkConvexPointSet.cxx b/Common/DataModel/vtkConvexPointSet.cxx
index 16a1dba..68443de 100644
--- a/Common/DataModel/vtkConvexPointSet.cxx
+++ b/Common/DataModel/vtkConvexPointSet.cxx
@@ -101,7 +101,8 @@ vtkCell *vtkConvexPointSet::GetFace(int faceId)
 int vtkConvexPointSet::Triangulate(int vtkNotUsed(index), vtkIdList *ptIds,
                                    vtkPoints *pts)
 {
-  vtkIdType numPts=this->GetNumberOfPoints();
+  int numPts=this->GetNumberOfPoints();
+  int i;
   double x[3];
   vtkIdType ptId;
 
@@ -122,7 +123,7 @@ int vtkConvexPointSet::Triangulate(int vtkNotUsed(index), vtkIdList *ptIds,
   // according to point id. We insert points with id == the index into the
   // vtkConvexPointSet::PointIds and Points; but sort on the global point
   // id.
-  for (vtkIdType i=0; i<numPts; i++)
+  for (i=0; i<numPts; i++)
     {
     ptId = this->PointIds->GetId(i);
     this->Points->GetPoint(i, x);
@@ -149,11 +150,12 @@ void vtkConvexPointSet::Contour(double value,
                                 vtkCellData *outCd)
 {
   // For each tetra, contour it
+  int i, j;
   vtkIdType ptId, localId;
-  vtkIdType numTets = this->TetraIds->GetNumberOfIds() / 4;
-  for (vtkIdType i=0; i<numTets; i++)
+  int numTets = this->TetraIds->GetNumberOfIds() / 4;
+  for (i=0; i<numTets; i++)
     {
-    for (vtkIdType j=0; j<4; j++)
+    for (j=0; j<4; j++)
       {
       localId = this->TetraIds->GetId(4*i+j);
       ptId = this->PointIds->GetId(localId);
diff --git a/Common/DataModel/vtkCylinder.h b/Common/DataModel/vtkCylinder.h
index 82fc149..3fd82fb 100644
--- a/Common/DataModel/vtkCylinder.h
+++ b/Common/DataModel/vtkCylinder.h
@@ -59,8 +59,7 @@ public:
   // Description:
   // Set/Get cylinder center
   vtkSetVector3Macro(Center,double);
-  vtkGetVector3Macro(Center,double);
-
+  vtkGetVectorMacro(Center,double,3);
 protected:
   vtkCylinder();
   ~vtkCylinder() {}
diff --git a/Common/DataModel/vtkDataObject.h b/Common/DataModel/vtkDataObject.h
index dce54f3..e1fbad5 100644
--- a/Common/DataModel/vtkDataObject.h
+++ b/Common/DataModel/vtkDataObject.h
@@ -113,26 +113,21 @@ public:
   unsigned long GetUpdateTime();
 
   // Description:
-  // Return the actual size of the data in kibibytes (1024 bytes). This number
+  // Return the actual size of the data in kilobytes. This number
   // is valid only after the pipeline has updated. The memory size
   // returned is guaranteed to be greater than or equal to the
   // memory required to represent the data (e.g., extra space in
   // arrays, etc. are not included in the return value).
   virtual unsigned long GetActualMemorySize();
 
-  // Description:
-  // Copy from the pipeline information to the data object's own information.
-  // Called right before the main execution pass.
+   // Description:
+   // Copy information about this data object from the
+   // pipeline information to its own Information.
+  // Called right before the main execution pass..
   virtual void CopyInformationFromPipeline(vtkInformation* vtkNotUsed(info))
   {}
 
   // Description:
-  // Copy information from this data object to the pipeline information.
-  // This is used by the vtkTrivialProducer that is created when someone
-  // calls SetInputData() to connect a data object to a pipeline.
-  virtual void CopyInformationToPipeline(vtkInformation* vtkNotUsed(info)) {}
-
-  // Description:
   // Return the information object within the input information object's
   // field data corresponding to the specified association
   // (FIELD_ASSOCIATION_POINTS or FIELD_ASSOCIATION_CELLS) and attribute
diff --git a/Common/DataModel/vtkDataObjectTree.h b/Common/DataModel/vtkDataObjectTree.h
index ca7ebbd..6a980ff 100644
--- a/Common/DataModel/vtkDataObjectTree.h
+++ b/Common/DataModel/vtkDataObjectTree.h
@@ -99,7 +99,7 @@ public:
   virtual int HasMetaData(vtkCompositeDataIterator* iter);
 
   // Description:
-  // Return the actual size of the data in kibibytes (1024 bytes). This number
+  // Return the actual size of the data in kilobytes. This number
   // is valid only after the pipeline has updated.
   virtual unsigned long GetActualMemorySize();
 
diff --git a/Common/DataModel/vtkDataSet.cxx b/Common/DataModel/vtkDataSet.cxx
index 4ca8d4b..4e84e9d 100644
--- a/Common/DataModel/vtkDataSet.cxx
+++ b/Common/DataModel/vtkDataSet.cxx
@@ -14,7 +14,6 @@
 =========================================================================*/
 #include "vtkDataSet.h"
 
-#include "vtkCallbackCommand.h"
 #include "vtkCell.h"
 #include "vtkCellData.h"
 #include "vtkCellTypes.h"
@@ -25,8 +24,6 @@
 #include "vtkInformationVector.h"
 #include "vtkMath.h"
 #include "vtkPointData.h"
-#include "vtkSmartPointer.h"
-#include "vtkStructuredData.h"
 
 #include <math.h>
 
@@ -36,21 +33,9 @@
 vtkDataSet::vtkDataSet ()
 {
   vtkMath::UninitializeBounds(this->Bounds);
-  // Observer for updating the cell/point ghost arrays pointers
-  this->DataObserver = vtkCallbackCommand::New();
-  this->DataObserver->SetCallback(&vtkDataSet::OnDataModified);
-  this->DataObserver->SetClientData(this);
 
   this->PointData = vtkPointData::New();
-  this->PointGhostArray = NULL;
-  // when point data is modified, we update the point data ghost array cache
-  this->PointData->AddObserver(vtkCommand::ModifiedEvent, this->DataObserver);
-
   this->CellData = vtkCellData::New();
-  this->CellGhostArray = NULL;
-  // when cell data is modified, we update the cell data ghost array cache
-  this->CellData->AddObserver(vtkCommand::ModifiedEvent, this->DataObserver);
-
   this->ScalarRange[0] = 0.0;
   this->ScalarRange[1] = 1.0;
 }
@@ -58,13 +43,8 @@ vtkDataSet::vtkDataSet ()
 //----------------------------------------------------------------------------
 vtkDataSet::~vtkDataSet ()
 {
-  this->PointData->RemoveObserver(this->DataObserver);
   this->PointData->Delete();
-
-  this->CellData->RemoveObserver(this->DataObserver);
   this->CellData->Delete();
-
-  this->DataObserver->Delete();
 }
 
 //----------------------------------------------------------------------------
@@ -480,7 +460,7 @@ int vtkDataSet::CheckAttributes()
 }
 
 //----------------------------------------------------------------------------
-void vtkDataSet::GenerateGhostArray(int zeroExt[6], bool cellOnly)
+void vtkDataSet::GenerateGhostLevelArray(int zeroExt[6])
 {
   // Make sure this is a structured data set.
   if(this->GetExtentType() != VTK_3D_EXTENT)
@@ -488,42 +468,31 @@ void vtkDataSet::GenerateGhostArray(int zeroExt[6], bool cellOnly)
     return;
     }
 
-  int extent[6];
-  int i, j, k, di, dj, dk, dist;
-
-  bool sameExtent = true;
-  for (i=0; i<6; i++)
-    {
-    if (extent[i] != zeroExt[i])
-      {
-      sameExtent = false;
-      break;
-      }
-    }
-  if (sameExtent)
-    {
-    return;
-    }
-
-  this->Information->Get(vtkDataObject::DATA_EXTENT(), extent);
-
-  vtkIdType index = 0;
-
-  // ---- POINTS ----
-
-  if (!cellOnly)
-    {
-    vtkSmartPointer<vtkUnsignedCharArray> ghostPoints =
-      vtkUnsignedCharArray::SafeDownCast(
-        this->PointData->GetArray(vtkDataSetAttributes::GhostArrayName()));
-    if (!ghostPoints)
-      {
-      ghostPoints.TakeReference(vtkUnsignedCharArray::New());
-      ghostPoints->SetName(vtkDataSetAttributes::GhostArrayName());
-      ghostPoints->SetNumberOfTuples(vtkStructuredData::GetNumberOfPoints(extent));
-      ghostPoints->FillComponent(0, 0);
-      this->PointData->AddArray(ghostPoints);
-      }
+  // Avoid generating these if the producer has generated them.
+  if(!this->PointData->GetArray("vtkGhostLevels"))
+    { // Create ghost levels for cells and points.
+    vtkUnsignedCharArray *levels;
+    int extent[6];
+    int i, j, k, di, dj, dk, dist;
+
+    this->Information->Get(vtkDataObject::DATA_EXTENT(), extent);
+
+    /*
+    // Get the extent with ghost level 0.
+    translator->SetWholeExtent(whole_extent);
+    translator->SetPiece(update_piece);
+    translator->SetNumberOfPieces(update_num_pieces);
+    translator->SetGhostLevel(0);
+    translator->PieceToExtent();
+    translator->GetExtent(zeroExt);
+    */
+
+    // ---- POINTS ----
+    // Allocate the appropriate number levels (number of points).
+    levels = vtkUnsignedCharArray::New();
+    levels->Allocate((extent[1]-extent[0] + 1) *
+                     (extent[3]-extent[2] + 1) *
+                     (extent[5]-extent[4] + 1));
 
     // Loop through the points in this image.
     for (k = extent[4]; k <= extent[5]; ++k)
@@ -533,7 +502,7 @@ void vtkDataSet::GenerateGhostArray(int zeroExt[6], bool cellOnly)
         {
         dk = zeroExt[4] - k;
         }
-      if (k > zeroExt[5])
+      if (k >= zeroExt[5])
         { // Special case for last tile.
         dk = k - zeroExt[5] + 1;
         }
@@ -544,7 +513,7 @@ void vtkDataSet::GenerateGhostArray(int zeroExt[6], bool cellOnly)
           {
           dj = zeroExt[2] - j;
           }
-        if (j > zeroExt[3])
+        if (j >= zeroExt[3])
           { // Special case for last tile.
           dj = j - zeroExt[3] + 1;
           }
@@ -555,7 +524,7 @@ void vtkDataSet::GenerateGhostArray(int zeroExt[6], bool cellOnly)
             {
             di = zeroExt[0] - i;
             }
-          if (i > zeroExt[1])
+          if (i >= zeroExt[1])
             { // Special case for last tile.
             di = i - zeroExt[1] + 1;
             }
@@ -569,106 +538,98 @@ void vtkDataSet::GenerateGhostArray(int zeroExt[6], bool cellOnly)
             {
             dist = dk;
             }
-          unsigned char value = ghostPoints->GetValue(index);
-          if(dist > 0)
-            {
-            value |= vtkDataSetAttributes::DUPLICATEPOINT;
-            }
-          ghostPoints->SetValue(index, value);
-          index++;
+
+          //cerr << "   " << i << ", " << j << ", " << k << endl;
+          //cerr << "   " << di << ", " << dj << ", " << dk << endl;
+          //cerr << dist << endl;
+
+          levels->InsertNextValue(static_cast<unsigned char>(dist));
           }
         }
       }
-    }
-
-  // ---- CELLS ----
-
-  vtkSmartPointer<vtkUnsignedCharArray> ghostCells =
-    vtkUnsignedCharArray::SafeDownCast(
-      this->CellData->GetArray(vtkDataSetAttributes::GhostArrayName()));
-  if (!ghostCells)
-    {
-    ghostCells.TakeReference(vtkUnsignedCharArray::New());
-    ghostCells->SetName(vtkDataSetAttributes::GhostArrayName());
-    ghostCells->SetNumberOfTuples(vtkStructuredData::GetNumberOfCells(extent));
-    ghostCells->FillComponent(0, 0);
-    this->CellData->AddArray(ghostCells);
-    }
-
-  index = 0;
-
-  // Loop through the cells in this image.
-  // Cells may be 2d or 1d ... Treat all as 3D
-  if (extent[0] == extent[1])
-    {
-    ++extent[1];
-    ++zeroExt[1];
-    }
-  if (extent[2] == extent[3])
-    {
-    ++extent[3];
-    ++zeroExt[3];
-    }
-  if (extent[4] == extent[5])
-    {
-    ++extent[5];
-    ++zeroExt[5];
-    }
-
-  // Loop
-  for (k = extent[4]; k < extent[5]; ++k)
-    { // Determine the Manhatten distances to zero extent.
-    dk = 0;
-    if (k < zeroExt[4])
+    levels->SetName("vtkGhostLevels");
+    this->PointData->AddArray(levels);
+    levels->Delete();
+
+    // ---- CELLS ----
+    // Allocate the appropriate number levels (number of cells).
+    levels = vtkUnsignedCharArray::New();
+    levels->Allocate((extent[1]-extent[0]) *
+                     (extent[3]-extent[2]) *
+                     (extent[5]-extent[4]));
+
+    // Loop through the cells in this image.
+    // Cells may be 2d or 1d ... Treat all as 3D
+    if (extent[0] == extent[1])
       {
-      dk = zeroExt[4] - k;
+      ++extent[1];
+      ++zeroExt[1];
       }
-    if (k >= zeroExt[5])
+    if (extent[2] == extent[3])
       {
-      dk = k - zeroExt[5] + 1;
+      ++extent[3];
+      ++zeroExt[3];
       }
-    for (j = extent[2]; j < extent[3]; ++j)
+    if (extent[4] == extent[5])
       {
-      dj = 0;
-      if (j < zeroExt[2])
+      ++extent[5];
+      ++zeroExt[5];
+      }
+
+    // Loop
+    for (k = extent[4]; k < extent[5]; ++k)
+      { // Determine the Manhatten distances to zero extent.
+      dk = 0;
+      if (k < zeroExt[4])
         {
-        dj = zeroExt[2] - j;
+        dk = zeroExt[4] - k;
         }
-      if (j >= zeroExt[3])
+      if (k >= zeroExt[5])
         {
-        dj = j - zeroExt[3] + 1;
+        dk = k - zeroExt[5] + 1;
         }
-      for (i = extent[0]; i < extent[1]; ++i)
+      for (j = extent[2]; j < extent[3]; ++j)
         {
-        di = 0;
-        if (i < zeroExt[0])
-          {
-          di = zeroExt[0] - i;
-          }
-        if (i >= zeroExt[1])
-          {
-          di = i - zeroExt[1] + 1;
-          }
-        // Compute Manhatten distance.
-        dist = di;
-        if (dj > dist)
+        dj = 0;
+        if (j < zeroExt[2])
           {
-          dist = dj;
+          dj = zeroExt[2] - j;
           }
-        if (dk > dist)
+        if (j >= zeroExt[3])
           {
-          dist = dk;
+          dj = j - zeroExt[3] + 1;
           }
-        unsigned char value = ghostCells->GetValue(index);
-        if(dist > 0)
+        for (i = extent[0]; i < extent[1]; ++i)
           {
-          value |= vtkDataSetAttributes::DUPLICATECELL;
+          di = 0;
+          if (i < zeroExt[0])
+            {
+            di = zeroExt[0] - i;
+            }
+          if (i >= zeroExt[1])
+            {
+            di = i - zeroExt[1] + 1;
+            }
+          // Compute Manhatten distance.
+          dist = di;
+          if (dj > dist)
+            {
+            dist = dj;
+            }
+          if (dk > dist)
+            {
+            dist = dk;
+            }
+
+          levels->InsertNextValue(static_cast<unsigned char>(dist));
           }
-        ghostCells->SetValue(index, value);
-        index++;
         }
       }
+    levels->SetName("vtkGhostLevels");
+    this->CellData->AddArray(levels);
+    levels->Delete();
     }
+
 }
 
 //----------------------------------------------------------------------------
@@ -733,128 +694,3 @@ void vtkDataSet::PrintSelf(ostream& os, vtkIndent indent)
   os << indent << "Compute Time: " <<this->ComputeTime.GetMTime() << "\n";
 }
 
-//----------------------------------------------------------------------------
-bool vtkDataSet::HasAnyGhostPoints()
-{
-  return IsAnyBitSet(
-    this->GetPointGhostArray(), vtkDataSetAttributes::DUPLICATEPOINT);
-}
-
-//----------------------------------------------------------------------------
-bool vtkDataSet::HasAnyGhostCells()
-{
-  return IsAnyBitSet(this->GetCellGhostArray(),
-                     vtkDataSetAttributes::DUPLICATECELL);
-}
-
-//----------------------------------------------------------------------------
-vtkUnsignedCharArray* vtkDataSet::GetPointGhostArray()
-{
-  if(!this->PointGhostArray)
-    {
-    this->PointGhostArray = vtkUnsignedCharArray::SafeDownCast(
-      this->GetPointData()->GetArray(vtkDataSetAttributes::GhostArrayName()));
-    }
-  assert (this->PointGhostArray ==
-          vtkUnsignedCharArray::SafeDownCast(
-            this->GetPointData()->GetArray(
-              vtkDataSetAttributes::GhostArrayName())));
-  return this->PointGhostArray;
-}
-
-//----------------------------------------------------------------------------
-void vtkDataSet::UpdatePointGhostArrayCache()
-{
-  this->PointGhostArray = vtkUnsignedCharArray::SafeDownCast(
-    this->GetPointData()->GetArray(vtkDataSetAttributes::GhostArrayName()));
-}
-
-//----------------------------------------------------------------------------
-vtkUnsignedCharArray* vtkDataSet::AllocatePointGhostArray()
-{
-  if(!this->GetPointGhostArray())
-    {
-    vtkUnsignedCharArray *ghosts = vtkUnsignedCharArray::New();
-    ghosts->SetName(vtkDataSetAttributes::GhostArrayName());
-    ghosts->SetNumberOfComponents(1);
-    ghosts->SetNumberOfTuples(this->GetNumberOfPoints());
-    ghosts->FillComponent(0, 0);
-    this->GetPointData()->AddArray(ghosts);
-    ghosts->Delete();
-    this->PointGhostArray = ghosts;
-    }
-  return this->PointGhostArray;
-}
-
-//----------------------------------------------------------------------------
-vtkUnsignedCharArray* vtkDataSet::GetCellGhostArray()
-{
-  if(!this->CellGhostArray)
-    {
-    this->CellGhostArray = vtkUnsignedCharArray::SafeDownCast(
-      this->GetCellData()->GetArray(vtkDataSetAttributes::GhostArrayName()));
-    }
-  assert (
-    this->CellGhostArray ==
-    vtkUnsignedCharArray::SafeDownCast(
-      this->GetCellData()->GetArray(vtkDataSetAttributes::GhostArrayName())));
-  return this->CellGhostArray;
-}
-
-//----------------------------------------------------------------------------
-void vtkDataSet::UpdateCellGhostArrayCache()
-{
-  this->CellGhostArray = vtkUnsignedCharArray::SafeDownCast(
-    this->GetCellData()->GetArray(vtkDataSetAttributes::GhostArrayName()));
-}
-
-
-//----------------------------------------------------------------------------
-vtkUnsignedCharArray* vtkDataSet::AllocateCellGhostArray()
-{
-  if(!this->GetCellGhostArray())
-    {
-    vtkUnsignedCharArray *ghosts = vtkUnsignedCharArray::New();
-    ghosts->SetName(vtkDataSetAttributes::GhostArrayName());
-    ghosts->SetNumberOfComponents(1);
-    ghosts->SetNumberOfTuples(this->GetNumberOfCells());
-    ghosts->FillComponent(0, 0);
-    this->GetCellData()->AddArray(ghosts);
-    ghosts->Delete();
-    this->CellGhostArray = ghosts;
-    }
-  return this->CellGhostArray;
-}
-
-//----------------------------------------------------------------------------
-bool vtkDataSet::IsAnyBitSet(vtkUnsignedCharArray *a, int bitFlag)
-{
-  if (a)
-    {
-    for (vtkIdType i = 0; i < a->GetNumberOfTuples(); ++i)
-      {
-      if (a->GetValue(i) & bitFlag)
-        {
-        return true;
-        }
-      }
-    }
-  return false;
-}
-
-//----------------------------------------------------------------------------
-void vtkDataSet::OnDataModified(
-  vtkObject* source, unsigned long, void* clientdata, void *)
-{
-  // update the point/cell pointers to ghost data arrays.
-  vtkDataSet* This = static_cast<vtkDataSet*>(clientdata);
-  if (source == This->GetPointData())
-    {
-    This->UpdatePointGhostArrayCache();
-    }
-  else
-    {
-    assert(source == This->GetCellData());
-    This->UpdateCellGhostArrayCache();
-    }
-}
diff --git a/Common/DataModel/vtkDataSet.h b/Common/DataModel/vtkDataSet.h
index 11a76f6..d5b2f91 100644
--- a/Common/DataModel/vtkDataSet.h
+++ b/Common/DataModel/vtkDataSet.h
@@ -47,8 +47,6 @@ class vtkCellTypes;
 class vtkGenericCell;
 class vtkIdList;
 class vtkPointData;
-class vtkUnsignedCharArray;
-class vtkCallbackCommand;
 
 class VTKCOMMONDATAMODEL_EXPORT vtkDataSet : public vtkDataObject
 {
@@ -295,7 +293,7 @@ public:
   virtual int GetMaxCellSize() = 0;
 
   // Description:
-  // Return the actual size of the data in kibibytes (1024 bytes). This number
+  // Return the actual size of the data in kilobytes. This number
   // is valid only after the pipeline has updated. The memory size
   // returned is guaranteed to be greater than or equal to the
   // memory required to represent the data (e.g., extra space in
@@ -332,14 +330,10 @@ public:
   int CheckAttributes();
 
   // Description:
-  // Normally called by pipeline executives or algoritms only. This method
+  // Normally called by pipeline executives or algoritgms only. This method
   // computes the ghost arrays for a given dataset. The zeroExt argument
-  // specifies the extent of the region which ghost type = 0.
-  virtual void GenerateGhostArray(int zeroExt[6])
-  {
-    this->GenerateGhostArray(zeroExt, false);
-  }
-  virtual void GenerateGhostArray(int zeroExt[6], bool cellOnly);
+  // specifies the extent of the region which ghost level = 0.
+  virtual void GenerateGhostLevelArray(int zeroExt[6]);
 
   //BTX
   // Description:
@@ -359,55 +353,6 @@ public:
   // Get the number of elements for a specific attribute type (POINT, CELL, etc.).
   virtual vtkIdType GetNumberOfElements(int type);
 
-  // Description:
-  // Returns 1 if there are any ghost cells
-  // 0 otherwise.
-  bool HasAnyGhostCells();
-  // Description:
-  // Returns 1 if there are any ghost points
-  // 0 otherwise.
-  bool HasAnyGhostPoints();
-  // Description:
-  // Returns 1 if there are any blanking cells
-  // 0 otherwise. Blanking is supported only for vtkStructuredGrid
-  // and vtkUniformGrid
-  virtual bool HasAnyBlankCells()
-  {
-    return 0;
-  }
-  // Description:
-  // Returns 1 if there are any blanking points
-  // 0 otherwise. Blanking is supported only for vtkStructuredGrid
-  // and vtkUniformGrid
-  virtual bool HasAnyBlankPoints()
-  {
-    return 0;
-  }
-
-  // Description:
-  // Gets the array that defines the ghost type of each point.
-  // We cache the pointer to the array to save a lookup involving string comparisons
-  vtkUnsignedCharArray* GetPointGhostArray();
-  // Description:
-  // Updates the pointer to the point ghost array.
-  void UpdatePointGhostArrayCache();
-
-  // Description:
-  // Allocate ghost array for points.
-  vtkUnsignedCharArray* AllocatePointGhostArray();
-
-  // Description:
-  // Get the array that defines the ghost type of each cell.
-  // We cache the pointer to the array to save a lookup involving string comparisons
-  vtkUnsignedCharArray* GetCellGhostArray();
-  // Description:
-  // Updates the pointer to the cell ghost array.
-  void UpdateCellGhostArrayCache();
-
-  // Description:
-  // Allocate ghost array for cells.
-  vtkUnsignedCharArray* AllocateCellGhostArray();
-
 protected:
   // Constructor with default bounds (0,1, 0,1, 0,1).
   vtkDataSet();
@@ -418,14 +363,8 @@ protected:
   // only if the cache became invalid (ScalarRangeComputeTime).
   virtual void ComputeScalarRange();
 
-  // Description:
-  // Helper function that tests if any of the values in 'a' have bitFlag set.
-  // The test performed is (value & bitFlag).
-  bool IsAnyBitSet(vtkUnsignedCharArray *a, int bitFlag);
-
   vtkCellData *CellData;   // Scalars, vectors, etc. associated w/ each cell
   vtkPointData *PointData;   // Scalars, vectors, etc. associated w/ each point
-  vtkCallbackCommand *DataObserver; // Observes changes to cell/point data
   vtkTimeStamp ComputeTime; // Time at which bounds, center, etc. computed
   double Bounds[6];  // (xmin,xmax, ymin,ymax, zmin,zmax) geometric bounds
   double Center[3];
@@ -436,21 +375,8 @@ protected:
   // Time at which scalar range is computed
   vtkTimeStamp ScalarRangeComputeTime;
 
-  // Description:
-  // These arrays pointers are caches used to avoid a string comparision (when
-  // getting ghost arrays using GetArray(name))
-  vtkUnsignedCharArray* PointGhostArray;
-  vtkUnsignedCharArray* CellGhostArray;
-
-
 private:
   void InternalDataSetCopy(vtkDataSet *src);
-  // Description:
-  // Called when point/cell data is modified
-  // Updates caches to point/cell ghost arrays.
-  static void OnDataModified(
-    vtkObject* source, unsigned long eid, void* clientdata, void *calldata);
-
   //BTX
   friend class vtkImageAlgorithmToDataSetFriendship;
   //ETX
diff --git a/Common/DataModel/vtkDataSetAttributes.h b/Common/DataModel/vtkDataSetAttributes.h
index 949a75e..f76eeaa 100644
--- a/Common/DataModel/vtkDataSetAttributes.h
+++ b/Common/DataModel/vtkDataSetAttributes.h
@@ -103,33 +103,6 @@ public:
   };
 //ETX
 
-  // ----------- ghost points and ghost cells -------------------------------------------
-  //The following bit fields are consistent with VisIt ghost zones specification
-  //For details, see http://www.visitusers.org/index.php?title=Representing_ghost_data
-
-  enum CellGhostTypes
-  {
-    DUPLICATECELL           = 1,  //the cell is present on multiple processors
-    HIGHCONNECTIVITYCELL    = 2,  //the cell has more neighbors than in a regular mesh
-    LOWCONNECTIVITYCELL     = 4,  //the cell has less neighbors than in a regular mesh
-    REFINEDCELL             = 8,  //other cells are present that refines it.
-    EXTERIORCELL            = 16, //the cell is on the exterior of the data set
-    HIDDENCELL              = 32  //the cell is needed to maintain connectivity, but the data values should be ignored.
-  };
-
-  enum PointGhostTypes
-  {
-    DUPLICATEPOINT          =1,   //the cell is present on multiple processors
-    HIDDENPOINT             =2    //the point is needed to maintain connectivity, but the data values should be ignored.
-  };
-
-  //A vtkDataArray with this name must be of type vtkUnsignedCharArray.
-  //Each value must be assigned according to the bit fields described in
-  //PointGhostTypes or CellGhostType
-  static const char* GhostArrayName()  { return "vtkGhostType";}
-
-  //-----------------------------------------------------------------------------------
-
   // Description:
   // Set/Get the scalar data.
   int SetScalars(vtkDataArray* da);
diff --git a/Common/DataModel/vtkEdgeTable.cxx b/Common/DataModel/vtkEdgeTable.cxx
index 1d4071c..98b712b 100644
--- a/Common/DataModel/vtkEdgeTable.cxx
+++ b/Common/DataModel/vtkEdgeTable.cxx
@@ -577,7 +577,7 @@ int vtkEdgeTable::InitPointInsertion(vtkPoints *newPts, vtkIdType estSize)
 int vtkEdgeTable::InsertUniquePoint(vtkIdType p1, vtkIdType p2, double x[3],
                                     vtkIdType &ptId)
 {
-  vtkIdType loc = this->IsEdge(p1,p2);
+  int loc = this->IsEdge(p1,p2);
 
   if ( loc != -1 )
     {
diff --git a/Common/DataModel/vtkEmptyCell.cxx b/Common/DataModel/vtkEmptyCell.cxx
index d5cb66b..1a378dc 100644
--- a/Common/DataModel/vtkEmptyCell.cxx
+++ b/Common/DataModel/vtkEmptyCell.cxx
@@ -23,37 +23,28 @@ vtkStandardNewMacro(vtkEmptyCell);
 
 //----------------------------------------------------------------------------
 int vtkEmptyCell::EvaluatePosition(double  vtkNotUsed(x)[3],
-                                  double closestPoint[3],
-                                  int& subId,
-                                  double pcoords[3],
-                                  double& dist2,
+                                  double  vtkNotUsed(closestPoint)[3],
+                                  int&   vtkNotUsed(subId),
+                                  double  vtkNotUsed(pcoords)[3],
+                                  double& vtkNotUsed(dist2),
                                   double  *vtkNotUsed(weights))
 {
-  pcoords[0] = pcoords[1] = pcoords[2] = -1.0;
-  subId = 0;
-  if (closestPoint != NULL)
-    {
-    closestPoint[0] = closestPoint[1] = closestPoint[2] = 0.0;
-    dist2 = -1.0;
-    }
   return 0;
 }
 
 //----------------------------------------------------------------------------
 void vtkEmptyCell::EvaluateLocation(int&  vtkNotUsed(subId),
                                    double vtkNotUsed(pcoords)[3],
-                                   double x[3],
+                                   double vtkNotUsed(x)[3],
                                    double *vtkNotUsed(weights))
 {
-  x[0] = x[1] = x[2] = 0.0;
 }
 
 //----------------------------------------------------------------------------
 int vtkEmptyCell::CellBoundary(int vtkNotUsed(subId),
                             double vtkNotUsed(pcoords)[3],
-                            vtkIdList* pts)
+                            vtkIdList *vtkNotUsed(pts))
 {
-  pts->Reset();
   return 0;
 }
 
@@ -80,9 +71,10 @@ int vtkEmptyCell::IntersectWithLine(double vtkNotUsed(p1)[3],
                                    double vtkNotUsed(tol),
                                    double& vtkNotUsed(t),
                                    double vtkNotUsed(x)[3],
-                                   double vtkNotUsed(pcoords)[3],
+                                   double pcoords[3],
                                    int& vtkNotUsed(subId))
 {
+  pcoords[0] = -10.0;
   return 0;
 }
 
@@ -92,6 +84,7 @@ int vtkEmptyCell::Triangulate(int vtkNotUsed(index),
 {
   pts->Reset();
   ptIds->Reset();
+
   return 1;
 }
 
@@ -119,6 +112,20 @@ void vtkEmptyCell::Clip(double vtkNotUsed(value),
 }
 
 //----------------------------------------------------------------------------
+void vtkEmptyCell::InterpolateFunctions(double pcoords[3], double *weights)
+{
+  (void)pcoords;
+  (void)weights;
+}
+
+//----------------------------------------------------------------------------
+void vtkEmptyCell::InterpolateDerivs(double pcoords[3], double *derivs)
+{
+  (void)pcoords;
+  (void)derivs;
+}
+
+//----------------------------------------------------------------------------
 void vtkEmptyCell::PrintSelf(ostream& os, vtkIndent indent)
 {
   this->Superclass::PrintSelf(os,indent);
diff --git a/Common/DataModel/vtkEmptyCell.h b/Common/DataModel/vtkEmptyCell.h
index 2e927d2..89b10f5 100644
--- a/Common/DataModel/vtkEmptyCell.h
+++ b/Common/DataModel/vtkEmptyCell.h
@@ -61,6 +61,12 @@ public:
   void Derivatives(int subId, double pcoords[3], double *values,
                    int dim, double *derivs);
 
+  // Description:
+  // Compute the interpolation functions/derivatives
+  // (aka shape functions/derivatives)
+  virtual void InterpolateFunctions(double pcoords[3], double *weights);
+  virtual void InterpolateDerivs(double pcoords[3], double *derivs);
+
 protected:
   vtkEmptyCell() {}
   ~vtkEmptyCell() {}
diff --git a/Common/DataModel/vtkExplicitCell.cxx b/Common/DataModel/vtkExplicitCell.cxx
new file mode 100644
index 0000000..5b73b48
--- /dev/null
+++ b/Common/DataModel/vtkExplicitCell.cxx
@@ -0,0 +1,37 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+  Module:    vtkExplicitCell.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 "vtkExplicitCell.h"
+
+#include "vtkCellArray.h"
+#include "vtkObjectFactory.h"
+#include "vtkDataSet.h"
+
+vtkCxxSetObjectMacro(vtkExplicitCell,DataSet,vtkDataSet);
+
+//----------------------------------------------------------------------------
+vtkExplicitCell::vtkExplicitCell()
+{
+  this->CellId = -1;
+  this->DataSet = NULL;
+}
+
+//----------------------------------------------------------------------------
+void vtkExplicitCell::PrintSelf(ostream& os, vtkIndent indent)
+{
+  this->Superclass::PrintSelf(os,indent);
+
+  os << indent << "Cell Id: " << this->CellId << "\n";
+  os << indent << "Data Set: " << this->DataSet << "\n";
+}
diff --git a/Common/DataModel/vtkExplicitCell.h b/Common/DataModel/vtkExplicitCell.h
new file mode 100644
index 0000000..066d498
--- /dev/null
+++ b/Common/DataModel/vtkExplicitCell.h
@@ -0,0 +1,75 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+  Module:    vtkExplicitCell.h
+
+  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.
+
+=========================================================================*/
+// .NAME vtkExplicitCell - abstract superclass for cells requiring an explicit representation
+// .SECTION Description
+// vtkExplicitCell is an abstract superclass for cells that cannot be
+// represented implicitly. An implicit representation requires only a
+// cell type and connectivity list (e.g., triangle). Explicit cells
+// require information beyond this; e.g., a NURBS surface or cells that
+// require explicit face/edge descriptions. Most cells in VTK are
+// implicitly represented.
+
+#ifndef vtkExplicitCell_h
+#define vtkExplicitCell_h
+
+#include "vtkCommonDataModelModule.h" // For export macro
+#include "vtkNonLinearCell.h"
+
+class vtkDataSet;
+
+class VTKCOMMONDATAMODEL_EXPORT vtkExplicitCell : public vtkNonLinearCell
+{
+public:
+  vtkTypeMacro(vtkExplicitCell,vtkNonLinearCell);
+  void PrintSelf(ostream& os, vtkIndent indent);
+
+  // Description:
+  // Explicit cells require additional representational information
+  // beyond the usual cell type and connectivity list information.
+  // Most cells in VTK are implicit cells. The vtkCell::IsImplicitCell()
+  // virtual function is overloaded to reflect this requirement.
+  virtual int IsExplicitCell() {return 1;}
+
+  // Description:
+  // Set/Get the cell id. This is necessary for explicit cells because they
+  // often need to keep extra information (typically contained in the
+  // cell data of a point set). This information might be things like
+  // knot points/weights, boundaries, etc.
+  vtkSetMacro(CellId,vtkIdType);
+  vtkGetMacro(CellId,vtkIdType);
+
+  // Description:
+  // Set/Get the mesh that owns this cell. This is necessary for explicit
+  // cells because they often need to keep extra information (typically
+  // contained in the cell data of a point set). This information might be
+  // things like knot points/weights, boundaries, etc.
+  virtual void SetDataSet(vtkDataSet*);
+  vtkGetObjectMacro(DataSet,vtkDataSet);
+
+protected:
+  vtkExplicitCell();
+  ~vtkExplicitCell() {}
+
+  vtkIdType  CellId; //used to index into other arrays
+  vtkDataSet *DataSet; //dataset from which this cell came
+
+private:
+  vtkExplicitCell(const vtkExplicitCell&);  // Not implemented.
+  void operator=(const vtkExplicitCell&);  // Not implemented.
+};
+
+#endif
+
+
diff --git a/Common/DataModel/vtkFieldData.cxx b/Common/DataModel/vtkFieldData.cxx
index a32db82..6198fa3 100644
--- a/Common/DataModel/vtkFieldData.cxx
+++ b/Common/DataModel/vtkFieldData.cxx
@@ -304,6 +304,10 @@ void vtkFieldData::AllocateArrays(int num)
     {
     return;
     }
+  else
+    {
+    this->Modified();
+    }
 
   if ( num == 0 )
     {
@@ -342,7 +346,6 @@ void vtkFieldData::AllocateArrays(int num)
     this->Data = data;
     this->NumberOfArrays = num;
     }
-  this->Modified();
 }
 
 //----------------------------------------------------------------------------
@@ -369,6 +372,7 @@ void vtkFieldData::SetArray(int i, vtkAbstractArray *data)
 
   if ( this->Data[i] != data )
     {
+    this->Modified();
     if ( this->Data[i] != NULL )
       {
       this->Data[i]->UnRegister(this);
@@ -378,7 +382,6 @@ void vtkFieldData::SetArray(int i, vtkAbstractArray *data)
       {
       this->Data[i]->Register(this);
       }
-    this->Modified();
     }
 }
 
@@ -395,7 +398,7 @@ vtkDataArray *vtkFieldData::GetArray(int i)
 // if range.
 vtkAbstractArray *vtkFieldData::GetAbstractArray(int i)
 {
-  if ( i < 0 || i >= this->GetNumberOfArrays() || this->Data == NULL)
+  if ( i < 0 || i >= this->GetNumberOfArrays() )
     {
     return 0;
     }
diff --git a/Common/DataModel/vtkFieldData.h b/Common/DataModel/vtkFieldData.h
index 80e0210..ae11ada 100644
--- a/Common/DataModel/vtkFieldData.h
+++ b/Common/DataModel/vtkFieldData.h
@@ -223,7 +223,7 @@ public:
   void Reset();
 
   // Description:
-  // Return the memory in kibibytes (1024 bytes) consumed by this field data. Used to
+  // Return the memory in kilobytes consumed by this field data. Used to
   // support streaming and reading/writing data. The value returned is
   // guaranteed to be greater than or equal to the memory required to
   // actually represent the data represented by this object.
diff --git a/Common/DataModel/vtkGenericAttribute.h b/Common/DataModel/vtkGenericAttribute.h
index 1563b6f..9bb476c 100644
--- a/Common/DataModel/vtkGenericAttribute.h
+++ b/Common/DataModel/vtkGenericAttribute.h
@@ -90,7 +90,7 @@ class VTKCOMMONDATAMODEL_EXPORT vtkGenericAttribute : public vtkObject
   virtual vtkIdType GetSize() = 0;
 
   // Description:
-  // Size in kibibytes (1024 bytes) taken by the attribute.
+  // Size in kilobytes taken by the attribute.
   virtual unsigned long GetActualMemorySize() = 0;
 
   // Description:
diff --git a/Common/DataModel/vtkGenericAttributeCollection.cxx b/Common/DataModel/vtkGenericAttributeCollection.cxx
index 0fd349d..3a023bb 100644
--- a/Common/DataModel/vtkGenericAttributeCollection.cxx
+++ b/Common/DataModel/vtkGenericAttributeCollection.cxx
@@ -142,7 +142,7 @@ int vtkGenericAttributeCollection::GetMaxNumberOfComponents()
 
 //----------------------------------------------------------------------------
 // Description:
-// Actual size of the data in kibibytes (1024 bytes); only valid after the pipeline has
+// Actual size of the data in kilobytes; only valid after the pipeline has
 // updated. It is guaranteed to be greater than or equal to the memory
 // required to represent the data.
 unsigned long vtkGenericAttributeCollection::GetActualMemorySize()
diff --git a/Common/DataModel/vtkGenericAttributeCollection.h b/Common/DataModel/vtkGenericAttributeCollection.h
index db7b53a..667aaec 100644
--- a/Common/DataModel/vtkGenericAttributeCollection.h
+++ b/Common/DataModel/vtkGenericAttributeCollection.h
@@ -64,7 +64,7 @@ public:
   int GetMaxNumberOfComponents();
 
   // Description:
-  // Actual size of the data in kibibytes (1024 bytes); only valid after the pipeline has
+  // Actual size of the data in kilobytes; only valid after the pipeline has
   // updated. It is guaranteed to be greater than or equal to the memory
   // required to represent the data.
   unsigned long GetActualMemorySize();
diff --git a/Common/DataModel/vtkGenericDataSet.cxx b/Common/DataModel/vtkGenericDataSet.cxx
index 2d4514f..32cda72 100644
--- a/Common/DataModel/vtkGenericDataSet.cxx
+++ b/Common/DataModel/vtkGenericDataSet.cxx
@@ -188,7 +188,7 @@ unsigned long int vtkGenericDataSet::GetMTime()
 
 //----------------------------------------------------------------------------
 // Description:
-// Actual size of the data in kibibytes (1024 bytes); only valid after the pipeline has
+// Actual size of the data in kilobytes; only valid after the pipeline has
 // updated. It is guaranteed to be greater than or equal to the memory
 // required to represent the data.
 unsigned long vtkGenericDataSet::GetActualMemorySize()
diff --git a/Common/DataModel/vtkGenericDataSet.h b/Common/DataModel/vtkGenericDataSet.h
index de33c2b..4a54499 100644
--- a/Common/DataModel/vtkGenericDataSet.h
+++ b/Common/DataModel/vtkGenericDataSet.h
@@ -222,7 +222,7 @@ public:
   vtkGetObjectMacro(Tessellator,vtkGenericCellTessellator);
 
   // Description:
-  // Actual size of the data in kibibytes (1024 bytes); only valid after the pipeline has
+  // Actual size of the data in kilobytes; only valid after the pipeline has
   // updated. It is guaranteed to be greater than or equal to the memory
   // required to represent the data.
   virtual unsigned long GetActualMemorySize();
diff --git a/Common/DataModel/vtkHexagonalPrism.cxx b/Common/DataModel/vtkHexagonalPrism.cxx
index da9382a..7dc4e28 100644
--- a/Common/DataModel/vtkHexagonalPrism.cxx
+++ b/Common/DataModel/vtkHexagonalPrism.cxx
@@ -133,7 +133,6 @@ int vtkHexagonalPrism::EvaluatePosition(double x[3], double* closestPoint,
     d=vtkMath::Determinant3x3(rcol,scol,tcol);
     if ( fabs(d) < 1.e-20)
       {
-      vtkDebugMacro (<<"Determinant incorrect, iteration " << iteration);
       return -1;
       }
 
@@ -380,7 +379,7 @@ int vtkHexagonalPrism::CellBoundary(int subId, double pcoords[3],
 
   double dot = vtkMath::Dot2D(v, u);
   double uNorm = vtkMath::Norm2D( u );
-  if (uNorm != 0.0)
+  if (uNorm)
     {
     dot /= uNorm;
     }
diff --git a/Common/DataModel/vtkHexahedron.cxx b/Common/DataModel/vtkHexahedron.cxx
index 618a6dd..7402dcb 100644
--- a/Common/DataModel/vtkHexahedron.cxx
+++ b/Common/DataModel/vtkHexahedron.cxx
@@ -357,7 +357,7 @@ static int faces[6][4] = { {0,4,7,3}, {1,2,6,5},
 
 // Marching cubes case table
 //
-#include "vtkMarchingCubesTriangleCases.h"
+#include "vtkMarchingCubesCases.h"
 
 void vtkHexahedron::Contour(double value, vtkDataArray *cellScalars,
                             vtkIncrementalPointLocator *locator,
diff --git a/Common/DataModel/vtkHyperOctree.cxx b/Common/DataModel/vtkHyperOctree.cxx
index b93d8ca..8d5dd60 100644
--- a/Common/DataModel/vtkHyperOctree.cxx
+++ b/Common/DataModel/vtkHyperOctree.cxx
@@ -86,7 +86,7 @@ public:
   virtual void SetAttributes(vtkDataSetAttributes *attributes)=0;
 
   // Description:
-  // Returns the actual memory size in kibibytes (1024 bytes).
+  // Returns the actual memory size in kilobytes.
   // Ignores the attribute array.
   virtual unsigned int GetActualMemorySize() = 0;
 
@@ -344,8 +344,8 @@ public:
   virtual vtkHyperOctreeCursor *Clone()
     {
       vtkCompactHyperOctreeCursor<D> *result=this->NewInstance();
-      assert("post: results_exists" && result!=0);
       result->Tree=this->Tree;
+      assert("post: results_exists" && result!=0);
       assert("post: same_tree" && result->SameTree(this));
       return result;
     }
@@ -917,7 +917,7 @@ public:
 
   //---------------------------------------------------------------------------
   // Description:
-  // Return memory used in kibibytes (1024 bytes).
+  // Return memory used in kilobytes.
   // Ignore the attribute array because its size is added by the data set.
   unsigned int GetActualMemorySize()
   {
diff --git a/Common/DataModel/vtkHyperOctree.h b/Common/DataModel/vtkHyperOctree.h
index 0df630a..9ce5463 100644
--- a/Common/DataModel/vtkHyperOctree.h
+++ b/Common/DataModel/vtkHyperOctree.h
@@ -470,7 +470,7 @@ public:
   vtkGetMacro(DualGridFlag,int);
 
   // Description:
-  // Return the actual size of the data in kibibytes (1024 bytes). This number
+  // Return the actual size of the data in kilobytes. This number
   // is valid only after the pipeline has updated. The memory size
   // returned is guaranteed to be greater than or equal to the
   // memory required to represent the data (e.g., extra space in
diff --git a/Common/DataModel/vtkHyperTree.cxx b/Common/DataModel/vtkHyperTree.cxx
index 19fb5ec..8cfc2f5 100644
--- a/Common/DataModel/vtkHyperTree.cxx
+++ b/Common/DataModel/vtkHyperTree.cxx
@@ -229,8 +229,8 @@ public:
   virtual vtkHyperTreeCursor* Clone()
   {
     vtkCompactHyperTreeCursor<N>* result = this->NewInstance();
-    assert( "post: results_exists" && result != 0 );
     result->Tree = this->Tree;
+    assert( "post: results_exists" && result != 0 );
     assert( "post: same_tree" && result->SameTree( this ) );
     return result;
   }
@@ -807,7 +807,7 @@ public:
 
   //---------------------------------------------------------------------------
   // Description:
-  // Return memory used in kibibytes (1024 bytes).
+  // Return memory used in kilobytes.
   // Ignore the attribute array because its size is added by the data set.
   unsigned int GetActualMemorySize()
   {
@@ -925,7 +925,6 @@ vtkHyperTree* vtkHyperTree::CreateInstance( unsigned int factor,
         default:
           vtkGenericWarningMacro( "Bad dimension " << dimension );
         }
-      break;
     case 3:
       switch ( dimension )
         {
@@ -938,7 +937,6 @@ vtkHyperTree* vtkHyperTree::CreateInstance( unsigned int factor,
         default:
           vtkGenericWarningMacro( "Bad dimension " << dimension );
         }
-      break;
     default:
       vtkGenericWarningMacro( "Bad branching factor " << factor );
     }
diff --git a/Common/DataModel/vtkHyperTree.h b/Common/DataModel/vtkHyperTree.h
index 621d1fb..9e4cb3a 100644
--- a/Common/DataModel/vtkHyperTree.h
+++ b/Common/DataModel/vtkHyperTree.h
@@ -152,7 +152,7 @@ public:
   virtual void SubdivideLeaf( vtkHyperTreeCursor* leaf ) = 0;
 
   // Description:
-  // Return the actual memory size in kibibytes (1024 bytes).
+  // Return the actual memory size in kilobytes.
   // NB: Ignores the attribute array.
   virtual unsigned int GetActualMemorySize() = 0;
 
diff --git a/Common/DataModel/vtkHyperTreeGrid.cxx b/Common/DataModel/vtkHyperTreeGrid.cxx
index d24ef66..4e64707 100644
--- a/Common/DataModel/vtkHyperTreeGrid.cxx
+++ b/Common/DataModel/vtkHyperTreeGrid.cxx
@@ -1108,11 +1108,9 @@ void vtkHyperTreeGrid::InitializeSuperCursor( vtkHyperTreeGridSuperCursor* sc,
     case 3:
       lowK = ( k == 0 ) ? 0 : -1;
       highK = ( k + 1 < this->GridSize[2] ) ? 1 : 0;
-      VTK_FALLTHROUGH;
     case 2:
       lowJ = ( j == 0 ) ? 0 : -1;
       highJ = ( j + 1 < this->GridSize[1] ) ? 1 : 0;
-      VTK_FALLTHROUGH;
     case 1:
       lowI = ( i == 0 ) ? 0 : -1;
       highI = ( i + 1 < this->GridSize[0] ) ? 1 : 0;
@@ -1417,7 +1415,7 @@ void vtkHyperTreeGrid::TraverseDualMaskedLeaf(
   vtkHyperTreeSimpleCursor* cursor0 = superCursor->GetCursor( 0 );
 
   // Check across D-face neighbors whether point must be adjusted
-  int f = 1;
+  unsigned int f = 1;
   for ( unsigned int d = 0; d < this->Dimension; ++ d, f *= 3 )
     {
     // For each direction, check both orientations
@@ -1575,7 +1573,7 @@ void vtkHyperTreeGrid::TraverseDualLeaf( vtkHyperTreeGridSuperCursor* superCurso
   //   (D-2)-faces are corners, neighbors are +/-  5, 7, 11, 13
 
   // Check across D-face neighbors whether point must be adjusted
-  int f = 1;
+  unsigned int f = 1;
   for ( unsigned int d = 0; d < this->Dimension; ++ d, f *= 3 )
     {
     // Start at center
@@ -1715,12 +1713,11 @@ void vtkHyperTreeGrid::TraverseDualLeaf( vtkHyperTreeGridSuperCursor* superCurso
       int cursorIdx = 0;
       switch ( this->Dimension )
         {
+        // Warning: Run through is intended! Do NOT add break statements
         case 3:
           cursorIdx += 9 * ( ( ( cornerIdx >> 2 ) & 1 ) + ( ( leafIdx >> 2 ) & 1 ) );
-          VTK_FALLTHROUGH;
         case 2:
           cursorIdx += 3 * ( ( ( cornerIdx >> 1 ) & 1 ) + ( ( leafIdx >> 1 ) & 1 ) );
-          VTK_FALLTHROUGH;
         case 1:
           cursorIdx += ( cornerIdx & 1) + ( leafIdx & 1);
         }
diff --git a/Common/DataModel/vtkHyperTreeGrid.h b/Common/DataModel/vtkHyperTreeGrid.h
index 683e8c4..5b07763 100644
--- a/Common/DataModel/vtkHyperTreeGrid.h
+++ b/Common/DataModel/vtkHyperTreeGrid.h
@@ -310,7 +310,7 @@ public:
   int GetExtentType() { return VTK_3D_EXTENT; }
 
   // Description:
-  // Return the actual size of the data in kibibytes (1024 bytes). This number
+  // Return the actual size of the data in kilobytes. This number
   // is valid only after the pipeline has updated. The memory size
   // returned is guaranteed to be greater than or equal to the
   // memory required to represent the data (e.g., extra space in
diff --git a/Common/DataModel/vtkImageData.cxx b/Common/DataModel/vtkImageData.cxx
index bffe98d..e2fe08c 100644
--- a/Common/DataModel/vtkImageData.cxx
+++ b/Common/DataModel/vtkImageData.cxx
@@ -119,19 +119,6 @@ void vtkImageData::CopyInformationFromPipeline(vtkInformation* information)
 }
 
 //----------------------------------------------------------------------------
-void vtkImageData::CopyInformationToPipeline(vtkInformation* info)
-{
-  // Let the superclass copy information to the pipeline.
-  this->Superclass::CopyInformationToPipeline(info);
-
-  // Copy the spacing, origin, and scalar info
-  info->Set(vtkDataObject::SPACING(), this->Spacing, 3);
-  info->Set(vtkDataObject::ORIGIN(), this->Origin, 3);
-  vtkDataObject::SetPointDataActiveScalarInfo(
-    info, this->GetScalarType(), this->GetNumberOfScalarComponents());
-}
-
-//----------------------------------------------------------------------------
 // Graphics filters reallocate every execute.  Image filters try to reuse
 // the scalars.
 void vtkImageData::PrepareForNewData()
diff --git a/Common/DataModel/vtkImageData.h b/Common/DataModel/vtkImageData.h
index af3c992..28b9631 100644
--- a/Common/DataModel/vtkImageData.h
+++ b/Common/DataModel/vtkImageData.h
@@ -261,7 +261,7 @@ public:
   virtual void Crop(const int* updateExtent);
 
   // Description:
-  // Return the actual size of the data in kibibytes (1024 bytes). This number
+  // Return the actual size of the data in kilobytes. This number
   // is valid only after the pipeline has updated. The memory size
   // returned is guaranteed to be greater than or equal to the
   // memory required to represent the data (e.g., extra space in
@@ -306,12 +306,6 @@ public:
   virtual void CopyInformationFromPipeline(vtkInformation* information);
 
   // Description:
-  // Copy information from this data object to the pipeline information.
-  // This is used by the vtkTrivialProducer that is created when someone
-  // calls SetInputData() to connect the image to a pipeline.
-  virtual void CopyInformationToPipeline(vtkInformation* information);
-
-  // Description:
   // make the output data ready for new data to be inserted. For most
   // objects we just call Initialize. But for image data we leave the old
   // data in case the memory can be reused.
diff --git a/Common/DataModel/vtkKdTree.cxx b/Common/DataModel/vtkKdTree.cxx
index 31ab1b1..ce479ca 100644
--- a/Common/DataModel/vtkKdTree.cxx
+++ b/Common/DataModel/vtkKdTree.cxx
@@ -3034,13 +3034,13 @@ int vtkKdTree::NewGeometry(vtkDataSet **sets, int numSets)
           {
           newGeometry = 1;
           }
-        else if (ug->GetPointGhostArray()
-                 && ug->GetPointGhostArray()->GetMTime() > this->BuildTime)
+        else if (ug->GetPointVisibilityArray()->GetMTime() >
+                 this->BuildTime)
           {
           newGeometry = 1;
           }
-        else if (ug->GetCellGhostArray()
-                 && ug->GetCellGhostArray()->GetMTime() > this->BuildTime)
+        else if (ug->GetCellVisibilityArray()->GetMTime() >
+                 this->BuildTime)
           {
           newGeometry = 1;
           }
diff --git a/Common/DataModel/vtkLine.cxx b/Common/DataModel/vtkLine.cxx
index b290725..98ca951 100644
--- a/Common/DataModel/vtkLine.cxx
+++ b/Common/DataModel/vtkLine.cxx
@@ -857,10 +857,11 @@ void vtkLine::InterpolationFunctions(double pcoords[3], double weights[2])
 }
 
 //----------------------------------------------------------------------------
-void vtkLine::InterpolationDerivs(double vtkNotUsed(pcoords)[3], double derivs[2])
+void vtkLine::InterpolationDerivs(double pcoords[3], double derivs[2])
 {
+  (void)pcoords;
   derivs[0] = -1.0;
-  derivs[1] = 1.0;
+  derivs[1] = 1;
 }
 
 //----------------------------------------------------------------------------
diff --git a/Common/DataModel/vtkMarchingCubesCases.h b/Common/DataModel/vtkMarchingCubesCases.h
new file mode 100644
index 0000000..908b877
--- /dev/null
+++ b/Common/DataModel/vtkMarchingCubesCases.h
@@ -0,0 +1,21 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+  Module:    vtkMarchingCubesCases.h
+
+  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 "vtkSystemIncludes.h"
+// Retained for compatibility, deprecated in VTK 5.10, remove in VTK 6.0.
+#ifndef VTK_LEGACY_REMOVE
+# include "vtkMarchingCubesTriangleCases.h"
+#endif
+// VTK-HeaderTest-Exclude: vtkMarchingCubesCases.h
diff --git a/Common/DataModel/vtkMarchingSquaresCases.h b/Common/DataModel/vtkMarchingSquaresCases.h
new file mode 100644
index 0000000..9681d71
--- /dev/null
+++ b/Common/DataModel/vtkMarchingSquaresCases.h
@@ -0,0 +1,21 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+  Module:    vtkMarchingSquaresCases.h
+
+  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 "vtkSystemIncludes.h"
+// Retained for compatibility, deprecated in VTK 5.10, remove in VTK 6.0.
+#ifndef VTK_LEGACY_REMOVE
+# include "vtkMarchingSquaresLineCases.h"
+#endif
+// VTK-HeaderTest-Exclude: vtkMarchingSquaresCases.h
diff --git a/Common/DataModel/vtkOverlappingAMR.cxx b/Common/DataModel/vtkOverlappingAMR.cxx
index 459b283..76a8ef2 100644
--- a/Common/DataModel/vtkOverlappingAMR.cxx
+++ b/Common/DataModel/vtkOverlappingAMR.cxx
@@ -20,7 +20,6 @@
 #include "vtkUniformGrid.h"
 #include "vtkInformationIdTypeKey.h"
 #include "vtkCellData.h"
-#include "vtkDataSetAttributes.h"
 #include <vector>
 
 vtkStandardNewMacro(vtkOverlappingAMR);
@@ -172,7 +171,7 @@ void vtkOverlappingAMR::SetOrigin(const double* origin)
 //----------------------------------------------------------------------------
 double* vtkOverlappingAMR::GetOrigin()
 {
-  return this->AMRInfo? this->AMRInfo->GetOrigin() : NULL;
+  return this->AMRInfo->GetOrigin();
 }
 
 //----------------------------------------------------------------------------
@@ -208,7 +207,7 @@ void vtkOverlappingAMR::Audit()
   for(iter->GoToFirstItem(); !iter->IsDoneWithTraversal(); iter->GoToNextItem())
     {
     vtkUniformGrid* grid = vtkUniformGrid::SafeDownCast(iter->GetCurrentDataObject());
-    int hasGhost  = grid->HasAnyGhostCells();
+    bool hasGhost  = grid->GetCellData()->GetArray("vtkGhostLevels")!=NULL;
 
     unsigned int level = iter->GetCurrentLevel();
     unsigned int id = iter->GetCurrentIndex();
diff --git a/Common/DataModel/vtkPentagonalPrism.cxx b/Common/DataModel/vtkPentagonalPrism.cxx
index a6ff9ba..6f8a7c6 100644
--- a/Common/DataModel/vtkPentagonalPrism.cxx
+++ b/Common/DataModel/vtkPentagonalPrism.cxx
@@ -19,12 +19,6 @@
 // Thanks to Jean Favre (CSCS, Switzerland) who contributed to integrate this
 // class in VTK. <br>
 // Please address all comments to Jean Favre (jfavre at cscs.ch).
-//
-// The Interpolation functions and derivatives were changed in June
-// 2015 by Bill Lorensen. These changes follow the formulation in:
-// http://dilbert.engr.ucdavis.edu/~suku/nem/papers/polyelas.pdf
-// NOTE: An additional copy of this paper is located at:
-// http://www.vtk.org/Wiki/File:ApplicationOfPolygonalFiniteElementsInLinearElasticity.pdf
 
 #include "vtkPentagonalPrism.h"
 
@@ -78,8 +72,8 @@ vtkPentagonalPrism::~vtkPentagonalPrism()
 }
 
 //
-//  Method to calculate parametric coordinates in a pentagonal prism
-//  from global coordinates
+//  Method to calculate parametric coordinates in an ten noded
+//  linear prism element from global coordinates.
 //
 static const int VTK_PENTA_MAX_ITERATION=10;
 static const double VTK_PENTA_CONVERGED=1.e-03;
@@ -134,7 +128,6 @@ int vtkPentagonalPrism::EvaluatePosition(double x[3], double closestPoint[3],
     d=vtkMath::Determinant3x3(rcol,scol,tcol);
     if ( fabs(d) < 1.e-20)
       {
-      vtkDebugMacro (<<"Determinant incorrect, iteration " << iteration);
       return -1;
       }
 
@@ -218,139 +211,135 @@ int vtkPentagonalPrism::EvaluatePosition(double x[3], double closestPoint[3],
 //----------------------------------------------------------------------------
 //
 // Compute iso-parametric interpolation functions
-// See:
-// http://dilbert.engr.ucdavis.edu/~suku/nem/papers/polyelas.pdf
+//
 
-void vtkPentagonalPrism::InterpolationFunctions(double pcoords[3],
-                                                double weights[10])
+// see vtkPentagonalPrismCellPCoords for V#i values:
+// The general idea is that for Point #0 (V1,V1,0) the shape function should be
+// 0 on the 4 other node. So expr of the line passing through points
+// (x1,y1) and (x2,y2) is as follow:
+// (x1-x2)*y - (y1-y2)*x - (x1*y2 - x2*y1) = 0
+// x(i):=1/2+1/2*Cos( Pi + Pi/4 + i*2*Pi/5)
+// y(i):=1/2+1/2*Sin( Pi + Pi/4 + i*2*Pi/5)
+// For instance EXPRA is x(2)-x(1)
+//              EXPRB is y(2)-y(1) (== x(4)-x(3))
+//              EXPRC is x(1)*y(2)-x(2)*y(1)
+//              EXPRD is x(2)-x(3) (because of sign)
+//              EXPRE is x(2)*y(3)-x(3)*y(2)
+//              EXPRF is x(0)-x(4)
+//              EXPRG is y(4)-y(0)
+//              EXPRH is x(0)*y(4)-x(4)*y(0)
+// EXPRN was deducted to normalize the function
+#define EXPRA 0.26684892042779546;
+#define EXPRB 0.52372049461429937;
+#define EXPRC 0.36619991616704034;
+#define EXPRD 0.41562693777745341;
+#define EXPRE 0.65339106685124182;
+#define EXPRF 0.091949871500910163;
+#define EXPRG 0.58054864046304711;
+#define EXPRH 0.098485126908190265;
+#define EXPRN 9.2621670111997307;
+
+void vtkPentagonalPrism::InterpolationFunctions(double pcoords[3], double sf[10])
 {
-  // VTK needs parametric coordinates to be between [0,1]. Isoparametric
-  // shape functions are formulated between [-1,1]. Here we do a
-  // coordinate system conversion from [0,1] to [-1,1].
-  double x = 2.0*(pcoords[0]-0.5);
-  double y = 2.0*(pcoords[1]-0.5);
-  double z = pcoords[2]; // z is from 0 to 1
-
-  // From Appendix A.1 Pentagonal reference element (n = 5)
-  double b = 87.05 - 12.7004 * x * x - 12.7004 * y * y;
-
-  double a[5];
-  a[0] =
-    -0.092937 * (3.23607 + 4 * x) *
-    (-3.80423 + 3.80423 * x - 2.76393 * y) *
-    (15.2169 + 5.81234 * x + 17.8885 * y);
-  a[1] =
-    - 0.0790569 * (3.80423 - 3.80423 * x - 2.76393 * y) *
-    (-3.80423 + 3.80423 * x - 2.76393 * y ) *
-    (15.2169 + 5.81234 * x + 17.8885 * y );
-  a[2] =
-    - 0.0790569 * (15.2169 + 5.81234 * x - 17.8885 * y) *
-    (3.80423 - 3.80423 * x - 2.76393 * y) *
-    (-3.80423 + 3.80423 * x - 2.76393 * y);
-  a[3] =
-    0.092937 * (3.23607 + 4.0 * x) *
-    (15.2169 + 5.81234 * x - 17.8885 * y) *
-    (3.80423 - 3.80423 * x - 2.76393 * y);
-  a[4] =
-    0.0232343 * (3.23607 + 4.0 * x) *
-    (15.2169 + 5.81234 * x - 17.8885 * y) *
-    (15.2169 + 5.81234 * x + 17.8885 * y);
-
-  for (int i = 0; i < 5; ++i)
-    {
-    weights[i]     = -(a[i] / b) * (z - 1.0);
-    weights[i + 5] = (a[i] / b) * (z - 0.0);
-    }
+  double r, s, t;
+  r = pcoords[0];
+  s = pcoords[1];
+  t = pcoords[2];
+
+  const double a = EXPRA;
+  const double b = EXPRB;
+  const double c = EXPRC;
+  const double d = EXPRD;
+  const double e = EXPRE;
+  const double f = EXPRF;
+  const double g = EXPRG;
+  const double h = EXPRH;
+  const double n = EXPRN;
+
+  //First pentagon
+  sf[0] = -n*(-a*s + b*r - c)*( b*s - a*r - c)*(t - 1.0);
+  sf[1] =  n*( d*s + d*r - e)*( f*s + g*r - h)*(t - 1.0);
+  sf[2] = -n*( b*s - a*r - c)*(-g*s - f*r + h)*(t - 1.0);
+  sf[3] =  n*(-a*s + b*r - c)*( f*s + g*r - h)*(t - 1.0);
+  sf[4] = -n*(-g*s - f*r + h)*( d*s + d*r - e)*(t - 1.0);
+
+  //Second pentagon
+  sf[5] =  n*(-a*s + b*r - c)*( b*s - a*r - c)*(t - 0.0);
+  sf[6] = -n*( d*s + d*r - e)*( f*s + g*r - h)*(t - 0.0);
+  sf[7] =  n*( b*s - a*r - c)*(-g*s - f*r + h)*(t - 0.0);
+  sf[8] = -n*(-a*s + b*r - c)*( f*s + g*r - h)*(t - 0.0);
+  //sf[9] =  n*(-g*s - f*r + h)*( d*s + d*r - e)*(t - 0.0);
+  sf[9] = 1. - (sf[0]+sf[1]+sf[2]+sf[3]+sf[4]+sf[5]+sf[6]+sf[7]+sf[8]);
 }
 
 //----------------------------------------------------------------------------
 //
 // Compute iso-parametric interpolation derivatives
-// See:
-// http://dilbert.engr.ucdavis.edu/~suku/nem/papers/polyelas.pdf
 //
 void vtkPentagonalPrism::InterpolationDerivs(double pcoords[3], double derivs[30])
 {
-  // VTK needs parametric coordinates to be between [0,1]. Isoparametric
-  // shape functions are formulated between [-1,1]. Here we do a
-  // coordinate system conversion from [0,1] to [-1,1].
-  double x = 2.0*(pcoords[0]-0.5);
-  double y = 2.0*(pcoords[1]-0.5);
-  double z = pcoords[2];  // z is from 0 to 1
-
-  double dd[20];
-
-  // x-derivatives
-  // First pentagon
-  double x2 = x * x;
-  double y2 = y * y;
-  double denom = (-12.7004*x2 - 12.7004*y2 + 87.05);
-  double denom2 = denom * denom;
-
-  // Please excuse the line length. This code was generated using the
-  // symbolic math package SymPy. (http://www.sympy.org)
-
-  dd[0] =  25.4008*x*(-0.371748*x - 0.30075063759)*(3.80423*x - 2.76393*y - 3.80423)*(5.81234*x + 17.8885*y + 15.2169)/denom2 + 5.81234*(-0.371748*x - 0.30075063759)*(3.80423*x - 2.76393*y - 3.80423)/denom + 3.80423*(-0.371748*x - 0.30075063759)*(5.81234*x + 17.8885*y + 15.2169)/denom - 0.371748*(3.80423*x - 2.76393*y - 3.80423)*(5.81234*x + 17.8885*y + 15.2169)/denom ;
-
-  dd[1] =  25.4008*x*(0.300750630687*x + 0.218507737617*y - 0.300750630687)*(3.80423*x - 2.76393*y - 3.80423)*(5.81234*x + 17.8885*y + 15.2169)/denom2 + 5.81234*(0.300750630687*x + 0.218507737617*y - 0.300750630687)*(3.80423*x - 2.76393*y - 3.80423)/denom + 3.80423*(0.300750630687*x + 0.218507737617*y - 0.300750630687)*(5.81234*x + 17.8885*y + 15.2169)/denom + 0.300750630687*(3.80423*x - 2.76393*y - 3.80423)*(5.81234*x + 17.8885*y + 15.2169)/denom ;
-
-  dd[2] =  25.4008*x*(-3.80423*x - 2.76393*y + 3.80423)*(-0.459505582146*x + 1.41420935565*y - 1.20300094161)*(3.80423*x - 2.76393*y - 3.80423)/denom2 + 3.80423*(-3.80423*x - 2.76393*y + 3.80423)*(-0.459505582146*x + 1.41420935565*y - 1.20300094161)/denom - 0.459505582146*(-3.80423*x - 2.76393*y + 3.80423)*(3.80423*x - 2.76393*y - 3.80423)/denom - 3.80423*(-0.459505582146*x + 1.41420935565*y - 1.20300094161)*(3.80423*x - 2.76393*y - 3.80423)/denom ;
-
-  dd[3] =  25.4008*x*(0.371748*x + 0.30075063759)*(-3.80423*x - 2.76393*y + 3.80423)*(5.81234*x - 17.8885*y + 15.2169)/denom2 + 5.81234*(0.371748*x + 0.30075063759)*(-3.80423*x - 2.76393*y + 3.80423)/denom - 3.80423*(0.371748*x + 0.30075063759)*(5.81234*x - 17.8885*y + 15.2169)/denom + 0.371748*(-3.80423*x - 2.76393*y + 3.80423)*(5.81234*x - 17.8885*y + 15.2169)/denom ;
-
-  dd[4] =  25.4008*x*(0.0929372*x + 0.075187821201)*(5.81234*x - 17.8885*y + 15.2169)*(5.81234*x + 17.8885*y + 15.2169)/denom2 + 5.81234*(0.0929372*x + 0.075187821201)*(5.81234*x - 17.8885*y + 15.2169)/denom + 5.81234*(0.0929372*x + 0.075187821201)*(5.81234*x + 17.8885*y + 15.2169)/denom + 0.0929372*(5.81234*x - 17.8885*y + 15.2169)*(5.81234*x + 17.8885*y + 15.2169)/denom ;
-
-  // y-derivatives
+  double r, s, t;
+  r = pcoords[0];
+  s = pcoords[1];
+  t = pcoords[2];
+
+  const double a = EXPRA;
+  const double b = EXPRB;
+  const double c = EXPRC;
+  const double d = EXPRD;
+  const double e = EXPRE;
+  const double f = EXPRF;
+  const double g = EXPRG;
+  const double h = EXPRH;
+  const double n = EXPRN;
+
+  // r-derivatives
   //First pentagon
-  dd[10] =  25.4008*y*(-0.371748*x - 0.30075063759)*(3.80423*x - 2.76393*y - 3.80423)*(5.81234*x + 17.8885*y + 15.2169)/denom2 + 17.8885*(-0.371748*x - 0.30075063759)*(3.80423*x - 2.76393*y - 3.80423)/denom - 2.76393*(-0.371748*x - 0.30075063759)*(5.81234*x + 17.8885*y + 15.2169)/denom ;
-
-  dd[11] =  25.4008*y*(0.300750630687*x + 0.218507737617*y - 0.300750630687)*(3.80423*x - 2.76393*y - 3.80423)*(5.81234*x + 17.8885*y + 15.2169)/denom2 + 17.8885*(0.300750630687*x + 0.218507737617*y - 0.300750630687)*(3.80423*x - 2.76393*y - 3.80423)/denom - 2.76393*(0.300750630687*x + 0.218507737617*y - 0.300750630687)*(5.81234*x + 17.8885*y + 15.2169)/denom + 0.218507737617*(3.80423*x - 2.76393*y - 3.80423)*(5.81234*x + 17.8885*y + 15.2169)/denom ;
-
-  dd[12] =  25.4008*y*(-3.80423*x - 2.76393*y + 3.80423)*(-0.459505582146*x + 1.41420935565*y - 1.20300094161)*(3.80423*x - 2.76393*y - 3.80423)/denom2 - 2.76393*(-3.80423*x - 2.76393*y + 3.80423)*(-0.459505582146*x + 1.41420935565*y - 1.20300094161)/denom + 1.41420935565*(-3.80423*x - 2.76393*y + 3.80423)*(3.80423*x - 2.76393*y - 3.80423)/denom - 2.76393*(-0.459505582146*x + 1.41420935565*y - 1.20300094161)*(3.80423*x - 2.76393*y - 3.80423)/denom ;
-
-  dd[13] =  25.4008*y*(0.371748*x + 0.30075063759)*(-3.80423*x - 2.76393*y + 3.80423)*(5.81234*x - 17.8885*y + 15.2169)/denom2 - 17.8885*(0.371748*x + 0.30075063759)*(-3.80423*x - 2.76393*y + 3.80423)/denom - 2.76393*(0.371748*x + 0.30075063759)*(5.81234*x - 17.8885*y + 15.2169)/denom ;
-
-  dd[14] =  25.4008*y*(0.0929372*x + 0.075187821201)*(5.81234*x - 17.8885*y + 15.2169)*(5.81234*x + 17.8885*y + 15.2169)/denom2 + 17.8885*(0.0929372*x + 0.075187821201)*(5.81234*x - 17.8885*y + 15.2169)/denom - 17.8885*(0.0929372*x + 0.075187821201)*(5.81234*x + 17.8885*y + 15.2169)/denom ;
-
-  // z-derivatives
-  // First pentagon
-  double b = 87.05 - 12.7004 * x * x - 12.7004 * y * y;
-  dd[15] =
-    -0.092937 * (3.23607 + 4 * x) *
-    (-3.80423 + 3.80423 * x - 2.76393 * y) *
-    (15.2169 + 5.81234 * x + 17.8885 * y) / b;
-  dd[16] =
-    - 0.0790569 * (3.80423 - 3.80423 * x - 2.76393 * y) *
-    (-3.80423 + 3.80423 * x - 2.76393 * y ) *
-    (15.2169 + 5.81234 * x + 17.8885 * y ) / b;
-  dd[17] =
-    - 0.0790569 * (15.2169 + 5.81234 * x - 17.8885 * y) *
-    (3.80423 - 3.80423 * x - 2.76393 * y) *
-    (-3.80423 + 3.80423 * x - 2.76393 * y) / b;
-  dd[18] =
-    0.092937 * (3.23607 + 4.0 * x) *
-    (15.2169 + 5.81234 * x - 17.8885 * y) *
-    (3.80423 - 3.80423 * x - 2.76393 * y) / b;
-  dd[19] =
-    0.0232343 * (3.23607 + 4.0 * x) *
-    (15.2169 + 5.81234 * x - 17.8885 * y) *
-    (15.2169 + 5.81234 * x + 17.8885 * y) / b;
-
-  for (int i = 0; i < 5; ++i)
-    {
-    derivs[i]      = -dd[i]      * (z - 1.0);  // x deriv first pentagon
-    derivs[i + 5]  =  dd[i]      * (z + 0.0);  // x deriv second pentagon
-    derivs[i + 10] = -dd[i + 10] * (z - 1.0);  // y deriv first pentagon
-    derivs[i + 15] =  dd[i + 10] * (z + 0.0);  // y deriv second pentagon
-    derivs[i + 20] = -dd[i + 15];              // z deriv first pentagon
-    derivs[i + 25] =  dd[i + 15];              // z deriv second pentagon
-    }
-
-  // We compute derivatives in [-1; 1] but we need them in [ 0; 1]
-  for(int i = 0; i < 30; i++)
-    {
-    derivs[i] *= 2;
-    }
+  derivs[0] = -n*(-2*a*b*r + (a*a + b*b)*s + a*c - b*c)*(t - 1.0);
+  derivs[1] =  n*( 2*d*g*r + d*(f + g)*s - d*h - e*g)*(t - 1.0);
+  derivs[2] = -n*( 2*a*f*r + (a*g - b*f)*s - a*h + c*f)*(t - 1.0);
+  derivs[3] =  n*( 2*b*g*r + (b*f - a*g)*s - b*h - c*g)*(t - 1.0);
+  derivs[4] = -n*(-2*d*f*r - d*(f + g)*s + d*h + e*f)*(t - 1.0);
+  //Second pentagon
+  derivs[5] =  n*(-2*a*b*r + (a*a + b*b)*s + a*c - b*c)*(t - 0.0);
+  derivs[6] = -n*( 2*d*g*r + d*(f + g)*s - d*h - e*g)*(t - 0.0);
+  derivs[7] =  n*( 2*a*f*r + (a*g - b*f)*s - a*h + c*f)*(t - 0.0);
+  derivs[8] = -n*( 2*b*g*r + (b*f - a*g)*s - b*h - c*g)*(t - 0.0);
+  //derivs[9] =  n*(-2*d*f*r - d*(f + g)*s + d*h + e*f)*(t - 0.0);
+  derivs[9] = -(derivs[0]+derivs[1]+derivs[2]+derivs[3]+derivs[4]+derivs[5]
+    +derivs[6]+derivs[7]+derivs[8]);
+
+  // s-derivatives
+  //First pentagon
+  derivs[10] = -n*(-2*a*b*s + (a*a + b*b)*r + a*c - b*c)*(t - 1.0);
+  derivs[11] =  n*( 2*d*f*s + d*(f + g)*r - d*h - e*f)*(t - 1.0);
+  derivs[12] = -n*(-2*b*g*s + (a*g - b*f)*r + b*h + c*g)*(t - 1.0);
+  derivs[13] =  n*(-2*a*f*s + (b*f - a*g)*r + a*h - c*f)*(t - 1.0);
+  derivs[14] = -n*(-2*d*g*s - d*(f + g)*r + d*h + e*g)*(t - 1.0);
+  //Second pentagon
+  derivs[15] =  n*(-2*a*b*s + (a*a + b*b)*r + a*c - b*c)*(t - 0.0);
+  derivs[16] = -n*( 2*d*f*s + d*(f + g)*r - d*h - e*f)*(t - 0.0);
+  derivs[17] =  n*(-2*b*g*s + (a*g - b*f)*r + b*h + c*g)*(t - 0.0);
+  derivs[18] = -n*(-2*a*f*s + (b*f - a*g)*r + a*h - c*f)*(t - 0.0);
+  //derivs[19] =  n*(-2*d*g*s - d*(f + g)*r + d*h + e*g)*(t - 0.0);
+  derivs[19] = -(derivs[10]+derivs[11]+derivs[12]+derivs[13]+derivs[14]+derivs[15]
+    +derivs[16]+derivs[17]+derivs[18]);
+
+  // t-derivatives
+  //First pentagon
+  derivs[20] = -n*(-a*s + b*r - c)*( b*s - a*r - c);
+  derivs[21] =  n*( d*s + d*r - e)*( f*s + g*r - h);
+  derivs[22] = -n*( b*s - a*r - c)*(-g*s - f*r + h);
+  derivs[23] =  n*(-a*s + b*r - c)*( f*s + g*r - h);
+  derivs[24] = -n*(-g*s - f*r + h)*( d*s + d*r - e);
+  //Second pentagon
+  derivs[25] =  n*(-a*s + b*r - c)*( b*s - a*r - c);
+  derivs[26] = -n*( d*s + d*r - e)*( f*s + g*r - h);
+  derivs[27] =  n*( b*s - a*r - c)*(-g*s - f*r + h);
+  derivs[28] = -n*(-a*s + b*r - c)*( f*s + g*r - h);
+  //derivs[29] =  n*(-g*s - f*r + h)*( d*s + d*r - e);
+  derivs[29] = -(derivs[20]+derivs[21]+derivs[22]+derivs[23]+derivs[24]+derivs[25]
+    +derivs[26]+derivs[27]+derivs[28]);
 }
 
 //----------------------------------------------------------------------------
@@ -755,20 +744,35 @@ void vtkPentagonalPrism::GetFacePoints (int faceId, int *&pts)
   pts = this->GetFaceArray(faceId);
 }
 
-// See:
-// http://dilbert.engr.ucdavis.edu/~suku/nem/papers/polyelas.pdf
+// How to find the points for the pentagon:
+// The points for the iso parametric pentagon have to be properly chosen so that
+// the inverse Jacobian is defined.
+// To be regular the points have to on the circle, center (1/2,1/2) with radius
+// sqrt(2)/2
+// Then since there is an odd number of points they have to be simmetric
+// to the first bisector
+// Thus I pick the first point to be on this dividing line.
+// We can then express point i (0, 4) to be:
+// Vi_x = CenterOfCircle + 1/2 ( cos( pi + pi/4 + i*2*pi/5) )
+// Vi_y = CenterOfCircle + 1/2 ( sin( pi + pi/4 + i*2*pi/5) )
+
+#define V1 0.14644660940672624
+#define V2 0.72699524986977337
+#define V3 0.054496737905816071
+#define V4 0.99384417029756889
+#define V5 0.57821723252011548
 
 static double vtkPentagonalPrismCellPCoords[30] = {
-  0.654508, 0.975528, 0,
-  0.0954915, 0.793893, 0,
-  0.0954915, 0.206107, 0,
-  0.654508, 0.0244717, 0,
-  1, 0.5, 0,
-  0.654508, 0.975528, 1,
-  0.0954915, 0.793893, 1,
-  0.0954915, 0.206107, 1,
-  0.654508, 0.0244717, 1,
-  1, 0.5, 1};
+V1 , V1 , 0.0,
+V2 , V3 , 0.0,
+V4 , V5 , 0.0,
+V5 , V4 , 0.0,
+V3 , V2 , 0.0,
+V1 , V1 , 1.0,
+V2 , V3 , 1.0,
+V4 , V5 , 1.0,
+V5 , V4 , 1.0,
+V3 , V2 , 1.0};
 
 //----------------------------------------------------------------------------
 double *vtkPentagonalPrism::GetParametricCoords()
diff --git a/Common/DataModel/vtkPentagonalPrism.h b/Common/DataModel/vtkPentagonalPrism.h
index 6eaa344..3b3e087 100644
--- a/Common/DataModel/vtkPentagonalPrism.h
+++ b/Common/DataModel/vtkPentagonalPrism.h
@@ -28,12 +28,6 @@
 // Thanks to Jean Favre (CSCS, Switzerland) who contributed to integrate this
 // class in VTK. <br>
 // Please address all comments to Jean Favre (jfavre at cscs.ch).
-//
-// The Interpolation functions and derivatives were changed in June
-// 2015 by Bill Lorensen. These changes follow the formulation in:
-// http://dilbert.engr.ucdavis.edu/~suku/nem/papers/polyelas.pdf
-// NOTE: An additional copy of this paper is located at:
-// http://www.vtk.org/Wiki/File:ApplicationOfPolygonalFiniteElementsInLinearElasticity.pdf
 
 #ifndef vtkPentagonalPrism_h
 #define vtkPentagonalPrism_h
@@ -137,3 +131,5 @@ inline int vtkPentagonalPrism::GetParametricCenter(double pcoords[3])
   return 0;
 }
 #endif
+
+
diff --git a/Common/DataModel/vtkPixel.cxx b/Common/DataModel/vtkPixel.cxx
index 5b675fe..5519487 100644
--- a/Common/DataModel/vtkPixel.cxx
+++ b/Common/DataModel/vtkPixel.cxx
@@ -212,7 +212,7 @@ int vtkPixel::CellBoundary(int vtkNotUsed(subId), double pcoords[3], vtkIdList *
 //
 // Marching squares
 //
-#include "vtkMarchingSquaresLineCases.h"
+#include "vtkMarchingSquaresCases.h"
 
 static int edges[4][2] = { {0,1}, {1,3}, {2,3}, {0,2} };
 
diff --git a/Common/DataModel/vtkPointLocator.cxx b/Common/DataModel/vtkPointLocator.cxx
index 93d73d1..0f40414 100644
--- a/Common/DataModel/vtkPointLocator.cxx
+++ b/Common/DataModel/vtkPointLocator.cxx
@@ -320,7 +320,7 @@ vtkIdType vtkPointLocator::FindClosestPointWithinRadius(double radius,
     refinedRadius2 = radius2;
     }
 
-  if (inputDataLength != 0.0)
+  if (inputDataLength)
     {
     distance2ToDataBounds = this->Distance2ToBounds(x, this->Bounds);
     maxDistance = sqrt(distance2ToDataBounds) + inputDataLength;
diff --git a/Common/DataModel/vtkPointSet.cxx b/Common/DataModel/vtkPointSet.cxx
index cc33f17..c144c40 100644
--- a/Common/DataModel/vtkPointSet.cxx
+++ b/Common/DataModel/vtkPointSet.cxx
@@ -249,10 +249,9 @@ vtkIdType vtkPointSet::FindCell(double x[3], vtkCell *cell,
   // a strict check, but it is fast.
   double bounds[6];
   this->GetBounds(bounds);
-  double tol = sqrt(tol2);
-  if (   (x[0] < bounds[0] - tol) || (x[0] > bounds[1] + tol)
-      || (x[1] < bounds[2] - tol) || (x[1] > bounds[3] + tol)
-      || (x[2] < bounds[4] - tol) || (x[2] > bounds[5] + tol) )
+  if (   (x[0] < bounds[0]) || (x[0] > bounds[1])
+      || (x[1] < bounds[2]) || (x[1] > bounds[3])
+      || (x[2] < bounds[4]) || (x[2] > bounds[5]) )
     {
     return -1;
     }
diff --git a/Common/DataModel/vtkPointSet.h b/Common/DataModel/vtkPointSet.h
index 6cfbada..a3d1644 100644
--- a/Common/DataModel/vtkPointSet.h
+++ b/Common/DataModel/vtkPointSet.h
@@ -85,7 +85,7 @@ public:
   vtkGetObjectMacro(Points,vtkPoints);
 
   // Description:
-  // Return the actual size of the data in kibibytes (1024 bytes). This number
+  // Return the actual size of the data in kilobytes. This number
   // is valid only after the pipeline has updated. The memory size
   // returned is guaranteed to be greater than or equal to the
   // memory required to represent the data (e.g., extra space in
diff --git a/Common/DataModel/vtkPolyData.cxx b/Common/DataModel/vtkPolyData.cxx
index b05151a..ef19c53 100644
--- a/Common/DataModel/vtkPolyData.cxx
+++ b/Common/DataModel/vtkPolyData.cxx
@@ -1868,22 +1868,23 @@ void vtkPolyData::DeepCopy(vtkDataObject *dataObject)
     }
 }
 
-void vtkPolyData::RemoveGhostCells()
+void vtkPolyData::RemoveGhostCells(int level)
 {
   // Get a pointer to the cell ghost level array.
-  vtkUnsignedCharArray* temp = this->GetCellGhostArray();
+  vtkUnsignedCharArray* temp = vtkUnsignedCharArray::SafeDownCast(
+    this->CellData->GetArray("vtkGhostLevels"));
   if (temp == NULL)
     {
-    vtkDebugMacro("Could not find cell ghost array.");
+    vtkDebugMacro("Could not find cell ghost level array.");
     return;
     }
   if (temp->GetNumberOfComponents() != 1 ||
       temp->GetNumberOfTuples() < this->GetNumberOfCells())
     {
-    vtkErrorMacro("Poorly formed ghost array.");
+    vtkErrorMacro("Poorly formed ghost level array.");
     return;
     }
-  unsigned char* cellGhosts = temp->GetPointer(0);
+  unsigned char* cellGhostLevels = temp->GetPointer(0);
 
   vtkIdType numCells = this->GetNumberOfCells();
 
@@ -1950,7 +1951,7 @@ void vtkPolyData::RemoveGhostCells()
       {
       verts->GetNextCell(n, pts);
 
-      if (! (cellGhosts[i] & vtkDataSetAttributes::DUPLICATECELL))
+      if (int(cellGhostLevels[i]) < level)
         {
         cellId = this->InsertNextCell(type, n, pts);
         newCellData->CopyData(this->CellData, i, cellId);
@@ -1960,7 +1961,7 @@ void vtkPolyData::RemoveGhostCells()
       {
       lines->GetNextCell(n, pts);
 
-      if (! (cellGhosts[i] & vtkDataSetAttributes::DUPLICATECELL))
+      if (int(cellGhostLevels[i]) < level)
         {
         cellId = this->InsertNextCell(type, n, pts);
         newCellData->CopyData(this->CellData, i, cellId);
@@ -1970,7 +1971,7 @@ void vtkPolyData::RemoveGhostCells()
       {
       polys->GetNextCell(n, pts);
 
-      if (! (cellGhosts[i] & vtkDataSetAttributes::DUPLICATECELL))
+      if (int(cellGhostLevels[i]) < level)
         {
         cellId = this->InsertNextCell(type, n, pts);
         newCellData->CopyData(this->CellData, i, cellId);
@@ -1980,7 +1981,7 @@ void vtkPolyData::RemoveGhostCells()
       {
       strips->GetNextCell(n, pts);
 
-      if (! (cellGhosts[i] & vtkDataSetAttributes::DUPLICATECELL))
+      if (int(cellGhostLevels[i]) < level)
         {
         cellId = this->InsertNextCell(type, n, pts);
         newCellData->CopyData(this->CellData, i, cellId);
@@ -1996,7 +1997,11 @@ void vtkPolyData::RemoveGhostCells()
   types->Delete();
 
   // If there are no more ghost levels, then remove all arrays.
-  this->CellData->RemoveArray(vtkDataSetAttributes::GhostArrayName());
+  if (level <= 1)
+    {
+    this->CellData->RemoveArray("vtkGhostLevels");
+    this->PointData->RemoveArray("vtkGhostLevels");
+    }
 
   this->Squeeze();
 }
diff --git a/Common/DataModel/vtkPolyData.h b/Common/DataModel/vtkPolyData.h
index 03cfc0b..415536b 100644
--- a/Common/DataModel/vtkPolyData.h
+++ b/Common/DataModel/vtkPolyData.h
@@ -370,7 +370,7 @@ public:
   virtual int GetGhostLevel();
 
   // Description:
-  // Return the actual size of the data in kibibytes (1024 bytes). This number
+  // Return the actual size of the data in kilobytes. This number
   // is valid only after the pipeline has updated. The memory size
   // returned is guaranteed to be greater than or equal to the
   // memory required to represent the data (e.g., extra space in
@@ -384,10 +384,9 @@ public:
   void DeepCopy(vtkDataObject *src);
 
   // Description:
-  // This method will remove any cell that is marked as ghost
-  // (has the vtkDataSetAttributes::DUPLICATECELL bit set).
-  // It does not remove unused points.
-  void RemoveGhostCells();
+  // This method will remove any cell that has a ghost level array value
+  // greater or equal to level.  It does not remove unused points (yet).
+  void RemoveGhostCells(int level);
 
   //BTX
   // Description:
diff --git a/Common/DataModel/vtkPolyLine.cxx b/Common/DataModel/vtkPolyLine.cxx
index 8fdda3f..e2311f9 100644
--- a/Common/DataModel/vtkPolyLine.cxx
+++ b/Common/DataModel/vtkPolyLine.cxx
@@ -472,6 +472,20 @@ int vtkPolyLine::GetParametricCenter(double pcoords[3])
 }
 
 //----------------------------------------------------------------------------
+void vtkPolyLine::InterpolateFunctions(double pcoords[3], double *weights)
+{
+  (void)pcoords;
+  (void)weights;
+}
+
+//----------------------------------------------------------------------------
+void vtkPolyLine::InterpolateDerivs(double pcoords[3], double *derivs)
+{
+  (void)pcoords;
+  (void)derivs;
+}
+
+//----------------------------------------------------------------------------
 void vtkPolyLine::PrintSelf(ostream& os, vtkIndent indent)
 {
   this->Superclass::PrintSelf(os,indent);
diff --git a/Common/DataModel/vtkPolyLine.h b/Common/DataModel/vtkPolyLine.h
index 3832a6a..61e4112 100644
--- a/Common/DataModel/vtkPolyLine.h
+++ b/Common/DataModel/vtkPolyLine.h
@@ -81,6 +81,12 @@ public:
   // Return the center of the point cloud in parametric coordinates.
   int GetParametricCenter(double pcoords[3]);
 
+  // Description:
+  // Compute the interpolation functions/derivatives
+  // (aka shape functions/derivatives)
+  virtual void InterpolateFunctions(double pcoords[3], double *weights);
+  virtual void InterpolateDerivs(double pcoords[3], double *derivs);
+
 protected:
   vtkPolyLine();
   ~vtkPolyLine();
diff --git a/Common/DataModel/vtkPolyVertex.cxx b/Common/DataModel/vtkPolyVertex.cxx
index d7e96fa..fa48ab5 100644
--- a/Common/DataModel/vtkPolyVertex.cxx
+++ b/Common/DataModel/vtkPolyVertex.cxx
@@ -46,7 +46,6 @@ int vtkPolyVertex::EvaluatePosition(double x[3], double* closestPoint,
   double X[3];
   double dist2;
   int i;
-  pcoords[1] = pcoords[2] = -1.0;
 
   for (minDist2=VTK_DOUBLE_MAX, i=0; i<numPts; i++)
     {
@@ -76,7 +75,7 @@ int vtkPolyVertex::EvaluatePosition(double x[3], double* closestPoint,
     }
   else
     {
-    pcoords[0] = -1.0;
+    pcoords[0] = -10.0;
     return 0;
     }
 }
@@ -232,6 +231,20 @@ int vtkPolyVertex::GetParametricCenter(double pcoords[3])
 }
 
 //----------------------------------------------------------------------------
+void vtkPolyVertex::InterpolateFunctions(double pcoords[3], double *weights)
+{
+  (void)pcoords;
+  (void)weights;
+}
+
+//----------------------------------------------------------------------------
+void vtkPolyVertex::InterpolateDerivs(double pcoords[3], double *derivs)
+{
+  (void)pcoords;
+  (void)derivs;
+}
+
+//----------------------------------------------------------------------------
 void vtkPolyVertex::PrintSelf(ostream& os, vtkIndent indent)
 {
   this->Superclass::PrintSelf(os,indent);
diff --git a/Common/DataModel/vtkPolyVertex.h b/Common/DataModel/vtkPolyVertex.h
index f5f749d..a924ec0 100644
--- a/Common/DataModel/vtkPolyVertex.h
+++ b/Common/DataModel/vtkPolyVertex.h
@@ -68,6 +68,12 @@ public:
   // Return the center of the point cloud in parametric coordinates.
   int GetParametricCenter(double pcoords[3]);
 
+  // Description:
+  // Compute the interpolation functions/derivatives
+  // (aka shape functions/derivatives)
+  virtual void InterpolateFunctions(double pcoords[3], double *weights);
+  virtual void InterpolateDerivs(double pcoords[3], double *derivs);
+
 protected:
   vtkPolyVertex();
   ~vtkPolyVertex();
diff --git a/Common/DataModel/vtkPolygon.cxx b/Common/DataModel/vtkPolygon.cxx
index bf87f3b..d513073 100644
--- a/Common/DataModel/vtkPolygon.cxx
+++ b/Common/DataModel/vtkPolygon.cxx
@@ -272,14 +272,13 @@ void vtkPolygon::ComputeNormal (int numPts, double *pts, double n[3])
 
 //----------------------------------------------------------------------------
 int vtkPolygon::EvaluatePosition(double x[3], double* closestPoint,
-                                 int& subId, double pcoords[3],
+                                 int& vtkNotUsed(subId), double pcoords[3],
                                  double& minDist2, double *weights)
 {
   int i;
   double p0[3], p10[3], l10, p20[3], l20, n[3], cp[3];
   double ray[3];
 
-  subId = 0;
   this->ParameterizePolygon(p0, p10, l10, p20, l20, n);
   this->InterpolateFunctions(x,weights);
   vtkPlane::ProjectPoint(x,p0,n,cp);
@@ -290,7 +289,6 @@ int vtkPolygon::EvaluatePosition(double x[3], double* closestPoint,
     }
   pcoords[0] = vtkMath::Dot(ray,p10) / (l10*l10);
   pcoords[1] = vtkMath::Dot(ray,p20) / (l20*l20);
-  pcoords[2] = 0.0;
 
   if ( pcoords[0] >= 0.0 && pcoords[0] <= 1.0 &&
        pcoords[1] >= 0.0 && pcoords[1] <= 1.0 &&
@@ -513,6 +511,13 @@ void vtkPolygon::InterpolateFunctionsUsingMVC(double x[3], double *weights)
 }
 
 //----------------------------------------------------------------------------
+void vtkPolygon::InterpolateDerivs(double pcoords[3], double *derivs)
+{
+  (void)pcoords;
+  (void)derivs;
+}
+
+//----------------------------------------------------------------------------
 // Create a local s-t coordinate system for a polygon. The point p0 is
 // the origin of the local system, p10 is s-axis vector, and p20 is the
 // t-axis vector. (These are expressed in the modelling coordinate system and
@@ -526,11 +531,6 @@ int vtkPolygon::ParameterizePolygon(double *p0, double *p10, double& l10,
   int numPts=this->Points->GetNumberOfPoints();
   double x1[3], x2[3];
 
-  if (numPts < 3)
-    {
-    return 0;
-    }
-
   //  This is a two pass process: first create a p' coordinate system
   //  that is then adjusted to insure that the polygon points are all in
   //  the range 0<=s,t<=1.  The p' system is defined by the polygon normal,
@@ -623,6 +623,7 @@ int vtkPolygon::PointInPolygon (double x[3], int numPts, double *pts,
   int iterNumber;
   int maxComp, comps[2];
   int deltaVotes;
+
   // do a quick bounds check
   if ( x[0] < bounds[0] || x[0] > bounds[1] ||
        x[1] < bounds[2] || x[1] > bounds[3] ||
@@ -739,18 +740,9 @@ int vtkPolygon::PointInPolygon (double x[3], int numPts, double *pts,
       //   Fire the ray and compute the number of intersections.  Be careful
       //   of degenerate cases (e.g., ray intersects at vertex).
       //
-
       if ((status=vtkLine::Intersection(x,xray,x1,x2,u,v)) == VTK_POLYGON_INTERSECTION)
         {
-        // This test checks for vertex and edge intersections
-        // For example
-        //  Vertex intersection
-        //    (u=0 v=0), (u=0 v=1), (u=1 v=0), (u=1 v=0)
-        //  Edge intersection
-        //    (u=0 v!=0 v!=1), (u=1 v!=0 v!=1)
-        //    (u!=0 u!=1 v=0), (u!=0 u!=1 v=1)
-        if ( (VTK_POLYGON_RAY_TOL < u) && (u < 1.0-VTK_POLYGON_RAY_TOL) &&
-             (VTK_POLYGON_RAY_TOL < v) && (v < 1.0-VTK_POLYGON_RAY_TOL) )
+        if ( (VTK_POLYGON_RAY_TOL < v) && (v < 1.0-VTK_POLYGON_RAY_TOL) )
           {
           numInts++;
           }
@@ -766,7 +758,7 @@ int vtkPolygon::PointInPolygon (double x[3], int numPts, double *pts,
       }
     if ( testResult == VTK_POLYGON_CERTAIN )
       {
-      if ( numInts % 2 == 0)
+      if ( (numInts % 2) == 0)
           {
           --deltaVotes;
           }
diff --git a/Common/DataModel/vtkPolygon.h b/Common/DataModel/vtkPolygon.h
index f0d669e..da09d64 100644
--- a/Common/DataModel/vtkPolygon.h
+++ b/Common/DataModel/vtkPolygon.h
@@ -87,6 +87,7 @@ public:
   // The function assumes the input point lies on the polygon plane without
   // checking that.
   virtual void InterpolateFunctions(double x[3], double *sf);
+  virtual void InterpolateDerivs(double x[3], double *derivs);
 
   // Description:
   // Polygon specific methods.
@@ -218,3 +219,4 @@ private:
 };
 
 #endif
+
diff --git a/Common/DataModel/vtkPolyhedron.cxx b/Common/DataModel/vtkPolyhedron.cxx
index 94f75b1..43b7ed6 100644
--- a/Common/DataModel/vtkPolyhedron.cxx
+++ b/Common/DataModel/vtkPolyhedron.cxx
@@ -1909,23 +1909,7 @@ int vtkPolyhedron::IsInside(double x[3], double tolerance)
         this->PolyData->GetCell(this->CellIds->GetId(idx), this->Cell);
         if ( this->Cell->IntersectWithLine(x, xray, tol, t, xint, pcoords, subId) )
           {
-          // Check for vertex, edge or face intersections
-          // count the number of 0 or 1 pcoords
-          int pcount = 0;
-          for (int p = 0; p < 3; ++p)
-            {
-            if (pcoords[p] == 0.0 || pcoords[p] == 1.0)
-              {
-              pcount++;
-              }
-            }
-          // pcount = 1, exact face intersection
-          // pcount = 2, exact edge intersection
-          // pcount = 3, exact vertex intersection
-          if (pcount == 0)
-            {
-            numInts++;
-            }
+          numInts++;
           }
         } //for all candidate cells
       }
@@ -1939,29 +1923,13 @@ int vtkPolyhedron::IsInside(double x[3], double tolerance)
         this->PolyData->GetCell(idx, this->Cell);
         if ( this->Cell->IntersectWithLine(x, xray, tol, t, xint, pcoords, subId) )
           {
-          // Check for vertex, edge or face intersections
-          // count the number of 0 or 1 pcoords
-          int pcount = 0;
-          for (int p = 0; p < 3; ++p)
-            {
-            if (pcoords[p] == 0.0 || pcoords[p] == 1.0)
-              {
-              pcount++;
-              }
-            }
-          // pcount = 1, exact face intersection
-          // pcount = 2, exact edge intersection
-          // pcount = 3, exact vertex intersection
-          if (pcount == 0)
-            {
-            numInts++;
-            }
+          numInts++;
           }
         } //for all candidate cells
       }
 
     // Count the result
-    if ( numInts != 0 && (numInts % 2) == 0)
+    if ( (numInts % 2) == 0)
       {
       --deltaVotes;
       }
@@ -2634,6 +2602,7 @@ int vtkPolyhedron::InternalContour(double value,
   std::vector<vtkIdVectorType> polygonVector;
   vtkIdToIdVectorMapType::iterator ceMapIt, ceBackupMapIt;
   vtkIdSetType::iterator cpSetIt = cpSet.end();
+  vtkIdVectorType::iterator cpVectorIt;
 
   // backup ceMap. During graph travasal, we will remove edges from contour point
   // which can mess up the ordering.
diff --git a/Common/DataModel/vtkPyramid.cxx b/Common/DataModel/vtkPyramid.cxx
index d194ae3..246e798 100644
--- a/Common/DataModel/vtkPyramid.cxx
+++ b/Common/DataModel/vtkPyramid.cxx
@@ -95,7 +95,7 @@ int vtkPyramid::EvaluatePosition(double x[3], double closestPoint[3],
   // square it here because we're looking at dist2^2.
   if(dist2 == 0. || ( length2 != 0. && dist2/length2 < 1.e-6) )
     {
-    pcoords[0] = pcoords[1] = 0;
+    pcoords[0] = pcoords[1] = .5;
     pcoords[2] = 1;
     this->InterpolationFunctions(pcoords, weights);
     if(closestPoint)
@@ -150,7 +150,6 @@ int vtkPyramid::EvaluatePosition(double x[3], double closestPoint[3],
     d=vtkMath::Determinant3x3(rcol,scol,tcol);
     if ( fabs(d) < 1.e-20)
       {
-      vtkDebugMacro (<<"Determinant incorrect, iteration " << iteration);
       return -1;
       }
 
diff --git a/Common/DataModel/vtkQuad.cxx b/Common/DataModel/vtkQuad.cxx
index 894becf..e08ef3e 100644
--- a/Common/DataModel/vtkQuad.cxx
+++ b/Common/DataModel/vtkQuad.cxx
@@ -87,7 +87,6 @@ int vtkQuad::EvaluatePosition(double x[3], double* closestPoint,
 
   subId = 0;
   pcoords[0] = pcoords[1] = params[0] = params[1] = 0.5;
-  pcoords[2] = 0.0;
 
   // Get normal for quadrilateral
   //
diff --git a/Common/DataModel/vtkQuadraticHexahedron.cxx b/Common/DataModel/vtkQuadraticHexahedron.cxx
index 01412e6..16ffb89 100644
--- a/Common/DataModel/vtkQuadraticHexahedron.cxx
+++ b/Common/DataModel/vtkQuadraticHexahedron.cxx
@@ -199,8 +199,8 @@ void vtkQuadraticHexahedron::Subdivide(vtkPointData *inPd, vtkCellData *inCd,
 
 //----------------------------------------------------------------------------
 static const double VTK_DIVERGED = 1.e6;
-static const int VTK_HEX_MAX_ITERATION=20;
-static const double VTK_HEX_CONVERGED=1.e-04;
+static const int VTK_HEX_MAX_ITERATION=10;
+static const double VTK_HEX_CONVERGED=1.e-03;
 
 int vtkQuadraticHexahedron::EvaluatePosition(double* x,
                                              double* closestPoint,
@@ -252,7 +252,6 @@ int vtkQuadraticHexahedron::EvaluatePosition(double* x,
     d=vtkMath::Determinant3x3(rcol,scol,tcol);
     if ( fabs(d) < 1.e-20)
       {
-      vtkDebugMacro (<<"Determinant incorrect, iteration " << iteration);
       return -1;
       }
 
diff --git a/Common/DataModel/vtkQuadraticPolygon.cxx b/Common/DataModel/vtkQuadraticPolygon.cxx
index 04d635a..b957a17 100644
--- a/Common/DataModel/vtkQuadraticPolygon.cxx
+++ b/Common/DataModel/vtkQuadraticPolygon.cxx
@@ -323,7 +323,7 @@ void vtkQuadraticPolygon::GetPermutationFromPolygon(vtkIdType nb,
   permutation->SetNumberOfIds(nb);
   for (vtkIdType i = 0; i < nb; i++)
     {
-    permutation->SetId(i, ((i % 2) ? (i + nb)/2 : i/2));
+    permutation->SetId(i, (i % 2 ? (i + nb)/2 : i/2));
     }
 }
 
@@ -484,9 +484,10 @@ void vtkQuadraticPolygon::ConvertFromPolygon(vtkIdList *ids)
 
 //----------------------------------------------------------------------------
 void vtkQuadraticPolygon::Derivatives(int vtkNotUsed(subId),
-                                      double vtkNotUsed(pcoords)[3],
+                                      double pcoords[3],
                                       double *vtkNotUsed(values),
                                       int vtkNotUsed(dim),
                                       double *vtkNotUsed(derivs))
 {
+  pcoords[0] = pcoords[1] = pcoords[2] = 0.0;
 }
diff --git a/Common/DataModel/vtkQuadraticPyramid.cxx b/Common/DataModel/vtkQuadraticPyramid.cxx
index 9d571f2..a0b972b 100644
--- a/Common/DataModel/vtkQuadraticPyramid.cxx
+++ b/Common/DataModel/vtkQuadraticPyramid.cxx
@@ -160,50 +160,10 @@ int vtkQuadraticPyramid::EvaluatePosition(double* x,
                                           int& subId, double pcoords[3],
                                           double& dist2, double *weights)
 {
-  int i, j;
-  subId = 0;
-  // There are problems searching for the apex point so we check if
-  // we are there first before doing the full parametric inversion.
-  vtkPoints* points = this->GetPoints();
-  double apexPoint[3];
-  points->GetPoint(4, apexPoint);
-  dist2 = vtkMath::Distance2BetweenPoints(apexPoint, x);
-  double baseMidpoint[3];
-  points->GetPoint(0, baseMidpoint);
-  for(i=1;i<4;i++)
-    {
-    double tmp[3];
-    points->GetPoint(i, tmp);
-    for(j=0;j<3;j++)
-      {
-      baseMidpoint[j] += tmp[j];
-      }
-    }
-  for(i=0;i<3;i++)
-    {
-    baseMidpoint[i] /= 4.;
-    }
-
-  double length2 = vtkMath::Distance2BetweenPoints(apexPoint, baseMidpoint);
-  // we use .001 as the relative tolerance here since that is the same
-  // that is used for the interior cell check below but we need to
-  // square it here because we're looking at dist2^2.
-  if(dist2 == 0. || ( length2 != 0. && dist2/length2 < 1.e-6) )
-    {
-    pcoords[0] = pcoords[1] = 0;
-    pcoords[2] = 1;
-    this->InterpolationFunctions(pcoords, weights);
-    if(closestPoint)
-      {
-      memcpy(closestPoint, x, 3*sizeof(double));
-      dist2 = 0.;
-      }
-    return 1;
-    }
-
   int iteration, converged;
   double  params[3];
   double  fcol[3], rcol[3], scol[3], tcol[3];
+  int i, j;
   double  d, pt[3];
   double derivs[3*13];
 
@@ -245,7 +205,6 @@ int vtkQuadraticPyramid::EvaluatePosition(double* x,
     d=vtkMath::Determinant3x3(rcol,scol,tcol);
     if ( fabs(d) < 1.e-20)
       {
-      vtkDebugMacro (<<"Determinant incorrect, iteration " << iteration);
       return -1;
       }
 
@@ -687,30 +646,39 @@ void vtkQuadraticPyramid::InterpolationFunctions(double pcoords[3],
   // VTK needs parametric coordinates to be between (0,1). Isoparametric
   // shape functions are formulated between (-1,1). Here we do a
   // coordinate system conversion from (0,1) to (-1,1).
-  const double r = 2.0*(pcoords[0] - 0.5);
-  const double s = 2.0*(pcoords[1] - 0.5);
-  const double t = 2.0*(pcoords[2] - 0.5);
-  const double r2 = r*r;
-  const double s2 = s*s;
-  const double t2 = t*t;
-
-  weights[0] = -(1 - r) * (1 - s) * (1 - t) * (4 + 3*r + 3*s + 2*r*s + 2*t + r*t + s*t + 2*r*s*t) / 16.0;
-  weights[1] = -(1 + r) * (1 - s) * (1 - t) * (4 - 3*r + 3*s - 2*r*s + 2*t - r*t + s*t - 2*r*s*t) / 16.0;
-  weights[2] = -(1 + r) * (1 + s) * (1 - t) * (4 - 3*r - 3*s + 2*r*s + 2*t - r*t - s*t + 2*r*s*t) / 16.0;
-  weights[3] = -(1 - r) * (1 + s) * (1 - t) * (4 + 3*r - 3*s - 2*r*s + 2*t + r*t - s*t - 2*r*s*t) / 16.0;
-
-  weights[4] = t * (1 + t) / 2.0;
-
-  weights[5] = (1 - r2) * (1 - s) * (1 - t) * (2 + s + s*t) / 8.0;
-  weights[6] = (1 + r) * (1 - s2) * (1 - t) * (2 - r - r*t) / 8.0;
-  weights[7] = (1 - r2) * (1 + s) * (1 - t) * (2 - s - s*t) / 8.0;
-  weights[8] = (1 - r) * (1 - s2) * (1 - t) * (2 + r + r*t) / 8.0;
-
-  weights[9] = (1 - r) * (1 - s) * (1 - t2) / 4.0;
-  weights[10] = (1 + r) * (1 - s) * (1 - t2) / 4.0;
-  weights[11] = (1 + r) * (1 + s) * (1 - t2) / 4.0;
-  weights[12] = (1 - r) * (1 + s) * (1 - t2) / 4.0;
+  const double r = 2*pcoords[0] - 1;
+  const double s = 2*pcoords[1] - 1;
+  const double t = 2*pcoords[2] - 1;
+
+  const double rm = 1.0 - r;
+  const double rp = 1.0 + r;
+  const double sm = 1.0 - s;
+  const double sp = 1.0 + s;
+  const double tm = 1.0 - t;
+  const double tp = 1.0 + t;
+  const double r2 = 1.0 - r*r;
+  const double s2 = 1.0 - s*s;
+  const double t2 = 1.0 - t*t;
 
+  // corners
+  weights[0] = 0.125 * rm * sm * tm * (-r - s - t - 2.0);
+  weights[1] = 0.125 * rp * sm * tm * ( r - s - t - 2.0);
+  weights[2] = 0.125 * rp * sp * tm * ( r + s - t - 2.0);
+  weights[3] = 0.125 * rm * sp * tm * (-r + s - t - 2.0);
+  weights[4] = 0.5   * t  * tp;
+
+  // midsides of rectangles
+  weights[5] = 0.25 * r2 * sm * tm;
+  weights[6] = 0.25 * s2 * rp * tm;
+  weights[7] = 0.25 * r2 * sp * tm;
+  weights[8] = 0.25 * s2 * rm * tm;
+
+
+  // midsides of triangles
+  weights[9]  = 0.25 * ( 1 - r ) * (1 - s ) * t2;
+  weights[10] = 0.25 * ( 1 + r ) * (1 - s ) * t2;
+  weights[11] = 0.25 * ( 1 + r ) * (1 + s ) * t2;
+  weights[12] = 0.25 * ( 1 - r ) * (1 + s ) * t2;
 }
 
 //----------------------------------------------------------------------------
diff --git a/Common/DataModel/vtkQuadraticPyramid.h b/Common/DataModel/vtkQuadraticPyramid.h
index a54b256..555caba 100644
--- a/Common/DataModel/vtkQuadraticPyramid.h
+++ b/Common/DataModel/vtkQuadraticPyramid.h
@@ -155,8 +155,8 @@ private:
 //
 inline int vtkQuadraticPyramid::GetParametricCenter(double pcoords[3])
 {
-  pcoords[0] = pcoords[1] = 6.0/13.0;
-  pcoords[2] = 3.0/13.0;
+  pcoords[0] = pcoords[1] = 6./13;
+  pcoords[2] = 3./13;
   return 0;
 }
 
diff --git a/Common/DataModel/vtkQuadraticQuad.cxx b/Common/DataModel/vtkQuadraticQuad.cxx
index 618d608..18e3c7e 100644
--- a/Common/DataModel/vtkQuadraticQuad.cxx
+++ b/Common/DataModel/vtkQuadraticQuad.cxx
@@ -528,6 +528,9 @@ void vtkQuadraticQuad::Derivatives(int vtkNotUsed(subId),
 void vtkQuadraticQuad::InterpolationFunctions(double pcoords[3],
                                               double weights[8])
 {
+  //VTK needs parametric coordinates to be between (0,1). Isoparametric
+  //shape functions are formulated between (-1,1). Here we do a
+  //coordinate system conversion from (0,1) to (-1,1).
   double r = pcoords[0];
   double s = pcoords[1];
 
diff --git a/Common/DataModel/vtkQuadraticTetra.cxx b/Common/DataModel/vtkQuadraticTetra.cxx
index d2c02a9..592a12c 100644
--- a/Common/DataModel/vtkQuadraticTetra.cxx
+++ b/Common/DataModel/vtkQuadraticTetra.cxx
@@ -116,8 +116,8 @@ vtkCell *vtkQuadraticTetra::GetFace(int faceId)
 
 //----------------------------------------------------------------------------
 static const double VTK_DIVERGED = 1.e6;
-static const int VTK_TETRA_MAX_ITERATION=20;
-static const double VTK_TETRA_CONVERGED=1.e-04;
+static const int VTK_TETRA_MAX_ITERATION=10;
+static const double VTK_TETRA_CONVERGED=1.e-03;
 
 int vtkQuadraticTetra::EvaluatePosition(double* x,
                                         double* closestPoint,
diff --git a/Common/DataModel/vtkQuadraticTriangle.cxx b/Common/DataModel/vtkQuadraticTriangle.cxx
index f83f869..c07c161 100644
--- a/Common/DataModel/vtkQuadraticTriangle.cxx
+++ b/Common/DataModel/vtkQuadraticTriangle.cxx
@@ -127,7 +127,7 @@ int vtkQuadraticTriangle::EvaluatePosition(double* x, double* closestPoint,
       pcoords[0] = 0.5 - pcoords[0]/2.0;
       pcoords[1] = 0.5 - pcoords[1]/2.0;
       }
-    pcoords[2] = 0.0;
+    pcoords[2] = 1.0 - pcoords[0] - pcoords[1];
     if(closestPoint!=0)
       {
       // Compute both closestPoint and weights
@@ -260,11 +260,12 @@ int vtkQuadraticTriangle::Triangulate(int vtkNotUsed(index), vtkIdList *ptIds,
 
 //----------------------------------------------------------------------------
 void vtkQuadraticTriangle::Derivatives(int vtkNotUsed(subId),
-                                       double vtkNotUsed(pcoords)[3],
+                                       double pcoords[3],
                                        double *vtkNotUsed(values),
                                        int vtkNotUsed(dim),
                                        double *vtkNotUsed(derivs))
 {
+  pcoords[0] = pcoords[1] = pcoords[2] = 0.0;
 }
 
 
diff --git a/Common/DataModel/vtkQuadraticWedge.cxx b/Common/DataModel/vtkQuadraticWedge.cxx
index 406dc8e..0a3cf8c 100644
--- a/Common/DataModel/vtkQuadraticWedge.cxx
+++ b/Common/DataModel/vtkQuadraticWedge.cxx
@@ -202,7 +202,6 @@ int vtkQuadraticWedge::EvaluatePosition(double* x,
     d=vtkMath::Determinant3x3(rcol,scol,tcol);
     if ( fabs(d) < 1.e-20)
       {
-      vtkDebugMacro (<<"Determinant incorrect, iteration " << iteration);
       return -1;
       }
 
diff --git a/Common/DataModel/vtkRect.h b/Common/DataModel/vtkRect.h
index f306697..0b6c688 100644
--- a/Common/DataModel/vtkRect.h
+++ b/Common/DataModel/vtkRect.h
@@ -85,6 +85,22 @@ public:
   // Description:
   // Get the height of the rectangle, i.e. element 3.
   const T& GetHeight() const { return this->Data[3]; }
+
+  // Description:
+  // Legacy method for getting the x position.
+  VTK_LEGACY(const T& X() const);
+
+  // Description:
+  // Legacy method for getting the y position.
+  VTK_LEGACY(const T& Y() const);
+
+  // Description:
+  // Legacy method for getting the width.
+  VTK_LEGACY(const T& Width() const);
+
+  // Description:
+  // Legacy method for getting the height.
+  VTK_LEGACY(const T& Height() const);
 };
 
 class vtkRecti : public vtkRect<int>
@@ -114,5 +130,37 @@ public:
   explicit vtkRectd(const double *init) : vtkRect<double>(init) {}
 };
 
+#ifndef VTK_LEGACY_REMOVE
+template<typename T>
+const T& vtkRect<T>::X() const
+{
+  VTK_LEGACY_REPLACED_BODY(vtkRect::X, "VTK 6.0", vtkRect::GetX);
+  return this->GetX();
+}
+
+template<typename T>
+const T& vtkRect<T>::Y() const
+{
+  VTK_LEGACY_REPLACED_BODY(vtkRect::Y, "VTK 6.0", vtkRect::GetY);
+  return this->GetY();
+}
+
+template<typename T>
+const T& vtkRect<T>::Width() const
+{
+  VTK_LEGACY_REPLACED_BODY(vtkRect::Width, "VTK 6.0", vtkRect::GetWidth);
+  return this->GetWidth();
+}
+
+template<typename T>
+const T& vtkRect<T>::Height() const
+{
+  VTK_LEGACY_REPLACED_BODY(vtkRect::Height, "VTK 6.0", vtkRect::GetHeight);
+  return this->GetHeight();
+}
+
+#endif // VTK_LEGACY_REMOVE
+
+
 #endif // vtkRect_h
 // VTK-HeaderTest-Exclude: vtkRect.h
diff --git a/Common/DataModel/vtkRectilinearGrid.h b/Common/DataModel/vtkRectilinearGrid.h
index e43ae6b..567b736 100644
--- a/Common/DataModel/vtkRectilinearGrid.h
+++ b/Common/DataModel/vtkRectilinearGrid.h
@@ -159,7 +159,7 @@ public:
   vtkGetVector6Macro(Extent, int);
 
   // Description:
-  // Return the actual size of the data in kibibytes (1024 bytes). This number
+  // Return the actual size of the data in kilobytes. This number
   // is valid only after the pipeline has updated. The memory size
   // returned is guaranteed to be greater than or equal to the
   // memory required to represent the data (e.g., extra space in
diff --git a/Common/DataModel/vtkReebGraph.cxx b/Common/DataModel/vtkReebGraph.cxx
index f2ca4b2..015972b 100644
--- a/Common/DataModel/vtkReebGraph.cxx
+++ b/Common/DataModel/vtkReebGraph.cxx
@@ -1060,15 +1060,15 @@ vtkReebGraph::Implementation::vtkReebPath vtkReebGraph::Implementation::FindPath
         if (M==N1)
         {
           //clear all the items in the priority queue
-          while (!pq.empty())
+          while (pq.size())
           {
             vtkReebPath aux=pq.top();pq.pop();
             delete aux.ArcTable;
             delete aux.NodeTable;
           }
 
-          free(Ntouch);
-          free(Atouch);
+          if (Ntouch) free(Ntouch);
+          if (Atouch) free(Atouch);
 
           vtkIdType* tmp=new vtkIdType[entry.NodeNumber+1];
           memcpy(tmp,entry.NodeTable,sizeof(vtkIdType)*entry.NodeNumber);
diff --git a/Common/DataModel/vtkStructuredGrid.cxx b/Common/DataModel/vtkStructuredGrid.cxx
index f5b3150..a223972 100644
--- a/Common/DataModel/vtkStructuredGrid.cxx
+++ b/Common/DataModel/vtkStructuredGrid.cxx
@@ -24,14 +24,18 @@
 #include "vtkMath.h"
 #include "vtkObjectFactory.h"
 #include "vtkPointData.h"
+#include "vtkStructuredVisibilityConstraint.h"
 #include "vtkQuad.h"
-#include "vtkUnsignedCharArray.h"
 #include "vtkVertex.h"
 
 vtkStandardNewMacro(vtkStructuredGrid);
 
-unsigned char vtkStructuredGrid::MASKED_CELL_VALUE =
-  vtkDataSetAttributes::HIDDENCELL | vtkDataSetAttributes::REFINEDCELL;
+vtkCxxSetObjectMacro(vtkStructuredGrid,
+                     PointVisibility,
+                     vtkStructuredVisibilityConstraint);
+vtkCxxSetObjectMacro(vtkStructuredGrid,
+                     CellVisibility,
+                     vtkStructuredVisibilityConstraint);
 
 #define vtkAdjustBoundsMacro( A, B ) \
   A[0] = (B[0] < A[0] ? B[0] : A[0]);   A[1] = (B[0] > A[1] ? B[0] : A[1]); \
@@ -51,6 +55,9 @@ vtkStructuredGrid::vtkStructuredGrid()
   this->Dimensions[2] = 0;
   this->DataDescription = VTK_EMPTY;
 
+  this->PointVisibility = vtkStructuredVisibilityConstraint::New();
+  this->CellVisibility = vtkStructuredVisibilityConstraint::New();
+
   int extent[6] = {0, -1, 0, -1, 0, -1};
   memcpy(this->Extent, extent, 6*sizeof(int));
 
@@ -66,6 +73,9 @@ vtkStructuredGrid::~vtkStructuredGrid()
   this->Quad->Delete();
   this->Hexahedron->Delete();
   this->EmptyCell->Delete();
+
+  this->PointVisibility->Delete();
+  this->CellVisibility->Delete();
 }
 
 //----------------------------------------------------------------------------
@@ -84,25 +94,27 @@ void vtkStructuredGrid::CopyStructure(vtkDataSet *ds)
 
   this->DataDescription = sg->DataDescription;
 
-  if(ds->HasAnyBlankPoints())
-    {
-    // there is blanking
-    this->GetPointData()->AddArray(ds->GetPointGhostArray());
-    this->PointGhostArray = NULL;
-    }
-  if(ds->HasAnyBlankCells())
-    {
-    // there is blanking
-    this->GetCellData()->AddArray(ds->GetCellGhostArray());
-    this->CellGhostArray = NULL;
-    }
+  this->PointVisibility->Delete();
+  this->PointVisibility = vtkStructuredVisibilityConstraint::New();
+  this->PointVisibility->ShallowCopy(sg->PointVisibility);
+
+  this->CellVisibility->Delete();
+  this->CellVisibility = vtkStructuredVisibilityConstraint::New();
+  this->CellVisibility->ShallowCopy(sg->CellVisibility);
 }
 
+
 //----------------------------------------------------------------------------
 void vtkStructuredGrid::Initialize()
 {
   this->Superclass::Initialize();
 
+  this->PointVisibility->Delete();
+  this->PointVisibility = vtkStructuredVisibilityConstraint::New();
+
+  this->CellVisibility->Delete();
+  this->CellVisibility = vtkStructuredVisibilityConstraint::New();
+
   if(this->Information)
     {
     this->SetDimensions(0,0,0);
@@ -113,7 +125,9 @@ void vtkStructuredGrid::Initialize()
 int vtkStructuredGrid::GetCellType(vtkIdType cellId)
 {
   // see whether the cell is blanked
-  if(!this->IsCellVisible(cellId))
+  if ( (this->PointVisibility->IsConstrained() ||
+        this->CellVisibility->IsConstrained())
+       && !this->IsCellVisible(cellId) )
     {
     return VTK_EMPTY_CELL;
     }
@@ -157,7 +171,9 @@ vtkCell *vtkStructuredGrid::GetCell(vtkIdType cellId)
     }
 
   // see whether the cell is blanked
-  if(!this->IsCellVisible(cellId))
+  if ( (this->PointVisibility->IsConstrained() ||
+        this->CellVisibility->IsConstrained())
+       && !this->IsCellVisible(cellId) )
     {
     return this->EmptyCell;
     }
@@ -288,7 +304,9 @@ void vtkStructuredGrid::GetCell(vtkIdType cellId, vtkGenericCell *cell)
     }
 
   // see whether the cell is blanked
-  if(!this->IsCellVisible(cellId))
+  if ( (this->PointVisibility->IsConstrained() ||
+        this->CellVisibility->IsConstrained())
+       && !this->IsCellVisible(cellId) )
     {
     cell->SetCellTypeToEmptyCell();
     return;
@@ -401,6 +419,7 @@ void vtkStructuredGrid::GetCell(vtkIdType cellId, vtkGenericCell *cell)
     }
 }
 
+
 //----------------------------------------------------------------------------
 // Fast implementation of GetCellBounds().  Bounds are calculated without
 // constructing a cell.
@@ -533,65 +552,77 @@ void vtkStructuredGrid::GetCellBounds(vtkIdType cellId, double bounds[6])
     }
 }
 
+
 //----------------------------------------------------------------------------
 // Turn off a particular data point.
 void vtkStructuredGrid::BlankPoint(vtkIdType ptId)
 {
-  vtkUnsignedCharArray *ghosts = this->GetPointGhostArray();
-  if(!ghosts)
-    {
-    ghosts = this->AllocatePointGhostArray();
-    }
-  ghosts->SetValue(ptId, ghosts->GetValue(ptId) | vtkDataSetAttributes::HIDDENPOINT);
-  assert(!this->IsPointVisible(ptId));
+  this->PointVisibility->Initialize(this->Dimensions);
+  this->PointVisibility->Blank(ptId);
 }
 
 //----------------------------------------------------------------------------
 // Turn on a particular data point.
 void vtkStructuredGrid::UnBlankPoint(vtkIdType ptId)
 {
-  vtkUnsignedCharArray *ghosts = this->GetPointGhostArray();
-  if(ghosts)
-    {
-    ghosts->SetValue(ptId, ghosts->GetValue(ptId) & ~vtkDataSetAttributes::HIDDENPOINT);
-    }
-  assert(this->IsPointVisible(ptId));
+  this->PointVisibility->Initialize(this->Dimensions);
+  this->PointVisibility->UnBlank(ptId);
+}
+
+//----------------------------------------------------------------------------
+void vtkStructuredGrid::SetPointVisibilityArray(vtkUnsignedCharArray *ptVis)
+{
+  this->PointVisibility->SetVisibilityById(ptVis);
+}
+
+//----------------------------------------------------------------------------
+vtkUnsignedCharArray* vtkStructuredGrid::GetPointVisibilityArray()
+{
+  this->PointVisibility->Initialize(this->Dimensions);
+  this->PointVisibility->Allocate();
+  return this->PointVisibility->GetVisibilityById();
 }
 
 //----------------------------------------------------------------------------
 // Turn off a particular data cell.
 void vtkStructuredGrid::BlankCell(vtkIdType cellId)
 {
-  vtkUnsignedCharArray *ghosts = this->GetCellGhostArray();
-  if(!ghosts)
-    {
-    ghosts = this->AllocateCellGhostArray();
-    }
-  ghosts->SetValue(cellId, ghosts->GetValue(cellId) |
-                   vtkDataSetAttributes::HIDDENCELL);
-  assert(!this->IsCellVisible(cellId));
+  int celldims[3];
+  this->GetCellDims( celldims );
+  this->CellVisibility->Initialize( celldims );
+  this->CellVisibility->Blank(cellId);
 }
 
 //----------------------------------------------------------------------------
 // Turn on a particular data cell.
 void vtkStructuredGrid::UnBlankCell(vtkIdType cellId)
 {
-  vtkUnsignedCharArray* ghosts = this->GetCellGhostArray();
-  if(ghosts)
-    {
-    ghosts->SetValue(cellId, ghosts->GetValue(cellId) &
-                     ~vtkDataSetAttributes::HIDDENCELL);
-    }
+  int celldims[3];
+  this->GetCellDims( celldims );
+  this->CellVisibility->Initialize( celldims );
+  this->CellVisibility->UnBlank(cellId);
+}
+
+//----------------------------------------------------------------------------
+void vtkStructuredGrid::SetCellVisibilityArray(vtkUnsignedCharArray *cellVis)
+{
+  this->CellVisibility->SetVisibilityById(cellVis);
+}
+
+//----------------------------------------------------------------------------
+vtkUnsignedCharArray* vtkStructuredGrid::GetCellVisibilityArray()
+{
+  int celldims[3];
+  this->GetCellDims( celldims );
+  this->CellVisibility->Initialize( celldims );
+  this->CellVisibility->Allocate();
+  return this->CellVisibility->GetVisibilityById();
 }
 
 //----------------------------------------------------------------------------
 unsigned char vtkStructuredGrid::IsPointVisible(vtkIdType pointId)
 {
-  if(this->GetPointGhostArray() && (this->GetPointGhostArray()->GetValue(pointId) & vtkDataSetAttributes::HIDDENPOINT))
-    {
-    return 0;
-    }
-  return 1;
+  return this->PointVisibility->IsVisible(pointId);
 }
 
 //----------------------------------------------------------------------------
@@ -607,14 +638,10 @@ void vtkStructuredGrid::GetCellDims( int cellDims[3] )
 // Return non-zero if the specified cell is visible (i.e., not blanked)
 unsigned char vtkStructuredGrid::IsCellVisible(vtkIdType cellId)
 {
-  if(this->GetCellGhostArray() && (this->GetCellGhostArray()->GetValue(cellId) & MASKED_CELL_VALUE))
-    {
-    return 0;
-    }
 
-  if (! this->GetPointGhostArray())
+  if ( !this->CellVisibility->IsVisible(cellId) )
     {
-    return (this->DataDescription == VTK_EMPTY) ? 0 : 1;
+    return 0;
     }
 
   // Update dimensions
@@ -919,7 +946,7 @@ void vtkStructuredGrid::GetCellNeighbors(vtkIdType cellId, vtkIdList *ptIds,
     }
 
   // If blanking, remove blanked cells.
-  if(this->GetPointGhostArray() || this->GetCellGhostArray())
+  if ( this->PointVisibility->IsConstrained() )
     {
     int xcellId;
     for (int i=0; i<cellIds->GetNumberOfIds(); i++)
@@ -943,10 +970,16 @@ unsigned long vtkStructuredGrid::GetActualMemorySize()
 void vtkStructuredGrid::ShallowCopy(vtkDataObject *dataObject)
 {
   vtkStructuredGrid *grid = vtkStructuredGrid::SafeDownCast(dataObject);
-  if(grid != NULL)
+
+  if ( grid != NULL )
     {
     this->InternalStructuredGridCopy(grid);
+    this->PointVisibility->ShallowCopy(grid->PointVisibility);
+    this->CellVisibility->ShallowCopy(grid->CellVisibility);
     }
+
+
+  // Do superclass
   this->vtkPointSet::ShallowCopy(dataObject);
 }
 
@@ -954,10 +987,15 @@ void vtkStructuredGrid::ShallowCopy(vtkDataObject *dataObject)
 void vtkStructuredGrid::DeepCopy(vtkDataObject *dataObject)
 {
   vtkStructuredGrid *grid = vtkStructuredGrid::SafeDownCast(dataObject);
-  if(grid != NULL)
+
+  if ( grid != NULL )
     {
     this->InternalStructuredGridCopy(grid);
+    this->PointVisibility->DeepCopy(grid->PointVisibility);
+    this->CellVisibility->DeepCopy(grid->CellVisibility);
     }
+
+  // Do superclass
   this->vtkPointSet::DeepCopy(dataObject);
 }
 
@@ -1043,6 +1081,7 @@ void vtkStructuredGrid::ComputeScalarRange()
     }
 }
 
+
 //----------------------------------------------------------------------------
 void vtkStructuredGrid::Crop(const int* updateExtent)
 {
@@ -1154,6 +1193,7 @@ void vtkStructuredGrid::Crop(const int* updateExtent)
     }
 }
 
+
 //----------------------------------------------------------------------------
 void vtkStructuredGrid::PrintSelf(ostream& os, vtkIndent indent)
 {
@@ -1175,6 +1215,19 @@ void vtkStructuredGrid::PrintSelf(ostream& os, vtkIndent indent)
 }
 
 //----------------------------------------------------------------------------
+unsigned char vtkStructuredGrid::GetPointBlanking()
+{
+  return this->PointVisibility->IsConstrained();
+}
+
+//----------------------------------------------------------------------------
+unsigned char vtkStructuredGrid::GetCellBlanking()
+{
+  return this->PointVisibility->IsConstrained() ||
+    this->CellVisibility->IsConstrained();
+}
+
+//----------------------------------------------------------------------------
 vtkStructuredGrid* vtkStructuredGrid::GetData(vtkInformation* info)
 {
   return info? vtkStructuredGrid::SafeDownCast(info->Get(DATA_OBJECT())) : 0;
@@ -1221,19 +1274,3 @@ void vtkStructuredGrid::GetPoint(
 
   this->GetPoint(id, p);
 }
-
-
-//----------------------------------------------------------------------------
-bool vtkStructuredGrid::HasAnyBlankPoints()
-{
-  return IsAnyBitSet(
-    this->GetPointGhostArray(), vtkDataSetAttributes::HIDDENPOINT);
-}
-
-//----------------------------------------------------------------------------
-bool vtkStructuredGrid::HasAnyBlankCells()
-{
-  int cellBlanking = IsAnyBitSet(this->GetCellGhostArray(),
-                                 vtkDataSetAttributes::HIDDENCELL);
-  return cellBlanking || this->HasAnyBlankPoints();
-}
diff --git a/Common/DataModel/vtkStructuredGrid.h b/Common/DataModel/vtkStructuredGrid.h
index 773a2fa..8f77c48 100644
--- a/Common/DataModel/vtkStructuredGrid.h
+++ b/Common/DataModel/vtkStructuredGrid.h
@@ -31,10 +31,10 @@
 // 0<=i<(dims[0]-1)), then j (0<=j<(dims[1]-1)), then k (0<=k<(dims[2]-1))
 // The number of cells is (dims[0]-1)*(dims[1]-1)*(dims[2]-1).
 //
-// vtkStructuredGrid has the ability to blank,
-// or "turn-off" points and cells in the dataset. This is done by setting
-// vtkDataSetAttributes::HIDDENPOINT or vtkDataSetAttributes::HIDDENCELL
-// in the ghost array for each point / cell that needs to be blanked.
+// A unusual feature of vtkStructuredGrid is the ability to blank,
+// or "turn-off" points and cells in the dataset. This is controlled by
+// defining a "blanking array" whose values (0,1) specify whether
+// a point should be blanked or not.
 
 #ifndef vtkStructuredGrid_h
 #define vtkStructuredGrid_h
@@ -48,6 +48,7 @@ class vtkEmptyCell;
 class vtkHexahedron;
 class vtkLine;
 class vtkQuad;
+class vtkStructuredVisibilityConstraint;
 class vtkUnsignedCharArray;
 class vtkVertex;
 
@@ -111,7 +112,7 @@ public:
   vtkGetVector6Macro(Extent, int);
 
   // Description:
-  // Return the actual size of the data in kibibytes (1024 bytes). This number
+  // Return the actual size of the data in kilobytes. This number
   // is valid only after the pipeline has updated. The memory size
   // returned is guaranteed to be greater than or equal to the
   // memory required to represent the data (e.g., extra space in
@@ -138,13 +139,33 @@ public:
 
   // Description:
   // Methods for supporting blanking of cells. Blanking turns on or off
-  // cells in the structured grid, and hence the points connected to them.
+  // cells in the structured grid, and hence the cells connected to them.
   // These methods should be called only after the dimensions of the
   // grid are set.
   void BlankCell(vtkIdType ptId);
   void UnBlankCell(vtkIdType ptId);
 
   // Description:
+  // Get the array that defines the blanking (visibility) of each point.
+  vtkUnsignedCharArray *GetPointVisibilityArray();
+
+  // Description:
+  // Set an array that defines the (blanking) visibility of the points
+  // in the grid. Make sure that length of the visibility array matches
+  // the number of points in the grid.
+  void SetPointVisibilityArray(vtkUnsignedCharArray *pointVisibility);
+
+  // Description:
+  // Get the array that defines the blanking (visibility) of each cell.
+  vtkUnsignedCharArray *GetCellVisibilityArray();
+
+  // Description:
+  // Set an array that defines the (blanking) visibility of the cells
+  // in the grid. Make sure that length of the visibility array matches
+  // the number of points in the grid.
+  void SetCellVisibilityArray(vtkUnsignedCharArray *pointVisibility);
+
+  // Description:
   // Return non-zero value if specified point is visible.
   // These methods should be called only after the dimensions of the
   // grid are set.
@@ -159,11 +180,12 @@ public:
   // Description:
   // Returns 1 if there is any visibility constraint on the points,
   // 0 otherwise.
-  virtual bool HasAnyBlankPoints();
+  unsigned char GetPointBlanking();
+
   // Description:
   // Returns 1 if there is any visibility constraint on the cells,
   // 0 otherwise.
-  virtual bool HasAnyBlankCells();
+  unsigned char GetCellBlanking();
 
   // Description:
   // Given the node dimensions of this grid instance, this method computes the
@@ -211,6 +233,16 @@ protected:
 
   int Extent[6];
 
+  vtkStructuredVisibilityConstraint* PointVisibility;
+
+  void SetPointVisibility(vtkStructuredVisibilityConstraint *pointVisibility);
+  vtkGetObjectMacro(PointVisibility, vtkStructuredVisibilityConstraint);
+
+  vtkStructuredVisibilityConstraint* CellVisibility;
+
+  void SetCellVisibility(vtkStructuredVisibilityConstraint *cellVisibility);
+  vtkGetObjectMacro(CellVisibility, vtkStructuredVisibilityConstraint);
+
   // Description:
   // Compute the range of the scalars and cache it into ScalarRange
   // only if the cache became invalid (ScalarRangeComputeTime).
@@ -225,8 +257,6 @@ private:
   // Internal method used by DeepCopy and ShallowCopy.
   void InternalStructuredGridCopy(vtkStructuredGrid *src);
 
-  static unsigned char MASKED_CELL_VALUE;
-
 private:
   vtkStructuredGrid(const vtkStructuredGrid&);  // Not implemented.
   void operator=(const vtkStructuredGrid&);  // Not implemented.
diff --git a/Common/DataModel/vtkStructuredVisibilityConstraint.cxx b/Common/DataModel/vtkStructuredVisibilityConstraint.cxx
new file mode 100644
index 0000000..f5d8755
--- /dev/null
+++ b/Common/DataModel/vtkStructuredVisibilityConstraint.cxx
@@ -0,0 +1,102 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+  Module:    vtkStructuredVisibilityConstraint.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 "vtkStructuredVisibilityConstraint.h"
+
+#include "vtkObjectFactory.h"
+#include "vtkUnsignedCharArray.h"
+
+vtkStandardNewMacro(vtkStructuredVisibilityConstraint);
+
+vtkCxxSetObjectMacro(vtkStructuredVisibilityConstraint,
+                     VisibilityById,
+                     vtkUnsignedCharArray);
+
+//----------------------------------------------------------------------------
+vtkStructuredVisibilityConstraint::vtkStructuredVisibilityConstraint()
+{
+  this->VisibilityById = 0;
+  for (int i=0; i<3; i++)
+    {
+    this->Dimensions[i] = 0;
+    }
+  this->NumberOfIds = 0;
+  this->Initialized = 0;
+}
+
+//----------------------------------------------------------------------------
+vtkStructuredVisibilityConstraint::~vtkStructuredVisibilityConstraint()
+{
+  if (this->VisibilityById)
+    {
+    this->VisibilityById->Delete();
+    }
+}
+
+//----------------------------------------------------------------------------
+void vtkStructuredVisibilityConstraint::DeepCopy(
+  vtkStructuredVisibilityConstraint* src)
+{
+  memcpy(this->Dimensions, src->Dimensions, 3*sizeof(int));
+  // use vtkIdType to avoid 32-bit overflow
+  this->NumberOfIds =
+    static_cast<vtkIdType>(this->Dimensions[0])*
+    static_cast<vtkIdType>(this->Dimensions[1])*
+    static_cast<vtkIdType>(this->Dimensions[2]);
+  if(src->VisibilityById)
+    {
+    if (!this->VisibilityById)
+      {
+      this->VisibilityById = vtkUnsignedCharArray::New();
+      }
+    this->VisibilityById->DeepCopy(src->VisibilityById);
+    }
+  this->Initialized = src->Initialized;
+}
+
+//----------------------------------------------------------------------------
+void vtkStructuredVisibilityConstraint::ShallowCopy(
+  vtkStructuredVisibilityConstraint* src)
+{
+  memcpy(this->Dimensions, src->Dimensions, 3*sizeof(int));
+  this->NumberOfIds =
+    static_cast<vtkIdType>(this->Dimensions[0])*
+    static_cast<vtkIdType>(this->Dimensions[1])*
+    static_cast<vtkIdType>(this->Dimensions[2]);
+  this->SetVisibilityById(src->VisibilityById);
+  this->Initialized = src->Initialized;
+}
+
+//----------------------------------------------------------------------------
+void vtkStructuredVisibilityConstraint::PrintSelf(ostream& os,
+                                                  vtkIndent indent)
+{
+  this->Superclass::PrintSelf(os,indent);
+  os << indent << "VisibilityById: ";
+  if (this->VisibilityById)
+    {
+    os << endl;
+    this->VisibilityById->PrintSelf(os,indent.GetNextIndent());
+    }
+  else
+    {
+    os << "(none)" << endl;
+    }
+  os << indent << "Dimensions: "
+     << this->Dimensions[0] << " "
+     << this->Dimensions[1] << " "
+     << this->Dimensions[2]
+     << endl;
+}
+
diff --git a/Common/DataModel/vtkStructuredVisibilityConstraint.h b/Common/DataModel/vtkStructuredVisibilityConstraint.h
new file mode 100644
index 0000000..e498e81
--- /dev/null
+++ b/Common/DataModel/vtkStructuredVisibilityConstraint.h
@@ -0,0 +1,178 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+  Module:    vtkStructuredVisibilityConstraint.h
+
+  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.
+
+=========================================================================*/
+// .NAME vtkStructuredVisibilityConstraint - helper object to manage the
+// visibility of points and cells
+// .SECTION Description
+// vtkStructuredVisibilityConstraint is a general class to manage
+// a list of points/cell marked as invalid or invisible. Currently,
+// it does this by maintaining an unsigned char array associated
+// with points/cells. To conserve memory, this array is allocated
+// only when it is needed (when Blank() is called the first time).
+// Make sure to call Initialize() with the right dimensions before
+// calling any methods that set/get visibility.
+
+#ifndef vtkStructuredVisibilityConstraint_h
+#define vtkStructuredVisibilityConstraint_h
+
+#include "vtkCommonDataModelModule.h" // For export macro
+#include "vtkObject.h"
+
+#include "vtkUnsignedCharArray.h" // Needed for inline methods.
+
+class VTKCOMMONDATAMODEL_EXPORT vtkStructuredVisibilityConstraint : public vtkObject
+{
+public:
+  static vtkStructuredVisibilityConstraint *New();
+
+  vtkTypeMacro(vtkStructuredVisibilityConstraint,vtkObject);
+  void PrintSelf(ostream& os, vtkIndent indent);
+
+  // Description:
+  // Returns 1 is the point/cell is visible, 0 otherwise.
+  unsigned char IsVisible(vtkIdType id);
+
+  // Description:
+  // Sets the visibility flag of the given point/cell off.
+  // The first time blank is called, a new visibility array
+  // is created if it doesn't exist.
+  void Blank(vtkIdType id);
+
+  // Description:
+  // Sets the visibility flag of the given point/cell on.
+  void UnBlank(vtkIdType id);
+
+  // Description:
+  // Get the dimensions used to initialize the object.
+  vtkGetVectorMacro(Dimensions,int,3);
+
+  // Description:
+  // Set the dimensions and set the Initialized flag to 1. Once
+  // an object is initialized, it's dimensions can not be
+  // changed anymore.
+  void Initialize(int dims[3]);
+
+  // Description:
+  // Allocates the internal visibility data-structure iff the object has
+  // been initialized.
+  void Allocate();
+
+  // Description:
+  // Set/Get the array used to store the visibility flags.
+  void SetVisibilityById(vtkUnsignedCharArray* vis);
+  vtkGetObjectMacro(VisibilityById, vtkUnsignedCharArray);
+
+  // Description:
+  // Copies the dimensions, the visibility array pointer
+  // and the initialized flag.
+  void ShallowCopy(vtkStructuredVisibilityConstraint* src);
+
+  // Description:
+  // Copies the dimensions, the visibility array
+  // and the initialized flag.
+  void DeepCopy(vtkStructuredVisibilityConstraint* src);
+
+  // Description:
+  // Returns 0 if there is no visibility array (all cells/points
+  // are visible), 0 otherwise.
+  unsigned char IsConstrained()
+    {
+      return this->VisibilityById ? 1 : 0;
+    }
+
+protected:
+  vtkStructuredVisibilityConstraint();
+  ~vtkStructuredVisibilityConstraint();
+
+  vtkUnsignedCharArray* VisibilityById;
+  int Dimensions[3];
+  vtkIdType NumberOfIds;
+  unsigned char Initialized;
+
+private:
+  vtkStructuredVisibilityConstraint(const vtkStructuredVisibilityConstraint&);  // Not implemented.
+  void operator=(const vtkStructuredVisibilityConstraint&);  // Not implemented.
+};
+
+//----------------------------------------------------------------------------
+// These methods are inline for efficiency.
+
+//----------------------------------------------------------------------------
+inline void vtkStructuredVisibilityConstraint::Allocate()
+{
+  if( !this->VisibilityById )
+    {
+    this->VisibilityById = vtkUnsignedCharArray::New();
+    this->VisibilityById->SetNumberOfTuples( this->NumberOfIds );
+    for( int i=0; i < this->NumberOfIds; ++i )
+      {
+      this->VisibilityById->SetValue( i, 1 );
+      }
+    }
+}
+//----------------------------------------------------------------------------
+inline unsigned char vtkStructuredVisibilityConstraint::IsVisible(
+  vtkIdType id)
+{
+  vtkUnsignedCharArray* vis = this->VisibilityById;
+  return vis ? vis->GetValue(id) : 1;
+}
+
+//----------------------------------------------------------------------------
+inline void vtkStructuredVisibilityConstraint::Blank(vtkIdType id)
+{
+  vtkUnsignedCharArray* vis = this->VisibilityById;
+  if (!vis)
+    {
+    this->VisibilityById = vtkUnsignedCharArray::New();
+    vis = this->VisibilityById;
+    this->VisibilityById->SetNumberOfTuples(this->NumberOfIds);
+    for (int i=0; i<this->NumberOfIds; ++i)
+      {
+      this->VisibilityById->SetValue(i, 1);
+      }
+    }
+  vis->SetValue(id, 0);
+}
+
+//----------------------------------------------------------------------------
+inline void vtkStructuredVisibilityConstraint::UnBlank(vtkIdType id)
+{
+  vtkUnsignedCharArray* vis = this->VisibilityById;
+  if (!vis)
+    {
+    return;
+    }
+  vis->SetValue(id, 1);
+}
+
+//----------------------------------------------------------------------------
+inline void vtkStructuredVisibilityConstraint::Initialize(int dims[3])
+{
+  if (this->Initialized)
+    {
+    return;
+    }
+  for (int i=0; i<3; i++)
+    {
+    this->Dimensions[i] = dims[i];
+    }
+  this->NumberOfIds = static_cast<vtkIdType>(dims[0])*
+                      static_cast<vtkIdType>(dims[1])*
+                      static_cast<vtkIdType>(dims[2]);
+  this->Initialized = 1;
+}
+
+#endif
+
diff --git a/Common/DataModel/vtkTable.h b/Common/DataModel/vtkTable.h
index 74246d2..d1414fc 100644
--- a/Common/DataModel/vtkTable.h
+++ b/Common/DataModel/vtkTable.h
@@ -74,7 +74,7 @@ public:
   int GetDataObjectType() {return VTK_TABLE;}
 
   // Description:
-  // Return the actual size of the data in kibibytes (1024 bytes). This number
+  // Return the actual size of the data in kilobytes. This number
   // is valid only after the pipeline has updated. The memory size
   // returned is guaranteed to be greater than or equal to the
   // memory required to represent the data (e.g., extra space in
diff --git a/Common/DataModel/vtkTriQuadraticHexahedron.cxx b/Common/DataModel/vtkTriQuadraticHexahedron.cxx
index 96ccb56..e35f674 100644
--- a/Common/DataModel/vtkTriQuadraticHexahedron.cxx
+++ b/Common/DataModel/vtkTriQuadraticHexahedron.cxx
@@ -190,7 +190,7 @@ int vtkTriQuadraticHexahedron::EvaluatePosition (double *x,
     d = vtkMath::Determinant3x3 (rcol, scol, tcol);
     if (fabs (d) < 1.e-20)
       {
-      vtkDebugMacro (<<"Determinant incorrect, iteration " << iteration);
+      vtkErrorMacro (<<"Determinant incorrect, iteration " << iteration);
       return -1;
       }
 
@@ -210,6 +210,7 @@ int vtkTriQuadraticHexahedron::EvaluatePosition (double *x,
     else if ((fabs (pcoords[0]) > VTK_DIVERGED) ||
       (fabs (pcoords[1]) > VTK_DIVERGED) || (fabs (pcoords[2]) > VTK_DIVERGED))
       {
+      vtkErrorMacro (<<"Newton did not converged, iteration " << iteration << " det " << d);
       return -1;
       }
 
@@ -227,6 +228,7 @@ int vtkTriQuadraticHexahedron::EvaluatePosition (double *x,
   //  outside of element
   if (!converged)
     {
+    vtkErrorMacro (<<"Newton did not converged, iteration " << iteration << " det " << d);
     return -1;
     }
 
diff --git a/Common/DataModel/vtkTriangle.cxx b/Common/DataModel/vtkTriangle.cxx
index c8533ba..943c05b 100644
--- a/Common/DataModel/vtkTriangle.cxx
+++ b/Common/DataModel/vtkTriangle.cxx
@@ -81,7 +81,6 @@ int vtkTriangle::EvaluatePosition(double x[3], double* closestPoint,
   double *closest, closestPoint1[3], closestPoint2[3], cp[3];
 
   subId = 0;
-  pcoords[2] = 0.0;
 
   // Get normal for triangle, only the normal direction is needed, i.e. the
   // normal need not be normalized (unit length)
@@ -134,22 +133,23 @@ int vtkTriangle::EvaluatePosition(double x[3], double* closestPoint,
 
   if ( (det = vtkMath::Determinant2x2(c1,c2)) == 0.0 )
     {
-    pcoords[0] = pcoords[1] = 0.0;
+    pcoords[0] = pcoords[1] = pcoords[2] = 0.0;
     return -1;
     }
 
   pcoords[0] = vtkMath::Determinant2x2(rhs,c2) / det;
   pcoords[1] = vtkMath::Determinant2x2(c1,rhs) / det;
+  pcoords[2] = 1.0 - (pcoords[0] + pcoords[1]);
 
   // Okay, now find closest point to element
   //
-  weights[0] = 1 - (pcoords[0] + pcoords[1]);
+  weights[0] = pcoords[2];
   weights[1] = pcoords[0];
   weights[2] = pcoords[1];
 
-  if ( weights[0] >= 0.0 && weights[0] <= 1.0 &&
-       weights[1] >= 0.0 && weights[1] <= 1.0 &&
-       weights[2] >= 0.0 && weights[2] <= 1.0 )
+  if ( pcoords[0] >= 0.0 && pcoords[0] <= 1.0 &&
+       pcoords[1] >= 0.0 && pcoords[1] <= 1.0 &&
+       pcoords[2] >= 0.0 && pcoords[2] <= 1.0 )
     {
     //projection distance
     if (closestPoint)
@@ -166,7 +166,7 @@ int vtkTriangle::EvaluatePosition(double x[3], double* closestPoint,
     double t;
     if (closestPoint)
       {
-      if ( weights[1] < 0.0 && weights[2] < 0.0 )
+      if ( pcoords[0] < 0.0 && pcoords[1] < 0.0 )
         {
         dist2Point = vtkMath::Distance2BetweenPoints(x,pt3);
         dist2Line1 = vtkLine::DistanceToLine(x,pt1,pt3,t,closestPoint1);
@@ -191,7 +191,7 @@ int vtkTriangle::EvaluatePosition(double x[3], double* closestPoint,
           closestPoint[i] = closest[i];
           }
         }
-      else if ( weights[2] < 0.0 && weights[0] < 0.0 )
+      else if ( pcoords[1] < 0.0 && pcoords[2] < 0.0 )
         {
         dist2Point = vtkMath::Distance2BetweenPoints(x,pt1);
         dist2Line1 = vtkLine::DistanceToLine(x,pt1,pt3,t,closestPoint1);
@@ -216,7 +216,7 @@ int vtkTriangle::EvaluatePosition(double x[3], double* closestPoint,
           closestPoint[i] = closest[i];
           }
         }
-      else if ( weights[1] < 0.0 && weights[0] < 0.0 )
+      else if ( pcoords[0] < 0.0 && pcoords[2] < 0.0 )
         {
         dist2Point = vtkMath::Distance2BetweenPoints(x,pt2);
         dist2Line1 = vtkLine::DistanceToLine(x,pt2,pt3,t,closestPoint1);
@@ -241,18 +241,18 @@ int vtkTriangle::EvaluatePosition(double x[3], double* closestPoint,
           closestPoint[i] = closest[i];
           }
         }
-      else if ( weights[0] < 0.0 )
-        {
-        dist2 = vtkLine::DistanceToLine(x,pt1,pt2,t,closestPoint);
-        }
-      else if ( weights[1] < 0.0 )
+      else if ( pcoords[0] < 0.0 )
         {
         dist2 = vtkLine::DistanceToLine(x,pt2,pt3,t,closestPoint);
         }
-      else if ( weights[2] < 0.0 )
+      else if ( pcoords[1] < 0.0 )
         {
         dist2 = vtkLine::DistanceToLine(x,pt1,pt3,t,closestPoint);
         }
+      else if ( pcoords[2] < 0.0 )
+        {
+        dist2 = vtkLine::DistanceToLine(x,pt1,pt2,t,closestPoint);
+        }
       }
     return 0;
     }
@@ -493,7 +493,6 @@ int vtkTriangle::IntersectWithLine(double p1[3], double p2[3], double tol,
   double dist2, weights[3];
 
   subId = 0;
-  pcoords[2] = 0.0;
 
   // Get normal for triangle
   //
@@ -502,70 +501,69 @@ int vtkTriangle::IntersectWithLine(double p1[3], double p2[3], double tol,
   this->Points->GetPoint(0, pt3);
 
   vtkTriangle::ComputeNormal (pt1, pt2, pt3, n);
-  if (n[0] != 0 || n[1] != 0 || n[2] != 0)
+
+  // Intersect plane of triangle with line
+  //
+  if ( ! vtkPlane::IntersectWithLine(p1,p2,n,pt1,t,x) )
     {
-    // Intersect plane of triangle with line
-    //
-    if ( ! vtkPlane::IntersectWithLine(p1,p2,n,pt1,t,x) )
-      {
-      pcoords[0] = pcoords[1] = 0.0;
-      return 0;
-      }
+    pcoords[0] = pcoords[1] = pcoords[2] = 0.0;
+    return 0;
+    }
 
-    // Evaluate position
-    //
-    int inside;
-    if ( (inside = this->EvaluatePosition(x, closestPoint, subId, pcoords,
-          dist2, weights)) >= 0)
+  // Evaluate position
+  //
+  int inside;
+  if ( (inside = this->EvaluatePosition(x, closestPoint, subId, pcoords,
+        dist2, weights)) >= 0)
+    {
+    if ( dist2 <= tol2 )
       {
-      if ( dist2 <= tol2 )
-        {
-        return 1;
-        }
-      return inside;
+      pcoords[2] = 0.0;
+      return 1;
       }
+    return inside;
     }
 
-  // Normals are null, so the triangle is degenerated and
-  // we still need to check intersection between line and
-  // the longest edge.
-  double dist2Pt1Pt2 = vtkMath::Distance2BetweenPoints(pt1, pt2);
-  double dist2Pt2Pt3 = vtkMath::Distance2BetweenPoints(pt2, pt3);
-  double dist2Pt3Pt1 = vtkMath::Distance2BetweenPoints(pt3, pt1);
-  if (dist2Pt1Pt2 > dist2Pt2Pt3 && dist2Pt1Pt2 > dist2Pt3Pt1)
+  // so the easy test failed. The line is not intersecting the triangle.
+  // Let's now do the 3d case check to see how close the line comes.
+  // basically we just need to test against the three lines of the triangle
+  this->Line->PointIds->InsertId(0,0);
+  this->Line->PointIds->InsertId(1,1);
+
+  if (pcoords[2] < 0.0)
     {
     this->Line->Points->InsertPoint(0,pt1);
     this->Line->Points->InsertPoint(1,pt2);
+    if (this->Line->IntersectWithLine(p1,p2,tol,t,x,pcoords,subId))
+      {
+      pcoords[2] = 0.0;
+      return 1;
+      }
     }
-  else if (dist2Pt2Pt3 > dist2Pt3Pt1 && dist2Pt2Pt3 > dist2Pt1Pt2)
+
+  if (pcoords[0] < 0.0)
     {
     this->Line->Points->InsertPoint(0,pt2);
     this->Line->Points->InsertPoint(1,pt3);
+    if (this->Line->IntersectWithLine(p1,p2,tol,t,x,pcoords,subId))
+      {
+      pcoords[2] = 0.0;
+      return 1;
+      }
     }
-  else
+
+  if (pcoords[1] < 0.0)
     {
     this->Line->Points->InsertPoint(0,pt3);
     this->Line->Points->InsertPoint(1,pt1);
-    }
-
-  if (this->Line->IntersectWithLine(p1,p2,tol,t,x,pcoords,subId))
-    {
-    // Compute r and s manually, using dot and norm.
-    double pt3Pt1[3];
-    double pt3Pt2[3];
-    double pt3X[3];
-    for (int i = 0; i < 3; i++)
+    if (this->Line->IntersectWithLine(p1,p2,tol,t,x,pcoords,subId))
       {
-      pt3Pt1[i] = pt1[i] - pt3[i];
-      pt3Pt2[i] = pt2[i] - pt3[i];
-      pt3X[i] = x[i] - pt3[i];
+      pcoords[2] = 0.0;
+      return 1;
       }
-    pcoords[0] = vtkMath::Dot(pt3X, pt3Pt1) / dist2Pt3Pt1;
-    pcoords[1] = vtkMath::Dot(pt3X, pt3Pt2) / dist2Pt2Pt3;
-    return 1;
     }
 
-  pcoords[0] = pcoords[1] = 0.0;
+  pcoords[0] = pcoords[1] = pcoords[2] = 0.0;
   return 0;
 }
 
diff --git a/Common/DataModel/vtkTriangleStrip.cxx b/Common/DataModel/vtkTriangleStrip.cxx
index d7b25fe..76364ed 100644
--- a/Common/DataModel/vtkTriangleStrip.cxx
+++ b/Common/DataModel/vtkTriangleStrip.cxx
@@ -74,6 +74,7 @@ int vtkTriangleStrip::EvaluatePosition(double x[3], double* closestPoint,
       subId = i;
       pcoords[0] = pc[0];
       pcoords[1] = pc[1];
+      pcoords[2] = 1.0 - pc[0] - pc[1];
       minDist2 = dist2;
       activeWeights[0] = tempWeights[0];
       activeWeights[1] = tempWeights[1];
@@ -339,6 +340,20 @@ int vtkTriangleStrip::GetParametricCenter(double pcoords[3])
 }
 
 //----------------------------------------------------------------------------
+void vtkTriangleStrip::InterpolateFunctions(double pcoords[3], double *weights)
+{
+  (void)pcoords;
+  (void)weights;
+}
+
+//----------------------------------------------------------------------------
+void vtkTriangleStrip::InterpolateDerivs(double pcoords[3], double *derivs)
+{
+  (void)pcoords;
+  (void)derivs;
+}
+
+//----------------------------------------------------------------------------
 void vtkTriangleStrip::PrintSelf(ostream& os, vtkIndent indent)
 {
   this->Superclass::PrintSelf(os,indent);
diff --git a/Common/DataModel/vtkTriangleStrip.h b/Common/DataModel/vtkTriangleStrip.h
index 92cce97..e37e43e 100644
--- a/Common/DataModel/vtkTriangleStrip.h
+++ b/Common/DataModel/vtkTriangleStrip.h
@@ -79,6 +79,12 @@ public:
   // polygons. The polygons are appended to the end of the list of triangles.
   static void DecomposeStrip(int npts, vtkIdType *pts, vtkCellArray *tris);
 
+  // Description:
+  // Compute the interpolation functions/derivatives
+  // (aka shape functions/derivatives)
+  virtual void InterpolateFunctions(double pcoords[3], double *weights);
+  virtual void InterpolateDerivs(double pcoords[3], double *derivs);
+
 protected:
   vtkTriangleStrip();
   ~vtkTriangleStrip();
diff --git a/Common/DataModel/vtkUniformGrid.cxx b/Common/DataModel/vtkUniformGrid.cxx
index 0ee26f3..2f890a3 100644
--- a/Common/DataModel/vtkUniformGrid.cxx
+++ b/Common/DataModel/vtkUniformGrid.cxx
@@ -23,29 +23,38 @@
 #include "vtkInformation.h"
 #include "vtkInformationVector.h"
 #include "vtkLine.h"
+#include "vtkMath.h"
 #include "vtkObjectFactory.h"
 #include "vtkPixel.h"
 #include "vtkPointData.h"
 #include "vtkPoints.h"
+#include "vtkStructuredVisibilityConstraint.h"
 #include "vtkStructuredData.h"
-#include "vtkUnsignedCharArray.h"
 #include "vtkVertex.h"
 #include "vtkVoxel.h"
+#include "vtkIntArray.h"
 
 vtkStandardNewMacro(vtkUniformGrid);
 
-unsigned char vtkUniformGrid::MASKED_CELL_VALUE =
-  vtkDataSetAttributes::HIDDENCELL | vtkDataSetAttributes::REFINEDCELL;
+vtkCxxSetObjectMacro(vtkUniformGrid, PointVisibility,
+                     vtkStructuredVisibilityConstraint);
+vtkCxxSetObjectMacro(vtkUniformGrid, CellVisibility,
+                     vtkStructuredVisibilityConstraint);
 
 //----------------------------------------------------------------------------
 vtkUniformGrid::vtkUniformGrid()
 {
-  this->EmptyCell = NULL;
+  this->PointVisibility = vtkStructuredVisibilityConstraint::New();
+  this->CellVisibility = vtkStructuredVisibilityConstraint::New();
+
+  this->EmptyCell = 0;
 }
 
 //----------------------------------------------------------------------------
 vtkUniformGrid::~vtkUniformGrid()
 {
+  this->PointVisibility->Delete();
+  this->CellVisibility->Delete();
   if (this->EmptyCell)
     {
     this->EmptyCell->Delete();
@@ -56,6 +65,12 @@ vtkUniformGrid::~vtkUniformGrid()
 void vtkUniformGrid::Initialize()
 {
   this->Superclass::Initialize();
+
+  this->PointVisibility->Delete();
+  this->PointVisibility = vtkStructuredVisibilityConstraint::New();
+
+  this->CellVisibility->Delete();
+  this->CellVisibility = vtkStructuredVisibilityConstraint::New();
 }
 
 //-----------------------------------------------------------------------------
@@ -104,10 +119,10 @@ int vtkUniformGrid::Initialize(
   vtkUnsignedCharArray *ghosts=vtkUnsignedCharArray::New();
   this->GetCellData()->AddArray(ghosts);
   ghosts->Delete();
-  ghosts->SetName(vtkDataSetAttributes::GhostArrayName());
+  ghosts->SetName("vtkGhostLevels");
   ghosts->SetNumberOfComponents(1);
   ghosts->SetNumberOfTuples(nCells[0]*nCells[1]*nCells[2]);
-  ghosts->FillComponent(0,0);
+  ghosts->FillComponent(0,'\0');
   // If there are ghost cells mark them.
   if (nGhostsI || nGhostsJ || nGhostsK)
     {
@@ -177,18 +192,14 @@ void vtkUniformGrid::CopyStructure(vtkDataSet *ds)
 
   this->Superclass::CopyStructure(ds);
 
-  if(ds->HasAnyBlankPoints())
+  vtkUniformGrid *sPts = vtkUniformGrid::SafeDownCast(ds);
+  if (!sPts)
     {
-    // there is blanking
-    this->GetPointData()->AddArray(ds->GetPointGhostArray());
-    this->PointGhostArray = NULL;
-    }
-  if(ds->HasAnyBlankCells())
-    {
-    // we assume there is blanking
-    this->GetCellData()->AddArray(ds->GetCellGhostArray());
-    this->CellGhostArray = NULL;
+    return;
     }
+
+  this->PointVisibility->ShallowCopy(sPts->PointVisibility);
+  this->CellVisibility->ShallowCopy(sPts->CellVisibility);
 }
 
 //----------------------------------------------------------------------------
@@ -219,7 +230,9 @@ vtkCell *vtkUniformGrid::GetCell(vtkIdType cellId)
     }
 
   // see whether the cell is blanked
-  if (!this->IsCellVisible(cellId) )
+  if ( (this->PointVisibility->IsConstrained() ||
+        this->CellVisibility->IsConstrained())
+       && !this->IsCellVisible(cellId) )
     {
     return this->GetEmptyCell();
     }
@@ -341,7 +354,9 @@ void vtkUniformGrid::GetCell(vtkIdType cellId, vtkGenericCell *cell)
     }
 
   // see whether the cell is blanked
-  if (!this->IsCellVisible(cellId))
+  if ( (this->PointVisibility->IsConstrained() ||
+        this->CellVisibility->IsConstrained())
+       && !this->IsCellVisible(cellId) )
     {
     cell->SetCellTypeToEmptyCell();
     return;
@@ -469,8 +484,8 @@ vtkIdType vtkUniformGrid::FindCell(double x[3], vtkCell *vtkNotUsed(cell),
   vtkIdType cellId =  (loc[2]-extent[4]) * (dims[0]-1)*(dims[1]-1) +
     (loc[1]-extent[2]) * (dims[0]-1) + loc[0] - extent[0];
 
-  if ( (this->GetPointGhostArray() ||
-        this->GetCellGhostArray())
+  if ( (this->PointVisibility->IsConstrained() ||
+        this->CellVisibility->IsConstrained())
        && !this->IsCellVisible(cellId) )
     {
     return -1;
@@ -512,7 +527,9 @@ vtkCell *vtkUniformGrid::FindAndGetCell(double x[3],
   vtkIdType cellId = loc[2] * (dims[0]-1)*(dims[1]-1) +
     loc[1] * (dims[0]-1) + loc[0];
 
-  if (!this->IsCellVisible(cellId))
+  if ( (this->PointVisibility->IsConstrained() ||
+        this->CellVisibility->IsConstrained())
+       && !this->IsCellVisible(cellId) )
     {
     return NULL;
     }
@@ -615,7 +632,9 @@ vtkCell *vtkUniformGrid::FindAndGetCell(double x[3],
 int vtkUniformGrid::GetCellType(vtkIdType cellId)
 {
   // see whether the cell is blanked
-  if (!this->IsCellVisible(cellId) )
+  if ( (this->PointVisibility->IsConstrained() ||
+        this->CellVisibility->IsConstrained())
+       && !this->IsCellVisible(cellId) )
     {
     return VTK_EMPTY_CELL;
     }
@@ -671,6 +690,36 @@ vtkImageData* vtkUniformGrid::NewImageDataCopy()
 }
 
 //----------------------------------------------------------------------------
+void vtkUniformGrid::ShallowCopy(vtkDataObject *dataObject)
+{
+  vtkUniformGrid *ugData = vtkUniformGrid::SafeDownCast(dataObject);
+
+  if ( ugData )
+    {
+    this->PointVisibility->ShallowCopy(ugData->PointVisibility);
+    this->CellVisibility->ShallowCopy(ugData->CellVisibility);
+    }
+
+  // Do superclass
+  this->Superclass::ShallowCopy(dataObject);
+}
+
+//----------------------------------------------------------------------------
+void vtkUniformGrid::DeepCopy(vtkDataObject *dataObject)
+{
+  vtkUniformGrid *ugData = vtkUniformGrid::SafeDownCast(dataObject);
+
+  if ( ugData != NULL )
+    {
+    this->PointVisibility->DeepCopy(ugData->PointVisibility);
+    this->CellVisibility->DeepCopy(ugData->CellVisibility);
+    }
+  // Do superclass
+  this->Superclass::DeepCopy(dataObject);
+}
+
+
+//----------------------------------------------------------------------------
 // Override this method because of blanking
 void vtkUniformGrid::ComputeScalarRange()
 {
@@ -737,14 +786,9 @@ void vtkUniformGrid::ComputeScalarRange()
 // Turn off a particular data point.
 void vtkUniformGrid::BlankPoint(vtkIdType ptId)
 {
-  vtkUnsignedCharArray* ghosts = this->GetPointGhostArray();
-  if(!ghosts)
-    {
-    this->AllocatePointGhostArray();
-    ghosts = this->GetPointGhostArray();
-    }
-  ghosts->SetValue(ptId, ghosts->GetValue(ptId) | vtkDataSetAttributes::HIDDENPOINT);
-  assert(!this->IsPointVisible(ptId));
+  this->PointVisibility->Initialize(this->GetDimensions());
+  this->PointVisibility->Allocate();
+  this->PointVisibility->Blank(ptId);
 }
 
 //----------------------------------------------------------------------------
@@ -760,13 +804,9 @@ void vtkUniformGrid::BlankPoint( const int i, const int j, const int k )
 // Turn on a particular data point.
 void vtkUniformGrid::UnBlankPoint(vtkIdType ptId)
 {
-  vtkUnsignedCharArray* ghosts = this->GetPointGhostArray();
-  if(!ghosts)
-    {
-    return;
-    }
-  ghosts->SetValue(ptId, ghosts->GetValue(ptId) &
-                   ~vtkDataSetAttributes::HIDDENPOINT);
+  this->PointVisibility->Initialize(this->GetDimensions());
+  this->PointVisibility->Allocate();
+  this->PointVisibility->UnBlank(ptId);
 }
 
 //----------------------------------------------------------------------------
@@ -779,18 +819,28 @@ void vtkUniformGrid::UnBlankPoint( const int i, const int j, const int k )
 }
 
 //----------------------------------------------------------------------------
+void vtkUniformGrid::SetPointVisibilityArray(vtkUnsignedCharArray *ptVis)
+{
+  this->PointVisibility->SetVisibilityById(ptVis);
+}
+
+//----------------------------------------------------------------------------
+vtkUnsignedCharArray* vtkUniformGrid::GetPointVisibilityArray()
+{
+  this->PointVisibility->Initialize(this->GetDimensions());
+  this->PointVisibility->Allocate();
+  return this->PointVisibility->GetVisibilityById();
+}
+
+//----------------------------------------------------------------------------
 // Turn off a particular data cell.
 void vtkUniformGrid::BlankCell(vtkIdType cellId)
 {
-  vtkUnsignedCharArray* ghost = this->GetCellGhostArray();
-  if(!ghost)
-    {
-    this->AllocateCellGhostArray();
-    ghost = this->GetCellGhostArray();
-    }
-  ghost->SetValue(cellId, ghost->GetValue(cellId) |
-                  vtkDataSetAttributes::HIDDENCELL);
-  assert(!this->IsCellVisible(cellId));
+  int celldims[3];
+  this->GetCellDims( celldims );
+  this->CellVisibility->Initialize( celldims  );
+  this->CellVisibility->Allocate();
+  this->CellVisibility->Blank(cellId);
 }
 
 //----------------------------------------------------------------------------
@@ -808,14 +858,11 @@ void vtkUniformGrid::BlankCell( const int i, const int j, const int k )
 // Turn on a particular data cell.
 void vtkUniformGrid::UnBlankCell(vtkIdType cellId)
 {
-  vtkUnsignedCharArray* ghosts = this->GetCellGhostArray();
-  if(!ghosts)
-    {
-    return;
-    }
-  ghosts->SetValue(cellId, ghosts->GetValue(cellId) &
-                   ~vtkDataSetAttributes::HIDDENCELL);
-  assert(this->IsCellVisible(cellId));
+  int celldims[3];
+  this->GetCellDims( celldims );
+  this->CellVisibility->Initialize( celldims  );
+  this->CellVisibility->Allocate();
+  this->CellVisibility->UnBlank(cellId);
 }
 
 //----------------------------------------------------------------------------
@@ -830,30 +877,82 @@ void vtkUniformGrid::UnBlankCell( const int i, const int j, const int k )
 }
 
 //----------------------------------------------------------------------------
-unsigned char vtkUniformGrid::IsPointVisible(vtkIdType pointId)
+void vtkUniformGrid::AttachCellVisibilityToCellData( )
 {
-  if (this->GetPointGhostArray() &&
-      (this->GetPointGhostArray()->GetValue(pointId) &
-       vtkDataSetAttributes::HIDDENPOINT))
+  vtkIntArray *cellIblank = NULL;
+  cellIblank              = vtkIntArray::New( );
+  cellIblank->SetName( "CellIBLANK" );
+  cellIblank->SetNumberOfTuples( this->GetNumberOfCells() );
+  cellIblank->SetNumberOfComponents( 1 );
+
+  for( int i=0; i < this->GetNumberOfCells(); ++i )
     {
-    return 0;
+    if( this->IsCellVisible( i ) )
+      {
+      cellIblank->SetValue( i, 1 );
+      }
+    else
+      {
+      cellIblank->SetValue( i, 0 );
+      }
     }
-  return 1;
+  this->CellData->AddArray( cellIblank );
+  cellIblank->Delete();
 }
 
 //----------------------------------------------------------------------------
-// Return non-zero if the specified cell is visible (i.e., not blanked)
-unsigned char vtkUniformGrid::IsCellVisible(vtkIdType cellId)
+void vtkUniformGrid::AttachPointVisibilityToPointData( )
 {
+  vtkIntArray *pointIblank = NULL;
+  pointIblank              = vtkIntArray::New( );
+  pointIblank->SetName( "PointIBLANK" );
+  pointIblank->SetNumberOfTuples( this->GetNumberOfPoints()   );
+  pointIblank->SetNumberOfComponents( 1 );
 
-  if (this->GetCellGhostArray() &&
-      (this->GetCellGhostArray()->GetValue(cellId) & MASKED_CELL_VALUE))
+  for( int i=0; i < this->GetNumberOfPoints(); ++i )
     {
-    return 0;
+    if( this->IsPointVisible( i ) )
+      {
+      pointIblank->SetValue( i, 1 );
+      }
+    else
+      {
+      pointIblank->SetValue( i, 0 );
+      }
     }
-  if (! this->GetPointGhostArray())
+  this->PointData->AddArray( pointIblank );
+  pointIblank->Delete();
+}
+
+//----------------------------------------------------------------------------
+void vtkUniformGrid::SetCellVisibilityArray(vtkUnsignedCharArray *cellVis)
+{
+  this->CellVisibility->SetVisibilityById(cellVis);
+}
+
+//----------------------------------------------------------------------------
+vtkUnsignedCharArray* vtkUniformGrid::GetCellVisibilityArray()
+{
+  int celldims[3];
+  this->GetCellDims( celldims );
+  this->CellVisibility->Initialize( celldims  );
+  this->CellVisibility->Allocate();
+  return this->CellVisibility->GetVisibilityById();
+}
+
+//----------------------------------------------------------------------------
+unsigned char vtkUniformGrid::IsPointVisible(vtkIdType pointId)
+{
+  return this->PointVisibility->IsVisible(pointId);
+}
+
+//----------------------------------------------------------------------------
+// Return non-zero if the specified cell is visible (i.e., not blanked)
+unsigned char vtkUniformGrid::IsCellVisible(vtkIdType cellId)
+{
+  if ( !this->CellVisibility->IsVisible(cellId) )
     {
-    return (this->GetDataDescription() == VTK_EMPTY) ? 0 : 1;
+    return 0;
     }
 
   int iMin, iMax, jMin, jMax, kMin, kMax;
@@ -945,6 +1044,19 @@ unsigned char vtkUniformGrid::IsCellVisible(vtkIdType cellId)
 }
 
 //----------------------------------------------------------------------------
+unsigned char vtkUniformGrid::GetPointBlanking()
+{
+  return this->PointVisibility->IsConstrained();
+}
+
+//----------------------------------------------------------------------------
+unsigned char vtkUniformGrid::GetCellBlanking()
+{
+  return this->PointVisibility->IsConstrained() ||
+    this->CellVisibility->IsConstrained();
+}
+
+//----------------------------------------------------------------------------
 void vtkUniformGrid::GetCellDims( int cellDims[3] )
 {
   int nodeDims[3];
@@ -966,18 +1078,3 @@ vtkUniformGrid* vtkUniformGrid::GetData(vtkInformationVector* v, int i)
 {
   return vtkUniformGrid::GetData(v->GetInformationObject(i));
 }
-
-//----------------------------------------------------------------------------
-bool vtkUniformGrid::HasAnyBlankPoints()
-{
-  return IsAnyBitSet(
-    this->GetPointGhostArray(), vtkDataSetAttributes::HIDDENPOINT);
-}
-
-//----------------------------------------------------------------------------
-bool vtkUniformGrid::HasAnyBlankCells()
-{
-  int cellBlanking = IsAnyBitSet(this->GetCellGhostArray(),
-                                 vtkDataSetAttributes::HIDDENCELL);
-  return cellBlanking || this->HasAnyBlankPoints();
-}
diff --git a/Common/DataModel/vtkUniformGrid.h b/Common/DataModel/vtkUniformGrid.h
index ac6660b..ce8d336 100644
--- a/Common/DataModel/vtkUniformGrid.h
+++ b/Common/DataModel/vtkUniformGrid.h
@@ -107,6 +107,11 @@ public:
   //ETX
 
   // Description:
+  // Shallow and Deep copy.
+  virtual void ShallowCopy(vtkDataObject *src);
+  virtual void DeepCopy(vtkDataObject *src);
+
+  // Description:
   // Methods for supporting blanking of cells. Blanking turns on or off
   // points in the structured grid, and hence the cells connected to them.
   // These methods should be called only after the dimensions of the
@@ -127,13 +132,34 @@ public:
   virtual void UnBlankCell( const int i, const int j, const int k );
 
   // Description:
-  // Returns 1 if there is any visibility constraint on the cells,
-  // 0 otherwise.
-  virtual bool HasAnyBlankCells();
+  // Get the array that defines the blanking (visibility) of each point.
+  virtual vtkUnsignedCharArray *GetPointVisibilityArray();
+
   // Description:
-  // Returns 1 if there is any visibility constraint on the points,
-  // 0 otherwise.
-  virtual bool HasAnyBlankPoints();
+  // Set an array that defines the (blanking) visibility of the points
+  // in the grid. Make sure that length of the visibility array matches
+  // the number of points in the grid.
+  virtual void SetPointVisibilityArray(vtkUnsignedCharArray *pointVisibility);
+
+  // Description:
+  // Get the array that defines the blanking (visibility) of each cell.
+  virtual vtkUnsignedCharArray *GetCellVisibilityArray();
+
+  // Description:
+  // Set an array that defines the (blanking) visibility of the cells
+  // in the grid. Make sure that length of the visibility array matches
+  // the number of points in the grid.
+  virtual void SetCellVisibilityArray(vtkUnsignedCharArray *pointVisibility);
+
+  // Description:
+  // Attaches the CellVisibility array to the Cell data.
+  // Used primarily for debugging.
+  virtual void AttachCellVisibilityToCellData( );
+
+  // Description:
+  // Attaches the PointVisibility arry to the Point data.
+  // Used primarily for debugging.
+  virtual void AttachPointVisibilityToPointData( );
 
   // Description:
   // Return non-zero value if specified point is visible.
@@ -147,6 +173,16 @@ public:
   // grid are set.
   virtual unsigned char IsCellVisible(vtkIdType cellId);
 
+  // Description:
+  // Returns 1 if there is any visibility constraint on the points,
+  // 0 otherwise.
+  virtual unsigned char GetPointBlanking();
+
+  // Description:
+  // Returns 1 if there is any visibility constraint on the cells,
+  // 0 otherwise.
+  virtual unsigned char GetCellBlanking();
+
   virtual vtkImageData* NewImageDataCopy();
 
   //BTX
@@ -168,6 +204,16 @@ protected:
   // Override this method because of blanking.
   virtual void ComputeScalarRange();
 
+  vtkStructuredVisibilityConstraint* PointVisibility;
+
+  void SetPointVisibility(vtkStructuredVisibilityConstraint *pointVisibility);
+  vtkGetObjectMacro(PointVisibility, vtkStructuredVisibilityConstraint);
+
+  vtkStructuredVisibilityConstraint* CellVisibility;
+
+  void SetCellVisibility(vtkStructuredVisibilityConstraint *cellVisibility);
+  vtkGetObjectMacro(CellVisibility, vtkStructuredVisibilityConstraint);
+
   vtkEmptyCell* GetEmptyCell();
 
 private:
@@ -175,8 +221,6 @@ private:
   void operator=(const vtkUniformGrid&);  // Not implemented.
 
   vtkEmptyCell *EmptyCell;
-
-  static unsigned char MASKED_CELL_VALUE;
 };
 
 
diff --git a/Common/DataModel/vtkUniformGridAMR.cxx b/Common/DataModel/vtkUniformGridAMR.cxx
index 81415b6..cf854ef 100644
--- a/Common/DataModel/vtkUniformGridAMR.cxx
+++ b/Common/DataModel/vtkUniformGridAMR.cxx
@@ -153,15 +153,7 @@ void vtkUniformGridAMR::SetDataSet(
     return;
     }
 
-  if(this->AMRInfo->GetGridDescription() < 0)
-    {
-    this->AMRInfo->SetGridDescription(grid->GetGridDescription());
-    }
-  else if (grid->GetGridDescription() != this->AMRInfo->GetGridDescription())
-    {
-    vtkErrorMacro("Inconsistent types of vtkUniformGrid");
-    return;
-    }
+  this->AMRInfo->SetGridDescription(grid->GetGridDescription());
   int index = this->AMRInfo->GetIndex(level,idx);
   this->AMRData->Insert(index, grid);
 
diff --git a/Common/DataModel/vtkUnstructuredGrid.cxx b/Common/DataModel/vtkUnstructuredGrid.cxx
index e20286b..2cf07d3 100644
--- a/Common/DataModel/vtkUnstructuredGrid.cxx
+++ b/Common/DataModel/vtkUnstructuredGrid.cxx
@@ -1877,11 +1877,11 @@ void vtkUnstructuredGrid::GetIdsOfCellsOfType(int type, vtkIdTypeArray *array)
 
 
 //----------------------------------------------------------------------------
-void vtkUnstructuredGrid::RemoveGhostCells()
+void vtkUnstructuredGrid::RemoveGhostCells(int level)
 {
   vtkUnstructuredGrid* newGrid = vtkUnstructuredGrid::New();
-  vtkUnsignedCharArray* temp;
-  unsigned char* cellGhosts;
+  vtkDataArray* temp;
+  unsigned char* cellGhostLevels;
 
   vtkIdType cellId, newCellId;
   vtkIdList *cellPts, *pointMap;
@@ -1897,25 +1897,26 @@ void vtkUnstructuredGrid::RemoveGhostCells()
   vtkCellData*    outCD = newGrid->GetCellData();
 
 
-  // Get a pointer to the cell ghost array.
-  temp = this->GetCellGhostArray();
+  // Get a pointer to the cell ghost level array.
+  temp = this->CellData->GetArray("vtkGhostLevels");
   if (temp == NULL)
     {
-    vtkDebugMacro("Could not find cell ghost array.");
+    vtkDebugMacro("Could not find cell ghost level array.");
     newGrid->Delete();
     return;
     }
-  if ((temp->GetNumberOfComponents() != 1)
-      || (temp->GetNumberOfTuples() < this->GetNumberOfCells()))
+  if ( (temp->GetDataType() != VTK_UNSIGNED_CHAR)
+       || (temp->GetNumberOfComponents() != 1)
+       || (temp->GetNumberOfTuples() < this->GetNumberOfCells()))
     {
-    vtkErrorMacro("Poorly formed ghost array.");
+    vtkErrorMacro("Poorly formed ghost level array.");
     newGrid->Delete();
     return;
     }
-  cellGhosts = temp->GetPointer(0);
+  cellGhostLevels =(static_cast<vtkUnsignedCharArray*>(temp))->GetPointer(0);
 
 
-  // Now threshold based on the cell ghost array.
+  // Now threshold based on the cell ghost level array.
   outPD->CopyAllocate(pd);
   outCD->CopyAllocate(cd);
 
@@ -1941,7 +1942,7 @@ void vtkUnstructuredGrid::RemoveGhostCells()
     cellPts = cell->GetPointIds();
     numCellPts = cell->GetNumberOfPoints();
 
-    if ( (cellGhosts[cellId] & vtkDataSetAttributes::DUPLICATECELL) == 0 ) // Keep the cell.
+    if ( cellGhostLevels[cellId] < level ) // Keep the cell.
       {
       for (i=0; i < numCellPts; i++)
         {
@@ -2090,3 +2091,11 @@ vtkUnstructuredGrid* vtkUnstructuredGrid::GetData(vtkInformationVector* v,
 {
   return vtkUnstructuredGrid::GetData(v->GetInformationObject(i));
 }
+
+//----------------------------------------------------------------------------
+#ifndef VTK_LEGACY_REMOVE
+void vtkUnstructuredGrid::GetCellNeighbors(vtkIdType cellId, vtkIdList& ptIds, vtkIdList& cellIds)
+{
+  this->GetCellNeighbors(cellId, &ptIds, &cellIds);
+}
+#endif
diff --git a/Common/DataModel/vtkUnstructuredGrid.h b/Common/DataModel/vtkUnstructuredGrid.h
index 245cb91..3f97723 100644
--- a/Common/DataModel/vtkUnstructuredGrid.h
+++ b/Common/DataModel/vtkUnstructuredGrid.h
@@ -204,7 +204,7 @@ public:
   virtual int GetGhostLevel();
 
   // Description:
-  // Return the actual size of the data in kibibytes (1024 bytes). This number
+  // Return the actual size of the data in kilobytes. This number
   // is valid only after the pipeline has updated. The memory size
   // returned is guaranteed to be greater than or equal to the
   // memory required to represent the data (e.g., extra space in
@@ -228,9 +228,9 @@ public:
   int IsHomogeneous();
 
   // Description:
-  // This method will remove any cell that is marked as ghost
-  // (has the vtkDataSetAttributes::DUPLICATECELL bit set).
-  void RemoveGhostCells();
+  // This method will remove any cell that has a ghost level array value
+  // greater or equal to level.
+  void RemoveGhostCells(int level);
 
   //BTX
   // Description:
@@ -375,6 +375,10 @@ private:
   void operator=(const vtkUnstructuredGrid&);  // Not implemented.
 
   void Cleanup();
+
+  // Description:
+  // For legacy compatibility. Do not use.
+  VTK_LEGACY(void GetCellNeighbors(vtkIdType cellId, vtkIdList& ptIds, vtkIdList& cellIds));
 };
 
 #endif
diff --git a/Common/DataModel/vtkUnstructuredGridCellIterator.cxx b/Common/DataModel/vtkUnstructuredGridCellIterator.cxx
index a409a99..025bd7f 100644
--- a/Common/DataModel/vtkUnstructuredGridCellIterator.cxx
+++ b/Common/DataModel/vtkUnstructuredGridCellIterator.cxx
@@ -116,11 +116,11 @@ void vtkUnstructuredGridCellIterator::CatchUpSkippedCells()
         this->SkippedCells--;
         }
       assert(this->SkippedCells == 1);
-      VTK_FALLTHROUGH;
+      // Fall through to first case
     case 1:
       this->ConnectivityPtr += *this->ConnectivityPtr + 1;
       --this->SkippedCells;
-      VTK_FALLTHROUGH;
+      // fall through to 0 case
     case 0:
       // do nothing.
       break;
diff --git a/Common/DataModel/vtkVector.h b/Common/DataModel/vtkVector.h
index 9d238fc..f536060 100644
--- a/Common/DataModel/vtkVector.h
+++ b/Common/DataModel/vtkVector.h
@@ -168,6 +168,14 @@ public:
   // Description:
   // Get the y component of the vector, i.e. element 1.
   const T& GetY() const { return this->Data[1]; }
+
+  // Description:
+  // Legacy method for getting the x component.
+  VTK_LEGACY(const T& X() const);
+
+  // Description:
+  // Legacy method for getting the y component.
+  VTK_LEGACY(const T& Y() const);
 };
 
 // .NAME vtkVector3 - templated base type for storage of 3D vectors.
@@ -238,6 +246,18 @@ public:
     res[2] = this->Data[0] * other.Data[1] - this->Data[1] * other.Data[0];
     return res;
   }
+
+  // Description:
+  // Legacy method for getting the x component.
+  VTK_LEGACY(const T& X() const);
+
+  // Description:
+  // Legacy method for getting the y component.
+  VTK_LEGACY(const T& Y() const);
+
+  // Description:
+  // Legacy method for getting the z component.
+  VTK_LEGACY(const T& Z() const);
 };
 
 // Description:
@@ -322,5 +342,42 @@ public:
   vtkVector3Cross(vtkVector3d, double)
 };
 
+#ifndef VTK_LEGACY_REMOVE
+template<typename T>
+const T& vtkVector2<T>::X() const
+{
+  VTK_LEGACY_REPLACED_BODY(vtkVector2::X, "VTK 6.0", vtkVector2::GetX);
+  return this->GetX();
+}
+
+template<typename T>
+const T& vtkVector2<T>::Y() const
+{
+  VTK_LEGACY_REPLACED_BODY(vtkVector2::Y, "VTK 6.0", vtkVector2::GetY);
+  return this->GetY();
+}
+
+template<typename T>
+const T& vtkVector3<T>::X() const
+{
+  VTK_LEGACY_REPLACED_BODY(vtkVector3::X, "VTK 6.0", vtkVector3::GetX);
+  return this->GetX();
+}
+
+template<typename T>
+const T& vtkVector3<T>::Y() const
+{
+  VTK_LEGACY_REPLACED_BODY(vtkVector3::Y, "VTK 6.0", vtkVector3::GetY);
+  return this->GetY();
+}
+
+template<typename T>
+const T& vtkVector3<T>::Z() const
+{
+  VTK_LEGACY_REPLACED_BODY(vtkVector3::Z, "VTK 6.0", vtkVector3::GetZ);
+  return this->GetZ();
+}
+#endif // VTK_LEGACY_REMOVE
+
 #endif // vtkVector_h
 // VTK-HeaderTest-Exclude: vtkVector.h
diff --git a/Common/DataModel/vtkVertex.cxx b/Common/DataModel/vtkVertex.cxx
index 886411e..a7cca28 100644
--- a/Common/DataModel/vtkVertex.cxx
+++ b/Common/DataModel/vtkVertex.cxx
@@ -64,7 +64,7 @@ int vtkVertex::EvaluatePosition(double x[3], double* closestPoint,
     }
   else
     {
-    pcoords[0] = -1.0;
+    pcoords[0] = -10.0;
     return 0;
     }
 }
@@ -177,7 +177,7 @@ int vtkVertex::IntersectWithLine(double p1[3], double p2[3], double tol, double&
       }
     }
 
-  pcoords[0] = -1.0;
+  pcoords[0] = -10.0;
   return 0;
 }
 
diff --git a/Common/DataModel/vtkVoxel.cxx b/Common/DataModel/vtkVoxel.cxx
index b6914cc..0e30353 100644
--- a/Common/DataModel/vtkVoxel.cxx
+++ b/Common/DataModel/vtkVoxel.cxx
@@ -298,7 +298,7 @@ static int faces[6][4] = { {2,0,6,4}, {1,3,5,7},
 //
 // Marching cubes case table
 //
-#include "vtkMarchingCubesTriangleCases.h"
+#include "vtkMarchingCubesCases.h"
 
 void vtkVoxel::Contour(double value, vtkDataArray *cellScalars,
                        vtkIncrementalPointLocator *locator,
diff --git a/Common/DataModel/vtkWedge.cxx b/Common/DataModel/vtkWedge.cxx
index c2bcfce..dac99e8 100644
--- a/Common/DataModel/vtkWedge.cxx
+++ b/Common/DataModel/vtkWedge.cxx
@@ -110,7 +110,6 @@ int vtkWedge::EvaluatePosition(double x[3], double* closestPoint,
     d=vtkMath::Determinant3x3(rcol,scol,tcol);
     if ( fabs(d) < 1.e-20)
       {
-      vtkDebugMacro (<<"Determinant incorrect, iteration " << iteration);
       return -1;
       }
 
diff --git a/Common/ExecutionModel/vtkCompositeDataPipeline.cxx b/Common/ExecutionModel/vtkCompositeDataPipeline.cxx
index 1d492a0..5783480 100644
--- a/Common/ExecutionModel/vtkCompositeDataPipeline.cxx
+++ b/Common/ExecutionModel/vtkCompositeDataPipeline.cxx
@@ -333,10 +333,6 @@ void vtkCompositeDataPipeline::ExecuteSimpleAlgorithm(
     {
     outInfo = outInfoVec->GetInformationObject(0);
     }
-  if (!outInfo)
-    {
-    return;
-    }
 
   // Make sure a valid composite data object exists for all output ports.
   for(int i=0; i < this->Algorithm->GetNumberOfOutputPorts(); ++i)
@@ -587,7 +583,7 @@ int vtkCompositeDataPipeline::NeedToExecuteData(
     }
   int dataGhostLevel = dataInfo->Get(vtkDataObject::DATA_NUMBER_OF_GHOST_LEVELS());
   int updateGhostLevel = outInfo->Get(UPDATE_NUMBER_OF_GHOST_LEVELS());
-  if(updateNumberOfPieces > 1 && dataGhostLevel < updateGhostLevel)
+  if(dataGhostLevel < updateGhostLevel)
     {
     return 1;
     }
@@ -1041,6 +1037,15 @@ void vtkCompositeDataPipeline::MarkOutputsGenerated(
 {
   this->Superclass::MarkOutputsGenerated(request,inInfoVec,outInfoVec);
 
+  // Save the information about COMPOSITE_INDICES() as needed in the data
+  // object.
+  int outputPort = 0;
+  if(request->Has(FROM_OUTPUT_PORT()))
+    {
+    outputPort = request->Get(FROM_OUTPUT_PORT());
+    outputPort = (outputPort >= 0 ? outputPort : 0);
+    }
+
   for (int i=0; i < outInfoVec->GetNumberOfInformationObjects(); ++i)
     {
     vtkInformation* outInfo = outInfoVec->GetInformationObject(i);
diff --git a/Common/ExecutionModel/vtkStreamingDemandDrivenPipeline.cxx b/Common/ExecutionModel/vtkStreamingDemandDrivenPipeline.cxx
index 8f96c9d..246dcfe 100644
--- a/Common/ExecutionModel/vtkStreamingDemandDrivenPipeline.cxx
+++ b/Common/ExecutionModel/vtkStreamingDemandDrivenPipeline.cxx
@@ -976,7 +976,7 @@ vtkStreamingDemandDrivenPipeline
                                         vtkExtentTranslator::BLOCK_MODE, 0);
             et->Delete();
 
-            data->GenerateGhostArray(zeroExt);
+            data->GenerateGhostLevelArray(zeroExt);
             }
           }
         }
@@ -1060,22 +1060,7 @@ vtkStreamingDemandDrivenPipeline
         {
         dataInfo->Set(vtkDataObject::DATA_PIECE_NUMBER(), piece);
         dataInfo->Set(vtkDataObject::DATA_NUMBER_OF_PIECES(), numPieces);
-        // If the source or filter produced a different number of ghost
-        // levels, honor it.
-        int dataGhostLevel = 0;
-        if (dataInfo->Has(vtkDataObject::DATA_NUMBER_OF_GHOST_LEVELS()))
-          {
-          dataGhostLevel =
-            dataInfo->Get(vtkDataObject::DATA_NUMBER_OF_GHOST_LEVELS());
-          }
-        // If the ghost level generated by the algorithm is larger than
-        // requested, we keep it. Otherwise, we store the requested one.
-        // We do this because there is no point in the algorithm re-executing
-        // if the downstream asks for the same level even though the
-        // algorithm cannot produce it.
-        dataInfo->Set(
-          vtkDataObject::DATA_NUMBER_OF_GHOST_LEVELS(),
-          ghostLevel > dataGhostLevel ? ghostLevel : dataGhostLevel);
+        dataInfo->Set(vtkDataObject::DATA_NUMBER_OF_GHOST_LEVELS(), ghostLevel);
         }
 
       // In this block, we make sure that DATA_TIME_STEP() is set if:
diff --git a/Common/ExecutionModel/vtkThreadedImageAlgorithm.cxx b/Common/ExecutionModel/vtkThreadedImageAlgorithm.cxx
index c794f18..0b4d23d 100644
--- a/Common/ExecutionModel/vtkThreadedImageAlgorithm.cxx
+++ b/Common/ExecutionModel/vtkThreadedImageAlgorithm.cxx
@@ -289,8 +289,8 @@ int vtkThreadedImageAlgorithm::RequestData(
   this->Threader->SetSingleMethod(vtkThreadedImageAlgorithmThreadedExecute, &str);
 
   // always shut off debugging to avoid threading problems with GetMacros
-  bool debug = this->Debug;
-  this->Debug = false;
+  int debug = this->Debug;
+  this->Debug = 0;
   this->Threader->SingleMethodExecute();
   this->Debug = debug;
 
diff --git a/Common/ExecutionModel/vtkTrivialProducer.cxx b/Common/ExecutionModel/vtkTrivialProducer.cxx
index 9203987..9b51877 100644
--- a/Common/ExecutionModel/vtkTrivialProducer.cxx
+++ b/Common/ExecutionModel/vtkTrivialProducer.cxx
@@ -124,8 +124,23 @@ void vtkTrivialProducer::FillOutputDataInformation(vtkDataObject* output,
                  extent, 6);
     }
 
-  // Let the data object copy information to the pipeline
-  output->CopyInformationToPipeline(outInfo);
+  if (output->IsA("vtkImageData"))
+    {
+    vtkImageData* img = static_cast<vtkImageData*>(output);
+
+    double spacing[3];
+    img->GetSpacing(spacing);
+    outInfo->Set(vtkDataObject::SPACING(), spacing[0], spacing[1], spacing[2]);
+
+    double origin[3];
+    img->GetOrigin(origin);
+    outInfo->Set(vtkDataObject::ORIGIN(), origin[0], origin[1], origin[2]);
+
+    vtkDataObject::SetPointDataActiveScalarInfo(outInfo,
+                                                img->GetScalarType(),
+                                                img->GetNumberOfScalarComponents());
+
+    }
 }
 
 //----------------------------------------------------------------------------
diff --git a/Common/ExecutionModel/vtkUniformGridPartitioner.cxx b/Common/ExecutionModel/vtkUniformGridPartitioner.cxx
index 5426ca1..28823df 100644
--- a/Common/ExecutionModel/vtkUniformGridPartitioner.cxx
+++ b/Common/ExecutionModel/vtkUniformGridPartitioner.cxx
@@ -136,7 +136,7 @@ int vtkUniformGridPartitioner::RequestData(
     int subdims[3];
     vtkStructuredExtent::GetDimensions( ext, subdims );
 
-    vtkIdType pntIdx = vtkStructuredData::ComputePointId( dims, ijk );
+    int pntIdx = vtkStructuredData::ComputePointId( dims, ijk );
 
     grd->GetPoint( pntIdx, origin );
 
diff --git a/Common/Math/CMakeLists.txt b/Common/Math/CMakeLists.txt
index 14cd45d..6ff77e9 100644
--- a/Common/Math/CMakeLists.txt
+++ b/Common/Math/CMakeLists.txt
@@ -15,6 +15,12 @@ set(Module_SRCS
   vtkTuple.h
   )
 
+if(NOT VTK_LEGACY_REMOVE)
+  list(APPEND Module_SRCS
+    vtkFastNumericConversion.cxx
+    )
+endif()
+
 set_source_files_properties(
   vtkQuaternion
   vtkTuple
diff --git a/Common/Math/Testing/Cxx/CMakeLists.txt b/Common/Math/Testing/Cxx/CMakeLists.txt
index f266b96..6ce585f 100644
--- a/Common/Math/Testing/Cxx/CMakeLists.txt
+++ b/Common/Math/Testing/Cxx/CMakeLists.txt
@@ -5,4 +5,12 @@ vtk_add_test_cxx(${vtk-module}CxxTests tests
   TestPolynomialSolversUnivariate.cxx
   TestQuaternion.cxx
   )
+if(NOT VTK_LEGACY_REMOVE)
+  vtk_add_test_cxx(${vtk-module}CxxTests extra_tests
+    NO_DATA NO_VALID NO_OUTPUT
+    TestFastNumericConversion.cxx
+    )
+  list(APPEND tests
+    ${extra_tests})
+endif()
 vtk_test_cxx_executable(${vtk-module}CxxTests tests)
diff --git a/Common/Math/Testing/Cxx/TestFastNumericConversion.cxx b/Common/Math/Testing/Cxx/TestFastNumericConversion.cxx
new file mode 100644
index 0000000..112109c
--- /dev/null
+++ b/Common/Math/Testing/Cxx/TestFastNumericConversion.cxx
@@ -0,0 +1,204 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+  Module:    TestFastNumericConversion.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.
+
+=========================================================================*/
+// .NAME Test of vtkFastNumericConversion.
+// .SECTION Description
+// Tests performance of the vtkFastNumericConversion methods.
+
+#include "vtkFastNumericConversion.h"
+#include "vtkMath.h"
+#include "vtkTimerLog.h"
+
+
+int TestFastNumericConversion(int,char *[])
+{
+  double bare_time;
+  double cast_time;
+  double mathfloor_time;
+  double mathround_time;
+  double convert_time;
+  double quickfloor_time;
+  double safefloor_time;
+  double round_time;
+
+  vtkFastNumericConversion* fnc = vtkFastNumericConversion::New();
+  const int inner_count = 10000;
+  const int outer_count = 10000;
+  double *dval = new double[inner_count];
+  int *ival = new int[inner_count];
+  int *frac = new int[inner_count];
+  union { int i; double d; } int_double_conv;
+
+  int i,o;
+  vtkTimerLog *timer = vtkTimerLog::New();
+
+  for (i=0; i<inner_count; i++)
+    {
+    dval[i] = i;
+    ival[i] = 0;
+    }
+
+  timer->StartTimer();
+  for (o=0; o<outer_count; o++)
+    {
+    for (i=0; i<inner_count; i++)
+      {
+      // Pure bit copy
+      int_double_conv.d = dval[i];
+      ival[i] = int_double_conv.i;
+      }
+    }
+  timer->StopTimer();
+  bare_time = timer->GetElapsedTime();
+
+
+  // Compute cast time
+  timer->StartTimer();
+  for (o=0; o<outer_count; o++)
+    {
+    for (i=0; i<inner_count; i++)
+      {
+      ival[i] = static_cast<int>(dval[i]);
+      }
+    }
+  timer->StopTimer();
+  cast_time = timer->GetElapsedTime();
+
+
+  // Compute vtkMath::Floor time
+  timer->StartTimer();
+  for (o=0; o<outer_count; o++)
+    {
+    for (i=0; i<inner_count; i++)
+      {
+      ival[i] = vtkMath::Floor(dval[i]);
+      }
+    }
+  timer->StopTimer();
+  mathfloor_time = timer->GetElapsedTime();
+
+
+  // Compute vtkMath::Round time
+  timer->StartTimer();
+  for (o=0; o<outer_count; o++)
+    {
+    for (i=0; i<inner_count; i++)
+      {
+      ival[i] = vtkMath::Round(dval[i]);
+      }
+    }
+  timer->StopTimer();
+  mathround_time = timer->GetElapsedTime();
+
+
+  // Compute convert time
+  timer->StartTimer();
+  for (o=0; o<outer_count; o++)
+    {
+    for (i=0; i<inner_count; i++)
+      {
+      ival[i] =fnc->ConvertFixedPoint(dval[i], frac[i]);
+      }
+    }
+  timer->StopTimer();
+  convert_time = timer->GetElapsedTime();
+
+  // Compute quickfloor time
+  timer->StartTimer();
+  for (o=0; o<outer_count; o++)
+    {
+    for (i=0; i<inner_count; i++)
+      {
+      ival[i] = vtkFastNumericConversion::QuickFloor(dval[i]);
+      }
+    }
+  timer->StopTimer();
+  quickfloor_time = timer->GetElapsedTime();
+
+  // Compute safefloor time
+  timer->StartTimer();
+  for (o=0; o<outer_count; o++)
+    {
+    for (i=0; i<inner_count; i++)
+      {
+      ival[i] = vtkFastNumericConversion::SafeFloor(dval[i]);
+      }
+    }
+  timer->StopTimer();
+  safefloor_time = timer->GetElapsedTime();
+
+  // Compute round time
+  timer->StartTimer();
+  for (o=0; o<outer_count; o++)
+    {
+    for (i=0; i<inner_count; i++)
+      {
+      ival[i] = vtkFastNumericConversion::Round(dval[i]);
+      }
+    }
+  timer->StopTimer();
+  round_time = timer->GetElapsedTime();
+
+  delete [] dval;
+  delete [] ival;
+  delete [] frac;
+
+  timer->Delete();
+  fnc->Delete();
+
+  cout << "Bare time from last PerformanceTest() call: " << bare_time << endl;
+  cout << "Cast time from last PerformanceTest() call: " << cast_time << endl;
+  cout << "vtkMath::Floor time from last PerformanceTest() call: " << mathfloor_time << endl;
+  cout << "vtkMath::Round time from last PerformanceTest() call: " << mathround_time << endl;
+  cout << "ConvertFixedPoint time from last PerformanceTest() call: " << convert_time << endl;
+  cout << "QuickFloor time from last PerformanceTest() call: " << quickfloor_time << endl;
+  cout << "SafeFloor time from last PerformanceTest() call: " << safefloor_time << endl;
+  cout << "Round time from last PerformanceTest() call: " << round_time << endl;
+
+  if (bare_time != 0.0)
+    {
+    // Don't do this if we haven't run the tests yet.
+    if (quickfloor_time-bare_time > 0.0)
+      {
+      cout << "Speedup ratio from cast to quickfloor is: " <<
+        (cast_time-bare_time)/(quickfloor_time-bare_time) << endl;
+      }
+    else
+      {
+      cout << "quickfloor_time <= bare_time, cannot calculate speedup ratio" << endl;
+      }
+
+    if (safefloor_time-bare_time > 0.0)
+      {
+      cout << "Speedup ratio from cast to safefloor is: " <<
+        (cast_time-bare_time)/(safefloor_time-bare_time) << endl;
+      }
+    else
+      {
+      cout <<"safefloor_time <= bare_time, cannot calculate speedup ratio" << endl;
+      }
+
+    if (round_time-bare_time > 0.0)
+      {
+      cout << "Speedup ratio from cast to round is: " <<
+        (cast_time-bare_time)/(round_time-bare_time) << endl;
+      }
+    else
+      {
+      cout << "round_time <= bare_time, cannot calculate speedup ratio" << endl;
+      }
+    }
+
+  return 0;
+}
diff --git a/Common/Math/Testing/Cxx/TestQuaternion.cxx b/Common/Math/Testing/Cxx/TestQuaternion.cxx
index 360a6c4..718619d 100644
--- a/Common/Math/Testing/Cxx/TestQuaternion.cxx
+++ b/Common/Math/Testing/Cxx/TestQuaternion.cxx
@@ -122,7 +122,7 @@ int TestQuaternionSetGet() //use of vtkQuaternionf for this test
     }
 
   //To and from float[4]
-  float setArray[4] = {1.0f, -38.0f, 42.0f, 0.0001f};
+  float setArray[4] = {1.0, -38.0, 42.0, 0.0001};
   qf.Set(setArray);
   if (!qf.Compare( vtkQuaternionf(1.0, -38.0, 42.0, 0.0001), 0.0001))
     {
diff --git a/Common/Math/vtkFastNumericConversion.cxx b/Common/Math/vtkFastNumericConversion.cxx
new file mode 100644
index 0000000..17d5bb2
--- /dev/null
+++ b/Common/Math/vtkFastNumericConversion.cxx
@@ -0,0 +1,119 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+  Module:    vtkFastNumericConversion.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.
+
+=========================================================================*/
+// .NAME vtkFastNumericConversion - Enables fast conversion of floating point to fixed point
+// .SECTION Description
+// vtkFastNumericConversion uses a portable (assuming IEEE format) method for converting single and
+// double precision floating point values to a fixed point representation. This allows fast
+// integer flooring on platforms, such as Intel X86, in which CPU floating point flooring
+// algorithms are very slow. It is based on the techniques described in Chris Hecker's article,
+// "Let's Get to the (Floating) Point", in Game Developer Magazine, Feb/Mar 1996, and the
+// techniques described in Michael Herf's website, http://www.stereopsis.com/FPU.html.
+// The Hecker article can be found at http://www.d6.com/users/checker/pdfs/gdmfp.pdf.
+// Unfortunately, each of these techniques is incomplete, and doesn't floor properly,
+// in a way that depends on how many bits are reserved for fixed point fractional use, due to
+// failing to properly account for the default round-towards-even rounding mode of the X86. Thus,
+// my implementation incorporates some rounding correction that undoes the rounding that the
+// FPU performs during denormalization of the floating point value. Note that
+// the rounding affect I'm talking about here is not the effect on the fistp instruction,
+// but rather the effect that occurs during the denormalization of a value that occurs when
+// adding it to a much larger value. The bits must be shifted to the right, and when a "1" bit
+// falls off the edge, the rounding mode determines what happens next, in order
+// to avoid completely "losing" the 1-bit. Furthermore, my implementation works on Linux, where the
+// default precision mode is 64-bit extended precision.
+
+// This class is contributed to VTK by Chris Volpe of Applied Research Associates, Inc.
+// (My employer requires me to say that -- CRV)
+
+
+#include "vtkFastNumericConversion.h"
+#include "vtkObjectFactory.h"
+
+#include "vtkMath.h"
+
+vtkStandardNewMacro(vtkFastNumericConversion);
+
+vtkFastNumericConversion::vtkFastNumericConversion()
+{
+#ifdef VTK_TEST_HACK_TO_EMULATE_LINUX_UNDER_WINDOWS
+  _controlfp( _PC_64, MCW_PC );
+#endif
+
+  this->fixRound = 0;
+  this->internalReservedFracBits = 0;
+  this->fracMask = 0;
+  this->fpDenormalizer = 0;
+
+#ifndef VTK_LEGACY_SILENT
+  vtkWarningMacro("Class vtkFastNumericConversion was depecated for VTK 6.0 "
+                  "and will be removed in a future version.");
+#endif
+}
+
+#ifndef VTK_LEGACY_SILENT
+int vtkFastNumericConversion::QuickFloor(const double &val)
+{
+  static int once = 0;
+  if (!once)
+    {
+    VTK_LEGACY_REPLACED_BODY(vtkFastNumericConversion::QuickFloor, "VTK 6.0",
+                             vtkMath::Floor);
+    once = 1;
+    }
+  return vtkFastNumericConversion::QuickFloorInline(val);
+}
+
+int vtkFastNumericConversion::SafeFloor(const double &val)
+{
+  static int once = 0;
+  if (!once)
+    {
+    VTK_LEGACY_REPLACED_BODY(vtkFastNumericConversion::SafeFloor, "VTK 6.0",
+                             vtkMath::Floor);
+    once = 1;
+    }
+  return vtkFastNumericConversion::SafeFloorInline(val);
+}
+
+int vtkFastNumericConversion::Round(const double &val)
+{
+  static int once = 0;
+  if (!once)
+    {
+    VTK_LEGACY_REPLACED_BODY(vtkFastNumericConversion::Round, "VTK 6.0",
+                             vtkMath::Round);
+    once = 1;
+    }
+  return vtkFastNumericConversion::RoundInline(val);
+}
+#endif
+
+void vtkFastNumericConversion::InternalRebuild()
+{
+  int i;
+  this->fixRound=.5;
+  for (i=this->internalReservedFracBits; i; i--)
+    {
+    this->fixRound *= .5;
+    }
+  this->fracMask = (1<<this->internalReservedFracBits)-1;
+  this->fpDenormalizer = (static_cast<unsigned long>(1) << (52-30-this->internalReservedFracBits)) *
+    this->two30() * this->BorrowBit();
+  this->epTempDenormalizer = this->fpDenormalizer * (static_cast<unsigned long>(1) << (63-52));
+}
+
+void vtkFastNumericConversion::PrintSelf(ostream &os, vtkIndent indent)
+{
+  os << indent << "ReservedFracBits: " << this->internalReservedFracBits << endl;
+}
diff --git a/Common/Math/vtkFastNumericConversion.h b/Common/Math/vtkFastNumericConversion.h
new file mode 100644
index 0000000..ba871a8
--- /dev/null
+++ b/Common/Math/vtkFastNumericConversion.h
@@ -0,0 +1,477 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+  Module:    vtkFastNumericConversion.h
+
+  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.
+
+=========================================================================*/
+// .NAME vtkFastNumericConversion - Enables fast conversion of floating point to fixed point
+// .SECTION Description
+// vtkFastNumericConversion uses a portable (assuming IEEE format) method for
+// converting single and double precision floating point values to a fixed
+// point representation. This allows fast integer floor operations on
+// platforms, such as Intel X86, in which CPU floating point conversion
+// algorithms are very slow. It is based on the techniques described in Chris
+// Hecker's article, "Let's Get to the (Floating) Point", in Game Developer
+// Magazine, Feb/Mar 1996, and the techniques described in Michael Herf's
+// website, http://www.stereopsis.com/FPU.html.  The Hecker article can be
+// found at http://www.d6.com/users/checker/pdfs/gdmfp.pdf.  Unfortunately,
+// each of these techniques is incomplete, and doesn't convert properly, in a
+// way that depends on how many bits are reserved for fixed point fractional
+// use, due to failing to properly account for the default round-towards-even
+// rounding mode of the X86. Thus, my implementation incorporates some
+// rounding correction that undoes the rounding that the FPU performs during
+// denormalization of the floating point value. Note that the rounding affect
+// I'm talking about here is not the effect on the fistp instruction, but
+// rather the effect that occurs during the denormalization of a value that
+// occurs when adding it to a much larger value. The bits must be shifted to
+// the right, and when a "1" bit falls off the edge, the rounding mode
+// determines what happens next, in order to avoid completely "losing" the
+// 1-bit. Furthermore, my implementation works on Linux, where the default
+// precision mode is 64-bit extended precision.
+
+// This class is contributed to VTK by Chris Volpe of Applied Research
+// Associates, Inc.  (My employer requires me to say that -- CRV)
+
+// This code assumes that the FPU is in round-to-nearest mode. It assumes, on
+// Linux, that the default extended precision mode is in effect, and it
+// assumes, on Windows, that the default double precision mode is in effect.
+
+#ifndef vtkFastNumericConversion_h
+#define vtkFastNumericConversion_h
+
+#include "vtkCommonMathModule.h" // For export macro
+#include "vtkObject.h"
+
+// Use the bit-representation trick only on X86, and only when producing
+// optimized code
+#if defined(NDEBUG) && (defined i386 || defined _M_IX86)
+#define VTK_USE_TRICK
+#endif
+
+// Linux puts the FPU in extended precision. Windows and FreeBSD keep it in
+// double precision.  If other operating systems for i386 (Solaris?) behave
+// like Linux, add them below.  Special care needs to be taken when dealing
+// with extended precision mode because even though we are eventually writing
+// out to a double-precision variable to capture the fixed-point or integer
+// results, the extra bits maintained in the internal computations disrupt
+// the bit-playing that we're doing here.
+#if defined(__linux__)
+#define VTK_EXT_PREC
+#endif
+
+//#define VTK_TEST_HACK_TO_EMULATE_LINUX_UNDER_WINDOWS
+#ifdef VTK_TEST_HACK_TO_EMULATE_LINUX_UNDER_WINDOWS
+#define VTK_EXT_PREC
+#endif
+
+
+class VTKCOMMONMATH_EXPORT vtkFastNumericConversion : public vtkObject
+{
+public:
+  static vtkFastNumericConversion *New();
+  vtkTypeMacro(vtkFastNumericConversion, vtkObject);
+  void PrintSelf(ostream& os, vtkIndent indent);
+
+  int TestQuickFloor(double val)
+    {
+    return vtkFastNumericConversion::QuickFloor(val);
+    }
+
+  int TestSafeFloor(double val)
+    {
+    return vtkFastNumericConversion::SafeFloor(val);
+    }
+
+  int TestRound(double val)
+    {
+    return vtkFastNumericConversion::Round(val);
+    }
+
+  int TestConvertFixedPointIntPart(double val)
+    {
+    int frac;
+    return ConvertFixedPoint(val, frac);
+    }
+
+  int TestConvertFixedPointFracPart(double val)
+    {
+    int frac;
+    ConvertFixedPoint(val, frac);
+    return frac;
+    }
+
+protected:
+  //BTX
+  // Description:
+  // Internal use: multiply the denormalizer value by 1.5 to ensure that it
+  // has a "1" bit, other than the implicit initial "1" bit, from which to
+  // borrow when adding (flooring) a negative number, so that we don't borrow
+  // from the implicit "1" bit, which would cause partial re-normalization,
+  // resulting in a shift of our integer bits.
+  static inline double BorrowBit() { return 1.5;};
+
+  // Description:
+  // Represent 2^30 as a double precision float. Use as a stepping
+  // stone for computing 2^52 as a double, since we can't represent 2^52 as an
+  // int before converting to double.
+  static inline double two30()
+    {
+      return static_cast<double>(static_cast<unsigned long>(1) << 30);
+    }
+
+  // Description:
+  // Represent 2^52 as a double precision float. This value is
+  // significant because doubles have 52 bits of precision in the mantissa
+  static inline double two52()
+    {
+      return (static_cast<unsigned long>(1) << (52-30)) * two30();
+    }
+
+  // Description:
+  // Represent 2^51 as a double precision float. This value is significant
+  // because doubles have 52 (explicit) bits of precision in the mantissa,
+  // but we're going to pretend we only have 51 to play with when using safe
+  // floor, since the default round-to-even on an X86 mucks with the LSB
+  // during the denormalizing shift.
+  static inline double two51()
+    {
+      return (static_cast<unsigned long>(1) << (51-30)) * two30();
+    }
+
+  // Description:
+  // Represent 2^63 as a double precision float. We need this value to shift
+  // unwanted fractional bits off the end of an extended precision value
+  static inline double two63()
+    {
+      return (static_cast<unsigned long>(1) << (63-60)) * two30() * two30();
+    }
+
+  // Description:
+  // Represent 2^62 as a double precision float. We need this value to shift
+  // unwanted fractional bits off the end of an extended precision value. Use
+  // when we're doing a SafeFloor.
+  static inline double two62()
+    {
+      return (static_cast<unsigned long>(1) << (62-60)) * two30() * two30();
+    }
+
+  // Define number of bits of precision for various data types.
+  // Note: INT_BITS is really 31, (rather than 32, since one of the bits is
+  // just used for the two's-complement sign), but we say 30 because we don't
+  // need to be able to handle 31-bit magnitudes correctly. I say that
+  // because this is used for the QuickFloor code, and the SafeFloor code
+  // retains an extra bit of fixed point precision which it shifts-out at the
+  // end, thus reducing the magnitude of integers that it can handle. That's
+  // an inherent limitation of using SafeFloor to prevent round-ups under any
+  // circumstances, and there's no need to make QuickFloor handle a wider
+  // range of numbers than SafeFloor.
+#define INT_BITS 30
+#define EXT_BITS 64
+#define DBL_BITS 53
+
+  // Description:
+  // Small amount to use as a rounding tie-breaker to prevent
+  // round-to-nearest-and-even mode from flooring-down odd numbered
+  // integers. But number to nudge by depends on number of bits mantissa in
+  // our floating point representation minus number of mantissa bits in the
+  // range of signed ints we need to handle. In order to ensure that
+  // flooring-down doesn't happen even for very large odd-integer values, the
+  // number of bits used to represent the tie-breaker (i.e. to the right of
+  // the binary-point), plus the number of bits needed to represent the
+  // integer (to the left of the binary point), can not exceeds the number of
+  // bits in the current precision mode. Thus, in selecting the tie-breaker
+  // value, we select the largest number of bits to the right of the binary
+  // point as possible while still maintaining that inequality. Thus, extended
+  // precision mode allows a larger number of bits to the right of the binary
+  // point.  This, in turn, implies a smaller value of the tie-breaker. And a
+  // smaller tie-breaker will impose a tighter window on the range of values
+  // that are erroneously rounded-up by a floor operation. Under double
+  // precision, a QuickFloor of 0.9999998 (six 9's and an 8) correctly yields
+  // 0. A value must be very close to 1.0, in fact, at least as close as
+  // 0.9999999 (seven 9's)in order for the tie-breaker to bump it up to 1.
+  // Under extended precision, an even smaller tie-breaker can be used. In
+  // this mode, a QuickFloor of 0.9999999999 (ten 9's) correctly yields 0. A
+  // QuickFloor of 0.99999999999 (eleven 9's) gets rounded up to 1. Since
+  // these spurious round-ups occur only when the given value is virtually
+  // indistinguishable from the next higher integer, the results should be
+  // acceptable in most situations where performance is of the essence.
+  // Make this public so that clients can account for the RoundingTieBreaker
+  // if necessary
+public:
+#ifdef VTK_EXT_PREC
+  // Compute (0.5 ^ (EXT_BITS-INT_BITS)) as a compile-time constant
+  static inline double RoundingTieBreaker()
+    {
+      return 1.0 / (two30() * (static_cast<unsigned long>(1) << (EXT_BITS - INT_BITS - 30)));
+    }
+#else
+  // Compute (0.5 ^ (DBL_BITS-INT_BITS)) as a compile-time constant
+  static inline double RoundingTieBreaker()
+    {
+      return 1.0 / (static_cast<unsigned long>(1) << (DBL_BITS - INT_BITS));
+    }
+#endif
+
+protected:
+  // Description:
+  // This is the magic floating point value which when added to any other
+  // floating point value, causes the rounded integer portion of that
+  // floating point value to appear in the least significant bits of the
+  // mantissa, which is what we want.
+  static inline double QuickFloorDenormalizer()
+    {return two52() * BorrowBit(); };
+
+  // Description:
+  // This is the magic floating point value which when added to any other
+  // floating point value, causes the rounded integer portion of that
+  // floating point value to appear in the NEXT TO least significant bits of
+  // the mantissa, which is what we want. This allows the CPU rounding mode
+  // to muck with the LSB which we can then discard in SafeFloor
+  static inline double SafeFloorDenormalizer()
+    { return two51() * BorrowBit(); };
+
+  // Description:
+  // This value is added to and then subtracted from an extended precision
+  // value in order to clear the fractional bits so that they do not
+  // adversely affect the final double-precision result.
+  static inline double QuickExtPrecTempDenormalizer()
+    {return two63() * BorrowBit(); };
+
+  // Description:
+  // Just like QuickExtPrecTempDenormalizer(), but preserves one extra bit of
+  // fixed point precision to guard against the CPU mucking with the LSB
+  static inline double SafeExtPrecTempDenormalizer()
+    {return two62() * BorrowBit(); };
+
+  static inline double QuickRoundAdjust() {return 0.5;};
+  static inline double SafeRoundAdjust() {return 0.25;};
+  static inline int SafeFinalShift() {return 1;};
+
+
+#ifdef VTK_WORDS_BIGENDIAN
+  enum {exponent_pos = 0, mantissa_pos = 1};
+#else
+  enum {exponent_pos = 1, mantissa_pos = 0};
+#endif
+  //ETX
+
+public:
+
+  // Description:
+  // Set the number of bits reserved for fractional precision that are
+  // maintained as part of the flooring process. This number affects the
+  // flooring arithmetic. It may be useful if the factional part is to be
+  // used to index into a lookup table of some sort. However, if you are only
+  // interested in knowing the fractional remainder after flooring, there
+  // doesn't appear to be any advantage to using these bits, either in terms
+  // of a lookup table, or by directly multiplying by some unit fraction,
+  // over simply subtracting the floored value from the original value. Note
+  // that since only 32 bits are used for the entire fixed point
+  // representation, increasing the number of reserved fractional bits
+  // reduces the range of integer values that can be floored to.
+  void SetReservedFracBits(int bits)
+    {
+    // Add one to the requested number of fractional bits, to make
+    // the conversion safe with respect to rounding mode. This is the
+    // same as the difference between QuickFloor and SafeFloor.
+    bits++;
+    unsigned long mtime = this->GetMTime();
+    this->SetinternalReservedFracBits(bits);
+    if (mtime != this->GetMTime())
+      {
+      this->InternalRebuild();
+      }
+    };
+
+  //BTX
+  // Description:
+  // Perform a quick flooring of the double-precision floating point
+  // value. The result is sometimes incorrect, but in a way that makes it
+  // acceptable for most uses. The naive way to implement floor(), given that
+  // the x86 FPU does round() by default, is to define floor(x) as
+  // round(x-.5).  This would work fine except for the fact that the x86 FPU
+  // breaks rounding ties by selecting the even number. Thus, floor(4.0) =
+  // round(3.5) = 4, but floor(3.0) = round(2.5) = 2. As a result,
+  // subtracting .5 gives the wrong answer for odd integers. So, let's
+  // subtract just a TEENSY bit less than .5, to swing the odd-integer
+  // results up to their corect value. How teensy? Well, if it's too teensy,
+  // it will be insignificant compared to 0.5, and will become equivalent to
+  // 0.5.  And if it's not teensy enough, we'll overshoot, causing results
+  // like floor(N-epsilon)==N, for some epsilon. Furthermore, the "too
+  // teensy" problem is exacerbated when trying to floor larger numbers, due
+  // to limitations of the representation's dynamic range. See the definition
+  // of RoundingTieBreaker() for details.
+  static int QuickFloor(const double &val);
+
+  // Description:
+  // Perform a SAFE flooring. Similar to QuickFloor, but modified to return
+  // the correct result always. Use this when it absolutely positively needs
+  // to be the correct answer all the time, and considering 0.9999999 as
+  // being equal to 1.0 is simply not acceptable.  It works similarly to
+  // QuickFloor, but it retains one extra bit of fixed point precision in the
+  // conversion process, so that the problem with QuickFloor affects only an
+  // unneeded bit, and then it ditches that bit from the resulting integer
+  // with a right-shift. In other words, it rounds to the nearest one-half,
+  // choosing the EVEN one-half (i.e. the integer) as a tie-breaker, and then
+  // shifting off that half-integer bit. As a result of maintaining one extra
+  // bit of fixed point precision in the intermediate calculation, the range
+  // of integers supported is reduced by one bit. Plus, it takes a little
+  // longer to execute, due to the final bit shift.
+  static int SafeFloor(const double &val);
+
+  // Description:
+  // Round to nearest int.  This is pretty sweet in the default
+  // round-to-nearest FPU mode, since it is generally immaterial how ties are
+  // broken when rounding. I.e., either "2" or "3" are acceptable results for
+  // "Round(2.5)", but only one of them (the one naively not chosen without
+  // jumping through the hoops in QuickFloor and SafeFloor) is the acceptable
+  // result for the analogous "Floor(3)". Therefore, we don't need to worry
+  // at all about adding a teensy but not too teensy tie breaker, or shifting
+  // off a half-integer bit. This makes it exceptionally fast.
+  static int Round(const double &val);
+
+  // Description:
+  // Convert the value to a fixed point representation, returning the
+  // integer portion as function value, and returning the fractional
+  // part in the second parameter.
+  inline int ConvertFixedPoint(const double &val, int &fracPart)
+    {
+      union { int i[2]; double d; } u;
+#ifdef VTK_EXT_PREC
+      u.d = (((val - fixRound)
+              + this->epTempDenormalizer)
+             - this->epTempDenormalizer)
+        + this->fpDenormalizer;
+#else // ! VTK_EXT_PREC
+      u.d = (val - fixRound)
+        + this->fpDenormalizer;
+#endif // VTK_EXT_PREC
+    fracPart = (u.i[mantissa_pos] & fracMask) >> 1;
+    return u.i[mantissa_pos] >> this->internalReservedFracBits;
+    }
+  //ETX
+
+
+protected:
+  //BTX
+  vtkFastNumericConversion();
+  ~vtkFastNumericConversion() {}
+  void InternalRebuild(void);
+
+private:
+  vtkSetMacro(internalReservedFracBits, int);
+  vtkGetMacro(internalReservedFracBits, int);
+
+#ifndef VTK_LEGACY_SILENT
+  static int QuickFloorInline(const double &val);
+  static int SafeFloorInline(const double &val);
+  static int RoundInline(const double &val);
+#endif
+
+  int internalReservedFracBits;
+  int fracMask;
+
+  // Used when doing fixed point conversions with a certain number of bits
+  // remaining for the fractional part, as opposed to the pure integer
+  // flooring
+  double fpDenormalizer;
+
+  // Used when doing fixed point conversions in extended precision mode
+  double epTempDenormalizer;
+
+  // Adjustment for rounding based on the number of bits reserved for
+  // fractional representation
+  double fixRound;
+  //ETX
+
+  vtkFastNumericConversion(const vtkFastNumericConversion&); // Not implemented
+  void operator=(const vtkFastNumericConversion&); // Not implemented
+};
+
+#ifndef VTK_LEGACY_SILENT
+inline int vtkFastNumericConversion::QuickFloorInline(const double &val)
+#else
+inline int vtkFastNumericConversion::QuickFloor(const double &val)
+#endif
+{
+#ifdef VTK_USE_TRICK
+  union { int i[2]; double d; } u;
+#ifdef VTK_EXT_PREC
+  u.d = (((val - (QuickRoundAdjust() - RoundingTieBreaker()))
+          // Push off those extended precision bits
+          + QuickExtPrecTempDenormalizer())
+         // Pull back the wanted bits into double range
+         - QuickExtPrecTempDenormalizer())
+    + QuickFloorDenormalizer();
+#else // ! VTK_EXT_PREC
+  u.d = (val - (QuickRoundAdjust() - RoundingTieBreaker()))
+    + QuickFloorDenormalizer();
+#endif // VTK_EXT_PREC
+  return u.i[mantissa_pos];
+#else // ! VTK_USE_TRICK
+  return static_cast<int>(val);
+#endif // VTK_USE_TRICK
+}
+
+#ifndef VTK_LEGACY_SILENT
+inline int vtkFastNumericConversion::SafeFloorInline(const double &val)
+#else
+inline int vtkFastNumericConversion::SafeFloor(const double &val)
+#endif
+{
+#ifdef VTK_USE_TRICK
+  union { int i[2]; double d; } u;
+#ifdef VTK_EXT_PREC
+  u.d = (((val - SafeRoundAdjust())
+          + SafeExtPrecTempDenormalizer())
+         - SafeExtPrecTempDenormalizer())
+    + SafeFloorDenormalizer();
+#else // ! VTK_EXT_PREC
+  u.d = (val - SafeRoundAdjust())
+    + SafeFloorDenormalizer();
+#endif // VTK_EXT_PREC
+  return u.i[mantissa_pos] >> SafeFinalShift();
+#else // ! VTK_USE_TRICK
+  return static_cast<int>(val);
+#endif // VTK_USE_TRICK
+}
+
+#ifndef VTK_LEGACY_SILENT
+inline int vtkFastNumericConversion::RoundInline(const double &val)
+#else
+inline int vtkFastNumericConversion::Round(const double &val)
+#endif
+{
+#ifdef VTK_USE_TRICK
+  union { int i[2]; double d; } u;
+#ifdef VTK_EXT_PREC
+  u.d = ((val
+          + QuickExtPrecTempDenormalizer())
+         - QuickExtPrecTempDenormalizer())
+    + QuickFloorDenormalizer();
+#else // ! VTK_EXT_PREC
+  u.d = val
+    + QuickFloorDenormalizer();
+#endif // VTK_EXT_PREC
+return u.i[mantissa_pos];
+#else // ! VTK_USE_TRICK
+if (val>=0)
+  {
+  return static_cast<int>(val + 0.5);
+  }
+else
+  {
+  return static_cast<int>(val - 0.5);
+  }
+#endif // VTK_USE_TRICK
+}
+
+#endif
diff --git a/Common/Math/vtkPolynomialSolversUnivariate.cxx b/Common/Math/vtkPolynomialSolversUnivariate.cxx
index b0b8c2b..5133f63 100644
--- a/Common/Math/vtkPolynomialSolversUnivariate.cxx
+++ b/Common/Math/vtkPolynomialSolversUnivariate.cxx
@@ -812,7 +812,7 @@ static int vtkHabichtOrSturmBisectionSolve(
       }
     else
       {
-      delete [] Q;
+      delete Q;
       }
     }
 
@@ -1569,7 +1569,7 @@ int vtkPolynomialSolversUnivariate::LinBairstowSolve( double* c, int d, double*
     if ( delta >= 0 )
       {
       // check whether there are 2 simple roots or 1 double root
-      if ( delta != 0.0 )
+      if ( delta )
         {
         delta = sqrt( delta );
         // we have 2 simple real roots
@@ -2141,9 +2141,9 @@ int vtkPolynomialSolversUnivariate::SolveQuadratic( double c1, double c2, double
 // Returns either the number of roots, or -1 if ininite number of roots.
 int vtkPolynomialSolversUnivariate::SolveQuadratic( double* c, double* r, int* m )
 {
-  if( c[0] == 0.0 )
+  if( ! c[0] )
     {
-    if( c[1] != 0.0 )
+    if( c[1] )
       {
       r[0] = -c[2] / c[1];
       m[0] = 1;
@@ -2151,18 +2151,18 @@ int vtkPolynomialSolversUnivariate::SolveQuadratic( double* c, double* r, int* m
       }
     else
       {
-      if ( c[2] != 0.0 ) return 0;
+      if ( c[2] ) return 0;
       else return -1;
       }
     }
 
   double delta = c[1] * c[1] - 4. * c[0] * c[2];
 
-  if ( delta >= 0.0 )
+  if ( delta >= 0. )
     {
     double fac = 1. / ( 2. *  c[0] );
     // check whether there are 2 simple or 1 double root(s)
-    if ( delta != 0.0 )
+    if ( delta )
       {
       delta = sqrt( delta );
       // insert 1st simple real root
diff --git a/Common/Misc/Testing/Cxx/UnitTestFunctionParser.cxx b/Common/Misc/Testing/Cxx/UnitTestFunctionParser.cxx
index bfc6bbe..941449e 100644
--- a/Common/Misc/Testing/Cxx/UnitTestFunctionParser.cxx
+++ b/Common/Misc/Testing/Cxx/UnitTestFunctionParser.cxx
@@ -683,7 +683,7 @@ int TestMiscFunctions()
     double expected = std::pow(x, y);
     if (!vtkMathUtilities::FuzzyCompare(
           result, expected,
-          std::numeric_limits<double>::epsilon() * 128.0))
+          std::numeric_limits<double>::epsilon() * 1.0))
       {
       std::cout << "\n";
       std::cout <<  " pow Expected " << expected
@@ -717,7 +717,7 @@ int TestMiscFunctions()
     double expected = x / y;
     if (!vtkMathUtilities::FuzzyCompare(
           result, expected,
-          std::numeric_limits<double>::epsilon() * 256.0))
+          std::numeric_limits<double>::epsilon() * 1.0))
       {
       std::cout << "\n";
       std::cout <<  " x / y Expected " << expected
diff --git a/Common/Misc/vtkContourValues.cxx b/Common/Misc/vtkContourValues.cxx
index c638eb8..2f4ab06 100644
--- a/Common/Misc/vtkContourValues.cxx
+++ b/Common/Misc/vtkContourValues.cxx
@@ -34,7 +34,7 @@ vtkContourValues::~vtkContourValues()
 // Set the ith contour value.
 void vtkContourValues::SetValue(int i, double value)
 {
-  vtkIdType numContours=this->Contours->GetMaxId()+1;
+  int numContours=this->Contours->GetMaxId()+1;
   i = (i < 0 ? 0 : i);
 
   if ( i >= numContours || value != this->Contours->GetValue(i) )
@@ -64,9 +64,9 @@ double *vtkContourValues::GetValues()
 // allocated memory of size GetNumberOfContours().
 void vtkContourValues::GetValues(double *contourValues)
 {
-  vtkIdType numContours=this->Contours->GetMaxId()+1;
+  int i, numContours=this->Contours->GetMaxId()+1;
 
-  for ( vtkIdType i=0; i < numContours; i++ )
+  for ( i=0; i < numContours; i++ )
     {
     contourValues[i] = this->Contours->GetValue(i);
     }
@@ -77,9 +77,9 @@ void vtkContourValues::GetValues(double *contourValues)
 // will automatically increase list size as needed.
 void vtkContourValues::SetNumberOfContours(const int number)
 {
-  vtkIdType    currentNumber = this->Contours->GetMaxId()+1;
-  vtkIdType    n = ( number < 0 ? 0 : number);
-  vtkIdType    i;
+  int    currentNumber = this->Contours->GetMaxId()+1;
+  int    n = ( number < 0 ? 0 : number);
+  int    i;
   double  *oldValues = NULL;
 
   if ( n != currentNumber )
@@ -101,7 +101,7 @@ void vtkContourValues::SetNumberOfContours(const int number)
     // Copy them back in since the array may have been re-allocated
     if ( currentNumber > 0 )
       {
-      vtkIdType limit = (currentNumber < n)?(currentNumber):(n);
+      int limit = (currentNumber < n)?(currentNumber):(n);
       for ( i = 0; i < limit; i++ )
         {
         this->Contours->SetValue( i, oldValues[i] );
@@ -166,10 +166,10 @@ void vtkContourValues::PrintSelf(ostream& os, vtkIndent indent)
 {
   this->Superclass::PrintSelf(os, indent);
 
-  vtkIdType numContours=this->Contours->GetMaxId() + 1;
+  int i, numContours=this->Contours->GetMaxId() + 1;
 
   os << indent << "Contour Values: \n";
-  for ( vtkIdType i=0; i < numContours; i++)
+  for ( i=0; i < numContours; i++)
     {
     os << indent << "  Value " << i << ": " << this->Contours->GetValue(i) << "\n";
     }
diff --git a/Common/Misc/vtkFunctionParser.cxx b/Common/Misc/vtkFunctionParser.cxx
index e06365c..bffb0e7 100644
--- a/Common/Misc/vtkFunctionParser.cxx
+++ b/Common/Misc/vtkFunctionParser.cxx
@@ -828,7 +828,7 @@ bool vtkFunctionParser::Evaluate()
         int valTrue = stackPosition - 1;
         int boolArg = stackPosition;
 
-        if (this->Stack[boolArg] != 0.0)
+        if (this->Stack[boolArg])
           this->Stack[result] = this->Stack[valTrue];
         else
           this->Stack[result] = this->Stack[valFalse];
@@ -848,7 +848,7 @@ bool vtkFunctionParser::Evaluate()
         int zValTrue = stackPosition - 1;
         int boolArg = stackPosition;
 
-        if (this->Stack[boolArg] != 0.0)
+        if (this->Stack[boolArg])
           {
           this->Stack[xResult] = this->Stack[xValTrue];
           this->Stack[yResult] = this->Stack[yValTrue];
@@ -1442,7 +1442,7 @@ void vtkFunctionParser::BuildInternalSubstringStructure(int beginIndex,
     if (mathFunctionNum > 0)
       {
       beginIndex2 = beginIndex;
-      while (beginIndex2 <= endIndex && this->Function[beginIndex2] != '(')
+      while (this->Function[beginIndex2] != '(' && beginIndex2 <= endIndex)
         {
         beginIndex2++;
         }
diff --git a/Common/Misc/vtkHeap.cxx b/Common/Misc/vtkHeap.cxx
index c9cf4fa..28c2a59 100644
--- a/Common/Misc/vtkHeap.cxx
+++ b/Common/Misc/vtkHeap.cxx
@@ -15,19 +15,25 @@
 #include "vtkCommonMiscModule.h" // For export macro
 #include "vtkHeap.h"
 #include "vtkObjectFactory.h"
-#include <cstddef>
 
 vtkStandardNewMacro(vtkHeap);
 
-static size_t vtkGetLongAlignment()
+struct vtkTestAlignLong
 {
-  struct vtkTestAlignLong
-  {
-    char    pad;
-    long    x;
-  };
+  char    pad;
+  long    x;
+};
+
+static int vtkGetLongAlignment()
+{
+  struct vtkTestAlignLong    s1;
+  char *               p1;
+  char *               p2;
+
+  p1 = reinterpret_cast<char *>(&s1);   // Get address of struct
+  p2 = reinterpret_cast<char *>(&s1.x); // Get address of long within struct
 
-  return offsetof(vtkTestAlignLong, x);
+  return (p2 - p1);    // Get member offset/alignment
 }
 
 class VTKCOMMONMISC_EXPORT vtkHeapBlock
diff --git a/Common/Misc/vtkHeap.h b/Common/Misc/vtkHeap.h
index 824b894..8a0b605 100644
--- a/Common/Misc/vtkHeap.h
+++ b/Common/Misc/vtkHeap.h
@@ -92,7 +92,7 @@ protected:
   size_t BlockSize;
   int    NumberOfAllocations;
   int    NumberOfBlocks;
-  size_t Alignment;
+  int    Alignment;
 
   // Manage the blocks
   vtkHeapBlock* First;
diff --git a/Common/Transforms/vtkIdentityTransform.cxx b/Common/Transforms/vtkIdentityTransform.cxx
index 7a89ac9..56945e9 100644
--- a/Common/Transforms/vtkIdentityTransform.cxx
+++ b/Common/Transforms/vtkIdentityTransform.cxx
@@ -159,10 +159,10 @@ void vtkIdentityTransform::TransformPointsNormalsVectors(vtkPoints *inPts,
 void vtkIdentityTransform::TransformPoints(vtkPoints *inPts,
                                            vtkPoints *outPts)
 {
-  vtkIdType n = inPts->GetNumberOfPoints();
+  int n = inPts->GetNumberOfPoints();
   double point[3];
 
-  for (vtkIdType i = 0; i < n; i++)
+  for (int i = 0; i < n; i++)
     {
     inPts->GetPoint(i,point);
     outPts->InsertNextPoint(point);
@@ -173,10 +173,10 @@ void vtkIdentityTransform::TransformPoints(vtkPoints *inPts,
 void vtkIdentityTransform::TransformNormals(vtkDataArray *inNms,
                                             vtkDataArray *outNms)
 {
-  vtkIdType n = inNms->GetNumberOfTuples();
+  int n = inNms->GetNumberOfTuples();
   double normal[3];
 
-  for (vtkIdType i = 0; i < n; i++)
+  for (int i = 0; i < n; i++)
     {
     inNms->GetTuple(i,normal);
     outNms->InsertNextTuple(normal);
@@ -187,10 +187,10 @@ void vtkIdentityTransform::TransformNormals(vtkDataArray *inNms,
 void vtkIdentityTransform::TransformVectors(vtkDataArray *inNms,
                                             vtkDataArray *outNms)
 {
-  vtkIdType n = inNms->GetNumberOfTuples();
+  int n = inNms->GetNumberOfTuples();
   double vect[3];
 
-  for (vtkIdType i = 0; i < n; i++)
+  for (int i = 0; i < n; i++)
     {
     inNms->GetTuple(i,vect);
     outNms->InsertNextTuple(vect);
diff --git a/Common/Transforms/vtkThinPlateSplineTransform.cxx b/Common/Transforms/vtkThinPlateSplineTransform.cxx
index 0882624..ecafa25 100644
--- a/Common/Transforms/vtkThinPlateSplineTransform.cxx
+++ b/Common/Transforms/vtkThinPlateSplineTransform.cxx
@@ -741,7 +741,7 @@ static double vtkRBFDRr(double r, double &dUdr)
 // the standard 2D thin plate spline basis function
 static double vtkRBFr2logr(double r)
 {
-  if (r != 0.0)
+  if (r)
     {
     return r*r*log(r);
     }
diff --git a/Common/Transforms/vtkTransform.cxx b/Common/Transforms/vtkTransform.cxx
index b911b60..f2afbb1 100644
--- a/Common/Transforms/vtkTransform.cxx
+++ b/Common/Transforms/vtkTransform.cxx
@@ -474,7 +474,7 @@ void vtkTransform::GetOrientationWXYZ(double wxyz[4])
   // calc the return value wxyz
  double mag = sqrt( wxyz[1] * wxyz[1] + wxyz[2] * wxyz[2] + wxyz[3] * wxyz[3] );
 
-  if ( mag != 0.0 )
+  if ( mag )
     {
     wxyz[0] = 2. * vtkMath::DegreesFromRadians( acos( wxyz[0] ) );
     wxyz[1] /= mag;
diff --git a/Documentation/dev/changes_6.3/ghosts_and_blanking.md b/Documentation/dev/changes_6.3/ghosts_and_blanking.md
deleted file mode 100644
index 92b8fb1..0000000
--- a/Documentation/dev/changes_6.3/ghosts_and_blanking.md
+++ /dev/null
@@ -1,174 +0,0 @@
-# Motivation
-
-`Ghost cells` are layers of cells at boundaries of pieces of a
-dataset. These cells are used by data parallel algorithms, to insure
-the correctness of their results. For instance, consider an algorithm
-that computes the external faces of a dataset. Consider also that the
-algorithm runs in parallel on several nodes, each node processing a
-piece of the original dataset. This operation would produce incorrect
-faces at boundaries of pieces. Ghosts cells can prevent this. See the
-following [wiki entry](http://www.vtk.org/Wiki/VTK/Parallel_Pipeline)
-for a more detailed description of ghost cells.
-
-`Blanking cells` are used to specify that certain pieces of a grid
-are not part of the data. For instance, a regular dataset with a hole
-in it could be specified by blanking the cells that cover the
-hole. Blanking cells are supported for `vtkStructuredGrid` and `vtkUniformGrid`.
-
-We change how ghost and blanked cells are stored to:
-
-1. better support blanking: in the past blanked cells were stored as
-   members of `vtkStructuredGrid` and `vtkUniformGrid`. This
-   created the need for special processing when these arrays needed to
-   be passed between algorithms or processes. Now, blanked cells are
-   marked with a bit in a field array. Field arrays are passed
-   automatically between algorithms and processes
-
-2. provide binary compatibility with VisIt: VTK now uses the
-   [same bits as VisIt](http://www.visitusers.org/index.php?title=Representing_ghost_data)
-   to mark ghost cells and blanked cells
-
-3. save space: the arrays for storing blanking are not needed anymore
-
-Note that ghosts and blanking exists for both cells and points. Simply
-replace cell with point to get the corresponding description for point
-ghosts and blanking.
-
-# Changes overview
-
-To achieve our goals we made the following changes:
-
-1. Previously, ghost cells were marked in a `unsigned char`
-   attribute array called "`vtkGhostLevels`". For each cell, the
-   ghost level was stored at the corresponding cell id. Now, there is
-   no distinction between ghost levels. Cells at any ghost level, are
-   marked by setting `vtkDataSetAttributes::DUPLICATECELL` bit at
-   the corresponding cell id, in the `unsigned char` attribute
-   array called `vtkDataSetAttributes::GhostArrayName()`
-   ("`vtkGhostType`").
-
-2. Previously, filters striped all ghost cells they requested from
-   upstream before finalizing the output. This is no longer done. The
-   user can remove all ghost cells at the end of pipeline processing,
-   if needed. Note that ghost cells are not shown in the render
-   window, and only consume a small amount of memory compared with the
-   whole dataset which means that removing them is often not
-   necessary.
-
-3. `vtkUniformGrid` and `vtkStructuredGrid` previously
-   supported blanking through member arrays `CellVisibility` and
-   `PointVisibility`. These arrays are removed and the blanking
-   functionality is supported by setting
-   `vtkDataSetAttributes::HIDDENCELL` bit at the corresponding
-   cell id in the "`vtkGhostType`" attribute array.
-
-4. We increase file version for VTK Legacy files (see VTK/IO/Legacy)
-   to 4.0 (from 3.0). We increase file version for VTK XML files (see
-   VTK/IO/XML) to 2.0 (from 0.1 for files using UInt32 header type and
-   from 1.0 for files using UInt64 header type). We increase these
-   versions because ghost cells are now stored in a file using the new
-   `vtkGhostType` format described in the previous section.  New
-   readers reading old files convert a `vtkGhostLevels` attribute
-   array to a `vtkGhostType` array. This preserves ghost cells
-   written using old readers.
-
-# Bits used in the ghost type array
-
-We use the following bits to store information about each cell in the
-dataset. These bits are
-[compatible](http://www.visitusers.org/index.php?title=Representing_ghost_data)
-with Visit.
-
-`vtkDataSetAttribute::DUPLICATECELL` specifies that this cell is
-present on multiple processors. This is a ghost cell. This cell is not
-rendered. It is present only to help obtain correct results when
-processing only a subset of the original data. Attributes associated
-with these cells are valid, so they can be used in certain statistical
-operations such as min/max. Ghost cells should not be used in
-operations such as average because this would result counting the same
-cell several times. A similar description applies to
-`vtkDataSetAttribute::DUPLICATEPOINT`
-
-`vtkDataSetAttribute::REFINEDCELL` specifies that other cells are
-present that refine this cell. Because the coarser grid is often a
-structured grid, it is difficult to remove cells that are further
-refined. Instead, this bit is used to mark this kind of cells. Values
-associated with this cell may be used in interpolation. Note that
-there is no vtkDataSetAttribute::REFINEDPOINT.  For more information
-about AMR datasets in VTK see
-[Visualization & Analysis of AMR Datasets](http://www.kitware.com/source/home/post/32) in The Source.
-
-`vtkDataSetAttribute::HIDDENCELL` specifies that this cell is not
-part of the model, it is only used to maintain the connectivity of the
-grid. This is a blank cell. It is not rendered and any values
-associated with it are ignored. A similar description applies to
-`vtkDataSetAttribute::HIDDENPOINT`
-
-Other bits specified by VisIt are not used in VTK.
-
-# API Changes
-
-To test if a cell is a ghost cell, previously, we used
-`grid->GetCellData()->GetArray("vtkGhostLevels")->GetValue(cellId) >
-0`. This is because we stored ghost levels in the ghost array. Now
-we use `grid->GetCellGhostArray()->GetValue(cellId) &
-vtkDataSetAttributes::DUPLICATECELL`.
-
-To specify that a cell is a ghost cell, instead of
-`grid->GetCellData()->GetArray("vtkGhostLevels")->SetValue(cellId,
-ghostLevel)`, use: ` vtkUnsignedCharArray* ghosts =
-grid->GetCellGhostArray(); ghosts->SetValue(cellId,
-ghosts->GetValue(cellId) | vtkDataSetAttributes::DUPLICATECELL); `
-Note that we use a 'or' operation to preserve other bits that might be
-set for the cell.
-
-To create a new ghost array, instead of
-`vtkDataSet::GenerateGhostLevelArray`, use
-`vtkDataSet::GenerateGhostArray`. We changed the name because there
-are no ghost levels in the new ghost array.
-
-To test if there are any ghost cells, instead of
-`grid->GetCellData()->GetArray("vtkGhostLevels") != NULL`, use
-`grid->HasAnyGhostCells()`. Make similar changes to test if there
-are any blank cells. We made this change because previously a non-NULL
-ghost array meant that there are ghost cells, now this means that
-there are blank cells or ghost cells.
-
-To get a pointer to the ghost array, instead of
-`grid->GetCellData()->GetArray("vtkGhostLevels")`, use
-`grid->GetCellGhostArray()`. This new function avoids O(N) string
-comparisons by caching the ghost array pointer.
-
-We remove a ghostLevel parameter from
-`vtkPolyData::RemoveGhostCells`,
-`vtkUnstructuredGrid::RemoveGhostCells`,
-`vtkGlyph3D::Execute`,
-`vtkDataSetSurfaceFilter::UnstructuredGridExecute`. This is
-because we no longer remove ghost levels requested by a filter after
-the filter finishes executing.
-
-We remove `GetCellVisibilityArray` from `vtkStructuredGrid`
-and `vtkUniformGrid`. Use `GetCellGhostArray` instead and use
-`vtkDataSetAttributes::HIDDENCELL` bit to set or test if a cell is
-blanked.
-
-We add an extra parameter to `vtkDataReader::ReadFieldData`,
-`vtkXMLDataReader::ReadArrayValues`,
-`vtkXMLStructuredDataReader::ReadSubExtent` which specifies if we
-read cell or point data. This is needed so that we can use the proper
-bits when converting ghost levels.
-
-We remove `vtkStructuredGridWriter:::WriteBlanking` as blanking is
-now written when saving the `vtkGhostType` array.
-
-# VTK XML file version update (4/16/2015)
-
-Users with an older VTK won't be able to read VTK XML files generated
-with a new VTK containing the ghost changes described even if those
-files do not contain ghost or blanking cells. This is because we
-increment VTK XML file version.
-
-To fix this, we use the previous file version for VTK XML files (0.1
-for files using UInt32 header type and 1.0 for files using UInt64
-header type) unless data is unstructured or structured grid and there
-is a vtkGhostType array.
diff --git a/Documentation/dev/git/README.md b/Documentation/dev/git/README.md
deleted file mode 100644
index 1ced1e3..0000000
--- a/Documentation/dev/git/README.md
+++ /dev/null
@@ -1,38 +0,0 @@
-VTK Git Usage
-=============
-
-VTK version tracking and development is hosted by [Git](http://git-scm.com).
-Please select a task for further instructions:
-
-Main Tasks
-----------
-
-* [Install Git](http://public.kitware.com/Wiki/Git/Download) -
-  Git 1.7.2 or greater is preferred (required for development)
-
-* [Download VTK](download.md) - Users start here
-
-* [Develop VTK](develop.md) - Contributors start here
-
-Other Tasks
------------
-
-* [Review Changes](https://gitlab.kitware.com/vtk/vtk/merge_requests) -
-  VTK GitLab Merge Requests
-
-* [Test VTK](dashboard.md) - CDash client setup
-
-* [Learn Git](http://public.kitware.com/Wiki/Git/Resources) -
-  Third-party documentation
-
-Branches
---------
-
-The upstream VTK repository has the following branches:
-
-* `master`: Development (default)
-* `release`: Maintenance of latest release
-* `nightly-master`: Follows `master`, updated at `01:00 UTC`
-* `hooks`: Local commit hooks
-   ([placed](http://public.kitware.com/Wiki/Git/Hooks#Local) in `.git/hooks`)
-* `dashboard`: Dashboard script ([setup](dashboard.md) a CDash client)
diff --git a/Documentation/dev/git/dashboard.md b/Documentation/dev/git/dashboard.md
deleted file mode 100644
index 83167a0..0000000
--- a/Documentation/dev/git/dashboard.md
+++ /dev/null
@@ -1,45 +0,0 @@
-VTK Dashboard Scripts
-=====================
-
-This page documents how to use the VTK `dashboard` branch in [Git][].
-See the [README](README.md) for more information.
-
-[Git]: http://git-scm.com
-
-Using the Dashboard Scripts
----------------------------
-
-The `dashboard` branch contains a dashboard client helper script.
-Use these commands to track it:
-
-    $ mkdir -p ~/Dashboards/VTKScripts
-    $ cd ~/Dashboards/VTKScripts
-    $ git init
-    $ git remote add -t dashboard origin https://gitlab.kitware.com/vtk/vtk.git
-    $ git pull origin
-
-The `vtk_common.cmake` script contains setup instructions in its
-top comments.
-
-Update the `dashboard` branch to get the latest version of this
-script by simply running:
-
-    $ git pull
-
-Here is a link to the script as it appears today: [vtk_common.cmake][].
-
-[vtk_common.cmake]: https://gitlab.kitware.com/vtk/vtk/tree/dashboard/vtk_common.cmake
-
-Changing the Dashboard Scripts
-------------------------------
-
-If you find bugs in the hooks themselves or would like to add new features,
-the can be edited in the usual Git manner:
-
-    $ git checkout -b my-topic-branch
-
-Make your edits, test it, and commit the result.  Create a patch file with:
-
-    $ git format-patch origin/dashboard
-
-And email the results to the developer's mailing list.
diff --git a/Documentation/dev/git/data.md b/Documentation/dev/git/data.md
deleted file mode 100644
index 366c7a3..0000000
--- a/Documentation/dev/git/data.md
+++ /dev/null
@@ -1,330 +0,0 @@
-VTK Data
-========
-
-This page documents how to add test data while developing VTK with [Git][].
-See the [README](README.md) for more information.
-
-[Git]: http://git-scm.com
-
-Setup
------
-
-The workflow below depends on local hooks to function properly.
-Follow the main [developer setup instructions](develop.md#setup)
-before proceeding.  In particular, run [SetupForDevelopment.sh][]:
-
-    $ ./Utilities/SetupForDevelopment.sh
-
-[SetupForDevelopment.sh]: /Utilities/SetupForDevelopment.sh
-
-Workflow
---------
-
-Our workflow for adding data integrates with our standard Git
-[development process](develop.md).  Start by
-[creating a topic](develop.md#create-a-topic).
-Return here when you reach the "edit files" step.
-
-These instructions follow a typical use case of adding a new
-test with a baseline image.
-
-### Add Test ###
-
-1.  Write a new test, e.g.
-
-        $ edit Some/Module/Testing/Cxx/MyTest.cxx
-
-2.  Edit the corresponding `CMakeLists.txt` file:
-
-        $ edit Some/Module/Testing/Cxx/CMakeLists.txt
-
-    and add the test in a `vtk_add_test_...` call (which references
-    baselines automatically).
-
-3.  For tests not using such a call, reference the data file in an
-    `ExternalData_add_test` call.  Specify the file inside `DATA{...}`
-    using a path relative to the test directory:
-
-        $ edit Some/Module/Testing/Cxx/CMakeLists.txt
-        ExternalData_add_test(VTKData
-          NAME ${vtk-module}Cxx-MyTest
-          COMMAND ${vtk-module}CxxTests MyTest
-                  ... -V DATA{../Data/Baseline/MyTest.png,:} ...
-          )
-
-Notes:
-
-* If the data file references other data files, e.g. `.mhd -> .raw`,
-  read the [ExternalData][] module documentation on "associated" files.
-* Multiple baseline images and other series are handled automatically
-  when the reference ends in the `,:` option.  Read [ExternalData][]
-  module documentation for details.
-
-[ExternalData]: /CMake/ExternalData.cmake
-
-### Build and Run the Test ###
-
-If you already have a data file, skip to the [next step](#add-data) to add it.
-Otherwise, use the following steps to produce a test baseline image file.
-We assume a build tree has been previously generated by CMake.
-
-1.  Switch to the build tree:
-
-        $ cd ../VTK-build
-
-2.  Run CMake:
-
-        $ cmake .
-
-    Since we have not yet created the baseline image data file, CMake
-    will warn that it does not exist but proceed to generate the test
-    anyway.
-
-3.  Build
-
-        $ make
-
-4.  Run the test
-
-        $ ctest -R MyTest
-
-    It will fail but place the baseline image in `Testing/Temporary`.
-
-5.  Switch back to the source tree:
-
-        $ cd ../VTK
-
-### Add Data ###
-
-Copy the data file into your local source tree.
-
-    $ mkdir -p Some/Module/Testing/Data/Baseline
-    $ cp ../VTK-build/Testing/Temporary/MyTest.png Some/Module/Testing/Data/Baseline
-
-### Run CMake ###
-
-1.  Switch to the build tree:
-
-        $ cd ../VTK-build
-
-2.  Run CMake:
-
-        $ cmake .
-
-    CMake will [move the original file](#externaldata).  Keep your own
-    copy if necessary.  See [below](#recover-data-file) to recover the
-    original file.
-
-    During configuration CMake will display a message such as:
-
-        Linked Some/Module/Testing/Data/Baseline/MyTest.png.md5 to ExternalData MD5/...
-
-    This means that CMake converted the file into a data object referenced
-    by a "content link" named like the original file but with a `.md5`
-    extension.  CMake also [renamed the original file](#externaldata).
-
-3.  Build
-
-        $ make
-
-    During the build, the [ExternalData][] module will make the data
-    file available where the test expects to find it.
-
-4.  Run the test
-
-        $ ctest -R MyTest
-
-    It should pass using the new data file.
-
-5.  Switch back to the source tree:
-
-        $ cd ../VTK
-
-### Commit ###
-
-Continue to [create the topic](develop.md#create-a-topic) and edit other
-files as necessary.  Add the content link and commit it along with the
-other changes:
-
-    $ git add Some/Module/Testing/Data/Baseline/MyTest.png.md5
-    $ git add Some/Module/Testing/Data/CMakeLists.txt
-    $ git commit
-
-The local `pre-commit` hook will display a message such as:
-
-    Some/Module/Testing/Data/Baseline/MyTest.png.md5: Added content to Git at refs/data/MD5/...
-    Some/Module/Testing/Data/Baseline/MyTest.png.md5: Added content to local store at .ExternalData/MD5/...
-    Content link Some/Module/Testing/Data/Baseline/MyTest.png.md5 -> .ExternalData/MD5/...
-
-This means that the pre-commit hook recognized that the content link
-references a new data object and [prepared it for upload](#pre-commit).
-
-### Push ###
-
-Follow the instructions to [share the topic](develop.md#share-a-topic).
-When you push it to GitLab for review using
-
-    $ git gitlab-push
-
-part of the output will be of the form:
-
-    *       ...:refs/data/...      [new branch]
-    *       HEAD:refs/heads/my-topic  [new branch]
-    Pushed refs/data/... and removed local ref.
-
-This means that the `git-gitlab-push` script pushed the topic
-and [uploaded the data](#git-gitlab-push) it references.
-
-Options for `gitlab-push` include:
-* `--dry-run`: Report push that would occur without actually doing it
-* `--no-topic`: Push the data referenced by the topic but not the topic itself
-
-Note: One must `git gitlab-push` from the same work tree as was used
-to create the commit.  Do not `git push` to another computer first and
-try to push to GitLab from there because the data will not follow.
-
-Building
---------
-
-### Download ###
-
-For the test data to be downloaded and made available to the tests in
-your build tree the `VTKData` target must be built.  One may build the
-target directly, e.g. `make VTKData`, to obtain the data without a
-complete build.  The output will be something like
-
-    -- Fetching ".../ExternalData/MD5/..."
-    -- [download 100% complete]
-    -- Downloaded object: "VTK-build/ExternalData/Objects/MD5/..."
-
-The downloaded files appear in `VTK-build/ExternalData` by default.
-
-### Local Store ###
-
-It is possible to configure one or more local ExternalData object
-stores shared among multiple builds.  Configure for each build the
-advanced cache entry `ExternalData_OBJECT_STORES` to a directory on
-your local disk outside all build trees, e.g. `/home/user/.ExternalData`:
-
-    $ cmake -DExternalData_OBJECT_STORES=/home/user/.ExternalData ../VTK
-
-The [ExternalData][] module will store downloaded objects in the local
-store instead of the build tree.  Once an object has been downloaded
-by one build it will persist in the local store for re-use by other
-builds without downloading again.
-
-Discussion
-----------
-
-A VTK test data file is not stored in the main source tree under version
-control.  Instead the source tree contains a "content link" that refers
-to a data object by a hash of its content.  At build time the
-[ExternalData][] module fetches data needed by enabled tests.
-This allows arbitrarily large data to be added and removed without
-bloating the version control history.
-
-The above [workflow](#workflow) allows developers to add a new data file
-almost as if committing it to the source tree.  The following subsections
-discuss details of the workflow implementation.
-
-### ExternalData ###
-
-While [CMake runs](#run-cmake) the [ExternalData][] module evaluates
-[DATA{} references](#add-test).  VTK [sets](/CMake/vtkExternalData.cmake)
-the `ExternalData_LINK_CONTENT` option to `MD5` to enable automatic
-conversion of raw data files into content links.  When the module detects
-a real data file in the source tree it performs the following
-transformation as specified in the module documentation:
-
-* Compute the MD5 hash of the file
-* Store the `${hash}` in a file with the original name plus `.md5`
-* Rename the original file to `.ExternalData_MD5_${hash}`
-
-The real data now sit in a file that we [tell Git to ignore](/.gitignore).
-For example:
-
-    $ cat Some/Module/Testing/Data/Baseline/.ExternalData_MD5_477e602800c18624d9bc7a32fa706b97 |md5sum
-    477e602800c18624d9bc7a32fa706b97  -
-    $ cat Some/Module/Testing/Data/Baseline/MyTest.png.md5
-    477e602800c18624d9bc7a32fa706b97
-
-#### Recover Data File ####
-
-To recover the original file after running CMake but before committing,
-undo the operation:
-
-    $ cd Some/Module/Testing/Data/Baseline
-    $ mv .ExternalData_MD5_$(cat MyTest.png.md5) MyTest.png
-
-### pre-commit ###
-
-While [committing](#commit) a new or modified content link the
-[pre-commit](/Utilities/Scripts/pre-commit) hook moves the real data
-object from the `.ExternalData_MD5_${hash}` file left by the
-[ExternalData][] module to a local object repository stored in a
-`.ExternalData` directory at the top of the source tree.
-
-The hook also uses Git plumbing commands to store the data object
-as a blob in the local Git repository.  The blob is not referenced
-by the new commit but instead by `refs/data/MD5/${hash}`.
-This keeps the blob alive in the local repository but does not add
-it to the project history.  For example:
-
-    $ git for-each-ref --format="%(refname)" refs/data
-    refs/data/MD5/477e602800c18624d9bc7a32fa706b97
-    $ git cat-file blob refs/data/MD5/477e602800c18624d9bc7a32fa706b97 | md5sum
-    477e602800c18624d9bc7a32fa706b97  -
-
-### git gitlab-push ###
-
-The `git gitlab-push` command is actually an alias for the
-[git-gitlab-push](/Utilities/GitSetup/git-gitlab-push) script.
-In addition to pushing the topic branch to Gerrit the script also detects
-content links added or modified by the commits in the topic.
-It reads the data object hashes from the content links and looks for
-matching `refs/data/` entries in the local Git repository.
-
-The script pushes the matching data objects to your VTK GitLab fork.
-For example:
-
-    $ git gitlab-push --dry-run --no-topic
-    *       refs/data/MD5/477e602800c18624d9bc7a32fa706b97:refs/data/MD5/477e602800c18624d9bc7a32fa706b97   [new branch]
-    Pushed refs/data/MD5/477e602800c18624d9bc7a32fa706b97 and removed local ref.
-
-A GitLab webhook that triggers whenever a topic branch is pushed checks
-for `refs/data/` in your VTK GitLab fork, fetches them, erases the refs
-from your fork, and uploads them to a location that we
-[tell ExternalData to search](/CMake/vtkExternalData.cmake) at build time.
-
-### Publishing Data for an External Branch ###
-
-The above [workflow](#workflow) works well for developers working on a
-single machine to contribute changes directly to upstream VTK.  When
-working in an external branch of VTK, perhaps during a long-term topic
-development effort, data objects need to be published separately.
-
-The workflow for adding data to an external branch of VTK is the same
-as the above through the [commit](#commit) step, but diverges at the
-[push](#push) step because one will push to a separate repository.
-Our ExternalData infrastructure intentionally hides the real data files
-from Git so only the content links (`.md5` files) will be pushed.
-The real data objects will still be left in the `.ExternalData/MD5`
-directory at the top of the VTK source tree by the
-[pre-commit](#pre-commit) hook.
-
-The `.ExternalData` directory must be published somewhere visible to
-other machines that want to use the data, such as on a web server.
-Once that is done then other machines can be told where to look for
-the data, e.g.
-
-    cmake ../VTK "-DExternalData_URL_TEMPLATES=https://username.github.io/VTK/ExternalData/%(algo)/%(hash)
-
-In this example we assume the files are published on a [Github Pages][]
-`gh-pages` branch in `username`'s fork of VTK.
-
-Within the `gh-pages` branch the files are placed at
-`ExternalData/MD5/$md5sum` where `$md5sum` is the MD5 hash of the content
-(these are the same names they have in the `.ExternalData` directory in
-the original source tree).
-
-[Github Pages]: https://help.github.com/articles/creating-project-pages-manually
diff --git a/Documentation/dev/git/develop.md b/Documentation/dev/git/develop.md
deleted file mode 100644
index 2dd46fd..0000000
--- a/Documentation/dev/git/develop.md
+++ /dev/null
@@ -1,385 +0,0 @@
-Develop VTK with Git
-====================
-
-This page documents how to develop VTK through [Git][].
-See the [README](README.md) for more information.
-
-[Git]: http://git-scm.com
-
-Git is an extremely powerful version control tool that supports many
-different "workflows" for individual development and collaboration.
-Here we document procedures used by the VTK development community.
-In the interest of simplicity and brevity we do *not* provide an
-explanation of why we use this approach.
-
-Setup
------
-
-Before you begin, perform initial setup:
-
-1.  Register [GitLab Access] to create an account and select a user name.
-
-2.  [Fork VTK][] into your user's namespace on GitLab.
-
-3.  Follow the [download instructions](download.md#clone) to create a
-    local clone of the main VTK repository:
-
-        $ git clone https://gitlab.kitware.com/vtk/vtk.git VTK
-        $ cd VTK
-    The main repository will be configured as your `origin` remote.
-
-4.  Run the [developer setup script][] to prepare your VTK work tree and
-    create Git command aliases used below:
-
-        $ ./Utilities/SetupForDevelopment.sh
-    This will prompt for your GitLab user name and configure a remote
-    called `gitlab` to refer to it.
-
-5.  (Optional but highly recommended.)
-    [Register](https://open.cdash.org/register.php) with the VTK project
-    on Kitware's CDash instance to better know how your code performs in
-    regression tests.  After registering and signing in, click on
-    "All Dashboards" link in the upper left corner, scroll down and click
-    "Subscribe to this project" on the right of VTK.
-
-[GitLab Access]: https://gitlab.kitware.com/users/sign_in
-[Fork VTK]: https://gitlab.kitware.com/vtk/vtk/fork/new
-[developer setup script]: /Utilities/SetupForDevelopment.sh
-
-Workflow
---------
-
-VTK development uses a [branchy workflow][] based on topic branches.
-Our collaboration workflow consists of three main steps:
-
-1.  Local Development:
-    * [Update](#update)
-    * [Create a Topic](#create-a-topic)
-
-2.  Code Review (requires [GitLab Access][]):
-    * [Share a Topic](#share-a-topic)
-    * [Create a Merge Request](#create-a-merge-request)
-    * [Review a Merge Request](#review-a-merge-request)
-    * [Revise a Topic](#revise-a-topic)
-
-3.  Integrate Changes:
-    * [Merge a Topic](#merge-a-topic) (requires permission in GitLab)
-    * [Delete a Topic](#delete-a-topic)
-
-[branchy workflow]: http://public.kitware.com/Wiki/Git/Workflow/Topic
-
-Update
-------
-
-1.  Update your local `master` branch:
-
-        $ git checkout master
-        $ git pull
-
-2.  Optionally push `master` to your fork in GitLab:
-
-        $ git push gitlab master
-    to keep it in sync.  The `git gitlab-push` script used to
-    [Share a Topic](#share-a-topic) below will also do this.
-
-Create a Topic
---------------
-
-All new work must be committed on topic branches.
-Name topics like you might name functions: concise but precise.
-A reader should have a general idea of the feature or fix to be developed given just the branch name.
-
-1.  To start a new topic branch:
-
-        $ git fetch origin
-
-2.  For new development, start the topic from `origin/master`:
-
-        $ git checkout -b my-topic origin/master
-
-    For release branch fixes, start the topic from `origin/release`, and
-    by convention use a topic name starting in `release-`:
-
-        $ git checkout -b release-my-topic origin/release
-
-3.  Edit files and create commits (repeat as needed):
-
-        $ edit file1 file2 file3
-        $ git add file1 file2 file3
-        $ git commit
-
-    Caveats:
-    * To add data follow [these instructions](data.md).
-    * If your change modifies the `Utilities/KWSys/vtksys` directory please
-      contribute directly to [KWSys][] instead.
-    * If your change modifies the `Utilities/MetaIO/vtkmetaio` directory please
-      contribute directly to [MetaIO][] instead.
-
-[KWSys]: http://public.kitware.com/Wiki/KWSys/Git
-[MetaIO]: https://github.com/Kitware/MetaIO
-
-Share a Topic
--------------
-
-When a topic is ready for review and possible inclusion, share it by pushing
-to a fork of your repository in GitLab.  Be sure you have registered and
-signed in for [GitLab Access][] and created your fork by visiting the main
-[VTK GitLab][] repository page and using the "Fork" button in the upper right.
-
-[VTK GitLab]: https://gitlab.kitware.com/vtk/vtk
-
-1.  Checkout the topic if it is not your current branch:
-
-        $ git checkout my-topic
-
-2.  Check what commits will be pushed to your fork in GitLab:
-
-        $ git prepush
-
-3.  Push commits in your topic branch to your fork in GitLab:
-
-        $ git gitlab-push
-
-    Notes:
-    * If you are revising a previously pushed topic and have rewritten the
-      topic history, add `-f` or `--force` to overwrite the destination.
-    * If the topic adds data see [this note](data.md#push).
-    * The `gitlab-push` script also pushes the `master` branch to your
-      fork in GitLab to keep it in sync with the upstream `master`.
-
-    The output will include a link to the topic branch in your fork in GitLab
-    and a link to a page for creating a Merge Request.
-
-Create a Merge Request
-----------------------
-
-(If you already created a merge request for a given topic and have reached
-this step after revising it, skip to the [next step](#review-a-merge-request).)
-
-Visit your fork in GitLab, browse to the "**Merge Requests**" link on the
-left, and use the "**New Merge Request**" button in the upper right to
-reach the URL printed at the end of the [previous step](#share-a-topic).
-It should be of the form:
-
-    https://gitlab.kitware.com/<username>/vtk/merge_requests/new
-
-Follow these steps:
-
-1.  In the "**Source branch**" box select the `<username>/vtk` repository
-    and the `my-topic` branch.
-
-2.  In the "**Target branch**" box select the `vtk/vtk` repository and
-    the `master` branch.  It should be the default.
-
-    If your change is a fix for the `release` branch, you should still
-    select the `master` branch as the target because the change needs
-    to end up there too.
-
-3.  Use the "**Compare branches**" button to proceed to the next page
-    and fill out the merge request creation form.
-
-4.  In the "**Title**" field provide a one-line summary of the entire
-    topic.  This will become the title of the Merge Request.
-
-    Example Merge Request Title:
-
-        Wrapping: Add Java 1.x support
-
-5.  In the "**Description**" field provide a high-level description
-    of the change the topic makes and any relevant information about
-    how to try it.
-    *   Use `@username` syntax to draw attention of specific developers.
-        This syntax may be used anywhere outside literal text and code
-        blocks.  Or, wait until the [next step](#review-a-merge-request)
-        and add comments to draw attention of developers.
-    *   If your change is a fix for the `release` branch, indicate this
-        so that a maintainer knows it should be merged to `release`.
-    *   Optionally use a fenced code block with type `message` to specify
-        text to be included in the generated merge commit message when the
-        topic is [merged](#merge-a-topic).
-
-    Example Merge Request Description:
-
-        This branch requires Java 1.x which is not generally available yet.
-        Get Java 1.x from ... in order to try these changes.
-
-        ```message
-        Add support for Java 1.x to the wrapping infrastructure.
-        ```
-
-        Cc: @user1 @user2
-
-6.  The "**Assign to**", "**Milestone**", and "**Labels**" fields
-    may be left blank.
-
-7.  Use the "**Submit merge request**" button to create the merge request
-    and visit its page.
-
-Review a Merge Request
-----------------------
-
-Add comments mentioning specific developers using `@username` syntax to
-draw their attention and have the topic reviewed.  After typing `@` and
-some text, GitLab will offer completions for developers whose real names
-or user names match.
-
-Comments use [GitLab Flavored Markdown][] for formatting.  See GitLab
-documentation on [Special GitLab References][] to add links to things
-like merge requests and commits in other repositories.
-
-[GitLab Flavored Markdown]: https://gitlab.kitware.com/help/markdown/markdown
-[Special GitLab References]: https://gitlab.kitware.com/help/markdown/markdown#special-gitlab-references
-
-### Human Reviews ###
-
-Reviewers may add comments providing feedback or to acknowledge their
-approval.  Lines of specific forms will be extracted during
-[merging](#merge-a-topic) and included as trailing lines of the
-generated merge commit message:
-
-The *leading* line of a comment may optionally be exactly one of the
-following votes followed by nothing but whitespace before the end
-of the line:
-
-*   `-1` or :-1: (`:-1:`) means "The change is not ready for integration."
-*   `+1` or :+1: (`:+1:`) means "I like the change but defer to others."
-*   `+2` means "The change is ready for integration."
-*   `+3` means "I have tested the change and verified it works."
-
-The middle lines of a comment may be free-form [GitLab Flavored Markdown][].
-
-Zero or more *trailing* lines of a comment may each contain exactly one
-of the following votes followed by nothing but whitespace before the end
-of the line:
-
-*   `Rejected-by: me` means "The change is not ready for integration."
-*   `Acked-by: me` means "I like the change but defer to others."
-*   `Reviewed-by: me` means "The change is ready for integration."
-*   `Tested-by: me` means "I have tested the change and verified it works."
-
-Each `me` reference may instead be an `@username` reference or a full
-`Real Name <user at domain>` reference to credit someone else for performing
-the review.  References to `me` and `@username` will automatically be
-transformed into a real name and email address according to the user's
-GitLab account profile.
-
-#### Fetching Changes ####
-
-One may fetch the changes associated with a merge request by using
-the `git fetch` command line shown at the top of the Merge Request
-page.  It is of the form:
-
-    $ git fetch https://gitlab.kitware.com/$username/vtk.git $branch
-
-This updates the local `FETCH_HEAD` to refer to the branch.
-
-There are a few options for checking out the changes in a work tree:
-
-*   One may checkout the branch:
-
-        $ git checkout FETCH_HEAD -b $branch
-    or checkout the commit without creating a local branch:
-
-        $ git checkout FETCH_HEAD
-
-*   Or, one may cherry-pick the commits to minimize rebuild time:
-
-        $ git cherry-pick ..FETCH_HEAD
-
-### Robot Reviews ###
-
-The "Kitware Robot" automatically performs basic checks on the commits
-and adds a comment acknowledging or rejecting the topic.  This will be
-repeated automatically whenever the topic is pushed to your fork again.
-A re-check may be explicitly requested by adding a comment with the
-trailing line:
-
-    Do: check
-
-A topic cannot be [merged](#merge-a-topic) until the automatic review
-succeeds.
-
-### Testing ###
-
-VTK has a [buildbot](http://buildbot.net) instance watching for merge requests
-to test.  A developer must issue a command to buildbot to enable builds:
-
-    @buildbot test
-
-The buildbot user (@buildbot) will respond with a comment linking to the CDash
-results when it schedules builds.
-
-Revise a Topic
---------------
-
-If a topic is approved during GitLab review, skip to the
-[next step](#merge-a-topic).  Otherwise, revise the topic
-and push it back to GitLab for another review as follows:
-
-1.  Checkout the topic if it is not your current branch:
-
-        $ git checkout my-topic
-
-2.  To revise the `3`rd commit back on the topic:
-
-        $ git rebase -i HEAD~3
-
-    (Substitute the correct number of commits back, as low as `1`.)
-    Follow Git's interactive instructions.
-
-3.  Return to the [above step](#share-a-topic) to share the revised topic.
-
-Merge a Topic
--------------
-
-After a topic has been reviewed and approved in a GitLab Merge Request,
-authorized developers may add a comment of the form
-
-    Do: merge
-
-to ask that the change be merged into the upstream repository.  By
-convention, do not request a merge if any `-1` or `Rejected-by:`
-review comments have not been resolved and superseded by at least
-`+1` or `Acked-by:` review comments from the same user.
-
-### Merge Success ###
-
-If the merge succeeds the topic will appear in the upstream repository
-`master` branch and the Merge Request will be closed automatically.
-
-### Merge Failure ###
-
-If the merge fails (likely due to a conflict), a comment will be added
-describing the failure.  In the case of a conflict, fetch the latest
-upstream history and rebase on it:
-
-    $ git fetch origin
-    $ git rebase origin/master
-
-(If you are fixing a bug in the latest release then substitute
-`origin/release` for `origin/master`.)
-
-Return to the [above step](#share-a-topic) to share the revised topic.
-
-Delete a Topic
---------------
-
-After a topic has been merged upstream the Merge Request will be closed.
-Now you may delete your copies of the branch.
-
-1.  In the GitLab Merge Request page a "**Remove Source Branch**"
-    button will appear.  Use it to delete the `my-topic` branch
-    from your fork in GitLab.
-
-2.  In your work tree checkout and update the `master` branch:
-
-        $ git checkout master
-        $ git pull
-
-3.  Delete the local topic branch:
-
-        $ git branch -d my-topic
-
-    The `branch -d` command works only when the topic branch has been
-    correctly merged.  Use `-D` instead of `-d` to force the deletion
-    of an unmerged topic branch (warning - you could lose commits).
diff --git a/Documentation/dev/git/download.md b/Documentation/dev/git/download.md
deleted file mode 100644
index dd8c999..0000000
--- a/Documentation/dev/git/download.md
+++ /dev/null
@@ -1,50 +0,0 @@
-Download VTK with Git
-=====================
-
-This page documents how to download VTK source code through [Git][].
-See the [README](README.md) for more information.
-
-[Git]: http://git-scm.com
-
-Clone
------
-
-Clone VTK using the commands:
-
-    $ git clone https://gitlab.kitware.com/vtk/vtk.git VTK
-    $ cd VTK
-
-Update
-------
-
-Users that have made no local changes and simply want to update a
-clone with the latest changes may run:
-
-    $ git pull
-
-Avoid making local changes unless you have read our [developer instructions][].
-
-[developer instructions]: develop.md
-
-Release
--------
-
-After cloning your local repository will be configured to follow the upstream
-`master` branch by default.  One may create a local branch to track the
-upstream `release` branch instead, which should guarantee only bug fixes to
-the functionality available in the latest release:
-
-    $ git checkout --track -b release origin/release
-
-This local branch will always follow the latest release.
-Use the [above instructions](#update) to update it.
-Alternatively one may checkout a specific release tag:
-
-    $ git checkout v6.2.0
-
-Release tags never move.  Repeat the command with a different tag to get a
-different release.  One may list available tags:
-
-    $ git tag
-
-and then checkout any tag listed.
diff --git a/Domains/Chemistry/Testing/Cxx/CMakeLists.txt b/Domains/Chemistry/Testing/Cxx/CMakeLists.txt
index 0d13a8a..c16245e 100644
--- a/Domains/Chemistry/Testing/Cxx/CMakeLists.txt
+++ b/Domains/Chemistry/Testing/Cxx/CMakeLists.txt
@@ -21,12 +21,3 @@ vtk_add_test_cxx(${vtk-module}CxxTests tests
 vtk_test_cxx_executable(${vtk-module}CxxTests tests
   RENDERING_FACTORY
   )
-
-# On some machines this test takes 260ish seconds to complete, this allows for
-# some extra time
-if(NOT VTK_TEST_TIMEOUT_TestPDBBallAndStick)
-  set(VTK_TEST_TIMEOUT_TestPDBBallAndStick 360)
-endif()
-set_tests_properties(${vtk-module}Cxx-TestPDBBallAndStick
-    PROPERTIES TIMEOUT ${VTK_TEST_TIMEOUT_TestPDBBallAndStick}
-               RUN_SERIAL ON)
diff --git a/Domains/Chemistry/Testing/Cxx/TestPeriodicTable.cxx b/Domains/Chemistry/Testing/Cxx/TestPeriodicTable.cxx
index 954dbe8..533e06d 100644
--- a/Domains/Chemistry/Testing/Cxx/TestPeriodicTable.cxx
+++ b/Domains/Chemistry/Testing/Cxx/TestPeriodicTable.cxx
@@ -141,7 +141,7 @@ int TestPeriodicTable(int , char * [])
     }
 
   float rgb[3];
-  float expectedRgb[3] = { 1, 0.05f, 0.05f };
+  float expectedRgb[3] = { 1, 0.05, 0.05 };
   pTab->GetDefaultRGBTuple(8, rgb);
   if (rgb[0] != expectedRgb[0] || rgb[1] != expectedRgb[1] ||
       rgb[2] != expectedRgb[2])
diff --git a/Domains/Chemistry/vtkMoleculeMapper.cxx b/Domains/Chemistry/vtkMoleculeMapper.cxx
index 2a01b11..f93833f 100644
--- a/Domains/Chemistry/vtkMoleculeMapper.cxx
+++ b/Domains/Chemistry/vtkMoleculeMapper.cxx
@@ -355,7 +355,6 @@ void vtkMoleculeMapper::UpdateAtomGlyphPolyData()
     default:
       vtkWarningMacro(<<"Unknown radius type: " << this->AtomicRadiusType
                       <<". Falling back to 'VDWRadius' ("<<VDWRadius<<").");
-      VTK_FALLTHROUGH;
     case VDWRadius:
       for (vtkIdType i = 0; i < numAtoms; ++i)
         {
diff --git a/Domains/Chemistry/vtkOpenQubeMoleculeSource.cxx b/Domains/Chemistry/vtkOpenQubeMoleculeSource.cxx
index 8219f98..b607670 100644
--- a/Domains/Chemistry/vtkOpenQubeMoleculeSource.cxx
+++ b/Domains/Chemistry/vtkOpenQubeMoleculeSource.cxx
@@ -42,7 +42,7 @@ vtkOpenQubeMoleculeSource::vtkOpenQubeMoleculeSource()
 vtkOpenQubeMoleculeSource::~vtkOpenQubeMoleculeSource()
 {
   this->SetFileName(NULL);
-  if (this->CleanUpBasisSet)
+  if (this->CleanUpBasisSet && this->BasisSet != NULL)
     {
     delete this->BasisSet;
     this->BasisSet = NULL;
@@ -68,7 +68,7 @@ void vtkOpenQubeMoleculeSource::SetBasisSet(OpenQube::BasisSet *b)
                 << "): setting BasisSet to " << b);
   if (this->BasisSet != b)
     {
-    if (this->CleanUpBasisSet)
+    if (this->CleanUpBasisSet && this->BasisSet != NULL)
       {
       delete this->BasisSet;
       }
diff --git a/Domains/ChemistryOpenGL2/glsl/vtkSphereMapperVS.glsl b/Domains/ChemistryOpenGL2/glsl/vtkSphereMapperVS.glsl
index 2cf5373..accbf69 100644
--- a/Domains/ChemistryOpenGL2/glsl/vtkSphereMapperVS.glsl
+++ b/Domains/ChemistryOpenGL2/glsl/vtkSphereMapperVS.glsl
@@ -18,6 +18,13 @@
 // default precisions, or defining precisions to null
 //VTK::System::Dec
 
+// all variables that represent positions or directions have a suffix
+// indicating the coordinate system they are in. The possible values are
+// MC - Model Coordinates
+// WC - WC world coordinates
+// VC - View Coordinates
+// DC - Display Coordinates
+
 attribute vec4 vertexMC;
 attribute vec2 offsetMC;
 
@@ -38,9 +45,9 @@ uniform mat3 normalMatrix; // transform model coordinate directions to view coor
 // camera and actor matrix values
 //VTK::Camera::Dec
 
-varying vec4 vertexVCVSOutput;
-varying float radiusVCVSOutput;
-varying vec3 centerVCVSOutput;
+varying vec4 vertexVCClose;
+varying float radiusVC;
+varying vec3 centerVC;
 
 uniform int cameraParallel;
 
@@ -55,23 +62,23 @@ void main()
   //VTK::Clip::Impl
 
   // compute the projected vertex position
-  vertexVCVSOutput = MCVCMatrix * vertexMC;
-  centerVCVSOutput = vertexVCVSOutput.xyz;
-  radiusVCVSOutput = length(offsetMC)*0.5;
+  vertexVCClose = MCVCMatrix * vertexMC;
+  centerVC = vertexVCClose.xyz;
+  radiusVC = length(offsetMC)*0.5;
 
   // make the triangle face the camera
   if (cameraParallel == 0)
     {
-    vec3 dir = normalize(-vertexVCVSOutput.xyz);
+    vec3 dir = normalize(-vertexVCClose.xyz);
     vec3 base2 = normalize(cross(dir,vec3(1.0,0.0,0.0)));
     vec3 base1 = cross(base2,dir);
-    vertexVCVSOutput.xyz = vertexVCVSOutput.xyz + offsetMC.x*base1 + offsetMC.y*base2;
+    vertexVCClose.xyz = vertexVCClose.xyz + offsetMC.x*base1 + offsetMC.y*base2;
     }
   else
     {
     // add in the offset
-    vertexVCVSOutput.xy = vertexVCVSOutput.xy + offsetMC;
+    vertexVCClose.xy = vertexVCClose.xy + offsetMC;
     }
 
-  gl_Position = VCDCMatrix * vertexVCVSOutput;
+  gl_Position = VCDCMatrix * vertexVCClose;
 }
diff --git a/Domains/ChemistryOpenGL2/glsl/vtkStickMapperVS.glsl b/Domains/ChemistryOpenGL2/glsl/vtkStickMapperVS.glsl
index 69d10dc..ce0649e 100644
--- a/Domains/ChemistryOpenGL2/glsl/vtkStickMapperVS.glsl
+++ b/Domains/ChemistryOpenGL2/glsl/vtkStickMapperVS.glsl
@@ -18,6 +18,13 @@
 // default precisions, or defining precisions to null
 //VTK::System::Dec
 
+// all variables that represent positions or directions have a suffix
+// indicating the coordinate system they are in. The possible values are
+// MC - Model Coordinates
+// WC - WC world coordinates
+// VC - View Coordinates
+// DC - Display Coordinates
+
 attribute vec4 vertexMC;
 attribute vec3 orientMC;
 attribute vec4 offsetMC;
@@ -42,11 +49,11 @@ uniform mat3 normalMatrix; // transform model coordinate directions to view coor
 // camera and actor matrix values
 //VTK::Camera::Dec
 
-varying vec4 vertexVCVSOutput;
-varying float radiusVCVSOutput;
-varying float lengthVCVSOutput;
-varying vec3 centerVCVSOutput;
-varying vec3 orientVCVSOutput;
+varying vec4 vertexVCClose;
+varying float radiusVC;
+varying float lengthVC;
+varying vec3 centerVC;
+varying vec3 orientVC;
 
 uniform int cameraParallel;
 
@@ -62,16 +69,16 @@ void main()
 
   //VTK::Clip::Impl
 
-  vertexVCVSOutput = MCVCMatrix * vertexMC;
-  centerVCVSOutput = vertexVCVSOutput.xyz;
-  radiusVCVSOutput = radiusMC;
-  lengthVCVSOutput = length(orientMC);
-  orientVCVSOutput = normalMatrix * normalize(orientMC);
+  vertexVCClose = MCVCMatrix * vertexMC;
+  centerVC = vertexVCClose.xyz;
+  radiusVC = radiusMC;
+  lengthVC = length(orientMC);
+  orientVC = normalMatrix * normalize(orientMC);
 
   // make sure it is pointing out of the screen
-  if (orientVCVSOutput.z < 0.0)
+  if (orientVC.z < 0.0)
     {
-    orientVCVSOutput = -orientVCVSOutput;
+    orientVC = -orientVC;
     }
 
   // make the basis
@@ -80,24 +87,24 @@ void main()
   vec3 dir = vec3(0.0,0.0,1.0);
   if (cameraParallel == 0)
     {
-    dir = normalize(-vertexVCVSOutput.xyz);
+    dir = normalize(-vertexVCClose.xyz);
     }
-  if (abs(dot(dir,orientVCVSOutput)) == 1.0)
+  if (abs(dot(dir,orientVC)) == 1.0)
     {
-    xbase = normalize(cross(vec3(0.0,1.0,0.0),orientVCVSOutput));
-    ybase = cross(xbase,orientVCVSOutput);
+    xbase = normalize(cross(vec3(0.0,1.0,0.0),orientVC));
+    ybase = cross(xbase,orientVC);
     }
   else
     {
-    xbase = normalize(cross(orientVCVSOutput,dir));
-    ybase = cross(orientVCVSOutput,xbase);
+    xbase = normalize(cross(orientVC,dir));
+    ybase = cross(orientVC,xbase);
     }
 
   vec3 offsets = offsetMC.xyz*2.0-1.0;
-  vertexVCVSOutput.xyz = vertexVCVSOutput.xyz +
-    radiusVCVSOutput*offsets.x*xbase +
-    radiusVCVSOutput*offsets.y*ybase +
-    0.5*lengthVCVSOutput*offsets.z*orientVCVSOutput;
+  vertexVCClose.xyz = vertexVCClose.xyz +
+    radiusVC*offsets.x*xbase +
+    radiusVC*offsets.y*ybase +
+    0.5*lengthVC*offsets.z*orientVC;
 
-  gl_Position = VCDCMatrix * vertexVCVSOutput;
+  gl_Position = VCDCMatrix * vertexVCClose;
 }
diff --git a/Domains/ChemistryOpenGL2/vtkOpenGLMoleculeMapper.h b/Domains/ChemistryOpenGL2/vtkOpenGLMoleculeMapper.h
index ba8f889..44e5064 100644
--- a/Domains/ChemistryOpenGL2/vtkOpenGLMoleculeMapper.h
+++ b/Domains/ChemistryOpenGL2/vtkOpenGLMoleculeMapper.h
@@ -54,4 +54,4 @@ private:
   void operator=(const vtkOpenGLMoleculeMapper&); // Not implemented.
 };
 
-#endif
+#endif
\ No newline at end of file
diff --git a/Domains/ChemistryOpenGL2/vtkOpenGLSphereMapper.cxx b/Domains/ChemistryOpenGL2/vtkOpenGLSphereMapper.cxx
index ca7dd9f..f2caa9c 100644
--- a/Domains/ChemistryOpenGL2/vtkOpenGLSphereMapper.cxx
+++ b/Domains/ChemistryOpenGL2/vtkOpenGLSphereMapper.cxx
@@ -13,15 +13,12 @@
 =========================================================================*/
 #include "vtkOpenGLSphereMapper.h"
 
-#include "vtkOpenGLHelper.h"
+#include "vtkglVBOHelper.h"
 
 #include "vtkMath.h"
 #include "vtkMatrix4x4.h"
 #include "vtkOpenGLActor.h"
 #include "vtkOpenGLCamera.h"
-#include "vtkOpenGLIndexBufferObject.h"
-#include "vtkOpenGLVertexArrayObject.h"
-#include "vtkOpenGLVertexBufferObject.h"
 #include "vtkObjectFactory.h"
 #include "vtkPointData.h"
 #include "vtkPolyData.h"
@@ -31,9 +28,7 @@
 
 #include "vtkSphereMapperVS.h"
 
-#include "vtk_glew.h"
-
-
+using vtkgl::substitute;
 
 //-----------------------------------------------------------------------------
 vtkStandardNewMacro(vtkOpenGLSphereMapper)
@@ -46,47 +41,50 @@ vtkOpenGLSphereMapper::vtkOpenGLSphereMapper()
 }
 
 //-----------------------------------------------------------------------------
-void vtkOpenGLSphereMapper::GetShaderTemplate(
-  std::map<vtkShader::Type, vtkShader *> shaders,
-  vtkRenderer *ren, vtkActor *actor)
+void vtkOpenGLSphereMapper::GetShaderTemplate(std::string &VSSource,
+  std::string &FSSource,
+  std::string &GSSource,
+  int lightComplexity, vtkRenderer* ren, vtkActor *actor)
 {
-  this->Superclass::GetShaderTemplate(shaders,ren,actor);
-  shaders[vtkShader::Vertex]->SetSource(vtkSphereMapperVS);
+  this->Superclass::GetShaderTemplate(VSSource,FSSource,GSSource,
+                                      lightComplexity,ren,actor);
+
+  VSSource = vtkSphereMapperVS;
 }
 
-void vtkOpenGLSphereMapper::ReplaceShaderValues(
-  std::map<vtkShader::Type, vtkShader *> shaders,
-  vtkRenderer *ren, vtkActor *actor)
+void vtkOpenGLSphereMapper::ReplaceShaderValues(std::string &VSSource,
+                                                 std::string &FSSource,
+                                                 std::string &GSSource,
+                                                 int lightComplexity,
+                                                 vtkRenderer* ren,
+                                                 vtkActor *actor)
 {
-  std::string VSSource = shaders[vtkShader::Vertex]->GetSource();
-  std::string FSSource = shaders[vtkShader::Fragment]->GetSource();
-
-  vtkShaderProgram::Substitute(VSSource,
+  substitute(VSSource,
     "//VTK::Camera::Dec",
     "uniform mat4 VCDCMatrix;\n"
     "uniform mat4 MCVCMatrix;");
 
-  vtkShaderProgram::Substitute(FSSource,
+  substitute(FSSource,
     "//VTK::PositionVC::Dec",
-    "varying vec4 vertexVCVSOutput;");
+    "varying vec4 vertexVCClose;");
 
   // for lights kit and positional the VCDC matrix is already defined
   // so don't redefine it
   std::string replacement =
     "uniform float invertedDepth;\n"
     "uniform int cameraParallel;\n"
-    "varying float radiusVCVSOutput;\n"
-    "varying vec3 centerVCVSOutput;\n"
+    "varying float radiusVC;\n"
+    "varying vec3 centerVC;\n"
     "uniform mat4 VCDCMatrix;\n";
-  vtkShaderProgram::Substitute(FSSource,"//VTK::Normal::Dec",replacement);
+  substitute(FSSource,"//VTK::Normal::Dec",replacement);
 
-  vtkShaderProgram::Substitute(FSSource,"//VTK::Normal::Impl",
+  substitute(FSSource,"//VTK::Normal::Impl",
     // compute the eye position and unit direction
-    "vec4 vertexVC = vertexVCVSOutput;\n"
+    "vec4 vertexVC = vertexVCClose;\n"
     "  vec3 EyePos;\n"
     "  vec3 EyeDir;\n"
     "  if (cameraParallel != 0) {\n"
-    "    EyePos = vec3(vertexVC.x, vertexVC.y, vertexVC.z + 3.0*radiusVCVSOutput);\n"
+    "    EyePos = vec3(vertexVC.x, vertexVC.y, vertexVC.z + 3.0*radiusVC);\n"
     "    EyeDir = vec3(0.0,0.0,-1.0); }\n"
     "  else {\n"
     "    EyeDir = vertexVC.xyz;\n"
@@ -95,38 +93,38 @@ void vtkOpenGLSphereMapper::ReplaceShaderValues(
     "    EyeDir = normalize(EyeDir);\n"
     // we adjust the EyePos to be closer if it is too far away
     // to prevent floating point precision noise
-    "    if (lengthED > radiusVCVSOutput*3.0) {\n"
-    "      EyePos = vertexVC.xyz - EyeDir*3.0*radiusVCVSOutput; }\n"
+    "    if (lengthED > radiusVC*3.0) {\n"
+    "      EyePos = vertexVC.xyz - EyeDir*3.0*radiusVC; }\n"
     "    }\n"
 
     // translate to Sphere center
-    "  EyePos = EyePos - centerVCVSOutput;\n"
+    "  EyePos = EyePos - centerVC;\n"
     // scale to radius 1.0
-    "  EyePos = EyePos/radiusVCVSOutput;\n"
+    "  EyePos = EyePos/radiusVC;\n"
     // find the intersection
     "  float b = 2.0*dot(EyePos,EyeDir);\n"
     "  float c = dot(EyePos,EyePos) - 1.0;\n"
     "  float d = b*b - 4.0*c;\n"
-    "  vec3 normalVCVSOutput = vec3(0.0,0.0,1.0);\n"
+    "  vec3 normalVC = vec3(0.0,0.0,1.0);\n"
     "  if (d < 0.0) { discard; }\n"
     "  else {\n"
     "    float t = (-b - invertedDepth*sqrt(d))*0.5;\n"
 
     // compute the normal, for unit sphere this is just
     // the intersection point
-    "    normalVCVSOutput = invertedDepth*normalize(EyePos + t*EyeDir);\n"
+    "    normalVC = invertedDepth*normalize(EyePos + t*EyeDir);\n"
     // compute the intersection point in VC
-    "    vertexVC.xyz = normalVCVSOutput*radiusVCVSOutput + centerVCVSOutput;\n"
+    "    vertexVC.xyz = normalVC*radiusVC + centerVC;\n"
     "    }\n"
     // compute the pixel's depth
-   // " normalVCVSOutput = vec3(0,0,1);\n"
+   // " normalVC = vec3(0,0,1);\n"
     "  vec4 pos = VCDCMatrix * vertexVC;\n"
     "  gl_FragDepth = (pos.z / pos.w + 1.0) / 2.0;\n"
     );
 
   if (ren->GetLastRenderingUsedDepthPeeling())
     {
-    vtkShaderProgram::Substitute(FSSource,
+    substitute(FSSource,
       "//VTK::DepthPeeling::Impl",
       "float odepth = texture2D(opaqueZTexture, gl_FragCoord.xy/screenSize).r;\n"
       "  if (gl_FragDepth >= odepth) { discard; }\n"
@@ -135,10 +133,8 @@ void vtkOpenGLSphereMapper::ReplaceShaderValues(
       );
     }
 
-  shaders[vtkShader::Vertex]->SetSource(VSSource);
-  shaders[vtkShader::Fragment]->SetSource(FSSource);
-
-  this->Superclass::ReplaceShaderValues(shaders,ren,actor);
+  this->Superclass::ReplaceShaderValues(VSSource,FSSource,GSSource,
+                                        lightComplexity,ren,actor);
 }
 
 //-----------------------------------------------------------------------------
@@ -150,7 +146,7 @@ vtkOpenGLSphereMapper::~vtkOpenGLSphereMapper()
 
 //-----------------------------------------------------------------------------
 void vtkOpenGLSphereMapper::SetCameraShaderParameters(
-  vtkOpenGLHelper &cellBO,
+  vtkgl::CellBO &cellBO,
   vtkRenderer* ren, vtkActor *actor)
 {
   vtkShaderProgram *program = cellBO.Program;
@@ -181,17 +177,17 @@ void vtkOpenGLSphereMapper::SetCameraShaderParameters(
 }
 
 //-----------------------------------------------------------------------------
-void vtkOpenGLSphereMapper::SetMapperShaderParameters(
-  vtkOpenGLHelper &cellBO,
-  vtkRenderer *ren, vtkActor *actor)
+void vtkOpenGLSphereMapper::SetMapperShaderParameters(vtkgl::CellBO &cellBO,
+                                                         vtkRenderer *ren, vtkActor *actor)
 {
-  if (cellBO.IBO->IndexCount && (this->VBOBuildTime > cellBO.AttributeUpdateTime ||
-      cellBO.ShaderSourceTime > cellBO.AttributeUpdateTime))
+  if (cellBO.indexCount && (this->VBOBuildTime > cellBO.attributeUpdateTime ||
+      cellBO.ShaderSourceTime > cellBO.attributeUpdateTime))
     {
-    cellBO.VAO->Bind();
-    if (!cellBO.VAO->AddAttributeArray(cellBO.Program, this->VBO,
-                                    "offsetMC", this->VBO->ColorOffset+sizeof(float),
-                                    this->VBO->Stride, VTK_FLOAT, 2, false))
+    vtkgl::VBOLayout &layout = this->Layout;
+    cellBO.vao.Bind();
+    if (!cellBO.vao.AddAttributeArray(cellBO.Program, this->VBO,
+                                    "offsetMC", layout.ColorOffset+sizeof(float),
+                                    layout.Stride, VTK_FLOAT, 2, false))
       {
       vtkErrorMacro(<< "Error setting 'offsetMC' in shader VAO.");
       }
@@ -211,28 +207,30 @@ void vtkOpenGLSphereMapper::PrintSelf(ostream& os, vtkIndent indent)
 namespace
 {
 // internal function called by CreateVBO
-void vtkOpenGLSphereMapperCreateVBO(float * points, vtkIdType numPts,
+vtkgl::VBOLayout vtkOpenGLSphereMapperCreateVBO(float * points, vtkIdType numPts,
               unsigned char *colors, int colorComponents,
               float *sizes,
-              vtkOpenGLVertexBufferObject *VBO)
+              vtkgl::BufferObject &vertexBuffer)
 {
+  vtkgl::VBOLayout layout;
   // Figure out how big each block will be, currently 6 or 7 floats.
   int blockSize = 3;
-  VBO->VertexOffset = 0;
-  VBO->NormalOffset = 0;
-  VBO->TCoordOffset = 0;
-  VBO->TCoordComponents = 0;
-  VBO->ColorComponents = colorComponents;
-  VBO->ColorOffset = sizeof(float) * blockSize;
+  layout.VertexOffset = 0;
+  layout.NormalOffset = 0;
+  layout.TCoordOffset = 0;
+  layout.TCoordComponents = 0;
+  layout.ColorComponents = colorComponents;
+  layout.ColorOffset = sizeof(float) * blockSize;
   ++blockSize;
 
   // two more floats
   blockSize += 2;
-  VBO->Stride = sizeof(float) * blockSize;
+  layout.Stride = sizeof(float) * blockSize;
 
   // Create a buffer, and copy the data over.
-  VBO->PackedVBO.resize(blockSize * numPts*3);
-  std::vector<float>::iterator it = VBO->PackedVBO.begin();
+  std::vector<float> packedVBO;
+  packedVBO.resize(blockSize * numPts*3);
+  std::vector<float>::iterator it = packedVBO.begin();
 
   float *pointPtr;
   unsigned char *colorPtr;
@@ -267,16 +265,14 @@ void vtkOpenGLSphereMapperCreateVBO(float * points, vtkIdType numPts,
     *(it++) = 0.0f;
     *(it++) = 2.0f*radius;
     }
-  VBO->Upload(VBO->PackedVBO, vtkOpenGLBufferObject::ArrayBuffer);
-  VBO->VertexCount = numPts*3;
-  return;
+  vertexBuffer.Upload(packedVBO, vtkgl::BufferObject::ArrayBuffer);
+  layout.VertexCount = numPts*3;
+  return layout;
 }
 }
 
 //-------------------------------------------------------------------------
-bool vtkOpenGLSphereMapper::GetNeedToRebuildBufferObjects(
-  vtkRenderer *vtkNotUsed(ren),
-  vtkActor *act)
+bool vtkOpenGLSphereMapper::GetNeedToRebuildBufferObjects(vtkRenderer *vtkNotUsed(ren), vtkActor *act)
 {
   // picking state does not require a rebuild, unlike our parent
   if (this->VBOBuildTime < this->GetMTime() ||
@@ -290,8 +286,7 @@ bool vtkOpenGLSphereMapper::GetNeedToRebuildBufferObjects(
 
 //-------------------------------------------------------------------------
 void vtkOpenGLSphereMapper::BuildBufferObjects(
-  vtkRenderer *vtkNotUsed(ren),
-  vtkActor *vtkNotUsed(act))
+  vtkRenderer *vtkNotUsed(ren), vtkActor *vtkNotUsed(act))
 {
   vtkPolyData *poly = this->CurrentInput;
 
@@ -310,19 +305,19 @@ void vtkOpenGLSphereMapper::BuildBufferObjects(
 
   // Iterate through all of the different types in the polydata, building OpenGLs
   // and IBOs as appropriate for each type.
-  vtkOpenGLSphereMapperCreateVBO(
-    static_cast<float *>(poly->GetPoints()->GetVoidPointer(0)),
-    poly->GetPoints()->GetNumberOfPoints(),
-    this->Colors ? (unsigned char *)this->Colors->GetVoidPointer(0) : NULL,
-    this->Colors ? this->Colors->GetNumberOfComponents() : 0,
-    static_cast<float *>(poly->GetPointData()->GetArray(this->ScaleArray)->GetVoidPointer(0)),
-    this->VBO);
+  this->Layout =
+    vtkOpenGLSphereMapperCreateVBO(static_cast<float *>(poly->GetPoints()->GetVoidPointer(0)),
+              poly->GetPoints()->GetNumberOfPoints(),
+              this->Colors ? (unsigned char *)this->Colors->GetVoidPointer(0) : NULL,
+              this->Colors ? this->Colors->GetNumberOfComponents() : 0,
+              static_cast<float *>(poly->GetPointData()->GetArray(this->ScaleArray)->GetVoidPointer(0)),
+              this->VBO);
 
   // create the IBO
-  this->Points.IBO->IndexCount = 0;
-  this->Lines.IBO->IndexCount = 0;
-  this->TriStrips.IBO->IndexCount = 0;
-  this->Tris.IBO->IndexCount = this->VBO->VertexCount;
+  this->Points.indexCount = 0;
+  this->Lines.indexCount = 0;
+  this->TriStrips.indexCount = 0;
+  this->Tris.indexCount = this->Layout.VertexCount;
 }
 
 
@@ -345,12 +340,14 @@ void vtkOpenGLSphereMapper::Render(vtkRenderer *ren, vtkActor *act)
 //-----------------------------------------------------------------------------
 void vtkOpenGLSphereMapper::RenderPieceDraw(vtkRenderer* ren, vtkActor *actor)
 {
+  vtkgl::VBOLayout &layout = this->Layout;
+
   // draw polygons
-  if (this->Tris.IBO->IndexCount)
+  if (this->Tris.indexCount)
     {
     // First we do the triangles, update the shader, set uniforms, etc.
-    this->UpdateShaders(this->Tris, ren, actor);
+    this->UpdateShader(this->Tris, ren, actor);
     glDrawArrays(GL_TRIANGLES, 0,
-                static_cast<GLuint>(this->VBO->VertexCount));
+                static_cast<GLuint>(layout.VertexCount));
     }
 }
diff --git a/Domains/ChemistryOpenGL2/vtkOpenGLSphereMapper.h b/Domains/ChemistryOpenGL2/vtkOpenGLSphereMapper.h
index 70f03f0..5ee8116 100644
--- a/Domains/ChemistryOpenGL2/vtkOpenGLSphereMapper.h
+++ b/Domains/ChemistryOpenGL2/vtkOpenGLSphereMapper.h
@@ -43,23 +43,27 @@ protected:
 
   // Description:
   // Create the basic shaders before replacement
-  virtual void GetShaderTemplate(
-    std::map<vtkShader::Type, vtkShader *> shaders,
-    vtkRenderer *ren, vtkActor *act);
+  virtual void GetShaderTemplate(std::string &VertexCode,
+                           std::string &fragmentCode,
+                           std::string &geometryCode,
+                           int lightComplexity,
+                           vtkRenderer *ren, vtkActor *act);
 
   // Description:
   // Perform string replacments on the shader templates
-  virtual void ReplaceShaderValues(
-    std::map<vtkShader::Type, vtkShader *> shaders,
-    vtkRenderer *ren, vtkActor *act);
+  virtual void ReplaceShaderValues(std::string &VertexCode,
+                           std::string &fragmentCode,
+                           std::string &geometryCode,
+                           int lightComplexity,
+                           vtkRenderer *ren, vtkActor *act);
 
   // Description:
   // Set the shader parameters related to the Camera
-  virtual void SetCameraShaderParameters(vtkOpenGLHelper &cellBO, vtkRenderer *ren, vtkActor *act);
+  virtual void SetCameraShaderParameters(vtkgl::CellBO &cellBO, vtkRenderer *ren, vtkActor *act);
 
   // Description:
   // Set the shader parameters related to the actor/mapper
-  virtual void SetMapperShaderParameters(vtkOpenGLHelper &cellBO, vtkRenderer *ren, vtkActor *act);
+  virtual void SetMapperShaderParameters(vtkgl::CellBO &cellBO, vtkRenderer *ren, vtkActor *act);
 
   const char *ScaleArray;
 
diff --git a/Domains/ChemistryOpenGL2/vtkOpenGLStickMapper.cxx b/Domains/ChemistryOpenGL2/vtkOpenGLStickMapper.cxx
index 73bd2cf..f1fc6cf 100644
--- a/Domains/ChemistryOpenGL2/vtkOpenGLStickMapper.cxx
+++ b/Domains/ChemistryOpenGL2/vtkOpenGLStickMapper.cxx
@@ -13,15 +13,12 @@
 =========================================================================*/
 #include "vtkOpenGLStickMapper.h"
 
-#include "vtkOpenGLHelper.h"
+#include "vtkglVBOHelper.h"
 
 #include "vtkMatrix3x3.h"
 #include "vtkMatrix4x4.h"
 #include "vtkOpenGLActor.h"
 #include "vtkOpenGLCamera.h"
-#include "vtkOpenGLIndexBufferObject.h"
-#include "vtkOpenGLVertexArrayObject.h"
-#include "vtkOpenGLVertexBufferObject.h"
 #include "vtkObjectFactory.h"
 #include "vtkPointData.h"
 #include "vtkPolyData.h"
@@ -32,9 +29,7 @@
 
 #include "vtkStickMapperVS.h"
 
-#include "vtk_glew.h"
-
-
+using vtkgl::substitute;
 
 //-----------------------------------------------------------------------------
 vtkStandardNewMacro(vtkOpenGLStickMapper)
@@ -48,50 +43,52 @@ vtkOpenGLStickMapper::vtkOpenGLStickMapper()
 }
 
 //-----------------------------------------------------------------------------
-void vtkOpenGLStickMapper::GetShaderTemplate(
-    std::map<vtkShader::Type, vtkShader *> shaders,
-    vtkRenderer *ren, vtkActor *actor)
+void vtkOpenGLStickMapper::GetShaderTemplate(std::string &VSSource,
+                                          std::string &FSSource,
+                                          std::string &GSSource,
+                                          int lightComplexity, vtkRenderer* ren, vtkActor *actor)
 {
-  this->Superclass::GetShaderTemplate(shaders,ren,actor);
-  shaders[vtkShader::Vertex]->SetSource(vtkStickMapperVS);
+  this->Superclass::GetShaderTemplate(VSSource,FSSource,GSSource,lightComplexity,ren,actor);
+
+  VSSource = vtkStickMapperVS;
 }
 
-void vtkOpenGLStickMapper::ReplaceShaderValues(
-    std::map<vtkShader::Type, vtkShader *> shaders,
-    vtkRenderer *ren, vtkActor *actor)
+void vtkOpenGLStickMapper::ReplaceShaderValues(std::string &VSSource,
+                                                 std::string &FSSource,
+                                                 std::string &GSSource,
+                                                 int lightComplexity,
+                                                 vtkRenderer* ren,
+                                                 vtkActor *actor)
 {
-  std::string VSSource = shaders[vtkShader::Vertex]->GetSource();
-  std::string FSSource = shaders[vtkShader::Fragment]->GetSource();
-
-  vtkShaderProgram::Substitute(VSSource,
+  substitute(VSSource,
     "//VTK::Camera::Dec",
     "uniform mat4 VCDCMatrix;\n"
     "uniform mat4 MCVCMatrix;");
 
-  vtkShaderProgram::Substitute(FSSource,
+  substitute(FSSource,
     "//VTK::PositionVC::Dec",
-    "varying vec4 vertexVCVSOutput;");
+    "varying vec4 vertexVCClose;");
 
   // for lights kit and positional the VCDC matrix is already defined
   // so don't redefine it
   std::string replacement =
     "uniform int cameraParallel;\n"
-    "varying float radiusVCVSOutput;\n"
-    "varying vec3 orientVCVSOutput;\n"
-    "varying float lengthVCVSOutput;\n"
-    "varying vec3 centerVCVSOutput;\n"
+    "varying float radiusVC;\n"
+    "varying vec3 orientVC;\n"
+    "varying float lengthVC;\n"
+    "varying vec3 centerVC;\n"
     "uniform mat4 VCDCMatrix;\n";
-  vtkShaderProgram::Substitute(FSSource,"//VTK::Normal::Dec",replacement);
+  substitute(FSSource,"//VTK::Normal::Dec",replacement);
 
 
   // see https://www.cl.cam.ac.uk/teaching/1999/AGraphHCI/SMAG/node2.html
-  vtkShaderProgram::Substitute(FSSource,"//VTK::Normal::Impl",
+  substitute(FSSource,"//VTK::Normal::Impl",
     // compute the eye position and unit direction
-    "  vec4 vertexVC = vertexVCVSOutput;\n"
+    "  vec4 vertexVC = vertexVCClose;\n"
     "  vec3 EyePos;\n"
     "  vec3 EyeDir;\n"
     "  if (cameraParallel != 0) {\n"
-    "    EyePos = vec3(vertexVC.x, vertexVC.y, vertexVC.z + 3.0*radiusVCVSOutput);\n"
+    "    EyePos = vec3(vertexVC.x, vertexVC.y, vertexVC.z + 3.0*radiusVC);\n"
     "    EyeDir = vec3(0.0,0.0,-1.0); }\n"
     "  else {\n"
     "    EyeDir = vertexVC.xyz;\n"
@@ -100,55 +97,55 @@ void vtkOpenGLStickMapper::ReplaceShaderValues(
     "    EyeDir = normalize(EyeDir);\n"
     // we adjust the EyePos to be closer if it is too far away
     // to prevent floating point precision noise
-    "    if (lengthED > radiusVCVSOutput*3.0) {\n"
-    "      EyePos = vertexVC.xyz - EyeDir*3.0*radiusVCVSOutput; }\n"
+    "    if (lengthED > radiusVC*3.0) {\n"
+    "      EyePos = vertexVC.xyz - EyeDir*3.0*radiusVC; }\n"
     "    }\n"
 
     // translate to Cylinder center
-    "  EyePos = EyePos - centerVCVSOutput;\n"
+    "  EyePos = EyePos - centerVC;\n"
 
     // rotate to new basis
     // base1, base2, orientVC
     "  vec3 base1;\n"
-    "  if (abs(orientVCVSOutput.z) < 0.99) {\n"
-    "    base1 = normalize(cross(orientVCVSOutput,vec3(0.0,0.0,1.0))); }\n"
+    "  if (abs(orientVC.z) < 0.99) {\n"
+    "    base1 = normalize(cross(orientVC,vec3(0.0,0.0,1.0))); }\n"
     "  else {\n"
-    "    base1 = normalize(cross(orientVCVSOutput,vec3(0.0,1.0,0.0))); }\n"
-    "  vec3 base2 = cross(orientVCVSOutput,base1);\n"
-    "  EyePos = vec3(dot(EyePos,base1),dot(EyePos,base2),dot(EyePos,orientVCVSOutput));\n"
-    "  EyeDir = vec3(dot(EyeDir,base1),dot(EyeDir,base2),dot(EyeDir,orientVCVSOutput));\n"
+    "    base1 = normalize(cross(orientVC,vec3(0.0,1.0,0.0))); }\n"
+    "  vec3 base2 = cross(orientVC,base1);\n"
+    "  EyePos = vec3(dot(EyePos,base1),dot(EyePos,base2),dot(EyePos,orientVC));\n"
+    "  EyeDir = vec3(dot(EyeDir,base1),dot(EyeDir,base2),dot(EyeDir,orientVC));\n"
 
     // scale by radius
-    "  EyePos = EyePos/radiusVCVSOutput;\n"
+    "  EyePos = EyePos/radiusVC;\n"
 
     // find the intersection
     "  float a = EyeDir.x*EyeDir.x + EyeDir.y*EyeDir.y;\n"
     "  float b = 2.0*(EyePos.x*EyeDir.x + EyePos.y*EyeDir.y);\n"
     "  float c = EyePos.x*EyePos.x + EyePos.y*EyePos.y - 1.0;\n"
     "  float d = b*b - 4.0*a*c;\n"
-    "  vec3 normalVCVSOutput = vec3(0.0,0.0,1.0);\n"
+    "  vec3 normalVC = vec3(0.0,0.0,1.0);\n"
     "  if (d < 0.0) { discard; }\n"
     "  else {\n"
     "    float t =  (-b - sqrt(d))/(2.0*a);\n"
     "    float tz = EyePos.z + t*EyeDir.z;\n"
     "    vec3 iPoint = EyePos + t*EyeDir;\n"
-    "    if (abs(iPoint.z)*radiusVCVSOutput > lengthVCVSOutput*0.5) {\n"
+    "    if (abs(iPoint.z)*radiusVC > lengthVC*0.5) {\n"
     // test for end cap
     "      float t2 = (-b + sqrt(d))/(2.0*a);\n"
     "      float tz2 = EyePos.z + t2*EyeDir.z;\n"
-    "      if (tz2*radiusVCVSOutput > lengthVCVSOutput*0.5 || tz*radiusVCVSOutput < -0.5*lengthVCVSOutput) { discard; }\n"
+    "      if (tz2*radiusVC > lengthVC*0.5 || tz*radiusVC < -0.5*lengthVC) { discard; }\n"
     "      else {\n"
-    "        normalVCVSOutput = orientVCVSOutput;\n"
-    "        float t3 = (lengthVCVSOutput*0.5/radiusVCVSOutput - EyePos.z)/EyeDir.z;\n"
+    "        normalVC = orientVC;\n"
+    "        float t3 = (lengthVC*0.5/radiusVC - EyePos.z)/EyeDir.z;\n"
     "        iPoint = EyePos + t3*EyeDir;\n"
-    "        vertexVC.xyz = radiusVCVSOutput*(iPoint.x*base1 + iPoint.y*base2 + iPoint.z*orientVCVSOutput) + centerVCVSOutput;\n"
+    "        vertexVC.xyz = radiusVC*(iPoint.x*base1 + iPoint.y*base2 + iPoint.z*orientVC) + centerVC;\n"
     "        }\n"
     "      }\n"
     "    else {\n"
     // The normal is the iPoint.xy rotated back into VC
-    "      normalVCVSOutput = iPoint.x*base1 + iPoint.y*base2;\n"
+    "      normalVC = iPoint.x*base1 + iPoint.y*base2;\n"
     // rescale rerotate and translate
-    "      vertexVC.xyz = radiusVCVSOutput*(normalVCVSOutput + iPoint.z*orientVCVSOutput) + centerVCVSOutput;\n"
+    "      vertexVC.xyz = radiusVC*(normalVC + iPoint.z*orientVC) + centerVC;\n"
     "      }\n"
     "    }\n"
 
@@ -162,33 +159,33 @@ void vtkOpenGLStickMapper::ReplaceShaderValues(
   bool picking = (ren->GetRenderWindow()->GetIsPicking() || selector != NULL);
   if (picking)
     {
-    vtkShaderProgram::Substitute(VSSource,
+    substitute(VSSource,
       "//VTK::Picking::Dec",
       "attribute vec4 selectionId;\n"
-      "varying vec4 selectionIdVSOutput;");
-    vtkShaderProgram::Substitute(VSSource,
+      "varying vec4 selectionIdFrag;");
+    substitute(VSSource,
       "//VTK::Picking::Impl",
-      "selectionIdVSOutput = selectionId;");
-    vtkShaderProgram::Substitute(FSSource,
+      "selectionIdFrag = selectionId;");
+    substitute(FSSource,
       "//VTK::Picking::Dec",
       "uniform vec3 mapperIndex;\n"
-      "varying vec4 selectionIdVSOutput;");
-    vtkShaderProgram::Substitute(FSSource,
+      "varying vec4 selectionIdFrag;");
+    substitute(FSSource,
       "//VTK::Picking::Impl",
       "if (mapperIndex == vec3(0.0,0.0,0.0))\n"
       "    {\n"
-      "    gl_FragData[0] = vec4(selectionIdVSOutput.rgb, 1.0);\n"
+      "    gl_FragColor = vec4(selectionIdFrag.rgb, 1.0);\n"
       "    }\n"
       "  else\n"
       "    {\n"
-      "    gl_FragData[0] = vec4(mapperIndex,1.0);\n"
+      "    gl_FragColor = vec4(mapperIndex,1.0);\n"
       "    }"
       );
     }
 
   if (ren->GetLastRenderingUsedDepthPeeling())
     {
-    vtkShaderProgram::Substitute(FSSource,
+    substitute(FSSource,
       "//VTK::DepthPeeling::Impl",
       "float odepth = texture2D(opaqueZTexture, gl_FragCoord.xy/screenSize).r;\n"
       "  if (gl_FragDepth >= odepth) { discard; }\n"
@@ -197,10 +194,9 @@ void vtkOpenGLStickMapper::ReplaceShaderValues(
       );
     }
 
-  shaders[vtkShader::Vertex]->SetSource(VSSource);
-  shaders[vtkShader::Fragment]->SetSource(FSSource);
 
-  this->Superclass::ReplaceShaderValues(shaders,ren,actor);
+
+  this->Superclass::ReplaceShaderValues(VSSource,FSSource,GSSource,lightComplexity,ren,actor);
 }
 
 //-----------------------------------------------------------------------------
@@ -213,7 +209,7 @@ vtkOpenGLStickMapper::~vtkOpenGLStickMapper()
 
 
 //-----------------------------------------------------------------------------
-void vtkOpenGLStickMapper::SetCameraShaderParameters(vtkOpenGLHelper &cellBO,
+void vtkOpenGLStickMapper::SetCameraShaderParameters(vtkgl::CellBO &cellBO,
                                                     vtkRenderer* ren, vtkActor *actor)
 {
   vtkShaderProgram *program = cellBO.Program;
@@ -247,48 +243,47 @@ void vtkOpenGLStickMapper::SetCameraShaderParameters(vtkOpenGLHelper &cellBO,
 }
 
 //-----------------------------------------------------------------------------
-void vtkOpenGLStickMapper::SetMapperShaderParameters(
-  vtkOpenGLHelper &cellBO,
-  vtkRenderer *ren,
-  vtkActor *actor)
+void vtkOpenGLStickMapper::SetMapperShaderParameters(vtkgl::CellBO &cellBO,
+                                                         vtkRenderer *ren, vtkActor *actor)
 {
-  if (cellBO.IBO->IndexCount && (this->VBOBuildTime > cellBO.AttributeUpdateTime ||
-      cellBO.ShaderSourceTime > cellBO.AttributeUpdateTime))
+  if (cellBO.indexCount && (this->VBOBuildTime > cellBO.attributeUpdateTime ||
+      cellBO.ShaderSourceTime > cellBO.attributeUpdateTime))
     {
     vtkHardwareSelector* selector = ren->GetSelector();
     bool picking = (ren->GetRenderWindow()->GetIsPicking() || selector != NULL);
 
-    cellBO.VAO->Bind();
-    if (!cellBO.VAO->AddAttributeArray(cellBO.Program, this->VBO,
-                                    "orientMC", this->VBO->ColorOffset+sizeof(float),
-                                    this->VBO->Stride, VTK_FLOAT, 3, false))
+    vtkgl::VBOLayout &layout = this->Layout;
+    cellBO.vao.Bind();
+    if (!cellBO.vao.AddAttributeArray(cellBO.Program, this->VBO,
+                                    "orientMC", layout.ColorOffset+sizeof(float),
+                                    layout.Stride, VTK_FLOAT, 3, false))
       {
       vtkErrorMacro(<< "Error setting 'orientMC' in shader VAO.");
       }
-    if (!cellBO.VAO->AddAttributeArray(cellBO.Program, this->VBO,
-                                    "offsetMC", this->VBO->ColorOffset+4*sizeof(float),
-                                    this->VBO->Stride, VTK_UNSIGNED_CHAR, 3, false))
+    if (!cellBO.vao.AddAttributeArray(cellBO.Program, this->VBO,
+                                    "offsetMC", layout.ColorOffset+4*sizeof(float),
+                                    layout.Stride, VTK_UNSIGNED_CHAR, 3, false))
       {
       vtkErrorMacro(<< "Error setting 'offsetMC' in shader VAO.");
       }
-    if (!cellBO.VAO->AddAttributeArray(cellBO.Program, this->VBO,
-                                    "radiusMC", this->VBO->ColorOffset+5*sizeof(float),
-                                    this->VBO->Stride, VTK_FLOAT, 1, false))
+    if (!cellBO.vao.AddAttributeArray(cellBO.Program, this->VBO,
+                                    "radiusMC", layout.ColorOffset+5*sizeof(float),
+                                    layout.Stride, VTK_FLOAT, 1, false))
       {
       vtkErrorMacro(<< "Error setting 'radiusMC' in shader VAO.");
       }
     if (picking)
       {
-      if (!cellBO.VAO->AddAttributeArray(cellBO.Program, this->VBO,
-                                      "selectionId", this->VBO->ColorOffset+6*sizeof(float),
-                                      this->VBO->Stride, VTK_UNSIGNED_CHAR, 4, true))
+      if (!cellBO.vao.AddAttributeArray(cellBO.Program, this->VBO,
+                                      "selectionId", layout.ColorOffset+6*sizeof(float),
+                                      layout.Stride, VTK_UNSIGNED_CHAR, 4, true))
         {
         vtkErrorMacro(<< "Error setting 'selectionId' in shader VAO.");
         }
       }
     else
       {
-      cellBO.VAO->RemoveAttributeArray("selectionId");
+      cellBO.vao.RemoveAttributeArray("selectionId");
       }
     }
 
@@ -305,21 +300,22 @@ void vtkOpenGLStickMapper::PrintSelf(ostream& os, vtkIndent indent)
 namespace
 {
 // internal function called by CreateVBO
-void vtkOpenGLStickMapperCreateVBO(float * points, vtkIdType numPts,
+vtkgl::VBOLayout vtkOpenGLStickMapperCreateVBO(float * points, vtkIdType numPts,
               unsigned char *colors, int colorComponents,
               float *orients,
               float *sizes,
               vtkIdType *selectionIds,
-              vtkOpenGLVertexBufferObject *VBO)
+              vtkgl::BufferObject &vertexBuffer)
 {
+  vtkgl::VBOLayout layout;
   // Figure out how big each block will be, currently 6 or 7 floats.
   int blockSize = 3;
-  VBO->VertexOffset = 0;
-  VBO->NormalOffset = 0;
-  VBO->TCoordOffset = 0;
-  VBO->TCoordComponents = 0;
-  VBO->ColorComponents = colorComponents;
-  VBO->ColorOffset = sizeof(float) * blockSize;
+  layout.VertexOffset = 0;
+  layout.NormalOffset = 0;
+  layout.TCoordOffset = 0;
+  layout.TCoordComponents = 0;
+  layout.ColorComponents = colorComponents;
+  layout.ColorOffset = sizeof(float) * blockSize;
   ++blockSize;
 
   // three more floats for orient + 2 for offset + 1 for radius
@@ -328,23 +324,20 @@ void vtkOpenGLStickMapperCreateVBO(float * points, vtkIdType numPts,
     {
     blockSize++;
     }
-  VBO->Stride = sizeof(float) * blockSize;
+  layout.Stride = sizeof(float) * blockSize;
 
   // Create a buffer, and copy the data over.
-  VBO->PackedVBO.resize(blockSize * numPts * 6);
-  std::vector<float>::iterator it = VBO->PackedVBO.begin();
+  std::vector<float> packedVBO;
+  packedVBO.resize(blockSize * numPts * 6);
+  std::vector<float>::iterator it = packedVBO.begin();
 
   float *pointPtr;
   float *orientPtr;
   unsigned char *colorPtr;
 
-  vtkucfloat offsets;
-  offsets.c[3] = 0;
-  vtkucfloat selId;
-  selId.c[0] = 0;
-  selId.c[1] = 0;
-  selId.c[2] = 0;
-  selId.c[3] = 0;
+  unsigned char offsets[4];
+  offsets[3] = 0;
+  unsigned int selId = 0;
 
   for (vtkIdType i = 0; i < numPts; ++i)
     {
@@ -355,11 +348,7 @@ void vtkOpenGLStickMapperCreateVBO(float * points, vtkIdType numPts,
     float length = sizes[i*3];
     if (selectionIds)
       {
-      vtkIdType thisId = selectionIds[i] + 1;
-      selId.c[0] = thisId % 256;
-      selId.c[1] = (thisId >> 8) % 256;
-      selId.c[2] = (thisId >> 16) % 256;
-      selId.c[3] = 0;
+      selId = static_cast<unsigned int>(selectionIds[i]) + 1;
       }
 
     // Vertices
@@ -370,14 +359,14 @@ void vtkOpenGLStickMapperCreateVBO(float * points, vtkIdType numPts,
     *(it++) = orientPtr[0]*length;
     *(it++) = orientPtr[1]*length;
     *(it++) = orientPtr[2]*length;
-    offsets.c[0] = 0;
-    offsets.c[1] = 0;
-    offsets.c[2] = 0;
-    *(it++) = offsets.f;
+    offsets[0] = 0;
+    offsets[1] = 0;
+    offsets[2] = 0;
+    *(it++) = *reinterpret_cast<float *>(offsets);
     *(it++) = radius;
     if (selectionIds)
       {
-      *(it++) = selId.f;
+      *(it++) = *reinterpret_cast<float *>(&selId);
       }
 
     *(it++) = pointPtr[0];
@@ -387,14 +376,14 @@ void vtkOpenGLStickMapperCreateVBO(float * points, vtkIdType numPts,
     *(it++) = orientPtr[0]*length;
     *(it++) = orientPtr[1]*length;
     *(it++) = orientPtr[2]*length;
-    offsets.c[0] = 1;
-    offsets.c[1] = 0;
-    offsets.c[2] = 0;
-    *(it++) = offsets.f;
+    offsets[0] = 1;
+    offsets[1] = 0;
+    offsets[2] = 0;
+    *(it++) = *reinterpret_cast<float *>(offsets);
     *(it++) = radius;
     if (selectionIds)
       {
-      *(it++) = selId.f;
+      *(it++) = *reinterpret_cast<float *>(&selId);
       }
 
     *(it++) = pointPtr[0];
@@ -404,14 +393,14 @@ void vtkOpenGLStickMapperCreateVBO(float * points, vtkIdType numPts,
     *(it++) = orientPtr[0]*length;
     *(it++) = orientPtr[1]*length;
     *(it++) = orientPtr[2]*length;
-    offsets.c[0] = 1;
-    offsets.c[1] = 0;
-    offsets.c[2] = 1;
-    *(it++) = offsets.f;
+    offsets[0] = 1;
+    offsets[1] = 0;
+    offsets[2] = 1;
+    *(it++) = *reinterpret_cast<float *>(offsets);
     *(it++) = radius;
     if (selectionIds)
       {
-      *(it++) = selId.f;
+      *(it++) = *reinterpret_cast<float *>(&selId);
       }
 
     *(it++) = pointPtr[0];
@@ -421,14 +410,14 @@ void vtkOpenGLStickMapperCreateVBO(float * points, vtkIdType numPts,
     *(it++) = orientPtr[0]*length;
     *(it++) = orientPtr[1]*length;
     *(it++) = orientPtr[2]*length;
-    offsets.c[0] = 0;
-    offsets.c[1] = 0;
-    offsets.c[2] = 1;
-    *(it++) = offsets.f;
+    offsets[0] = 0;
+    offsets[1] = 0;
+    offsets[2] = 1;
+    *(it++) = *reinterpret_cast<float *>(offsets);
     *(it++) = radius;
     if (selectionIds)
       {
-      *(it++) = selId.f;
+      *(it++) = *reinterpret_cast<float *>(&selId);
       }
 
     *(it++) = pointPtr[0];
@@ -438,14 +427,14 @@ void vtkOpenGLStickMapperCreateVBO(float * points, vtkIdType numPts,
     *(it++) = orientPtr[0]*length;
     *(it++) = orientPtr[1]*length;
     *(it++) = orientPtr[2]*length;
-    offsets.c[0] = 1;
-    offsets.c[1] = 1;
-    offsets.c[2] = 1;
-    *(it++) = offsets.f;
+    offsets[0] = 1;
+    offsets[1] = 1;
+    offsets[2] = 1;
+    *(it++) = *reinterpret_cast<float *>(offsets);
     *(it++) = radius;
     if (selectionIds)
       {
-      *(it++) = selId.f;
+      *(it++) = *reinterpret_cast<float *>(&selId);
       }
 
     *(it++) = pointPtr[0];
@@ -455,24 +444,24 @@ void vtkOpenGLStickMapperCreateVBO(float * points, vtkIdType numPts,
     *(it++) = orientPtr[0]*length;
     *(it++) = orientPtr[1]*length;
     *(it++) = orientPtr[2]*length;
-    offsets.c[0] = 0;
-    offsets.c[1] = 1;
-    offsets.c[2] = 1;
-    *(it++) = offsets.f;
+    offsets[0] = 0;
+    offsets[1] = 1;
+    offsets[2] = 1;
+    *(it++) = *reinterpret_cast<float *>(offsets);
     *(it++) = radius;
     if (selectionIds)
       {
-      *(it++) = selId.f;
+      *(it++) = *reinterpret_cast<float *>(&selId);
       }
     }
-  VBO->Upload(VBO->PackedVBO, vtkOpenGLBufferObject::ArrayBuffer);
-  VBO->VertexCount = numPts*6;
-  return;
+  vertexBuffer.Upload(packedVBO, vtkgl::BufferObject::ArrayBuffer);
+  layout.VertexCount = numPts*6;
+  return layout;
 }
 }
 
 size_t vtkOpenGLStickMapperCreateTriangleIndexBuffer(
-  vtkOpenGLBufferObject *indexBuffer,
+  vtkgl::BufferObject &indexBuffer,
   int numPts)
 {
   std::vector<unsigned int> indexArray;
@@ -493,19 +482,21 @@ size_t vtkOpenGLStickMapperCreateTriangleIndexBuffer(
     indexArray.push_back(i*6+4);
     indexArray.push_back(i*6+5);
     }
-  indexBuffer->Upload(indexArray, vtkOpenGLBufferObject::ElementArrayBuffer);
+  indexBuffer.Upload(indexArray, vtkgl::BufferObject::ElementArrayBuffer);
   return indexArray.size();
 }
 
 //-------------------------------------------------------------------------
-bool vtkOpenGLStickMapper::GetNeedToRebuildBufferObjects(
-  vtkRenderer *vtkNotUsed(ren),
-  vtkActor *act)
+bool vtkOpenGLStickMapper::GetNeedToRebuildBufferObjects(vtkRenderer *ren, vtkActor *act)
 {
+  // picking state changing always requires a rebuild
+  vtkHardwareSelector* selector = ren->GetSelector();
+  bool picking = (ren->GetIsPicking() || selector != NULL);
+
   if (this->VBOBuildTime < this->GetMTime() ||
       this->VBOBuildTime < act->GetMTime() ||
       this->VBOBuildTime < this->CurrentInput->GetMTime() ||
-      this->VBOBuildTime < this->SelectionStateChanged)
+      this->LastSelectionState || picking)
     {
     return true;
     }
@@ -536,41 +527,43 @@ void vtkOpenGLStickMapper::BuildBufferObjects(vtkRenderer *ren,
 
   // Iterate through all of the different types in the polydata, building OpenGLs
   // and IBOs as appropriate for each type.
-  vtkOpenGLStickMapperCreateVBO(
-    static_cast<float *>(poly->GetPoints()->GetVoidPointer(0)),
-    poly->GetPoints()->GetNumberOfPoints(),
-    this->Colors ? (unsigned char *)this->Colors->GetVoidPointer(0) : NULL,
-    this->Colors ? this->Colors->GetNumberOfComponents() : 0,
-    static_cast<float *>(poly->GetPointData()->GetArray(this->OrientationArray)->GetVoidPointer(0)),
-    static_cast<float *>(poly->GetPointData()->GetArray(this->ScaleArray)->GetVoidPointer(0)),
-    picking ?
-      static_cast<vtkIdType *>(poly->GetPointData()->GetArray(this->SelectionIdArray)->GetVoidPointer(0))
-      : NULL,
-    this->VBO);
+  this->Layout =
+    vtkOpenGLStickMapperCreateVBO(static_cast<float *>(poly->GetPoints()->GetVoidPointer(0)),
+              poly->GetPoints()->GetNumberOfPoints(),
+              this->Colors ? (unsigned char *)this->Colors->GetVoidPointer(0) : NULL,
+              this->Colors ? this->Colors->GetNumberOfComponents() : 0,
+              static_cast<float *>(poly->GetPointData()->GetArray(this->OrientationArray)->GetVoidPointer(0)),
+              static_cast<float *>(poly->GetPointData()->GetArray(this->ScaleArray)->GetVoidPointer(0)),
+              picking ?
+                static_cast<vtkIdType *>(poly->GetPointData()->GetArray(this->SelectionIdArray)->GetVoidPointer(0))
+                : NULL,
+              this->VBO);
 
   // create the IBO
-  this->Points.IBO->IndexCount = 0;
-  this->Lines.IBO->IndexCount = 0;
-  this->TriStrips.IBO->IndexCount = 0;
-  this->Tris.IBO->IndexCount =
-    vtkOpenGLStickMapperCreateTriangleIndexBuffer(this->Tris.IBO,
+  this->Points.indexCount = 0;
+  this->Lines.indexCount = 0;
+  this->TriStrips.indexCount = 0;
+  this->Tris.indexCount =
+    vtkOpenGLStickMapperCreateTriangleIndexBuffer(this->Tris.ibo,
       poly->GetPoints()->GetNumberOfPoints());
 }
 
 //-----------------------------------------------------------------------------
 void vtkOpenGLStickMapper::RenderPieceDraw(vtkRenderer* ren, vtkActor *actor)
 {
+  vtkgl::VBOLayout &layout = this->Layout;
+
   // draw polygons
-  if (this->Tris.IBO->IndexCount)
+  if (this->Tris.indexCount)
     {
     // First we do the triangles, update the shader, set uniforms, etc.
-    this->UpdateShaders(this->Tris, ren, actor);
-    this->Tris.IBO->Bind();
+    this->UpdateShader(this->Tris, ren, actor);
+    this->Tris.ibo.Bind();
     glDrawRangeElements(GL_TRIANGLES, 0,
-                        static_cast<GLuint>(this->VBO->VertexCount - 1),
-                        static_cast<GLsizei>(this->Tris.IBO->IndexCount),
+                        static_cast<GLuint>(layout.VertexCount - 1),
+                        static_cast<GLsizei>(this->Tris.indexCount),
                         GL_UNSIGNED_INT,
                         reinterpret_cast<const GLvoid *>(NULL));
-    this->Tris.IBO->Release();
+    this->Tris.ibo.Release();
     }
 }
diff --git a/Domains/ChemistryOpenGL2/vtkOpenGLStickMapper.h b/Domains/ChemistryOpenGL2/vtkOpenGLStickMapper.h
index ccf963d..1fde760 100644
--- a/Domains/ChemistryOpenGL2/vtkOpenGLStickMapper.h
+++ b/Domains/ChemistryOpenGL2/vtkOpenGLStickMapper.h
@@ -47,23 +47,27 @@ protected:
 
   // Description:
   // Create the basic shaders before replacement
-  virtual void GetShaderTemplate(
-    std::map<vtkShader::Type, vtkShader *> shaders,
-    vtkRenderer *ren, vtkActor *act);
+  virtual void GetShaderTemplate(std::string &VertexCode,
+                           std::string &fragmentCode,
+                           std::string &geometryCode,
+                           int lightComplexity,
+                           vtkRenderer *ren, vtkActor *act);
 
   // Description:
   // Perform string replacments on the shader templates
-  virtual void ReplaceShaderValues(
-    std::map<vtkShader::Type, vtkShader *> shaders,
-    vtkRenderer *ren, vtkActor *act);
+  virtual void ReplaceShaderValues(std::string &VertexCode,
+                           std::string &fragmentCode,
+                           std::string &geometryCode,
+                           int lightComplexity,
+                           vtkRenderer *ren, vtkActor *act);
 
   // Description:
   // Set the shader parameters related to the Camera
-  virtual void SetCameraShaderParameters(vtkOpenGLHelper &cellBO, vtkRenderer *ren, vtkActor *act);
+  virtual void SetCameraShaderParameters(vtkgl::CellBO &cellBO, vtkRenderer *ren, vtkActor *act);
 
   // Description:
   // Set the shader parameters related to the actor/mapper
-  virtual void SetMapperShaderParameters(vtkOpenGLHelper &cellBO, vtkRenderer *ren, vtkActor *act);
+  virtual void SetMapperShaderParameters(vtkgl::CellBO &cellBO, vtkRenderer *ren, vtkActor *act);
 
   const char *ScaleArray;
   const char *OrientationArray;
diff --git a/Examples/GUI/Cocoa/CMakeLists.txt b/Examples/GUI/Cocoa/CMakeLists.txt
index c5e7080..c41eca7 100644
--- a/Examples/GUI/Cocoa/CMakeLists.txt
+++ b/Examples/GUI/Cocoa/CMakeLists.txt
@@ -56,7 +56,7 @@ add_executable(SimpleCocoaVTK MACOSX_BUNDLE ${SimpleCocoaVTK_SRCS} ${SimpleCocoa
 
 # Probably a better way to set the framework link libraries.
 target_link_libraries(SimpleCocoaVTK "-framework Cocoa -framework OpenGL"
-                      vtkRenderingOpenGL vtkInteractionStyle )
+                      vtkRenderingOpenGL vtkRenderingFreeTypeOpenGL vtkInteractionStyle )
 
 # Set a custom plist file for the app bundle
 set_target_properties(SimpleCocoaVTK PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${SimpleCocoaVTK_SOURCE_DIR}/Info-CMake.plist)
diff --git a/Examples/GUI/Cocoa/Documentation/Instructions.rtf b/Examples/GUI/Cocoa/Documentation/Instructions.rtf
index 8623463..37bbe2f 100644
--- a/Examples/GUI/Cocoa/Documentation/Instructions.rtf
+++ b/Examples/GUI/Cocoa/Documentation/Instructions.rtf
@@ -1,11 +1,11 @@
-{\rtf1\ansi\ansicpg1252\cocoartf1348\cocoasubrtf170
+{\rtf1\ansi\ansicpg1252\cocoartf1187\cocoasubrtf400
 \cocoascreenfonts1{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
 {\colortbl;\red255\green255\blue255;}
 \margl1440\margr1440\vieww21440\viewh21120\viewkind0
 \pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\tx7380\tx7940\tx8520\pardirnatural
 
-\f0\fs38 \cf0 SimpleCocoaVTK 1.9\
-2015-07-27\
+\f0\fs38 \cf0 SimpleCocoaVTK 1.8\
+2013-01-13\
 by: Sean McBride and Mike Jackson\
 
 \fs34 \
@@ -14,7 +14,7 @@ by: Sean McBride and Mike Jackson\
 1) you need Mac OS X 10.7 and Xcode 4.x or later installed on your Mac.\
 2) you need CMake 2.8.10 or later.\
 3) you need to know the basics of Xcode, CMake, VTK, and Cocoa already.\
-4) you have to build VTK 6.3 separately.  The Xcode project expects VTK to be built with certain options, see below.\
+4) you have to build VTK 6.0 (or later) separately.  This project expects VTK to be built with certain options, see below.\
 \
 \ul Purpose of Example:\
 \ulnone \
@@ -30,16 +30,17 @@ First, you need to build VTK.  SimpleCocoaVTK requires that you build VTK with t
 	BUILD_SHARED_LIBS				OFF                                                                                                                                         \
 	CMAKE_BUILD_TYPE				Debug                                                                                                                                       \
 \
-It is recommended to also use these options, and you should synchronize your choices with the SimpleCocoaVTK.xcconfig file:                                                                                                                                     	CMAKE_OSX_ARCHITECTURES			(as desired)\
+It is recommended to also use these options, and you should synchronize your choices with the SimpleCocoaVTK.xcconfig file:\
+	VTK_USE_SYSTEM_ZLIB					ON                                                                                                                                          	CMAKE_OSX_ARCHITECTURES			(as desired)\
 	CMAKE_OSX_SYSROOT						(as desired)\
 	CMAKE_OSX_DEPLOYMENT_TARGET		(as desired)\
 \
 The other settings are not so relevant or their defaults are fine.  If you've never built VTK before, please see Ryan Glover's excellent document here: <{\field{\*\fldinst{HYPERLINK "http://www.vtk.org/Wiki/Cocoa_VTK"}}{\fldrslt http://www.vtk.org/Wiki/Cocoa_VTK}}>.  Make sure you both build and install VTK!\
 \
-Next, you have to create two Source Trees in Xcode, named "vtk-debug-include" and "vtk-debug-lib".  Do this from Preferences > Locations > Source Trees.  Both should point to subfolders of where your installed VTK is.  If you install into the default /usr/local/, set them like so:\
+Next, you have to create two Source Trees in Xcode, named "vtk-debug-include" and "vtk-debug-lib".  Do this from Preferences > Locations > Source Trees.  Both should point to subfolders of where your installed VTK is.  The example in the VTK Wiki installs to "~/Development/VTKBuild".  So you would set them like so:\
 \
-	vtk-debug-include			/usr/local/include/vtk-6.3\
-	vtk-debug-lib				/usr/local/lib\
+	vtk-debug-include			~/Development/VTKBuild/include/vtk-6.2\
+	vtk-debug-lib				~/Development/VTKBuild/lib\
 \
 Note that the path changes depending on your version of VTK.  Basically, you want the source trees to match your CMAKE_INSTALL_PREFIX setting.\
 \
@@ -56,13 +57,6 @@ If you have any problems, please post to the vtkusers mailing list.\
 \ulnone \
 \pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\tx7380\tx7940\tx8520\pardirnatural
 
-\i \cf0 Changes in 1.9 (since 1.8)\
-\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\tx7380\tx7940\tx8520\pardirnatural
-
-\i0 \cf0 - updated for VTK 6.3.\
-\
-\pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\tx7380\tx7940\tx8520\pardirnatural
-
 \i \cf0 Changes in 1.8 (since 1.7)\
 \pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\tx7380\tx7940\tx8520\pardirnatural
 
diff --git a/Examples/GUI/Cocoa/PrefixHeader.pch b/Examples/GUI/Cocoa/PrefixHeader.pch
index 6835e53..e12dd73 100644
--- a/Examples/GUI/Cocoa/PrefixHeader.pch
+++ b/Examples/GUI/Cocoa/PrefixHeader.pch
@@ -1,10 +1,8 @@
 // This header is automatically #included in every source file in the Xcode project.
 
-// VTK 6 factory methods now require "auto-initialization".
-// <http://www.vtk.org/Wiki/VTK/VTK_6_Migration/Factories_now_require_defines>
 // Match the definitions used to build VTK.
 // Required for proper object factory initialization.
 // It happens automatically when building with CMake,
-// but not when building directly with Xcode.
-#define vtkRenderingCore_AUTOINIT 3(vtkInteractionStyle,vtkRenderingFreeType,vtkRenderingOpenGL)
+// but not when building with Xcode.
+#define vtkRenderingCore_AUTOINIT 4(vtkInteractionStyle,vtkRenderingFreeType,vtkRenderingFreeTypeOpenGL,vtkRenderingOpenGL)
 #define vtkRenderingVolume_AUTOINIT 1(vtkRenderingVolumeOpenGL)
diff --git a/Examples/GUI/Cocoa/SimpleCocoaVTK.xcodeproj/project.pbxproj b/Examples/GUI/Cocoa/SimpleCocoaVTK.xcodeproj/project.pbxproj
index 454d360..c1935e9 100644
--- a/Examples/GUI/Cocoa/SimpleCocoaVTK.xcodeproj/project.pbxproj
+++ b/Examples/GUI/Cocoa/SimpleCocoaVTK.xcodeproj/project.pbxproj
@@ -7,8 +7,9 @@
 	objects = {
 
 /* Begin PBXBuildFile section */
-		142CC7EC17133D3600FE6428 /* libvtkfreetype-6.3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 142CC7EB17133D3600FE6428 /* libvtkfreetype-6.3.a */; };
-		142CC7EE17133D4D00FE6428 /* libvtkftgl-6.3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 142CC7ED17133D4D00FE6428 /* libvtkftgl-6.3.a */; };
+		142CC7E917133C7000FE6428 /* libvtkRenderingFreeTypeOpenGL-6.2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 142CC7E817133C7000FE6428 /* libvtkRenderingFreeTypeOpenGL-6.2.a */; };
+		142CC7EC17133D3600FE6428 /* libvtkfreetype-6.2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 142CC7EB17133D3600FE6428 /* libvtkfreetype-6.2.a */; };
+		142CC7EE17133D4D00FE6428 /* libvtkftgl-6.2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 142CC7ED17133D4D00FE6428 /* libvtkftgl-6.2.a */; };
 		1454C0F1094E266D00F594FE /* MyDocument.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1454C0F0094E266D00F594FE /* MyDocument.mm */; };
 		1454C1D6094F306B00F594FE /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1454C1D5094F306B00F594FE /* OpenGL.framework */; };
 		1454C4360950A4A800F594FE /* BasicVTKView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1454C4350950A4A800F594FE /* BasicVTKView.mm */; };
@@ -16,51 +17,50 @@
 		14A3028D119E0C3200D75B9A /* MyDocument.xib in Resources */ = {isa = PBXBuildFile; fileRef = 14A3028B119E0C3200D75B9A /* MyDocument.xib */; };
 		14B86359113C3E4200C9B42E /* SimpleCocoaVTK.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 14B86358113C3E4200C9B42E /* SimpleCocoaVTK.xcconfig */; };
 		14B863A5113C436100C9B42E /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 14B863A4113C436100C9B42E /* IOKit.framework */; };
-		14D951A31B701A690012248C /* libvtkCommonColor-6.3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14D951A21B701A690012248C /* libvtkCommonColor-6.3.a */; };
-		14D951A51B701C9A0012248C /* libvtkzlib-6.3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14D951A41B701C9A0012248C /* libvtkzlib-6.3.a */; };
-		14FC3EAD16C5A02D0092149A /* libvtkRenderingCore-6.3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3EAC16C5A02D0092149A /* libvtkRenderingCore-6.3.a */; };
-		14FC3EAF16C5A0460092149A /* libvtkRenderingOpenGL-6.3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3EAE16C5A0460092149A /* libvtkRenderingOpenGL-6.3.a */; };
-		14FC3EB616C5A0E30092149A /* libvtkCommonCore-6.3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3EB016C5A0E30092149A /* libvtkCommonCore-6.3.a */; };
-		14FC3EB716C5A0E30092149A /* libvtkCommonDataModel-6.3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3EB116C5A0E30092149A /* libvtkCommonDataModel-6.3.a */; };
-		14FC3EB816C5A0E30092149A /* libvtkCommonExecutionModel-6.3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3EB216C5A0E30092149A /* libvtkCommonExecutionModel-6.3.a */; };
-		14FC3EB916C5A0E30092149A /* libvtkCommonMath-6.3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3EB316C5A0E30092149A /* libvtkCommonMath-6.3.a */; };
-		14FC3EBA16C5A0E30092149A /* libvtkCommonSystem-6.3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3EB416C5A0E30092149A /* libvtkCommonSystem-6.3.a */; };
-		14FC3EBB16C5A0E30092149A /* libvtkCommonTransforms-6.3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3EB516C5A0E30092149A /* libvtkCommonTransforms-6.3.a */; };
-		14FC3EBD16C5A1090092149A /* libvtkCommonMisc-6.3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3EBC16C5A1090092149A /* libvtkCommonMisc-6.3.a */; };
-		14FC3EC116C5A1230092149A /* libvtkIOCore-6.3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3EBE16C5A1230092149A /* libvtkIOCore-6.3.a */; };
-		14FC3EC216C5A1230092149A /* libvtkIOGeometry-6.3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3EBF16C5A1230092149A /* libvtkIOGeometry-6.3.a */; };
-		14FC3EC316C5A1230092149A /* libvtkIOImage-6.3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3EC016C5A1230092149A /* libvtkIOImage-6.3.a */; };
-		14FC3EC516C5A15F0092149A /* libvtkImagingCore-6.3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3EC416C5A15F0092149A /* libvtkImagingCore-6.3.a */; };
-		14FC3EC816C5A1810092149A /* libvtkImagingMorphological-6.3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3EC616C5A1810092149A /* libvtkImagingMorphological-6.3.a */; };
-		14FC3EC916C5A1810092149A /* libvtkImagingStencil-6.3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3EC716C5A1810092149A /* libvtkImagingStencil-6.3.a */; };
-		14FC3ECB16C5A1C20092149A /* libvtkRenderingFreeType-6.3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3ECA16C5A1C20092149A /* libvtkRenderingFreeType-6.3.a */; };
-		14FC3ECD16C5A8A20092149A /* libvtklibxml2-6.3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3ECC16C5A8A20092149A /* libvtklibxml2-6.3.a */; };
-		14FC3ED116C5A8C00092149A /* libvtkjpeg-6.3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3ECE16C5A8C00092149A /* libvtkjpeg-6.3.a */; };
-		14FC3ED216C5A8C00092149A /* libvtklibxml2-6.3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3ECF16C5A8C00092149A /* libvtklibxml2-6.3.a */; };
-		14FC3ED316C5A8C00092149A /* libvtkpng-6.3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3ED016C5A8C00092149A /* libvtkpng-6.3.a */; };
-		14FC3ED616C5A9030092149A /* libvtkIOXML-6.3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3ED416C5A9030092149A /* libvtkIOXML-6.3.a */; };
-		14FC3ED716C5A9030092149A /* libvtkIOXMLParser-6.3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3ED516C5A9030092149A /* libvtkIOXMLParser-6.3.a */; };
-		14FC3EDD16C5A92E0092149A /* libvtkFiltersCore-6.3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3ED816C5A92E0092149A /* libvtkFiltersCore-6.3.a */; };
-		14FC3EDE16C5A92F0092149A /* libvtkFiltersGeneral-6.3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3ED916C5A92E0092149A /* libvtkFiltersGeneral-6.3.a */; };
-		14FC3EDF16C5A92F0092149A /* libvtkFiltersGeneric-6.3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3EDA16C5A92E0092149A /* libvtkFiltersGeneric-6.3.a */; };
-		14FC3EE016C5A92F0092149A /* libvtkFiltersGeometry-6.3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3EDB16C5A92E0092149A /* libvtkFiltersGeometry-6.3.a */; };
-		14FC3EE116C5A92F0092149A /* libvtkFiltersSources-6.3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3EDC16C5A92E0092149A /* libvtkFiltersSources-6.3.a */; };
-		14FC3EE316C5A9470092149A /* libvtkexpat-6.3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3EE216C5A9470092149A /* libvtkexpat-6.3.a */; };
-		14FC3EE616C5A9690092149A /* libvtkInteractionImage-6.3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3EE416C5A9690092149A /* libvtkInteractionImage-6.3.a */; };
-		14FC3EE716C5A9690092149A /* libvtkInteractionStyle-6.3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3EE516C5A9690092149A /* libvtkInteractionStyle-6.3.a */; };
-		14FC3EEA16C5A9830092149A /* libvtksys-6.3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3EE816C5A9830092149A /* libvtksys-6.3.a */; };
-		14FC3EEB16C5A9830092149A /* libvtktiff-6.3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3EE916C5A9830092149A /* libvtktiff-6.3.a */; };
-		14FC3EEE16C5A9A60092149A /* libvtkFiltersExtraction-6.3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3EEC16C5A9A60092149A /* libvtkFiltersExtraction-6.3.a */; };
-		14FC3EEF16C5A9A60092149A /* libvtkmetaio-6.3.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3EED16C5A9A60092149A /* libvtkmetaio-6.3.a */; };
+		14FC3EAD16C5A02D0092149A /* libvtkRenderingCore-6.2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3EAC16C5A02D0092149A /* libvtkRenderingCore-6.2.a */; };
+		14FC3EAF16C5A0460092149A /* libvtkRenderingOpenGL-6.2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3EAE16C5A0460092149A /* libvtkRenderingOpenGL-6.2.a */; };
+		14FC3EB616C5A0E30092149A /* libvtkCommonCore-6.2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3EB016C5A0E30092149A /* libvtkCommonCore-6.2.a */; };
+		14FC3EB716C5A0E30092149A /* libvtkCommonDataModel-6.2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3EB116C5A0E30092149A /* libvtkCommonDataModel-6.2.a */; };
+		14FC3EB816C5A0E30092149A /* libvtkCommonExecutionModel-6.2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3EB216C5A0E30092149A /* libvtkCommonExecutionModel-6.2.a */; };
+		14FC3EB916C5A0E30092149A /* libvtkCommonMath-6.2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3EB316C5A0E30092149A /* libvtkCommonMath-6.2.a */; };
+		14FC3EBA16C5A0E30092149A /* libvtkCommonSystem-6.2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3EB416C5A0E30092149A /* libvtkCommonSystem-6.2.a */; };
+		14FC3EBB16C5A0E30092149A /* libvtkCommonTransforms-6.2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3EB516C5A0E30092149A /* libvtkCommonTransforms-6.2.a */; };
+		14FC3EBD16C5A1090092149A /* libvtkCommonMisc-6.2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3EBC16C5A1090092149A /* libvtkCommonMisc-6.2.a */; };
+		14FC3EC116C5A1230092149A /* libvtkIOCore-6.2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3EBE16C5A1230092149A /* libvtkIOCore-6.2.a */; };
+		14FC3EC216C5A1230092149A /* libvtkIOGeometry-6.2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3EBF16C5A1230092149A /* libvtkIOGeometry-6.2.a */; };
+		14FC3EC316C5A1230092149A /* libvtkIOImage-6.2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3EC016C5A1230092149A /* libvtkIOImage-6.2.a */; };
+		14FC3EC516C5A15F0092149A /* libvtkImagingCore-6.2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3EC416C5A15F0092149A /* libvtkImagingCore-6.2.a */; };
+		14FC3EC816C5A1810092149A /* libvtkImagingMorphological-6.2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3EC616C5A1810092149A /* libvtkImagingMorphological-6.2.a */; };
+		14FC3EC916C5A1810092149A /* libvtkImagingStencil-6.2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3EC716C5A1810092149A /* libvtkImagingStencil-6.2.a */; };
+		14FC3ECB16C5A1C20092149A /* libvtkRenderingFreeType-6.2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3ECA16C5A1C20092149A /* libvtkRenderingFreeType-6.2.a */; };
+		14FC3ECD16C5A8A20092149A /* libvtklibxml2-6.2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3ECC16C5A8A20092149A /* libvtklibxml2-6.2.a */; };
+		14FC3ED116C5A8C00092149A /* libvtkjpeg-6.2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3ECE16C5A8C00092149A /* libvtkjpeg-6.2.a */; };
+		14FC3ED216C5A8C00092149A /* libvtklibxml2-6.2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3ECF16C5A8C00092149A /* libvtklibxml2-6.2.a */; };
+		14FC3ED316C5A8C00092149A /* libvtkpng-6.2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3ED016C5A8C00092149A /* libvtkpng-6.2.a */; };
+		14FC3ED616C5A9030092149A /* libvtkIOXML-6.2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3ED416C5A9030092149A /* libvtkIOXML-6.2.a */; };
+		14FC3ED716C5A9030092149A /* libvtkIOXMLParser-6.2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3ED516C5A9030092149A /* libvtkIOXMLParser-6.2.a */; };
+		14FC3EDD16C5A92E0092149A /* libvtkFiltersCore-6.2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3ED816C5A92E0092149A /* libvtkFiltersCore-6.2.a */; };
+		14FC3EDE16C5A92F0092149A /* libvtkFiltersGeneral-6.2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3ED916C5A92E0092149A /* libvtkFiltersGeneral-6.2.a */; };
+		14FC3EDF16C5A92F0092149A /* libvtkFiltersGeneric-6.2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3EDA16C5A92E0092149A /* libvtkFiltersGeneric-6.2.a */; };
+		14FC3EE016C5A92F0092149A /* libvtkFiltersGeometry-6.2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3EDB16C5A92E0092149A /* libvtkFiltersGeometry-6.2.a */; };
+		14FC3EE116C5A92F0092149A /* libvtkFiltersSources-6.2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3EDC16C5A92E0092149A /* libvtkFiltersSources-6.2.a */; };
+		14FC3EE316C5A9470092149A /* libvtkexpat-6.2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3EE216C5A9470092149A /* libvtkexpat-6.2.a */; };
+		14FC3EE616C5A9690092149A /* libvtkInteractionImage-6.2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3EE416C5A9690092149A /* libvtkInteractionImage-6.2.a */; };
+		14FC3EE716C5A9690092149A /* libvtkInteractionStyle-6.2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3EE516C5A9690092149A /* libvtkInteractionStyle-6.2.a */; };
+		14FC3EEA16C5A9830092149A /* libvtksys-6.2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3EE816C5A9830092149A /* libvtksys-6.2.a */; };
+		14FC3EEB16C5A9830092149A /* libvtktiff-6.2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3EE916C5A9830092149A /* libvtktiff-6.2.a */; };
+		14FC3EEE16C5A9A60092149A /* libvtkFiltersExtraction-6.2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3EEC16C5A9A60092149A /* libvtkFiltersExtraction-6.2.a */; };
+		14FC3EEF16C5A9A60092149A /* libvtkmetaio-6.2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14FC3EED16C5A9A60092149A /* libvtkmetaio-6.2.a */; };
 		8D15AC320486D014006FF6A4 /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2A37F4B0FDCFA73011CA2CEA /* main.mm */; settings = {ATTRIBUTES = (); }; };
 		8D15AC340486D014006FF6A4 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A7FEA54F5311CA2CBB /* Cocoa.framework */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXFileReference section */
 		1058C7A7FEA54F5311CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
+		142CC7E817133C7000FE6428 /* libvtkRenderingFreeTypeOpenGL-6.2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkRenderingFreeTypeOpenGL-6.2.a"; sourceTree = "vtk-debug-lib"; };
 		142CC7EA17133CB300FE6428 /* PrefixHeader.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PrefixHeader.pch; sourceTree = "<group>"; };
-		142CC7EB17133D3600FE6428 /* libvtkfreetype-6.3.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkfreetype-6.3.a"; sourceTree = "vtk-debug-lib"; };
-		142CC7ED17133D4D00FE6428 /* libvtkftgl-6.3.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkftgl-6.3.a"; sourceTree = "vtk-debug-lib"; };
+		142CC7EB17133D3600FE6428 /* libvtkfreetype-6.2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkfreetype-6.2.a"; sourceTree = "vtk-debug-lib"; };
+		142CC7ED17133D4D00FE6428 /* libvtkftgl-6.2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkftgl-6.2.a"; sourceTree = "vtk-debug-lib"; };
 		1454C0EF094E266D00F594FE /* MyDocument.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MyDocument.h; sourceTree = SOURCE_ROOT; };
 		1454C0F0094E266D00F594FE /* MyDocument.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MyDocument.mm; sourceTree = SOURCE_ROOT; };
 		1454C1D5094F306B00F594FE /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = /System/Library/Frameworks/OpenGL.framework; sourceTree = "<absolute>"; };
@@ -70,42 +70,40 @@
 		14A3028B119E0C3200D75B9A /* MyDocument.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MyDocument.xib; sourceTree = "<group>"; };
 		14B86358113C3E4200C9B42E /* SimpleCocoaVTK.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = SimpleCocoaVTK.xcconfig; sourceTree = "<group>"; };
 		14B863A4113C436100C9B42E /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = /System/Library/Frameworks/IOKit.framework; sourceTree = "<absolute>"; };
-		14D951A21B701A690012248C /* libvtkCommonColor-6.3.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkCommonColor-6.3.a"; sourceTree = "vtk-debug-lib"; };
-		14D951A41B701C9A0012248C /* libvtkzlib-6.3.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkzlib-6.3.a"; sourceTree = "vtk-debug-lib"; };
-		14FC3EAC16C5A02D0092149A /* libvtkRenderingCore-6.3.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkRenderingCore-6.3.a"; sourceTree = "vtk-debug-lib"; };
-		14FC3EAE16C5A0460092149A /* libvtkRenderingOpenGL-6.3.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkRenderingOpenGL-6.3.a"; sourceTree = "vtk-debug-lib"; };
-		14FC3EB016C5A0E30092149A /* libvtkCommonCore-6.3.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkCommonCore-6.3.a"; sourceTree = "vtk-debug-lib"; };
-		14FC3EB116C5A0E30092149A /* libvtkCommonDataModel-6.3.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkCommonDataModel-6.3.a"; sourceTree = "vtk-debug-lib"; };
-		14FC3EB216C5A0E30092149A /* libvtkCommonExecutionModel-6.3.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkCommonExecutionModel-6.3.a"; sourceTree = "vtk-debug-lib"; };
-		14FC3EB316C5A0E30092149A /* libvtkCommonMath-6.3.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkCommonMath-6.3.a"; sourceTree = "vtk-debug-lib"; };
-		14FC3EB416C5A0E30092149A /* libvtkCommonSystem-6.3.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkCommonSystem-6.3.a"; sourceTree = "vtk-debug-lib"; };
-		14FC3EB516C5A0E30092149A /* libvtkCommonTransforms-6.3.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkCommonTransforms-6.3.a"; sourceTree = "vtk-debug-lib"; };
-		14FC3EBC16C5A1090092149A /* libvtkCommonMisc-6.3.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkCommonMisc-6.3.a"; sourceTree = "vtk-debug-lib"; };
-		14FC3EBE16C5A1230092149A /* libvtkIOCore-6.3.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkIOCore-6.3.a"; sourceTree = "vtk-debug-lib"; };
-		14FC3EBF16C5A1230092149A /* libvtkIOGeometry-6.3.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkIOGeometry-6.3.a"; sourceTree = "vtk-debug-lib"; };
-		14FC3EC016C5A1230092149A /* libvtkIOImage-6.3.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkIOImage-6.3.a"; sourceTree = "vtk-debug-lib"; };
-		14FC3EC416C5A15F0092149A /* libvtkImagingCore-6.3.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkImagingCore-6.3.a"; sourceTree = "vtk-debug-lib"; };
-		14FC3EC616C5A1810092149A /* libvtkImagingMorphological-6.3.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkImagingMorphological-6.3.a"; sourceTree = "vtk-debug-lib"; };
-		14FC3EC716C5A1810092149A /* libvtkImagingStencil-6.3.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkImagingStencil-6.3.a"; sourceTree = "vtk-debug-lib"; };
-		14FC3ECA16C5A1C20092149A /* libvtkRenderingFreeType-6.3.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkRenderingFreeType-6.3.a"; sourceTree = "vtk-debug-lib"; };
-		14FC3ECC16C5A8A20092149A /* libvtklibxml2-6.3.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtklibxml2-6.3.a"; sourceTree = "vtk-debug-lib"; };
-		14FC3ECE16C5A8C00092149A /* libvtkjpeg-6.3.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkjpeg-6.3.a"; sourceTree = "vtk-debug-lib"; };
-		14FC3ECF16C5A8C00092149A /* libvtklibxml2-6.3.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtklibxml2-6.3.a"; sourceTree = "vtk-debug-lib"; };
-		14FC3ED016C5A8C00092149A /* libvtkpng-6.3.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkpng-6.3.a"; sourceTree = "vtk-debug-lib"; };
-		14FC3ED416C5A9030092149A /* libvtkIOXML-6.3.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkIOXML-6.3.a"; sourceTree = "vtk-debug-lib"; };
-		14FC3ED516C5A9030092149A /* libvtkIOXMLParser-6.3.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkIOXMLParser-6.3.a"; sourceTree = "vtk-debug-lib"; };
-		14FC3ED816C5A92E0092149A /* libvtkFiltersCore-6.3.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkFiltersCore-6.3.a"; sourceTree = "vtk-debug-lib"; };
-		14FC3ED916C5A92E0092149A /* libvtkFiltersGeneral-6.3.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkFiltersGeneral-6.3.a"; sourceTree = "vtk-debug-lib"; };
-		14FC3EDA16C5A92E0092149A /* libvtkFiltersGeneric-6.3.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkFiltersGeneric-6.3.a"; sourceTree = "vtk-debug-lib"; };
-		14FC3EDB16C5A92E0092149A /* libvtkFiltersGeometry-6.3.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkFiltersGeometry-6.3.a"; sourceTree = "vtk-debug-lib"; };
-		14FC3EDC16C5A92E0092149A /* libvtkFiltersSources-6.3.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkFiltersSources-6.3.a"; sourceTree = "vtk-debug-lib"; };
-		14FC3EE216C5A9470092149A /* libvtkexpat-6.3.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkexpat-6.3.a"; sourceTree = "vtk-debug-lib"; };
-		14FC3EE416C5A9690092149A /* libvtkInteractionImage-6.3.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkInteractionImage-6.3.a"; sourceTree = "vtk-debug-lib"; };
-		14FC3EE516C5A9690092149A /* libvtkInteractionStyle-6.3.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkInteractionStyle-6.3.a"; sourceTree = "vtk-debug-lib"; };
-		14FC3EE816C5A9830092149A /* libvtksys-6.3.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtksys-6.3.a"; sourceTree = "vtk-debug-lib"; };
-		14FC3EE916C5A9830092149A /* libvtktiff-6.3.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtktiff-6.3.a"; sourceTree = "vtk-debug-lib"; };
-		14FC3EEC16C5A9A60092149A /* libvtkFiltersExtraction-6.3.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkFiltersExtraction-6.3.a"; sourceTree = "vtk-debug-lib"; };
-		14FC3EED16C5A9A60092149A /* libvtkmetaio-6.3.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkmetaio-6.3.a"; sourceTree = "vtk-debug-lib"; };
+		14FC3EAC16C5A02D0092149A /* libvtkRenderingCore-6.2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkRenderingCore-6.2.a"; sourceTree = "vtk-debug-lib"; };
+		14FC3EAE16C5A0460092149A /* libvtkRenderingOpenGL-6.2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkRenderingOpenGL-6.2.a"; sourceTree = "vtk-debug-lib"; };
+		14FC3EB016C5A0E30092149A /* libvtkCommonCore-6.2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkCommonCore-6.2.a"; sourceTree = "vtk-debug-lib"; };
+		14FC3EB116C5A0E30092149A /* libvtkCommonDataModel-6.2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkCommonDataModel-6.2.a"; sourceTree = "vtk-debug-lib"; };
+		14FC3EB216C5A0E30092149A /* libvtkCommonExecutionModel-6.2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkCommonExecutionModel-6.2.a"; sourceTree = "vtk-debug-lib"; };
+		14FC3EB316C5A0E30092149A /* libvtkCommonMath-6.2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkCommonMath-6.2.a"; sourceTree = "vtk-debug-lib"; };
+		14FC3EB416C5A0E30092149A /* libvtkCommonSystem-6.2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkCommonSystem-6.2.a"; sourceTree = "vtk-debug-lib"; };
+		14FC3EB516C5A0E30092149A /* libvtkCommonTransforms-6.2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkCommonTransforms-6.2.a"; sourceTree = "vtk-debug-lib"; };
+		14FC3EBC16C5A1090092149A /* libvtkCommonMisc-6.2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkCommonMisc-6.2.a"; sourceTree = "vtk-debug-lib"; };
+		14FC3EBE16C5A1230092149A /* libvtkIOCore-6.2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkIOCore-6.2.a"; sourceTree = "vtk-debug-lib"; };
+		14FC3EBF16C5A1230092149A /* libvtkIOGeometry-6.2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkIOGeometry-6.2.a"; sourceTree = "vtk-debug-lib"; };
+		14FC3EC016C5A1230092149A /* libvtkIOImage-6.2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkIOImage-6.2.a"; sourceTree = "vtk-debug-lib"; };
+		14FC3EC416C5A15F0092149A /* libvtkImagingCore-6.2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkImagingCore-6.2.a"; sourceTree = "vtk-debug-lib"; };
+		14FC3EC616C5A1810092149A /* libvtkImagingMorphological-6.2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkImagingMorphological-6.2.a"; sourceTree = "vtk-debug-lib"; };
+		14FC3EC716C5A1810092149A /* libvtkImagingStencil-6.2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkImagingStencil-6.2.a"; sourceTree = "vtk-debug-lib"; };
+		14FC3ECA16C5A1C20092149A /* libvtkRenderingFreeType-6.2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkRenderingFreeType-6.2.a"; sourceTree = "vtk-debug-lib"; };
+		14FC3ECC16C5A8A20092149A /* libvtklibxml2-6.2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtklibxml2-6.2.a"; sourceTree = "vtk-debug-lib"; };
+		14FC3ECE16C5A8C00092149A /* libvtkjpeg-6.2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkjpeg-6.2.a"; sourceTree = "vtk-debug-lib"; };
+		14FC3ECF16C5A8C00092149A /* libvtklibxml2-6.2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtklibxml2-6.2.a"; sourceTree = "vtk-debug-lib"; };
+		14FC3ED016C5A8C00092149A /* libvtkpng-6.2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkpng-6.2.a"; sourceTree = "vtk-debug-lib"; };
+		14FC3ED416C5A9030092149A /* libvtkIOXML-6.2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkIOXML-6.2.a"; sourceTree = "vtk-debug-lib"; };
+		14FC3ED516C5A9030092149A /* libvtkIOXMLParser-6.2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkIOXMLParser-6.2.a"; sourceTree = "vtk-debug-lib"; };
+		14FC3ED816C5A92E0092149A /* libvtkFiltersCore-6.2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkFiltersCore-6.2.a"; sourceTree = "vtk-debug-lib"; };
+		14FC3ED916C5A92E0092149A /* libvtkFiltersGeneral-6.2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkFiltersGeneral-6.2.a"; sourceTree = "vtk-debug-lib"; };
+		14FC3EDA16C5A92E0092149A /* libvtkFiltersGeneric-6.2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkFiltersGeneric-6.2.a"; sourceTree = "vtk-debug-lib"; };
+		14FC3EDB16C5A92E0092149A /* libvtkFiltersGeometry-6.2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkFiltersGeometry-6.2.a"; sourceTree = "vtk-debug-lib"; };
+		14FC3EDC16C5A92E0092149A /* libvtkFiltersSources-6.2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkFiltersSources-6.2.a"; sourceTree = "vtk-debug-lib"; };
+		14FC3EE216C5A9470092149A /* libvtkexpat-6.2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkexpat-6.2.a"; sourceTree = "vtk-debug-lib"; };
+		14FC3EE416C5A9690092149A /* libvtkInteractionImage-6.2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkInteractionImage-6.2.a"; sourceTree = "vtk-debug-lib"; };
+		14FC3EE516C5A9690092149A /* libvtkInteractionStyle-6.2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkInteractionStyle-6.2.a"; sourceTree = "vtk-debug-lib"; };
+		14FC3EE816C5A9830092149A /* libvtksys-6.2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtksys-6.2.a"; sourceTree = "vtk-debug-lib"; };
+		14FC3EE916C5A9830092149A /* libvtktiff-6.2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtktiff-6.2.a"; sourceTree = "vtk-debug-lib"; };
+		14FC3EEC16C5A9A60092149A /* libvtkFiltersExtraction-6.2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkFiltersExtraction-6.2.a"; sourceTree = "vtk-debug-lib"; };
+		14FC3EED16C5A9A60092149A /* libvtkmetaio-6.2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; path = "libvtkmetaio-6.2.a"; sourceTree = "vtk-debug-lib"; };
 		2A37F4B0FDCFA73011CA2CEA /* main.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = main.mm; sourceTree = "<group>"; };
 		8D15AC360486D014006FF6A4 /* Info-Xcode.plist */ = {isa = PBXFileReference; explicitFileType = text.xml; fileEncoding = 4; path = "Info-Xcode.plist"; sourceTree = "<group>"; };
 		8D15AC370486D014006FF6A4 /* SimpleCocoaVTK.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SimpleCocoaVTK.app; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -119,44 +117,43 @@
 				8D15AC340486D014006FF6A4 /* Cocoa.framework in Frameworks */,
 				1454C1D6094F306B00F594FE /* OpenGL.framework in Frameworks */,
 				14B863A5113C436100C9B42E /* IOKit.framework in Frameworks */,
-				14FC3EAD16C5A02D0092149A /* libvtkRenderingCore-6.3.a in Frameworks */,
-				14FC3EAF16C5A0460092149A /* libvtkRenderingOpenGL-6.3.a in Frameworks */,
-				14FC3EB616C5A0E30092149A /* libvtkCommonCore-6.3.a in Frameworks */,
-				14FC3EB716C5A0E30092149A /* libvtkCommonDataModel-6.3.a in Frameworks */,
-				14FC3EB816C5A0E30092149A /* libvtkCommonExecutionModel-6.3.a in Frameworks */,
-				14D951A51B701C9A0012248C /* libvtkzlib-6.3.a in Frameworks */,
-				14FC3EB916C5A0E30092149A /* libvtkCommonMath-6.3.a in Frameworks */,
-				14FC3EBA16C5A0E30092149A /* libvtkCommonSystem-6.3.a in Frameworks */,
-				14FC3EBB16C5A0E30092149A /* libvtkCommonTransforms-6.3.a in Frameworks */,
-				14FC3EBD16C5A1090092149A /* libvtkCommonMisc-6.3.a in Frameworks */,
-				14FC3EC116C5A1230092149A /* libvtkIOCore-6.3.a in Frameworks */,
-				14FC3EC216C5A1230092149A /* libvtkIOGeometry-6.3.a in Frameworks */,
-				14FC3EC316C5A1230092149A /* libvtkIOImage-6.3.a in Frameworks */,
-				14FC3EC516C5A15F0092149A /* libvtkImagingCore-6.3.a in Frameworks */,
-				14FC3EC816C5A1810092149A /* libvtkImagingMorphological-6.3.a in Frameworks */,
-				14FC3EC916C5A1810092149A /* libvtkImagingStencil-6.3.a in Frameworks */,
-				14FC3ECB16C5A1C20092149A /* libvtkRenderingFreeType-6.3.a in Frameworks */,
-				14FC3ECD16C5A8A20092149A /* libvtklibxml2-6.3.a in Frameworks */,
-				14FC3ED116C5A8C00092149A /* libvtkjpeg-6.3.a in Frameworks */,
-				14FC3ED216C5A8C00092149A /* libvtklibxml2-6.3.a in Frameworks */,
-				14FC3ED316C5A8C00092149A /* libvtkpng-6.3.a in Frameworks */,
-				14FC3ED616C5A9030092149A /* libvtkIOXML-6.3.a in Frameworks */,
-				14FC3ED716C5A9030092149A /* libvtkIOXMLParser-6.3.a in Frameworks */,
-				14FC3EDD16C5A92E0092149A /* libvtkFiltersCore-6.3.a in Frameworks */,
-				14FC3EDE16C5A92F0092149A /* libvtkFiltersGeneral-6.3.a in Frameworks */,
-				14FC3EDF16C5A92F0092149A /* libvtkFiltersGeneric-6.3.a in Frameworks */,
-				14FC3EE016C5A92F0092149A /* libvtkFiltersGeometry-6.3.a in Frameworks */,
-				14FC3EE116C5A92F0092149A /* libvtkFiltersSources-6.3.a in Frameworks */,
-				14D951A31B701A690012248C /* libvtkCommonColor-6.3.a in Frameworks */,
-				14FC3EE316C5A9470092149A /* libvtkexpat-6.3.a in Frameworks */,
-				14FC3EE616C5A9690092149A /* libvtkInteractionImage-6.3.a in Frameworks */,
-				14FC3EE716C5A9690092149A /* libvtkInteractionStyle-6.3.a in Frameworks */,
-				14FC3EEA16C5A9830092149A /* libvtksys-6.3.a in Frameworks */,
-				14FC3EEB16C5A9830092149A /* libvtktiff-6.3.a in Frameworks */,
-				14FC3EEE16C5A9A60092149A /* libvtkFiltersExtraction-6.3.a in Frameworks */,
-				14FC3EEF16C5A9A60092149A /* libvtkmetaio-6.3.a in Frameworks */,
-				142CC7EC17133D3600FE6428 /* libvtkfreetype-6.3.a in Frameworks */,
-				142CC7EE17133D4D00FE6428 /* libvtkftgl-6.3.a in Frameworks */,
+				14FC3EAD16C5A02D0092149A /* libvtkRenderingCore-6.2.a in Frameworks */,
+				14FC3EAF16C5A0460092149A /* libvtkRenderingOpenGL-6.2.a in Frameworks */,
+				14FC3EB616C5A0E30092149A /* libvtkCommonCore-6.2.a in Frameworks */,
+				14FC3EB716C5A0E30092149A /* libvtkCommonDataModel-6.2.a in Frameworks */,
+				14FC3EB816C5A0E30092149A /* libvtkCommonExecutionModel-6.2.a in Frameworks */,
+				14FC3EB916C5A0E30092149A /* libvtkCommonMath-6.2.a in Frameworks */,
+				14FC3EBA16C5A0E30092149A /* libvtkCommonSystem-6.2.a in Frameworks */,
+				14FC3EBB16C5A0E30092149A /* libvtkCommonTransforms-6.2.a in Frameworks */,
+				14FC3EBD16C5A1090092149A /* libvtkCommonMisc-6.2.a in Frameworks */,
+				14FC3EC116C5A1230092149A /* libvtkIOCore-6.2.a in Frameworks */,
+				14FC3EC216C5A1230092149A /* libvtkIOGeometry-6.2.a in Frameworks */,
+				14FC3EC316C5A1230092149A /* libvtkIOImage-6.2.a in Frameworks */,
+				14FC3EC516C5A15F0092149A /* libvtkImagingCore-6.2.a in Frameworks */,
+				14FC3EC816C5A1810092149A /* libvtkImagingMorphological-6.2.a in Frameworks */,
+				14FC3EC916C5A1810092149A /* libvtkImagingStencil-6.2.a in Frameworks */,
+				14FC3ECB16C5A1C20092149A /* libvtkRenderingFreeType-6.2.a in Frameworks */,
+				14FC3ECD16C5A8A20092149A /* libvtklibxml2-6.2.a in Frameworks */,
+				14FC3ED116C5A8C00092149A /* libvtkjpeg-6.2.a in Frameworks */,
+				14FC3ED216C5A8C00092149A /* libvtklibxml2-6.2.a in Frameworks */,
+				14FC3ED316C5A8C00092149A /* libvtkpng-6.2.a in Frameworks */,
+				14FC3ED616C5A9030092149A /* libvtkIOXML-6.2.a in Frameworks */,
+				14FC3ED716C5A9030092149A /* libvtkIOXMLParser-6.2.a in Frameworks */,
+				14FC3EDD16C5A92E0092149A /* libvtkFiltersCore-6.2.a in Frameworks */,
+				14FC3EDE16C5A92F0092149A /* libvtkFiltersGeneral-6.2.a in Frameworks */,
+				14FC3EDF16C5A92F0092149A /* libvtkFiltersGeneric-6.2.a in Frameworks */,
+				14FC3EE016C5A92F0092149A /* libvtkFiltersGeometry-6.2.a in Frameworks */,
+				14FC3EE116C5A92F0092149A /* libvtkFiltersSources-6.2.a in Frameworks */,
+				14FC3EE316C5A9470092149A /* libvtkexpat-6.2.a in Frameworks */,
+				14FC3EE616C5A9690092149A /* libvtkInteractionImage-6.2.a in Frameworks */,
+				14FC3EE716C5A9690092149A /* libvtkInteractionStyle-6.2.a in Frameworks */,
+				14FC3EEA16C5A9830092149A /* libvtksys-6.2.a in Frameworks */,
+				14FC3EEB16C5A9830092149A /* libvtktiff-6.2.a in Frameworks */,
+				14FC3EEE16C5A9A60092149A /* libvtkFiltersExtraction-6.2.a in Frameworks */,
+				14FC3EEF16C5A9A60092149A /* libvtkmetaio-6.2.a in Frameworks */,
+				142CC7E917133C7000FE6428 /* libvtkRenderingFreeTypeOpenGL-6.2.a in Frameworks */,
+				142CC7EC17133D3600FE6428 /* libvtkfreetype-6.2.a in Frameworks */,
+				142CC7EE17133D4D00FE6428 /* libvtkftgl-6.2.a in Frameworks */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -166,44 +163,43 @@
 		1454C0F8094E269200F594FE /* vtk libraries */ = {
 			isa = PBXGroup;
 			children = (
-				14D951A21B701A690012248C /* libvtkCommonColor-6.3.a */,
-				14FC3EB016C5A0E30092149A /* libvtkCommonCore-6.3.a */,
-				14FC3EB116C5A0E30092149A /* libvtkCommonDataModel-6.3.a */,
-				14FC3EB216C5A0E30092149A /* libvtkCommonExecutionModel-6.3.a */,
-				14FC3EB316C5A0E30092149A /* libvtkCommonMath-6.3.a */,
-				14FC3EBC16C5A1090092149A /* libvtkCommonMisc-6.3.a */,
-				14FC3EB416C5A0E30092149A /* libvtkCommonSystem-6.3.a */,
-				14FC3EB516C5A0E30092149A /* libvtkCommonTransforms-6.3.a */,
-				14FC3ED816C5A92E0092149A /* libvtkFiltersCore-6.3.a */,
-				14FC3ED916C5A92E0092149A /* libvtkFiltersGeneral-6.3.a */,
-				14FC3EDA16C5A92E0092149A /* libvtkFiltersGeneric-6.3.a */,
-				14FC3EDB16C5A92E0092149A /* libvtkFiltersGeometry-6.3.a */,
-				14FC3EDC16C5A92E0092149A /* libvtkFiltersSources-6.3.a */,
-				14FC3EEC16C5A9A60092149A /* libvtkFiltersExtraction-6.3.a */,
-				14FC3EE416C5A9690092149A /* libvtkInteractionImage-6.3.a */,
-				14FC3EE516C5A9690092149A /* libvtkInteractionStyle-6.3.a */,
-				14FC3EC416C5A15F0092149A /* libvtkImagingCore-6.3.a */,
-				14FC3EC616C5A1810092149A /* libvtkImagingMorphological-6.3.a */,
-				14FC3EC716C5A1810092149A /* libvtkImagingStencil-6.3.a */,
-				14FC3EBE16C5A1230092149A /* libvtkIOCore-6.3.a */,
-				14FC3EBF16C5A1230092149A /* libvtkIOGeometry-6.3.a */,
-				14FC3EC016C5A1230092149A /* libvtkIOImage-6.3.a */,
-				14FC3ED416C5A9030092149A /* libvtkIOXML-6.3.a */,
-				14FC3ED516C5A9030092149A /* libvtkIOXMLParser-6.3.a */,
-				14FC3EAC16C5A02D0092149A /* libvtkRenderingCore-6.3.a */,
-				14FC3ECA16C5A1C20092149A /* libvtkRenderingFreeType-6.3.a */,
-				14FC3EAE16C5A0460092149A /* libvtkRenderingOpenGL-6.3.a */,
-				14FC3EE816C5A9830092149A /* libvtksys-6.3.a */,
-				14FC3EE916C5A9830092149A /* libvtktiff-6.3.a */,
-				14FC3EE216C5A9470092149A /* libvtkexpat-6.3.a */,
-				142CC7EB17133D3600FE6428 /* libvtkfreetype-6.3.a */,
-				142CC7ED17133D4D00FE6428 /* libvtkftgl-6.3.a */,
-				14FC3ECC16C5A8A20092149A /* libvtklibxml2-6.3.a */,
-				14FC3ECE16C5A8C00092149A /* libvtkjpeg-6.3.a */,
-				14FC3EED16C5A9A60092149A /* libvtkmetaio-6.3.a */,
-				14FC3ECF16C5A8C00092149A /* libvtklibxml2-6.3.a */,
-				14FC3ED016C5A8C00092149A /* libvtkpng-6.3.a */,
-				14D951A41B701C9A0012248C /* libvtkzlib-6.3.a */,
+				14FC3EB016C5A0E30092149A /* libvtkCommonCore-6.2.a */,
+				14FC3EB116C5A0E30092149A /* libvtkCommonDataModel-6.2.a */,
+				14FC3EB216C5A0E30092149A /* libvtkCommonExecutionModel-6.2.a */,
+				14FC3EB316C5A0E30092149A /* libvtkCommonMath-6.2.a */,
+				14FC3EBC16C5A1090092149A /* libvtkCommonMisc-6.2.a */,
+				14FC3EB416C5A0E30092149A /* libvtkCommonSystem-6.2.a */,
+				14FC3EB516C5A0E30092149A /* libvtkCommonTransforms-6.2.a */,
+				14FC3ED816C5A92E0092149A /* libvtkFiltersCore-6.2.a */,
+				14FC3ED916C5A92E0092149A /* libvtkFiltersGeneral-6.2.a */,
+				14FC3EDA16C5A92E0092149A /* libvtkFiltersGeneric-6.2.a */,
+				14FC3EDB16C5A92E0092149A /* libvtkFiltersGeometry-6.2.a */,
+				14FC3EDC16C5A92E0092149A /* libvtkFiltersSources-6.2.a */,
+				14FC3EEC16C5A9A60092149A /* libvtkFiltersExtraction-6.2.a */,
+				14FC3EE416C5A9690092149A /* libvtkInteractionImage-6.2.a */,
+				14FC3EE516C5A9690092149A /* libvtkInteractionStyle-6.2.a */,
+				14FC3EC416C5A15F0092149A /* libvtkImagingCore-6.2.a */,
+				14FC3EC616C5A1810092149A /* libvtkImagingMorphological-6.2.a */,
+				14FC3EC716C5A1810092149A /* libvtkImagingStencil-6.2.a */,
+				14FC3EBE16C5A1230092149A /* libvtkIOCore-6.2.a */,
+				14FC3EBF16C5A1230092149A /* libvtkIOGeometry-6.2.a */,
+				14FC3EC016C5A1230092149A /* libvtkIOImage-6.2.a */,
+				14FC3ED416C5A9030092149A /* libvtkIOXML-6.2.a */,
+				14FC3ED516C5A9030092149A /* libvtkIOXMLParser-6.2.a */,
+				14FC3EAC16C5A02D0092149A /* libvtkRenderingCore-6.2.a */,
+				14FC3ECA16C5A1C20092149A /* libvtkRenderingFreeType-6.2.a */,
+				142CC7E817133C7000FE6428 /* libvtkRenderingFreeTypeOpenGL-6.2.a */,
+				14FC3EAE16C5A0460092149A /* libvtkRenderingOpenGL-6.2.a */,
+				14FC3EE816C5A9830092149A /* libvtksys-6.2.a */,
+				14FC3EE916C5A9830092149A /* libvtktiff-6.2.a */,
+				14FC3EE216C5A9470092149A /* libvtkexpat-6.2.a */,
+				142CC7EB17133D3600FE6428 /* libvtkfreetype-6.2.a */,
+				142CC7ED17133D4D00FE6428 /* libvtkftgl-6.2.a */,
+				14FC3ECC16C5A8A20092149A /* libvtklibxml2-6.2.a */,
+				14FC3ECE16C5A8C00092149A /* libvtkjpeg-6.2.a */,
+				14FC3EED16C5A9A60092149A /* libvtkmetaio-6.2.a */,
+				14FC3ECF16C5A8C00092149A /* libvtklibxml2-6.2.a */,
+				14FC3ED016C5A8C00092149A /* libvtkpng-6.2.a */,
 			);
 			name = "vtk libraries";
 			sourceTree = "<group>";
@@ -296,8 +292,6 @@
 /* Begin PBXProject section */
 		2A37F4A9FDCFA73011CA2CEA /* Project object */ = {
 			isa = PBXProject;
-			attributes = {
-			};
 			buildConfigurationList = C05733CB08A9546B00998B17 /* Build configuration list for PBXProject "SimpleCocoaVTK" */;
 			compatibilityVersion = "Xcode 3.2";
 			developmentRegion = English;
diff --git a/Examples/GUI/Qt/Events/CMakeLists.txt b/Examples/GUI/Qt/Events/CMakeLists.txt
index 00f5e99..b6949d4 100644
--- a/Examples/GUI/Qt/Events/CMakeLists.txt
+++ b/Examples/GUI/Qt/Events/CMakeLists.txt
@@ -42,7 +42,7 @@ include_directories(
 set(CMAKE_AUTOMOC ON)
 
 if(VTK_QT_VERSION VERSION_GREATER "4")
-  find_package(Qt5 COMPONENTS Widgets)
+  find_package(Qt5Widgets)
   qt5_wrap_ui(UI_Srcs ${UIs})
 
   add_executable(qtevents
diff --git a/Examples/GUI/Qt/FourPaneViewer/CMakeLists.txt b/Examples/GUI/Qt/FourPaneViewer/CMakeLists.txt
index 1bfbc4a..a773dba 100644
--- a/Examples/GUI/Qt/FourPaneViewer/CMakeLists.txt
+++ b/Examples/GUI/Qt/FourPaneViewer/CMakeLists.txt
@@ -45,7 +45,7 @@ include_directories(
 set(CMAKE_AUTOMOC ON)
 
 if(VTK_QT_VERSION VERSION_GREATER "4")
-  find_package(Qt5 COMPONENTS Widgets REQUIRED QUIET)
+  find_package(Qt5Widgets REQUIRED QUIET)
   qt5_wrap_ui(UI_Srcs ${UIs})
 
   # CMAKE_AUTOMOC in ON so the MocHdrs will be automatically wrapped.
diff --git a/Examples/GUI/Qt/GraphicsView/CMakeLists.txt b/Examples/GUI/Qt/GraphicsView/CMakeLists.txt
index 73b0999..5d86e7f 100644
--- a/Examples/GUI/Qt/GraphicsView/CMakeLists.txt
+++ b/Examples/GUI/Qt/GraphicsView/CMakeLists.txt
@@ -5,9 +5,6 @@ endif()
 if(POLICY CMP0025)
   cmake_policy(SET CMP0025 NEW) # CMake 3.0
 endif()
-if(POLICY CMP0043)
-  cmake_policy(SET CMP0043 NEW) # CMake 3.0
-endif()
 if(POLICY CMP0053)
   cmake_policy(SET CMP0053 NEW) # CMake 3.1
 endif()
@@ -20,6 +17,7 @@ find_package(VTK COMPONENTS
   vtkGUISupportQt
   vtkGUISupportQtOpenGL
   vtkIOInfovis
+  vtkRenderingFreeTypeOpenGL
   vtkViewsInfovis
 )
 include(${VTK_USE_FILE})
@@ -59,7 +57,7 @@ set( QRCs
 set(CMAKE_AUTOMOC ON)
 
 if(VTK_QT_VERSION VERSION_GREATER "4")
-  find_package(Qt5 COMPONENTS WebKitWidgets REQUIRED QUIET)
+  find_package(Qt5WebKitWidgets REQUIRED QUIET)
 
   qt5_add_resources(QRC_Srcs ${QRCs} )
 
diff --git a/Examples/GUI/Qt/GraphicsView/GraphLayoutViewItem.cpp b/Examples/GUI/Qt/GraphicsView/GraphLayoutViewItem.cpp
index 731453d..aafd1c6 100644
--- a/Examples/GUI/Qt/GraphicsView/GraphLayoutViewItem.cpp
+++ b/Examples/GUI/Qt/GraphicsView/GraphLayoutViewItem.cpp
@@ -2,6 +2,7 @@
 #include "GraphLayoutViewItem.h"
 #include "vtkGraphLayoutView.h"
 #include "vtkGenericOpenGLRenderWindow.h"
+#include "vtkgl.h"
 #include "QVTKInteractor.h"
 #include "vtkXMLTreeReader.h"
 #include "vtkRenderedTreeAreaRepresentation.h"
diff --git a/Examples/GUI/Qt/GraphicsView/TreeRingViewItem.cpp b/Examples/GUI/Qt/GraphicsView/TreeRingViewItem.cpp
index 4edeb29..963b05c 100644
--- a/Examples/GUI/Qt/GraphicsView/TreeRingViewItem.cpp
+++ b/Examples/GUI/Qt/GraphicsView/TreeRingViewItem.cpp
@@ -2,6 +2,7 @@
 #include "TreeRingViewItem.h"
 #include "vtkTreeRingView.h"
 #include "vtkGenericOpenGLRenderWindow.h"
+#include "vtkgl.h"
 #include "QVTKInteractor.h"
 #include "vtkXMLTreeReader.h"
 #include "vtkRenderedTreeAreaRepresentation.h"
diff --git a/Examples/GUI/Qt/GraphicsView/vtkclasses.xml b/Examples/GUI/Qt/GraphicsView/vtkclasses.xml
index ca9cb7c..93df3c7 100644
--- a/Examples/GUI/Qt/GraphicsView/vtkclasses.xml
+++ b/Examples/GUI/Qt/GraphicsView/vtkclasses.xml
@@ -1938,6 +1938,8 @@
             </class>
             <class id="vtkBiQuadraticQuadraticWedge" library="Filtering">
             </class>
+            <class id="vtkExplicitCell" library="Filtering">
+            </class>
             <class id="vtkQuadraticEdge" library="Filtering">
             </class>
             <class id="vtkQuadraticHexahedron" library="Filtering">
diff --git a/Examples/GUI/Qt/GraphicsView/vtklibrary.xml b/Examples/GUI/Qt/GraphicsView/vtklibrary.xml
index f117dd1..2dd50ca 100644
--- a/Examples/GUI/Qt/GraphicsView/vtklibrary.xml
+++ b/Examples/GUI/Qt/GraphicsView/vtklibrary.xml
@@ -516,6 +516,8 @@
     </node>
     <node id="vtkBiQuadraticQuadraticWedge">
     </node>
+    <node id="vtkExplicitCell">
+    </node>
     <node id="vtkQuadraticEdge">
     </node>
     <node id="vtkQuadraticHexahedron">
diff --git a/Examples/GUI/Qt/ImageViewer/CMakeLists.txt b/Examples/GUI/Qt/ImageViewer/CMakeLists.txt
index 659bcd5..4c298b7 100644
--- a/Examples/GUI/Qt/ImageViewer/CMakeLists.txt
+++ b/Examples/GUI/Qt/ImageViewer/CMakeLists.txt
@@ -29,7 +29,7 @@ endif()
 set( Srcs main.cxx )
 
 if(VTK_QT_VERSION VERSION_GREATER "4")
-  find_package(Qt5 COMPONENTS Core REQUIRED QUIET)
+  find_package(Qt5Core REQUIRED QUIET)
 
   add_executable(qtimageviewer ${Srcs})
   qt5_use_modules(qtimageviewer Core Gui Widgets)
diff --git a/Examples/GUI/Qt/SimpleView/CMakeLists.txt b/Examples/GUI/Qt/SimpleView/CMakeLists.txt
index 91e3e5c..ca88570 100644
--- a/Examples/GUI/Qt/SimpleView/CMakeLists.txt
+++ b/Examples/GUI/Qt/SimpleView/CMakeLists.txt
@@ -18,6 +18,7 @@ find_package(VTK COMPONENTS
   vtkFiltersCore
   vtkInfovisCore
   vtkInteractionStyle
+  vtkRenderingFreeType${VTK_RENDERING_BACKEND}
   vtkViewsQt
 )
 include(${VTK_USE_FILE})
@@ -50,7 +51,7 @@ set(CMAKE_AUTOMOC ON)
 # The rest should just work (sure...)
 if(VTK_QT_VERSION VERSION_GREATER "4")
   # We have ui files, this will bring in the macro: qt5_wrap_ui
-  find_package(Qt5 COMPONENTS Widgets REQUIRED QUIET)
+  find_package(Qt5Widgets REQUIRED QUIET)
   qt5_wrap_ui(UI_Srcs ${UIs})
   qt5_add_resources(QRC_Srcs ${QRCs} )
 
diff --git a/Examples/HyperTree/Cxx/Sphere/CMakeLists.txt b/Examples/HyperTree/Cxx/Sphere/CMakeLists.txt
index 0db9ec7..ceafca5 100644
--- a/Examples/HyperTree/Cxx/Sphere/CMakeLists.txt
+++ b/Examples/HyperTree/Cxx/Sphere/CMakeLists.txt
@@ -23,4 +23,4 @@ set(HyperTreeGridSphere_SRCS
 
 # Add example showing use use of synthetic vtkHyperTreeGrid along with various filters
 add_executable(HyperTreeGridSphere ${HyperTreeGridSphere_SRCS})
-target_link_libraries(HyperTreeGridSphere vtkCommonCore vtkCommonSystem vtkCommonDataModel vtkCommonExecutionModel vtkIOCore vtkIOLegacy vtkFiltersCore vtkFiltersGeometry vtkFiltersHyperTree vtkInteractionStyle vtkRenderingCore vtkRenderingOpenGL)
+target_link_libraries(HyperTreeGridSphere vtkCommonCore vtkCommonSystem vtkCommonDataModel vtkCommonExecutionModel vtkIOCore vtkIOLegacy vtkFiltersCore vtkFiltersGeometry vtkFiltersHyperTree vtkInteractionStyle vtkRenderingCore vtkRenderingOpenGL vtkRenderingFreeTypeOpenGL)
diff --git a/Examples/Infovis/Cxx/CustomLinkView/CMakeLists.txt b/Examples/Infovis/Cxx/CustomLinkView/CMakeLists.txt
index 15a42a0..d9d8301 100644
--- a/Examples/Infovis/Cxx/CustomLinkView/CMakeLists.txt
+++ b/Examples/Infovis/Cxx/CustomLinkView/CMakeLists.txt
@@ -47,7 +47,7 @@ endif(CMAKE_BUILD_TOOL MATCHES "(msdev|devenv)")
 
 if(VTK_QT_VERSION VERSION_GREATER "4")
 
-  find_package(Qt5 COMPONENTS Widgets)
+  find_package(Qt5Widgets)
 
   qt5_wrap_ui(UI_Srcs ${UIs})
   qt5_add_resources(Rcs_Srcs ${Rcs})
diff --git a/Examples/Infovis/Cxx/EasyView/CMakeLists.txt b/Examples/Infovis/Cxx/EasyView/CMakeLists.txt
index d49a22b..6e8787d 100644
--- a/Examples/Infovis/Cxx/EasyView/CMakeLists.txt
+++ b/Examples/Infovis/Cxx/EasyView/CMakeLists.txt
@@ -47,7 +47,7 @@ endif(CMAKE_BUILD_TOOL MATCHES "(msdev|devenv)")
 
 if(VTK_QT_VERSION VERSION_GREATER "4")
 
-  find_package(Qt5 COMPONENTS Widgets)
+  find_package(Qt5Widgets)
 
   qt5_wrap_ui(UI_Srcs ${UIs})
   qt5_add_resources(Rcs_Srcs ${Rcs})
diff --git a/Examples/Infovis/Cxx/StatsView/CMakeLists.txt b/Examples/Infovis/Cxx/StatsView/CMakeLists.txt
index 4367ff4..8649f88 100644
--- a/Examples/Infovis/Cxx/StatsView/CMakeLists.txt
+++ b/Examples/Infovis/Cxx/StatsView/CMakeLists.txt
@@ -47,7 +47,7 @@ endif(CMAKE_BUILD_TOOL MATCHES "(msdev|devenv)")
 
 if(VTK_QT_VERSION VERSION_GREATER "4")
 
-  find_package(Qt5 COMPONENTS Widgets)
+  find_package(Qt5Widgets)
 
   qt5_wrap_ui(UI_Srcs ${UIs})
   qt5_add_resources(Rcs_Srcs ${Rcs})
diff --git a/Examples/Infovis/Python/vtkclasses.xml b/Examples/Infovis/Python/vtkclasses.xml
index ca9cb7c..93df3c7 100644
--- a/Examples/Infovis/Python/vtkclasses.xml
+++ b/Examples/Infovis/Python/vtkclasses.xml
@@ -1938,6 +1938,8 @@
             </class>
             <class id="vtkBiQuadraticQuadraticWedge" library="Filtering">
             </class>
+            <class id="vtkExplicitCell" library="Filtering">
+            </class>
             <class id="vtkQuadraticEdge" library="Filtering">
             </class>
             <class id="vtkQuadraticHexahedron" library="Filtering">
diff --git a/Examples/Infovis/Python/vtklibrary.xml b/Examples/Infovis/Python/vtklibrary.xml
index f117dd1..2dd50ca 100644
--- a/Examples/Infovis/Python/vtklibrary.xml
+++ b/Examples/Infovis/Python/vtklibrary.xml
@@ -516,6 +516,8 @@
     </node>
     <node id="vtkBiQuadraticQuadraticWedge">
     </node>
+    <node id="vtkExplicitCell">
+    </node>
     <node id="vtkQuadraticEdge">
     </node>
     <node id="vtkQuadraticHexahedron">
diff --git a/Examples/ParallelProcessing/SMP/Cxx/vtkOverlappingAMR2.cxx b/Examples/ParallelProcessing/SMP/Cxx/vtkOverlappingAMR2.cxx
index 5a50f63..dc70e9e 100644
--- a/Examples/ParallelProcessing/SMP/Cxx/vtkOverlappingAMR2.cxx
+++ b/Examples/ParallelProcessing/SMP/Cxx/vtkOverlappingAMR2.cxx
@@ -207,7 +207,7 @@ void vtkOverlappingAMR2::Audit()
   for(iter->GoToFirstItem(); !iter->IsDoneWithTraversal(); iter->GoToNextItem())
     {
     vtkUniformGrid* grid = vtkUniformGrid::SafeDownCast(iter->GetCurrentDataObject());
-    bool hasGhost  = grid->HasAnyGhostCells();
+    bool hasGhost  = grid->GetCellData()->GetArray("vtkGhostLevels")!=NULL;
 
     unsigned int level = iter->GetCurrentLevel();
     unsigned int id = iter->GetCurrentIndex();
diff --git a/Examples/ParallelProcessing/SMP/Cxx/vtkSMPMinMaxTree.cxx b/Examples/ParallelProcessing/SMP/Cxx/vtkSMPMinMaxTree.cxx
index 37b2fab..99fea76 100644
--- a/Examples/ParallelProcessing/SMP/Cxx/vtkSMPMinMaxTree.cxx
+++ b/Examples/ParallelProcessing/SMP/Cxx/vtkSMPMinMaxTree.cxx
@@ -76,7 +76,8 @@ namespace
     }
     ~InitializeFunctor()
     {
-      delete [] this->Locks;
+      if ( this->Locks )
+        delete [] this->Locks;
     }
 
     void operator()(vtkIdType start, vtkIdType end)
diff --git a/Examples/ParallelProcessing/SMP/Cxx/vtkUniformGridAMR2.cxx b/Examples/ParallelProcessing/SMP/Cxx/vtkUniformGridAMR2.cxx
index 9b7b36e..22588d9 100644
--- a/Examples/ParallelProcessing/SMP/Cxx/vtkUniformGridAMR2.cxx
+++ b/Examples/ParallelProcessing/SMP/Cxx/vtkUniformGridAMR2.cxx
@@ -154,15 +154,7 @@ void vtkUniformGridAMR2::SetDataSet(
     return;
     }
 
-  if(this->AMRInfo->GetGridDescription() < 0)
-    {
-    this->AMRInfo->SetGridDescription(grid->GetGridDescription());
-    }
-  else if (grid->GetGridDescription() != this->AMRInfo->GetGridDescription())
-    {
-    vtkErrorMacro("Inconsistent types of vtkUniformGrid");
-    return;
-    }
+  this->AMRInfo->SetGridDescription(grid->GetGridDescription());
   int index = this->AMRInfo->GetIndex(level,idx);
   this->AMRData->Insert(index, grid);
 
diff --git a/Examples/VisualizationAlgorithms/Cxx/Baseline/TestFilledContours_1.png.md5 b/Examples/VisualizationAlgorithms/Cxx/Baseline/TestFilledContours_1.png.md5
deleted file mode 100644
index f5bcf38..0000000
--- a/Examples/VisualizationAlgorithms/Cxx/Baseline/TestFilledContours_1.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-844a55bed1ac2ede3ea3a5846594e417
diff --git a/Filters/AMR/Testing/Cxx/TestAMRGhostLayerStripping.cxx b/Filters/AMR/Testing/Cxx/TestAMRGhostLayerStripping.cxx
index c454230..dcff47e 100644
--- a/Filters/AMR/Testing/Cxx/TestAMRGhostLayerStripping.cxx
+++ b/Filters/AMR/Testing/Cxx/TestAMRGhostLayerStripping.cxx
@@ -116,14 +116,31 @@ void ComputeCellCenter(
   assert("pre: cell index is out-of-bounds!" &&
          (cellIdx >= 0) && (cellIdx < grid->GetNumberOfCells()));
 
-  // We want to get all cells including blanked cells.
-  vtkCell *myCell = grid->vtkImageData::GetCell(cellIdx);
+  vtkCell *myCell = grid->GetCell( cellIdx );
+  assert( "ERROR: Cell is NULL" && (myCell != NULL) );
+
+  // Work around for blanked cells. For blanked cells GetCell returns a
+  // VTK_EMPTY_CELL! Therefore, to get the cell, we have to temporarily
+  // unblank it and then blank it again.
+  bool isCellBlanked = false;
+  if( (myCell->GetCellType() == VTK_EMPTY_CELL) &&
+      (!grid->IsCellVisible(cellIdx)) )
+    {
+    grid->UnBlankCell( cellIdx );
+    myCell = grid->GetCell(cellIdx);
+    isCellBlanked = true;
+    }
 
   double pcenter[3];
   double *weights = new double[ myCell->GetNumberOfPoints() ];
   int subId = myCell->GetParametricCenter( pcenter );
   myCell->EvaluateLocation( subId, pcenter, centroid, weights );
   delete [] weights;
+
+  if( isCellBlanked )
+    {
+    grid->BlankCell( cellIdx );
+    }
 }
 
 //------------------------------------------------------------------------------
diff --git a/Filters/AMR/vtkAMRResampleFilter.cxx b/Filters/AMR/vtkAMRResampleFilter.cxx
index 6a17783..682407d 100644
--- a/Filters/AMR/vtkAMRResampleFilter.cxx
+++ b/Filters/AMR/vtkAMRResampleFilter.cxx
@@ -877,9 +877,8 @@ void vtkAMRResampleFilter::ExtractRegion(
 //  std::cout << "NumProcs: "  << this->Controller->GetNumberOfProcesses() << std::endl;
 //  std::cout.flush();
 
-  assert( "pre: NumProcs must be less than or equal to NumBlocks" &&
-    (!this->Controller ||
-     (static_cast<int>(this->ROI->GetNumberOfBlocks()) <= this->Controller->GetNumberOfProcesses())));
+  assert( !this->Controller || ( "pre: NumProcs must be less than or equal to NumBlocks" &&
+                                 ( static_cast<int>(this->ROI->GetNumberOfBlocks()) <= this->Controller->GetNumberOfProcesses())));
 
   mbds->SetNumberOfBlocks( this->ROI->GetNumberOfBlocks( ) );
   for( unsigned int block=0; block < this->ROI->GetNumberOfBlocks(); ++block )
diff --git a/Filters/AMR/vtkAMRSliceFilter.cxx b/Filters/AMR/vtkAMRSliceFilter.cxx
index c4d20df..d9fb35e 100644
--- a/Filters/AMR/vtkAMRSliceFilter.cxx
+++ b/Filters/AMR/vtkAMRSliceFilter.cxx
@@ -15,27 +15,26 @@
 
 #include "vtkAMRSliceFilter.h"
 #include "vtkAMRBox.h"
-#include "vtkCell.h"
-#include "vtkCellData.h"
-#include "vtkCompositeDataPipeline.h"
-#include "vtkDataArray.h"
+#include "vtkObjectFactory.h"
 #include "vtkDataObject.h"
 #include "vtkInformation.h"
-#include "vtkInformationIntegerKey.h"
 #include "vtkInformationVector.h"
-#include "vtkMultiProcessController.h"
-#include "vtkObjectFactory.h"
 #include "vtkOverlappingAMR.h"
+#include "vtkCell.h"
 #include "vtkParallelAMRUtilities.h"
 #include "vtkPlane.h"
-#include "vtkPointData.h"
+#include "vtkUniformGrid.h"
 #include "vtkStructuredData.h"
-#include "vtkSmartPointer.h"
+#include "vtkCellData.h"
+#include "vtkPointData.h"
+#include "vtkInformationIntegerKey.h"
+#include "vtkCompositeDataPipeline.h"
+#include "vtkMultiProcessController.h"
 #include "vtkStreamingDemandDrivenPipeline.h"
+#include "vtkDataArray.h"
 #include "vtkTimerLog.h"
-#include "vtkUniformGrid.h"
+#include "vtkSmartPointer.h"
 #include "vtkUniformGridAMRDataIterator.h"
-#include "vtkUnsignedCharArray.h"
 
 #include <cassert>
 #include <algorithm>
@@ -54,7 +53,6 @@ vtkAMRSliceFilter::vtkAMRSliceFilter()
   this->EnablePrefetching = 1;
   this->Controller        = vtkMultiProcessController::GetGlobalController();
   this->initialRequest    = true;
-  this->MaxResolution     = 1;
 }
 
 //------------------------------------------------------------------------------
@@ -493,7 +491,7 @@ int vtkAMRSliceFilter::GetDonorCellIdx( double x[3], vtkUniformGrid *ug )
       }
     }
 
-  return( vtkStructuredData::ComputeCellId( dims, ijk ) );
+  return( vtkStructuredData::ComputePointId( dims, ijk ) );
 }
 
 //------------------------------------------------------------------------------
@@ -525,12 +523,6 @@ void vtkAMRSliceFilter::GetSliceCellData(
      sourceCD->GetArray( arrayIdx )->GetNumberOfComponents( ) );
     array->SetNumberOfTuples( numCells );
     targetCD->AddArray( array );
-    vtkUnsignedCharArray* uca = vtkUnsignedCharArray::SafeDownCast(array);
-    if (uca != NULL && uca == slice->GetCellGhostArray())
-      {
-      // initiallize the ghost array
-      memset(uca->WritePointer(0, numCells), 0, numCells);
-      }
     array->Delete();
     } // END for all arrays
 
diff --git a/Filters/AMR/vtkImageToAMR.cxx b/Filters/AMR/vtkImageToAMR.cxx
index 4c9455c..58e4a66 100644
--- a/Filters/AMR/vtkImageToAMR.cxx
+++ b/Filters/AMR/vtkImageToAMR.cxx
@@ -279,7 +279,7 @@ int vtkImageToAMR::RequestData(vtkInformation* vtkNotUsed(request),
         vtkWarningMacro("Zero dimension? Really?");
         }
       dims0[d] = 1;
-      spacing0[d] = 1.0;
+      spacing0[d] = 0;
       }
     else
       {
diff --git a/Filters/Core/CMakeLists.txt b/Filters/Core/CMakeLists.txt
index dc04489..900038c 100644
--- a/Filters/Core/CMakeLists.txt
+++ b/Filters/Core/CMakeLists.txt
@@ -74,6 +74,7 @@ set(Module_SRCS
   vtkStreamerBase.cxx
   vtkCenterOfMass.cxx
 
+  vtkGhostArray.cxx
   vtkImageAppend.cxx
   vtkStructuredGridAppend.cxx
   vtkAppendCompositeDataLeaves.cxx
diff --git a/Filters/Core/Testing/Cxx/CMakeLists.txt b/Filters/Core/Testing/Cxx/CMakeLists.txt
index 41b3566..6f3bbc0 100644
--- a/Filters/Core/Testing/Cxx/CMakeLists.txt
+++ b/Filters/Core/Testing/Cxx/CMakeLists.txt
@@ -16,9 +16,10 @@ vtk_add_test_cxx(${vtk-module}CxxTests tests
   TestDelaunay3D.cxx,NO_VALID
   TestExecutionTimer.cxx,NO_VALID
   TestFeatureEdges.cxx,NO_VALID
+  TestGhostArray.cxx,NO_VALID
   TestGlyph3D.cxx
   TestHedgeHog.cxx,NO_VALID
-  TestImplicitPolyDataDistance.cxx
+  TestImplicitPolyDataDistance.cxx,NO_VALID
   TestMaskPoints.cxx,NO_VALID
   TestNamedComponents.cxx,NO_VALID
   TestPolyDataConnectivityFilter.cxx,NO_VALID
diff --git a/Filters/Core/Testing/Cxx/TestGhostArray.cxx b/Filters/Core/Testing/Cxx/TestGhostArray.cxx
new file mode 100644
index 0000000..d34ea16
--- /dev/null
+++ b/Filters/Core/Testing/Cxx/TestGhostArray.cxx
@@ -0,0 +1,81 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+  Module:    TestGhostArray.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.
+
+=========================================================================*/
+// .NAME TestGhostArray -- Tests vtkGhostArray
+//
+// .SECTION Description
+//  A simple test for the vtkGhostArray
+
+#include "vtkGhostArray.h"
+
+int CheckSetAndUnsetProperty( unsigned char &u, const int p )
+{
+  int rc = 0;
+  vtkGhostArray::SetProperty( u, p);
+  if( !vtkGhostArray::IsPropertySet( u, p) )
+    {
+    std::cerr << "Could not set property " << p << std::endl;
+    ++rc;
+    }
+
+  vtkGhostArray::UnsetProperty( u, p);
+  if( vtkGhostArray::IsPropertySet( u, p) )
+    {
+    std::cerr << "Could not unset property " << p << std::endl;
+    ++rc;
+    }
+
+  return( rc );
+}
+
+//------------------------------------------------------------------------------
+int TestGhostArray(int,char *[])
+{
+  int rc = 0;
+  unsigned char propertyField = '0';
+  vtkGhostArray::Reset( propertyField );
+
+  // Ensure all bits are set to 0
+  for( int i=0; i < 8; ++i )
+    {
+    if( vtkGhostArray::IsPropertySet( propertyField, i) )
+      {
+      std::cerr << "bit " << i << " appears to be set!\n";
+      ++rc;
+      }
+    } // END for
+
+  // Try setting/unsetting some node properties
+  rc += CheckSetAndUnsetProperty( propertyField, vtkGhostArray::INTERNAL );
+  rc += CheckSetAndUnsetProperty( propertyField, vtkGhostArray::SHARED );
+  rc += CheckSetAndUnsetProperty( propertyField, vtkGhostArray::GHOST );
+  rc += CheckSetAndUnsetProperty( propertyField, vtkGhostArray::IGNORE );
+  rc += CheckSetAndUnsetProperty( propertyField, vtkGhostArray::VOID );
+  rc += CheckSetAndUnsetProperty( propertyField, vtkGhostArray::BOUNDARY );
+
+  // Try setting/unsetting some cell properties
+  rc += CheckSetAndUnsetProperty( propertyField, vtkGhostArray::DUPLICATE );
+  rc += CheckSetAndUnsetProperty( propertyField, vtkGhostArray::EXTERNAL );
+
+  // Ensure all bits are set to 0
+  for( int i=0; i < 8; ++i )
+    {
+    if( vtkGhostArray::IsPropertySet( propertyField, i) )
+      {
+      std::cerr << "bit " << i << " appears to be set!\n";
+      ++rc;
+      }
+    } // END for
+  return( rc );
+}
diff --git a/Filters/Core/Testing/Cxx/TestImplicitPolyDataDistance.cxx b/Filters/Core/Testing/Cxx/TestImplicitPolyDataDistance.cxx
index e1af47c..7cef245 100644
--- a/Filters/Core/Testing/Cxx/TestImplicitPolyDataDistance.cxx
+++ b/Filters/Core/Testing/Cxx/TestImplicitPolyDataDistance.cxx
@@ -11,130 +11,77 @@
      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
      PURPOSE.  See the above copyright notice for more information.
 =========================================================================*/
-#include "vtkActor.h"
-#include "vtkCamera.h"
-#include "vtkGlyph3D.h"
-#include "vtkImplicitPolyDataDistance.h"
-#include "vtkNew.h"
-#include "vtkPlaneSource.h"
-#include "vtkPolyDataMapper.h"
-#include "vtkProperty.h"
-#include "vtkRegressionTestImage.h"
-#include "vtkRenderer.h"
-#include "vtkRenderWindow.h"
-#include "vtkRenderWindowInteractor.h"
-#include "vtkSmartPointer.h"
-#include "vtkSphereSource.h"
-#include "vtkTesting.h"
-#include "vtkXMLPolyDataReader.h"
+#include <vtkSmartPointer.h>
+
+#include <vtkImplicitPolyDataDistance.h>
+#include <vtkPlaneSource.h>
 
 #include <vector>
 
-int TestImplicitPolyDataDistance(int argc, char* argv[])
+int TestImplicitPolyDataDistance(int, char*[])
 {
-  vtkSmartPointer<vtkTesting> testHelper =
-    vtkSmartPointer<vtkTesting>::New();
-  testHelper->AddArguments(argc, argv);
-  if (!testHelper->IsFlagSpecified("-D"))
+  vtkSmartPointer<vtkPlaneSource> plane =
+    vtkSmartPointer<vtkPlaneSource>::New();
+  plane->SetXResolution(5);
+  plane->SetYResolution(5);
+  plane->Update();
+
+  vtkSmartPointer<vtkImplicitPolyDataDistance> distance =
+    vtkSmartPointer<vtkImplicitPolyDataDistance>::New();
+
+  distance->SetInput(plane->GetOutput());
+
+  // Evaluate at a few points
+
+  std::vector<double *> probes;
+  {
+  double *probe = new double[3];
+  probe[0] = probe[1] = 0.0;
+  probe[2] = 1.0;
+  probes.push_back(probe);
+  }
+  {
+  double *probe = new double[3];
+  probe[0] = probe[1] = 0.0;
+  probe[2] = -1.0;
+  probes.push_back(probe);
+  }
+  {
+  double *probe = new double[3];
+  probe[0] = 1.0;
+  probe[1] = 1.0;
+  probe[2] = 1.0;
+  probes.push_back(probe);
+  }
+  // Probe at each of the polydata points
+  for (int i = 0; i < plane->GetOutput()->GetNumberOfPoints(); ++i)
     {
-    std::cerr << "Error: -D /path/to/data was not specified.";
-    return EXIT_FAILURE;
+    double *point = new double[3];
+    plane->GetOutput()->GetPoint(i, point);
+    probes.push_back(point);
     }
 
-  std::string dataRoot = testHelper->GetDataRoot();
-  std::string fileName = dataRoot + "/Data/CuspySurface.vtp";
-  std::cout << fileName << std::endl;
-
-  // Set up reader
-  vtkNew<vtkXMLPolyDataReader> reader;
-  reader->SetFileName(fileName.c_str());
-  reader->Update();
-
-  // Set up distance calculator
-  vtkNew<vtkImplicitPolyDataDistance> implicitDistance;
-  implicitDistance->SetInput(reader->GetOutput());
-
-  // Compute distances to test points, saving those within the cuspy surface for display
-  vtkNew<vtkPoints> points;
-  double xRange[2] = {-47.6, 46.9};
-  double yRange[2] = {-18.2, 82.1};
-  double zRange[2] = {1.63, 102};
-  const double spacing = 10.0;
-  for (double z = zRange[0]; z < zRange[1]; z += spacing)
+  std::vector<double*>::iterator it = probes.begin();
+  for ( ; it != probes.end(); ++it)
     {
-    for (double y = yRange[0]; y < yRange[1]; y += spacing)
-      {
-      for (double x = xRange[0]; x < xRange[1]; x += spacing)
-        {
-        double pt[3] = {x, y, z};
-        double distance = implicitDistance->EvaluateFunction(pt);
-        if (distance <= 0.0)
-          {
-          points->InsertNextPoint(pt);
-          }
-        }
-      }
+    double *p = *it;
+    double result = distance->EvaluateFunction(p);
+    double gradient[3];
+    distance->EvaluateGradient(p, gradient);
+    std::cout << "(" << p[0] << ", "  << p[1] << ", " << p[2] << "): "
+              << result
+              << " gradient(" << gradient[0] << ", "
+              << gradient[1] << ", "
+              << gradient[2] << ")"
+              << std::endl;
     }
 
-  // Set up the point data structure
-  vtkNew<vtkPolyData> insidePoints;
-  insidePoints->SetPoints(points.GetPointer());
-
-  // Glyph the points
-  vtkNew<vtkSphereSource> sphere;
-  sphere->SetRadius(3);
-  vtkNew<vtkGlyph3D> glypher;
-  glypher->SetInputData(insidePoints.GetPointer());
-  glypher->SetSourceConnection(sphere->GetOutputPort());
-
-  // Display the glyphs
-  vtkNew<vtkPolyDataMapper> mapper;
-  mapper->SetInputConnection(glypher->GetOutputPort());
-
-  vtkNew<vtkActor> actor;
-  actor->SetMapper(mapper.GetPointer());
-  actor->GetProperty()->SetColor(1.0, 0.0, 0.0);
-
-  // Display the bounding surface
-  vtkNew<vtkPolyDataMapper> surfaceMapper;
-  surfaceMapper->SetInputConnection(reader->GetOutputPort());
+  distance->Print(std::cout);
 
-  vtkNew<vtkActor> surfaceActor;
-  surfaceActor->SetMapper(surfaceMapper.GetPointer());
-  surfaceActor->GetProperty()->FrontfaceCullingOn();
-
-  // Standard rendering classes
-  vtkSmartPointer<vtkRenderer> renderer =
-    vtkSmartPointer<vtkRenderer>::New();
-  vtkSmartPointer<vtkRenderWindow> renWin =
-    vtkSmartPointer<vtkRenderWindow>::New();
-  renWin->SetMultiSamples(0);
-  renWin->AddRenderer(renderer);
-  vtkSmartPointer<vtkRenderWindowInteractor> iren =
-    vtkSmartPointer<vtkRenderWindowInteractor>::New();
-  iren->SetRenderWindow(renWin);
-
-  renderer->AddActor(actor.GetPointer());
-  renderer->AddActor(surfaceActor.GetPointer());
-
-  // Standard testing code.
-  renderer->SetBackground(0.0, 0.0, 0.0);
-  renWin->SetSize(300,300);
-
-  vtkCamera *camera = renderer->GetActiveCamera();
-  renderer->ResetCamera();
-  camera->Azimuth(30);
-  camera->Elevation(-20);
-
-  iren->Initialize();
-
-  renWin->Render();
-
-  int retVal = vtkRegressionTestImage(renWin.GetPointer());
-  if (retVal == vtkRegressionTester::DO_INTERACTOR)
+  it = probes.begin();
+  for ( ; it != probes.end(); ++it)
     {
-    iren->Start();
+    delete [] *it;
     }
-
-  return !retVal;
+  return EXIT_SUCCESS;
 }
diff --git a/Filters/Core/Testing/Cxx/TestSMPPipelineContour.cxx b/Filters/Core/Testing/Cxx/TestSMPPipelineContour.cxx
index f487dc2..21b3eb9 100644
--- a/Filters/Core/Testing/Cxx/TestSMPPipelineContour.cxx
+++ b/Filters/Core/Testing/Cxx/TestSMPPipelineContour.cxx
@@ -28,7 +28,7 @@
 #include "vtkSmartPointer.h"
 
 const int EXTENT = 100;
-static int WholeExtent[] = {-EXTENT, EXTENT, -EXTENT, EXTENT, -EXTENT, EXTENT};
+int WholeExtent[] = {-EXTENT, EXTENT, -EXTENT, EXTENT, -EXTENT, EXTENT};
 const int NUMBER_OF_PIECES = 50;
 static vtkImageData* Pieces[NUMBER_OF_PIECES];
 
diff --git a/Filters/Core/Testing/Data/Baseline/TestImplicitPolyDataDistance.png.md5 b/Filters/Core/Testing/Data/Baseline/TestImplicitPolyDataDistance.png.md5
deleted file mode 100644
index a97bf13..0000000
--- a/Filters/Core/Testing/Data/Baseline/TestImplicitPolyDataDistance.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-9ec794488c7500c9255d341d9364cc31
diff --git a/Filters/Core/Testing/Python/CMakeLists.txt b/Filters/Core/Testing/Python/CMakeLists.txt
index 3075a8b..3e85bd6 100644
--- a/Filters/Core/Testing/Python/CMakeLists.txt
+++ b/Filters/Core/Testing/Python/CMakeLists.txt
@@ -46,7 +46,6 @@ vtk_add_test_python(
   multipleComponentContour.py
   multipleIso.py
   polyConn.py
-  probe.py
   probeComb.py
   reverseNormals.py
   smoothMeshOnMesh.py
diff --git a/Filters/Core/Testing/Python/probe.py b/Filters/Core/Testing/Python/probe.py
deleted file mode 100755
index 4220b01..0000000
--- a/Filters/Core/Testing/Python/probe.py
+++ /dev/null
@@ -1,90 +0,0 @@
-#!/usr/bin/env python
-
-
-import vtk
-from vtk.test import Testing
-from vtk.util.misc import vtkGetDataRoot
-VTK_DATA_ROOT = vtkGetDataRoot()
-
-
-# Create the RenderWindow, Renderer and both Actors
-#
-ren = vtk.vtkRenderer()
-renWin = vtk.vtkRenderWindow()
-renWin.SetMultiSamples(0)
-renWin.AddRenderer(ren)
-iren = vtk.vtkRenderWindowInteractor()
-iren.SetRenderWindow(renWin)
-
-# cut data
-pl3d = vtk.vtkMultiBlockPLOT3DReader()
-pl3d.SetXYZFileName(VTK_DATA_ROOT + "/Data/combxyz.bin")
-pl3d.SetQFileName(VTK_DATA_ROOT + "/Data/combq.bin")
-pl3d.SetScalarFunctionNumber(100)
-pl3d.SetVectorFunctionNumber(202)
-pl3d.Update()
-output = pl3d.GetOutput().GetBlock(0)
-
-plane = vtk.vtkPlane()
-plane.SetOrigin(output.GetCenter())
-plane.SetNormal(-0.287, 0, 0.9579)
-
-planeCut = vtk.vtkCutter()
-planeCut.SetInputData(output)
-planeCut.SetCutFunction(plane)
-
-probe = vtk.vtkProbeFilter()
-probe.SetInputConnection(planeCut.GetOutputPort())
-probe.SetSourceData(output)
-
-cutMapper = vtk.vtkDataSetMapper()
-cutMapper.SetInputConnection(probe.GetOutputPort())
-cutMapper.SetScalarRange(output.GetPointData().GetScalars().GetRange())
-
-cutActor = vtk.vtkActor()
-cutActor.SetMapper(cutMapper)
-
-#extract plane
-compPlane = vtk.vtkStructuredGridGeometryFilter()
-compPlane.SetInputData(output)
-compPlane.SetExtent(0, 100, 0, 100, 9, 9)
-
-planeMapper = vtk.vtkPolyDataMapper()
-planeMapper.SetInputConnection(compPlane.GetOutputPort())
-planeMapper.ScalarVisibilityOff()
-
-planeActor = vtk.vtkActor()
-planeActor.SetMapper(planeMapper)
-planeActor.GetProperty().SetRepresentationToWireframe()
-planeActor.GetProperty().SetColor(0, 0, 0)
-
-#outline
-outline = vtk.vtkStructuredGridOutlineFilter()
-outline.SetInputData(output)
-
-outlineMapper = vtk.vtkPolyDataMapper()
-outlineMapper.SetInputConnection(outline.GetOutputPort())
-
-outlineActor = vtk.vtkActor()
-outlineActor.SetMapper(outlineMapper)
-
-outlineProp = outlineActor.GetProperty()
-outlineProp.SetColor(0, 0, 0)
-
-# Add the actors to the renderer, set the background and size
-#
-ren.AddActor(outlineActor)
-ren.AddActor(planeActor)
-ren.AddActor(cutActor)
-ren.SetBackground(1, 1, 1)
-renWin.SetSize(400, 300)
-
-cam1 = ren.GetActiveCamera()
-cam1.SetClippingRange(11.1034, 59.5328)
-cam1.SetFocalPoint(9.71821, 0.458166, 29.3999)
-cam1.SetPosition(-2.95748, -26.7271, 44.5309)
-cam1.SetViewUp(0.0184785, 0.479657, 0.877262)
-
-iren.Initialize()
-renWin.Render()
-#iren.Start()
diff --git a/Filters/Core/vtkAppendFilter.cxx b/Filters/Core/vtkAppendFilter.cxx
index 20bcda8..4fdf260 100644
--- a/Filters/Core/vtkAppendFilter.cxx
+++ b/Filters/Core/vtkAppendFilter.cxx
@@ -122,7 +122,8 @@ int vtkAppendFilter::RequestData(
     for (int cc = 0; cc < inputVector[0]->GetNumberOfInformationObjects(); cc++)
       {
       vtkDataSet * tempData = vtkDataSet::GetData(inputVector[0], cc);
-      if (tempData->HasAnyGhostCells())
+      if (tempData && tempData->GetCellData() &&
+          tempData->GetCellData()->GetArray("vtkGhostLevels") != NULL)
         {
         vtkDebugMacro(<< "Ghost cells present, so points will not be merged");
         reallyMergePoints = false;
@@ -210,7 +211,7 @@ int vtkAppendFilter::RequestData(
   vtkSmartPointer<vtkIdList> newPtIds = vtkSmartPointer<vtkIdList>::New();
   newPtIds->Allocate(VTK_CELL_SIZE);
 
-  vtkIdType twentieth = (totalNumPts + totalNumCells)/20 + 1;
+  int twentieth = (totalNumPts + totalNumCells)/20 + 1;
 
   // For optionally merging duplicate points
   vtkIdType* globalIndices = new vtkIdType[totalNumPts];
diff --git a/Filters/Core/vtkAppendPolyData.cxx b/Filters/Core/vtkAppendPolyData.cxx
index 140ecb4..04fdeac 100644
--- a/Filters/Core/vtkAppendPolyData.cxx
+++ b/Filters/Core/vtkAppendPolyData.cxx
@@ -17,7 +17,6 @@
 #include "vtkAlgorithmOutput.h"
 #include "vtkCellArray.h"
 #include "vtkCellData.h"
-#include "vtkDataArrayIteratorMacro.h"
 #include "vtkDataSetAttributes.h"
 #include "vtkInformation.h"
 #include "vtkInformationVector.h"
@@ -170,11 +169,11 @@ int vtkAppendPolyData::ExecuteAppend(vtkPolyData* output,
     ds = inputs[idx];
     if (ds != NULL)
       {
-      if (ds->GetNumberOfPoints() > 0)
+      if ( ds->GetNumberOfPoints() > 0)
         {
         ++countPD;
         }
-      if (ds->GetNumberOfCells() > 0)
+      if (ds->GetNumberOfCells() > 0 )
         {
         ++countCD;
         } // for a data set that has cells
@@ -192,12 +191,12 @@ int vtkAppendPolyData::ExecuteAppend(vtkPolyData* output,
     if (ds != NULL)
       {
       // Skip points and cells if there are no points.  Empty inputs may have no arrays.
-      if (ds->GetNumberOfPoints() > 0)
+      if ( ds->GetNumberOfPoints() > 0)
         {
         numPts += ds->GetNumberOfPoints();
         // Take intersection of available point data fields.
         inPD = ds->GetPointData();
-        if (countPD == 0)
+        if ( countPD == 0 )
           {
           ptList.InitializeFieldList(inPD);
           }
@@ -209,7 +208,7 @@ int vtkAppendPolyData::ExecuteAppend(vtkPolyData* output,
         } // for a data set that has points
 
       // Although we cannot have cells without points ... let's not nest.
-      if (ds->GetNumberOfCells() > 0)
+      if (ds->GetNumberOfCells() > 0 )
         {
         // keep track of the size of the poly cell array
         if (ds->GetPolys())
@@ -239,7 +238,7 @@ int vtkAppendPolyData::ExecuteAppend(vtkPolyData* output,
       } // for a non NULL input
     } // for each input
 
-  if (numPts < 1 || numCells < 1)
+  if ( numPts < 1 || numCells < 1 )
     {
     vtkDebugMacro(<<"No data to append!");
     return 1;
@@ -249,7 +248,7 @@ int vtkAppendPolyData::ExecuteAppend(vtkPolyData* output,
   // Examine the points and check if they're the same type. If not,
   // use highest (double probably), otherwise the type of the first
   // array (float no doubt). Depends on defs in vtkSetGet.h - Warning.
-  int ttype, firstType=1;
+  int ttype, firstType=1, AllSame=1;
   int pointtype = 0;
 
   // Keep track of types for fast point append
@@ -264,6 +263,12 @@ int vtkAppendPolyData::ExecuteAppend(vtkPolyData* output,
         pointtype = ds->GetPoints()->GetData()->GetDataType();
         }
       ttype = ds->GetPoints()->GetData()->GetDataType();
+
+      if ( ttype != pointtype )
+        {
+        AllSame = 0;
+        vtkDebugMacro(<<"Different point data types");
+        }
       pointtype = pointtype > ttype ? pointtype : ttype;
       }
     }
@@ -416,9 +421,16 @@ int vtkAppendPolyData::ExecuteAppend(vtkPolyData* output,
       if (ds->GetNumberOfPoints() > 0)
         {
         // copy points directly
-        this->AppendData(newPts->GetData(),
-                         inPts->GetData(), ptOffset);
-
+        if (AllSame)
+          {
+          this->AppendData(newPts->GetData(),
+                           inPts->GetData(), ptOffset);
+          }
+        else
+          {
+          this->AppendDifferentPoints(newPts->GetData(),
+                                      inPts->GetData(), ptOffset);
+          }
         // copy scalars directly
         if (newPtScalars)
           {
@@ -709,33 +721,15 @@ size_t vtkAppendPolyDataGetTypeSize(T*)
 void vtkAppendPolyData::AppendData(vtkDataArray *dest, vtkDataArray *src,
                                    vtkIdType offset)
 {
-  switch (src->GetDataType())
-    {
-    vtkDataArrayIteratorMacro(src,
-      AppendData(dest, src, offset, vtkDABegin, vtkDAEnd));
-    }
-}
+  void *pSrc, *pDest;
+  vtkIdType length;
 
-//----------------------------------------------------------------------------
-template <class InputIterator>
-void vtkAppendPolyData::AppendData(vtkDataArray *dest, vtkDataArray *src,
-                                   vtkIdType offset, InputIterator srcIt,
-                                   InputIterator srcEnd)
-{
-  switch (dest->GetDataType())
+  // sanity checks
+  if (src->GetDataType() != dest->GetDataType())
     {
-    vtkDataArrayIteratorMacro(dest,
-      AppendData(dest, src, offset, srcIt, srcEnd, vtkDABegin));
+    vtkErrorMacro("Data type mismatch.");
+    return;
     }
-}
-
-
-//----------------------------------------------------------------------------
-template <class InputIterator, class OutputIterator>
-void vtkAppendPolyData::AppendData(vtkDataArray *dest, vtkDataArray *src,
-                                   vtkIdType offset, InputIterator srcIt,
-                                   InputIterator srcEnd, OutputIterator destIt)
-{
   if (src->GetNumberOfComponents() != dest->GetNumberOfComponents())
     {
     vtkErrorMacro("NumberOfComponents mismatch.");
@@ -749,14 +743,82 @@ void vtkAppendPolyData::AppendData(vtkDataArray *dest, vtkDataArray *src,
 
   // convert from tuples to components.
   offset *= src->GetNumberOfComponents();
+  length = src->GetMaxId() + 1;
+
+  switch (src->GetDataType())
+    {
+    vtkTemplateMacro(
+      length *= vtkAppendPolyDataGetTypeSize(static_cast<VTK_TT*>(0))
+      );
+    default:
+      vtkErrorMacro("Unknown data type " << src->GetDataType());
+    }
+
+  pSrc  = src->GetVoidPointer(0);
+  pDest = dest->GetVoidPointer(offset);
+
+  memcpy(pDest, pSrc, length);
+}
+
+//----------------------------------------------------------------------------
+void vtkAppendPolyData::AppendDifferentPoints(vtkDataArray *dest,
+                                              vtkDataArray *src,
+                                              vtkIdType offset)
+{
+  float  *fSrc;
+  double *dSrc, *dDest;
+  vtkIdType p;
+
+  if (src->GetNumberOfTuples() + offset > dest->GetNumberOfTuples())
+    {
+    vtkErrorMacro("Destination not big enough");
+    return;
+    }
 
-  // Position destination iterator
-  destIt += offset;
+  vtkIdType vals = src->GetMaxId()+1;
+  switch (dest->GetDataType())
+    {
+    //
+    // Dest is FLOAT - if sources are not all same type, dest ought to
+    // be double. (assuming float and double are the only choices)
+    //
+    case VTK_FLOAT:
+        vtkErrorMacro("Dest type should be double? "
+            << dest->GetDataType());
+        break;
+    //
+    // Dest is DOUBLE - sources may be mixed float/double combinations
+    //
+
+    case VTK_DOUBLE:
+      dDest = static_cast<double*>(
+        dest->GetVoidPointer(offset*src->GetNumberOfComponents()));
+      //
+      switch (src->GetDataType())
+        {
+        case VTK_FLOAT:
+          fSrc = static_cast<float*>(src->GetVoidPointer(0));
+          for (p=0; p<vals; p++)
+            {
+            dDest[p] = static_cast<double>(fSrc[p]);
+            }
+          break;
+        case VTK_DOUBLE:
+          dSrc = static_cast<double*>(src->GetVoidPointer(0));
+          memcpy(dDest, dSrc, vals*sizeof(double));
+          break;
+        default:
+          vtkErrorMacro("Unknown data type " << dest->GetDataType());
+        }
+      break;
+      //
+    default:
+      vtkErrorMacro("Unknown data type " << dest->GetDataType());
+    }
 
-  // Copy data, performing implicit conversion if necessary
-  std::copy(srcIt, srcEnd, destIt);
 }
 
+
 //----------------------------------------------------------------------------
 // returns the next pointer in dest
 vtkIdType *vtkAppendPolyData::AppendCells(vtkIdType *pDest, vtkCellArray *src,
diff --git a/Filters/Core/vtkAppendPolyData.h b/Filters/Core/vtkAppendPolyData.h
index 919d01b..336f053 100644
--- a/Filters/Core/vtkAppendPolyData.h
+++ b/Filters/Core/vtkAppendPolyData.h
@@ -118,11 +118,10 @@ protected:
                                   vtkInformationVector **, vtkInformationVector *);
   virtual int FillInputPortInformation(int, vtkInformation *);
 
-  // An efficient templated way to append data.
+  // An efficient way to append data/cells.
   void AppendData(vtkDataArray *dest, vtkDataArray *src, vtkIdType offset);
-
-
-  // An efficient way to append cells.
+  void AppendDifferentPoints(vtkDataArray *dest, vtkDataArray *src,
+                             vtkIdType offset);
   vtkIdType *AppendCells(vtkIdType *pDest, vtkCellArray *src,
                          vtkIdType offset);
 
@@ -131,15 +130,6 @@ protected:
   void AddInputData(vtkDataObject *)
     { vtkErrorMacro( << "AddInput() must be called with a vtkPolyData not a vtkDataObject."); };
 
-  template <class InputIterator>
-  void AppendData(vtkDataArray *dest, vtkDataArray *src, vtkIdType offset,
-                  InputIterator srcData, InputIterator srcEnd);
-
-  template <class InputIterator, class OutputIterator>
-  void AppendData(vtkDataArray *dest, vtkDataArray *src, vtkIdType offset,
-                  InputIterator srcData, InputIterator srcEnd,
-                  OutputIterator destData);
-
   int UserManagedInputs;
 
 private:
diff --git a/Filters/Core/vtkCellDataToPointData.cxx b/Filters/Core/vtkCellDataToPointData.cxx
index 01ba996..3e85bcc 100644
--- a/Filters/Core/vtkCellDataToPointData.cxx
+++ b/Filters/Core/vtkCellDataToPointData.cxx
@@ -74,7 +74,7 @@ int vtkCellDataToPointData::RequestData(
   // be over-written during CopyAllocate
   output->GetPointData()->CopyGlobalIdsOff();
   output->GetPointData()->PassData(input->GetPointData());
-  output->GetPointData()->CopyFieldOff(vtkDataSetAttributes::GhostArrayName());
+  output->GetPointData()->CopyFieldOff("vtkGhostLevels");
 
   if (input->GetNumberOfPoints() < 1)
     {
@@ -84,7 +84,7 @@ int vtkCellDataToPointData::RequestData(
 
   // Do the interpolation, taking care of masked cells if needed.
   vtkStructuredGrid *sGrid = vtkStructuredGrid::SafeDownCast(input);
-  if (sGrid && sGrid->HasAnyBlankCells())
+  if (sGrid && sGrid->GetCellBlanking())
     {
     this->interpolatePointDataWithMask(sGrid, output);
     }
@@ -96,7 +96,7 @@ int vtkCellDataToPointData::RequestData(
   if (!this->PassCellData)
     {
     output->GetCellData()->CopyAllOff();
-    output->GetCellData()->CopyFieldOn(vtkDataSetAttributes::GhostArrayName());
+    output->GetCellData()->CopyFieldOn("vtkGhostLevels");
     }
   output->GetCellData()->PassData(input->GetCellData());
 
@@ -203,7 +203,7 @@ int vtkCellDataToPointData::RequestDataForUnstructuredGrid
   // be over-written during CopyAllocate
   opd->CopyGlobalIdsOff();
   opd->PassData(src->GetPointData());
-  opd->CopyFieldOff(vtkDataSetAttributes::GhostArrayName());
+  opd->CopyFieldOff("vtkGhostLevels");
 
   // Copy all existing cell fields into a temporary cell data array
   vtkSmartPointer<vtkCellData> clean = vtkSmartPointer<vtkCellData>::New();
@@ -264,7 +264,7 @@ int vtkCellDataToPointData::RequestDataForUnstructuredGrid
   if (!this->PassCellData)
     {
     dst->GetCellData()->CopyAllOff();
-    dst->GetCellData()->CopyFieldOn(vtkDataSetAttributes::GhostArrayName());
+    dst->GetCellData()->CopyFieldOn("vtkGhostLevels");
     }
   dst->GetCellData()->PassData(src->GetCellData());
 
diff --git a/Filters/Core/vtkContourFilter.cxx b/Filters/Core/vtkContourFilter.cxx
index dc8cc3c..cf6e7f2 100644
--- a/Filters/Core/vtkContourFilter.cxx
+++ b/Filters/Core/vtkContourFilter.cxx
@@ -241,7 +241,6 @@ int vtkContourFilter::RequestUpdateExtent(vtkInformation* request,
       this->GridSynchronizedTemplates->SetComputeNormals(this->ComputeNormals);
       this->GridSynchronizedTemplates->SetComputeGradients(this->ComputeGradients);
       this->GridSynchronizedTemplates->SetComputeScalars(this->ComputeScalars);
-      this->GridSynchronizedTemplates->SetOutputPointsPrecision(this->OutputPointsPrecision);
       this->GridSynchronizedTemplates->SetGenerateTriangles(this->GenerateTriangles);
       return this->GridSynchronizedTemplates->
         ProcessRequest(request,inputVector,outputVector);
@@ -368,7 +367,6 @@ int vtkContourFilter::RequestData(
       this->GridSynchronizedTemplates->SetComputeNormals(this->ComputeNormals);
       this->GridSynchronizedTemplates->SetComputeGradients(this->ComputeGradients);
       this->GridSynchronizedTemplates->SetComputeScalars(this->ComputeScalars);
-      this->GridSynchronizedTemplates->SetOutputPointsPrecision(this->OutputPointsPrecision);
       this->GridSynchronizedTemplates->SetGenerateTriangles(this->GenerateTriangles);
       this->GridSynchronizedTemplates->
         SetInputArrayToProcess(0,this->GetInputArrayInformation(0));
diff --git a/Filters/Core/vtkDelaunay2D.cxx b/Filters/Core/vtkDelaunay2D.cxx
index 71eb7e4..6b2c59c 100644
--- a/Filters/Core/vtkDelaunay2D.cxx
+++ b/Filters/Core/vtkDelaunay2D.cxx
@@ -704,8 +704,8 @@ int vtkDelaunay2D::RequestData(
     //traverse all points, create vertices if none used
     for (ptId=0; ptId<(numPoints+8); ptId++)
       {
-      if ( (ptId < numPoints || this->BoundingTriangulation)
-           && !pointUse[ptId] )
+      if ( !pointUse[ptId]
+           &&  (ptId < numPoints || this->BoundingTriangulation) )
         {
         pts[0] = ptId;
         alphaVerts->InsertNextCell(1,pts);
diff --git a/Filters/Core/vtkDelaunay3D.cxx b/Filters/Core/vtkDelaunay3D.cxx
index acec5d7..90eeb50 100644
--- a/Filters/Core/vtkDelaunay3D.cxx
+++ b/Filters/Core/vtkDelaunay3D.cxx
@@ -700,7 +700,7 @@ int vtkDelaunay3D::RequestData(
       //traverse all points, create vertices if none used
       for (ptId=0; ptId<(numPoints+6); ptId++)
         {
-        if ((ptId < numPoints || this->BoundingTriangulation) && !pointUse[ptId])
+        if (!pointUse[ptId] && (ptId < numPoints || this->BoundingTriangulation))
           {
           pts[0] = ptId;
           output->InsertNextCell(VTK_VERTEX,1,pts);
diff --git a/Filters/Core/vtkFeatureEdges.cxx b/Filters/Core/vtkFeatureEdges.cxx
index 56c8b5e..2e0afe0 100644
--- a/Filters/Core/vtkFeatureEdges.cxx
+++ b/Filters/Core/vtkFeatureEdges.cxx
@@ -91,13 +91,16 @@ int vtkFeatureEdges::RequestData(
   vtkIdType p1, p2, newId;
   vtkPointData *pd=input->GetPointData(), *outPD=output->GetPointData();
   vtkCellData *cd=input->GetCellData(), *outCD=output->GetCellData();
-  unsigned char* ghosts=0;
+  unsigned char* ghostLevels=0;
+  unsigned char  updateLevel = static_cast<unsigned char>(
+    outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_GHOST_LEVELS()));
+
   vtkDebugMacro(<<"Executing feature edges");
 
   vtkDataArray* temp = 0;
   if (cd)
     {
-    temp = cd->GetArray(vtkDataSetAttributes::GhostArrayName());
+    temp = cd->GetArray("vtkGhostLevels");
     }
   if ( (!temp) || (temp->GetDataType() != VTK_UNSIGNED_CHAR)
        || (temp->GetNumberOfComponents() != 1))
@@ -106,7 +109,7 @@ int vtkFeatureEdges::RequestData(
     }
   else
     {
-    ghosts = static_cast<vtkUnsignedCharArray *>(temp)->GetPointer(0);
+    ghostLevels = static_cast<vtkUnsignedCharArray *>(temp)->GetPointer(0);
     }
 
   //  Check input
@@ -242,8 +245,7 @@ int vtkFeatureEdges::RequestData(
 
       if ( this->BoundaryEdges && numNei < 1 )
         {
-        if (ghosts &&
-            ghosts[cellId] & vtkDataSetAttributes::DUPLICATECELL)
+        if (ghostLevels && ghostLevels[cellId] > updateLevel)
           {
           continue;
           }
@@ -266,8 +268,7 @@ int vtkFeatureEdges::RequestData(
           }
         if ( j >= numNei )
           {
-          if (ghosts &&
-              ghosts[cellId]  & vtkDataSetAttributes::DUPLICATECELL)
+          if (ghostLevels && ghostLevels[cellId] > updateLevel)
             {
             continue;
             }
@@ -291,8 +292,7 @@ int vtkFeatureEdges::RequestData(
         polyNormals->GetTuple(cellId, cellTuple);
         if ( vtkMath::Dot(neiTuple, cellTuple) <= cosAngle )
           {
-          if (ghosts &&
-              ghosts[cellId] & vtkDataSetAttributes::DUPLICATECELL)
+          if (ghostLevels && ghostLevels[cellId] > updateLevel)
             {
             continue;
             }
@@ -310,8 +310,7 @@ int vtkFeatureEdges::RequestData(
       else if ( this->ManifoldEdges &&
                 numNei == 1 && neighbors->GetId(0) > cellId )
         {
-        if (ghosts &&
-            ghosts[cellId] & vtkDataSetAttributes::DUPLICATECELL)
+        if (ghostLevels && ghostLevels[cellId] > updateLevel)
           {
           continue;
           }
diff --git a/Filters/Core/vtkGhostArray.h b/Filters/Core/vtkGhostArray.h
new file mode 100644
index 0000000..20c9f3b
--- /dev/null
+++ b/Filters/Core/vtkGhostArray.h
@@ -0,0 +1,128 @@
+/*=========================================================================
+
+ Program:   Visualization Toolkit
+ Module:    vtkGhostArray.h
+
+ 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.
+
+ =========================================================================*/
+// .NAME vtkGhostArray.h -- Encodes/Decodes ghost array information.
+//
+// .SECTION Description
+//  vtkGhostArray provides functionality for manipulating a mesh entity
+//  property field, represented by an "unsigned char". Each mesh entity, e.g.,
+//  a vertex or cell is associated with an "unsigned char" where each individual
+//  bit represents the state of a particular property. This class provides
+//  the logic required to manipulate individual bits in the "unsigned char".
+//
+// .SECTION Caveats
+//  Since an unsigned char is used to represent a mesh entity property field, we
+//  are restricted to at most 8 properties, i.e., [0-7] that can be used to
+//  designate different states.
+
+#ifndef vtkGhostArray_H_
+#define vtkGhostArray_H_
+
+#include "vtkFiltersCoreModule.h" // For export macro
+#include "vtkObject.h"
+
+#include <cassert> // For assert
+
+class VTKFILTERSCORE_EXPORT vtkGhostArray : public vtkObject
+{
+public:
+
+  enum
+    {
+    INTERNAL = 0, // Nodes that are on the interior domain of a partition
+    SHARED   = 1, // Nodes that are on the abutting/internal interface of
+                  // two or more partitions.
+    GHOST    = 2, // Nodes whose value comes from another process/partition
+    VOID     = 3, // Nodes that are ignored in computation/visualization,
+                  // their value is typically garbage.
+    IGNORE   = 4, // Nodes that are ignored in computation/visualization but
+                  // have a valid value, e.g., if a SHARED node is going to be
+                  // processed by another partition, then, this property is
+                  // used to indicate to the rest of the partitions sharing
+                  // that node to ignore it.
+    BOUNDARY = 5, // Nodes that are on the boundaries of the domain
+    PERIODIC = 6  // Nodes that are on periodic boundaries
+    } NodeProperties;
+
+  enum
+    {
+    DUPLICATE = 0, // Ghost cells that exist in another partition, i.e, are
+                   // composed of internal boundary and/or ghost nodes
+    EXTERNAL  = 1, // Cells that are created "artificially" outside the domain,
+                   // i.e., are composed from boundary nodes and nodes outside
+                   // the domain.
+    BLANK     = 2, // Cells that are ignored in computation/visualization, their
+                   // value is typically garbage, or in the case of AMR data,
+                   // they have a value that is typically the average of the
+                   // the values of each subdivision cell.
+    INTERIOR  = 3  // Cells that are internal/owned by a given partition.
+    } CellProperties;
+
+  static vtkGhostArray* New();
+  vtkTypeMacro( vtkGhostArray, vtkObject );
+  void PrintSelf(ostream& os, vtkIndent indent );
+
+  // Description:
+  // Sets the given property in the propertyField.
+  static void SetProperty(
+      unsigned char &propertyField,const int property )
+  {
+    assert("pre:invalid property" && (property >= 0 && property < 8));
+    propertyField |= (1 << property);
+  }
+
+  // Description:
+  // Unsets the property from the given propertyField.
+  static void UnsetProperty(
+      unsigned char &propertyField,const int property )
+  {
+    assert("pre:invalid property" && (property >= 0 && property < 8));
+    propertyField &= ~(1 << property);
+  }
+
+  // Description:
+  // Checks if a property is set in the given property field.
+  static bool IsPropertySet(
+      unsigned char &propertyField,const int property )
+  {
+    assert("pre:invalid property" && (property >= 0 && property < 8));
+    bool status = false;
+    if( propertyField & (1 << property) )
+      {
+      status = true;
+      }
+
+    return status;
+  }
+
+  // Description:
+  // Resets all the bits in the property field
+  static void Reset( unsigned char &propertyField )
+  {
+    for( int i=0; i < 8; ++i )
+      {
+      vtkGhostArray::UnsetProperty( propertyField, i );
+      }
+  }
+
+protected:
+  vtkGhostArray();
+  ~vtkGhostArray();
+
+private:
+  vtkGhostArray( const vtkGhostArray& ); // Not implemented
+  void operator=(const vtkGhostArray& ); // Not implemented
+};
+
+#endif /* vtkGhostArray_H_ */
diff --git a/Filters/Core/vtkGlyph2D.cxx b/Filters/Core/vtkGlyph2D.cxx
index 2eda622..783a4b2 100644
--- a/Filters/Core/vtkGlyph2D.cxx
+++ b/Filters/Core/vtkGlyph2D.cxx
@@ -78,7 +78,7 @@ int vtkGlyph2D::RequestData(
   vtkDataArray* temp = 0;
   if (pd)
     {
-    temp = pd->GetArray(vtkDataSetAttributes::GhostArrayName());
+    temp = pd->GetArray("vtkGhostLevels");
     }
   if ( (!temp) || (temp->GetDataType() != VTK_UNSIGNED_CHAR)
     || (temp->GetNumberOfComponents() != 1))
@@ -354,10 +354,8 @@ int vtkGlyph2D::RequestData(
       continue;
       }
 
-    // Check ghost/blanked points.
-    if (inGhostLevels &&
-        inGhostLevels[inPtId] & (vtkDataSetAttributes::DUPLICATEPOINT |
-                                 vtkDataSetAttributes::HIDDENPOINT))
+    // Check ghost points.
+    if (inGhostLevels && inGhostLevels[inPtId] > 0)
       {
       continue;
       }
diff --git a/Filters/Core/vtkGlyph3D.cxx b/Filters/Core/vtkGlyph3D.cxx
index 3d2c43d..7c2c238 100644
--- a/Filters/Core/vtkGlyph3D.cxx
+++ b/Filters/Core/vtkGlyph3D.cxx
@@ -104,14 +104,17 @@ int vtkGlyph3D::RequestData(
   vtkDataSet* input = vtkDataSet::GetData(inputVector[0], 0);
   vtkPolyData* output = vtkPolyData::GetData(outputVector, 0);
 
-  return this->Execute(input, inputVector[1], output)? 1 : 0;
+  int requestedGhostLevel = outputVector->GetInformationObject(0)->Get(
+      vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_GHOST_LEVELS());
+  return this->Execute(input, inputVector[1], output, requestedGhostLevel)? 1 : 0;
 }
 
 //----------------------------------------------------------------------------
 bool vtkGlyph3D::Execute(
   vtkDataSet* input,
   vtkInformationVector* sourceVector,
-  vtkPolyData* output)
+  vtkPolyData* output,
+  int requestedGhostLevel)
 {
   assert(input && output);
   if (input == NULL || output == NULL)
@@ -176,7 +179,7 @@ bool vtkGlyph3D::Execute(
   vtkDataArray* temp = 0;
   if (pd)
     {
-    temp = pd->GetArray(vtkDataSetAttributes::GhostArrayName());
+    temp = pd->GetArray("vtkGhostLevels");
     }
   if ( (!temp) || (temp->GetDataType() != VTK_UNSIGNED_CHAR)
     || (temp->GetNumberOfComponents() != 1))
@@ -195,7 +198,7 @@ bool vtkGlyph3D::Execute(
     vtkDebugMacro(<<"No points to glyph!");
     pts->Delete();
     trans->Delete();
-    return 1;
+    return true;
     }
 
   // Check input for consistency
@@ -506,9 +509,13 @@ bool vtkGlyph3D::Execute(
 
     // Check ghost points.
     // If we are processing a piece, we do not want to duplicate
-    // glyphs on the borders.
-    if (inGhostLevels &&
-        inGhostLevels[inPtId] & vtkDataSetAttributes::DUPLICATEPOINT)
+    // glyphs on the borders.  The corrct check here is:
+    // ghostLevel > 0.  I am leaving this over glyphing here because
+    // it make a nice example (sphereGhost.tcl) to show the
+    // point ghost levels with the glyph filter.  I am not certain
+    // of the usefulness of point ghost levels over 1, but I will have
+    // to think about it.
+    if (inGhostLevels && inGhostLevels[inPtId] > requestedGhostLevel)
       {
       continue;
       }
diff --git a/Filters/Core/vtkGlyph3D.h b/Filters/Core/vtkGlyph3D.h
index e464317..4bd39ed 100644
--- a/Filters/Core/vtkGlyph3D.h
+++ b/Filters/Core/vtkGlyph3D.h
@@ -267,8 +267,8 @@ protected:
   // glyph the \c input, filling up the \c output based on the filter
   // parameters.
   virtual bool Execute(vtkDataSet* input,
-                       vtkInformationVector* sourceVector,
-                       vtkPolyData* output);
+    vtkInformationVector* sourceVector,
+    vtkPolyData* output, int requestedGhostLevel);
 
   vtkPolyData **Source; // Geometry to copy to each point
   int Scaling; // Determine whether scaling of geometry is performed
diff --git a/Filters/Core/vtkImplicitPolyDataDistance.cxx b/Filters/Core/vtkImplicitPolyDataDistance.cxx
index 77a9bf8..3e0f518 100644
--- a/Filters/Core/vtkImplicitPolyDataDistance.cxx
+++ b/Filters/Core/vtkImplicitPolyDataDistance.cxx
@@ -164,10 +164,12 @@ double vtkImplicitPolyDataDistance::SharedEvaluate(double x[3], double n[3])
       {
       count += (fabs(weights[i]) < this->Tolerance ? 1 : 0);
       }
-    // Face case - weights contains no 0s
-    if ( count == 0 )
+    // if weights contains no 0s
+    if ( count == 0 || count == 1 )
       {
       // Compute face normal.
+      // For count == 0, this is all we need.
+      // For count = 1, we'll add in the normals from adjacent faces.
       if ( cnorms )
         {
         cnorms->GetTuple(cellId, awnorm);
@@ -177,8 +179,9 @@ double vtkImplicitPolyDataDistance::SharedEvaluate(double x[3], double n[3])
         vtkPolygon::ComputeNormal(cell->Points, awnorm);
         }
       }
-    // Edge case - weights contain one 0
-    else if ( count == 1 )
+
+    // if weights contains 1 0s
+    if ( count == 1 )
       {
       // ... edge ... get two adjacent faces, compute average normal
       int a = -1, b = -1;
@@ -199,9 +202,7 @@ double vtkImplicitPolyDataDistance::SharedEvaluate(double x[3], double n[3])
         return this->NoValue;
         }
 
-      // The first argument is the cell ID. We pass a bogus cell ID so that
-      // all face IDs attached to the edge are returned in the idList.
-      this->Input->GetCellEdgeNeighbors(VTK_ID_MAX, a, b, idList);
+      this->Input->GetCellEdgeNeighbors(0, a, b, idList);
       for (int i = 0; i < idList->GetNumberOfIds(); i++)
         {
         double norm[3];
@@ -220,7 +221,7 @@ double vtkImplicitPolyDataDistance::SharedEvaluate(double x[3], double n[3])
       vtkMath::Normalize(awnorm);
       }
 
-    // Vertex case - weights contain two 0s
+    // If weights contains 2 0s
     else if ( count == 2 )
       {
       // ... vertex ... this is the expensive case, get all adjacent
diff --git a/Filters/Core/vtkPointDataToCellData.cxx b/Filters/Core/vtkPointDataToCellData.cxx
index a4d8b16..6e25ed4 100644
--- a/Filters/Core/vtkPointDataToCellData.cxx
+++ b/Filters/Core/vtkPointDataToCellData.cxx
@@ -74,7 +74,7 @@ int vtkPointDataToCellData::RequestData(
   // be over-written during CopyAllocate
   output->GetCellData()->CopyGlobalIdsOff();
   output->GetCellData()->PassData(input->GetCellData());
-  output->GetCellData()->CopyFieldOff(vtkDataSetAttributes::GhostArrayName());
+  output->GetCellData()->CopyFieldOff("vtkGhostLevels");
 
   // notice that inPD and outCD are vtkPointData and vtkCellData; respectively.
   // It's weird, but it works.
@@ -106,7 +106,7 @@ int vtkPointDataToCellData::RequestData(
   if ( !this->PassPointData )
     {
     output->GetPointData()->CopyAllOff();
-    output->GetPointData()->CopyFieldOn(vtkDataSetAttributes::GhostArrayName());
+    output->GetPointData()->CopyFieldOn("vtkGhostLevels");
     }
   output->GetPointData()->PassData(input->GetPointData());
 
diff --git a/Filters/Core/vtkProbeFilter.cxx b/Filters/Core/vtkProbeFilter.cxx
index 851304e..5bc1317 100644
--- a/Filters/Core/vtkProbeFilter.cxx
+++ b/Filters/Core/vtkProbeFilter.cxx
@@ -40,7 +40,8 @@ vtkProbeFilter::vtkProbeFilter()
 {
   this->SpatialMatch = 0;
   this->ValidPoints = vtkIdTypeArray::New();
-  this->MaskPoints = NULL;
+  this->MaskPoints = vtkCharArray::New();
+  this->MaskPoints->SetNumberOfComponents(1);
   this->SetNumberOfInputPorts(2);
   this->ValidPointMaskArrayName = 0;
   this->SetValidPointMaskArrayName("vtkValidPointMask");
@@ -62,11 +63,8 @@ vtkProbeFilter::vtkProbeFilter()
 //----------------------------------------------------------------------------
 vtkProbeFilter::~vtkProbeFilter()
 {
-  if (this->MaskPoints)
-    {
-    this->MaskPoints->Delete();
-    this->MaskPoints = 0;
-    }
+  this->MaskPoints->Delete();
+  this->MaskPoints = 0;
   this->ValidPoints->Delete();
   this->ValidPoints = NULL;
   this->SetValidPointMaskArrayName(0);
@@ -194,15 +192,6 @@ void vtkProbeFilter::InitializeForProbing(vtkDataSet* input,
   // Initialize valid points/mask points arrays.
   this->NumberOfValidPoints = 0;
   this->ValidPoints->Allocate(numPts);
-  // if this is repeatedly called by the pipeline for a composite mesh,
-  // you need a new array for each block
-  // (that is you need to reinitialize the object)
-  if (this->MaskPoints)
-    {
-    this->MaskPoints->Delete();
-    }
-  this->MaskPoints = vtkCharArray::New();
-  this->MaskPoints->SetNumberOfComponents(1);
   this->MaskPoints->SetNumberOfTuples(numPts);
   this->MaskPoints->FillComponent(0, 0);
   this->MaskPoints->SetName(this->ValidPointMaskArrayName?
@@ -290,7 +279,7 @@ void vtkProbeFilter::ProbeEmptyPoints(vtkDataSet *input,
     // Use tolerance as a function of size of source data
     //
     tol2 = source->GetLength();
-    tol2 = (tol2 != 0.0) ? tol2*tol2 / 1000.0 : 0.001;
+    tol2 = tol2 ? tol2*tol2 / 1000.0 : 0.001;
 
     // the actual sampling rate needs to be considered for a
     // more appropriate / accurate selection of the tolerance.
diff --git a/Filters/Core/vtkStructuredGridAppend.cxx b/Filters/Core/vtkStructuredGridAppend.cxx
index 7d1f260..c93d15e 100644
--- a/Filters/Core/vtkStructuredGridAppend.cxx
+++ b/Filters/Core/vtkStructuredGridAppend.cxx
@@ -186,10 +186,7 @@ namespace
             skipValue = false;
             validValues[outputIndex] = 1; // value is from a blanked entity
             }
-          else if(
-            ghosts &&
-            (ghosts->GetValue(inCounter) & vtkDataSetAttributes::DUPLICATECELL) &&
-            validValues[outputIndex] <= 2)
+          else if(ghosts && ghosts->GetValue(inCounter) && validValues[outputIndex] <= 2)
             {
             validValues[outputIndex] = 2; // value is a ghost
             skipValue = false;
@@ -255,7 +252,8 @@ int vtkStructuredGridAppend::RequestData(
         vtkDataArray *outArray;
         vtkIdType numComp;
 
-        vtkUnsignedCharArray* ghosts = input->GetPointGhostArray();
+        vtkUnsignedCharArray* ghosts = vtkUnsignedCharArray::SafeDownCast(
+          input->GetPointData()->GetArray("vtkGhostLevels"));
 
         //do point associated arrays
         for (vtkIdType ai = 0;
@@ -347,7 +345,8 @@ int vtkStructuredGridAppend::RequestData(
           {
           validValues[i] = 0;
           }
-        ghosts = input->GetCellGhostArray();
+        ghosts = vtkUnsignedCharArray::SafeDownCast(
+          input->GetCellData()->GetArray("vtkGhostLevels"));
 
         //do cell associated arrays
         for (vtkIdType ai = 0;
diff --git a/Filters/Core/vtkSynchronizedTemplates3D.cxx b/Filters/Core/vtkSynchronizedTemplates3D.cxx
index 82a8302..7aab740 100644
--- a/Filters/Core/vtkSynchronizedTemplates3D.cxx
+++ b/Filters/Core/vtkSynchronizedTemplates3D.cxx
@@ -88,13 +88,10 @@ static void vtkSynchronizedTemplates3DInitializeOutput(
 {
   vtkPoints *newPts;
   vtkCellArray *newPolys;
+  long estimatedSize;
 
-  const vtkIdType numCells = static_cast<vtkIdType>(ext[1]-ext[0]+1) *
-                             static_cast<vtkIdType>(ext[3]-ext[2]+1) *
-                             static_cast<vtkIdType>(ext[5]-ext[4]+1);
-
-  vtkIdType estimatedSize = (vtkIdType) pow (static_cast<double>(numCells),
-                                             .75);
+  estimatedSize = (int) pow ((double)
+      ((ext[1]-ext[0]+1)*(ext[3]-ext[2]+1)*(ext[5]-ext[4]+1)), .75);
   if (estimatedSize < 1024)
     {
     estimatedSize = 1024;
@@ -152,7 +149,7 @@ static void vtkSynchronizedTemplates3DInitializeOutput(
 // Calculate the gradient using central difference.
 template <class T>
 void vtkSTComputePointGradient(int i, int j, int k, T *s, int *inExt,
-                               vtkIdType xInc, vtkIdType yInc, vtkIdType zInc,
+                               int xInc, int yInc, int zInc,
                                double *spacing, double n[3])
 {
   double sp, sm;
@@ -258,36 +255,35 @@ void ContourImage(vtkSynchronizedTemplates3D *self, int* exExt,
                   vtkDataArray *inScalars, bool outputTriangles)
 {
   int *inExt = data->GetExtent();
-  vtkIdType xdim = exExt[1] - exExt[0] + 1;
-  vtkIdType ydim = exExt[3] - exExt[2] + 1;
+  int xdim = exExt[1] - exExt[0] + 1;
+  int ydim = exExt[3] - exExt[2] + 1;
   double *values = self->GetValues();
   int numContours = self->GetNumberOfContours();
   T *inPtrX, *inPtrY, *inPtrZ;
   T *s0, *s1, *s2, *s3;
   int xMin, xMax, yMin, yMax, zMin, zMax;
-  vtkIdType xInc, yInc, zInc;
+  int xInc, yInc, zInc;
   double *origin = data->GetOrigin();
   double *spacing = data->GetSpacing();
-  vtkIdType *isect1Ptr, *isect2Ptr;
+  int *isect1Ptr, *isect2Ptr;
   double y, z, t;
   int i, j, k;
-  vtkIdType zstep, yisectstep;
-  vtkIdType offsets[12];
+  int zstep, yisectstep;
+  int offsets[12];
   int ComputeNormals = self->GetComputeNormals();
   int ComputeGradients = self->GetComputeGradients();
   int ComputeScalars = self->GetComputeScalars();
   int NeedGradients = ComputeGradients || ComputeNormals;
   double n[3], n0[3], n1[3];
-  vtkIdType jj, g0;
+  int jj, g0;
   int *tablePtr;
-  vtkIdType idx;
-  int vidx;
+  int idx, vidx;
   double x[3], xz[3];
-  vtkIdType v0, v1, v2, v3;
+  int v0, v1, v2, v3;
   vtkIdType ptIds[3];
   double value;
   // We need to know the edgePointId's for interpolating attributes.
-  vtkIdType edgePtId, inCellId, outCellId;
+  int edgePtId, inCellId, outCellId;
   vtkPointData *inPD = data->GetPointData();
   vtkCellData *inCD = data->GetCellData();
   vtkPointData *outPD = output->GetPointData();
@@ -353,7 +349,7 @@ void ContourImage(vtkSynchronizedTemplates3D *self, int* exExt,
   offsets[11] = zstep*3;
 
   // allocate storage array
-  vtkIdType *isect1 = new vtkIdType [xdim*ydim*3*2];
+  int *isect1 = new int [xdim*ydim*3*2];
   // set impossible edges to -1
   for (i = 0; i < ydim; i++)
     {
@@ -730,7 +726,6 @@ void vtkSynchronizedTemplates3D::ThreadedExecute(vtkImageData *data,
     {
     vtkErrorMacro("Scalars have " << numComps << " components. "
                   "ArrayComponent must be smaller than " << numComps);
-
     return;
     }
 
diff --git a/Filters/Extraction/vtkExtractArraysOverTime.cxx b/Filters/Extraction/vtkExtractArraysOverTime.cxx
index 334e4af..9cc8fd6 100644
--- a/Filters/Extraction/vtkExtractArraysOverTime.cxx
+++ b/Filters/Extraction/vtkExtractArraysOverTime.cxx
@@ -370,7 +370,6 @@ static void vtkExtractArraysAddColumnValue(
   arr->SetNumberOfTuples(1);
   arr->SetVariantValue(0, val);
   statSummary->AddColumn(arr);
-  arr->FastDelete();
 }
 
 //------------------------------------------------------------------------------
@@ -963,6 +962,12 @@ void vtkExtractArraysOverTime::ExecuteAtTimeStep(
   vtkDataObject* input = vtkDataObject::GetData(inInfo);
   vtkSelection* selInput = vtkSelection::GetData(selInfo);
 
+  vtkDataObject* inputClone = input->NewInstance();
+  inputClone->ShallowCopy(input);
+
+  vtkSelection* selInputClone = selInput->NewInstance();
+  selInputClone->ShallowCopy(selInput);
+
   vtkExtractSelection* filter = this->SelectionExtractor;
   if (!filter)
     {
@@ -972,8 +977,8 @@ void vtkExtractArraysOverTime::ExecuteAtTimeStep(
     }
   filter->SetPreserveTopology(0);
   filter->SetUseProbeForLocations(1);
-  filter->SetInputData(0, input);
-  filter->SetInputData(1, selInput);
+  filter->SetInputData(0, inputClone);
+  filter->SetInputData(1, selInputClone);
 
   vtkDebugMacro(<< "Preparing subfilter to extract from dataset");
   //pass all required information to the helper filter
@@ -1007,6 +1012,8 @@ void vtkExtractArraysOverTime::ExecuteAtTimeStep(
   this->Internal->AddTimeStep(time_step, output);
 
   output->Delete();
+  inputClone->Delete();
+  selInputClone->Delete();
 
   this->UpdateProgress(
     static_cast<double>(this->CurrentTimeIndex)/this->NumberOfTimeSteps);
diff --git a/Filters/Extraction/vtkExtractCells.cxx b/Filters/Extraction/vtkExtractCells.cxx
index 3acc5aa..ca8d15a 100644
--- a/Filters/Extraction/vtkExtractCells.cxx
+++ b/Filters/Extraction/vtkExtractCells.cxx
@@ -129,8 +129,8 @@ int vtkExtractCells::RequestData(
   this->InputIsUgrid =
     ((vtkUnstructuredGrid::SafeDownCast(input)) != NULL);
 
-  vtkIdType numCellsInput = input->GetNumberOfCells();
-  vtkIdType numCells = this->CellList->IdTypeSet.size();
+  int numCellsInput = input->GetNumberOfCells();
+  int numCells = static_cast<int>(this->CellList->IdTypeSet.size());
 
   if (numCells == numCellsInput)
     {
@@ -219,13 +219,15 @@ int vtkExtractCells::RequestData(
 //----------------------------------------------------------------------------
 void vtkExtractCells::Copy(vtkDataSet *input, vtkUnstructuredGrid *output)
 {
+  int i;
+
   if (this->InputIsUgrid)
     {
     output->DeepCopy(vtkUnstructuredGrid::SafeDownCast(input));
     return;
     }
 
-  vtkIdType numCells = input->GetNumberOfCells();
+  int numCells = input->GetNumberOfCells();
 
   vtkPointData *PD = input->GetPointData();
   vtkCellData *CD = input->GetCellData();
@@ -233,7 +235,7 @@ void vtkExtractCells::Copy(vtkDataSet *input, vtkUnstructuredGrid *output)
   vtkPointData *newPD = output->GetPointData();
   vtkCellData *newCD  = output->GetCellData();
 
-  vtkIdType numPoints = input->GetNumberOfPoints();
+  int numPoints = input->GetNumberOfPoints();
 
   output->Allocate(numCells);
 
@@ -244,7 +246,7 @@ void vtkExtractCells::Copy(vtkDataSet *input, vtkUnstructuredGrid *output)
   vtkPoints *pts = vtkPoints::New();
   pts->SetNumberOfPoints(numPoints);
 
-  for (vtkIdType i=0; i<numPoints; i++)
+  for (i=0; i<numPoints; i++)
     {
     pts->SetPoint(i, input->GetPoint(i));
     }
@@ -278,13 +280,13 @@ vtkIdType vtkExtractCells::findInSortedList(vtkIdList *idList, vtkIdType id)
 
   if (numids < 8) return idList->IsId(id);
 
-  vtkIdType L, R, M;
+  int L, R, M;
   L=0;
   R=numids-1;
 
   vtkIdType *ids = idList->GetPointer(0);
 
-  vtkIdType loc = -1;
+  int loc = -1;
 
   while (R > L)
     {
@@ -325,7 +327,7 @@ vtkIdType vtkExtractCells::findInSortedList(vtkIdList *idList, vtkIdType id)
 //----------------------------------------------------------------------------
 vtkIdList *vtkExtractCells::reMapPointIds(vtkDataSet *grid)
 {
-  vtkIdType totalPoints = grid->GetNumberOfPoints();
+  int totalPoints = grid->GetNumberOfPoints();
 
   char *temp = new char [totalPoints];
 
@@ -384,7 +386,7 @@ vtkIdList *vtkExtractCells::reMapPointIds(vtkDataSet *grid)
       {
       if (*cellPtr > maxid) continue;
 
-      vtkIdType loc = locs[*cellPtr];
+      int loc = locs[*cellPtr];
 
       vtkIdType nIds = cellArray[loc++];
 
@@ -404,7 +406,7 @@ vtkIdList *vtkExtractCells::reMapPointIds(vtkDataSet *grid)
     }
 
   ptIds->SetNumberOfIds(numberOfIds);
-  vtkIdType next=0;
+  int next=0;
 
   for (id=0; id<totalPoints; id++)
     {
@@ -458,7 +460,7 @@ void vtkExtractCells::CopyCellsDataSet(vtkIdList *ptMap, vtkDataSet *input,
 
       cellPoints->SetId(i, newId);
       }
-    vtkIdType newId = output->InsertNextCell(input->GetCellType(cellId), cellPoints);
+    int newId = output->InsertNextCell(input->GetCellType(cellId), cellPoints);
 
     newCD->CopyData(oldCD, cellId, newId);
     if(origMap)
@@ -528,9 +530,9 @@ void vtkExtractCells::CopyCellsUnstructuredGrid(vtkIdList *ptMap,
     {
     if (*cellPtr > maxid) continue;
 
-    vtkIdType oldCellId = *cellPtr;
+    int oldCellId = *cellPtr;
 
-    vtkIdType loc = locs[oldCellId];
+    int loc = locs[oldCellId];
     int size = static_cast<int>(cells[loc]);
     vtkIdType *pts = cells + loc + 1;
     unsigned char type = types->GetValue(oldCellId);
diff --git a/Filters/Extraction/vtkExtractDataSets.cxx b/Filters/Extraction/vtkExtractDataSets.cxx
index b15476c..9e1409b 100644
--- a/Filters/Extraction/vtkExtractDataSets.cxx
+++ b/Filters/Extraction/vtkExtractDataSets.cxx
@@ -14,16 +14,14 @@
 =========================================================================*/
 #include "vtkExtractDataSets.h"
 
-#include "vtkCellData.h"
-#include "vtkHierarchicalBoxDataSet.h"
+#include "vtkObjectFactory.h"
 #include "vtkInformation.h"
 #include "vtkInformationVector.h"
-#include "vtkMultiBlockDataSet.h"
-#include "vtkMultiPieceDataSet.h"
-#include "vtkObjectFactory.h"
+#include "vtkHierarchicalBoxDataSet.h"
 #include "vtkUniformGrid.h"
 #include "vtkUnsignedCharArray.h"
-
+#include "vtkMultiBlockDataSet.h"
+#include "vtkMultiPieceDataSet.h"
 
 #include <cassert>
 #include <set>
@@ -147,7 +145,7 @@ int vtkExtractDataSets::RequestData(
       clone->ShallowCopy(inUG);
 
       // Remove blanking from output datasets.
-      clone->GetCellData()->RemoveArray(vtkDataSetAttributes::GhostArrayName());
+      clone->SetCellVisibilityArray(0);
       mpds->SetPiece( out_index, clone );
       clone->Delete();
       }
diff --git a/Filters/Extraction/vtkExtractEdges.cxx b/Filters/Extraction/vtkExtractEdges.cxx
index f43f174..88a7d55 100644
--- a/Filters/Extraction/vtkExtractEdges.cxx
+++ b/Filters/Extraction/vtkExtractEdges.cxx
@@ -118,7 +118,7 @@ int vtkExtractEdges::RequestData(
 
   // Loop over all cells, extracting non-visited edges.
   //
-  vtkIdType tenth = numCells/10 + 1;
+  int tenth = numCells/10 + 1;
   for (cellNum=0; cellNum < numCells && !abort; cellNum++ )
     {
     if ( ! (cellNum % tenth) ) //manage progress reports / early abort
diff --git a/Filters/Extraction/vtkExtractGeometry.cxx b/Filters/Extraction/vtkExtractGeometry.cxx
index 6290b38..34bc589 100644
--- a/Filters/Extraction/vtkExtractGeometry.cxx
+++ b/Filters/Extraction/vtkExtractGeometry.cxx
@@ -92,7 +92,7 @@ int vtkExtractGeometry::RequestData(
       vtkSmartPointer<vtkCellIterator>::Take(input->NewCellIterator());
   vtkIdList *pointIdList;
   int cellType;
-  vtkIdType numCellPts;
+  int numCellPts;
   double x[3];
   double multiplier;
   vtkPoints *newPts;
diff --git a/Filters/Extraction/vtkExtractSelectedFrustum.cxx b/Filters/Extraction/vtkExtractSelectedFrustum.cxx
index c58d212..4083923 100644
--- a/Filters/Extraction/vtkExtractSelectedFrustum.cxx
+++ b/Filters/Extraction/vtkExtractSelectedFrustum.cxx
@@ -1067,10 +1067,10 @@ int vtkExtractSelectedFrustum::ABoxFrustumIsect(double *bounds, vtkCell *cell)
 //handle degenerate cells by testing each point, if any in, then in
 int vtkExtractSelectedFrustum::IsectDegenerateCell(vtkCell *cell)
 {
-  vtkIdType npts = cell->GetNumberOfPoints();
+  int npts = cell->GetNumberOfPoints();
   vtkPoints *pts = cell->GetPoints();
   double x[3];
-  for (vtkIdType i = 0; i < npts; i++)
+  for (int i = 0; i < npts; i++)
     {
     pts->GetPoint(i, x);
     if (this->Frustum->EvaluateFunction(x) < 0.0)
diff --git a/Filters/Extraction/vtkExtractSelectedThresholds.cxx b/Filters/Extraction/vtkExtractSelectedThresholds.cxx
index c8b7e66..473b5d8 100644
--- a/Filters/Extraction/vtkExtractSelectedThresholds.cxx
+++ b/Filters/Extraction/vtkExtractSelectedThresholds.cxx
@@ -228,7 +228,7 @@ int vtkExtractSelectedThresholds::ExtractCells(
   vtkCell *cell = 0;
   vtkPoints *newPoints = 0;
   vtkIdType i, ptId, newId, numPts, numCells;
-  vtkIdType numCellPts;
+  int numCellPts;
   double x[3];
 
   vtkPointData *pd=input->GetPointData(), *outPD=output->GetPointData();
diff --git a/Filters/Extraction/vtkExtractVectorComponents.cxx b/Filters/Extraction/vtkExtractVectorComponents.cxx
index a43f149..1252b85 100644
--- a/Filters/Extraction/vtkExtractVectorComponents.cxx
+++ b/Filters/Extraction/vtkExtractVectorComponents.cxx
@@ -139,7 +139,7 @@ int vtkExtractVectorComponents::RequestData(
   vtkDataSet *output = vtkDataSet::SafeDownCast(
     outInfo->Get(vtkDataObject::DATA_OBJECT()));
 
-  vtkIdType numVectors = 0, numVectorsc = 0;
+  int numVectors = 0, numVectorsc = 0;
   vtkDataArray *vectors, *vectorsc;
   vtkDataArray *vx, *vy, *vz;
   vtkDataArray *vxc, *vyc, *vzc;
diff --git a/Filters/FlowPaths/Testing/Cxx/CMakeLists.txt b/Filters/FlowPaths/Testing/Cxx/CMakeLists.txt
index a5fff09..502aa18 100644
--- a/Filters/FlowPaths/Testing/Cxx/CMakeLists.txt
+++ b/Filters/FlowPaths/Testing/Cxx/CMakeLists.txt
@@ -1,7 +1,6 @@
 vtk_add_test_cxx(${vtk-module}CxxTests tests
   TestBSPTree.cxx
   TestStreamTracer.cxx,NO_VALID
-  TestStreamTracerSurface.cxx
   TestAMRInterpolatedVelocityField.cxx,NO_VALID
   TestParticleTracers.cxx,NO_VALID
   )
diff --git a/Filters/FlowPaths/Testing/Cxx/TestAMRInterpolatedVelocityField.cxx b/Filters/FlowPaths/Testing/Cxx/TestAMRInterpolatedVelocityField.cxx
index 137ab71..9534df1 100644
--- a/Filters/FlowPaths/Testing/Cxx/TestAMRInterpolatedVelocityField.cxx
+++ b/Filters/FlowPaths/Testing/Cxx/TestAMRInterpolatedVelocityField.cxx
@@ -19,7 +19,7 @@
 #include <vtkOverlappingAMR.h>
 #include <vtkMath.h>
 #include <vtkCompositeDataPipeline.h>
-#include "vtkUniformGrid.h"
+
 #define RETURNONFALSE(b)\
   if(!(b)) \
     {\
@@ -42,20 +42,6 @@ int TestAMRInterpolatedVelocityField(int, char*[])
 
   vtkOverlappingAMR* amrGrad = vtkOverlappingAMR::SafeDownCast(gradientFilter->GetOutputDataObject(0));
   amrGrad->GenerateParentChildInformation();
-  for(unsigned int datasetLevel =0; datasetLevel<amrGrad->GetNumberOfLevels(); datasetLevel++)
-    {
-    for(unsigned int id=0; id < amrGrad->GetNumberOfDataSets(datasetLevel); id++)
-      {
-      vtkUniformGrid* grid = amrGrad->GetDataSet(datasetLevel,id);
-      int numBlankedCells(0);
-      for(int i=0; i<grid->GetNumberOfCells();i++)
-        {
-        numBlankedCells += grid->IsCellVisible(i)? 0 : 1;
-        }
-      cout<<numBlankedCells<<" ";
-      }
-    }
-  cout<<endl;
 
   vtkNew<vtkAMRInterpolatedVelocityField> func;
   func->SetAMRData(amrGrad);
diff --git a/Filters/FlowPaths/Testing/Cxx/TestStreamTracerSurface.cxx b/Filters/FlowPaths/Testing/Cxx/TestStreamTracerSurface.cxx
deleted file mode 100644
index 6c7ae1a..0000000
--- a/Filters/FlowPaths/Testing/Cxx/TestStreamTracerSurface.cxx
+++ /dev/null
@@ -1,102 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    TestDistancePolyDataFilter.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 "vtkActor.h"
-#include "vtkArrayCalculator.h"
-#include "vtkDataSetMapper.h"
-#include "vtkMath.h"
-#include "vtkNew.h"
-#include "vtkProperty.h"
-#include "vtkPolyData.h"
-#include "vtkPoints.h"
-#include "vtkPointSource.h"
-#include "vtkRegressionTestImage.h"
-#include "vtkRenderer.h"
-#include "vtkRenderWindow.h"
-#include "vtkRenderWindowInteractor.h"
-#include "vtkRTAnalyticSource.h"
-#include "vtkStreamTracer.h"
-#include "vtkWarpScalar.h"
-
-int TestStreamTracerSurface(int argc, char* argv[])
-{
-
-  vtkNew<vtkRTAnalyticSource> wavelet;
-  wavelet->SetWholeExtent(-10, 100, -10, 100, 0, 0);
-
-  vtkNew<vtkWarpScalar> warp;
-  warp->SetScaleFactor(0.1);
-  warp->SetInputConnection(wavelet->GetOutputPort());
-
-  vtkNew<vtkArrayCalculator> calc;
-  calc->AddScalarArrayName("RTData");
-  calc->SetFunction("abs(RTData)*iHat + abs(RTData)*jHat");
-  calc->SetInputConnection(warp->GetOutputPort());
-  calc->Update();
-
-  vtkNew<vtkPoints> points;
-  vtkDataSet* calcData = calc->GetOutput();
-  vtkIdType nLine = static_cast<vtkIdType>(sqrt(static_cast<double>(calcData->GetNumberOfPoints())));
-  for (vtkIdType i = 0; i < nLine; i += 10)
-    {
-    points->InsertNextPoint(calcData->GetPoint(i * (nLine - 1) + nLine));
-    }
-
-  vtkNew<vtkPolyData> pointsPolydata;
-  pointsPolydata->SetPoints(points.Get());
-
-  vtkNew<vtkStreamTracer> stream;
-  stream->SurfaceStreamlinesOn();
-  stream->SetMaximumPropagation(210);
-  stream->SetIntegrationDirection(vtkStreamTracer::BOTH);
-  stream->SetInputConnection(calc->GetOutputPort());
-  stream->SetSourceData(pointsPolydata.Get());
-
-  vtkNew<vtkDataSetMapper> streamMapper;
-  streamMapper->SetInputConnection(stream->GetOutputPort());
-  streamMapper->ScalarVisibilityOff();
-
-  vtkNew<vtkDataSetMapper> surfaceMapper;
-  surfaceMapper->SetInputConnection(calc->GetOutputPort());
-
-  vtkNew<vtkActor> streamActor;
-  streamActor->SetMapper(streamMapper.Get());
-  streamActor->GetProperty()->SetColor(1, 1, 1);
-  streamActor->GetProperty()->SetLineWidth(4.);
-  streamActor->SetPosition(0, 0, 1);
-
-  vtkNew<vtkActor> surfaceActor;
-  surfaceActor->SetMapper(surfaceMapper.Get());
-  surfaceActor->GetProperty()->SetRepresentationToSurface();
-
-  vtkNew<vtkRenderer> renderer;
-  renderer->AddActor(surfaceActor.GetPointer());
-  renderer->AddActor(streamActor.GetPointer());
-  renderer->ResetCamera();
-  renderer->SetBackground(1., 1., 1.);
-
-  vtkNew<vtkRenderWindow> renWin;
-  renWin->AddRenderer(renderer.GetPointer());
-  renWin->SetMultiSamples(0);
-  renWin->SetSize(300, 300);
-
-  vtkNew<vtkRenderWindowInteractor> iren;
-  iren->SetRenderWindow(renWin.GetPointer());
-
-  int retVal = vtkRegressionTestImage(renWin.GetPointer());
-  if (retVal == vtkRegressionTester::DO_INTERACTOR)
-    {
-    iren->Start();
-    }
-  return !retVal;
-}
diff --git a/Filters/FlowPaths/Testing/Data/Baseline/TestStreamTracerSurface.png.md5 b/Filters/FlowPaths/Testing/Data/Baseline/TestStreamTracerSurface.png.md5
deleted file mode 100644
index b588a0c..0000000
--- a/Filters/FlowPaths/Testing/Data/Baseline/TestStreamTracerSurface.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-9202b58eca0942a641744e35c799e7f8
diff --git a/Filters/FlowPaths/vtkAbstractInterpolatedVelocityField.cxx b/Filters/FlowPaths/vtkAbstractInterpolatedVelocityField.cxx
index e0881b7..29b3c57 100644
--- a/Filters/FlowPaths/vtkAbstractInterpolatedVelocityField.cxx
+++ b/Filters/FlowPaths/vtkAbstractInterpolatedVelocityField.cxx
@@ -15,7 +15,6 @@
 #include "vtkAbstractInterpolatedVelocityField.h"
 
 #include "vtkMath.h"
-#include "vtkNew.h"
 #include "vtkDataSet.h"
 #include "vtkDataArray.h"
 #include "vtkPointData.h"
@@ -26,7 +25,6 @@
 
 //----------------------------------------------------------------------------
 const double vtkAbstractInterpolatedVelocityField::TOLERANCE_SCALE = 1.0E-8;
-const double vtkAbstractInterpolatedVelocityField::SURFACE_TOLERANCE_SCALE = 1.0E-5;
 
 //---------------------------------------------------------------------------
 vtkAbstractInterpolatedVelocityField::vtkAbstractInterpolatedVelocityField()
@@ -49,8 +47,6 @@ vtkAbstractInterpolatedVelocityField::vtkAbstractInterpolatedVelocityField()
   this->VectorsType = 0;
   this->VectorsSelection = 0;
   this->NormalizeVector  = false;
-  this->ForceSurfaceTangentVector  = false;
-  this->SurfaceDataset = false;
 
   this->Cell     = vtkGenericCell::New();
   this->GenCell  = vtkGenericCell::New();
@@ -65,8 +61,11 @@ vtkAbstractInterpolatedVelocityField::~vtkAbstractInterpolatedVelocityField()
   this->LastDataSet  = 0;
   this->SetVectorsSelection(0);
 
-  delete[] this->Weights;
-  this->Weights = 0;
+  if ( this->Weights )
+    {
+    delete[] this->Weights;
+    this->Weights = 0;
+    }
 
   if ( this->Cell )
     {
@@ -85,9 +84,11 @@ vtkAbstractInterpolatedVelocityField::~vtkAbstractInterpolatedVelocityField()
 int vtkAbstractInterpolatedVelocityField::FunctionValues
   ( vtkDataSet * dataset, double * x, double * f )
 {
-  int i, j, numPts, id;
+  int i, j, subId , numPts, id;
   vtkDataArray * vectors = NULL;
   double vec[3];
+  double dist2;
+  int ret;
 
   f[0] = f[1] = f[2] = 0.0;
 
@@ -99,8 +100,8 @@ int vtkAbstractInterpolatedVelocityField::FunctionValues
     return 0;
     }
   if(!this->VectorsSelection) //if a selection is not speicifed,
+                              //use the first one in the point set (this is a behavior for backward compatability)
     {
-    //use the first one in the point set (this is a behavior for backward compatability)
     vectors =  dataset->GetPointData()->GetVectors(0);
     }
   else
@@ -114,15 +115,68 @@ int vtkAbstractInterpolatedVelocityField::FunctionValues
     return 0;
     }
 
+  double tol2 = dataset->GetLength() *
+                vtkAbstractInterpolatedVelocityField::TOLERANCE_SCALE;
+
+
+  int found = 0;
+
+  if ( this->Caching )
+    {
+    // See if the point is in the cached cell
+    if ( this->LastCellId == -1 ||
+         !(  ret = this->GenCell->EvaluatePosition
+                   ( x, 0, subId, this->LastPCoords, dist2, this->Weights)
+          )
+        || ret == -1
+       )
+      {
+      // if not, find and get it
+      if ( this->LastCellId != - 1 )
+        {
+        this->CacheMiss ++;
+
+        dataset->GetCell( this->LastCellId, this->Cell );
+
+        this->LastCellId =
+          dataset->FindCell( x, this->Cell, this->GenCell, this->LastCellId,
+                             tol2, subId, this->LastPCoords, this->Weights );
+
+        if ( this->LastCellId != -1 )
+          {
+          dataset->GetCell( this->LastCellId, this->GenCell );
+          found = 1;
+          }
+        }
+      }
+    else
+      {
+      this->CacheHit ++;
+      found = 1;
+      }
+    }
 
-  if (!this->FindAndUpdateCell(dataset, x))
+  if ( !found )
     {
+    // if the cell is not found, do a global search (ignore initial
+    // cell if there is one)
+    this->LastCellId =
+      dataset->FindCell( x, 0, this->GenCell, -1, tol2,
+                         subId, this->LastPCoords, this->Weights );
+
+    if ( this->LastCellId != -1 )
+      {
+      dataset->GetCell( this->LastCellId, this->GenCell );
+      }
+    else
+      {
       vectors = NULL;
       return  0;
+      }
     }
 
   // if the cell is valid
-  if (this->LastCellId >= 0)
+  if ( this->LastCellId >= 0 )
     {
     numPts = this->GenCell->GetNumberOfPoints();
 
@@ -144,46 +198,6 @@ int vtkAbstractInterpolatedVelocityField::FunctionValues
       vectors->GetTuple(this->LastCellId, f);
       }
 
-    if (this->ForceSurfaceTangentVector)
-      {
-      vtkNew<vtkIdList> ptIds;
-      dataset->GetCellPoints(this->LastCellId, ptIds.Get());
-      if (ptIds->GetNumberOfIds() < 3)
-        {
-        vtkErrorMacro(<<"Cannot compute normal on cells with less than 3 points");
-        }
-      else
-        {
-        double p1[3];
-        double p2[3];
-        double p3[3];
-        double normal[3];
-        double v1[3], v2[3];
-        double k;
-
-        dataset->GetPoint(ptIds->GetId(0), p1);
-        dataset->GetPoint(ptIds->GetId(1), p2);
-        dataset->GetPoint(ptIds->GetId(2), p3);
-
-        // Compute othogonal component
-        v1[0] = p2[0] - p1[0];
-        v1[1] = p2[1] - p1[1];
-        v1[2] = p2[2] - p1[2];
-        v2[0] = p3[0] - p1[0];
-        v2[1] = p3[1] - p1[1];
-        v2[2] = p3[2] - p1[2];
-
-        vtkMath::Cross(v1, v2, normal);
-        vtkMath::Normalize(normal);
-        k = vtkMath::Dot(normal, f);
-
-        // Remove non orthogonal component.
-        f[0] = f[0] - (normal[0] * k);
-        f[1] = f[1] - (normal[1] * k);
-        f[2] = f[2] - (normal[2] * k);
-        }
-      }
-
     if ( this->NormalizeVector == true )
       {
       vtkMath::Normalize( f );
@@ -200,188 +214,6 @@ int vtkAbstractInterpolatedVelocityField::FunctionValues
   return  1;
 }
 
-//---------------------------------------------------------------------------
-bool vtkAbstractInterpolatedVelocityField::CheckPCoords(double pcoords [3])
-{
-  for (int i = 0; i < 3; i++)
-    {
-    if (pcoords[i] < 0 || pcoords[i] > 1)
-      {
-      return false;
-      }
-    }
-  return true;
-}
-
-//---------------------------------------------------------------------------
-bool vtkAbstractInterpolatedVelocityField::FindAndUpdateCell(vtkDataSet* dataset, double* x)
-{
-  double tol2, dist2;
-  if (this->SurfaceDataset)
-    {
-    tol2 = dataset->GetLength() *  dataset->GetLength() *
-      vtkAbstractInterpolatedVelocityField::SURFACE_TOLERANCE_SCALE;
-    }
-  else
-    {
-    tol2 = dataset->GetLength() *  dataset->GetLength() *
-           vtkAbstractInterpolatedVelocityField::TOLERANCE_SCALE;
-    }
-
-  double closest[3];
-  bool found = false;
-  if (this->Caching)
-    {
-    bool out = false;
-
-    // See if the point is in the cached cell
-    if (this->LastCellId != -1)
-      {
-      // Use cache cell only if point is inside
-      // or , with surface , not far and in pccords
-      int ret = this->GenCell->EvaluatePosition
-          (x, closest, this->LastSubId, this->LastPCoords, dist2, this->Weights);
-      if (ret == -1
-          || (ret == 0 && !this->SurfaceDataset)
-          || (this->SurfaceDataset && (dist2 > tol2 || !this->CheckPCoords(this->LastPCoords))))
-        {
-        out = true;
-        }
-
-      if (out)
-        {
-        this->CacheMiss++;
-
-        dataset->GetCell(this->LastCellId, this->Cell);
-
-        // Search around current cached cell to see if there is a cell within tolerance
-        this->LastCellId =
-          dataset->FindCell(x, this->Cell, this->GenCell, this->LastCellId,
-                            tol2, this->LastSubId, this->LastPCoords, this->Weights);
-
-        if (this->LastCellId != -1 && (!this->SurfaceDataset || this->CheckPCoords(this->LastPCoords)))
-          {
-          dataset->GetCell(this->LastCellId, this->GenCell);
-          found = true;
-          }
-        }
-      else
-        {
-        this->CacheHit++;
-        found = true;
-        }
-      }
-    }
-  if (!found)
-    {
-    // if the cell is not found in cache, do a global search (ignore initial
-    // cell if there is one)
-    this->LastCellId =
-      dataset->FindCell(x, 0, this->GenCell, -1, tol2,
-                        this->LastSubId, this->LastPCoords, this->Weights);
-
-    if (this->LastCellId != -1 && (!this->SurfaceDataset || this->CheckPCoords(this->LastPCoords)))
-      {
-      dataset->GetCell(this->LastCellId, this->GenCell);
-      }
-    else
-      {
-      if (this->SurfaceDataset)
-        {
-        // Still cannot find cell, use point locator to find a (arbitrary) cell, for 2D surface
-        vtkIdType idPoint = dataset->FindPoint(x);
-        if (idPoint < 0)
-          {
-          this->LastCellId = -1;
-          return false;
-          }
-
-        vtkNew<vtkIdList> cellList;
-        dataset->GetPointCells(idPoint, cellList.Get());
-        double minDist2 = dataset->GetLength() * dataset->GetLength();
-        vtkIdType minDistId = -1;
-        for (vtkIdType idCell = 0; idCell < cellList->GetNumberOfIds(); idCell++)
-          {
-          this->LastCellId = cellList->GetId(idCell);
-          dataset->GetCell(this->LastCellId, this->GenCell);
-          int ret = this->GenCell->EvaluatePosition
-            (x, closest, this->LastSubId, this->LastPCoords, dist2, this->Weights);
-          if (ret != -1 && dist2 < minDist2)
-            {
-            minDistId = this->LastCellId;
-            minDist2 = dist2;
-            }
-          }
-
-        if (minDistId == -1)
-          {
-          this->LastCellId = -1;
-          return false;
-          }
-
-        // Recover closest cell info
-        this->LastCellId = minDistId;
-        dataset->GetCell(this->LastCellId, this->GenCell);
-        int ret = this->GenCell->EvaluatePosition
-            (x, closest, this->LastSubId, this->LastPCoords, dist2, this->Weights);
-
-        // Find Point being not perfect to find cell, check for closer cells
-        vtkNew<vtkIdList> boundaryPoints;
-        vtkNew<vtkIdList> neighCells;
-        bool edge = false;
-        bool closer;
-        while (true)
-          {
-            this->GenCell->CellBoundary(this->LastSubId, this->LastPCoords, boundaryPoints.Get());
-            dataset->GetCellNeighbors(this->LastCellId, boundaryPoints.Get(), neighCells.Get());
-            if (neighCells->GetNumberOfIds() == 0)
-              {
-              edge = true;
-              break;
-              }
-            closer = false;
-            for (vtkIdType neighCellId = 0; neighCellId < neighCells->GetNumberOfIds(); neighCellId++)
-              {
-                this->LastCellId = neighCells->GetId(neighCellId);
-                dataset->GetCell(this->LastCellId, this->GenCell);
-                ret = this->GenCell->EvaluatePosition
-                  (x, closest, this->LastSubId, this->LastPCoords, dist2, this->Weights);
-                if (ret != -1 && dist2 < minDist2)
-                  {
-                  minDistId = this->LastCellId;
-                  minDist2 = dist2;
-                  closer = true;
-                  }
-              }
-            if (!closer)
-              {
-              break;
-              }
-          }
-
-        // Recover closest cell info
-        if (!edge)
-          {
-          this->LastCellId = minDistId;
-          dataset->GetCell(this->LastCellId, this->GenCell);
-          this->GenCell->EvaluatePosition
-              (x, closest, this->LastSubId, this->LastPCoords, dist2, this->Weights);
-          }
-        if (minDist2 > tol2 || (!this->CheckPCoords(this->LastPCoords) && edge))
-          {
-          this->LastCellId = -1;
-          return false;
-          }
-        }
-      else
-        {
-        this->LastCellId = -1;
-        return  false;
-        }
-      }
-    }
-  return true;
-}
 //----------------------------------------------------------------------------
 int vtkAbstractInterpolatedVelocityField::GetLastWeights( double * w )
 {
@@ -456,10 +288,6 @@ void vtkAbstractInterpolatedVelocityField::PrintSelf( ostream & os, vtkIndent in
      << ( this->VectorsSelection ? this->VectorsSelection : "(none)" ) << endl;
   os << indent << "NormalizeVector: "
      << ( this->NormalizeVector ? "on." : "off." ) << endl;
-  os << indent << "ForceSurfaceTangentVector: "
-     << ( this->ForceSurfaceTangentVector ? "on." : "off." ) << endl;
-  os << indent << "SurfaceDataset: "
-     << ( this->SurfaceDataset ? "on." : "off." ) << endl;
 
   os << indent << "Caching Status: "     << ( this->Caching ? "on." : "off." )
      << endl;
diff --git a/Filters/FlowPaths/vtkAbstractInterpolatedVelocityField.h b/Filters/FlowPaths/vtkAbstractInterpolatedVelocityField.h
index b25c0c5..35a5ca7 100644
--- a/Filters/FlowPaths/vtkAbstractInterpolatedVelocityField.h
+++ b/Filters/FlowPaths/vtkAbstractInterpolatedVelocityField.h
@@ -143,17 +143,6 @@ public:
   vtkGetMacro( NormalizeVector, bool );
 
   // Description:
-  // If set to true, the first three point of the cell will be used to compute a normal to the cell,
-  // this normal will then be removed from the vorticity so the resulting vector in tangent to the cell.
-  vtkSetMacro(ForceSurfaceTangentVector, bool);
-  vtkGetMacro(ForceSurfaceTangentVector, bool);
-
-  // Description:
-  // If set to true, cell within tolerance factor will always be found, except for edges.
-  vtkSetMacro(SurfaceDataset, bool);
-  vtkGetMacro(SurfaceDataset, bool);
-
-  // Description:
   // Import parameters. Sub-classes can add more after chaining.
   virtual void CopyParameters( vtkAbstractInterpolatedVelocityField * from )
     { this->Caching = from->Caching; }
@@ -178,20 +167,16 @@ protected:
   ~vtkAbstractInterpolatedVelocityField();
 
   static const double TOLERANCE_SCALE;
-  static const double SURFACE_TOLERANCE_SCALE;
 
   int       CacheHit;
   int       CacheMiss;
   int       WeightsSize;
   bool      Caching;
   bool      NormalizeVector;
-  bool      ForceSurfaceTangentVector;
-  bool      SurfaceDataset;
   int       VectorsType;
   char *    VectorsSelection;
   double *  Weights;
   double    LastPCoords[3];
-  int       LastSubId;
   vtkIdType LastCellId;
   vtkDataSet *     LastDataSet;
   vtkGenericCell * Cell;
@@ -210,22 +195,8 @@ protected:
   // for cell location. In vtkCellLocatorInterpolatedVelocityField, this function
   // is invoked just to handle vtkImageData and vtkRectilinearGrid that are not
   // assigned with any vtkAbstractCellLocatot-type cell locator.
-  // If activated, returned vector will be tangential to the first
-  // three point of the cell
   virtual int FunctionValues( vtkDataSet * ds, double * x, double * f );
 
-  // Description:
-  // Check that all three pcoords are between 0 and 1 included.
-  virtual bool CheckPCoords(double pcoords[3]);
-
-  // Description
-  // Try to find the cell closest to provided x point in provided dataset,
-  // By first testing inclusion in it's cached cell and neighbor
-  // Then testing globally
-  // Then , only if surfacic is activated finding the closest cell
-  // using FindPoint and comparing distance with tolerance
-  virtual bool FindAndUpdateCell(vtkDataSet* ds, double* x);
-
 //BTX
   friend class vtkTemporalInterpolatedVelocityField;
   // Description:
diff --git a/Filters/FlowPaths/vtkCachingInterpolatedVelocityField.cxx b/Filters/FlowPaths/vtkCachingInterpolatedVelocityField.cxx
index e90794e..113160a 100644
--- a/Filters/FlowPaths/vtkCachingInterpolatedVelocityField.cxx
+++ b/Filters/FlowPaths/vtkCachingInterpolatedVelocityField.cxx
@@ -14,17 +14,26 @@
 =========================================================================*/
 #include "vtkCachingInterpolatedVelocityField.h"
 
-#include "vtkCellLocator.h"
+#include "vtkDataArray.h"
 #include "vtkDataSet.h"
-#include "vtkDoubleArray.h"
-#include "vtkFloatArray.h"
+#include "vtkPointData.h"
 #include "vtkGenericCell.h"
 #include "vtkObjectFactory.h"
 #include "vtkPointData.h"
+#include "vtkAbstractCellLocator.h"
 #include "vtkSmartPointer.h"
+#include "vtkFloatArray.h"
+#include "vtkDoubleArray.h"
 
-#include <vector>
+#include "vtkCellLocator.h"
+#define Custom_TreeType vtkCellLocator
 
+#include <vector>
+#ifdef JB_BSP_TREE
+ #include "vtkModifiedBSPTree.h"
+ #undef  Custom_TreeType
+ #define Custom_TreeType vtkModifiedBSPTree
+#endif
 //---------------------------------------------------------------------------
 vtkStandardNewMacro(vtkCachingInterpolatedVelocityField);
 //---------------------------------------------------------------------------
@@ -48,37 +57,30 @@ void IVFDataSetInfo::SetDataSet(vtkDataSet *data, char *velocity, bool staticdat
   this->DataSet        = data;
   this->Cell           = vtkSmartPointer<vtkGenericCell>::New();
   this->StaticDataSet  = staticdataset;
-  if (locator)
-    {
+  if (locator) {
     this->BSPTree = locator;
+  }
+  else if (this->DataSet->IsA("vtkUnstructuredGrid")) {
+    if (!this->BSPTree) {
+      this->BSPTree = vtkSmartPointer<Custom_TreeType>::New();
     }
-  else if (this->DataSet->IsA("vtkUnstructuredGrid"))
-    {
-    if (!this->BSPTree)
-      {
-      this->BSPTree = vtkSmartPointer<vtkCellLocator>::New();
-      }
     this->BSPTree->SetLazyEvaluation(1);
     this->BSPTree->SetDataSet(this->DataSet);
     this->BSPTree->SetUseExistingSearchStructure(this->StaticDataSet);
-    }
-
+  }
   this->Tolerance =
     this->DataSet->GetLength() * IVFDataSetInfo::TOLERANCE_SCALE;
   //
   vtkDataArray *vectors = this->DataSet->GetPointData()->GetArray(velocity);
-  if (vtkFloatArray::SafeDownCast(vectors))
-    {
+  if (vtkFloatArray::SafeDownCast(vectors)) {
     this->VelocityFloat = vtkFloatArray::SafeDownCast(vectors)->GetPointer(0);
-    }
-  else if (vtkDoubleArray::SafeDownCast(vectors))
-    {
+  }
+  else if (vtkDoubleArray::SafeDownCast(vectors)) {
     this->VelocityDouble = vtkDoubleArray::SafeDownCast(vectors)->GetPointer(0);
-    }
-  else
-    {
+  }
+  else {
     vtkGenericWarningMacro("We only support float/double velocity vectors at the current time");
-    }
+  }
 }
 //---------------------------------------------------------------------------
 IVFDataSetInfo::IVFDataSetInfo(const IVFDataSetInfo &ivfci)
@@ -142,23 +144,20 @@ void vtkCachingInterpolatedVelocityField::SetDataSet(int I, vtkDataSet* dataset,
 void vtkCachingInterpolatedVelocityField::SetLastCellInfo(vtkIdType c, int datasetindex)
 {
   if ((this->LastCacheIndex != datasetindex) || (this->LastCellId != c))
-    {
-    assert(this->CacheList.size() > static_cast<size_t>(datasetindex));
+  {
     this->LastCacheIndex = datasetindex;
     this->Cache          = &this->CacheList[this->LastCacheIndex];
     this->LastCellId     = c;
     // if the dataset changes, then the cached cell is invalidated
     // we might as well prefetch the new cached cell - we'll need it on the next test anyway
     if (this->LastCellId!=-1)
-      {
-      assert(c < this->Cache->DataSet->GetNumberOfCells());
+    {
       this->Cache->DataSet->GetCell(this->LastCellId, this->Cache->Cell);
-      }
     }
+  }
 }
 //---------------------------------------------------------------------------
-void vtkCachingInterpolatedVelocityField::ClearLastCellInfo()
-{
+void vtkCachingInterpolatedVelocityField::ClearLastCellInfo() {
   this->Cache      = NULL;
   this->LastCellId = -1;
 }
@@ -176,14 +175,12 @@ vtkGenericCell *vtkCachingInterpolatedVelocityField::GetLastCell()
 int vtkCachingInterpolatedVelocityField::FunctionValues(double* x, double* f)
 {
   // Test using whatever cached information we have
-  if (this->Cache)
-    {
-    if (this->FunctionValues(this->Cache, x, f))
-      {
+  if (this->Cache) {
+    if (this->FunctionValues(this->Cache, x, f)) {
       this->DataSetCacheHit++;
       return 1;
-      }
     }
+  }
   // don't reset this->Cache as we don't want to test it again,
   // see == comparison below
 
@@ -194,15 +191,14 @@ int vtkCachingInterpolatedVelocityField::FunctionValues(double* x, double* f)
        this->LastCacheIndex++)
     {
     IVFDataSetInfo *data = &this->CacheList[this->LastCacheIndex];
-    if (data!=this->Cache)
+    if (data==this->Cache) continue;
+    //
+    this->LastCellId = -1;
+    if (this->FunctionValues(data, x, f))
       {
-      this->LastCellId = -1;
-      if (this->FunctionValues(data, x, f))
-        {
-        this->Cache = data;
-        this->CacheMiss++;
-        return 1;
-        }
+      this->Cache = data;
+      this->CacheMiss++;
+      return 1;
       }
     }
   // failed, so clear data and set the cache index to something sensible
@@ -216,22 +212,15 @@ int vtkCachingInterpolatedVelocityField::FunctionValues(double* x, double* f)
 int vtkCachingInterpolatedVelocityField::InsideTest(double* x)
 {
   // Test using whatever cached information we have
-  if (this->Cache)
-    {
+  if (this->Cache) {
     // check the last cell
     int subId;
     if (this->LastCellId!=-1 && this->Cache->Cell->EvaluatePosition(
-          x, 0, subId, this->Cache->PCoords,
-          this->Cache->Tolerance, &this->Weights[0])==1)
-      {
-      return 1;
-      }
+        x, 0, subId, this->Cache->PCoords,
+        this->Cache->Tolerance, &this->Weights[0])==1) return 1;
     // check this dataset
-    if (this->InsideTest(this->Cache, x))
-      {
-      return 1;
-      }
-    }
+    if (this->InsideTest(this->Cache, x)) return 1;
+  }
   // don't reset this->Cache as we don't want to test it again,
   // see != comparison below
 
@@ -241,14 +230,13 @@ int vtkCachingInterpolatedVelocityField::InsideTest(double* x)
        this->LastCacheIndex++)
     {
     IVFDataSetInfo *data = &this->CacheList[this->LastCacheIndex];
-    if (data!=this->Cache)
+    if (data==this->Cache) continue;
+    //
+    this->LastCellId = -1;
+    if (this->InsideTest(data,  x))
       {
-      this->LastCellId = -1;
-      if (this->InsideTest(data,  x))
-        {
-        this->Cache = data;
-        return 1;
-        }
+      this->Cache = data;
+      return 1;
       }
     }
   // failed, so clear data
@@ -277,12 +265,11 @@ int vtkCachingInterpolatedVelocityField::FunctionValues(
   if (this->LastCellId>=0)
     {
     bool inbox = true;
-    if (data->BSPTree && !data->BSPTree->InsideCellBounds(x, this->LastCellId))
-      {
+    if (data->BSPTree && !data->BSPTree->InsideCellBounds(x, this->LastCellId)) {
       inbox = false;
-      }
+    }
     if (inbox && data->Cell->EvaluatePosition(
-          x, 0, subId, data->PCoords, dist2, &this->Weights[0])==1)
+      x, 0, subId, data->PCoords, dist2, &this->Weights[0])==1)
       {
       this->FastCompute(data, f);
       this->CellCacheHit++;
@@ -293,8 +280,8 @@ int vtkCachingInterpolatedVelocityField::FunctionValues(
   // we need to search the whole dataset
   if (data->BSPTree)
     {
-    int cellId = data->BSPTree->FindCell(
-      x, data->Tolerance, data->Cell, data->PCoords, &this->Weights[0]);
+    int cellId = data->BSPTree->FindCell(x, data->Tolerance,
+      data->Cell, data->PCoords, &this->Weights[0]);
     this->LastCellId = cellId;
     }
   else
@@ -307,7 +294,7 @@ int vtkCachingInterpolatedVelocityField::FunctionValues(
       }
     this->LastCellId =
       data->DataSet->FindCell(x, tmpCell, data->Cell, this->LastCellId,
-                              data->Tolerance, subId, data->PCoords, &this->Weights[0]);
+      data->Tolerance, subId, data->PCoords, &this->Weights[0]);
     if (this->LastCellId != -1)
       {
       data->DataSet->GetCell(this->LastCellId, data->Cell);
@@ -385,12 +372,14 @@ bool vtkCachingInterpolatedVelocityField::InterpolatePoint(
 //---------------------------------------------------------------------------
 int vtkCachingInterpolatedVelocityField::GetLastWeights(double* w)
 {
+  int j, numPts;
+
   // If last cell is valid, fill w with the interpolation weights
   // and return true
   if (this->Cache && this->LastCellId >= 0)
     {
-    int numPts = this->Cache->Cell->GetNumberOfPoints();
-    for (int j=0; j < numPts; j++)
+    numPts = this->Cache->Cell->GetNumberOfPoints();
+    for (j=0; j < numPts; j++)
       {
       w[j] = this->Weights[j];
       }
@@ -405,11 +394,13 @@ int vtkCachingInterpolatedVelocityField::GetLastWeights(double* w)
 //---------------------------------------------------------------------------
 int vtkCachingInterpolatedVelocityField::GetLastLocalCoordinates(double pcoords[3])
 {
+  int j;
+
   // If last cell is valid, fill p with the local coordinates
   // and return true
   if (this->Cache && this->LastCellId >= 0)
     {
-    for (int j=0; j < 3; j++)
+    for (j=0; j < 3; j++)
       {
       pcoords[j] = this->Cache->PCoords[j];
       }
@@ -443,13 +434,15 @@ void vtkCachingInterpolatedVelocityField::PrintSelf(ostream& os, vtkIndent inden
 
   if (this->Cache)
     {
-    os << indent << "Cache->DataSet : " << this->Cache->DataSet << endl;
+    os << indent << "Cache->DataSet : "
+        << this->Cache->DataSet << endl;
     }
   else
     {
     os << indent << "Cache->DataSet : (none)" << endl;
     }
 
-  os << indent << "LastCacheIndex : " << this->LastCacheIndex << endl;
+  os << indent << "LastCacheIndex : "
+     << this->LastCacheIndex << endl;
 }
 //---------------------------------------------------------------------------
diff --git a/Filters/FlowPaths/vtkCachingInterpolatedVelocityField.h b/Filters/FlowPaths/vtkCachingInterpolatedVelocityField.h
index b2e6d28..4b7849e 100644
--- a/Filters/FlowPaths/vtkCachingInterpolatedVelocityField.h
+++ b/Filters/FlowPaths/vtkCachingInterpolatedVelocityField.h
@@ -90,14 +90,12 @@ public:
     {this->SetVectorsSelection(fieldName);}
 
   // Description:
-  // Set LastCellId to c and LastCacheIndex datasetindex, cached from last evaluation.
-  // If c isn't -1 then the corresponding cell is stored in Cache->Cell.
-  // These values should be valid or an assertion will be triggered.
+  // Return the cell id cached from last evaluation.
   void SetLastCellInfo(vtkIdType c, int datasetindex);
 
   // Description:
-  // Set LastCellId to -1 and Cache to NULL so that the next
-  // search does not  start from the previous cell.
+  // Set the last cell id to -1 so that the next search does not
+  // start from the previous cell
   void ClearLastCellInfo();
 
   // Description:
diff --git a/Filters/FlowPaths/vtkInterpolatedVelocityField.cxx b/Filters/FlowPaths/vtkInterpolatedVelocityField.cxx
index 11ff1b8..ea3d37e 100644
--- a/Filters/FlowPaths/vtkInterpolatedVelocityField.cxx
+++ b/Filters/FlowPaths/vtkInterpolatedVelocityField.cxx
@@ -102,23 +102,6 @@ int vtkInterpolatedVelocityField::FunctionValues( double * x, double * f )
 }
 
 //----------------------------------------------------------------------------
-int vtkInterpolatedVelocityField::SnapPointOnCell(double* pOrigin, double* pSnap)
-{
-  if (this->LastDataSet == NULL)
-    {
-    return 0;
-    }
-   if (!this->FindAndUpdateCell(this->LastDataSet, pOrigin))
-    {
-    return 0;
-    }
-  double dist2;
-  this->GenCell->EvaluatePosition
-    (pOrigin, pSnap, this->LastSubId, this->LastPCoords, dist2, this->Weights);
-  return 1;
-}
-
-//----------------------------------------------------------------------------
 void vtkInterpolatedVelocityField::PrintSelf( ostream & os, vtkIndent indent )
 {
   this->Superclass::PrintSelf( os, indent );
diff --git a/Filters/FlowPaths/vtkInterpolatedVelocityField.h b/Filters/FlowPaths/vtkInterpolatedVelocityField.h
index 43900f6..b4d3c16 100644
--- a/Filters/FlowPaths/vtkInterpolatedVelocityField.h
+++ b/Filters/FlowPaths/vtkInterpolatedVelocityField.h
@@ -79,10 +79,6 @@ public:
   virtual int FunctionValues( double * x, double * f );
 
   // Description:
-  // Project the provided point on current cell, current dataset.
-  virtual int SnapPointOnCell(double* pOrigin, double* pProj);
-
-  // Description:
   // Set the cell id cached by the last evaluation within a specified dataset.
   virtual void SetLastCellId( vtkIdType c, int dataindex );
 
diff --git a/Filters/FlowPaths/vtkModifiedBSPTree.cxx b/Filters/FlowPaths/vtkModifiedBSPTree.cxx
index 2aeda6b..24b6a5f 100644
--- a/Filters/FlowPaths/vtkModifiedBSPTree.cxx
+++ b/Filters/FlowPaths/vtkModifiedBSPTree.cxx
@@ -562,7 +562,7 @@ void vtkModifiedBSPTree::GenerateRepresentation(int level, vtkPolyData *pd)
     ns.pop();
     if (node->depth==level)
       {
-      bl.push_back(_box(node->Bounds));
+      bl.push_back(_box(node->bounds));
       }
     else
       {
@@ -577,7 +577,7 @@ void vtkModifiedBSPTree::GenerateRepresentation(int level, vtkPolyData *pd)
         }
       else if (level==-1)
         {
-        bl.push_back(_box(node->Bounds));
+        bl.push_back(_box(node->bounds));
         }
       }
     }
@@ -1108,7 +1108,7 @@ void BSPNode::Classify(const double origin[3],
                        BSPNode *&Mid,
                        BSPNode *&Far) const
 {
-  double tOriginToDivPlane = mChild[0]->Bounds[mAxis*2+1] - origin[mAxis];
+  double tOriginToDivPlane = mChild[0]->bounds[mAxis*2+1] - origin[mAxis];
   double tDivDirection   = dir[mAxis];
   if ( tOriginToDivPlane > 0 )
     {
@@ -1151,7 +1151,7 @@ bool BSPNode::RayMinMaxT(const double origin[3],
   // X-Axis
   if (dir[0] < -Epsilon_)
     {                // ray travelling in -x direction
-    tT = (this->Bounds[0] - origin[0]) / dir[0];
+    tT = (bounds[0] - origin[0]) / dir[0];
     if (tT < rTmin)
       {
       return (false);        // ray already left of box. Can't hit
@@ -1160,7 +1160,7 @@ bool BSPNode::RayMinMaxT(const double origin[3],
       {
       rTmax = tT;           // update new tmax
       }
-    tT = (this->Bounds[1] - origin[0]) / dir[0]; // distance to right edge
+    tT = (bounds[1] - origin[0]) / dir[0]; // distance to right edge
     if (tT >= rTmin)
       {                     // can't see this ever happening
       if (tT > rTmax)
@@ -1172,7 +1172,7 @@ bool BSPNode::RayMinMaxT(const double origin[3],
     }
   else if (dir[0] > Epsilon_)
     {
-    tT = (this->Bounds[1] - origin[0]) / dir[0];
+    tT = (bounds[1] - origin[0]) / dir[0];
     if (tT < rTmin)
       {
       return (false);
@@ -1181,7 +1181,7 @@ bool BSPNode::RayMinMaxT(const double origin[3],
       {
       rTmax = tT;
       }
-    tT = (this->Bounds[0] - origin[0]) / dir[0];
+    tT = (bounds[0] - origin[0]) / dir[0];
     if (tT >= rTmin)
       {
       if (tT > rTmax)
@@ -1191,14 +1191,14 @@ bool BSPNode::RayMinMaxT(const double origin[3],
       rTmin = tT;
       }
     }
-  else if (origin[0] < this->Bounds[0] || origin[0] > this->Bounds[1])
+  else if (origin[0] < bounds[0] || origin[0] > bounds[1])
     {
     return (false);
     }
   // Y-Axis
   if (dir[1] < -Epsilon_)
     {
-    tT = (this->Bounds[2] - origin[1]) / dir[1];
+    tT = (bounds[2] - origin[1]) / dir[1];
     if (tT < rTmin)
       {
       return (false);
@@ -1207,7 +1207,7 @@ bool BSPNode::RayMinMaxT(const double origin[3],
       {
       rTmax = tT;
       }
-    tT = (this->Bounds[3] - origin[1]) / dir[1];
+    tT = (bounds[3] - origin[1]) / dir[1];
     if (tT >= rTmin)
       {
       if (tT > rTmax)
@@ -1219,7 +1219,7 @@ bool BSPNode::RayMinMaxT(const double origin[3],
     }
   else if (dir[1] > Epsilon_)
     {
-    tT = (this->Bounds[3] - origin[1]) / dir[1];
+    tT = (bounds[3] - origin[1]) / dir[1];
     if (tT < rTmin)
       {
       return (false);
@@ -1228,7 +1228,7 @@ bool BSPNode::RayMinMaxT(const double origin[3],
       {
       rTmax = tT;
       }
-    tT = (this->Bounds[2] - origin[1]) / dir[1];
+    tT = (bounds[2] - origin[1]) / dir[1];
     if (tT >= rTmin)
       {
       if (tT > rTmax)
@@ -1238,14 +1238,14 @@ bool BSPNode::RayMinMaxT(const double origin[3],
       rTmin = tT;
       }
     }
-  else if (origin[1] < this->Bounds[2] || origin[1] > this->Bounds[3])
+  else if (origin[1] < bounds[2] || origin[1] > bounds[3])
     {
     return (false);
     }
   // Z-Axis
   if (dir[2] < -Epsilon_)
     {
-    tT = (this->Bounds[4] - origin[2]) / dir[2];
+    tT = (bounds[4] - origin[2]) / dir[2];
     if (tT < rTmin)
       {
       return (false);
@@ -1254,7 +1254,7 @@ bool BSPNode::RayMinMaxT(const double origin[3],
       {
       rTmax = tT;
       }
-    tT = (this->Bounds[5] - origin[2]) / dir[2];
+    tT = (bounds[5] - origin[2]) / dir[2];
     if (tT >= rTmin)
       {
       if (tT > rTmax)
@@ -1266,7 +1266,7 @@ bool BSPNode::RayMinMaxT(const double origin[3],
     }
   else if (dir[2] > Epsilon_)
     {
-    tT = (this->Bounds[5] - origin[2]) / dir[2];
+    tT = (bounds[5] - origin[2]) / dir[2];
     if (tT < rTmin)
       {
       return (false);
@@ -1275,7 +1275,7 @@ bool BSPNode::RayMinMaxT(const double origin[3],
       {
       rTmax = tT;
       }
-    tT = (this->Bounds[4] - origin[2]) / dir[2];
+    tT = (bounds[4] - origin[2]) / dir[2];
     if (tT >= rTmin)
       {
       if (tT > rTmax)
@@ -1285,7 +1285,7 @@ bool BSPNode::RayMinMaxT(const double origin[3],
       rTmin = tT;
       }
     }
-  else if (origin[2] < this->Bounds[4] || origin[2] > this->Bounds[5])
+  else if (origin[2] < bounds[4] || origin[2] > bounds[5])
     {
     return (false);
     }
@@ -1443,9 +1443,9 @@ bool BSPNode::RayMinMaxT(const double bounds[6],
 //---------------------------------------------------------------------------
 bool BSPNode::Inside(double point[3]) const
 {
-  if (point[0]<this->Bounds[0] || point[0]>this->Bounds[1] ||
-      point[1]<this->Bounds[2] || point[1]>this->Bounds[3] ||
-      point[2]<this->Bounds[4] || point[2]>this->Bounds[5])
+  if (point[0]<this->bounds[0] || point[0]>this->bounds[1] ||
+      point[1]<this->bounds[2] || point[1]>this->bounds[3] ||
+      point[2]<this->bounds[4] || point[2]>this->bounds[5])
     {
     return 0;
     }
diff --git a/Filters/FlowPaths/vtkModifiedBSPTree.h b/Filters/FlowPaths/vtkModifiedBSPTree.h
index 1ed6d7e..483ed49 100644
--- a/Filters/FlowPaths/vtkModifiedBSPTree.h
+++ b/Filters/FlowPaths/vtkModifiedBSPTree.h
@@ -163,9 +163,11 @@ class VTKFILTERSFLOWPATHS_EXPORT vtkModifiedBSPTree : public vtkAbstractCellLoca
   // Construct with maximum 32 cells per node. (average 16->31)
   static vtkModifiedBSPTree *New();
 
-  // Re-use any superclass signatures that we don't override.
+//BTX
   using vtkAbstractCellLocator::IntersectWithLine;
-  using vtkAbstractCellLocator::FindCell;
+  using vtkAbstractCellLocator::FindClosestPoint;
+  using vtkAbstractCellLocator::FindClosestPointWithinRadius;
+//ETX
 
   // Description:
   // Free tree memory
@@ -185,6 +187,14 @@ class VTKFILTERSFLOWPATHS_EXPORT vtkModifiedBSPTree : public vtkAbstractCellLoca
   virtual void GenerateRepresentationLeafs(vtkPolyData *pd);
 
   // Description:
+  // Return intersection point (if any) of finite line with cells contained
+  // in cell locator.
+  virtual int IntersectWithLine(
+    double p1[3], double p2[3], double tol, double& t, double x[3],
+    double pcoords[3], int &subId)
+    { return this->Superclass::IntersectWithLine(p1, p2, tol, t, x, pcoords, subId); }
+
+  // Description:
   // Return intersection point (if any) AND the cell which was intersected by
   // the finite line. Uses fast tree-search BBox rejection tests.
   virtual int IntersectWithLine(
@@ -200,6 +210,22 @@ class VTKFILTERSFLOWPATHS_EXPORT vtkModifiedBSPTree : public vtkAbstractCellLoca
 
   // Description:
   // Take the passed line segment and intersect it with the data set.
+  // This method assumes that the data set is a vtkPolyData that describes
+  // a closed surface, and the intersection points that are returned in
+  // 'points' alternate between entrance points and exit points.
+  // The return value of the function is 0 if no intersections were found,
+  // -1 if point 'a0' lies inside the closed surface, or +1 if point 'a0'
+  // lies outside the closed surface.
+  // Either 'points' or 'cellIds' can be set to NULL if you don't want
+  // to receive that information. This method is currently only implemented
+  // in vtkOBBTree
+  virtual int IntersectWithLine(
+    const double p1[3], const double p2[3],
+    vtkPoints *points, vtkIdList *cellIds)
+    { return this->Superclass::IntersectWithLine(p1, p2, points, cellIds); }
+
+  // Description:
+  // Take the passed line segment and intersect it with the data set.
   // The return value of the function is 0 if no intersections were found.
   // For each intersection found, the vtkPoints and CellIds objects
   // have the relevant information added in order of intersection increasing
@@ -210,6 +236,12 @@ class VTKFILTERSFLOWPATHS_EXPORT vtkModifiedBSPTree : public vtkAbstractCellLoca
     vtkPoints *points, vtkIdList *cellIds);
 
   // Description:
+  // Returns the Id of the cell containing the point,
+  // returns -1 if no cell found. This interface uses a tolerance of zero
+  virtual vtkIdType FindCell(double x[3])
+    { return this->Superclass::FindCell(x); }
+
+  // Description:
   // Test a point to find if it is inside a cell. Returns the cellId if inside
   // or -1 if not.
   virtual vtkIdType FindCell(double x[3], double tol2, vtkGenericCell *GenCell,
@@ -268,7 +300,7 @@ class BSPNode {
     BSPNode(void) {
       mChild[0] = mChild[1] = mChild[2] = NULL;
       for (int i=0; i<6; i++) sorted_cell_lists[i] = NULL;
-      for (int i=0; i<3; i++) { this->Bounds[i*2] = VTK_FLOAT_MAX; this->Bounds[i*2+1] = -VTK_FLOAT_MAX; }
+      for (int i=0; i<3; i++) { bounds[i*2] = VTK_FLOAT_MAX; bounds[i*2+1] = -VTK_FLOAT_MAX; }
     }
     // Destructor
     ~BSPNode(void) {
@@ -277,16 +309,16 @@ class BSPNode {
     }
     // Set min box limits
     void setMin(double minx, double miny, double minz) {
-      this->Bounds[0] = minx; this->Bounds[2] = miny; this->Bounds[4] = minz;
+      bounds[0] = minx; bounds[2] = miny; bounds[4] = minz;
     }
     // Set max box limits
     void setMax(double maxx, double maxy, double maxz) {
-      this->Bounds[1] = maxx; this->Bounds[3] = maxy; this->Bounds[5] = maxz;
+      bounds[1] = maxx; bounds[3] = maxy; bounds[5] = maxz;
     }
     //
     bool Inside(double point[3]) const;
     // BBox
-    double       Bounds[6];
+    double       bounds[6];
   protected:
     // The child nodes of this one (if present - NULL otherwise)
     BSPNode   *mChild[3];
diff --git a/Filters/FlowPaths/vtkParticleTracerBase.cxx b/Filters/FlowPaths/vtkParticleTracerBase.cxx
index 82a20e4..9a64e94 100644
--- a/Filters/FlowPaths/vtkParticleTracerBase.cxx
+++ b/Filters/FlowPaths/vtkParticleTracerBase.cxx
@@ -39,6 +39,17 @@
 #include "vtkTemporalInterpolatedVelocityField.h"
 #include <cassert>
 
+#ifdef WIN32
+#undef JB_H5PART_PARTICLE_OUTPUT
+#else
+//  #define JB_H5PART_PARTICLE_OUTPUT
+#endif
+
+#ifdef JB_H5PART_PARTICLE_OUTPUT
+// #include "vtkH5PartWriter.h"
+#include "vtkXMLParticleWriter.h"
+#endif
+
 #include <functional>
 #include <algorithm>
 #ifdef DEBUGPARTICLETRACE
@@ -80,7 +91,7 @@ namespace
   //return the interval i, such that a belongs to the interval (A[i],A[i+1]]
   inline int FindInterval(double a, const std::vector<double>& A)
   {
-    if(A.size() == 0 || a < A[0])
+    if( a < A[0])
       {
       return -1;
       }
@@ -259,6 +270,19 @@ int vtkParticleTracerBase::RequestInformation(
 
   return 1;
 }
+namespace
+{
+//----------------------------------------------------------------------------
+  class WithinTolerance: public std::binary_function<double, double, bool>
+  {
+  public:
+    result_type operator()(first_argument_type a, second_argument_type b) const
+    {
+      bool result = (fabs(a-b)<=(a*1E-6));
+      return (result_type)result;
+    }
+  };
+}
 
 //----------------------------------------------------------------------------
 int vtkParticleTracerBase::RequestUpdateExtent(
@@ -349,7 +373,7 @@ int vtkParticleTracerBase::RequestUpdateExtent(
       }
     else
       {
-      Assert(this->CurrentTimeValue == this->InputTimeValues.back());
+      Assert(this->CurrentTime == this->InputTimeValues.back());
       }
     }
 
@@ -567,6 +591,7 @@ bool vtkParticleTracerBase::InsideBounds(double point[])
 void vtkParticleTracerBase::TestParticles(
   ParticleVector &candidates, ParticleVector &passed, int &count)
 {
+
   std::vector<int> passedIndices;
   this->TestParticles(candidates, passedIndices);
   count = static_cast<int>(passedIndices.size());
@@ -642,8 +667,7 @@ void vtkParticleTracerBase::AssignSeedsToProcessors(
     info.speed                = 0.0;
     info.ErrorCode            = 0;
     info.SimulationTime       = this->GetCurrentTimeValue();
-    info.PointId              = -1;
-    info.TailPointId          = -1;
+    info.PointId = -1;
     }
   //
   // Gather all Seeds to all processors for classification
@@ -816,8 +840,7 @@ vtkPolyData* vtkParticleTracerBase::Execute(vtkInformationVector** inputVector)
 
     for (size_t i=0; i<seedSources.size(); i++)
       {
-      this->AssignSeedsToProcessors(this->CurrentTimeValue,seedSources[i], static_cast<int>(i),
-                                    0, this->LocalSeeds, seedPointId);
+      this->AssignSeedsToProcessors(this->CurrentTimeValue,seedSources[i], static_cast<int>(i), 0, this->LocalSeeds, seedPointId);
       }
 
     this->ParticleInjectionTime.Modified();
@@ -847,11 +870,17 @@ vtkPolyData* vtkParticleTracerBase::Execute(vtkInformationVector** inputVector)
     ParticleListIterator  it_next;
 
     //
-    // Perform mulitple passes. The number of passes is equal to one more than
-    // the maximum times a particle gets migrated between processes.
-    bool continueExecuting = true;
-    int pass = 0; // really just for debugging
-    while(continueExecuting)
+    // Perform 2 passes
+    // Pass 0 : Integration of particles created by a source in this process
+    // or received at start from a source in another process.
+    //
+    // Pass 1 : Particles that were sent in mid integration from another process
+    // are added in and their integration continued here. In actual fact, the process
+    // should be repeated until all particles are finished, but the chances of
+    // a particle stepping inside and out again through a single domain
+    // in one time step are small (hopefully!)
+#define PASSES 2
+    for (int pass=0; pass<PASSES; pass++)
       {
       vtkDebugMacro(<<"Begin Pass " << pass << " with " << this->ParticleHistories.size() << " Particles");
       for (ParticleListIterator it=it_first; it!=it_last;)
@@ -869,7 +898,7 @@ vtkPolyData* vtkParticleTracerBase::Execute(vtkInformationVector** inputVector)
         }
       // Particles might have been deleted during the first pass as they move
       // out of domain or age. Before adding any new particles that are sent
-      // to us, we must know the starting point ready for the next pass
+      // to us, we must know the starting point ready for the second pass
       bool list_valid = (this->ParticleHistories.size()>0);
       if (list_valid)
         {
@@ -877,7 +906,10 @@ vtkPolyData* vtkParticleTracerBase::Execute(vtkInformationVector** inputVector)
         it_first = --this->ParticleHistories.end();
         }
       // Send and receive any particles which exited/entered the domain
-      continueExecuting = this->UpdateParticleListFromOtherProcesses();
+      if (pass<(PASSES-1))
+        {
+        this->UpdateParticleListFromOtherProcesses();
+        }
       it_last = this->ParticleHistories.end();
       if (list_valid)
         {
@@ -888,7 +920,6 @@ vtkPolyData* vtkParticleTracerBase::Execute(vtkInformationVector** inputVector)
         {
         it_first = this->ParticleHistories.begin();
         }
-      pass++;
       }//end of pass
     }
 
@@ -900,7 +931,7 @@ vtkPolyData* vtkParticleTracerBase::Execute(vtkInformationVector** inputVector)
 
   if(injectionFlag) //reinject again in the last step
     {
-    this->ReinjectionCounter = this->CurrentTimeStep - this->StartTimeStep;
+    this->ReinjectionCounter += this->ForceReinjectionEveryNSteps;
 
     ParticleListIterator lastParticle = this->ParticleHistories.end();
     if (!this->ParticleHistories.empty())
@@ -928,10 +959,11 @@ vtkPolyData* vtkParticleTracerBase::Execute(vtkInformationVector** inputVector)
 
     for(; itr!=this->ParticleHistories.end(); ++itr)
       {
-      this->Interpolator->TestPoint(itr->CurrentPosition.x);
+      ParticleInformation& info(*lastParticle);
+      this->Interpolator->TestPoint(info.CurrentPosition.x);
       double velocity[3];
       this->Interpolator->GetLastGoodVelocity(velocity);
-      itr->speed = vtkMath::Norm(velocity);
+      info.speed = vtkMath::Norm(velocity);
       this->AddParticle(*itr,velocity);
       }
     }
@@ -974,7 +1006,7 @@ int vtkParticleTracerBase::RequestData(
   vtkInformationVector **inputVector,
   vtkInformationVector *outputVector)
 {
-  PRINT("RD start: "<<this->CurrentTimeStep<<" "<<this->CurrentTimeValue<<" "<<this->StartTimeStep<<" "<<this->TerminationTimeStep);
+  PRINT("RD start: "<<this->CurrentTimeStep<<" "<<this->CurrentTime<<" "<<this->StartTimeStep<<" "<<this->TerminationTimeStep);
   if(this->StartTimeStep<0)
     {
     return 0;
@@ -993,7 +1025,7 @@ int vtkParticleTracerBase::RequestData(
     }
 
   bool finished = this->CurrentTimeStep==this->TerminationTimeStep;
-  this->ProcessInput(inputVector);
+  ProcessInput(inputVector);
 
   if(this->FirstIteration)
     {
@@ -1065,6 +1097,12 @@ void vtkParticleTracerBase::IntegrateParticle(
   // Get the Initial point {x,y,z,t}
   memcpy(point1, &info.CurrentPosition, sizeof(Position));
 
+  //
+  // begin interpolation between available time values, if the particle has
+  // a cached cell ID and dataset - try to use it,
+  //
+  this->Interpolator->SetCachedCellIds(info.CachedCellId, info.CachedDataSetId);
+
   if(currenttime==targettime)
     {
     Assert(point1[3]==currenttime);
@@ -1073,19 +1111,6 @@ void vtkParticleTracerBase::IntegrateParticle(
     {
     Assert (point1[3]>=(currenttime-epsilon) && point1[3]<=(targettime+epsilon));
 
-    //
-    // begin interpolation between available time values, if the particle has
-    // a cached cell ID and dataset - try to use it,
-    //
-    if(this->AllFixedGeometry)
-      {
-      this->Interpolator->SetCachedCellIds(info.CachedCellId, info.CachedDataSetId);
-      }
-    else
-      {
-      this->Interpolator->ClearCache();
-      }
-
     double delT = (targettime-currenttime) * this->IntegrationStep;
     epsilon = delT*1E-3;
 
@@ -1116,9 +1141,9 @@ void vtkParticleTracerBase::IntegrateParticle(
         info.ErrorCode = 1;
         if (!this->RetryWithPush(info, point1, delT, substeps))
           {
-          if(previous.PointId <0 && previous.TailPointId < 0)
+          if(previous.PointId <0)
             {
-            vtkErrorMacro("the particle should have been added");
+            vtkWarningMacro("the particle should have been added");
             }
           else
             {
@@ -1395,12 +1420,6 @@ bool vtkParticleTracerBase::SetTerminationTimeNoModify(double t)
 }
 
 //---------------------------------------------------------------------------
-vtkTemporalInterpolatedVelocityField* vtkParticleTracerBase::GetInterpolator()
-{
-  return this->Interpolator;
-}
-
-//---------------------------------------------------------------------------
 void vtkParticleTracerBase::SetTerminationTime(double t)
 {
   if (this->SetTerminationTimeNoModify(t))
@@ -1514,7 +1533,6 @@ void vtkParticleTracerBase::AddParticle(
   this->ParticleAge->InsertNextValue(info.age);
   this->AppendToExtraPointDataArrays(info);
   info.PointId = tempId;
-  info.TailPointId = -1;
 
   //
   // Interpolate all existing point attributes
diff --git a/Filters/FlowPaths/vtkParticleTracerBase.h b/Filters/FlowPaths/vtkParticleTracerBase.h
index cf45394..6176d04 100644
--- a/Filters/FlowPaths/vtkParticleTracerBase.h
+++ b/Filters/FlowPaths/vtkParticleTracerBase.h
@@ -77,12 +77,8 @@ namespace vtkParticleTracerBaseNamespace
     float         angularVel;
     float         time;
     float         speed;
-    // once the partice is added, PointId is valid and is the tuple location
-    // in ProtoPD.
-    vtkIdType     PointId;
-    // if PointId is negative then in parallel this particle was just
-    // received and we need to get the tuple value from vtkPParticleTracerBase::Tail.
-    vtkIdType     TailPointId;
+
+    vtkIdType     PointId; //once the partice is added, PointId is valid
   } ParticleInformation;
 
   typedef std::vector<ParticleInformation>  ParticleVector;
@@ -224,9 +220,6 @@ public:
 
  protected:
   vtkSmartPointer<vtkPolyData> Output; //managed by child classes
-  // Description:
-  // ProtoPD is used just to keep track of the input array names and number of components
-  // for copy allocating from other vtkPointDatas where the data is really stored
   vtkSmartPointer<vtkPointData> ProtoPD;
   vtkIdType UniqueIdCounter;// global Id counter used to give particles a stamp
   vtkParticleTracerBaseNamespace::ParticleDataList  ParticleHistories;
@@ -333,9 +326,8 @@ public:
 
   // Description : Perform a GatherV operation on a vector of particles
   // this is used during classification of seed points and also between iterations
-  // of the main loop as particles leave each processor domain. Returns true
-  // if particles moved between processes and false otherwise.
-  virtual bool UpdateParticleListFromOtherProcesses(){return false;}
+  // of the main loop as particles leave each processor domain
+  virtual void UpdateParticleListFromOtherProcesses(){}
 
   // Description : The main loop performing Runge-Kutta integration of a single
   // particle between the two times supplied.
@@ -409,8 +401,6 @@ public:
   virtual void InitializeExtraPointDataArrays(vtkPointData* vtkNotUsed(outputPD)) {}
 
   virtual void AppendToExtraPointDataArrays(vtkParticleTracerBaseNamespace::ParticleInformation &) {}
-
-  vtkTemporalInterpolatedVelocityField* GetInterpolator();
 private:
   // Description:
   // Hide this because we require a new interpolator type
@@ -422,7 +412,7 @@ private:
   // These routines manage the collection and sending after each main iteration.
   // RetryWithPush adds a small push to a particle along it's current velocity
   // vector, this helps get over cracks in dynamic/rotating meshes. This is a
-  // first order integration though so it may introduce a bit extra error compared
+  // firsr order integration though so it may introduce a bit extra error compared
   // to the integrator that is used.
   bool RetryWithPush(
     vtkParticleTracerBaseNamespace::ParticleInformation &info, double* point1,double delT, int subSteps);
@@ -469,6 +459,7 @@ private:
   // The main lists which are held during operation- between time step updates
   vtkParticleTracerBaseNamespace::ParticleVector    LocalSeeds;
 
+
   // The velocity interpolator
   vtkSmartPointer<vtkTemporalInterpolatedVelocityField>  Interpolator;
   vtkAbstractInterpolatedVelocityField * InterpolatorPrototype;
diff --git a/Filters/FlowPaths/vtkStreamTracer.cxx b/Filters/FlowPaths/vtkStreamTracer.cxx
index d21768e..4a20092 100644
--- a/Filters/FlowPaths/vtkStreamTracer.cxx
+++ b/Filters/FlowPaths/vtkStreamTracer.cxx
@@ -126,8 +126,6 @@ vtkStreamTracer::vtkStreamTracer()
                                vtkDataSetAttributes::VECTORS);
 
   this->HasMatchingPointAttributes = true;
-
-  this->SurfaceStreamlines = false;
 }
 
 vtkStreamTracer::~vtkStreamTracer()
@@ -702,24 +700,6 @@ void vtkStreamTracer::Integrate(vtkPointData *input0Data,
     this->GetIntegrator()->NewInstance();
   integrator->SetFunctionSet(func);
 
-  // Check Surface option
-  vtkInterpolatedVelocityField* surfaceFunc = NULL;
-  if (this->SurfaceStreamlines == true)
-    {
-    surfaceFunc = vtkInterpolatedVelocityField::SafeDownCast(func);
-    if (surfaceFunc == NULL)
-      {
-        vtkWarningMacro(<< "Surface Streamlines works only with Point Locator "
-                           "Interpolated Velocity Field, setting it off");
-        this->SetSurfaceStreamlines(false);
-      }
-    else
-      {
-      surfaceFunc->SetForceSurfaceTangentVector(true);
-      surfaceFunc->SetSurfaceDataset(true);
-      }
-    }
-
   // Since we do not know what the total number of points
   // will be, we do not allocate any. This is important for
   // cases where a lot of streamers are used at once. If we
@@ -832,8 +812,6 @@ void vtkStreamTracer::Integrate(vtkPointData *input0Data,
     numPts++;
     numPtsTotal++;
     vtkIdType nextPoint = outputPoints->InsertNextPoint(point1);
-    double lastInsertedPoint[3];
-    outputPoints->GetPoint(nextPoint, lastInsertedPoint);
     time->InsertNextValue(0.0);
 
     // We will always pass an arc-length step size to the integrator.
@@ -907,7 +885,6 @@ void vtkStreamTracer::Integrate(vtkPointData *input0Data,
       }
 
     double error = 0;
-
     // Integrate until the maximum propagation length is reached,
     // maximum number of steps is reached or until a boundary is encountered.
     // Begin Integration
@@ -974,21 +951,9 @@ void vtkStreamTracer::Integrate(vtkPointData *input0Data,
         }
 
       // This is the next starting point
-      if (this->SurfaceStreamlines && surfaceFunc != NULL)
+      for(i=0; i<3; i++)
         {
-        if (surfaceFunc->SnapPointOnCell(point2, point1) != 1)
-          {
-          retVal = OUT_OF_DOMAIN;
-          memcpy(lastPoint, point2, 3 * sizeof(double));
-          break;
-          }
-        }
-      else
-        {
-        for (i = 0; i < 3; i++)
-          {
-          point1[i] = point2[i];
-          }
+        point1[i] = point2[i];
         }
 
       // Interpolate the velocity at the next point
@@ -1017,64 +982,51 @@ void vtkStreamTracer::Integrate(vtkPointData *input0Data,
       inputPD = input->GetPointData();
       inVectors = input->GetAttributesAsFieldData(vecType)->GetArray(vecName);
 
+
+      // Point is valid. Insert it.
+      numPts++;
+      numPtsTotal++;
+      nextPoint = outputPoints->InsertNextPoint(point1);
+      time->InsertNextValue(accumTime);
+
       // Calculate cell length and speed to be used in unit conversions
       input->GetCell(func->GetLastCellId(), cell);
       cellLength = sqrt(static_cast<double>(cell->GetLength2()));
       speed = speed2;
-
-      // Check if conversion to float will produce a point in same place
-      float convertedPoint[3];
-      for (i = 0; i < 3; i++)
+      // Interpolate all point attributes on current point
+      func->GetLastWeights(weights);
+      InterpolatePoint(outputPD, inputPD, nextPoint, cell->PointIds, weights, this->HasMatchingPointAttributes);
+      if(vecType != vtkDataObject::POINT)
         {
-        convertedPoint[i] = point1[i];
+        velocityVectors->InsertNextTuple(velocity);
         }
-      if (lastInsertedPoint[0] != convertedPoint[0] ||
-          lastInsertedPoint[1] != convertedPoint[1] ||
-          lastInsertedPoint[2] != convertedPoint[2])
+      // Compute vorticity if required
+      // This can be used later for streamribbon generation.
+      if (this->ComputeVorticity)
         {
-        // Point is valid. Insert it.
-        numPts++;
-        numPtsTotal++;
-        nextPoint = outputPoints->InsertNextPoint(point1);
-        outputPoints->GetPoint(nextPoint, lastInsertedPoint);
-        time->InsertNextValue(accumTime);
-
-        // Interpolate all point attributes on current point
-        func->GetLastWeights(weights);
-        InterpolatePoint(outputPD, inputPD, nextPoint, cell->PointIds, weights, this->HasMatchingPointAttributes);
-
-        if(vecType != vtkDataObject::POINT)
+        if(vecType == vtkDataObject::POINT)
           {
-          velocityVectors->InsertNextTuple(velocity);
+          inVectors->GetTuples(cell->PointIds, cellVectors);
+          func->GetLastLocalCoordinates(pcoords);
+          vtkStreamTracer::CalculateVorticity(cell, pcoords, cellVectors, vort);
           }
-        // Compute vorticity if required
-        // This can be used later for streamribbon generation.
-        if (this->ComputeVorticity)
+        else
           {
-          if(vecType == vtkDataObject::POINT)
-            {
-            inVectors->GetTuples(cell->PointIds, cellVectors);
-            func->GetLastLocalCoordinates(pcoords);
-            vtkStreamTracer::CalculateVorticity(cell, pcoords, cellVectors, vort);
-            }
-          else
-            {
-            vort[0] = 0;
-            vort[1] = 0;
-            vort[2] = 0;
-            }
-          vorticity->InsertNextTuple(vort);
-          // rotation
-          // angular velocity = vorticity . unit tangent ( i.e. velocity/speed )
-          // rotation = sum ( angular velocity * stepSize )
-          omega = vtkMath::Dot(vort, velocity);
-          omega /= speed;
-          omega *= this->RotationScale;
-          index = angularVel->InsertNextValue(omega);
-          rotation->InsertNextValue(rotation->GetValue(index-1) +
-                                    (angularVel->GetValue(index-1) + omega)/2 *
-                                    (accumTime - time->GetValue(index-1)));
+          vort[0] = 0;
+          vort[1] = 0;
+          vort[2] = 0;
           }
+        vorticity->InsertNextTuple(vort);
+        // rotation
+        // angular velocity = vorticity . unit tangent ( i.e. velocity/speed )
+        // rotation = sum ( angular velocity * stepSize )
+        omega = vtkMath::Dot(vort, velocity);
+        omega /= speed;
+        omega *= this->RotationScale;
+        index = angularVel->InsertNextValue(omega);
+        rotation->InsertNextValue(rotation->GetValue(index-1) +
+                                  (angularVel->GetValue(index-1) + omega)/2 *
+                                  (accumTime - time->GetValue(index-1)));
         }
 
       // Never call conversion methods if speed == 0
diff --git a/Filters/FlowPaths/vtkStreamTracer.h b/Filters/FlowPaths/vtkStreamTracer.h
index cac65ba..8eacd5b 100644
--- a/Filters/FlowPaths/vtkStreamTracer.h
+++ b/Filters/FlowPaths/vtkStreamTracer.h
@@ -244,12 +244,6 @@ public:
   vtkSetMacro(TerminalSpeed, double);
   vtkGetMacro(TerminalSpeed, double);
 
-  // Description:
-  // Set/Unset the streamlines to be computed on a surface
-  vtkGetMacro(SurfaceStreamlines, bool);
-  vtkSetMacro(SurfaceStreamlines, bool);
-  vtkBooleanMacro(SurfaceStreamlines, bool);
-
 //BTX
   enum
   {
@@ -390,9 +384,6 @@ protected:
   bool ComputeVorticity;
   double RotationScale;
 
-  // Compute streamlines only on surface.
-  bool SurfaceStreamlines;
-
   vtkAbstractInterpolatedVelocityField * InterpolatorPrototype;
 
   vtkCompositeDataSet* InputData;
diff --git a/Filters/FlowPaths/vtkTemporalInterpolatedVelocityField.cxx b/Filters/FlowPaths/vtkTemporalInterpolatedVelocityField.cxx
index a9b3abc..169d4f6 100644
--- a/Filters/FlowPaths/vtkTemporalInterpolatedVelocityField.cxx
+++ b/Filters/FlowPaths/vtkTemporalInterpolatedVelocityField.cxx
@@ -31,8 +31,8 @@ vtkTemporalInterpolatedVelocityField::vtkTemporalInterpolatedVelocityField()
 {
   this->NumFuncs         = 3; // u, v, w
   this->NumIndepVars     = 4; // x, y, z, t
-  this->IVF[0] = vtkSmartPointer<vtkCachingInterpolatedVelocityField>::New();
-  this->IVF[1] = vtkSmartPointer<vtkCachingInterpolatedVelocityField>::New();
+  this->ivf[0] = vtkSmartPointer<vtkCachingInterpolatedVelocityField>::New();
+  this->ivf[1] = vtkSmartPointer<vtkCachingInterpolatedVelocityField>::New();
   this->LastGoodVelocity[0]=0.0;
   this->LastGoodVelocity[1]=0.0;
   this->LastGoodVelocity[2]=0.0;
@@ -40,9 +40,9 @@ vtkTemporalInterpolatedVelocityField::vtkTemporalInterpolatedVelocityField()
   this->OneMinusWeight=1.0;
   this->ScaleCoeff=1.0;
 
-  this->Vals1[0] = this->Vals1[1] = this->Vals1[2] = 0.0;
-  this->Vals2[0] = this->Vals2[1] = this->Vals2[2] = 0.0;
-  this->Times[0] = this->Times[1] = 0.0;
+  this->vals1[0] = this->vals1[1] = this->vals1[2] = 0.0;
+  this->vals2[0] = this->vals2[1] = this->vals2[2] = 0.0;
+  this->times[0] = this->times[1] = 0.0;
 }
 
 //---------------------------------------------------------------------------
@@ -51,36 +51,36 @@ vtkTemporalInterpolatedVelocityField::~vtkTemporalInterpolatedVelocityField()
   this->NumFuncs = 0;
   this->NumIndepVars = 0;
   this->SetVectorsSelection(0);
-  this->IVF[0] = NULL;
-  this->IVF[1] = NULL;
+  this->ivf[0] = NULL;
+  this->ivf[1] = NULL;
 }
 //---------------------------------------------------------------------------
 void vtkTemporalInterpolatedVelocityField::SetDataSetAtTime(int I, int N, double T, vtkDataSet* dataset, bool staticdataset)
 {
-  this->Times[N] = T;
-  if ((this->Times[1]-this->Times[0])>0)
+  this->times[N] = T;
+  if ((this->times[1]-this->times[0])>0)
     {
-    this->ScaleCoeff = 1.0/(this->Times[1]-this->Times[0]);
+    this->ScaleCoeff = 1.0/(this->times[1]-this->times[0]);
     }
   if (N==0)
     {
-    this->IVF[N]->SetDataSet(I, dataset, staticdataset, NULL);
+    this->ivf[N]->SetDataSet(I, dataset, staticdataset, NULL);
     }
   // when the datasets for the second time set are added, set the static flag
   if (N==1)
     {
-    bool is_static = staticdataset && this->IVF[0]->CacheList[I].StaticDataSet;
+    bool is_static = staticdataset && this->ivf[0]->CacheList[I].StaticDataSet;
     if (static_cast<size_t>(I)>=this->StaticDataSets.size())
       {
       this->StaticDataSets.resize(I+1,is_static);
       }
     if (is_static)
       {
-      this->IVF[N]->SetDataSet(I, dataset, staticdataset, this->IVF[0]->CacheList[I].BSPTree);
+      this->ivf[N]->SetDataSet(I, dataset, staticdataset, this->ivf[0]->CacheList[I].BSPTree);
       }
     else
       {
-      this->IVF[N]->SetDataSet(I, dataset, staticdataset, NULL);
+      this->ivf[N]->SetDataSet(I, dataset, staticdataset, NULL);
       }
     }
 }
@@ -92,60 +92,60 @@ bool vtkTemporalInterpolatedVelocityField::IsStatic(int datasetIndex)
 //---------------------------------------------------------------------------
 void vtkTemporalInterpolatedVelocityField::SetVectorsSelection(const char *v)
 {
-  this->IVF[0]->SelectVectors(v);
-  this->IVF[1]->SelectVectors(v);
+  this->ivf[0]->SelectVectors(v);
+  this->ivf[1]->SelectVectors(v);
 }
 //---------------------------------------------------------------------------
 void vtkTemporalInterpolatedVelocityField::ClearCache()
 {
-  this->IVF[0]->SetLastCellInfo(-1, 0);
-  this->IVF[1]->SetLastCellInfo(-1, 0);
+  this->ivf[0]->SetLastCellInfo(-1, 0);
+  this->ivf[1]->SetLastCellInfo(-1, 0);
 }
 //---------------------------------------------------------------------------
 void vtkTemporalInterpolatedVelocityField::SetCachedCellIds(vtkIdType id[2], int ds[2])
 {
   if (id[0]!=-1)
     {
-    this->IVF[0]->SetLastCellInfo(id[0], ds[0]);
+    this->ivf[0]->SetLastCellInfo(id[0], ds[0]);
     }
   else
     {
-    this->IVF[0]->SetLastCellInfo(-1, 0);
+    this->ivf[0]->SetLastCellInfo(-1, 0);
     }
   //
   if (id[1]!=-1)
     {
-    this->IVF[1]->SetLastCellInfo(id[1], ds[1]);
+    this->ivf[1]->SetLastCellInfo(id[1], ds[1]);
     }
   else
     {
-    this->IVF[1]->SetLastCellInfo(-1, 0);
+    this->ivf[1]->SetLastCellInfo(-1, 0);
     }
 }
 //---------------------------------------------------------------------------
 bool vtkTemporalInterpolatedVelocityField::GetCachedCellIds(vtkIdType id[2], int ds[2])
 {
-  id[0] = this->IVF[0]->LastCellId;
-  ds[0] = (id[0]==-1) ? 0 : this->IVF[0]->LastCacheIndex;
+  id[0] = this->ivf[0]->LastCellId;
+  ds[0] = (id[0]==-1) ? 0 : this->ivf[0]->LastCacheIndex;
   //
-  id[1] = this->IVF[1]->LastCellId;
-  ds[1] = (id[1]==-1) ? 0 : this->IVF[1]->LastCacheIndex;
+  id[1] = this->ivf[1]->LastCellId;
+  ds[1] = (id[1]==-1) ? 0 : this->ivf[1]->LastCacheIndex;
   return ((id[0]>=0) && (id[1]>=0));
 }
 //---------------------------------------------------------------------------
 void vtkTemporalInterpolatedVelocityField::AdvanceOneTimeStep()
 {
-  for (unsigned int i=0; i<this->IVF[0]->CacheList.size(); i++)
+  for (unsigned int i=0; i<this->ivf[0]->CacheList.size(); i++)
     {
     if (this->IsStatic(i))
       {
-      this->IVF[0]->ClearLastCellInfo();
-      this->IVF[1]->ClearLastCellInfo();
+      this->ivf[0]->ClearLastCellInfo();
+      this->ivf[1]->ClearLastCellInfo();
       }
     else
       {
-      this->IVF[0] = this->IVF[1];
-      this->IVF[1] = vtkSmartPointer<vtkCachingInterpolatedVelocityField>::New();
+      this->ivf[0] = this->ivf[1];
+      this->ivf[1] = vtkSmartPointer<vtkCachingInterpolatedVelocityField>::New();
       }
     }
 }
@@ -153,19 +153,19 @@ void vtkTemporalInterpolatedVelocityField::AdvanceOneTimeStep()
 void vtkTemporalInterpolatedVelocityField::ShowCacheResults()
 {
   vtkErrorMacro(<< ")\n"
-                << "T0 - (cell hit : " << this->IVF[0]->CellCacheHit
-                << "  (dataset hit : " << this->IVF[0]->DataSetCacheHit-this->IVF[0]->CellCacheHit
-                << "         (miss : " << this->IVF[0]->CacheMiss       << ")\n"
-                << "T1 - (cell hit : " << this->IVF[1]->CellCacheHit
-                << "  (dataset hit : " << this->IVF[1]->DataSetCacheHit-this->IVF[1]->CellCacheHit
-                << "         (miss : " << this->IVF[1]->CacheMiss);
+                << "T0 - (cell hit : " << this->ivf[0]->CellCacheHit
+                << "  (dataset hit : " << this->ivf[0]->DataSetCacheHit-this->ivf[0]->CellCacheHit
+                << "         (miss : " << this->ivf[0]->CacheMiss       << ")\n"
+                << "T1 - (cell hit : " << this->ivf[1]->CellCacheHit
+                << "  (dataset hit : " << this->ivf[1]->DataSetCacheHit-this->ivf[1]->CellCacheHit
+                << "         (miss : " << this->ivf[1]->CacheMiss);
 }
 //---------------------------------------------------------------------------
 static double vtkTIVFWeightTolerance = 1E-3;
 // Evaluate u,v,w at x,y,z,t
 int vtkTemporalInterpolatedVelocityField::TestPoint(double* x)
 {
-  this->CurrentWeight  = (x[3]-this->Times[0])*this->ScaleCoeff;
+  this->CurrentWeight  = (x[3]-this->times[0])*this->ScaleCoeff;
   this->OneMinusWeight = 1.0 - this->CurrentWeight;
   if (this->CurrentWeight<(0.0+vtkTIVFWeightTolerance))
     {
@@ -178,69 +178,72 @@ int vtkTemporalInterpolatedVelocityField::TestPoint(double* x)
   //
   // are we inside dataset at T0
   //
-  if (this->IVF[0]->FunctionValues(x, this->Vals1))
+  if (this->ivf[0]->FunctionValues(x, vals1))
     {
     // if we are inside at T0 and static, we must be inside at T1
-    if (this->IsStatic(this->IVF[0]->LastCacheIndex))
+    if (this->IsStatic(this->ivf[0]->LastCacheIndex))
       {
       // compute using weights from dataset 0 and vectors from dataset 1
-      this->IVF[1]->SetLastCellInfo(this->IVF[0]->LastCellId, this->IVF[0]->LastCacheIndex);
-      this->IVF[0]->FastCompute(this->IVF[1]->Cache, this->Vals2);
+      this->ivf[1]->SetLastCellInfo(this->ivf[0]->LastCellId, this->ivf[0]->LastCacheIndex);
+      this->ivf[0]->FastCompute(this->ivf[1]->Cache, vals2);
       for (int i=0; i<this->NumFuncs; i++)
         {
-        this->LastGoodVelocity[i] = this->OneMinusWeight*this->Vals1[i] + this->CurrentWeight*this->Vals2[i];
+        this->LastGoodVelocity[i] = this->OneMinusWeight*vals1[i] + this->CurrentWeight*vals2[i];
         }
       return ID_INSIDE_ALL;
       }
     // dynamic, we need to test at T1
-    if (!this->IVF[1]->FunctionValues(x, this->Vals2))
+    if (!this->ivf[1]->FunctionValues(x, vals2))
       {
       // inside at T0, but outside at T1, return velocity for T0
       for (int i=0; i<this->NumFuncs; i++)
         {
-        this->LastGoodVelocity[i] = this->Vals1[i];
+        this->LastGoodVelocity[i] = vals1[i];
         }
       return ID_OUTSIDE_T1;
       }
     // both valid, compute correct value
     for (int i=0; i<this->NumFuncs; i++)
       {
-      this->LastGoodVelocity[i] = this->OneMinusWeight*this->Vals1[i] + this->CurrentWeight*this->Vals2[i];
+      this->LastGoodVelocity[i] = this->OneMinusWeight*vals1[i] + this->CurrentWeight*vals2[i];
       }
     return ID_INSIDE_ALL;
     }
   // Outside at T0, either abort or use T1
-  // if we are outside at T0 and static, we must be outside at T1
-  if (this->IsStatic(this->IVF[0]->LastCacheIndex))
-    {
-    return ID_OUTSIDE_ALL;
-    }
-  // we are dynamic, so test T1
-  if (this->IVF[1]->FunctionValues(x, this->Vals2))
+  else
     {
-    // inside at T1, but outside at T0, return velocity for T1
-    for (int i=0; i<this->NumFuncs; i++)
+    // if we are outside at T0 and static, we must be outside at T1
+    if (this->IsStatic(this->ivf[0]->LastCacheIndex))
       {
-      this->LastGoodVelocity[i] = this->Vals2[i];
+      return ID_OUTSIDE_ALL;
       }
-    return ID_OUTSIDE_T0;
+    // we are dynamic, so test T1
+    if (this->ivf[1]->FunctionValues(x, vals2))
+      {
+      // inside at T1, but outside at T0, return velocity for T1
+      for (int i=0; i<this->NumFuncs; i++)
+        {
+        this->LastGoodVelocity[i] = vals2[i];
+        }
+      return ID_OUTSIDE_T0;
+      }
+    // failed both, so exit
+    return ID_OUTSIDE_ALL;
     }
-  // failed both, so exit
-  return ID_OUTSIDE_ALL;
 }
 //---------------------------------------------------------------------------
 // Evaluate u,v,w at x,y,z,t
 int vtkTemporalInterpolatedVelocityField::QuickTestPoint(double* x)
 {
   // if outside, return 0
-  if (!this->IVF[0]->InsideTest(x))
+  if (!this->ivf[0]->InsideTest(x))
     {
     return 0;
     }
   // if inside and static dataset hit, skip next test
-  if (!this->IsStatic(this->IVF[0]->LastCacheIndex))
+  if (!this->IsStatic(this->ivf[0]->LastCacheIndex))
     {
-    if (!this->IVF[1]->InsideTest(x))
+    if (!this->ivf[1]->InsideTest(x))
       {
       return 0;
       }
@@ -269,17 +272,17 @@ int vtkTemporalInterpolatedVelocityField::FunctionValuesAtT(int T, double* x, do
   //
   if (T==0)
     {
-    if (!this->IVF[0]->FunctionValues(x, this->Vals1))
+    if (!this->ivf[0]->FunctionValues(x, vals1))
       {
       return 0;
       }
     for (int i=0; i<this->NumFuncs; i++)
       {
-      this->LastGoodVelocity[i] = u[i] = this->Vals1[i];
+      this->LastGoodVelocity[i] = u[i] = vals1[i];
       }
-    if (this->IsStatic(this->IVF[0]->LastCacheIndex))
+    if (this->IsStatic(this->ivf[0]->LastCacheIndex))
       {
-      this->IVF[1]->SetLastCellInfo(this->IVF[0]->LastCellId, this->IVF[0]->LastCacheIndex);
+      this->ivf[1]->SetLastCellInfo(this->ivf[0]->LastCellId, this->ivf[0]->LastCacheIndex);
       }
     }
   //
@@ -287,17 +290,17 @@ int vtkTemporalInterpolatedVelocityField::FunctionValuesAtT(int T, double* x, do
   //
   else if (T==1)
     {
-    if (!this->IVF[1]->FunctionValues(x, this->Vals2))
+    if (!this->ivf[1]->FunctionValues(x, vals2))
       {
       return 0;
       }
     for (int i=0; i<this->NumFuncs; i++)
       {
-      this->LastGoodVelocity[i] = u[i] = this->Vals2[i];
+      this->LastGoodVelocity[i] = u[i] = vals2[i];
       }
-    if (this->IsStatic(this->IVF[1]->LastCacheIndex))
+    if (this->IsStatic(this->ivf[1]->LastCacheIndex))
       {
-      this->IVF[0]->SetLastCellInfo(this->IVF[1]->LastCellId, this->IVF[1]->LastCacheIndex);
+      this->ivf[0]->SetLastCellInfo(this->ivf[1]->LastCellId, this->ivf[1]->LastCacheIndex);
       }
     }
   return 1;
@@ -307,22 +310,22 @@ bool vtkTemporalInterpolatedVelocityField::InterpolatePoint(
   vtkPointData *outPD1, vtkPointData *outPD2,
   vtkIdType outIndex)
 {
-  bool ok1 = this->IVF[0]->InterpolatePoint(outPD1, outIndex);
-  bool ok2 = this->IVF[1]->InterpolatePoint(outPD2, outIndex);
+  bool ok1 = this->ivf[0]->InterpolatePoint(outPD1, outIndex);
+  bool ok2 = this->ivf[1]->InterpolatePoint(outPD2, outIndex);
   return (ok1 || ok2);
 }
 //---------------------------------------------------------------------------
 bool vtkTemporalInterpolatedVelocityField::InterpolatePoint(
   int T, vtkPointData *outPD1, vtkIdType outIndex)
 {
-  vtkCachingInterpolatedVelocityField* inivf = this->IVF[T];
+  vtkCachingInterpolatedVelocityField* inivf = this->ivf[T];
   // force use of correct weights/etc if static as only T0 are valid
-  if (T==1 && this->IsStatic(this->IVF[T]->LastCacheIndex))
+  if (T==1 && this->IsStatic(this->ivf[T]->LastCacheIndex))
     {
     T=0;
     }
   //
-  return this->IVF[T]->InterpolatePoint(inivf, outPD1, outIndex);
+  return this->ivf[T]->InterpolatePoint(inivf, outPD1, outIndex);
 }
 //---------------------------------------------------------------------------
 bool vtkTemporalInterpolatedVelocityField::GetVorticityData(
@@ -330,18 +333,18 @@ bool vtkTemporalInterpolatedVelocityField::GetVorticityData(
   vtkGenericCell *&cell, vtkDoubleArray *cellVectors)
 {
   // force use of correct weights/etc if static as only T0 are valid
-  if (T==1 && this->IsStatic(this->IVF[T]->LastCacheIndex))
+  if (T==1 && this->IsStatic(this->ivf[T]->LastCacheIndex))
     {
     T=0;
     }
   //
-  if (this->IVF[T]->GetLastWeights(weights) &&
-      this->IVF[T]->GetLastLocalCoordinates(pcoords) &&
-      (cell=this->IVF[T]->GetLastCell()) )
+  if (this->ivf[T]->GetLastWeights(weights) &&
+      this->ivf[T]->GetLastLocalCoordinates(pcoords) &&
+      (cell=this->ivf[T]->GetLastCell()) )
     {
-    vtkDataSet   *ds = this->IVF[T]->Cache->DataSet;
+    vtkDataSet   *ds = this->ivf[T]->Cache->DataSet;
     vtkPointData *pd = ds->GetPointData();
-    vtkDataArray *da = pd->GetVectors(this->IVF[T]->GetVectorsSelection());
+    vtkDataArray *da = pd->GetVectors(this->ivf[T]->GetVectorsSelection());
     da->GetTuples(cell->PointIds, cellVectors);
     return 1;
     }
diff --git a/Filters/FlowPaths/vtkTemporalInterpolatedVelocityField.h b/Filters/FlowPaths/vtkTemporalInterpolatedVelocityField.h
index 4e4f999..eac389d 100644
--- a/Filters/FlowPaths/vtkTemporalInterpolatedVelocityField.h
+++ b/Filters/FlowPaths/vtkTemporalInterpolatedVelocityField.h
@@ -140,9 +140,9 @@ protected:
   int FunctionValues(vtkDataSet* ds, double* x, double* f);
   virtual void SetVectorsSelection(const char *v);
 
-  double Vals1[3];
-  double Vals2[3];
-  double Times[2];
+  double vals1[3];
+  double vals2[3];
+  double times[2];
   double LastGoodVelocity[3];
 
   // The weight (0.0->1.0) of the value of T between the two avaiable
@@ -153,7 +153,7 @@ protected:
   // A scaling factor used when calculating the CurrentWeight { 1.0/(T2-T1) }
   double ScaleCoeff;
 //BTX
-  vtkSmartPointer<vtkCachingInterpolatedVelocityField> IVF[2];
+  vtkSmartPointer<vtkCachingInterpolatedVelocityField> ivf[2];
   // we want to keep track of static datasets so we can optimize caching
   std::vector<bool> StaticDataSets;
 //ETX
diff --git a/Filters/General/Testing/Cxx/BoxClipTriangulateAndInterpolate.cxx b/Filters/General/Testing/Cxx/BoxClipTriangulateAndInterpolate.cxx
index 280e024..fa61142 100644
--- a/Filters/General/Testing/Cxx/BoxClipTriangulateAndInterpolate.cxx
+++ b/Filters/General/Testing/Cxx/BoxClipTriangulateAndInterpolate.cxx
@@ -185,6 +185,7 @@ static void AddToRenderWindow(vtkRenderWindow *renwin,
 
   VTK_CREATE(vtkActor, actor1);
   actor1->SetMapper(mapper1);
+  actor1->GetProperty()->SetLineWidth(10.0);
   renderer->AddActor(actor1);
 
   VTK_CREATE(vtkDataSetSurfaceFilter, surface2);
@@ -195,6 +196,7 @@ static void AddToRenderWindow(vtkRenderWindow *renwin,
 
   VTK_CREATE(vtkActor, actor2);
   actor2->SetMapper(mapper2);
+  actor2->GetProperty()->SetLineWidth(10.0);
   renderer->AddActor(actor2);
 
   renwin->AddRenderer(renderer);
diff --git a/Filters/General/Testing/Cxx/TestTessellator.cxx b/Filters/General/Testing/Cxx/TestTessellator.cxx
index a54bacd..60aacfe 100644
--- a/Filters/General/Testing/Cxx/TestTessellator.cxx
+++ b/Filters/General/Testing/Cxx/TestTessellator.cxx
@@ -2635,7 +2635,7 @@ static int test_list[] =
 
 int* vtkTestTessellatorSubdivision::TestList = test_list;
 
-static double points[] =
+double points[] =
 {
   0., 0., 0.,  0., 0., 0.,
   1., 0., .1,  1., 0., 0.,
diff --git a/Filters/General/Testing/Cxx/TestYoungsMaterialInterface.cxx b/Filters/General/Testing/Cxx/TestYoungsMaterialInterface.cxx
index a20bff0..d09c48a 100644
--- a/Filters/General/Testing/Cxx/TestYoungsMaterialInterface.cxx
+++ b/Filters/General/Testing/Cxx/TestYoungsMaterialInterface.cxx
@@ -160,7 +160,7 @@ int TestYoungsMaterialInterface( int argc, char * argv [] )
     interfaceMapper->SetInputData( interface );
     interfaceIterator->GoToNextItem();
     interfaceMapper->ScalarVisibilityOff();
-    interfaceMapper->SetResolveCoincidentTopologyPolygonOffsetParameters( 1, 100 );
+    interfaceMapper->SetResolveCoincidentTopologyPolygonOffsetParameters( 1, 1 );
     interfaceMapper->SetResolveCoincidentTopologyToPolygonOffset();
 
     // Create surface actor and add it to view
diff --git a/Filters/General/Testing/Data/Baseline/BoxClipTriangulateAndInterpolate_1.png.md5 b/Filters/General/Testing/Data/Baseline/BoxClipTriangulateAndInterpolate_1.png.md5
deleted file mode 100644
index 286c893..0000000
--- a/Filters/General/Testing/Data/Baseline/BoxClipTriangulateAndInterpolate_1.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-752b060eee64a6cc7412169f97668f74
diff --git a/Filters/General/Testing/Python/blankGrid.py b/Filters/General/Testing/Python/blankGrid.py
index db51a3f..6da83ff 100755
--- a/Filters/General/Testing/Python/blankGrid.py
+++ b/Filters/General/Testing/Python/blankGrid.py
@@ -50,7 +50,7 @@ blanking = blankImage.GetPointData().GetScalars()
 numBlanks = 57 * 33
 i = 0
 while i < numBlanks:
-    blanking.SetComponent(i, 0, vtk.vtkDataSetAttributes.HIDDENPOINT)
+    blanking.SetComponent(i, 0, 1)
     i += 1
 
 # Manually blank out areas corresponding to dilution holes
diff --git a/Filters/General/Testing/Python/splitVectors.py b/Filters/General/Testing/Python/splitVectors.py
index d3f4ee2..9ff360f 100755
--- a/Filters/General/Testing/Python/splitVectors.py
+++ b/Filters/General/Testing/Python/splitVectors.py
@@ -20,7 +20,6 @@ pl3d.SetScalarFunctionNumber(100)
 pl3d.SetVectorFunctionNumber(202)
 pl3d.Update()
 output = pl3d.GetOutput().GetBlock(0)
-
 sf = vtk.vtkSplitField()
 sf.SetInputData(output)
 sf.SetInputField("VECTORS","POINT_DATA")
@@ -44,7 +43,6 @@ isoVxMapper.ImmediateModeRenderingOn()
 isoVxActor = vtk.vtkActor()
 isoVxActor.SetMapper(isoVxMapper)
 isoVxActor.GetProperty().SetColor(1,0.7,0.6)
-
 aay = vtk.vtkAssignAttribute()
 aay.SetInputConnection(sf.GetOutputPort())
 aay.Assign("vy","SCALARS","POINT_DATA")
@@ -61,7 +59,6 @@ isoVyMapper.ImmediateModeRenderingOn()
 isoVyActor = vtk.vtkActor()
 isoVyActor.SetMapper(isoVyMapper)
 isoVyActor.GetProperty().SetColor(0.7,1,0.6)
-
 aaz = vtk.vtkAssignAttribute()
 aaz.SetInputConnection(sf.GetOutputPort())
 aaz.Assign("vz","SCALARS","POINT_DATA")
@@ -78,7 +75,6 @@ isoVzMapper.ImmediateModeRenderingOn()
 isoVzActor = vtk.vtkActor()
 isoVzActor.SetMapper(isoVzMapper)
 isoVzActor.GetProperty().SetColor(0.4,0.5,1)
-
 mf = vtk.vtkMergeFields()
 mf.SetInputConnection(sf.GetOutputPort())
 mf.SetOutputField("merged","POINT_DATA")
@@ -109,7 +105,6 @@ slMapper.SetInputConnection(rf.GetOutputPort())
 slMapper.ImmediateModeRenderingOn()
 slActor = vtk.vtkActor()
 slActor.SetMapper(slMapper)
-
 outline = vtk.vtkStructuredGridOutlineFilter()
 outline.SetInputData(output)
 outlineMapper = vtk.vtkPolyDataMapper()
@@ -129,7 +124,6 @@ ren1.AddActor(outlineActor)
 outlineActor.AddPosition(0,24,0)
 ren1.SetBackground(.8,.8,.8)
 renWin.SetSize(321,321)
-
 ren1.GetActiveCamera().SetPosition(-20.3093,20.55444,64.3922)
 ren1.GetActiveCamera().SetFocalPoint(8.255,0.0499763,29.7631)
 ren1.GetActiveCamera().SetViewAngle(30)
diff --git a/Filters/General/Testing/Python/testDataSetTriangleFilter.py b/Filters/General/Testing/Python/testDataSetTriangleFilter.py
index 720c53e..af34343 100755
--- a/Filters/General/Testing/Python/testDataSetTriangleFilter.py
+++ b/Filters/General/Testing/Python/testDataSetTriangleFilter.py
@@ -40,7 +40,7 @@ def remove_ghosts():
     input = pf.GetInput()
     output = pf.GetOutputDataObject(0)
     output.ShallowCopy(input)
-    output.RemoveGhostCells()
+    output.RemoveGhostCells(1)
 pf.SetExecuteMethod(remove_ghosts)
 edges = vtk.vtkExtractEdges()
 edges.SetInputConnection(pf.GetOutputPort())
@@ -54,7 +54,7 @@ mapper2 = vtk.vtkPolyDataMapper()
 mapper2.SetInputConnection(edges.GetOutputPort())
 mapper2.SetPiece(PIECE)
 mapper2.SetNumberOfPieces(NUMBER_OF_PIECES)
-mapper2.GetInput().RemoveGhostCells()
+mapper2.GetInput().RemoveGhostCells(1)
 actor1 = vtk.vtkActor()
 actor1.SetMapper(mapper1)
 actor2 = vtk.vtkActor()
diff --git a/Filters/General/Testing/Tcl/splitVectors.tcl b/Filters/General/Testing/Tcl/splitVectors.tcl
index dac7f09..f2ff29c 100644
--- a/Filters/General/Testing/Tcl/splitVectors.tcl
+++ b/Filters/General/Testing/Tcl/splitVectors.tcl
@@ -1,9 +1,6 @@
 package require vtk
 package require vtkinteraction
 
-
-
-
 # Create the RenderWindow, Renderer and both Actors
 #
 vtkRenderer ren1
@@ -11,6 +8,7 @@ vtkRenderWindow renWin
     renWin AddRenderer ren1
 vtkRenderWindowInteractor iren
     iren SetRenderWindow renWin
+
 # create pipeline
 #
 vtkMultiBlockPLOT3DReader pl3d
@@ -27,7 +25,9 @@ vtkSplitField sf
     sf Split 0 "vx"
     sf Split 1 "vy"
     sf Split 2 "vz"
-#sf Print
+
+sf Print
+
 vtkAssignAttribute aax
    aax SetInputConnection [sf GetOutputPort]
    aax Assign "vx" "SCALARS" "POINT_DATA"
@@ -86,7 +86,9 @@ vtkMergeFields mf
    mf Merge 0 "vy" 0
    mf Merge 1 "vz" 0
    mf Merge 2 "vx" 0
-#mf Print
+
+mf Print
+
 vtkAssignAttribute aa
    aa SetInputConnection [mf GetOutputPort]
    aa Assign "merged" "SCALARS" "POINT_DATA"
@@ -116,6 +118,7 @@ vtkPolyDataMapper outlineMapper
     outlineMapper SetInputConnection [outline GetOutputPort]
 vtkActor outlineActor
     outlineActor SetMapper outlineMapper
+
 # Add the actors to the renderer, set the background and size
 #
 ren1 AddActor isoVxActor
@@ -136,6 +139,8 @@ renWin SetSize 321 321
 [ren1 GetActiveCamera] SetViewUp 0 0 1
 [ren1 GetActiveCamera] Dolly 0.4
 ren1 ResetCameraClippingRange
+
+
 # render the image
 #
 iren AddObserver UserEvent {wm deiconify .vtkInteract}
diff --git a/Filters/General/Testing/Tcl/testDataSetTriangleFilter.tcl b/Filters/General/Testing/Tcl/testDataSetTriangleFilter.tcl
index 595cf8c..4566a52 100644
--- a/Filters/General/Testing/Tcl/testDataSetTriangleFilter.tcl
+++ b/Filters/General/Testing/Tcl/testDataSetTriangleFilter.tcl
@@ -47,7 +47,7 @@ proc stripGhosts {} {
    set inputDS [pf GetPolyDataInput]
    set outputDS [pf GetUnstructuredGridOutput]
    $outputDS ShallowCopy $inputDS
-   $outputDS RemoveGhostCells
+   $outputDS RemoveGhostCells 1
 }
 
 vtkExtractEdges edges
diff --git a/Filters/General/module.cmake b/Filters/General/module.cmake
index ed8db41..9fec44b 100644
--- a/Filters/General/module.cmake
+++ b/Filters/General/module.cmake
@@ -5,12 +5,12 @@ vtk_module(vtkFiltersGeneral
     vtkCommonComputationalGeometry
     vtkFiltersCore
   TEST_DEPENDS
-    vtkFiltersFlowPaths
     vtkIOLegacy
     vtkIOXML
     vtkImagingMath
     vtkInteractionStyle
     vtkRendering${VTK_RENDERING_BACKEND}
+    vtkRenderingFreeType${VTK_RENDERING_BACKEND}
     vtkRenderingAnnotation
     vtkRenderingLabel
     vtkTestingRendering
diff --git a/Filters/General/vtkApproximatingSubdivisionFilter.cxx b/Filters/General/vtkApproximatingSubdivisionFilter.cxx
index 4fca3e9..aa376ee 100644
--- a/Filters/General/vtkApproximatingSubdivisionFilter.cxx
+++ b/Filters/General/vtkApproximatingSubdivisionFilter.cxx
@@ -135,10 +135,30 @@ int vtkApproximatingSubdivisionFilter::RequestData(
     inputDS->Squeeze();
     } // each level
 
+  // Get rid of ghost cells if we have to.
+  unsigned char* ghostLevels=0;
+
+  vtkCellData* cd = inputDS->GetCellData();
+  if (cd)
+    {
+    vtkDataArray* temp = cd->GetArray("vtkGhostLevels");
+    if (temp)
+      {
+      ghostLevels = static_cast<vtkUnsignedCharArray*>(temp)->GetPointer(0);
+      }
+    }
+  int updateGhostLevel = outInfo->Get(
+    vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_GHOST_LEVELS());
+
   output->SetPoints(inputDS->GetPoints());
   output->SetPolys(inputDS->GetPolys());
   output->CopyAttributes(inputDS);
 
+  if (input->GetGhostLevel() > updateGhostLevel && ghostLevels != NULL)
+    {
+    output->RemoveGhostCells(updateGhostLevel+1);
+    }
+
   inputDS->Delete();
 
   return 1;
diff --git a/Filters/General/vtkBlankStructuredGrid.cxx b/Filters/General/vtkBlankStructuredGrid.cxx
index 378bf8a..4e614ea 100644
--- a/Filters/General/vtkBlankStructuredGrid.cxx
+++ b/Filters/General/vtkBlankStructuredGrid.cxx
@@ -45,7 +45,7 @@ template <class T>
 void vtkBlankStructuredGridExecute(vtkBlankStructuredGrid *vtkNotUsed(self),
                                    T *dptr, int numPts, int numComp,
                                    int comp, double min, double max,
-                                   vtkUnsignedCharArray *ghosts)
+                                   vtkUnsignedCharArray *blanking)
 {
   T compValue;
   dptr += comp;
@@ -53,12 +53,14 @@ void vtkBlankStructuredGridExecute(vtkBlankStructuredGrid *vtkNotUsed(self),
   for ( int ptId=0; ptId < numPts; ptId++, dptr+=numComp)
     {
     compValue = *dptr;
-    unsigned char value = 0;
-    if(compValue >= min && compValue <= max)
+    if ( compValue >= min && compValue <= max )
       {
-      value |= vtkDataSetAttributes::HIDDENPOINT;
+      blanking->SetValue(ptId,0); //make it invisible
+      }
+    else
+      {
+      blanking->SetValue(ptId,1);
       }
-    ghosts->SetValue(ptId, value);
     }
 }
 
@@ -116,21 +118,24 @@ int vtkBlankStructuredGrid::RequestData(
   // Loop over the data array setting anything within the data range specified
   // to be blanked.
   //
-  vtkUnsignedCharArray *ghosts = vtkUnsignedCharArray::New();
-  ghosts->SetNumberOfValues(numPts);
-  ghosts->SetName(vtkDataSetAttributes::GhostArrayName());
-  switch(dataArray->GetDataType())
+  vtkUnsignedCharArray *blanking = vtkUnsignedCharArray::New();
+  blanking->SetNumberOfValues(numPts);
+
+  // call templated function
+  switch (dataArray->GetDataType())
     {
     vtkTemplateMacro(
       vtkBlankStructuredGridExecute(this, static_cast<VTK_TT *>(dptr), numPts,
                                     numComp, this->Component,
                                     this->MinBlankingValue,
-                                    this->MaxBlankingValue, ghosts));
+                                    this->MaxBlankingValue, blanking));
     default:
       break;
     }
-  output->GetPointData()->AddArray(ghosts);
-  ghosts->Delete();
+
+  // Clean up and get out
+  output->SetPointVisibilityArray(blanking);
+  blanking->Delete();
 
   return 1;
 }
diff --git a/Filters/General/vtkBlankStructuredGridWithImage.cxx b/Filters/General/vtkBlankStructuredGridWithImage.cxx
index 2af934f..eb0b688 100644
--- a/Filters/General/vtkBlankStructuredGridWithImage.cxx
+++ b/Filters/General/vtkBlankStructuredGridWithImage.cxx
@@ -103,28 +103,16 @@ int vtkBlankStructuredGridWithImage::RequestData(
     }
 
   // Get the image, set it as the blanking array.
-  unsigned char *data = static_cast<unsigned char *>(image->GetScalarPointer());
-  vtkUnsignedCharArray *visibility = vtkUnsignedCharArray::New();
-  const vtkIdType numberOfValues = gridDims[0] * gridDims[1] * gridDims[2];
-  visibility->SetArray(data, numberOfValues, 1);
-  vtkUnsignedCharArray *ghosts = vtkUnsignedCharArray::New();
-  ghosts->SetNumberOfValues(numberOfValues);
-  ghosts->SetName(vtkDataSetAttributes::GhostArrayName());
-  for(vtkIdType ptId = 0; ptId < numberOfValues; ++ptId)
-    {
-    unsigned char value = 0;
-    if(visibility->GetValue(ptId) == 0)
-      {
-      value |= vtkDataSetAttributes::HIDDENPOINT;
-      }
-    ghosts->SetValue(ptId, value);
-    }
+  unsigned char *data=static_cast<unsigned char *>(image->GetScalarPointer());
+  vtkUnsignedCharArray *dataArray = vtkUnsignedCharArray::New();
+  dataArray->SetArray(data, gridDims[0]*gridDims[1]*gridDims[2], 1);
+
   output->CopyStructure(grid);
   output->GetPointData()->PassData(grid->GetPointData());
   output->GetCellData()->PassData(grid->GetCellData());
-  output->GetPointData()->AddArray(ghosts);
-  ghosts->Delete();
-  visibility->Delete();
+  output->SetPointVisibilityArray(dataArray);
+
+  dataArray->Delete();
 
   return 1;
 }
diff --git a/Filters/General/vtkCellTreeLocator.cxx b/Filters/General/vtkCellTreeLocator.cxx
index 9ae298a..990274f 100644
--- a/Filters/General/vtkCellTreeLocator.cxx
+++ b/Filters/General/vtkCellTreeLocator.cxx
@@ -277,6 +277,36 @@ class vtkCellTreeBuilder
         }
       }
 
+    //----------------------------------------------------------------------------
+
+    void FindMinD( const PerCell* begin, const PerCell* end,
+      unsigned int d, float& min )
+      {
+      min = begin->Min[d];
+
+      while( ++begin != end )
+        {
+        if( begin->Min[d] < min )
+          {
+          min = begin->Min[d];
+          }
+        }
+      }
+
+    void FindMaxD( const PerCell* begin, const PerCell* end,
+      unsigned int d, float& max )
+      {
+      max = begin->Max[d];
+
+      while( ++begin != end )
+        {
+        if( begin->Max[d] > max )
+          {
+          max = begin->Max[d];
+          }
+        }
+      }
+
     // -------------------------------------------------------------------------
 
     void Split( unsigned int index, float min[3], float max[3] )
diff --git a/Filters/General/vtkContourTriangulator.cxx b/Filters/General/vtkContourTriangulator.cxx
index 8634196..107933d 100644
--- a/Filters/General/vtkContourTriangulator.cxx
+++ b/Filters/General/vtkContourTriangulator.cxx
@@ -295,13 +295,15 @@ double vtkCCSPolygonNormal(
   double p0[3], p1[3], p2[3];
 
   size_t n = poly.size();
-  points->GetPoint(poly[0], p0);
-  points->GetPoint(poly[1], p1);
+  points->GetPoint(poly[n-1], p1);
+  points->GetPoint(poly[0], p2);
 
-  for (size_t j = 2; j < n; j++)
+  for (size_t j = 1; j < n; j++)
     {
     double v1[3], v2[3];
 
+    p0[0] = p1[0]; p0[1] = p1[1]; p0[2] = p1[2];
+    p1[0] = p2[0]; p1[1] = p2[1]; p1[2] = p2[2];
     points->GetPoint(poly[j], p2);
 
     v1[0] = p2[0] - p1[0];
@@ -315,10 +317,6 @@ double vtkCCSPolygonNormal(
     nn[0] += v1[1]*v2[2] - v1[2]*v2[1];
     nn[1] += v1[2]*v2[0] - v1[0]*v2[2];
     nn[2] += v1[0]*v2[1] - v1[1]*v2[0];
-
-    p1[0] = p2[0];
-    p1[1] = p2[1];
-    p1[2] = p2[2];
     }
 
   double norm2 = nn[0]*nn[0] + nn[1]*nn[1] + nn[2]*nn[2];
diff --git a/Filters/General/vtkDicer.cxx b/Filters/General/vtkDicer.cxx
index d60128e..6cadf64 100644
--- a/Filters/General/vtkDicer.cxx
+++ b/Filters/General/vtkDicer.cxx
@@ -23,7 +23,7 @@ vtkDicer::vtkDicer()
 {
   this->NumberOfPointsPerPiece = 5000;
   this->NumberOfPieces = 10;
-  this->MemoryLimit = 50 * 1024; // 50 mebibytes
+  this->MemoryLimit = 50000; //50 MBytes
   this->NumberOfActualPieces = 0;
   this->FieldData = 0;
   this->DiceMode = VTK_DICE_MODE_NUMBER_OF_POINTS;
@@ -71,7 +71,7 @@ void vtkDicer::PrintSelf(ostream& os, vtkIndent indent)
   os << indent << "Number of Pieces: "
      << this->NumberOfPieces << "\n";
 
-  os << indent << "Memory Limit (in kibibytes): "
+  os << indent << "Memory Limit: "
      << this->MemoryLimit << "\n";
 
   os << indent << "Number of Actual Pieces: "
diff --git a/Filters/General/vtkDicer.h b/Filters/General/vtkDicer.h
index cc8f29e..25e41bc 100644
--- a/Filters/General/vtkDicer.h
+++ b/Filters/General/vtkDicer.h
@@ -103,7 +103,7 @@ public:
   // Control piece size based on a memory limit.  (This ivar has
   // effect only when the DiceMode is set to
   // SetDiceModeToMemoryLimit()). The memory limit should be set in
-  // kibibytes (1024 bytes).
+  // kilobytes.
   vtkSetClampMacro(MemoryLimit,unsigned long,100,VTK_INT_MAX);
   vtkGetMacro(MemoryLimit,unsigned long);
 
diff --git a/Filters/General/vtkGradientFilter.cxx b/Filters/General/vtkGradientFilter.cxx
index 342626a..06f4585 100644
--- a/Filters/General/vtkGradientFilter.cxx
+++ b/Filters/General/vtkGradientFilter.cxx
@@ -304,6 +304,27 @@ int vtkGradientFilter::RequestData(vtkInformation *vtkNotUsed(request),
       array, fieldAssociation, input, computeVorticity, computeQCriterion, output);
     }
 
+  // If necessary, remove a layer of ghost cells.
+  int numPieces = outInfo->Get(
+    vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_PIECES());
+  if (numPieces > 1)
+    {
+    int ghostLevel = outInfo->Get(
+      vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_GHOST_LEVELS());
+    vtkPolyData *pd = vtkPolyData::SafeDownCast(output);
+    vtkUnstructuredGrid *ug = vtkUnstructuredGrid::SafeDownCast(output);
+    // Currently the only grids that ghost cells can be removed from
+    // are unstructured grids and polydatas
+    if (pd)
+      {
+      pd->RemoveGhostCells(ghostLevel+1);
+      }
+    else if (ug)
+      {
+      ug->RemoveGhostCells(ghostLevel+1);
+      }
+    }
+
   return 1;
 }
 
diff --git a/Filters/General/vtkImageMarchingCubes.cxx b/Filters/General/vtkImageMarchingCubes.cxx
index a8a1ac1..61f3558 100644
--- a/Filters/General/vtkImageMarchingCubes.cxx
+++ b/Filters/General/vtkImageMarchingCubes.cxx
@@ -595,7 +595,7 @@ void vtkImageMarchingCubesMarch(vtkImageMarchingCubes *self,
   unsigned long target, count;
 
   // avoid warnings
-  (void)ptr;
+  ptr = ptr;
 
   // Get information to loop through images.
   inData->GetExtent(min0, max0, min1, max1, min2, max2);
@@ -701,8 +701,11 @@ void vtkImageMarchingCubes::InitializeLocator(int min0, int max0,
 void vtkImageMarchingCubes::DeleteLocator()
 {
   // Free old memory
-  delete [] this->LocatorPointIds;
-  this->LocatorPointIds = NULL;
+  if (this->LocatorPointIds)
+    {
+    delete [] this->LocatorPointIds;
+    this->LocatorPointIds = NULL;
+    }
 }
 
 //----------------------------------------------------------------------------
diff --git a/Filters/General/vtkMultiThreshold.cxx b/Filters/General/vtkMultiThreshold.cxx
index cbc66a0..abee2d6 100644
--- a/Filters/General/vtkMultiThreshold.cxx
+++ b/Filters/General/vtkMultiThreshold.cxx
@@ -716,7 +716,7 @@ void vtkMultiThreshold::UpdateDependents(
               }
             }
           }
-        decision = (cnt % 2) ? INCLUDE : EXCLUDE;
+        decision = cnt % 2 ? INCLUDE : EXCLUDE;
         }
       break;
     case NAND:
diff --git a/Filters/General/vtkOBBTree.cxx b/Filters/General/vtkOBBTree.cxx
index 171b140..a06b1df 100644
--- a/Filters/General/vtkOBBTree.cxx
+++ b/Filters/General/vtkOBBTree.cxx
@@ -1090,7 +1090,7 @@ void vtkOBBTree::BuildLocator()
 
   vtkDebugMacro(<<"# Cells: " << numCells << ", Deepest tree level: " <<
                 this->Level <<", Created: " << this->OBBCount << " OBB nodes");
-  if ( this->GetDebug() )
+  if ( this->GetDebug() > 1 )
     { // print tree
     double volume = 0.0;
     int minCells = 65535, maxCells = 0;
diff --git a/Filters/General/vtkOBBTree.h b/Filters/General/vtkOBBTree.h
index 12b658e..cab0f78 100644
--- a/Filters/General/vtkOBBTree.h
+++ b/Filters/General/vtkOBBTree.h
@@ -89,8 +89,37 @@ public:
   // 25 cells per octant.
   static vtkOBBTree *New();
 
-  // Re-use any superclass signatures that we don't override.
+//BTX
+/*
+  if the borland compiler is ever removed, we can use these declarations
+  instead of reimplementaing the calls in this subclass
   using vtkAbstractCellLocator::IntersectWithLine;
+  using vtkAbstractCellLocator::FindClosestPoint;
+  using vtkAbstractCellLocator::FindClosestPointWithinRadius;
+*/
+//ETX
+
+  // Description:
+  // reimplemented from vtkAbstractCellLocator to support bad compilers
+  virtual int IntersectWithLine(
+    double a0[3], double a1[3], double tol,
+    double& t, double x[3], double pcoords[3],
+    int &subId)
+  {
+    return Superclass::
+      IntersectWithLine(a0, a1, tol,t, x, pcoords, subId);
+  }
+
+  // Description:
+  // reimplemented from vtkAbstractCellLocator to support bad compilers
+  virtual int IntersectWithLine(
+    double a0[3], double a1[3], double tol,
+    double& t, double x[3], double pcoords[3],
+    int &subId, vtkIdType &cellId)
+  {
+    return Superclass::
+      IntersectWithLine(a0, a1, tol,t, x, pcoords, subId, cellId);
+  }
 
   // Description:
   // Take the passed line segment and intersect it with the data set.
@@ -114,6 +143,69 @@ public:
                         int &subId, vtkIdType &cellId, vtkGenericCell *cell);
 
   // Description:
+  // Return the closest point and the cell which is closest to the point x.
+  // The closest point is somewhere on a cell, it need not be one of the
+  // vertices of the cell.  This version takes in a vtkGenericCell
+  // to avoid allocating and deallocating the cell.  This is much faster than
+  // the version which does not take a *cell, especially when this function is
+  // called many times in a row such as by a for loop, where the allocation and
+  // deallocation can be done only once outside the for loop.  If a cell is
+  // found, "cell" contains the points and ptIds for the cell "cellId" upon
+  // exit.
+  virtual void FindClosestPoint(
+    double x[3], double closestPoint[3],
+    vtkIdType &cellId, int &subId, double& dist2)
+  {
+    Superclass::
+      FindClosestPoint(x, closestPoint, cellId, subId, dist2);
+  }
+
+  // Description:
+  // reimplemented from vtkAbstractCellLocator to support bad compilers
+  virtual void FindClosestPoint(
+    double x[3], double closestPoint[3],
+    vtkGenericCell *cell, vtkIdType &cellId,
+    int &subId, double& dist2)
+  {
+    Superclass::
+      FindClosestPoint(x, closestPoint, cell, cellId, subId, dist2);
+  }
+
+  // Description:
+  // reimplemented from vtkAbstractCellLocator to support bad compilers
+  virtual vtkIdType FindClosestPointWithinRadius(
+    double x[3], double radius,
+    double closestPoint[3], vtkIdType &cellId,
+    int &subId, double& dist2)
+  {
+    return Superclass::FindClosestPointWithinRadius
+      (x, radius, closestPoint, cellId, subId, dist2);
+  }
+
+  // Description:
+  // reimplemented from vtkAbstractCellLocator to support bad compilers
+  virtual vtkIdType FindClosestPointWithinRadius(
+    double x[3], double radius,
+    double closestPoint[3],
+    vtkGenericCell *cell, vtkIdType &cellId,
+    int &subId, double& dist2)
+  {
+    return Superclass::FindClosestPointWithinRadius
+      (x, radius, closestPoint, cell, cellId, subId, dist2);
+  }
+
+  // Description:
+  // reimplemented from vtkAbstractCellLocator to support bad compilers
+  virtual vtkIdType FindClosestPointWithinRadius(
+    double x[3], double radius, double closestPoint[3],
+    vtkGenericCell *cell, vtkIdType &cellId,
+    int &subId, double& dist2, int &inside)
+  {
+    return Superclass::FindClosestPointWithinRadius
+      (x, radius, closestPoint, cell, cellId, subId, dist2, inside);
+  }
+
+  // Description:
   // Compute an OBB from the list of points given. Return the corner point
   // and the three axes defining the orientation of the OBB. Also return
   // a sorted list of relative "sizes" of axes for comparison purposes.
diff --git a/Filters/General/vtkRectilinearGridToTetrahedra.cxx b/Filters/General/vtkRectilinearGridToTetrahedra.cxx
index 5fa7d2d..1ff18cb 100644
--- a/Filters/General/vtkRectilinearGridToTetrahedra.cxx
+++ b/Filters/General/vtkRectilinearGridToTetrahedra.cxx
@@ -129,7 +129,7 @@ void vtkRectilinearGridToTetrahedra::SetInput(const double Extent[3],
 void vtkRectilinearGridToTetrahedra::DetermineGridDivisionTypes(
                                              vtkRectilinearGrid *RectGrid,
                                              vtkSignedCharArray *VoxelSubdivisionType,
-                                             const int &tetraPerCell)
+                                             const int &TetraPerCell)
 {
   int numRec = RectGrid->GetNumberOfCells();
   int NumPointsInDir[3];
@@ -143,7 +143,7 @@ void vtkRectilinearGridToTetrahedra::DetermineGridDivisionTypes(
   int flip;
   int i;
 
-  switch (tetraPerCell)
+  switch (TetraPerCell)
     {
     case (VTK_VOXEL_TO_12_TET):
       for(i=0;i<numRec;i++)
@@ -196,8 +196,8 @@ void vtkRectilinearGridToTetrahedra::DetermineGridDivisionTypes(
 // Take the grid and make it into a tetrahedral mesh.
 void vtkRectilinearGridToTetrahedra::GridToTetMesh(vtkRectilinearGrid *RectGrid,
                                 vtkSignedCharArray *VoxelSubdivisionType,
-                                const int &tetraPerCell,
-                                const int &rememberVoxelId,
+                                const int &TetraPerCell,
+                                const int &RememberVoxelId,
                                 vtkUnstructuredGrid *TetMesh)
 {
   int i, j;
@@ -213,7 +213,7 @@ void vtkRectilinearGridToTetrahedra::GridToTetMesh(vtkRectilinearGrid *RectGrid,
   // it is easier to way overguess to avoid re-allocation
   // slowness and range checking during insertion.
 
-  switch (tetraPerCell)
+  switch (TetraPerCell)
     {
     case (VTK_VOXEL_TO_5_TET):
       NodePoints->Allocate(numPts);
@@ -236,7 +236,7 @@ void vtkRectilinearGridToTetrahedra::GridToTetMesh(vtkRectilinearGrid *RectGrid,
   // to the Tets indicating the Voxel Id the tet
   // came from.
   vtkIntArray *TetOriginalVoxel = NULL;
-  if (rememberVoxelId) {
+  if (RememberVoxelId) {
     TetOriginalVoxel = vtkIntArray::New();
     TetOriginalVoxel->Allocate(12*numRec);
   }
@@ -253,7 +253,7 @@ void vtkRectilinearGridToTetrahedra::GridToTetMesh(vtkRectilinearGrid *RectGrid,
     NumTetFromVoxel = TetrahedralizeVoxel(VoxelCorners,
                                           (int)VoxelSubdivisionType->GetValue(i),
                                           NodePoints,TetList);
-    if (rememberVoxelId)
+    if (RememberVoxelId)
       {
       for(j=0;j<NumTetFromVoxel;j++)
         {
@@ -287,7 +287,7 @@ void vtkRectilinearGridToTetrahedra::GridToTetMesh(vtkRectilinearGrid *RectGrid,
   // Add Scalar Types if wanted
   //
 
-  if(rememberVoxelId)
+  if(RememberVoxelId)
     {
     TetOriginalVoxel->Squeeze();
     int idx = TetMesh->GetCellData()->AddArray(TetOriginalVoxel);
diff --git a/Filters/General/vtkTableBasedClipCases.h b/Filters/General/vtkTableBasedClipCases.h
index 25292cb..cf29491 100644
--- a/Filters/General/vtkTableBasedClipCases.h
+++ b/Filters/General/vtkTableBasedClipCases.h
@@ -971,7 +971,7 @@ const int StartClipShapesHex[256] = {
   20964, 21065, 21091, 21138, 21208, 21234, 21304, 21374  // cases 248 - 255
 };
 
-static unsigned char ClipShapesHex[] = {
+unsigned char ClipShapesHex[] = {
  // Case #0: Unique case #1
   ST_HEX, COLOR0, P0, P1, P2, P3, P4, P5, P6, P7,
  // Case #1: Unique case #2
@@ -4450,7 +4450,7 @@ const int StartClipShapesVox[256] = {
   20964, 21065, 21112, 21138, 21208, 21234, 21304, 21374  // cases 248 - 255
 };
 
-static unsigned char ClipShapesVox[] = {
+unsigned char ClipShapesVox[] = {
  // Case #0: Unique case #1
   ST_HEX, COLOR0, P0, P1, P3, P2, P4, P5, P7, P6,
  // Case #1: Unique case #2
@@ -7882,7 +7882,7 @@ const int StartClipShapesWdg[64] = {
   3192, 3208, 3273, 3338, 3359, 3424, 3445, 3466  // cases 56 - 63
 };
 
-static unsigned char ClipShapesWdg[] = {
+unsigned char ClipShapesWdg[] = {
  // Case #0: Unique case #1
   ST_WDG, COLOR0, P0, P1, P2, P3, P4, P5,
  // Case #1: Unique case #2
@@ -8472,7 +8472,7 @@ const int StartClipShapesPyr[32] = {
   797, 827, 886, 914, 934, 993, 1013, 1033  // cases 24 - 31
 };
 
-static unsigned char ClipShapesPyr[] = {
+unsigned char ClipShapesPyr[] = {
  // Case #0: Unique case #1
   ST_PYR, COLOR0, P0, P1, P2, P3, P4,
  // Case #1: Unique case #2
@@ -8670,7 +8670,7 @@ const int StartClipShapesTet[16] = {
   110, 124, 140, 156, 170, 186, 200, 214  // cases 8 - 15
 };
 
-static unsigned char ClipShapesTet[] = {
+unsigned char ClipShapesTet[] = {
  // Case #0: Unique case #1
   ST_TET, COLOR0, P0, P1, P2, P3,
  // Case #1: Unique case #2
@@ -8740,7 +8740,7 @@ const int StartClipShapesQua[16] = {
   116, 132, 144, 166, 182, 194, 210, 226  // cases 8 - 15
 };
 
-static unsigned char ClipShapesQua[] = {
+unsigned char ClipShapesQua[] = {
  // Case #0: Unique case #1
   ST_QUA, COLOR0, P0, P1, P2, P3,
  // Case #1: Unique case #2
@@ -8822,7 +8822,7 @@ const int StartClipShapesPix[16] = {
   116, 132, 154, 166, 182, 194, 210, 226  // cases 8 - 15
 };
 
-static unsigned char ClipShapesPix[] = {
+unsigned char ClipShapesPix[] = {
  // Case #0: Unique case #1
   ST_QUA, COLOR0, P0, P1, P3, P2,
  // Case #1: Unique case #2
@@ -8902,7 +8902,7 @@ const int StartClipShapesTri[8] = {
   0, 5, 16, 27, 38, 49, 60, 71  // cases 0 - 7
 };
 
-static unsigned char ClipShapesTri[] = {
+unsigned char ClipShapesTri[] = {
  // Case #0: Unique case #1
   ST_TRI, COLOR0, P0, P1, P2,
  // Case #1: Unique case #2
@@ -8944,7 +8944,7 @@ const int NumClipShapesLin[4] = {
 const int StartClipShapesLin[4] = {
   0, 4, 12, 20  };
 
-static unsigned char ClipShapesLin[] = {
+unsigned char ClipShapesLin[] = {
  // Case #0: Unique case #1
   ST_LIN, COLOR0, P0, P1,
  // Case #1: Unique case #2
@@ -8974,7 +8974,7 @@ const int NumClipShapesVtx[2] = {
 const int StartClipShapesVtx[2] = {
   0, 3  };
 
-static unsigned char ClipShapesVtx[] = {
+unsigned char ClipShapesVtx[] = {
  // Case #0: Unique case #1
   ST_VTX, COLOR0, P0,
  // Case #1: Unique case #2
diff --git a/Filters/General/vtkTemporalStatistics.cxx b/Filters/General/vtkTemporalStatistics.cxx
index cc34d89..c7384d0 100644
--- a/Filters/General/vtkTemporalStatistics.cxx
+++ b/Filters/General/vtkTemporalStatistics.cxx
@@ -356,8 +356,9 @@ void vtkTemporalStatistics::InitializeStatistics(vtkCompositeDataSet *input,
     vtkSmartPointer<vtkDataObject> outputObj;
     outputObj.TakeReference(inputObj->NewInstance());
 
-    this->InitializeStatistics(inputObj, outputObj);
     output->SetDataSet(inputItr, outputObj);
+
+    this->InitializeStatistics(inputObj, outputObj);
     }
 }
 
diff --git a/Filters/General/vtkTessellatorFilter.cxx b/Filters/General/vtkTessellatorFilter.cxx
index e72c2df..75f8a59 100644
--- a/Filters/General/vtkTessellatorFilter.cxx
+++ b/Filters/General/vtkTessellatorFilter.cxx
@@ -1134,23 +1134,21 @@ int vtkTessellatorFilter::RequestData(
       this->Subdivider->SetCellId( cell );
       vtkCell* cp = this->Subdivider->GetCell(); // We set the cell ID, get the vtkCell pointer
       int np = cp->GetCellType();
-      double* pcoord = cp->GetParametricCoords();
       if (
-        !pcoord ||
         np == VTK_POLYGON || np == VTK_TRIANGLE_STRIP || np == VTK_CONVEX_POINT_SET ||
-        np == VTK_POLY_LINE || np == VTK_POLY_VERTEX || np == VTK_POLYHEDRON ||
-        np == VTK_QUADRATIC_POLYGON)
+        np == VTK_POLY_LINE || np == VTK_POLY_VERTEX || np == VTK_POLYHEDRON )
         {
         if ( ! vtkTessellatorHasPolys )
           {
           vtkWarningMacro(
             "Input dataset has cells without parameterizations "
-            "(VTK_POLYGON,VTK_POLY_LINE,VTK_POLY_VERTEX,VTK_TRIANGLE_STRIP,VTK_CONVEX_POINT_SET,VTK_QUADRATIC_POLYGON). "
+            "(VTK_POLYGON,VTK_POLY_LINE,VTK_POLY_VERTEX,VTK_TRIANGLE_STRIP,VTK_CONVEX_POINT_SET). "
             "They will be ignored. Use vtkTriangleFilter, vtkTetrahedralize, etc. to parameterize them first." );
           vtkTessellatorHasPolys = 1;
           }
         continue;
         }
+      double* pcoord = cp->GetParametricCoords();
       double* gcoord;
       vtkDataArray* field;
       for ( p = 0; p < cp->GetNumberOfPoints(); ++p )
@@ -1349,7 +1347,7 @@ int vtkTessellatorFilter::RequestData(
           cp->EvaluateLocation( dummySubId, pts[p] + 3, pts[p], weights );
           this->Subdivider->EvaluateFields( pts[p], weights, 6 );
           }
-        VTK_FALLTHROUGH;
+        // fall through
       case VTK_QUADRATIC_HEXAHEDRON:
         for ( p = 20; p < 27; ++p )
           {
diff --git a/Filters/Generic/module.cmake b/Filters/Generic/module.cmake
index e60592e..c541d08 100644
--- a/Filters/Generic/module.cmake
+++ b/Filters/Generic/module.cmake
@@ -8,6 +8,7 @@ vtk_module(vtkFiltersGeneric
     vtkIOXML
     vtkIOLegacy
     vtkRendering${VTK_RENDERING_BACKEND}
+    vtkRenderingFreeType${VTK_RENDERING_BACKEND}
     vtkFiltersModeling
     vtkRenderingLabel
     vtkTestingRendering
diff --git a/Filters/Generic/vtkGenericGlyph3DFilter.cxx b/Filters/Generic/vtkGenericGlyph3DFilter.cxx
index 4a29b86..1f9d847 100644
--- a/Filters/Generic/vtkGenericGlyph3DFilter.cxx
+++ b/Filters/Generic/vtkGenericGlyph3DFilter.cxx
@@ -101,6 +101,7 @@ int vtkGenericGlyph3DFilter::RequestData(
   vtkGenericAttribute *inNormals=0;
   //  vtkGenericAttribute *sourceNormals=0;
 
+  int requestedGhostLevel=0;
   unsigned char* inGhostLevels=0;
 
   vtkIdType numPts, numSourcePts, numSourceCells, inPtId, i;
@@ -215,7 +216,7 @@ int vtkGenericGlyph3DFilter::RequestData(
   vtkDataArray* temp = 0;
   if (pd)
     {
-    temp = pd->GetArray(vtkDataSetAttributes::GhostArrayName());
+    temp = pd->GetArray("vtkGhostLevels");
     }
   if ( (!temp) || (temp->GetDataType() != VTK_UNSIGNED_CHAR)
        || (temp->GetNumberOfComponents() != 1))
@@ -226,6 +227,8 @@ int vtkGenericGlyph3DFilter::RequestData(
     {
     inGhostLevels = ((vtkUnsignedCharArray*)temp)->GetPointer(0);
     }
+
+  requestedGhostLevel = output->GetUpdateGhostLevel();
 #endif
 
   numPts = input->GetNumberOfPoints();
@@ -515,9 +518,13 @@ int vtkGenericGlyph3DFilter::RequestData(
 
     // Check ghost points.
     // If we are processing a piece, we do not want to duplicate
-    // glyphs on the borders.
-    if (inGhostLevels &&
-        inGhostLevels[inPtId] & vtkDataSetAttributes::DUPLICATEPOINT)
+    // glyphs on the borders.  The corrct check here is:
+    // ghostLevel > 0.  I am leaving this over glyphing here because
+    // it make a nice example (sphereGhost.tcl) to show the
+    // point ghost levels with the glyph filter.  I am not certain
+    // of the usefulness of point ghost levels over 1, but I will have
+    // to think about it.
+    if (inGhostLevels && inGhostLevels[inPtId] > requestedGhostLevel)
       {
       continue;
       }
diff --git a/Filters/Geometry/Testing/Cxx/CMakeLists.txt b/Filters/Geometry/Testing/Cxx/CMakeLists.txt
index 813cc13..7d34030 100644
--- a/Filters/Geometry/Testing/Cxx/CMakeLists.txt
+++ b/Filters/Geometry/Testing/Cxx/CMakeLists.txt
@@ -1,6 +1,5 @@
 vtk_add_test_cxx(${vtk-module}CxxTests tests
   TestExtractSurfaceNonLinearSubdivision.cxx
-  TestDataSetSurfaceFieldData.cxx,NO_VALID
   TestImageDataToUniformGrid.cxx,NO_VALID
   TestProjectSphereFilter.cxx,NO_VALID
   TestStructuredAMRNeighbor.cxx,NO_VALID
diff --git a/Filters/Geometry/Testing/Cxx/TestDataSetSurfaceFieldData.cxx b/Filters/Geometry/Testing/Cxx/TestDataSetSurfaceFieldData.cxx
deleted file mode 100644
index 516934d..0000000
--- a/Filters/Geometry/Testing/Cxx/TestDataSetSurfaceFieldData.cxx
+++ /dev/null
@@ -1,193 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    TestDataSetSurfaceMultiBlockFieldData.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 <cstdio>
-
-#include <vtkDataSetSurfaceFilter.h>
-#include <vtkFieldData.h>
-#include <vtkFloatArray.h>
-#include <vtkImageData.h>
-#include <vtkIntArray.h>
-#include <vtkNew.h>
-#include <vtkPointData.h>
-#include <vtkPolyData.h>
-#include <vtkStructuredGrid.h>
-#include <vtkUnstructuredGrid.h>
-
-// Test to ensure that field data is copied for different data types in vtkDataSetSurface
-
-namespace
-{
-
-//----------------------------------------------------------------------------
-int TestDataSet(vtkDataSet* ds, int expectedValue)
-{
-  vtkNew<vtkDataSetSurfaceFilter> surfacer;
-  surfacer->SetInputData(ds);
-  surfacer->Update();
-  if (!surfacer->GetOutput())
-    {
-    std::cout << "No output!\n";
-    return EXIT_FAILURE;
-    }
-
-  vtkFieldData* fieldData = surfacer->GetOutput()->GetFieldData();
-  const char* className = ds->GetClassName();
-  if (fieldData == NULL || fieldData->GetNumberOfArrays() == 0)
-    {
-    std::cerr << "No field data was associated with data set type " << className << "\n";
-    return EXIT_FAILURE;
-    }
-  else
-    {
-    std::cout << "Have field data for surface from data set type " << className << "\n";
-
-    vtkIntArray* array = vtkIntArray::SafeDownCast(fieldData->GetArray(0));
-    if (!array)
-      {
-      std::cerr << "Field data array was not of type vtkIntArray for data set type"
-                << className << "\n";
-      return EXIT_FAILURE;
-      }
-    else if (array->GetNumberOfTuples() < 1)
-      {
-      std::cerr << "No tuples in field data array for surface from data set type "
-                << className << "\n";
-      return EXIT_FAILURE;
-      }
-    else
-      {
-      int value = 0;
-      array->GetTupleValue(0, &value);
-
-      std::cout << "Block value " << value << "\n";
-      if (value != expectedValue)
-        {
-        std::cerr << "Unexpected block field array value " << value
-                  << " for surface from data set type " << className
-                  << ". Expected " << expectedValue << "\n";
-        return EXIT_FAILURE;
-        }
-      }
-    }
-
-  return EXIT_SUCCESS;
-}
-
-//----------------------------------------------------------------------------
-void AddFieldData(vtkDataSet* ds, int id)
-{
-  vtkNew<vtkIntArray> array;
-  array->SetName("ID");
-  array->SetNumberOfComponents(1);
-  array->SetNumberOfTuples(1);
-  array->SetTupleValue(0, &id);
-
-  ds->GetFieldData()->AddArray(array.GetPointer());
-}
-
-//----------------------------------------------------------------------------
-int TestImageData()
-{
- // Create image data
-  vtkNew<vtkImageData> imageData;
-  imageData->Initialize();
-  imageData->SetSpacing(1, 1, 1);
-  imageData->SetOrigin(0, 0, 0);
-  imageData->SetDimensions(10, 10, 10);
-
-  int id = 1;
-  AddFieldData(imageData.GetPointer(), id);
-
-  // Add point data
-  vtkNew<vtkFloatArray> pa;
-  pa->SetName("pd");
-  pa->SetNumberOfComponents(1);
-  pa->SetNumberOfTuples(10 * 10 * 10);
-
-  imageData->GetPointData()->AddArray(pa.GetPointer());
-
-  return TestDataSet(imageData.GetPointer(), id);
-}
-
-//----------------------------------------------------------------------------
-int TestPolyData()
-{
-  // Create polydata
-  vtkNew<vtkPolyData> polyData;
-  polyData->Initialize();
-
-  int id = 2;
-  AddFieldData(polyData.GetPointer(), id);
-
-  return TestDataSet(polyData.GetPointer(), id);
-}
-
-//----------------------------------------------------------------------------
-int TestStructuredGrid()
-{
-  // Create structured grid data
-  vtkNew<vtkStructuredGrid> structuredGrid;
-  structuredGrid->Initialize();
-
-  int id = 3;
-  AddFieldData(structuredGrid.GetPointer(), id);
-
-  return TestDataSet(structuredGrid.GetPointer(), id);
-}
-
-//----------------------------------------------------------------------------
-int TestUnstructuredGrid()
-{
-  // Create unstructured grid data
-  vtkNew<vtkUnstructuredGrid> unstructuredGrid;
-  unstructuredGrid->Initialize();
-
-  int id = 4;
-  AddFieldData(unstructuredGrid.GetPointer(), id);
-
-  return TestDataSet(unstructuredGrid.GetPointer(), id);
-}
-
-} // end anonymous namespace
-
-//----------------------------------------------------------------------------
-int TestDataSetSurfaceFieldData(int vtkNotUsed(argc), char* vtkNotUsed(argv)[])
-{
-  if (TestImageData() != EXIT_SUCCESS)
-    {
-    std::cerr << "TestImageData failed\n";
-    return EXIT_FAILURE;
-    }
-
-  if (TestPolyData() != EXIT_SUCCESS)
-    {
-    std::cerr << "TestPolyData failed\n";
-    return EXIT_FAILURE;
-    }
-
-  if (TestStructuredGrid() != EXIT_SUCCESS)
-    {
-    std::cerr << "TestStructuredGrid failed\n";
-    return EXIT_FAILURE;
-    }
-
-  if (TestUnstructuredGrid() != EXIT_SUCCESS)
-    {
-    std::cerr << "TestUnstructuredGrid failed\n";
-    return EXIT_FAILURE;
-    }
-
-  return EXIT_SUCCESS;
-}
diff --git a/Filters/Geometry/Testing/Cxx/TestStructuredAMRGridConnectivity.cxx b/Filters/Geometry/Testing/Cxx/TestStructuredAMRGridConnectivity.cxx
index 3d1b7fe..ac45004 100644
--- a/Filters/Geometry/Testing/Cxx/TestStructuredAMRGridConnectivity.cxx
+++ b/Filters/Geometry/Testing/Cxx/TestStructuredAMRGridConnectivity.cxx
@@ -21,6 +21,7 @@
 #include "vtkAMRInformation.h"
 #include "vtkCell.h"
 #include "vtkDoubleArray.h"
+#include "vtkGhostArray.h"
 #include "vtkIntArray.h"
 #include "vtkOverlappingAMR.h"
 #include "vtkStructuredAMRGridConnectivity.h"
@@ -172,6 +173,56 @@ void WriteAMR(vtkOverlappingAMR *amr, std::string prefix)
 }
 
 //------------------------------------------------------------------------------
+void AttachCellBlanking(vtkOverlappingAMR *amr)
+{
+  assert("pre: input amr dataset is NULL" && (amr != NULL) );
+
+  unsigned int levelIdx = 0;
+  for( ;levelIdx < amr->GetNumberOfLevels(); ++levelIdx )
+    {
+    unsigned int dataIdx = 0;
+    for( ;dataIdx < amr->GetNumberOfDataSets(levelIdx); ++dataIdx)
+      {
+      vtkUniformGrid *grid = amr->GetDataSet(levelIdx,dataIdx);
+      if( grid != NULL )
+        {
+        vtkIdType numCells = grid->GetNumberOfCells();
+
+        vtkUnsignedCharArray *ghostArray = grid->GetCellVisibilityArray();
+        assert("pre: cell visibility is NULL" && (ghostArray != NULL) );
+        unsigned char *ghostptr = ghostArray->GetPointer(0);
+        assert("pre: ghostptr is NULL!" && (ghostptr != NULL) );
+
+        vtkIntArray *blanking = vtkIntArray::New();
+        blanking->SetName( "BLANKING" );
+        blanking->SetNumberOfComponents(1);
+        blanking->SetNumberOfTuples(numCells);
+
+        int *iblank = blanking->GetPointer(0);
+        assert("pre: iblank array pointer is NULL" && (iblank != NULL) );
+
+        for(vtkIdType cellIdx=0; cellIdx < numCells; ++cellIdx)
+          {
+          if(vtkGhostArray::IsPropertySet(
+              ghostptr[cellIdx],vtkGhostArray::BLANK))
+            {
+            iblank[cellIdx] = 0;
+            }
+          else
+            {
+            iblank[cellIdx] = 1;
+            }
+          } // END for all cells
+
+        grid->GetCellData()->AddArray( blanking );
+        blanking->Delete();
+        } // END if grid != NULL
+      } // END for all data
+    } // END for all levels
+
+}
+
+//------------------------------------------------------------------------------
 void ApplyXYZFieldToGrid( vtkUniformGrid *grd, std::string prefix )
 {
   assert( "pre: grd should not be NULL" && (grd != NULL)  );
@@ -430,8 +481,8 @@ void RegisterGrids(
         GetGridExtent(idx,dim,ratio,ext);
         gridConnectivity->RegisterGrid(
             idx,levelIdx,ext,
-            grid->GetPointGhostArray(),
-            grid->GetCellGhostArray(),
+            grid->GetPointVisibilityArray(),
+            grid->GetCellVisibilityArray(),
             grid->GetPointData(),
             grid->GetCellData(),
             NULL);
@@ -525,7 +576,11 @@ int Test2DAMR(const int ratio)
   amrGridConnectivity->ComputeNeighbors();
   amrGridConnectivity->Print( std::cout );
 
-  // STEP 3: Create ghost-layers
+  // STEP 3: Attach blank cell arrays
+  AttachCellBlanking(amr);
+  WriteAMR(amr,"AMR2D-BLANKED");
+
+  // STEP 4: Create ghost-layers
   std::cout << "Ghosting...\n";
   std::cout.flush();
   amrGridConnectivity->CreateGhostLayers( 1 );
@@ -533,12 +588,12 @@ int Test2DAMR(const int ratio)
   std::cout << "[DONE]\n";
   std::cout.flush();
 
-  // STEP 4: Get & Write ghosted grids
+  // STEP 5: Get & Write ghosted grids
   vtkOverlappingAMR *ghostedAMR = vtkOverlappingAMR::New();
   GetGhostedAMRData(amr,amrGridConnectivity,ghostedAMR);
   WriteAMR(ghostedAMR,"AMR2D-GHOSTED");
 
-  // STEP 5: De-allocate
+  // STEP 6: De-allocate
   amrGridConnectivity->Delete();
   amr->Delete();
   ghostedAMR->Delete();
@@ -570,7 +625,11 @@ int Test3DAMR(const int ratio)
   amrGridConnectivity->ComputeNeighbors();
   amrGridConnectivity->Print( std::cout );
 
-  // STEP 3: Create ghost-layers
+  // STEP 3: Attach blank cell arrays
+  AttachCellBlanking(amr);
+  WriteAMR(amr,"AMR3D-BLANKED");
+
+  // STEP 4: Create ghost-layers
   std::cout << "Ghosting...\n";
   std::cout.flush();
   amrGridConnectivity->CreateGhostLayers( 1 );
@@ -578,12 +637,12 @@ int Test3DAMR(const int ratio)
   std::cout << "[DONE]\n";
   std::cout.flush();
 
-  // STEP 4: Get & Write ghosted grids
+  // STEP 5: Get & Write ghosted grids
   vtkOverlappingAMR *ghostedAMR = vtkOverlappingAMR::New();
   GetGhostedAMRData(amr,amrGridConnectivity,ghostedAMR);
   WriteAMR(ghostedAMR,"AMR3D-GHOSTED");
 
-  // STEP 5: De-allocate
+  // STEP 6: De-allocate
   amrGridConnectivity->Delete();
   amr->Delete();
   ghostedAMR->Delete();
diff --git a/Filters/Geometry/Testing/Cxx/TestStructuredGridConnectivity.cxx b/Filters/Geometry/Testing/Cxx/TestStructuredGridConnectivity.cxx
index 06c53a4..e48360d 100644
--- a/Filters/Geometry/Testing/Cxx/TestStructuredGridConnectivity.cxx
+++ b/Filters/Geometry/Testing/Cxx/TestStructuredGridConnectivity.cxx
@@ -30,6 +30,7 @@
 #include "vtkStructuredNeighbor.h"
 #include "vtkUnsignedCharArray.h"
 #include "vtkIntArray.h"
+#include "vtkGhostArray.h"
 #include "vtkPointData.h"
 #include "vtkCellData.h"
 #include "vtkDoubleArray.h"
@@ -72,8 +73,8 @@ void AttachPointFlagsArray(
   for( ; pidx < grid->GetNumberOfPoints(); ++pidx )
     {
     unsigned char nodeProperty =
-         *(grid->GetPointGhostArray()->GetPointer( pidx ));
-    if( nodeProperty & flag )
+         *(grid->GetPointVisibilityArray()->GetPointer( pidx ));
+    if( vtkGhostArray::IsPropertySet(nodeProperty,flag) )
       {
       flags->SetValue( pidx, 1);
       }
@@ -106,8 +107,8 @@ void AttachCellFlagsArray(
   for( ; cellIdx < grid->GetNumberOfCells(); ++cellIdx )
     {
     unsigned char cellProperty =
-        *(grid->GetCellGhostArray()->GetPointer(cellIdx));
-    if( cellProperty & flag )
+        *(grid->GetCellVisibilityArray()->GetPointer(cellIdx));
+    if( vtkGhostArray::IsPropertySet(cellProperty,flag) )
       {
       flags->SetValue( cellIdx, 1 );
       }
@@ -135,12 +136,12 @@ void AttachNodeAndCellGhostFlags( vtkMultiBlockDataSet *mbds )
        vtkUniformGrid::SafeDownCast(mbds->GetBlock( block ) );
     if( myGrid != NULL )
       {
-      // original IGNORE
-      AttachPointFlagsArray( myGrid, vtkDataSetAttributes::DUPLICATEPOINT,
-                             "DUPLICATEPOINT" );
-      // original DUPLICATE
-      AttachCellFlagsArray( myGrid, vtkDataSetAttributes::DUPLICATECELL,
-                            "DUPLICATECELL" );
+      AttachPointFlagsArray( myGrid, vtkGhostArray::IGNORE, "IGNORE" );
+      AttachPointFlagsArray( myGrid, vtkGhostArray::SHARED, "SHARED" );
+      AttachPointFlagsArray( myGrid, vtkGhostArray::GHOST, "GHOST" );
+      AttachPointFlagsArray( myGrid, vtkGhostArray::BOUNDARY, "BOUNDARY" );
+      AttachCellFlagsArray( myGrid, vtkGhostArray::DUPLICATE, "DUPLICATE" );
+      AttachCellFlagsArray( myGrid, vtkGhostArray::INTERIOR, "INTERIOR" );
       }
    } // END for all blocks
 }
@@ -340,9 +341,9 @@ int GetTotalNumberOfNodes( vtkMultiBlockDataSet *multiblock )
       for( ; pntIdx < grid->GetNumberOfPoints(); ++pntIdx )
         {
         unsigned char nodeProperty =
-            *(grid->GetPointGhostArray()->GetPointer( pntIdx ));
-        if( ! (nodeProperty & (vtkDataSetAttributes::DUPLICATEPOINT |
-                               vtkDataSetAttributes::HIDDENPOINT)))
+            *(grid->GetPointVisibilityArray()->GetPointer( pntIdx ));
+        if( !vtkGhostArray::IsPropertySet(
+            nodeProperty,vtkGhostArray::IGNORE ) )
           {
           ++numNodes;
           }
@@ -374,9 +375,9 @@ int GetTotalNumberOfCells( vtkMultiBlockDataSet *multiblock )
       for( ; cellIdx < grid->GetNumberOfCells(); ++cellIdx )
         {
         unsigned char cellProperty =
-            *(grid->GetCellGhostArray()->GetPointer( cellIdx ) );
-        if( ! (cellProperty & vtkDataSetAttributes::DUPLICATECELL) )
-
+            *(grid->GetCellVisibilityArray()->GetPointer( cellIdx ) );
+        if( !vtkGhostArray::IsPropertySet(
+            cellProperty,vtkGhostArray::DUPLICATE) )
           {
           ++numCells;
           }
@@ -397,8 +398,6 @@ void RegisterGrids(
     {
     vtkUniformGrid *grid = vtkUniformGrid::SafeDownCast(mbds->GetBlock(block));
     assert( "pre: grid should not be NULL!" && (grid != NULL) );
-    grid->AllocatePointGhostArray();
-    grid->AllocateCellGhostArray();
 
     vtkInformation *info = mbds->GetMetaData( block );
     assert( "pre: metadata should not be NULL" && (info != NULL) );
@@ -407,8 +406,8 @@ void RegisterGrids(
 
     connectivity->RegisterGrid(
         block,info->Get(vtkDataObject::PIECE_EXTENT()),
-        grid->GetPointGhostArray(),
-        grid->GetCellGhostArray(),
+        grid->GetPointVisibilityArray(),
+        grid->GetCellVisibilityArray(),
         grid->GetPointData(),
         grid->GetCellData(),
         NULL);
@@ -501,12 +500,8 @@ vtkMultiBlockDataSet* GetGhostedDataSet(
         SGC->GetGhostedGridCellData(block) );
 
     // Copy the ghost arrays
-    vtkUnsignedCharArray* ghosts = SGC->GetGhostedPointGhostArray(block);
-    ghosts->SetName(vtkDataSetAttributes::GhostArrayName());
-    ghostedGrid->GetPointData()->AddArray(ghosts);
-    ghosts = SGC->GetGhostedCellGhostArray(block);
-    ghosts->SetName(vtkDataSetAttributes::GhostArrayName());
-    ghostedGrid->GetCellData()->AddArray(ghosts);
+    ghostedGrid->SetPointVisibilityArray(SGC->GetGhostedPointGhostArray(block));
+    ghostedGrid->SetCellVisibilityArray(SGC->GetGhostedCellGhostArray(block));
 
     output->SetBlock( block, ghostedGrid );
     ghostedGrid->Delete();
@@ -517,7 +512,7 @@ vtkMultiBlockDataSet* GetGhostedDataSet(
 
 //------------------------------------------------------------------------------
 bool Check(
-    std::string name, const int val, const int expected, bool verbose=true )
+    std::string name, const int val, const int expected, bool verbose=false )
 {
   bool status = false;
 
@@ -596,6 +591,9 @@ int TestStructuredGridConnectivity_internal( int argc, char *argv[] )
       if( !Check( "NODES", NumNodes, expected ) )
         {
         ++rc;
+        mbds->Delete();
+        gridConnectivity->Delete();
+        return( rc );
         }
 
       // STEP 6: Compute total number of cells & compare to expected
@@ -603,10 +601,6 @@ int TestStructuredGridConnectivity_internal( int argc, char *argv[] )
       if( !Check( "CELLS", NumCells, expectedCells ) )
         {
         ++rc;
-        }
-
-      if(rc != 0)
-        {
         mbds->Delete();
         gridConnectivity->Delete();
         return( rc );
@@ -621,21 +615,24 @@ int TestStructuredGridConnectivity_internal( int argc, char *argv[] )
       if( !Check( "GHOSTED_NODES", GhostedNumNodes, expected ) )
         {
         ++rc;
+        gmbds->Delete();
+        mbds->Delete();
+        gridConnectivity->Delete();
+        return( rc );
         }
       if( !Check( "GHOSTED_CELLS", GhostedNumCells, expectedCells ) )
         {
         ++rc;
+        gmbds->Delete();
+        mbds->Delete();
+        gridConnectivity->Delete();
+        return( rc );
         }
 
       // STEP 9: De-allocated data-structures
       gmbds->Delete();
       mbds->Delete();
       gridConnectivity->Delete();
-
-      if(rc != 0)
-        {
-        return rc;
-        }
       }// END for all ghost layer tests
     } // END for all numPartition tests
 
diff --git a/Filters/Geometry/Testing/Cxx/TestUniformGridGhostDataGenerator.cxx b/Filters/Geometry/Testing/Cxx/TestUniformGridGhostDataGenerator.cxx
index d34cb59..2dc7786 100644
--- a/Filters/Geometry/Testing/Cxx/TestUniformGridGhostDataGenerator.cxx
+++ b/Filters/Geometry/Testing/Cxx/TestUniformGridGhostDataGenerator.cxx
@@ -38,6 +38,7 @@
 #include "vtkXMLImageDataWriter.h"
 #include "vtkUnsignedCharArray.h"
 #include "vtkIntArray.h"
+#include "vtkGhostArray.h"
 #include "vtkPointData.h"
 #include "vtkCellData.h"
 #include "vtkDoubleArray.h"
diff --git a/Filters/Geometry/Testing/Python/TestGhostPoints.py b/Filters/Geometry/Testing/Python/TestGhostPoints.py
index 0dcc14d..4bb0bd9 100644
--- a/Filters/Geometry/Testing/Python/TestGhostPoints.py
+++ b/Filters/Geometry/Testing/Python/TestGhostPoints.py
@@ -18,7 +18,7 @@ class TestGhostPoints(Testing.vtkTest):
             ptIds.SetId(i, i)
 
         ghosts = vtk.vtkUnsignedCharArray()
-        ghosts.SetName(vtk.vtkDataSetAttributes.GhostArrayName())
+        ghosts.SetName("vtkGhostLevels")
         ghosts.SetNumberOfTuples(4)
         ghosts.SetValue(0, 1)
         ghosts.SetValue(1, 1)
@@ -56,7 +56,7 @@ class TestGhostPoints(Testing.vtkTest):
             ptIds.SetId(i, i)
 
         ghosts = vtk.vtkUnsignedCharArray()
-        ghosts.SetName(vtk.vtkDataSetAttributes.GhostArrayName())
+        ghosts.SetName("vtkGhostLevels")
         ghosts.SetNumberOfTuples(10)
         ghosts.SetValue(0, 1)
         ghosts.SetValue(1, 1)
diff --git a/Filters/Geometry/vtkDataSetSurfaceFilter.cxx b/Filters/Geometry/vtkDataSetSurfaceFilter.cxx
index ad8f2f2..be960a1 100644
--- a/Filters/Geometry/vtkDataSetSurfaceFilter.cxx
+++ b/Filters/Geometry/vtkDataSetSurfaceFilter.cxx
@@ -192,7 +192,9 @@ int vtkDataSetSurfaceFilter::RequestData(
     case  VTK_UNSTRUCTURED_GRID:
     case  VTK_UNSTRUCTURED_GRID_BASE:
       {
-      if (!this->UnstructuredGridExecute(input, output))
+      if (!this->UnstructuredGridExecute(
+            input, output, outInfo->Get(
+              vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_GHOST_LEVELS())))
         {
         return 1;
         }
@@ -211,7 +213,7 @@ int vtkDataSetSurfaceFilter::RequestData(
     case VTK_STRUCTURED_GRID:
       {
       vtkStructuredGrid *grid = vtkStructuredGrid::SafeDownCast(input);
-      if (grid->HasAnyBlankCells())
+      if (grid->GetCellBlanking())
         {
         return this->DataSetExecute(grid, output);
         }
@@ -517,8 +519,14 @@ int vtkDataSetSurfaceFilter::StructuredExecute(vtkDataSet *input,
       break;
       }
     case VTK_UNIFORM_GRID:
+      {
+      // same as vtk_image_data
+      }
     case VTK_STRUCTURED_POINTS:
-    case VTK_IMAGE_DATA:
+      {
+      // same as vtk_image_data
+      }
+     case VTK_IMAGE_DATA:
       {
       dataType = VTK_DOUBLE;
       break;
@@ -526,7 +534,6 @@ int vtkDataSetSurfaceFilter::StructuredExecute(vtkDataSet *input,
     default:
       dataType = VTK_DOUBLE;
       vtkWarningMacro("Invalid data set type.");
-      break;
     }
 
   outPoints->SetDataType(dataType);
@@ -1090,7 +1097,7 @@ int vtkDataSetSurfaceFilter::DataSetExecute(vtkDataSet *input,
     }
 
   vtkStructuredGrid *sgridInput = vtkStructuredGrid::SafeDownCast(input);
-  bool mayBlank = sgridInput && sgridInput->HasAnyBlankCells();
+  bool mayBlank = sgridInput && sgridInput->GetCellBlanking();
 
   cellIds = vtkIdList::New();
   pts = vtkIdList::New();
@@ -1301,7 +1308,8 @@ void vtkDataSetSurfaceFilter::PrintSelf(ostream& os, vtkIndent indent)
 
 //----------------------------------------------------------------------------
 int vtkDataSetSurfaceFilter::UnstructuredGridExecute(vtkDataSet *dataSetInput,
-                                                     vtkPolyData *output)
+                                                     vtkPolyData *output,
+                                                     int updateGhostLevel)
 {
   vtkUnstructuredGridBase *input =
       vtkUnstructuredGridBase::SafeDownCast(dataSetInput);
@@ -1360,7 +1368,8 @@ int vtkDataSetSurfaceFilter::UnstructuredGridExecute(vtkDataSet *dataSetInput,
     cellIter = vtkSmartPointer<vtkCellIterator>::Take(input->NewCellIterator());
     }
 
-  vtkUnsignedCharArray* ghosts = input->GetPointGhostArray();
+  vtkUnsignedCharArray* ghosts = vtkUnsignedCharArray::SafeDownCast(
+    input->GetPointData()->GetArray("vtkGhostLevels"));
   vtkCellArray *newVerts;
   vtkCellArray *newLines;
   vtkCellArray *newPolys;
@@ -1591,7 +1600,6 @@ int vtkDataSetSurfaceFilter::UnstructuredGridExecute(vtkDataSet *dataSetInput,
       case VTK_QUADRATIC_QUAD:
       case VTK_QUADRATIC_LINEAR_QUAD:
       case VTK_BIQUADRATIC_QUAD:
-      case VTK_QUADRATIC_POLYGON:
         // save 2D cells for third pass
         flag2D = 1;
         break;
@@ -1799,8 +1807,7 @@ int vtkDataSetSurfaceFilter::UnstructuredGridExecute(vtkDataSet *dataSetInput,
            || cellType == VTK_BIQUADRATIC_TRIANGLE
            || cellType == VTK_QUADRATIC_QUAD
            || cellType == VTK_BIQUADRATIC_QUAD
-           || cellType == VTK_QUADRATIC_LINEAR_QUAD
-           || cellType == VTK_QUADRATIC_POLYGON)
+           || cellType == VTK_QUADRATIC_LINEAR_QUAD)
       {
       bool allGhosts = true;
       pointIdList = cellIter->GetPointIds();
@@ -1835,10 +1842,10 @@ int vtkDataSetSurfaceFilter::UnstructuredGridExecute(vtkDataSet *dataSetInput,
         outPts->InsertNextId(op);
         }
       // Do any further subdivision if necessary.
-        double *pc = cell->GetParametricCoords();
-      if (this->NonlinearSubdivisionLevel > 1 && pc)
+      if (this->NonlinearSubdivisionLevel > 1)
         {
         // We are going to need parametric coordinates to further subdivide.
+        double *pc = cell->GetParametricCoords();
         parametricCoords->Reset();
         parametricCoords->SetNumberOfComponents(3);
         for (i = 0; i < pts->GetNumberOfIds(); i++)
@@ -1991,6 +1998,10 @@ int vtkDataSetSurfaceFilter::UnstructuredGridExecute(vtkDataSet *dataSetInput,
     this->OriginalPointIds->Delete();
     this->OriginalPointIds = NULL;
     }
+  if (this->PieceInvariant)
+    {
+    output->RemoveGhostCells(updateGhostLevel+1);
+    }
 
   this->DeleteQuadHash();
 
diff --git a/Filters/Geometry/vtkDataSetSurfaceFilter.h b/Filters/Geometry/vtkDataSetSurfaceFilter.h
index 4b77569..60229ae 100644
--- a/Filters/Geometry/vtkDataSetSurfaceFilter.h
+++ b/Filters/Geometry/vtkDataSetSurfaceFilter.h
@@ -131,7 +131,8 @@ public:
     }
 #endif
   virtual int UnstructuredGridExecute(vtkDataSet *input,
-                                      vtkPolyData *output);
+                                      vtkPolyData *output,
+                                      int updateghostlevel);
   virtual int DataSetExecute(vtkDataSet *input, vtkPolyData *output);
   virtual int UniformGridExecute(
       vtkDataSet *input, vtkPolyData *output,
diff --git a/Filters/Geometry/vtkGeometryFilter.cxx b/Filters/Geometry/vtkGeometryFilter.cxx
index eb353a4..b8e94d2 100644
--- a/Filters/Geometry/vtkGeometryFilter.cxx
+++ b/Filters/Geometry/vtkGeometryFilter.cxx
@@ -36,7 +36,6 @@
 #include "vtkWedge.h"
 #include "vtkIncrementalPointLocator.h"
 
-
 vtkStandardNewMacro(vtkGeometryFilter);
 vtkCxxSetObjectMacro(vtkGeometryFilter, Locator, vtkIncrementalPointLocator)
 
@@ -147,7 +146,12 @@ int vtkGeometryFilter::RequestData(
   int allVisible;
   vtkPointData *outputPD = output->GetPointData();
   vtkCellData *outputCD = output->GetCellData();
-  unsigned char  *cellGhosts = NULL;
+  // ghost cell stuff
+  unsigned char  updateLevel =
+    static_cast<unsigned char>(
+      outInfo->Get(
+        vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_GHOST_LEVELS()));
+  unsigned char  *cellGhostLevels = NULL;
 
   if (numCells == 0)
     {
@@ -157,10 +161,10 @@ int vtkGeometryFilter::RequestData(
   switch (input->GetDataObjectType())
     {
     case  VTK_POLY_DATA:
-      this->PolyDataExecute(input, output);
+      this->PolyDataExecute(input, output, outInfo);
       return 1;
     case  VTK_UNSTRUCTURED_GRID:
-      this->UnstructuredGridExecute(input, output);
+      this->UnstructuredGridExecute(input, output, outInfo);
       return 1;
     case VTK_STRUCTURED_GRID:
       this->StructuredGridExecute(input, output, outInfo);
@@ -170,7 +174,7 @@ int vtkGeometryFilter::RequestData(
   vtkDataArray* temp = 0;
   if (cd)
     {
-    temp = cd->GetArray(vtkDataSetAttributes::GhostArrayName());
+    temp = cd->GetArray("vtkGhostLevels");
     }
   if ( (!temp) || (temp->GetDataType() != VTK_UNSIGNED_CHAR)
     || (temp->GetNumberOfComponents() != 1))
@@ -179,7 +183,7 @@ int vtkGeometryFilter::RequestData(
     }
   else
     {
-      cellGhosts=static_cast<vtkUnsignedCharArray *>(temp)->GetPointer(0);
+      cellGhostLevels=static_cast<vtkUnsignedCharArray *>(temp)->GetPointer(0);
     }
 
   cellIds = vtkIdList::New();
@@ -274,8 +278,7 @@ int vtkGeometryFilter::RequestData(
       }
 
     // Handle ghost cells here.  Another option was used cellVis array.
-    if (cellGhosts &&
-        cellGhosts[cellId] & vtkDataSetAttributes::DUPLICATECELL)
+    if (cellGhostLevels && cellGhostLevels[cellId] > updateLevel)
       { // Do not create surfaces in outer ghost cells.
       continue;
       }
@@ -438,7 +441,8 @@ unsigned long int vtkGeometryFilter::GetMTime()
 
 //----------------------------------------------------------------------------
 void vtkGeometryFilter::PolyDataExecute(vtkDataSet *dataSetInput,
-                                        vtkPolyData *output)
+                                        vtkPolyData *output,
+                                        vtkInformation *outInfo)
 {
   vtkPolyData *input=static_cast<vtkPolyData *>(dataSetInput);
   vtkIdType cellId;
@@ -455,14 +459,18 @@ void vtkGeometryFilter::PolyDataExecute(vtkDataSet *dataSetInput,
   vtkIdType newCellId, ptId;
   int visible, type;
   double x[3];
-  unsigned char *cellGhosts = 0;
+  // ghost cell stuff
+  unsigned char updateLevel =static_cast<unsigned char>
+    (outInfo->Get(
+      vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_GHOST_LEVELS()));
+  unsigned char *cellGhostLevels = 0;
 
   vtkDebugMacro(<<"Executing geometry filter for poly data input");
 
   vtkDataArray* temp = 0;
   if (cd)
     {
-    temp = cd->GetArray(vtkDataSetAttributes::GhostArrayName());
+    temp = cd->GetArray("vtkGhostLevels");
     }
   if ( (!temp) || (temp->GetDataType() != VTK_UNSIGNED_CHAR)
     || (temp->GetNumberOfComponents() != 1))
@@ -471,7 +479,7 @@ void vtkGeometryFilter::PolyDataExecute(vtkDataSet *dataSetInput,
     }
   else
     {
-      cellGhosts=static_cast<vtkUnsignedCharArray *>(temp)->GetPointer(0);
+      cellGhostLevels=static_cast<vtkUnsignedCharArray *>(temp)->GetPointer(0);
     }
 
   if ( (!this->CellClipping) && (!this->PointClipping) &&
@@ -513,8 +521,7 @@ void vtkGeometryFilter::PolyDataExecute(vtkDataSet *dataSetInput,
       }
 
     // Handle ghost cells here.  Another option was used cellVis array.
-    if (cellGhosts &&
-        cellGhosts[cellId] & vtkDataSetAttributes::DUPLICATECELL)
+    if (cellGhostLevels && cellGhostLevels[cellId] > updateLevel)
       { // Do not create surfaces in outer ghost cells.
       continue;
       }
@@ -568,7 +575,8 @@ void vtkGeometryFilter::PolyDataExecute(vtkDataSet *dataSetInput,
 
 //----------------------------------------------------------------------------
 void vtkGeometryFilter::UnstructuredGridExecute(vtkDataSet *dataSetInput,
-                                                vtkPolyData *output)
+                                                vtkPolyData *output,
+                                                vtkInformation *outInfo)
 {
   vtkUnstructuredGrid *input=static_cast<vtkUnstructuredGrid *>(dataSetInput);
   vtkCellArray *connectivity = input->GetCells();
@@ -592,7 +600,11 @@ void vtkGeometryFilter::UnstructuredGridExecute(vtkDataSet *dataSetInput,
   int faceId, *faceVerts, numFacePts;
   double x[3];
   int pixelConvert[4];
-  unsigned char  *cellGhosts = 0;
+  // ghost cell stuff
+  unsigned char  updateLevel = static_cast<unsigned char>
+    (outInfo->Get(
+      vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_GHOST_LEVELS()));
+  unsigned char  *cellGhostLevels = 0;
 
   pixelConvert[0] = 0;
   pixelConvert[1] = 1;
@@ -604,7 +616,7 @@ void vtkGeometryFilter::UnstructuredGridExecute(vtkDataSet *dataSetInput,
   vtkDataArray* temp = 0;
   if (cd)
     {
-    temp = cd->GetArray(vtkDataSetAttributes::GhostArrayName());
+    temp = cd->GetArray("vtkGhostLevels");
     }
   if ( (!temp) || (temp->GetDataType() != VTK_UNSIGNED_CHAR)
     || (temp->GetNumberOfComponents() != 1))
@@ -613,7 +625,7 @@ void vtkGeometryFilter::UnstructuredGridExecute(vtkDataSet *dataSetInput,
     }
   else
     {
-    cellGhosts=static_cast<vtkUnsignedCharArray *>(temp)->GetPointer(0);
+    cellGhostLevels=static_cast<vtkUnsignedCharArray *>(temp)->GetPointer(0);
     }
 
   // Check input
@@ -714,8 +726,7 @@ void vtkGeometryFilter::UnstructuredGridExecute(vtkDataSet *dataSetInput,
       }
 
     // Handle ghost cells here.  Another option was used cellVis array.
-    if (cellGhosts &&
-        cellGhosts[cellId] & vtkDataSetAttributes::DUPLICATECELL)
+    if (cellGhostLevels && cellGhostLevels[cellId] > updateLevel)
       { // Do not create surfaces in outer ghost cells.
       continue;
       }
@@ -1076,7 +1087,7 @@ void vtkGeometryFilter::UnstructuredGridExecute(vtkDataSet *dataSetInput,
 //----------------------------------------------------------------------------
 void vtkGeometryFilter::StructuredGridExecute(vtkDataSet *dataSetInput,
                                               vtkPolyData *output,
-                                              vtkInformation *)
+                                              vtkInformation *outInfo)
 {
   vtkIdType cellId, newCellId;
   int i;
@@ -1097,7 +1108,11 @@ void vtkGeometryFilter::StructuredGridExecute(vtkDataSet *dataSetInput,
   vtkPointData *outputPD = output->GetPointData();
   vtkCellData *outputCD = output->GetCellData();
   vtkCellArray *cells;
-  unsigned char  *cellGhosts = 0;
+  // ghost cell stuff
+  unsigned char  updateLevel =static_cast<unsigned char>
+    (outInfo->Get(
+      vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_GHOST_LEVELS()));
+  unsigned char  *cellGhostLevels = 0;
 
   cellIds = vtkIdList::New();
   pts = vtkIdList::New();
@@ -1109,7 +1124,7 @@ void vtkGeometryFilter::StructuredGridExecute(vtkDataSet *dataSetInput,
   vtkDataArray* temp = 0;
   if (cd)
     {
-    temp = cd->GetArray(vtkDataSetAttributes::GhostArrayName());
+    temp = cd->GetArray("vtkGhostLevels");
     }
   if ( (!temp) || (temp->GetDataType() != VTK_UNSIGNED_CHAR)
     || (temp->GetNumberOfComponents() != 1))
@@ -1118,7 +1133,7 @@ void vtkGeometryFilter::StructuredGridExecute(vtkDataSet *dataSetInput,
     }
   else
     {
-    cellGhosts =static_cast<vtkUnsignedCharArray *>(temp)->GetPointer(0);
+    cellGhostLevels =static_cast<vtkUnsignedCharArray *>(temp)->GetPointer(0);
     }
 
   if ( (!this->CellClipping) && (!this->PointClipping) &&
@@ -1191,8 +1206,7 @@ void vtkGeometryFilter::StructuredGridExecute(vtkDataSet *dataSetInput,
       }
 
     // Handle ghost cells here.  Another option was used cellVis array.
-    if (cellGhosts &&
-        cellGhosts[cellId] & vtkDataSetAttributes::DUPLICATECELL)
+    if (cellGhostLevels && cellGhostLevels[cellId] > updateLevel)
       { // Do not create surfaces in outer ghost cells.
       continue;
       }
diff --git a/Filters/Geometry/vtkGeometryFilter.h b/Filters/Geometry/vtkGeometryFilter.h
index 6e1c939..6016c7c 100644
--- a/Filters/Geometry/vtkGeometryFilter.h
+++ b/Filters/Geometry/vtkGeometryFilter.h
@@ -139,8 +139,8 @@ protected:
   virtual int FillInputPortInformation(int port, vtkInformation *info);
 
   //special cases for performance
-  void PolyDataExecute(vtkDataSet *, vtkPolyData *);
-  void UnstructuredGridExecute(vtkDataSet *, vtkPolyData *);
+  void PolyDataExecute(vtkDataSet *, vtkPolyData *, vtkInformation *);
+  void UnstructuredGridExecute(vtkDataSet *, vtkPolyData *, vtkInformation *);
   void StructuredGridExecute(vtkDataSet *, vtkPolyData *, vtkInformation *);
   int RequestUpdateExtent(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
 
diff --git a/Filters/Geometry/vtkImageDataToUniformGrid.cxx b/Filters/Geometry/vtkImageDataToUniformGrid.cxx
index 2e97800..93279d8 100644
--- a/Filters/Geometry/vtkImageDataToUniformGrid.cxx
+++ b/Filters/Geometry/vtkImageDataToUniformGrid.cxx
@@ -218,50 +218,23 @@ int vtkImageDataToUniformGrid::Process(
 
   vtkNew<vtkUnsignedCharArray> blankingArray;
   blankingArray->DeepCopy(inScalars);
-  blankingArray->SetName(vtkDataSetAttributes::GhostArrayName());
 
-
-  unsigned char value1;
-  unsigned char value2;
-  if (association == vtkDataObject::FIELD_ASSOCIATION_CELLS)
-    {
-    if (this->Reverse)
-      {
-      value1 = 0;
-      value2 = vtkDataSetAttributes::HIDDENCELL;
-      }
-    else
-      {
-      value1 = vtkDataSetAttributes::HIDDENCELL;
-      value2 = 0;
-      }
-    }
-  else
+  if(this->Reverse)
     {
-    if (this->Reverse)
+    for(vtkIdType i=0;i<blankingArray->GetNumberOfTuples();i++)
       {
-      value1 = 0;
-      value2 = vtkDataSetAttributes::HIDDENPOINT;
+      char value = blankingArray->GetValue(i) == 0 ? 1 : 0;
+      blankingArray->SetValue(i, value);
       }
-    else
-      {
-      value1 = vtkDataSetAttributes::HIDDENPOINT;
-      value2 = 0;
-      }
-    }
-  for(vtkIdType i=0;i<blankingArray->GetNumberOfTuples();i++)
-    {
-    char value = blankingArray->GetValue(i) == 0 ? value1 : value2;
-    blankingArray->SetValue(i, value);
     }
 
   if(association == vtkDataObject::FIELD_ASSOCIATION_POINTS)
     {
-    output->GetPointData()->AddArray(blankingArray.GetPointer());
+    output->SetPointVisibilityArray(blankingArray.GetPointer());
     }
   else
     {
-    output->GetCellData()->AddArray(blankingArray.GetPointer());
+    output->SetCellVisibilityArray(blankingArray.GetPointer());
     }
 
   return VTK_OK;
diff --git a/Filters/Geometry/vtkStructuredAMRGridConnectivity.cxx b/Filters/Geometry/vtkStructuredAMRGridConnectivity.cxx
index 60cf689..10d0221 100644
--- a/Filters/Geometry/vtkStructuredAMRGridConnectivity.cxx
+++ b/Filters/Geometry/vtkStructuredAMRGridConnectivity.cxx
@@ -15,6 +15,7 @@
 #include "vtkStructuredAMRGridConnectivity.h"
 
 // VTK Includes
+#include "vtkGhostArray.h"
 #include "vtkObjectFactory.h"
 #include "vtkStructuredData.h"
 #include "vtkStructuredGridConnectivity.h"
@@ -212,11 +213,6 @@ void vtkStructuredAMRGridConnectivity::Initialize(
 void vtkStructuredAMRGridConnectivity::SetNumberOfGrids(
     const unsigned int N )
 {
-  if (N == 0)
-    {
-    vtkErrorMacro("Number of grids cannot be 0.");
-    return;
-    }
   this->NumberOfGrids = N;
   this->AllocateUserRegisterDataStructures();
 
@@ -1102,23 +1098,20 @@ void vtkStructuredAMRGridConnectivity::CreateGhostedMaskArrays(
           vtkIdType srcIdx =
              vtkStructuredData::ComputePointIdForExtent(
                  registeredGridExtent,ijk,this->DataDescription);
-          unsigned char p = 0;
-          if(this->GridPointGhostArrays[gridID])
-            {
-            p = this->GridPointGhostArrays[gridID]->GetValue(srcIdx);
-            }
-          this->GhostedPointGhostArray[ gridID ]->SetValue(pntIdx, p);
+          this->GhostedPointGhostArray[ gridID ]->SetValue(
+              pntIdx, this->GridPointGhostArrays[gridID]->GetValue(srcIdx) );
           } // END if node within the registered extent
         else
           {
           // The node is a ghost node
-          unsigned char p = 0;
-          p |= vtkDataSetAttributes::DUPLICATEPOINT;
+          unsigned char p = '0';
+          vtkGhostArray::Reset( p );
+          vtkGhostArray::SetProperty(p,vtkGhostArray::GHOST);
+          vtkGhostArray::SetProperty(p,vtkGhostArray::IGNORE);
+
           if( this->IsNodeOnBoundaryOfExtent(i,j,k,normalizedWholeExt) )
             {
-            // We don't have BOUNDARY now but we might add
-            // it in the future.
-            //vtkGhostArray::SetProperty(p,vtkGhostArray::BOUNDARY);
+            vtkGhostArray::SetProperty(p,vtkGhostArray::BOUNDARY);
             }
 
           this->GhostedPointGhostArray[ gridID ]->SetValue(pntIdx,p);
@@ -1153,17 +1146,14 @@ void vtkStructuredAMRGridConnectivity::CreateGhostedMaskArrays(
           vtkIdType srcCellIdx =
               vtkStructuredData::ComputePointIdForExtent(
                   registeredCellExtent,ijk,this->DataDescription);
-          unsigned char p = 0;
-          if(this->GridCellGhostArrays[gridID])
-            {
-            p = this->GridCellGhostArrays[gridID]->GetValue(srcCellIdx);
-            }
-          this->GhostedCellGhostArray[ gridID ]->SetValue(cellIdx, p);
+          this->GhostedCellGhostArray[ gridID ]->SetValue(
+             cellIdx,this->GridCellGhostArrays[gridID]->GetValue(srcCellIdx));
           }
         else
           {
-          unsigned char p = 0;
-          p |= vtkDataSetAttributes::DUPLICATECELL;
+          unsigned char p = '0';
+          vtkGhostArray::Reset(p);
+          vtkGhostArray::SetProperty(p,vtkGhostArray::DUPLICATE);
           this->GhostedCellGhostArray[ gridID ]->SetValue(cellIdx,p);
           }
         } // END for all k
@@ -1279,7 +1269,9 @@ void vtkStructuredAMRGridConnectivity::FillCellsGhostArray(
             vtkStructuredData::ComputePointIdForExtent(
                 cellext,ijk,dataDescription);
         assert("pre: cell index is out-of-bounds!" && (idx < numCells) );
-        ghostArrayPtr[idx] = 0;
+
+        vtkGhostArray::Reset(ghostArrayPtr[idx]);
+        vtkGhostArray::SetProperty(ghostArrayPtr[idx],vtkGhostArray::INTERIOR);
         } // END for all k
       } // END for all j
     } // END for all i
@@ -1312,7 +1304,7 @@ void vtkStructuredAMRGridConnectivity::FillCellsGhostArray(
                 vtkStructuredData::ComputePointIdForExtent(
                     cellext,ijk,dataDescription);
             assert("pre: cell index is out-of-bounds!" && (idx < numCells) );
-            ghostArrayPtr[idx] |= vtkDataSetAttributes::REFINEDCELL;
+            vtkGhostArray::SetProperty(ghostArrayPtr[idx],vtkGhostArray::BLANK);
             } // END for all k
           } // END for all j
         } // END for all i
@@ -1326,24 +1318,27 @@ void vtkStructuredAMRGridConnectivity::MarkNodeProperty(
     const int gridId, const int i, const int j, const int k,
     int gridExt[6], int wholeExt[6], unsigned char &p)
 {
-  p = 0;
+  vtkGhostArray::Reset( p );
 
-  if( !this->IsNodeInterior(i,j,k,gridExt) )
+  if( this->IsNodeInterior(i,j,k,gridExt) )
+    {
+    vtkGhostArray::SetProperty( p, vtkGhostArray::INTERNAL );
+    } // END if
+  else
     {
     if( this->IsNodeOnBoundaryOfExtent(i,j,k,wholeExt))
       {
-      //We might use BOUNDARY in the future
-      //vtkGhostArray::SetProperty( p, vtkGhostArray::BOUNDARY );
+      vtkGhostArray::SetProperty( p, vtkGhostArray::BOUNDARY );
       }
 
     if( this->IsNodeOnSharedBoundary(i,j,k, gridId, gridExt) )
       {
       // NOTE: for AMR grids, all the grids own all of ther points so we don't
       // ignore any of the points.
-      // We might use SHARED in the future
-      //vtkGhostArray::SetProperty(p,vtkGhostArray::SHARED);
+      vtkGhostArray::SetProperty(p,vtkGhostArray::SHARED);
       }
-    }
+
+    } // END else
 }
 
 //-----------------------------------------------------------------------------
@@ -2102,7 +2097,7 @@ void vtkStructuredAMRGridConnectivity::GetCoarsenedExtent(
 void vtkStructuredAMRGridConnectivity::CoarsenExtent(
     int orient[3], int ndim, int fromLevel, int toLevel, int ext[6])
 {
-  assert("pre: ndim must be either 1, 2 or 3" && (ndim > 0 && ndim <= 3) );
+  assert("pre: ndim must be either 1, 2 or 3" && (ndim > 0 || ndim <= 3) );
 
   if( this->HasConstantRefinementRatio() )
     {
@@ -2166,7 +2161,7 @@ void vtkStructuredAMRGridConnectivity::GetRefinedExtent(
 void vtkStructuredAMRGridConnectivity::RefineExtent(
     int orient[3], int ndim, int fromLevel, int toLevel, int ext[6])
 {
-  assert("pre: ndim must be either 1, 2 or 3" && (ndim > 0 && ndim <= 3) );
+  assert("pre: ndim must be either 1, 2 or 3" && (ndim > 0 || ndim <= 3) );
 
   if( this->HasConstantRefinementRatio() )
     {
diff --git a/Filters/Geometry/vtkStructuredGridConnectivity.cxx b/Filters/Geometry/vtkStructuredGridConnectivity.cxx
index 32cf61b..4a3081f 100644
--- a/Filters/Geometry/vtkStructuredGridConnectivity.cxx
+++ b/Filters/Geometry/vtkStructuredGridConnectivity.cxx
@@ -16,6 +16,7 @@
 
 // VTK includes
 #include "vtkObjectFactory.h"
+#include "vtkGhostArray.h"
 #include "vtkStructuredData.h"
 #include "vtkStructuredExtent.h"
 #include "vtkIdList.h"
@@ -323,16 +324,18 @@ void vtkStructuredGridConnectivity::MarkCellProperty(
   assert( "pre: node ghostfields should not be NULL" &&
            (nodeGhostFields != NULL) );
 
-  pfield = 0;
+  vtkGhostArray::Reset(pfield);
 
   for( int i=0; i < numNodes; ++i )
     {
-    if(nodeGhostFields[i] & vtkDataSetAttributes::DUPLICATEPOINT)
+    if( vtkGhostArray::IsPropertySet(nodeGhostFields[i], vtkGhostArray::GHOST))
       {
-      pfield |= vtkDataSetAttributes::DUPLICATECELL;
+      vtkGhostArray::SetProperty(pfield,vtkGhostArray::DUPLICATE);
       return;
       }
     } // END for all nodes
+
+  vtkGhostArray::SetProperty( pfield,vtkGhostArray::INTERIOR );
 }
 
 //------------------------------------------------------------------------------
@@ -340,25 +343,27 @@ void vtkStructuredGridConnectivity::MarkNodeProperty(
     const int gridID, const int i, const int j, const int k,
     int ext[6], int realExtent[6], unsigned char &p )
 {
-  p = 0;
+  vtkGhostArray::Reset( p );
 
   // Check if the node is an interior a node, i.e., it is not on any boundary
   // shared or real boundary and not in a ghost region. Interior nodes can only
   // be internal nodes!
-  if( ! this->IsNodeInterior( i,j,k, realExtent) )
+  if( this->IsNodeInterior( i,j,k, realExtent) )
+    {
+    vtkGhostArray::SetProperty( p, vtkGhostArray::INTERNAL );
+    }
+  else
     {
     // If the node is on the boundary of the computational domain mark it
     if( this->IsNodeOnBoundary(i,j,k) )
       {
-      // BOUNDARY might be used in the future
-      //vtkGhostArray::SetProperty( p, vtkGhostArray::BOUNDARY );
+      vtkGhostArray::SetProperty( p, vtkGhostArray::BOUNDARY );
       }
 
     // Check if the node is also on a shared boundary or if it is a ghost node
     if(this->IsNodeOnSharedBoundary(gridID,realExtent,i,j,k))
       {
-      // SHARED might be used in the future
-      //vtkGhostArray::SetProperty( p, vtkGhostArray::SHARED );
+      vtkGhostArray::SetProperty( p, vtkGhostArray::SHARED );
 
       // For shared nodes we must check for ownership
       vtkIdList *neiList = vtkIdList::New();
@@ -383,8 +388,7 @@ void vtkStructuredGridConnectivity::MarkNodeProperty(
           if( this->IsNodeWithinExtent(i,j,k,neiRealExtent) &&
               gridID > neiList->GetId( nei ) )
             {
-            // this was originally vtkGhostArray::IGNORE
-            p |= vtkDataSetAttributes::HIDDENPOINT;
+            vtkGhostArray::SetProperty(p,vtkGhostArray::IGNORE );
             break;
             }
           } // END for all neis
@@ -393,7 +397,9 @@ void vtkStructuredGridConnectivity::MarkNodeProperty(
       }// END if node is on a shared boundary
     else if( this->IsGhostNode(ext,realExtent,i,j,k) )
       {
-      p |= vtkDataSetAttributes::DUPLICATEPOINT;
+      vtkGhostArray::SetProperty( p, vtkGhostArray::GHOST );
+      // Ghost nodes are always ignored!
+      vtkGhostArray::SetProperty( p, vtkGhostArray::IGNORE );
       }
     }
 }
@@ -1150,18 +1156,10 @@ void vtkStructuredGridConnectivity::CreateGhostedMaskArrays(const int gridID)
   int numCells = vtkStructuredData::GetNumberOfCells(
       ghostedExtent,this->DataDescription );
 
-  // STEP 3: Allocated the ghosted node and cell arrays and initialize them
+  // STEP 3: Allocated the ghosted node and cell arrays
   this->GhostedPointGhostArray[gridID]->Allocate( numNodes );
   this->GhostedCellGhostArray[gridID]->Allocate( numCells );
 
-  // Initialize the arrays
-  unsigned char* pnodes =
-    this->GhostedPointGhostArray[gridID]->WritePointer(0, numNodes);
-  memset(pnodes, 0, numNodes);
-  unsigned char* pcells =
-    this->GhostedCellGhostArray[gridID]->WritePointer(0, numCells);
-  memset(pcells, 0, numCells);
-
   // STEP 4: Loop through the ghosted extent and mark the nodes in the ghosted
   // extent accordingly. If the node exists in the grown extent
   int ijk[3];
@@ -1184,22 +1182,19 @@ void vtkStructuredGridConnectivity::CreateGhostedMaskArrays(const int gridID)
           vtkIdType srcidx =
               vtkStructuredData::ComputePointIdForExtent(
                           gridExtent,ijk,this->DataDescription);
-          if(this->GridPointGhostArrays[gridID])
-            {
-            p = this->GridPointGhostArrays[gridID]->GetValue( srcidx );
-            this->GhostedPointGhostArray[gridID]->SetValue(idx, p);
-            }
+          p = this->GridPointGhostArrays[gridID]->GetValue( srcidx );
+          this->GhostedPointGhostArray[gridID]->SetValue(idx, p);
           }
         else
           {
-          p = 0;
+          vtkGhostArray::Reset( p );
 
           if( this->IsNodeOnBoundary(i,j,k) )
             {
-            // We might use BOUNDARY in the future
-            //vtkGhostArray::SetProperty( p,vtkGhostArray::BOUNDARY );
+            vtkGhostArray::SetProperty( p,vtkGhostArray::BOUNDARY );
             }
-          p |= vtkDataSetAttributes::DUPLICATEPOINT;
+          vtkGhostArray::SetProperty( p, vtkGhostArray::GHOST );
+          vtkGhostArray::SetProperty( p, vtkGhostArray::IGNORE );
           this->GhostedPointGhostArray[gridID]->SetValue(idx,p);
           }
         } // END for all k
diff --git a/Filters/Geometry/vtkStructuredGridConnectivity.h b/Filters/Geometry/vtkStructuredGridConnectivity.h
index ba199f5..f52ec85 100644
--- a/Filters/Geometry/vtkStructuredGridConnectivity.h
+++ b/Filters/Geometry/vtkStructuredGridConnectivity.h
@@ -973,12 +973,6 @@ inline int vtkStructuredGridConnectivity::GetNumberOfConnectingBlockFaces(
 inline void vtkStructuredGridConnectivity::SetNumberOfGrids(
     const unsigned int N )
 {
-  if (N == 0)
-    {
-    vtkErrorMacro("Number of grids cannot be 0.");
-    return;
-    }
-
   this->NumberOfGrids = N;
   this->AllocateUserRegisterDataStructures();
 
diff --git a/Filters/Geometry/vtkStructuredGridGhostDataGenerator.cxx b/Filters/Geometry/vtkStructuredGridGhostDataGenerator.cxx
index 11719a0..2ac5b71 100644
--- a/Filters/Geometry/vtkStructuredGridGhostDataGenerator.cxx
+++ b/Filters/Geometry/vtkStructuredGridGhostDataGenerator.cxx
@@ -68,8 +68,8 @@ void vtkStructuredGridGhostDataGenerator::RegisterGrids(
 
     this->GridConnectivity->RegisterGrid(
         static_cast<int>(i),info->Get(vtkDataObject::PIECE_EXTENT()),
-        grid->GetPointGhostArray(),
-        grid->GetCellGhostArray(),
+        grid->GetPointVisibilityArray(),
+        grid->GetCellVisibilityArray(),
         grid->GetPointData(),
         grid->GetCellData(),
         grid->GetPoints() );
@@ -114,6 +114,12 @@ void vtkStructuredGridGhostDataGenerator::CreateGhostedDataSet(
     ghostedGrid->GetCellData()->DeepCopy(
         this->GridConnectivity->GetGhostedGridCellData(i) );
 
+    // STEP 3: Copy the ghost arrays
+    ghostedGrid->SetPointVisibilityArray(
+        this->GridConnectivity->GetGhostedPointGhostArray(i) );
+    ghostedGrid->SetPointVisibilityArray(
+        this->GridConnectivity->GetGhostedCellGhostArray(i) );
+
     out->SetBlock(i,ghostedGrid);
     ghostedGrid->Delete();
     } // END for all blocks
diff --git a/Filters/Geometry/vtkUniformGridGhostDataGenerator.cxx b/Filters/Geometry/vtkUniformGridGhostDataGenerator.cxx
index a753cc2..bb7e465 100644
--- a/Filters/Geometry/vtkUniformGridGhostDataGenerator.cxx
+++ b/Filters/Geometry/vtkUniformGridGhostDataGenerator.cxx
@@ -113,8 +113,8 @@ void vtkUniformGridGhostDataGenerator::RegisterGrids(vtkMultiBlockDataSet *in)
 
     this->GridConnectivity->RegisterGrid(
         static_cast<int>(i), info->Get(vtkDataObject::PIECE_EXTENT()),
-        grid->GetPointGhostArray(),
-        grid->GetCellGhostArray(),
+        grid->GetPointVisibilityArray(),
+        grid->GetCellVisibilityArray(),
         grid->GetPointData(),
         grid->GetCellData(),
         NULL);
@@ -168,6 +168,12 @@ void vtkUniformGridGhostDataGenerator::CreateGhostedDataSet(
     ghostedGrid->GetCellData()->DeepCopy(
         this->GridConnectivity->GetGhostedGridCellData(i) );
 
+    // STEP 6: Copy the ghost arrays
+    ghostedGrid->SetPointVisibilityArray(
+        this->GridConnectivity->GetGhostedPointGhostArray( i ) );
+    ghostedGrid->SetCellVisibilityArray(
+        this->GridConnectivity->GetGhostedCellGhostArray( i ) );
+
     out->SetBlock(i,ghostedGrid);
     ghostedGrid->Delete();
     } // END for all blocks
diff --git a/Filters/Geometry/vtkUnstructuredGridGeometryFilter.cxx b/Filters/Geometry/vtkUnstructuredGridGeometryFilter.cxx
index 76be3f1..ce43920 100644
--- a/Filters/Geometry/vtkUnstructuredGridGeometryFilter.cxx
+++ b/Filters/Geometry/vtkUnstructuredGridGeometryFilter.cxx
@@ -815,6 +815,7 @@ int vtkUnstructuredGridGeometryFilter::RequestData(
     }
   vtkPointData *pd=input->GetPointData();
   vtkCellData *cd=input->GetCellData();
+  vtkFieldData *fd=input->GetFieldData();
   vtkIdType numPts=input->GetNumberOfPoints();
   vtkPoints *inPts=input->GetPoints();
   vtkSmartPointer<vtkCellIterator> cellIter =
@@ -823,6 +824,7 @@ int vtkUnstructuredGridGeometryFilter::RequestData(
   // Output
   vtkPointData *outputPD=output->GetPointData();
   vtkCellData *outputCD=output->GetCellData();
+  vtkFieldData *outputFD=output->GetFieldData();
 //  vtkUnsignedCharArray *types=vtkUnsignedCharArray::New();
 //  types->Allocate(numCells);
 //  vtkIdTypeArray *locs=vtkIdTypeArray::New();
@@ -830,11 +832,16 @@ int vtkUnstructuredGridGeometryFilter::RequestData(
 //  vtkCellArray *conn=vtkCellArray::New();
 //  conn->Allocate(numCells);
 
+  // Ghost cells
+  unsigned char updateLevel=(unsigned char)(
+    outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_GHOST_LEVELS()));
+
+
   unsigned char *cellGhostLevels=0;
   vtkDataArray *temp=0;
   if(cd!=0)
     {
-    temp=cd->GetArray(vtkDataSetAttributes::GhostArrayName());
+    temp=cd->GetArray("vtkGhostLevels");
     }
   if(temp!=0&&temp->GetDataType()==VTK_UNSIGNED_CHAR&&temp->GetNumberOfComponents()==1)
     {
@@ -874,8 +881,7 @@ int vtkUnstructuredGridGeometryFilter::RequestData(
       cellId = cellIter->GetCellId();
       npts = cellIter->GetNumberOfPoints();
       pts = cellIter->GetPointIds()->GetPointer(0);
-      if((cellGhostLevels!=0 &&
-          cellGhostLevels[cellId] & vtkDataSetAttributes::DUPLICATECELL)||
+      if((cellGhostLevels!=0 && cellGhostLevels[cellId] > updateLevel)||
          (this->CellClipping && (cellId < this->CellMinimum ||
                                  cellId > this->CellMaximum)) )
         {
@@ -932,6 +938,9 @@ int vtkUnstructuredGridGeometryFilter::RequestData(
     originalCellIds->Allocate(numCells, numCells/2);
     }
 
+  // Shallow copy field data not associated with points or cells
+  outputFD->ShallowCopy(fd);
+
   vtkIdType *pointMap=0;
 
   if(this->Merging)
@@ -991,7 +1000,6 @@ int vtkUnstructuredGridGeometryFilter::RequestData(
          ||(cellType==VTK_QUADRATIC_LINEAR_QUAD)
          ||(cellType==VTK_BIQUADRATIC_TRIANGLE)
          ||(cellType==VTK_CUBIC_LINE)
-         ||(cellType==VTK_QUADRATIC_POLYGON)
         )
         {
         vtkDebugMacro(<<"not 3D cell. type="<<cellType);
diff --git a/Filters/Hybrid/Testing/Data/Baseline/TestPolyDataSilhouette_1.png.md5 b/Filters/Hybrid/Testing/Data/Baseline/TestPolyDataSilhouette_1.png.md5
deleted file mode 100644
index 4783a43..0000000
--- a/Filters/Hybrid/Testing/Data/Baseline/TestPolyDataSilhouette_1.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-33cd4a45a6fbfaec5b573d9dda67810d
diff --git a/Filters/Hybrid/vtkGreedyTerrainDecimation.cxx b/Filters/Hybrid/vtkGreedyTerrainDecimation.cxx
index 2b37263..0c6d2d8 100644
--- a/Filters/Hybrid/vtkGreedyTerrainDecimation.cxx
+++ b/Filters/Hybrid/vtkGreedyTerrainDecimation.cxx
@@ -989,7 +989,6 @@ void vtkGreedyTerrainDecimation::UpdateTriangle(vtkIdType tri, int ij1[2], int i
         {
         break;
         }
-      VTK_FALLTHROUGH;
 
     case VTK_TOP_TRIANGLE:
       //Start scanning the upper triangle
diff --git a/Filters/Hybrid/vtkPolyDataSilhouette.cxx b/Filters/Hybrid/vtkPolyDataSilhouette.cxx
index d1464f7..d70ff1f 100644
--- a/Filters/Hybrid/vtkPolyDataSilhouette.cxx
+++ b/Filters/Hybrid/vtkPolyDataSilhouette.cxx
@@ -163,31 +163,30 @@ int vtkPolyDataSilhouette::RequestData(
   // Compute the sort vector
   switch( this->Direction )
     {
-    case VTK_DIRECTION_SPECIFIED_VECTOR :
-      vector[0] = this->Vector[0];
-      vector[1] = this->Vector[1];
-      vector[2] = this->Vector[2];
-      break;
-
-    case VTK_DIRECTION_SPECIFIED_ORIGIN :
-      origin[0] = this->Origin[0];
-      origin[1] = this->Origin[1];
-      origin[2] = this->Origin[2];
-      vectorMode = false;
-      break;
-
-    case VTK_DIRECTION_CAMERA_ORIGIN :
-      vectorMode = false;
-      VTK_FALLTHROUGH;
-
-    case VTK_DIRECTION_CAMERA_VECTOR :
-      if ( this->Camera == NULL)
-        {
-        vtkErrorMacro(<<"Need a camera when direction is set to VTK_DIRECTION_CAMERA_*");
-        return 0;
-        }
-      this->ComputeProjectionVector(vector, origin);
-      break;
+  case VTK_DIRECTION_SPECIFIED_VECTOR :
+    vector[0] = this->Vector[0];
+    vector[1] = this->Vector[1];
+    vector[2] = this->Vector[2];
+    break;
+
+  case VTK_DIRECTION_SPECIFIED_ORIGIN :
+    origin[0] = this->Origin[0];
+    origin[1] = this->Origin[1];
+    origin[2] = this->Origin[2];
+    vectorMode = false;
+    break;
+
+  case VTK_DIRECTION_CAMERA_ORIGIN :
+    vectorMode = false;
+
+  case VTK_DIRECTION_CAMERA_VECTOR :
+    if ( this->Camera == NULL)
+      {
+      vtkErrorMacro(<<"Need a camera when direction is set to VTK_DIRECTION_CAMERA_*");
+      return 0;
+      }
+    this->ComputeProjectionVector(vector, origin);
+    break;
     }
 
   vtkIdType nPolys = input->GetNumberOfPolys();
diff --git a/Filters/Hybrid/vtkTemporalFractal.cxx b/Filters/Hybrid/vtkTemporalFractal.cxx
index d019dec..69bd0cc 100644
--- a/Filters/Hybrid/vtkTemporalFractal.cxx
+++ b/Filters/Hybrid/vtkTemporalFractal.cxx
@@ -1413,13 +1413,13 @@ void vtkTemporalFractal::AddGhostLevelArray(vtkDataSet *grid,
           }
         else
           {
-          *ptr |= vtkDataSetAttributes::DUPLICATECELL;
+          *ptr = iLevel;
           }
         ++ptr;
         }
       }
     }
-  array->SetName(vtkDataSetAttributes::GhostArrayName());
+  array->SetName("vtkGhostLevels");
   grid->GetCellData()->AddArray(array);
   array->Delete();
 }
diff --git a/Filters/Hybrid/vtkTemporalInterpolator.cxx b/Filters/Hybrid/vtkTemporalInterpolator.cxx
index 1cf007e..cb13914 100644
--- a/Filters/Hybrid/vtkTemporalInterpolator.cxx
+++ b/Filters/Hybrid/vtkTemporalInterpolator.cxx
@@ -216,7 +216,8 @@ int vtkTemporalInterpolator::RequestData(
 {
   vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
   vtkInformation *outInfo = outputVector->GetInformationObject(0);
-  vtkDataObject *outData = vtkDataObject::GetData(outInfo);
+
+  vtkDataObject *outData = NULL;
 
   // get the requested update times
   double upTime = outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEP());
@@ -228,7 +229,8 @@ int vtkTemporalInterpolator::RequestData(
   if (numTimeSteps==1)
     {
     // pass the lowest data
-    outData->ShallowCopy(inData->GetBlock(0));
+    outData = inData->GetBlock(0);
+    outInfo->Set(vtkDataObject::DATA_OBJECT(),outData);
     }
   else
     {
@@ -243,9 +245,11 @@ int vtkTemporalInterpolator::RequestData(
     double t0 = data0->GetInformation()->Get(vtkDataObject::DATA_TIME_STEP());
     double t1 = data1->GetInformation()->Get(vtkDataObject::DATA_TIME_STEP());
     this->Ratio  = (upTime-t0)/(t1 - t0);
-    vtkSmartPointer<vtkDataObject> newOutput;
-    newOutput.TakeReference(this->InterpolateDataObject(data0, data1, this->Ratio));
-    outData->ShallowCopy(newOutput);
+    outData = this->InterpolateDataObject(data0,data1,this->Ratio);
+    // stamp this new dataset with a time key
+    outData->GetInformation()->Set(vtkDataObject::DATA_TIME_STEP(),upTime);
+    outInfo->Set(vtkDataObject::DATA_OBJECT(),outData);
+    outData->Delete();
     }
 
   // @TODO remove this when we move to new time framework
diff --git a/Filters/Hybrid/vtkTransformToGrid.cxx b/Filters/Hybrid/vtkTransformToGrid.cxx
index ed93498..9ea9872 100644
--- a/Filters/Hybrid/vtkTransformToGrid.cxx
+++ b/Filters/Hybrid/vtkTransformToGrid.cxx
@@ -370,7 +370,7 @@ void vtkTransformToGrid::RequestData(
   grid->AllocateScalars(outInfo);
   int *extent = grid->GetExtent();
 
-  void *gridPtr = grid->GetScalarPointerForExtent(extent);
+  double *gridPtr = (double *)grid->GetScalarPointerForExtent(extent);
   int gridType = grid->GetScalarType();
 
   this->UpdateShiftScale();
diff --git a/Filters/Hybrid/vtkWeightedTransformFilter.cxx b/Filters/Hybrid/vtkWeightedTransformFilter.cxx
index d064699..b292302 100644
--- a/Filters/Hybrid/vtkWeightedTransformFilter.cxx
+++ b/Filters/Hybrid/vtkWeightedTransformFilter.cxx
@@ -318,8 +318,6 @@ int vtkWeightedTransformFilter::RequestData(
       {
       vtkErrorMacro(<<"WeightArray " << this->WeightArray <<
       " " << "doesn't exist");
-      delete [] linearNormMtx;
-      delete [] linearPtMtx;
       return 1;
       }
 
@@ -350,8 +348,6 @@ int vtkWeightedTransformFilter::RequestData(
       {
       vtkErrorMacro(<<"TransformIndexArray " << this->TransformIndexArray <<
       " " << "doesn't exist");
-      delete [] linearNormMtx;
-      delete [] linearPtMtx;
       return 1;
       }
 
@@ -391,8 +387,6 @@ int vtkWeightedTransformFilter::RequestData(
       {
       vtkErrorMacro(<<"CellDataWeightArray " << this->CellDataWeightArray <<
       " " << "doesn't exist");
-      delete [] linearNormMtx;
-      delete [] linearPtMtx;
       return 1;
       }
     cdComponents = cdArray->GetNumberOfComponents();
@@ -426,8 +420,6 @@ int vtkWeightedTransformFilter::RequestData(
       vtkErrorMacro(<<"CellDataTransformIndexArray " <<
                     this->CellDataTransformIndexArray <<
                     " " << "doesn't exist");
-      delete [] linearNormMtx;
-      delete [] linearPtMtx;
       return 1;
       }
 
@@ -458,8 +450,6 @@ int vtkWeightedTransformFilter::RequestData(
   if ( !inPts )
     {
     vtkErrorMacro(<<"No input data");
-    delete [] linearNormMtx;
-    delete [] linearPtMtx;
     return 1;
     }
 
diff --git a/Filters/HyperTree/Testing/Data/Baseline/TestHyperTreeGridTernary2DFullMaterialBits.png.md5 b/Filters/HyperTree/Testing/Data/Baseline/TestHyperTreeGridTernary2DFullMaterialBits.png.md5
index f669484..206e16e 100644
--- a/Filters/HyperTree/Testing/Data/Baseline/TestHyperTreeGridTernary2DFullMaterialBits.png.md5
+++ b/Filters/HyperTree/Testing/Data/Baseline/TestHyperTreeGridTernary2DFullMaterialBits.png.md5
@@ -1 +1 @@
-d7de9b31e54cc2864b873ee3a447a55e
+8c4cbc7bc06ae604c6028669edd6d7b7
diff --git a/Filters/HyperTree/module.cmake b/Filters/HyperTree/module.cmake
index d05a275..e43d8a0 100644
--- a/Filters/HyperTree/module.cmake
+++ b/Filters/HyperTree/module.cmake
@@ -10,7 +10,7 @@ vtk_module(vtkFiltersHyperTree
     vtkRenderingAnnotation
     vtkTestingRendering
     vtkInteractionStyle
-    vtkRendering${VTK_RENDERING_BACKEND}
+    vtkRenderingFreeType${VTK_RENDERING_BACKEND}
   KIT
     vtkFilters
   )
diff --git a/Filters/Matlab/vtkMatlabEngineFilter.cxx b/Filters/Matlab/vtkMatlabEngineFilter.cxx
index 69247e4..7a3faf0 100644
--- a/Filters/Matlab/vtkMatlabEngineFilter.cxx
+++ b/Filters/Matlab/vtkMatlabEngineFilter.cxx
@@ -912,7 +912,11 @@ int vtkMatlabEngineFilter::SetMatlabScriptFromFile(const char* fname)
     len = ftell(fp);
     fseek(fp,0,SEEK_SET);
 
-    delete [] this->MatlabFileScript;
+    if(this->MatlabFileScript)
+      {
+      delete [] this->MatlabFileScript;
+      this->MatlabFileScript = 0;
+      }
 
     this->MatlabFileScript = new char[len+1];
     fread(this->MatlabFileScript,len,1,fp);
diff --git a/Filters/Modeling/Testing/Data/Baseline/TestQuadRotationalExtrusion_1.png.md5 b/Filters/Modeling/Testing/Data/Baseline/TestQuadRotationalExtrusion_1.png.md5
deleted file mode 100644
index 0c5800a..0000000
--- a/Filters/Modeling/Testing/Data/Baseline/TestQuadRotationalExtrusion_1.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-ba07aca8ada7bb4e187fd27ce0114ec3
diff --git a/Filters/Modeling/Testing/Data/Baseline/TestRotationalExtrusion_1.png.md5 b/Filters/Modeling/Testing/Data/Baseline/TestRotationalExtrusion_1.png.md5
deleted file mode 100644
index ac8c4fb..0000000
--- a/Filters/Modeling/Testing/Data/Baseline/TestRotationalExtrusion_1.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-3fffd5733482983d5a4daf4806db9693
diff --git a/Filters/Modeling/vtkBandedPolyDataContourFilter.cxx b/Filters/Modeling/vtkBandedPolyDataContourFilter.cxx
index 83e1e81..d3c884c 100644
--- a/Filters/Modeling/vtkBandedPolyDataContourFilter.cxx
+++ b/Filters/Modeling/vtkBandedPolyDataContourFilter.cxx
@@ -446,8 +446,8 @@ int vtkBandedPolyDataContourFilter::RequestData(
   // Polygons are assumed convex and chopped into filled, convex polygons.
   // Triangle strips are treated similarly.
   //
-  vtkIdType numPolys = input->GetPolys()->GetNumberOfCells();
-  vtkIdType numStrips = input->GetStrips()->GetNumberOfCells();
+  int numPolys = input->GetPolys()->GetNumberOfCells();
+  int numStrips = input->GetStrips()->GetNumberOfCells();
   if ( numPolys > 0 || numStrips > 0 )
     {
     // Set up processing. We are going to store an ordered list of
diff --git a/Filters/Modeling/vtkButterflySubdivisionFilter.cxx b/Filters/Modeling/vtkButterflySubdivisionFilter.cxx
index 8086116..3b7121e 100644
--- a/Filters/Modeling/vtkButterflySubdivisionFilter.cxx
+++ b/Filters/Modeling/vtkButterflySubdivisionFilter.cxx
@@ -175,6 +175,7 @@ void vtkButterflySubdivisionFilter::GenerateLoopStencil(
 {
   vtkIdList *cellIds = vtkIdList::New();
   vtkCell *cell;
+  int j;
   vtkIdType startCell, nextCell, tp2, p;
   int shift[255];
   int processed = 0;
@@ -226,10 +227,10 @@ void vtkButterflySubdivisionFilter::GenerateLoopStencil(
 
   // Generate weights
 #define VTK_PI vtkMath::Pi()
-  vtkIdType K = stencilIds->GetNumberOfIds();
+  int K = stencilIds->GetNumberOfIds();
   if (K >= 5)
     {
-    for (vtkIdType j = 0; j < K; j++)
+    for (j = 0; j < K; j++)
       {
       weights[j] = (.25 +  cos (2.0 * VTK_PI * shift[j] / static_cast<double>(K))
                     + .5 * cos (4.0 * VTK_PI * shift[j] / static_cast<double>(K))) / static_cast<double>(K);
diff --git a/Filters/Modeling/vtkDijkstraGraphGeodesicPath.cxx b/Filters/Modeling/vtkDijkstraGraphGeodesicPath.cxx
index 142bd58..60ed4c9 100644
--- a/Filters/Modeling/vtkDijkstraGraphGeodesicPath.cxx
+++ b/Filters/Modeling/vtkDijkstraGraphGeodesicPath.cxx
@@ -185,9 +185,9 @@ double vtkDijkstraGraphGeodesicPath::CalculateStaticEdgeCost(
 void vtkDijkstraGraphGeodesicPath::BuildAdjacency(vtkDataSet *inData)
 {
   vtkPolyData *pd = vtkPolyData::SafeDownCast( inData );
-  vtkIdType ncells = pd->GetNumberOfCells();
+  int ncells = pd->GetNumberOfCells();
 
-  for ( vtkIdType i = 0; i < ncells; i++)
+  for ( int i = 0; i < ncells; i++)
     {
     // Possible types
     //    VTK_VERTEX, VTK_POLY_VERTEX, VTK_LINE,
@@ -242,7 +242,7 @@ void vtkDijkstraGraphGeodesicPath::TraceShortestPath(
   lines->InsertNextCell(this->NumberOfVertices);
 
   // trace backward
-  vtkIdType v = endv;
+  int v = endv;
   double pt[3];
   vtkIdType id;
   while (v != startv)
diff --git a/Filters/Modeling/vtkDijkstraImageGeodesicPath.cxx b/Filters/Modeling/vtkDijkstraImageGeodesicPath.cxx
index f7deb9a..07fea5b 100644
--- a/Filters/Modeling/vtkDijkstraImageGeodesicPath.cxx
+++ b/Filters/Modeling/vtkDijkstraImageGeodesicPath.cxx
@@ -238,7 +238,7 @@ void vtkDijkstraImageGeodesicPath::BuildAdjacency( vtkDataSet *inData )
 {
   vtkImageData *image = vtkImageData::SafeDownCast(inData);
 
-  vtkIdType ncells = image->GetNumberOfCells();
+  int ncells = image->GetNumberOfCells();
 
   // optimized for cell type VTK_PIXEL
   //
@@ -247,7 +247,7 @@ void vtkDijkstraImageGeodesicPath::BuildAdjacency( vtkDataSet *inData )
   vtkIdType vId[6] = {1,2,3,0,2,3};
   double cost;
 
-  for ( vtkIdType i = 0; i < ncells; ++i )
+  for ( int i = 0; i < ncells; ++i )
     {
     image->GetCellPoints ( i, ptIds );
 
diff --git a/Filters/Modeling/vtkLinearExtrusionFilter.cxx b/Filters/Modeling/vtkLinearExtrusionFilter.cxx
index 63f6d1d..c13c3f8 100644
--- a/Filters/Modeling/vtkLinearExtrusionFilter.cxx
+++ b/Filters/Modeling/vtkLinearExtrusionFilter.cxx
@@ -95,7 +95,7 @@ int vtkLinearExtrusionFilter::RequestData(
   vtkIdType *pts = 0;
   vtkIdType npts = 0;
   vtkIdType ptId, ncells, p1, p2;
-  vtkIdType i, j;
+  int i, j;
   double x[3];
   vtkPoints *newPts;
   vtkCellArray *newLines=NULL, *newPolys=NULL, *newStrips;
diff --git a/Filters/Modeling/vtkLoopSubdivisionFilter.cxx b/Filters/Modeling/vtkLoopSubdivisionFilter.cxx
index 4c7dadc..a32d3a7 100644
--- a/Filters/Modeling/vtkLoopSubdivisionFilter.cxx
+++ b/Filters/Modeling/vtkLoopSubdivisionFilter.cxx
@@ -132,17 +132,17 @@ void vtkLoopSubdivisionFilter::GenerateEvenStencil (vtkIdType p1,
   vtkIdList *ptIds = vtkIdList::New();
   vtkCell *cell;
 
-  int i;
-  vtkIdType j;
-  vtkIdType startCell, nextCell;
+  int i, j;
+  int numCellsInLoop;
+  int startCell, nextCell;
   vtkIdType p, p2;
   vtkIdType bp1, bp2;
-  vtkIdType K;
+  int K;
   double beta, cosSQ;
 
   // Get the cells that use this point
   polys->GetPointCells (p1, cellIds);
-  vtkIdType numCellsInLoop = cellIds->GetNumberOfIds();
+  numCellsInLoop = cellIds->GetNumberOfIds();
   if (numCellsInLoop < 1)
       {
       vtkWarningMacro("numCellsInLoop < 1: " << numCellsInLoop);
diff --git a/Filters/Parallel/CMakeLists.txt b/Filters/Parallel/CMakeLists.txt
index d58e31a..e521ecf 100644
--- a/Filters/Parallel/CMakeLists.txt
+++ b/Filters/Parallel/CMakeLists.txt
@@ -1,5 +1,4 @@
 set(Module_SRCS
-  vtkAngularPeriodicFilter.cxx
   vtkCollectGraph.cxx
   vtkCollectPolyData.cxx
   vtkCollectTable.cxx
@@ -11,7 +10,6 @@ set(Module_SRCS
   vtkExtractUserDefinedPiece.cxx
   vtkPCellDataToPointData.cxx
   vtkPExtractArraysOverTime.cxx
-  vtkPeriodicFilter.cxx
   vtkPKdTree.cxx
   vtkPLinearExtrusionFilter.cxx
   vtkPMaskPoints.cxx
diff --git a/Filters/Parallel/Testing/Cxx/CMakeLists.txt b/Filters/Parallel/Testing/Cxx/CMakeLists.txt
index a277eae..0395755 100644
--- a/Filters/Parallel/Testing/Cxx/CMakeLists.txt
+++ b/Filters/Parallel/Testing/Cxx/CMakeLists.txt
@@ -1,9 +1,5 @@
 include(vtkMPI)
 
-vtk_add_test_cxx(${vtk-module}CxxTests testsStd
-  TestAngularPeriodicFilter.cxx
-  )
-
 vtk_add_test_mpi(${vtk-module}CxxTests-MPI tests
   TESTING_DATA
   DistributedData.cxx
@@ -22,4 +18,3 @@ set(all_tests
   ${no_data_tests}
   )
 vtk_test_mpi_executable(${vtk-module}CxxTests-MPI all_tests)
-vtk_test_cxx_executable(${vtk-module}CxxTests testsStd)
diff --git a/Filters/Parallel/Testing/Cxx/DistributedData.cxx b/Filters/Parallel/Testing/Cxx/DistributedData.cxx
index 6657b40..3c5b231 100644
--- a/Filters/Parallel/Testing/Cxx/DistributedData.cxx
+++ b/Filters/Parallel/Testing/Cxx/DistributedData.cxx
@@ -55,6 +55,7 @@ class MyProcess : public vtkProcess
 {
 public:
   static MyProcess *New();
+  vtkTypeMacro(MyProcess, vtkProcess);
 
   virtual void Execute();
 
diff --git a/Filters/Parallel/Testing/Cxx/DistributedDataRenderPass.cxx b/Filters/Parallel/Testing/Cxx/DistributedDataRenderPass.cxx
index 3311e7e..c882044 100644
--- a/Filters/Parallel/Testing/Cxx/DistributedDataRenderPass.cxx
+++ b/Filters/Parallel/Testing/Cxx/DistributedDataRenderPass.cxx
@@ -67,6 +67,7 @@ class MyProcess : public vtkProcess
 {
 public:
   static MyProcess *New();
+  vtkTypeMacro(MyProcess, vtkProcess);
 
   virtual void Execute();
 
diff --git a/Filters/Parallel/Testing/Cxx/ParallelResampling.cxx b/Filters/Parallel/Testing/Cxx/ParallelResampling.cxx
index 53b36a9..f483d1e 100644
--- a/Filters/Parallel/Testing/Cxx/ParallelResampling.cxx
+++ b/Filters/Parallel/Testing/Cxx/ParallelResampling.cxx
@@ -43,6 +43,7 @@ class MyProcess : public vtkProcess
 {
 public:
   static MyProcess *New();
+  vtkTypeMacro(MyProcess, vtkProcess);
 
   virtual void Execute();
 
diff --git a/Filters/Parallel/Testing/Cxx/TestAngularPeriodicFilter.cxx b/Filters/Parallel/Testing/Cxx/TestAngularPeriodicFilter.cxx
deleted file mode 100644
index 1c819d1..0000000
--- a/Filters/Parallel/Testing/Cxx/TestAngularPeriodicFilter.cxx
+++ /dev/null
@@ -1,145 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    TestDistancePolyDataFilter.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 "vtkActor.h"
-#include "vtkAngularPeriodicFilter.h"
-#include "vtkCamera.h"
-#include "vtkGeometryFilter.h"
-#include "vtkCompositePolyDataMapper.h"
-#include "vtkLookupTable.h"
-#include "vtkMultiBlockDataSet.h"
-#include "vtkNew.h"
-#include "vtkPointSource.h"
-#include "vtkPointData.h"
-#include "vtkPolyDataMapper.h"
-#include "vtkProperty.h"
-#include "vtkRegressionTestImage.h"
-#include "vtkRenderer.h"
-#include "vtkRenderWindow.h"
-#include "vtkRenderWindowInteractor.h"
-#include "vtkStreamTracer.h"
-#include "vtkTesting.h"
-#include "vtkTriangleFilter.h"
-#include "vtkUnstructuredGrid.h"
-#include "vtkXMLUnstructuredGridReader.h"
-
-
-int TestAngularPeriodicFilter(int argc, char* argv[])
-{
-  vtkNew<vtkXMLUnstructuredGridReader> reader;
-
-  vtkNew<vtkTesting> testHelper;
-  testHelper->AddArguments(argc, argv);
-  if (!testHelper->IsFlagSpecified("-D"))
-    {
-    std::cerr << "Error : -D /path/to/data was not specified.";
-    return EXIT_FAILURE;
-    }
-  std::string dataRoot = testHelper->GetDataRoot();
-  std::string inputFileName = dataRoot + "/Data/periodicPiece.vtu";
-  reader->SetFileName(inputFileName.c_str());
-  reader->Update();
-
-  vtkNew<vtkMultiBlockDataSet> mb;
-  mb->SetNumberOfBlocks(1);
-  mb->SetBlock(0, reader->GetOutput());
-
-  vtkNew<vtkAngularPeriodicFilter> angularPeriodicFilter;
-  angularPeriodicFilter->SetInputData(mb.Get());
-  angularPeriodicFilter->AddIndex(1);
-  angularPeriodicFilter->SetIterationModeToMax();
-  angularPeriodicFilter->SetRotationModeToDirectAngle();
-  angularPeriodicFilter->SetRotationAngle(45.);
-  angularPeriodicFilter->SetRotationAxisToZ();
-
-  vtkNew<vtkGeometryFilter> geomFilter;
-  geomFilter->SetInputData(mb.Get());
-
-  vtkNew<vtkTriangleFilter> triangleFilter;
-  triangleFilter->SetInputConnection(geomFilter->GetOutputPort());
-
-  vtkNew<vtkPointSource> seed;
-  seed->SetCenter(5.80752824733665, -3.46144284193073, -5.83410675177451);
-  seed->SetNumberOfPoints(1);
-  seed->SetRadius(2);
-
-  vtkNew<vtkStreamTracer> streamTracer;
-  streamTracer->SetInputConnection(angularPeriodicFilter->GetOutputPort());
-  streamTracer->SetInputArrayToProcess(0, 0, 0, 0, "Result");
-  streamTracer->SetInterpolatorType(0);
-  streamTracer->SetIntegrationDirection(2);
-  streamTracer->SetIntegratorType(2);
-  streamTracer->SetIntegrationStepUnit(2);
-  streamTracer->SetInitialIntegrationStep(0.2);
-  streamTracer->SetMinimumIntegrationStep(0.01);
-  streamTracer->SetMaximumIntegrationStep(0.5);
-  streamTracer->SetMaximumNumberOfSteps(2000);
-  streamTracer->SetMaximumPropagation(28.);
-  streamTracer->SetTerminalSpeed(0.000000000001);
-  streamTracer->SetMaximumError(0.000001);
-  streamTracer->SetComputeVorticity(1);
-
-  streamTracer->SetSourceConnection(seed->GetOutputPort());
-  streamTracer->Update();
-
-  vtkPolyData* pd = streamTracer->GetOutput();
-  pd->GetPointData()->SetActiveScalars("RTData");
-
-  vtkNew<vtkLookupTable> hueLut;
-  hueLut->SetHueRange(0., 1.);
-  hueLut->SetSaturationRange(1., 1.);
-  hueLut->Build();
-
-  vtkNew<vtkCompositePolyDataMapper> multiBlockMapper;
-  multiBlockMapper->SetInputConnection(triangleFilter->GetOutputPort());
-  multiBlockMapper->SetLookupTable(hueLut.Get());
-  multiBlockMapper->SetScalarRange(131., 225.);
-  multiBlockMapper->SetColorModeToMapScalars();
-  multiBlockMapper->SetScalarModeToUsePointData();
-
-  vtkNew<vtkPolyDataMapper> mapper;
-  mapper->SetInputConnection(streamTracer->GetOutputPort());
-  mapper->SetLookupTable(hueLut.Get());
-  mapper->SetScalarRange(131., 225.);
-  mapper->SetColorModeToMapScalars();
-  mapper->SetScalarModeToUsePointData();
-
-  vtkNew<vtkActor> multiBlockActor;
-  multiBlockActor->SetMapper(multiBlockMapper.Get());
-
-  vtkNew<vtkActor> actor;
-  actor->SetMapper(mapper.Get());
-
-  vtkNew<vtkRenderer> renderer;
-  renderer->AddActor(multiBlockActor.GetPointer());
-  renderer->AddActor(actor.GetPointer());
-  renderer->GetActiveCamera()->SetPosition(3.97282457351685, -0.0373859405517578, -59.3025624847687);
-  renderer->ResetCamera();
-  renderer->SetBackground(1., 1., 1.);
-
-  vtkNew<vtkRenderWindow> renWin;
-  renWin->AddRenderer(renderer.GetPointer());
-  renWin->SetMultiSamples(0);
-  renWin->SetSize(300, 300);
-
-  vtkNew<vtkRenderWindowInteractor> iren;
-  iren->SetRenderWindow(renWin.GetPointer());
-
-  int retVal = vtkRegressionTestImage(renWin.GetPointer());
-  if (retVal == vtkRegressionTester::DO_INTERACTOR)
-    {
-    iren->Start();
-    }
-
-  return !retVal;
-}
diff --git a/Filters/Parallel/Testing/Cxx/TransmitImageData.cxx b/Filters/Parallel/Testing/Cxx/TransmitImageData.cxx
index 0f98e5c..96dc314 100644
--- a/Filters/Parallel/Testing/Cxx/TransmitImageData.cxx
+++ b/Filters/Parallel/Testing/Cxx/TransmitImageData.cxx
@@ -52,6 +52,7 @@ class MyProcess : public vtkProcess
 {
 public:
   static MyProcess *New();
+  vtkTypeMacro(MyProcess, vtkProcess);
 
   virtual void Execute();
 
diff --git a/Filters/Parallel/Testing/Cxx/TransmitImageDataRenderPass.cxx b/Filters/Parallel/Testing/Cxx/TransmitImageDataRenderPass.cxx
index 316d400..188dfca 100644
--- a/Filters/Parallel/Testing/Cxx/TransmitImageDataRenderPass.cxx
+++ b/Filters/Parallel/Testing/Cxx/TransmitImageDataRenderPass.cxx
@@ -57,6 +57,7 @@ class MyProcess : public vtkProcess
 {
 public:
   static MyProcess *New();
+  vtkTypeMacro(MyProcess, vtkProcess);
 
   virtual void Execute();
 
diff --git a/Filters/Parallel/Testing/Cxx/TransmitRectilinearGrid.cxx b/Filters/Parallel/Testing/Cxx/TransmitRectilinearGrid.cxx
index ce43c8d..d2989f6 100644
--- a/Filters/Parallel/Testing/Cxx/TransmitRectilinearGrid.cxx
+++ b/Filters/Parallel/Testing/Cxx/TransmitRectilinearGrid.cxx
@@ -50,6 +50,7 @@ class MyProcess : public vtkProcess
 {
 public:
   static MyProcess *New();
+  vtkTypeMacro(MyProcess, vtkProcess);
 
   virtual void Execute();
 
diff --git a/Filters/Parallel/Testing/Cxx/TransmitStructuredGrid.cxx b/Filters/Parallel/Testing/Cxx/TransmitStructuredGrid.cxx
index 6a20c8f..46953e5 100644
--- a/Filters/Parallel/Testing/Cxx/TransmitStructuredGrid.cxx
+++ b/Filters/Parallel/Testing/Cxx/TransmitStructuredGrid.cxx
@@ -50,6 +50,7 @@ class MyProcess : public vtkProcess
 {
 public:
   static MyProcess *New();
+  vtkTypeMacro(MyProcess, vtkProcess);
 
   virtual void Execute();
 
diff --git a/Filters/Parallel/Testing/Data/Baseline/TestAngularPeriodicFilter.png.md5 b/Filters/Parallel/Testing/Data/Baseline/TestAngularPeriodicFilter.png.md5
deleted file mode 100644
index d4cc2b9..0000000
--- a/Filters/Parallel/Testing/Data/Baseline/TestAngularPeriodicFilter.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-698f52db8a99c7fbd5a30081dc7367cf
diff --git a/Filters/Parallel/Testing/Data/Baseline/TestAngularPeriodicFilter_1.png.md5 b/Filters/Parallel/Testing/Data/Baseline/TestAngularPeriodicFilter_1.png.md5
deleted file mode 100644
index 4347113..0000000
--- a/Filters/Parallel/Testing/Data/Baseline/TestAngularPeriodicFilter_1.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-fc096bef56e771460f67cfe6a2614c24
diff --git a/Filters/Parallel/Testing/Python/TestCutMaterial.py b/Filters/Parallel/Testing/Python/TestCutMaterial.py
index 52d36c4..ec18ead 100755
--- a/Filters/Parallel/Testing/Python/TestCutMaterial.py
+++ b/Filters/Parallel/Testing/Python/TestCutMaterial.py
@@ -40,7 +40,7 @@ mapper2.SetInputConnection(cut.GetOutputPort())
 mapper2.SetScalarRange(0,1)
 #apper2 SetScalarModeToUseCellFieldData
 #apper2 SetColorModeToMapScalars
-#apper2 ColorByArrayComponent vtk.vtkDataSetAttributes.GhostArrayName() 0
+#apper2 ColorByArrayComponent "vtkGhostLevels" 0
 actor2 = vtk.vtkActor()
 actor2.SetMapper(mapper2)
 actor2.SetPosition(1.5,0,0)
diff --git a/Filters/Parallel/Testing/Python/TestExtrudePiece.py b/Filters/Parallel/Testing/Python/TestExtrudePiece.py
index 6154a1d..2da796a 100755
--- a/Filters/Parallel/Testing/Python/TestExtrudePiece.py
+++ b/Filters/Parallel/Testing/Python/TestExtrudePiece.py
@@ -1,17 +1,13 @@
 #!/usr/bin/env python
 
-
 disk = vtk.vtkDiskSource()
 disk.SetRadialResolution(2)
 disk.SetCircumferentialResolution(9)
-
 clean = vtk.vtkCleanPolyData()
 clean.SetInputConnection(disk.GetOutputPort())
 clean.SetTolerance(0.01)
-
 piece = vtk.vtkExtractPolyDataPiece()
 piece.SetInputConnection(clean.GetOutputPort())
-
 extrude = vtk.vtkPLinearExtrusionFilter()
 extrude.SetInputConnection(piece.GetOutputPort())
 extrude.PieceInvariantOn()
@@ -22,14 +18,10 @@ renWin = vtk.vtkRenderWindow()
 renWin.AddRenderer(ren1)
 iren = vtk.vtkRenderWindowInteractor()
 iren.SetRenderWindow(renWin)
-
 mapper = vtk.vtkPolyDataMapper()
 mapper.SetInputConnection(extrude.GetOutputPort())
 mapper.SetNumberOfPieces(2)
 mapper.SetPiece(1)
-mapper.Update()
-mapper.GetInput().RemoveGhostCells()
-
 bf = vtk.vtkProperty()
 bf.SetColor(1,0,0)
 actor = vtk.vtkActor()
diff --git a/Filters/Parallel/Testing/Python/testTransmit.py b/Filters/Parallel/Testing/Python/testTransmit.py
index afe713f..f453d4c 100644
--- a/Filters/Parallel/Testing/Python/testTransmit.py
+++ b/Filters/Parallel/Testing/Python/testTransmit.py
@@ -125,7 +125,7 @@ def TestDataType(dataType, filter):
     filter.SetUpdateExtent(rank, nranks, 1)
     filter.Update()
 
-    gl = filter.GetOutput().GetCellData().GetArray(vtk.vtkDataSetAttributes.GhostArrayName())
+    gl = filter.GetOutput().GetCellData().GetArray("vtkGhostLevels")
     if not gl:
         result.SetValue(0, 0)
     else:
diff --git a/Filters/Parallel/Testing/Tcl/TestCutMaterial.tcl b/Filters/Parallel/Testing/Tcl/TestCutMaterial.tcl
index c706133..679106d 100644
--- a/Filters/Parallel/Testing/Tcl/TestCutMaterial.tcl
+++ b/Filters/Parallel/Testing/Tcl/TestCutMaterial.tcl
@@ -52,7 +52,7 @@ mapper2 SetInputConnection [cut GetOutputPort]
 mapper2 SetScalarRange 0 1
 #apper2 SetScalarModeToUseCellFieldData
 #apper2 SetColorModeToMapScalars
-#apper2 ColorByArrayComponent [vtkDataSetAttributes GhostArrayName] 0
+#apper2 ColorByArrayComponent "vtkGhostLevels" 0
 
 vtkActor actor2
 actor2 SetMapper mapper2
diff --git a/Filters/Parallel/Testing/Tcl/TestExtrudePiece.tcl b/Filters/Parallel/Testing/Tcl/TestExtrudePiece.tcl
index c3520ac..46128d8 100644
--- a/Filters/Parallel/Testing/Tcl/TestExtrudePiece.tcl
+++ b/Filters/Parallel/Testing/Tcl/TestExtrudePiece.tcl
@@ -1,6 +1,7 @@
 package require vtk
 package require vtkinteraction
 
+
 vtkDiskSource disk
   disk SetRadialResolution 2
   disk SetCircumferentialResolution 9
@@ -15,6 +16,9 @@ vtkExtractPolyDataPiece piece
 vtkPLinearExtrusionFilter extrude
   extrude SetInputConnection [piece GetOutputPort]
   extrude PieceInvariantOn
+
+
+
 # Create the RenderWindow, Renderer and both Actors
 #
 vtkRenderer ren1
@@ -27,8 +31,6 @@ vtkPolyDataMapper mapper
    mapper SetInputConnection [extrude GetOutputPort]
    mapper SetNumberOfPieces 2
    mapper SetPiece 1
-   mapper Update
-  [mapper GetInput] RemoveGhostCells
 
 vtkProperty bf
     bf SetColor 1 0 0
@@ -36,21 +38,28 @@ vtkActor actor
     actor SetMapper mapper
     [actor GetProperty] SetColor 1 1 0.8
     actor SetBackfaceProperty bf
+
+
+
 # Add the actors to the renderer, set the background and size
 #
 ren1 AddActor actor
+
 ren1 SetBackground 0.1 0.2 0.4
 renWin SetSize 300 300
+
 # render the image
 #
+iren AddObserver UserEvent {wm deiconify .vtkInteract}
+
 set cam1 [ren1 GetActiveCamera]
 $cam1 Azimuth 20
 $cam1 Elevation 40
 ren1 ResetCamera
 $cam1 Zoom 1.2
+
 iren Initialize
 
-iren AddObserver UserEvent {wm deiconify .vtkInteract}
 # prevent the tk window from showing up then start the event loop
 wm withdraw .
 
diff --git a/Filters/Parallel/module.cmake b/Filters/Parallel/module.cmake
index 7ad6427..f88e58f 100644
--- a/Filters/Parallel/module.cmake
+++ b/Filters/Parallel/module.cmake
@@ -12,12 +12,10 @@ vtk_module(vtkFiltersParallel
     vtkTestingCore
     vtkTestingRendering
     vtkInteractionStyle
-    vtkIOXML
     vtkRendering${VTK_RENDERING_BACKEND}
     vtkRenderingParallel
     vtkFiltersParallelMPI
     vtkFiltersParallelImaging
-    vtkFiltersFlowPaths
     vtkIOLegacy
   KIT
     vtkParallel
diff --git a/Filters/Parallel/vtkAngularPeriodicFilter.cxx b/Filters/Parallel/vtkAngularPeriodicFilter.cxx
deleted file mode 100644
index 0d5a333..0000000
--- a/Filters/Parallel/vtkAngularPeriodicFilter.cxx
+++ /dev/null
@@ -1,399 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkPeriodicFiler.h
-
-  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 "vtkAngularPeriodicFilter.h"
-
-#include "vtkAngularPeriodicDataArray.h"
-#include "vtkCellData.h"
-#include "vtkDoubleArray.h"
-#include "vtkFieldData.h"
-#include "vtkFloatArray.h"
-#include "vtkInformation.h"
-#include "vtkMath.h"
-#include "vtkMultiPieceDataSet.h"
-#include "vtkNew.h"
-#include "vtkObjectFactory.h"
-#include "vtkPointData.h"
-#include "vtkPointSet.h"
-#include "vtkPolyData.h"
-#include "vtkStructuredGrid.h"
-#include "vtkTransform.h"
-#include "vtkTransformFilter.h"
-#include "vtkUnstructuredGrid.h"
-
-#include <sstream>
-
-vtkStandardNewMacro(vtkAngularPeriodicFilter);
-
-//----------------------------------------------------------------------------
-vtkAngularPeriodicFilter::vtkAngularPeriodicFilter()
-{
-  this->RotationMode = VTK_ROTATION_MODE_DIRECT_ANGLE;
-  this->RotationAngle = 180.;
-  this->RotationArrayName = 0;
-  this->RotationAxis = static_cast<int>(VTK_PERIODIC_ARRAY_AXIS_X);
-  this->Center[0] = 0;
-  this->Center[1] = 0;
-  this->Center[2] = 0;
-}
-
-//----------------------------------------------------------------------------
-vtkAngularPeriodicFilter::~vtkAngularPeriodicFilter()
-{
-  this->SetRotationArrayName(0);
-}
-
-//----------------------------------------------------------------------------
-void vtkAngularPeriodicFilter::PrintSelf(ostream& os, vtkIndent indent)
-{
-  this->Superclass::PrintSelf(os, indent);
-  if (this->RotationMode == VTK_ROTATION_MODE_DIRECT_ANGLE)
-    {
-    os << indent << "Rotation Mode: Direct Angle" << endl;
-    os << indent << "Rotation Angle: " << this->RotationAngle << endl;
-    }
-  else
-    {
-    os << indent << "Rotation Mode: Array Value" << endl;
-    os << indent << "Rotation Angle Array Name: " << this->RotationArrayName << endl;
-    }
-  switch (this->RotationAxis)
-    {
-    case VTK_PERIODIC_ARRAY_AXIS_X:
-      os << indent << "Rotation Axis: X" << endl;
-      break;
-    case VTK_PERIODIC_ARRAY_AXIS_Y:
-      os << indent << "Rotation Axis: Y" << endl;
-      break;
-    case VTK_PERIODIC_ARRAY_AXIS_Z:
-      os << indent << "Rotation Axis: Z" << endl;
-      break;
-    default:
-      break;
-    }
-}
-
-//----------------------------------------------------------------------------
-void vtkAngularPeriodicFilter::SetRotationAxisToX()
-{
-  this->SetRotationAxis(VTK_PERIODIC_ARRAY_AXIS_X);
-}
-
-//----------------------------------------------------------------------------
-void vtkAngularPeriodicFilter::SetRotationAxisToY()
-{
-  this->SetRotationAxis(VTK_PERIODIC_ARRAY_AXIS_Y);
-}
-
-//----------------------------------------------------------------------------
-void vtkAngularPeriodicFilter::SetRotationAxisToZ()
-{
-  this->SetRotationAxis(VTK_PERIODIC_ARRAY_AXIS_Z);
-}
-
-//----------------------------------------------------------------------------
-void vtkAngularPeriodicFilter::CreatePeriodicDataSet(
-  vtkCompositeDataIterator* loc,
-  vtkCompositeDataSet* output,
-  vtkCompositeDataSet* input)
-{
-  vtkDataObject* inputNode = input->GetDataSet(loc);
-  vtkNew<vtkMultiPieceDataSet> multiPiece;
-
-  // Number of periods
-  int periodsNb = 0;
-
-  // Rotation angle in degree
-  double angle = this->GetRotationAngle();
-  switch (this->GetRotationMode())
-    {
-    case VTK_ROTATION_MODE_DIRECT_ANGLE:
-      break;
-    case VTK_ROTATION_MODE_ARRAY_VALUE:
-      {
-      if (inputNode != NULL)
-        {
-        vtkDataArray* angleArray =
-          inputNode->GetFieldData()->GetArray(this->GetRotationArrayName());
-        if (!angleArray)
-          {
-          vtkErrorMacro(<< "Bad rotation mode.");
-          return;
-          }
-        double angleRad = angleArray->GetTuple1(0);
-        angle = vtkMath::DegreesFromRadians(angleRad);
-        }
-      else
-        {
-        angle = 360;
-        }
-      break;
-      }
-    default:
-      {
-      vtkErrorMacro(<< "Bad rotation mode.");
-      return;
-      }
-    }
-
-  switch (this->GetIterationMode())
-    {
-    case VTK_ITERATION_MODE_DIRECT_NB:
-      {
-      periodsNb = this->GetNumberOfPeriods();
-      break;
-      }
-
-    case VTK_ITERATION_MODE_MAX:
-      {
-      periodsNb = vtkMath::Round(360. / std::abs(angle));
-      break;
-      }
-
-    default:
-      {
-      vtkErrorMacro(<< "Bad iteration mode.");
-      return;
-      }
-    }
-
-  multiPiece->SetNumberOfPieces(periodsNb);
-  if (periodsNb > 0 && inputNode != NULL)
-    {
-    // Shallow copy the first piece, it is not transformed
-    vtkDataObject* firstDataSet = inputNode->NewInstance();
-    firstDataSet->ShallowCopy(inputNode);
-    multiPiece->SetPiece(0, firstDataSet);
-    firstDataSet->Delete();
-    this->GeneratePieceName(input, loc, multiPiece.Get(), 0);
-
-    for (vtkIdType iPiece = 1; iPiece < periodsNb; iPiece++)
-      {
-      this->AppendPeriodicPiece(angle, iPiece, inputNode, multiPiece.Get());
-      this->GeneratePieceName(input, loc, multiPiece.Get(), iPiece);
-      }
-    }
-  this->PeriodNumbers.push_back(periodsNb);
-  output->SetDataSet(loc, multiPiece.Get());
-}
-//----------------------------------------------------------------------------
-void vtkAngularPeriodicFilter::SetPeriodNumber(vtkCompositeDataIterator* loc,
-                             vtkCompositeDataSet* output,
-                             int nbPeriod)
-{
-  vtkMultiPieceDataSet* mp = vtkMultiPieceDataSet::SafeDownCast(output->GetDataSet(loc));
-  if (mp)
-    {
-    mp->SetNumberOfPieces(nbPeriod);
-    }
-  else
-    {
-    vtkErrorMacro(<< "Setting period on a non existent vtkMultiPieceDataSet");
-    }
-}
-
-//----------------------------------------------------------------------------
-void vtkAngularPeriodicFilter::AppendPeriodicPiece(double angle,
-  vtkIdType iPiece, vtkDataObject* inputNode, vtkMultiPieceDataSet* multiPiece)
-{
-  vtkPointSet* dataset = vtkPointSet::SafeDownCast(inputNode);
-  vtkPointSet* transformedDataset = NULL;
-
-  int pieceAlterner =  ((iPiece % 2) * 2 - 1) * ((iPiece + 1) / 2);
-  double pieceAngle = angle * pieceAlterner;
-
-  // MappedData supported type are pointset
-  if (dataset)
-    {
-    transformedDataset = dataset->NewInstance();
-
-    // Transform periodic points and cells
-    this->ComputePeriodicMesh(dataset, transformedDataset, pieceAngle);
-    multiPiece->SetPiece(iPiece, transformedDataset);
-    transformedDataset->Delete();
-    }
-  else
-    {
-    // Legacy non mapped code, for unsuported type dataset
-    vtkWarningMacro(
-      "Unsupported Dataset Type for mapped array, using vtkTransformFilter instead.");
-    vtkNew<vtkTransform> transform;
-    switch (this->RotationAxis)
-      {
-      case VTK_PERIODIC_ARRAY_AXIS_X:
-        transform->RotateX(pieceAngle);
-        break;
-      case VTK_PERIODIC_ARRAY_AXIS_Y:
-        transform->RotateY(pieceAngle);
-        break;
-      case VTK_PERIODIC_ARRAY_AXIS_Z:
-        transform->RotateZ(pieceAngle);
-        break;
-      }
-
-    vtkNew<vtkTransformFilter> transformFilter;
-    transformFilter->SetInputData(inputNode);
-    transformFilter->SetTransform(transform.Get());
-    transformFilter->Update();
-
-    multiPiece->SetPiece(iPiece, transformFilter->GetOutput());
-    }
-}
-
-//----------------------------------------------------------------------------
-vtkDataArray* vtkAngularPeriodicFilter::TransformDataArray(
-  vtkDataArray* inputArray, double angle, bool useCenter, bool normalize)
-{
-  vtkDataArray* periodicArray = 0;
-  switch (inputArray->GetDataType())
-    {
-    case VTK_FLOAT:
-      {
-      vtkAngularPeriodicDataArray<float>* pArray =
-        vtkAngularPeriodicDataArray<float>::New();
-      pArray->SetAxis(this->RotationAxis);
-      pArray->SetAngle(angle);
-      if (useCenter)
-        {
-        pArray->SetCenter(this->Center);
-        }
-      pArray->SetNormalize(normalize);
-      pArray->InitializeArray(vtkFloatArray::SafeDownCast(inputArray));
-      periodicArray = pArray;
-      break;
-      }
-    case VTK_DOUBLE:
-      {
-      vtkAngularPeriodicDataArray<double>* pArray =
-        vtkAngularPeriodicDataArray<double>::New();
-      pArray->SetAxis(this->RotationAxis);
-      pArray->SetAngle(angle);
-      if (useCenter)
-        {
-        pArray->SetCenter(this->Center);
-        }
-      pArray->SetNormalize(normalize);
-      pArray->InitializeArray(vtkDoubleArray::SafeDownCast(inputArray));
-      periodicArray = pArray;
-      break;
-      }
-    default:
-      {
-      vtkErrorMacro("Unknown data type " << inputArray->GetDataType());
-      periodicArray = vtkDataArray::CreateDataArray(inputArray->GetDataType());
-      periodicArray->DeepCopy(inputArray);
-      break;
-      }
-    }
-  return periodicArray;
-}
-
-//----------------------------------------------------------------------------
-void vtkAngularPeriodicFilter::ComputeAngularPeriodicData(
-  vtkDataSetAttributes* data, vtkDataSetAttributes* transformedData, double angle)
-{
-  for (int i = 0; i < data->GetNumberOfArrays(); i++)
-    {
-    int attribute = data->IsArrayAnAttribute(i);
-    vtkDataArray* array = data->GetArray(i);
-    vtkDataArray* transformedArray;
-    // Perdiodic copy of vector (3 components) or tensor (9 components) data
-    if (array->GetNumberOfComponents() == 3 || array->GetNumberOfComponents() == 9)
-      {
-      transformedArray = this->TransformDataArray(array, angle, false,
-        attribute == vtkDataSetAttributes::NORMALS);
-      }
-    else
-      {
-      transformedArray = array;
-      array->Register(0);
-      }
-    transformedData->AddArray(transformedArray);
-    if (attribute >= 0)
-      {
-      transformedData->SetAttribute(transformedArray, attribute);
-      }
-    transformedArray->Delete();
-    }
-}
-
-//----------------------------------------------------------------------------
-void vtkAngularPeriodicFilter::ComputePeriodicMesh(vtkPointSet* dataset,
-  vtkPointSet* transformedDataset, double angle)
-{
-  // Shallow copy data structure
-  transformedDataset->CopyStructure(dataset);
-
-  // Transform points coordinates array
-  vtkPoints* points = dataset->GetPoints();
-  if (points != NULL)
-    {
-    vtkDataArray* pointArray = dataset->GetPoints()->GetData();
-    vtkNew<vtkPoints> rotatedPoints;
-    vtkDataArray* transformedArray = this->TransformDataArray(pointArray, angle, true);
-    rotatedPoints->SetData(transformedArray);
-    transformedArray->Delete();
-    // Set the points
-    transformedDataset->SetPoints(rotatedPoints.Get());
-    }
-
-  // Transform point data
-  this->ComputeAngularPeriodicData(
-    dataset->GetPointData(), transformedDataset->GetPointData(), angle);
-
-  // Transform cell data
-  this->ComputeAngularPeriodicData(
-    dataset->GetCellData(), transformedDataset->GetCellData(), angle);
-
-  // Shallow copy field data
-  transformedDataset->GetFieldData()->ShallowCopy(dataset->GetFieldData());
-}
-
-//----------------------------------------------------------------------------
-int vtkAngularPeriodicFilter::RequestData(vtkInformation *request,
-                                   vtkInformationVector **inputVector,
-                                   vtkInformationVector *outputVector)
-{
-  if (this->GetRotationMode() == VTK_ROTATION_MODE_ARRAY_VALUE &&
-      this->GetIterationMode() == VTK_ITERATION_MODE_MAX)
-    {
-    this->ReducePeriodNumbers = true;
-    }
-  return this->Superclass::RequestData(request, inputVector, outputVector);
-}
-
-//----------------------------------------------------------------------------
-void vtkAngularPeriodicFilter::GeneratePieceName(vtkCompositeDataSet* input,
-  vtkCompositeDataIterator* inputLoc, vtkMultiPieceDataSet* output, vtkIdType outputId)
-{
-  vtkDataObjectTree* inputTree = vtkDataObjectTree::SafeDownCast(input);
-  if (!inputTree)
-    {
-    return;
-    }
-  std::ostringstream ss;
-  const char* parentName =
-    inputTree->GetMetaData(inputLoc)->Get(vtkCompositeDataSet::NAME());
-  if (parentName)
-    {
-    ss << parentName;
-    }
-  else
-    {
-    ss << "Piece";
-    }
-  ss << "_period" << outputId;
-  output->GetMetaData(outputId)->Set(vtkCompositeDataSet::NAME(), ss.str().c_str());
-}
diff --git a/Filters/Parallel/vtkAngularPeriodicFilter.h b/Filters/Parallel/vtkAngularPeriodicFilter.h
deleted file mode 100644
index b3bee2f..0000000
--- a/Filters/Parallel/vtkAngularPeriodicFilter.h
+++ /dev/null
@@ -1,156 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkPeriodicFiler.h
-
-  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.
-
-=========================================================================*/
-
-// .NAME vtkAngularPeriodicFilter - A filter to produce mapped angular periodic
-// multiblock dataset from a single block, by rotation.
-//
-// .SECTION Description:
-// Generate angular periodic dataset by rotating points, vectors and tensors
-// data arrays from an original data array.
-// The generated dataset is of the same type than the input (float or double).
-// To compute the rotation this filter needs
-// i) a number of periods, wich can be the maximum, i.e. a full period,
-// ii) an angle, wich can be fetched from a field data array in radian or directly
-// in degrees; iii) the axis (X, Y or Z) and the center of rotation.
-// Point coordinates are transformed, as well as all vectors (3-components) and
-// tensors (9 components) in points and cell data arrays.
-// The generated multiblock will have the same tree architecture than the input,
-// except transformed leaves are replaced by a vtkMultipieceDataSet.
-// Supported input leaf dataset type are: vtkPolyData, vtkStructuredGrid
-// and vtkUnstructuredGrid. Other data objects are rotated using the
-// transform filter (at a high cost!).
-
-#ifndef vtkAngularPeriodicFilter_h
-#define vtkAngularPeriodicFilter_h
-
-#include "vtkFiltersParallelModule.h" // For export macro
-#include "vtkPeriodicFilter.h"
-
-class vtkDataSetAttributes;
-class vtkMultiPieceDataSet;
-class vtkPointSet;
-
-#define VTK_ROTATION_MODE_DIRECT_ANGLE 0  // Use user-provided angle
-#define VTK_ROTATION_MODE_ARRAY_VALUE  1  // Use array from input data as angle
-
-class VTKFILTERSPARALLEL_EXPORT vtkAngularPeriodicFilter : public vtkPeriodicFilter
-{
-public:
-  static vtkAngularPeriodicFilter* New();
-  vtkTypeMacro(vtkAngularPeriodicFilter, vtkPeriodicFilter);
-  void PrintSelf(ostream& os, vtkIndent indent);
-
-  // Description:
-  // Set/Get The rotation mode.
-  // VTK_ROTATION_MODE_DIRECT_ANGLE to specifiy a angle value (default),
-  // VTK_ROTATION_MODE_ARRAY_VALUE to use value from an array in the input dataset.
-  vtkSetClampMacro(RotationMode, int,
-    VTK_ROTATION_MODE_DIRECT_ANGLE, VTK_ROTATION_MODE_ARRAY_VALUE);
-  vtkGetMacro(RotationMode, int);
-  void SetRotationModeToDirectAngle()
-    { this->SetRotationMode(VTK_ROTATION_MODE_DIRECT_ANGLE); }
-  void SetRotationModeToArrayValue()
-    { this->SetRotationMode(VTK_ROTATION_MODE_ARRAY_VALUE); }
-
-  // Description:
-  // Set/Get Rotation angle, in degrees.
-  // Used only with VTK_ROTATION_MODE_DIRECT_ANGLE.
-  // Default is 180.
-  vtkSetMacro(RotationAngle, double);
-  vtkGetMacro(RotationAngle, double);
-
-  // Description:
-  // Set/Get Name of array to get the angle from.
-  // Used only with VTK_ROTATION_MODE_ARRAY_VALUE.
-  vtkSetStringMacro(RotationArrayName);
-  vtkGetStringMacro(RotationArrayName);
-
-  // Description:
-  // Set/Get Rotation Axis, 0 for X, 1 for Y, 2 for Z
-  vtkSetClampMacro(RotationAxis, int, 0, 2);
-  vtkGetMacro(RotationAxis, int);
-  void SetRotationAxisToX();
-  void SetRotationAxisToY();
-  void SetRotationAxisToZ();
-
-  // Description:
-  // Set/Get Rotation Center
-  vtkSetVector3Macro(Center, double);
-  vtkGetVector3Macro(Center, double);
-
-protected:
-  vtkAngularPeriodicFilter();
-  ~vtkAngularPeriodicFilter();
-
-  virtual int RequestData(vtkInformation *,
-                          vtkInformationVector **,
-                          vtkInformationVector *);
-
-  // Description:
-  // Create a transform copy of the provided data array
-  vtkDataArray* TransformDataArray(vtkDataArray* inputArray,
-                                   double angle,
-                                   bool useCenter = true,
-                                   bool normalize = false);
-
-  // Description:
-  // Append a periodic piece to dataset, by computing rotated mesh and data
-  void AppendPeriodicPiece(double angle, vtkIdType iPiece,
-                           vtkDataObject* inputNode,
-                           vtkMultiPieceDataSet* multiPiece);
-
-  // Description:
-  // Manually set the number of period on a specific leaf
-  virtual void SetPeriodNumber(vtkCompositeDataIterator* loc,
-                               vtkCompositeDataSet* output,
-                               int nbPeriod);
-
-  // Description:
-  // Compute periodic pointset, rotating point, using provided angle
-  void ComputePeriodicMesh(vtkPointSet* dataset, vtkPointSet* rotatedDataset,
-                           double angle);
-
-  // Description:
-  // Compute periodic point/cell data, using provided angle
-  void ComputeAngularPeriodicData(vtkDataSetAttributes* data,
-                                  vtkDataSetAttributes* rotatedData,
-                                  double angle);
-
-  // Description:
-  // Create a periodic data, leaf of the tree
-  void CreatePeriodicDataSet(vtkCompositeDataIterator* loc,
-                             vtkCompositeDataSet* output,
-                             vtkCompositeDataSet* input);
-
-  // Description:
-  // Generate a name for a piece in the periodic dataset from the input dataset
-  virtual void GeneratePieceName(vtkCompositeDataSet* input,
-                                 vtkCompositeDataIterator* inputLoc,
-                                 vtkMultiPieceDataSet* output,
-                                 vtkIdType outputId);
-private:
-  vtkAngularPeriodicFilter(const vtkAngularPeriodicFilter&); // Not implemented.
-  void operator=(const vtkAngularPeriodicFilter&); // Not implemented.
-
-  int RotationMode;
-  char* RotationArrayName;  // user-provided array name to use as angle, for ROTATION_MODE_ARRAY_VALUE
-
-  // Transform parameters
-  double RotationAngle;
-  int RotationAxis;         // Axis to rotate around, 0 for X, 1 for Y, 2 for Z
-  double Center[3];         // Center of rotation
-};
-
-#endif
diff --git a/Filters/Parallel/vtkCollectGraph.cxx b/Filters/Parallel/vtkCollectGraph.cxx
index bea22be..1f83840 100644
--- a/Filters/Parallel/vtkCollectGraph.cxx
+++ b/Filters/Parallel/vtkCollectGraph.cxx
@@ -275,7 +275,7 @@ int vtkCollectGraph::RequestData(
       vtkIntArray *idArrInt = vtkIntArray::SafeDownCast(idArr);
 
       vtkIntArray *ghostLevelsArr = vtkIntArray::SafeDownCast(
-        wholePointData->GetAbstractArray(vtkDataSetAttributes::GhostArrayName()));
+        wholePointData->GetAbstractArray("vtkGhostLevels"));
 
       // Add new vertices
       localIdVec.clear();
@@ -345,7 +345,7 @@ int vtkCollectGraph::RequestData(
 
       // Add non-ghost edges
       vtkIntArray* edgeGhostLevelsArr = vtkIntArray::SafeDownCast(
-        curGraph->GetEdgeData()->GetAbstractArray(vtkDataSetAttributes::GhostArrayName()));
+        curGraph->GetEdgeData()->GetAbstractArray("vtkGhostLevels"));
       curGraph->GetEdges(edges);
       while (edges->HasNext())
         {
diff --git a/Filters/Parallel/vtkExtractCTHPart.cxx b/Filters/Parallel/vtkExtractCTHPart.cxx
index e6c278d..ee1a2a9 100644
--- a/Filters/Parallel/vtkExtractCTHPart.cxx
+++ b/Filters/Parallel/vtkExtractCTHPart.cxx
@@ -558,14 +558,14 @@ bool vtkExtractCTHPart::ExtractContourOnBlock(
 
   vtkPolyData* output =
     vtkPolyData::SafeDownCast(contourer->GetOutputDataObject(0));
-  if (!output || output->GetNumberOfPoints()== 0)
+  if (!output && output->GetNumberOfPoints()== 0)
     {
     return true;
     }
   if (!this->RemoveGhostCells &&
-    output->GetCellData()->GetArray(vtkDataSetAttributes::GhostArrayName()))
+    output->GetCellData()->GetArray("vtkGhostLevels"))
     {
-    output->GetCellData()->GetArray(vtkDataSetAttributes::GhostArrayName())->SetName("OriginalGhostLevels");
+    output->GetCellData()->GetArray("vtkGhostLevels")->SetName("OriginalGhostLevels");
     }
 
   fragments.push_back(output);
@@ -591,7 +591,7 @@ void vtkExtractCTHPart::ExtractExteriorSurface(
   input->GetExtent(ext);
   input->GetExtent(originalExtents);
 
-//  vtkUnsignedCharArray *ghostArray=static_cast<vtkUnsignedCharArray *>(input->GetCellData()->GetArray(vtkDataSetAttributes::GhostArrayName()));
+//  vtkUnsignedCharArray *ghostArray=static_cast<vtkUnsignedCharArray *>(input->GetCellData()->GetArray("vtkGhostLevels"));
 
   // bounds without taking ghost cells into account
   double bounds[6];
diff --git a/Filters/Parallel/vtkExtractPolyDataPiece.cxx b/Filters/Parallel/vtkExtractPolyDataPiece.cxx
index c09f3a2..c49b6e0 100644
--- a/Filters/Parallel/vtkExtractPolyDataPiece.cxx
+++ b/Filters/Parallel/vtkExtractPolyDataPiece.cxx
@@ -194,7 +194,7 @@ int vtkExtractPolyDataPiece::RequestData(
       if (cellGhostLevels)
         {
         cellGhostLevels->InsertNextValue(
-          (cellTags->GetValue(cellId) > 0) ? vtkDataSetAttributes::DUPLICATECELL : 0);
+          (unsigned char)(cellTags->GetValue(cellId)));
         }
 
       cell = input->GetCell(cellId);
@@ -211,7 +211,7 @@ int vtkExtractPolyDataPiece::RequestData(
           if (pointGhostLevels)
             {
             pointGhostLevels->InsertNextValue(
-              cellTags->GetValue(pointOwnership->GetId(ptId)) > 0 ? vtkDataSetAttributes::DUPLICATEPOINT : 0);
+              cellTags->GetValue(pointOwnership->GetId(ptId)));
             }
           pointMap->SetId(ptId,newId);
           outPD->CopyData(pd,ptId,newId);
@@ -266,14 +266,14 @@ int vtkExtractPolyDataPiece::RequestData(
 
   if (cellGhostLevels)
     {
-    cellGhostLevels->SetName(vtkDataSetAttributes::GhostArrayName());
+    cellGhostLevels->SetName("vtkGhostLevels");
     output->GetCellData()->AddArray(cellGhostLevels);
     cellGhostLevels->Delete();
     cellGhostLevels = 0;
      }
   if (pointGhostLevels)
     {
-    pointGhostLevels->SetName(vtkDataSetAttributes::GhostArrayName());
+    pointGhostLevels->SetName("vtkGhostLevels");
     output->GetPointData()->AddArray(pointGhostLevels);
     pointGhostLevels->Delete();
     pointGhostLevels = 0;
diff --git a/Filters/Parallel/vtkExtractUnstructuredGridPiece.cxx b/Filters/Parallel/vtkExtractUnstructuredGridPiece.cxx
index 8cb94e8..4dbd787 100644
--- a/Filters/Parallel/vtkExtractUnstructuredGridPiece.cxx
+++ b/Filters/Parallel/vtkExtractUnstructuredGridPiece.cxx
@@ -258,9 +258,9 @@ int vtkExtractUnstructuredGridPiece::RequestData(
       if (cellGhostLevels)
         {
         cellGhostLevels->InsertNextValue(
-          cellTags->GetValue(cellId) > 0 ?
-          vtkDataSetAttributes::DUPLICATECELL : 0);
+          (unsigned char)(cellTags->GetValue(cellId)));
         }
+
       if (cellType != VTK_POLYHEDRON)
         {
         for (i=0; i < numCellPts; i++)
@@ -273,8 +273,7 @@ int vtkExtractUnstructuredGridPiece::RequestData(
             if (pointGhostLevels && pointOwnership)
               {
               pointGhostLevels->InsertNextValue(
-                cellTags->GetValue(pointOwnership->GetId(ptId)) > 0 ?
-                vtkDataSetAttributes::DUPLICATEPOINT : 0);
+                    cellTags->GetValue(pointOwnership->GetId(ptId)));
               }
             pointMap->SetId(ptId,newId);
             outPD->CopyData(pd,ptId,newId);
@@ -301,8 +300,7 @@ int vtkExtractUnstructuredGridPiece::RequestData(
               if (pointGhostLevels && pointOwnership)
                 {
                 pointGhostLevels->InsertNextValue(
-                  cellTags->GetValue(pointOwnership->GetId(ptId)) > 0 ?
-                  vtkDataSetAttributes::DUPLICATEPOINT : 0);
+                      cellTags->GetValue(pointOwnership->GetId(ptId)));
                 }
               pointMap->SetId(ptId,newId);
               outPD->CopyData(pd,ptId,newId);
@@ -358,14 +356,14 @@ int vtkExtractUnstructuredGridPiece::RequestData(
 
   if (cellGhostLevels)
     {
-    cellGhostLevels->SetName(vtkDataSetAttributes::GhostArrayName());
+    cellGhostLevels->SetName("vtkGhostLevels");
     output->GetCellData()->AddArray(cellGhostLevels);
     cellGhostLevels->Delete();
     cellGhostLevels = 0;
     }
   if (pointGhostLevels)
     {
-    pointGhostLevels->SetName(vtkDataSetAttributes::GhostArrayName());
+    pointGhostLevels->SetName("vtkGhostLevels");
     output->GetPointData()->AddArray(pointGhostLevels);
     pointGhostLevels->Delete();
     pointGhostLevels = 0;
diff --git a/Filters/Parallel/vtkExtractUserDefinedPiece.cxx b/Filters/Parallel/vtkExtractUserDefinedPiece.cxx
index 9738b02..ed15167 100644
--- a/Filters/Parallel/vtkExtractUserDefinedPiece.cxx
+++ b/Filters/Parallel/vtkExtractUserDefinedPiece.cxx
@@ -162,8 +162,7 @@ int vtkExtractUserDefinedPiece::RequestData(
       if (cellGhostLevels)
         {
         cellGhostLevels->InsertNextValue(
-          cellTags->GetValue(cellId) > 0 ?
-          vtkDataSetAttributes::DUPLICATECELL : 0);
+          (unsigned char)(cellTags->GetValue(cellId)));
         }
 
       cell = input->GetCell(cellId);
@@ -180,8 +179,7 @@ int vtkExtractUserDefinedPiece::RequestData(
           if (pointGhostLevels)
             {
             pointGhostLevels->InsertNextValue(
-              cellTags->GetValue(pointOwnership->GetId(ptId)) > 0 ?
-              vtkDataSetAttributes::DUPLICATEPOINT : 0);
+              cellTags->GetValue(pointOwnership->GetId(ptId)));
             }
           pointMap->SetId(ptId,newId);
           outPD->CopyData(pd,ptId,newId);
@@ -203,14 +201,14 @@ int vtkExtractUserDefinedPiece::RequestData(
 
   if (cellGhostLevels)
     {
-    cellGhostLevels->SetName(vtkDataSetAttributes::GhostArrayName());
+    cellGhostLevels->SetName("vtkGhostLevels");
     output->GetCellData()->AddArray(cellGhostLevels);
     cellGhostLevels->Delete();
     cellGhostLevels = 0;
      }
   if (pointGhostLevels)
     {
-    pointGhostLevels->SetName(vtkDataSetAttributes::GhostArrayName());
+    pointGhostLevels->SetName("vtkGhostLevels");
     output->GetPointData()->AddArray(pointGhostLevels);
     pointGhostLevels->Delete();
     pointGhostLevels = 0;
@@ -267,3 +265,4 @@ ComputeCellTagsWithFunction(vtkIntArray *tags,
 
   cellPtIds->Delete();
 }
+
diff --git a/Filters/Parallel/vtkPCellDataToPointData.cxx b/Filters/Parallel/vtkPCellDataToPointData.cxx
index 20a8b08..18764d9 100644
--- a/Filters/Parallel/vtkPCellDataToPointData.cxx
+++ b/Filters/Parallel/vtkPCellDataToPointData.cxx
@@ -44,6 +44,24 @@ int vtkPCellDataToPointData::RequestData(
     return 0;
     }
 
+  // Remove the extra (now ivalid) ghost cells.
+  // This is only necessary fro unstructured data.
+  if (this->PieceInvariant)
+    {
+    vtkInformation* outInfo = outputVector->GetInformationObject(0);
+    int ghostLevel = outInfo->Get(
+      vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_GHOST_LEVELS());
+    vtkPolyData *pd = vtkPolyData::SafeDownCast(output);
+    vtkUnstructuredGrid *ug = vtkUnstructuredGrid::SafeDownCast(output);
+    if (pd)
+      {
+      pd->RemoveGhostCells(ghostLevel+1);
+      }
+    if (ug)
+      {
+      ug->RemoveGhostCells(ghostLevel+1);
+      }
+    }
   return 1;
 }
 
diff --git a/Filters/Parallel/vtkPKdTree.cxx b/Filters/Parallel/vtkPKdTree.cxx
index a9d07d2..a1841f9 100644
--- a/Filters/Parallel/vtkPKdTree.cxx
+++ b/Filters/Parallel/vtkPKdTree.cxx
@@ -1955,7 +1955,7 @@ int vtkPKdTree::CompleteTree()
 
   if (this->AllCheckForFailure(fail, "CompleteTree", "memory allocation"))
     {
-    delete [] buf;
+    if (buf) delete [] buf;
     return 1;
     }
 
diff --git a/Filters/Parallel/vtkPLinearExtrusionFilter.cxx b/Filters/Parallel/vtkPLinearExtrusionFilter.cxx
index bdea3e8..c053942 100644
--- a/Filters/Parallel/vtkPLinearExtrusionFilter.cxx
+++ b/Filters/Parallel/vtkPLinearExtrusionFilter.cxx
@@ -37,12 +37,26 @@ int vtkPLinearExtrusionFilter::RequestData(
   vtkInformationVector **inputVector,
   vtkInformationVector *outputVector)
 {
+  // get the info object
+  vtkInformation *outInfo = outputVector->GetInformationObject(0);
+
+  // get the ouptut
+  vtkPolyData *output = vtkPolyData::SafeDownCast(
+    outInfo->Get(vtkDataObject::DATA_OBJECT()));
+
   if (!this->vtkLinearExtrusionFilter::RequestData(request,
                                                    inputVector, outputVector))
     {
     return 0;
     }
 
+  if (this->PieceInvariant)
+    {
+    output->RemoveGhostCells(
+      outInfo->Get(
+        vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_GHOST_LEVELS())+1);
+    }
+
   return 1;
 }
 
diff --git a/Filters/Parallel/vtkPPolyDataNormals.cxx b/Filters/Parallel/vtkPPolyDataNormals.cxx
index 234b0a4..1b39ce7 100644
--- a/Filters/Parallel/vtkPPolyDataNormals.cxx
+++ b/Filters/Parallel/vtkPPolyDataNormals.cxx
@@ -34,11 +34,25 @@ int vtkPPolyDataNormals::RequestData(
   vtkInformationVector **inputVector,
   vtkInformationVector *outputVector)
 {
+  // get the info object
+  vtkInformation *outInfo = outputVector->GetInformationObject(0);
+
+  // get the ouptut
+  vtkPolyData *output = vtkPolyData::SafeDownCast(
+    outInfo->Get(vtkDataObject::DATA_OBJECT()));
+
   if (!this->vtkPolyDataNormals::RequestData(request, inputVector, outputVector))
     {
     return 0;
     }
 
+  if (this->PieceInvariant)
+    {
+    output->RemoveGhostCells(
+      outInfo->Get(
+        vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_GHOST_LEVELS())+1);
+    }
+
   return 1;
 }
 
diff --git a/Filters/Parallel/vtkPSphereSource.cxx b/Filters/Parallel/vtkPSphereSource.cxx
index 6e46023..b72adf3 100644
--- a/Filters/Parallel/vtkPSphereSource.cxx
+++ b/Filters/Parallel/vtkPSphereSource.cxx
@@ -270,7 +270,7 @@ unsigned long vtkPSphereSource::GetEstimatedMemorySize()
 
   sz = sz + sz2;
 
-  // convert to kibibytes (1024 bytes)
+  // convert to kilobytes
   sz >>= 10;
 
   return sz.CastToUnsignedLong();
diff --git a/Filters/Parallel/vtkPSphereSource.h b/Filters/Parallel/vtkPSphereSource.h
index d76bbc6..efad0a8 100644
--- a/Filters/Parallel/vtkPSphereSource.h
+++ b/Filters/Parallel/vtkPSphereSource.h
@@ -32,7 +32,7 @@ public:
   virtual void PrintSelf(ostream& os, vtkIndent indent);
 
   // Description:
-  // Get the estimated memory size in kibibytes (1024 bytes).
+  // Get the estimated memory size in 1024 bytes
   unsigned long GetEstimatedMemorySize();
 
 protected:
diff --git a/Filters/Parallel/vtkPeriodicFilter.cxx b/Filters/Parallel/vtkPeriodicFilter.cxx
deleted file mode 100644
index 9f5ee2a..0000000
--- a/Filters/Parallel/vtkPeriodicFilter.cxx
+++ /dev/null
@@ -1,148 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkPeriodicFiler.h
-
-  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 "vtkPeriodicFilter.h"
-
-#include "vtkDataObjectTreeIterator.h"
-#include "vtkInformationVector.h"
-#include "vtkMultiBlockDataSet.h"
-#include "vtkMultiProcessController.h"
-
-//----------------------------------------------------------------------------
-vtkPeriodicFilter::vtkPeriodicFilter()
-{
-  this->IterationMode = VTK_ITERATION_MODE_MAX;
-  this->NumberOfPeriods = 1;
-  this->ReducePeriodNumbers = false;
-}
-
-//----------------------------------------------------------------------------
-vtkPeriodicFilter::~vtkPeriodicFilter()
-{
-}
-
-//----------------------------------------------------------------------------
-void vtkPeriodicFilter::PrintSelf(ostream& os, vtkIndent indent)
-{
-  this->Superclass::PrintSelf(os, indent);
-  if (this->IterationMode == VTK_ITERATION_MODE_DIRECT_NB)
-    {
-    os << indent << "Iteration Mode: Direct Number" << endl;
-    os << indent << "Number of Periods: " << this->NumberOfPeriods << endl;
-    }
-  else
-    {
-    os << indent << "Iteration Mode: Maximum" << endl;
-    }
-}
-
-//----------------------------------------------------------------------------
-void vtkPeriodicFilter::AddIndex(unsigned int index)
-{
-  this->Indices.insert(index);
-  this->Modified();
-}
-
-//----------------------------------------------------------------------------
-void vtkPeriodicFilter::RemoveIndex(unsigned int index)
-{
-  this->Indices.erase(index);
-  this->Modified();
-}
-
-//----------------------------------------------------------------------------
-void vtkPeriodicFilter::RemoveAllIndices()
-{
-  this->Indices.clear();
-  this->Modified();
-}
-
-//----------------------------------------------------------------------------
-int vtkPeriodicFilter::RequestData(vtkInformation *vtkNotUsed(request),
-                                   vtkInformationVector **inputVector,
-                                   vtkInformationVector *outputVector)
-{
-  vtkMultiBlockDataSet *input = vtkMultiBlockDataSet::GetData(inputVector[0], 0);
-  vtkMultiBlockDataSet *output = vtkMultiBlockDataSet::GetData(outputVector, 0);
-
-  if (this->Indices.empty())
-    {
-    // Trivial case
-    output->ShallowCopy(input);
-    return 1;
-    }
-
-  this->PeriodNumbers.clear();
-
-  output->CopyStructure(input);
-
-  // Copy selected blocks over to the output.
-  vtkDataObjectTreeIterator* iter = input->NewTreeIterator();
-
-  // Generate leaf multipieces
-  iter->VisitOnlyLeavesOn();
-  iter->SkipEmptyNodesOff();
-  iter->InitTraversal();
-  while (!iter->IsDoneWithTraversal() && this->Indices.size() > 0)
-    {
-    const unsigned int index = iter->GetCurrentFlatIndex();
-    if (this->Indices.find(index) != this->Indices.end())
-      {
-      this->CreatePeriodicDataSet(iter, output, input);
-      }
-    else
-      {
-      vtkDataObject* inputLeaf = input->GetDataSet(iter);
-      if (inputLeaf)
-        {
-        vtkDataObject* newLeaf = inputLeaf->NewInstance();
-        newLeaf->ShallowCopy(inputLeaf);
-        output->SetDataSet(iter, newLeaf);
-        newLeaf->Delete();
-        }
-      }
-    iter->GoToNextItem();
-    }
-
-  // Reduce period number in case of parrallelism, and update empty multipieces
-  if (this->ReducePeriodNumbers)
-    {
-    int* reducedPeriodNumbers = new int[this->PeriodNumbers.size()];
-    vtkMultiProcessController *controller = vtkMultiProcessController::GetGlobalController();
-    if (controller)
-      {
-      controller->AllReduce(&this->PeriodNumbers.front(), reducedPeriodNumbers,
-        this->PeriodNumbers.size(), vtkCommunicator::MAX_OP);
-      int i = 0;
-      iter->InitTraversal();
-      while (!iter->IsDoneWithTraversal() && this->Indices.size() > 0)
-        {
-        if (reducedPeriodNumbers[i] > this->PeriodNumbers[i])
-          {
-          const unsigned int index = iter->GetCurrentFlatIndex();
-          if (this->Indices.find(index) != this->Indices.end())
-            {
-            this->SetPeriodNumber(iter, output, reducedPeriodNumbers[i]);
-            }
-          }
-        iter->GoToNextItem();
-        i++;
-        }
-      }
-    delete [] reducedPeriodNumbers;
-    }
-  iter->Delete();
-  return 1;
-}
diff --git a/Filters/Parallel/vtkPeriodicFilter.h b/Filters/Parallel/vtkPeriodicFilter.h
deleted file mode 100644
index 74bcf18..0000000
--- a/Filters/Parallel/vtkPeriodicFilter.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkPeriodicFiler.h
-
-  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.
-
-=========================================================================*/
-
-// .NAME vtkPeriodicFilter - A filter to produce mapped  periodic
-// multiblock dataset from a single block
-//
-// .SECTION Description:
-// Generate periodic dataset by transforming points, vectors, tensors
-// data arrays from an original data array.
-// The generated dataset is of the same type than the input (float or double).
-// This is an abstract class wich do not implement the actual transformation.
-// Point coordinates are transformed, as well as all vectors (3-components) and
-// tensors (9 components) in points and cell data arrays.
-// The generated multiblock will have the same tree architecture than the input,
-// except transformed leaves are replaced by a vtkMultipieceDataSet.
-// Supported input leaf dataset type are: vtkPolyData, vtkStructuredGrid
-// and vtkUnstructuredGrid. Other data objects are transformed using the
-// transform filter (at a high cost!).
-
-#ifndef vtkPeriodicFilter_h
-#define vtkPeriodicFilter_h
-
-#include "vtkFiltersParallelModule.h" // For export macro
-#include "vtkMultiBlockDataSetAlgorithm.h"
-
-#include <set> // For block selection
-#include <vector> // For pieces number
-
-class vtkCompositeDataIterator;
-class vtkCompositeDataSet;
-class vtkDataObjectTreeIterator;
-class vtkMultiPieceDataSet;
-
-#define VTK_ITERATION_MODE_DIRECT_NB 0    // Generate a user-provided number of periods
-#define VTK_ITERATION_MODE_MAX       1    // Generate a maximum of periods, i.e. a full period.
-
-class VTKFILTERSPARALLEL_EXPORT vtkPeriodicFilter : public vtkMultiBlockDataSetAlgorithm
-{
-public:
-  vtkTypeMacro(vtkPeriodicFilter, vtkMultiBlockDataSetAlgorithm);
-  void PrintSelf(ostream& os, vtkIndent indent);
-
-  // Description:
-  // Set/Get Iteration mode.
-  // VTK_ITERATION_MODE_DIRECT_NB to specify the number of periods,
-  // VTK_ITERATION_MODE_MAX to generate a full period (default).
-  vtkSetClampMacro(IterationMode, int,
-                   VTK_ITERATION_MODE_DIRECT_NB,
-                   VTK_ITERATION_MODE_MAX);
-  vtkGetMacro(IterationMode, int);
-  void SetIterationModeToDirectNb()
-    { this->SetIterationMode(VTK_ITERATION_MODE_DIRECT_NB); }
-  void SetIterationModeToMax()
-    { this->SetIterationMode(VTK_ITERATION_MODE_MAX); }
-
-  // Description:
-  // Set/Get Number of periods.
-  // Used only with ITERATION_MODE_DIRECT_NB.
-  vtkSetMacro(NumberOfPeriods, int);
-  vtkGetMacro(NumberOfPeriods, int);
-
-  // Description:
-  // Select the periodic pieces indices.
-  // Each node in the multi - block tree is identified by an \c index. The index can
-  // be obtained by performing a preorder traversal of the tree (including empty
-  // nodes). eg. A(B (D, E), C(F, G)).
-  // Inorder traversal yields: A, B, D, E, C, F, G
-  // Index of A is 0, while index of C is 4.
-  virtual void AddIndex(unsigned int index);
-
-  // Description:
-  // Remove an index from selected indices tress
-  virtual void RemoveIndex(unsigned int index);
-
-  // Description:
-  // Clear selected indices tree
-  virtual void RemoveAllIndices();
-
-protected:
-  vtkPeriodicFilter();
-  ~vtkPeriodicFilter();
-
-  virtual int RequestData(vtkInformation *,
-                          vtkInformationVector **,
-                          vtkInformationVector *);
-
-  // Description:
-  // Create a periodic data, leaf of the tree
-  virtual void CreatePeriodicDataSet(vtkCompositeDataIterator* loc,
-                                     vtkCompositeDataSet* output,
-                                     vtkCompositeDataSet* input) = 0;
-
-  // Description:
-  // Manually set the number of period on a specific leaf
-  virtual void SetPeriodNumber(vtkCompositeDataIterator* loc,
-                               vtkCompositeDataSet* output,
-                               int nbPeriod) = 0;
-
-  std::vector<int> PeriodNumbers;     // Periods numbers by leaf
-  bool ReducePeriodNumbers;
-
-private:
-  vtkPeriodicFilter(const vtkPeriodicFilter&); // Not implemented.
-  void operator=(const vtkPeriodicFilter&); // Not implemented.
-
-  int IterationMode;
-  int NumberOfPeriods;      // User provided number of periods
-
-  std::set<vtkIdType> Indices;          // Selected indices
-};
-
-#endif
diff --git a/Filters/Parallel/vtkPipelineSize.cxx b/Filters/Parallel/vtkPipelineSize.cxx
index ea8f502..91b5eeb 100644
--- a/Filters/Parallel/vtkPipelineSize.cxx
+++ b/Filters/Parallel/vtkPipelineSize.cxx
@@ -31,7 +31,6 @@
 
 vtkStandardNewMacro(vtkPipelineSize);
 
-// Returns size in kibibytes (1024 bytes)
 unsigned long
 vtkPipelineSize::GetEstimatedSize(vtkAlgorithm *input, int inputPort,
                                   int connection)
@@ -60,7 +59,6 @@ vtkPipelineSize::GetEstimatedSize(vtkAlgorithm *input, int inputPort,
 // size of the specified output (which can be used by the downstream
 // filter when determining how much data it might release). The final size
 // is the maximum pipeline size encountered here and upstream from here.
-// All sizes are in kibibytes (1024 bytes).
 void vtkPipelineSize::ComputeSourcePipelineSize(vtkAlgorithm *src,
                                                 int outputPort,
                                                 unsigned long size[3])
diff --git a/Filters/Parallel/vtkPipelineSize.h b/Filters/Parallel/vtkPipelineSize.h
index 7a1659d..6fe9e26 100644
--- a/Filters/Parallel/vtkPipelineSize.h
+++ b/Filters/Parallel/vtkPipelineSize.h
@@ -32,7 +32,7 @@ public:
 
   // Description:
   // Compute an estimate of how much memory a pipline will require in
-  // kibibytes (1024 bytes) This is only an estimate and the
+  // kilobytes (1024 bytes not 1000) This is only an estimate and the
   // calculations in here do not take into account the specifics of many
   // sources and filters.
   unsigned long GetEstimatedSize(vtkAlgorithm *input, int inputPort,
diff --git a/Filters/Parallel/vtkTransmitStructuredDataPiece.cxx b/Filters/Parallel/vtkTransmitStructuredDataPiece.cxx
index 7104e04..31fdda0 100644
--- a/Filters/Parallel/vtkTransmitStructuredDataPiece.cxx
+++ b/Filters/Parallel/vtkTransmitStructuredDataPiece.cxx
@@ -143,7 +143,7 @@ void vtkTransmitStructuredDataPiece::RootExecute(vtkDataSet *input,
     int zeroExt[6];
     et->PieceToExtentThreadSafe(updatePiece, updateNumPieces, 0,
                                 wholeExt, zeroExt, vtkExtentTranslator::BLOCK_MODE, 0);
-    output->GenerateGhostArray(zeroExt);
+    output->GenerateGhostLevelArray(zeroExt);
     }
 
   numProcs = this->Controller->GetNumberOfProcesses();
@@ -162,7 +162,7 @@ void vtkTransmitStructuredDataPiece::RootExecute(vtkDataSet *input,
       int zeroExt[6];
       et->PieceToExtentThreadSafe(updateInfo[0], updateInfo[1], 0,
                                   wholeExt, zeroExt, vtkExtentTranslator::BLOCK_MODE, 0);
-      tmp->GenerateGhostArray(zeroExt);
+      tmp->GenerateGhostLevelArray(zeroExt);
       }
 
     this->Controller->Send(tmp, i, 22342);
diff --git a/Filters/ParallelFlowPaths/module.cmake b/Filters/ParallelFlowPaths/module.cmake
index 4ef1c59..a0bcf01 100644
--- a/Filters/ParallelFlowPaths/module.cmake
+++ b/Filters/ParallelFlowPaths/module.cmake
@@ -9,7 +9,7 @@ vtk_module(vtkFiltersParallelFlowPaths
     vtkIOAMR
     vtkTestingRendering
     vtkRenderingParallel
-    vtkIOParallel
+    vtkIOGeometry
   KIT
     vtkParallel
   )
diff --git a/Filters/ParallelFlowPaths/vtkPParticleTracerBase.cxx b/Filters/ParallelFlowPaths/vtkPParticleTracerBase.cxx
index 1d7e7dd..65dfac8 100644
--- a/Filters/ParallelFlowPaths/vtkPParticleTracerBase.cxx
+++ b/Filters/ParallelFlowPaths/vtkPParticleTracerBase.cxx
@@ -28,7 +28,6 @@ PURPOSE.  See the above copyright notice for more information.
 #include "vtkPolyData.h"
 #include "vtkSmartPointer.h"
 #include "vtkStreamingDemandDrivenPipeline.h"
-#include "vtkTemporalInterpolatedVelocityField.h"
 #include <cassert>
 
 #include <algorithm>
@@ -55,14 +54,6 @@ vtkPolyData* vtkPParticleTracerBase::Execute(vtkInformationVector** inputVector)
   this->MPISendList.clear();
   this->Tail.clear();
 
-  // clear out TailPointId
-  ParticleListIterator  it_first = this->ParticleHistories.begin();
-  ParticleListIterator  it_last  = this->ParticleHistories.end();
-  for (ParticleListIterator it=it_first; it!=it_last;it++)
-    {
-    it->TailPointId = -1;
-    }
-
   return vtkParticleTracerBase::Execute(inputVector);
 }
 
@@ -71,12 +62,7 @@ bool vtkPParticleTracerBase::SendParticleToAnotherProcess(
   ParticleInformation &info, ParticleInformation &previousInfo,
   vtkPointData* pd)
 {
-  if(info.PointId < 0 && info.TailPointId < 0)
-    {
-    vtkErrorMacro("Bad particle information.");
-    assert(0);
-    return true;
-    }
+  assert(info.PointId>=0); //the particle must have already been added;
 
   RemoteParticleInfo remoteInfo;
 
@@ -84,33 +70,16 @@ bool vtkPParticleTracerBase::SendParticleToAnotherProcess(
 
   remoteInfo.Previous = previousInfo;
   remoteInfo.PreviousPD = vtkSmartPointer<vtkPointData>::New();
-  // the point data that we get values from.
-  vtkPointData* fromPD = NULL;
-  vtkIdType fromTupleId = -1;
-  // ProtoPD is ONLY used to properly copy allocate the new point data
-  if(info.PointId >= 0)
-    { // point data comes from the input pd and the tuple
-    // location comes from the particles's PointId
-    remoteInfo.PreviousPD->CopyAllocate(this->ProtoPD);
-    fromPD = pd;
-    fromTupleId = info.PointId;
-    }
-  else
-    { // point data comes from this->Tail and the tuple
-    // location comes from the particle's TailPointId
-    remoteInfo.PreviousPD->CopyAllocate(this->ProtoPD);
-    fromPD = this->Tail[info.TailPointId].PreviousPD;
-    fromTupleId = 0;
-    }
+  remoteInfo.PreviousPD->CopyAllocate(this->ProtoPD);
 
   //only copy those that correspond to the original data fields
   for(int i=0; i <this->ProtoPD->GetNumberOfArrays(); i++)
     {
     char* arrName = this->ProtoPD->GetArray(i)->GetName();
-    vtkDataArray* arrFrom = fromPD->GetArray(arrName);
+    vtkDataArray* arrFrom = pd->GetArray(arrName);
     vtkDataArray* arrTo = remoteInfo.PreviousPD->GetArray(i);
     assert(arrFrom->GetNumberOfComponents()==arrTo->GetNumberOfComponents());
-    arrTo->InsertNextTuple(arrFrom->GetTuple(fromTupleId));
+    arrTo->InsertNextTuple(arrFrom->GetTuple(info.PointId));
     }
 
   double eps = (this->GetCacheDataTime(1)-this->GetCacheDataTime(0))/100;
@@ -169,43 +138,15 @@ void vtkPParticleTracerBase::AssignSeedsToProcessors(
     info.speed                = 0.0;
     info.SimulationTime       = this->GetCurrentTimeValue();
     info.ErrorCode            = 0;
-    info.PointId              = -1;
-    info.TailPointId          = -1;
   }
   //
-  // Check all Seeds on all processors for classification
+  // Gather all Seeds to all processors for classification
   //
-  std::vector<int> owningProcess(numSeeds, -1);
-  int myRank = this->Controller->GetLocalProcessId();
-  ParticleIterator it=candidates.begin();
-  for (int i=0; it!=candidates.end(); ++it, ++i)
-    {
-    ParticleInformation &info = (*it);
-    double *pos = &info.CurrentPosition.x[0];
-    // if outside bounds, reject instantly
-    if (this->InsideBounds(pos))
-      {
-      // since this is first test, avoid bad cache tests
-      this->GetInterpolator()->ClearCache();
-      int searchResult = this->GetInterpolator()->TestPoint(pos);
-      if(searchResult==ID_INSIDE_ALL || searchResult==ID_OUTSIDE_T0)
-        {
-        // this particle is in this process's domain for the latest time step
-        owningProcess[i] = myRank;
-        }
-      }
-    }
-  std::vector<int> realOwningProcess(numSeeds);
-  this->Controller->AllReduce(&owningProcess[0], &realOwningProcess[0], numSeeds,
-                              vtkCommunicator::MAX_OP);
-
-  for(size_t i=0;i<realOwningProcess.size();i++)
-    {
-    if(realOwningProcess[i] == myRank)
-      {
-      localSeedPoints.push_back(candidates[i]);
-      }
-    }
+  // TODO : can we just use the same array here for send and receive
+  ParticleVector allCandidates;
+  this->TestParticles(candidates, localSeedPoints, localAssignedCount);
+  int TotalAssigned = 0;
+  this->Controller->Reduce(&localAssignedCount, &TotalAssigned, 1, vtkCommunicator::SUM_OP, 0);
 
   // Assign unique identifiers taking into account uneven distribution
   // across processes and seeds which were rejected
@@ -259,11 +200,10 @@ void vtkPParticleTracerBase::AssignUniqueIds(
 }
 
 //---------------------------------------------------------------------------
-bool vtkPParticleTracerBase::SendReceiveParticles(RemoteParticleVector &sParticles,
+void vtkPParticleTracerBase::SendReceiveParticles(RemoteParticleVector &sParticles,
                                                   RemoteParticleVector &rParticles)
 {
   int numParticles = static_cast<int>(sParticles.size());
-
   std::vector<int> allNumParticles(this->Controller->GetNumberOfProcesses(), 0);
   // Broadcast and receive size to/from all other processes.
   this->Controller->AllGather(&numParticles, &allNumParticles[0], 1);
@@ -318,89 +258,36 @@ bool vtkPParticleTracerBase::SendReceiveParticles(RemoteParticleVector &sParticl
                                messageSize, &messageLength[0],
                                &messageOffset[0]);
 
-
-  int myRank = this->Controller->GetLocalProcessId();
-
-  // owningProcess is used to make sure that particles that are sent aren't added
-  // on multiple processes
-  std::vector<vtkIdType> owningProcess(numAllParticles, -1);
-  // we automatically ignore particles that we sent
-  int ignoreBegin = messageOffset[myRank]/typeSize;
-  int ignoreEnd = ignoreBegin+messageLength[myRank]/typeSize;
+  //read the message
+  rParticles.resize(numAllParticles);
   for(int i=0; i<numAllParticles; i++)
     {
-    if(i < ignoreBegin || i >= ignoreEnd)
-      {
-      ParticleInformation tmpParticle;
-      memcpy(&tmpParticle, &recvMessage[i*typeSize], size1);
-      // since this is first test, avoid bad cache tests
-      this->GetInterpolator()->ClearCache();
-      int searchResult =
-        this->GetInterpolator()->TestPoint(tmpParticle.CurrentPosition.x);
-      if(searchResult==ID_INSIDE_ALL || searchResult==ID_OUTSIDE_T0)
-        {
-        // this particle is in this process's domain for the latest time step
-        owningProcess[i] = myRank;
-        }
-      }
-    }
-  std::vector<vtkIdType> realOwningProcess(numAllParticles);
-  this->Controller->AllReduce(&owningProcess[0], &realOwningProcess[0],
-                              numAllParticles, vtkCommunicator::MAX_OP);
-
-  // if any value in realOwningProcess array is not -1 then we know
-  // that a particle was moved to another process and probably needs
-  // to be integrated further
-  bool particlesMoved = false; // assume no particles moved
-
-  //read the message for the particles that we really want
-  int counter = 0;
-  for(std::vector<vtkIdType>::iterator it=realOwningProcess.begin();
-      it!=realOwningProcess.end();it++)
-    {
-    if(*it != -1)
-      {
-      particlesMoved = true;
-      if(*it == myRank)
-        {
-        counter++;
-        }
-      }
-    }
-  rParticles.resize(counter);
-  counter = 0;
-  // owningProcess is used to make sure that particles that are sent aren't added
-  // on multiple processes
+    memcpy(&rParticles[i].Current,  &recvMessage[i*typeSize],     size1);
+    memcpy(&rParticles[i].Previous, &recvMessage[i*typeSize]+size1,size1);
 
-  for(int i=0; i<numAllParticles; i++)
-    {
-    if(realOwningProcess[i] == myRank)
+    rParticles[i].PreviousPD = vtkSmartPointer<vtkPointData>::New();
+    rParticles[i].PreviousPD->CopyAllocate(this->ProtoPD);
+    vtkPointData* pd = rParticles[i].PreviousPD;
+    char* data = &recvMessage[i*typeSize] + 2*size1;
+    for(int j=0; j<nArrays;j++)
       {
-      memcpy(&rParticles[counter].Current,  &recvMessage[i*typeSize],     size1);
-      memcpy(&rParticles[counter].Previous, &recvMessage[i*typeSize]+size1,size1);
-
-      rParticles[counter].PreviousPD = vtkSmartPointer<vtkPointData>::New();
-      rParticles[counter].PreviousPD->CopyAllocate(this->ProtoPD);
-      vtkPointData* pd = rParticles[counter].PreviousPD;
-      char* data = &recvMessage[i*typeSize] + 2*size1;
-      for(int j=0; j<nArrays;j++)
-        {
-        vtkDataArray* arr = pd->GetArray(j);
-        int numComponents = arr->GetNumberOfComponents();
-        int dataSize = sizeof(double)*numComponents;
-        std::vector<double> xi(numComponents);
-        memcpy(&xi[0], data, dataSize);
-        arr->InsertNextTuple(&xi[0]);
-        data+=dataSize;
-        }
-      counter++;
+      vtkDataArray* arr = pd->GetArray(j);
+      int numComponents = arr->GetNumberOfComponents();
+      int dataSize = sizeof(double)*numComponents;
+      std::vector<double> xi(numComponents);
+      memcpy(&xi[0], data, dataSize);
+      arr->InsertNextTuple(&xi[0]);
+      data+=dataSize;
       }
     }
 
+  std::vector<RemoteParticleInfo>::iterator first =
+    rParticles.begin() + messageOffset[this->Controller->GetLocalProcessId()]/typeSize;
+  std::vector<RemoteParticleInfo>::iterator last =
+    first + messageLength[this->Controller->GetLocalProcessId()]/typeSize;
+  rParticles.erase(first, last);
   // don't want the ones that we sent away
   this->MPISendList.clear();
-
-  return particlesMoved;
 }
 
 //---------------------------------------------------------------------------
@@ -420,6 +307,21 @@ int vtkPParticleTracerBase::RequestUpdateExtent(
 }
 
 //---------------------------------------------------------------------------
+int vtkPParticleTracerBase::RequestData(
+  vtkInformation *request,
+  vtkInformationVector **inputVector,
+  vtkInformationVector *outputVector)
+{
+  int rvalue = this->Superclass::RequestData(request, inputVector, outputVector);
+  if(this->Controller)
+    {
+    this->Controller->Barrier();
+    }
+
+  return rvalue;
+}
+
+//---------------------------------------------------------------------------
 void vtkPParticleTracerBase::PrintSelf(ostream& os, vtkIndent indent)
 {
   this->Superclass::PrintSelf(os,indent);
@@ -428,32 +330,54 @@ void vtkPParticleTracerBase::PrintSelf(ostream& os, vtkIndent indent)
 }
 
 //---------------------------------------------------------------------------
-bool vtkPParticleTracerBase::UpdateParticleListFromOtherProcesses()
+void vtkPParticleTracerBase::UpdateParticleListFromOtherProcesses()
 {
   if(!this->Controller)
     {
-    return false;
+    return;
     }
   RemoteParticleVector received;
 
-  bool particlesMoved = this->SendReceiveParticles(this->MPISendList, received);
+  this->SendReceiveParticles(this->MPISendList, received);
+
+  std::vector<int> candidatesIndices;
 
-  for(size_t i=0;i<received.size();i++)
+  // the Particle lists will grow if any are received
+  // so we must be very careful with our iterators
+  //  this->TransmitReceiveParticles(this->MPISendList, received, true);
+  // classify all the ones we received
+  if (received.size()>0)
     {
-    RemoteParticleInfo& info(received[i]);
+    ParticleVector receivedParticles;
+    for(unsigned int i=0; i<received.size();i++)
+      {
+      receivedParticles.push_back(received[i].Current);
+      }
+
+    this->TestParticles(receivedParticles, candidatesIndices);
+    }
+  int numCandidates =static_cast<int>(candidatesIndices.size());
+
+  //increment particle ids
+  for(int i=0; i<numCandidates;i++)
+    {
+    RemoteParticleInfo& info(received[candidatesIndices[i]]);
     info.Current.UniqueParticleId++;
     info.Previous.UniqueParticleId++;
+    }
+
+// Now update our main list with the ones we are keeping
+  for (int i=0; i<numCandidates; i++)
+    {
+    RemoteParticleInfo& info(received[candidatesIndices[i]]);
     info.Current.PointId = -1;
     info.Current.CachedDataSetId[0] = info.Current.CachedDataSetId[1] = -1;
     info.Current.CachedCellId[0] = info.Current.CachedCellId[1] = -1;
     info.Previous.CachedDataSetId[0] = info.Previous.CachedDataSetId[1] = -1;
     info.Previous.CachedCellId[0] = info.Previous.CachedCellId[1] = -1;
-    info.Current.TailPointId = info.Previous.TailPointId = this->Tail.size();
     this->Tail.push_back(info);
     this->ParticleHistories.push_back(info.Current);
-   }
-
-  return particlesMoved;
+    }
 }
 
 //---------------------------------------------------------------------------
diff --git a/Filters/ParallelFlowPaths/vtkPParticleTracerBase.h b/Filters/ParallelFlowPaths/vtkPParticleTracerBase.h
index 6c4aa49..ccab176 100644
--- a/Filters/ParallelFlowPaths/vtkPParticleTracerBase.h
+++ b/Filters/ParallelFlowPaths/vtkPParticleTracerBase.h
@@ -62,6 +62,13 @@ protected:
                                   vtkInformationVector** inputVector,
                                   vtkInformationVector* outputVector);
 
+  //
+  // Generate output
+  //
+  virtual int RequestData(vtkInformation* request,
+                          vtkInformationVector** inputVector,
+                          vtkInformationVector* outputVector);
+
 //
 //BTX
 
@@ -88,11 +95,10 @@ protected:
 
   // Description : Perform a GatherV operation on a vector of particles
   // this is used during classification of seed points and also between iterations
-  // of the main loop as particles leave each processor domain. Returns
-  // true if particles were migrated to any new process.
-  virtual bool SendReceiveParticles(RemoteParticleVector &outofdomain, RemoteParticleVector &received);
+  // of the main loop as particles leave each processor domain
+  virtual void SendReceiveParticles(RemoteParticleVector &outofdomain, RemoteParticleVector &received);
 
-  virtual bool UpdateParticleListFromOtherProcesses();
+  void UpdateParticleListFromOtherProcesses();
 
   // Description:
   // Method that checks that the input arrays are ordered the
diff --git a/Filters/ParallelFlowPaths/vtkPStreamTracer.cxx b/Filters/ParallelFlowPaths/vtkPStreamTracer.cxx
index bf2455c..763fcf4 100644
--- a/Filters/ParallelFlowPaths/vtkPStreamTracer.cxx
+++ b/Filters/ParallelFlowPaths/vtkPStreamTracer.cxx
@@ -989,7 +989,7 @@ namespace
   class Task: public vtkObject
   {
   public:
-
+    vtkTypeMacro(Task,vtkObject);
     static Task *New();
 
     int GetId()
@@ -1256,6 +1256,12 @@ namespace
         delete ReceiveBuffer;
         }
     }
+    double ComputeReceiveTime()
+    {
+      double totalReceiveTime(0);
+      this->Controller->Reduce(&this->ReceiveTime,&totalReceiveTime,1,vtkCommunicator::SUM_OP,0);
+      return totalReceiveTime;
+    }
   private:
     ProcessLocator* Locator;
     vtkSmartPointer<PStreamTracerPoint> Proto;
@@ -1336,6 +1342,15 @@ namespace
       AssertNe(rank,Rank);
       return rank;
     }
+    int NextProcess()
+    {
+      int rank=(this->Rank+1)%NumProcs;
+      while(!this->HasData[rank] && rank!=this->Rank)
+        {
+        rank = (rank+1)%NumProcs;
+        }
+      return rank;
+    }
 
     vtkSmartPointer<Task> NewTaskInstance()
     {
@@ -1429,6 +1444,16 @@ namespace
     int NumSends;
     double ReceiveTime;
     vtkSmartPointer<vtkTimerLog> Timer;
+    void StartTimer()
+    {
+      Timer->StartTimer();
+    }
+
+    double StopTimer()
+    {
+      Timer->StopTimer();
+      return Timer->GetElapsedTime();
+    }
   };
 
 };
diff --git a/Filters/ParallelGeometry/Testing/Cxx/CMakeLists.txt b/Filters/ParallelGeometry/Testing/Cxx/CMakeLists.txt
index 2a80f82..9f630c0 100644
--- a/Filters/ParallelGeometry/Testing/Cxx/CMakeLists.txt
+++ b/Filters/ParallelGeometry/Testing/Cxx/CMakeLists.txt
@@ -5,7 +5,6 @@ vtk_add_test_mpi(${vtk-module}CxxTests-MPI tests
   TestPStructuredGridGhostDataGenerator.cxx
   TestPUnstructuredGridConnectivity.cxx
   TestPUnstructuredGridGhostDataGenerator.cxx
-  TestPUniformGridGhostDataGenerator.cxx
   )
 vtk_test_mpi_executable(${vtk-module}CxxTests-MPI tests
   UnstructuredGhostZonesCommon.cxx)
diff --git a/Filters/ParallelGeometry/Testing/Cxx/TestPStructuredGridConnectivity.cxx b/Filters/ParallelGeometry/Testing/Cxx/TestPStructuredGridConnectivity.cxx
index eaceef0..6a79116 100644
--- a/Filters/ParallelGeometry/Testing/Cxx/TestPStructuredGridConnectivity.cxx
+++ b/Filters/ParallelGeometry/Testing/Cxx/TestPStructuredGridConnectivity.cxx
@@ -37,6 +37,7 @@
 #include "vtkPStructuredGridConnectivity.h"
 #include "vtkStructuredGridConnectivity.h"
 #include "vtkStructuredNeighbor.h"
+#include "vtkGhostArray.h"
 #include "vtkPointData.h"
 #include "vtkCellData.h"
 #include "vtkUniformGridPartitioner.h"
@@ -106,7 +107,10 @@ int GetTotalNumberOfNodes( vtkMultiBlockDataSet *multiblock )
       vtkIdType pntIdx = 0;
       for( ; pntIdx < grid->GetNumberOfPoints(); ++pntIdx )
         {
-        if(grid->IsPointVisible(pntIdx))
+        unsigned char nodeProperty =
+            *(grid->GetPointVisibilityArray()->GetPointer( pntIdx ));
+        if( !vtkGhostArray::IsPropertySet(
+            nodeProperty,vtkGhostArray::IGNORE ) )
           {
           ++numNodes;
           }
@@ -229,8 +233,8 @@ void RegisterGrids(
               info->Has(vtkDataObject::PIECE_EXTENT() ) );
       connectivity->RegisterGrid(
           block,info->Get(vtkDataObject::PIECE_EXTENT()),
-          grid->GetPointGhostArray(),
-          grid->GetCellGhostArray(),
+          grid->GetPointVisibilityArray(),
+          grid->GetCellVisibilityArray(),
           grid->GetPointData(),
           grid->GetCellData(),
           NULL );
@@ -341,7 +345,9 @@ double GetXYZSumForGrid( vtkUniformGrid *grid )
   double sum = 0.0;
   for( vtkIdType pntIdx=0; pntIdx < grid->GetNumberOfPoints(); ++pntIdx )
     {
-    if(grid->IsPointVisible(pntIdx))
+    unsigned char nodeProperty =
+      *(grid->GetPointVisibilityArray()->GetPointer( pntIdx ));
+    if( !vtkGhostArray::IsPropertySet( nodeProperty,vtkGhostArray::IGNORE ) )
       {
       grid->GetPoint( pntIdx, pnt );
       sum += pnt[0];
diff --git a/Filters/ParallelGeometry/Testing/Cxx/TestPUniformGridGhostDataGenerator.cxx b/Filters/ParallelGeometry/Testing/Cxx/TestPUniformGridGhostDataGenerator.cxx
index 3ba8802..c258f05 100644
--- a/Filters/ParallelGeometry/Testing/Cxx/TestPUniformGridGhostDataGenerator.cxx
+++ b/Filters/ParallelGeometry/Testing/Cxx/TestPUniformGridGhostDataGenerator.cxx
@@ -56,6 +56,15 @@ int NumberOfPartitions;
 
 //------------------------------------------------------------------------------
 namespace Logger {
+  void Print( const std::string &msg)
+  {
+    if( Controller->GetLocalProcessId() == 0 )
+      {
+      std::cout << msg;
+      std::cout.flush();
+      }
+    Controller->Barrier();
+  }
 
   void Println(const std::string &msg )
   {
diff --git a/Filters/ParallelGeometry/Testing/Cxx/TestPUnstructuredGridConnectivity.cxx b/Filters/ParallelGeometry/Testing/Cxx/TestPUnstructuredGridConnectivity.cxx
index a59fccd..946611a 100644
--- a/Filters/ParallelGeometry/Testing/Cxx/TestPUnstructuredGridConnectivity.cxx
+++ b/Filters/ParallelGeometry/Testing/Cxx/TestPUnstructuredGridConnectivity.cxx
@@ -97,7 +97,7 @@ int TestPUnstructuredGridConnectivity(int argc, char* argv[])
     UpdateGrid(i);
 
 #ifdef DEBUG
-    WriteDataSet(Grid,grdfname.str());
+    WriteDataSet(Grid,grdfname.str().c_str());
 #endif
 
     vtkMPIUtilities::Printf(cntrl,"[INFO]: iteration=%d\n",i);
@@ -124,7 +124,7 @@ int TestPUnstructuredGridConnectivity(int argc, char* argv[])
 
 #ifdef DEBUG
     assert("pre: ghost grid should not be NULL!" && (ghostGrid != NULL) );
-    WriteDataSet(ghostGrid,ghostfname.str());
+    WriteDataSet(ghostGrid,ghostfname.str().c_str());
 #endif
 
     rc += CheckGrid(ghostGrid,i);
diff --git a/Filters/ParallelGeometry/Testing/Cxx/TestPUnstructuredGridGhostDataGenerator.cxx b/Filters/ParallelGeometry/Testing/Cxx/TestPUnstructuredGridGhostDataGenerator.cxx
index 1f50d57..4b8fee9 100644
--- a/Filters/ParallelGeometry/Testing/Cxx/TestPUnstructuredGridGhostDataGenerator.cxx
+++ b/Filters/ParallelGeometry/Testing/Cxx/TestPUnstructuredGridGhostDataGenerator.cxx
@@ -78,7 +78,7 @@ int TestPUnstructuredGridGhostDataGenerator(int argc, char* argv[])
     UpdateGrid(i);
     global::Grid->Modified();
 #ifdef DEBUG
-    WriteDataSet(global::Grid,grdfname.str());
+    WriteDataSet(global::Grid,grdfname.str().c_str());
 #endif
 
     // update ghost zones in this iteration...
@@ -108,7 +108,7 @@ int TestPUnstructuredGridGhostDataGenerator(int argc, char* argv[])
     ghostGrid->DeepCopy(ghostGenerator->GetOutput());
 #ifdef DEBUG
     assert("pre: ghost gird should not be NULL!" && (ghostGrid != NULL) );
-    WriteDataSet(ghostGrid,ghostfname.str());
+    WriteDataSet(ghostGrid,ghostfname.str().c_str());
 #endif
 
     rc += CheckGrid(ghostGrid,i);
diff --git a/Filters/ParallelGeometry/vtkPStructuredGridConnectivity.cxx b/Filters/ParallelGeometry/vtkPStructuredGridConnectivity.cxx
index 1ad94f0..9d0238e 100644
--- a/Filters/ParallelGeometry/vtkPStructuredGridConnectivity.cxx
+++ b/Filters/ParallelGeometry/vtkPStructuredGridConnectivity.cxx
@@ -71,11 +71,6 @@ void vtkPStructuredGridConnectivity::Initialize()
 //------------------------------------------------------------------------------
 void vtkPStructuredGridConnectivity::SetNumberOfGrids( const unsigned int N )
 {
-  if (N == 0)
-    {
-    vtkErrorMacro("Number of grids cannot be 0.");
-    return;
-    }
   this->Superclass::SetNumberOfGrids( N );
   this->GridRanks.resize( N,-1 );
 }
@@ -900,7 +895,7 @@ void vtkPStructuredGridConnectivity::SerializeDataArray(
           static_cast<int*>(dataArray->GetVoidPointer(0)), size );
       break;
     default:
-      vtkErrorMacro("Cannot serialize data array of type"<<dataArray->GetDataType());
+      vtkErrorMacro("Cannot serialize data array of this type");
     }
 }
 
diff --git a/Filters/ParallelGeometry/vtkPStructuredGridGhostDataGenerator.cxx b/Filters/ParallelGeometry/vtkPStructuredGridGhostDataGenerator.cxx
index e8f266a..e8cc8be 100644
--- a/Filters/ParallelGeometry/vtkPStructuredGridGhostDataGenerator.cxx
+++ b/Filters/ParallelGeometry/vtkPStructuredGridGhostDataGenerator.cxx
@@ -72,8 +72,8 @@ void vtkPStructuredGridGhostDataGenerator::RegisterGrids(
 
       this->GridConnectivity->RegisterGrid(
           static_cast<int>(i),info->Get(vtkDataObject::PIECE_EXTENT() ),
-          grid->GetPointGhostArray(),
-          grid->GetCellGhostArray(),
+          grid->GetPointVisibilityArray(),
+          grid->GetCellVisibilityArray(),
           grid->GetPointData(),
           grid->GetCellData(),
           grid->GetPoints() );
@@ -119,6 +119,12 @@ void vtkPStructuredGridGhostDataGenerator::CreateGhostedDataSet(
       ghostedGrid->GetCellData()->DeepCopy(
          this->GridConnectivity->GetGhostedGridCellData(i) );
 
+      // STEP 3: Copy the ghost arrays
+      ghostedGrid->SetPointVisibilityArray(
+          this->GridConnectivity->GetGhostedPointGhostArray(i) );
+      ghostedGrid->SetPointVisibilityArray(
+         this->GridConnectivity->GetGhostedCellGhostArray(i) );
+
       out->SetBlock(i,ghostedGrid);
       ghostedGrid->Delete();
       }
diff --git a/Filters/ParallelGeometry/vtkPUniformGridGhostDataGenerator.cxx b/Filters/ParallelGeometry/vtkPUniformGridGhostDataGenerator.cxx
index a720b7f..041ebb9 100644
--- a/Filters/ParallelGeometry/vtkPUniformGridGhostDataGenerator.cxx
+++ b/Filters/ParallelGeometry/vtkPUniformGridGhostDataGenerator.cxx
@@ -77,8 +77,8 @@ void vtkPUniformGridGhostDataGenerator::RegisterGrids(vtkMultiBlockDataSet *in)
 
       this->GridConnectivity->RegisterGrid(
           static_cast<int>(i), info->Get(vtkDataObject::PIECE_EXTENT()),
-          grid->GetPointGhostArray(),
-          grid->GetCellGhostArray(),
+          grid->GetPointVisibilityArray(),
+          grid->GetCellVisibilityArray(),
           grid->GetPointData(),
           grid->GetCellData(),
           NULL);
@@ -183,6 +183,12 @@ void vtkPUniformGridGhostDataGenerator::CreateGhostedDataSet(
       ghostedGrid->GetCellData()->DeepCopy(
           this->GridConnectivity->GetGhostedGridCellData(i) );
 
+      // STEP 6: Copy the ghost arrays
+      ghostedGrid->SetPointVisibilityArray(
+          this->GridConnectivity->GetGhostedPointGhostArray( i ) );
+      ghostedGrid->SetCellVisibilityArray(
+          this->GridConnectivity->GetGhostedCellGhostArray( i ) );
+
       out->SetBlock(i,ghostedGrid);
       ghostedGrid->Delete();
       }
diff --git a/Filters/ParallelImaging/vtkMemoryLimitImageDataStreamer.cxx b/Filters/ParallelImaging/vtkMemoryLimitImageDataStreamer.cxx
index 83bc481..ff0f453 100644
--- a/Filters/ParallelImaging/vtkMemoryLimitImageDataStreamer.cxx
+++ b/Filters/ParallelImaging/vtkMemoryLimitImageDataStreamer.cxx
@@ -30,8 +30,8 @@ vtkStandardNewMacro(vtkMemoryLimitImageDataStreamer);
 //----------------------------------------------------------------------------
 vtkMemoryLimitImageDataStreamer::vtkMemoryLimitImageDataStreamer()
 {
-  // Set a default memory limit of 50 mebibytes
-  this->MemoryLimit = 50 * 1024;
+  // Set a default memory limit of 50 Megabytes
+  this->MemoryLimit = 50000;
 }
 
 
@@ -40,7 +40,7 @@ void vtkMemoryLimitImageDataStreamer::PrintSelf(ostream& os, vtkIndent indent)
 {
   this->Superclass::PrintSelf(os,indent);
 
-  os << indent << "MemoryLimit (in kibibytes): " << this->MemoryLimit << endl;
+  os << indent << "MemoryLimit (in kb): " << this->MemoryLimit << endl;
 }
 
 //----------------------------------------------------------------------------
diff --git a/Filters/ParallelImaging/vtkMemoryLimitImageDataStreamer.h b/Filters/ParallelImaging/vtkMemoryLimitImageDataStreamer.h
index f8a718e..2f0e01d 100644
--- a/Filters/ParallelImaging/vtkMemoryLimitImageDataStreamer.h
+++ b/Filters/ParallelImaging/vtkMemoryLimitImageDataStreamer.h
@@ -33,7 +33,7 @@ public:
   void PrintSelf(ostream& os, vtkIndent indent);
 
   // Description:
-  // Set / Get the memory limit in kibibytes (1024 bytes).
+  // Set / Get the memory limit in kilobytes.
   vtkSetMacro(MemoryLimit, unsigned long);
   vtkGetMacro(MemoryLimit, unsigned long);
 
diff --git a/Filters/ParallelMPI/vtkDistributedDataFilter.cxx b/Filters/ParallelMPI/vtkDistributedDataFilter.cxx
index 4996a51..3b76a81 100644
--- a/Filters/ParallelMPI/vtkDistributedDataFilter.cxx
+++ b/Filters/ParallelMPI/vtkDistributedDataFilter.cxx
@@ -75,23 +75,6 @@ public:
   std::multimap<int, int> IntMultiMap;
 };
 
-namespace
-{
-void convertGhostLevelsToBitFields(vtkDataSetAttributes* dsa, unsigned int bit)
-{
-  vtkDataArray *da = dsa->GetArray(vtkDataSetAttributes::GhostArrayName());
-  vtkUnsignedCharArray *uca = vtkUnsignedCharArray::SafeDownCast(da);
-  unsigned char *ghosts = uca->GetPointer(0);
-  for (vtkIdType i=0; i < da->GetNumberOfTuples(); ++i)
-    {
-    if (ghosts[i] > 0)
-      {
-      ghosts[i] = bit;
-      }
-    }
-}
-};
-
 class vtkDistributedDataFilter::vtkInternals
 {
 public:
@@ -893,11 +876,6 @@ vtkUnstructuredGrid *
       this->AddGhostCellsUniqueCellAssignment(grid, &globalToLocalMap);
     }
 
-  convertGhostLevelsToBitFields(
-    expandedGrid->GetCellData(), vtkDataSetAttributes::DUPLICATECELL);
-  convertGhostLevelsToBitFields(
-    expandedGrid->GetPointData(), vtkDataSetAttributes::DUPLICATEPOINT);
-
   return expandedGrid;
 }
 
@@ -947,13 +925,13 @@ void vtkDistributedDataFilter::SingleProcessExecute(vtkDataSet *input,
 
   if (this->GhostLevel > 0)
     {
-    // Add the vtkGhostType arrays.  We have the whole
+    // Add the vtkGhostLevels arrays.  We have the whole
     // data set, so all cells are level 0.
 
     vtkDistributedDataFilter::AddConstantUnsignedCharPointArray(
-                              output, vtkDataSetAttributes::GhostArrayName(), 0);
+                              output, "vtkGhostLevels", 0);
     vtkDistributedDataFilter::AddConstantUnsignedCharCellArray(
-                              output, vtkDataSetAttributes::GhostArrayName(), 0);
+                              output, "vtkGhostLevels", 0);
     }
 }
 
@@ -1089,17 +1067,6 @@ vtkDataSet *vtkDistributedDataFilter::TestFixTooFewInputFiles(vtkDataSet *input)
       }
     }
 
-  if (numTotalCells == 0)
-    {
-    // Nothing to do.
-    // Based on the comments in RequestData() where this method is called, if
-    // this method returns NULL, it indicates that there's no distribution to be
-    // done. That's indeed the case for empty datasets. Hence we'll return NULL.
-    delete[] nodeType;
-    inputSize->Delete();
-    return NULL;
-    }
-
   if (numConsumers == 0)
     {
     // Nothing to do.  Every process has input data.
@@ -1743,7 +1710,6 @@ vtkIdTypeArray **
           "vtkDistributedDataFilter::ExchangeIdArrays memory allocation");
         delete [] sendSize;
         delete [] recvSize;
-        delete [] recvArrays;
         return NULL;
         }
       mpiContr->NoBlockReceive(recvArrays[source], recvSize[source], source, tag, req);
@@ -1893,7 +1859,6 @@ vtkUnstructuredGrid *
         {
         vtkErrorMacro(<<
           "vtkDistributedDataFilter::ExchangeMergeSubGrids memory allocation");
-        delete [] grids;
         return NULL;
         }
       recvBufSize = packedGridRecvSize;
@@ -1965,19 +1930,55 @@ vtkUnstructuredGrid *
 }
 
 // ----------------------- Fast versions ----------------------------//
-vtkIdTypeArray *vtkDistributedDataFilter::ExchangeCountsFast(
-  vtkIdType myCount, int vtkNotUsed(tag))
+vtkIdTypeArray *vtkDistributedDataFilter::ExchangeCountsFast(vtkIdType myCount, int tag)
 {
   vtkIdTypeArray *countArray = NULL;
 
+  vtkIdType i;
   int nprocs = this->NumProcesses;
+  int me = this->MyId;
+
+  vtkMPICommunicator::Request *req = new vtkMPICommunicator::Request [nprocs];
+  vtkMPIController *mpiContr = vtkMPIController::SafeDownCast(this->Controller);
 
   vtkIdType *counts = new vtkIdType [nprocs];
-  this->Controller->AllGather(&myCount, counts, 1);
+  counts[me] = myCount;
+
+  for (i = 0; i < nprocs; i++)
+    {
+    if (i  == me)
+      {
+      continue;
+      }
+    mpiContr->NoBlockReceive(counts + i, 1, i, tag, req[i]);
+    }
+
+  mpiContr->Barrier();
+
+  for (i = 0; i < nprocs; i++)
+    {
+    if (i  == me)
+      {
+      continue;
+      }
+    mpiContr->Send(&myCount, 1, i, tag);
+    }
 
   countArray = vtkIdTypeArray::New();
   countArray->SetArray(counts, nprocs, 0,
     vtkIdTypeArray::VTK_DATA_ARRAY_DELETE);
+
+  for (i = 0; i < nprocs; i++)
+    {
+    if (i  == me)
+      {
+      continue;
+      }
+    req[i].Wait();
+    }
+
+  delete [] req;
+
   return countArray;
 }
 
@@ -2561,9 +2562,9 @@ vtkUnstructuredGrid *vtkDistributedDataFilter::MPIRedistribute(vtkDataSet *in,
   if (myNewGrid && (this->GhostLevel > 0))
     {
     vtkDistributedDataFilter::AddConstantUnsignedCharCellArray(
-                            myNewGrid, vtkDataSetAttributes::GhostArrayName(), 0);
+                            myNewGrid, "vtkGhostLevels", 0);
     vtkDistributedDataFilter::AddConstantUnsignedCharPointArray(
-                            myNewGrid, vtkDataSetAttributes::GhostArrayName(), 0);
+                            myNewGrid, "vtkGhostLevels", 0);
     }
   return myNewGrid;
 }
@@ -3580,7 +3581,8 @@ vtkIdTypeArray **vtkDistributedDataFilter::GetGhostPointIds(
   vtkIdType *gidsCell = this->GetGlobalElementIds(grid);
 
 
-  vtkUnsignedCharArray *uca = grid->GetPointGhostArray();
+  vtkDataArray *da = grid->GetPointData()->GetArray("vtkGhostLevels");
+  vtkUnsignedCharArray *uca = vtkUnsignedCharArray::SafeDownCast(da);
   unsigned char *levels = uca->GetPointer(0);
 
   unsigned char level = (unsigned char)(ghostLevel - 1);
@@ -3981,7 +3983,7 @@ vtkDistributedDataFilter::AddGhostCellsUniqueCellAssignment(
     this->UpdateProgress(this->NextProgressStep++ * this->ProgressIncrement);
 
     gl++;
-    }
+  }
 
   delete insidePointMap;
 
@@ -4384,9 +4386,11 @@ vtkUnstructuredGrid *vtkDistributedDataFilter::SetMergeGhostGrid(
   // grid, and we need to use the global ID map to determine if the
   // point ghost levels should be set to 0.
 
-  vtkUnsignedCharArray *cellGL = incomingGhostCells->GetCellGhostArray();
-  vtkUnsignedCharArray *ptGL  = incomingGhostCells->GetPointGhostArray();
+  vtkDataArray *da = incomingGhostCells->GetCellData()->GetArray("vtkGhostLevels");
+  vtkUnsignedCharArray *cellGL = vtkUnsignedCharArray::SafeDownCast(da);
 
+  da  = incomingGhostCells->GetPointData()->GetArray("vtkGhostLevels");
+  vtkUnsignedCharArray *ptGL = vtkUnsignedCharArray::SafeDownCast(da);
 
   unsigned char *ia = cellGL->GetPointer(0);
 
@@ -4423,7 +4427,8 @@ vtkUnstructuredGrid *vtkDistributedDataFilter::SetMergeGhostGrid(
 
   if (ghostLevel == 1)
     {
-    ptGL = mergedGrid->GetPointGhostArray();
+    da = mergedGrid->GetPointData()->GetArray("vtkGhostLevels");
+    ptGL = vtkUnsignedCharArray::SafeDownCast(da);
 
     vtkIdType *gidPoints = this->GetGlobalNodeIds(mergedGrid);
     int npoints = mergedGrid->GetNumberOfPoints();
diff --git a/Filters/ParallelMPI/vtkStructuredImplicitConnectivity.cxx b/Filters/ParallelMPI/vtkStructuredImplicitConnectivity.cxx
index fc657e3..0efa732 100644
--- a/Filters/ParallelMPI/vtkStructuredImplicitConnectivity.cxx
+++ b/Filters/ParallelMPI/vtkStructuredImplicitConnectivity.cxx
@@ -965,8 +965,11 @@ void vtkStructuredImplicitConnectivity::RegisterGrid(
           (this->InputGrid == NULL) );
   assert("pre: input grid ID should be >= 0" && (gridID >= 0) );
 
-  delete this->InputGrid;
-  this->InputGrid = NULL;
+  if (this->InputGrid)
+    {
+    delete this->InputGrid;
+    this->InputGrid = NULL;
+    }
 
   // Only add if the grid falls within the output extent. Processes that do
   // not contain the VOI will fail this test.
@@ -993,8 +996,11 @@ void vtkStructuredImplicitConnectivity::RegisterRectilinearGrid(
           (this->InputGrid == NULL) );
   assert("pre: input grid ID should be >= 0" && (gridID >= 0) );
 
-  delete this->InputGrid;
-  this->InputGrid = NULL;
+  if (this->InputGrid)
+    {
+    delete this->InputGrid;
+    this->InputGrid = NULL;
+    }
 
   // Only add if the grid falls within the output extent. Processes that do
   // not contain the VOI will fail this test.
diff --git a/Filters/Programmable/vtkProgrammableFilter.cxx b/Filters/Programmable/vtkProgrammableFilter.cxx
index 25ef83c..3236dfc 100644
--- a/Filters/Programmable/vtkProgrammableFilter.cxx
+++ b/Filters/Programmable/vtkProgrammableFilter.cxx
@@ -202,8 +202,8 @@ int vtkProgrammableFilter::RequestData(
         vtkCompositeDataIterator* iter = cdsInput->NewIterator();
         for(iter->InitTraversal(); !iter->IsDoneWithTraversal(); iter->GoToNextItem())
           {
-          vtkDataObject* iblock = iter->GetCurrentDataObject();
-          vtkDataObject* oblock = iblock->NewInstance();
+          vtkDataSet* iblock = vtkDataSet::SafeDownCast(iter->GetCurrentDataObject());
+          vtkDataSet* oblock = iblock->NewInstance();
           if (iblock)
             {
             if (this->CopyArrays)
@@ -212,12 +212,7 @@ int vtkProgrammableFilter::RequestData(
               }
             else
               {
-              vtkDataSet* iblockDS = vtkDataSet::SafeDownCast(iblock);
-              vtkDataSet* oblockDS = vtkDataSet::SafeDownCast(oblock);
-              if (iblockDS && oblockDS)
-                {
-                oblockDS->CopyStructure(iblockDS);
-                }
+              oblock->CopyStructure( iblock );
               }
             }
           cdsOutput->SetDataSet(iter, oblock);
diff --git a/Filters/SMP/CMakeLists.txt b/Filters/SMP/CMakeLists.txt
index 495415b..46d9c93 100644
--- a/Filters/SMP/CMakeLists.txt
+++ b/Filters/SMP/CMakeLists.txt
@@ -4,7 +4,6 @@ set(Module_SRCS
   vtkSMPMergePoints.cxx
   vtkSMPMergePolyDataHelper.cxx
   vtkThreadedSynchronizedTemplates3D.cxx
-  vtkThreadedSynchronizedTemplatesCutter3D.cxx
   vtkSMPTransform.cxx
   vtkSMPWarpVector.cxx
   )
diff --git a/Filters/SMP/Testing/Cxx/CMakeLists.txt b/Filters/SMP/Testing/Cxx/CMakeLists.txt
index 600c758..7ee514b 100644
--- a/Filters/SMP/Testing/Cxx/CMakeLists.txt
+++ b/Filters/SMP/Testing/Cxx/CMakeLists.txt
@@ -2,7 +2,6 @@ vtk_add_test_cxx(${vtk-module}CxxTests tests
   NO_VALID
   TestSMPContour.cxx
   TestThreadedSynchronizedTemplates3D.cxx
-  TestThreadedSynchronizedTemplatesCutter3D.cxx
   TestSMPTransform.cxx
   TestSMPWarp.cxx
   )
diff --git a/Filters/SMP/Testing/Cxx/TestThreadedSynchronizedTemplatesCutter3D.cxx b/Filters/SMP/Testing/Cxx/TestThreadedSynchronizedTemplatesCutter3D.cxx
deleted file mode 100644
index 07953ed..0000000
--- a/Filters/SMP/Testing/Cxx/TestThreadedSynchronizedTemplatesCutter3D.cxx
+++ /dev/null
@@ -1,129 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    TestThreadedSynchronizedTemplatesCutter3D.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 "vtkAppendPolyData.h"
-#include "vtkCleanPolyData.h"
-#include "vtkCompositeDataIterator.h"
-#include "vtkCompositeDataSet.h"
-#include "vtkImageData.h"
-#include "vtkNew.h"
-#include "vtkPolyData.h"
-#include "vtkRTAnalyticSource.h"
-#include "vtkSmartPointer.h"
-#include "vtkSMPTools.h"
-#include "vtkSphere.h"
-#include "vtkSynchronizedTemplatesCutter3D.h"
-#include "vtkThreadedSynchronizedTemplatesCutter3D.h"
-#include "vtkTimerLog.h"
-
-#include <algorithm>
-
-
-int TestThreadedSynchronizedTemplatesCutter3D(int, char *[])
-{
-  static const int dim = 257;
-  static int ext[6] = { 0, dim - 1, 0, dim - 1, 0, dim - 1 };
-
-  //vtkSMPTools::Initialize(4);
-  vtkNew<vtkTimerLog> tl;
-
-  vtkNew<vtkRTAnalyticSource> source;
-  source->SetWholeExtent(ext[0], ext[1], ext[2], ext[3], ext[4], ext[5]);
-  tl->StartTimer();
-  source->Update();
-  tl->StopTimer();
-
-  cout << "Creation time: " << tl->GetElapsedTime() << " seconds" << endl;
-
-  double bounds[6];
-  source->GetOutput()->GetBounds(bounds);
-
-  double center[3] = {(bounds[0] + bounds[1])/2.0, (bounds[2] + bounds[3])/2.0,
-                      (bounds[4] + bounds[5])/2.0};
-  double radius = std::min((bounds[1] - bounds[0])/2.0,
-                           std::min((bounds[3] - bounds[2])/2.0,
-                                    (bounds[5] - bounds[4])/2.0));
-
-  vtkNew<vtkSphere> impfunc;
-  impfunc->SetRadius(radius);
-  impfunc->SetCenter(center);
-
-  vtkNew<vtkSynchronizedTemplatesCutter3D> sc;
-  sc->SetInputData(source->GetOutput());
-  sc->SetCutFunction(impfunc.GetPointer());
-  tl->StartTimer();
-  sc->Update();
-  tl->StopTimer();
-
-  double serialTime = tl->GetElapsedTime();
-  cout << "Serial Execution Time: " << serialTime << " seconds" << endl;
-
-  vtkNew<vtkThreadedSynchronizedTemplatesCutter3D> pc;
-  pc->SetInputData(source->GetOutput());
-  pc->SetCutFunction(impfunc.GetPointer());
-  tl->StartTimer();
-  pc->Update();
-  tl->StopTimer();
-
-  double parallelTime = tl->GetElapsedTime();
-  cout << "SMP Execution Time: " << parallelTime << " seconds" << endl;
-
-  int numPieces = 0;
-  vtkNew<vtkAppendPolyData> appender;
-  vtkSmartPointer<vtkCompositeDataIterator> iter;
-  iter.TakeReference(static_cast<vtkCompositeDataSet*>(
-    pc->GetOutputDataObject(0))->NewIterator());
-  iter->InitTraversal();
-  while(!iter->IsDoneWithTraversal())
-    {
-    vtkPolyData* piece =
-      static_cast<vtkPolyData*>(iter->GetCurrentDataObject());
-    appender->AddInputData(piece);
-    ++numPieces;
-    iter->GoToNextItem();
-    }
-  tl->StartTimer();
-  appender->Update();
-  tl->StopTimer();
-
-  cout << "Append Poly Time: " << tl->GetElapsedTime() << " seconds" << endl;
-
-  vtkNew<vtkCleanPolyData> cleaner1, cleaner2;
-  cleaner1->SetInputData(sc->GetOutput());
-  cleaner1->Update();
-  cleaner2->SetInputData(appender->GetOutput());
-  cleaner2->Update();
-
-  int npoints1 = cleaner1->GetOutput()->GetNumberOfPoints();
-  int ntriangles1 = cleaner1->GetOutput()->GetNumberOfCells();
-  int npoints2 = cleaner2->GetOutput()->GetNumberOfPoints();
-  int ntriangles2 = cleaner2->GetOutput()->GetNumberOfCells();
-
-  cout << "Serial Output: Triangles=" << ntriangles1 << ", Points="
-       << npoints1 << endl;
-  cout << "SMP Output: Triangles=" << ntriangles2 << ", Points="
-       << npoints2 << endl;
-
-  if (npoints1 == npoints2 && ntriangles1 == ntriangles2)
-    {
-    cout << "Outputs match" << endl;
-    cout << "speedup = " << serialTime/parallelTime << "x with "
-         << numPieces << " threads" << endl;
-    return EXIT_SUCCESS;
-    }
-
-  cout << "Outputs don't match" << endl;
-  return EXIT_FAILURE;
-}
diff --git a/Filters/SMP/vtkSMPMergePoints.h b/Filters/SMP/vtkSMPMergePoints.h
index 90ef62d..ccc050c 100644
--- a/Filters/SMP/vtkSMPMergePoints.h
+++ b/Filters/SMP/vtkSMPMergePoints.h
@@ -31,7 +31,7 @@
 #include "vtkFiltersSMPModule.h" // For export macro
 #include "vtkMergePoints.h"
 #include "vtkIdList.h" // For inline functions
-#include "vtkAtomicTypes.h" // For the atomic integer used in Merge()
+#include "vtkAtomicInt.h" // For the atomic integer used in Merge()
 
 class vtkPointData;
 
@@ -99,7 +99,7 @@ protected:
   vtkSMPMergePoints();
   ~vtkSMPMergePoints();
 
-  vtkAtomicIdType AtomicInsertionId;
+  vtkAtomicInt<vtkIdType> AtomicInsertionId;
 
 private:
   vtkSMPMergePoints(const vtkSMPMergePoints&); // Not implemented
diff --git a/Filters/SMP/vtkThreadedSynchronizedTemplates3D.cxx b/Filters/SMP/vtkThreadedSynchronizedTemplates3D.cxx
index 129c5bf..a7c8c66 100644
--- a/Filters/SMP/vtkThreadedSynchronizedTemplates3D.cxx
+++ b/Filters/SMP/vtkThreadedSynchronizedTemplates3D.cxx
@@ -93,19 +93,14 @@ static void vtkThreadedSynchronizedTemplates3DInitializeOutput(
 {
   vtkPoints *newPts;
   vtkCellArray *newPolys;
+  long estimatedSize;
 
-  const vtkIdType numCells = static_cast<vtkIdType>(ext[1]-ext[0]+1) *
-                             static_cast<vtkIdType>(ext[3]-ext[2]+1) *
-                             static_cast<vtkIdType>(ext[5]-ext[4]+1);
-
-  vtkIdType estimatedSize = (vtkIdType) pow (static_cast<double>(numCells),
-                                             .75);
-
+  estimatedSize = (int) pow ((double)
+      ((ext[1]-ext[0]+1)*(ext[3]-ext[2]+1)*(ext[5]-ext[4]+1)), .75);
   if (estimatedSize < 1024)
     {
     estimatedSize = 1024;
     }
-
   estimatedSize /= estimatedNumberOfPieces;
 
   newPts = vtkPoints::New();
@@ -160,7 +155,7 @@ static void vtkThreadedSynchronizedTemplates3DInitializeOutput(
 // Calculate the gradient using central difference.
 template <class T>
 void vtkSTComputePointGradient(int i, int j, int k, T *s, int *inExt,
-                               vtkIdType xInc, vtkIdType yInc, vtkIdType zInc,
+                               int xInc, int yInc, int zInc,
                                double *spacing, double n[3])
 {
   double sp, sm;
@@ -268,17 +263,17 @@ void ContourImage(vtkThreadedSynchronizedTemplates3D *self, int* exExt,
                   vtkDataArray *inScalars, bool outputTriangles)
 {
   int *inExt = data->GetExtent();
-  vtkIdType xdim = exExt[1] - exExt[0] + 1;
-  vtkIdType ydim = exExt[3] - exExt[2] + 1;
+  int xdim = exExt[1] - exExt[0] + 1;
+  int ydim = exExt[3] - exExt[2] + 1;
   double *values = self->GetValues();
   int numContours = self->GetNumberOfContours();
   T *inPtrX, *inPtrY, *inPtrZ;
   T *s0, *s1, *s2, *s3;
   int xMin, xMax, yMin, yMax, zMin, zMax;
-  vtkIdType xInc, yInc, zInc;
+  int xInc, yInc, zInc;
   double *origin = data->GetOrigin();
   double *spacing = data->GetSpacing();
-  vtkIdType *isect1Ptr, *isect2Ptr;
+  int *isect1Ptr, *isect2Ptr;
   double y, z, t;
   int i, j, k;
   int zstep, yisectstep;
@@ -288,16 +283,15 @@ void ContourImage(vtkThreadedSynchronizedTemplates3D *self, int* exExt,
   int ComputeScalars = self->GetComputeScalars();
   int NeedGradients = ComputeGradients || ComputeNormals;
   double n[3], n0[3], n1[3];
-  vtkIdType jj, g0;
+  int jj, g0;
   int *tablePtr;
-  vtkIdType idx;
-  int vidx;
+  int idx, vidx;
   double x[3], xz[3];
   int v0, v1, v2, v3;
   vtkIdType ptIds[3];
   double value;
   // We need to know the edgePointId's for interpolating attributes.
-  vtkIdType edgePtId, inCellId, outCellId;
+  int edgePtId, inCellId, outCellId;
   vtkPointData *inPD = data->GetPointData();
   vtkCellData *inCD = data->GetCellData();
   vtkPointData *outPD = output->GetPointData();
@@ -345,7 +339,7 @@ void ContourImage(vtkThreadedSynchronizedTemplates3D *self, int* exExt,
   offsets[11] = zstep*3;
 
   // allocate storage array
-  vtkIdType *isect1 = new vtkIdType [xdim*ydim*3*2];
+  int *isect1 = new int [xdim*ydim*3*2];
   // set impossible edges to -1
   for (i = 0; i < ydim; i++)
     {
@@ -743,7 +737,7 @@ public:
     et->SetWholeExtent(this->ExExt);
     et->SetNumberOfPieces(this->NumberOfPieces);
     ThreadLocalWorkSpace &ws = tlws.Local();
-    for(vtkIdType i=begin; i<end; i++)
+    for(int i=begin; i<end; i++)
       {
       int exExt2[6];
       et->SetPiece(i);
@@ -832,14 +826,10 @@ void vtkThreadedSynchronizedTemplates3D::ThreadedExecute(vtkImageData *data,
     return;
     }
 
-  //multiplication needs to be as vtkIdType so we don't roll the integer
-  //over when computing the number of cells in very large grids
-  vtkIdType ncells = static_cast<vtkIdType>(exExt[1] - exExt[0]) *
-                     static_cast<vtkIdType>(exExt[3] - exExt[2]) *
-                     static_cast<vtkIdType>(exExt[5] - exExt[4]);
-  const vtkIdType grainSize = 32 * 32 * 32;
-  vtkIdType nPieces = (ncells == 0) ? 1 : (ncells + grainSize - 1)/grainSize;
-
+  int ncells = (exExt[1] - exExt[0]) * (exExt[3] - exExt[2]) *
+               (exExt[5] - exExt[4]);
+  const int grainSize = 32 * 32 * 32;
+  int nPieces = (ncells == 0) ? 1 : (ncells + grainSize - 1)/grainSize;
   DoThreadedContour functor(this, exExt, data, inScalars, nPieces);
   vtkSMPTools::For( 0, nPieces, functor );
 
diff --git a/Filters/SMP/vtkThreadedSynchronizedTemplates3D.h b/Filters/SMP/vtkThreadedSynchronizedTemplates3D.h
index 482b44d..6ad7761 100644
--- a/Filters/SMP/vtkThreadedSynchronizedTemplates3D.h
+++ b/Filters/SMP/vtkThreadedSynchronizedTemplates3D.h
@@ -25,8 +25,8 @@
 // .SECTION See Also
 // vtkContourFilter vtkThreadedSynchronizedTemplates2D
 
-#ifndef vtkThreadedSynchronizedTemplates3D_h
-#define vtkThreadedSynchronizedTemplates3D_h
+#ifndef __vtkThreadedSynchronizedTemplates3D_h
+#define __vtkThreadedSynchronizedTemplates3D_h
 
 #include "vtkFiltersSMPModule.h" // For export macro
 #include "vtkMultiBlockDataSetAlgorithm.h"
diff --git a/Filters/SMP/vtkThreadedSynchronizedTemplatesCutter3D.cxx b/Filters/SMP/vtkThreadedSynchronizedTemplatesCutter3D.cxx
deleted file mode 100644
index 77a58f0..0000000
--- a/Filters/SMP/vtkThreadedSynchronizedTemplatesCutter3D.cxx
+++ /dev/null
@@ -1,751 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkThreadedSynchronizedTemplatesCutter3D.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 "vtkThreadedSynchronizedTemplatesCutter3D.h"
-
-#include "vtkCellArray.h"
-#include "vtkCellData.h"
-#include "vtkCharArray.h"
-#include "vtkDoubleArray.h"
-#include "vtkFloatArray.h"
-#include "vtkImplicitFunction.h"
-#include "vtkInformation.h"
-#include "vtkInformationVector.h"
-#include "vtkIntArray.h"
-#include "vtkLongArray.h"
-#include "vtkMath.h"
-#include "vtkObjectFactory.h"
-#include "vtkPointData.h"
-#include "vtkPolyData.h"
-#include "vtkShortArray.h"
-#include "vtkStreamingDemandDrivenPipeline.h"
-#include "vtkStructuredPoints.h"
-#include "vtkUnsignedCharArray.h"
-#include "vtkUnsignedIntArray.h"
-#include "vtkUnsignedLongArray.h"
-#include "vtkUnsignedShortArray.h"
-#include "vtkPolygonBuilder.h"
-#include "vtkIdList.h"
-#include "vtkSmartPointer.h"
-
-#include <math.h>
-
-#include "vtkSMPTools.h"
-#include "vtkSMPThreadLocalObject.h"
-#include "vtkNew.h"
-#include "vtkExtentTranslator.h"
-#include "vtkMultiBlockDataSet.h"
-#include "vtkPlane.h"
-
-vtkStandardNewMacro(vtkThreadedSynchronizedTemplatesCutter3D);
-vtkCxxSetObjectMacro(vtkThreadedSynchronizedTemplatesCutter3D,CutFunction,vtkImplicitFunction);
-
-//----------------------------------------------------------------------------
-// Description:
-// Construct object with initial scalar range (0,1) and single contour value
-// of 0.0. The ImageRange are set to extract the first k-plane.
-vtkThreadedSynchronizedTemplatesCutter3D::vtkThreadedSynchronizedTemplatesCutter3D()
-{
-  this->CutFunction = 0;
-  this->OutputPointsPrecision = vtkAlgorithm::DEFAULT_PRECISION;
-}
-
-//----------------------------------------------------------------------------
-vtkThreadedSynchronizedTemplatesCutter3D::~vtkThreadedSynchronizedTemplatesCutter3D()
-{
-  this->SetCutFunction(NULL);
-}
-
-//----------------------------------------------------------------------------
-// Overload standard modified time function. If cut functions is modified,
-// or contour values modified, then this object is modified as well.
-unsigned long vtkThreadedSynchronizedTemplatesCutter3D::GetMTime()
-{
-  unsigned long mTime=this->Superclass::GetMTime();
-
-  if ( this->CutFunction != NULL )
-    {
-    unsigned long time = this->CutFunction->GetMTime();
-    mTime = ( time > mTime ? time : mTime );
-    }
-
-  return mTime;
-}
-
-//----------------------------------------------------------------------------
-int vtkThreadedSynchronizedTemplatesCutter3D::FillOutputPortInformation(
-  int vtkNotUsed(port), vtkInformation* info)
-{
-  info->Set(vtkDataObject::DATA_TYPE_NAME(), "vtkMultiBlockDataSet");
-  return 1;
-}
-
-//----------------------------------------------------------------------------
-static void vtkThreadedSynchronizedTemplatesCutter3DInitializeOutput(
-  int *ext, int precision, int estimatedNumberOfPieces, vtkImageData *input,
-  vtkPolyData *o)
-{
-  vtkPoints *newPts;
-  vtkCellArray *newPolys;
-  long estimatedSize;
-
-  estimatedSize = (int) pow ((double)
-      ((ext[1]-ext[0]+1)*(ext[3]-ext[2]+1)*(ext[5]-ext[4]+1)), .75);
-  if (estimatedSize < 1024)
-    {
-    estimatedSize = 1024;
-    }
-  estimatedSize /= estimatedNumberOfPieces;
-
-  newPts = vtkPoints::New();
-
-  // set precision for the points in the output
-  if(precision == vtkAlgorithm::DEFAULT_PRECISION)
-    {
-    vtkPointSet *inputPointSet = vtkPointSet::SafeDownCast(input);
-    if(inputPointSet)
-      {
-      newPts->SetDataType(inputPointSet->GetPoints()->GetDataType());
-      }
-    else
-      {
-      newPts->SetDataType(VTK_FLOAT);
-      }
-    }
-  else if(precision == vtkAlgorithm::SINGLE_PRECISION)
-    {
-    newPts->SetDataType(VTK_FLOAT);
-    }
-  else if(precision == vtkAlgorithm::DOUBLE_PRECISION)
-    {
-    newPts->SetDataType(VTK_DOUBLE);
-    }
-
-  newPts->Allocate(estimatedSize,estimatedSize);
-  newPolys = vtkCellArray::New();
-  newPolys->Allocate(newPolys->EstimateSize(estimatedSize,3));
-
-  o->GetPointData()->CopyAllOn();
-
-  o->GetPointData()->InterpolateAllocate(input->GetPointData(),
-                                         estimatedSize,estimatedSize/2);
-  o->GetCellData()->CopyAllocate(input->GetCellData(),
-                                 estimatedSize,estimatedSize/2);
-
-  o->SetPoints(newPts);
-  newPts->Delete();
-
-  o->SetPolys(newPolys);
-  newPolys->Delete();
-}
-
-inline void PointIndexToPosition(vtkImageData *img, int xidx, int yidx,
-                                 int zidx, double position[3])
-{
-  double *origin = img->GetOrigin();
-  double *spacing = img->GetSpacing();
-
-  position[0] = origin[0] + (static_cast<double>(xidx) * spacing[0]);
-  position[1] = origin[1] + (static_cast<double>(yidx) * spacing[1]);
-  position[2] = origin[2] + (static_cast<double>(zidx) * spacing[2]);
-}
-
-inline int GetSideOfSurface(vtkImplicitFunction *func, double value,
-                            const double pos[3])
-{
-  double diff = func->FunctionValue(pos) - value;
-  return (diff < 0.0) ? -1 : ((diff > 0.0) ? 1 : 0);
-}
-
-//----------------------------------------------------------------------------
-//
-// Contouring filter specialized for images
-//
-template <class T>
-void ContourImage(vtkThreadedSynchronizedTemplatesCutter3D *self, int *exExt,
-                  vtkImageData *data, vtkPolyData *output, T *ptr,
-                  bool outputTriangles)
-{
-  int *inExt = data->GetExtent();
-  int xdim = exExt[1] - exExt[0] + 1;
-  int ydim = exExt[3] - exExt[2] + 1;
-  double *values = self->GetValues();
-  int numContours = self->GetNumberOfContours();
-  T *inPtrX, *inPtrY, *inPtrZ;
-  T *s0, *s1, *s2, *s3;
-  int xMin, xMax, yMin, yMax, zMin, zMax;
-  int xInc, yInc, zInc;
-  int xIncFunc, yIncFunc, zIncFunc, scalarZIncFunc;
-  double *origin = data->GetOrigin();
-  double *spacing = data->GetSpacing();
-  int *isect1Ptr, *isect2Ptr;
-  double y, z, t;
-  int i, j, k;
-  int zstep, yisectstep;
-  int offsets[12];
-  int *tablePtr;
-  int idx, vidx;
-  double x[3], xz[3];
-  int v0, v1, v2, v3;
-  vtkIdType ptIds[3];
-  double value;
-  // We need to know the edgePointId's for interpolating attributes.
-  int edgePtId, inCellId, outCellId;
-  vtkPointData *inPD = data->GetPointData();
-  vtkCellData *inCD = data->GetCellData();
-  vtkPointData *outPD = output->GetPointData();
-  vtkCellData *outCD = output->GetCellData();
-  // Use to be arguments
-  vtkPoints *newPts;
-  vtkCellArray *newPolys;
-  ptr += self->GetArrayComponent();
-  vtkPolygonBuilder polyBuilder;
-  vtkSmartPointer<vtkIdList> poly = vtkSmartPointer<vtkIdList>::New();
-
-  newPts = output->GetPoints();
-  newPolys = output->GetPolys();
-
-  xMin = exExt[0];
-  xMax = exExt[1];
-  yMin = exExt[2];
-  yMax = exExt[3];
-  zMin = exExt[4];
-  zMax = exExt[5];
-
-  vtkImplicitFunction *func = self->GetCutFunction();
-  if (!func)
-    {
-    return;
-    }
-
-  xInc = 1;
-  yInc = xInc*(inExt[1]-inExt[0]+1);
-  zInc = yInc*(inExt[3]-inExt[2]+1);
-
-  // Note that the implicit functions are specified
-  //over exExt so we need to compute the steps differently
-  xIncFunc = 1;
-  yIncFunc = xIncFunc*xdim;
-  zIncFunc = yIncFunc*ydim;
-  scalarZIncFunc = zIncFunc;
-
-  // Kens increments, probably to do with edge array
-  zstep = xdim*ydim;
-  yisectstep = xdim*3;
-  // compute offsets probably how to get to the edges in the edge array.
-  offsets[0] = -xdim*3;
-  offsets[1] = -xdim*3 + 1;
-  offsets[2] = -xdim*3 + 2;
-  offsets[3] = -xdim*3 + 4;
-  offsets[4] = -xdim*3 + 5;
-  offsets[5] = 0;
-  offsets[6] = 2;
-  offsets[7] = 5;
-  offsets[8] = (zstep - xdim)*3;
-  offsets[9] = (zstep - xdim)*3 + 1;
-  offsets[10] = (zstep - xdim)*3 + 4;
-  offsets[11] = zstep*3;
-
-  double bboxCorners[8][3];
-  PointIndexToPosition(data, exExt[0], exExt[2], exExt[4], bboxCorners[0]);
-  PointIndexToPosition(data, exExt[1], exExt[2], exExt[4], bboxCorners[1]);
-  PointIndexToPosition(data, exExt[0], exExt[3], exExt[4], bboxCorners[2]);
-  PointIndexToPosition(data, exExt[0], exExt[2], exExt[5], bboxCorners[3]);
-  PointIndexToPosition(data, exExt[1], exExt[3], exExt[4], bboxCorners[4]);
-  PointIndexToPosition(data, exExt[0], exExt[3], exExt[5], bboxCorners[5]);
-  PointIndexToPosition(data, exExt[1], exExt[2], exExt[5], bboxCorners[6]);
-  PointIndexToPosition(data, exExt[1], exExt[3], exExt[5], bboxCorners[7]);
-
-  // allocate storage array
-  int *isect1 = new int [xdim*ydim*3*2];
-  // set impossible edges to -1
-  for (i = 0; i < ydim; i++)
-    {
-    isect1[(i+1)*xdim*3-3] = -1;
-    isect1[(i+1)*xdim*3*2-3] = -1;
-    }
-  for (i = 0; i < xdim; i++)
-    {
-    isect1[((ydim-1)*xdim + i)*3 + 1] = -1;
-    isect1[((ydim-1)*xdim + i)*3*2 + 1] = -1;
-    }
-
-  // allocate scalar storage for two slices
-  T *scalars = 0;
-  T *scalars1 = 0;
-  T *scalars2 = 0;
-  scalars = new T [xdim*ydim*2];
-  scalars1 = scalars;
-  scalars2 = scalars + xdim*ydim;
-
-  // for each contour
-  for (vidx = 0; vidx < numContours; vidx++)
-    {
-    value = values[vidx];
-    inPtrZ = ptr;
-
-    // can the block be skipped?
-    int total = 0;
-    for (int ii = 0; ii < 8; ++ii)
-      {
-      total += GetSideOfSurface(func, value, bboxCorners[ii]);
-      }
-
-    vtkPlane *plane = vtkPlane::SafeDownCast(func);
-    if (plane && (total == 8 || total == -8))
-      {
-      continue;
-      }
-
-    // fill the first slice
-    z = origin[2] + spacing[2]*zMin;
-    x[2] = z;
-    T *scalarsTmp = scalars1;
-    scalars1 = scalars2;
-    scalars2 = scalarsTmp;
-    for (j = yMin; j <= yMax; j++)
-      {
-      x[1] = origin[1] + spacing[1]*j;
-      for (i = xMin; i <= xMax; i++)
-        {
-        x[0] = origin[0] + spacing[0]*i;
-        *scalarsTmp = func->FunctionValue(x);
-        scalarsTmp++;
-        }
-      }
-    scalarZIncFunc = -scalarZIncFunc;
-
-    //==================================================================
-    for (k = zMin; k <= zMax; k++)
-      {
-      // self->UpdateProgress((double)vidx/numContours +
-      //                      (k-zMin)/((zMax - zMin+1.0)*numContours));
-      inPtrY = inPtrZ;
-
-      // for each slice compute the scalars
-      z = origin[2] + spacing[2]*(k+1);
-      x[2] = z;
-      scalarsTmp = scalars1;
-      scalars1 = scalars2;
-      scalars2 = scalarsTmp;
-      // if not the last slice then get more scalars
-      if (k < zMax)
-        {
-        for (j = yMin; j <= yMax; j++)
-          {
-          x[1] = origin[1] + spacing[1]*j;
-          for (i = xMin; i <= xMax; i++)
-            {
-            x[0] = origin[0] + spacing[0]*i;
-            *scalarsTmp = func->FunctionValue(x);
-            scalarsTmp++;
-            }
-          }
-        }
-      inPtrY = scalars1;
-      scalarZIncFunc = -scalarZIncFunc;
-
-      z = origin[2] + spacing[2]*k;
-      x[2] = z;
-
-      // swap the buffers
-      if (k%2)
-        {
-        offsets[8] = (zstep - xdim)*3;
-        offsets[9] = (zstep - xdim)*3 + 1;
-        offsets[10] = (zstep - xdim)*3 + 4;
-        offsets[11] = zstep*3;
-        isect1Ptr = isect1;
-        isect2Ptr = isect1 + xdim*ydim*3;
-        }
-      else
-        {
-        offsets[8] = (-zstep - xdim)*3;
-        offsets[9] = (-zstep - xdim)*3 + 1;
-        offsets[10] = (-zstep - xdim)*3 + 4;
-        offsets[11] = -zstep*3;
-        isect1Ptr = isect1 + xdim*ydim*3;
-        isect2Ptr = isect1;
-        }
-
-      for (j = yMin; j <= yMax; j++)
-        {
-        // Should not impact performance here/
-        edgePtId = (xMin-inExt[0])*xInc + (j-inExt[2])*yInc + (k-inExt[4])*zInc;
-
-        // Increments are different for cells.  Since the cells are not
-        // contoured until the second row of templates, subtract 1 from
-        // i,j,and k.  Note: first cube is formed when i=0, j=1, and k=1.
-        inCellId =
-          (xMin-inExt[0]) + (inExt[1]-inExt[0])*
-          ( (j-inExt[2]-1) + (k-inExt[4]-1)*(inExt[3]-inExt[2]) );
-
-        y = origin[1] + j*spacing[1];
-        xz[1] = y;
-
-        s1 = inPtrY;
-        v1 = (*s1 < value ? 0 : 1);
-
-        inPtrX = inPtrY;
-        for (i = xMin; i <= xMax; i++)
-          {
-          s0 = s1;
-          v0 = v1;
-          *isect2Ptr = -1;
-          *(isect2Ptr + 1) = -1;
-          *(isect2Ptr + 2) = -1;
-          if (i < xMax)
-            {
-            s1 = (inPtrX + xIncFunc);
-            v1 = (*s1 < value ? 0 : 1);
-            if (v0 ^ v1)
-              {
-              // watch for degenerate points
-              if (*s0 == value)
-                {
-                if (i > xMin && *(isect2Ptr-3) > -1)
-                  {
-                  *isect2Ptr = *(isect2Ptr-3);
-                  }
-                else if (j > yMin && *(isect2Ptr - yisectstep + 1) > -1)
-                  {
-                  *isect2Ptr = *(isect2Ptr - yisectstep + 1);
-                  }
-                else if (k > zMin && *(isect1Ptr+2) > -1)
-                  {
-                  *isect2Ptr = *(isect1Ptr+2);
-                  }
-                }
-              else if (*s1 == value)
-                {
-                if (j > yMin && *(isect2Ptr - yisectstep +4) > -1)
-                  {
-                  *isect2Ptr = *(isect2Ptr - yisectstep + 4);
-                  }
-                else if (k > zMin && i < xMax && *(isect1Ptr + 5) > -1)
-                  {
-                  *isect2Ptr = *(isect1Ptr + 5);
-                  }
-                }
-              // if the edge has not been set yet then it is a new point
-              if (*isect2Ptr == -1)
-                {
-                t = (value - (double)(*s0)) / ((double)(*s1) - (double)(*s0));
-                x[0] = origin[0] + spacing[0]*(i+t);
-                x[1] = y;
-                *isect2Ptr = newPts->InsertNextPoint(x);
-                outPD->InterpolateEdge(inPD, *isect2Ptr, edgePtId, edgePtId+1, t);
-                }
-              }
-            }
-          if (j < yMax)
-            {
-            s2 = (inPtrX + yIncFunc);
-            v2 = (*s2 < value ? 0 : 1);
-            if (v0 ^ v2)
-              {
-              if (*s0 == value)
-                {
-                if (*isect2Ptr > -1)
-                  {
-                  *(isect2Ptr + 1) = *isect2Ptr;
-                  }
-                else if (i > xMin && *(isect2Ptr-3) > -1)
-                  {
-                  *(isect2Ptr + 1) = *(isect2Ptr-3);
-                  }
-                else if (j > yMin && *(isect2Ptr - yisectstep + 1) > -1)
-                  {
-                  *(isect2Ptr + 1) = *(isect2Ptr - yisectstep + 1);
-                  }
-                else if (k > zMin && *(isect1Ptr+2) > -1)
-                  {
-                  *(isect2Ptr + 1) = *(isect1Ptr+2);
-                  }
-                }
-              else if (*s2 == value && k > zMin && *(isect1Ptr + yisectstep + 2) > -1)
-                {
-                *(isect2Ptr+1) = *(isect1Ptr + yisectstep + 2);
-                }
-              // if the edge has not been set yet then it is a new point
-              if (*(isect2Ptr + 1) == -1)
-                {
-                t = (value - (double)(*s0)) / ((double)(*s2) - (double)(*s0));
-                x[0] = origin[0] + spacing[0]*i;
-                x[1] = y + spacing[1]*t;
-                *(isect2Ptr + 1) = newPts->InsertNextPoint(x);
-                outPD->InterpolateEdge(inPD, *(isect2Ptr+1), edgePtId, edgePtId+yInc, t);
-                }
-              }
-            }
-          if (k < zMax)
-            {
-            s3 = (inPtrX + scalarZIncFunc);
-            v3 = (*s3 < value ? 0 : 1);
-            if (v0 ^ v3)
-              {
-              if (*s0 == value)
-                {
-                if (*isect2Ptr > -1)
-                  {
-                  *(isect2Ptr + 2) = *isect2Ptr;
-                  }
-                else if (*(isect2Ptr+1) > -1)
-                  {
-                  *(isect2Ptr + 2) = *(isect2Ptr+1);
-                  }
-                else if (i > xMin && *(isect2Ptr-3) > -1)
-                  {
-                  *(isect2Ptr + 2) = *(isect2Ptr-3);
-                  }
-                else if (j > yMin && *(isect2Ptr - yisectstep + 1) > -1)
-                  {
-                  *(isect2Ptr + 2) = *(isect2Ptr - yisectstep + 1);
-                  }
-                else if (k > zMin && *(isect1Ptr+2) > -1)
-                  {
-                  *(isect2Ptr + 2) = *(isect1Ptr+2);
-                  }
-                }
-              if (*(isect2Ptr + 2) == -1)
-                {
-                t = (value - (double)(*s0)) / ((double)(*s3) - (double)(*s0));
-                xz[0] = origin[0] + spacing[0]*i;
-                xz[2] = z + spacing[2]*t;
-                *(isect2Ptr + 2) = newPts->InsertNextPoint(xz);
-                outPD->InterpolateEdge(inPD, *(isect2Ptr+2), edgePtId, edgePtId+zInc, t);
-                }
-              }
-            }
-          // To keep track of ids for interpolating attributes.
-          ++edgePtId;
-
-          // now add any polys that need to be added
-          // basically look at the isect values,
-          // form an index and lookup the polys
-          if (j > yMin && i < xMax && k > zMin)
-            {
-            idx = (v0 ? 4096 : 0);
-            idx = idx + (*(isect1Ptr - yisectstep) > -1 ? 2048 : 0);
-            idx = idx + (*(isect1Ptr -yisectstep +1) > -1 ? 1024 : 0);
-            idx = idx + (*(isect1Ptr -yisectstep +2) > -1 ? 512 : 0);
-            idx = idx + (*(isect1Ptr -yisectstep +4) > -1 ? 256 : 0);
-            idx = idx + (*(isect1Ptr -yisectstep +5) > -1 ? 128 : 0);
-            idx = idx + (*(isect1Ptr) > -1 ? 64 : 0);
-            idx = idx + (*(isect1Ptr + 2) > -1 ? 32 : 0);
-            idx = idx + (*(isect1Ptr + 5) > -1 ? 16 : 0);
-            idx = idx + (*(isect2Ptr -yisectstep) > -1 ? 8 : 0);
-            idx = idx + (*(isect2Ptr -yisectstep +1) > -1 ? 4 : 0);
-            idx = idx + (*(isect2Ptr -yisectstep +4) > -1 ? 2 : 0);
-            idx = idx + (*(isect2Ptr) > -1 ? 1 : 0);
-
-            tablePtr = VTK_TSYNCHRONIZED_TEMPLATES_3D_TABLE_2
-              + VTK_TSYNCHRONIZED_TEMPLATES_3D_TABLE_1[idx];
-
-            if (!outputTriangles)
-              {
-              polyBuilder.Reset();
-              }
-            while (*tablePtr != -1)
-              {
-              ptIds[0] = *(isect1Ptr + offsets[*tablePtr]);
-              tablePtr++;
-              ptIds[1] = *(isect1Ptr + offsets[*tablePtr]);
-              tablePtr++;
-              ptIds[2] = *(isect1Ptr + offsets[*tablePtr]);
-              tablePtr++;
-              if (ptIds[0] != ptIds[1] &&
-                  ptIds[0] != ptIds[2] &&
-                  ptIds[1] != ptIds[2])
-                {
-                if(outputTriangles)
-                  {
-                  outCellId = newPolys->InsertNextCell(3,ptIds);
-                  outCD->CopyData(inCD, inCellId, outCellId);
-                  }
-                else
-                  {
-                  polyBuilder.InsertTriangle(ptIds);
-                  }
-                }
-              }
-            if(!outputTriangles)
-              {
-              polyBuilder.GetPolygon(poly);
-              if(poly->GetNumberOfIds()>0)
-                {
-                outCellId = newPolys->InsertNextCell(poly);
-                outCD->CopyData(inCD, inCellId, outCellId);
-                }
-              }
-            }
-          inPtrX += xIncFunc;
-          isect2Ptr += 3;
-          isect1Ptr += 3;
-          // To keep track of ids for copying cell attributes..
-          ++inCellId;
-          }
-        inPtrY += yIncFunc;
-        }
-      inPtrZ += zIncFunc;
-      }
-    }
-  delete [] isect1;
-
-  delete [] scalars;
-}
-
-class DoThreadedCut
-{
-public:
-  DoThreadedCut(vtkThreadedSynchronizedTemplatesCutter3D* filter, int* exExt,
-    vtkImageData* input, int numPieces)
-    : Filter(filter), ExExt(exExt), Input(input), Outputs(NULL),
-      NumberOfPieces(numPieces), NumOutputPieces(0)
-  {
-  }
-
-  ~DoThreadedCut()
-  {
-    delete[] this->Outputs;
-  }
-
-  int GetNumberOfOutputPieces() const
-  {
-    return this->NumOutputPieces;
-  }
-
-  vtkPolyData* GetOutputPiece(int pieceIdx)
-  {
-    return this->Outputs[pieceIdx];
-  }
-
-  void Initialize()
-  {
-  vtkThreadedSynchronizedTemplatesCutter3DInitializeOutput(ExExt,
-    Filter->GetOutputPointsPrecision(),
-    vtkSMPTools::GetEstimatedNumberOfThreads(), Input, this->tlsPoly.Local());
-  }
-
-  void Reduce()
-  {
-  this->NumOutputPieces = static_cast<int>(tlsPoly.size());
-  this->Outputs = new vtkPolyData* [this->NumOutputPieces];
-
-  int p = 0;
-  for (ThreadLocalPolyObject::iterator i = this->tlsPoly.begin();
-       i != this->tlsPoly.end(); ++i)
-    {
-    vtkPolyData *thisPiece = vtkPolyData::New();
-    thisPiece->ShallowCopy(*i);
-    this->Outputs[p++] = thisPiece;
-    }
-  }
-
-  void operator()( vtkIdType begin, vtkIdType end )
-  {
-    vtkNew<vtkExtentTranslator> et;
-    et->SetWholeExtent(this->ExExt);
-    et->SetNumberOfPieces(this->NumberOfPieces);
-    for(int i=begin; i<end; i++)
-      {
-      int exExt2[6];
-      et->SetPiece(i);
-      et->PieceToExtent();
-      et->GetExtent(exExt2);
-      ContourImage(this->Filter, exExt2, this->Input, this->tlsPoly.Local(),
-                   (double*)0, true);
-      }
-  }
-
-private:
-  vtkThreadedSynchronizedTemplatesCutter3D* Filter;
-  int* ExExt;
-  vtkImageData* Input;
-  vtkPolyData** Outputs;
-  int NumberOfPieces;
-  int NumOutputPieces;
-
-  typedef vtkSMPThreadLocalObject<vtkPolyData> ThreadLocalPolyObject;
-  ThreadLocalPolyObject tlsPoly;
-};
-
-//----------------------------------------------------------------------------
-//
-// Contouring filter specialized for images (or slices from images)
-//
-void vtkThreadedSynchronizedTemplatesCutter3D::ThreadedExecute(
-  vtkImageData *data, vtkInformation *outInfo, int)
-{
-  vtkMultiBlockDataSet *output;
-
-  vtkDebugMacro(<< "Executing Cutter3D structured contour");
-
-  output = vtkMultiBlockDataSet::GetData(outInfo);
-
-  int* exExt = data->GetExtent();
-  if ( exExt[0] >= exExt[1] || exExt[2] >= exExt[3] || exExt[4] >= exExt[5] )
-    {
-    vtkDebugMacro(<<"Cutter3D structured contours requires Cutter3D data");
-    return;
-    }
-
-  int ncells = (exExt[1] - exExt[0]) * (exExt[3] - exExt[2]) *
-               (exExt[5] - exExt[4]);
-  const int grainSize = 64 * 64 * 64;
-  int nPieces = (ncells == 0) ? 1 : (ncells + grainSize - 1)/grainSize;
-  DoThreadedCut functor(this, exExt, data, nPieces);
-  vtkSMPTools::For( 0, nPieces, functor );
-
-  int count = 0;
-  for(int i = 0; i < functor.GetNumberOfOutputPieces(); ++i)
-    {
-    vtkPolyData* contour = functor.GetOutputPiece(i);
-    if (contour->GetNumberOfCells() > 0)
-      {
-      output->SetBlock(count++, contour);
-      }
-    contour->Delete();
-    }
-}
-
-//----------------------------------------------------------------------------
-int vtkThreadedSynchronizedTemplatesCutter3D::RequestData(
-  vtkInformation *vtkNotUsed(request),
-  vtkInformationVector **inputVector,
-  vtkInformationVector *outputVector)
-{
-  // get the info objects
-  vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
-  vtkInformation *outInfo = outputVector->GetInformationObject(0);
-
-  // get the input and output
-  vtkImageData *input = vtkImageData::SafeDownCast(
-    inInfo->Get(vtkDataObject::DATA_OBJECT()));
-
-  // Just call the threaded execute directly.
-  this->ThreadedExecute(input, outInfo, 0);
-
-  return 1;
-}
-
-
-//----------------------------------------------------------------------------
-void vtkThreadedSynchronizedTemplatesCutter3D::PrintSelf(ostream& os, vtkIndent indent)
-{
-  this->Superclass::PrintSelf(os,indent);
-  os << indent << "Cut Function: " << this->CutFunction << "\n";
-  os << indent << "Precision of the output points: "
-     << this->OutputPointsPrecision << "\n";
-}
diff --git a/Filters/SMP/vtkThreadedSynchronizedTemplatesCutter3D.h b/Filters/SMP/vtkThreadedSynchronizedTemplatesCutter3D.h
deleted file mode 100644
index 7ce291c..0000000
--- a/Filters/SMP/vtkThreadedSynchronizedTemplatesCutter3D.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkThreadedSynchronizedTemplatesCutter3D.h
-
-  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.
-
-=========================================================================*/
-// .NAME vtkThreadedSynchronizedTemplatesCutter3D - generate cut surface from structured points
-
-// .SECTION Description
-// vtkThreadedSynchronizedTemplatesCutter3D is an implementation of the
-// synchronized template algorithm.
-
-// .SECTION See Also
-// vtkContourFilter vtkSynchronizedTemplates3D vtkThreadedSynchronizedTemplates3D vtkSynchronizedTemplatesCutter3D
-
-#ifndef vtkThreadedSynchronizedTemplatesCutter3D_h
-#define vtkThreadedSynchronizedTemplatesCutter3D_h
-
-#include "vtkFiltersSMPModule.h" // For export macro
-#include "vtkThreadedSynchronizedTemplates3D.h"
-
-class vtkImplicitFunction;
-
-class VTKFILTERSSMP_EXPORT vtkThreadedSynchronizedTemplatesCutter3D : public vtkThreadedSynchronizedTemplates3D
-{
-public:
-  static vtkThreadedSynchronizedTemplatesCutter3D *New();
-
-  vtkTypeMacro(vtkThreadedSynchronizedTemplatesCutter3D,vtkThreadedSynchronizedTemplates3D);
-  void PrintSelf(ostream& os, vtkIndent indent);
-
-  // Description:
-  // Needed by templated functions.
-  void ThreadedExecute(vtkImageData *data, vtkInformation *outInfo, int);
-
-  // Description
-  // Specify the implicit function to perform the cutting.
-  virtual void SetCutFunction(vtkImplicitFunction*);
-  vtkGetObjectMacro(CutFunction,vtkImplicitFunction);
-
-  // Description:
-  // Set/get the desired precision for the output types. See the documentation
-  // for the vtkAlgorithm::DesiredOutputPrecision enum for an explanation of
-  // the available precision settings.
-  vtkSetClampMacro(OutputPointsPrecision, int, SINGLE_PRECISION, DEFAULT_PRECISION);
-  vtkGetMacro(OutputPointsPrecision, int);
-
-  // Description:
-  // Override GetMTime because we delegate to vtkContourValues and refer to
-  // vtkImplicitFunction.
-  unsigned long GetMTime();
-
-protected:
-  vtkThreadedSynchronizedTemplatesCutter3D();
-  ~vtkThreadedSynchronizedTemplatesCutter3D();
-
-  vtkImplicitFunction *CutFunction;
-  int OutputPointsPrecision;
-
-  virtual int RequestData(vtkInformation *,
-                          vtkInformationVector **,
-                          vtkInformationVector *);
-
-  virtual int FillOutputPortInformation(int port, vtkInformation* info);
-private:
-  vtkThreadedSynchronizedTemplatesCutter3D(const vtkThreadedSynchronizedTemplatesCutter3D&);  // Not implemented.
-  void operator=(const vtkThreadedSynchronizedTemplatesCutter3D&);  // Not implemented.
-};
-
-#endif
diff --git a/Filters/Selection/Testing/Cxx/TestCellDistanceSelector2D.cxx b/Filters/Selection/Testing/Cxx/TestCellDistanceSelector2D.cxx
index 23f5fe9..e65b546 100644
--- a/Filters/Selection/Testing/Cxx/TestCellDistanceSelector2D.cxx
+++ b/Filters/Selection/Testing/Cxx/TestCellDistanceSelector2D.cxx
@@ -34,7 +34,7 @@
 #include <vtksys/ios/sstream>
 
 // Reference values
-static vtkIdType cardCellDistanceSelection2D[] =
+vtkIdType cardCellDistanceSelection2D[] =
 {
   25,
   6,
diff --git a/Filters/Selection/module.cmake b/Filters/Selection/module.cmake
index 16f8e8a..42a971b 100644
--- a/Filters/Selection/module.cmake
+++ b/Filters/Selection/module.cmake
@@ -9,6 +9,7 @@ vtk_module(vtkFiltersSelection
     vtkIOLegacy
     vtkIOXML
     vtkRendering${VTK_RENDERING_BACKEND}
+    vtkRenderingFreeType${VTK_RENDERING_BACKEND}
     vtkRenderingAnnotation
     vtkTestingRendering
     vtkInteractionStyle
diff --git a/Filters/Sources/CMakeLists.txt b/Filters/Sources/CMakeLists.txt
index 71f461d..0cc5cc6 100644
--- a/Filters/Sources/CMakeLists.txt
+++ b/Filters/Sources/CMakeLists.txt
@@ -19,7 +19,6 @@ set(Module_SRCS
   vtkPlaneSource.cxx
   vtkPlatonicSolidSource.cxx
   vtkPointSource.cxx
-  vtkPolyLineSource.cxx
   vtkProgrammableDataObjectSource.cxx
   vtkProgrammableSource.cxx
   vtkRectangularButtonSource.cxx
diff --git a/Filters/Sources/Testing/Cxx/CMakeLists.txt b/Filters/Sources/Testing/Cxx/CMakeLists.txt
index 188de79..630d5d3 100644
--- a/Filters/Sources/Testing/Cxx/CMakeLists.txt
+++ b/Filters/Sources/Testing/Cxx/CMakeLists.txt
@@ -15,7 +15,6 @@ vtk_add_test_cxx(${vtk-module}CxxTests tests
   TestPlaneSource.cxx,NO_VALID
   TestPlatonicSolidSource.cxx,NO_VALID
   TestPointSource.cxx,NO_VALID
-  TestPolyLineSource.cxx,NO_VALID
   TestRectangularButtonSource.cxx,NO_VALID
   TestRegularPolygonSource.cxx,NO_VALID
   TestSphereSource.cxx,NO_VALID
@@ -23,6 +22,5 @@ vtk_add_test_cxx(${vtk-module}CxxTests tests
   TestTessellatedBoxSource.cxx,NO_VALID
   TestTextSource.cxx,NO_VALID
   TestTexturedSphereSource.cxx,NO_VALID
-  TestGlyphSource2DResolution.cxx,
   )
 vtk_test_cxx_executable(${vtk-module}CxxTests tests)
diff --git a/Filters/Sources/Testing/Cxx/TestGlyphSource2DResolution.cxx b/Filters/Sources/Testing/Cxx/TestGlyphSource2DResolution.cxx
deleted file mode 100644
index 6aed900..0000000
--- a/Filters/Sources/Testing/Cxx/TestGlyphSource2DResolution.cxx
+++ /dev/null
@@ -1,151 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    TestGlyphSource2DResolution.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.
-
-=========================================================================*/
-
-// Description
-// This tests the circle resolution parameter for vtkGlyphSource2D
-
-#include "vtkActor2D.h"
-#include "vtkFloatArray.h"
-#include "vtkGlyph2D.h"
-#include "vtkGlyphSource2D.h"
-#include "vtkMinimalStandardRandomSequence.h"
-#include "vtkNew.h"
-#include "vtkPointData.h"
-#include "vtkPoints.h"
-#include "vtkPolyData.h"
-#include "vtkPolyDataMapper2D.h"
-#include "vtkRegressionTestImage.h"
-#include "vtkRenderer.h"
-#include "vtkRenderWindow.h"
-#include "vtkRenderWindowInteractor.h"
-#include "vtkTestUtilities.h"
-
-int TestGlyphSource2DResolution(int argc, char* argv[])
-{
-  cout << "CTEST_FULL_OUTPUT (Avoid ctest truncation of output)" << endl;
-
-  vtkNew<vtkPolyData> pd;
-  vtkNew<vtkPoints> pts;
-
-  vtkNew<vtkFloatArray> scalars;
-  vtkNew<vtkFloatArray> vectors;
-  vectors->SetNumberOfComponents(3);
-
-  pd->SetPoints(pts.GetPointer());
-  pd->GetPointData()->SetScalars(scalars.GetPointer());
-  pd->GetPointData()->SetVectors(vectors.GetPointer());
-
-  vtkNew<vtkMinimalStandardRandomSequence> randomSequence;
-  randomSequence->SetSeed(1);
-
-  int size = 400;
-
-  for (int i = 0; i < 100; ++i)
-    {
-    randomSequence->Next();
-    double x = randomSequence->GetValue()*size;
-    randomSequence->Next();
-    double y = randomSequence->GetValue()*size;
-    pts->InsertNextPoint(x,
-                         y,
-                         0.0);
-    randomSequence->Next();
-    scalars->InsertNextValue(5.0*randomSequence->GetValue());
-    randomSequence->Next();
-    double ihat = randomSequence->GetValue()*2-1;
-    randomSequence->Next();
-    double jhat = randomSequence->GetValue()*2-1;
-    vectors->InsertNextTuple3(ihat,
-                              jhat,
-                              0.0);
-    }
-
-  vtkNew<vtkGlyphSource2D> gs;
-  gs->SetGlyphTypeToCircle();
-  gs->SetScale(20);
-  gs->FilledOff();
-  gs->CrossOn();
-
-  vtkNew<vtkGlyphSource2D> gs1;
-  gs1->SetGlyphTypeToCircle();
-  gs1->SetResolution(24);
-  gs1->SetScale(30);
-  gs1->FilledOn();
-  gs1->CrossOff();
-
-  vtkNew<vtkGlyphSource2D> gs2;
-  gs2->SetGlyphTypeToCircle();
-  gs2->SetResolution(6);
-  gs2->SetScale(20);
-  gs2->FilledOn();
-  gs2->CrossOff();
-
-  vtkNew<vtkGlyphSource2D> gs3;
-  gs3->SetGlyphTypeToCircle();
-  gs3->SetResolution(5);
-  gs3->SetScale(30);
-  gs3->FilledOff();
-  gs3->CrossOn();
-
-  vtkNew<vtkGlyphSource2D> gs4;
-  gs4->SetGlyphTypeToCircle();
-  gs4->SetResolution(100);
-  gs4->SetScale(50);
-  gs4->FilledOff();
-  gs4->CrossOff();
-
-  vtkNew<vtkGlyph2D> glypher;
-  glypher->SetInputData(pd.GetPointer());
-  glypher->SetSourceConnection(0, gs->GetOutputPort());
-  glypher->SetSourceConnection(1, gs1->GetOutputPort());
-  glypher->SetSourceConnection(2, gs2->GetOutputPort());
-  glypher->SetSourceConnection(3, gs3->GetOutputPort());
-  glypher->SetSourceConnection(4, gs4->GetOutputPort());
-  glypher->SetIndexModeToScalar();
-  glypher->SetRange(0,5);
-  glypher->SetScaleModeToScaleByVector();
-
-  vtkNew<vtkPolyDataMapper2D> mapper;
-  mapper->SetInputConnection(glypher->GetOutputPort());
-  mapper->SetScalarRange(0, 5);
-
-  vtkNew<vtkActor2D> glyphActor;
-  glyphActor->SetMapper(mapper.GetPointer());
-
-  // Create the RenderWindow, Renderer
-  vtkNew<vtkRenderWindow> renWin;
-  renWin->SetMultiSamples(0);
-  vtkNew<vtkRenderWindowInteractor> iren;
-  iren->SetRenderWindow(renWin.GetPointer());
-
-  vtkNew<vtkRenderer> ren;
-  ren->AddActor2D(glyphActor.GetPointer());
-  ren->SetBackground(0.3, 0.3, 0.3);
-  ren->ResetCamera();
-
-  renWin->SetSize(size+1, size-1); //NPOT size
-  renWin->AddRenderer(ren.GetPointer());
-  renWin->Render();
-
-  iren->Initialize();
-
-  int retVal = vtkRegressionTestImage(renWin.GetPointer());
-  if (retVal == vtkRegressionTester::DO_INTERACTOR)
-    {
-    iren->Start();
-    }
-
-  return !retVal;
-}
diff --git a/Filters/Sources/Testing/Cxx/TestPolyLineSource.cxx b/Filters/Sources/Testing/Cxx/TestPolyLineSource.cxx
deleted file mode 100644
index 0fa960a..0000000
--- a/Filters/Sources/Testing/Cxx/TestPolyLineSource.cxx
+++ /dev/null
@@ -1,122 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    TestPolyLineSource.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 <cstdio>
-
-#include <vtkPolyLineSource.h>
-#include <vtkSmartPointer.h>
-
-int TestPolyLineSource(int vtkNotUsed(argc), char* vtkNotUsed(argv)[])
-{
-  vtkSmartPointer<vtkPolyLineSource> source = vtkSmartPointer<vtkPolyLineSource>::New();
-
-  // Basic tests
-  int expectedNumberOfPoints = 4;
-  source->SetNumberOfPoints( 4 );
-  int actualNumberOfPoints = source->GetNumberOfPoints();
-  if (expectedNumberOfPoints != actualNumberOfPoints)
-    {
-    std::cerr << "Expected NumberOfPoints setting to be " << expectedNumberOfPoints << ", got "
-              << actualNumberOfPoints << std::endl;
-    return EXIT_FAILURE;
-    }
-
-  int expectedClosed = 1;
-  source->SetClosed( expectedClosed );
-  int actualClosed = source->GetClosed();
-  if (expectedClosed != actualClosed)
-    {
-    std::cerr << "Expected Closed setting to be " << expectedClosed << ", got "
-              << actualClosed << std::endl;
-    return EXIT_FAILURE;
-    }
-
-  // Test setting individual points
-  double pts[4][3] = {
-    { 1.0, 2.0, 3.0 },
-    { 4.0, 5.0, 6.0 },
-    { 7.0, 8.0, 9.0 },
-    { 10.0, 11.0, 12.0 }
-  };
-
-  for ( int i = 0; i < 4; ++i )
-    {
-    source->SetPoint( i, pts[i][0], pts[i][1], pts[i][2] );
-    }
-
-  // Test getting the points
-  vtkPoints* testPoints = source->GetPoints();
-  if ( testPoints->GetNumberOfPoints() != 4 )
-    {
-    std::cerr << "Expected 4 points in vtkPoints returned from GetPoints() method, but got "
-              << testPoints->GetNumberOfPoints() << " instead." << std::endl;
-    return EXIT_FAILURE;
-    }
-
-  // Test the point values
-  vtkPoints* outputPoints = source->GetPoints();
-  for ( int i = 0; i < 4; ++i )
-    {
-    double pt[3];
-    outputPoints->GetPoint(i, pt);
-
-    if ( pt[0] != pts[i][0] || pt[1] != pts[i][1] || pt[2] != pts[i][2] )
-      {
-      std::cerr << "Point disagreement in point " << i << std::endl;
-      std::cerr << "Expected point: " << pts[i][0] << ", " << pts[i][1] << ", " << pts[i][2] << std::endl;
-      std::cerr << "Actual point:  " << pt[0] << ", " << pt[1] << ", " << pt[2] << std::endl;
-      return EXIT_FAILURE;
-      }
-    }
-
-  // Test setting the points from a vtkPoints object
-  double newPts[3][3] = {
-    { 13.0, 14.0, 15.0 },
-    { 16.0, 17.0, 18.0 },
-    { 19.0, 20.0, 21.0 }
-  };
-
-  vtkSmartPointer<vtkPoints> newPoints = vtkSmartPointer<vtkPoints>::New();
-  newPoints->SetNumberOfPoints( 3 );
-  for ( int i = 0; i < 3; ++i )
-    {
-    newPoints->SetPoint( i, newPts[i] );
-    }
-  source->SetPoints( newPoints );
-
-  actualNumberOfPoints = source->GetNumberOfPoints();
-  if ( source->GetNumberOfPoints() != 3)
-    {
-    std::cerr << "Expected 3 points, got " << source->GetNumberOfPoints() << std::endl;
-    return EXIT_FAILURE;
-    }
-
-  outputPoints = source->GetPoints();
-  for ( int i = 0; i < 3; ++i )
-    {
-    double pt[3];
-    outputPoints->GetPoint(i, pt);
-
-    if ( pt[0] != newPts[i][0] || pt[1] != newPts[i][1] || pt[2] != newPts[i][2] )
-      {
-      std::cerr << "Point disagreement in point " << i << std::endl;
-      std::cerr << "Expected point: " << newPts[i][0] << ", " << newPts[i][1] << ", " << newPts[i][2] << std::endl;
-      std::cerr << "Actual point:  " << pt[0] << ", " << pt[1] << ", " << pt[2] << std::endl;
-      return EXIT_FAILURE;
-      }
-    }
-
-  return EXIT_SUCCESS;
-}
diff --git a/Filters/Sources/Testing/Data/Baseline/TestGlyphSource2DResolution.png.md5 b/Filters/Sources/Testing/Data/Baseline/TestGlyphSource2DResolution.png.md5
deleted file mode 100644
index 265c416..0000000
--- a/Filters/Sources/Testing/Data/Baseline/TestGlyphSource2DResolution.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-678390d5a0bed078c6d68a1449a41677
diff --git a/Filters/Sources/Testing/Data/Baseline/squadViewer.png.md5 b/Filters/Sources/Testing/Data/Baseline/squadViewer.png.md5
index cd4f74d..5bd4d0c 100644
--- a/Filters/Sources/Testing/Data/Baseline/squadViewer.png.md5
+++ b/Filters/Sources/Testing/Data/Baseline/squadViewer.png.md5
@@ -1 +1 @@
-cb30645738b36c71e4b9b858b8fcce27
+8b6e81c9065a54236853ecaa2b5e674e
diff --git a/Filters/Sources/Testing/Python/CMakeLists.txt b/Filters/Sources/Testing/Python/CMakeLists.txt
index 4450b0a..d38de95 100644
--- a/Filters/Sources/Testing/Python/CMakeLists.txt
+++ b/Filters/Sources/Testing/Python/CMakeLists.txt
@@ -7,8 +7,3 @@ vtk_add_test_python(
   glyph2D.py
   TestPlatonicSolids.py,NO_RT
   )
-if(VTK_USE_TK AND Module_vtkRenderingTk)
-  vtk_add_test_python(
-    squadViewer.py,NO_RT
-    )
-endif()
diff --git a/Filters/Sources/Testing/Python/OSCone.py b/Filters/Sources/Testing/Python/OSCone.py
index e9e6707..c0af6fb 100755
--- a/Filters/Sources/Testing/Python/OSCone.py
+++ b/Filters/Sources/Testing/Python/OSCone.py
@@ -6,7 +6,6 @@ VTK_DATA_ROOT = vtkGetDataRoot()
 
 renWin = vtk.vtkRenderWindow()
 renWin.OffScreenRenderingOn()
-renWin.SetMultiSamples(0)
 ren = vtk.vtkRenderer()
 renWin.AddRenderer(ren)
 cone = vtk.vtkConeSource()
diff --git a/Filters/Sources/Testing/Python/squadViewer.py b/Filters/Sources/Testing/Python/squadViewer.py
deleted file mode 100755
index cb86883..0000000
--- a/Filters/Sources/Testing/Python/squadViewer.py
+++ /dev/null
@@ -1,190 +0,0 @@
-#!/usr/bin/env python
-
-import sys
-from functools import partial
-import vtk
-from vtk.test import Testing
-from vtk.util.misc import vtkGetDataRoot
-VTK_DATA_ROOT = vtkGetDataRoot()
-
-import Tkinter
-from vtk.tk.vtkTkRenderWindowInteractor import vtkTkRenderWindowInteractor
-from vtk.tk.vtkTkRenderWidget import vtkTkRenderWidget
-
-# Tkinter constants.
-E = Tkinter.E
-W = Tkinter.W
-N = Tkinter.N
-S = Tkinter.S
-HORIZONTAL = Tkinter.HORIZONTAL
-RIGHT = Tkinter.RIGHT
-NO = Tkinter.NO
-NORMAL = Tkinter.NORMAL
-DISABLED = Tkinter.DISABLED
-
-class SuperQuadricViewer(Testing.vtkTest):
-    '''
-    Provide a testing framework for squadViewer.
-
-    Note:
-        root, the top-level widget for Tk,
-        tkrw, the vtkTkRenderWidget and
-        renWin, the vtkRenderindow
-        are accessible from any function in this class
-        after SetUp() has run.
-    '''
-
-    def SetUp(self):
-        '''
-        Set up squadViewer
-        '''
-        def OnClosing():
-            self.root.quit()
-
-        def SetPhi(squad, win, phi):
-            squad.SetPhiRoundness(float(phi))
-            win.Render()
-
-        def SetTheta(squad, win, theta):
-            squad.SetThetaRoundness(float(theta))
-            win.Render()
-
-        def SetThickness(squad, win, thickness):
-            squad.SetThickness(float(thickness))
-            win.Render()
-
-        def SetTexture(actor, texture, win):
-            if doTexture.get():
-                actor.SetTexture(texture)
-            else:
-                actor.SetTexture(None)
-            win.Render()
-
-        def SetToroid(squad, scale, win):
-            squad.SetToroidal(toroid.get())
-            if toroid.get():
-                scale.config(state=NORMAL, fg='black')
-            else:
-                scale.config(state=DISABLED, fg='gray')
-            win.Render()
-
-        self.root = Tkinter.Tk()
-        self.root.title("superquadric viewer")
-        # Define what to do when the user explicitly closes a window.
-        self.root.protocol("WM_DELETE_WINDOW", OnClosing)
-
-        # Create render window
-        self.tkrw = vtkTkRenderWidget(self.root, width=550, height=450)
-        self.tkrw.BindTkRenderWidget()
-        self.renWin = self.tkrw.GetRenderWindow()
-
-        # Create parameter sliders
-        #
-        prs = Tkinter.Scale(self.root, from_=0, to=3.5, res=0.1,
-                             orient=HORIZONTAL, label="phi roundness")
-        trs = Tkinter.Scale(self.root, from_=0, to=3.5, res=0.1,
-                             orient=HORIZONTAL, label="theta roundness")
-        thicks = Tkinter.Scale(self.root, from_=0.01, to=1.0, res=0.01,
-                             orient=HORIZONTAL, label="thickness")
-
-        # Create check buttons
-        #
-        toroid = Tkinter.IntVar()
-        toroid.set(0)
-        doTexture = Tkinter.IntVar()
-        doTexture.set(0)
-
-        rframe = Tkinter.Frame(self.root)
-        torbut = Tkinter.Checkbutton(rframe, text="Toroid", variable=toroid)
-        texbut = Tkinter.Checkbutton(rframe, text="Texture", variable=doTexture)
-
-        # Put it all together
-        #
-        torbut.pack(padx=10, pady=5, ipadx=20, ipady=5, side=RIGHT, anchor=S)
-        texbut.pack(padx=10, pady=5, ipadx=20, ipady=5, side=RIGHT, anchor=S)
-
-        self.tkrw.grid(sticky=N+E+W+S, columnspan=2)
-        rframe.grid(sticky=N+E+W+S)
-        thicks.grid(sticky=N+S+E+W, padx=10, ipady=5, row=1, column=1)
-        prs.grid(sticky=N+E+W+S, padx=10, ipady=5, row = 2, column = 0)
-        trs.grid(sticky=N+E+W+S, padx=10, ipady=5, row = 2, column = 1)
-        Tkinter.Pack.propagate(rframe,NO)
-
-        prs.set(1.0)
-        trs.set(0.7)
-        thicks.set(0.3)
-        toroid.set(1)
-        doTexture.set(0)
-
-        # Create pipeline
-        #
-        squad = vtk.vtkSuperquadricSource()
-        squad.SetPhiResolution(20)
-        squad.SetThetaResolution(25)
-
-        pnmReader = vtk.vtkPNMReader()
-        pnmReader.SetFileName(VTK_DATA_ROOT + "/Data/earth.ppm")
-        atext = vtk.vtkTexture()
-        atext.SetInputConnection(pnmReader.GetOutputPort())
-        atext.InterpolateOn()
-
-        appendSquads = vtk.vtkAppendPolyData()
-        appendSquads.AddInputConnection(squad.GetOutputPort())
-
-        mapper = vtk.vtkPolyDataMapper()
-        mapper.SetInputConnection(squad.GetOutputPort())
-        mapper.ScalarVisibilityOff()
-        actor = vtk.vtkActor()
-        actor.SetMapper(mapper)
-        actor.SetTexture(atext)
-        actor.GetProperty().SetDiffuseColor(0.5, 0.8, 0.8)
-        actor.GetProperty().SetAmbient(0.2)
-        actor.GetProperty().SetAmbientColor(0.2, 0.2, 0.2)
-
-        squad.SetPhiRoundness(prs.get())
-        squad.SetThetaRoundness(trs.get())
-        squad.SetToroidal(toroid.get())
-        squad.SetThickness(thicks.get())
-        squad.SetScale(1, 1, 1)
-        SetTexture(actor, atext, self.renWin)
-
-        # Create renderer stuff
-        #
-        ren = vtk.vtkRenderer()
-        ren.SetAmbient(1.0, 1.0, 1.0)
-        self.renWin.AddRenderer(ren)
-
-
-        # Add the actors to the renderer, set the background and size
-        #
-        ren.AddActor(actor)
-        ren.SetBackground(0.25, 0.2, 0.2)
-        ren.ResetCamera()
-        ren.GetActiveCamera().Zoom(1.2)
-        ren.GetActiveCamera().Elevation(40)
-        ren.GetActiveCamera().Azimuth(-20)
-
-        # Associate the functions with the sliders and check buttons.
-        #
-        prs.config(command=partial(SetPhi, squad, self.renWin))
-        trs.config(command=partial(SetTheta, squad, self.renWin))
-        thicks.config(command=partial(SetThickness,squad, self.renWin))
-        torbut.config(command=partial(SetToroid, squad, thicks, self.renWin))
-        texbut.config(command=partial(SetTexture, actor, atext, self.renWin))
-
-    def DoIt(self):
-        self.SetUp()
-        self.renWin.Render()
-        self.tkrw.Render()
-        self.root.update()
-        # If you want to interact and use the sliders etc,
-        # uncomment the following line.
-        #self.root.mainloop()
-        img_file = "squadViewer.png"
-        Testing.compareImage(self.renWin, Testing.getAbsImagePath(img_file))
-        Testing.interact()
-
-if __name__ == '__main__':
-    cases = [(SuperQuadricViewer, 'DoIt')]
-    del SuperQuadricViewer
-    Testing.main(cases)
diff --git a/Filters/Sources/Testing/Tcl/CMakeLists.txt b/Filters/Sources/Testing/Tcl/CMakeLists.txt
index 6ffc491..8e5b477 100644
--- a/Filters/Sources/Testing/Tcl/CMakeLists.txt
+++ b/Filters/Sources/Testing/Tcl/CMakeLists.txt
@@ -1,5 +1,7 @@
-if(Module_vtkRenderingTk AND VTK_USE_TK)
-  vtk_add_test_tcl(
-    squadViewer.tcl
-    )
+if (VTK_USE_RENDERING)
+  if(VTK_USE_TK)
+    vtk_add_test_tcl(
+      squadViewer.tcl
+      )
+  endif()
 endif()
diff --git a/Filters/Sources/Testing/Tcl/Disk.tcl b/Filters/Sources/Testing/Tcl/Disk.tcl
new file mode 100644
index 0000000..625aff7
--- /dev/null
+++ b/Filters/Sources/Testing/Tcl/Disk.tcl
@@ -0,0 +1,40 @@
+package require vtk
+package require vtkinteraction
+
+# Create the RenderWindow, Renderer and both Actors
+#
+vtkRenderer ren1
+vtkRenderWindow renWin
+    renWin AddRenderer ren1
+vtkRenderWindowInteractor iren
+    iren SetRenderWindow renWin
+
+vtkDiskSource disk
+    disk SetInnerRadius 1.0
+    disk SetOuterRadius 2.0
+    disk SetRadialResolution 1
+    disk SetCircumferentialResolution 20
+
+vtkPolyDataMapper diskMapper
+    diskMapper SetInputConnection [disk GetOutputPort]
+vtkActor diskActor
+    diskActor SetMapper diskMapper
+
+# Add the actors to the renderer, set the background and size
+#
+ren1 AddActor diskActor
+ren1 SetBackground 0.1 0.2 0.4
+renWin SetSize 200 200
+
+# Get handles to some useful objects
+#
+iren AddObserver UserEvent {wm deiconify .vtkInteract}
+iren Initialize
+renWin Render
+
+
+# prevent the tk window from showing up then start the event loop
+wm withdraw .
+
+
+
diff --git a/Filters/Sources/Testing/Tcl/OSCone.tcl b/Filters/Sources/Testing/Tcl/OSCone.tcl
new file mode 100644
index 0000000..f564b5b
--- /dev/null
+++ b/Filters/Sources/Testing/Tcl/OSCone.tcl
@@ -0,0 +1,23 @@
+package require vtk
+package require vtkinteraction
+
+vtkRenderWindow renWin
+renWin OffScreenRenderingOn
+
+vtkRenderer ren
+renWin AddRenderer ren
+
+vtkConeSource cone
+
+vtkPolyDataMapper mp
+mp SetInputConnection [cone GetOutputPort]
+
+vtkActor actor
+actor SetMapper mp
+
+ren AddActor actor
+
+renWin Render
+
+# prevent the tk window from showing up then start the event loop
+wm withdraw .
diff --git a/Filters/Sources/Testing/Tcl/TestButtonSource.tcl b/Filters/Sources/Testing/Tcl/TestButtonSource.tcl
new file mode 100644
index 0000000..3e2f7bf
--- /dev/null
+++ b/Filters/Sources/Testing/Tcl/TestButtonSource.tcl
@@ -0,0 +1,101 @@
+# Test the button source
+package require vtk
+package require vtkinteraction
+
+# The image to map on the button
+vtkJPEGReader r
+  r SetFileName "$VTK_DATA_ROOT/Data/beach.jpg"
+  r Update
+vtkTexture t
+  t SetInputConnection [r GetOutputPort]
+set dims [[r GetOutput] GetDimensions]
+set d1 [lindex $dims 0]
+set d2 [lindex $dims 1]
+
+# The first elliptical button
+vtkEllipticalButtonSource bs
+  bs SetWidth 2
+  bs SetHeight 1
+  bs SetDepth 0.2
+  bs SetCircumferentialResolution 64
+  bs SetRadialRatio 1.1
+  bs SetShoulderResolution 8
+  bs SetTextureResolution 4
+  bs TwoSidedOn
+vtkPolyDataMapper bMapper
+  bMapper SetInputConnection [bs GetOutputPort]
+vtkActor b1
+  b1 SetMapper bMapper
+  b1 SetTexture t
+
+# The second elliptical button
+vtkEllipticalButtonSource bs2
+  bs2 SetWidth 2
+  bs2 SetHeight 1
+  bs2 SetDepth 0.2
+  bs2 SetCircumferentialResolution 64
+  bs2 SetRadialRatio 1.1
+  bs2 SetShoulderResolution 8
+  bs2 SetTextureResolution 4
+  bs2 TwoSidedOn
+  bs2 SetCenter 2 0 0
+  bs2 SetTextureStyleToFitImage
+  bs2 SetTextureDimensions $d1 $d2
+vtkPolyDataMapper b2Mapper
+  b2Mapper SetInputConnection [bs2 GetOutputPort]
+vtkActor b2
+  b2 SetMapper b2Mapper
+  b2 SetTexture t
+
+# The third rectangular button
+vtkRectangularButtonSource bs3
+  bs3 SetWidth 1.5
+  bs3 SetHeight 0.75
+  bs3 SetDepth 0.2
+  bs3 TwoSidedOn
+  bs3 SetCenter 0 1 0
+  bs3 SetTextureDimensions $d1 $d2
+vtkPolyDataMapper b3Mapper
+  b3Mapper SetInputConnection [bs3 GetOutputPort]
+vtkActor b3
+  b3 SetMapper b3Mapper
+  b3 SetTexture t
+
+# The fourth rectangular button
+vtkRectangularButtonSource bs4
+  bs4 SetWidth 1.5
+  bs4 SetHeight 0.75
+  bs4 SetDepth 0.2
+  bs4 TwoSidedOn
+  bs4 SetCenter 2 1 0
+  bs4 SetTextureStyleToFitImage
+  bs4 SetTextureDimensions $d1 $d2
+vtkPolyDataMapper b4Mapper
+  b4Mapper SetInputConnection [bs4 GetOutputPort]
+vtkActor b4
+  b4 SetMapper b4Mapper
+  b4 SetTexture t
+
+# Create the RenderWindow, Renderer and Interactive Renderer
+#
+vtkRenderer ren1
+vtkRenderWindow renWin
+    renWin AddRenderer ren1
+vtkRenderWindowInteractor iren
+    iren SetRenderWindow renWin
+
+ren1 AddActor b1
+ren1 AddActor b2
+ren1 AddActor b3
+ren1 AddActor b4
+ren1 SetBackground 0 0 0
+
+renWin SetSize 250 150
+renWin Render
+[ren1 GetActiveCamera] Zoom 1.5
+renWin Render
+
+iren AddObserver UserEvent {wm deiconify .vtkInteract}
+
+# prevent the tk window from showing up then start the event loop
+wm withdraw .
diff --git a/Filters/Sources/Testing/Tcl/TestPlatonicSolids.tcl b/Filters/Sources/Testing/Tcl/TestPlatonicSolids.tcl
new file mode 100644
index 0000000..e752fd3
--- /dev/null
+++ b/Filters/Sources/Testing/Tcl/TestPlatonicSolids.tcl
@@ -0,0 +1,117 @@
+package require vtk
+package require vtkinteraction
+package require vtktesting
+
+# Create five instances of vtkPlatonicSolidSource
+# corresponding to each of the five Platonic solids.
+#
+vtkPlatonicSolidSource tet
+  tet SetSolidTypeToTetrahedron
+vtkPolyDataMapper tetMapper
+  tetMapper SetInputConnection [tet GetOutputPort]
+vtkActor tetActor
+  tetActor SetMapper tetMapper
+
+vtkPlatonicSolidSource cube
+  cube SetSolidTypeToCube
+vtkPolyDataMapper cubeMapper
+  cubeMapper SetInputConnection [cube GetOutputPort]
+vtkActor cubeActor
+  cubeActor SetMapper cubeMapper
+  cubeActor AddPosition 2.0 0 0
+
+vtkPlatonicSolidSource oct
+  oct SetSolidTypeToOctahedron
+vtkPolyDataMapper octMapper
+  octMapper SetInputConnection [oct GetOutputPort]
+vtkActor octActor
+  octActor SetMapper octMapper
+  octActor AddPosition 4.0 0 0
+
+vtkPlatonicSolidSource icosa
+  icosa SetSolidTypeToIcosahedron
+vtkPolyDataMapper icosaMapper
+  icosaMapper SetInputConnection [icosa GetOutputPort]
+vtkActor icosaActor
+  icosaActor SetMapper icosaMapper
+  icosaActor AddPosition 6.0 0 0
+
+vtkPlatonicSolidSource dode
+  dode SetSolidTypeToDodecahedron
+vtkPolyDataMapper dodeMapper
+  dodeMapper SetInputConnection [dode GetOutputPort]
+vtkActor dodeActor
+  dodeActor SetMapper dodeMapper
+  dodeActor AddPosition 8.0 0 0
+
+# Create rendering stuff
+#
+vtkRenderer ren1
+vtkRenderWindow renWin
+    renWin AddRenderer ren1
+vtkRenderWindowInteractor iren
+    iren SetRenderWindow renWin
+
+# Add the actors to the renderer, set the background and size
+#
+ren1 AddActor tetActor
+ren1 AddActor cubeActor
+ren1 AddActor octActor
+ren1 AddActor icosaActor
+ren1 AddActor dodeActor
+
+# Create a lookup table with colors for each face
+#
+vtkMath math
+vtkLookupTable lut
+  lut SetNumberOfColors 20
+  lut Build
+  lut SetTableValue 0 1 0 0 1
+  lut SetTableValue 1 0 1 0 1
+  lut SetTableValue 2 1 1 0 1
+  lut SetTableValue 3 0 0 1 1
+  lut SetTableValue 4 1 0 1 1
+  lut SetTableValue 5 0 1 1 1
+  eval lut SetTableValue 6 $spring_green 1.0
+  eval lut SetTableValue 7 $lavender 1.0
+  eval lut SetTableValue 8 $mint_cream 1.0
+  eval lut SetTableValue 9 $violet 1.0
+  eval lut SetTableValue 10 $ivory_black 1.0
+  eval lut SetTableValue 11 $coral 1.0
+  eval lut SetTableValue 12 $pink 1.0
+  eval lut SetTableValue 13 $salmon 1.0
+  eval lut SetTableValue 14 $sepia 1.0
+  eval lut SetTableValue 15 $carrot 1.0
+  eval lut SetTableValue 16 $gold 1.0
+  eval lut SetTableValue 17 $forest_green 1.0
+  eval lut SetTableValue 18 $turquoise 1.0
+  eval lut SetTableValue 19 $plum 1.0
+
+lut SetTableRange 0 19
+tetMapper SetLookupTable lut
+tetMapper SetScalarRange 0 19
+cubeMapper SetLookupTable lut
+cubeMapper SetScalarRange 0 19
+octMapper SetLookupTable lut
+octMapper SetScalarRange 0 19
+icosaMapper SetLookupTable lut
+icosaMapper SetScalarRange 0 19
+dodeMapper SetLookupTable lut
+dodeMapper SetScalarRange 0 19
+
+set cam [ren1 GetActiveCamera]
+$cam SetPosition 3.89696 7.20771 1.44123
+$cam SetFocalPoint 3.96132 0 0
+$cam SetViewUp -0.0079335 0.196002 -0.980571
+$cam SetClippingRange 5.42814 9.78848
+
+ren1 SetBackground 0 0 0
+renWin SetSize 400 150
+iren Initialize
+
+# render the image
+#
+iren AddObserver UserEvent {wm deiconify .vtkInteract}
+
+# prevent the tk window from showing up then start the event loop
+wm withdraw .
diff --git a/Filters/Sources/Testing/Tcl/TestRegularPolygonSource.tcl b/Filters/Sources/Testing/Tcl/TestRegularPolygonSource.tcl
new file mode 100644
index 0000000..6194e09
--- /dev/null
+++ b/Filters/Sources/Testing/Tcl/TestRegularPolygonSource.tcl
@@ -0,0 +1,61 @@
+package require vtk
+package require vtkinteraction
+
+# Create two polygon sources, one a closed polyline, one a polygon
+#
+vtkRegularPolygonSource polyline
+polyline SetCenter 1 1 1
+polyline SetRadius 1
+polyline SetNumberOfSides 12
+polyline SetNormal 1 2 3
+polyline GeneratePolylineOn
+polyline GeneratePolygonOff
+
+vtkPolyDataMapper polylineMapper
+polylineMapper SetInputConnection [polyline GetOutputPort]
+
+vtkActor polylineActor
+polylineActor SetMapper polylineMapper
+[polylineActor GetProperty] SetColor 0 1 0
+[polylineActor GetProperty] SetAmbient 1
+
+
+vtkRegularPolygonSource polygon
+polygon SetCenter 3 1 1
+polygon SetRadius 1
+polygon SetNumberOfSides 12
+polygon SetNormal 1 2 3
+polygon GeneratePolylineOff
+polygon GeneratePolygonOn
+
+vtkPolyDataMapper polygonMapper
+polygonMapper SetInputConnection [polygon GetOutputPort]
+
+vtkActor polygonActor
+polygonActor SetMapper polygonMapper
+[polygonActor GetProperty] SetColor 1 0 0
+[polygonActor GetProperty] SetAmbient 1
+
+# Create the RenderWindow, Renderer and both Actors
+#
+vtkRenderer ren1
+vtkRenderWindow renWin
+    renWin AddRenderer ren1
+vtkRenderWindowInteractor iren
+    iren SetRenderWindow renWin
+
+# create room profile# Add the actors to the renderer, set the background and size
+#
+ren1 AddActor polylineActor
+ren1 AddActor polygonActor
+
+ren1 SetBackground 0 0 0
+renWin SetSize 200 200
+renWin Render
+
+iren AddObserver UserEvent {wm deiconify .vtkInteract}
+iren Initialize
+
+# prevent the tk window from showing up then start the event loop
+wm withdraw .
+
diff --git a/Filters/Sources/Testing/Tcl/coneResolution.tcl b/Filters/Sources/Testing/Tcl/coneResolution.tcl
new file mode 100644
index 0000000..f8558fa
--- /dev/null
+++ b/Filters/Sources/Testing/Tcl/coneResolution.tcl
@@ -0,0 +1,69 @@
+package require vtk
+package require vtkinteraction
+
+# create a rendering window and renderer
+vtkRenderer ren1
+vtkRenderWindow renWin
+    renWin AddRenderer ren1
+vtkRenderWindowInteractor iren
+    iren SetRenderWindow renWin
+
+# create cones of varying resolution
+vtkConeSource cone0
+  cone0 SetResolution 0
+vtkConeSource cone1
+  cone1 SetResolution 1
+vtkConeSource cone2
+  cone2 SetResolution 2
+vtkConeSource cone8
+  cone8 SetResolution 8
+
+vtkPolyDataMapper cone0Mapper
+  cone0Mapper SetInputConnection [cone0 GetOutputPort]
+vtkActor cone0Actor
+  cone0Actor SetMapper cone0Mapper
+
+vtkPolyDataMapper cone1Mapper
+  cone1Mapper SetInputConnection [cone1 GetOutputPort]
+vtkActor cone1Actor
+  cone1Actor SetMapper cone1Mapper
+
+vtkPolyDataMapper cone2Mapper
+  cone2Mapper SetInputConnection [cone2 GetOutputPort]
+vtkActor cone2Actor
+  cone2Actor SetMapper cone2Mapper
+
+vtkPolyDataMapper cone8Mapper
+  cone8Mapper SetInputConnection [cone8 GetOutputPort]
+vtkActor cone8Actor
+  cone8Actor SetMapper cone8Mapper
+
+# assign our actor to the renderer
+ren1 AddActor cone0Actor
+ren1 AddActor cone1Actor
+ren1 AddActor cone2Actor
+ren1 AddActor cone8Actor
+ren1 SetBackground .5 .5 .5
+ren1 ResetCamera
+[ren1 GetActiveCamera] Elevation 30
+[ren1 GetActiveCamera] Dolly 1.3
+ren1 ResetCameraClippingRange
+
+renWin SetSize 301 91
+cone0Actor SetPosition -1.5 0 0
+cone1Actor SetPosition -.5 0 0
+cone2Actor SetPosition .5 0 0
+cone8Actor SetPosition 1.5 0 0
+
+[cone0Actor GetProperty] SetDiffuseColor 1 0 0
+[cone1Actor GetProperty] SetDiffuseColor 0 1 0
+[cone8Actor GetProperty] BackfaceCullingOn
+[cone8Actor GetProperty] SetDiffuseColor 0 0 1
+
+# enable user interface interactor
+iren AddObserver UserEvent {wm deiconify .vtkInteract}
+iren Initialize
+
+# prevent the tk window from showing up then start the event loop
+wm withdraw .
+
diff --git a/Filters/Sources/Testing/Tcl/glyph2D.tcl b/Filters/Sources/Testing/Tcl/glyph2D.tcl
new file mode 100644
index 0000000..558511d
--- /dev/null
+++ b/Filters/Sources/Testing/Tcl/glyph2D.tcl
@@ -0,0 +1,114 @@
+package require vtk
+package require vtkinteraction
+
+# Create some random points, scalars, and vectors to glyph
+#
+vtkPolyData pd
+vtkPoints pts
+vtkFloatArray scalars
+vtkFloatArray vectors
+vectors SetNumberOfComponents 3
+
+pd SetPoints pts
+  [pd GetPointData] SetScalars scalars
+  [pd GetPointData] SetVectors vectors
+
+vtkMath math
+set size 500
+for {set i 0} {$i < 100} {incr i} {
+  pts InsertNextPoint [math Random 0 [expr $size - 1]] \
+                      [math Random 0 [expr $size - 1]] 0.0
+  scalars InsertNextValue [math Random 0.0 5]
+    vectors InsertNextTuple3 [math Random -1 1] [math Random -1 1] 0.0
+}
+
+vtkGlyphSource2D gs
+  gs SetGlyphTypeToCircle
+  gs SetScale 20
+  gs FilledOff
+  gs CrossOn
+  gs Update
+
+vtkGlyphSource2D gs1
+  gs1 SetGlyphTypeToTriangle
+  gs1 SetScale 20
+  gs1 FilledOff
+  gs1 CrossOn
+  gs1 Update
+
+vtkGlyphSource2D gs2
+  gs2 SetGlyphTypeToSquare
+  gs2 SetScale 20
+  gs2 FilledOff
+  gs2 CrossOn
+  gs2 Update
+
+vtkGlyphSource2D gs3
+  gs3 SetGlyphTypeToDiamond
+  gs3 SetScale 20
+  gs3 FilledOff
+  gs3 CrossOn
+  gs3 Update
+
+vtkGlyphSource2D gs4
+  gs4 SetGlyphTypeToDiamond
+  gs4 SetScale 20
+  gs4 FilledOn
+  gs4 DashOn
+  gs4 CrossOff
+  gs4 Update
+
+vtkGlyphSource2D gs5
+  gs5 SetGlyphTypeToThickArrow
+  gs5 SetScale 20
+  gs5 FilledOn
+  gs5 CrossOff
+  gs5 Update
+
+# Create a table of glyphs
+vtkGlyph2D glypher
+  glypher SetInputData pd
+  glypher SetSourceData 0 [gs GetOutput]
+  glypher SetSourceData 1 [gs1 GetOutput]
+  glypher SetSourceData 2 [gs2 GetOutput]
+  glypher SetSourceData 3 [gs3 GetOutput]
+  glypher SetSourceData 4 [gs4 GetOutput]
+  glypher SetSourceData 5 [gs5 GetOutput]
+  glypher SetIndexModeToScalar
+  glypher SetRange 0 5
+  glypher SetScaleModeToDataScalingOff
+
+vtkPolyDataMapper2D mapper
+    mapper SetInputConnection [glypher GetOutputPort]
+    mapper SetScalarRange 0 5
+
+vtkActor2D glyphActor
+    glyphActor SetMapper mapper
+
+# Create the RenderWindow, Renderer and both Actors
+#
+vtkRenderer ren1
+vtkRenderWindow renWin
+    renWin SetMultiSamples 0
+    renWin AddRenderer ren1
+vtkRenderWindowInteractor iren
+    iren SetRenderWindow renWin
+
+# Add the actors to the renderer, set the background and size
+#
+ren1 AddActor glyphActor
+ren1 SetBackground 1 1 1
+
+renWin SetSize $size $size
+renWin Render
+
+# render the image
+#
+iren AddObserver UserEvent {wm deiconify .vtkInteract}
+iren Initialize
+
+# prevent the tk window from showing up then start the event loop
+wm withdraw .
+
+
+
diff --git a/Filters/Sources/module.cmake b/Filters/Sources/module.cmake
index 30237a3..eff4485 100644
--- a/Filters/Sources/module.cmake
+++ b/Filters/Sources/module.cmake
@@ -9,9 +9,9 @@ vtk_module(vtkFiltersSources
     vtkTestingRendering
     vtkInteractionStyle
     vtkRendering${VTK_RENDERING_BACKEND}
+    vtkRenderingFreeType${VTK_RENDERING_BACKEND}
     vtkFiltersModeling
     vtkIOXML
-    vtkIOParallel
   KIT
     vtkFilters
   )
diff --git a/Filters/Sources/vtkConeSource.cxx b/Filters/Sources/vtkConeSource.cxx
index 1763f9f..d9cc247 100644
--- a/Filters/Sources/vtkConeSource.cxx
+++ b/Filters/Sources/vtkConeSource.cxx
@@ -187,7 +187,6 @@ int vtkConeSource::RequestData(
     x[2] = this->Radius;
     pts[2] = newPoints->InsertNextPoint(x);
     newPolys->InsertNextCell(3,pts);
-    VTK_FALLTHROUGH;
 
   case 1:
     x[0] = xbot;
diff --git a/Filters/Sources/vtkEllipticalButtonSource.cxx b/Filters/Sources/vtkEllipticalButtonSource.cxx
index 45c0d17..2cfe065 100644
--- a/Filters/Sources/vtkEllipticalButtonSource.cxx
+++ b/Filters/Sources/vtkEllipticalButtonSource.cxx
@@ -299,7 +299,7 @@ int vtkEllipticalButtonSource::RequestData(
     vtkIdType opts[4];
 
     vtkIdType npts = 0;
-    vtkIdType numPolys=newPolys->GetNumberOfCells();
+    int numPolys=newPolys->GetNumberOfCells();
     for ( j=0, newPolys->InitTraversal(); j < numPolys; j++ )
       {
       newPolys->GetNextCell(npts,ipts);
diff --git a/Filters/Sources/vtkGlyphSource2D.cxx b/Filters/Sources/vtkGlyphSource2D.cxx
index a286451..4064e5a 100644
--- a/Filters/Sources/vtkGlyphSource2D.cxx
+++ b/Filters/Sources/vtkGlyphSource2D.cxx
@@ -16,15 +16,13 @@
 
 #include "vtkCellArray.h"
 #include "vtkCellData.h"
-#include "vtkIdList.h"
+#include "vtkMath.h"
 #include "vtkInformation.h"
 #include "vtkInformationVector.h"
-#include "vtkMath.h"
 #include "vtkObjectFactory.h"
 #include "vtkPolyData.h"
 #include "vtkUnsignedCharArray.h"
 
-
 vtkStandardNewMacro(vtkGlyphSource2D);
 
 //----------------------------------------------------------------------------
@@ -42,7 +40,6 @@ vtkGlyphSource2D::vtkGlyphSource2D()
   this->Cross = 0;
   this->Dash = 0;
   this->RotationAngle = 0.0;
-  this->Resolution = 8;
   this->OutputPointsPrecision = SINGLE_PRECISION;
   this->GlyphType = VTK_VERTEX_GLYPH;
 
@@ -179,8 +176,8 @@ void vtkGlyphSource2D::ConvertColor()
 void vtkGlyphSource2D::TransformGlyph(vtkPoints *pts)
 {
   double x[3];
-  vtkIdType i;
-  vtkIdType numPts=pts->GetNumberOfPoints();
+  int i;
+  int numPts=pts->GetNumberOfPoints();
 
   if ( this->RotationAngle == 0.0 )
     {
@@ -343,35 +340,31 @@ void vtkGlyphSource2D::CreateSquare(vtkPoints *pts, vtkCellArray *lines,
 void vtkGlyphSource2D::CreateCircle(vtkPoints *pts, vtkCellArray *lines,
                                     vtkCellArray *polys, vtkUnsignedCharArray *colors)
 {
-  vtkIdList* ptIds = vtkIdList::New();
-  ptIds->SetNumberOfIds(this->Resolution + 1);
-
+  vtkIdType ptIds[9];
   double x[3], theta;
 
   // generate eight points in a circle
   x[2] = 0.0;
-  theta = 2.0 * vtkMath::Pi() / static_cast<double>(this->Resolution);
-  for (int i=0; i<this->Resolution; i++)
+  theta = 2.0 * vtkMath::Pi() / 8.0;
+  for (int i=0; i<8; i++)
     {
     x[0] = 0.5 * cos(i*theta);
     x[1] = 0.5 * sin(i*theta);
-    ptIds->SetId(i, pts->InsertNextPoint(x));
+    ptIds[i] = pts->InsertNextPoint(x);
     }
 
-  ptIds->SetId(this->Resolution, ptIds->GetId(0));
   if ( this->Filled )
     {
-    polys->InsertNextCell(ptIds);
+    polys->InsertNextCell(8,ptIds);
     }
   else
     {
-    lines->InsertNextCell(ptIds);
+    ptIds[8] = ptIds[0];
+    lines->InsertNextCell(9,ptIds);
     }
   colors->InsertNextValue(this->RGB[0]);
   colors->InsertNextValue(this->RGB[1]);
   colors->InsertNextValue(this->RGB[2]);
-
-  ptIds->Delete();
 }
 
 void vtkGlyphSource2D::CreateDiamond(vtkPoints *pts, vtkCellArray *lines,
@@ -566,7 +559,6 @@ void vtkGlyphSource2D::PrintSelf(ostream& os, vtkIndent indent)
   os << indent << "Scale: " << this->Scale << "\n";
   os << indent << "Scale2: " << this->Scale2 << "\n";
   os << indent << "Rotation Angle: " << this->RotationAngle << "\n";
-  os << indent << "Resolution: " << this->Resolution << "\n";
 
   os << indent << "Color: (" << this->Color[0] << ", "
      << this->Color[1] << ", " << this->Color[2] << ")\n";
diff --git a/Filters/Sources/vtkGlyphSource2D.h b/Filters/Sources/vtkGlyphSource2D.h
index 6c52736..7aa5091 100644
--- a/Filters/Sources/vtkGlyphSource2D.h
+++ b/Filters/Sources/vtkGlyphSource2D.h
@@ -44,8 +44,6 @@
 #define VTK_HOOKEDARROW_GLYPH 11
 #define VTK_EDGEARROW_GLYPH 12
 
-#define VTK_MAX_CIRCLE_RESOLUTION 1024
-
 class vtkPoints;
 class vtkUnsignedCharArray;
 class vtkCellArray;
@@ -115,11 +113,6 @@ public:
   vtkGetMacro(RotationAngle,double);
 
   // Description:
-  // Specify the number of points that form the circular glyph.
-  vtkSetClampMacro(Resolution,int,3,VTK_MAX_CIRCLE_RESOLUTION);
-  vtkGetMacro(Resolution,int);
-
-  // Description:
   // Specify the type of glyph to generate.
   vtkSetClampMacro(GlyphType,int,VTK_NO_GLYPH,VTK_EDGEARROW_GLYPH);
   vtkGetMacro(GlyphType,int);
@@ -159,7 +152,6 @@ protected:
   int    Cross;
   int    GlyphType;
   double RotationAngle;
-  int    Resolution;
   int    OutputPointsPrecision;
 
   void TransformGlyph(vtkPoints *pts);
diff --git a/Filters/Sources/vtkGraphToPolyData.cxx b/Filters/Sources/vtkGraphToPolyData.cxx
index eb49f70..6386c87 100644
--- a/Filters/Sources/vtkGraphToPolyData.cxx
+++ b/Filters/Sources/vtkGraphToPolyData.cxx
@@ -75,7 +75,7 @@ int vtkGraphToPolyData::RequestData(
     arrowInfo->Get(vtkDataObject::DATA_OBJECT()));
 
   vtkDataArray* edgeGhostLevels = vtkDataArray::SafeDownCast(
-    input->GetEdgeData()->GetAbstractArray(vtkDataSetAttributes::GhostArrayName()));
+    input->GetEdgeData()->GetAbstractArray("vtkGhostLevels"));
 
   if (edgeGhostLevels == NULL)
     {
diff --git a/Filters/Sources/vtkHyperTreeGridSource.cxx b/Filters/Sources/vtkHyperTreeGridSource.cxx
index 1bf9a81..cd0ac27 100644
--- a/Filters/Sources/vtkHyperTreeGridSource.cxx
+++ b/Filters/Sources/vtkHyperTreeGridSource.cxx
@@ -1046,15 +1046,13 @@ void vtkHyperTreeGridSource::SubdivideFromQuadric( vtkHyperTreeCursor* cursor,
     double newSize[] = { 0., 0., 0. };
     switch ( this->Dimension )
       {
+      // Warning: Run through is intended! Do NOT add break statements
       case 3:
         newSize[2] = size[2] / this->BranchFactor;
-        VTK_FALLTHROUGH;
       case 2:
         newSize[1] = size[1] / this->BranchFactor;
-        VTK_FALLTHROUGH;
       case 1:
         newSize[0] = size[0] / this->BranchFactor;
-        break;
       }
 
     int newChildIdx = 0;
diff --git a/Filters/Sources/vtkParametricFunctionSource.cxx b/Filters/Sources/vtkParametricFunctionSource.cxx
index e875524..6356091 100644
--- a/Filters/Sources/vtkParametricFunctionSource.cxx
+++ b/Filters/Sources/vtkParametricFunctionSource.cxx
@@ -517,9 +517,6 @@ void vtkParametricFunctionSource::Produce2DOutput(vtkInformationVector *output)
       pd->SetPoints( points );
       pd->SetPolys( tris );
       vtkSmartPointer<vtkPolyDataNormals> norm = vtkSmartPointer<vtkPolyDataNormals>::New();
-      // we prevent vtkPolyDataNormals from generating new points
-      // so that the number of newTCoords matches the number of points.
-      norm->SplittingOff();
       norm->SetInputData(pd);
       norm->Update();
       outData->DeepCopy(norm->GetOutput());
diff --git a/Filters/Sources/vtkPolyLineSource.cxx b/Filters/Sources/vtkPolyLineSource.cxx
deleted file mode 100644
index 71a6dc4..0000000
--- a/Filters/Sources/vtkPolyLineSource.cxx
+++ /dev/null
@@ -1,166 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkPolyLineSource.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 "vtkPolyLineSource.h"
-
-#include "vtkCellArray.h"
-#include "vtkIdList.h"
-#include "vtkInformation.h"
-#include "vtkInformationVector.h"
-#include "vtkObjectFactory.h"
-#include "vtkSmartPointer.h"
-
-//----------------------------------------------------------------------------
-vtkStandardNewMacro(vtkPolyLineSource);
-
-//----------------------------------------------------------------------------
-vtkPolyLineSource::vtkPolyLineSource()
-{
-  this->Points = NULL;
-  this->Closed = 0;
-
-  this->SetNumberOfInputPorts(0);
-}
-
-//----------------------------------------------------------------------------
-vtkPolyLineSource::~vtkPolyLineSource()
-{
-  if (this->Points)
-    {
-    this->Points->Delete();
-    }
-}
-
-//----------------------------------------------------------------------------
-void vtkPolyLineSource::SetNumberOfPoints(vtkIdType numPoints)
-{
-  if (!this->Points)
-    {
-    vtkPoints* pts = vtkPoints::New(VTK_DOUBLE);
-    this->SetPoints(pts);
-    this->Points = pts;
-    pts->Delete();
-    }
-
-  if (numPoints != this->GetNumberOfPoints())
-    {
-    this->Points->SetNumberOfPoints(numPoints);
-    this->Modified();
-    }
-}
-
-//----------------------------------------------------------------------------
-vtkIdType vtkPolyLineSource::GetNumberOfPoints()
-{
-  if (this->Points)
-    {
-    return this->Points->GetNumberOfPoints();
-    }
-
-  return 0;
-}
-
-//----------------------------------------------------------------------------
-void vtkPolyLineSource::Resize(vtkIdType numPoints)
-{
-  if (!this->Points)
-    {
-    this->SetNumberOfPoints(numPoints);
-    }
-
-  if (numPoints != this->GetNumberOfPoints())
-    {
-    this->Points->Resize(numPoints);
-    this->Modified();
-    }
-}
-
-//----------------------------------------------------------------------------
-void vtkPolyLineSource::SetPoint(vtkIdType id, double x, double y, double z)
-{
-  if (!this->Points)
-    {
-    return;
-    }
-
-  if (id >= this->Points->GetNumberOfPoints())
-    {
-    vtkErrorMacro(<< "point id " << id << " is larger than the number of points");
-    return;
-    }
-
-  this->Points->SetPoint(id, x, y, z);
-  this->Modified();
-}
-
-//----------------------------------------------------------------------------
-void vtkPolyLineSource::SetPoints(vtkPoints* points)
-{
-  if ( points != this->Points )
-    {
-    if ( this->Points != NULL )
-      {
-      this->Points->Delete();
-      }
-    this->Points = points;
-    if ( this->Points != NULL )
-      {
-      this->Points->Register(this);
-      }
-    this->Modified();
-    }
-}
-
-//----------------------------------------------------------------------------
-int vtkPolyLineSource::RequestData(
-  vtkInformation *vtkNotUsed(request),
-  vtkInformationVector **vtkNotUsed(inputVector),
-  vtkInformationVector *outputVector)
-{
-  // get the info object
-  vtkInformation *outInfo = outputVector->GetInformationObject(0);
-
-  // get the ouptut
-  vtkPolyData *output = vtkPolyData::SafeDownCast(
-    outInfo->Get(vtkDataObject::DATA_OBJECT()));
-
-  vtkIdType numPoints = this->GetNumberOfPoints();
-  vtkSmartPointer<vtkIdList> pointIds = vtkSmartPointer<vtkIdList>::New();
-  pointIds->SetNumberOfIds(this->Closed ? numPoints + 1 : numPoints);
-  for (vtkIdType i = 0; i < numPoints; ++i)
-    {
-    pointIds->SetId(i, i);
-    }
-  if (this->Closed)
-    {
-    pointIds->SetId(numPoints, 0);
-    }
-
-  vtkSmartPointer<vtkCellArray> polyLine = vtkSmartPointer<vtkCellArray>::New();
-  polyLine->InsertNextCell(pointIds.GetPointer());
-
-  output->SetPoints(this->Points);
-  output->SetLines(polyLine);
-
-  return 1;
-}
-
-//----------------------------------------------------------------------------
-void vtkPolyLineSource::PrintSelf(ostream& os, vtkIndent indent)
-{
-  this->Superclass::PrintSelf(os, indent);
-
-  os << indent << "Points: " << this->Points << "\n";
-  os << indent << "Closed: " << this->Closed << "\n";
-}
diff --git a/Filters/Sources/vtkPolyLineSource.h b/Filters/Sources/vtkPolyLineSource.h
deleted file mode 100644
index 370ef25..0000000
--- a/Filters/Sources/vtkPolyLineSource.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkPolyLineSource.h
-
-  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.
-
-=========================================================================*/
-// .NAME vtkPolyLineSource - create a poly line from a list of input points
-// .SECTION Description
-// vtkPolyLineSource is a source object that creates a poly line from
-// user-specified points. The output is a vtkPolyLine.
-
-#ifndef vtkPolyLineSource_h
-#define vtkPolyLineSource_h
-
-#include "vtkFiltersSourcesModule.h" // For export macro
-#include "vtkPolyDataAlgorithm.h"
-
-class vtkPoints;
-
-class VTKFILTERSSOURCES_EXPORT vtkPolyLineSource : public vtkPolyDataAlgorithm
-{
-public:
-  static vtkPolyLineSource* New();
-  vtkTypeMacro(vtkPolyLineSource, vtkPolyDataAlgorithm);
-  void PrintSelf(ostream& os, vtkIndent indent);
-
-  // Description:
-  // Set the number of points in the poly line.
-  void SetNumberOfPoints(vtkIdType numPoints);
-  vtkIdType GetNumberOfPoints();
-
-  // Description:
-  // Resize while preserving data.
-  void Resize(vtkIdType numPoints);
-
-  // Description:
-  // Set a point location.
-  void SetPoint(vtkIdType id, double x, double y, double z);
-
-  // Description:
-  // Get the points.
-  void SetPoints(vtkPoints* points);
-  vtkGetObjectMacro(Points, vtkPoints);
-
-  // Description:
-  // Set whether to close the poly line by connecting the last and first points.
-  vtkSetMacro(Closed, int);
-  vtkGetMacro(Closed, int);
-  vtkBooleanMacro(Closed, int);
-
-protected:
-  vtkPolyLineSource();
-  ~vtkPolyLineSource();
-
-  int RequestData(vtkInformation*, vtkInformationVector**, vtkInformationVector *);
-
-  vtkPoints* Points;
-
-  int Closed;
-
-private:
-  vtkPolyLineSource(const vtkPolyLineSource&);  // Not implemented.
-  void operator=(const vtkPolyLineSource&);     // Not implemented.
-};
-
-#endif
diff --git a/Filters/Sources/vtkSelectionSource.cxx b/Filters/Sources/vtkSelectionSource.cxx
index 2290379..4897f86 100644
--- a/Filters/Sources/vtkSelectionSource.cxx
+++ b/Filters/Sources/vtkSelectionSource.cxx
@@ -346,7 +346,7 @@ int vtkSelectionSource::RequestData(
         vtkSelectionSourceInternals::StringIDSetType& selSet =
           this->Internal->StringIDs[idx];
 
-        if (!selSet.empty())
+        if (selSet.size() > 0)
           {
           // Create the selection list
           selectionList->SetNumberOfTuples(selSet.size());
@@ -408,7 +408,7 @@ int vtkSelectionSource::RequestData(
         vtkSelectionSourceInternals::IDSetType& selSet =
           this->Internal->IDs[idx];
 
-        if (!selSet.empty())
+        if (selSet.size() > 0)
           {
           // Create the selection list
           selectionList->SetNumberOfTuples(selSet.size());
diff --git a/Filters/Statistics/vtkBivariateLinearTableThreshold.cxx b/Filters/Statistics/vtkBivariateLinearTableThreshold.cxx
index e0cb5b4..3d9ac8b 100644
--- a/Filters/Statistics/vtkBivariateLinearTableThreshold.cxx
+++ b/Filters/Statistics/vtkBivariateLinearTableThreshold.cxx
@@ -112,8 +112,8 @@ int vtkBivariateLinearTableThreshold::RequestData(vtkInformation* vtkNotUsed(req
   outRowIdsTable->AddColumn(outIds);
 
   outRowDataTable->Initialize();
-  vtkIdType numColumns = inTable->GetNumberOfColumns();
-  for (vtkIdType i=0; i<numColumns; i++)
+  int numColumns = inTable->GetNumberOfColumns();
+  for (int i=0; i<numColumns; i++)
     {
     vtkDataArray* a = vtkDataArray::CreateDataArray(inTable->GetColumn(i)->GetDataType());
     a->SetNumberOfComponents(inTable->GetColumn(i)->GetNumberOfComponents());
@@ -122,7 +122,7 @@ int vtkBivariateLinearTableThreshold::RequestData(vtkInformation* vtkNotUsed(req
     a->Delete();
     }
 
-  for (vtkIdType i=0; i<outIds->GetNumberOfTuples(); i++)
+  for (int i=0; i<outIds->GetNumberOfTuples(); i++)
     {
     outRowDataTable->InsertNextRow(inTable->GetRow(outIds->GetValue(i)));
     }
@@ -245,7 +245,7 @@ int vtkBivariateLinearTableThreshold::ApplyThreshold(vtkTable* tableToThreshold,
     }
 
   acceptedIds->Initialize();
-  vtkIdType numTuples = a1->GetNumberOfTuples();
+  int numTuples = a1->GetNumberOfTuples();
   double v1,v2;
   for (int i=0; i<numTuples; i++)
     {
diff --git a/Filters/Statistics/vtkContingencyStatistics.cxx b/Filters/Statistics/vtkContingencyStatistics.cxx
index dfc3328..c5a2b32 100644
--- a/Filters/Statistics/vtkContingencyStatistics.cxx
+++ b/Filters/Statistics/vtkContingencyStatistics.cxx
@@ -585,9 +585,9 @@ void vtkContingencyStatistics::Assess( vtkTable* inData,
     varNames->SetValue( 1, varNameY );
 
     // Store names to be able to use SetValueByName which is faster than SetValue
-    vtkIdType nv = this->AssessNames->GetNumberOfValues();
+    int nv = this->AssessNames->GetNumberOfValues();
     vtkStdString* names = new vtkStdString[nv];
-    for ( vtkIdType v = 0; v < nv; ++ v )
+    for ( int v = 0; v < nv; ++ v )
       {
       vtksys_ios::ostringstream assessColName;
       assessColName << this->AssessNames->GetValue( v )
@@ -632,7 +632,7 @@ void vtkContingencyStatistics::Assess( vtkTable* inData,
       for ( vtkIdType r = 0; r < nRowData; ++ r )
         {
         (*dfunc)( assessResult, r );
-        for ( vtkIdType v = 0; v < nv; ++ v )
+        for ( int v = 0; v < nv; ++ v )
           {
           outData->SetValueByName( r, names[v], assessResult->GetValue( v ) );
           }
diff --git a/Filters/Statistics/vtkHighestDensityRegionsStatistics.cxx b/Filters/Statistics/vtkHighestDensityRegionsStatistics.cxx
index f1798f4..e1c28ef 100644
--- a/Filters/Statistics/vtkHighestDensityRegionsStatistics.cxx
+++ b/Filters/Statistics/vtkHighestDensityRegionsStatistics.cxx
@@ -197,16 +197,7 @@ void vtkHighestDensityRegionsStatistics::Derive(vtkMultiBlockDataSet*)
 double vtkHighestDensityRegionsStatistics::ComputeHDR(vtkDataArray *inObs,
                                                       vtkDataArray *outDensity)
 {
-  return ComputeHDR(inObs, inObs, outDensity);
-}
-
-// ----------------------------------------------------------------------
-double vtkHighestDensityRegionsStatistics
-::ComputeHDR(vtkDataArray *inObs, vtkDataArray *inPointsOfInterest,
-             vtkDataArray *outDensity)
-{
   vtkIdType nbObservations = inObs->GetNumberOfTuples();
-  vtkIdType nbPoints = inPointsOfInterest->GetNumberOfTuples();
 
   if (nbObservations == 0)
     {
@@ -217,31 +208,29 @@ double vtkHighestDensityRegionsStatistics
 
   double denom = 1.0 / static_cast<double>(nbObservations);
 
-  // Let's compute the HDR for each points of interest
-  for (vtkIdType i = 0; i < nbPoints; i++)
+  // Let's compute the HDR for each points of the observations
+  for (vtkIdType i = 0; i < nbObservations; i++)
     {
     double currentXi[2];
     double currentXj[2];
     double hdr = 0.0;
 
     // We are working in a bivariate model.
-    inPointsOfInterest->GetTuple(i, currentXi);
+    inObs->GetTuple(i, currentXi);
     // Sum all gaussian kernel
     for (vtkIdType j = 0; j < nbObservations; j++)
       {
-
-      inObs->GetTuple(j, currentXj);
-
-      const double deltaX = currentXi[0] - currentXj[0];
-      const double deltaY = currentXi[1] - currentXj[1];
       // Avoid case where point is compared to itself
-      if (deltaX == 0. && deltaY == 0.)
+      if (i == j)
         {
         continue;
         }
+      inObs->GetTuple(j, currentXj);
+
       hdr += this->ComputeSmoothGaussianKernel(
         inObs->GetNumberOfComponents(),
-        deltaX, deltaY);
+        currentXi[0] - currentXj[0],
+        currentXi[1] - currentXj[1]);
       }
     double d = denom * hdr;
     outDensity->SetTuple1(i, d);
diff --git a/Filters/Statistics/vtkHighestDensityRegionsStatistics.h b/Filters/Statistics/vtkHighestDensityRegionsStatistics.h
index 15eea4d..f3155d4 100644
--- a/Filters/Statistics/vtkHighestDensityRegionsStatistics.h
+++ b/Filters/Statistics/vtkHighestDensityRegionsStatistics.h
@@ -69,22 +69,6 @@ public:
   vtkGetVectorMacro(SmoothHC2, double, 2);
   vtkSetVectorMacro(SmoothHC2, double, 2);
 
-  // Description:
-  // Fill outDensity with density vector that is computed from
-  // inObservations values. This method uses a Gaussian kernel.
-  // For n observations and with X an observation point:
-  // f(X) = (1 / n) * Sum(KH(X -Xi)) for (i = 1 to n).
-  // Look ComputeSmoothGaussianKernel for KH kernel definition.
-  double ComputeHDR(vtkDataArray *inObservations, vtkDataArray *outDensity);
-
-  // Description:
-  // Fill outDensity with density vector defined by inPOI and computed from
-  // the inObs values. This method uses a Gaussian kernel.
-  // For n observations and with X an observation point:
-  // f(X) = (1 / n) * Sum(KH(X -Xi)) for (i = 1 to n).
-  // Look ComputeSmoothGaussianKernel for KH kernel definition.
-  double ComputeHDR(vtkDataArray *inObs, vtkDataArray* inPOI,
-                    vtkDataArray *outDensity);
 protected:
   vtkHighestDensityRegionsStatistics();
   ~vtkHighestDensityRegionsStatistics();
@@ -121,6 +105,14 @@ protected:
 //ETX
 
   // Description:
+  // Fill outDensity with density vector that is computed from
+  // inObservations values. This method uses a Gaussian kernel.
+  // For n observations and with X an observation point:
+  // f(X) = (1 / n) * Sum(KH(X -Xi)) for (i = 1 to n).
+  // Look ComputeSmoothGaussianKernel for KH kernel definition.
+  double ComputeHDR(vtkDataArray *inObservations, vtkDataArray *outDensity);
+
+  // Description:
   // Store the smooth matrix parameter H. Specify a smooth direction
   // for the Gaussian kernel.
   double SmoothHC1[2];
diff --git a/Filters/Statistics/vtkOrderStatistics.cxx b/Filters/Statistics/vtkOrderStatistics.cxx
index 1d2320f..f92e1b2 100644
--- a/Filters/Statistics/vtkOrderStatistics.cxx
+++ b/Filters/Statistics/vtkOrderStatistics.cxx
@@ -33,7 +33,6 @@ PURPOSE.  See the above copyright notice for more information.
 #include "vtkTable.h"
 #include "vtkVariantArray.h"
 
-#include <cstdlib>
 #include <vtksys/stl/vector>
 #include <vtksys/stl/map>
 #include <vtksys/stl/set>
@@ -340,11 +339,11 @@ void vtkOrderStatistics::Derive( vtkMultiBlockDataSet* inMeta )
   stringCol->Delete();
 
   double dq = 1. / static_cast<double>( this->NumberOfIntervals );
-  for ( vtkIdType i = 0; i <= this->NumberOfIntervals; ++ i )
+  for ( int i = 0; i <= this->NumberOfIntervals; ++ i )
     {
 
     // Handle special case of quartiles and median for convenience
-    ldiv_t q = ldiv( i << 2, this->NumberOfIntervals );
+    div_t q = div( i << 2, this->NumberOfIntervals );
     if ( q.rem )
       {
       // General case
diff --git a/Filters/Statistics/vtkOrderStatistics.h b/Filters/Statistics/vtkOrderStatistics.h
index 4836d36..c5726a2 100644
--- a/Filters/Statistics/vtkOrderStatistics.h
+++ b/Filters/Statistics/vtkOrderStatistics.h
@@ -140,7 +140,7 @@ protected:
                                     AssessFunctor*& dfunc );
 //ETX
 
-  vtkIdType NumberOfIntervals;
+  int NumberOfIntervals;
   QuantileDefinitionType QuantileDefinition;
   bool Quantize;
   vtkIdType MaximumHistogramSize;
diff --git a/Filters/Statistics/vtkPCAStatistics.cxx b/Filters/Statistics/vtkPCAStatistics.cxx
index 1ee24f0..7328121 100644
--- a/Filters/Statistics/vtkPCAStatistics.cxx
+++ b/Filters/Statistics/vtkPCAStatistics.cxx
@@ -292,7 +292,7 @@ bool vtkPCAAssessFunctor::InitializePCA( vtkTable* inData,
     case vtkPCAStatistics::NUM_BASIS_SCHEMES:
     default:
       vtkGenericWarningMacro( "Unknown basis scheme " << basisScheme << ". Using FULL_BASIS." );
-      VTK_FALLTHROUGH;
+      // fall through
     case vtkPCAStatistics::FULL_BASIS:
       this->BasisSize = m;
       break;
diff --git a/Filters/Statistics/vtkStatisticsAlgorithm.cxx b/Filters/Statistics/vtkStatisticsAlgorithm.cxx
index 14cce8c..6dbb780 100644
--- a/Filters/Statistics/vtkStatisticsAlgorithm.cxx
+++ b/Filters/Statistics/vtkStatisticsAlgorithm.cxx
@@ -348,10 +348,10 @@ void vtkStatisticsAlgorithm::Assess( vtkTable* inData,
       }
 
     // Store names to be able to use SetValueByName, and create the outData columns
-    vtkIdType nAssessments = this->AssessNames->GetNumberOfValues();
+    int nAssessments = this->AssessNames->GetNumberOfValues();
     vtkStdString* names = new vtkStdString[nAssessments];
     vtkIdType nRowData = inData->GetNumberOfRows();
-    for ( vtkIdType a = 0; a < nAssessments; ++ a )
+    for ( int a = 0; a < nAssessments; ++ a )
       {
       // Prepare string for numVariables-tuple of variable names
       vtksys_ios::ostringstream assessColName;
@@ -398,7 +398,7 @@ void vtkStatisticsAlgorithm::Assess( vtkTable* inData,
         {
         // Apply functor
         (*dfunc)( assessResult, r );
-        for ( vtkIdType a = 0; a < nAssessments; ++ a )
+        for ( int a = 0; a < nAssessments; ++ a )
           {
           // Store each assessment value in corresponding assessment column
           outData->SetValueByName( r,
diff --git a/Filters/Statistics/vtkStatisticsAlgorithm.h b/Filters/Statistics/vtkStatisticsAlgorithm.h
index c381bb9..d002743 100644
--- a/Filters/Statistics/vtkStatisticsAlgorithm.h
+++ b/Filters/Statistics/vtkStatisticsAlgorithm.h
@@ -86,6 +86,9 @@ public:
     {
     OUTPUT_DATA  = 0,       //!< Output 0 mirrors the input data, plus optional assessment columns
     OUTPUT_MODEL = 1,       //!< Output 1 contains any generated model
+#ifndef VTK_LEGACY_REMOVE
+    ASSESSMENT   = 2,       //!< This is an old, deprecated name for OUTPUT_TEST.
+#endif
     OUTPUT_TEST  = 2        //!< Output 2 contains result of statistical test(s)
     };
 //ETX
@@ -295,7 +298,7 @@ protected:
                                     AssessFunctor*& dfunc ) = 0;
   //ETX
 
-  vtkIdType NumberOfPrimaryTables;
+  int NumberOfPrimaryTables;
   bool LearnOption;
   bool DeriveOption;
   bool AssessOption;
diff --git a/Filters/Statistics/vtkStreamingStatistics.h b/Filters/Statistics/vtkStreamingStatistics.h
index 2596b20..ef70738 100644
--- a/Filters/Statistics/vtkStreamingStatistics.h
+++ b/Filters/Statistics/vtkStreamingStatistics.h
@@ -61,6 +61,9 @@ public:
     {
     OUTPUT_DATA  = 0,       //!< Output 0 mirrors the input data, plus optional assessment columns
     OUTPUT_MODEL = 1,       //!< Output 1 contains any generated model
+#ifndef VTK_LEGACY_REMOVE
+    ASSESSMENT   = 2,       //!< This is an old, deprecated name for OUTPUT_TEST.
+#endif
     OUTPUT_TEST  = 2        //!< Output 2 contains result of statistical test(s)
     };
 
diff --git a/Filters/StatisticsGnuR/CMakeLists.txt b/Filters/StatisticsGnuR/CMakeLists.txt
index 3611702..d8789b1 100644
--- a/Filters/StatisticsGnuR/CMakeLists.txt
+++ b/Filters/StatisticsGnuR/CMakeLists.txt
@@ -14,8 +14,6 @@ set(Module_SRCS
 find_package(R)
 include_directories(${R_INCLUDE_DIR})
 
-add_definitions(-DVTK_BUILDING_FILTERS_STATISTICSGNUR)
-
 # Configure the module specific settings into a module configured header.
 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/vtkFiltersStatisticsGnuRConfigure.h.in
   ${CMAKE_CURRENT_BINARY_DIR}/vtkFiltersStatisticsGnuRConfigure.h)
diff --git a/Filters/StatisticsGnuR/vtkRAdapter.h b/Filters/StatisticsGnuR/vtkRAdapter.h
index 54a176a..6c9770d 100644
--- a/Filters/StatisticsGnuR/vtkRAdapter.h
+++ b/Filters/StatisticsGnuR/vtkRAdapter.h
@@ -48,11 +48,6 @@
 
 #include "vtkFiltersStatisticsGnuRModule.h" // For export macro
 #include "vtkObject.h"
-
-#ifndef VTK_BUILDING_FILTERS_STATISTICSGNUR
-#define R_NO_REMAP /* Don't pollute the namespace (some of which conflict). DO NOT REMOVE. */
-#endif
-
 #include "Rinternals.h" // Needed for Rinternals.h SEXP data structure
 
 class vtkInformation;
@@ -130,3 +125,6 @@ private:
 
 
 #endif
+
+
+
diff --git a/Filters/StatisticsGnuR/vtkRInterface.cxx b/Filters/StatisticsGnuR/vtkRInterface.cxx
index 971b48d..acd095f 100644
--- a/Filters/StatisticsGnuR/vtkRInterface.cxx
+++ b/Filters/StatisticsGnuR/vtkRInterface.cxx
@@ -144,7 +144,7 @@ public:
   void CloseR()
     {
     this->refcount--;
-    if (this->refcount < 1)
+    if (this->refcount < 1 && ins)
       {
       delete ins;
       ins = NULL;
diff --git a/Filters/Texture/Testing/Python/socbal.py b/Filters/Texture/Testing/Python/socbal.py
index 70f64bc..99898db 100755
--- a/Filters/Texture/Testing/Python/socbal.py
+++ b/Filters/Texture/Testing/Python/socbal.py
@@ -395,7 +395,7 @@ ballTC.SetInputData(model)
 lut = vtk.vtkLookupTable()
 lut.SetNumberOfColors(3)
 lut.Build()
-lut.SetTableValue(0,0,0,0,1)
+lut.SetTableValue(0,0,0,0,0)
 lut.SetTableValue(1,1,.3,.3,1)
 lut.SetTableValue(2,.8,.8,.9,1)
 mapper = vtk.vtkDataSetMapper()
diff --git a/Filters/Texture/Testing/Tcl/socbal.tcl b/Filters/Texture/Testing/Tcl/socbal.tcl
index 14e6112..e9aa643 100644
--- a/Filters/Texture/Testing/Tcl/socbal.tcl
+++ b/Filters/Texture/Testing/Tcl/socbal.tcl
@@ -399,7 +399,7 @@ vtkTextureMapToSphere ballTC
 vtkLookupTable lut
   lut SetNumberOfColors 3
   lut Build
-  lut SetTableValue 0 0 0 0 1
+  lut SetTableValue 0 0 0 0 0
   lut SetTableValue 1 1 .3 .3 1
   lut SetTableValue 2 .8 .8 .9 1
 
diff --git a/GUISupport/Qt/CMakeLists.txt b/GUISupport/Qt/CMakeLists.txt
index aea25cb..41457d0 100644
--- a/GUISupport/Qt/CMakeLists.txt
+++ b/GUISupport/Qt/CMakeLists.txt
@@ -55,7 +55,7 @@ set(QVTKNonMocHeaders
   )
 
 if(VTK_QT_VERSION VERSION_GREATER "4")
-  find_package(Qt5 COMPONENTS Widgets REQUIRED QUIET)
+  find_package(Qt5Widgets REQUIRED QUIET)
   include_directories(${Qt5Widgets_INCLUDE_DIRS})
   add_definitions(${Qt5Widgets_DEFINITIONS})
 
@@ -110,7 +110,7 @@ if(BUILD_SHARED_LIBS)
   set(PluginMocHeaders Q4VTKWidgetPlugin.h)
 
   if(VTK_QT_VERSION VERSION_GREATER "4")
-    find_package(Qt5 COMPONENTS Designer REQUIRED QUIET)
+    find_package(Qt5Designer REQUIRED QUIET)
     add_definitions(${Qt5Designer_DEFINITIONS})
     include_directories(${Qt5Designer_INCLUDE_DIRS})
     qt5_wrap_cpp(PluginMocSrcs ${PluginMocHeaders})
diff --git a/GUISupport/Qt/QVTKInteractorAdapter.cxx b/GUISupport/Qt/QVTKInteractorAdapter.cxx
index d10b278..4fd856e 100644
--- a/GUISupport/Qt/QVTKInteractorAdapter.cxx
+++ b/GUISupport/Qt/QVTKInteractorAdapter.cxx
@@ -158,46 +158,6 @@ bool QVTKInteractorAdapter::ProcessEvent(QEvent* e, vtkRenderWindowInteractor* i
       }
     return true;
     }
-  if (t == QEvent::TouchBegin ||
-      t == QEvent::TouchUpdate ||
-      t == QEvent::TouchEnd)
-    {
-    QTouchEvent* e2 = dynamic_cast<QTouchEvent*>(e);
-    foreach (const QTouchEvent::TouchPoint& point, e2->touchPoints())
-      {
-      if (point.id() >= VTKI_MAX_POINTERS)
-        {
-        break;
-        }
-      // give interactor the event information
-      iren->SetEventInformationFlipY(point.pos().x(), point.pos().y(),
-                                      (e2->modifiers() & Qt::ControlModifier) > 0 ? 1 : 0,
-                                      (e2->modifiers() & Qt::ShiftModifier ) > 0 ? 1 : 0,
-                                      0,0,0, point.id());
-      }
-    foreach (const QTouchEvent::TouchPoint& point, e2->touchPoints())
-      {
-      if (point.id() >= VTKI_MAX_POINTERS)
-        {
-        break;
-        }
-      iren->SetPointerIndex(point.id());
-      if (point.state() & Qt::TouchPointReleased)
-        {
-        iren->InvokeEvent(vtkCommand::LeftButtonReleaseEvent,NULL);
-        }
-      if (point.state() & Qt::TouchPointPressed)
-        {
-        iren->InvokeEvent(vtkCommand::LeftButtonPressEvent,NULL);
-        }
-      if (point.state() & Qt::TouchPointMoved)
-        {
-        iren->InvokeEvent(vtkCommand::MouseMoveEvent, NULL);
-        }
-      }
-    e2->accept();
-    return true;
-    }
 
   if(t == QEvent::Enter)
     {
diff --git a/GUISupport/Qt/QVTKWidget.cxx b/GUISupport/Qt/QVTKWidget.cxx
index 5521841..cd214f1 100644
--- a/GUISupport/Qt/QVTKWidget.cxx
+++ b/GUISupport/Qt/QVTKWidget.cxx
@@ -396,19 +396,6 @@ bool QVTKWidget::event(QEvent* e)
         }
       }
     }
-  else if(e->type() == QEvent::TouchBegin ||
-          e->type() == QEvent::TouchUpdate ||
-          e->type() == QEvent::TouchEnd)
-    {
-    if(this->mRenWin)
-      {
-      mIrenAdapter->ProcessEvent(e, this->mRenWin->GetInteractor());
-      if (e->isAccepted())
-        {
-        return true;
-        }
-      }
-    }
 
   if(QObject::event(e))
     {
diff --git a/GUISupport/Qt/Testing/Cxx/CMakeLists.txt b/GUISupport/Qt/Testing/Cxx/CMakeLists.txt
index 5088d46..7e86f76 100644
--- a/GUISupport/Qt/Testing/Cxx/CMakeLists.txt
+++ b/GUISupport/Qt/Testing/Cxx/CMakeLists.txt
@@ -8,7 +8,7 @@ vtk_add_test_cxx(${vtk-module}CxxTests tests
   )
 
 if(VTK_QT_VERSION VERSION_GREATER "4")
-  find_package(Qt5 COMPONENTS Widgets REQUIRED)
+  find_package(Qt5Widgets REQUIRED)
   include_directories(${Qt5Widgets_INCLUDE_DIRS})
   add_definitions(${Qt5Widgets_DEFINITIONS})
 else()
diff --git a/GUISupport/QtOpenGL/CMakeLists.txt b/GUISupport/QtOpenGL/CMakeLists.txt
index f95c0b2..d6d4bc6 100644
--- a/GUISupport/QtOpenGL/CMakeLists.txt
+++ b/GUISupport/QtOpenGL/CMakeLists.txt
@@ -9,12 +9,8 @@ set(LibSrcs ${QVTKLibSrcs}
   QVTKWidget2.cxx
   )
 
-if (VTK_RENDERING_BACKEND STREQUAL "OpenGL2")
-  add_definitions(-DVTKGL2)
-endif ()
-
 if(VTK_QT_VERSION VERSION_GREATER "4")
-  find_package(Qt5 COMPONENTS OpenGL REQUIRED QUIET)
+  find_package(Qt5OpenGL REQUIRED QUIET)
   include_directories(${Qt5OpenGL_INCLUDE_DIRS})
   add_definitions(${Qt5OpenGL_DEFINITIONS})
   qt5_wrap_cpp(LibMocSrcs ${MocHeaders})
diff --git a/GUISupport/QtOpenGL/QVTKGraphicsItem.cxx b/GUISupport/QtOpenGL/QVTKGraphicsItem.cxx
index 9b77cff..417e2f2 100644
--- a/GUISupport/QtOpenGL/QVTKGraphicsItem.cxx
+++ b/GUISupport/QtOpenGL/QVTKGraphicsItem.cxx
@@ -18,10 +18,6 @@
   the U.S. Government retains certain rights in this software.
 -------------------------------------------------------------------------*/
 
-#ifdef VTKGL2
-#include "vtk_glew.h"
-#endif
-
 #include "QVTKGraphicsItem.h"
 #include <QGLFramebufferObject>
 #include <QGraphicsSceneMouseEvent>
@@ -31,9 +27,7 @@
 #include "QVTKInteractorAdapter.h"
 #include "vtkGenericOpenGLRenderWindow.h"
 #include "vtkEventQtSlotConnect.h"
-#ifndef VTKGL2
 #include "vtkgl.h"
-#endif
 #include "vtkOpenGLError.h"
 
 QVTKGraphicsItem::QVTKGraphicsItem(QGLContext* ctx, QGraphicsItem* p)
@@ -83,17 +77,10 @@ void QVTKGraphicsItem::SetRenderWindow(vtkGenericOpenGLRenderWindow* win)
   {
     mWin->SetMapped(1);
     mWin->SetDoubleBuffer(0);
-#ifdef VTKGL2
-    mWin->SetFrontBuffer(GL_COLOR_ATTACHMENT0);
-    mWin->SetFrontLeftBuffer(GL_COLOR_ATTACHMENT0);
-    mWin->SetBackBuffer(GL_COLOR_ATTACHMENT0);
-    mWin->SetBackLeftBuffer(GL_COLOR_ATTACHMENT0);
-#else
     mWin->SetFrontBuffer(vtkgl::COLOR_ATTACHMENT0_EXT);
     mWin->SetFrontLeftBuffer(vtkgl::COLOR_ATTACHMENT0_EXT);
     mWin->SetBackBuffer(vtkgl::COLOR_ATTACHMENT0_EXT);
     mWin->SetBackLeftBuffer(vtkgl::COLOR_ATTACHMENT0_EXT);
-#endif
 
     mConnect->Connect(mWin, vtkCommand::StartEvent, this, SLOT(Start()));
     mConnect->Connect(mWin, vtkCommand::WindowMakeCurrentEvent, this, SLOT(MakeCurrent()));
diff --git a/GUISupport/QtOpenGL/QVTKWidget2.cxx b/GUISupport/QtOpenGL/QVTKWidget2.cxx
index 57001cf..88618b1 100644
--- a/GUISupport/QtOpenGL/QVTKWidget2.cxx
+++ b/GUISupport/QtOpenGL/QVTKWidget2.cxx
@@ -36,7 +36,7 @@
 #endif
 
 QVTKWidget2::QVTKWidget2(QWidget* p, const QGLWidget* shareWidget, Qt::WindowFlags f)
-  : Superclass(p, shareWidget, f), mRenWin(NULL)
+  : QGLWidget(p, shareWidget, f), mRenWin(NULL)
 {
   this->UseTDx=false;
   mIrenAdapter = new QVTKInteractorAdapter(this);
@@ -46,7 +46,7 @@ QVTKWidget2::QVTKWidget2(QWidget* p, const QGLWidget* shareWidget, Qt::WindowFla
 }
 
 QVTKWidget2::QVTKWidget2(QGLContext* ctx, QWidget* p, const QGLWidget* shareWidget, Qt::WindowFlags f)
-  : Superclass(ctx, p, shareWidget, f), mRenWin(NULL)
+  : QGLWidget(ctx, p, shareWidget, f), mRenWin(NULL)
 {
   this->UseTDx=false;
   mIrenAdapter = new QVTKInteractorAdapter(this);
@@ -56,7 +56,7 @@ QVTKWidget2::QVTKWidget2(QGLContext* ctx, QWidget* p, const QGLWidget* shareWidg
 }
 
 QVTKWidget2::QVTKWidget2(const QGLFormat& fmt, QWidget* p, const QGLWidget* shareWidget, Qt::WindowFlags f)
-  : Superclass(fmt, p, shareWidget, f), mRenWin(NULL)
+  : QGLWidget(fmt, p, shareWidget, f), mRenWin(NULL)
 {
   this->UseTDx=false;
   mIrenAdapter = new QVTKInteractorAdapter(this);
@@ -271,26 +271,6 @@ void QVTKWidget2::paintGL()
   iren->Render();
 }
 
-/*! handle touch events
- */
-bool QVTKWidget2::event(QEvent* e)
-{
-  if(e->type() == QEvent::TouchBegin ||
-          e->type() == QEvent::TouchUpdate ||
-          e->type() == QEvent::TouchEnd)
-    {
-    if(this->mRenWin)
-      {
-      mIrenAdapter->ProcessEvent(e, this->mRenWin->GetInteractor());
-      if (e->isAccepted())
-        {
-        return true;
-        }
-      }
-    }
-  return Superclass::event(e);
-}
-
 /*! handle mouse press event
  */
 void QVTKWidget2::mousePressEvent(QMouseEvent* e)
@@ -490,10 +470,10 @@ int QVTKWidget2::GetMultiSamples() const
 
 void QVTKWidget2::setAutoBufferSwap(bool f)
 {
-  Superclass::setAutoBufferSwap(f);
+  QGLWidget::setAutoBufferSwap(f);
 }
 
 bool QVTKWidget2::autoBufferSwap() const
 {
-  return Superclass::autoBufferSwap();
+  return QGLWidget::autoBufferSwap();
 }
diff --git a/GUISupport/QtOpenGL/QVTKWidget2.h b/GUISupport/QtOpenGL/QVTKWidget2.h
index fd72bb1..1443808 100644
--- a/GUISupport/QtOpenGL/QVTKWidget2.h
+++ b/GUISupport/QtOpenGL/QVTKWidget2.h
@@ -39,7 +39,6 @@ class vtkTDxDevice;
 class VTKGUISUPPORTQTOPENGL_EXPORT QVTKWidget2 : public QGLWidget
 {
   Q_OBJECT
-  typedef QGLWidget Superclass;
 public:
   //! constructor
   QVTKWidget2(QWidget* parent = NULL, const QGLWidget* shareWidget=0, Qt::WindowFlags f = 0);
@@ -121,8 +120,6 @@ protected:
   // overloaded move handler
   virtual void moveEvent(QMoveEvent* event);
 
-  // overloaded touch events
-  virtual bool event(QEvent* e);
   // overloaded mouse press handler
   virtual void mousePressEvent(QMouseEvent* event);
   // overloaded mouse move handler
diff --git a/GUISupport/QtOpenGL/module.cmake b/GUISupport/QtOpenGL/module.cmake
index c36e7c4..ad1f09d 100644
--- a/GUISupport/QtOpenGL/module.cmake
+++ b/GUISupport/QtOpenGL/module.cmake
@@ -5,7 +5,7 @@ vtk_module(vtkGUISupportQtOpenGL
   ${_groups}
   DEPENDS
     vtkGUISupportQt
-    vtkRendering${VTK_RENDERING_BACKEND}
+    vtkRenderingOpenGL
   TEST_DEPENDS
     vtkTestingCore
   EXCLUDE_FROM_WRAPPING
diff --git a/GUISupport/QtSQL/CMakeLists.txt b/GUISupport/QtSQL/CMakeLists.txt
index 5c9c987..06337fb 100644
--- a/GUISupport/QtSQL/CMakeLists.txt
+++ b/GUISupport/QtSQL/CMakeLists.txt
@@ -10,8 +10,8 @@ set(LibSrcs
 include_directories(${CMAKE_CURRENT_BINARY_DIR})
 
 if(VTK_QT_VERSION VERSION_GREATER "4")
-  find_package(Qt5 COMPONENTS Widgets REQUIRED QUIET)
-  find_package(Qt5 COMPONENTS Sql REQUIRED QUIET)
+  find_package(Qt5Widgets REQUIRED QUIET)
+  find_package(Qt5Sql REQUIRED QUIET)
 
   set(_qt_include_dirs ${Qt5Widgets_INCLUDE_DIRS} ${Qt5Sql_INCLUDE_DIRS})
   list(REMOVE_DUPLICATES _qt_include_dirs)
diff --git a/GUISupport/QtSQL/Testing/Cxx/CMakeLists.txt b/GUISupport/QtSQL/Testing/Cxx/CMakeLists.txt
index 85f847f..2abb90a 100644
--- a/GUISupport/QtSQL/Testing/Cxx/CMakeLists.txt
+++ b/GUISupport/QtSQL/Testing/Cxx/CMakeLists.txt
@@ -6,7 +6,7 @@ vtk_add_test_cxx(${vtk-module}CxxTests tests
   )
 
 if(VTK_QT_VERSION VERSION_GREATER "4")
-  find_package(Qt5 COMPONENTS Widgets REQUIRED)
+  find_package(Qt5Widgets REQUIRED)
   include_directories(${Qt5Widgets_INCLUDE_DIRS})
   add_definitions(${Qt5Widgets_DEFINITIONS})
 else()
diff --git a/GUISupport/QtWebkit/CMakeLists.txt b/GUISupport/QtWebkit/CMakeLists.txt
index 5340997..6c6d072 100644
--- a/GUISupport/QtWebkit/CMakeLists.txt
+++ b/GUISupport/QtWebkit/CMakeLists.txt
@@ -7,7 +7,7 @@ set(LibSrcs ${QVTKLibSrcs} vtkQtRichTextView.cxx)
 set(MocHeaders ${QVTKMocHeaders} vtkQtRichTextView.h)
 
 if(VTK_QT_VERSION VERSION_GREATER "4")
-  find_package(Qt5 COMPONENTS WebKitWidgets REQUIRED QUIET)
+  find_package(Qt5WebKitWidgets REQUIRED QUIET)
   include_directories(${Qt5WebKitWidgets_INCLUDE_DIRS})
   add_definitions(${Qt5WebKitWidgets_DEFINITIONS})
 
diff --git a/Geovis/Core/Testing/Data/Baseline/TestLabeledGeoView2D.png.md5 b/Geovis/Core/Testing/Data/Baseline/TestLabeledGeoView2D.png.md5
index 36fe6bb..f2b1ac6 100644
--- a/Geovis/Core/Testing/Data/Baseline/TestLabeledGeoView2D.png.md5
+++ b/Geovis/Core/Testing/Data/Baseline/TestLabeledGeoView2D.png.md5
@@ -1 +1 @@
-0087f914e60fafcad8b2a720bda407d1
+a0ba2137f9ecfbbe7e24f196c0231056
diff --git a/Geovis/Core/Testing/Data/Baseline/TestLabeledGeoView2D_1.png.md5 b/Geovis/Core/Testing/Data/Baseline/TestLabeledGeoView2D_1.png.md5
new file mode 100644
index 0000000..774e726
--- /dev/null
+++ b/Geovis/Core/Testing/Data/Baseline/TestLabeledGeoView2D_1.png.md5
@@ -0,0 +1 @@
+61e0c742f0a037d45b76f0317dacdb73
diff --git a/Geovis/Core/Testing/Data/Baseline/TestLabeledGeoView2D_2.png.md5 b/Geovis/Core/Testing/Data/Baseline/TestLabeledGeoView2D_2.png.md5
new file mode 100644
index 0000000..15f34c8
--- /dev/null
+++ b/Geovis/Core/Testing/Data/Baseline/TestLabeledGeoView2D_2.png.md5
@@ -0,0 +1 @@
+dce4d801948c1b896163ed65def0fd76
diff --git a/Geovis/Core/Testing/Data/Baseline/TestLabeledGeoView2D_3.png.md5 b/Geovis/Core/Testing/Data/Baseline/TestLabeledGeoView2D_3.png.md5
new file mode 100644
index 0000000..ab98732
--- /dev/null
+++ b/Geovis/Core/Testing/Data/Baseline/TestLabeledGeoView2D_3.png.md5
@@ -0,0 +1 @@
+c291a5768cc0c0cf9ec516a666cefc95
diff --git a/Geovis/Core/Testing/Data/Baseline/TestLabeledGeoView2D_4.png.md5 b/Geovis/Core/Testing/Data/Baseline/TestLabeledGeoView2D_4.png.md5
new file mode 100644
index 0000000..ea111ea
--- /dev/null
+++ b/Geovis/Core/Testing/Data/Baseline/TestLabeledGeoView2D_4.png.md5
@@ -0,0 +1 @@
+00a9dac85f9d1a9ff39ef2c181f18ddf
diff --git a/Geovis/Core/Testing/Data/Baseline/TestLabeledGeoView2D_5.png.md5 b/Geovis/Core/Testing/Data/Baseline/TestLabeledGeoView2D_5.png.md5
new file mode 100644
index 0000000..c0de37b
--- /dev/null
+++ b/Geovis/Core/Testing/Data/Baseline/TestLabeledGeoView2D_5.png.md5
@@ -0,0 +1 @@
+fe2697992f9e05ef19943d2b3ca28471
diff --git a/Geovis/Core/module.cmake b/Geovis/Core/module.cmake
index a65a5f2..8fa60a3 100644
--- a/Geovis/Core/module.cmake
+++ b/Geovis/Core/module.cmake
@@ -14,6 +14,7 @@ vtk_module(vtkGeovisCore
     vtkViewsInfovis
     vtkRenderingCore
     vtkRendering${VTK_RENDERING_BACKEND}
+    vtkRenderingFreeType${VTK_RENDERING_BACKEND}
     vtkTestingRendering
     vtkInteractionStyle
   )
diff --git a/Geovis/Core/vtkGlobeSource.cxx b/Geovis/Core/vtkGlobeSource.cxx
index 644ca2c..697c828 100644
--- a/Geovis/Core/vtkGlobeSource.cxx
+++ b/Geovis/Core/vtkGlobeSource.cxx
@@ -64,22 +64,20 @@ vtkGlobeSource::vtkGlobeSource()
 void vtkGlobeSource::ComputeGlobePoint(
   double theta, double phi, double radius, double* x, double* normal)
 {
-  // Lets keep this conversion code in a single place.
-  double tmp = cos( vtkMath::RadiansFromDegrees( phi ) );
-  double n0 = -tmp * sin( vtkMath::RadiansFromDegrees( theta ) );
-  double n1 = tmp * cos( vtkMath::RadiansFromDegrees( theta ) );
-  double n2 = sin( vtkMath::RadiansFromDegrees( phi ) );
+  double mynormal[3];
 
-  x[0] = n0 * radius;
-  x[1] = n1 * radius;
-  x[2] = n2 * radius;
+  double* n = normal ? normal : mynormal;
 
-  if (normal)
-    {
-    normal[0] = n0;
-    normal[1] = n1;
-    normal[2] = n2;
-    }
+  // Lets keep this conversion code in a single place.
+  double tmp;
+  tmp =    cos( vtkMath::RadiansFromDegrees( phi ) );
+  n[0] = - tmp * sin( vtkMath::RadiansFromDegrees( theta ) );
+  n[1] =   tmp * cos( vtkMath::RadiansFromDegrees( theta ) );
+  n[2] =   sin( vtkMath::RadiansFromDegrees( phi ) );
+
+  x[0] = n[0] * radius;
+  x[1] = n[1] * radius;
+  x[2] = n[2] * radius;
 }
 
 //----------------------------------------------------------------------------
diff --git a/IO/ADIOS/ADIOSScalar.cxx b/IO/ADIOS/ADIOSScalar.cxx
index caab714..381aca5 100644
--- a/IO/ADIOS/ADIOSScalar.cxx
+++ b/IO/ADIOS/ADIOSScalar.cxx
@@ -23,62 +23,72 @@
 namespace ADIOS
 {
 
-template<typename T>
-void LoadScalarsFromStats(void* &ptr, ADIOS_VARINFO *v)
-{
-  T* &ptrT = reinterpret_cast<T*&>(ptr);
-  ptrT = new T[v->sum_nblocks];
-  for(size_t i = 0; i < v->sum_nblocks; ++i)
-    {
-    ptrT[i] = *reinterpret_cast<const T*>(v->statistics->blocks->mins[i]);
-    }
-}
-
 //----------------------------------------------------------------------------
 Scalar::Scalar(ADIOS_FILE *f, ADIOS_VARINFO *v)
 : VarInfo(f, v), Values(NULL)
 {
+  // Allocate memory
   switch(this->Type)
     {
     case adios_byte:
-      LoadScalarsFromStats<int8_t>(this->Values, v);
+      this->Values = new int8_t[v->sum_nblocks];
       break;
     case adios_short:
-      LoadScalarsFromStats<int16_t>(this->Values, v);
+      this->Values = new int16_t[v->sum_nblocks];
       break;
     case adios_integer:
-      LoadScalarsFromStats<int32_t>(this->Values, v);
+      this->Values = new int32_t[v->sum_nblocks];
       break;
     case adios_long:
-      LoadScalarsFromStats<int64_t>(this->Values, v);
+      this->Values = new int64_t[v->sum_nblocks];
       break;
     case adios_unsigned_byte:
-      LoadScalarsFromStats<uint8_t>(this->Values, v);
+      this->Values = new uint8_t[v->sum_nblocks];
       break;
     case adios_unsigned_short:
-      LoadScalarsFromStats<uint16_t>(this->Values, v);
+      this->Values = new uint16_t[v->sum_nblocks];
       break;
     case adios_unsigned_integer:
-      LoadScalarsFromStats<uint32_t>(this->Values, v);
+      this->Values = new uint32_t[v->sum_nblocks];
       break;
     case adios_unsigned_long:
-      LoadScalarsFromStats<uint64_t>(this->Values, v);
+      this->Values = new uint64_t[v->sum_nblocks];
       break;
     case adios_real:
-      LoadScalarsFromStats<float>(this->Values, v);
+      this->Values = new float[v->sum_nblocks];
       break;
     case adios_double:
-      LoadScalarsFromStats<double>(this->Values, v);
+      this->Values = new double[v->sum_nblocks];
       break;
     case adios_complex:
-      LoadScalarsFromStats<std::complex<float> >(this->Values, v);
+      this->Values = new std::complex<float>[v->sum_nblocks];
       break;
     case adios_double_complex:
-      LoadScalarsFromStats<std::complex<double> >(this->Values, v);
-      break;
-    default:
-      // Unsupported data type
+      this->Values = new std::complex<double>[v->sum_nblocks];
       break;
+    default: break;
+    }
+  size_t tSize = Type::SizeOf(this->Type);
+
+  // Read all blocks and steps
+  int err;
+  char *rawPtr = reinterpret_cast<char *>(this->Values);
+  for(size_t s = 0; s < v->nsteps; ++s)
+    {
+    for(size_t b = 0; b < v->nblocks[s]; ++b)
+      {
+      ADIOS_SELECTION *sel = adios_selection_writeblock(b);
+      ReadError::TestNe<ADIOS_SELECTION*>(NULL, sel);
+
+      err = adios_schedule_read_byid(f, sel, v->varid, s, 1, rawPtr);
+      ReadError::TestEq(0, err);
+
+      err = adios_perform_reads(f, 1);
+      ReadError::TestEq(0, err);
+
+      adios_selection_delete(sel);
+      rawPtr += tSize;
+      }
     }
 }
 
diff --git a/IO/ADIOS/ADIOSScalar.h b/IO/ADIOS/ADIOSScalar.h
index 0a649fe..50acc03 100644
--- a/IO/ADIOS/ADIOSScalar.h
+++ b/IO/ADIOS/ADIOSScalar.h
@@ -39,10 +39,8 @@ public:
   {
     ReadError::TestEq(this->Type, Type::NativeToADIOS<T>(), "Invalid type");
 
-    StepBlock* idx = this->GetNewestBlockIndex(step, block);
-    ReadError::TestNe<StepBlock*>(NULL, idx, "Variable not available");
-
-    return reinterpret_cast<const T*>(this->Values)[idx->BlockId];
+    const int blockId = this->GetBlockId(step, block);
+    return reinterpret_cast<const T*>(this->Values)[blockId];
   }
 
 protected:
diff --git a/IO/ADIOS/ADIOSVarInfo.cxx b/IO/ADIOS/ADIOSVarInfo.cxx
index afe2211..4cb4ffd 100644
--- a/IO/ADIOS/ADIOSVarInfo.cxx
+++ b/IO/ADIOS/ADIOSVarInfo.cxx
@@ -35,54 +35,21 @@ VarInfo::VarInfo(ADIOS_FILE *f, ADIOS_VARINFO *v)
   err = adios_inq_var_blockinfo(f, v);
   ReadError::TestEq(0, err);
 
-  // Polulate dimensions and determine block step ranges
-  size_t pidMax = 0;
-  int nd = v->ndim;
-  this->Dims.resize(v->sum_nblocks);
-  for(size_t bid = 0; bid < v->sum_nblocks; ++bid)
-    {
-    ADIOS_VARBLOCK &bi = v->blockinfo[bid];
-    if(bi.process_id > pidMax)
-      {
-      pidMax = bi.process_id;
-      }
-
-    if(nd > 0)
-      {
-      std::vector<size_t> &dimsBid = this->Dims[bid];
-      dimsBid.reserve(nd);
-      for(size_t n = 0; n < nd; ++n)
-        {
-        dimsBid.push_back(bi.count[n]);
-        }
-      }
-    }
-
-  // Construct the block index
-  this->NumPids = pidMax + 1;
-  this->NumSteps = f->last_step+1;
-  this->StepBlockIndex.clear();
-  this->StepBlockIndex.resize(this->NumSteps*this->NumPids, NULL);
+  // Calculate block ids
   size_t bid = 0;
+  this->BlockId.resize(v->nsteps);
+  this->Dims.resize(v->nsteps);
   for(size_t s = 0; s < v->nsteps; ++s)
     {
+    this->Dims[s].resize(v->nblocks[s]);
     for(size_t b = 0; b < v->nblocks[s]; ++b)
       {
-      ADIOS_VARBLOCK &bi = v->blockinfo[bid];
-      this->StepBlockIndex[(bi.time_index-1)*this->NumPids+bi.process_id] =
-        new StepBlock(s, b, bid++);
-      }
-    }
-}
+      this->Dims[s][b].reserve(v->ndim);
+      std::copy(v->blockinfo[bid].count, v->blockinfo[bid].count+v->ndim,
+        std::back_inserter(this->Dims[s][b]));
 
-//----------------------------------------------------------------------------
-VarInfo::~VarInfo()
-{
-  // Cleanup the block step index
-  for(std::vector<StepBlock*>::iterator i = this->StepBlockIndex.begin();
-    i != this->StepBlockIndex.end(); ++i)
-    {
-    delete *i;
+      this->BlockId[s].push_back(bid++);
+      }
     }
 }
 
@@ -107,38 +74,34 @@ const std::string& VarInfo::GetName(void) const
 //----------------------------------------------------------------------------
 size_t VarInfo::GetNumSteps(void) const
 {
-  return this->NumSteps;
+  return this->BlockId.size();
 }
 
 //----------------------------------------------------------------------------
 size_t VarInfo::GetNumBlocks(size_t step) const
 {
-  return this->NumPids;
+  return this->BlockId[step].size();
 }
 
 //----------------------------------------------------------------------------
-VarInfo::StepBlock* VarInfo::GetNewestBlockIndex(size_t step, size_t pid) const
+size_t VarInfo::GetBlockId(size_t step, size_t block) const
 {
-  ReadError::TestEq(true, step < this->NumSteps, "Invalid step");
-  ReadError::TestEq(true, pid < this->NumPids, "Invalid block");
-
-  StepBlock* idx = NULL;
-  for(int curStep = step; !idx && curStep >= 0; --curStep)
-    {
-    idx = this->StepBlockIndex[curStep*this->NumPids+pid];
-    }
-
-  return idx;
+  ReadError::TestEq(true, step < this->BlockId.size(), "Invalid step");
+  ReadError::TestEq(true, block < this->BlockId[step].size(),
+    "Invalid block");
+  return static_cast<int>(this->BlockId[step][block]);
 }
 
 //----------------------------------------------------------------------------
-void VarInfo::GetDims(std::vector<size_t>& dims, size_t step, size_t pid) const
+void VarInfo::GetDims(std::vector<size_t>& dims, size_t step,
+  size_t block) const
 {
-  StepBlock* idx = this->GetNewestBlockIndex(step, pid);
-  ReadError::TestNe<VarInfo::StepBlock*>(NULL, idx, "Variable not available");
+  ReadError::TestEq(true, step < this->BlockId.size(), "Invalid step");
+  ReadError::TestEq(true, block < this->BlockId[step].size(),
+    "Invalid block");
 
   dims.clear();
-  dims = this->Dims[idx->BlockId];
+  dims = this->Dims[step][block];
 }
 
 } // End namespace ADIOS
diff --git a/IO/ADIOS/ADIOSVarInfo.h b/IO/ADIOS/ADIOSVarInfo.h
index 9baab60..16565fd 100644
--- a/IO/ADIOS/ADIOSVarInfo.h
+++ b/IO/ADIOS/ADIOSVarInfo.h
@@ -29,19 +29,8 @@ namespace ADIOS
 class VarInfo
 {
 public:
-  // Data structure used to hold block index mapping info
-  struct StepBlock
-  {
-    StepBlock() : Step(-1), Block(-1), BlockId(-1) {}
-    StepBlock(int s, int b, int i) : Step(s), Block(b), BlockId(i) { }
-    int Step;
-    int Block;
-    int BlockId;
-  };
-
-public:
   VarInfo(ADIOS_FILE *f, ADIOS_VARINFO *v);
-  virtual ~VarInfo(void);
+  virtual ~VarInfo(void) { }
   void SetName(const std::string& name) { this->Name = name; }
 
   const int& GetId() const;
@@ -49,20 +38,15 @@ public:
   const std::string& GetName(void) const;
   size_t GetNumSteps(void) const;
   size_t GetNumBlocks(size_t step) const;
-  StepBlock* GetNewestBlockIndex(size_t step, size_t pid) const;
-  void GetDims(std::vector<size_t>& dims, size_t step, size_t pid) const;
+  size_t GetBlockId(size_t step, size_t block) const;
+  void GetDims(std::vector<size_t>& dims, size_t step, size_t block) const;
 
 protected:
   int Id;
   ADIOS_DATATYPES Type;
   std::string Name;
-  size_t NumSteps;
-  size_t NumPids;
-  std::vector<std::vector<size_t> > Dims;
-
-  // This maps the absolute time step and process id to a file-local
-  // step and block id for reading
-  std::vector<StepBlock*> StepBlockIndex;
+  std::vector<std::vector<size_t> > BlockId;
+  std::vector<std::vector<std::vector<size_t> > > Dims;
 };
 
 } // End namespace ADIOS
diff --git a/IO/ADIOS/ADIOSWriter.cxx b/IO/ADIOS/ADIOSWriter.cxx
index d26a392..f5cc624 100644
--- a/IO/ADIOS/ADIOSWriter.cxx
+++ b/IO/ADIOS/ADIOSWriter.cxx
@@ -409,6 +409,7 @@ void Writer::WriteArray(const std::string& path, const void* val)
 void Writer::Commit(const std::string& fName, bool app)
 {
   uint64_t groupSize = 0;
+  std::vector<const WriterImpl::ArrayValue*> nonEmptyArrays;
 
   // Step 1: Preprocessing
 
@@ -446,15 +447,23 @@ void Writer::Commit(const std::string& fName, bool app)
           di->ValueI : this->Impl->IntegralScalars[di->ValueS];
         }
       }
-    groupSize += numElements * ai->ElementSize;
+    //if(numElements == 0)
+    //  {
+    //  delete *avi;
+    //  }
+    //else
+    //  {
+      groupSize += numElements * ai->ElementSize;
+      nonEmptyArrays.push_back(*avi);
+    //  }
     }
+  this->Impl->ArraysToWrite.clear();
 
   int err;
 
   // Step 2. Set the buffer size in MB with the full knowledge of the dynamic
-  // group size.  Ask for 10% over the group size to account for extra metadata
-  int bufSize = (groupSize * 1.1)/(1024*1024) + 1;
-  err = adios_allocate_buffer(ADIOS_BUFFER_ALLOC_LATER, bufSize);
+  // group size
+  err = adios_allocate_buffer(ADIOS_BUFFER_ALLOC_LATER, (groupSize >> 20) + 1);
   WriteError::TestEq(0, err);
 
   // Step 3. Open the file for writing
@@ -479,8 +488,8 @@ void Writer::Commit(const std::string& fName, bool app)
 
   // Step 5: Write Arrays
   for(std::vector<const WriterImpl::ArrayValue*>::iterator avi =
-        this->Impl->ArraysToWrite.begin();
-      avi != this->Impl->ArraysToWrite.end();
+        nonEmptyArrays.begin();
+      avi != nonEmptyArrays.end();
       ++avi)
     {
     err = adios_write(file, (*avi)->Path.c_str(),
@@ -490,6 +499,7 @@ void Writer::Commit(const std::string& fName, bool app)
 
   // Step 6. Close the file and commit the writes to ADIOS
   adios_close(file);
+  MPI_Barrier(this->Ctx->Comm);
 
   // Step 7. Cleanup
   for(std::vector<const WriterImpl::ScalarValue*>::iterator svi =
@@ -499,16 +509,14 @@ void Writer::Commit(const std::string& fName, bool app)
     {
     delete *svi;
     }
-  this->Impl->ScalarsToWrite.clear();
-
   for(std::vector<const WriterImpl::ArrayValue*>::iterator avi =
-        this->Impl->ArraysToWrite.begin();
-      avi != this->Impl->ArraysToWrite.end();
+        nonEmptyArrays.begin();
+      avi != nonEmptyArrays.end();
       ++avi)
     {
     delete *avi;
     }
-  this->Impl->ArraysToWrite.clear();
+  this->Impl->ScalarsToWrite.clear();
 }
 
 } // End namespace
diff --git a/IO/ADIOS/Testing/Cxx/TestADIOSSphereWR.cxx b/IO/ADIOS/Testing/Cxx/TestADIOSSphereWR.cxx
index 16a0fa0..607b66b 100644
--- a/IO/ADIOS/Testing/Cxx/TestADIOSSphereWR.cxx
+++ b/IO/ADIOS/Testing/Cxx/TestADIOSSphereWR.cxx
@@ -156,6 +156,8 @@ int ValidateSphere::ProcessRequest(vtkInformation* request,
       }
 
     // Adjust Phi and Theta resolutions for multi-piece
+    double deltaPhi, deltaTheta, phi, theta;
+    double startTheta, endTheta, startPhi, endPhi;
     int thetaResolution, phiResolution;
     int piece = controller->GetLocalProcessId();
     int numPieces = mpInput->GetNumberOfPieces();
@@ -175,7 +177,7 @@ int ValidateSphere::ProcessRequest(vtkInformation* request,
       {
       localEndTheta += 360.0;
       }
-    double deltaTheta = (localEndTheta - localStartTheta) / localThetaResolution;
+    deltaTheta = (localEndTheta - localStartTheta) / localThetaResolution;
 
     int start, end, numPoles;
     start = piece * localThetaResolution / numPieces;
diff --git a/IO/ADIOS/vtkADIOSReader.cxx b/IO/ADIOS/vtkADIOSReader.cxx
index f297c5f..3a73d57 100644
--- a/IO/ADIOS/vtkADIOSReader.cxx
+++ b/IO/ADIOS/vtkADIOSReader.cxx
@@ -205,7 +205,7 @@ int vtkADIOSReader::RequestInformation(vtkInformation *vtkNotUsed(req),
   vtkInformation* outInfo = output->GetInformationObject(0);
   outInfo->Set(vtkAlgorithm::CAN_HANDLE_PIECE_REQUEST(), 1);
 
-  // Rank 0 reads attributes and sends to all other ranks
+  // Rank 0 reads attributes and time steps and sends to all other ranks
   if(this->Controller->GetLocalProcessId() == 0)
     {
     // 1: Retrieve the necessary attributes
@@ -226,30 +226,32 @@ int vtkADIOSReader::RequestInformation(vtkInformation *vtkNotUsed(req),
       vtkWarningMacro(<< "NumberOfPieces attribute not present.  Assuming 1");
       this->NumberOfPieces = 1;
       }
+
+    // 3: Retrieve the time steps
+    const ADIOS::Scalar *varTimeSteps = this->Tree->GetScalar("TimeStamp");
+    this->TimeSteps.clear();
+    this->TimeSteps.resize(varTimeSteps->GetNumSteps());
+    for(int t = 0; t < varTimeSteps->GetNumSteps(); ++t)
+      {
+      this->TimeSteps[t] = varTimeSteps->GetValue<double>(t, 0);
+      }
     }
 
-  // 3: Broadcast number of pieces to all other ranks
-  int msg1[1];
+  // 4: Communicate metadata to all other ranks
+  int msg1[2];
   if(this->Controller->GetLocalProcessId() == 0)
     {
     msg1[0] = this->NumberOfPieces;
+    msg1[1] = this->TimeSteps.size();
     }
-  this->Controller->Broadcast(msg1, 1, 0);
+  this->Controller->Broadcast(msg1, 2, 0);
   if(this->Controller->GetLocalProcessId() != 0)
     {
     this->NumberOfPieces = msg1[0];
+    this->TimeSteps.resize(msg1[1]);
     }
-
-
-  // 4: Retrieve the time steps
-  const ADIOS::Scalar *varTimeSteps = this->Tree->GetScalar("TimeStamp");
-  this->TimeSteps.clear();
-  this->TimeSteps.resize(varTimeSteps->GetNumSteps());
-  for(int t = 0; t < varTimeSteps->GetNumSteps(); ++t)
-    {
-    // Always read time info from block0
-    this->TimeSteps[t] = varTimeSteps->GetValue<double>(t, 0);
-    }
+  this->Controller->Broadcast(&(*this->TimeSteps.begin()),
+    this->TimeSteps.size(), 0);
 
   // Populate the inverse lookup, i.e. time step value to time step index
   this->TimeStepsIndex.clear();
@@ -498,14 +500,10 @@ void vtkADIOSReader::ReadObject(const ADIOS::VarInfo* info,
   // Only queue the read if there's data to be read
   if(nc != 0 && nt != 0)
     {
-    const ADIOS::VarInfo::StepBlock *idx =
-      info->GetNewestBlockIndex(this->RequestStepIndex, blockId);
-    // TODO: Use a cached copy if available
-
     data->SetNumberOfComponents(nc);
     data->SetNumberOfTuples(nt);
     this->Reader->ScheduleReadArray(info->GetId(), data->GetVoidPointer(0),
-      idx->Step, idx->Block);
+      this->RequestStepIndex, blockId);
     }
 }
 
diff --git a/IO/ADIOS/vtkADIOSUtilities.h b/IO/ADIOS/vtkADIOSUtilities.h
index 4d2db3d..61097f7 100644
--- a/IO/ADIOS/vtkADIOSUtilities.h
+++ b/IO/ADIOS/vtkADIOSUtilities.h
@@ -12,8 +12,8 @@
      PURPOSE.  See the above copyright notice for more information.
 
 =========================================================================*/
-#ifndef vtkADIOSUtilities_h
-#define vtkADIOSUtilities_h
+#ifndef __vtkADIOSUtilities_h
+#define __vtkADIOSUtilities_h
 
 #include <vtkType.h>
 
diff --git a/IO/ADIOS/vtkADIOSWriter.cxx b/IO/ADIOS/vtkADIOSWriter.cxx
index 181601d..0f38f27 100644
--- a/IO/ADIOS/vtkADIOSWriter.cxx
+++ b/IO/ADIOS/vtkADIOSWriter.cxx
@@ -58,7 +58,7 @@ vtkADIOSWriter::vtkADIOSWriter()
   TransportMethod(static_cast<int>(ADIOS::TransportMethod_POSIX)),
   TransportMethodArguments(NULL),
   Transform(static_cast<int>(ADIOS::Transform_NONE)),
-  CurrentStep(-1), Controller(NULL),
+  WriteMode(vtkADIOSWriter::Always), CurrentStep(-1), Controller(NULL),
   Writer(NULL),
   NumberOfPieces(-1), RequestPiece(-1), NumberOfGhostLevels(-1),
   WriteAllTimeSteps(false), TimeSteps(), CurrentTimeStepIndex(-1)
@@ -150,6 +150,26 @@ bool vtkADIOSWriter::DefineAndWrite(vtkDataObject *input)
       // Before any data can be writen, it's structure must be declared
       this->Define("", data);
 
+      if(this->WriteMode == vtkADIOSWriter::OnChange)
+        {
+        // Set up the index for independently array stepping
+        this->BlockStepIndex.clear();
+        this->BlockStepIndex.resize(this->BlockStepIndexIdMap.size());
+
+        std::vector<ADIOS::ArrayDim> indexDims;
+        indexDims.push_back(ADIOS::ArrayDim(this->BlockStepIndexIdMap.size()));
+        this->Writer->DefineLocalArray<int>("::BlockStepIndex", indexDims);
+
+        // Gather all the block step index id maps to Rank 0
+        std::string BlockStepIndexIdMapAttr = this->GatherBlockStepIdMap();
+
+        if(localProc == 0)
+          {
+          this->Writer->DefineAttribute<std::string>("::BlockStepIndexIdMap",
+            BlockStepIndexIdMapAttr);
+          }
+        }
+
       if(localProc == 0)
         {
         // Global time step is only used by Rank 0
@@ -174,7 +194,14 @@ bool vtkADIOSWriter::DefineAndWrite(vtkDataObject *input)
         }
       }
 
+    std::memset(&*this->BlockStepIndex.begin(), 0xFF,
+      sizeof(vtkTypeInt64)*this->BlockStepIndex.size());
     this->Write("", data);
+
+    if(this->WriteMode == vtkADIOSWriter::OnChange)
+      {
+      this->Writer->WriteArray("::BlockStepIndex", &this->BlockStepIndex[0]);
+      }
     this->Writer->Commit(this->FileName, this->CurrentStep > 0);
     }
   catch(const ADIOS::WriteError &err)
@@ -186,6 +213,64 @@ bool vtkADIOSWriter::DefineAndWrite(vtkDataObject *input)
 }
 
 //----------------------------------------------------------------------------
+std::string vtkADIOSWriter::GatherBlockStepIdMap(void)
+{
+  const int numProcs = this->Controller->GetNumberOfProcesses();
+  const int localProc = this->Controller->GetLocalProcessId();
+
+  // Encode into string containing:
+  // Block0_Id Var0_Id Var0_Name
+  // Block0_Id Var1_Id Var1_Name
+  // ...
+  // BlockN_Id VarM_Id VarM_Name
+  std::stringstream ss;
+  for(NameIdMap::const_iterator i = this->BlockStepIndexIdMap.begin();
+    i != this->BlockStepIndexIdMap.end(); ++i)
+    {
+    ss << localProc << ' ' << i->second << ' ' << i->first << '\n';
+    }
+  std::string sendBuf = ss.str();
+  vtkIdType sendBufLen = sendBuf.length();
+
+  // Gather the variable length buffer sizes
+  vtkIdType *recvLengths = localProc == 0 ? new vtkIdType[numProcs] : NULL;
+  this->Controller->Gather(&sendBufLen, recvLengths, 1, 0);
+
+  // Compute the recieving buffer sizes and offsets
+  vtkIdType fullLength = 0;
+  vtkIdType *recvOffsets = NULL;
+  char *recvBuffer = NULL;
+  if(localProc == 0)
+    {
+    recvOffsets = new vtkIdType[numProcs];
+    for(int p = 0; p < numProcs; ++p)
+      {
+      recvOffsets[p] = fullLength;
+      fullLength += recvLengths[p];
+      }
+    recvBuffer = new char[fullLength];
+    }
+
+  // Gather the index id maps from all processes
+  this->Controller->GatherV(sendBuf.c_str(), recvBuffer, sendBufLen,
+    recvLengths, recvOffsets, 0);
+
+  std::string recv;
+  if(localProc == 0)
+    {
+    // Strip the trailing \n to make null terminated and parse as an std::string
+    recvBuffer[fullLength-1] = '\0';
+    recv = recvBuffer;
+
+    // Cleanup
+    delete[] recvBuffer;
+    delete[] recvOffsets;
+    delete[] recvLengths;
+    }
+  return recv;
+}
+
+//----------------------------------------------------------------------------
 bool vtkADIOSWriter::WriteInternal(void)
 {
   vtkDataObject *input = this->GetInputDataObject(0, 0);
@@ -356,6 +441,11 @@ void vtkADIOSWriter::Define(const std::string& path, const vtkAbstractArray* v)
   this->Writer->DefineLocalArray(path,
     ADIOS::Type::VTKToADIOS(valueTmp->GetDataType()), dims,
     static_cast<ADIOS::Transform>(this->Transform));
+  if(this->WriteMode == vtkADIOSWriter::OnChange)
+    {
+    this->BlockStepIndexIdMap.insert(
+      std::make_pair(path, this->BlockStepIndexIdMap.size()));
+    }
 }
 
 //----------------------------------------------------------------------------
@@ -490,7 +580,7 @@ bool vtkADIOSWriter::UpdateMTimeTable(const std::string path,
   unsigned long mtimePrev = mtimeCurrent;
 
   mtimeCurrent = mtimeNew;
-  return mtimeNew != mtimePrev;
+  return this->WriteMode == vtkADIOSWriter::Always || mtimeNew != mtimePrev;
 }
 
 //----------------------------------------------------------------------------
@@ -512,9 +602,22 @@ void vtkADIOSWriter::Write(const std::string& path, const vtkAbstractArray* v)
   size_t nc = valueTmp->GetNumberOfComponents();
   size_t nt = valueTmp->GetNumberOfTuples();
 
+  // Skip empty arrays
+  //if(nc == 0 || nt == 0)
+  //  {
+  //  return;
+  //  }
+
   this->Writer->WriteScalar<size_t>(path+"#NC", nc);
   this->Writer->WriteScalar<size_t>(path+"#NT", nt);
   this->Writer->WriteArray(path, valueTmp->GetVoidPointer(0));
+
+  if(this->WriteMode == vtkADIOSWriter::OnChange)
+    {
+    this->BlockStepIndex[this->BlockStepIndexIdMap[path]] =
+      (static_cast<vtkTypeInt64>(this->CurrentStep) << 32) |
+      this->Controller->GetLocalProcessId();
+    }
 }
 
 //----------------------------------------------------------------------------
@@ -525,7 +628,7 @@ void vtkADIOSWriter::Write(const std::string& path, const vtkDataArray* v)
 
   if(lut)
     {
-    // Only check the mtime here if a LUT is present.  Otherwise it will be
+    // Only heck the mtime here if a LUT is present.  Otherwise it will be
     // handled apropriately by the abstract array writer
     if(!this->UpdateMTimeTable(path, v))
       {
diff --git a/IO/ADIOS/vtkADIOSWriter.h b/IO/ADIOS/vtkADIOSWriter.h
index 12215b8..5e1174b 100644
--- a/IO/ADIOS/vtkADIOSWriter.h
+++ b/IO/ADIOS/vtkADIOSWriter.h
@@ -95,6 +95,19 @@ public:
   void SetTransformToBZip2() { this->SetTransform(static_cast<int>(ADIOS::Transform_BZLIB2)); }
   void SetTransformToSZip()  { this->SetTransform(static_cast<int>(ADIOS::Transform_SZIP)); }
 
+  enum
+  {
+    Always = 0,
+    OnChange = 1
+  };
+
+  // Description:
+  // Get/Set the write mode for array data
+  vtkGetMacro(WriteMode, int);
+  vtkSetClampMacro(WriteMode, int, Always, OnChange);
+  void SetWriteModeToAlways()   { this->SetWriteMode(Always); }
+  void SetWriteModeToOnChange() { this->SetWriteMode(OnChange); }
+
   //Description:
   //Controls whether writer automatically writes all input time steps, or
   //just the timestep that is currently on the input.
@@ -153,10 +166,15 @@ protected:
   int TransportMethod;
   char *TransportMethodArguments;
   int Transform;
+  int WriteMode;
   int Rank;
   int CurrentStep;
+  typedef std::map<std::string, size_t> NameIdMap;
+  NameIdMap BlockStepIndexIdMap;
+  std::vector<vtkTypeInt64> BlockStepIndex;
   vtkMultiProcessController *Controller;
   ADIOS::Writer *Writer;
+  int BLOCKDEBUG;
 
   vtkADIOSWriter();
   ~vtkADIOSWriter();
@@ -188,6 +206,9 @@ protected:
   bool UpdateMTimeTable(const std::string path, const vtkObject* value);
   std::map<std::string, unsigned long> LastUpdated;
 private:
+  // Synchronize the block step index map across all processes
+  std::string GatherBlockStepIdMap();
+
   bool WriteInternal();
 
   template<typename T>
diff --git a/IO/AMR/vtkAMRBaseReader.cxx b/IO/AMR/vtkAMRBaseReader.cxx
index 7c6c032..a08e4c3 100644
--- a/IO/AMR/vtkAMRBaseReader.cxx
+++ b/IO/AMR/vtkAMRBaseReader.cxx
@@ -366,48 +366,6 @@ void vtkAMRBaseReader::GetAMRData(
 }
 
 //------------------------------------------------------------------------------
-void vtkAMRBaseReader::GetAMRPointData(
-    const int blockIdx, vtkUniformGrid *block, const char *fieldName )
-{
-  assert( "pre: AMR block is NULL" && (block != NULL) );
-  assert( "pre: field name is NULL" && (fieldName != NULL) );
-
-  // If caching is disabled load the data from file
-  if( !this->IsCachingEnabled() )
-    {
-    vtkTimerLog::MarkStartEvent( "GetAMRGridPointDataFromFile" );
-    this->GetAMRGridPointData( blockIdx, block, fieldName );
-    vtkTimerLog::MarkEndEvent( "GetAMRGridPointDataFromFile" );
-    return;
-    }
-
-  // Caching is enabled.
-  // Check the cache to see if the data has already been read.
-  // Otherwise, read it and cache it.
-  if( this->Cache->HasAMRBlockPointData( blockIdx, fieldName ) )
-    {
-    vtkTimerLog::MarkStartEvent( "GetAMRGridPointDataFromCache" );
-    vtkDataArray *data =
-       this->Cache->GetAMRBlockPointData( blockIdx, fieldName );
-    assert( "pre: cached data is NULL!" && (data != NULL) );
-    vtkTimerLog::MarkEndEvent( "GetAMRGridPointDataFromCache" );
-
-    block->GetPointData()->AddArray( data );
-    }
-  else
-    {
-    vtkTimerLog::MarkStartEvent( "GetAMRGridPointDataFromFile" );
-    this->GetAMRGridPointData( blockIdx, block, fieldName );
-    vtkTimerLog::MarkEndEvent( "GetAMRGridPointDataFromFile" );
-
-    vtkTimerLog::MarkStartEvent( "CacheAMRPointData" );
-    this->Cache->InsertAMRBlockPointData(
-        blockIdx, block->GetPointData()->GetArray( fieldName ) );
-    vtkTimerLog::MarkEndEvent( "CacheAMRPointData" );
-    }
-}
-
-//------------------------------------------------------------------------------
 vtkUniformGrid* vtkAMRBaseReader::GetAMRBlock( const int blockIdx )
 {
 
@@ -458,18 +416,10 @@ vtkUniformGrid* vtkAMRBaseReader::GetAMRBlock( const int blockIdx )
 
 //------------------------------------------------------------------------------
 void vtkAMRBaseReader::LoadPointData(
-    const int blockIdx, vtkUniformGrid* block )
+    const int vtkNotUsed(blockIdx), vtkUniformGrid* vtkNotUsed(block) )
 {
-  // Sanity check!
-  assert( "pre: AMR block should not be NULL" && (block != NULL) );
-
-  for( int i=0; i < this->GetNumberOfPointArrays(); ++i )
-    {
-    if( this->GetPointArrayStatus( this->GetPointArrayName( i ) ) )
-      {
-      this->GetAMRPointData( blockIdx, block, this->GetPointArrayName( i ) );
-      }
-    } // END for all point arrays
+  // TODO: implement this
+  //vtkErrorMacro( "Node-centered AMR data are not currently supported" );
 }
 
 //------------------------------------------------------------------------------
diff --git a/IO/AMR/vtkAMRBaseReader.h b/IO/AMR/vtkAMRBaseReader.h
index 8c6f516..b5b5e9f 100644
--- a/IO/AMR/vtkAMRBaseReader.h
+++ b/IO/AMR/vtkAMRBaseReader.h
@@ -145,12 +145,6 @@ protected:
   void GetAMRData(
     const int blockIdx, vtkUniformGrid *block, const char *fieldName );
 
-
-  // Description:
-  // Loads the AMR point data corresponding to the given field name.
-  void GetAMRPointData(
-    const int blockIdx, vtkUniformGrid *block, const char *fieldName );
-
   // Description:
   // A wrapper that loops over point arrays and load the point
   // arrays that are enabled, i.e., selected for the given block.
@@ -205,11 +199,6 @@ protected:
       const int blockIdx, vtkUniformGrid *block, const char *field ) = 0;
 
   // Description:
-  // Loads the block Point data
-  virtual void GetAMRGridPointData(
-      const int blockIdx, vtkUniformGrid *block, const char *field ) = 0;
-
-  // Description:
   // Standard Pipeline methods, subclasses may override this method if needed.
  virtual int RequestData(
       vtkInformation* vtkNotUsed(request),
diff --git a/IO/AMR/vtkAMREnzoReader.h b/IO/AMR/vtkAMREnzoReader.h
index 0e20034..de57d8c 100644
--- a/IO/AMR/vtkAMREnzoReader.h
+++ b/IO/AMR/vtkAMREnzoReader.h
@@ -110,11 +110,6 @@ protected:
       const int blockIdx, vtkUniformGrid *block, const char *field);
 
   // Description:
-  // See vtkAMRBaseReader::GetAMRGridData
-  void GetAMRGridPointData(
-      const int vtkNotUsed(blockIdx), vtkUniformGrid *vtkNotUsed(block), const char *vtkNotUsed(field)) {;};
-
-  // Description:
   // See vtkAMRBaseReader::SetUpDataArraySelections
   void SetUpDataArraySelections();
 
diff --git a/IO/AMR/vtkAMRFlashReader.h b/IO/AMR/vtkAMRFlashReader.h
index de42d0f..5057b09 100644
--- a/IO/AMR/vtkAMRFlashReader.h
+++ b/IO/AMR/vtkAMRFlashReader.h
@@ -72,11 +72,6 @@ protected:
       const int blockIdx, vtkUniformGrid *block, const char *field);
 
   // Description:
-  // See vtkAMRBaseReader::GetAMRGridData
-  void GetAMRGridPointData(
-      const int vtkNotUsed(blockIdx), vtkUniformGrid *vtkNotUsed(block), const char *vtkNotUsed(field)) {;}
-
-  // Description:
   // See vtkAMRBaseReader::SetUpDataArraySelections
   void SetUpDataArraySelections();
 
diff --git a/IO/Core/CMakeLists.txt b/IO/Core/CMakeLists.txt
index 90f6546..2c545d7 100644
--- a/IO/Core/CMakeLists.txt
+++ b/IO/Core/CMakeLists.txt
@@ -17,7 +17,6 @@ SET(Module_SRCS
   vtkTextCodecFactory.cxx
   vtkUTF16TextCodec.cxx
   vtkUTF8TextCodec.cxx
-  vtkAbstractPolyDataReader.cxx
   vtkWriter.cxx
   vtkZLibDataCompressor.cxx
   vtkArrayDataReader.cxx
@@ -31,7 +30,6 @@ set_source_files_properties(
   vtkDataCompressor
   vtkTextCodec
   vtkWriter
-  vtkAbstractPolyDataReader
   ABSTRACT
   )
 
diff --git a/IO/Core/vtkAbstractPolyDataReader.cxx b/IO/Core/vtkAbstractPolyDataReader.cxx
deleted file mode 100644
index cd7c178..0000000
--- a/IO/Core/vtkAbstractPolyDataReader.cxx
+++ /dev/null
@@ -1,33 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkAbstractPolyDataReader.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.
-
-=========================================================================*/
-// .SECTION See Also
-// vtkOBJReader vtkPLYReader vtkSTLReader
-#include "vtkAbstractPolyDataReader.h"
-
-vtkAbstractPolyDataReader::vtkAbstractPolyDataReader()
-  : vtkPolyDataAlgorithm()
-{
-}
-
-vtkAbstractPolyDataReader::~vtkAbstractPolyDataReader()
-{
-}
-
-void vtkAbstractPolyDataReader::PrintSelf(ostream& os, vtkIndent indent)
-{
-  this->Superclass::PrintSelf(os,indent);
-  os << indent << "FileName: " <<
-    (this->FileName ? this->FileName : "NONE") << endl;
-}
diff --git a/IO/Core/vtkAbstractPolyDataReader.h b/IO/Core/vtkAbstractPolyDataReader.h
deleted file mode 100644
index a7af268..0000000
--- a/IO/Core/vtkAbstractPolyDataReader.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkAbstractPolyDataReader.h
-
-  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.
-
-=========================================================================*/
-// .NAME vtkAbstractPolyDataReader - Superclass for algorithms that read
-// models from a file.
-// .SECTION Description
-// This class allows to use a single base class to manage AbstractPolyData
-// reader classes in a uniform manner without needing to know the actual
-// type of the reader.
-// i.e. makes it possible to create maps to associate filename extension
-// and vtkAbstractPolyDataReader object.
-
-// .SECTION See Also
-// vtkOBJReader vtkPLYReader vtkSTLReader
-
-#ifndef vtkAbstractPolyDataReader_h
-#define vtkAbstractPolyDataReader_h
-
-#include "vtkIOCoreModule.h" // For export macro
-#include "vtkPolyDataAlgorithm.h"
-
-class VTKIOCORE_EXPORT vtkAbstractPolyDataReader : public vtkPolyDataAlgorithm
-{
-public:
-  vtkTypeMacro(vtkAbstractPolyDataReader, vtkPolyDataAlgorithm);
-  void PrintSelf(ostream& os, vtkIndent indent);
-
-  // Description:
-  // Specify file name of AbstractPolyData file (obj / ply / stl).
-  vtkSetStringMacro(FileName);
-  vtkGetStringMacro(FileName);
-
-protected:
-  vtkAbstractPolyDataReader();
-  ~vtkAbstractPolyDataReader();
-
-  char *FileName;
-private:
-  vtkAbstractPolyDataReader(const vtkAbstractPolyDataReader&);  // Not implemented.
-  void operator=(const vtkAbstractPolyDataReader&);  // Not implemented.
-};
-
-#endif
diff --git a/IO/Core/vtkSortFileNames.cxx b/IO/Core/vtkSortFileNames.cxx
index afecd89..1a8c483 100644
--- a/IO/Core/vtkSortFileNames.cxx
+++ b/IO/Core/vtkSortFileNames.cxx
@@ -177,8 +177,8 @@ void vtkSortFileNames::GroupFileNames(vtkStringArray *input,
   std::list<unsigned int> ungroupedFiles;
   std::vector<std::string> reducedFileNames;
 
-  vtkIdType numberOfStrings = input->GetNumberOfValues();
-  for (vtkIdType i = 0; i < numberOfStrings; i++)
+  unsigned int numberOfStrings = input->GetNumberOfValues();
+  for (unsigned int i = 0; i < numberOfStrings; i++)
     {
     std::string& fileName = input->GetValue(i);
     extension = vtksys::SystemTools::GetFilenameLastExtension(fileName);
@@ -507,8 +507,8 @@ void vtkSortFileNames::SortFileNames(vtkStringArray *input,
 {
   // convert vtkStringArray into an STL vector
   std::vector<std::string> fileNames;
-  vtkIdType numberOfStrings = input->GetNumberOfValues();
-  for (vtkIdType j = 0; j < numberOfStrings; j++)
+  unsigned int numberOfStrings = input->GetNumberOfValues();
+  for (unsigned int j = 0; j < numberOfStrings; j++)
     {
     std::string& fileName = input->GetValue(j);
 
diff --git a/IO/Core/vtkWriter.cxx b/IO/Core/vtkWriter.cxx
index e58dfd4..47b9fe4 100644
--- a/IO/Core/vtkWriter.cxx
+++ b/IO/Core/vtkWriter.cxx
@@ -74,8 +74,7 @@ int vtkWriter::Write()
   // always write even if the data hasn't changed
   this->Modified();
   this->UpdateWholeExtent();
-
-  return (this->GetErrorCode() == vtkErrorCode::NoError);
+  return 1;
 }
 
 int vtkWriter::ProcessRequest(vtkInformation *request,
diff --git a/IO/EnSight/vtkEnSightMasterServerReader.cxx b/IO/EnSight/vtkEnSightMasterServerReader.cxx
index adde678..606c373 100644
--- a/IO/EnSight/vtkEnSightMasterServerReader.cxx
+++ b/IO/EnSight/vtkEnSightMasterServerReader.cxx
@@ -159,7 +159,7 @@ int vtkEnSightMasterServerReader::DetermineFileName(int piece)
       {
       if ( currentserver == piece )
         {
-        char filename[VTK_MAXPATH] = "";
+        char filename[1024] = "";
         sscanf(result, "casefile: %s", filename);
         if ( filename[0] == 0 )
           {
diff --git a/IO/EnSight/vtkEnSightReader.cxx b/IO/EnSight/vtkEnSightReader.cxx
index 58a6e76..3765663 100644
--- a/IO/EnSight/vtkEnSightReader.cxx
+++ b/IO/EnSight/vtkEnSightReader.cxx
@@ -160,13 +160,6 @@ vtkEnSightReader::~vtkEnSightReader()
 }
 
 //----------------------------------------------------------------------------
-void vtkEnSightReader::ClearForNewCaseFileName()
-{
-  this->UnstructuredPartIds->Reset();
-  vtkGenericEnSightReader::ClearForNewCaseFileName();
-}
-
-//----------------------------------------------------------------------------
 int vtkEnSightReader::RequestData(
   vtkInformation *vtkNotUsed(request),
   vtkInformationVector **vtkNotUsed(inputVector),
@@ -1572,12 +1565,11 @@ int vtkEnSightReader::ReadVariableFiles(vtkMultiBlockDataSet *output)
           fileNum = 1;
           for (j = 1; j < numStepsList->GetNumberOfIds(); j++)
             {
-            int curNumSteps = numStepsList->GetId(j);
-            numSteps += curNumSteps;
+            numSteps += numStepsList->GetId(j);
             if (timeStep > numSteps)
               {
               fileNum++;
-              timeStepInFile -= curNumSteps;
+              timeStepInFile -= numStepsList->GetId(j);
               }
             }
           }
@@ -1717,12 +1709,11 @@ int vtkEnSightReader::ReadVariableFiles(vtkMultiBlockDataSet *output)
           fileNum = 1;
           for (j = 1; j < numStepsList->GetNumberOfIds(); j++)
             {
-            int curNumSteps = numStepsList->GetId(j);
-            numSteps += curNumSteps;
+            numSteps += numStepsList->GetId(j);
             if (timeStep > numSteps)
               {
               fileNum++;
-              timeStepInFile -= curNumSteps;
+              timeStepInFile -= numStepsList->GetId(j);
               }
             }
           }
diff --git a/IO/EnSight/vtkEnSightReader.h b/IO/EnSight/vtkEnSightReader.h
index 5475ac7..fcd4420 100644
--- a/IO/EnSight/vtkEnSightReader.h
+++ b/IO/EnSight/vtkEnSightReader.h
@@ -116,8 +116,6 @@ protected:
                           vtkInformationVector**,
                           vtkInformationVector*);
 
-  virtual void ClearForNewCaseFileName();
-
   // Description:
   // Set the Measured file name.
   vtkSetStringMacro(MeasuredFileName);
diff --git a/IO/EnSight/vtkGenericEnSightReader.cxx b/IO/EnSight/vtkGenericEnSightReader.cxx
index a507d3c..c3ac7df 100644
--- a/IO/EnSight/vtkGenericEnSightReader.cxx
+++ b/IO/EnSight/vtkGenericEnSightReader.cxx
@@ -395,7 +395,10 @@ int vtkGenericEnSightReader::DetermineEnSightVersion(int quiet)
             delete this->IS;
             this->IS = NULL;
 
-            if (!this->GeometryFileName || this->GeometryFileName[0] == '\0')
+            fileName = new char[strlen(this->GeometryFileName) + 1];
+            strcpy(fileName, this->GeometryFileName);
+
+            if (!fileName)
               {
               if (!quiet)
                 {
@@ -404,10 +407,6 @@ int vtkGenericEnSightReader::DetermineEnSightVersion(int quiet)
                 }
               return 0;
               }
-
-            fileName = new char[strlen(this->GeometryFileName) + 1];
-            strcpy(fileName, this->GeometryFileName);
-
             if (strrchr(fileName, '*') != NULL)
               {
               // RE-open case file; find right time set and fill in
@@ -517,10 +516,12 @@ int vtkGenericEnSightReader::DetermineEnSightVersion(int quiet)
             }
           } // geometry file name set
 
+        fileName = new char[strlen(this->GeometryFileName) + 1];
+        strcpy(fileName, this->GeometryFileName);
+
         delete this->IS;
         this->IS = NULL;
-
-        if (!this->GeometryFileName || this->GeometryFileName[0] == '\0')
+        if (!fileName)
           {
           if (!quiet)
             {
@@ -529,10 +530,6 @@ int vtkGenericEnSightReader::DetermineEnSightVersion(int quiet)
             }
           return 0;
           }
-
-        fileName = new char[strlen(this->GeometryFileName) + 1];
-        strcpy(fileName, this->GeometryFileName);
-
         if (strrchr(fileName, '*') != NULL)
           {
           // reopen case file; find right time set and fill in wildcards from
@@ -593,18 +590,15 @@ int vtkGenericEnSightReader::DetermineEnSightVersion(int quiet)
       } // not ensight gold
     } // if we found the format section in the case file
 
-  delete [] fileName;
+  if (fileName)
+    {
+    delete [] fileName;
+    }
 
   return -1;
 }
 
 //----------------------------------------------------------------------------
-void vtkGenericEnSightReader::ClearForNewCaseFileName()
-{
-  this->TranslationTable->PartIdMap.clear();
-}
-
-//----------------------------------------------------------------------------
 void vtkGenericEnSightReader::SetCaseFileName(const char* fileName)
 {
   char *endingSlash;
@@ -616,7 +610,10 @@ void vtkGenericEnSightReader::SetCaseFileName(const char* fileName)
     {
     return;
     }
-  delete [] this->CaseFileName;
+  if (this->CaseFileName)
+    {
+    delete [] this->CaseFileName;
+    }
   if (fileName)
     {
     this->CaseFileName = new char[strlen(fileName)+1];
@@ -627,7 +624,6 @@ void vtkGenericEnSightReader::SetCaseFileName(const char* fileName)
     this->CaseFileName = NULL;
     }
 
-  this->ClearForNewCaseFileName();
   this->Modified();
   if (!this->CaseFileName)
     {
@@ -876,7 +872,10 @@ void vtkGenericEnSightReader::AddVariableDescription(const char* description)
     strcpy(newDescriptionList[i], this->VariableDescriptions[i]);
     delete [] this->VariableDescriptions[i];
     }
-  delete [] this->VariableDescriptions;
+  if (this->VariableDescriptions)
+    {
+    delete [] this->VariableDescriptions;
+    }
 
   // make room for new description
   this->VariableDescriptions = new char *[size+1];
@@ -1476,9 +1475,13 @@ char** vtkGenericEnSightReader::CreateStringArray(int numStrings)
 void vtkGenericEnSightReader::DestroyStringArray(int numStrings,
                                                  char** strings)
 {
-  for(int i=0; i < numStrings; ++i)
+  int i;
+  for(i=0; i < numStrings; ++i)
     {
-    delete [] strings[i];
+    if(strings[i])
+      {
+      delete [] strings[i];
+      }
     }
   delete[] strings;
 }
diff --git a/IO/EnSight/vtkGenericEnSightReader.h b/IO/EnSight/vtkGenericEnSightReader.h
index 127c07f..9e8f13c 100644
--- a/IO/EnSight/vtkGenericEnSightReader.h
+++ b/IO/EnSight/vtkGenericEnSightReader.h
@@ -237,12 +237,6 @@ protected:
                           vtkInformationVector*);
 
   // Description:
-  // Clear data structures such that setting a new case file name works.
-  // WARNING: Derived classes should call the base version after they clear
-  // their own structures.
-  virtual void ClearForNewCaseFileName();
-
-  // Description:
   // Internal function to read in a line up to 256 characters.
   // Returns zero if there was an error.
   int ReadLine(char result[256]);
diff --git a/IO/Exodus/CMakeLists.txt b/IO/Exodus/CMakeLists.txt
index 04f0494..f7ee943 100644
--- a/IO/Exodus/CMakeLists.txt
+++ b/IO/Exodus/CMakeLists.txt
@@ -16,15 +16,9 @@ set_source_files_properties(
   vtkCPExodusIIResultsArrayTemplate
   vtkExodusIIReaderParser
   vtkExodusIIReaderVariableCheck
-  PROPERTIES
-    WRAP_EXCLUDE 1
-  )
 
-set_source_files_properties(
-  vtkExodusIIReaderVariableCheck
-  PROPERTIES
-    SKIP_HEADER_INSTALL 1
-)
+  WRAP_EXCLUDE
+  )
 
 set(vtkIOExodus_HDRS
   vtkCPExodusIINodalCoordinatesTemplate.h
diff --git a/IO/Exodus/Testing/Python/CMakeLists.txt b/IO/Exodus/Testing/Python/CMakeLists.txt
index e3801c0..605a432 100644
--- a/IO/Exodus/Testing/Python/CMakeLists.txt
+++ b/IO/Exodus/Testing/Python/CMakeLists.txt
@@ -1,4 +1,3 @@
 vtk_add_test_python(
   TestExodusPolyhedra.py
-  TestExodusWithNaN.py,NO_RT,NO_VALID
 )
diff --git a/IO/Exodus/Testing/Python/TestExodusWithNaN.py b/IO/Exodus/Testing/Python/TestExodusWithNaN.py
deleted file mode 100755
index d16d4f9..0000000
--- a/IO/Exodus/Testing/Python/TestExodusWithNaN.py
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/usr/bin/env python
-# This test loads an Exodus file with NaNs and we test that the vtkDataArray
-# returns a correct range for the array with NaNs i.e. not including the NaN.
-from vtk import *
-from vtk.util.misc import vtkGetDataRoot
-VTK_DATA_ROOT = vtkGetDataRoot()
-
-rdr = vtkExodusIIReader()
-rdr.SetFileName(str(VTK_DATA_ROOT) + "/Data/cyl_with_NaN.g")
-rdr.UpdateInformation()
-rdr.SetPointResultArrayStatus("dist_from_origin", 1);
-rdr.Update()
-
-data = rdr.GetOutput().GetBlock(0).GetBlock(0)
-
-# Test that this dataset with NaNs gets a correct range i.e. range without NaNs
-# in it.
-drange = data.GetPointData().GetArray("dist_from_origin").GetRange()[:]
-print "'dist_from_origin' Range: ", drange
-assert (abs(drange[0] - 0.5) < 1e-3) and (abs(drange[1] - 1.118) < 1e-3)
diff --git a/IO/Exodus/vtkExodusIIReader.cxx b/IO/Exodus/vtkExodusIIReader.cxx
index d7d8237..855add7 100644
--- a/IO/Exodus/vtkExodusIIReader.cxx
+++ b/IO/Exodus/vtkExodusIIReader.cxx
@@ -1010,23 +1010,13 @@ int vtkExodusIIReaderPrivate::AssembleOutputGlobalArrays(
     }
 
   // Add mode_shape/time_step
-  if (this->HasModeShapes)
     {
     vtkNew<vtkIntArray> dataIndexArray;
     dataIndexArray->SetName("mode_shape");
     dataIndexArray->SetNumberOfComponents(1);
     dataIndexArray->SetNumberOfTuples(1);
-    // mode-shape == (timestep + 1). See vtkExodusIIReader::SetModeShape().
-    dataIndexArray->SetValue(0, (timeStep + 1));
+    dataIndexArray->SetValue(0, timeStep);
     ofieldData->AddArray(dataIndexArray.GetPointer());
-
-    vtkNew<vtkIntArray> modeShapeRange;
-    modeShapeRange->SetName("mode_shape_range");
-    modeShapeRange->SetNumberOfComponents(2);
-    modeShapeRange->SetNumberOfTuples(1);
-    modeShapeRange->SetValue(0, this->Parent->GetModeShapesRange()[0]);
-    modeShapeRange->SetValue(1, this->Parent->GetModeShapesRange()[1]);
-    ofieldData->AddArray(modeShapeRange.GetPointer());
     }
 
   vtkExodusIICacheKey infokey( -1, vtkExodusIIReader::INFO_RECORDS, 0, 0 );
@@ -3070,8 +3060,6 @@ void vtkExodusIIReaderPrivate::DetermineVtkCellType( BlockInfoType& binfo )
     { binfo.CellType=VTK_QUADRATIC_EDGE;           binfo.PointsPerCell = 3; }
   else if ((elemType.substr(0,3) == "EDG") &&      (binfo.BdsPerEntry[0] == 3))
     { binfo.CellType=VTK_QUADRATIC_EDGE;           binfo.PointsPerCell = 3; }
-  else if ((elemType.substr(0,3) == "PYR") &&      (binfo.BdsPerEntry[0] == 13))
-    { binfo.CellType=VTK_QUADRATIC_PYRAMID;        binfo.PointsPerCell = 13; }
 
   // Check for regular elements
   else if (elemType.substr(0,3) == "CIR") { binfo.CellType = VTK_VERTEX;     binfo.PointsPerCell = 1; }
@@ -3099,7 +3087,7 @@ void vtkExodusIIReaderPrivate::DetermineVtkCellType( BlockInfoType& binfo )
     binfo.CellType=VTK_POLY_VERTEX;
     binfo.PointsPerCell = binfo.BdsPerEntry[0];
     }
-  else if ((elemType.substr(0,4) == "NULL") && (binfo.Size == 0))
+  else if ((elemType.substr(0,8) == "NULL") && (binfo.Size == 0))
     {
     (void)binfo; // silently ignore empty element blocks
     }
@@ -6119,29 +6107,26 @@ void vtkExodusIIReader::SetAllArrayStatus( int otyp, int status )
       {
       this->SetAssemblyArrayStatus( i, status );
       }
-    VTK_FALLTHROUGH;
   case PART:
     numObj = this->GetNumberOfPartArrays();
     for ( i = 0; i < numObj; ++i )
       {
       this->SetPartArrayStatus( i, status );
       }
-    VTK_FALLTHROUGH;
   case MATERIAL:
     numObj = this->GetNumberOfMaterialArrays();
     for ( i = 0; i < numObj; ++i )
       {
       this->SetMaterialArrayStatus( i, status );
       }
-    VTK_FALLTHROUGH;
   case HIERARCHY:
     numObj = this->GetNumberOfHierarchyArrays();
     for ( i = 0; i < numObj; ++i )
       {
       this->SetHierarchyArrayStatus( i, status );
       }
-    break;
   default:
+    ;
     break;
     }
 }
@@ -6208,21 +6193,9 @@ bool vtkExodusIIReader::FindXMLFile()
 
 void vtkExodusIIReader::AdvertiseTimeSteps( vtkInformation* outInfo )
 {
-  // This method is called in vtkExodusIIReader::RequestInformation() to update
-  // information about timesteps. Since this gets called after this->Metadata
-  // has processed the file meta-data it's a good place to update iVars that
-  // reflect the meta-data read from the file about timesteps/mode shapes.
-
-  int nTimes = static_cast<int>(this->Metadata->Times.size());
-  this->TimeStepRange[0] = 0;
-  this->TimeStepRange[1] = (nTimes > 0)? (nTimes-1) : 0;
-
-  // Since modeshape range is 1 indexed.
-  this->ModeShapesRange[0] = this->TimeStepRange[0] + 1;
-  this->ModeShapesRange[1] = this->TimeStepRange[1] + 1;
-
   if ( ! this->GetHasModeShapes() )
     {
+    int nTimes = (int) this->Metadata->Times.size();
     double timeRange[2];
     if ( nTimes )
       {
@@ -6230,6 +6203,7 @@ void vtkExodusIIReader::AdvertiseTimeSteps( vtkInformation* outInfo )
       timeRange[1] = this->Metadata->Times[nTimes - 1];
       outInfo->Set( vtkStreamingDemandDrivenPipeline::TIME_STEPS(), &this->Metadata->Times[0], nTimes );
       outInfo->Set( vtkStreamingDemandDrivenPipeline::TIME_RANGE(), timeRange, 2 );
+      this->TimeStepRange[0] = 0; this->TimeStepRange[1] = nTimes - 1;
       }
     }
   else if (this->GetAnimateModeShapes())
@@ -6280,3 +6254,22 @@ void vtkExodusIIReader::ResetCache()
 {
   this->Metadata->ResetCache();
 }
+
+void vtkExodusIIReader::UpdateTimeInformation()
+{
+  if ( this->Metadata->OpenFile( this->FileName ) )
+    {
+    this->Metadata->UpdateTimeInformation();
+
+    if ( ! this->GetHasModeShapes() )
+      {
+      int nTimes = (int) this->Metadata->Times.size();
+      if ( nTimes )
+        {
+        this->TimeStepRange[0] = 0;
+        this->TimeStepRange[1] = nTimes - 1;
+        }
+      }
+    this->Metadata->CloseFile();
+    }
+}
diff --git a/IO/Exodus/vtkExodusIIReader.h b/IO/Exodus/vtkExodusIIReader.h
index f778f6a..d405c01 100644
--- a/IO/Exodus/vtkExodusIIReader.h
+++ b/IO/Exodus/vtkExodusIIReader.h
@@ -95,17 +95,19 @@ public:
     }
 
   // Description:
-  // Since ModeShapes are expected to run from [1,N] rather than [0, N-1],
-  // this method will return the TimeStepRange offset by 1. Note this method
-  // returns the potential mode shapes range irrespective of whether
-  // this->HasModeShapes is set to true.
-  vtkGetVector2Macro(ModeShapesRange, int);
+  // Since ModeShapes are expected to run from [1,N] rather than [0, N],
+  // this method will return the TimeStepRange offset by 1.
+  virtual int* GetModeShapesRange()
+    {
+    this->ModeShapesRange[0] = this->TimeStepRange[0] + 1;
+    this->ModeShapesRange[1] = this->TimeStepRange[1] + 1;
+    return this->ModeShapesRange;
+    }
 
   // Description:
   // Returns the available range of valid integer time steps.
-  // Note this method returns the potential timesteps range irrespective of
-  // whether this->HasModeShapes is set to false.
   vtkGetVector2Macro(TimeStepRange,int);
+  vtkSetVector2Macro(TimeStepRange,int);
 
   // Description:
   // Extra cell data array that can be generated.  By default, this array
@@ -680,6 +682,12 @@ public:
   void SetSqueezePoints(bool sp);
   bool GetSqueezePoints();
 
+
+  // Description:
+  // Re-reads time information from the exodus file and updates
+  // TimeStepRange accordingly.
+  virtual void UpdateTimeInformation();
+
   virtual void Dump();
 
   // Description:
diff --git a/IO/Exodus/vtkExodusIIWriter.cxx b/IO/Exodus/vtkExodusIIWriter.cxx
index 3887860..7195050 100644
--- a/IO/Exodus/vtkExodusIIWriter.cxx
+++ b/IO/Exodus/vtkExodusIIWriter.cxx
@@ -29,8 +29,6 @@
 #include "vtkFieldData.h"
 #include "vtkCompositeDataSet.h"
 #include "vtkCompositeDataIterator.h"
-#include "vtkMultiBlockDataSet.h"
-#include "vtkDataObjectTreeIterator.h"
 #include "vtkUnstructuredGrid.h"
 #include "vtkCellData.h"
 #include "vtkPointData.h"
@@ -437,50 +435,20 @@ void vtkExodusIIWriter::StringUppercase(std::string& str)
 //----------------------------------------------------------------------------
 int vtkExodusIIWriter::FlattenHierarchy (vtkDataObject* input, bool& changed)
 {
-  if (input->IsA ("vtkMultiBlockDataSet"))
-    {
-    vtkMultiBlockDataSet* castObj = vtkMultiBlockDataSet::SafeDownCast(input);
-    vtkSmartPointer<vtkDataObjectTreeIterator> iter;
-    iter.TakeReference (castObj->NewTreeIterator ());
-    iter->VisitOnlyLeavesOff ();
-    iter->TraverseSubTreeOff ();
-    iter->SkipEmptyNodesOff ();
-    for (iter->InitTraversal ();
-         !iter->IsDoneWithTraversal ();
-         iter->GoToNextItem ())
-      {
-      const char *name = iter->GetCurrentMetaData()->Get (vtkCompositeDataSet::NAME());
-      if (strstr (name, "Sets") != 0)
-        {
-        continue;
-        }
-      if (iter->GetCurrentDataObject () && !this->FlattenHierarchy (iter->GetCurrentDataObject (), changed))
-        {
-        return 0;
-        }
-      }
-    }
-  else if (input->IsA ("vtkCompositeDataSet"))
+  if (input->IsA ("vtkCompositeDataSet"))
     {
     vtkCompositeDataSet* castObj = vtkCompositeDataSet::SafeDownCast(input);
-    vtkSmartPointer<vtkCompositeDataIterator> iter;
-    iter.TakeReference (castObj->NewIterator ());
-    vtkDataObjectTreeIterator* treeIter = vtkDataObjectTreeIterator::SafeDownCast (castObj);
-    if (treeIter)
-      {
-      treeIter->VisitOnlyLeavesOff ();
-      treeIter->TraverseSubTreeOff ();
-      treeIter->SkipEmptyNodesOff ();
-      }
+    vtkCompositeDataIterator* iter = castObj->NewIterator ();
     for (iter->InitTraversal ();
          !iter->IsDoneWithTraversal ();
          iter->GoToNextItem ())
       {
-      if (iter->GetCurrentDataObject () && !this->FlattenHierarchy (iter->GetCurrentDataObject (), changed))
+      if (!this->FlattenHierarchy (iter->GetCurrentDataObject (), changed))
         {
         return 0;
         }
       }
+    iter->Delete ();
     }
   else if (input->IsA ("vtkDataSet"))
     {
@@ -494,7 +462,6 @@ int vtkExodusIIWriter::FlattenHierarchy (vtkDataObject* input, bool& changed)
       {
       vtkDataSet* castObj = vtkDataSet::SafeDownCast (input);
 
-      output->GetFieldData ()->ShallowCopy (castObj->GetFieldData ());
       output->GetPointData ()->ShallowCopy (castObj->GetPointData ());
       output->GetCellData ()->ShallowCopy (castObj->GetCellData ());
 
@@ -565,7 +532,7 @@ int vtkExodusIIWriter::CreateNewExodusFile()
       }
     else
       {
-      char *myFileName = new char [VTK_MAXPATH];
+      char *myFileName = new char [1024];
       sprintf(myFileName, "%s_%06d", this->FileName, this->CurrentTimeIndex);
       this->fid = ex_create(myFileName, EX_CLOBBER, &compWordSize, &IOWordSize);
       if (fid <= 0)
@@ -579,7 +546,7 @@ int vtkExodusIIWriter::CreateNewExodusFile()
     }
   else
     {
-    char *myFileName = new char [VTK_MAXPATH];
+    char *myFileName = new char [1024];
     if (this->CurrentTimeIndex == 0)
       {
       sprintf(myFileName, "%s.%d.%d", this->FileName, this->NumberOfProcesses, this->MyRank);
@@ -677,7 +644,7 @@ void vtkExodusIIWriter::RemoveGhostCells()
 {
   for (size_t i = 0; i < this->FlattenedInput.size (); i ++)
     {
-    vtkUnsignedCharArray *da = this->FlattenedInput[i]->GetCellGhostArray();
+    vtkDataArray *da = this->FlattenedInput[i]->GetCellData()->GetArray("vtkGhostLevels");
 
     if (da)
       {
@@ -685,15 +652,15 @@ void vtkExodusIIWriter::RemoveGhostCells()
       t->SetInputData(this->FlattenedInput[i]);
       t->ThresholdByLower(0);
       t->SetInputArrayToProcess(
-        0, 0, 0, vtkDataObject::FIELD_ASSOCIATION_CELLS, vtkDataSetAttributes::GhostArrayName());
+        0, 0, 0, vtkDataObject::FIELD_ASSOCIATION_CELLS, "vtkGhostLevels");
 
       t->Update();
 
       this->FlattenedInput[i] = vtkSmartPointer<vtkUnstructuredGrid>(t->GetOutput());
       t->Delete();
 
-      this->FlattenedInput[i]->GetCellData()->RemoveArray(vtkDataSetAttributes::GhostArrayName());
-      this->FlattenedInput[i]->GetPointData()->RemoveArray(vtkDataSetAttributes::GhostArrayName());
+      this->FlattenedInput[i]->GetCellData()->RemoveArray("vtkGhostLevels");
+      this->FlattenedInput[i]->GetPointData()->RemoveArray("vtkGhostLevels");
 
       this->GhostLevel = 1;
       }
@@ -813,7 +780,7 @@ int vtkExodusIIWriter::CheckInputArrays ()
 
     // Trying to find global element id
     vtkDataArray *da = cd->GetGlobalIds();
-    if (da)
+    if (this->WriteOutGlobalElementIdArray && da)
       {
       vtkIdTypeArray *ia = vtkIdTypeArray::SafeDownCast(da);
       if (!ia)
@@ -984,9 +951,9 @@ int vtkExodusIIWriter::ConstructVariableInfoMaps ()
     for (int j = 0; j < fd->GetNumberOfArrays (); j ++)
       {
       char *name = 0;
-      if (fd->GetAbstractArray(j))
+      if (fd->GetArray(j))
         {
-        name = fd->GetAbstractArray(j)->GetName();
+        name = fd->GetArray(j)->GetName();
         }
       if (name == 0)
         {
@@ -995,10 +962,6 @@ int vtkExodusIIWriter::ConstructVariableInfoMaps ()
         }
       std::string upper (name);
       this->StringUppercase(upper);
-      if (strncmp(upper.c_str (),"TITLE",5) == 0)
-        {
-        continue;
-        }
       if (strncmp(upper.c_str (),"QA_RECORD",9) == 0)
         {
         continue;
@@ -1011,7 +974,7 @@ int vtkExodusIIWriter::ConstructVariableInfoMaps ()
         {
         continue;
         }
-      int numComp = fd->GetAbstractArray(j)->GetNumberOfComponents ();
+      int numComp = fd->GetArray(j)->GetNumberOfComponents ();
       std::map<std::string, VariableInfo>::const_iterator iter =
         this->GlobalVariableMap.find (name);
       if (iter == this->GlobalVariableMap.end ())
@@ -1209,8 +1172,6 @@ int vtkExodusIIWriter::CreateDefaultMetadata ()
     {
     return 0;
     }
-
-  this->CreateSetsMetadata(em);
   this->SetModelMetadata(em);
   em->Delete();
 
@@ -1434,167 +1395,6 @@ int vtkExodusIIWriter::CreateBlockVariableMetadata (vtkModelMetadata *em)
   return 1;
 }
 
-int vtkExodusIIWriter::CreateSetsMetadata (vtkModelMetadata* em)
-{
-  bool isASideSet = false;
-  bool isANodeSet = false;
-
-  if (this->OriginalInput->IsA ("vtkMultiBlockDataSet"))
-    {
-    int numNodeSets = 0;
-    int sumNodes = 0;
-    vtkSmartPointer<vtkIntArray> nodeSetIds = vtkSmartPointer<vtkIntArray>::New ();
-    vtkSmartPointer<vtkIntArray> nodeSetSizes = vtkSmartPointer<vtkIntArray>::New ();
-    vtkSmartPointer<vtkIntArray> nodeSetNumDF = vtkSmartPointer<vtkIntArray>::New ();
-    vtkSmartPointer<vtkIntArray> nodeIds = vtkSmartPointer<vtkIntArray>::New ();
-    int numSideSets = 0;
-    int sumSides = 0;
-    vtkSmartPointer<vtkIntArray> sideSetIds = vtkSmartPointer<vtkIntArray>::New ();
-    vtkSmartPointer<vtkIntArray> sideSetSizes = vtkSmartPointer<vtkIntArray>::New ();
-    vtkSmartPointer<vtkIntArray> sideSetNumDF = vtkSmartPointer<vtkIntArray>::New ();
-    vtkSmartPointer<vtkIntArray> sideSetElementList = vtkSmartPointer<vtkIntArray>::New ();
-    vtkSmartPointer<vtkIntArray> sideSetSideList = vtkSmartPointer<vtkIntArray>::New ();
-
-    vtkMultiBlockDataSet* castObj = vtkMultiBlockDataSet::SafeDownCast(this->OriginalInput);
-    vtkSmartPointer<vtkDataObjectTreeIterator> iter;
-    iter.TakeReference (castObj->NewTreeIterator ());
-    iter->VisitOnlyLeavesOff ();
-    iter->TraverseSubTreeOn ();
-    for (iter->InitTraversal ();
-         !iter->IsDoneWithTraversal ();
-         iter->GoToNextItem ())
-      {
-      const char *name = iter->GetCurrentMetaData()->Get (vtkCompositeDataSet::NAME());
-      if (iter->GetCurrentDataObject ()->IsA ("vtkMultiBlockDataSet"))
-        {
-        isASideSet = (strncmp (name, "Side Sets", 9) == 0);
-        isANodeSet = (strncmp (name, "Node Sets", 9) == 0);
-        }
-      else if (isANodeSet)
-        {
-        numNodeSets ++;
-        const char* id_str = strstr (name, "ID:");
-        id_str += 3;
-        int id = atoi (id_str);
-        nodeSetIds->InsertNextTuple1 (id);
-        vtkUnstructuredGrid* grid = vtkUnstructuredGrid::SafeDownCast (iter->GetCurrentDataObject ());
-        vtkFieldData* field = grid->GetPointData ();
-        vtkIdTypeArray* globalIds = vtkIdTypeArray::SafeDownCast (field ? field->GetArray ("GlobalNodeId") : 0);
-        if (globalIds)
-          {
-          int size = 0;
-          for (int c = 0; c < grid->GetNumberOfCells (); c ++)
-            {
-            vtkCell* cell = grid->GetCell (c);
-            for (int p = 0; p < cell->GetNumberOfPoints (); p ++)
-              {
-              size ++;
-              vtkIdType pointId = cell->GetPointId (p);
-              vtkIdType gid = globalIds->GetValue (pointId);
-              nodeIds->InsertNextTuple1 (gid);
-              // TODO implement distribution factors
-              nodeSetNumDF->InsertNextTuple1 (0);
-              }
-            }
-          nodeSetSizes->InsertNextTuple1 (size);
-          sumNodes += size;
-          }
-        else
-          {
-          vtkErrorMacro ("We have a node set, but it doesn't have GlobalNodeIDs");
-          }
-        }
-      else if (isASideSet)
-        {
-        numSideSets ++;
-        const char* id_str = strstr (name, "ID:");
-        id_str += 3;
-        int id = atoi (id_str);
-        sideSetIds->InsertNextTuple1 (id);
-        vtkUnstructuredGrid* grid = vtkUnstructuredGrid::SafeDownCast (iter->GetCurrentDataObject ());
-        vtkFieldData* field = grid->GetCellData ();
-        vtkIdTypeArray* sourceElement = vtkIdTypeArray::SafeDownCast (field ? field->GetArray ("SourceElementId") : 0);
-        vtkIntArray* sourceSide = vtkIntArray::SafeDownCast (field ? field->GetArray ("SourceElementSide") : 0);
-        if (sourceElement && sourceSide)
-          {
-          int cells = grid->GetNumberOfCells ();
-          for (int c = 0; c < cells; c ++)
-            {
-            sideSetElementList->InsertNextTuple1 (sourceElement->GetValue (c) + 1);
-            switch (GetElementType (sourceElement->GetValue (c) + 1))
-              {
-              case VTK_WEDGE:
-                {
-                int wedgeMapping[5] = {3, 4, 0, 1, 2};
-                sideSetSideList->InsertNextTuple1 (wedgeMapping[sourceSide->GetValue (c)] + 1);
-                break;
-                }
-              case VTK_HEXAHEDRON:
-                {
-                int hexMapping[6] = {3, 1, 0, 2, 4, 5};
-                sideSetSideList->InsertNextTuple1 (hexMapping[sourceSide->GetValue (c)] + 1);
-                break;
-                }
-              default:
-                sideSetSideList->InsertNextTuple1 (sourceSide->GetValue (c) + 1);
-              }
-            // TODO implement distribution factors
-            sideSetNumDF->InsertNextTuple1 (0);
-            }
-          sideSetSizes->InsertNextTuple1 (cells);
-          sumSides += cells;
-          }
-        else
-          {
-          vtkErrorMacro ("We have a side set, but it doesn't have SourceElementId or SourceElementSide");
-          }
-        }
-      }
-
-    em->SetNumberOfNodeSets (numNodeSets);
-    em->SetSumNodesPerNodeSet (sumNodes);
-
-    int *nodeSetIds_a = new int[nodeSetIds->GetNumberOfTuples ()];
-    memcpy (nodeSetIds_a, nodeSetIds->GetPointer (0), nodeSetIds->GetNumberOfTuples () * sizeof(int));
-    em->SetNodeSetIds (nodeSetIds_a);
-
-    int *nodeSetSizes_a = new int[nodeSetSizes->GetNumberOfTuples ()];
-    memcpy (nodeSetSizes_a, nodeSetSizes->GetPointer (0), nodeSetSizes->GetNumberOfTuples () * sizeof(int));
-    em->SetNodeSetSize (nodeSetSizes_a);
-
-    int *nodeSetNumDF_a = new int[nodeSetNumDF->GetNumberOfTuples ()];
-    memcpy (nodeSetNumDF_a, nodeSetNumDF->GetPointer (0), nodeSetNumDF->GetNumberOfTuples () * sizeof(int));
-    em->SetNodeSetNumberOfDistributionFactors (nodeSetNumDF_a);
-
-    int *nodeIds_a = new int[nodeIds->GetNumberOfTuples ()];
-    memcpy (nodeIds_a, nodeIds->GetPointer (0), nodeIds->GetNumberOfTuples() * sizeof(int));
-    em->SetNodeSetNodeIdList (nodeIds_a);
-
-    em->SetNumberOfSideSets (numSideSets);
-    em->SetSumSidesPerSideSet (sumSides);
-
-    int *sideSetIds_a = new int[sideSetIds->GetNumberOfTuples ()];
-    memcpy (sideSetIds_a, sideSetIds->GetPointer (0), sideSetIds->GetNumberOfTuples() * sizeof(int));
-    em->SetSideSetIds (sideSetIds_a);
-
-    int *sideSetSizes_a = new int[sideSetSizes->GetNumberOfTuples ()];
-    memcpy (sideSetSizes_a, sideSetSizes->GetPointer (0), sideSetSizes->GetNumberOfTuples() * sizeof(int));
-    em->SetSideSetSize (sideSetSizes_a);
-
-    int *sideSetNumDF_a = new int[sideSetNumDF->GetNumberOfTuples ()];
-    memcpy (sideSetNumDF_a, sideSetNumDF->GetPointer (0), sideSetNumDF->GetNumberOfTuples() * sizeof(int));
-    em->SetSideSetNumDFPerSide (sideSetNumDF_a);
-
-    int *sideSetElementList_a = new int[sideSetElementList->GetNumberOfTuples ()];
-    memcpy (sideSetElementList_a, sideSetElementList->GetPointer (0), sideSetElementList->GetNumberOfTuples() * sizeof(int));
-    em->SetSideSetElementList (sideSetElementList_a);
-
-    int *sideSetSideList_a = new int[sideSetSideList->GetNumberOfTuples ()];
-    memcpy (sideSetSideList_a, sideSetSideList->GetPointer (0), sideSetSideList->GetNumberOfTuples() * sizeof(int));
-    em->SetSideSetSideList (sideSetSideList_a);
-    }
-  return 1;
-}
 
 //----------------------------------------------------------------------------
 int vtkExodusIIWriter::ParseMetadata ()
@@ -1978,7 +1778,7 @@ int vtkExodusIIWriter::WriteBlockInformation()
   for (size_t n = 0; n < nblocks; n ++)
     {
     delete [] connectivity[n];
-    if (this->PassDoubles)
+    if (this->PassDoubles && attributesD[n])
       {
       delete [] attributesD[n];
       }
@@ -2444,13 +2244,12 @@ int vtkExodusIIWriter::WriteNodeSetInformation()
 
   int *emNsSize = em->GetNodeSetSize();
   int *emNumDF = em->GetNodeSetNumberOfDistributionFactors();
+  int *emIdIdx = em->GetNodeSetNodeIdListIndex();
+  int *emDFIdx = em->GetNodeSetDistributionFactorIndex();
 
   int nextId = 0;
   int nextDF = 0;
 
-  int *ids = em->GetNodeSetNodeIdList();
-  float *df = em->GetNodeSetDistributionFactors();
-
   for (i=0; i<nnsets; i++)
     {
     nsSize[i] = 0;
@@ -2459,32 +2258,35 @@ int vtkExodusIIWriter::WriteNodeSetInformation()
     nsIdIdx[i] = nextId;
     nsDFIdx[i] = nextDF;
 
+    int *ids = em->GetNodeSetNodeIdList() + emIdIdx[i];
+    float *df = em->GetNodeSetDistributionFactors() + emDFIdx[i];
+
     for (j=0; j< emNsSize[i]; j++)
       {
-      int lid = this->GetNodeLocalId(*ids);
-      ids ++;
+      // Have to check if this node is still in the ugrid.
+      // It may have been deleted since the ExodusModel was created.
+
+      int lid = this->GetNodeLocalId(ids[j]);
 
       if (lid < 0) continue;
 
       nsSize[i]++;
       idBuf[nextId++] = lid + 1;
 
-      if (*emNumDF > 0)
+      if (emNumDF[i] > 0)
         {
         nsNumDF[i]++;
 
         if (this->PassDoubles)
           {
-          dfBufD[nextDF++] = (double)*df;
+          dfBufD[nextDF++] = (double)df[j];
           }
         else
           {
-          dfBuf[nextDF++] = *df;
+          dfBuf[nextDF++] = df[j];
           }
         }
       }
-      df ++;
-      emNumDF ++;
     }
 
   if (this->PassDoubles)
@@ -2543,26 +2345,6 @@ vtkIdType vtkExodusIIWriter::GetElementLocalId(vtkIdType id)
     }
 }
 
-int vtkExodusIIWriter::GetElementType(vtkIdType id)
-{
-  for (size_t i = 0; i < this->FlattenedInput.size (); i ++)
-    {
-    if (this->GlobalElementIdList[i])
-      {
-      vtkIdType ncells = this->FlattenedInput[i]->GetNumberOfCells();
-      for (vtkIdType j=0; j<ncells; j++)
-        {
-        vtkIdType gid = this->GlobalElementIdList[i][j];
-        if (gid == id)
-          {
-          return this->FlattenedInput[i]->GetCellType (j);
-          }
-        }
-      }
-    }
-  return -1;
-}
-
 //-----------------------------------------------------------------------
 int vtkExodusIIWriter::WriteSideSetInformation()
 {
@@ -2622,15 +2404,12 @@ int vtkExodusIIWriter::WriteSideSetInformation()
     }
 
   int *emSsSize = em->GetSideSetSize();
+  int *emIdIdx = em->GetSideSetListIndex();
   int *emDFIdx = em->GetSideSetDistributionFactorIndex();
 
   int nextId = 0;
   int nextDF = 0;
 
-  int *ids = em->GetSideSetElementList();
-  int *sides = em->GetSideSetSideList();
-  int *numDFPerSide = em->GetSideSetNumDFPerSide();
-
   for (i=0; i<nssets; i++)
     {
     ssSize[i] = 0;
@@ -2641,6 +2420,10 @@ int vtkExodusIIWriter::WriteSideSetInformation()
 
     if (emSsSize[i] == 0) continue;
 
+    int *ids = em->GetSideSetElementList() + emIdIdx[i];
+    int *sides = em->GetSideSetSideList() + emIdIdx[i];
+
+    int *numDFPerSide = em->GetSideSetNumDFPerSide() + emIdIdx[i];
     float *df = NULL;
 
     if (ndf > 0)
@@ -2653,33 +2436,31 @@ int vtkExodusIIWriter::WriteSideSetInformation()
       // Have to check if this element is still in the ugrid.
       // It may have been deleted since the ExodusModel was created.
 
-      int lid = this->GetElementLocalId(*ids);
-      ids ++;
+      int lid = this->GetElementLocalId(ids[j]);
 
       if (lid >= 0)
         {
         ssSize[i]++;
 
         idBuf[nextId] = lid+1;
-        sideBuf[nextId] = *sides;
-        sides ++;
+        sideBuf[nextId] = sides[j];
 
         nextId++;
 
-        if (*numDFPerSide > 0)
+        if (numDFPerSide[j] > 0)
           {
-          ssNumDF[i] += *numDFPerSide;
+          ssNumDF[i] += numDFPerSide[j];
 
           if (this->PassDoubles)
             {
-            for (k=0; k < *numDFPerSide; k++)
+            for (k=0; k < numDFPerSide[j]; k++)
               {
               dfBufD[nextDF++] = (double)df[k];
               }
             }
           else
             {
-            for (k=0; k < *numDFPerSide; k++)
+            for (k=0; k < numDFPerSide[j]; k++)
               {
               dfBuf[nextDF++] = df[k];
               }
@@ -2687,8 +2468,7 @@ int vtkExodusIIWriter::WriteSideSetInformation()
           }
         }
 
-      if (df) df += *numDFPerSide;
-      numDFPerSide ++;
+      if (df) df += numDFPerSide[j];
       }
     }
 
diff --git a/IO/Exodus/vtkExodusIIWriter.h b/IO/Exodus/vtkExodusIIWriter.h
index 56b8aed..be8fdfc 100644
--- a/IO/Exodus/vtkExodusIIWriter.h
+++ b/IO/Exodus/vtkExodusIIWriter.h
@@ -306,7 +306,6 @@ protected:
 
   int CreateBlockIdMetadata(vtkModelMetadata *em);
   int CreateBlockVariableMetadata (vtkModelMetadata* em);
-  int CreateSetsMetadata (vtkModelMetadata* em);
 
 //BTX
   void ConvertVariableNames (std::map<std::string, VariableInfo>& variableMap);
@@ -322,7 +321,6 @@ protected:
 //ETX
   vtkIdType GetNodeLocalId(vtkIdType id);
   vtkIdType GetElementLocalId(vtkIdType id);
-  int GetElementType(vtkIdType id);
 
   int WriteInitializationParameters ();
   int WriteInformationRecords ();
diff --git a/IO/Exodus/vtkModelMetadata.cxx b/IO/Exodus/vtkModelMetadata.cxx
index e53b0ea..b9fc0f4 100644
--- a/IO/Exodus/vtkModelMetadata.cxx
+++ b/IO/Exodus/vtkModelMetadata.cxx
@@ -473,24 +473,12 @@ void vtkModelMetadata::SetNodeSetIds(int *n)
 
   this->NodeSetIds = n;
 }
-void vtkModelMetadata::SetNodeSetSize(int *n)
-{
-  FREE(this->NodeSetSize);
-
-  this->NodeSetSize = n;
-}
 void vtkModelMetadata::SetNodeSetNodeIdList(int *n)
 {
   FREE(this->NodeSetNodeIdList);
 
   this->NodeSetNodeIdList = n;
 }
-void vtkModelMetadata::SetNodeSetNumberOfDistributionFactors(int *n)
-{
-  FREE(this->NodeSetNumberOfDistributionFactors);
-
-  this->NodeSetNumberOfDistributionFactors = n;
-}
 void vtkModelMetadata::SetNodeSetDistributionFactors(float *d)
 {
   FREE(this->NodeSetDistributionFactors);
diff --git a/IO/Exodus/vtkModelMetadata.h b/IO/Exodus/vtkModelMetadata.h
index 4e4829c..d9edc88 100644
--- a/IO/Exodus/vtkModelMetadata.h
+++ b/IO/Exodus/vtkModelMetadata.h
@@ -247,7 +247,6 @@ public:
   // Description:
   //   Set or get a pointer to a list of the number of nodes in each node set.
   //   We use your pointer, and free the memory when the object is freed.
-  void SetNodeSetSize(int *);
   int *GetNodeSetSize() const {return this->NodeSetSize;}
 
   // Description:
@@ -264,7 +263,6 @@ public:
   //   nodes in the node set.
   //   Length of list is number of node sets.
   //   We use your pointer, and free the memory when the object is freed.
-  void SetNodeSetNumberOfDistributionFactors(int *);
   int *GetNodeSetNumberOfDistributionFactors() const
     {return this->NodeSetNumberOfDistributionFactors;}
 
@@ -278,7 +276,6 @@ public:
 
   // Description:
   //   Get the total number of nodes in all node sets
-  vtkSetMacro(SumNodesPerNodeSet, int);
   int GetSumNodesPerNodeSet() const {return this->SumNodesPerNodeSet;}
 
   // Description:
@@ -365,7 +362,6 @@ public:
 
   // Description:
   //   Get the total number of sides in all side sets
-  vtkSetMacro(SumSidesPerSideSet, int);
   int GetSumSidesPerSideSet() const {return this->SumSidesPerSideSet;}
 
   // Description:
diff --git a/IO/Export/Testing/Cxx/CMakeLists.txt b/IO/Export/Testing/Cxx/CMakeLists.txt
index 951bf51..196229c 100644
--- a/IO/Export/Testing/Cxx/CMakeLists.txt
+++ b/IO/Export/Testing/Cxx/CMakeLists.txt
@@ -14,66 +14,17 @@ if(VTK_GHOSTSCRIPT_EXECUTABLE AND (VTK_RENDERING_BACKEND STREQUAL "OpenGL"))
     TestGL2PSLabeledDataMapper.cxx
     TestLinePlotGL2PS.cxx
     TestStackedPlotGL2PS.cxx
-          )
+  )
 endif()
 
 vtk_add_test_cxx(${vtk-module}CxxTests tests
   X3DTest.cxx,NO_DATA,NO_VALID
   ${GL2PSTests}
-  TestRIBExporter.cxx,NO_VALID
-  UnitTestRIB.cxx,NO_DATA,NO_VALID
   )
 vtk_test_cxx_executable(${vtk-module}CxxTests tests
   RENDERING_FACTORY
   )
 
-# See if Pixar's Renderman is available
-find_path(RMANTREE bin/prman HINTS
-          /Applications/Pixar/RenderManProServer-19.0
-          /opt/pixar/RenderManProServer-19.0
-)
-
-# Tests to run if Renderman is present
-if(RMANTREE)
-  # write a Renderman ini file to specify the shaderpath
-  write_file(${${vtk-module}_BINARY_DIR}/Testing/Cxx/rendermn.ini
-          "/shaderpath &:${${vtk-module}_SOURCE_DIR}/Testing/Cxx")
-  add_test(NAME ${vtk-module}-RIBExporterShaderCompile
-          COMMAND ${RMANTREE}/bin/shader
-          ${${vtk-module}_SOURCE_DIR}/Testing/Data/Input/bozo.sl
-          ${${vtk-module}_SOURCE_DIR}/Testing/Data/Input/dented.sl
-          WORKING_DIRECTORY ${${vtk-module}_BINARY_DIR}/Testing/Cxx
-  )
-  add_test(NAME ${vtk-module}-RIBExporterPrman
-          COMMAND ${RMANTREE}/bin/prman
-            ${VTK_TEST_OUTPUT_DIR}/TestRIBExporter.rib
-          WORKING_DIRECTORY ${${vtk-module}_BINARY_DIR}/Testing/Cxx
-  )
-  # Image diff rman generated tif with baseline
-  set(baseline_dir ${${vtk-module}_SOURCE_DIR}/Testing/Data/Baseline)
-  ExternalData_add_test(VTKData
-        NAME ${vtk-module}Cxx-ComparePrmanImage
-        COMMAND ${RMANTREE}/bin/cmptiff -d 100
-        DATA{${baseline_dir}/TestRIBExporter.tif}
-        ${VTK_TEST_OUTPUT_DIR}/TestRIBExporter.tif
-  )
-  set_tests_properties(${vtk-module}-RIBExporterPrman
-        PROPERTIES
-        DEPENDS
-        "${vtk-module}-TestRIBExporter"
-        DEPENDS
-        "${vtk-module}-RIBExporterShaderCompile"
-        ENVIRONMENT
-        "RMANTREE=${RMANTREE}"
-  )
-  set_tests_properties("${vtk-module}Cxx-ComparePrmanImage"
-        PROPERTIES
-        DEPENDS "${vtk-module}Cxx-TestRIBExporter"
-        REQUIRED_FILES
-          "${VTK_TEST_OUTPUT_DIR}/TestRIBExporter.tif"
-  )
-endif()
-
 # The GL2PS tests produce postscript output, which cannot be compared using
 # the built-in image regression framework. The tests added above will create the
 # postscript, while the following tests will convert the postscript to a PNG and
diff --git a/IO/Export/Testing/Cxx/TestRIBExporter.cxx b/IO/Export/Testing/Cxx/TestRIBExporter.cxx
deleted file mode 100644
index c4b434e..0000000
--- a/IO/Export/Testing/Cxx/TestRIBExporter.cxx
+++ /dev/null
@@ -1,328 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    UnitTestRIB.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 "vtkSmartPointer.h"
-
-#include "vtkTestUtilities.h"
-#include "vtkNamedColors.h"
-#include "vtkRenderWindow.h"
-#include "vtkRenderer.h"
-#include "vtkRenderWindowInteractor.h"
-#include "vtkTexture.h"
-#include "vtkPNMReader.h"
-#include "vtkSphereSource.h"
-#include "vtkTexturedSphereSource.h"
-#include "vtkPolyDataMapper.h"
-#include "vtkActor.h"
-#include "vtkCamera.h"
-#include "vtkRIBExporter.h"
-#include "vtkRIBProperty.h"
-
-static vtkSmartPointer<vtkRIBProperty> cloth(const char *freq,
-                                             const char *depth);
-static vtkSmartPointer<vtkRIBProperty> dented(const char *Km);
-static vtkSmartPointer<vtkRIBProperty> stippled(const char *grainsize,
-                                                const char *stippling);
-static vtkSmartPointer<vtkRIBProperty> spatter(const char *sizes,
-                                               const char *specksize,
-                                               const char *spattercolor,
-                                               const char *basecolor);
-static vtkSmartPointer<vtkRIBProperty> cmarble(const char *veining);
-static vtkSmartPointer<vtkRIBProperty> stone(const char *scale,
-                                             const char *nshades,
-                                             const char *exponent,
-                                             const char *graincolor);
-static vtkSmartPointer<vtkRIBProperty> wood(const char *grain,
-                                            const char *swirl,
-                                            const char *swirlfreq);
-static vtkSmartPointer<vtkRIBProperty> bozo(const char *k);
-
-int TestRIBExporter (int argc, char *argv[])
-{
-  const char *_prefix = vtkTestUtilities::GetArgOrEnvOrDefault(
-    "-T", argc, argv, "VTK_TEMP_DIR", "Testing/Temporary");
-  std::string prefix = _prefix;
-  delete []_prefix;
-
-  if (prefix == "")
-    {
-    std::cout << argv[0] << " Could not determine temporary directory.\n";
-    return EXIT_FAILURE;
-    }
-  prefix += "/TestRIBExporter";
-
-  vtkSmartPointer<vtkRenderWindow> renWin =
-    vtkSmartPointer<vtkRenderWindow>::New ();
-  vtkSmartPointer<vtkRenderer> ren1 =
-    vtkSmartPointer<vtkRenderer>::New ();
-  vtkSmartPointer<vtkRenderWindowInteractor> iren =
-    vtkSmartPointer<vtkRenderWindowInteractor>::New ();
-
-  char *textureFile = vtkTestUtilities::ExpandDataFileName(argc, argv, "Data/earth.ppm");
-  vtkSmartPointer<vtkPNMReader> textureReader =
-    vtkSmartPointer<vtkPNMReader>::New ();
-  textureReader->SetFileName(textureFile);
-  delete []textureFile;
-
-  vtkSmartPointer<vtkTexturedSphereSource> texturedSphere =
-    vtkSmartPointer<vtkTexturedSphereSource>::New ();
-  texturedSphere->SetPhiResolution(20);
-  texturedSphere->SetThetaResolution(20);
-
-  vtkSmartPointer<vtkTexture> texture =
-    vtkSmartPointer<vtkTexture>::New ();
-  texture->SetInputConnection(textureReader->GetOutputPort());
-
-  vtkSmartPointer<vtkPolyDataMapper>  texturedSphereMapper =
-    vtkSmartPointer<vtkPolyDataMapper>::New ();
-  texturedSphereMapper->SetInputConnection(texturedSphere->GetOutputPort());
-
-  vtkSmartPointer<vtkSphereSource> sphere =
-    vtkSmartPointer<vtkSphereSource>::New ();
-  sphere->SetPhiResolution(20);
-  sphere->SetThetaResolution(20);
-
-  vtkSmartPointer<vtkPolyDataMapper>  sphereMapper =
-    vtkSmartPointer<vtkPolyDataMapper>::New ();
-  sphereMapper->SetInputConnection(sphere->GetOutputPort());
-
-  vtkSmartPointer<vtkActor> sphere1 =
-    vtkSmartPointer<vtkActor>::New ();
-  sphere1->SetMapper(sphereMapper);
-  sphere1->SetPosition( -1.5, 1.5, 0);
-
-  vtkSmartPointer<vtkActor> sphere2 =
-    vtkSmartPointer<vtkActor>::New ();
-  sphere2->SetMapper(sphereMapper);
-  sphere2->SetPosition( 0, 1.5, 0);
-
-  vtkSmartPointer<vtkActor> sphere3 =
-    vtkSmartPointer<vtkActor>::New ();
-  sphere3->SetMapper(sphereMapper);
-  sphere3->SetPosition(1.5, 1.5, 0);
-
-  vtkSmartPointer<vtkActor> sphere4 =
-    vtkSmartPointer<vtkActor>::New ();
-  sphere4->SetMapper(sphereMapper);
-  sphere4->SetPosition(-1.5, 0, 0);
-
-  vtkSmartPointer<vtkActor> sphere5 =
-    vtkSmartPointer<vtkActor>::New ();
-  sphere5->SetMapper(sphereMapper);
-  sphere5->SetPosition(0, 0, 0);
-
-  vtkSmartPointer<vtkActor> sphere6 =
-    vtkSmartPointer<vtkActor>::New ();
-  sphere6->SetMapper(sphereMapper);
-  sphere6->SetPosition(1.5, 0, 0);
-
-  vtkSmartPointer<vtkActor> sphere7 =
-    vtkSmartPointer<vtkActor>::New ();
-  sphere7->SetMapper(sphereMapper);
-  sphere7->SetPosition(-1.5, -1.5, 0);
-
-  vtkSmartPointer<vtkActor> sphere8 =
-    vtkSmartPointer<vtkActor>::New ();
-  sphere8->SetMapper(sphereMapper);
-  sphere8->SetPosition(0, -1.5, 0);
-
-  vtkSmartPointer<vtkActor> sphere9 =
-    vtkSmartPointer<vtkActor>::New ();
-  sphere9->SetMapper(texturedSphereMapper);
-  sphere9->SetTexture(texture);
-  sphere9->SetPosition(1.5,-1.5, 0);
-  sphere9->SetOrientation(90, 0, 0);
-
-  renWin->AddRenderer(ren1);
-  iren->SetRenderWindow(renWin);
-
-  ren1->AddActor(sphere1);
-  ren1->AddActor(sphere2);
-  ren1->AddActor(sphere3);
-  ren1->AddActor(sphere4);
-  ren1->AddActor(sphere5);
-  ren1->AddActor(sphere6);
-  ren1->AddActor(sphere7);
-  ren1->AddActor(sphere8);
-  ren1->AddActor(sphere9);
-
-  ren1->SetBackground(0.10, 0.2, 0.4);
-  renWin->SetSize(640, 480);
-
-  vtkSmartPointer<vtkNamedColors> colors =
-    vtkSmartPointer<vtkNamedColors>::New();
-  double color[4];
-
-  sphere1->SetProperty(cloth("500", ".02"));
-  colors->GetColor("gold", color);
-  sphere1->GetProperty()->SetDiffuseColor(color);
-
-  sphere2->SetProperty(stippled(".1", "1"));
-  colors->GetColor("ivory", color);
-  sphere2->GetProperty()->SetDiffuseColor(color);
-
-  sphere3->SetProperty(spatter("5", ".5", "0 0 0", "1 1 1"));
-
-  sphere4->SetProperty(cmarble("4"));
-
-  sphere5->SetProperty(stone(".07", "2", "2", ".2 .3 .4"));
-
-  sphere6->SetProperty(wood("5", ".25", "1"));
-  sphere7->SetProperty(bozo("5"));
-
-  sphere8->SetProperty(dented("5"));
-  colors->GetColor("tomato", color);
-  sphere8->GetProperty()->SetDiffuse(.7);
-  sphere8->GetProperty()->SetDiffuseColor(color);
-  sphere8->GetProperty()->SetSpecular(.5);
-  sphere8->GetProperty()->SetSpecularPower(5);
-
-  vtkCamera *cam1 = ren1->GetActiveCamera();
-  ren1->ResetCamera();
-
-  cam1->Zoom(1.5);
-
-  renWin->Render();
-
-  vtkSmartPointer<vtkRIBExporter> aRib =
-    vtkSmartPointer<vtkRIBExporter>::New ();
-  aRib->SetInput(renWin);
-  aRib->SetFilePrefix(prefix.c_str());
-  aRib->SetTexturePrefix(prefix.c_str());
-  aRib->BackgroundOn();
-  aRib->Write();
-
-  return EXIT_SUCCESS;
-}
-
-vtkSmartPointer<vtkRIBProperty> cloth(const char *freq, const char *depth)
-{
-  vtkSmartPointer<vtkRIBProperty> clothProp =
-    vtkSmartPointer<vtkRIBProperty>::New ();
-  clothProp->SetVariable("freq", "float");
-  clothProp->AddVariable("depth", "float");
-
-  clothProp->SetDisplacementShaderParameter("freq", freq);
-  clothProp->AddDisplacementShaderParameter("depth", depth);
-
-  clothProp->SetDisplacementShader("cloth");
-  return clothProp;
-}
-
-vtkSmartPointer<vtkRIBProperty> dented(const char *Km)
-{
-  vtkSmartPointer<vtkRIBProperty> dentedProp =
-    vtkSmartPointer<vtkRIBProperty>::New ();
-  dentedProp->SetVariable("Km", "float");
-  dentedProp->SetDisplacementShaderParameter("Km", Km);
-  dentedProp->SetDisplacementShader("dented");
-  return dentedProp;
-}
-
-vtkSmartPointer<vtkRIBProperty> stippled(const char *grainsize, const char *stippling)
-{
-  vtkSmartPointer<vtkRIBProperty> stippledProp =
-    vtkSmartPointer<vtkRIBProperty>::New ();
-  stippledProp->SetVariable("grainsize", "float");
-  stippledProp->AddVariable("stippling", "float");
-
-  stippledProp->SetSurfaceShaderParameter("grainsize", grainsize);
-  stippledProp->AddSurfaceShaderParameter("stippling", stippling);
-
-  stippledProp->SetSurfaceShader("stippled");
-  return stippledProp;
-}
-
-vtkSmartPointer<vtkRIBProperty> bozo(const char *k)
-{
-  vtkSmartPointer<vtkRIBProperty> bozoProp =
-    vtkSmartPointer<vtkRIBProperty>::New ();
-  bozoProp->SetSurfaceShader("bozo");
-  bozoProp->SetVariable("k", "float");
-  bozoProp->SetSurfaceShaderParameter("k", k);
-
-  return bozoProp;
-}
-
-vtkSmartPointer<vtkRIBProperty> spatter(const char *sizes,
-                                        const char *specksize,
-                                        const char *spattercolor,
-                                        const char *basecolor)
-{
-  vtkSmartPointer<vtkRIBProperty> spatterProp =
-    vtkSmartPointer<vtkRIBProperty>::New ();
-  spatterProp->SetVariable("sizes", "float");
-  spatterProp->AddVariable("specksize", "float");
-  spatterProp->AddVariable("spattercolor", "color");
-  spatterProp->AddVariable("basecolor", "color");
-
-  spatterProp->SetSurfaceShaderParameter("sizes", sizes);
-  spatterProp->AddSurfaceShaderParameter("specksize", specksize);
-  spatterProp->AddSurfaceShaderParameter("spattercolor", spattercolor);
-  spatterProp->AddSurfaceShaderParameter("basecolor", basecolor);
-  spatterProp->SetSurfaceShader("spatter");
-
-  return spatterProp;
-}
-vtkSmartPointer<vtkRIBProperty> cmarble(const char *veining)
-{
-  vtkSmartPointer<vtkRIBProperty> cmarbleProp =
-    vtkSmartPointer<vtkRIBProperty>::New ();
-  cmarbleProp->SetVariable("veining", "float");
-  cmarbleProp->SetSurfaceShaderParameter("veining", veining);
-  cmarbleProp->SetSurfaceShader("cmarble");
-
-  return cmarbleProp;
-}
-vtkSmartPointer<vtkRIBProperty> stone(const char *scale,
-                                      const char *nshades,
-                                      const char *exponent,
-                                      const char *graincolor)
-{
-  vtkSmartPointer<vtkRIBProperty> stoneProp =
-    vtkSmartPointer<vtkRIBProperty>::New ();
-  stoneProp->SetVariable("scale", "float");
-  stoneProp->AddVariable("nshades", "float");
-  stoneProp->AddVariable("exponent", "float");
-  stoneProp->AddVariable("graincolor", "color");
-
-  stoneProp->SetSurfaceShaderParameter("scale", scale);
-  stoneProp->AddSurfaceShaderParameter("nshades", nshades);
-  stoneProp->AddSurfaceShaderParameter("exponent", exponent);
-  stoneProp->AddSurfaceShaderParameter("graincolor", graincolor);
-
-  stoneProp->SetSurfaceShader("stone");
-
-  return stoneProp;
-}
-
-vtkSmartPointer<vtkRIBProperty> wood(const char *grain,
-                                      const char *swirl,
-                                     const char *swirlfreq)
-{
-  vtkSmartPointer<vtkRIBProperty> woodProp =
-    vtkSmartPointer<vtkRIBProperty>::New ();
-  woodProp->SetVariable("grain", "float");
-  woodProp->AddVariable("swirl", "float");
-  woodProp->AddVariable("swirlfreq", "float");
-
-  woodProp->SetSurfaceShaderParameter("grain", grain);
-  woodProp->AddSurfaceShaderParameter("swirl", swirl);
-  woodProp->AddSurfaceShaderParameter("swirlfreq", swirlfreq);
-
-  woodProp->SetSurfaceShader("wood");
-
-  return woodProp;
-}
diff --git a/IO/Export/Testing/Cxx/UnitTestRIB.cxx b/IO/Export/Testing/Cxx/UnitTestRIB.cxx
deleted file mode 100644
index cacf2e4..0000000
--- a/IO/Export/Testing/Cxx/UnitTestRIB.cxx
+++ /dev/null
@@ -1,401 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    UnitTestRIB.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 "vtkSmartPointer.h"
-#include "vtkRIBProperty.h"
-#include "vtkRIBLight.h"
-#include "vtkRIBExporter.h"
-#include "vtkProperty.h"
-
-#include "vtkTestUtilities.h"
-#include "vtkRenderWindow.h"
-#include "vtkRenderer.h"
-#include "vtkSphereSource.h"
-#include "vtkStripper.h"
-#include "vtkPolyDataMapper.h"
-#include "vtkActor.h"
-#include "vtkCamera.h"
-
-#include "vtkTestErrorObserver.h"
-
-#include <sstream>
-
-#define CHECK_ERROR_MSG(msg) \
-  { \
-  std::string expectedMsg(msg); \
-  if (!errorObserver->GetError()) \
-    { \
-    std::cout << "Failed to catch any error. Expected the error message to contain \"" << expectedMsg << "\"" << std::endl; \
-    status++; \
-    } \
-  else \
-    { \
-    std::string gotMsg(errorObserver->GetErrorMessage()); \
-    if (gotMsg.find(expectedMsg) == std::string::npos) \
-      { \
-      std::cout << "Error message does not contain \"" << expectedMsg << "\" got \n\"" << gotMsg << std::endl; \
-      status++; \
-      } \
-    } \
-  } \
-  errorObserver->Clear()
-
-#define CHECK_WARNING_MSG(msg) \
-  { \
-  std::string expectedMsg(msg); \
-  if (!warningObserver->GetWarning()) \
-    { \
-    std::cout << "Failed to catch any warning. Expected the warning message to contain \"" << expectedMsg << "\"" << std::endl; \
-    status++; \
-    } \
-  else \
-    { \
-    std::string gotMsg(warningObserver->GetWarningMessage()); \
-    if (gotMsg.find(expectedMsg) == std::string::npos) \
-      { \
-      std::cout << "Warning message does not contain \"" << expectedMsg << "\" got \n\"" << gotMsg << std::endl; \
-      status++; \
-      } \
-    } \
-  } \
-  warningObserver->Clear()
-
-#define TEST_SET_GET_VALUE( variable, command ) \
-  if( variable != command )   \
-    {   \
-    std::cout << "Error in " << #command << std::endl; \
-    std::cout << "  In " __FILE__ ", line " << __LINE__ << std::endl;   \
-    std::cout << "Expected |" << variable << "|" << std::endl;           \
-    std::cout << "but got  |" << command << "|" << std::endl;            \
-    status += 1; \
-    }
-
-static int TestRIBProperty();
-static int TestRIBLight();
-static int TestRIBExporter();
-
-int UnitTestRIB (int, char *[])
-{
-  int status = 0;
-  status += TestRIBProperty();
-  status += TestRIBLight();
-  status += TestRIBExporter();
-
-  if (status != 0)
-    {
-    return EXIT_FAILURE;
-    }
-  else
-    {
-    return EXIT_SUCCESS;
-    }
-}
-
-int TestRIBProperty()
-{
-  int status = 0;
-  {
-  std::cout << "RIBProperty empty Print..";
-  std::ostringstream propPrint;
-  vtkSmartPointer<vtkRIBProperty> prop =
-    vtkSmartPointer<vtkRIBProperty>::New();
-  prop->Print(propPrint);
-  std::cout << ".PASSED" << std::endl;
-  }
-  {
-  std::cout << "RIBProperty Set/Get..";
-  vtkSmartPointer<vtkRIBProperty> prop =
-    vtkSmartPointer<vtkRIBProperty>::New();
-  prop->SetSurfaceShader("surfaceshader");
-  TEST_SET_GET_VALUE(std::string("surfaceshader"),
-                     std::string(prop->GetSurfaceShader()));
-  prop->SetDisplacementShader("displacementshader");
-  TEST_SET_GET_VALUE(std::string("displacementshader"),
-                     std::string(prop->GetDisplacementShader()));
-  prop->SetVariable("floatVar", "float");
-  TEST_SET_GET_VALUE(std::string("Declare \"floatVar\" \"float\"\n"),
-                     std::string(prop->GetDeclarations()));
-  prop->AddVariable("colorVar", "color");
-  TEST_SET_GET_VALUE(std::string(
-                       "Declare \"floatVar\" \"float\"\n"
-                       "Declare \"colorVar\" \"color\"\n"),
-                     std::string(prop->GetDeclarations()));
-  prop->SetVariable("vectorVar", "vector");
-  TEST_SET_GET_VALUE(std::string("Declare \"vectorVar\" \"vector\"\n"),
-                     std::string(prop->GetDeclarations()));
-  prop->SetSurfaceShaderParameter("floatVar", "5.678");
-  TEST_SET_GET_VALUE(std::string(
-                       " \"floatVar\" [5.678]"),
-                     std::string(prop->GetSurfaceShaderParameters()));
-  prop->SetSurfaceShaderParameter("floatVar", "1.234");
-  prop->AddSurfaceShaderParameter("colorVar", "1 .5 .1");
-  TEST_SET_GET_VALUE(std::string(
-                       " \"floatVar\" [1.234] \"colorVar\" [1 .5 .1]"),
-                     std::string(prop->GetSurfaceShaderParameters()));
-  prop->SetDisplacementShaderParameter("floatVar", "5.678");
-  TEST_SET_GET_VALUE(std::string(
-                       " \"floatVar\" [5.678]"),
-                     std::string(prop->GetDisplacementShaderParameters()));
-  prop->SetDisplacementShaderParameter("floatVar", "1.234");
-  prop->AddDisplacementShaderParameter("colorVar", "1 .5 .1");
-  TEST_SET_GET_VALUE(std::string(
-                       " \"floatVar\" [1.234] \"colorVar\" [1 .5 .1]"),
-                     std::string(prop->GetDisplacementShaderParameters()));
-  prop->SurfaceShaderUsesDefaultParametersOn();
-  TEST_SET_GET_VALUE(1,
-                     prop->GetSurfaceShaderUsesDefaultParameters());
-  prop->SurfaceShaderUsesDefaultParametersOff();
-  TEST_SET_GET_VALUE(0,
-                     prop->GetSurfaceShaderUsesDefaultParameters());
-
-  std::cout << ".PASSED" << std::endl;
-  std::cout << "RIBProperty Print..";
-  std::ostringstream propPrint;
-  prop->Print(propPrint);
-  std::cout << ".PASSED" << std::endl;
-  }
-  {
-  std::cout << "RIBProperty Deprecated Set/Get..";
-  vtkSmartPointer<vtkRIBProperty> prop =
-    vtkSmartPointer<vtkRIBProperty>::New();
-  vtkSmartPointer<vtkTest::ErrorObserver>  warningObserver =
-    vtkSmartPointer<vtkTest::ErrorObserver>::New();
-  prop->AddObserver(vtkCommand::WarningEvent, warningObserver);
-  prop->SetParameter("floatVar", "5.678");
-  CHECK_WARNING_MSG("SetParameter is deprecated");
-
-  TEST_SET_GET_VALUE(std::string(
-                       " \"floatVar\" [5.678]"),
-                     std::string(prop->GetParameters()));
-  CHECK_WARNING_MSG("GetParameters is deprecated");
-
-  prop->AddParameter("colorVar", "1 .5 .1");
-  CHECK_WARNING_MSG("AddParameter is deprecated");
-  TEST_SET_GET_VALUE(std::string(
-                       " \"floatVar\" [5.678] \"colorVar\" [1 .5 .1]"),
-                     std::string(prop->GetSurfaceShaderParameters()));
-  std::cout << ".PASSED" << std::endl;
-  }
-  return status;
-}
-
-int TestRIBLight()
-{
-  int status = 0;
-  {
-  std::cout << "RIBLight empty Print..";
-  std::ostringstream lightPrint;
-  vtkSmartPointer<vtkRIBLight> light =
-    vtkSmartPointer<vtkRIBLight>::New();
-  light->Print(lightPrint);
-  light->ShadowsOff();
-  TEST_SET_GET_VALUE(0,
-                     light->GetShadows());
-  light->ShadowsOn();
-  TEST_SET_GET_VALUE(1,
-                     light->GetShadows());
-
-  std::cout << ".PASSED" << std::endl;
-  }
-  return status;
-}
-
-int TestRIBExporter()
-{
-  int status = 0;
-  {
-  std::cout << "RIBExporter empty Print..";
-  std::ostringstream exporterPrint;
-  vtkSmartPointer<vtkRIBExporter> exporter =
-    vtkSmartPointer<vtkRIBExporter>::New();
-  exporter->Print(exporterPrint);
-  std::cout << ".PASSED" << std::endl;
-  }
-  {
-  std::cout << "RIBExporter Set/Get..";
-  std::ostringstream exporterPrint;
-  vtkSmartPointer<vtkRIBExporter> exporter =
-    vtkSmartPointer<vtkRIBExporter>::New();
-
-  exporter->SetFilePrefix("foo");
-  TEST_SET_GET_VALUE(std::string("foo"),
-                     std::string(exporter->GetFilePrefix()));
-
-  exporter->SetTexturePrefix("bar");
-  TEST_SET_GET_VALUE(std::string("bar"),
-                     std::string(exporter->GetTexturePrefix()));
-
-  exporter->BackgroundOn();
-  TEST_SET_GET_VALUE(1,
-                     exporter->GetBackground());
-  exporter->BackgroundOff();
-  TEST_SET_GET_VALUE(0,
-                     exporter->GetBackground());
-  exporter->ExportArraysOn();
-  TEST_SET_GET_VALUE(1,
-                     exporter->GetExportArrays());
-  exporter->ExportArraysOff();
-  TEST_SET_GET_VALUE(0,
-                     exporter->GetExportArrays());
-  int sizeExpected[2] = {100,200};
-  int sizeGot[2];
-  exporter->SetSize(sizeExpected);
-  exporter->GetSize(sizeGot);
-  if (sizeExpected[0] != sizeGot[0] ||
-      sizeExpected[1] != sizeGot[1])
-    {
-    std::cout << "Error in " << "GetSize" << std::endl;
-    std::cout << "  In " __FILE__ ", line " << __LINE__ << std::endl;
-    std::cout << "Expected |"
-              << sizeExpected[0] << ", " << sizeExpected[1]
-              << "|" << std::endl;
-    std::cout << "but got  |"
-              << sizeGot[0] << ", " << sizeGot[1]
-              << "|" << std::endl;
-    status += 1;
-    }
-
-  int samplesExpected[2] = {2, 3};
-  int samplesGot[2];
-  exporter->SetPixelSamples(samplesExpected);
-  exporter->GetPixelSamples(samplesGot);
-  if (samplesExpected[0] != samplesGot[0] ||
-      samplesExpected[1] != samplesGot[1])
-    {
-    std::cout << "Error in " << "GetPixelSamples" << std::endl;
-    std::cout << "  In " __FILE__ ", line " << __LINE__ << std::endl;
-    std::cout << "Expected |"
-              << samplesExpected[0] << ", " << samplesExpected[1]
-              << "|" << std::endl;
-    std::cout << "but got  |"
-              << samplesGot[0] << ", " << samplesGot[1]
-              << "|" << std::endl;
-    status += 1;
-    }
-
-  std::cout << ".PASSED" << std::endl;
-  }
-  {
-  std::cout << "RIBExporter Default Shader Update..";
-  vtkSmartPointer<vtkSphereSource> sphereModel =
-    vtkSmartPointer<vtkSphereSource>::New ();
-  vtkSmartPointer<vtkStripper> stripModel =
-    vtkSmartPointer<vtkStripper>::New();
-  vtkSmartPointer<vtkRIBExporter> exporter =
-    vtkSmartPointer<vtkRIBExporter>::New();
-  vtkSmartPointer<vtkRIBProperty> prop =
-    vtkSmartPointer<vtkRIBProperty>::New();
-  vtkSmartPointer<vtkRIBProperty> prop2 =
-    vtkSmartPointer<vtkRIBProperty>::New();
-
-  vtkSmartPointer<vtkPolyDataMapper>  sphereMapper =
-    vtkSmartPointer<vtkPolyDataMapper>::New ();
-  sphereMapper->SetInputConnection(sphereModel->GetOutputPort());
-  vtkSmartPointer<vtkActor> sphere =
-    vtkSmartPointer<vtkActor>::New ();
-  sphere->SetMapper(sphereMapper);
-
-  stripModel->SetInputConnection(sphereModel->GetOutputPort());
-  vtkSmartPointer<vtkPolyDataMapper>  stripMapper =
-    vtkSmartPointer<vtkPolyDataMapper>::New ();
-  stripMapper->SetInputConnection(stripModel->GetOutputPort());
-  vtkSmartPointer<vtkActor> strip =
-    vtkSmartPointer<vtkActor>::New ();
-  strip->SetMapper(stripMapper);
-  strip->SetProperty(prop2);
-
-  vtkSmartPointer<vtkRenderWindow> renWin =
-    vtkSmartPointer<vtkRenderWindow>::New ();
-  vtkSmartPointer<vtkRenderer> ren1 =
-    vtkSmartPointer<vtkRenderer>::New ();
-  ren1->AddActor(sphere);
-  ren1->AddActor(strip);
-  renWin->AddRenderer(ren1);
-  renWin->Render();
-
-  exporter->SetRenderWindow(renWin);
-  exporter->SetFilePrefix("UnitTestRIBDefault");
-  exporter->Update();
-  std::cout << ".PASSED" << std::endl;
-
-  std::cout << "RIBExporter SetSurfaceShader Update..";
-  prop->SetVariable("k", "float");
-  prop->SetDiffuse(.5);
-  prop->SetSurfaceShaderParameter("k", "5");
-  prop->SetSurfaceShader("bozo");
-  sphere->SetProperty(prop);
-  renWin->Render();
-  exporter->SetFilePrefix("UnitTestRIBSetSurfaceShader");
-  exporter->Update();
-  std::cout << ".PASSED" << std::endl;
-
-  std::cout << "RIBExporter SurfaceShaderUsesDefaultParametersOff Update..";
-  prop->SurfaceShaderUsesDefaultParametersOff();
-  prop->SetVariable("k", "float");
-  prop->SetDiffuse(.5);
-  prop->SetSurfaceShaderParameter("k", "5");
-  prop->SetSurfaceShader("bozo");
-  sphere->SetProperty(prop);
-  renWin->Render();
-  exporter->SetFilePrefix("UnitTestRIBSurfaceShaderUsesDefaultParametersOff");
-  exporter->Update();
-  std::cout << ".PASSED" << std::endl;
-
-  std::cout << "RIBExporter SetDisplacmentShader Update..";
-  prop->SetVariable("Km", "float");
-  prop->SetDisplacementShaderParameter("Km", "2");
-  prop->SetDisplacementShader("dented");
-  sphere->SetProperty(prop);
-  renWin->Render();
-  exporter->SetFilePrefix("UnitTestRIBSetDisplacementShader");
-  exporter->Update();
-  std::cout << ".PASSED" << std::endl;
-
-  std::cout << "RIBExporter Errors and Warnings..";
-  vtkSmartPointer<vtkTest::ErrorObserver>  errorObserver =
-    vtkSmartPointer<vtkTest::ErrorObserver>::New();
-  exporter->AddObserver(vtkCommand::ErrorEvent, errorObserver);
-
-  prop->SetRepresentationToWireframe();
-  exporter->Update();
-  CHECK_ERROR_MSG("Bad representation. Only Surface is supported.");
-
-  prop->SetRepresentationToSurface();
-  prop2->SetRepresentationToWireframe();
-  exporter->Update();
-  CHECK_ERROR_MSG("Bad representation. Only Surface is supported.");
-
-  exporter->SetFilePrefix(NULL);
-  exporter->Update();
-  CHECK_ERROR_MSG("Please specify file name for the rib file");
-
-  vtkSmartPointer<vtkRenderer> ren2 =
-    vtkSmartPointer<vtkRenderer>::New ();
-  renWin->AddRenderer(ren2);
-  exporter->SetFilePrefix("dummy");
-  exporter->Update();
-  CHECK_ERROR_MSG("RIB files only support one renderer per window");
-
-  renWin->RemoveRenderer(ren2);
-  ren1->RemoveActor(sphere);
-  ren1->RemoveActor(strip);
-  exporter->Update();
-  CHECK_ERROR_MSG("No actors found for writing .RIB file");
-
-  std::cout << ".PASSED" << std::endl;
-
-  }
-  return status;
-}
diff --git a/IO/Export/Testing/Data/Baseline/TestContextGL2PS-rasterRef.png.md5 b/IO/Export/Testing/Data/Baseline/TestContextGL2PS-rasterRef.png.md5
index 74efdf3..fc6a340 100644
--- a/IO/Export/Testing/Data/Baseline/TestContextGL2PS-rasterRef.png.md5
+++ b/IO/Export/Testing/Data/Baseline/TestContextGL2PS-rasterRef.png.md5
@@ -1 +1 @@
-0fb59fffccc7d532b0fb49f01cbd9215
+cf147ce912f5e55b541a769d86c208e9
diff --git a/IO/Export/Testing/Data/Baseline/TestContextGL2PS-rasterRef_1.png.md5 b/IO/Export/Testing/Data/Baseline/TestContextGL2PS-rasterRef_1.png.md5
new file mode 100644
index 0000000..d28d5ac
--- /dev/null
+++ b/IO/Export/Testing/Data/Baseline/TestContextGL2PS-rasterRef_1.png.md5
@@ -0,0 +1 @@
+bf545d72b4b5faaeeead0f7c565a169f
diff --git a/IO/Export/Testing/Data/Baseline/TestContextGL2PS.png.md5 b/IO/Export/Testing/Data/Baseline/TestContextGL2PS.png.md5
index b6b0cd7..a6e4ddd 100644
--- a/IO/Export/Testing/Data/Baseline/TestContextGL2PS.png.md5
+++ b/IO/Export/Testing/Data/Baseline/TestContextGL2PS.png.md5
@@ -1 +1 @@
-ca2146ba0bea38523f0811f32c2efc72
+ea50692200efe3f0807b2cd6d8c43347
diff --git a/IO/Export/Testing/Data/Baseline/TestGL2PSExporterRaster-rasterRef.png.md5 b/IO/Export/Testing/Data/Baseline/TestGL2PSExporterRaster-rasterRef.png.md5
index 6bda75d..87731a3 100644
--- a/IO/Export/Testing/Data/Baseline/TestGL2PSExporterRaster-rasterRef.png.md5
+++ b/IO/Export/Testing/Data/Baseline/TestGL2PSExporterRaster-rasterRef.png.md5
@@ -1 +1 @@
-f56175a14ba5891687c627a51c2c34ea
+01b00df7ad722d8b589725d415d42e41
diff --git a/IO/Export/Testing/Data/Baseline/TestGL2PSExporterRaster-rasterRef_1.png.md5 b/IO/Export/Testing/Data/Baseline/TestGL2PSExporterRaster-rasterRef_1.png.md5
index 7b76880..7d4f582 100644
--- a/IO/Export/Testing/Data/Baseline/TestGL2PSExporterRaster-rasterRef_1.png.md5
+++ b/IO/Export/Testing/Data/Baseline/TestGL2PSExporterRaster-rasterRef_1.png.md5
@@ -1 +1 @@
-8750f86e8d8a28b367ba3213bdd44837
+192a29884c60428e852dacbd6767b61a
diff --git a/IO/Export/Testing/Data/Baseline/TestGL2PSExporterRaster-rasterRef_2.png.md5 b/IO/Export/Testing/Data/Baseline/TestGL2PSExporterRaster-rasterRef_2.png.md5
new file mode 100644
index 0000000..d4ea6ad
--- /dev/null
+++ b/IO/Export/Testing/Data/Baseline/TestGL2PSExporterRaster-rasterRef_2.png.md5
@@ -0,0 +1 @@
+82327130597803fd72e52cb7c9bdfb67
diff --git a/IO/Export/Testing/Data/Baseline/TestGL2PSExporterRaster.png.md5 b/IO/Export/Testing/Data/Baseline/TestGL2PSExporterRaster.png.md5
index e7afdb5..450abd2 100644
--- a/IO/Export/Testing/Data/Baseline/TestGL2PSExporterRaster.png.md5
+++ b/IO/Export/Testing/Data/Baseline/TestGL2PSExporterRaster.png.md5
@@ -1 +1 @@
-74fc0165820f613d07221be87112fb54
+e8764112353d7898b33cc0b75eec3a51
diff --git a/IO/Export/Testing/Data/Baseline/TestGL2PSExporterRasterExclusion.png.md5 b/IO/Export/Testing/Data/Baseline/TestGL2PSExporterRasterExclusion.png.md5
index f83caa7..0450e62 100644
--- a/IO/Export/Testing/Data/Baseline/TestGL2PSExporterRasterExclusion.png.md5
+++ b/IO/Export/Testing/Data/Baseline/TestGL2PSExporterRasterExclusion.png.md5
@@ -1 +1 @@
-28392228daa6f2fff4e5f02b74295cea
+3951300ab44b79d2c476c4d4dd15d7ef
diff --git a/IO/Export/Testing/Data/Baseline/TestGL2PSExporterVector-rasterRef.png.md5 b/IO/Export/Testing/Data/Baseline/TestGL2PSExporterVector-rasterRef.png.md5
index fa0f3cb..4fa6083 100644
--- a/IO/Export/Testing/Data/Baseline/TestGL2PSExporterVector-rasterRef.png.md5
+++ b/IO/Export/Testing/Data/Baseline/TestGL2PSExporterVector-rasterRef.png.md5
@@ -1 +1 @@
-760266861654af71eb35b785b980b771
+1376c4e71930a1735e4e3f92cbb88558
diff --git a/IO/Export/Testing/Data/Baseline/TestGL2PSExporterVector-rasterRef_1.png.md5 b/IO/Export/Testing/Data/Baseline/TestGL2PSExporterVector-rasterRef_1.png.md5
index 3c7d578..ba838b8 100644
--- a/IO/Export/Testing/Data/Baseline/TestGL2PSExporterVector-rasterRef_1.png.md5
+++ b/IO/Export/Testing/Data/Baseline/TestGL2PSExporterVector-rasterRef_1.png.md5
@@ -1 +1 @@
-4bf94ef2dc02792ac8af6aeb6bf9c31e
+85abe20e1a2185f1d55b95fb5367ff37
diff --git a/IO/Export/Testing/Data/Baseline/TestGL2PSExporterVector-rasterRef_2.png.md5 b/IO/Export/Testing/Data/Baseline/TestGL2PSExporterVector-rasterRef_2.png.md5
new file mode 100644
index 0000000..321bf46
--- /dev/null
+++ b/IO/Export/Testing/Data/Baseline/TestGL2PSExporterVector-rasterRef_2.png.md5
@@ -0,0 +1 @@
+8dca44af90682b10d42eb7f9bb22d713
diff --git a/IO/Export/Testing/Data/Baseline/TestGL2PSExporterVector-rasterRef_3.png.md5 b/IO/Export/Testing/Data/Baseline/TestGL2PSExporterVector-rasterRef_3.png.md5
new file mode 100644
index 0000000..06318ba
--- /dev/null
+++ b/IO/Export/Testing/Data/Baseline/TestGL2PSExporterVector-rasterRef_3.png.md5
@@ -0,0 +1 @@
+71f5f38df773f281ea63ad1e3c1f8748
diff --git a/IO/Export/Testing/Data/Baseline/TestGL2PSExporterVector.png.md5 b/IO/Export/Testing/Data/Baseline/TestGL2PSExporterVector.png.md5
index e7afdb5..450abd2 100644
--- a/IO/Export/Testing/Data/Baseline/TestGL2PSExporterVector.png.md5
+++ b/IO/Export/Testing/Data/Baseline/TestGL2PSExporterVector.png.md5
@@ -1 +1 @@
-74fc0165820f613d07221be87112fb54
+e8764112353d7898b33cc0b75eec3a51
diff --git a/IO/Export/Testing/Data/Baseline/TestGL2PSExporterVolumeRaster-rasterRef.png.md5 b/IO/Export/Testing/Data/Baseline/TestGL2PSExporterVolumeRaster-rasterRef.png.md5
index 328bfda..648703a 100644
--- a/IO/Export/Testing/Data/Baseline/TestGL2PSExporterVolumeRaster-rasterRef.png.md5
+++ b/IO/Export/Testing/Data/Baseline/TestGL2PSExporterVolumeRaster-rasterRef.png.md5
@@ -1 +1 @@
-4b144a840d586a33caee442781c3f983
+c660b8882d0bbc72f366e5218545cab6
diff --git a/IO/Export/Testing/Data/Baseline/TestGL2PSExporterVolumeRaster-rasterRef_1.png.md5 b/IO/Export/Testing/Data/Baseline/TestGL2PSExporterVolumeRaster-rasterRef_1.png.md5
new file mode 100644
index 0000000..800bef3
--- /dev/null
+++ b/IO/Export/Testing/Data/Baseline/TestGL2PSExporterVolumeRaster-rasterRef_1.png.md5
@@ -0,0 +1 @@
+cd447b7ee48c7fc4024fba85881900f0
diff --git a/IO/Export/Testing/Data/Baseline/TestGL2PSExporterVolumeRaster-rasterRef_2.png.md5 b/IO/Export/Testing/Data/Baseline/TestGL2PSExporterVolumeRaster-rasterRef_2.png.md5
new file mode 100644
index 0000000..6b48b79
--- /dev/null
+++ b/IO/Export/Testing/Data/Baseline/TestGL2PSExporterVolumeRaster-rasterRef_2.png.md5
@@ -0,0 +1 @@
+1e56dfa9cc5afa912d4f794f6e7d16bf
diff --git a/IO/Export/Testing/Data/Baseline/TestGL2PSExporterVolumeRaster-rasterRef_3.png.md5 b/IO/Export/Testing/Data/Baseline/TestGL2PSExporterVolumeRaster-rasterRef_3.png.md5
new file mode 100644
index 0000000..ab5b8dc
--- /dev/null
+++ b/IO/Export/Testing/Data/Baseline/TestGL2PSExporterVolumeRaster-rasterRef_3.png.md5
@@ -0,0 +1 @@
+622cc183dc3cf87fda4719e045ec445e
diff --git a/IO/Export/Testing/Data/Baseline/TestGL2PSExporterVolumeRaster-rasterRef_4.png.md5 b/IO/Export/Testing/Data/Baseline/TestGL2PSExporterVolumeRaster-rasterRef_4.png.md5
new file mode 100644
index 0000000..4984c70
--- /dev/null
+++ b/IO/Export/Testing/Data/Baseline/TestGL2PSExporterVolumeRaster-rasterRef_4.png.md5
@@ -0,0 +1 @@
+d6eb04c3766991bb8f0005a7d0d90261
diff --git a/IO/Export/Testing/Data/Baseline/TestGL2PSExporterVolumeRaster.png.md5 b/IO/Export/Testing/Data/Baseline/TestGL2PSExporterVolumeRaster.png.md5
index 37cbc37..c979911 100644
--- a/IO/Export/Testing/Data/Baseline/TestGL2PSExporterVolumeRaster.png.md5
+++ b/IO/Export/Testing/Data/Baseline/TestGL2PSExporterVolumeRaster.png.md5
@@ -1 +1 @@
-ded21dec53749c2bb5dcf23ffd8a7fe4
+8606c955740ade4636dd10575f9c89a4
diff --git a/IO/Export/Testing/Data/Baseline/TestGL2PSExporterVolumeRaster_1.png.md5 b/IO/Export/Testing/Data/Baseline/TestGL2PSExporterVolumeRaster_1.png.md5
index da6eba4..d58f325 100644
--- a/IO/Export/Testing/Data/Baseline/TestGL2PSExporterVolumeRaster_1.png.md5
+++ b/IO/Export/Testing/Data/Baseline/TestGL2PSExporterVolumeRaster_1.png.md5
@@ -1 +1 @@
-14869c5f052bb06659a67c1c692b4318
+3977291a8022c7f52727d57415d79a26
diff --git a/IO/Export/Testing/Data/Baseline/TestGL2PSLabeledDataMapper-rasterRef.png.md5 b/IO/Export/Testing/Data/Baseline/TestGL2PSLabeledDataMapper-rasterRef.png.md5
index 0e60365..6b3a690 100644
--- a/IO/Export/Testing/Data/Baseline/TestGL2PSLabeledDataMapper-rasterRef.png.md5
+++ b/IO/Export/Testing/Data/Baseline/TestGL2PSLabeledDataMapper-rasterRef.png.md5
@@ -1 +1 @@
-74ee6a5b26230087c48fe63a1bb2bb7c
+0baa142c7b599f5b4858467135aa9fbf
diff --git a/IO/Export/Testing/Data/Baseline/TestGL2PSLabeledDataMapper.png.md5 b/IO/Export/Testing/Data/Baseline/TestGL2PSLabeledDataMapper.png.md5
index e6e6cd0..36edbd7 100644
--- a/IO/Export/Testing/Data/Baseline/TestGL2PSLabeledDataMapper.png.md5
+++ b/IO/Export/Testing/Data/Baseline/TestGL2PSLabeledDataMapper.png.md5
@@ -1 +1 @@
-a92aadcb606ed7bcaf2b55f1cdcdb705
+2fab6fd7f29e0aff854261f8b3e4e3eb
diff --git a/IO/Export/Testing/Data/Baseline/TestGL2PSTextActor-rasterRef.png.md5 b/IO/Export/Testing/Data/Baseline/TestGL2PSTextActor-rasterRef.png.md5
index 126d711..126f1ba 100644
--- a/IO/Export/Testing/Data/Baseline/TestGL2PSTextActor-rasterRef.png.md5
+++ b/IO/Export/Testing/Data/Baseline/TestGL2PSTextActor-rasterRef.png.md5
@@ -1 +1 @@
-a9ee3ee52daff9007a29e7c5db62eb92
+632b71040c062eb22100ada4c81d72f3
diff --git a/IO/Export/Testing/Data/Baseline/TestGL2PSTextActor.png.md5 b/IO/Export/Testing/Data/Baseline/TestGL2PSTextActor.png.md5
index fb19e5c..808f237 100644
--- a/IO/Export/Testing/Data/Baseline/TestGL2PSTextActor.png.md5
+++ b/IO/Export/Testing/Data/Baseline/TestGL2PSTextActor.png.md5
@@ -1 +1 @@
-3c1f1475164cc67fb8d5283639f41f16
+e82e81aaa51e0e4d71ba878fffdeecf9
diff --git a/IO/Export/Testing/Data/Baseline/TestGL2PSTextActor3D-rasterRef.png.md5 b/IO/Export/Testing/Data/Baseline/TestGL2PSTextActor3D-rasterRef.png.md5
index f1ea215..1fffada 100644
--- a/IO/Export/Testing/Data/Baseline/TestGL2PSTextActor3D-rasterRef.png.md5
+++ b/IO/Export/Testing/Data/Baseline/TestGL2PSTextActor3D-rasterRef.png.md5
@@ -1 +1 @@
-952c8e7138a58fe4442e818716b042e0
+b7d370e65738b172570c1d8617e85d0b
diff --git a/IO/Export/Testing/Data/Baseline/TestLinePlotGL2PS-rasterRef.png.md5 b/IO/Export/Testing/Data/Baseline/TestLinePlotGL2PS-rasterRef.png.md5
index 4864ccc..8a2d093 100644
--- a/IO/Export/Testing/Data/Baseline/TestLinePlotGL2PS-rasterRef.png.md5
+++ b/IO/Export/Testing/Data/Baseline/TestLinePlotGL2PS-rasterRef.png.md5
@@ -1 +1 @@
-495ee22b8070d90f48a4a28199199cab
+5f8b8139e6c5d5dd995b7b978ade4253
diff --git a/IO/Export/Testing/Data/Baseline/TestLinePlotGL2PS.png.md5 b/IO/Export/Testing/Data/Baseline/TestLinePlotGL2PS.png.md5
index f187b03..2d86b94 100644
--- a/IO/Export/Testing/Data/Baseline/TestLinePlotGL2PS.png.md5
+++ b/IO/Export/Testing/Data/Baseline/TestLinePlotGL2PS.png.md5
@@ -1 +1 @@
-94c04e226b6f59046c9d71c5c251d8c5
+ed7d9ba58822315ba797114a5e847e9a
diff --git a/IO/Export/Testing/Data/Baseline/TestLinePlotGL2PS_1.png.md5 b/IO/Export/Testing/Data/Baseline/TestLinePlotGL2PS_1.png.md5
index a54ce55..ec5ab43 100644
--- a/IO/Export/Testing/Data/Baseline/TestLinePlotGL2PS_1.png.md5
+++ b/IO/Export/Testing/Data/Baseline/TestLinePlotGL2PS_1.png.md5
@@ -1 +1 @@
-ca8cb0b30dfce2da920ae477aac4096d
+fb0ed7dcdcb6796802f9f2bed0876c43
diff --git a/IO/Export/Testing/Data/Baseline/TestRIBExporter.tif.md5 b/IO/Export/Testing/Data/Baseline/TestRIBExporter.tif.md5
deleted file mode 100644
index 5d2175c..0000000
--- a/IO/Export/Testing/Data/Baseline/TestRIBExporter.tif.md5
+++ /dev/null
@@ -1 +0,0 @@
-29f8c98a056050c8521bc196465e50d7
diff --git a/IO/Export/Testing/Data/Baseline/TestStackedPlotGL2PS-rasterRef.png.md5 b/IO/Export/Testing/Data/Baseline/TestStackedPlotGL2PS-rasterRef.png.md5
index 04da9a0..0a7964a 100644
--- a/IO/Export/Testing/Data/Baseline/TestStackedPlotGL2PS-rasterRef.png.md5
+++ b/IO/Export/Testing/Data/Baseline/TestStackedPlotGL2PS-rasterRef.png.md5
@@ -1 +1 @@
-2e223f1c66ac185e47edfec637e89481
+e3a141301d92252be343a0770177404c
diff --git a/IO/Export/Testing/Data/Baseline/TestStackedPlotGL2PS-rasterRef_1.png.md5 b/IO/Export/Testing/Data/Baseline/TestStackedPlotGL2PS-rasterRef_1.png.md5
new file mode 100644
index 0000000..50944fa
--- /dev/null
+++ b/IO/Export/Testing/Data/Baseline/TestStackedPlotGL2PS-rasterRef_1.png.md5
@@ -0,0 +1 @@
+19d61df3d058d87fb8dcc6eec26f6e3e
diff --git a/IO/Export/Testing/Data/Baseline/TestStackedPlotGL2PS.png.md5 b/IO/Export/Testing/Data/Baseline/TestStackedPlotGL2PS.png.md5
index f5851a1..a512c23 100644
--- a/IO/Export/Testing/Data/Baseline/TestStackedPlotGL2PS.png.md5
+++ b/IO/Export/Testing/Data/Baseline/TestStackedPlotGL2PS.png.md5
@@ -1 +1 @@
-edcf235af616e7087f11f2ce90f617d7
+b26485a625bcadbdcb5319a11e078122
diff --git a/IO/Export/Testing/Data/Input/bozo.sl b/IO/Export/Testing/Data/Input/bozo.sl
deleted file mode 100644
index 52664f2..0000000
--- a/IO/Export/Testing/Data/Input/bozo.sl
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Perlin's "Bozo's Donut"
- * Perlin, Ken, "An Image Synthesizer", SIGGRAPH '85
- */
-
-
-surface
-bozo(
-    float k             = 4,      /* noise amplification */
-          Ka            = 1,
-          Kd            = 0.5,
-          Ks            = 0.5,
-          roughness     = 0.1;
-    color specularcolor = 1
-)
-{
-    normal Nf = faceforward(normalize(N),I);
-    vector V = normalize(-I);
-    color cc;
-    float i;
-
-    cc = color noise(k*P) ;
-
-    /* map ranges of noise values into different colors */
-    for ( i=0.0; i<3.0; i+=1.0) {
-        if (comp(cc,i) < 0.3) setcomp(cc,i,0.3);
-        else
-            if (comp(cc,i) < 0.6) setcomp(cc,i,0.6);
-            else setcomp(cc,i,1.0);
-    }
-
-    /* specular reflection model */
-    Oi = Os;
-    Ci = Os * (Cs * (Ka * ambient() + cc * Kd * diffuse(Nf))
-        + specularcolor * Ks * specular(Nf,V,roughness));
-}
diff --git a/IO/Export/Testing/Data/Input/dented.sl b/IO/Export/Testing/Data/Input/dented.sl
deleted file mode 100644
index 2c21a94..0000000
--- a/IO/Export/Testing/Data/Input/dented.sl
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Listing 16.16  Displacement shader to dent a surface*/
-/*
- * dented(): Create a worn surface.
- */
-displacement
-dented (float	Km	= 1.0 )
-{
-	float	size 	  = 1.0,
-		magnitude = 0.0,
-		i;
-	point P2;
-        normal Ndiff;
-
-	P2 = transform("shader", P);
-	for (i = 0; i < 6.0; i += 1.0) {
-		/* Calculate a simple fractal 1/f noise function */
-		magnitude += abs(.5 - noise(P2 * size)) / size;
-		size *= 2.0;
-	}
-        Ndiff = normalize(N) - normalize(Ng);
-	P2 = P - normalize(N) * (magnitude * magnitude * magnitude) * Km;
-
-        /* correct the normal */
-        N = normalize(calculatenormal (P2)) + Ndiff;
-}
diff --git a/IO/Export/module.cmake b/IO/Export/module.cmake
index fcf2bab..d558959 100644
--- a/IO/Export/module.cmake
+++ b/IO/Export/module.cmake
@@ -26,6 +26,7 @@ vtk_module(vtkIOExport
     vtkTestingRendering
     vtkInteractionStyle
     vtkRenderingAnnotation
+    vtkRenderingFreeType${VTK_RENDERING_BACKEND}
     vtkRenderingVolume${VTK_RENDERING_BACKEND}
     vtkRenderingContext${VTK_RENDERING_BACKEND}
     vtkViewsContext2D
diff --git a/IO/Export/vtkGL2PSExporter.cxx b/IO/Export/vtkGL2PSExporter.cxx
index 5a4d467..41551e5 100644
--- a/IO/Export/vtkGL2PSExporter.cxx
+++ b/IO/Export/vtkGL2PSExporter.cxx
@@ -32,7 +32,6 @@
 #include "vtkIntArray.h"
 #include "vtkLabeledDataMapper.h"
 #include "vtkMapper2D.h"
-#include "vtkMath.h"
 #include "vtkMathTextUtilities.h"
 #include "vtkMatrix4x4.h"
 #include "vtkNew.h"
@@ -357,7 +356,6 @@ int vtkGL2PSExporter::GetGL2PSSort()
     {
     default:
       vtkDebugMacro(<<"Invalid sort settings, using NO_SORT.");
-      VTK_FALLTHROUGH;
     case NO_SORT:
       return GL2PS_NO_SORT;
     case SIMPLE_SORT:
@@ -373,7 +371,6 @@ int vtkGL2PSExporter::GetGL2PSFormat()
     {
     default:
       vtkDebugMacro(<<"Invalid output format. Using postscript.");
-      VTK_FALLTHROUGH;
     case PS_FILE:
       return GL2PS_PS;
     case EPS_FILE:
@@ -393,7 +390,6 @@ const char *vtkGL2PSExporter::GetFileExtension()
     {
     default:
       vtkDebugMacro(<<"Invalid output format. Using postscript.");
-      VTK_FALLTHROUGH;
     case PS_FILE:
       return "ps";
     case EPS_FILE:
@@ -727,26 +723,21 @@ void vtkGL2PSExporter::DrawTextActor(vtkTextActor *textAct, vtkRenderer *ren)
 }
 
 void vtkGL2PSExporter::DrawTextActor3D(vtkTextActor3D *textAct,
-                                       vtkRenderer *ren)
+                                       vtkRenderer *)
 {
   // Get path
   const char *string = textAct->GetInput();
   vtkTextProperty *tprop = textAct->GetTextProperty();
   vtkNew<vtkPath> textPath;
   vtkTextRenderer *tren = vtkTextRenderer::GetInstance();
-
-  if (!tren)
+  if (tren)
     {
-    vtkWarningMacro(<<"Cannot generate path data from 3D text string '"
-                    << string << "': Text renderer unavailable.");
-    return;
+    tren->StringToPath(tprop, vtkStdString(string), textPath.GetPointer());
     }
-
-  if (!tren->StringToPath(tprop, vtkStdString(string), textPath.GetPointer(),
-                          vtkTextActor3D::GetRenderedDPI()))
+  else
     {
-    vtkWarningMacro(<<"Failed to generate path data from 3D text string '"
-                    << string << "': StringToPath failed.");
+    vtkWarningMacro(<<"Cannot generate path data from 3D text string: "
+                    << string);
     return;
     }
 
@@ -774,22 +765,8 @@ void vtkGL2PSExporter::DrawTextActor3D(vtkTextActor3D *textAct,
       static_cast<unsigned char>(bgColord[2] * 255),
       static_cast<unsigned char>(tprop->GetBackgroundOpacity() * 255)};
 
-    // Get the camera so we can calculate an offset to place the background
-    // behind the text.
-    vtkCamera *cam = ren->GetActiveCamera();
-    vtkMatrix4x4 *mat = cam->GetCompositeProjectionTransformMatrix(
-          ren->GetTiledAspectRatio(), 0., 1.);
-    double forward[3] = {mat->GetElement(2, 0),
-                         mat->GetElement(2, 1),
-                         mat->GetElement(2, 2)};
-    vtkMath::Normalize(forward);
-    double bgPos[3] = {textPos[0] + (forward[0] * 0.0001),
-                       textPos[1] + (forward[1] * 0.0001),
-                       textPos[2] + (forward[2] * 0.0001)};
-
     vtkTextRenderer::Metrics metrics;
-    if (tren->GetMetrics(tprop, string, metrics,
-                         vtkTextActor3D::GetRenderedDPI()))
+    if (tren->GetMetrics(tprop, string, metrics))
       {
       vtkNew<vtkPath> bgPath;
       bgPath->InsertNextPoint(static_cast<double>(metrics.TopLeft.GetX()),
@@ -808,7 +785,7 @@ void vtkGL2PSExporter::DrawTextActor3D(vtkTextActor3D *textAct,
                               static_cast<double>(metrics.TopLeft.GetY()),
                               0., vtkPath::LINE_TO);
 
-      vtkGL2PSUtilities::Draw3DPath(bgPath.GetPointer(), actorMatrix, bgPos,
+      vtkGL2PSUtilities::Draw3DPath(bgPath.GetPointer(), actorMatrix, textPos,
                                     bgColor);
       }
     }
diff --git a/IO/Export/vtkOOGLExporter.cxx b/IO/Export/vtkOOGLExporter.cxx
index 0d800ae..9750043 100644
--- a/IO/Export/vtkOOGLExporter.cxx
+++ b/IO/Export/vtkOOGLExporter.cxx
@@ -323,6 +323,110 @@ void vtkOOGLExporter::WriteAnActor(vtkActor *anActor, FILE *fp, int count)
   // Get the material properties
   prop = anActor->GetProperty();
 
+  // is there a texture map (for the moment, we don't deal with textures)
+  if ( 1 == 2 /*anActor->GetTexture()*/)
+    {
+    vtkTexture *aTexture = anActor->GetTexture();
+    int *size, xsize, ysize, bpp;
+    vtkDataArray *scalars;
+    vtkUnsignedCharArray *mappedScalars;
+    unsigned char *txtrData;
+    int totalValues;
+
+    // make sure it is updated and then get some info
+    if (aTexture->GetInput() == NULL)
+      {
+      vtkErrorMacro(<< "texture has no input!\n");
+      return;
+      }
+    aTexture->GetInputAlgorithm()->Update();
+    size = aTexture->GetInput()->GetDimensions();
+    scalars = aTexture->GetInput()->GetPointData()->GetScalars();
+
+    // make sure scalars are non null
+    if (!scalars)
+      {
+      vtkErrorMacro(<< "No scalar values found for texture input!\n");
+      return;
+      }
+
+    // make sure using unsigned char data of color scalars type
+    if (aTexture->GetMapColorScalarsThroughLookupTable () ||
+        (scalars->GetDataType() != VTK_UNSIGNED_CHAR) )
+      {
+      mappedScalars = aTexture->GetMappedScalars ();
+      }
+    else
+      {
+      mappedScalars = static_cast<vtkUnsignedCharArray*>(scalars);
+      }
+
+    // we only support 2d texture maps right now
+    // so one of the three sizes must be 1, but it
+    // could be any of them, so lets find it
+    if (size[0] == 1)
+      {
+      xsize = size[1]; ysize = size[2];
+      }
+    else
+      {
+      xsize = size[0];
+      if (size[1] == 1)
+        {
+        ysize = size[2];
+        }
+      else
+        {
+        ysize = size[1];
+        if (size[2] != 1)
+          {
+          vtkErrorMacro(<< "3D texture maps currently are not supported!\n");
+          return;
+          }
+        }
+      }
+
+    fprintf(fp, "%sTexture2 {\n", indent);
+    VTK_INDENT_MORE;
+    bpp = mappedScalars->GetNumberOfComponents();
+    fprintf(fp, "%simage %d %d %d\n", indent, xsize, ysize, bpp);
+    VTK_INDENT_MORE;
+    txtrData =  static_cast<vtkUnsignedCharArray *>(mappedScalars)->GetPointer(0);
+    totalValues = xsize*ysize;
+    fprintf(fp,"%s",indent);
+    for (i = 0; i < totalValues; i++)
+      {
+      fprintf(fp,"%.2x",*txtrData);
+      txtrData++;
+      if (bpp > 1)
+        {
+        fprintf(fp,"%.2x",*txtrData);
+        txtrData++;
+        }
+      if (bpp > 2)
+        {
+        fprintf(fp,"%.2x",*txtrData);
+        txtrData++;
+        }
+      if (bpp > 3)
+        {
+        fprintf(fp,"%.2x",*txtrData);
+        txtrData++;
+        }
+      if (i%8 == 0)
+        {
+        fprintf(fp,"\n%s    ", indent);
+        }
+      else
+        {
+        fprintf(fp," ");
+        }
+      }
+    VTK_INDENT_LESS;
+    fprintf(fp, "%s}\n", indent);
+    VTK_INDENT_LESS;
+    }
+
    // start an INST object
    fprintf(fp, "%s{ INST\n", indent);
 
diff --git a/IO/Export/vtkRIBExporter.cxx b/IO/Export/vtkRIBExporter.cxx
index 946e3f0..29855fc 100644
--- a/IO/Export/vtkRIBExporter.cxx
+++ b/IO/Export/vtkRIBExporter.cxx
@@ -68,12 +68,18 @@ vtkRIBExporter::~vtkRIBExporter()
 
 void vtkRIBExporter::WriteData()
 {
+  vtkRenderer *ren;
+  vtkActorCollection *ac;
+  vtkLightCollection *lc;
+  vtkActor *anActor;
+  vtkCollection *textures = vtkCollection::New();
+  vtkLight *aLight;
+  vtkTexture *aTexture;
+
   // make sure the user specified a FilePrefix
   if ( this->FilePrefix == NULL)
     {
     vtkErrorMacro(<< "Please specify file name for the rib file");
-    delete [] this->FilePrefix;
-    delete [] this->TexturePrefix;
     return;
     }
 
@@ -84,13 +90,6 @@ void vtkRIBExporter::WriteData()
     return;
     }
 
-  vtkRenderer *ren;
-  vtkActorCollection *ac;
-  vtkLightCollection *lc;
-  vtkActor *anActor;
-  vtkLight *aLight;
-  vtkTexture *aTexture;
-
   // get the renderer
   vtkCollectionSimpleIterator sit;
   this->RenderWindow->GetRenderers()->InitTraversal(sit);
@@ -99,7 +98,7 @@ void vtkRIBExporter::WriteData()
   // make sure it has at least one actor
   if (ren->GetActors()->GetNumberOfItems() < 1)
     {
-    vtkErrorMacro(<< "No actors found for writing .RIB file.");
+    vtkErrorMacro(<< "no actors found for writing .RIB file.");
     return;
     }
 
@@ -125,7 +124,6 @@ void vtkRIBExporter::WriteData()
   //  All textures must be made first
   //
   ac = ren->GetActors();
-  vtkCollection *textures = vtkCollection::New();
   vtkCollectionSimpleIterator ait;
   for ( ac->InitTraversal (ait); (anActor = ac->GetNextActor(ait)); )
     {
@@ -227,12 +225,12 @@ void vtkRIBExporter::WriteHeader (vtkRenderer *aRen)
   sprintf (imageFileName, "%s%s", this->FilePrefix, ".tif");
 
   fprintf (this->FilePtr, "FrameBegin %d\n", 1);
-  fprintf (this->FilePtr, "Display \"%s\" \"file\" \"rgb\"\n", imageFileName);
-  fprintf (this->FilePtr, "Declare \"color\" \"uniform color\"\n");
+  fprintf (this->FilePtr, "Display \"%s\" \"file\" \"rgba\"\n", imageFileName);
+  fprintf (this->FilePtr, "Declare \"bgcolor\" \"uniform color\"\n");
   if (this->Background)
     {
     double *color = aRen->GetBackground ();
-    fprintf (this->FilePtr, "Imager \"background\" \"color\" [%f %f %f]\n",
+    fprintf (this->FilePtr, "Imager \"background\" \"bgcolor\" [%f %f %f]\n",
              color[0], color[1], color[2]);
     }
   fprintf (this->FilePtr, "PixelSamples %d %d\n",
@@ -279,17 +277,17 @@ void vtkRIBExporter::WriteProperty (vtkProperty *aProperty,
   SpecularColor = aProperty->GetSpecularColor();
   Roughness = (RtFloat) (1.0 / aProperty->GetSpecularPower ());
 
-  //
-  // if there is a texture map we need to declare it
-  //
+//
+// if there is a texture map we need to declare it
+//
   mapName = (char *) NULL;
   if (aTexture)
     {
     mapName = this->GetTextureName(aTexture);
     if (mapName)
-      {
-      fprintf (this->FilePtr, "Declare \"texturename\" \"uniform string\"\n");
-      }
+        {
+        fprintf (this->FilePtr, "Declare \"mapname\" \"uniform string\"\n");
+        }
     }
 //
 // Now we need to check to see if an RIBProperty has been specified
@@ -304,56 +302,61 @@ void vtkRIBExporter::WriteProperty (vtkProperty *aProperty,
     if (aRIBProperty->GetSurfaceShader ())
       {
       fprintf (this->FilePtr, "%s \"%s\" ", "Surface", aRIBProperty->GetSurfaceShader ());
-      if (aRIBProperty->GetSurfaceShaderUsesDefaultParameters())
-        {
-        fprintf (this->FilePtr, "\"Ka\" [%f] ", Ambient);
-        fprintf (this->FilePtr, "\"Kd\" [%f] ", Diffuse);
-        fprintf (this->FilePtr, "\"Ks\" [%f] ", Specular);
-        fprintf (this->FilePtr, "\"roughness\" [%f] ", Roughness);
-        fprintf (this->FilePtr, "\"specularcolor\" [%f %f %f]\n",
-                 SpecularColor[0], SpecularColor[1], SpecularColor[2]);
-        if (mapName)
-          {
-          fprintf (this->FilePtr, " \"texturename\" [\"%s\"]", mapName);
-          }
-        }
-      if (aRIBProperty->GetSurfaceShaderParameters ())
-        {
-        fprintf (this->FilePtr, "%s\n", aRIBProperty->GetSurfaceShaderParameters ());
-        }
+      fprintf (this->FilePtr, "\"Ka\" [%f] ", Ambient);
+      fprintf (this->FilePtr, "\"Kd\" [%f] ", Diffuse);
+      fprintf (this->FilePtr, "\"Ks\" [%f] ", Specular);
+      fprintf (this->FilePtr, "\"roughness\" [%f] ", Roughness);
+      fprintf (this->FilePtr, "\"specularcolor\" [%f %f %f]",
+        SpecularColor[0], SpecularColor[1], SpecularColor[2]);
+      if (mapName)
+       {
+       fprintf (this->FilePtr, " \"mapname\" [\"%s\"]", mapName);
+       }
+      }
+    if (aRIBProperty->GetParameters ())
+      {
+      fprintf (this->FilePtr, "%s", aRIBProperty->GetParameters ());
       }
+      fprintf (this->FilePtr, "\n");
     if (aRIBProperty->GetDisplacementShader ())
       {
       fprintf (this->FilePtr, "%s \"%s\" ", "Displacement", aRIBProperty->GetDisplacementShader ());
+      fprintf (this->FilePtr, "\"Ka\" [%f] ", Ambient);
+      fprintf (this->FilePtr, "\"Kd\" [%f] ", Diffuse);
+      fprintf (this->FilePtr, "\"Ks\" [%f] ", Specular);
+      fprintf (this->FilePtr, "\"roughness\" [%f] ", Roughness);
+      fprintf (this->FilePtr, "\"specularcolor\" [%f %f %f]",
+        SpecularColor[0], SpecularColor[1], SpecularColor[2]);
       if (mapName)
+       {
+       fprintf (this->FilePtr, " \"mapname\" [\"%s\"]", mapName);
+       }
+      if (aRIBProperty->GetParameters ())
         {
-        fprintf (this->FilePtr, " \"texturename\" [\"%s\"]", mapName);
-        }
-      if (aRIBProperty->GetDisplacementShaderParameters ())
-        {
-        fprintf (this->FilePtr, "%s", aRIBProperty->GetDisplacementShaderParameters ());
+        fprintf (this->FilePtr, "%s", aRIBProperty->GetParameters ());
         }
       fprintf (this->FilePtr, "\n");
       }
     }
-// Default Property
+// Normal Property
   else
     {
-    fprintf (this->FilePtr, "Surface \"%s\" ", mapName ? "paintedplastic" : "plastic");
+    fprintf (this->FilePtr, "Surface \"%s\" ", mapName ? "txtplastic" : "plastic");
     fprintf (this->FilePtr, "\"Ka\" [%f] ", Ambient);
     fprintf (this->FilePtr, "\"Kd\" [%f] ", Diffuse);
     fprintf (this->FilePtr, "\"Ks\" [%f] ", Specular);
     fprintf (this->FilePtr, "\"roughness\" [%f] ", Roughness);
     fprintf (this->FilePtr, "\"specularcolor\" [%f %f %f] ",
-             SpecularColor[0], SpecularColor[1], SpecularColor[2]);
+        SpecularColor[0], SpecularColor[1], SpecularColor[2]);
     if (mapName)
-      {
-      fprintf (this->FilePtr, " \"texturename\" [\"%s\"]", mapName);
+     {
+     fprintf (this->FilePtr, " \"mapname\" [\"%s\"]", mapName);
      }
     fprintf (this->FilePtr, "\n");
     }
 }
 
+
 void vtkRIBExporter::WriteLight (vtkLight *aLight, int count)
 {
   double color[4];
@@ -364,9 +367,9 @@ void vtkRIBExporter::WriteLight (vtkLight *aLight, int count)
   // get required info from light
   Intensity = aLight->GetIntensity();
   Color = aLight->GetDiffuseColor();
-  color[0] = Color[0];
-  color[1] = Color[1];
-  color[2] = Color[2];
+  color[0] = Intensity * Color[0];
+  color[1] = Intensity * Color[1];
+  color[2] = Intensity * Color[2];
   color[3] = 1.0;
 
   FocalPoint = aLight->GetFocalPoint();
@@ -398,8 +401,6 @@ void vtkRIBExporter::WriteLight (vtkLight *aLight, int count)
   else
     {
     double coneAngle = aLight->GetConeAngle ();
-    double coneAngleRadians = vtkMath::RadiansFromDegrees(coneAngle);
-
     double exponent = aLight->GetExponent ();
     fprintf (this->FilePtr, "LightSource \"spotlight\" %d ", count);
     fprintf (this->FilePtr, "\"intensity\" [%f] ", Intensity);
@@ -409,7 +410,7 @@ void vtkRIBExporter::WriteLight (vtkLight *aLight, int count)
         Position[0], Position[1], Position[2]);
     fprintf (this->FilePtr, "\"to\" [%f %f %f]\n",
         FocalPoint[0], FocalPoint[1], FocalPoint[2]);
-    fprintf (this->FilePtr, "\"coneangle\" [%f]\n", coneAngleRadians);
+    fprintf (this->FilePtr, "\"coneangle\" [%f]\n", coneAngle);
     fprintf (this->FilePtr, "\"beamdistribution\" [%f]\n", exponent);
     fprintf (this->FilePtr, "\"conedeltaangle\" [%f]\n", 0.0);
     }
@@ -711,7 +712,7 @@ void vtkRIBExporter::WritePolygons (vtkPolyData *polyData,
     case VTK_SURFACE:
       break;
     default:
-      vtkErrorMacro(<< "Bad representation. Only Surface is supported.");
+      vtkErrorMacro(<< "Bad representation sent\n");
       break;
     }
 
@@ -942,7 +943,7 @@ void vtkRIBExporter::WriteStrips (vtkPolyData *polyData,
     case VTK_SURFACE:
       break;
     default:
-      vtkErrorMacro(<< "Bad representation. Only Surface is supported.");
+      vtkErrorMacro(<< "Bad representation sent\n");
       break;
     }
 
diff --git a/IO/Export/vtkRIBExporter.h b/IO/Export/vtkRIBExporter.h
index 53c417e..01a11e9 100644
--- a/IO/Export/vtkRIBExporter.h
+++ b/IO/Export/vtkRIBExporter.h
@@ -35,13 +35,13 @@
 // Tcl Example: generate a rib file for the current rendering.
 // vtkRIBExporter myRIB
 //   myRIB SetInput $renWin
-//   myRIB SetFilePrefix mine
+//   myRIB SetFIlePrefix mine
 //   myRIB Write
 // This will create a file mine.rib. After running this file through
 // a Renderman renderer a file mine.tif will contain the rendered image.
 //
 // .SECTION See Also
-// vtkExporter vtkRIBProperty vtkRIBLight
+// vtkExporter vtkRIBProperty
 
 
 #ifndef vtkRIBExporter_h
@@ -79,7 +79,7 @@ public:
 
   // Description:
   // Specify the prefix of the files to write out. The resulting file names
-  // will have .rib appended to them.
+  // will have .RIB appended to them.
   vtkSetStringMacro(FilePrefix);
   vtkGetStringMacro(FilePrefix);
 
@@ -111,7 +111,7 @@ public:
   // Description:
   // Set or get the ExportArrays. If ExportArrays is set, then
   // all point data, field data, and cell data arrays will get
-  // exported together with polygons. Default is Off (0).
+  // exported together with polygons.
   vtkSetClampMacro(ExportArrays, int, 0, 1);
   vtkBooleanMacro(ExportArrays, int);
   vtkGetMacro(ExportArrays, int);
diff --git a/IO/Export/vtkRIBLight.h b/IO/Export/vtkRIBLight.h
index 97ad2d4..9786676 100644
--- a/IO/Export/vtkRIBLight.h
+++ b/IO/Export/vtkRIBLight.h
@@ -15,11 +15,10 @@
 // .NAME vtkRIBLight - RIP Light
 // .SECTION Description
 // vtkRIBLight is a subclass of vtkLight that allows the user to
-// specify light source shaders and shadow casting lights for use with
-// RenderMan.
+// specify light source shaders and shadow casting lights for use with RenderMan.
 //
 // .SECTION See Also
-// vtkRIBExporter vtkRIBProperty
+// vtkRIBExporter
 
 #ifndef vtkRIBLight_h
 #define vtkRIBLight_h
diff --git a/IO/Export/vtkRIBProperty.cxx b/IO/Export/vtkRIBProperty.cxx
index 5750422..4011366 100644
--- a/IO/Export/vtkRIBProperty.cxx
+++ b/IO/Export/vtkRIBProperty.cxx
@@ -20,13 +20,10 @@ vtkStandardNewMacro(vtkRIBProperty);
 vtkRIBProperty::vtkRIBProperty ()
 {
   this->Declarations = NULL;
-  this->SurfaceShaderParameters = NULL;
-  this->DisplacementShaderParameters = NULL;
+  this->Parameters = NULL;
   this->SurfaceShader = new char[strlen("plastic") + 1];
   strcpy (this->SurfaceShader, "plastic");
   this->DisplacementShader = NULL;
-  this->SurfaceShaderUsesDefaultParameters = true;
-
   // create a vtkProperty that can be rendered
   this->Property = vtkProperty::New ();
 }
@@ -42,8 +39,7 @@ vtkRIBProperty::~vtkRIBProperty()
     this->Property->Delete ();
     }
 
-  delete [] this->SurfaceShaderParameters;
-  delete [] this->DisplacementShaderParameters;
+  delete [] this->Parameters;
 }
 
 void vtkRIBProperty::Render(vtkActor *anActor, vtkRenderer *ren)
@@ -53,27 +49,28 @@ void vtkRIBProperty::Render(vtkActor *anActor, vtkRenderer *ren)
   // Copy this property's ivars into the property to be rendered
   ref = this->Property->GetReferenceCount();
   this->Property->DeepCopy(this);
+  //this->Property->SetDeleteMethod(NULL);
   this->Property->SetReferenceCount(ref);
 
   // Render the property
   this->Property->Render (anActor, ren);
 }
 
-void vtkRIBProperty::SetVariable (const char *variable, const char *value)
+void vtkRIBProperty::SetVariable (char *variable, char *value)
 {
   delete [] this->Declarations;
 
   // format of line is: Declare "variable" "type"\n
   this->Declarations = new char [strlen ("Declare ") +
-                                 strlen (variable) +
-                                 strlen (value) +
-                                 8];
+                              strlen (variable) +
+                              strlen (value) +
+                              8];
 
   sprintf (this->Declarations, "Declare \"%s\" \"%s\"\n", variable, value);
   this->Modified ();
 }
 
-void vtkRIBProperty::AddVariable (const char *variable, const char *value)
+void vtkRIBProperty::AddVariable (char *variable, char *value)
 {
   if (this->Declarations == NULL)
     {
@@ -98,106 +95,46 @@ void vtkRIBProperty::AddVariable (const char *variable, const char *value)
     }
 }
 
-void vtkRIBProperty::SetParameter (const char *parameter, const char *value)
-{
-  vtkWarningMacro("vtkRIBProperty::SetParameter is deprecated. Using SetSurfaceShaderParameter instead.");
-  this->SetSurfaceShaderParameter(parameter, value);
-}
-
-void vtkRIBProperty::SetSurfaceShaderParameter (const char *parameter, const char *value)
-{
-  delete [] this->SurfaceShaderParameters;
-
-  // format of line is: "parameter" "value"
-  this->SurfaceShaderParameters = new char [strlen (parameter) +
-                                                  strlen (value) +
-                                                  7];
-
-  sprintf (this->SurfaceShaderParameters, " \"%s\" [%s]", parameter, value);
-  this->Modified ();
-}
-
-void vtkRIBProperty::SetDisplacementShaderParameter (const char *parameter, const char *value)
+void vtkRIBProperty::SetParameter (char *parameter, char *value)
 {
-  delete [] this->DisplacementShaderParameters;
+  delete [] this->Parameters;
 
   // format of line is: "parameter" "value"
-  this->DisplacementShaderParameters = new char [strlen (parameter) +
-                                                  strlen (value) +
-                                                  7];
+  this->Parameters = new char [strlen (parameter) +
+                              strlen (value) +
+                              7];
 
-  sprintf (this->DisplacementShaderParameters, " \"%s\" [%s]", parameter, value);
+  sprintf (this->Parameters, " \"%s\" [%s]", parameter, value);
   this->Modified ();
 }
 
-void vtkRIBProperty::AddParameter (const char *parameter, const char *value)
+void vtkRIBProperty::AddParameter (char *Parameter, char *value)
 {
-  vtkWarningMacro("vtkRIBProperty::AddParameter is deprecated. Using AddSurfaceShaderParameter instead.");
-  this->AddSurfaceShaderParameter(parameter, value);
-}
-
-void vtkRIBProperty::AddSurfaceShaderParameter (const char *SurfaceShaderParameter, const char *value)
-{
-  if (this->SurfaceShaderParameters == NULL)
+  if (this->Parameters == NULL)
     {
-    this->SetSurfaceShaderParameter (SurfaceShaderParameter, value);
+    this->SetParameter (Parameter, value);
     }
   else
     {
-    char *newSurfaceShaderParameter = new char [strlen (SurfaceShaderParameter) +
+    char *newParameter = new char [strlen (Parameter) +
                                   strlen (value) +
                                   7];
 
-    sprintf (newSurfaceShaderParameter, " \"%s\" [%s]", SurfaceShaderParameter, value);
-    char *oldSurfaceShaderParameters = this->SurfaceShaderParameters;
+    sprintf (newParameter, " \"%s\" [%s]", Parameter, value);
+    char *oldParameters = this->Parameters;
 
-    this->SurfaceShaderParameters = new char [strlen (oldSurfaceShaderParameters) + strlen (newSurfaceShaderParameter) + 1];
-    strcpy (this->SurfaceShaderParameters, oldSurfaceShaderParameters);
-    strcat (this->SurfaceShaderParameters, newSurfaceShaderParameter);
-    delete [] oldSurfaceShaderParameters;
-    delete [] newSurfaceShaderParameter;
-    this->Modified ();
-    }
-}
-
-void vtkRIBProperty::AddDisplacementShaderParameter (const char *DisplacementShaderParameter, const char *value)
-{
-  if (this->DisplacementShaderParameters == NULL)
-    {
-    this->SetDisplacementShaderParameter (DisplacementShaderParameter, value);
-    }
-  else
-    {
-    char *newDisplacementShaderParameter = new char [strlen (DisplacementShaderParameter) +
-                                  strlen (value) +
-                                  7];
-
-    sprintf (newDisplacementShaderParameter, " \"%s\" [%s]", DisplacementShaderParameter, value);
-    char *oldDisplacementShaderParameters = this->DisplacementShaderParameters;
-
-    this->DisplacementShaderParameters = new char [strlen (oldDisplacementShaderParameters) + strlen (newDisplacementShaderParameter) + 1];
-    strcpy (this->DisplacementShaderParameters, oldDisplacementShaderParameters);
-    strcat (this->DisplacementShaderParameters, newDisplacementShaderParameter);
-    delete [] oldDisplacementShaderParameters;
-    delete [] newDisplacementShaderParameter;
+    this->Parameters = new char [strlen (oldParameters) + strlen (newParameter) + 1];
+    strcpy (this->Parameters, oldParameters);
+    strcat (this->Parameters, newParameter);
+    delete [] oldParameters;
+    delete [] newParameter;
     this->Modified ();
     }
 }
 
 char *vtkRIBProperty::GetParameters ()
 {
-  vtkWarningMacro("vtkRIBProperty::GetParameters is deprecated. Using GetSurfaceShaderParameter instead.");
-  return this->GetSurfaceShaderParameters();
-}
-
-char *vtkRIBProperty::GetSurfaceShaderParameters ()
-{
-  return this->SurfaceShaderParameters;
-}
-
-char *vtkRIBProperty::GetDisplacementShaderParameters ()
-{
-  return this->DisplacementShaderParameters;
+  return this->Parameters;
 }
 
 char *vtkRIBProperty::GetDeclarations ()
@@ -233,23 +170,14 @@ void vtkRIBProperty::PrintSelf(ostream& os, vtkIndent indent)
     {
     os << indent << "Declarations: (none)\n";
     }
-  if (this->SurfaceShaderParameters)
+  if (this->Parameters)
     {
-    os << indent << "SurfaceShaderParameters: " << this->SurfaceShaderParameters;
+    os << indent << "Parameters: " << this->Parameters;
     }
   else
     {
-    os << indent << "SurfaceShaderParameters: (none)\n";
-    }
-  if (this->DisplacementShaderParameters)
-    {
-    os << indent << "DisplacementShaderParameters: " << this->DisplacementShaderParameters;
+    os << indent << "Parameters: (none)\n";
     }
-  else
-    {
-    os << indent << "DisplacementShaderParameters: (none)\n";
-    }
-  os << indent << "SurfaceShaderUsesDefaultParameters: "
-     << this->GetSurfaceShaderUsesDefaultParameters() << std::endl;
+
 }
 
diff --git a/IO/Export/vtkRIBProperty.h b/IO/Export/vtkRIBProperty.h
index 0ca04a9..5a797b3 100644
--- a/IO/Export/vtkRIBProperty.h
+++ b/IO/Export/vtkRIBProperty.h
@@ -15,12 +15,12 @@
 // .NAME vtkRIBProperty - RIP Property
 // .SECTION Description
 // vtkRIBProperty is a subclass of vtkProperty that allows the user to
-// specify named shaders for use with RenderMan. Both surface
-// and displacement shaders can be specified. Parameters
-// for the shaders can be declared and set.
+// specify named shaders for use with RenderMan. Both a surface shader
+// and displacement shader can be specified. Parameters for the shaders
+// can be declared and set.
 //
 // .SECTION See Also
-// vtkRIBExporter vtkRIBLight
+// vtkRIBExporter
 
 #ifndef vtkRIBProperty_h
 #define vtkRIBProperty_h
@@ -38,20 +38,6 @@ public:
   void PrintSelf(ostream& os, vtkIndent indent);
 
   // Description:
-  // If true (default) the surface shader uses the usual shader parameters:
-  // Ka - Ambient amount
-  // Kd - Diffuse amount
-  // Ks - Specular amount
-  // Roughness
-  // SpecularColor
-  // Additional surface shader parameters can be added with the
-  // Set/AddSurfaceShaderParameter methods.
-  // If false, all surface shader parameters must be specified
-  vtkSetMacro(SurfaceShaderUsesDefaultParameters, bool);
-  vtkGetMacro(SurfaceShaderUsesDefaultParameters, bool);
-  vtkBooleanMacro(SurfaceShaderUsesDefaultParameters, bool);
-
-  // Description:
   // Specify the name of a surface shader.
   vtkSetStringMacro(SurfaceShader);
   vtkGetStringMacro(SurfaceShader);
@@ -63,8 +49,8 @@ public:
 
   // Description:
   // Specify declarations for variables..
-  void SetVariable (const char *variable, const char *declaration);
-  void AddVariable (const char *variable, const char *declaration);
+  void SetVariable (char *variable, char *declaration);
+  void AddVariable (char *variable, char *declaration);
 
   // Description:
   // Get variable declarations
@@ -72,25 +58,12 @@ public:
 
   // Description:
   // Specify parameter values for variables.
-  // DEPRECATED: use (Set/Add)SurfaceShaderParameter instead.
-  void SetParameter (const char *parameter, const char *value);
-  void AddParameter (const char *parameter, const char *value);
-
-  // Description:
-  // Specify parameter values for surface shader parameters
-  void SetSurfaceShaderParameter (const char *parameter, const char *value);
-  void AddSurfaceShaderParameter (const char *parameter, const char *value);
-
-  // Description:
-  // Specify parameter values for displacement shader parameters
-  void SetDisplacementShaderParameter (const char *parameter, const char *value);
-  void AddDisplacementShaderParameter (const char *parameter, const char *value);
+  void SetParameter (char *parameter, char *value);
+  void AddParameter (char *parameter, char *value);
 
   // Description:
   // Get parameters.
-  char *GetParameters (); // DEPRECATED: use GetSurfaceShaderParameters instead.
-  char *GetSurfaceShaderParameters ();
-  char *GetDisplacementShaderParameters ();
+  char *GetParameters ();
 
 protected:
   vtkRIBProperty();
@@ -101,10 +74,7 @@ protected:
   char *SurfaceShader;
   char *DisplacementShader;
   char *Declarations;
-  char *SurfaceShaderParameters;
-  char *DisplacementShaderParameters;
-  bool SurfaceShaderUsesDefaultParameters;
-
+  char *Parameters;
 private:
   vtkRIBProperty(const vtkRIBProperty&);  // Not implemented.
   void operator=(const vtkRIBProperty&);  // Not implemented.
diff --git a/IO/Export/vtkX3DExporter.cxx b/IO/Export/vtkX3DExporter.cxx
index 51671e4..0a37b79 100644
--- a/IO/Export/vtkX3DExporter.cxx
+++ b/IO/Export/vtkX3DExporter.cxx
@@ -91,14 +91,19 @@ vtkX3DExporter::vtkX3DExporter()
   this->OutputString = NULL;
   this->OutputStringLength = 0;
 }
-
 //----------------------------------------------------------------------------
 vtkX3DExporter::~vtkX3DExporter()
 {
   this->SetFileName(0);
-  delete [] this->OutputString;
+  if (this->OutputString)
+    {
+    delete [] this->OutputString;
+    this->OutputString = NULL;
+    this->OutputStringLength = 0;
+    }
 }
 
+
 //----------------------------------------------------------------------------
 void vtkX3DExporter::WriteData()
 {
diff --git a/IO/FFMPEG/vtkFFMPEGWriter.cxx b/IO/FFMPEG/vtkFFMPEGWriter.cxx
index d3fd421..ed9e5b6 100644
--- a/IO/FFMPEG/vtkFFMPEGWriter.cxx
+++ b/IO/FFMPEG/vtkFFMPEGWriter.cxx
@@ -36,9 +36,7 @@ extern "C" {
 #endif
 }
 
-#ifdef __GNUC__
 #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-#endif
 
 #if LIBAVCODEC_VERSION_MAJOR < 55
 # define AV_CODEC_ID_MJPEG CODEC_ID_MJPEG
diff --git a/IO/GDAL/CMakeLists.txt b/IO/GDAL/CMakeLists.txt
index eb1b582..9cb8fe6 100644
--- a/IO/GDAL/CMakeLists.txt
+++ b/IO/GDAL/CMakeLists.txt
@@ -4,7 +4,7 @@ mark_as_advanced(GDAL_INCLUDE_DIR GDAL_LIBRARY)
 set(GDAL_SRCS vtkGDAL.cxx vtkGDALVectorReader.cxx vtkGDALRasterReader.cxx)
 
 include_directories(${GDAL_INCLUDE_DIRS})
-set_source_files_properties(vtkGDAL WRAP_EXCLUDE)
+set_source_files_properties(vtkGDAL.h WRAP_EXCLUDE)
 
 vtk_module_library(vtkIOGDAL ${GDAL_SRCS})
 
diff --git a/IO/GDAL/vtkGDAL.h b/IO/GDAL/vtkGDAL.h
index 5b85215..f53aaa2 100644
--- a/IO/GDAL/vtkGDAL.h
+++ b/IO/GDAL/vtkGDAL.h
@@ -16,8 +16,8 @@
 // .SECTION Description
 // .SECTION See Also
 
-#ifndef vtkGDAL_h
-#define vtkGDAL_h
+#ifndef __vtkGDAL_h
+#define __vtkGDAL_h
 
 #include "vtkObject.h"
 #include <vtkIOGDALModule.h> // For export macro
@@ -40,5 +40,5 @@ class VTKIOGDAL_EXPORT vtkGDAL : public vtkObject
   void operator=(const vtkGDAL&); // Not implemented
 };
 
-#endif // vtkGDAL_h
+#endif // __vtkGDAL_h
 // VTK-HeaderTest-Exclude: vtkGDAL.h
diff --git a/IO/GDAL/vtkGDALRasterReader.cxx b/IO/GDAL/vtkGDALRasterReader.cxx
index 4fb036b..3a4732a 100644
--- a/IO/GDAL/vtkGDALRasterReader.cxx
+++ b/IO/GDAL/vtkGDALRasterReader.cxx
@@ -24,7 +24,6 @@
 #include <vtkInformationVector.h>
 #include <vtkInformation.h>
 #include <vtkIntArray.h>
-#include <vtkMath.h>
 #include <vtkObjectFactory.h>
 #include <vtkPointData.h>
 #include <vtkPoints.h>
@@ -444,8 +443,11 @@ void vtkGDALRasterReader::vtkGDALRasterReaderInternal::GenericReadData()
 //----------------------------------------------------------------------------
 void vtkGDALRasterReader::vtkGDALRasterReaderInternal::ReleaseData()
 {
-  delete this->GDALData;
-  this->GDALData = 0;
+  if (this->GDALData)
+    {
+    delete this->GDALData;
+    this->GDALData = 0;
+    }
 }
 
 //-----------------------------------------------------------------------------
@@ -648,7 +650,11 @@ vtkGDALRasterReader::vtkGDALRasterReader() : vtkImageReader2(),
 //-----------------------------------------------------------------------------
 vtkGDALRasterReader::~vtkGDALRasterReader()
 {
-  delete this->Implementation;
+  if (this->Implementation)
+    {
+    delete this->Implementation;
+    this->Implementation = 0;
+    }
 
   if (this->FileName)
     {
@@ -747,28 +753,6 @@ int vtkGDALRasterReader::RequestData(vtkInformation* vtkNotUsed(request),
   this->Implementation->UniformGridData->GetFieldData()->AddArray(
     projectionData);
 
-  // Add NoDataValue as field data
-  // GDALDatset can have 1 value for each raster band
-  // Use NaN for undefined values
-  vtkSmartPointer<vtkDoubleArray> noDataArray =
-    vtkSmartPointer<vtkDoubleArray>::New();
-  noDataArray->SetName("NO_DATA_VALUE");
-  noDataArray->SetNumberOfComponents(1);
-  noDataArray->SetNumberOfTuples(this->Implementation->NumberOfBands);
-  for (int i=0; i<this->Implementation->NumberOfBands; ++i)
-    {
-    int success = 0;
-    double noDataValue = this->Implementation->GDALData->GetRasterBand(
-      i+1)->GetNoDataValue(&success);
-    if (!success)
-      {
-      noDataValue = vtkMath::Nan();
-      }
-     noDataArray->SetValue(i, noDataValue);
-    }
-  this->Implementation->UniformGridData->GetFieldData()->AddArray(
-    noDataArray);
-
   // Check if file has been changed here.
   // If changed then throw the vtxId time and load a new one.
   vtkInformation* outInfo = outputVector->GetInformationObject(0);
diff --git a/IO/Geometry/CMakeLists.txt b/IO/Geometry/CMakeLists.txt
index a9ac040..f8ea0ad 100644
--- a/IO/Geometry/CMakeLists.txt
+++ b/IO/Geometry/CMakeLists.txt
@@ -13,10 +13,13 @@ SET(Module_SRCS
   vtkMCubesWriter.cxx
   vtkMFIXReader.cxx
   vtkMoleculeReaderBase.cxx
+  vtkMultiBlockPLOT3DReader.cxx
+  vtkMultiBlockPLOT3DReaderInternals.cxx
   vtkOBJReader.cxx
   vtkOpenFOAMReader.cxx
   vtkParticleReader.cxx
   vtkPDBReader.cxx
+  vtkPlot3DMetaReader.cxx
   vtkProStarReader.cxx
   vtkSTLReader.cxx
   vtkSTLWriter.cxx
@@ -31,4 +34,9 @@ set_source_files_properties(
   ABSTRACT
   )
 
+set_source_files_properties(
+  vtkMultiBlockPLOT3DReaderInternals
+  WRAP_EXCLUDE
+  )
+
 vtk_module_library(vtkIOGeometry ${Module_SRCS})
diff --git a/IO/Geometry/Testing/Cxx/TestIncrementalOctreePointLocator.cxx b/IO/Geometry/Testing/Cxx/TestIncrementalOctreePointLocator.cxx
index 63ff25d..56246de 100644
--- a/IO/Geometry/Testing/Cxx/TestIncrementalOctreePointLocator.cxx
+++ b/IO/Geometry/Testing/Cxx/TestIncrementalOctreePointLocator.cxx
@@ -415,7 +415,6 @@ int TestIncrementalOctreePointLocator( int argc, char * argv[] )
     {
     cerr << "IO error " << __FILE__ << ":" << __LINE__ << "\n";
     fclose(pntsFile);
-    free(pDataPts);
     return 1;
     }
   #ifdef VTK_WORDS_BIGENDIAN
@@ -430,10 +429,6 @@ int TestIncrementalOctreePointLocator( int argc, char * argv[] )
     {
     cerr << "IO error " << __FILE__ << ":" << __LINE__ << "\n";
     fclose(pntsFile);
-    free(pLocPnts);
-    free(minDist2);
-    free(maxDist2);
-    free(pDataPts);
     return 1;
     }
   //fread( minDist2, sizeof( double ), nLocPnts,     pntsFile );
diff --git a/IO/Geometry/Testing/Cxx/TestWindBladeReader.cxx b/IO/Geometry/Testing/Cxx/TestWindBladeReader.cxx
index 3d0625f..2e8f668 100644
--- a/IO/Geometry/Testing/Cxx/TestWindBladeReader.cxx
+++ b/IO/Geometry/Testing/Cxx/TestWindBladeReader.cxx
@@ -133,7 +133,6 @@ int TestWindBladeReader( int argc, char *argv[] )
   bounds[2] -= 150;
   ren->ResetCamera(bounds);
   camera->Elevation(-90);
-  camera->SetViewUp(0,0,1);
   camera->Zoom(1.2);
 
   ren->AddActor(fieldActor);
diff --git a/IO/Geometry/module.cmake b/IO/Geometry/module.cmake
index bdea649..67d5d46 100644
--- a/IO/Geometry/module.cmake
+++ b/IO/Geometry/module.cmake
@@ -8,6 +8,7 @@ vtk_module(vtkIOGeometry
     vtkIOCore
   PRIVATE_DEPENDS
     vtkzlib
+    vtkjsoncpp
     vtksys
   TEST_DEPENDS
     vtkIOAMR
diff --git a/IO/Geometry/vtkAVSucdReader.cxx b/IO/Geometry/vtkAVSucdReader.cxx
index dab4cc4..69251f6 100644
--- a/IO/Geometry/vtkAVSucdReader.cxx
+++ b/IO/Geometry/vtkAVSucdReader.cxx
@@ -846,9 +846,25 @@ void vtkAVSucdReader::ReadNodeData(vtkUnstructuredGrid *output)
         scalars->SetNumberOfTuples(this->NumberOfNodes);
         scalars->SetName(PointDataArraySelection->GetArrayName(i));
         this->FileStream->seekg(this->NodeDataInfo[i].foffset, ios::beg);
-        ptr = scalars->GetPointer(0);
-        this->ReadFloatBlock(this->NumberOfNodes *
-                             this->NodeDataInfo[i].veclen, ptr);
+        if(1) // this->NodeDataInfo[i].veclen == 1)
+          {
+          ptr = scalars->GetPointer(0);
+          this->ReadFloatBlock(this->NumberOfNodes *
+                               this->NodeDataInfo[i].veclen, ptr);
+          }
+        else
+          {
+          ptr = new float[this->NodeDataInfo[i].veclen];
+          for(n=0; n < this->NumberOfNodes; n++)
+            {
+            this->ReadFloatBlock(this->NodeDataInfo[i].veclen, ptr);
+            for(j=0; j < this->NodeDataInfo[i].veclen; j++)
+              {
+              scalars->SetComponent(n, j, ptr[j]);
+              }
+            }
+          delete [] ptr;
+          }
 
         output->GetPointData()->AddArray(scalars);
         if (!output->GetPointData()->GetScalars())
@@ -941,9 +957,29 @@ void vtkAVSucdReader::ReadCellData(vtkUnstructuredGrid *output)
         scalars->SetNumberOfTuples(this->NumberOfCells);
         scalars->SetName(CellDataArraySelection->GetArrayName(i));
         this->FileStream->seekg(this->CellDataInfo[i].foffset, ios::beg);
-        ptr = scalars->GetPointer(0);
-        this->ReadFloatBlock(this->NumberOfCells *
-                             this->CellDataInfo[i].veclen, ptr);
+        if(1) // this->CellDataInfo[i].veclen == 1)
+          {
+          ptr = scalars->GetPointer(0);
+          this->ReadFloatBlock(this->NumberOfCells *
+                               this->CellDataInfo[i].veclen, ptr);
+          }
+        else
+          {
+          ptr = new float[this->NumberOfCells];
+          for(j=0; j < this->CellDataInfo[i].veclen; j++)
+            {
+            this->FileStream->seekg(this->CellDataInfo[i].foffset +
+                            j*this->NumberOfCells,
+                            ios::beg);
+            this->ReadFloatBlock(this->NumberOfCells, ptr);
+
+            for(n=0; n < this->NumberOfCells; n++)
+              {
+              scalars->SetComponent(n, j, ptr[n]);
+              }
+            }
+          delete [] ptr;
+          }
 
         output->GetCellData()->AddArray(scalars);
         if (!output->GetCellData()->GetScalars())
diff --git a/IO/Geometry/vtkCGMWriter.cxx b/IO/Geometry/vtkCGMWriter.cxx
index 5b4eb2b..e6bc3a5 100644
--- a/IO/Geometry/vtkCGMWriter.cxx
+++ b/IO/Geometry/vtkCGMWriter.cxx
@@ -973,6 +973,7 @@ static int cgmcomheadlong(unsigned char *es, int elemclass, int id, int len)
   /* now set the second two bytes */
   cgmAppShort(es, static_cast<short int>(len));
   *es = *es & 0177; /* make bit 15 = 0 */
+  es += 2;
 
   return 1;
 }
diff --git a/IO/Geometry/vtkChacoReader.cxx b/IO/Geometry/vtkChacoReader.cxx
index 1df9f49..d0d45f1 100644
--- a/IO/Geometry/vtkChacoReader.cxx
+++ b/IO/Geometry/vtkChacoReader.cxx
@@ -1248,15 +1248,21 @@ done:
     /* Graph was empty */
     delete [] *start;
     *start = NULL;
-
-    delete [] *adjacency;
-    *adjacency = NULL;
-
-    delete [] *vweights;
-    *vweights = NULL;
-
-    delete [] *eweights;
-    *eweights = NULL;
+    if (adjacency)
+      {
+      delete [] *adjacency;
+      *adjacency = NULL;
+      }
+    if (vweights)
+      {
+      delete [] *vweights;
+      *vweights = NULL;
+      }
+    if (eweights)
+      {
+      delete [] *eweights;
+      *eweights = NULL;
+      }
     }
 
   return retVal;
diff --git a/IO/Geometry/vtkMFIXReader.cxx b/IO/Geometry/vtkMFIXReader.cxx
index efd362a..a6d2ed8 100644
--- a/IO/Geometry/vtkMFIXReader.cxx
+++ b/IO/Geometry/vtkMFIXReader.cxx
@@ -734,6 +734,20 @@ void vtkMFIXReader::EnableAllCellArrays()
   this->CellDataArraySelection->EnableAllArrays();
 }
 
+#if !defined(VTK_LEGACY_REMOVE)
+//----------------------------------------------------------------------------
+void vtkMFIXReader::GetCellDataRange(int cellComp, int /* index */,
+     float *min, float *max)
+{
+#if !defined(VTK_LEGACY_SILENT)
+  vtkGenericWarningMacro("vtkMFIXReader::GetCellDataRange with \"index\" was deprecated in VTK 6.0");
+#endif
+
+  *min = this->Minimum->GetValue(cellComp);
+  *max = this->Maximum->GetValue(cellComp);
+}
+#endif
+
 //----------------------------------------------------------------------------
 void vtkMFIXReader::GetCellDataRange(int cellComp, float *min, float *max)
 {
@@ -1595,7 +1609,7 @@ void vtkMFIXReader::ReadRestartFile()
 //----------------------------------------------------------------------------
 void vtkMFIXReader::CreateVariableNames()
 {
-  char fileName[VTK_MAXPATH];
+  char fileName[256];
   int cnt = 0;
   char uString[120];
   char vString[120];
@@ -1919,7 +1933,7 @@ void vtkMFIXReader::CreateVariableNames()
 void vtkMFIXReader::GetTimeSteps()
 {
   int nextRecord, numberOfRecords;
-  char fileName[VTK_MAXPATH];
+  char fileName[256];
   int cnt = 0;
 
   for (int i=0; i<this->NumberOfSPXFilesUsed; ++i)
@@ -2115,7 +2129,7 @@ void vtkMFIXReader::GetVariableAtTimestep(int vari , int tstep,
   char variableName[256];
   strcpy(variableName, this->VariableNames->GetValue(vari));
   int spx = this->VariableIndexToSPX->GetValue(vari);
-  char fileName[VTK_MAXPATH];
+  char fileName[256];
 
   for(int k=0;k<(int)sizeof(fileName);k++)
     {
@@ -2310,7 +2324,7 @@ void vtkMFIXReader::GetAllTimes(vtkInformationVector *outputVector)
       }
     }
 
-  char fileName[VTK_MAXPATH];
+  char fileName[256];
 
   for(int k=0;k<(int)sizeof(fileName);k++)
     {
diff --git a/IO/Geometry/vtkMFIXReader.h b/IO/Geometry/vtkMFIXReader.h
index 4d73d45..77e6a7f 100644
--- a/IO/Geometry/vtkMFIXReader.h
+++ b/IO/Geometry/vtkMFIXReader.h
@@ -108,6 +108,11 @@ public:
   void EnableAllCellArrays();
 
   // Description:
+  // Get the range of cell data. The index parameter is ignored.
+  // @deprecated Replaced by GetCellDataRange as of VTK 6.0
+  VTK_LEGACY(void GetCellDataRange(int cellComp, int index, float *min, float *max));
+
+  // Description:
   // Get the range of cell data.
   void GetCellDataRange(int cellComp, float *min, float *max);
 
diff --git a/IO/Geometry/vtkMultiBlockPLOT3DReader.cxx b/IO/Geometry/vtkMultiBlockPLOT3DReader.cxx
new file mode 100644
index 0000000..7522aee
--- /dev/null
+++ b/IO/Geometry/vtkMultiBlockPLOT3DReader.cxx
@@ -0,0 +1,2819 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+  Module:    vtkMultiBlockPLOT3DReader.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 "vtkMultiBlockPLOT3DReader.h"
+
+#include "vtkByteSwap.h"
+#include "vtkCompositeDataPipeline.h"
+#include "vtkDoubleArray.h"
+#include "vtkErrorCode.h"
+#include "vtkFieldData.h"
+#include "vtkFloatArray.h"
+#include "vtkMultiBlockDataSet.h"
+#include "vtkInformation.h"
+#include "vtkInformationVector.h"
+#include "vtkIntArray.h"
+#include "vtkObjectFactory.h"
+#include "vtkPointData.h"
+#include "vtkStreamingDemandDrivenPipeline.h"
+#include "vtkStructuredGrid.h"
+#include "vtkUnsignedCharArray.h"
+#include "vtkIdList.h"
+#include "vtkCellData.h"
+
+#include "vtkMultiBlockPLOT3DReaderInternals.h"
+
+vtkStandardNewMacro(vtkMultiBlockPLOT3DReader);
+
+#define VTK_RHOINF 1.0
+#define VTK_CINF 1.0
+#define VTK_PINF ((VTK_RHOINF*VTK_CINF) * (VTK_RHOINF*VTK_CINF) / this->Gamma)
+#define VTK_CV (this->R / (this->Gamma-1.0))
+
+template <class DataType>
+class vtkPLOT3DArrayReader
+{
+public:
+  vtkPLOT3DArrayReader() : ByteOrder(
+    vtkMultiBlockPLOT3DReader::FILE_BIG_ENDIAN)
+    {
+    }
+
+  int ReadScalar(FILE* fp, int n, DataType* scalar)
+    {
+      int retVal = static_cast<int>(fread(scalar, sizeof(DataType), n, fp));
+      if (this->ByteOrder == vtkMultiBlockPLOT3DReader::FILE_LITTLE_ENDIAN)
+        {
+        if (sizeof(DataType) == 4)
+          {
+          vtkByteSwap::Swap4LERange(scalar, n);
+          }
+        else
+          {
+          vtkByteSwap::Swap8LERange(scalar, n);
+          }
+        }
+      else
+        {
+        if (sizeof(DataType) == 4)
+          {
+          vtkByteSwap::Swap4BERange(scalar, n);
+          }
+        else
+          {
+          vtkByteSwap::Swap8BERange(scalar, n);
+          }
+        }
+      return retVal;
+    }
+
+  int ReadVector(FILE* fp, int n, int numDims, DataType* vector)
+    {
+      // Setting to 0 in case numDims == 0. We still need to
+      // populate an array with 3 components but the code below
+      // does not read the 3rd component (it doesn't exist
+      // in the file)
+      memset(vector, 0, n*3*sizeof(DataType));
+
+      int retVal = 0;
+      DataType* buffer = new DataType[n];
+      for (int component = 0; component < numDims; component++)
+        {
+        retVal += this->ReadScalar(fp, n, buffer);
+        for (int i=0; i<n; i++)
+          {
+          vector[3*i+component] = buffer[i];
+          }
+        }
+      delete[] buffer;
+
+      return retVal;
+    }
+
+  int ByteOrder;
+};
+
+vtkMultiBlockPLOT3DReader::vtkMultiBlockPLOT3DReader()
+{
+  this->Internal = new vtkMultiBlockPLOT3DReaderInternals;
+
+  this->XYZFileName = NULL;
+  this->QFileName = NULL;
+  this->FunctionFileName = NULL;
+  this->BinaryFile = 1;
+  this->HasByteCount = 0;
+  this->FileSize = 0;
+  this->MultiGrid = 0;
+  this->ForceRead = 0;
+  this->ByteOrder = FILE_BIG_ENDIAN;
+  this->IBlanking = 0;
+  this->TwoDimensionalGeometry = 0;
+  this->DoublePrecision = 0;
+  this->AutoDetectFormat = 0;
+
+  this->R = 1.0;
+  this->Gamma = 1.4;
+
+  this->FunctionList = vtkIntArray::New();
+
+  this->ScalarFunctionNumber = -1;
+  this->SetScalarFunctionNumber(100);
+  this->VectorFunctionNumber = -1;
+  this->SetVectorFunctionNumber(202);
+
+  this->SetNumberOfInputPorts(0);
+}
+
+vtkMultiBlockPLOT3DReader::~vtkMultiBlockPLOT3DReader()
+{
+  delete [] this->XYZFileName;
+  delete [] this->QFileName;
+  delete [] this->FunctionFileName;
+  this->FunctionList->Delete();
+  this->ClearGeometryCache();
+
+  delete this->Internal;
+}
+
+void vtkMultiBlockPLOT3DReader::ClearGeometryCache()
+{
+  this->Internal->Blocks.clear();
+}
+
+int vtkMultiBlockPLOT3DReader::AutoDetectionCheck(FILE* fp)
+{
+  this->Internal->CheckBinaryFile(fp);
+
+  if (!this->Internal->BinaryFile)
+    {
+    vtkDebugMacro("Auto-detection only works with binary files.");
+    if (this->BinaryFile)
+      {
+      vtkWarningMacro("This appears to be an ASCII file. Please make sure "
+                      "that all settings are correct to read it correctly.");
+      }
+    this->Internal->ByteOrder = this->ByteOrder;
+    this->Internal->HasByteCount = this->HasByteCount;
+    this->Internal->MultiGrid = this->MultiGrid;
+    this->Internal->NumberOfDimensions = this->TwoDimensionalGeometry ? 2 : 3;
+    this->Internal->Precision = this->DoublePrecision ? 8 : 4;
+    this->Internal->IBlanking = this->IBlanking;
+    return 1;
+    }
+
+  if (!this->Internal->CheckByteOrder(fp))
+    {
+    return 0;
+    }
+  if (!this->Internal->CheckByteCount(fp))
+    {
+    return 0;
+    }
+
+  if (!this->Internal->HasByteCount)
+    {
+    if (!this->Internal->CheckCFile(fp, this->FileSize))
+      {
+      return 0;
+      }
+    }
+  else
+    {
+    if (!this->Internal->CheckMultiGrid(fp))
+      {
+      return 0;
+      }
+    if (!this->Internal->Check2DGeom(fp))
+      {
+      return 0;
+      }
+    if (!this->Internal->CheckBlankingAndPrecision(fp))
+      {
+      return 0;
+      }
+    }
+  if (!this->AutoDetectFormat)
+    {
+    if ( !this->ForceRead && (
+           this->Internal->BinaryFile != this->BinaryFile ||
+           this->Internal->ByteOrder != this->ByteOrder ||
+           this->Internal->HasByteCount != this->HasByteCount ||
+           this->Internal->MultiGrid != this->MultiGrid ||
+           this->Internal->NumberOfDimensions != (this->TwoDimensionalGeometry ? 2 : 3) ||
+           this->Internal->Precision != (this->DoublePrecision ? 8 : 4) ||
+           this->Internal->IBlanking != this->IBlanking ) )
+      {
+      vtkErrorMacro(<< "The settings that you provided do not match what was auto-detected "
+                    << "in the file. The detected settings are: " << "\n"
+                    << "BinaryFile: " << (this->Internal->BinaryFile ? 1 : 0) << "\n"
+                    << "ByteOrder: " << this->Internal->ByteOrder << "\n"
+                    << "HasByteCount: " << (this->Internal->HasByteCount ? 1 : 0) << "\n"
+                    << "MultiGrid: " << (this->Internal->MultiGrid ? 1 : 0) << "\n"
+                    << "NumberOfDimensions: " << this->Internal->NumberOfDimensions << "\n"
+                    << "DoublePrecision: " << (this->Internal->Precision == 4 ? 0 : 1) << "\n"
+                    << "IBlanking: " << (this->Internal->IBlanking ? 1 : 0) << endl);
+      return 0;
+      }
+    this->Internal->BinaryFile = this->BinaryFile;
+    this->Internal->ByteOrder = this->ByteOrder;
+    this->Internal->HasByteCount = this->HasByteCount;
+    this->Internal->MultiGrid = this->MultiGrid;
+    this->Internal->NumberOfDimensions = this->TwoDimensionalGeometry ? 2 : 3;
+    this->Internal->Precision = this->DoublePrecision ? 8 : 4;
+    this->Internal->IBlanking = this->IBlanking;
+    return 1;
+    }
+  return 1;
+}
+
+int vtkMultiBlockPLOT3DReader::CheckFile(FILE*& fp, const char* fname)
+{
+  if (this->BinaryFile)
+    {
+    fp = fopen(fname, "rb");
+    }
+  else
+    {
+    fp = fopen(fname, "r");
+    }
+  if ( fp == NULL)
+    {
+    this->SetErrorCode(vtkErrorCode::FileNotFoundError);
+    vtkErrorMacro(<< "File: " << fname << " not found.");
+    return VTK_ERROR;
+    }
+  return VTK_OK;
+}
+
+int vtkMultiBlockPLOT3DReader::CheckGeometryFile(FILE*& xyzFp)
+{
+  if ( this->XYZFileName == NULL || this->XYZFileName[0] == '\0'  )
+    {
+    this->SetErrorCode(vtkErrorCode::NoFileNameError);
+    vtkErrorMacro(<< "Must specify geometry file");
+    return VTK_ERROR;
+    }
+  return this->CheckFile(xyzFp, this->XYZFileName);
+}
+
+int vtkMultiBlockPLOT3DReader::CheckSolutionFile(FILE*& qFp)
+{
+  if ( this->QFileName == NULL || this->QFileName[0] == '\0' )
+    {
+    this->SetErrorCode(vtkErrorCode::NoFileNameError);
+    vtkErrorMacro(<< "Must specify geometry file");
+    return VTK_ERROR;
+    }
+  return this->CheckFile(qFp, this->QFileName);
+}
+
+int vtkMultiBlockPLOT3DReader::CheckFunctionFile(FILE*& fFp)
+{
+  if ( this->FunctionFileName == NULL || this->FunctionFileName[0] == '\0' )
+    {
+    this->SetErrorCode(vtkErrorCode::NoFileNameError);
+    vtkErrorMacro(<< "Must specify geometry file");
+    return VTK_ERROR;
+    }
+  return this->CheckFile(fFp, this->FunctionFileName);
+}
+
+// Skip Fortran style byte count.
+int vtkMultiBlockPLOT3DReader::SkipByteCount(FILE* fp)
+{
+  if (this->Internal->BinaryFile && this->Internal->HasByteCount)
+    {
+    int tmp;
+    if (fread(&tmp, sizeof(int), 1, fp) != 1)
+      {
+      vtkErrorMacro ("MultiBlockPLOT3DReader error reading file: " << this->XYZFileName
+                     << " Premature EOF while reading skipping byte count.");
+      fclose (fp);
+      return 0;
+      }
+    if (this->Internal->ByteOrder == vtkMultiBlockPLOT3DReader::FILE_LITTLE_ENDIAN)
+      {
+      vtkByteSwap::Swap4LERange(&tmp, 1);
+      }
+    else
+      {
+      vtkByteSwap::Swap4BERange(&tmp, 1);
+      }
+
+    return tmp;
+    }
+  return 0;
+}
+
+// Read a block of ints (ascii or binary) and return number read.
+int vtkMultiBlockPLOT3DReader::ReadIntBlock(FILE* fp, int n, int* block)
+{
+  if (this->Internal->BinaryFile)
+    {
+    int retVal=static_cast<int>(fread(block, sizeof(int), n, fp));
+    if (this->Internal->ByteOrder == FILE_LITTLE_ENDIAN)
+      {
+      vtkByteSwap::Swap4LERange(block, n);
+      }
+    else
+      {
+      vtkByteSwap::Swap4BERange(block, n);
+      }
+    return retVal;
+    }
+  else
+    {
+    int count = 0;
+    for(int i=0; i<n; i++)
+      {
+      int num = fscanf(fp, "%d", &(block[i]));
+      if ( num > 0 )
+        {
+        count++;
+        }
+      else
+        {
+        return 0;
+        }
+      }
+    return count;
+    }
+}
+
+vtkDataArray* vtkMultiBlockPLOT3DReader::NewFloatArray()
+{
+  if (this->Internal->Precision == 4)
+    {
+    return vtkFloatArray::New();
+    }
+  else
+    {
+    return vtkDoubleArray::New();
+    }
+}
+
+int vtkMultiBlockPLOT3DReader::ReadScalar(FILE* fp, int n, vtkDataArray* scalar)
+{
+  if (this->Internal->BinaryFile)
+    {
+    if (this->Internal->Precision == 4)
+      {
+      vtkPLOT3DArrayReader<float> arrayReader;
+      arrayReader.ByteOrder = this->Internal->ByteOrder;
+      vtkFloatArray* floatArray = static_cast<vtkFloatArray*>(scalar);
+      return arrayReader.ReadScalar(fp, n, floatArray->GetPointer(0));
+      }
+    else
+      {
+      vtkPLOT3DArrayReader<double> arrayReader;
+      arrayReader.ByteOrder = this->Internal->ByteOrder;
+      vtkDoubleArray* doubleArray = static_cast<vtkDoubleArray*>(scalar);
+      return arrayReader.ReadScalar(fp, n, doubleArray->GetPointer(0));
+      }
+    }
+  else
+    {
+    if (this->Internal->Precision == 4)
+      {
+      vtkFloatArray* floatArray = static_cast<vtkFloatArray*>(scalar);
+      float* values = floatArray->GetPointer(0);
+
+      int count = 0;
+      for(int i=0; i<n; i++)
+        {
+        int num = fscanf(fp, "%f", &(values[i]));
+        if ( num > 0 )
+          {
+          count++;
+          }
+        else
+          {
+          return 0;
+          }
+        }
+      return count;
+      }
+    else
+      {
+      vtkDoubleArray* doubleArray = static_cast<vtkDoubleArray*>(scalar);
+      double* values = doubleArray->GetPointer(0);
+
+      int count = 0;
+      for(int i=0; i<n; i++)
+        {
+        int num = fscanf(fp, "%lf", &(values[i]));
+        if ( num > 0 )
+          {
+          count++;
+          }
+        else
+          {
+          return 0;
+          }
+        }
+      return count;
+      }
+    }
+}
+
+int vtkMultiBlockPLOT3DReader::ReadVector(FILE* fp, int n, int numDims, vtkDataArray* vector)
+{
+  if (this->Internal->BinaryFile)
+    {
+    if (this->Internal->Precision == 4)
+      {
+      vtkPLOT3DArrayReader<float> arrayReader;
+      arrayReader.ByteOrder = this->Internal->ByteOrder;
+      vtkFloatArray* floatArray = static_cast<vtkFloatArray*>(vector);
+      return arrayReader.ReadVector(fp, n, numDims, floatArray->GetPointer(0));
+      }
+    else
+      {
+      vtkPLOT3DArrayReader<double> arrayReader;
+      arrayReader.ByteOrder = this->Internal->ByteOrder;
+      vtkDoubleArray* doubleArray = static_cast<vtkDoubleArray*>(vector);
+      return arrayReader.ReadVector(fp, n, numDims, doubleArray->GetPointer(0));
+      }
+    }
+  else
+    {
+    // Initialize the 3rd component to 0 in case the input file is
+    // 2D
+    vector->FillComponent(2, 0);
+
+    int count = 0;
+
+    if (this->Internal->Precision == 4)
+      {
+      vtkFloatArray* floatArray = static_cast<vtkFloatArray*>(vector);
+
+      vtkFloatArray* tmpArray = vtkFloatArray::New();
+      tmpArray->Allocate(n);
+      for (int component = 0; component < numDims; component++)
+        {
+        count += this->ReadScalar(fp, n, tmpArray);
+        for (int i=0; i<n; i++)
+          {
+          floatArray->SetValue(3*i+component, tmpArray->GetValue(i));
+          }
+        }
+      tmpArray->Delete();
+      }
+    else
+      {
+      vtkDoubleArray* doubleArray = static_cast<vtkDoubleArray*>(vector);
+
+      vtkDoubleArray* tmpArray = vtkDoubleArray::New();
+      tmpArray->Allocate(n);
+      for (int component = 0; component < numDims; component++)
+        {
+        count += this->ReadScalar(fp, n, tmpArray);
+        for (int i=0; i<n; i++)
+          {
+          doubleArray->SetValue(3*i+component, tmpArray->GetValue(i));
+          }
+        }
+      tmpArray->Delete();
+      }
+
+    return count;
+    }
+}
+
+// Read a block of floats (ascii or binary) and return number read.
+void vtkMultiBlockPLOT3DReader::CalculateFileSize(FILE* fp)
+{
+  long curPos = ftell(fp);
+  fseek(fp, 0, SEEK_END);
+  this->FileSize = ftell(fp);
+  fseek(fp, curPos, SEEK_SET);
+}
+
+
+// Estimate the size of a grid (binary file only)
+long vtkMultiBlockPLOT3DReader::EstimateSize(int ni, int nj, int nk)
+{
+  long size; // the header portion, 3 ints
+  size = this->Internal->NumberOfDimensions*4;
+  // x, y, z
+  size += ni*nj*nk*this->Internal->NumberOfDimensions*this->Internal->Precision;
+
+  if (this->Internal->HasByteCount)
+    {
+    size += 2*4; // the byte counts
+    }
+  if (this->Internal->IBlanking)
+    {
+    size += ni*nj*nk*4;
+    }
+
+  return size;
+}
+
+int vtkMultiBlockPLOT3DReader::CanReadBinaryFile(const char* fname)
+{
+  FILE* xyzFp;
+
+  if (!fname || fname[0] == '\0')
+    {
+    return 0;
+    }
+
+  if ( this->CheckFile(xyzFp, fname) != VTK_OK)
+    {
+    return 0;
+    }
+
+  this->CalculateFileSize(xyzFp);
+
+  if (!this->AutoDetectionCheck(xyzFp))
+    {
+    fclose(xyzFp);
+    return 0;
+    }
+  rewind(xyzFp);
+
+  int numBlocks = this->GetNumberOfBlocksInternal(xyzFp, 0);
+  fclose(xyzFp);
+  if (numBlocks != 0)
+    {
+    return 1;
+    }
+  return 0;
+}
+
+// Read the header and return the number of grids.
+int vtkMultiBlockPLOT3DReader::GetNumberOfBlocksInternal(FILE* xyzFp, int allocate)
+{
+  int numGrid = 0;
+
+  if ( this->Internal->MultiGrid )
+    {
+    this->SkipByteCount(xyzFp);
+    this->ReadIntBlock(xyzFp, 1, &numGrid);
+    this->SkipByteCount(xyzFp);
+    }
+  else
+    {
+    numGrid=1;
+    }
+
+
+  if (allocate)
+    {
+    // Now set the number of blocks.
+    if (numGrid != 0)
+      {
+      if ( numGrid > (int)this->Internal->Blocks.size() )
+        {
+        this->Internal->Blocks.resize(numGrid);
+        }
+      for (int i=0; i<numGrid; i++)
+        {
+        if (!this->Internal->Blocks[i])
+          {
+          vtkStructuredGrid* sg = vtkStructuredGrid::New();
+          this->Internal->Blocks[i] = sg;
+          sg->Delete();
+          }
+        }
+      }
+    }
+
+  return numGrid;
+}
+
+int vtkMultiBlockPLOT3DReader::ReadGeometryHeader(FILE* fp)
+{
+  int numGrid = this->GetNumberOfBlocksInternal(fp, 1);
+  int i;
+  vtkDebugMacro("Geometry number of grids: " << numGrid);
+  if ( numGrid == 0 )
+    {
+    return VTK_ERROR;
+    }
+
+  // Read and set extents of all blocks.
+  this->SkipByteCount(fp);
+  for(i=0; i<numGrid; i++)
+    {
+    int n[3];
+    n[2] = 1;
+    this->ReadIntBlock(fp, this->Internal->NumberOfDimensions, n);
+    vtkDebugMacro("Geometry, block " << i << " dimensions: "
+                  << n[0] << " " << n[1] << " " << n[2]);
+    this->Internal->Blocks[i]->SetExtent(0, n[0]-1, 0, n[1]-1, 0, n[2]-1);
+    }
+  this->SkipByteCount(fp);
+
+  return VTK_OK;
+}
+
+int vtkMultiBlockPLOT3DReader::ReadQHeader(FILE* fp,
+                                           bool checkGrid,
+                                           int& nq,
+                                           int& nqc,
+                                           int& overflow)
+{
+  int numGrid = this->GetNumberOfBlocksInternal(fp, 0);
+  vtkDebugMacro("Q number of grids: " << numGrid);
+  if ( numGrid == 0 )
+    {
+    return VTK_ERROR;
+    }
+
+  // If the numbers of grids still do not match, the
+  // q file is wrong
+  if (checkGrid &&
+      numGrid != static_cast<int>(this->Internal->Blocks.size()))
+    {
+    vtkErrorMacro("The number of grids between the geometry "
+                  "and the q file do not match.");
+    return VTK_ERROR;
+    }
+
+  int bytes = this->SkipByteCount(fp);
+  // If the header contains 2 additional ints, then we assume
+  // that this is an Overflow file.
+  if (bytes > 0 &&
+      bytes == (numGrid*this->Internal->NumberOfDimensions+2)*4)
+    {
+    overflow = 1;
+    }
+  else
+    {
+    overflow = 0;
+    }
+  for(int i=0; i<numGrid; i++)
+    {
+    int n[3];
+    n[2] = 1;
+    this->ReadIntBlock(fp, this->Internal->NumberOfDimensions, n);
+    vtkDebugMacro("Q, block " << i << " dimensions: "
+                  << n[0] << " " << n[1] << " " << n[2]);
+
+    if (checkGrid)
+      {
+      int extent[6];
+      this->Internal->Blocks[i]->GetExtent(extent);
+      if ( extent[1] != n[0]-1 || extent[3] != n[1]-1 || extent[5] != n[2]-1)
+        {
+        this->SetErrorCode(vtkErrorCode::FileFormatError);
+        vtkErrorMacro("Geometry and data dimensions do not match. "
+                      "Data file may be corrupt.");
+        this->Internal->Blocks[i]->Initialize();
+        return VTK_ERROR;
+        }
+      }
+    }
+  if (overflow)
+    {
+    this->ReadIntBlock(fp, 1, &nq);
+    this->ReadIntBlock(fp, 1, &nqc);
+    }
+  else
+    {
+    nq = 5;
+    nqc = 0;
+    }
+  this->SkipByteCount(fp);
+  return VTK_OK;
+}
+
+int vtkMultiBlockPLOT3DReader::ReadFunctionHeader(FILE* fp, int* nFunctions)
+{
+  int numGrid = this->GetNumberOfBlocksInternal(fp, 0);
+  vtkDebugMacro("Function number of grids: " << numGrid);
+  if ( numGrid == 0 )
+    {
+    return VTK_ERROR;
+    }
+
+  // If the numbers of grids still do not match, the
+  // function file is wrong
+  if (numGrid != static_cast<int>(this->Internal->Blocks.size()))
+    {
+    vtkErrorMacro("The number of grids between the geometry "
+                  "and the function file do not match.");
+    return VTK_ERROR;
+    }
+
+  this->SkipByteCount(fp);
+  for(int i=0; i<numGrid; i++)
+    {
+    int n[3];
+    n[2] = 1;
+    this->ReadIntBlock(fp, this->Internal->NumberOfDimensions, n);
+    vtkDebugMacro("Function, block " << i << " dimensions: "
+                  << n[0] << " " << n[1] << " " << n[2]);
+
+    int extent[6];
+    this->Internal->Blocks[i]->GetExtent(extent);
+    if ( extent[1] != n[0]-1 || extent[3] != n[1]-1 || extent[5] != n[2]-1)
+      {
+      this->SetErrorCode(vtkErrorCode::FileFormatError);
+      vtkErrorMacro("Geometry and data dimensions do not match. "
+                    "Data file may be corrupt.");
+      this->Internal->Blocks[i]->Initialize();
+      return VTK_ERROR;
+      }
+    this->ReadIntBlock(fp, 1, nFunctions+i);
+    }
+  this->SkipByteCount(fp);
+  return VTK_OK;
+}
+
+void vtkMultiBlockPLOT3DReader::SetXYZFileName( const char* name )
+{
+  if ( this->XYZFileName && ! strcmp( this->XYZFileName, name ) )
+    {
+    return;
+    }
+
+  delete [] this->XYZFileName;
+
+  if ( name )
+    {
+    this->XYZFileName = new char [ strlen( name ) + 1 ];
+    strcpy( this->XYZFileName, name );
+    }
+  else
+    {
+    this->XYZFileName = 0;
+    }
+
+  this->Internal->NeedToCheckXYZFile = true;
+  this->ClearGeometryCache();
+  this->Modified();
+}
+
+void vtkMultiBlockPLOT3DReader::SetScalarFunctionNumber(int num)
+{
+  if ( this->ScalarFunctionNumber == num)
+    {
+    return;
+    }
+  if (num >= 0)
+    {
+    // If this function is not in the list, add it.
+    int found=0;
+    for (int i=0; i < this->FunctionList->GetNumberOfTuples(); i++ )
+      {
+      if ( this->FunctionList->GetValue(i) == num )
+        {
+        found=1;
+        }
+      }
+    if (!found)
+      {
+      this->AddFunction(num);
+      }
+    }
+  this->ScalarFunctionNumber = num;
+}
+
+void vtkMultiBlockPLOT3DReader::SetVectorFunctionNumber(int num)
+{
+  if ( this->VectorFunctionNumber == num)
+    {
+    return;
+    }
+  if (num >= 0)
+    {
+    // If this function is not in the list, add it.
+    int found=0;
+    for (int i=0; i < this->FunctionList->GetNumberOfTuples(); i++ )
+      {
+      if ( this->FunctionList->GetValue(i) == num )
+        {
+        found=1;
+        }
+      }
+    if (!found)
+      {
+      this->AddFunction(num);
+      }
+    }
+  this->VectorFunctionNumber = num;
+}
+
+void vtkMultiBlockPLOT3DReader::RemoveFunction(int fnum)
+{
+  for (int i=0; i < this->FunctionList->GetNumberOfTuples(); i++ )
+    {
+    if ( this->FunctionList->GetValue(i) == fnum )
+      {
+      this->FunctionList->SetValue(i,-1);
+      this->Modified();
+      }
+    }
+}
+
+int vtkMultiBlockPLOT3DReader::RequestInformation(
+  vtkInformation*,
+  vtkInformationVector**,
+  vtkInformationVector* outputVector)
+{
+  if (this->XYZFileName &&
+      this->XYZFileName[0] != '\0' &&
+      this->Internal->NeedToCheckXYZFile)
+    {
+    FILE* xyzFp;
+    if ( this->CheckGeometryFile(xyzFp) != VTK_OK)
+      {
+      fclose(xyzFp);
+      return 0;
+      }
+
+    this->CalculateFileSize(xyzFp);
+
+    if (!this->AutoDetectionCheck(xyzFp))
+      {
+      fclose(xyzFp);
+      return 0;
+      }
+    this->Internal->NeedToCheckXYZFile = false;
+    fclose(xyzFp);
+    }
+
+  vtkInformation* info = outputVector->GetInformationObject(0);
+
+  // We report time from the Q file for meta-type readers that
+  // might support file series of Q files.
+  if (this->QFileName && this->QFileName[0] != '\0')
+    {
+    FILE* qFp;
+    if ( this->CheckSolutionFile(qFp) != VTK_OK)
+      {
+      return 0;
+      }
+    int nq, nqc, overflow;
+    if (this->ReadQHeader(qFp, false, nq, nqc, overflow) != VTK_OK)
+      {
+      fclose(qFp);
+      return 0;
+      }
+
+    // I have seen Plot3D files with bogus time values so the only
+    // type I have some confidence about having correct time values
+    // is Overflow output.
+    if (overflow)
+      {
+      vtkDataArray* properties = this->NewFloatArray();
+
+      this->SkipByteCount(qFp);
+      properties->SetNumberOfTuples(4);
+
+      // Read fsmach, alpha, re, time;
+      if (this->ReadScalar(qFp, 4, properties) == 0)
+        {
+        vtkErrorMacro("Encountered premature end-of-file while reading "
+                      "the q file (or the file is corrupt).");
+        this->SetErrorCode(vtkErrorCode::PrematureEndOfFileError);
+        fclose(qFp);
+        properties->Delete();
+        return 0;
+        }
+      double time = properties->GetTuple1(3);
+      double times[2] = { time, time };
+      info->Set(vtkStreamingDemandDrivenPipeline::TIME_STEPS(), &time, 1);
+      info->Set(vtkStreamingDemandDrivenPipeline::TIME_RANGE(), times, 2);
+      properties->Delete();
+      }
+    fclose(qFp);
+    }
+
+  return 1;
+}
+
+int vtkMultiBlockPLOT3DReader::RequestData(
+  vtkInformation*, vtkInformationVector**, vtkInformationVector* outputVector)
+{
+  vtkInformation* info = outputVector->GetInformationObject(0);
+
+  vtkDataObject* doOutput =
+    info->Get(vtkDataObject::DATA_OBJECT());
+  vtkMultiBlockDataSet* mb =
+    vtkMultiBlockDataSet::SafeDownCast(doOutput);
+  if (!mb)
+    {
+    return 0;
+    }
+
+  this->SetErrorCode(vtkErrorCode::NoError);
+
+  int i;
+
+  // This may be wrong if geometry is not cached. It is
+  // update below.
+  int numBlocks = static_cast<int>(this->Internal->Blocks.size());
+
+  // Don't read the geometry if we already have it!
+  if ( numBlocks == 0 )
+    {
+    FILE* xyzFp;
+    if ( this->CheckGeometryFile(xyzFp) != VTK_OK)
+      {
+      return 0;
+      }
+
+    if ( this->ReadGeometryHeader(xyzFp) != VTK_OK )
+      {
+      vtkErrorMacro("Error reading geometry file.");
+      fclose(xyzFp);
+      return 0;
+      }
+
+    // Update from the value in the file.
+    numBlocks = static_cast<int>(this->Internal->Blocks.size());
+
+    for(i=0; i<numBlocks; i++)
+      {
+
+      // Read the geometry of this grid.
+      this->SkipByteCount(xyzFp);
+
+      vtkStructuredGrid* nthOutput = this->Internal->Blocks[i];
+      int dims[3];
+      nthOutput->GetDimensions(dims);
+      vtkDataArray* pointArray = this->NewFloatArray();
+      pointArray->SetNumberOfComponents(3);
+      pointArray->SetNumberOfTuples( dims[0]*dims[1]*dims[2] );
+
+      vtkPoints* points = vtkPoints::New();
+      points->SetData(pointArray);
+      pointArray->Delete();
+      nthOutput->SetPoints(points);
+      points->Delete();
+      if ( this->ReadVector(xyzFp,
+                            dims[0]*dims[1]*dims[2],
+                            this->Internal->NumberOfDimensions,
+                            pointArray) == 0)
+        {
+        vtkErrorMacro("Encountered premature end-of-file while reading "
+                      "the geometry file (or the file is corrupt).");
+        this->SetErrorCode(vtkErrorCode::PrematureEndOfFileError);
+        fclose(xyzFp);
+        return 0;
+        }
+
+      if (this->Internal->IBlanking)
+        {
+        int* ib = (int*)malloc(dims[0]*dims[1]*dims[2]*sizeof(int));
+        if ( this->ReadIntBlock(xyzFp, dims[0]*dims[1]*dims[2], ib) == 0)
+          {
+          vtkErrorMacro("Encountered premature end-of-file while reading "
+                        "the q file (or the file is corrupt).");
+          this->SetErrorCode(vtkErrorCode::PrematureEndOfFileError);
+          free(ib);
+          fclose(xyzFp);
+          return 0;
+          }
+
+        vtkIntArray* iblank = vtkIntArray::New();
+        iblank->SetName("IBlank");
+        iblank->SetVoidArray(ib, dims[0]*dims[1]*dims[2], 0);
+        nthOutput->GetPointData()->AddArray(iblank);
+        iblank->Delete();
+
+        vtkUnsignedCharArray* visibility = vtkUnsignedCharArray::New();
+        visibility->SetNumberOfComponents(1);
+        visibility->SetNumberOfTuples( nthOutput->GetNumberOfCells() );
+        visibility->SetName("Visibility");
+        nthOutput->SetCellVisibilityArray(visibility);
+        nthOutput->GetCellData()->AddArray(visibility);
+        vtkIdList* ids = vtkIdList::New();
+        ids->SetNumberOfIds(8);
+        vtkIdType numCells = nthOutput->GetNumberOfCells();
+        for (vtkIdType cellId=0; cellId<numCells; cellId++)
+          {
+          nthOutput->GetCellPoints(cellId, ids);
+          vtkIdType numIds = ids->GetNumberOfIds();
+          char visible = 1;
+          for (vtkIdType ptIdx=0; ptIdx<numIds; ptIdx++)
+            {
+            if (ib[ids->GetId(ptIdx)] == 0)
+              {
+              visible = 0;
+              break;
+              }
+            }
+          visibility->SetValue(cellId, visible);
+          }
+        ids->Delete();
+        }
+      this->SkipByteCount(xyzFp);
+      }
+
+    fclose(xyzFp);
+    }
+
+  // Now read the solution.
+  if (this->QFileName && this->QFileName[0] != '\0')
+    {
+    FILE* qFp;
+    if ( this->CheckSolutionFile(qFp) != VTK_OK)
+      {
+      return 0;
+      }
+
+    int nq, nqc, isOverflow;
+    if ( this->ReadQHeader(qFp, true, nq, nqc, isOverflow) != VTK_OK )
+      {
+      fclose(qFp);
+      return 0;
+      }
+
+    for(i=0; i<numBlocks; i++)
+      {
+      vtkStructuredGrid* nthOutput = this->Internal->Blocks[i];
+
+
+      // Save the properties first
+      vtkDataArray* properties = this->NewFloatArray();
+      properties->SetName("Properties");
+
+      int numProperties = 4;
+      int count = this->SkipByteCount(qFp);
+      // We have a byte count to tell us how many Q values to
+      // read. If this is more that 4, this is probably an Overflow
+      // file.
+      if (isOverflow)
+        {
+        // We take 4 bytes because there is an int there that
+        // we will throw away
+        numProperties = (count-4) / this->Internal->Precision + 1;
+        }
+      properties->SetNumberOfTuples(numProperties);
+
+      // Read fsmach, alpha, re, time;
+      if ( this->ReadScalar(qFp, 4, properties) == 0)
+        {
+        vtkErrorMacro("Encountered premature end-of-file while reading "
+                      "the q file (or the file is corrupt).");
+        this->SetErrorCode(vtkErrorCode::PrematureEndOfFileError);
+        fclose(qFp);
+        properties->Delete();
+        return 0;
+        }
+
+      if (isOverflow)
+        {
+        // We create a dummy array to use with ReadScalar
+        vtkDataArray* dummyArray = properties->NewInstance();
+        dummyArray->SetVoidArray(properties->GetVoidPointer(4), 3, 1);
+
+        // Read GAMINF, BETA, TINF
+        if ( this->ReadScalar(qFp, 3, dummyArray) == 0)
+          {
+          vtkErrorMacro("Encountered premature end-of-file while reading "
+                        "the q file (or the file is corrupt).");
+          this->SetErrorCode(vtkErrorCode::PrematureEndOfFileError);
+          fclose(qFp);
+          properties->Delete();
+          return 0;
+          }
+
+        // igam is an int
+        int igam;
+        this->ReadIntBlock(qFp, 1, &igam);
+        properties->SetTuple1(7, igam);
+
+        dummyArray->SetVoidArray(properties->GetVoidPointer(8), 3, 1);
+        // Read the rest of properties
+        if ( this->ReadScalar(qFp, numProperties - 8, dummyArray) == 0)
+          {
+          vtkErrorMacro("Encountered premature end-of-file while reading "
+                        "the q file (or the file is corrupt).");
+          this->SetErrorCode(vtkErrorCode::PrematureEndOfFileError);
+          fclose(qFp);
+          properties->Delete();
+          return 0;
+          }
+        dummyArray->Delete();
+        }
+
+      nthOutput->GetFieldData()->AddArray(properties);
+      properties->Delete();
+      this->SkipByteCount(qFp);
+
+      int dims[3];
+      nthOutput->GetDimensions(dims);
+
+      this->SkipByteCount(qFp);
+
+      vtkDataArray* density = this->NewFloatArray();
+      density->SetNumberOfComponents(1);
+      density->SetNumberOfTuples( dims[0]*dims[1]*dims[2] );
+      density->SetName("Density");
+      if ( this->ReadScalar(qFp, dims[0]*dims[1]*dims[2], density) == 0)
+        {
+        vtkErrorMacro("Encountered premature end-of-file while reading "
+                      "the q file (or the file is corrupt).");
+        this->SetErrorCode(vtkErrorCode::PrematureEndOfFileError);
+        fclose(qFp);
+        density->Delete();
+        return 0;
+        }
+      nthOutput->GetPointData()->AddArray(density);
+      density->Delete();
+
+      vtkDataArray* momentum = this->NewFloatArray();
+      momentum->SetNumberOfComponents(3);
+      momentum->SetNumberOfTuples( dims[0]*dims[1]*dims[2] );
+      momentum->SetName("Momentum");
+      if ( this->ReadVector(qFp,
+                            dims[0]*dims[1]*dims[2],
+                            this->Internal->NumberOfDimensions,
+                            momentum) == 0)
+        {
+        vtkErrorMacro("Encountered premature end-of-file while reading "
+                      "the q file (or the file is corrupt).");
+        this->SetErrorCode(vtkErrorCode::PrematureEndOfFileError);
+        fclose(qFp);
+        momentum->Delete();
+        return 0;
+        }
+      nthOutput->GetPointData()->AddArray(momentum);
+      momentum->Delete();
+
+      vtkDataArray* se = this->NewFloatArray();
+      se->SetNumberOfComponents(1);
+      se->SetNumberOfTuples( dims[0]*dims[1]*dims[2] );
+      se->SetName("StagnationEnergy");
+      if (this->ReadScalar(qFp, dims[0]*dims[1]*dims[2], se) == 0)
+        {
+        vtkErrorMacro("Encountered premature end-of-file while reading "
+                      "the q file (or the file is corrupt).");
+        fclose(qFp);
+        se->Delete();
+        return 0;
+        }
+      nthOutput->GetPointData()->AddArray(se);
+      se->Delete();
+
+      if (isOverflow)
+        {
+        if(nq >= 6) /// super new
+          {
+          vtkDataArray* gamma = this->NewFloatArray();
+          gamma->SetNumberOfComponents(1);
+          gamma->SetNumberOfTuples(dims[0]*dims[1]*dims[2]);
+          gamma->SetName("Gamma");
+          if (this->ReadScalar(qFp, dims[0]*dims[1]*dims[2], gamma) == 0)
+            {
+            vtkErrorMacro("Encountered premature end-of-file while reading "
+                          "the q file (or the file is corrupt).");
+            fclose(qFp);
+            gamma->Delete();
+            return 0;
+            }
+          nthOutput->GetPointData()->AddArray(gamma);
+          gamma->Delete();
+        } /// end of new
+
+        char res[100];
+        // Read species and turbulence variables for overflow q files
+        for(int j=0; j<nqc; j++)
+          {
+          vtkDataArray* temp = this->NewFloatArray();
+          temp->SetNumberOfComponents(1);
+          temp->SetNumberOfTuples(dims[0]*dims[1]*dims[2]);
+          int k = j+1;
+          sprintf(res, "Species Density #%d", k);
+          temp->SetName(res);
+          if (this->ReadScalar(qFp, dims[0]*dims[1]*dims[2], temp) == 0)
+            {
+            vtkErrorMacro("Encountered premature end-of-file while reading "
+                          "the q file (or the file is corrupt).");
+            fclose(qFp);
+            temp->Delete();
+            return 0;
+            }
+          nthOutput->GetPointData()->AddArray(temp);
+          temp->Delete();
+          }
+        float d, r;
+        for(int v=0; v<nqc; v++)
+          {
+          vtkDataArray* rat = this->NewFloatArray();
+          sprintf(res, "Species Density #%d", v+1);
+          vtkPointData* outputPD = nthOutput->GetPointData();
+          vtkDataArray* spec = outputPD->GetArray(res);
+          vtkDataArray* dens = outputPD->GetArray("Density");
+          rat->SetNumberOfComponents(1);
+          rat->SetNumberOfTuples(dims[0]*dims[1]*dims[2]);
+          sprintf(res, "Spec Dens #%d / rho", v+1);
+          rat->SetName(res);
+          for(int w=0; w<dims[0]*dims[1]*dims[2]; w++)
+            {
+            r = dens->GetComponent(w,0);
+            r = (r != 0.0 ? r : 1.0);
+            d = spec->GetComponent(w,0);
+            rat->SetTuple1(w, d/r);
+            }
+          nthOutput->GetPointData()->AddArray(rat);
+          rat->Delete();
+          }
+        for(int a=0; a<nq-6-nqc; a++)
+          {
+          vtkDataArray* temp = this->NewFloatArray();
+          temp->SetNumberOfComponents(1);
+          temp->SetNumberOfTuples(dims[0]*dims[1]*dims[2]);
+          int k = a+1;
+          sprintf(res, "Turb Field Quant #%d", k);
+          temp->SetName(res);
+          if (this->ReadScalar(qFp, dims[0]*dims[1]*dims[2], temp) == 0)
+            {
+            vtkErrorMacro("Encountered premature end-of-file while reading "
+                          "the q file (or the file is corrupt).");
+            fclose(qFp);
+            temp->Delete();
+            return 0;
+            }
+          nthOutput->GetPointData()->AddArray(temp);
+          temp->Delete();
+          }
+        }
+
+      this->SkipByteCount(qFp);
+
+      if ( this->FunctionList->GetNumberOfTuples() > 0 )
+        {
+        int fnum;
+        for (int tup=0; tup < this->FunctionList->GetNumberOfTuples(); tup++)
+          {
+          if ( (fnum=this->FunctionList->GetValue(tup)) >= 0 )
+            {
+            this->MapFunction(fnum, nthOutput);
+            }
+          }
+        }
+      this->AssignAttribute(this->ScalarFunctionNumber, nthOutput,
+                            vtkDataSetAttributes::SCALARS);
+      this->AssignAttribute(this->VectorFunctionNumber, nthOutput,
+                            vtkDataSetAttributes::VECTORS);
+      }
+    fclose(qFp);
+    }
+
+  // Now read the functions.
+  if (this->FunctionFileName && this->FunctionFileName[0] != '\0')
+    {
+    FILE* fFp;
+    if ( this->CheckFunctionFile(fFp) != VTK_OK)
+      {
+      return 0;
+      }
+
+    std::vector<int> nFunctions(numBlocks);
+    if ( this->ReadFunctionHeader(fFp, &nFunctions[0]) != VTK_OK )
+      {
+      fclose(fFp);
+      return 0;
+      }
+
+    for(i=0; i<numBlocks; i++)
+      {
+      vtkStructuredGrid* nthOutput = this->Internal->Blocks[i];
+      int dims[3];
+      nthOutput->GetDimensions(dims);
+
+      this->SkipByteCount(fFp);
+
+      for (int j=0; j<nFunctions[i]; j++)
+        {
+        vtkDataArray* functionArray = this->NewFloatArray();
+        functionArray->SetNumberOfTuples( dims[0]*dims[1]*dims[2] );
+        char functionName[20];
+        sprintf(functionName, "Function%d", j);
+        functionArray->SetName(functionName);
+        if (this->ReadScalar(fFp, dims[0]*dims[1]*dims[2], functionArray) == 0)
+          {
+          vtkErrorMacro("Encountered premature end-of-file while reading "
+                        "the function file (or the file is corrupt).");
+          fclose(fFp);
+          functionArray->Delete();
+          return 0;
+          }
+        nthOutput->GetPointData()->AddArray(functionArray);
+        functionArray->Delete();
+        }
+
+      this->SkipByteCount(fFp);
+      }
+    }
+
+  mb->SetNumberOfBlocks(numBlocks);
+  for(i=0; i<numBlocks; i++)
+    {
+    vtkStructuredGrid* nthOutput = this->Internal->Blocks[i];
+    mb->SetBlock(i, nthOutput);
+    }
+
+  return 1;
+}
+
+// Various PLOT3D functions.....................
+void vtkMultiBlockPLOT3DReader::MapFunction(int fNumber, vtkStructuredGrid* output)
+{
+  switch (fNumber)
+    {
+    case 100: //Density
+      break;
+
+    case 110: //Pressure
+      this->ComputePressure(output);
+      break;
+
+    case 111: // Pressure Coefficient
+      this->ComputePressureCoefficient(output);
+      break;
+
+    case 112: // Mach Number
+      this->ComputeMachNumber(output);
+      break;
+
+    case 113: // Sound Speed
+      this->ComputeSoundSpeed(output);
+      break;
+
+    case 120: //Temperature
+      this->ComputeTemperature(output);
+      break;
+
+    case 130: //Enthalpy
+      this->ComputeEnthalpy(output);
+      break;
+
+    case 140: //Internal Energy
+      break;
+
+    case 144: //Kinetic Energy
+      this->ComputeKineticEnergy(output);
+      break;
+
+    case 153: //Velocity Magnitude
+      this->ComputeVelocityMagnitude(output);
+      break;
+
+    case 163: //Stagnation energy
+      break;
+
+    case 170: //Entropy
+      this->ComputeEntropy(output);
+      break;
+
+    case 184: //Swirl
+      this->ComputeSwirl(output);
+      break;
+
+    case 200: //Velocity
+      this->ComputeVelocity(output);
+      break;
+
+    case 201: //Vorticity
+      this->ComputeVorticity(output);
+      break;
+
+    case 202: //Momentum
+      break;
+
+    case 210: //PressureGradient
+      this->ComputePressureGradient(output);
+      break;
+
+    case 211: // Vorticity Magnitude
+      this->ComputeVorticityMagnitude(output);
+      break;
+
+    case 212: // Strain Rate
+      this->ComputeStrainRate(output);
+      break;
+
+    default:
+      vtkErrorMacro(<<"No function number " << fNumber);
+    }
+}
+
+void vtkMultiBlockPLOT3DReader::AssignAttribute(int fNumber, vtkStructuredGrid* output,
+                                  int attributeType)
+{
+  switch (fNumber)
+    {
+    case -1:  //empty mapping
+      output->GetPointData()->SetActiveAttribute(0,
+                                                 attributeType);
+      break;
+
+    case 100: //Density
+      output->GetPointData()->SetActiveAttribute("Density",
+                                                 attributeType);
+      break;
+
+    case 110: //Pressure
+      output->GetPointData()->SetActiveAttribute("Pressure",
+                                                 attributeType);
+      break;
+
+    case 120: //Temperature
+      output->GetPointData()->SetActiveAttribute("Temperature",
+                                                 attributeType);
+      break;
+
+    case 130: //Enthalpy
+      output->GetPointData()->SetActiveAttribute("Enthalpy",
+                                                 attributeType);
+      break;
+
+    case 140: //Internal Energy
+      output->GetPointData()->SetActiveAttribute("StagnationEnergy",
+                                                 attributeType);
+      break;
+
+    case 144: //Kinetic Energy
+      output->GetPointData()->SetActiveAttribute("KineticEnergy",
+                                                 attributeType);
+      break;
+
+    case 153: //Velocity Magnitude
+      output->GetPointData()->SetActiveAttribute("VelocityMagnitude",
+                                                 attributeType);
+      break;
+
+    case 163: //Stagnation energy
+      output->GetPointData()->SetActiveAttribute("StagnationEnergy",
+                                                 attributeType);
+      break;
+
+    case 170: //Entropy
+      output->GetPointData()->SetActiveAttribute("Entropy",
+                                                 attributeType);
+      break;
+
+    case 184: //Swirl
+      output->GetPointData()->SetActiveAttribute("Swirl",
+                                                 attributeType);
+      break;
+
+    case 200: //Velocity
+      output->GetPointData()->SetActiveAttribute("Velocity",
+                                                 attributeType);
+      break;
+
+    case 201: //Vorticity
+      output->GetPointData()->SetActiveAttribute("Vorticity",
+                                                 attributeType);
+      break;
+
+    case 202: //Momentum
+      output->GetPointData()->SetActiveAttribute("Momentum",
+                                                 attributeType);
+      break;
+
+    case 210: //PressureGradient
+      output->GetPointData()->SetActiveAttribute("PressureGradient",
+                                                 attributeType);
+      break;
+
+    default:
+      vtkErrorMacro(<<"No function number " << fNumber);
+    }
+}
+
+void vtkMultiBlockPLOT3DReader::ComputeTemperature(vtkStructuredGrid* output)
+{
+  double *m, e, rr, u, v, w, v2, p, d, rrgas;
+  vtkIdType i;
+  vtkDataArray *temperature;
+
+  //  Check that the required data is available
+  //
+  vtkPointData* outputPD = output->GetPointData();
+  vtkDataArray* density = outputPD->GetArray("Density");
+  vtkDataArray* momentum = outputPD->GetArray("Momentum");
+  vtkDataArray* energy = outputPD->GetArray("StagnationEnergy");
+
+  if ( density == NULL || momentum == NULL ||
+       energy == NULL )
+    {
+    vtkErrorMacro(<<"Cannot compute temperature");
+    return;
+    }
+
+  vtkIdType numPts = density->GetNumberOfTuples();
+  temperature = this->NewFloatArray();
+  temperature->SetNumberOfTuples(numPts);
+
+  //  Compute the temperature
+  //
+  rrgas = 1.0 / this->R;
+  for (i=0; i < numPts; i++)
+    {
+    d = density->GetComponent(i,0);
+    d = (d != 0.0 ? d : 1.0);
+    m = momentum->GetTuple(i);
+    e = energy->GetComponent(i,0);
+    rr = 1.0 / d;
+    u = m[0] * rr;
+    v = m[1] * rr;
+    w = m[2] * rr;
+    v2 = u*u + v*v + w*w;
+    p = (this->Gamma-1.) * (e - 0.5 * d * v2);
+    temperature->SetTuple1(i, p*rr*rrgas);
+  }
+
+  temperature->SetName("Temperature");
+  outputPD->AddArray(temperature);
+
+  temperature->Delete();
+  vtkDebugMacro(<<"Created temperature scalar");
+}
+
+void vtkMultiBlockPLOT3DReader::ComputePressure(vtkStructuredGrid* output)
+{
+  double *m, e, u, v, w, v2, p, d, rr;
+  vtkIdType i;
+  vtkDataArray *pressure;
+
+  //  Check that the required data is available
+  //
+  vtkPointData* outputPD = output->GetPointData();
+  vtkDataArray* density = outputPD->GetArray("Density");
+  vtkDataArray* momentum = outputPD->GetArray("Momentum");
+  vtkDataArray* energy = outputPD->GetArray("StagnationEnergy");
+  if ( density == NULL || momentum == NULL ||
+       energy == NULL )
+    {
+    vtkErrorMacro(<<"Cannot compute pressure");
+    return;
+    }
+
+  vtkIdType numPts = density->GetNumberOfTuples();
+  pressure = this->NewFloatArray();
+  pressure->SetNumberOfTuples(numPts);
+
+  //  Compute the pressure
+  //
+  for (i=0; i < numPts; i++)
+    {
+    d = density->GetComponent(i,0);
+    d = (d != 0.0 ? d : 1.0);
+    m = momentum->GetTuple(i);
+    e = energy->GetComponent(i,0);
+    rr = 1.0 / d;
+    u = m[0] * rr;
+    v = m[1] * rr;
+    w = m[2] * rr;
+    v2 = u*u + v*v + w*w;
+    p = (this->Gamma-1.) * (e - 0.5 * d * v2);
+    pressure->SetTuple1(i, p);
+  }
+
+  pressure->SetName("Pressure");
+  outputPD->AddArray(pressure);
+  pressure->Delete();
+  vtkDebugMacro(<<"Created pressure scalar");
+}
+
+void vtkMultiBlockPLOT3DReader::ComputeEnthalpy(vtkStructuredGrid* output)
+{
+  double *m, e, u, v, w, v2, d, rr;
+  vtkIdType i;
+  vtkDataArray *enthalpy;
+
+  //  Check that the required data is available
+  //
+  vtkPointData* outputPD = output->GetPointData();
+  vtkDataArray* density = outputPD->GetArray("Density");
+  vtkDataArray* momentum = outputPD->GetArray("Momentum");
+  vtkDataArray* energy = outputPD->GetArray("StagnationEnergy");
+  if ( density == NULL || momentum == NULL ||
+       energy == NULL )
+    {
+    vtkErrorMacro(<<"Cannot compute enthalpy");
+    return;
+    }
+
+  vtkIdType numPts = density->GetNumberOfTuples();
+  enthalpy = this->NewFloatArray();
+  enthalpy->SetNumberOfTuples(numPts);
+
+  //  Compute the enthalpy
+  //
+  for (i=0; i < numPts; i++)
+    {
+    d = density->GetComponent(i,0);
+    d = (d != 0.0 ? d : 1.0);
+    m = momentum->GetTuple(i);
+    e = energy->GetComponent(i,0);
+    rr = 1.0 / d;
+    u = m[0] * rr;
+    v = m[1] * rr;
+    w = m[2] * rr;
+    v2 = u*u + v*v + w*w;
+    enthalpy->SetTuple1(i, this->Gamma*(e*rr - 0.5*v2));
+  }
+  enthalpy->SetName("Enthalpy");
+  outputPD->AddArray(enthalpy);
+  enthalpy->Delete();
+  vtkDebugMacro(<<"Created enthalpy scalar");
+}
+
+void vtkMultiBlockPLOT3DReader::ComputeKineticEnergy(vtkStructuredGrid* output)
+{
+  double *m, u, v, w, v2, d, rr;
+  vtkIdType i;
+  vtkDataArray *kineticEnergy;
+
+  //  Check that the required data is available
+  //
+  vtkPointData* outputPD = output->GetPointData();
+  vtkDataArray* density = outputPD->GetArray("Density");
+  vtkDataArray* momentum = outputPD->GetArray("Momentum");
+  if ( density == NULL || momentum == NULL )
+    {
+    vtkErrorMacro(<<"Cannot compute kinetic energy");
+    return;
+    }
+
+  vtkIdType numPts = density->GetNumberOfTuples();
+  kineticEnergy = this->NewFloatArray();
+  kineticEnergy->SetNumberOfTuples(numPts);
+
+  //  Compute the kinetic energy
+  //
+  for (i=0; i < numPts; i++)
+    {
+    d = density->GetComponent(i,0);
+    d = (d != 0.0 ? d : 1.0);
+    m = momentum->GetTuple(i);
+    rr = 1.0 / d;
+    u = m[0] * rr;
+    v = m[1] * rr;
+    w = m[2] * rr;
+    v2 = u*u + v*v + w*w;
+    kineticEnergy->SetTuple1(i, 0.5*v2);
+  }
+  kineticEnergy->SetName("KineticEnergy");
+  outputPD->AddArray(kineticEnergy);
+  kineticEnergy->Delete();
+  vtkDebugMacro(<<"Created kinetic energy scalar");
+}
+
+void vtkMultiBlockPLOT3DReader::ComputeVelocityMagnitude(vtkStructuredGrid* output)
+{
+  double *m, u, v, w, v2, d, rr;
+  vtkIdType i;
+  vtkDataArray *velocityMag;
+
+  //  Check that the required data is available
+  //
+  vtkPointData* outputPD = output->GetPointData();
+  vtkDataArray* density = outputPD->GetArray("Density");
+  vtkDataArray* momentum = outputPD->GetArray("Momentum");
+  vtkDataArray* energy = outputPD->GetArray("StagnationEnergy");
+  if ( density == NULL || momentum == NULL ||
+       energy == NULL )
+    {
+    vtkErrorMacro(<<"Cannot compute velocity magnitude");
+    return;
+    }
+
+  vtkIdType numPts = density->GetNumberOfTuples();
+  velocityMag = this->NewFloatArray();
+  velocityMag->SetNumberOfTuples(numPts);
+
+  //  Compute the velocity magnitude
+  //
+  for (i=0; i < numPts; i++)
+    {
+    d = density->GetComponent(i,0);
+    d = (d != 0.0 ? d : 1.0);
+    m = momentum->GetTuple(i);
+    rr = 1.0 / d;
+    u = m[0] * rr;
+    v = m[1] * rr;
+    w = m[2] * rr;
+    v2 = u*u + v*v + w*w;
+    velocityMag->SetTuple1(i, sqrt((double)v2));
+    }
+  velocityMag->SetName("VelocityMagnitude");
+  outputPD->AddArray(velocityMag);
+  velocityMag->Delete();
+  vtkDebugMacro(<<"Created velocity magnitude scalar");
+}
+
+void vtkMultiBlockPLOT3DReader::ComputeEntropy(vtkStructuredGrid* output)
+{
+  double *m, u, v, w, v2, d, rr, s, p, e;
+  vtkIdType i;
+  vtkDataArray *entropy;
+
+  //  Check that the required data is available
+  //
+  vtkPointData* outputPD = output->GetPointData();
+  vtkDataArray* density = outputPD->GetArray("Density");
+  vtkDataArray* momentum = outputPD->GetArray("Momentum");
+  vtkDataArray* energy = outputPD->GetArray("StagnationEnergy");
+  if ( density == NULL || momentum == NULL ||
+       energy == NULL )
+    {
+    vtkErrorMacro(<<"Cannot compute entropy");
+    return;
+    }
+
+  vtkIdType numPts = density->GetNumberOfTuples();
+  entropy = this->NewFloatArray();
+  entropy->SetNumberOfTuples(numPts);
+
+  //  Compute the entropy
+  //
+  for (i=0; i < numPts; i++)
+    {
+    d = density->GetComponent(i,0);
+    d = (d != 0.0 ? d : 1.0);
+    m = momentum->GetTuple(i);
+    e = energy->GetComponent(i,0);
+    rr = 1.0 / d;
+    u = m[0] * rr;
+    v = m[1] * rr;
+    w = m[2] * rr;
+    v2 = u*u + v*v + w*w;
+    p = (this->Gamma-1.)*(e - 0.5*d*v2);
+    s = VTK_CV * log((p/VTK_PINF)/pow((double)d/VTK_RHOINF,(double)this->Gamma));
+    entropy->SetTuple1(i,s);
+  }
+  entropy->SetName("Entropy");
+  outputPD->AddArray(entropy);
+  entropy->Delete();
+  vtkDebugMacro(<<"Created entropy scalar");
+}
+
+void vtkMultiBlockPLOT3DReader::ComputeSwirl(vtkStructuredGrid* output)
+{
+  vtkDataArray *vorticity;
+  double d, rr, *m, u, v, w, v2, *vort, s;
+  vtkIdType i;
+  vtkDataArray *swirl;
+
+  //  Check that the required data is available
+  //
+  vtkPointData* outputPD = output->GetPointData();
+  vtkDataArray* density = outputPD->GetArray("Density");
+  vtkDataArray* momentum = outputPD->GetArray("Momentum");
+  vtkDataArray* energy = outputPD->GetArray("StagnationEnergy");
+  if ( density == NULL || momentum == NULL ||
+       energy == NULL )
+    {
+    vtkErrorMacro(<<"Cannot compute swirl");
+    return;
+    }
+
+  vtkIdType numPts = density->GetNumberOfTuples();
+  swirl = this->NewFloatArray();
+  swirl->SetNumberOfTuples(numPts);
+
+  this->ComputeVorticity(output);
+  vorticity = outputPD->GetArray("Vorticity");
+//
+//  Compute the swirl
+//
+  for (i=0; i < numPts; i++)
+    {
+    d = density->GetComponent(i,0);
+    d = (d != 0.0 ? d : 1.0);
+    m = momentum->GetTuple(i);
+    vort = vorticity->GetTuple(i);
+    rr = 1.0 / d;
+    u = m[0] * rr;
+    v = m[1] * rr;
+    w = m[2] * rr;
+    v2 = u*u + v*v + w*w;
+    if ( v2 != 0.0 )
+      {
+      s = (vort[0]*m[0] + vort[1]*m[1] + vort[2]*m[2]) / v2;
+      }
+    else
+      {
+      s = 0.0;
+      }
+
+    swirl->SetTuple1(i,s);
+  }
+  swirl->SetName("Swirl");
+  outputPD->AddArray(swirl);
+  swirl->Delete();
+  vtkDebugMacro(<<"Created swirl scalar");
+
+}
+
+// Vector functions
+void vtkMultiBlockPLOT3DReader::ComputeVelocity(vtkStructuredGrid* output)
+{
+  double *m, v[3], d, rr;
+  vtkIdType i;
+  vtkDataArray *velocity;
+
+  //  Check that the required data is available
+  //
+  vtkPointData* outputPD = output->GetPointData();
+  vtkDataArray* density = outputPD->GetArray("Density");
+  vtkDataArray* momentum = outputPD->GetArray("Momentum");
+  vtkDataArray* energy = outputPD->GetArray("StagnationEnergy");
+  if ( density == NULL || momentum == NULL ||
+       energy == NULL )
+    {
+    vtkErrorMacro(<<"Cannot compute velocity");
+    return;
+    }
+
+  vtkIdType numPts = density->GetNumberOfTuples();
+  velocity = this->NewFloatArray();
+  velocity->SetNumberOfComponents(3);
+  velocity->SetNumberOfTuples(numPts);
+
+  //  Compute the velocity
+  //
+  for (i=0; i < numPts; i++)
+    {
+    d = density->GetComponent(i,0);
+    d = (d != 0.0 ? d : 1.0);
+    m = momentum->GetTuple(i);
+    rr = 1.0 / d;
+    v[0] = m[0] * rr;
+    v[1] = m[1] * rr;
+    v[2] = m[2] * rr;
+    velocity->SetTuple(i, v);
+  }
+  velocity->SetName("Velocity");
+  outputPD->AddArray(velocity);
+  velocity->Delete();
+  vtkDebugMacro(<<"Created velocity vector");
+}
+
+void vtkMultiBlockPLOT3DReader::ComputeVorticity(vtkStructuredGrid* output)
+{
+  vtkDataArray *velocity;
+  vtkDataArray *vorticity;
+  int dims[3], ijsize;
+  vtkPoints *points;
+  int i, j, k, idx, idx2, ii;
+  double vort[3], xp[3], xm[3], vp[3], vm[3], factor;
+  double xxi, yxi, zxi, uxi, vxi, wxi;
+  double xeta, yeta, zeta, ueta, veta, weta;
+  double xzeta, yzeta, zzeta, uzeta, vzeta, wzeta;
+  double aj, xix, xiy, xiz, etax, etay, etaz, zetax, zetay, zetaz;
+
+  //  Check that the required data is available
+  //
+  vtkPointData* outputPD = output->GetPointData();
+  vtkDataArray* density = outputPD->GetArray("Density");
+  vtkDataArray* momentum = outputPD->GetArray("Momentum");
+  vtkDataArray* energy = outputPD->GetArray("StagnationEnergy");
+  if ( (points=output->GetPoints()) == NULL ||
+       density == NULL || momentum == NULL ||
+       energy == NULL )
+    {
+    vtkErrorMacro(<<"Cannot compute vorticity");
+    return;
+    }
+
+  vtkIdType numPts = density->GetNumberOfTuples();
+  vorticity = this->NewFloatArray();
+  vorticity->SetNumberOfComponents(3);
+  vorticity->SetNumberOfTuples(numPts);
+
+  this->ComputeVelocity(output);
+  velocity = outputPD->GetArray("Velocity");
+
+  output->GetDimensions(dims);
+  ijsize = dims[0]*dims[1];
+
+  for (k=0; k<dims[2]; k++)
+    {
+    for (j=0; j<dims[1]; j++)
+      {
+      for (i=0; i<dims[0]; i++)
+        {
+        //  Xi derivatives.
+        if ( dims[0] == 1 ) // 2D in this direction
+          {
+          factor = 1.0;
+          for (ii=0; ii<3; ii++)
+            {
+            vp[ii] = vm[ii] = xp[ii] = xm[ii] = 0.0;
+            }
+          xp[0] = 1.0;
+          }
+        else if ( i == 0 )
+          {
+          factor = 1.0;
+          idx = (i+1) + j*dims[0] + k*ijsize;
+          idx2 = i + j*dims[0] + k*ijsize;
+          points->GetPoint(idx,xp);
+          points->GetPoint(idx2,xm);
+          velocity->GetTuple(idx,vp);
+          velocity->GetTuple(idx2,vm);
+          }
+        else if ( i == (dims[0]-1) )
+          {
+          factor = 1.0;
+          idx = i + j*dims[0] + k*ijsize;
+          idx2 = i-1 + j*dims[0] + k*ijsize;
+          points->GetPoint(idx,xp);
+          points->GetPoint(idx2,xm);
+          velocity->GetTuple(idx,vp);
+          velocity->GetTuple(idx2,vm);
+          }
+        else
+          {
+          factor = 0.5;
+          idx = (i+1) + j*dims[0] + k*ijsize;
+          idx2 = (i-1) + j*dims[0] + k*ijsize;
+          points->GetPoint(idx,xp);
+          points->GetPoint(idx2,xm);
+          velocity->GetTuple(idx,vp);
+          velocity->GetTuple(idx2,vm);
+          }
+
+        xxi = factor * (xp[0] - xm[0]);
+        yxi = factor * (xp[1] - xm[1]);
+        zxi = factor * (xp[2] - xm[2]);
+        uxi = factor * (vp[0] - vm[0]);
+        vxi = factor * (vp[1] - vm[1]);
+        wxi = factor * (vp[2] - vm[2]);
+
+        //  Eta derivatives.
+        if ( dims[1] == 1 ) // 2D in this direction
+          {
+          factor = 1.0;
+          for (ii=0; ii<3; ii++)
+            {
+            vp[ii] = vm[ii] = xp[ii] = xm[ii] = 0.0;
+            }
+          xp[1] = 1.0;
+          }
+        else if ( j == 0 )
+          {
+          factor = 1.0;
+          idx = i + (j+1)*dims[0] + k*ijsize;
+          idx2 = i + j*dims[0] + k*ijsize;
+          points->GetPoint(idx,xp);
+          points->GetPoint(idx2,xm);
+          velocity->GetTuple(idx,vp);
+          velocity->GetTuple(idx2,vm);
+          }
+        else if ( j == (dims[1]-1) )
+          {
+          factor = 1.0;
+          idx = i + j*dims[0] + k*ijsize;
+          idx2 = i + (j-1)*dims[0] + k*ijsize;
+          points->GetPoint(idx,xp);
+          points->GetPoint(idx2,xm);
+          velocity->GetTuple(idx,vp);
+          velocity->GetTuple(idx2,vm);
+          }
+        else
+          {
+          factor = 0.5;
+          idx = i + (j+1)*dims[0] + k*ijsize;
+          idx2 = i + (j-1)*dims[0] + k*ijsize;
+          points->GetPoint(idx,xp);
+          points->GetPoint(idx2,xm);
+          velocity->GetTuple(idx,vp);
+          velocity->GetTuple(idx2,vm);
+          }
+
+
+        xeta = factor * (xp[0] - xm[0]);
+        yeta = factor * (xp[1] - xm[1]);
+        zeta = factor * (xp[2] - xm[2]);
+        ueta = factor * (vp[0] - vm[0]);
+        veta = factor * (vp[1] - vm[1]);
+        weta = factor * (vp[2] - vm[2]);
+
+        //  Zeta derivatives.
+        if ( dims[2] == 1 ) // 2D in this direction
+          {
+          factor = 1.0;
+          for (ii=0; ii<3; ii++)
+            {
+            vp[ii] = vm[ii] = xp[ii] = xm[ii] = 0.0;
+            }
+          xp[2] = 1.0;
+          }
+        else if ( k == 0 )
+          {
+          factor = 1.0;
+          idx = i + j*dims[0] + (k+1)*ijsize;
+          idx2 = i + j*dims[0] + k*ijsize;
+          points->GetPoint(idx,xp);
+          points->GetPoint(idx2,xm);
+          velocity->GetTuple(idx,vp);
+          velocity->GetTuple(idx2,vm);
+          }
+        else if ( k == (dims[2]-1) )
+          {
+          factor = 1.0;
+          idx = i + j*dims[0] + k*ijsize;
+          idx2 = i + j*dims[0] + (k-1)*ijsize;
+          points->GetPoint(idx,xp);
+          points->GetPoint(idx2,xm);
+          velocity->GetTuple(idx,vp);
+          velocity->GetTuple(idx2,vm);
+          }
+        else
+          {
+          factor = 0.5;
+          idx = i + j*dims[0] + (k+1)*ijsize;
+          idx2 = i + j*dims[0] + (k-1)*ijsize;
+          points->GetPoint(idx,xp);
+          points->GetPoint(idx2,xm);
+          velocity->GetTuple(idx,vp);
+          velocity->GetTuple(idx2,vm);
+          }
+
+        xzeta = factor * (xp[0] - xm[0]);
+        yzeta = factor * (xp[1] - xm[1]);
+        zzeta = factor * (xp[2] - xm[2]);
+        uzeta = factor * (vp[0] - vm[0]);
+        vzeta = factor * (vp[1] - vm[1]);
+        wzeta = factor * (vp[2] - vm[2]);
+
+        // Now calculate the Jacobian.  Grids occasionally have
+        // singularities, or points where the Jacobian is infinite (the
+        // inverse is zero).  For these cases, we'll set the Jacobian to
+        // zero, which will result in a zero vorticity.
+        //
+        aj =  xxi*yeta*zzeta+yxi*zeta*xzeta+zxi*xeta*yzeta
+              -zxi*yeta*xzeta-yxi*xeta*zzeta-xxi*zeta*yzeta;
+        if (aj != 0.0)
+          {
+          aj = 1. / aj;
+          }
+
+        //  Xi metrics.
+        xix  =  aj*(yeta*zzeta-zeta*yzeta);
+        xiy  = -aj*(xeta*zzeta-zeta*xzeta);
+        xiz  =  aj*(xeta*yzeta-yeta*xzeta);
+
+        //  Eta metrics.
+        etax = -aj*(yxi*zzeta-zxi*yzeta);
+        etay =  aj*(xxi*zzeta-zxi*xzeta);
+        etaz = -aj*(xxi*yzeta-yxi*xzeta);
+
+        //  Zeta metrics.
+        zetax=  aj*(yxi*zeta-zxi*yeta);
+        zetay= -aj*(xxi*zeta-zxi*xeta);
+        zetaz=  aj*(xxi*yeta-yxi*xeta);
+
+        //  Finally, the vorticity components.
+        //
+        vort[0]= xiy*wxi+etay*weta+zetay*wzeta - xiz*vxi-etaz*veta-zetaz*vzeta;
+        vort[1]= xiz*uxi+etaz*ueta+zetaz*uzeta - xix*wxi-etax*weta-zetax*wzeta;
+        vort[2]= xix*vxi+etax*veta+zetax*vzeta - xiy*uxi-etay*ueta-zetay*uzeta;
+        idx = i + j*dims[0] + k*ijsize;
+        vorticity->SetTuple(idx,vort);
+        }
+      }
+    }
+  vorticity->SetName("Vorticity");
+  outputPD->AddArray(vorticity);
+  vorticity->Delete();
+  vtkDebugMacro(<<"Created vorticity vector");
+}
+
+void vtkMultiBlockPLOT3DReader::ComputePressureGradient(vtkStructuredGrid* output)
+{
+  vtkDataArray *pressure;
+  vtkDataArray *gradient;
+  int dims[3], ijsize;
+  vtkPoints *points;
+  int i, j, k, idx, idx2, ii;
+  double g[3], xp[3], xm[3], pp, pm, factor;
+  double xxi, yxi, zxi, pxi;
+  double xeta, yeta, zeta, peta;
+  double xzeta, yzeta, zzeta, pzeta;
+  double aj, xix, xiy, xiz, etax, etay, etaz, zetax, zetay, zetaz;
+
+  //  Check that the required data is available
+  //
+  vtkPointData* outputPD = output->GetPointData();
+  vtkDataArray* density = outputPD->GetArray("Density");
+  vtkDataArray* momentum = outputPD->GetArray("Momentum");
+  vtkDataArray* energy = outputPD->GetArray("StagnationEnergy");
+  if ( (points=output->GetPoints()) == NULL ||
+       density == NULL || momentum == NULL ||
+       energy == NULL )
+    {
+    vtkErrorMacro(<<"Cannot compute pressure gradient");
+    return;
+    }
+
+  vtkIdType numPts = density->GetNumberOfTuples();
+  gradient = this->NewFloatArray();
+  gradient->SetNumberOfComponents(3);
+  gradient->SetNumberOfTuples(numPts);
+
+  this->ComputePressure(output);
+  pressure = outputPD->GetArray("Pressure");
+
+  output->GetDimensions(dims);
+  ijsize = dims[0]*dims[1];
+
+  for (k=0; k<dims[2]; k++)
+    {
+    for (j=0; j<dims[1]; j++)
+      {
+      for (i=0; i<dims[0]; i++)
+        {
+        //  Xi derivatives.
+        if ( dims[0] == 1 ) // 2D in this direction
+          {
+          factor = 1.0;
+          for (ii=0; ii<3; ii++)
+            {
+            xp[ii] = xm[ii] = 0.0;
+            }
+          xp[0] = 1.0; pp = pm = 0.0;
+          }
+        else if ( i == 0 )
+          {
+          factor = 1.0;
+          idx = (i+1) + j*dims[0] + k*ijsize;
+          idx2 = i + j*dims[0] + k*ijsize;
+          points->GetPoint(idx,xp);
+          points->GetPoint(idx2,xm);
+          pp = pressure->GetComponent(idx,0);
+          pm = pressure->GetComponent(idx2,0);
+          }
+        else if ( i == (dims[0]-1) )
+          {
+          factor = 1.0;
+          idx = i + j*dims[0] + k*ijsize;
+          idx2 = i-1 + j*dims[0] + k*ijsize;
+          points->GetPoint(idx,xp);
+          points->GetPoint(idx2,xm);
+          pp = pressure->GetComponent(idx,0);
+          pm = pressure->GetComponent(idx2,0);
+          }
+        else
+          {
+          factor = 0.5;
+          idx = (i+1) + j*dims[0] + k*ijsize;
+          idx2 = (i-1) + j*dims[0] + k*ijsize;
+          points->GetPoint(idx,xp);
+          points->GetPoint(idx2,xm);
+          pp = pressure->GetComponent(idx,0);
+          pm = pressure->GetComponent(idx2,0);
+          }
+
+        xxi = factor * (xp[0] - xm[0]);
+        yxi = factor * (xp[1] - xm[1]);
+        zxi = factor * (xp[2] - xm[2]);
+        pxi = factor * (pp - pm);
+
+        //  Eta derivatives.
+        if ( dims[1] == 1 ) // 2D in this direction
+          {
+          factor = 1.0;
+          for (ii=0; ii<3; ii++)
+            {
+            xp[ii] = xm[ii] = 0.0;
+            }
+          xp[1] = 1.0; pp = pm = 0.0;
+          }
+        else if ( j == 0 )
+          {
+          factor = 1.0;
+          idx = i + (j+1)*dims[0] + k*ijsize;
+          idx2 = i + j*dims[0] + k*ijsize;
+          points->GetPoint(idx,xp);
+          points->GetPoint(idx2,xm);
+          pp = pressure->GetComponent(idx,0);
+          pm = pressure->GetComponent(idx2,0);
+          }
+        else if ( j == (dims[1]-1) )
+          {
+          factor = 1.0;
+          idx = i + j*dims[0] + k*ijsize;
+          idx2 = i + (j-1)*dims[0] + k*ijsize;
+          points->GetPoint(idx,xp);
+          points->GetPoint(idx2,xm);
+          pp = pressure->GetComponent(idx,0);
+          pm = pressure->GetComponent(idx2,0);
+          }
+        else
+          {
+          factor = 0.5;
+          idx = i + (j+1)*dims[0] + k*ijsize;
+          idx2 = i + (j-1)*dims[0] + k*ijsize;
+          points->GetPoint(idx,xp);
+          points->GetPoint(idx2,xm);
+          pp = pressure->GetComponent(idx,0);
+          pm = pressure->GetComponent(idx2,0);
+          }
+
+        xeta = factor * (xp[0] - xm[0]);
+        yeta = factor * (xp[1] - xm[1]);
+        zeta = factor * (xp[2] - xm[2]);
+        peta = factor * (pp - pm);
+
+        //  Zeta derivatives.
+        if ( dims[2] == 1 ) // 2D in this direction
+          {
+          factor = 1.0;
+          for (ii=0; ii<3; ii++)
+            {
+            xp[ii] = xm[ii] = 0.0;
+            }
+          xp[2] = 1.0; pp = pm = 0.0;
+          }
+        else if ( k == 0 )
+          {
+          factor = 1.0;
+          idx = i + j*dims[0] + (k+1)*ijsize;
+          idx2 = i + j*dims[0] + k*ijsize;
+          points->GetPoint(idx,xp);
+          points->GetPoint(idx2,xm);
+          pp = pressure->GetComponent(idx,0);
+          pm = pressure->GetComponent(idx2,0);
+          }
+        else if ( k == (dims[2]-1) )
+          {
+          factor = 1.0;
+          idx = i + j*dims[0] + k*ijsize;
+          idx2 = i + j*dims[0] + (k-1)*ijsize;
+          points->GetPoint(idx,xp);
+          points->GetPoint(idx2,xm);
+          pp = pressure->GetComponent(idx,0);
+          pm = pressure->GetComponent(idx2,0);
+          }
+        else
+          {
+          factor = 0.5;
+          idx = i + j*dims[0] + (k+1)*ijsize;
+          idx2 = i + j*dims[0] + (k-1)*ijsize;
+          points->GetPoint(idx,xp);
+          points->GetPoint(idx2,xm);
+          pp = pressure->GetComponent(idx,0);
+          pm = pressure->GetComponent(idx2,0);
+          }
+
+        xzeta = factor * (xp[0] - xm[0]);
+        yzeta = factor * (xp[1] - xm[1]);
+        zzeta = factor * (xp[2] - xm[2]);
+        pzeta = factor * (pp - pm);
+
+        //  Now calculate the Jacobian.  Grids occasionally have
+        //  singularities, or points where the Jacobian is infinite (the
+        //  inverse is zero).  For these cases, we'll set the Jacobian to
+        //  zero, which will result in a zero vorticity.
+        //
+        aj =  xxi*yeta*zzeta+yxi*zeta*xzeta+zxi*xeta*yzeta
+              -zxi*yeta*xzeta-yxi*xeta*zzeta-xxi*zeta*yzeta;
+        if (aj != 0.0)
+          {
+          aj = 1. / aj;
+          }
+
+        //  Xi metrics.
+        xix  =  aj*(yeta*zzeta-zeta*yzeta);
+        xiy  = -aj*(xeta*zzeta-zeta*xzeta);
+        xiz  =  aj*(xeta*yzeta-yeta*xzeta);
+
+        //  Eta metrics.
+        etax = -aj*(yxi*zzeta-zxi*yzeta);
+        etay =  aj*(xxi*zzeta-zxi*xzeta);
+        etaz = -aj*(xxi*yzeta-yxi*xzeta);
+
+        //  Zeta metrics.
+        zetax=  aj*(yxi*zeta-zxi*yeta);
+        zetay= -aj*(xxi*zeta-zxi*xeta);
+        zetaz=  aj*(xxi*yeta-yxi*xeta);
+
+        //  Finally, the vorticity components.
+        g[0]= xix*pxi+etax*peta+zetax*pzeta;
+        g[1]= xiy*pxi+etay*peta+zetay*pzeta;
+        g[2]= xiz*pxi+etaz*peta+zetaz*pzeta;
+
+        idx = i + j*dims[0] + k*ijsize;
+        gradient->SetTuple(idx,g);
+        }
+      }
+    }
+  gradient->SetName("PressureGradient");
+  outputPD->AddArray(gradient);
+  gradient->Delete();
+  vtkDebugMacro(<<"Created pressure gradient vector");
+}
+
+void vtkMultiBlockPLOT3DReader::ComputePressureCoefficient(vtkStructuredGrid* output)
+{
+  double *m, e, u, v, w, v2, p, d, g, rr, pc, gi, pi, fsm, den;
+  vtkIdType i;
+
+  //  Check that the required data is available
+  //
+  vtkPointData* outputPD = output->GetPointData();
+  vtkFieldData* outputFD = output->GetFieldData();
+  // It's already computed
+  if (outputPD->GetArray("PressureCoefficient"))
+    {
+    return;
+    }
+  vtkDataArray* density = outputPD->GetArray("Density");
+  vtkDataArray* momentum = outputPD->GetArray("Momentum");
+  vtkDataArray* energy = outputPD->GetArray("StagnationEnergy");
+  vtkDataArray* gamma = outputPD->GetArray("Gamma");
+  vtkDataArray* props = outputFD->GetArray("Properties");
+  if ( density == NULL || momentum == NULL ||
+       energy == NULL  || gamma == NULL || props == NULL)
+    {
+    vtkErrorMacro(<<"Cannot compute pressure coefficient");
+    return;
+    }
+
+  vtkIdType numPts = density->GetNumberOfTuples();
+  vtkDataArray* pressure_coeff = this->NewFloatArray();
+  pressure_coeff->SetNumberOfTuples(numPts);
+  //  Compute the pressure coefficient
+  //
+  gi = props->GetComponent(0,4);
+  fsm = props->GetComponent(0,0);
+  den = .5*fsm*fsm;
+  for (i=0; i < numPts; i++)
+    {
+    d = density->GetComponent(i,0);
+    d = (d != 0.0 ? d : 1.0);
+    m = momentum->GetTuple(i);
+    e = energy->GetComponent(i,0);
+    g = gamma->GetComponent(i,0);
+    pi = 1.0 / gi;
+    rr = 1.0 / d;
+    u = m[0] * rr;
+    v = m[1] * rr;
+    w = m[2] * rr;
+    v2 = u*u + v*v + w*w;
+    p = (g-1.) * (e - 0.5 * d * v2);
+    pc = (p - pi)/den;
+    pressure_coeff->SetTuple1(i, pc);
+    }
+
+  pressure_coeff->SetName("PressureCoefficient");
+  outputPD->AddArray(pressure_coeff);
+  pressure_coeff->Delete();
+  vtkDebugMacro(<<"Created pressure coefficient scalar");
+}
+
+void vtkMultiBlockPLOT3DReader::ComputeMachNumber(vtkStructuredGrid* output)
+{
+  double *m, e, u, v, w, v2, a2, d, g, rr;
+  vtkIdType i;
+
+  //  Check that the required data is available
+  //
+  vtkPointData* outputPD = output->GetPointData();
+  // It's already computed
+  if (outputPD->GetArray("MachNumber"))
+    {
+    return;
+    }
+  vtkDataArray* density = outputPD->GetArray("Density");
+  vtkDataArray* momentum = outputPD->GetArray("Momentum");
+  vtkDataArray* energy = outputPD->GetArray("StagnationEnergy");
+  vtkDataArray* gamma = outputPD->GetArray("Gamma");
+  if ( density == NULL || momentum == NULL ||
+       energy == NULL  || gamma == NULL)
+    {
+    vtkErrorMacro(<<"Cannot compute mach number");
+    return;
+    }
+
+  vtkIdType numPts = density->GetNumberOfTuples();
+  vtkDataArray* machnumber = this->NewFloatArray();
+  machnumber->SetNumberOfTuples(numPts);
+
+  //  Compute the mach number
+  //
+  for (i=0; i < numPts; i++)
+    {
+    d = density->GetComponent(i,0);
+    d = (d != 0.0 ? d : 1.0);
+    m = momentum->GetTuple(i);
+    e = energy->GetComponent(i,0);
+    g = gamma->GetComponent(i,0);
+    rr = 1.0 / d;
+    u = m[0] * rr;
+    v = m[1] * rr;
+    w = m[2] * rr;
+    v2 = u*u + v*v + w*w;
+    a2 = g * (g-1.) * (e * rr - .5*v2);
+    machnumber->SetTuple1(i, sqrt(v2/a2));
+  }
+
+  machnumber->SetName("MachNumber");
+  outputPD->AddArray(machnumber);
+  machnumber->Delete();
+  vtkDebugMacro(<<"Created mach number scalar");
+}
+
+void vtkMultiBlockPLOT3DReader::ComputeSoundSpeed(vtkStructuredGrid* output)
+{
+  double *m, e, u, v, w, v2, p, d, g, rr;
+  vtkIdType i;
+
+  //  Check that the required data is available
+  //
+  vtkPointData* outputPD = output->GetPointData();
+  // It's already computed
+  if (outputPD->GetArray("SoundSpeed"))
+    {
+    return;
+    }
+  vtkDataArray* density = outputPD->GetArray("Density");
+  vtkDataArray* momentum = outputPD->GetArray("Momentum");
+  vtkDataArray* energy = outputPD->GetArray("StagnationEnergy");
+  vtkDataArray* gamma = outputPD->GetArray("Gamma");
+  if ( density == NULL || momentum == NULL ||
+       energy == NULL  || gamma == NULL)
+    {
+    vtkErrorMacro(<<"Cannot compute sound speed");
+    return;
+    }
+
+  vtkIdType numPts = density->GetNumberOfTuples();
+  vtkDataArray* soundspeed = this->NewFloatArray();
+  soundspeed->SetNumberOfTuples(numPts);
+
+  //  Compute sound speed
+  //
+  for (i=0; i < numPts; i++)
+    {
+    d = density->GetComponent(i,0);
+    d = (d != 0.0 ? d : 1.0);
+    m = momentum->GetTuple(i);
+    e = energy->GetComponent(i,0);
+    g = gamma->GetComponent(i,0);
+    rr = 1.0 / d;
+    u = m[0] * rr;
+    v = m[1] * rr;
+    w = m[2] * rr;
+    v2 = u*u + v*v + w*w;
+    p = (g-1.) * (e - 0.5 * d * v2);
+    soundspeed->SetTuple1(i, sqrt(g*p*rr));
+  }
+
+  soundspeed->SetName("SoundSpeed");
+  outputPD->AddArray(soundspeed);
+  soundspeed->Delete();
+  vtkDebugMacro(<<"Created sound speed scalar");
+}
+
+void vtkMultiBlockPLOT3DReader::ComputeVorticityMagnitude(vtkStructuredGrid* output)
+{
+  vtkPointData* outputPD = output->GetPointData();
+  // It's already computed
+  if (outputPD->GetArray("VorticityMagnitude"))
+    {
+    return;
+    }
+  this->ComputeVorticity(output);
+  vtkDataArray* vorticity = outputPD->GetArray("Vorticity");
+  vtkDataArray* vm = this->NewFloatArray();
+  vtkIdType numPts = vorticity->GetNumberOfTuples();
+  vm->SetNumberOfTuples(numPts);
+  for (vtkIdType idx=0; idx<numPts; idx++)
+    {
+    double* vort = vorticity->GetTuple(idx);
+    double magnitude = sqrt(vort[0]*vort[0]+
+                            vort[1]*vort[1]+vort[2]*vort[2]);
+    vm->SetTuple1(idx, magnitude);
+    }
+  vm->SetName("VorticityMagnitude");
+  outputPD->AddArray(vm);
+  vm->Delete();
+}
+
+void vtkMultiBlockPLOT3DReader::ComputeStrainRate(vtkStructuredGrid* output)
+{
+  vtkDataArray *velocity;
+  int dims[3], ijsize;
+  int i, j, k, idx, idx2, ii;
+  double stRate[3], xp[3], xm[3], vp[3], vm[3], factor;
+  double xxi, yxi, zxi, uxi, vxi, wxi;
+  double xeta, yeta, zeta, ueta, veta, weta;
+  double xzeta, yzeta, zzeta, uzeta, vzeta, wzeta;
+  double aj, xix, xiy, xiz, etax, etay, etaz, zetax, zetay, zetaz;
+
+  //  Check that the required data is available
+  //
+  vtkPointData* outputPD = output->GetPointData();
+  if (outputPD->GetArray("StrainRate"))
+    {
+    return;
+    }
+  vtkDataArray* density = outputPD->GetArray("Density");
+  vtkDataArray* momentum = outputPD->GetArray("Momentum");
+  if ( density == NULL || momentum == NULL )
+    {
+    vtkErrorMacro("Cannot compute strain rate.");
+    return;
+    }
+
+  vtkIdType numPts = density->GetNumberOfTuples();
+  vtkDataArray* strainRate = this->NewFloatArray();
+  strainRate->SetNumberOfComponents(3);
+  strainRate->SetNumberOfTuples(numPts);
+  strainRate->SetName("StrainRate");
+
+  this->ComputeVelocity(output);
+  velocity = outputPD->GetArray("Velocity");
+  if(!velocity)
+    {
+    vtkErrorMacro("Could not compute strain rate.");
+    return;
+    }
+
+  output->GetDimensions(dims);
+  ijsize = dims[0]*dims[1];
+
+  for (k=0; k<dims[2]; k++)
+    {
+    for (j=0; j<dims[1]; j++)
+      {
+      for (i=0; i<dims[0]; i++)
+        {
+        //  Xi derivatives.
+        if ( dims[0] == 1 ) // 2D in this direction
+          {
+          factor = 1.0;
+          for (ii=0; ii<3; ii++)
+            {
+            vp[ii] = vm[ii] = xp[ii] = xm[ii] = 0.0;
+            }
+          xp[0] = 1.0;
+          }
+        else if ( i == 0 )
+          {
+          factor = 1.0;
+          idx = (i+1) + j*dims[0] + k*ijsize;
+          idx2 = i + j*dims[0] + k*ijsize;
+          output->GetPoint(idx,xp);
+          output->GetPoint(idx2,xm);
+          velocity->GetTuple(idx,vp);
+          velocity->GetTuple(idx2,vm);
+          }
+        else if ( i == (dims[0]-1) )
+          {
+          factor = 1.0;
+          idx = i + j*dims[0] + k*ijsize;
+          idx2 = i-1 + j*dims[0] + k*ijsize;
+          output->GetPoint(idx,xp);
+          output->GetPoint(idx2,xm);
+          velocity->GetTuple(idx,vp);
+          velocity->GetTuple(idx2,vm);
+          }
+        else
+          {
+          factor = 0.5;
+          idx = (i+1) + j*dims[0] + k*ijsize;
+          idx2 = (i-1) + j*dims[0] + k*ijsize;
+          output->GetPoint(idx,xp);
+          output->GetPoint(idx2,xm);
+          velocity->GetTuple(idx,vp);
+          velocity->GetTuple(idx2,vm);
+          }
+
+        xxi = factor * (xp[0] - xm[0]);
+        yxi = factor * (xp[1] - xm[1]);
+        zxi = factor * (xp[2] - xm[2]);
+        uxi = factor * (vp[0] - vm[0]);
+        vxi = factor * (vp[1] - vm[1]);
+        wxi = factor * (vp[2] - vm[2]);
+
+        //  Eta derivatives.
+        if ( dims[1] == 1 ) // 2D in this direction
+          {
+          factor = 1.0;
+          for (ii=0; ii<3; ii++)
+            {
+            vp[ii] = vm[ii] = xp[ii] = xm[ii] = 0.0;
+            }
+          xp[1] = 1.0;
+          }
+        else if ( j == 0 )
+          {
+          factor = 1.0;
+          idx = i + (j+1)*dims[0] + k*ijsize;
+          idx2 = i + j*dims[0] + k*ijsize;
+          output->GetPoint(idx,xp);
+          output->GetPoint(idx2,xm);
+          velocity->GetTuple(idx,vp);
+          velocity->GetTuple(idx2,vm);
+          }
+        else if ( j == (dims[1]-1) )
+          {
+          factor = 1.0;
+          idx = i + j*dims[0] + k*ijsize;
+          idx2 = i + (j-1)*dims[0] + k*ijsize;
+          output->GetPoint(idx,xp);
+          output->GetPoint(idx2,xm);
+          velocity->GetTuple(idx,vp);
+          velocity->GetTuple(idx2,vm);
+          }
+        else
+          {
+          factor = 0.5;
+          idx = i + (j+1)*dims[0] + k*ijsize;
+          idx2 = i + (j-1)*dims[0] + k*ijsize;
+          output->GetPoint(idx,xp);
+          output->GetPoint(idx2,xm);
+          velocity->GetTuple(idx,vp);
+          velocity->GetTuple(idx2,vm);
+          }
+
+
+        xeta = factor * (xp[0] - xm[0]);
+        yeta = factor * (xp[1] - xm[1]);
+        zeta = factor * (xp[2] - xm[2]);
+        ueta = factor * (vp[0] - vm[0]);
+        veta = factor * (vp[1] - vm[1]);
+        weta = factor * (vp[2] - vm[2]);
+
+        //  Zeta derivatives.
+        if ( dims[2] == 1 ) // 2D in this direction
+          {
+          factor = 1.0;
+          for (ii=0; ii<3; ii++)
+            {
+            vp[ii] = vm[ii] = xp[ii] = xm[ii] = 0.0;
+            }
+          xp[2] = 1.0;
+          }
+        else if ( k == 0 )
+          {
+          factor = 1.0;
+          idx = i + j*dims[0] + (k+1)*ijsize;
+          idx2 = i + j*dims[0] + k*ijsize;
+          output->GetPoint(idx,xp);
+          output->GetPoint(idx2,xm);
+          velocity->GetTuple(idx,vp);
+          velocity->GetTuple(idx2,vm);
+          }
+        else if ( k == (dims[2]-1) )
+          {
+          factor = 1.0;
+          idx = i + j*dims[0] + k*ijsize;
+          idx2 = i + j*dims[0] + (k-1)*ijsize;
+          output->GetPoint(idx,xp);
+          output->GetPoint(idx2,xm);
+          velocity->GetTuple(idx,vp);
+          velocity->GetTuple(idx2,vm);
+          }
+        else
+          {
+          factor = 0.5;
+          idx = i + j*dims[0] + (k+1)*ijsize;
+          idx2 = i + j*dims[0] + (k-1)*ijsize;
+          output->GetPoint(idx,xp);
+          output->GetPoint(idx2,xm);
+          velocity->GetTuple(idx,vp);
+          velocity->GetTuple(idx2,vm);
+          }
+
+        xzeta = factor * (xp[0] - xm[0]);
+        yzeta = factor * (xp[1] - xm[1]);
+        zzeta = factor * (xp[2] - xm[2]);
+        uzeta = factor * (vp[0] - vm[0]);
+        vzeta = factor * (vp[1] - vm[1]);
+        wzeta = factor * (vp[2] - vm[2]);
+
+        // Now calculate the Jacobian.  Grids occasionally have
+        // singularities, or points where the Jacobian is infinite (the
+        // inverse is zero).  For these cases, we'll set the Jacobian to
+        // zero, which will result in a zero vorticity.
+        //
+        aj =  xxi*yeta*zzeta+yxi*zeta*xzeta+zxi*xeta*yzeta
+              -zxi*yeta*xzeta-yxi*xeta*zzeta-xxi*zeta*yzeta;
+        if (aj != 0.0)
+          {
+          aj = 1. / aj;
+          }
+
+        //  Xi metrics.
+        xix  =  aj*(yeta*zzeta-zeta*yzeta);
+        xiy  = -aj*(xeta*zzeta-zeta*xzeta);
+        xiz  =  aj*(xeta*yzeta-yeta*xzeta);
+
+        //  Eta metrics.
+        etax = -aj*(yxi*zzeta-zxi*yzeta);
+        etay =  aj*(xxi*zzeta-zxi*xzeta);
+        etaz = -aj*(xxi*yzeta-yxi*xzeta);
+
+        //  Zeta metrics.
+        zetax=  aj*(yxi*zeta-zxi*yeta);
+        zetay= -aj*(xxi*zeta-zxi*xeta);
+        zetaz=  aj*(xxi*yeta-yxi*xeta);
+
+        //  Finally, the strain rate components.
+        //
+        stRate[0] = xix*uxi+etax*ueta+zetax*uzeta;
+        stRate[1] = xiy*vxi+etay*veta+zetay*vzeta;
+        stRate[2] = xiz*wxi+etaz*weta+zetaz*wzeta;
+        idx = i + j*dims[0] + k*ijsize;
+        strainRate->SetTuple(idx,stRate);
+        }
+      }
+    }
+  outputPD->AddArray(strainRate);
+  strainRate->Delete();
+}
+
+void vtkMultiBlockPLOT3DReader::SetByteOrderToBigEndian()
+{
+  this->ByteOrder = FILE_BIG_ENDIAN;
+}
+
+void vtkMultiBlockPLOT3DReader::SetByteOrderToLittleEndian()
+{
+  this->ByteOrder = FILE_LITTLE_ENDIAN;
+}
+
+const char *vtkMultiBlockPLOT3DReader::GetByteOrderAsString()
+{
+  if ( this->ByteOrder ==  FILE_LITTLE_ENDIAN)
+    {
+    return "LittleEndian";
+    }
+  else
+    {
+    return "BigEndian";
+    }
+}
+
+void vtkMultiBlockPLOT3DReader::AddFunction(int functionNumber)
+{
+  this->FunctionList->InsertNextValue(functionNumber);
+  this->Modified();
+}
+
+void vtkMultiBlockPLOT3DReader::RemoveAllFunctions()
+{
+  this->FunctionList->Reset();
+  this->Modified();
+}
+
+int vtkMultiBlockPLOT3DReader::FillOutputPortInformation(
+  int vtkNotUsed(port), vtkInformation* info)
+{
+  info->Set(vtkDataObject::DATA_TYPE_NAME(), "vtkMultiBlockDataSet");
+  return 1;
+}
+
+void vtkMultiBlockPLOT3DReader::PrintSelf(ostream& os, vtkIndent indent)
+{
+  this->Superclass::PrintSelf(os,indent);
+
+  os << indent << "XYZ File Name: " <<
+    (this->XYZFileName ? this->XYZFileName : "(none)") << "\n";
+  os << indent << "Q File Name: " <<
+    (this->QFileName ? this->QFileName : "(none)") << "\n";
+  os << indent << "Function File Name: " <<
+    (this->FunctionFileName ? this->FunctionFileName : "(none)") << "\n";
+  os << indent << "BinaryFile: " << this->BinaryFile << endl;
+  os << indent << "HasByteCount: " << this->HasByteCount << endl;
+  os << indent << "Gamma: " << this->Gamma << endl;
+  os << indent << "R: " << this->R << endl;
+  os << indent << "ScalarFunctionNumber: " << this->ScalarFunctionNumber << endl;
+  os << indent << "VectorFunctionNumber: " << this->VectorFunctionNumber << endl;
+  os << indent << "MultiGrid: " << this->MultiGrid << endl;
+  os << indent << "ForceRead: " << this->ForceRead << endl;
+  os << indent << "IBlanking: " << this->IBlanking << endl;
+  os << indent << "ByteOrder: " << this->ByteOrder << endl;
+  os << indent << "TwoDimensionalGeometry: " << (this->TwoDimensionalGeometry?"on":"off")
+     << endl;
+  os << indent << "Double Precision:" << this->DoublePrecision << endl;
+  os << indent << "Auto Detect Format: " << this->AutoDetectFormat << endl;
+}
+
+void vtkMultiBlockPLOT3DReader::Modified()
+{
+  this->Superclass::Modified();
+  if (this->Internal)
+    {
+    this->Internal->NeedToCheckXYZFile = true;
+    }
+}
diff --git a/IO/Geometry/vtkMultiBlockPLOT3DReader.h b/IO/Geometry/vtkMultiBlockPLOT3DReader.h
new file mode 100644
index 0000000..5902088
--- /dev/null
+++ b/IO/Geometry/vtkMultiBlockPLOT3DReader.h
@@ -0,0 +1,353 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+  Module:    vtkMultiBlockPLOT3DReader.h
+
+  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.
+
+=========================================================================*/
+// .NAME vtkMultiBlockPLOT3DReader - read PLOT3D data files
+// .SECTION Description
+// vtkMultiBlockPLOT3DReader is a reader object that reads PLOT3D formatted
+// files and generates structured grid(s) on output. PLOT3D is a computer
+// graphics program designed to visualize the grids and solutions of
+// computational fluid dynamics. This reader also supports the variant
+// of the PLOT3D format used by NASA's OVERFLOW CFD software, including
+// full support for all Q variables. Please see the "PLOT3D User's Manual"
+// available from NASA Ames Research Center, Moffett Field CA.
+//
+// PLOT3D files consist of a grid file (also known as XYZ file), an
+// optional solution file (also known as a Q file), and an optional function
+// file that contains user created data (currently unsupported). The Q file
+// contains solution  information as follows: the four parameters free stream
+// mach number (Fsmach), angle of attack (Alpha), Reynolds number (Re), and
+// total integration time (Time). This information is stored in an array
+// called Properties in the FieldData of each output (tuple 0: fsmach, tuple 1:
+// alpha, tuple 2: re, tuple 3: time). In addition, the solution file contains
+// the flow density (scalar), flow momentum (vector), and flow energy (scalar).
+//
+// Note that this reader does not support time series data which is usually
+// stored as a series of Q and optionally XYZ files. If you want to read such
+// a file series, use vtkPlot3DMetaReader.
+//
+// The reader can generate additional scalars and vectors (or "functions")
+// from this information. To use vtkMultiBlockPLOT3DReader, you must specify the
+// particular function number for the scalar and vector you want to visualize.
+// This implementation of the reader provides the following functions. The
+// scalar functions are:
+//    -1  - don't read or compute any scalars
+//    100 - density
+//    110 - pressure
+//    111 - pressure coefficient (requires Overflow file with Gamma)
+//    112 - mach number (requires Overflow file with Gamma)
+//    113 - sounds speed (requires Overflow file with Gamma)
+//    120 - temperature
+//    130 - enthalpy
+//    140 - internal energy
+//    144 - kinetic energy
+//    153 - velocity magnitude
+//    163 - stagnation energy
+//    170 - entropy
+//    184 - swirl
+//    211 - vorticity magnitude
+//
+// The vector functions are:
+//    -1  - don't read or compute any vectors
+//    200 - velocity
+//    201 - vorticity
+//    202 - momentum
+//    210 - pressure gradient.
+//    212 - strain rate
+//
+// (Other functions are described in the PLOT3D spec, but only those listed are
+// implemented here.) Note that by default, this reader creates the density
+// scalar (100), stagnation energy (163) and momentum vector (202) as output.
+// (These are just read in from the solution file.) Please note that the validity
+// of computation is a function of this class's gas constants (R, Gamma) and the
+// equations used. They may not be suitable for your computational domain.
+//
+// Additionally, you can read other data and associate it as a vtkDataArray
+// into the output's point attribute data. Use the method AddFunction()
+// to list all the functions that you'd like to read. AddFunction() accepts
+// an integer parameter that defines the function number.
+//
+// .SECTION See Also
+// vtkMultiBlockDataSet vtkStructuredGrid vtkPlot3DMetaReader
+
+#ifndef vtkMultiBlockPLOT3DReader_h
+#define vtkMultiBlockPLOT3DReader_h
+
+#include "vtkIOGeometryModule.h" // For export macro
+#include "vtkMultiBlockDataSetAlgorithm.h"
+
+class vtkDataArray;
+class vtkUnsignedCharArray;
+class vtkIntArray;
+class vtkStructuredGrid;
+//BTX
+struct vtkMultiBlockPLOT3DReaderInternals;
+//ETX
+class VTKIOGEOMETRY_EXPORT vtkMultiBlockPLOT3DReader : public vtkMultiBlockDataSetAlgorithm
+{
+public:
+  static vtkMultiBlockPLOT3DReader *New();
+  vtkTypeMacro(vtkMultiBlockPLOT3DReader,vtkMultiBlockDataSetAlgorithm);
+  void PrintSelf(ostream& os, vtkIndent indent);
+
+  // Description:
+  // Set/Get the PLOT3D geometry filename.
+  void SetFileName(const char* name) { this->SetXYZFileName(name); }
+  const char* GetFileName() { return this->GetXYZFileName(); }
+  virtual void SetXYZFileName( const char* );
+  vtkGetStringMacro(XYZFileName);
+
+  // Description:
+  // Set/Get the PLOT3D solution filename.
+  vtkSetStringMacro(QFileName);
+  vtkGetStringMacro(QFileName);
+
+  // Description:
+  // Set/Get the PLOT3D function filename.
+  vtkSetStringMacro(FunctionFileName);
+  vtkGetStringMacro(FunctionFileName);
+
+  // Description:
+  // When this option is turned on, the reader will try to figure
+  // out the values of various options such as byte order, byte
+  // count etc. automatically. This options works only for binary
+  // files. When it is turned on, the reader should be able to read
+  // most Plot3D files automatically. The default is OFF for backwards
+  // compatibility reasons. For binary files, it is strongly recommended
+  // that you turn on AutoDetectFormat and leave the other file format
+  // related options untouched.
+  vtkSetMacro(AutoDetectFormat, int);
+  vtkGetMacro(AutoDetectFormat, int);
+  vtkBooleanMacro(AutoDetectFormat, int);
+
+  // Description:
+  // Is the file to be read written in binary format (as opposed
+  // to ascii).
+  vtkSetMacro(BinaryFile, int);
+  vtkGetMacro(BinaryFile, int);
+  vtkBooleanMacro(BinaryFile, int);
+
+  // Description:
+  // Does the file to be read contain information about number of
+  // grids. In some PLOT3D files, the first value contains the number
+  // of grids (even if there is only 1). If reading such a file,
+  // set this to true.
+  vtkSetMacro(MultiGrid, int);
+  vtkGetMacro(MultiGrid, int);
+  vtkBooleanMacro(MultiGrid, int);
+
+  // Description:
+  // Were the arrays written with leading and trailing byte counts ?
+  // Usually, files written by a fortran program will contain these
+  // byte counts whereas the ones written by C/C++ won't.
+  vtkSetMacro(HasByteCount, int);
+  vtkGetMacro(HasByteCount, int);
+  vtkBooleanMacro(HasByteCount, int);
+
+  // Description:
+  // Is there iblanking (point visibility) information in the file.
+  // If there is iblanking arrays, these will be read and assigned
+  // to the PointVisibility array of the output.
+  vtkSetMacro(IBlanking, int);
+  vtkGetMacro(IBlanking, int);
+  vtkBooleanMacro(IBlanking, int);
+
+  // Description:
+  // If only two-dimensional data was written to the file,
+  // turn this on.
+  vtkSetMacro(TwoDimensionalGeometry, int);
+  vtkGetMacro(TwoDimensionalGeometry, int);
+  vtkBooleanMacro(TwoDimensionalGeometry, int);
+
+  // Description:
+  // Is this file in double precision or single precision.
+  // This only matters for binary files.
+  // Default is single.
+  vtkSetMacro(DoublePrecision, int);
+  vtkGetMacro(DoublePrecision, int);
+  vtkBooleanMacro(DoublePrecision, int);
+
+  // Description:
+  // Try to read a binary file even if the file length seems to be
+  // inconsistent with the header information. Use this with caution,
+  // if the file length is not the same as calculated from the header.
+  // either the file is corrupt or the settings are wrong.
+  vtkSetMacro(ForceRead, int);
+  vtkGetMacro(ForceRead, int);
+  vtkBooleanMacro(ForceRead, int);
+
+  // Description:
+  // Set the byte order of the file (remember, more Unix workstations
+  // write big endian whereas PCs write little endian). Default is
+  // big endian (since most older PLOT3D files were written by
+  // workstations).
+  void SetByteOrderToBigEndian();
+  void SetByteOrderToLittleEndian();
+  vtkSetMacro(ByteOrder, int);
+  vtkGetMacro(ByteOrder, int);
+  const char *GetByteOrderAsString();
+
+  // Description:
+  // Set/Get the gas constant. Default is 1.0.
+  vtkSetMacro(R,double);
+  vtkGetMacro(R,double);
+
+  // Description:
+  // Set/Get the ratio of specific heats. Default is 1.4.
+  vtkSetMacro(Gamma,double);
+  vtkGetMacro(Gamma,double);
+
+  // Description:
+  // Specify the scalar function to extract. If ==(-1), then no scalar
+  // function is extracted.
+  void SetScalarFunctionNumber(int num);
+  vtkGetMacro(ScalarFunctionNumber,int);
+
+  // Description:
+  // Specify the vector function to extract. If ==(-1), then no vector
+  // function is extracted.
+  void SetVectorFunctionNumber(int num);
+  vtkGetMacro(VectorFunctionNumber,int);
+
+  // Description:
+  // Specify additional functions to read. These are placed into the
+  // point data as data arrays. Later on they can be used by labeling
+  // them as scalars, etc.
+  void AddFunction(int functionNumber);
+  void RemoveFunction(int);
+  void RemoveAllFunctions();
+
+  // Description:
+  // Return 1 if the reader can read the given file name. Only meaningful
+  // for binary files.
+  virtual int CanReadBinaryFile(const char* fname);
+
+  // Description:
+  // Overwritten to make sure that RequestInformation reads the meta-data
+  // again after the reader parameters were changed.
+  virtual void Modified();
+
+//BTX
+  enum
+  {
+    FILE_BIG_ENDIAN=0,
+    FILE_LITTLE_ENDIAN=1
+  };
+//ETX
+
+protected:
+  vtkMultiBlockPLOT3DReader();
+  ~vtkMultiBlockPLOT3DReader();
+
+  vtkDataArray* CreateFloatArray();
+
+  int CheckFile(FILE*& fp, const char* fname);
+  int CheckGeometryFile(FILE*& xyzFp);
+  int CheckSolutionFile(FILE*& qFp);
+  int CheckFunctionFile(FILE*& fFp);
+
+  int SkipByteCount (FILE* fp);
+  int ReadIntBlock  (FILE* fp, int n, int*   block);
+
+  int ReadScalar(FILE* fp, int n, vtkDataArray* scalar);
+  int ReadVector(FILE* fp, int n, int numDims, vtkDataArray* vector);
+
+  int GetNumberOfBlocksInternal(FILE* xyzFp, int allocate);
+
+  int ReadGeometryHeader(FILE* fp);
+  int ReadQHeader(FILE* fp, bool checkGrid, int& nq, int& nqc, int& overflow);
+  int ReadFunctionHeader(FILE* fp, int* nFunctions);
+
+  void CalculateFileSize(FILE* fp);
+  long EstimateSize(int ni, int nj, int nk);
+
+  int AutoDetectionCheck(FILE* fp);
+
+
+  void AssignAttribute(int fNumber, vtkStructuredGrid* output,
+                       int attributeType);
+  void MapFunction(int fNumber, vtkStructuredGrid* output);
+  void ComputeTemperature(vtkStructuredGrid* output);
+  void ComputePressure(vtkStructuredGrid* output);
+  void ComputeEnthalpy(vtkStructuredGrid* output);
+  void ComputeKineticEnergy(vtkStructuredGrid* output);
+  void ComputeVelocityMagnitude(vtkStructuredGrid* output);
+  void ComputeEntropy(vtkStructuredGrid* output);
+  void ComputeSwirl(vtkStructuredGrid* output);
+  void ComputeVelocity(vtkStructuredGrid* output);
+  void ComputeVorticity(vtkStructuredGrid* output);
+  void ComputePressureGradient(vtkStructuredGrid* output);
+  void ComputePressureCoefficient(vtkStructuredGrid* output);
+  void ComputeMachNumber(vtkStructuredGrid* output);
+  void ComputeSoundSpeed(vtkStructuredGrid* output);
+  void ComputeVorticityMagnitude(vtkStructuredGrid* output);
+  void ComputeStrainRate(vtkStructuredGrid* output);
+
+  // Returns a vtkFloatArray or a vtkDoubleArray depending
+  // on DoublePrecision setting
+  vtkDataArray* NewFloatArray();
+
+  // Delete references to any existing vtkPoints and
+  // I-blank arrays. The next Update() will (re)read
+  // the XYZ file.
+  void ClearGeometryCache();
+
+  //plot3d FileNames
+  char *XYZFileName;
+  char *QFileName;
+  char *FunctionFileName;
+
+  int BinaryFile;
+  int HasByteCount;
+  int TwoDimensionalGeometry;
+  int MultiGrid;
+  int ForceRead;
+  int ByteOrder;
+  int IBlanking;
+  int DoublePrecision;
+  int AutoDetectFormat;
+
+  long FileSize;
+
+  //parameters used in computing derived functions
+  double R;
+  double Gamma;
+  double Uvinf;
+  double Vvinf;
+  double Wvinf;
+
+  //functions to read that are not scalars or vectors
+  vtkIntArray *FunctionList;
+
+  int ScalarFunctionNumber;
+  int VectorFunctionNumber;
+
+  virtual int FillOutputPortInformation(int port, vtkInformation* info);
+
+  virtual int RequestData(vtkInformation*,
+                          vtkInformationVector**,
+                          vtkInformationVector*);
+  virtual int RequestInformation(vtkInformation*,
+                                 vtkInformationVector**,
+                                 vtkInformationVector*);
+
+  vtkMultiBlockPLOT3DReaderInternals* Internal;
+
+private:
+  vtkMultiBlockPLOT3DReader(const vtkMultiBlockPLOT3DReader&);  // Not implemented.
+  void operator=(const vtkMultiBlockPLOT3DReader&);  // Not implemented.
+};
+
+#endif
+
+
diff --git a/IO/Geometry/vtkMultiBlockPLOT3DReaderInternals.cxx b/IO/Geometry/vtkMultiBlockPLOT3DReaderInternals.cxx
new file mode 100644
index 0000000..6c6daf9
--- /dev/null
+++ b/IO/Geometry/vtkMultiBlockPLOT3DReaderInternals.cxx
@@ -0,0 +1,395 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+  Module:    vtkMultiBlockPLOT3DReaderInternals.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 "vtkMultiBlockPLOT3DReaderInternals.h"
+
+int vtkMultiBlockPLOT3DReaderInternals::ReadInts(FILE* fp, int n, int* val)
+{
+  int retVal = static_cast<int>(fread(val, sizeof(int), n, fp));
+  if (this->ByteOrder == vtkMultiBlockPLOT3DReader::FILE_LITTLE_ENDIAN)
+    {
+    vtkByteSwap::Swap4LERange(val, n);
+    }
+  else
+    {
+    vtkByteSwap::Swap4BERange(val, n);
+    }
+  return retVal;
+}
+
+void vtkMultiBlockPLOT3DReaderInternals::CheckBinaryFile(FILE *fp)
+{
+  int j, k, l;
+  rewind(fp);
+  // Try fscanf to read 3 integers. If it fails,
+  // must be a binary file.
+  if(0 == fscanf(fp, "%d %d %d\n", &j, &k, &l))
+    {
+    this->BinaryFile = 1;
+    }
+  else
+    {
+    this->BinaryFile = 0;
+    }
+}
+
+int vtkMultiBlockPLOT3DReaderInternals::CheckByteOrder(FILE* fp)
+{
+  rewind(fp);
+  int i;
+  if (fread(&i, sizeof(int), 1, fp) < 1)
+    {
+    return 0;
+    }
+  char* cpy = (char*)&i;
+
+  // If binary, we can assume that the first value is going to be either a
+  // count (Fortran) or a number of block or a dimension. We assume that
+  // this number will be smaller than 2^24. Then we check the first byte.
+  // If it is 0 and the last byte is not 0, it is likely that this is big
+  // endian.
+  if(cpy[0] == 0 && cpy[3] != 0)
+    {
+    this->ByteOrder = vtkMultiBlockPLOT3DReader::FILE_BIG_ENDIAN;
+    }
+  else
+    {
+    this->ByteOrder = vtkMultiBlockPLOT3DReader::FILE_LITTLE_ENDIAN;
+    }
+  return 1;
+}
+
+int vtkMultiBlockPLOT3DReaderInternals::CheckByteCount(FILE* fp)
+{
+  rewind(fp);
+  // Read the first integer, then skip by that many bytes, then
+  // read the value again. If the two match, it is likely that
+  // the file has byte counts.
+  int count;
+  if (!this->ReadInts(fp, 1, &count))
+    {
+    return 0;
+    }
+  if (fseek(fp, count, SEEK_CUR) != 0)
+    {
+    return 0;
+    }
+  int count2;
+  if (!this->ReadInts(fp, 1, &count2))
+    {
+    return 0;
+    }
+  if (count == count2)
+    {
+    this->HasByteCount = 1;
+    }
+  else
+    {
+    this->HasByteCount = 0;
+    }
+  return 1;
+}
+
+int vtkMultiBlockPLOT3DReaderInternals::CheckMultiGrid(FILE* fp)
+{
+  if (this->HasByteCount)
+    {
+    rewind(fp);
+    // We read the byte count, if it is 4 (1 int),
+    // then this is multi-grid because the first
+    // value is the number of grids rather than
+    // an array of 2 or 3 values.
+    int recMarkBeg;
+    if (!this->ReadInts(fp, 1, &recMarkBeg))
+      {
+      return 0;
+      }
+    if(recMarkBeg == sizeof(int))
+      {
+      this->MultiGrid = 1;
+      }
+    else
+      {
+      this->MultiGrid = 0;
+      }
+    return 1;
+    }
+  return 0;
+}
+
+int vtkMultiBlockPLOT3DReaderInternals::Check2DGeom(FILE* fp)
+{
+  if (this->HasByteCount)
+    {
+    rewind(fp);
+    int recMarkBeg, recMarkEnd;
+    int numGrids = 1;
+    if(this->MultiGrid)
+      {
+      if (!this->ReadInts(fp, 1, &recMarkBeg) ||
+          !this->ReadInts(fp, 1, &numGrids) ||
+          !this->ReadInts(fp, 1, &recMarkEnd))
+        {
+        return 0;
+        }
+      }
+    if (!this->ReadInts(fp, 1, &recMarkBeg))
+      {
+      return 0;
+      }
+    int nMax = 3*numGrids;
+    int ndims;
+    if(recMarkBeg == static_cast<int>(nMax*sizeof(int) + 2*sizeof(int)))
+      {
+      ndims = 3;
+      }
+    else
+      {
+      if(recMarkBeg == static_cast<int>(nMax*sizeof(int)))
+        {
+        ndims = 3;
+        }
+      else
+        {
+        ndims = 2;
+        }
+      }
+    this->NumberOfDimensions = ndims;
+    return 1;
+    }
+  return 0;
+}
+
+int vtkMultiBlockPLOT3DReaderInternals::CheckBlankingAndPrecision(FILE* fp)
+{
+  int recMarkBeg, recMarkEnd, numGrids = 1, nMax, totPts;
+  int* jmax;
+
+  rewind(fp);
+  if(this->MultiGrid)
+    {
+    if (!this->ReadInts(fp, 1, &recMarkBeg) ||
+        !this->ReadInts(fp, 1, &numGrids) ||
+        !this->ReadInts(fp, 1, &recMarkEnd))
+      {
+      return 0;
+      }
+    }
+  if (!this->ReadInts(fp, 1, &recMarkBeg))
+    {
+    return 0;
+    }
+  nMax = this->NumberOfDimensions * numGrids;
+  jmax = new int[numGrids*3]; // allocate memory for jmax
+  if (!this->ReadInts(fp, nMax, jmax) ||
+      !this->ReadInts(fp, 1, &recMarkEnd))
+    {
+    delete[] jmax;
+    return 0;
+    }
+  totPts = 1;
+  for (int i=0; i<this->NumberOfDimensions; i++)
+    {
+    totPts *= jmax[i];
+    }
+  this->ReadInts(fp, 1, &recMarkBeg);
+  // single precision, with iblanking
+  if(recMarkBeg == totPts*(this->NumberOfDimensions*4 + 4))
+    {
+    this->Precision = 4;
+    this->IBlanking = 1;
+    delete[] jmax;
+    return 1;
+    }
+  // double precision, with iblanking
+  else if(recMarkBeg == totPts*(this->NumberOfDimensions*8 + 4))
+    {
+    this->Precision = 8;
+    this->IBlanking = 1;
+    delete[] jmax;
+    return 1;
+    }
+  // single precision, no iblanking
+  else if(recMarkBeg == totPts*this->NumberOfDimensions*4)
+    {
+    this->Precision = 4;
+    this->IBlanking = 0;
+    delete[] jmax;
+    return 1;
+    }
+  // double precision, no iblanking
+  else if(recMarkBeg == totPts*this->NumberOfDimensions*8)
+    {
+    this->Precision = 8;
+    this->IBlanking = 0;
+    delete[] jmax;
+    return 1;
+    }
+  return 0;
+}
+
+// Unfortunately, a Plot3D file written in C is trickier
+// to check becaues it has no byte count markers. We need
+// to do a bit more brute force checks based on reading
+// data and estimating file size.
+int vtkMultiBlockPLOT3DReaderInternals::CheckCFile(FILE* fp, long fileSize)
+{
+  int precisions[2] = {4, 8};
+  int blankings[2] = {0, 1};
+  int dimensions[2] = {2, 3};
+
+  rewind(fp);
+  int gridDims[3];
+  if (this->ReadInts(fp, 3, gridDims) != 3)
+    {
+    return 0;
+    }
+
+  // Single grid
+  for (int i=0; i<2; i++)
+    {
+    int precision = precisions[i];
+    for (int j=0; j<2; j++)
+      {
+      int blanking = blankings[j];
+      for (int k=0; k<2; k++)
+        {
+        int dimension = dimensions[k];
+
+        if (fileSize ==
+            this->CalculateFileSize(false,
+                                    precision,
+                                    blanking,
+                                    dimension,
+                                    false, // always
+                                    1,
+                                    gridDims))
+          {
+          this->MultiGrid = 0;
+          this->Precision = precision;
+          this->IBlanking = blanking;
+          this->NumberOfDimensions = dimension;
+          return 1;
+          }
+        }
+      }
+    }
+
+  // Multi grid
+  int nGrids;
+  rewind(fp);
+  if (!this->ReadInts(fp, 1, &nGrids))
+    {
+    return 0;
+    }
+  int* gridDims2 = new int[3*nGrids];
+  if (this->ReadInts(fp, nGrids*3, gridDims2) != nGrids*3)
+    {
+    delete[] gridDims2;
+    return 0;
+    }
+
+  for (int i=0; i<2; i++)
+    {
+    int precision = precisions[i];
+    for (int j=0; j<2; j++)
+      {
+      int blanking = blankings[j];
+      for (int k=0; k<2; k++)
+        {
+        int dimension = dimensions[k];
+
+        if (fileSize ==
+            this->CalculateFileSize(true,
+                                    precision,
+                                    blanking,
+                                    dimension,
+                                    false, // always
+                                    nGrids,
+                                    gridDims2))
+          {
+          this->MultiGrid = 1;
+          this->Precision = precision;
+          this->IBlanking = blanking;
+          this->NumberOfDimensions = dimension;
+          delete[] gridDims2;
+          return 1;
+          }
+        }
+      }
+    }
+  delete[] gridDims2;
+  return 0;
+}
+
+long vtkMultiBlockPLOT3DReaderInternals::CalculateFileSize(int mgrid,
+                                                           int precision, // in bytes
+                                                           int blanking,
+                                                           int ndims,
+                                                           int hasByteCount,
+                                                           int nGrids,
+                                                           int* gridDims)
+{
+  long size = 0; // the header portion, 3 ints
+
+  // N grids
+  if (mgrid)
+    {
+    size += 4; // int for nblocks
+    if (hasByteCount)
+      {
+      size += 2*4; // byte counts for nblocks
+      }
+    }
+  // Header
+  size += nGrids*ndims*4;
+
+  if (hasByteCount)
+    {
+    size += 2*4; // byte counts for grid dims
+    }
+  for (int i=0; i<nGrids; i++)
+    {
+    size += this->CalculateFileSizeForBlock(
+      precision, blanking, ndims, hasByteCount, gridDims + ndims*i);
+    }
+  return size;
+}
+
+long vtkMultiBlockPLOT3DReaderInternals::CalculateFileSizeForBlock(int precision, // in bytes
+                                                                   int blanking,
+                                                                   int ndims,
+                                                                   int hasByteCount,
+                                                                   int* gridDims)
+{
+  long size = 0;
+  // x, y, (z)
+  long npts = 1;
+  for (int i=0; i<ndims; i++)
+    {
+    npts *= gridDims[i];
+    }
+  size += npts*ndims*precision;
+
+  if (blanking)
+    {
+    size += npts*4;
+    }
+
+  if (hasByteCount)
+    {
+    size += 2*4;
+    }
+  return size;
+}
diff --git a/IO/Geometry/vtkMultiBlockPLOT3DReaderInternals.h b/IO/Geometry/vtkMultiBlockPLOT3DReaderInternals.h
new file mode 100644
index 0000000..11bfac6
--- /dev/null
+++ b/IO/Geometry/vtkMultiBlockPLOT3DReaderInternals.h
@@ -0,0 +1,72 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+  Module:    vtkMultiBlockPLOT3DReaderInternals.h
+
+  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.
+
+=========================================================================*/
+#ifndef vtkMultiBlockPLOT3DReaderInternals_h
+#define vtkMultiBlockPLOT3DReaderInternals_h
+
+#include "vtkByteSwap.h"
+#include "vtkMultiBlockPLOT3DReader.h"
+#include "vtkSmartPointer.h"
+#include "vtkStructuredGrid.h"
+
+#include <vector>
+
+struct vtkMultiBlockPLOT3DReaderInternals
+{
+  std::vector<vtkSmartPointer<vtkStructuredGrid> > Blocks;
+  int BinaryFile;
+  int ByteOrder;
+  int HasByteCount;
+  int MultiGrid;
+  int NumberOfDimensions;
+  int Precision; // in bytes
+  int IBlanking;
+
+  bool NeedToCheckXYZFile;
+
+  vtkMultiBlockPLOT3DReaderInternals() :
+    BinaryFile(1),
+    ByteOrder(vtkMultiBlockPLOT3DReader::FILE_BIG_ENDIAN),
+    HasByteCount(1),
+    MultiGrid(0),
+    NumberOfDimensions(3),
+    Precision(4),
+    IBlanking(0),
+    NeedToCheckXYZFile(true)
+    {
+    }
+
+  int ReadInts(FILE* fp, int n, int* val);
+  void CheckBinaryFile(FILE *fp);
+  int CheckByteOrder(FILE* fp);
+  int CheckByteCount(FILE* fp);
+  int CheckMultiGrid(FILE* fp);
+  int Check2DGeom(FILE* fp);
+  int CheckBlankingAndPrecision(FILE* fp);
+  int CheckCFile(FILE* fp, long fileSize);
+  long CalculateFileSize(int mgrid,
+                         int precision, // in bytes
+                         int blanking,
+                         int ndims,
+                         int hasByteCount,
+                         int nGrids,
+                         int* gridDims);
+  long CalculateFileSizeForBlock(int precision, // in bytes
+                                 int blanking,
+                                 int ndims,
+                                 int hasByteCount,
+                                 int* gridDims);
+};
+#endif
+// VTK-HeaderTest-Exclude: vtkMultiBlockPLOT3DReaderInternals.h
diff --git a/IO/Geometry/vtkOBJReader.h b/IO/Geometry/vtkOBJReader.h
index 1ae4af3..4b51bff 100644
--- a/IO/Geometry/vtkOBJReader.h
+++ b/IO/Geometry/vtkOBJReader.h
@@ -23,20 +23,27 @@
 #define vtkOBJReader_h
 
 #include "vtkIOGeometryModule.h" // For export macro
-#include "vtkAbstractPolyDataReader.h"
+#include "vtkPolyDataAlgorithm.h"
 
-class VTKIOGEOMETRY_EXPORT vtkOBJReader : public vtkAbstractPolyDataReader
+class VTKIOGEOMETRY_EXPORT vtkOBJReader : public vtkPolyDataAlgorithm
 {
 public:
   static vtkOBJReader *New();
-  vtkTypeMacro(vtkOBJReader,vtkAbstractPolyDataReader);
+  vtkTypeMacro(vtkOBJReader,vtkPolyDataAlgorithm);
   void PrintSelf(ostream& os, vtkIndent indent);
 
+  // Description:
+  // Specify file name of Wavefront .obj file.
+  vtkSetStringMacro(FileName);
+  vtkGetStringMacro(FileName);
+
 protected:
   vtkOBJReader();
   ~vtkOBJReader();
 
   int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
+
+  char *FileName;
 private:
   vtkOBJReader(const vtkOBJReader&);  // Not implemented.
   void operator=(const vtkOBJReader&);  // Not implemented.
diff --git a/IO/Geometry/vtkOpenFOAMReader.cxx b/IO/Geometry/vtkOpenFOAMReader.cxx
index fec98b5..e601fd3 100644
--- a/IO/Geometry/vtkOpenFOAMReader.cxx
+++ b/IO/Geometry/vtkOpenFOAMReader.cxx
@@ -41,7 +41,7 @@
 #define VTK_FOAMFILE_OUTBUFSIZE (131072)
 #define VTK_FOAMFILE_INCLUDE_STACK_SIZE (10)
 
-#if defined(_MSC_VER)
+#if defined(_MSC_VER) && (_MSC_VER >= 1400)
 #define _CRT_SECURE_NO_WARNINGS 1
 #endif
 
@@ -504,16 +504,9 @@ protected:
       case IDENTIFIER:
         this->String = new vtkStdString(*value.String);
         break;
-      case UNDEFINED:
-      case STRINGLIST:
-      case LABELLIST:
-      case SCALARLIST:
-      case VECTORLIST:
-      case LABELLISTLIST:
-      case ENTRYVALUELIST:
-      case EMPTYLIST:
-      case DICTIONARY:
-      case TOKEN_ERROR:
+        // required to suppress the 'enumeration value not handled' warning by
+        // g++ when compiled with -Wall
+      default:
         break;
       }
   }
@@ -660,15 +653,9 @@ public:
       case IDENTIFIER:
         str << *value.String;
         break;
-      case UNDEFINED:
-      case STRINGLIST:
-      case LABELLIST:
-      case SCALARLIST:
-      case VECTORLIST:
-      case LABELLISTLIST:
-      case ENTRYVALUELIST:
-      case EMPTYLIST:
-      case DICTIONARY:
+        // required to suppress the 'enumeration value not handled' warning by
+        // g++ when compiled with -Wall
+      default:
         break;
       }
     return str;
@@ -1080,7 +1067,7 @@ public:
             isExpanded = true;
             break;
             }
-          VTK_FALLTHROUGH;
+          // fall through
         default:
           wasPathSeparator = (c == '/' || c == '\\');
           expandedPath += c;
@@ -1175,7 +1162,7 @@ public:
           this->PutBack(c);
           return true;
           }
-        VTK_FALLTHROUGH;
+        // fall through
       case '.':
         // scalar token
         if (c == '.' && charI < MAXLEN)
@@ -2146,22 +2133,21 @@ public:
     {
       if (isPositions) // lagrangian/positions (class Cloud)
         {
-        // skip label celli, label facei and scalar stepFraction
-        const size_t sz1 = sizeof(double) * (nComponents + 1) + 2 * sizeof(int);
-
-        // skip label celli
-        const size_t sz2 = sizeof(double) * nComponents + sizeof(int);
-
         // allocate space along with the larger 1.4 format since the
         // size must be determined at compile-time. we allocate on the
         // stack to avoid leak when an exception is thrown.
-        double buffer[sz1/sizeof(double)];
-        const int nBytes = (io.GetIs13Positions() ? sz2 : sz1);
+        unsigned char buffer[sizeof(double) * (nComponents + 1) + 2
+            * sizeof(int)];
+        const int nBytes = (io.GetIs13Positions()
+        // skip label celli
+            ? sizeof(double) * nComponents + sizeof(int)
+            // skip label celli, label facei and scalar stepFraction
+                : sizeof(double) * (nComponents + 1) + 2 * sizeof(int));
         for (int i = 0; i < size; i++)
           {
           io.ReadExpecting('(');
-          io.Read(reinterpret_cast<unsigned char *>(buffer), nBytes);
-          this->Ptr->SetTuple(i, buffer);
+          io.Read(buffer, nBytes);
+          this->Ptr->SetTuple(i, reinterpret_cast<double *>(buffer));
           io.ReadExpecting(')');
           }
         }
@@ -3070,22 +3056,17 @@ vtkFoamEntryValue::vtkFoamEntryValue(
   switch (this->Superclass::Type)
     {
     case VECTORLIST:
-      {
-      vtkFloatArray *fa = vtkFloatArray::SafeDownCast(value.ToVTKObject());
-      if(fa->GetNumberOfComponents() == 6)
         {
-        // create deepcopies for vtkObjects to avoid duplicated mainpulation
-        vtkFloatArray *newfa = vtkFloatArray::New();
-        newfa->DeepCopy(fa);
-        this->Superclass::VtkObjectPtr = newfa;
-        }
-      else
-        {
-        this->Superclass::VtkObjectPtr = value.ToVTKObject();
-        this->Superclass::VtkObjectPtr->Register(0);
+        vtkFloatArray *fa = vtkFloatArray::SafeDownCast(value.ToVTKObject());
+        if(fa->GetNumberOfComponents() == 6)
+          {
+          // create deepcopies for vtkObjects to avoid duplicated mainpulation
+          vtkFloatArray *newfa = vtkFloatArray::New();
+          newfa->DeepCopy(fa);
+          this->Superclass::VtkObjectPtr = newfa;
+          break;
+          }
         }
-      }
-      break;
     case LABELLIST:
     case SCALARLIST:
     case STRINGLIST:
@@ -3120,13 +3101,8 @@ vtkFoamEntryValue::vtkFoamEntryValue(
       break;
     case EMPTYLIST:
       break;
-    case UNDEFINED:
-    case PUNCTUATION:
-    case LABEL:
-    case SCALAR:
-    case STRING:
-    case IDENTIFIER:
-    case TOKEN_ERROR:
+      // required to suppress the 'enumeration value not handled' warning by
+      // g++ when compiled with -Wall
     default:
       break;
     }
@@ -3157,14 +3133,8 @@ void vtkFoamEntryValue::Clear()
       case DICTIONARY:
         delete this->DictPtr;
         break;
-      case UNDEFINED:
-      case PUNCTUATION:
-      case LABEL:
-      case SCALAR:
-      case STRING:
-      case IDENTIFIER:
-      case TOKEN_ERROR:
-      case EMPTYLIST:
+        // required to suppress the 'enumeration value not handled' warning by
+        // g++ when compiled with -Wall
       default:
         break;
       }
diff --git a/IO/Geometry/vtkParticleReader.cxx b/IO/Geometry/vtkParticleReader.cxx
index 97a8686..7187c3b 100644
--- a/IO/Geometry/vtkParticleReader.cxx
+++ b/IO/Geometry/vtkParticleReader.cxx
@@ -185,10 +185,6 @@ int vtkParticleReader::RequestInformation(
     }
 
   this->OpenFile();
-  if (!this->File || this->File->fail())
-    {
-    return 0;
-    }
   int ft = this->FileType;
   if ( ft == FILE_TYPE_IS_UNKNOWN )
     {
diff --git a/IO/Geometry/vtkPlot3DMetaReader.cxx b/IO/Geometry/vtkPlot3DMetaReader.cxx
new file mode 100644
index 0000000..a35afac
--- /dev/null
+++ b/IO/Geometry/vtkPlot3DMetaReader.cxx
@@ -0,0 +1,501 @@
+/*=========================================================================
+
+  Program:   ParaView
+  Module:    $RCSfile: vtkPlot3DMetaReader.cxx,v $
+
+  Copyright (c) Kitware, Inc.
+  All rights reserved.
+  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html 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 "vtkPlot3DMetaReader.h"
+
+#include "vtkStreamingDemandDrivenPipeline.h"
+#include "vtkInformation.h"
+#include "vtkInformationVector.h"
+#include "vtkMath.h"
+#include "vtkMultiBlockDataSet.h"
+#include "vtkObjectFactory.h"
+#include "vtkMultiBlockPLOT3DReader.h"
+
+#include <vtksys/SystemTools.hxx>
+
+#include <map>
+#include <vector>
+#include <string>
+
+#include "vtk_jsoncpp.h"
+
+#define CALL_MEMBER_FN(object,ptrToMember)  ((object).*(ptrToMember))
+
+vtkStandardNewMacro(vtkPlot3DMetaReader);
+
+typedef void (vtkPlot3DMetaReader::*Plot3DFunction)(Json::Value* val);
+
+struct Plot3DTimeStep
+{
+  double Time;
+  std::string XYZFile;
+  std::string QFile;
+  std::string FunctionFile;
+};
+
+struct vtkPlot3DMetaReaderInternals
+{
+  std::map<std::string, Plot3DFunction> FunctionMap;
+  std::vector<Plot3DTimeStep> TimeSteps;
+
+  std::string ResolveFileName(std::string metaFileName,
+                              std::string fileName)
+    {
+      if (vtksys::SystemTools::FileIsFullPath(fileName.c_str()))
+        {
+        return fileName;
+        }
+      else
+        {
+        std::string path = vtksys::SystemTools::GetFilenamePath(metaFileName);
+        std::vector<std::string> components;
+        components.push_back(path + "/");
+        components.push_back(fileName);
+        return vtksys::SystemTools::JoinPath(components);
+        }
+    }
+};
+
+//-----------------------------------------------------------------------------
+vtkPlot3DMetaReader::vtkPlot3DMetaReader()
+{
+  this->SetNumberOfInputPorts(0);
+  this->SetNumberOfOutputPorts(1);
+
+  this->Reader = vtkMultiBlockPLOT3DReader::New();
+  this->Reader->AutoDetectFormatOn();
+
+  this->FileName = 0;
+
+  this->Internal = new vtkPlot3DMetaReaderInternals;
+
+  this->Internal->FunctionMap["auto-detect-format"] =
+    &vtkPlot3DMetaReader::SetAutoDetectFormat;
+  this->Internal->FunctionMap["byte-order"] =
+    &vtkPlot3DMetaReader::SetByteOrder;
+  this->Internal->FunctionMap["precision"] =
+    &vtkPlot3DMetaReader::SetPrecision;
+  this->Internal->FunctionMap["multi-grid"] =
+    &vtkPlot3DMetaReader::SetMultiGrid;
+  this->Internal->FunctionMap["format"] =
+    &vtkPlot3DMetaReader::SetFormat;
+  this->Internal->FunctionMap["blanking"] =
+    &vtkPlot3DMetaReader::SetBlanking;
+  this->Internal->FunctionMap["language"] =
+    &vtkPlot3DMetaReader::SetLanguage;
+  this->Internal->FunctionMap["2D"] =
+    &vtkPlot3DMetaReader::Set2D;
+  this->Internal->FunctionMap["R"] =
+    &vtkPlot3DMetaReader::SetR;
+  this->Internal->FunctionMap["gamma"] =
+    &vtkPlot3DMetaReader::SetGamma;
+  this->Internal->FunctionMap["filenames"] =
+    &vtkPlot3DMetaReader::SetFileNames;
+  this->Internal->FunctionMap["functions"] =
+    &vtkPlot3DMetaReader::AddFunctions;
+}
+
+//-----------------------------------------------------------------------------
+vtkPlot3DMetaReader::~vtkPlot3DMetaReader()
+{
+  this->Reader->Delete();
+
+  delete this->Internal;
+
+  delete[] this->FileName;
+}
+
+//-----------------------------------------------------------------------------
+void vtkPlot3DMetaReader::SetAutoDetectFormat(Json::Value* val)
+{
+  bool value = val->asBool();
+  if (value)
+    {
+    this->Reader->AutoDetectFormatOn();
+    }
+  else
+    {
+    this->Reader->AutoDetectFormatOff();
+    }
+}
+
+//-----------------------------------------------------------------------------
+void vtkPlot3DMetaReader::SetByteOrder(Json::Value* val)
+{
+  std::string value = val->asString();
+  if (value == "little")
+    {
+    this->Reader->SetByteOrderToLittleEndian();
+    }
+  else if (value == "big")
+    {
+    this->Reader->SetByteOrderToBigEndian();
+    }
+  else
+    {
+    vtkErrorMacro("Unrecognized byte order: " <<
+                  value.c_str()<< ". Valid options are \"little\" and \"big\"."
+                  " Setting to little endian");
+    this->Reader->SetByteOrderToLittleEndian();
+    }
+}
+
+//-----------------------------------------------------------------------------
+void vtkPlot3DMetaReader::SetLanguage(Json::Value* val)
+{
+  std::string value = val->asString();
+  if (value == "fortran")
+    {
+    this->Reader->HasByteCountOn();
+    }
+  else if (value == "C")
+    {
+    this->Reader->HasByteCountOff();
+    }
+  else
+    {
+    vtkErrorMacro("Unrecognized language: " <<
+                  value.c_str()<< ". Valid options are \"fortran\" and \"C\"."
+                  " Setting to little fortran");
+    this->Reader->HasByteCountOn();
+    }
+}
+
+//-----------------------------------------------------------------------------
+void vtkPlot3DMetaReader::SetPrecision(Json::Value* val)
+{
+  int value = val->asInt();
+  if (value == 32)
+    {
+    this->Reader->DoublePrecisionOff();
+    }
+  else if (value == 64)
+    {
+    this->Reader->DoublePrecisionOn();
+    }
+  else
+    {
+    vtkErrorMacro("Unrecognized precision: " <<
+                  value << ". Valid options are 32 and 64 (bits)."
+                  " Setting to 32 bits");
+    this->Reader->DoublePrecisionOff();
+    }
+}
+
+//-----------------------------------------------------------------------------
+void vtkPlot3DMetaReader::SetMultiGrid(Json::Value* val)
+{
+  bool value = val->asBool();
+  if (value)
+    {
+    this->Reader->MultiGridOn();
+    }
+  else
+    {
+    this->Reader->MultiGridOff();
+    }
+}
+
+//-----------------------------------------------------------------------------
+void vtkPlot3DMetaReader::SetFormat(Json::Value* val)
+{
+  std::string value = val->asString();
+  if (value == "binary")
+    {
+    this->Reader->BinaryFileOn();
+    }
+  else if (value == "ascii")
+    {
+    this->Reader->BinaryFileOff();
+    }
+  else
+    {
+    vtkErrorMacro("Unrecognized file type: " <<
+                  value.c_str()<< ". Valid options are \"binary\" and \"ascii\"."
+                  " Setting to binary");
+    this->Reader->BinaryFileOn();
+    }
+}
+
+//-----------------------------------------------------------------------------
+void vtkPlot3DMetaReader::SetBlanking(Json::Value* val)
+{
+  bool value = val->asBool();
+  if (value)
+    {
+    this->Reader->IBlankingOn();
+    }
+  else
+    {
+    this->Reader->IBlankingOff();
+    }
+}
+
+//-----------------------------------------------------------------------------
+void vtkPlot3DMetaReader::Set2D(Json::Value* val)
+{
+  bool value = val->asBool();
+  if (value)
+    {
+    this->Reader->TwoDimensionalGeometryOn();
+    }
+  else
+    {
+    this->Reader->TwoDimensionalGeometryOff();
+    }
+}
+
+//-----------------------------------------------------------------------------
+void vtkPlot3DMetaReader::SetR(Json::Value* val)
+{
+  double R = val->asDouble();
+  this->Reader->SetR(R);
+}
+
+//-----------------------------------------------------------------------------
+void vtkPlot3DMetaReader::SetGamma(Json::Value* val)
+{
+  double gamma = val->asDouble();
+  this->Reader->SetGamma(gamma);
+}
+
+//-----------------------------------------------------------------------------
+void vtkPlot3DMetaReader::AddFunctions(Json::Value* val)
+{
+  const Json::Value& functions = *val;
+  for ( size_t index = 0; index < functions.size(); ++index )
+    {
+    this->Reader->AddFunction(functions[(int)index].asInt());
+    }
+}
+
+//-----------------------------------------------------------------------------
+void vtkPlot3DMetaReader::SetFileNames(Json::Value* val)
+{
+  const Json::Value& filenames = *val;
+  for ( size_t index = 0; index < filenames.size(); ++index )
+    {
+    const Json::Value& astep = filenames[(int)index];
+    bool doAdd = true;
+    Plot3DTimeStep aTime;
+    if (!astep.isMember("time"))
+      {
+      vtkErrorMacro("Missing time value in timestep " << index);
+      doAdd = false;
+      }
+    else
+      {
+      aTime.Time = astep["time"].asDouble();
+      }
+
+    if (!astep.isMember("xyz"))
+      {
+      vtkErrorMacro("Missing xyz filename in timestep " << index);
+      doAdd = false;
+      }
+    else
+      {
+      std::string xyzfile = astep["xyz"].asString();
+      aTime.XYZFile = this->Internal->ResolveFileName(this->FileName,
+                                                      xyzfile);
+      }
+
+    if (astep.isMember("q"))
+      {
+      std::string qfile = astep["q"].asString();
+      aTime.QFile = this->Internal->ResolveFileName(this->FileName,
+                                                    qfile);
+      }
+
+    if (astep.isMember("function"))
+      {
+      std::string functionfile = astep["function"].asString();
+      aTime.FunctionFile = this->Internal->ResolveFileName(this->FileName,
+                                                           functionfile);
+      }
+
+    if (doAdd)
+      {
+      this->Internal->TimeSteps.push_back(aTime);
+      }
+    }
+}
+
+//----------------------------------------------------------------------------
+int vtkPlot3DMetaReader::RequestInformation(
+  vtkInformation* vtkNotUsed(request),
+  vtkInformationVector** vtkNotUsed(inputVector),
+  vtkInformationVector* outputVector)
+{
+  vtkInformation* outInfo = outputVector->GetInformationObject(0);
+
+  this->Internal->TimeSteps.clear();
+
+  this->Reader->RemoveAllFunctions();
+
+  if (!this->FileName)
+    {
+    vtkErrorMacro("No file name was specified. Cannot execute.");
+    return 0;
+    }
+
+  ifstream file(this->FileName);
+
+  Json::Value root;
+  Json::Reader reader;
+  bool parsingSuccessful = reader.parse(file, root);
+  if (!parsingSuccessful)
+    {
+    // report to the user the failure and their locations in the document.
+    vtkErrorMacro("Failed to parse configuration\n"
+                  << reader.getFormattedErrorMessages().c_str());
+    return 0;
+    }
+
+  Json::Value::Members members = root.getMemberNames();
+  Json::Value::Members::iterator memberIterator;
+  for (memberIterator = members.begin();
+       memberIterator != members.end();
+       memberIterator++)
+    {
+    std::map<std::string, Plot3DFunction>::iterator iter =
+      this->Internal->FunctionMap.find(*memberIterator);
+    if (iter != this->Internal->FunctionMap.end())
+      {
+      Json::Value val = root[*memberIterator];
+      Plot3DFunction func = iter->second;
+      CALL_MEMBER_FN(*this, func)(&val);
+      }
+    else
+      {
+      vtkErrorMacro("Syntax error in file. Option \""
+                    << memberIterator->c_str()
+                    << "\" is not valid.");
+      }
+    }
+
+  std::vector<Plot3DTimeStep>::iterator iter;
+  std::vector<double> timeValues;
+  for (iter  = this->Internal->TimeSteps.begin();
+       iter != this->Internal->TimeSteps.end();
+       iter++)
+    {
+    timeValues.push_back(iter->Time);
+    }
+
+  size_t numSteps = timeValues.size();
+  if (numSteps > 0)
+    {
+    outInfo->Set(vtkStreamingDemandDrivenPipeline::TIME_STEPS(),
+                 &timeValues[0],
+                 (int)numSteps);
+
+    double timeRange[2];
+    timeRange[0] = timeValues[0];
+    timeRange[1] = timeValues[numSteps - 1];
+    outInfo->Set(vtkStreamingDemandDrivenPipeline::TIME_RANGE(),
+                 timeRange,
+                 2);
+    }
+
+  return 1;
+}
+
+//----------------------------------------------------------------------------
+int vtkPlot3DMetaReader::RequestData(
+  vtkInformation*,
+  vtkInformationVector**,
+  vtkInformationVector* outputVector)
+{
+  vtkInformation* outInfo = outputVector->GetInformationObject(0);
+  vtkMultiBlockDataSet* output = vtkMultiBlockDataSet::GetData(
+    outputVector->GetInformationObject(0));
+
+  double timeValue = 0;
+  if (outInfo->Has(vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEP()))
+    {
+    // Get the requested time step. We only supprt requests of a single time
+    // step in this reader right now
+    timeValue =
+      outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEP());
+    }
+
+  int tsLength =
+    outInfo->Length(vtkStreamingDemandDrivenPipeline::TIME_STEPS());
+  double *steps =
+    outInfo->Get(vtkStreamingDemandDrivenPipeline::TIME_STEPS());
+
+  if (tsLength < 1)
+    {
+    vtkErrorMacro("No timesteps were found. Please specify at least one "
+                  "filenames entry in the input file.");
+    return 0;
+    }
+
+
+  // find the first time value larger than requested time value
+  // this logic could be improved
+  int cnt = 0;
+  while (cnt < tsLength-1 && steps[cnt] < timeValue)
+    {
+    cnt++;
+    }
+
+  int updateTime = cnt;
+
+  if (updateTime >= tsLength)
+    {
+    updateTime = tsLength - 1;
+    }
+
+  if (tsLength > updateTime)
+    {
+    this->Reader->SetXYZFileName(
+      this->Internal->TimeSteps[updateTime].XYZFile.c_str());
+    const char* qname = this->Internal->TimeSteps[updateTime].QFile.c_str();
+    if (strlen(qname) > 0)
+      {
+      this->Reader->SetQFileName(qname);
+      }
+    else
+      {
+      this->Reader->SetQFileName(0);
+      }
+    const char* fname =
+      this->Internal->TimeSteps[updateTime].FunctionFile.c_str();
+    if (strlen(fname) > 0)
+      {
+      this->Reader->SetFunctionFileName(fname);
+      }
+    else
+      {
+      this->Reader->SetFunctionFileName(0);
+      }
+    this->Reader->Update();
+    output->ShallowCopy(this->Reader->GetOutput());
+    }
+  else
+    {
+    vtkErrorMacro("Time step " << updateTime << " was not found.");
+    return 0;
+    }
+
+  return 1;
+}
+
+//-----------------------------------------------------------------------------
+void vtkPlot3DMetaReader::PrintSelf(ostream& os, vtkIndent indent)
+{
+  this->Superclass::PrintSelf(os, indent);
+}
diff --git a/IO/Geometry/vtkPlot3DMetaReader.h b/IO/Geometry/vtkPlot3DMetaReader.h
new file mode 100644
index 0000000..08a578e
--- /dev/null
+++ b/IO/Geometry/vtkPlot3DMetaReader.h
@@ -0,0 +1,138 @@
+/*=========================================================================
+
+  Program:   ParaView
+  Module:    $RCSfile: vtkPlot3DMetaReader.h,v $
+
+  Copyright (c) Kitware, Inc.
+  All rights reserved.
+  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html 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.
+
+=========================================================================*/
+// .NAME vtkPlot3DMetaReader - reads meta-files points to PLOT3D files
+// .SECTION Description:
+// The main goal of this reader is to make it easy to read PLOT3D files,
+// specifically time series of PLOT3D files. PLOT3D files can take many
+// different forms based on their content. Unfortunately, it is not a
+// self-describing format therefore the user needs to pass information
+// about the contents of the file to the reader. Normally, this is done
+// by setting a number of member variables. The goal of this reader is
+// to provide a simple format that enable the writer of the PLOT3D file
+// to describe its settings as well as group a number of files as a time
+// series. Note that for binary files, the auto-detect-format option,
+// which is on by default negates the need to specify most other option.
+// However, this reader is still very useful when trying to read file
+// series even for binary files. The format for this meta-file is very simple
+// and is based on JSON (there is no need to know anything about JSON to
+// understand this format). Below is an example with comments (followed by //)
+// that describe the format. Note that the PLOT3D file names are relative
+// to the location of the meta-file unless they start with a leading /.
+//
+// \verbatim
+// {
+// "auto-detect-format" : true // Tells the reader to try to figure out the format automatically. Only works
+//                             // with binary file. This is on by default, negating the need for most other
+//                             // options for binary files (format, byte-order, precision, multi-grid,
+//                             // blanking, 2D).
+// "format" : "binary",  // Is this a binary or ascii file, values : binary, ascii
+// "byte-order" : "big", // Byte order for binary files, values : little, big (denoting little or big endian)
+// "precision" : 32,     // Precision of floating point values, can be 32 or 64 (bits)
+// "multi-grid" : false, // Is this a multi-grid file, values: true, false
+// "language" : "C",     // Which language was this file written in, values : C, fortran. This is
+//                       // used to determine if an binary PLOT3D file contains byte counts, used by
+//                       // Fortran IO routines.
+// "blanking" : false,   // Does this file have blanking information (iblanks), values : true, false
+// "2D" : false,         // Is this a 2D dataset, values : true, false
+// "R" : 8.314,          // The value of the gas constant, default is 1.0. Set this according to the dimensions you use
+// "gamma" : 1.4,        // Ratio of specific heats. Default is 1.4.
+// "functions": [ 110, 200, 201 ],  // Additional derived values to calculate. This is an array of integers formatted
+//                                  // as [ value, value, value, ...]
+// "filenames" : [     // List of xyz (geometry) and q (value) file names along with the time values.
+//                     // This is an array which contains items in the format:
+//                     // {"time" : values, "xyz" : "xyz file name", "q" : "q file name", "function" : "function file name"}
+//                     // Note that q and function are optional. Also, you can repeat the same file name for xyz or q
+//                     // if they don't change over time. The reader will not read files unnecessarily.
+//  { "time" : 3.5, "xyz" : "combxyz.bin", "q" : "combq.1.bin", "function" : "combf.1.bin" },
+//  { "time" : 4.5, "xyz" : "combxyz.bin", "q" : "combq.2.bin", "function" : "combf.2.bin" }
+// ]
+// }
+// \endverbatim
+//
+// This reader leverages vtkMultiBlockPLOT3DReader to do the actual
+// reading so you may want to refer to the documenation of
+// vtkMultiBlockPLOT3DReader about the details of some of these
+// parameters including the function numbers for derived value
+// calculation.
+//
+// .SECTION See Also
+// vtkMultiBlockPLOT3DReader
+
+#ifndef vtkPlot3DMetaReader_h
+#define vtkPlot3DMetaReader_h
+
+#include "vtkIOGeometryModule.h" // For export macro
+#include "vtkMultiBlockDataSetAlgorithm.h"
+
+//BTX
+struct vtkPlot3DMetaReaderInternals;
+//ETX
+
+class vtkMultiBlockPLOT3DReader;
+
+namespace Json
+{
+  class Value;
+}
+
+class VTKIOGEOMETRY_EXPORT vtkPlot3DMetaReader : public vtkMultiBlockDataSetAlgorithm
+{
+public:
+  static vtkPlot3DMetaReader* New();
+  vtkTypeMacro(vtkPlot3DMetaReader, vtkMultiBlockDataSetAlgorithm);
+  void PrintSelf(ostream& os, vtkIndent indent);
+
+  // Description:
+  // Set/Get the meta PLOT3D filename. See the class documentation for
+  // format details.
+  vtkSetStringMacro(FileName);
+  vtkGetStringMacro(FileName);
+
+protected:
+  vtkPlot3DMetaReader();
+  ~vtkPlot3DMetaReader();
+
+  virtual int RequestInformation(vtkInformation* request,
+                                 vtkInformationVector** inputVector,
+                                 vtkInformationVector* outputVector);
+  virtual int RequestData(vtkInformation*,
+                          vtkInformationVector**,
+                          vtkInformationVector*);
+
+
+  char* FileName;
+
+  void SetAutoDetectFormat(Json::Value* value);
+  void SetByteOrder(Json::Value* value);
+  void SetPrecision(Json::Value* val);
+  void SetMultiGrid(Json::Value* val);
+  void SetFormat(Json::Value* val);
+  void SetBlanking(Json::Value* val);
+  void Set2D(Json::Value* val);
+  void SetR(Json::Value* val);
+  void SetGamma(Json::Value* val);
+  void SetFileNames(Json::Value* val);
+  void SetLanguage(Json::Value* val);
+  void AddFunctions(Json::Value* val);
+
+private:
+  vtkPlot3DMetaReader(const vtkPlot3DMetaReader&); // Not implemented.
+  void operator=(const vtkPlot3DMetaReader&); // Not implemented.
+
+  vtkMultiBlockPLOT3DReader* Reader;
+  vtkPlot3DMetaReaderInternals* Internal;
+};
+
+#endif
diff --git a/IO/Geometry/vtkSTLReader.cxx b/IO/Geometry/vtkSTLReader.cxx
index e6b0f18..f708b4a 100644
--- a/IO/Geometry/vtkSTLReader.cxx
+++ b/IO/Geometry/vtkSTLReader.cxx
@@ -361,7 +361,7 @@ bool vtkSTLReader::ReadASCIISTL(FILE *fp, vtkPoints *newPts,
   try
     {
     int currentSolid = 0;
-    // Go into loop, reading facet normal and vertices
+    // Go into loop, reading  facet normal and vertices
     while (!done)
       {
       if (!fgets(line, 255, fp))
@@ -418,7 +418,7 @@ bool vtkSTLReader::ReadASCIISTL(FILE *fp, vtkPoints *newPts,
       if (!strcmp(line, "ENDSOLID") || !strcmp(line, "endsolid"))
         {
         currentSolid++;
-        if (!fgets(line, 255, fp) && !feof(fp))
+        if (!fgets(line, 255, fp))
           {
           throw std::runtime_error("unable to read end solid.");
           }
@@ -477,7 +477,7 @@ int vtkSTLReader::GetSTLFileType(const char *filename)
   case vtksys::SystemTools::FileTypeText:
     return VTK_ASCII;
   case vtksys::SystemTools::FileTypeUnknown:
-    vtkWarningMacro("File type not recognized; attempting binary");
+    vtkWarningMacro("File type not recognized attempting binary");
     return VTK_BINARY;
   default:
     vtkErrorMacro("Case not handled, file type is " << static_cast<int>(ft));
diff --git a/IO/Geometry/vtkSTLReader.h b/IO/Geometry/vtkSTLReader.h
index fcc2f8d..64f4397 100644
--- a/IO/Geometry/vtkSTLReader.h
+++ b/IO/Geometry/vtkSTLReader.h
@@ -33,17 +33,17 @@
 #define vtkSTLReader_h
 
 #include "vtkIOGeometryModule.h" // For export macro
-#include "vtkAbstractPolyDataReader.h"
+#include "vtkPolyDataAlgorithm.h"
 
 class vtkCellArray;
 class vtkFloatArray;
 class vtkIncrementalPointLocator;
 class vtkPoints;
 
-class VTKIOGEOMETRY_EXPORT vtkSTLReader : public vtkAbstractPolyDataReader
+class VTKIOGEOMETRY_EXPORT vtkSTLReader : public vtkPolyDataAlgorithm
 {
 public:
-  vtkTypeMacro(vtkSTLReader,vtkAbstractPolyDataReader);
+  vtkTypeMacro(vtkSTLReader,vtkPolyDataAlgorithm);
   void PrintSelf(ostream& os, vtkIndent indent);
 
   // Description:
@@ -56,6 +56,11 @@ public:
   unsigned long GetMTime();
 
   // Description:
+  // Specify file name of stereo lithography file.
+  vtkSetStringMacro(FileName);
+  vtkGetStringMacro(FileName);
+
+  // Description:
   // Turn on/off merging of points/triangles.
   vtkSetMacro(Merging,int);
   vtkGetMacro(Merging,int);
@@ -81,6 +86,7 @@ protected:
   // Create default locator. Used to create one when none is specified.
   vtkIncrementalPointLocator* NewDefaultLocator();
 
+  char *FileName;
   int Merging;
   int ScalarTags;
   vtkIncrementalPointLocator *Locator;
diff --git a/IO/Geometry/vtkSTLWriter.cxx b/IO/Geometry/vtkSTLWriter.cxx
index 4731ce3..465c433 100644
--- a/IO/Geometry/vtkSTLWriter.cxx
+++ b/IO/Geometry/vtkSTLWriter.cxx
@@ -52,7 +52,6 @@ void vtkSTLWriter::WriteData()
   if (pts == NULL || polys == NULL )
     {
     vtkErrorMacro(<<"No data to write!");
-    this->SetErrorCode(vtkErrorCode::UnknownError);
     return;
     }
 
diff --git a/IO/Geometry/vtkWindBladeReader.cxx b/IO/Geometry/vtkWindBladeReader.cxx
index de94345..90ca303 100644
--- a/IO/Geometry/vtkWindBladeReader.cxx
+++ b/IO/Geometry/vtkWindBladeReader.cxx
@@ -179,12 +179,32 @@ vtkWindBladeReader::~vtkWindBladeReader()
   delete this->Internal;
 
   delete [] this->TimeSteps;
-  delete[] this->VariableName;
-  delete[] this->VariableStruct;
-  delete[] this->VariableCompSize;
-  delete[] this->VariableBasicType;
-  delete[] this->VariableByteCount;
-  delete[] this->VariableOffset;
+  this->TimeSteps = NULL;
+
+  if (this->VariableName)
+    {
+    delete[] this->VariableName;
+    }
+  if (this->VariableStruct)
+    {
+    delete[] this->VariableStruct;
+    }
+  if (this->VariableCompSize)
+    {
+    delete[] this->VariableCompSize;
+    }
+  if (this->VariableBasicType)
+    {
+    delete[] this->VariableBasicType;
+    }
+  if (this->VariableByteCount)
+    {
+    delete[] this->VariableByteCount;
+    }
+  if (this->VariableOffset)
+    {
+    delete[] this->VariableOffset;
+    }
 }
 
 //----------------------------------------------------------------------------
diff --git a/IO/Image/Testing/Cxx/CMakeLists.txt b/IO/Image/Testing/Cxx/CMakeLists.txt
index db8647e..50cc83f 100644
--- a/IO/Image/Testing/Cxx/CMakeLists.txt
+++ b/IO/Image/Testing/Cxx/CMakeLists.txt
@@ -38,10 +38,6 @@ vtk_add_test_cxx(${vtk-module}CxxTests tests
   TestTIFFReaderTiledRGB,TestTIFFReader.cxx,NO_OUTPUT
     "DATA{${VTK_TEST_INPUT_DIR}/libtiff/gourds_tiled_200x300.tif}")
 
-vtk_add_test_cxx(${vtk-module}CxxTests tests
-  TestCompressedTIFFReader,TestCompressedTIFFReader.cxx,NO_OUTPUT
-    "DATA{${VTK_TEST_INPUT_DIR}/al_foam_smallest.0.tif}")
-
 set(all_tests
   ${data_tests}
   ${tests}
diff --git a/IO/Image/Testing/Cxx/TestCompressedTIFFReader.cxx b/IO/Image/Testing/Cxx/TestCompressedTIFFReader.cxx
deleted file mode 100644
index 2e0082f..0000000
--- a/IO/Image/Testing/Cxx/TestCompressedTIFFReader.cxx
+++ /dev/null
@@ -1,66 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    TestCompressedTIFFReader.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 <vtkSmartPointer.h>
-
-#include <vtkTIFFReader.h>
-#include <vtkImageViewer2.h>
-#include <vtkRenderWindow.h>
-#include <vtkRenderWindowInteractor.h>
-#include <vtkRenderer.h>
-#include <vtkImageData.h>
-
-int TestCompressedTIFFReader(int argc, char* argv[])
-{
-  //Verify input arguments
-  if ( argc < 3 )
-    {
-    std::cout << "Usage: " << argv[0]
-              << " Filename(.tif)" << std::endl;
-    return EXIT_FAILURE;
-    }
-
-  //Read the image
-  vtkSmartPointer<vtkTIFFReader> reader =
-    vtkSmartPointer<vtkTIFFReader>::New();
-  reader->SetFileName(argv[1]);
-  reader->UpdateInformation();
-
-  // Read the image in 4 chunks. This exercises the logic to read random scan
-  // lines from files that do not support it.
-  const int maxNumPieces = 4;
-  for (int cc=0; cc < maxNumPieces; cc++)
-    {
-    reader->SetUpdateExtent(cc, maxNumPieces, 0);
-    reader->Update();
-    }
-  reader->SetUpdateExtentToWholeExtent();
-
-  // Visualize
-  vtkSmartPointer<vtkImageViewer2> imageViewer =
-    vtkSmartPointer<vtkImageViewer2>::New();
-  imageViewer->SetInputConnection(reader->GetOutputPort());
-  vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor =
-    vtkSmartPointer<vtkRenderWindowInteractor>::New();
-  imageViewer->SetupInteractor(renderWindowInteractor);
-  imageViewer->Render();
-  imageViewer->GetRenderer()->ResetCamera();
-  renderWindowInteractor->Initialize();
-  imageViewer->Render();
-
-  renderWindowInteractor->Start();
-
-  return EXIT_SUCCESS;
-}
diff --git a/IO/Image/Testing/Cxx/TestNIFTIReaderWriter.cxx b/IO/Image/Testing/Cxx/TestNIFTIReaderWriter.cxx
index ffb8789..2184e6a 100644
--- a/IO/Image/Testing/Cxx/TestNIFTIReaderWriter.cxx
+++ b/IO/Image/Testing/Cxx/TestNIFTIReaderWriter.cxx
@@ -39,10 +39,9 @@ then re-reading it to ensure that the contents are identical.
 
 #include <string>
 
-static const char *testfiles[7][2] = {
+static const char *testfiles[6][2] = {
     { "Data/minimal.nii.gz", "out_minimal.nii.gz" },
     { "Data/minimal.img.gz", "out_minimal.hdr" },
-    { "Data/planar_rgb.nii.gz", "out_planar_rgb.nii" },
     { "Data/nifti_rgb.nii.gz", "out_nifti_rgb.nii" },
     { "Data/filtered_func_data.nii.gz", "out_filtered_func_data.nii.gz" },
     { "Data/minimal.hdr.gz", "out_minimal_2.nii" },
@@ -124,8 +123,7 @@ static void TestDisplay(vtkRenderWindow *renwin, const char *infile)
 };
 
 static double TestReadWriteRead(
-  const char *infile, const char *infile2, const char *outfile,
-  bool planarRGB)
+  const char *infile, const char *infile2, const char *outfile)
 {
   // read a NIFTI file
   vtkNew<vtkNIFTIImageReader> reader;
@@ -141,10 +139,6 @@ static double TestReadWriteRead(
     reader->SetFileNames(filenames.GetPointer());
     }
   reader->TimeAsVectorOn();
-  if (planarRGB)
-    {
-    reader->PlanarRGBOn();
-    }
   reader->Update();
 
   vtkNew<vtkNIFTIImageWriter> writer;
@@ -169,10 +163,6 @@ static double TestReadWriteRead(
     {
     writer->SetSFormMatrix(reader->GetQFormMatrix());
     }
-  if (planarRGB)
-    {
-    writer->PlanarRGBOn();
-    }
   writer->Write();
 
   // to exercise PrintSelf
@@ -184,13 +174,8 @@ static double TestReadWriteRead(
   vtkNew<vtkNIFTIImageReader> reader2;
   reader2->SetFileName(outfile);
   reader2->TimeAsVectorOn();
-  if (planarRGB)
-    {
-    reader2->PlanarRGBOn();
-    }
   reader2->Update();
 
-  // the images should be identical
   vtkNew<vtkImageMathematics> diff;
   diff->SetOperationToSubtract();
   diff->SetInputConnection(0,reader->GetOutputPort());
@@ -200,55 +185,6 @@ static double TestReadWriteRead(
   diff->GetOutput()->GetScalarRange(diffrange);
   double differr = diffrange[0]*diffrange[0] + diffrange[1]*diffrange[1];
 
-  // the matrices should be within tolerance
-  if (writer->GetQFormMatrix())
-    {
-    vtkNew<vtkMatrix4x4> m;
-    m->DeepCopy(writer->GetQFormMatrix());
-    m->Invert();
-    vtkMatrix4x4::Multiply4x4(m.GetPointer(), reader2->GetQFormMatrix(),
-                              m.GetPointer());
-    double sqdiff = 0.0;
-    for (int i = 0; i < 4; i++)
-      {
-      for (int j = 0; j < 4; j++)
-        {
-        double d = (m->GetElement(i, j) - (i == j));
-        sqdiff += d*d;
-        }
-      }
-    if (sqdiff > 1e-10)
-      {
-      cerr << "Mismatched read/write QFormMatrix:\n";
-      m->Print(cerr);
-      differr = 1.0;
-      }
-    }
-
-  if (writer->GetSFormMatrix())
-    {
-    vtkNew<vtkMatrix4x4> m;
-    m->DeepCopy(writer->GetSFormMatrix());
-    m->Invert();
-    vtkMatrix4x4::Multiply4x4(m.GetPointer(), reader2->GetSFormMatrix(),
-                              m.GetPointer());
-    double sqdiff = 0.0;
-    for (int i = 0; i < 4; i++)
-      {
-      for (int j = 0; j < 4; j++)
-        {
-        double d = (m->GetElement(i, j) - (i == j));
-        sqdiff += d*d;
-        }
-      }
-    if (sqdiff > 1e-10)
-      {
-      cerr << "Mismatched read/write SFormMatrix:\n";
-      m->Print(cerr);
-      differr = 1.0;
-      }
-    }
-
   return differr;
 }
 
@@ -337,11 +273,10 @@ int TestNIFTIReaderWriter(int argc, char *argv[])
     char *infile2 = 0;
     char *infile =
       vtkTestUtilities::ExpandDataFileName(argc, argv, testfiles[i][0]);
-    bool planarRGB = (i == 2);
-    if (i == 5)
+    if (i == 4)
       {
       infile2 =
-        vtkTestUtilities::ExpandDataFileName(argc, argv, testfiles[6][0]);
+        vtkTestUtilities::ExpandDataFileName(argc, argv, testfiles[5][0]);
       }
     if (!infile)
       {
@@ -371,8 +306,7 @@ int TestNIFTIReaderWriter(int argc, char *argv[])
       return 1;
       }
 
-    double err = TestReadWriteRead(infile, infile2, outpath.c_str(),
-                                   planarRGB);
+    double err = TestReadWriteRead(infile, infile2, outpath.c_str());
     if (err != 0.0)
       {
       cerr << "Input " << infile << " differs from output " << outpath.c_str()
diff --git a/IO/Image/Testing/Data/Baseline/TestCompressedTIFFReader.png.md5 b/IO/Image/Testing/Data/Baseline/TestCompressedTIFFReader.png.md5
deleted file mode 100644
index 41e3c47..0000000
--- a/IO/Image/Testing/Data/Baseline/TestCompressedTIFFReader.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-54dcf8b7c3f759d9c22095c5a568741e
diff --git a/IO/Image/vtkDICOMImageReader.cxx b/IO/Image/vtkDICOMImageReader.cxx
index 9465b21..b05414f 100644
--- a/IO/Image/vtkDICOMImageReader.cxx
+++ b/IO/Image/vtkDICOMImageReader.cxx
@@ -144,14 +144,14 @@ void vtkDICOMImageReader::ExecuteInformation()
       dir->Delete();
       return;
       }
-    vtkIdType numFiles = dir->GetNumberOfFiles();
+    int numFiles = dir->GetNumberOfFiles();
 
     vtkDebugMacro( << "There are " << numFiles << " files in the directory.");
 
     this->DICOMFileNames->clear();
     this->AppHelper->Clear();
 
-    for (vtkIdType i = 0; i < numFiles; i++)
+    for (int i = 0; i < numFiles; i++)
       {
       if (strcmp(dir->GetFile(i), ".") == 0 ||
           strcmp(dir->GetFile(i), "..") == 0)
@@ -197,7 +197,6 @@ void vtkDICOMImageReader::ExecuteInformation()
       this->AppHelper->RegisterCallbacks(this->Parser);
 
       this->Parser->ReadHeader();
-      this->Parser->CloseFile();
 
       vtkDebugMacro( << "File name : " << fn );
       vtkDebugMacro( << "Slice number : " << this->AppHelper->GetSliceNumber());
@@ -311,7 +310,7 @@ void vtkDICOMImageReader::ExecuteDataWithInformation(vtkDataObject *output,
     std::vector<std::string>::iterator fiter;
 
     int count = 0;
-    vtkIdType numFiles = static_cast<int>(this->DICOMFileNames->size());
+    int numFiles = static_cast<int>(this->DICOMFileNames->size());
 
     for (fiter = this->DICOMFileNames->begin();
          fiter != this->DICOMFileNames->end();
@@ -506,7 +505,10 @@ const char* vtkDICOMImageReader::GetTransferSyntaxUID()
 {
   std::string tmp = this->AppHelper->GetTransferSyntaxUID();
 
-  delete [] this->TransferSyntaxUID;
+  if (this->TransferSyntaxUID)
+    {
+    delete [] this->TransferSyntaxUID;
+    }
   this->TransferSyntaxUID = new char[tmp.length()+1];
   strcpy(this->TransferSyntaxUID, tmp.c_str());
   this->TransferSyntaxUID[tmp.length()] = '\0';
@@ -531,7 +533,10 @@ const char* vtkDICOMImageReader::GetPatientName()
 {
   std::string tmp = this->AppHelper->GetPatientName();
 
-  delete [] this->PatientName;
+  if (this->PatientName)
+    {
+    delete [] this->PatientName;
+    }
   this->PatientName = new char[tmp.length()+1];
   strcpy(this->PatientName, tmp.c_str());
   this->PatientName[tmp.length()] = '\0';
@@ -544,7 +549,10 @@ const char* vtkDICOMImageReader::GetStudyUID()
 {
   std::string tmp = this->AppHelper->GetStudyUID();
 
-  delete [] this->StudyUID;
+  if (this->StudyUID)
+    {
+    delete [] this->StudyUID;
+    }
   this->StudyUID = new char[tmp.length()+1];
   strcpy(this->StudyUID, tmp.c_str());
   this->StudyUID[tmp.length()] = '\0';
@@ -557,7 +565,10 @@ const char* vtkDICOMImageReader::GetStudyID()
 {
   std::string tmp = this->AppHelper->GetStudyID();
 
-  delete [] this->StudyID;
+  if (this->StudyID)
+    {
+    delete [] this->StudyID;
+    }
   this->StudyID = new char[tmp.length()+1];
   strcpy(this->StudyID, tmp.c_str());
   this->StudyID[tmp.length()] = '\0';
diff --git a/IO/Image/vtkImageImport.cxx b/IO/Image/vtkImageImport.cxx
index c4b4834..b282089 100644
--- a/IO/Image/vtkImageImport.cxx
+++ b/IO/Image/vtkImageImport.cxx
@@ -91,7 +91,7 @@ vtkImageImport::vtkImageImport()
 //----------------------------------------------------------------------------
 vtkImageImport::~vtkImageImport()
 {
-  if (!this->SaveUserArray)
+  if ((this->ImportVoidPointer) && (!this->SaveUserArray))
     {
     delete [] static_cast<char *>(this->ImportVoidPointer);
     }
diff --git a/IO/Image/vtkImageReader2.cxx b/IO/Image/vtkImageReader2.cxx
index ee703f5..bbe8cfa 100644
--- a/IO/Image/vtkImageReader2.cxx
+++ b/IO/Image/vtkImageReader2.cxx
@@ -283,15 +283,21 @@ void vtkImageReader2::SetFilePattern(const char *pattern)
     {
     return;
     }
-  delete [] this->FilePattern;
-  this->FilePattern = NULL;
+  if (this->FilePattern)
+    {
+    delete [] this->FilePattern;
+    this->FilePattern = NULL;
+    }
   if (pattern)
     {
     this->FilePattern = new char[strlen(pattern) + 1];
     strcpy(this->FilePattern, pattern);
 
-    delete [] this->FileName;
-    this->FileName = NULL;
+    if (this->FileName)
+      {
+      delete [] this->FileName;
+      this->FileName = NULL;
+      }
     if (this->FileNames)
       {
       this->FileNames->Delete();
diff --git a/IO/Image/vtkMetaImageReader.cxx b/IO/Image/vtkMetaImageReader.cxx
index c513e1d..1cb3f42 100644
--- a/IO/Image/vtkMetaImageReader.cxx
+++ b/IO/Image/vtkMetaImageReader.cxx
@@ -99,17 +99,6 @@ void vtkMetaImageReader::ExecuteInformation()
 
   switch(this->MetaImagePtr->ElementType())
     {
-    case vtkmetaio::MET_NONE:
-    case vtkmetaio::MET_ASCII_CHAR:
-    case vtkmetaio::MET_LONG_LONG:
-    case vtkmetaio::MET_ULONG_LONG:
-    case vtkmetaio::MET_STRING:
-    case vtkmetaio::MET_LONG_LONG_ARRAY:
-    case vtkmetaio::MET_ULONG_LONG_ARRAY:
-    case vtkmetaio::MET_FLOAT_ARRAY:
-    case vtkmetaio::MET_DOUBLE_ARRAY:
-    case vtkmetaio::MET_FLOAT_MATRIX:
-    case vtkmetaio::MET_OTHER:
     default:
       vtkErrorMacro(<< "Unknown data type: "
                     << this->MetaImagePtr->ElementType());
@@ -175,7 +164,6 @@ void vtkMetaImageReader::ExecuteInformation()
   switch(this->MetaImagePtr->DistanceUnits())
     {
     default:
-    case vtkmetaio::MET_DISTANCE_UNITS_UNKNOWN:
     case vtkmetaio::MET_DISTANCE_UNITS_UM:
       {
       strcpy(DistanceUnits, "um");
diff --git a/IO/Image/vtkNIFTIImageReader.cxx b/IO/Image/vtkNIFTIImageReader.cxx
index f472693..902847d 100644
--- a/IO/Image/vtkNIFTIImageReader.cxx
+++ b/IO/Image/vtkNIFTIImageReader.cxx
@@ -63,7 +63,6 @@ vtkNIFTIImageReader::vtkNIFTIImageReader()
   this->QFormMatrix = 0;
   this->SFormMatrix = 0;
   this->NIFTIHeader = 0;
-  this->PlanarRGB = false;
 }
 
 //----------------------------------------------------------------------------
@@ -223,7 +222,6 @@ void vtkNIFTIImageReader::PrintSelf(ostream& os, vtkIndent indent)
     }
 
   os << indent << "NIFTIHeader:" << (this->NIFTIHeader ? "\n" : " (none)\n");
-  os << indent << "PlanarRGB: " << (this->PlanarRGB ? "On\n" : "Off\n");
 }
 
 //----------------------------------------------------------------------------
@@ -878,9 +876,9 @@ int vtkNIFTIImageReader::RequestInformation(
   //    c) reorder the slices, multiply the 3rd column by -1, and adjust
   //       the 4th column of the matrix:
   //
-  //         M14 = S14 + (number_of_slices - 1)*S13
-  //         M24 = S24 + (number_of_slices - 1)*S23
-  //         M34 = S34 + (number_of_slices - 1)*S33
+  //         M14 = S14 - (number_of_slices - 1)*S13
+  //         M24 = S24 - (number_of_slices - 1)*S23
+  //         M34 = S34 - (number_of_slices - 1)*S33
   //
   //       The third choice will provide a VTK image that has positive
   //       spacing and a matrix with a positive determinant.
@@ -1030,9 +1028,9 @@ int vtkNIFTIImageReader::RequestInformation(
       mmat[10] = -mmat[10];
 
       // adjust the offset to compensate for changed slice ordering
-      mmat[3] += hdr2->srow_x[2]*(hdr2->dim[3] - 1);
-      mmat[7] += hdr2->srow_y[2]*(hdr2->dim[3] - 1);
-      mmat[11] += hdr2->srow_z[2]*(hdr2->dim[3] - 1);
+      mmat[3] -= hdr2->srow_x[2]*(hdr2->dim[3] - 1);
+      mmat[7] -= hdr2->srow_y[2]*(hdr2->dim[3] - 1);
+      mmat[11] -= hdr2->srow_z[2]*(hdr2->dim[3] - 1);
       }
 
     this->SFormMatrix = vtkMatrix4x4::New();
@@ -1151,11 +1149,6 @@ int vtkNIFTIImageReader::RequestData(
     return 0;
     }
 
-  // check if planar RGB is applicable (Analyze only)
-  bool planarRGB = (this->PlanarRGB &&
-                    (this->NIFTIHeader->GetDataType() == NIFTI_TYPE_RGB24 ||
-                     this->NIFTIHeader->GetDataType() == NIFTI_TYPE_RGBA32));
-
   int swapBytes = this->GetSwapBytes();
   int scalarSize = data->GetScalarSize();
   int numComponents = data->GetNumberOfScalarComponents();
@@ -1172,7 +1165,6 @@ int vtkNIFTIImageReader::RequestData(
 
   z_off_t fileVoxelIncr = scalarSize*numComponents/vectorDim;
   z_off_t fileRowIncr = fileVoxelIncr*this->Dim[1];
-  z_off_t filePlaneIncr = fileRowIncr*this->Dim[2];
   z_off_t fileSliceIncr = fileRowIncr*this->Dim[2];
   z_off_t fileTimeIncr = fileSliceIncr*this->Dim[3];
   z_off_t fileVectorIncr = fileTimeIncr*this->Dim[4];
@@ -1181,19 +1173,9 @@ int vtkNIFTIImageReader::RequestData(
     fileVectorIncr = fileTimeIncr;
     }
 
-  // planar RGB requires different increments
-  int planarSize = 1; // if > 1, indicates planar RGB
-  if (planarRGB)
-    {
-    planarSize = numComponents/vectorDim;
-    fileVoxelIncr = scalarSize;
-    fileRowIncr = fileVoxelIncr*this->Dim[1];
-    filePlaneIncr = fileRowIncr*this->Dim[2];
-    }
-
   // add a buffer for planar-vector to packed-vector conversion
   unsigned char *rowBuffer = 0;
-  if (vectorDim > 1 || planarRGB)
+  if (vectorDim > 1)
     {
     rowBuffer = new unsigned char[outSizeX*fileVoxelIncr];
     }
@@ -1210,23 +1192,11 @@ int vtkNIFTIImageReader::RequestData(
     dataPtr += sliceOffset*(outSizeZ - 1);
     }
 
-  // special increment to handle planar RGB
-  vtkIdType planarOffset = 0;
-  vtkIdType planarEndOffset = 0;
-  if (planarRGB)
-    {
-    planarOffset = scalarSize*numComponents;
-    planarOffset *= outSizeX;
-    planarOffset *= outSizeY;
-    planarOffset -= scalarSize;
-    planarEndOffset = planarOffset - scalarSize*(planarSize - 1);
-    }
-
   // report progress every 2% of the way to completion
   this->InvokeEvent(vtkCommand::StartEvent);
   this->UpdateProgress(0.0);
   vtkIdType target =
-    static_cast<vtkIdType>(0.02*planarSize*outSizeY*outSizeZ*vectorDim) + 1;
+    static_cast<vtkIdType>(0.02*outSizeY*outSizeZ*vectorDim) + 1;
   vtkIdType count = 0;
 
   // seek to the start of the data
@@ -1237,11 +1207,10 @@ int vtkNIFTIImageReader::RequestData(
 
   // read the data one row at a time, do planar-to-packed conversion
   // of vector components if NIFTI file has a vector dimension
-  int rowSize = fileVoxelIncr/scalarSize*outSizeX;
+  int rowSize = numComponents/vectorDim*outSizeX;
   int t = 0; // counter for time
   int c = 0; // counter for vector components
   int j = 0; // counter for rows
-  int p = 0; // counter for planes (planar RGB)
   int k = 0; // counter for slices
   unsigned char *ptr = dataPtr;
 
@@ -1263,7 +1232,7 @@ int vtkNIFTIImageReader::RequestData(
         }
       }
 
-    if (vectorDim == 1 && !planarRGB)
+    if (vectorDim == 1)
       {
       // read directly into the output instead of into a buffer
       rowBuffer = ptr;
@@ -1285,7 +1254,7 @@ int vtkNIFTIImageReader::RequestData(
       vtkByteSwap::SwapVoidRange(rowBuffer, rowSize, scalarSize);
       }
 
-    if (vectorDim == 1 && !planarRGB)
+    if (vectorDim == 1)
       {
       // advance the pointer to the next row
       ptr += outSizeX*numComponents*scalarSize;
@@ -1317,44 +1286,36 @@ int vtkNIFTIImageReader::RequestData(
     if (++j == outSizeY)
       {
       j = 0;
-      offset += filePlaneIncr - outSizeY*fileRowIncr;
-      // back up for next plane (R, G, or B) if planar mode
-      ptr -= planarOffset;
-      if (++p == planarSize)
+      offset += fileSliceIncr - outSizeY*fileRowIncr;
+      ptr -= 2*sliceOffset; // for reverse slice order
+      if (++k == outSizeZ)
         {
-        p = 0;
-        ptr += planarEndOffset; // advance to start of next slice
-        ptr -= 2*sliceOffset; // for reverse slice order
-        if (++k == outSizeZ)
+        k = 0;
+        offset += fileVectorIncr - outSizeZ*fileSliceIncr;
+        if (++t == timeDim)
+          {
+          t = 0;
+          }
+        if (++c == vectorDim)
+          {
+          break;
+          }
+        // back up the ptr to the beginning of the image,
+        // then increment to the next vector component
+        ptr = dataPtr + c*fileVoxelIncr;
+
+        if (this->TimeAsVector)
           {
-          k = 0;
-          offset += fileVectorIncr - outSizeZ*fileSliceIncr;
-          if (++t == timeDim)
-            {
-            t = 0;
-            }
-          if (++c == vectorDim)
-            {
-            break;
-            }
-          // back up the ptr to the beginning of the image,
-          // then increment to the next vector component
-          ptr = dataPtr + c*fileVoxelIncr*planarSize;
-
-          if (this->TimeAsVector)
-            {
-            // if timeDim is included in the vectorDim (and hence in the
-            // VTK scalar components) then we have to make sure that
-            // the vector components are packed before the time steps
-            ptr = dataPtr + (c + t*(vectorDim - 1))/timeDim*
-                            fileVoxelIncr*planarSize;
-            }
+          // if timeDim is included in the vectorDim (and hence in the
+          // VTK scalar components) then we have to make sure that
+          // the vector components are packed before the time steps
+          ptr = dataPtr + (c + t*(vectorDim - 1))/timeDim*fileVoxelIncr;
           }
         }
       }
     }
 
-  if (vectorDim > 1 || planarRGB)
+  if (vectorDim > 1)
     {
     delete [] rowBuffer;
     }
diff --git a/IO/Image/vtkNIFTIImageReader.h b/IO/Image/vtkNIFTIImageReader.h
index cde30d3..7d42f1c 100644
--- a/IO/Image/vtkNIFTIImageReader.h
+++ b/IO/Image/vtkNIFTIImageReader.h
@@ -92,16 +92,6 @@ public:
   double GetRescaleIntercept() { return this->RescaleIntercept; }
 
   // Description:
-  // Read planar RGB (separate R, G, and B planes), rather than packed RGB.
-  // The NIFTI format should always use packed RGB.  The Analyze format,
-  // however, was used to store both planar RGB and packed RGB depending
-  // on the software, without any indication in the header about which
-  // convention was being used.  Use this if you have a planar RGB file.
-  vtkGetMacro(PlanarRGB, bool);
-  vtkSetMacro(PlanarRGB, bool);
-  vtkBooleanMacro(PlanarRGB, bool);
-
-  // Description:
   // QFac gives the slice order in the NIFTI file versus the VTK image.
   // If QFac is -1, then the VTK slice index J is related to the NIFTI
   // slice index j by the equation J = (num_slices - j - 1).  VTK requires
@@ -214,10 +204,6 @@ protected:
   // A copy of the header from the file that was most recently read.
   vtkNIFTIImageHeader *NIFTIHeader;
 
-  // Description:
-  // Use planar RGB instead of the default (packed).
-  bool PlanarRGB;
-
 private:
   vtkNIFTIImageReader(const vtkNIFTIImageReader&);  // Not implemented.
   void operator=(const vtkNIFTIImageReader&);  // Not implemented.
diff --git a/IO/Image/vtkNIFTIImageWriter.cxx b/IO/Image/vtkNIFTIImageWriter.cxx
index 55d4717..93d9e92 100644
--- a/IO/Image/vtkNIFTIImageWriter.cxx
+++ b/IO/Image/vtkNIFTIImageWriter.cxx
@@ -71,8 +71,6 @@ vtkNIFTIImageWriter::vtkNIFTIImageWriter()
   strncpy(this->Description, "VTK", 3);
   strncpy(&this->Description[3], version, l);
   this->Description[l + 3] = '\0';
-  // Planar RGB (NIFTI doesn't allow this, it's here for Analyze)
-  this->PlanarRGB = false;
 }
 
 //----------------------------------------------------------------------------
@@ -161,7 +159,6 @@ void vtkNIFTIImageWriter::PrintSelf(ostream& os, vtkIndent indent)
     os << "(none)\n";
     }
   os << indent << "NIFTIVersion: " << this->NIFTIVersion << "\n";
-  os << indent << "PlanarRGB: " << (this->PlanarRGB ? "On\n" : "Off\n");
 }
 
 //----------------------------------------------------------------------------
@@ -345,9 +342,9 @@ void vtkNIFTIImageWriterSetQForm(
     // We will be reversing the order of the slices, so the first VTK
     // slice will be at the position of the last NIfTI slice, and we
     // must adjust the offset to compensate for this.
-    mmat[3] += rmat[0][2] * hdr->pixdim[3] * (hdr->dim[3] - 1);
-    mmat[7] += rmat[1][2] * hdr->pixdim[3] * (hdr->dim[3] - 1);
-    mmat[11] += rmat[2][2] * hdr->pixdim[3] * (hdr->dim[3] - 1);
+    mmat[3] -= rmat[0][2]*hdr->pixdim[3]*(hdr->dim[3] - 1);
+    mmat[7] -= rmat[1][2]*hdr->pixdim[3]*(hdr->dim[3] - 1);
+    mmat[11] -= rmat[2][2]*hdr->pixdim[3]*(hdr->dim[3] - 1);
     }
 
   hdr->pixdim[0] = qfac;
@@ -370,9 +367,9 @@ void vtkNIFTIImageWriterSetSForm(
     // orientation vector (the third column of the matrix) to compensate.
 
     // adjust the offset to compensate for changed slice ordering
-    mmat[3] += mmat[2] * hdr->pixdim[3] * (hdr->dim[3] - 1);
-    mmat[7] += mmat[6] * hdr->pixdim[3] * (hdr->dim[3] - 1);
-    mmat[11] += mmat[10] * hdr->pixdim[3] * (hdr->dim[3] - 1);
+    mmat[3] -= mmat[2]*(hdr->dim[3] - 1);
+    mmat[7] -= mmat[6]*(hdr->dim[3] - 1);
+    mmat[11] -= mmat[10]*(hdr->dim[3] - 1);
 
     // reverse the slice orientation vector
     mmat[2] = -mmat[2];
@@ -764,18 +761,12 @@ int vtkNIFTIImageWriter::RequestData(
     {
     vtkErrorMacro("Cannot open file " << imgname);
     this->SetErrorCode(vtkErrorCode::CannotOpenFileError);
-    return 0;
     }
 
   // write the image
   unsigned char *dataPtr =
     static_cast<unsigned char *>(data->GetScalarPointer());
 
-  // check if planar RGB is applicable (Analyze only)
-  bool planarRGB = (this->PlanarRGB &&
-                    (this->OwnHeader->GetDataType() == NIFTI_TYPE_RGB24 ||
-                     this->OwnHeader->GetDataType() == NIFTI_TYPE_RGBA32));
-
   int swapBytes = 0;
   int scalarSize = data->GetScalarSize();
   int numComponents = data->GetNumberOfScalarComponents();
@@ -789,16 +780,10 @@ int vtkNIFTIImageWriter::RequestData(
   vectorDim *= timeDim;
 
   z_off_t fileVoxelIncr = scalarSize*numComponents/vectorDim;
-  int planarSize = 1;
-  if (planarRGB)
-    {
-    planarSize = numComponents/vectorDim;
-    fileVoxelIncr = scalarSize;
-    }
 
   // add a buffer for planar-vector to packed-vector conversion
   unsigned char *rowBuffer = 0;
-  if (vectorDim > 1 || planarRGB || swapBytes)
+  if (vectorDim > 1 || swapBytes)
     {
     rowBuffer = new unsigned char[outSizeX*fileVoxelIncr];
     }
@@ -815,29 +800,16 @@ int vtkNIFTIImageWriter::RequestData(
     dataPtr += sliceOffset*(outSizeZ - 1);
     }
 
-  // special increment to handle planar RGB
-  vtkIdType planarOffset = 0;
-  vtkIdType planarEndOffset = 0;
-  if (planarRGB)
-    {
-    planarOffset = scalarSize*numComponents;
-    planarOffset *= outSizeX;
-    planarOffset *= outSizeY;
-    planarOffset -= scalarSize;
-    planarEndOffset = planarOffset - scalarSize*(planarSize - 1);
-    }
-
   // report progress every 2% of the way to completion
   vtkIdType target =
-    static_cast<vtkIdType>(0.02*planarSize*outSizeY*outSizeZ*vectorDim) + 1;
+    static_cast<vtkIdType>(0.02*outSizeY*outSizeZ*vectorDim) + 1;
   vtkIdType count = 0;
 
   // write the data one row at a time, do planar-to-packed conversion
   // of vector components if NIFTI file has a vector dimension
-  int rowSize = fileVoxelIncr/scalarSize*outSizeX;
+  int rowSize = numComponents/vectorDim*outSizeX;
   int c = 0; // counter for vector components
   int j = 0; // counter for rows
-  int p = 0; // counter for planes (planar RGB)
   int k = 0; // counter for slices
   int t = 0; // counter for time
 
@@ -845,7 +817,7 @@ int vtkNIFTIImageWriter::RequestData(
 
   while (!this->AbortExecute && !this->ErrorCode)
     {
-    if (vectorDim == 1 && !planarRGB && !swapBytes)
+    if (vectorDim == 1 && swapBytes == 0)
       {
       // write directly from input, instead of using a buffer
       rowBuffer = ptr;
@@ -894,36 +866,28 @@ int vtkNIFTIImageWriter::RequestData(
     if (++j == outSizeY)
       {
       j = 0;
-      // back up for next plane (R, G, or B) if planar mode
-      ptr -= planarOffset;
-      if (++p == planarSize)
+      ptr -= 2*sliceOffset; // for reverse slice order
+      if (++k == outSizeZ)
         {
-        p = 0;
-        ptr += planarEndOffset; // advance to start of next slice
-        ptr -= 2*sliceOffset; // for reverse slice order
-        if (++k == outSizeZ)
+        k = 0;
+        if (++t == timeDim)
+          {
+          t = 0;
+          }
+        if (++c == vectorDim)
+          {
+          break;
+          }
+        // back up the ptr to the beginning of the image,
+        // then increment to the next vector component
+        ptr = dataPtr + c*fileVoxelIncr;
+
+        if (timeDim > 1)
           {
-          k = 0;
-          if (++t == timeDim)
-            {
-            t = 0;
-            }
-          if (++c == vectorDim)
-            {
-            break;
-            }
-          // back up the ptr to the beginning of the image,
-          // then increment to the next vector component
-          ptr = dataPtr + c*fileVoxelIncr*planarSize;
-
-          if (timeDim > 1)
-            {
-            // if timeDim is included in the vectorDim (and hence in the
-            // VTK scalar components) then we have to make sure that
-            // the vector components are packed before the time steps
-            ptr = dataPtr + (c + t*(vectorDim - 1))/timeDim*
-                             fileVoxelIncr*planarSize;
-            }
+          // if timeDim is included in the vectorDim (and hence in the
+          // VTK scalar components) then we have to make sure that
+          // the vector components are packed before the time steps
+          ptr = dataPtr + (c + t*(vectorDim - 1))/timeDim*fileVoxelIncr;
           }
         }
       }
@@ -931,7 +895,7 @@ int vtkNIFTIImageWriter::RequestData(
 
   // only delete this if it was alloced (if it was not alloced, it
   // would have been set directly to a row out the output image)
-  if (vectorDim > 1 || swapBytes || planarRGB)
+  if (vectorDim > 1 || swapBytes)
     {
     delete [] rowBuffer;
     }
diff --git a/IO/Image/vtkNIFTIImageWriter.h b/IO/Image/vtkNIFTIImageWriter.h
index 7f4c88f..cb7fe85 100644
--- a/IO/Image/vtkNIFTIImageWriter.h
+++ b/IO/Image/vtkNIFTIImageWriter.h
@@ -85,16 +85,6 @@ public:
    vtkGetMacro(RescaleIntercept, double);
 
   // Description:
-  // Write planar RGB (separate R, G, and B planes), rather than packed RGB.
-  // Use this option with extreme caution: the NIFTI standard requires RGB
-  // pixels to be packed.  The Analyze format, however, was used to store
-  // both planar RGB and packed RGB depending on the software, without any
-  // indication in the header about which convention was being used.
-  vtkGetMacro(PlanarRGB, bool);
-  vtkSetMacro(PlanarRGB, bool);
-  vtkBooleanMacro(PlanarRGB, bool);
-
-  // Description:
   // The QFac sets the ordering of the slices in the NIFTI file.
   // If QFac is -1, then the slice ordering in the file will be reversed
   // as compared to VTK. Use with caution.
@@ -179,10 +169,6 @@ protected:
   vtkNIFTIImageHeader *OwnHeader;
   int NIFTIVersion;
 
-  // Description:
-  // Use planar RGB instead of the default (packed).
-  bool PlanarRGB;
-
 private:
   vtkNIFTIImageWriter(const vtkNIFTIImageWriter&);  // Not implemented.
   void operator=(const vtkNIFTIImageWriter&);  // Not implemented.
diff --git a/IO/Image/vtkTIFFReader.cxx b/IO/Image/vtkTIFFReader.cxx
index 379ada5..f3be3f2 100644
--- a/IO/Image/vtkTIFFReader.cxx
+++ b/IO/Image/vtkTIFFReader.cxx
@@ -24,7 +24,6 @@
 
 #include <sys/stat.h>
 #include <string>
-#include <algorithm>
 
 extern "C" {
 #include "vtk_tiff.h"
@@ -44,75 +43,23 @@ int GetFileRow(int row, int, FlipFalse)
   return row;
 }
 
-// This is inverse of GetFileRow(), which is same as calling GetFileRow()
-// again.
-template <class Flip>
-int GetImageRow(int file_row, int height, Flip flip)
-{
-  return GetFileRow(file_row, height, flip);
-}
-
-bool SupportsRandomAccess(TIFF* image)
-{
-  unsigned int rowsPerStrip;
-  unsigned short compression;
-  TIFFGetFieldDefaulted(image, TIFFTAG_COMPRESSION, &compression);
-  TIFFGetFieldDefaulted(image, TIFFTAG_ROWSPERSTRIP, &rowsPerStrip);
-  return (compression == COMPRESSION_NONE || rowsPerStrip == 1);
-}
-
-bool PurgeInitialScanLinesIfNeeded(int fileStartRow, TIFF* image)
-{
-  if (fileStartRow == 0 || SupportsRandomAccess(image))
-    {
-    return true;
-    }
-
-  // File doesn't support random access and we want to start at a non-0 row. We
-  // read (and discard) initial scanlines.
-  unsigned int isize = TIFFScanlineSize(image);
-  tdata_t buf = _TIFFmalloc(isize);
-  for (int i = 0; i < fileStartRow; ++i)
-    {
-    if (TIFFReadScanline(image, buf, i, 0) <= 0)
-      {
-      _TIFFfree(buf);
-      return false;
-      }
-    }
-  _TIFFfree(buf);
-  return true;
-}
-
 // Simple scan line copy of a slice in a volume with tightly packed memory.
 template<typename T, typename Flip>
 bool ReadTemplatedImage(T* out, Flip flip,
                         int startCol, int endCol,
                         int startRow, int endRow,
                         int yIncrements,
-                        unsigned int height,
-                        TIFF *image)
+                        unsigned int height, TIFF *image)
 {
-  int fileStartRow = GetFileRow(startRow, height, flip);
-  int fileEndRow = GetFileRow(endRow, height, flip);
-  int minFileRow = std::min(fileStartRow, fileEndRow);
-  int maxFileRow = std::max(fileStartRow, fileEndRow);
-
-  if (!PurgeInitialScanLinesIfNeeded(minFileRow, image))
-    {
-    return false;
-    }
-
   unsigned int isize = TIFFScanlineSize(image);
   size_t scanLineSize = endCol - startCol + 1;
   if (scanLineSize * sizeof(T) == isize)
     {
     // We can copy straight into the image data output.
-    for (int fi = minFileRow; fi <= maxFileRow; ++fi)
+    for (int i = startRow; i <= endRow; ++i)
       {
-      int i = GetImageRow(fi, height, flip);
       T* tmp = out + (i - startRow) * yIncrements;
-      if (TIFFReadScanline(image, tmp, fi, 0) <= 0)
+      if (TIFFReadScanline(image, tmp, GetFileRow(i, height, flip), 0) <= 0)
         {
         return false;
         }
@@ -122,11 +69,10 @@ bool ReadTemplatedImage(T* out, Flip flip,
     {
     // Copy into a buffer of the appropriate size, then subset into the output.
     tdata_t buf = _TIFFmalloc(isize);
-    for (int fi = minFileRow; fi <= maxFileRow; ++fi)
+    for (int i = startRow; i <= endRow; ++i)
       {
-      int i = GetImageRow(fi, height, flip);
       T* tmp = out + (i - startRow) * yIncrements;
-      if (TIFFReadScanline(image, buf, fi, 0) <= 0)
+      if (TIFFReadScanline(image, buf, GetFileRow(i, height, flip), 0) <= 0)
         {
         _TIFFfree(buf);
         return false;
@@ -248,7 +194,6 @@ void vtkTIFFReader::vtkTIFFReaderInternal::Clean()
 vtkTIFFReader::vtkTIFFReaderInternal::vtkTIFFReaderInternal()
 {
   this->Image           = NULL;
-  // Note that this suppresses all error/warning output from libtiff!
   TIFFSetErrorHandler(&vtkTIFFReaderInternalErrorHandler);
   TIFFSetWarningHandler(&vtkTIFFReaderInternalErrorHandler);
   this->Clean();
@@ -863,11 +808,13 @@ void vtkTIFFReader::ReadVolume(T* buffer)
 {
   int width  = this->InternalImage->Width;
   int height = this->InternalImage->Height;
-  int samplesPerPixel = this->InternalImage->SamplesPerPixel;
   unsigned int npages = this->InternalImage->NumberOfPages;
+  if (this->InternalImage->SubFiles > 0)
+    {
+    // See ExecuteInformation
+    npages = this->InternalImage->SubFiles;
+    }
 
-  // counter for slices (not every page is a slice)
-  unsigned int slice = 0;
   for (unsigned int page = 0; page < npages; ++page)
     {
     this->UpdateProgress(static_cast<double>(page + 1) / npages);
@@ -886,10 +833,10 @@ void vtkTIFFReader::ReadVolume(T* buffer)
       }
 
     // if we have a Zeiss image meaning that the SamplesPerPixel is 2
-    if (samplesPerPixel == 2)
+    if (this->InternalImage->SamplesPerPixel == 2)
       {
       T* volume = buffer;
-      volume += width * height * slice * samplesPerPixel;
+      volume += width * height * this->InternalImage->SamplesPerPixel * page;
       this->ReadTwoSamplesPerPixelImage(volume, width, height);
       break;
       }
@@ -907,7 +854,7 @@ void vtkTIFFReader::ReadVolume(T* buffer)
 
       const bool flip = this->InternalImage->Orientation != ORIENTATION_TOPLEFT;
       T* fimage = buffer;
-      fimage += width * height * 4 * slice;
+      fimage += width * height * 4 * page;
       for (int yy = 0; yy < height; ++yy)
         {
         uint32* ssimage;
@@ -943,7 +890,7 @@ void vtkTIFFReader::ReadVolume(T* buffer)
         case vtkTIFFReader::PALETTE_GRAYSCALE:
           {
           T* volume = buffer;
-          volume += width * height * slice * samplesPerPixel;
+          volume += width * height * this->InternalImage->SamplesPerPixel * page;
           this->ReadGenericImage(volume, width, height);
           break;
           }
@@ -951,9 +898,6 @@ void vtkTIFFReader::ReadVolume(T* buffer)
           return;
         }
       }
-
-    // advance to next slice
-    slice++;
     TIFFReadDirectory(this->InternalImage->Image);
     }
 }
@@ -1414,7 +1358,7 @@ void vtkTIFFReader::ReadImageInternal(T* outPtr)
         }
       }
 
-    if (tempImage != reinterpret_cast<uint32*>(outPtr))
+    if (tempImage != 0 && tempImage != reinterpret_cast<uint32*>(outPtr))
       {
       delete [] tempImage;
       }
diff --git a/IO/Image/vtkTIFFWriter.cxx b/IO/Image/vtkTIFFWriter.cxx
index 37125f2..f29c060 100644
--- a/IO/Image/vtkTIFFWriter.cxx
+++ b/IO/Image/vtkTIFFWriter.cxx
@@ -18,108 +18,82 @@
 #include "vtkImageData.h"
 #include "vtkObjectFactory.h"
 #include "vtkPointData.h"
-#include "vtkStreamingDemandDrivenPipeline.h"
 #include "vtk_tiff.h"
 
-#if _MSC_VER
-#define snprintf _snprintf
-#endif
-
 vtkStandardNewMacro(vtkTIFFWriter);
 
 //----------------------------------------------------------------------------
 vtkTIFFWriter::vtkTIFFWriter()
-  : TIFFPtr(NULL), Compression(PackBits), Width(0), Height(0), Pages(0),
-    XResolution(-1.0), YResolution(-1.0)
 {
-}
+  this->TIFFPtr = 0;
+  this->Compression = vtkTIFFWriter::PackBits;
+};
 
-//----------------------------------------------------------------------------
-void vtkTIFFWriter::Write()
+
+class vtkTIFFWriterIO
 {
-  // make sure the latest input is available.
-  this->GetInputAlgorithm()->Update();
-  this->SetErrorCode(vtkErrorCode::NoError);
-  // Error checking
-  if (this->GetInput() == NULL)
-    {
-    vtkErrorMacro(<<"Write: Please specify an input!");
-    return;
-    }
-  if (!this->FileName && !this->FilePattern)
-    {
-    vtkErrorMacro(<<"Write: Please specify either a FileName or a file prefix and pattern");
-    this->SetErrorCode(vtkErrorCode::NoFileNameError);
-    return;
-    }
+public:
+  // Writing file no reading
+  static tsize_t TIFFRead(thandle_t, tdata_t, tsize_t) { return 0; }
 
-  // Make sure the file name is allocated - inherited from parent class,
-  // would be great to rewrite in more modern C++, but sticking with superclass
-  // for now to maintain behavior without rewriting/translating code.
-  size_t internalFileNameSize = (this->FileName ? strlen(this->FileName) : 1) +
-            (this->FilePrefix ? strlen(this->FilePrefix) : 1) +
-            (this->FilePattern ? strlen(this->FilePattern) : 1) + 256;
-  this->InternalFileName = new char[internalFileNameSize];
-  this->InternalFileName[0] = 0;
-  int bytesPrinted = 0;
-  // determine the name
-  if (this->FileName)
+  // Write data
+  static tsize_t TIFFWrite(thandle_t fd, tdata_t buf, tsize_t size)
     {
-    bytesPrinted = snprintf(this->InternalFileName, internalFileNameSize,
-      "%s",this->FileName);
+    ostream *out = reinterpret_cast<ostream *>(fd);
+    out->write(static_cast<char *>(buf), size);
+    return out->fail() ? static_cast<tsize_t>(0) : size;
     }
-  else
+
+  static toff_t TIFFSeek(thandle_t fd, toff_t off, int whence)
     {
-    if (this->FilePrefix)
-      {
-      bytesPrinted = snprintf(this->InternalFileName, internalFileNameSize,
-        this->FilePattern, this->FilePrefix, this->FileNumber);
-      }
-    else
+    ostream *out = reinterpret_cast<ostream *>(fd);
+    switch (whence)
       {
-      bytesPrinted = snprintf(this->InternalFileName, internalFileNameSize,
-        this->FilePattern,this->FileNumber);
+      case SEEK_SET:
+        out->seekp(off, ios::beg);
+        break;
+      case SEEK_END:
+        out->seekp(off, ios::end);
+        break;
+      case SEEK_CUR:
+        out->seekp(off, ios::cur);
+        break;
+      default:
+        return out->tellp();
       }
-    }
-  if (static_cast<size_t>(bytesPrinted) >= internalFileNameSize)
-    {
-    // Add null terminating character just to be safe.
-    this->InternalFileName[internalFileNameSize - 1] = 0;
-    vtkWarningMacro("Filename has been truncated.");
+    return out->tellp();
     }
 
-  // Fill in image information.
-  this->GetInputExecutive(0, 0)->UpdateInformation();
-  int *wExtent;
-  wExtent = vtkStreamingDemandDrivenPipeline::GetWholeExtent(
-    this->GetInputInformation(0, 0));
-  this->FilesDeleted = 0;
-  this->UpdateProgress(0.0);
-
-  this->WriteFileHeader(0, this->GetInput(), wExtent);
-  this->WriteFile(0, this->GetInput(), wExtent, 0);
-  if (this->ErrorCode == vtkErrorCode::OutOfDiskSpaceError)
-    {
-    this->DeleteFiles();
-    }
-  else
+  // File will be closed by the superclass
+  static int TIFFClose(thandle_t) { return 1; }
+
+  static toff_t TIFFSize(thandle_t fd)
     {
-    this->WriteFileTrailer(0, 0);
+    ostream *out = reinterpret_cast<ostream *>(fd);
+    out->seekp(0, ios::end);
+    return out->tellp();
     }
 
-  delete [] this->InternalFileName;
-  this->InternalFileName = NULL;
-}
+  static int TIFFMapFile(thandle_t, tdata_t*, toff_t*) { return (0); }
+  static void TIFFUnmapFile(thandle_t, tdata_t, toff_t) {}
+};
 
 //----------------------------------------------------------------------------
-void vtkTIFFWriter::WriteFileHeader(ofstream *, vtkImageData *data, int wExt[6])
+void vtkTIFFWriter::WriteFileHeader(ofstream *file, vtkImageData *data, int wExt[6])
 {
   int dims[3];
+  int width, height;
   data->GetDimensions(dims);
   int scomponents = data->GetNumberOfScalarComponents();
   int stype = data->GetScalarType();
+  double resolution = -1;
   uint32 rowsperstrip = (uint32) -1;
 
+  int min0 = wExt[0],
+    max0 = wExt[1],
+    min1 = wExt[2],
+    max1 = wExt[3];
+
   int bps;
   switch (stype)
     {
@@ -142,41 +116,38 @@ void vtkTIFFWriter::WriteFileHeader(ofstream *, vtkImageData *data, int wExt[6])
     }
 
   int predictor;
-
-  // Find the width/height of the images
-  this->Width = wExt[1] - wExt[0] + 1;
-  this->Height = wExt[3] - wExt[2] + 1;
-  // Check if we need to write an image stack (pages > 2).
-  this->Pages = wExt[5] - wExt[4] + 1;
-
-  // Check the resolution too, assume we store it in metric (as in reader).
-  this->XResolution = 10.0 / data->GetSpacing()[0];
-  this->YResolution = 10.0 / data->GetSpacing()[1];
-
-  TIFF* tif = TIFFOpen(this->InternalFileName, "w");
-
-  if (!tif)
+  ostream* ost = file;
+
+  // Find the length of the rows to write.
+  width = (max0 - min0 + 1);
+  height = (max1 - min1 + 1);
+
+  TIFF* tif = TIFFClientOpen(this->InternalFileName, "w",
+    (thandle_t) ost,
+    reinterpret_cast<TIFFReadWriteProc>(vtkTIFFWriterIO::TIFFRead),
+    reinterpret_cast<TIFFReadWriteProc>(vtkTIFFWriterIO::TIFFWrite),
+    reinterpret_cast<TIFFSeekProc>(vtkTIFFWriterIO::TIFFSeek),
+    reinterpret_cast<TIFFCloseProc>(vtkTIFFWriterIO::TIFFClose),
+    reinterpret_cast<TIFFSizeProc>(vtkTIFFWriterIO::TIFFSize),
+    reinterpret_cast<TIFFMapFileProc>(vtkTIFFWriterIO::TIFFMapFile),
+    reinterpret_cast<TIFFUnmapFileProc>(vtkTIFFWriterIO::TIFFUnmapFile)
+    );
+  if ( !tif )
     {
     this->TIFFPtr = 0;
     return;
     }
   this->TIFFPtr = tif;
 
-  // Let the volume do its metadata, keep existing for 2D images.
-  if (this->Pages > 1)
-    {
-    return;
-    }
-
-  uint32 w = this->Width;
-  uint32 h = this->Height;
+  uint32 w = width;
+  uint32 h = height;
   TIFFSetField(tif, TIFFTAG_IMAGEWIDTH, w);
   TIFFSetField(tif, TIFFTAG_IMAGELENGTH, h);
   TIFFSetField(tif, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT);
   TIFFSetField(tif, TIFFTAG_SAMPLESPERPIXEL, scomponents);
   TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, bps); // Fix for stype
   TIFFSetField(tif, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
-  if (stype == VTK_FLOAT)
+  if(stype == VTK_FLOAT)
     {
     TIFFSetField(tif, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_IEEEFP);
     }
@@ -232,11 +203,11 @@ void vtkTIFFWriter::WriteFileHeader(ofstream *, vtkImageData *data, int wExt[6])
   TIFFSetField(tif, TIFFTAG_PHOTOMETRIC, photometric); // Fix for scomponents
   TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP,
     TIFFDefaultStripSize(tif, rowsperstrip));
-  if (this->XResolution > 0.0 && this->YResolution > 0.0)
+  if (resolution > 0)
     {
-    TIFFSetField(tif, TIFFTAG_XRESOLUTION, this->XResolution);
-    TIFFSetField(tif, TIFFTAG_YRESOLUTION, this->YResolution);
-    TIFFSetField(tif, TIFFTAG_RESOLUTIONUNIT, RESUNIT_CENTIMETER);
+    TIFFSetField(tif, TIFFTAG_XRESOLUTION, resolution);
+    TIFFSetField(tif, TIFFTAG_YRESOLUTION, resolution);
+    TIFFSetField(tif, TIFFTAG_RESOLUTIONUNIT, RESUNIT_INCH);
     }
 }
 
@@ -244,17 +215,21 @@ void vtkTIFFWriter::WriteFileHeader(ofstream *, vtkImageData *data, int wExt[6])
 void vtkTIFFWriter::WriteFile(ofstream *, vtkImageData *data,
                               int extent[6], int*)
 {
+  int idx1, idx2;
+  void *ptr;
+
+
   // Make sure we actually have data.
-  if (!data->GetPointData()->GetScalars())
+  if ( !data->GetPointData()->GetScalars())
     {
     vtkErrorMacro(<< "Could not get data from input.");
     return;
     }
 
   TIFF* tif = reinterpret_cast<TIFF*>(this->TIFFPtr);
-  if (!tif)
+  if ( !tif )
     {
-    vtkErrorMacro("Problem writing file.");
+    vtkErrorMacro("Problem writing trailer.");
     this->SetErrorCode(vtkErrorCode::FileFormatError);
     return;
     }
@@ -262,139 +237,25 @@ void vtkTIFFWriter::WriteFile(ofstream *, vtkImageData *data,
   // take into consideration the scalar type
   if( data->GetScalarType() != VTK_UNSIGNED_CHAR
    && data->GetScalarType() != VTK_UNSIGNED_SHORT
-   && data->GetScalarType() != VTK_FLOAT)
+   && data->GetScalarType() != VTK_FLOAT
+   )
     {
     vtkErrorMacro("TIFFWriter only accepts unsigned char/short or float scalars!");
     return;
     }
 
-  if (this->Pages > 1)
+  int row = 0;
+  for (idx2 = extent[4]; idx2 <= extent[5]; ++idx2)
     {
-    // Call the correct templated function for the input
-    void *inPtr = data->GetScalarPointer();
-
-    switch (data->GetScalarType())
+    for (idx1 = extent[3]; idx1 >= extent[2]; idx1--)
       {
-      vtkTemplateMacro(this->WriteVolume((VTK_TT *)(inPtr)));
-      default:
-        vtkErrorMacro("UpdateFromFile: Unknown data type");
-      }
-    }
-  else
-    {
-    // Now write the image for the current page/directory element.
-    int row = 0;
-    for (int idx2 = extent[4]; idx2 <= extent[5]; ++idx2)
-      {
-      for (int idx1 = extent[3]; idx1 >= extent[2]; idx1--)
-        {
-        void *ptr = data->GetScalarPointer(extent[0], idx1, idx2);
-        if (TIFFWriteScanline(tif, static_cast<unsigned char*>(ptr), row, 0) < 0)
-          {
-          this->SetErrorCode(vtkErrorCode::OutOfDiskSpaceError);
-          break;
-          }
-        ++row;
-        }
-      }
-    }
-}
-
-//----------------------------------------------------------------------------
-template<typename T>
-void vtkTIFFWriter::WriteVolume(T* buffer)
-{
-  TIFF* tif = reinterpret_cast<TIFF*>(this->TIFFPtr);
-  if (!tif)
-    {
-    vtkErrorMacro("Problem writing volume.");
-    this->SetErrorCode(vtkErrorCode::FileFormatError);
-    return;
-    }
-  int width = this->Width;
-  int height = this->Height;
-  int pages = this->Pages;
-
-  uint32 w = width;
-  uint32 h = height;
-  int bitsPerSample = sizeof(T) * 8;
-
-  for (int page = 0; page < pages; ++page)
-    {
-    this->UpdateProgress(static_cast<double>(page + 1) / pages);
-
-    // TIFF directory set up/tags.
-    TIFFSetField(tif, TIFFTAG_IMAGEWIDTH, w);
-    TIFFSetField(tif, TIFFTAG_IMAGELENGTH, h);
-    TIFFSetField(tif, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT);
-    TIFFSetField(tif, TIFFTAG_SAMPLESPERPIXEL, 1);
-    TIFFSetField(tif, TIFFTAG_BITSPERSAMPLE, bitsPerSample);
-    TIFFSetField(tif, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG);
-
-    int compression;
-    switch ( this->Compression )
-      {
-      case vtkTIFFWriter::PackBits:
-        compression = COMPRESSION_PACKBITS;
-        break;
-      case vtkTIFFWriter::JPEG:
-        compression = COMPRESSION_JPEG;
-        break;
-      case vtkTIFFWriter::Deflate:
-        compression = COMPRESSION_DEFLATE;
-        break;
-      case vtkTIFFWriter::LZW:
-        compression = COMPRESSION_LZW;
-        break;
-      default:
-        compression = COMPRESSION_NONE;
-      }
-    TIFFSetField(tif, TIFFTAG_COMPRESSION, compression); // Fix for compression
-    if (compression == COMPRESSION_LZW)
-       {
-       TIFFSetField(tif, TIFFTAG_PREDICTOR, 2);
-       vtkErrorMacro("LZW compression is patented outside US so it is disabled");
-       }
-     else if (compression == COMPRESSION_DEFLATE)
-       {
-       TIFFSetField(tif, TIFFTAG_PREDICTOR, 2);
-       }
-
-    if (bitsPerSample == 32)
-      {
-      TIFFSetField(tif, TIFFTAG_SAMPLEFORMAT, SAMPLEFORMAT_IEEEFP);
-      }
-
-    TIFFSetField(tif, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISBLACK);
-    uint32 rowsperstrip = (uint32) -1;
-    TIFFSetField(tif, TIFFTAG_ROWSPERSTRIP,
-      TIFFDefaultStripSize(tif, rowsperstrip));
-    if (this->XResolution > 0.0 && this->YResolution > 0.0)
-      {
-      TIFFSetField(tif, TIFFTAG_XRESOLUTION, this->XResolution);
-      TIFFSetField(tif, TIFFTAG_YRESOLUTION, this->YResolution);
-      TIFFSetField(tif, TIFFTAG_RESOLUTIONUNIT, RESUNIT_CENTIMETER);
-      }
-
-    // Extra pieces for multidirectory files.
-    TIFFSetField(tif, TIFFTAG_SUBFILETYPE, FILETYPE_PAGE);
-    TIFFSetField(tif, TIFFTAG_PAGENUMBER, page, pages);
-
-    T* volume = buffer;
-    volume += width * height * page;
-    for (int i = 0; i < height; ++i)
-      {
-      T* tmp = volume + i * width;
-      if (TIFFWriteScanline(tif, reinterpret_cast<char*>(tmp), i, 0) < 0)
+      ptr = data->GetScalarPointer(extent[0], idx1, idx2);
+      if ( TIFFWriteScanline(tif, static_cast<unsigned char*>(ptr), row, 0) < 0)
         {
         this->SetErrorCode(vtkErrorCode::OutOfDiskSpaceError);
-        return;
+        break;
         }
-      }
-    if (!TIFFWriteDirectory(tif))
-      {
-      this->SetErrorCode(vtkErrorCode::OutOfDiskSpaceError);
-      return;
+      row ++;
       }
     }
 }
@@ -403,16 +264,12 @@ void vtkTIFFWriter::WriteVolume(T* buffer)
 void vtkTIFFWriter::WriteFileTrailer(ofstream *, vtkImageData *)
 {
   TIFF* tif = reinterpret_cast<TIFF*>(this->TIFFPtr);
-  if( tif)
-    {
-    TIFFClose(tif);
-    }
-  else
+  if ( !tif )
     {
-    vtkErrorMacro("Problem writing trailer.");
+    vtkErrorMacro("Problem writting trailer.");
     this->SetErrorCode(vtkErrorCode::FileFormatError);
     }
-
+  TIFFClose(tif);
   this->TIFFPtr = 0;
 }
 
diff --git a/IO/Image/vtkTIFFWriter.h b/IO/Image/vtkTIFFWriter.h
index cb94c29..35d44e9 100644
--- a/IO/Image/vtkTIFFWriter.h
+++ b/IO/Image/vtkTIFFWriter.h
@@ -34,10 +34,6 @@ public:
   vtkTypeMacro(vtkTIFFWriter,vtkImageWriter);
   virtual void PrintSelf(ostream& os, vtkIndent indent);
 
-  // Description:
-  // The main interface which triggers the writer to start.
-  virtual void Write();
-
 //BTX
   enum { // Compression types
     NoCompression,
@@ -69,17 +65,10 @@ protected:
 
   void* TIFFPtr;
   int Compression;
-  int Width;
-  int Height;
-  int Pages;
-  double XResolution;
-  double YResolution;
 
 private:
   vtkTIFFWriter(const vtkTIFFWriter&);  // Not implemented.
   void operator=(const vtkTIFFWriter&);  // Not implemented.
-
-  template<typename T> void WriteVolume(T *buffer);
 };
 
 #endif
diff --git a/IO/Image/vtkVolume16Reader.cxx b/IO/Image/vtkVolume16Reader.cxx
index 50b9acf..8ebf80d 100644
--- a/IO/Image/vtkVolume16Reader.cxx
+++ b/IO/Image/vtkVolume16Reader.cxx
@@ -275,7 +275,7 @@ void vtkVolume16Reader::ReadImage(int sliceNumber,
   unsigned short *pixels;
   FILE *fp;
   int numPts;
-  char filename[VTK_MAXPATH];
+  char filename[1024];
 
   // build the file name. if there is no prefix, just use the slice number
   if (this->FilePrefix)
@@ -318,7 +318,7 @@ void vtkVolume16Reader::ReadVolume(int first, int last,
   int fileNumber;
   int status;
   int numberSlices = last - first + 1;
-  char filename[VTK_MAXPATH];
+  char filename[1024];
   int dimensions[3];
   int bounds[6];
 
diff --git a/IO/Import/CMakeLists.txt b/IO/Import/CMakeLists.txt
index b8e28f7..fc00885 100644
--- a/IO/Import/CMakeLists.txt
+++ b/IO/Import/CMakeLists.txt
@@ -2,8 +2,6 @@ set(Module_SRCS
   vtk3DSImporter.cxx
   vtkImporter.cxx
   vtkVRMLImporter.cxx
-  vtkOBJImporter.cxx
-  vtkOBJImporterInternals.cxx
 )
 
 set_source_files_properties(
@@ -11,9 +9,4 @@ set_source_files_properties(
   ABSTRACT
   )
 
-set_source_files_properties(
-  vtkOBJImporterInternals
-  WRAP_EXCLUDE
-  )
-
 vtk_module_library(vtkIOImport ${Module_SRCS})
diff --git a/IO/Import/Testing/Cxx/CMakeLists.txt b/IO/Import/Testing/Cxx/CMakeLists.txt
index fd36d5c..9e98d31 100644
--- a/IO/Import/Testing/Cxx/CMakeLists.txt
+++ b/IO/Import/Testing/Cxx/CMakeLists.txt
@@ -1,35 +1,5 @@
-
-set(TestOBJImporter_ARGS -D DATA{../Data/Input/boxes_1.obj}  DATA{../Data/Input/boxes_1.obj.mtl}
-                            DATA{../Data/Input/flare.jpg}  DATA{../Data/Input/map1024.png})
-
 vtk_add_test_cxx(${vtk-module}CxxTests tests
-  TestOBJImporter.cxx,NO_VALID,NO_OUTPUT
   TestVRMLNormals.cxx
   TestVRMLImporter.cxx,NO_VALID
   )
-
-
-ExternalData_add_test(VTKData
-  NAME ${vtk-module}Cxx-OBJImport-MixedOrder1
-  COMMAND ${vtk-module}CxxTests TestOBJImporter
-    -D DATA{../Data/Input/boxes_2.obj}  DATA{../Data/Input/boxes_2.obj.mtl}
-       DATA{../Data/Input/flare.jpg}    DATA{../Data/Input/map1024.png}
-    -D " ${VTK_TEST_OUTPUT_DIR} "
-  )
-
-ExternalData_add_test(VTKData
-  NAME ${vtk-module}Cxx-OBJImport-NoMTL
-  COMMAND ${vtk-module}CxxTests TestOBJImporter
-    -D DATA{../Data/Input/boxes_3_no_mtl.obj}
-    -D " ${VTK_TEST_OUTPUT_DIR} "
-  )
-
-ExternalData_add_test(VTKData
-  NAME ${vtk-module}Cxx-OBJImport-MTLwithoutTextureFile
-  COMMAND ${vtk-module}CxxTests TestOBJImporter
-    -D DATA{../Data/Input/boxes_4_mtl_no_texture.obj}  DATA{../Data/Input/boxes_4_mtl_no_texture.obj.mtl}
-    -D " ${VTK_TEST_OUTPUT_DIR} "
-  )
-
-
 vtk_test_cxx_executable(${vtk-module}CxxTests tests)
diff --git a/IO/Import/Testing/Cxx/TestOBJImporter.cxx b/IO/Import/Testing/Cxx/TestOBJImporter.cxx
deleted file mode 100644
index 875bff1..0000000
--- a/IO/Import/Testing/Cxx/TestOBJImporter.cxx
+++ /dev/null
@@ -1,99 +0,0 @@
-
-#include "vtkVRMLImporter.h"
-#include "vtkRenderer.h"
-#include "vtkRenderWindow.h"
-#include "vtkRenderWindowInteractor.h"
-#include "vtkOBJImporter.h"
-#include "vtkTestUtilities.h"
-#include "vtkNew.h"
-#include "vtkJPEGWriter.h"
-#include "vtkPNGWriter.h"
-#include "vtkImageCanvasSource2D.h"
-#include "vtkImageCast.h"
-
-#include "vtkTestUtilities.h"
-#include "vtksys/SystemTools.hxx"
-
-namespace
-{
-int s_interactive = 0;
-
-bool bInteractive()
-{
-    return (s_interactive>0);
-}
-
-}
-
-int TestOBJImporter( int argc, char * argv [] )
-{
-    // Files for testing demonstrate updated functionality for OBJ import:
-    //       polydata + textures + actor properties all get loaded.
-
-    if(argc < (5))
-    {
-      std::cerr<<"expected TestName -D  File1.obj [File2.obj.mtl]  [texture1]  [texture2]  ... "<<std::endl;
-      return -1;
-    }
-
-    std::string filenameOBJ(argv[2]);
-
-    std::string filenameMTL,texfile1,texfile2;
-
-    if(argc >= 6)
-      filenameMTL = argv[3];
-
-    if(argc >= 7)
-      texfile1 = argv[4];
-
-    if(argc >= 8)
-      texfile2 = argv[5];
-
-    std::vector<std::string> tmp1,tmp2;
-    std::string texture_path1 = vtksys::SystemTools::GetFilenamePath(texfile1);
-    std::string texture_path2 = vtksys::SystemTools::GetFilenamePath(texfile2);
-    if( 0 != texture_path1.compare(texture_path2) )
-    {
-      std::cerr<<" texture files should be in the same path: "<<texture_path1<<std::endl;
-      return -2;
-    }
-
-    int lastArg = (argc <= 8) ? (argc-1) : 7;
-    std::string tmppath(argv[lastArg]);
-    vtkNew<vtkOBJImporter> importer;
-
-
-    if(argc > 8)
-    {
-      s_interactive = 1;
-      importer->DebugOn();
-    }
-
-    importer->SetFileName(filenameOBJ.data());
-    importer->SetFileNameMTL(filenameMTL.data());
-    importer->SetTexturePath(texture_path1.data());
-
-    vtkNew<vtkRenderer> ren;
-    vtkNew<vtkRenderWindow> renWin;
-    vtkNew<vtkRenderWindowInteractor> iren;
-
-    renWin->AddRenderer(ren.Get());
-    iren->SetRenderWindow(renWin.Get());
-    importer->SetRenderWindow(renWin.Get());
-    importer->Update();
-
-    ren->ResetCamera();
-
-    if( 1 > ren->GetActors()->GetNumberOfItems() )
-    {
-      std::cerr << "failed to get an actor created?!" << std::endl;
-      return -1;
-    }
-    if( bInteractive() )
-    {
-        renWin->SetSize(800,600);
-        renWin->SetAAFrames(3);
-        iren->Start();
-    }
-    return 0;
-}
diff --git a/IO/Import/Testing/Data/Input/boxes_1.obj.md5 b/IO/Import/Testing/Data/Input/boxes_1.obj.md5
deleted file mode 100644
index 19e1394..0000000
--- a/IO/Import/Testing/Data/Input/boxes_1.obj.md5
+++ /dev/null
@@ -1 +0,0 @@
-89896d9993f03d079b1fc5ecfd773b81
diff --git a/IO/Import/Testing/Data/Input/boxes_1.obj.mtl.md5 b/IO/Import/Testing/Data/Input/boxes_1.obj.mtl.md5
deleted file mode 100644
index b24bf34..0000000
--- a/IO/Import/Testing/Data/Input/boxes_1.obj.mtl.md5
+++ /dev/null
@@ -1 +0,0 @@
-18507267e4fa4fd51cc51c9fd9bd6cfe
diff --git a/IO/Import/Testing/Data/Input/boxes_2.obj.md5 b/IO/Import/Testing/Data/Input/boxes_2.obj.md5
deleted file mode 100644
index d4b2053..0000000
--- a/IO/Import/Testing/Data/Input/boxes_2.obj.md5
+++ /dev/null
@@ -1 +0,0 @@
-894362cb570ee5827c331f9da544cc6f
diff --git a/IO/Import/Testing/Data/Input/boxes_2.obj.mtl.md5 b/IO/Import/Testing/Data/Input/boxes_2.obj.mtl.md5
deleted file mode 100644
index 26b1ced..0000000
--- a/IO/Import/Testing/Data/Input/boxes_2.obj.mtl.md5
+++ /dev/null
@@ -1 +0,0 @@
-56db4b694c5ff726a0b6a6d6d7603a4a
diff --git a/IO/Import/Testing/Data/Input/boxes_3_no_mtl.obj.md5 b/IO/Import/Testing/Data/Input/boxes_3_no_mtl.obj.md5
deleted file mode 100644
index c8d7011..0000000
--- a/IO/Import/Testing/Data/Input/boxes_3_no_mtl.obj.md5
+++ /dev/null
@@ -1 +0,0 @@
-09c800e0d5ccba578e33734e775b758b
diff --git a/IO/Import/Testing/Data/Input/boxes_4_mtl_no_texture.obj.md5 b/IO/Import/Testing/Data/Input/boxes_4_mtl_no_texture.obj.md5
deleted file mode 100644
index 19e1394..0000000
--- a/IO/Import/Testing/Data/Input/boxes_4_mtl_no_texture.obj.md5
+++ /dev/null
@@ -1 +0,0 @@
-89896d9993f03d079b1fc5ecfd773b81
diff --git a/IO/Import/Testing/Data/Input/boxes_4_mtl_no_texture.obj.mtl.md5 b/IO/Import/Testing/Data/Input/boxes_4_mtl_no_texture.obj.mtl.md5
deleted file mode 100644
index 509fd8a..0000000
--- a/IO/Import/Testing/Data/Input/boxes_4_mtl_no_texture.obj.mtl.md5
+++ /dev/null
@@ -1 +0,0 @@
-2b2094871bfdcc65ab0b08ef65e92085
diff --git a/IO/Import/Testing/Data/Input/flare.jpg.md5 b/IO/Import/Testing/Data/Input/flare.jpg.md5
deleted file mode 100644
index 637db2c..0000000
--- a/IO/Import/Testing/Data/Input/flare.jpg.md5
+++ /dev/null
@@ -1 +0,0 @@
-2ef84c9bc39cc54310632f9372090b17
diff --git a/IO/Import/Testing/Data/Input/map1024.png.md5 b/IO/Import/Testing/Data/Input/map1024.png.md5
deleted file mode 100644
index 9ec872c..0000000
--- a/IO/Import/Testing/Data/Input/map1024.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-a1c3fa2c72f23fa38ecb620b3150cf47
diff --git a/IO/Import/module.cmake b/IO/Import/module.cmake
index f8413a3..f835f33 100644
--- a/IO/Import/module.cmake
+++ b/IO/Import/module.cmake
@@ -4,13 +4,10 @@ vtk_module(vtkIOImport
   DEPENDS
     vtkCommonCore
     vtkRenderingCore
-    vtksys
   PRIVATE_DEPENDS
     vtkFiltersSources
-    vtkIOImage
   TEST_DEPENDS
     vtkRendering${VTK_RENDERING_BACKEND}
     vtkTestingRendering
-    vtkImagingSources
     vtkInteractionStyle
   )
diff --git a/IO/Import/vtk3DSImporter.cxx b/IO/Import/vtk3DSImporter.cxx
index 2f623ab..9fbb2e6 100644
--- a/IO/Import/vtk3DSImporter.cxx
+++ b/IO/Import/vtk3DSImporter.cxx
@@ -39,11 +39,11 @@ vtkStandardNewMacro(vtk3DSImporter);
 #pragma GCC diagnostic ignored "-Wstrict-aliasing"
 #endif
 
-static vtk3DSColour Black = {0.0f, 0.0f, 0.0f};
+static vtk3DSColour Black = {0.0, 0.0, 0.0};
 static char   obj_name[80] = "";
-static vtk3DSColour fog_colour = {0.0f, 0.0f, 0.0f};
-static vtk3DSColour col        = {0.0f, 0.0f, 0.0f};
-static vtk3DSColour global_amb = {0.1f, 0.1f, 0.1f};
+static vtk3DSColour fog_colour = {0.0, 0.0, 0.0};
+static vtk3DSColour col        = {0.0, 0.0, 0.0};
+static vtk3DSColour global_amb = {0.1, 0.1, 0.1};
 static vtk3DSVector pos        = {0.0, 0.0, 0.0};
 static vtk3DSVector target     = {0.0, 0.0, 0.0};
 static float  hotspot = -1;
diff --git a/IO/Import/vtkOBJImporter.cxx b/IO/Import/vtkOBJImporter.cxx
deleted file mode 100644
index f2edd92..0000000
--- a/IO/Import/vtkOBJImporter.cxx
+++ /dev/null
@@ -1,986 +0,0 @@
-/*=========================================================================
-  Program:   Visualization Toolkit
-  Module:    vtkOBJImporter.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 "vtkOBJImporter.h"
-
-#include "vtkActor.h"
-#include "vtkCellArray.h"
-#include "vtkFloatArray.h"
-#include "vtkInformation.h"
-#include "vtkInformationVector.h"
-#include "vtkObjectFactory.h"
-#include "vtkPointData.h"
-#include "vtkPoints.h"
-#include "vtkPolyData.h"
-#include "vtkPolyDataMapper.h"
-#include "vtkProperty.h"
-#include "vtkRenderWindow.h"
-#include "vtkRenderer.h"
-#include "vtkSmartPointer.h"
-#include "vtksys/SystemTools.hxx"
-
-#include <ctype.h>
-#include <cstdio>
-#include <list>
-#include <set>
-#include <map>
-#include <memory>
-#include "vtkOBJImporterInternals.h"
-
-#if defined(_WIN32)
-  #pragma warning(disable : 4267)
-#endif
-
-vtkStandardNewMacro(vtkOBJImporter)
-vtkStandardNewMacro(vtkOBJPolyDataProcessor)
-
-//----------------------------------------------------------------------------
-  vtkOBJImporter::vtkOBJImporter()
-{
-  this->Impl = vtkSmartPointer<vtkOBJPolyDataProcessor>::New();
-}
-
-//----------------------------------------------------------------------------
-vtkOBJImporter::~vtkOBJImporter()
-{
-}
-
-int CanReadFile( vtkObject* that, const std::string& fname )
-{
-  FILE* fileFD = fopen (fname.c_str(), "rb");
-  if (fileFD == NULL)
-    {
-    vtkErrorWithObjectMacro(that,<< "Unable to open file: "<< fname.c_str());
-    return 0;
-    }
-  fclose(fileFD);
-  return 1;
-}
-
-int vtkOBJImporter::ImportBegin()
-{
-  if (!CanReadFile(this, this->GetFileName()))
-    {
-    return 0;
-    }
-  if( !std::string(GetFileNameMTL()).empty() && !CanReadFile(this,this->GetFileNameMTL()))
-    {
-      return 0;
-    }
-  return 1;
-}
-
-//----------------------------------------------------------------------------
-void vtkOBJImporter::ImportEnd()
-{
-  vtkDebugMacro("Done with "<<this->GetClassName()<<"::"<<__FUNCTION__);
-}
-
-//----------------------------------------------------------------------------
-void vtkOBJImporter::ReadData()
-{
-  this->Impl->Update();
-  if (Impl->GetSuccessParsingFiles())
-    {
-    bindTexturedPolydataToRenderWindow(this->RenderWindow,this->Renderer,Impl.Get());
-    }
-}
-
-//----------------------------------------------------------------------------
-void vtkOBJImporter::PrintSelf(std::ostream &os, vtkIndent indent)
-{
-  vtkImporter::PrintSelf(os,indent);
-}
-
-void vtkOBJImporter::SetFileName(const char *arg)
-{
-  this->Impl->SetFileName(arg);
-}
-
-void vtkOBJImporter::SetFileNameMTL(const char *arg)
-{
-  this->Impl->SetMTLfileName(arg);
-}
-
-void vtkOBJImporter::SetTexturePath(const char *path)
-{
-  return this->Impl->SetTexturePath(path);
-}
-
-const char* vtkOBJImporter::GetFileName() const
-{
-  return this->Impl->GetFileName().data();
-}
-
-const char* vtkOBJImporter::GetFileNameMTL() const
-{
-  return this->Impl->GetMTLFileName().data();
-}
-
-const char* vtkOBJImporter::GetTexturePath( ) const
-{
-  return this->Impl->GetTexturePath().data();
-}
-
-///////////////////////////////////////////
-
-
-struct vtkOBJImportedPolyDataWithMaterial
-{
-  ~vtkOBJImportedPolyDataWithMaterial()
-  {
-    delete mtlProperties;
-  }
-  vtkOBJImportedPolyDataWithMaterial()
-  { // initialize some structures to store the file contents in
-    points            = vtkSmartPointer<vtkPoints>::New();
-    tcoords           = vtkSmartPointer<vtkFloatArray>::New();
-    normals           = vtkSmartPointer<vtkFloatArray>::New();
-    polys             = vtkSmartPointer<vtkCellArray>::New();
-    tcoord_polys      = vtkSmartPointer<vtkCellArray>::New();
-    pointElems        = vtkSmartPointer<vtkCellArray>::New();
-    lineElems         = vtkSmartPointer<vtkCellArray>::New();
-    normal_polys      = vtkSmartPointer<vtkCellArray>::New();
-    tcoords->SetNumberOfComponents(2);
-    normals->SetNumberOfComponents(3);
-
-    materialName  = "";
-    mtlProperties = new vtkOBJImportedMaterial;
-    obj_set_material_defaults( mtlProperties );
-  }
-
-  // these can be shared
-  vtkSmartPointer<vtkPoints> points          ;
-  vtkSmartPointer<vtkFloatArray> normals     ;
-
-  void SetSharedPoints( vtkSmartPointer<vtkPoints> arg )
-  {
-    points = arg;
-  }
-  void SetSharedNormals( vtkSmartPointer<vtkFloatArray> arg )
-  {
-    normals = arg;
-  }
-
-  // these are unique per entity
-  vtkSmartPointer<vtkFloatArray> tcoords     ;
-  vtkSmartPointer<vtkCellArray> polys        ;
-  vtkSmartPointer<vtkCellArray> tcoord_polys ;
-  vtkSmartPointer<vtkCellArray> pointElems   ;
-  vtkSmartPointer<vtkCellArray> lineElems    ;
-  vtkSmartPointer<vtkCellArray> normal_polys ;
-
-  typedef std::map<std::string,vtkOBJImportedPolyDataWithMaterial*> NamedMaterials;
-  std::string    materialName;
-  vtkOBJImportedMaterial*  mtlProperties;
-};
-
-//----------------------------------------------------------------------------
-vtkOBJPolyDataProcessor::vtkOBJPolyDataProcessor()
-{
-  // Instantiate object with NULL filename, and no materials yet loaded.
-  this->FileName    = "";
-  this->MTLFileName = "";
-  this->TexturePath = ".";
-  this->VertexScale = 1.0;
-  this->SuccessParsingFiles = 1;
-  this->SetNumberOfInputPorts(0);
-  /** multi-poly-data paradigm: pivot based on named materials */
-  vtkOBJImportedPolyDataWithMaterial* default_poly = (new vtkOBJImportedPolyDataWithMaterial);
-  poly_list.push_back(default_poly);
-  this->SetNumberOfOutputPorts(poly_list.size());
-}
-
-//----------------------------------------------------------------------------
-vtkOBJPolyDataProcessor::~vtkOBJPolyDataProcessor()
-{
-  for( size_t k = 0; k < poly_list.size(); ++k)
-    {
-    if (poly_list[k]->mtlProperties)
-      {
-      delete poly_list[k]->mtlProperties;
-      poly_list[k]->mtlProperties = NULL;
-      }
-    delete poly_list[k];
-    poly_list[k] = NULL;
-    }
-}
-
-//----------------------------------------------------------------------------
-vtkOBJImportedMaterial*  vtkOBJPolyDataProcessor::GetMaterial(int k)
-{
-  vtkOBJImportedPolyDataWithMaterial*  rpdmm = this->poly_list[k];
-  return rpdmm->mtlProperties;
-}
-
-//----------------------------------------------------------------------------
-std::string vtkOBJPolyDataProcessor::GetTextureFilename( int idx )
-{
-  std::vector<std::string> path_and_filename(2);
-  path_and_filename[0] = this->TexturePath;
-  path_and_filename[1] = outVector_of_textureFilnames[idx];
-  std::string joined   = vtksys::SystemTools::JoinPath( path_and_filename );
-  return  joined;
-}
-
-
-// intialise some structures to store the file contents in
-
-
-/*---------------------------------------------------------------------------*\
-
-This is only partial support for the OBJ format, which is quite complicated.
-To find a full specification, search the net for "OBJ format", eg.:
-
-    http://en.wikipedia.org/wiki/Obj
-    http://netghost.narod.ru/gff/graphics/summary/waveobj.htm
-
-We support the following types:
-
-v <x> <y> <z>
-
-    vertex
-
-vn <x> <y> <z>
-
-    vertex normal
-
-vt <x> <y>
-
-    texture coordinate
-
-f <v_a> <v_b> <v_c> ...
-
-    polygonal face linking vertices v_a, v_b, v_c, etc. which
-    are 1-based indices into the vertex list
-
-f <v_a>/<t_a> <v_b>/<t_b> ...
-
-    polygonal face as above, but with texture coordinates for
-    each vertex. t_a etc. are 1-based indices into the texture
-    coordinates list (from the vt lines)
-
-f <v_a>/<t_a>/<n_a> <v_b>/<t_b>/<n_b> ...
-
-    polygonal face as above, with a normal at each vertex, as a
-    1-based index into the normals list (from the vn lines)
-
-f <v_a>//<n_a> <v_b>//<n_b> ...
-
-    polygonal face as above but without texture coordinates.
-
-    Per-face tcoords and normals are supported by duplicating
-    the vertices on each face as necessary.
-
-l <v_a> <v_b> ...
-
-    lines linking vertices v_a, v_b, etc. which are 1-based
-    indices into the vertex list
-
-p <v_a> <v_b> ...
-
-    points located at the vertices v_a, v_b, etc. which are 1-based
-    indices into the vertex list
-
-\*---------------------------------------------------------------------------*/
-
-//----------------------------------------------------------------------------
-int vtkOBJPolyDataProcessor::RequestData(
-  vtkInformation *vtkNotUsed(request),
-  vtkInformationVector **vtkNotUsed(inputVector),
-  vtkInformationVector *vtkNotUsed(outputVector))
-{
-
-  if (this->FileName.empty())
-    {
-    vtkErrorMacro(<< "A FileName must be specified.");
-    return 0;
-    }
-
-  FILE *in = fopen(this->FileName.c_str(),"r");
-  if (in == NULL)
-    {
-    vtkErrorMacro(<< "File " << this->FileName << " not found");
-    return 0;
-    }
-
-  vtkDebugMacro(<<"Reading file" << this->FileName);
-
-  vtkOBJImportedPolyDataWithMaterial::NamedMaterials known_materials; // std::stringto ptr map
-
-  int mtlParseResult;
-  std::vector<vtkOBJImportedMaterial*>  parsedMTLs = ParseOBJandMTL(MTLFileName,mtlParseResult);
-  if(parsedMTLs.empty())
-    { // construct a default material to define the single polydata's actor.
-    parsedMTLs.push_back( new vtkOBJImportedMaterial );
-    }
-
-  vtkDebugMacro("vtkOBJPolyDataProcessor parsed "   << parsedMTLs.size()
-                << " materials from "   << MTLFileName);
-
-  vtkSmartPointer<vtkPoints>     shared_vertexs = vtkSmartPointer<vtkPoints>::New();
-  vtkSmartPointer<vtkFloatArray> shared_normals = vtkSmartPointer<vtkFloatArray>::New();
-  shared_normals->SetNumberOfComponents(3);
-
-  std::map<std::string,vtkOBJImportedPolyDataWithMaterial*>  mtlName_to_Actor;
-
-  {
-  // Since we read the MTL file, we already know how many actors we need.
-  // So, pre-allocate instead of trying to do it on the fly.
-  if(!parsedMTLs.empty())
-    {
-    while(poly_list.size() != parsedMTLs.size() )
-      {
-      vtkOBJImportedPolyDataWithMaterial*  newMaterial = new vtkOBJImportedPolyDataWithMaterial;
-      newMaterial->SetSharedPoints(shared_vertexs);
-      newMaterial->SetSharedNormals(shared_normals);
-      poly_list.push_back(newMaterial);
-      }
-    }
-  for( size_t k = 0; k<parsedMTLs.size(); ++k )
-    {
-    std::string mtlname_k(parsedMTLs[k]->name);
-    poly_list[k]->materialName = mtlname_k;
-    if (poly_list[k]->mtlProperties)
-      {
-      delete poly_list[k]->mtlProperties;
-      }
-    poly_list[k]->mtlProperties= parsedMTLs[k];
-    mtlName_to_mtlData[mtlname_k] = parsedMTLs[k];
-    mtlName_to_Actor[mtlname_k]   = poly_list[k];
-    }
-  }
-
-  vtkPoints* points           = poly_list.back()->points;
-  vtkFloatArray* tcoords      = poly_list.back()->tcoords;
-  vtkFloatArray* normals      = poly_list.back()->normals;
-  vtkCellArray* polys         = poly_list.back()->polys;
-  vtkCellArray* tcoord_polys  = poly_list.back()->tcoord_polys;
-  vtkCellArray* pointElems    = poly_list.back()->pointElems;
-  vtkCellArray* lineElems     = poly_list.back()->lineElems;
-  vtkCellArray* normal_polys  = poly_list.back()->normal_polys;
-
-  outVector_of_textureFilnames.resize( parsedMTLs.size() );
-  for( int i = 0; i < (int)parsedMTLs.size(); ++i )
-    {
-    std::string mtlname     = parsedMTLs[i]->name;
-    std::string texfilename = parsedMTLs[i]->texture_filename;
-    outVector_of_textureFilnames[i] = texfilename;
-    mtlName_to_mtlData[mtlname] = parsedMTLs[i];
-    vtkDebugMacro("out texture name: " << outVector_of_textureFilnames[i]);
-    }
-
-  bool gotFirstUseMaterialTag = false;
-
-  int numPolysWithTCoords = 0;
-  bool hasTCoords = false;
-  bool hasNormals = false;
-  bool tcoords_same_as_verts = true;
-  bool normals_same_as_verts = true;
-  bool everything_ok = true; // (use of this flag avoids early return and associated memory leak)
-  const double v_scale   = this->VertexScale;
-  const bool   use_scale = (fabs(v_scale-1.0) > 1e-3 ) ;
-
-  // -- work through the file line by line, assigning into the above 7 structures as appropriate --
-  { // (make a local scope section to emphasise that the variables below are only used here)
-
-  const int MAX_LINE = 4096;
-  char rawLine[MAX_LINE];
-  float xyz[3];
-
-  int lineNr = 0;
-  while (everything_ok && fgets(rawLine, MAX_LINE, in) != NULL)
-    { /** While OK and there is another line in the file */
-    lineNr++;
-    char *pLine = rawLine;
-    char *pEnd = rawLine + strlen(rawLine);
-
-    // find the first non-whitespace character
-    while (isspace(*pLine) && pLine < pEnd)
-      {
-      pLine++;
-      }
-
-    // this first non-whitespace is the command
-    const char *cmd = pLine;
-
-    // skip over non-whitespace
-    while (!isspace(*pLine) && pLine < pEnd)
-      {
-      pLine++;
-      }
-
-    // terminate command
-    if (pLine < pEnd)
-      {
-      *pLine = '\0';
-      pLine++;
-      }
-
-    // in the OBJ format the first characters determine how to interpret the line:
-    if (strcmp(cmd, "v") == 0)
-      {
-      // this is a vertex definition, expect three floats, separated by whitespace:
-      if (sscanf(pLine, "%f %f %f", xyz, xyz+1, xyz+2) == 3)
-        {
-        if ( use_scale )
-          {
-          xyz[0] *= v_scale; xyz[1] *= v_scale; xyz[2] *= v_scale;
-          }
-        points->InsertNextPoint(xyz);
-        }
-      else
-        {
-        vtkErrorMacro(<<"Error reading 'v' at line " << lineNr);
-        everything_ok = false;
-        }
-      if ( gotFirstUseMaterialTag && this->GetDebug() )
-        {
-        vtkWarningMacro("attempting to add vertices after usemtl ... ");
-        }
-      }
-    else if (strcmp(cmd, "vt") == 0) /** Texture Coord, whango! */
-      {
-      // this is a tcoord, expect two floats, separated by whitespace:
-      if (sscanf(pLine, "%f %f", xyz, xyz+1) == 2)
-        {
-        tcoords->InsertNextTuple(xyz);
-        }
-      else
-        {
-        vtkErrorMacro(<<"Error reading 'vt' at line " << lineNr);
-        everything_ok = false;
-        }
-      }
-    else if (strcmp(cmd, "vn") == 0)
-      {
-      // this is a normal, expect three floats, separated by whitespace:
-      if (sscanf(pLine, "%f %f %f", xyz, xyz+1, xyz+2) == 3)
-        {
-        normals->InsertNextTuple(xyz);
-        hasNormals = true;
-        }
-      else
-        {
-        vtkErrorMacro(<<"Error reading 'vn' at line " << lineNr);
-        everything_ok = false;
-        }
-      }
-    else if (strcmp(cmd, "p") == 0)
-      {
-      // this is a point definition, consisting of 1-based indices separated by whitespace and /
-      pointElems->InsertNextCell(0); // we don't yet know how many points are to come
-
-      int nVerts=0; // keep a count of how many there are
-
-      while (everything_ok && pLine < pEnd)
-        {
-        // find next non-whitespace character
-        while (isspace(*pLine) && pLine < pEnd)
-          {
-          pLine++;
-          }
-
-        if (pLine < pEnd)         // there is still data left on this line
-          {
-          int iVert;
-          if (sscanf(pLine, "%d", &iVert) == 1)
-            {
-            pointElems->InsertCellPoint(iVert-1);
-            nVerts++;
-            }
-          else if (strcmp(pLine, "\\\n") == 0)
-            {
-            // handle backslash-newline continuation
-            if (fgets(rawLine, MAX_LINE, in) != NULL)
-              {
-              lineNr++;
-              pLine = rawLine;
-              pEnd = rawLine + strlen(rawLine);
-              continue;
-              }
-            else
-              {
-              vtkErrorMacro(<<"Error reading continuation line at line " << lineNr);
-              everything_ok = false;
-              }
-            }
-          else
-            {
-            vtkErrorMacro(<<"Error reading 'p' at line " << lineNr);
-            everything_ok = false;
-            }
-          // skip over what we just sscanf'd
-          // (find the first whitespace character)
-          while (!isspace(*pLine) && pLine < pEnd)
-            {
-            pLine++;
-            }
-          }
-        }
-
-      if (nVerts < 1)
-        {
-        vtkErrorMacro
-          (
-            <<"Error reading file near line " << lineNr
-            << " while processing the 'p' command"
-            );
-        everything_ok = false;
-        }
-
-      // now we know how many points there were in this cell
-      pointElems->UpdateCellCount(nVerts);
-      }
-    else if (strcmp(cmd, "l") == 0)
-      {
-      // this is a line definition, consisting of 1-based indices separated by whitespace and /
-      lineElems->InsertNextCell(0); // we don't yet know how many points are to come
-
-      int nVerts=0; // keep a count of how many there are
-
-      while (everything_ok && pLine < pEnd)
-        {
-        // find next non-whitespace character
-        while (isspace(*pLine) && pLine < pEnd)
-          {
-          pLine++;
-          }
-
-        if (pLine < pEnd)         // there is still data left on this line
-          {
-          int iVert, dummyInt;
-          if (sscanf(pLine, "%d/%d", &iVert, &dummyInt) == 2)
-            {
-            // we simply ignore texture information
-            lineElems->InsertCellPoint(iVert-1);
-            nVerts++;
-            }
-          else if (sscanf(pLine, "%d", &iVert) == 1)
-            {
-            lineElems->InsertCellPoint(iVert-1);
-            nVerts++;
-            }
-          else if (strcmp(pLine, "\\\n") == 0)
-            {
-            // handle backslash-newline continuation
-            if (fgets(rawLine, MAX_LINE, in) != NULL)
-              {
-              lineNr++;
-              pLine = rawLine;
-              pEnd = rawLine + strlen(rawLine);
-              continue;
-              }
-            else
-              {
-              vtkErrorMacro(<<"Error reading continuation line at line " << lineNr);
-              everything_ok = false;
-              }
-            }
-          else
-            {
-            vtkErrorMacro(<<"Error reading 'l' at line " << lineNr);
-            everything_ok = false;
-            }
-          // skip over what we just sscanf'd
-          // (find the first whitespace character)
-          while (!isspace(*pLine) && pLine < pEnd)
-            {
-            pLine++;
-            }
-          }
-        }
-
-      if (nVerts < 2)
-        {
-        vtkErrorMacro
-          (
-            <<"Error reading file near line " << lineNr
-            << " while processing the 'l' command"
-            );
-        everything_ok = false;
-        }
-
-      // now we know how many points there were in this cell
-      lineElems->UpdateCellCount(nVerts);
-      }
-    else if (strcmp(cmd, "f") == 0)
-      {
-      // this is a face definition, consisting of 1-based indices separated by whitespace and /
-
-      polys->InsertNextCell(0); // we don't yet know how many points are to come
-      tcoord_polys->InsertNextCell(0);
-      normal_polys->InsertNextCell(0);
-
-      int nVerts=0, nTCoords=0, nNormals=0; // keep a count of how many of each there are
-
-      while (everything_ok && pLine < pEnd)
-        {
-        // find the first non-whitespace character
-        while (isspace(*pLine) && pLine < pEnd)
-          {
-          pLine++;
-          }
-
-        if (pLine < pEnd)         // there is still data left on this line
-          {
-          int iVert,iTCoord,iNormal;
-          if (sscanf(pLine, "%d/%d/%d", &iVert, &iTCoord, &iNormal) == 3)
-            {
-            polys->InsertCellPoint(iVert-1); // convert to 0-based index
-            nVerts++;
-            tcoord_polys->InsertCellPoint(iTCoord-1);
-            nTCoords++;
-            normal_polys->InsertCellPoint(iNormal-1);
-            nNormals++;
-            if (iTCoord != iVert)
-              tcoords_same_as_verts = false;
-            if (iNormal != iVert)
-              normals_same_as_verts = false;
-            }
-          else if (sscanf(pLine, "%d//%d", &iVert, &iNormal) == 2)
-            {
-            polys->InsertCellPoint(iVert-1);
-            nVerts++;
-            normal_polys->InsertCellPoint(iNormal-1);
-            nNormals++;
-            if (iNormal != iVert)
-              normals_same_as_verts = false;
-            }
-          else if (sscanf(pLine, "%d/%d", &iVert, &iTCoord) == 2)
-            {
-            polys->InsertCellPoint(iVert-1);
-            nVerts++;
-            tcoord_polys->InsertCellPoint(iTCoord-1);
-            nTCoords++;
-            if (iTCoord != iVert)
-              tcoords_same_as_verts = false;
-            }
-          else if (sscanf(pLine, "%d", &iVert) == 1)
-            {
-            polys->InsertCellPoint(iVert-1);
-            nVerts++;
-            }
-          else if (strcmp(pLine, "\\\n") == 0)
-            {
-            // handle backslash-newline continuation
-            if (fgets(rawLine, MAX_LINE, in) != NULL)
-              {
-              lineNr++;
-              pLine = rawLine;
-              pEnd = rawLine + strlen(rawLine);
-              continue;
-              }
-            else
-              {
-              vtkErrorMacro(<<"Error reading continuation line at line " << lineNr);
-              everything_ok = false;
-              }
-            }
-          else
-            {
-            vtkErrorMacro(<<"Error reading 'f' at line " << lineNr);
-            everything_ok = false;
-            }
-          // skip over what we just read
-          // (find the first whitespace character)
-          while (!isspace(*pLine) && pLine < pEnd)
-            {
-            pLine++;
-            }
-          }
-        }
-
-      // count of tcoords and normals must be equal to number of vertices or zero
-      if ( nVerts < 3 ||
-           (nTCoords > 0 && nTCoords != nVerts) ||
-           (nNormals > 0 && nNormals != nVerts)
-        )
-        {
-        vtkErrorMacro
-          (
-            <<"Error reading file near line " << lineNr
-            << " while processing the 'f' command"
-            );
-        everything_ok = false;
-        }
-
-      // now we know how many points there were in this cell
-      polys->UpdateCellCount(nVerts);
-      tcoord_polys->UpdateCellCount(nTCoords);
-      normal_polys->UpdateCellCount(nNormals);
-
-      // also make a note of whether any cells have tcoords, and whether any have normals
-      numPolysWithTCoords += (int) (nTCoords)>0;
-      if ( (!hasTCoords)&&(nTCoords > 0) )
-        {
-        vtkDebugMacro("got texture coords in obj file! nTCoords = " << nTCoords);
-        hasTCoords = true;
-        }
-      else if (nTCoords==0)
-        {
-        vtkDebugMacro("did NOT get texture coords in obj file!");
-        }
-      if (nNormals > 0)
-        {
-        hasNormals = true;
-        }
-      }
-    else if (strcmp(cmd, "usemtl") == 0)
-      {
-      std::string strLine(pLine);
-      vtkDebugMacro("strLine = " << strLine);
-      int idx = strLine.find_first_of(' ');
-      int idxNewLine = strLine.find_last_of('\n');
-      std::string a = strLine.substr(0,idx);
-      std::string mtl_name = strLine.substr(idx+1,idxNewLine);
-      vtkDebugMacro("'Use Material' command, usemtl with name: " << mtl_name);
-
-      gotFirstUseMaterialTag = true; // yep we have a usemtl command. check to make sure idiots don't try to add vertices later.
-      int mtlCount = known_materials.count(mtl_name);
-      if ( 0 == mtlCount )
-        { // new material encountered; bag and tag it, make a new named-poly-data-container
-        if ( ! mtlName_to_Actor.count(mtl_name) )
-          {
-          vtkErrorMacro(" material " << mtl_name << " appears in OBJ but not MTL file??");
-          }
-        vtkOBJImportedPolyDataWithMaterial* active = mtlName_to_Actor[mtl_name];
-        known_materials[mtl_name] = active;
-
-        vtkDebugMacro("name of material is: " << active->materialName);
-
-        /** slightly tricky: all multi-polys share the vertex, normals, and tcoords,
-                                 but define unique polygons... */
-        polys           = active->polys; // Update pointers reading file further
-        tcoord_polys    = active->tcoord_polys;
-        pointElems      = active->pointElems;
-        lineElems       = active->lineElems;
-        normal_polys    = active->normal_polys;
-        }
-    else /** This material name already exists; switch back to it! */
-      {
-      vtkOBJImportedPolyDataWithMaterial* known_mtl = known_materials[mtl_name];
-      vtkDebugMacro("switching to append faces with pre-existing material named "
-                    << known_mtl->materialName);
-      polys           = known_mtl->polys; // Update pointers reading file further
-      tcoord_polys    = known_mtl->tcoord_polys;
-      pointElems      = known_mtl->pointElems;
-      lineElems       = known_mtl->lineElems;
-      normal_polys    = known_mtl->normal_polys;
-      }
-    }
-    else
-      {
-      vtkDebugMacro(<<"Ignoring line: "<<rawLine);
-      }
-    }  /** Looping over lines of file */ // (end of while loop)
-  } // (end of local scope section)
-
-  // we have finished with the file
-  fclose(in);
-
-  if(!gotFirstUseMaterialTag)
-  {
-    known_materials[parsedMTLs[0]->name] = poly_list[0];
-  }
-
-  { /** based on how many named materials are present,
-                 set the number of output ports of vtkPolyData */
-  this->SetNumberOfOutputPorts( known_materials.size() );
-  vtkDebugMacro("vtkOBJPolyDataProcessor.cxx, set # of output ports to "
-                << known_materials.size());
-  this->outVector_of_vtkPolyData.clear();
-  for( int i = 0; i < (int)known_materials.size(); ++i)
-    {
-    vtkSmartPointer<vtkPolyData> poly_data = vtkSmartPointer<vtkPolyData>::New();
-    this->outVector_of_vtkPolyData.push_back(poly_data);
-    }
-  }
-
-  if (everything_ok)   // (otherwise just release allocated memory and return)
-    {   // -- now turn this lot into a useable vtkPolyData --
-
-    for( int outputIndex = 0; outputIndex < (int)known_materials.size(); ++outputIndex )
-      {
-      vtkSmartPointer<vtkPolyData> output = outVector_of_vtkPolyData[outputIndex];
-      polys           = poly_list[outputIndex]->polys; // Update pointers reading file further
-      tcoord_polys    = poly_list[outputIndex]->tcoord_polys;
-      pointElems      = poly_list[outputIndex]->pointElems;
-      lineElems       = poly_list[outputIndex]->lineElems;
-      normal_polys    = poly_list[outputIndex]->normal_polys;
-      vtkDebugMacro("generating output polydata ....  \n"
-                    << "tcoords same as verts!? " << tcoords_same_as_verts
-                    << " ... hasTCoords?" << hasTCoords
-                    << " ... numPolysWithTCoords = " << numPolysWithTCoords);
-      // if there are no tcoords or normals or they match exactly
-      // then we can just copy the data into the output (easy!)
-      if ((!hasTCoords || tcoords_same_as_verts) &&
-          (!hasNormals || normals_same_as_verts))
-        { // ...
-        vtkDebugMacro(<<"Copying file data into the output directly");
-
-        output->SetPoints(points);
-        if (pointElems->GetNumberOfCells())
-          {
-          output->SetVerts(pointElems);
-          }
-        if (lineElems->GetNumberOfCells())
-          {
-          output->SetLines(lineElems);
-          }
-        if (polys->GetNumberOfCells())
-          {
-          output->SetPolys(polys);
-          }
-
-        // if there is an exact correspondence between tcoords and vertices then can simply
-        // assign the tcoords points as point data
-        if (hasTCoords && tcoords_same_as_verts)
-          output->GetPointData()->SetTCoords(tcoords);
-
-        // if there is an exact correspondence between normals and vertices then can simply
-        // assign the normals as point data
-        if (hasNormals && normals_same_as_verts)
-          {
-          output->GetPointData()->SetNormals(normals);
-          }
-        output->Squeeze();
-        }
-      // otherwise we can duplicate the vertices as necessary (a bit slower)
-      else
-        {
-        vtkDebugMacro(<<"Duplicating vertices so that tcoords and normals are correct");
-        vtkPoints *new_points = vtkPoints::New();
-        vtkFloatArray *new_tcoords = vtkFloatArray::New();
-        new_tcoords->SetNumberOfComponents(2);
-        vtkFloatArray *new_normals = vtkFloatArray::New();
-        new_normals->SetNumberOfComponents(3);
-        vtkCellArray *new_polys = vtkCellArray::New();
-
-        // for each poly, copy its vertices into new_points (and point at them)
-        // also copy its tcoords into new_tcoords
-        // also copy its normals into new_normals
-        polys->InitTraversal();
-        tcoord_polys->InitTraversal();
-        normal_polys->InitTraversal();
-
-        vtkIdType dummy_warning_prevention_mechanism[1];
-        vtkIdType n_pts=-1,*pts=dummy_warning_prevention_mechanism;
-        vtkIdType n_tcoord_pts=-1,*tcoord_pts=dummy_warning_prevention_mechanism;
-        vtkIdType n_normal_pts=-1,*normal_pts=dummy_warning_prevention_mechanism;
-        for (int i = 0; i < polys->GetNumberOfCells(); ++i)
-          {
-          polys->GetNextCell(n_pts,pts);
-          tcoord_polys->GetNextCell(n_tcoord_pts,tcoord_pts);
-          normal_polys->GetNextCell(n_normal_pts,normal_pts);
-
-          // If some vertices have tcoords and not others (likewise normals)
-          // then we must do something else VTK will complain. (crash on render attempt)
-          // Easiest solution is to delete polys that don't have complete tcoords (if there
-          // are any tcoords in the dataset) or normals (if there are any normals in the dataset).
-
-          if (
-            (n_pts != n_tcoord_pts && hasTCoords) ||
-            (n_pts != n_normal_pts && hasNormals)
-            )
-            {
-            // skip this poly
-            vtkDebugMacro(<<"Skipping poly "<<i+1<<" (1-based index)");
-            }
-          else
-            {
-            // copy the corresponding points, tcoords and normals across
-            for (int j = 0; j < n_pts; ++j)
-              {
-              // copy the tcoord for this point across (if there is one)
-              if (n_tcoord_pts>0)
-                {
-                new_tcoords->InsertNextTuple(tcoords->GetTuple(tcoord_pts[j]));
-                }
-              // copy the normal for this point across (if there is one)
-              if (n_normal_pts>0)
-                {
-                new_normals->InsertNextTuple(normals->GetTuple(normal_pts[j]));
-                }
-              // copy the vertex into the new structure and update
-              // the vertex index in the polys structure (pts is a pointer into it)
-              pts[j] = new_points->InsertNextPoint(points->GetPoint(pts[j]));
-              }
-            // copy this poly (pointing at the new points) into the new polys list
-            new_polys->InsertNextCell(n_pts,pts);
-            }
-          }
-
-        // use the new structures for the output
-        output->SetPoints(new_points);
-        output->SetPolys(new_polys);
-        vtkDebugMacro(" set new points, count = "
-                      << new_points->GetNumberOfPoints() << " ...");
-        vtkDebugMacro(" set new polys, count = "
-                      << new_polys->GetNumberOfCells() << " ...");
-
-        if (hasTCoords)
-          {
-          output->GetPointData()->SetTCoords(new_tcoords);
-          vtkDebugMacro(" set new tcoords");
-          }
-        if (hasNormals)
-          {
-          output->GetPointData()->SetNormals(new_normals);
-          vtkDebugMacro(" set new normals");
-          }
-
-        // TODO: fixup for pointElems and lineElems too
-        output->Squeeze();
-
-        new_points->Delete();
-        new_polys->Delete();
-        new_tcoords->Delete();
-        new_normals->Delete();
-        }
-      }
-    }
-
-  if (!everything_ok)
-    {
-    SetSuccessParsingFiles(false);
-    }
-
-  return 1;
-}
-
-//----------------------------------------------------------------------------
-void vtkOBJPolyDataProcessor::PrintSelf(ostream& os, vtkIndent indent)
-{
-  this->Superclass::PrintSelf(os,indent);
-
-  os << indent << "FileName: "
-     << (this->FileName.empty() ? this->FileName : "(none)") << "\n";
-  os << indent << "MTLFileName: "
-     << (this->MTLFileName.empty() ? this->MTLFileName : "(none)") << "\n";
-  os << indent << "TexturePath: "
-     << (this->TexturePath.empty() ? this->TexturePath : "(none)") << "\n";
-}
-
-
-//----------------------------------------------------------------------------
-vtkPolyData* vtkOBJPolyDataProcessor::GetOutput(int idx)
-{
-  if ( idx < (int)outVector_of_vtkPolyData.size() )
-    {
-    return outVector_of_vtkPolyData[idx];
-    }
-  else
-    {
-    return NULL;
-    }
-}
diff --git a/IO/Import/vtkOBJImporter.h b/IO/Import/vtkOBJImporter.h
deleted file mode 100644
index 3e02749..0000000
--- a/IO/Import/vtkOBJImporter.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*=========================================================================
-  Program:   Visualization Toolkit
-  Module:    vtkOBJImporter.h
-  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.
-=========================================================================*/
-// .NAME vtkOBJImporter - import from .obj wavefront files
-// .SECTION Description - suports import of polydata, textures, and actors
-//                        from Wavefront .obj & associated .mtl files.
-// .SECTION Thanks - Peter Karasev (Georgia Tech / Keysight Technologies Inc),
-//                   Allen Tannenbaum (SUNY Stonybrook), Patricio Vela (Georgia Tech)
-// .SECTION See Also
-//  vtkImporter
-
-#ifndef vtkOBJImporter_h
-#define vtkOBJImporter_h
-
-#include "vtkIOImportModule.h" // For export macro
-#include "vtkSmartPointer.h"
-#include "vtkImporter.h"
-
-class vtkRenderWindow;
-class vtkRenderer;
-class vtkPolydata;
-class vtkOBJPolyDataProcessor;
-
-/** @note{updated by peter karasev, 2015 to read texture coordinates + material properties}
-    @note{An example of a supported (*).mtl file is show below.
-             Lighting values and texture images are specified, and a corresponding vtkActor
-             with properties and vtkTexture will be created upon import. }
-
-        # Wavefront material file saved from Meshlab
-        newmtl material_0
-        Ka 0.400000 0.400000 0.400000
-        Kd 0.5 0.5 0.5
-        Ks 0.85 0.9 0.9
-        illum 2
-        Ns 0.000000
-        map_Kd map1024.png
-
-        newmtl material_1
-        Ka 0.200000 0.200000 0.200000
-        Kd 0.666667 0.666667 0.666667
-        Ks 1.000000 0.9 1.000000
-        illum 2
-        Ns 0.000000
-        map_Kd flare.jpg
-
-   **/
-class VTKIOIMPORT_EXPORT vtkOBJImporter : public vtkImporter
-{
-public:
-  static vtkOBJImporter *New();
-
-  vtkTypeMacro(vtkOBJImporter,vtkImporter);
-  void PrintSelf(ostream& os, vtkIndent indent);
-
-  // Description:
-  // Specify the name of the file to read.
-  void SetFileName(const char* arg);
-  void SetFileNameMTL(const char* arg);
-  void SetTexturePath(const char* path);
-  const char* GetFileName() const;
-  const char* GetFileNameMTL() const;
-  const char* GetTexturePath() const;
-
-protected:
-  vtkOBJImporter();
-  ~vtkOBJImporter();
-
-  virtual int  ImportBegin() /*override*/;
-  virtual void ImportEnd () /*override*/;
-  virtual void ReadData() /* override */;
-
-  vtkSmartPointer<vtkOBJPolyDataProcessor>   Impl;
-
-private:
-  vtkOBJImporter(const vtkOBJImporter&);  // Not implemented.
-  void operator=(const vtkOBJImporter&);  // Not implemented.
-};
-
-
-
-#endif
-// VTK-HeaderTest-Exclude: vtkOBJImporter.h
diff --git a/IO/Import/vtkOBJImporterInternals.cxx b/IO/Import/vtkOBJImporterInternals.cxx
deleted file mode 100644
index 9e844ef..0000000
--- a/IO/Import/vtkOBJImporterInternals.cxx
+++ /dev/null
@@ -1,323 +0,0 @@
-/*=========================================================================
-  Program:   Visualization Toolkit
-  Module:    vtkOBJImporterInternals.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 "vtkSmartPointer.h"
-#include "vtkOBJImporter.h"
-#include "vtkOBJImporterInternals.h"
-#include "vtkJPEGReader.h"
-#include "vtkPNGReader.h"
-#include "vtkPolyDataMapper.h"
-#include "vtkProperty.h"
-#include "vtkRenderer.h"
-#include "vtkRenderWindow.h"
-#include "vtksys/SystemTools.hxx"
-
-#include <iostream>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <map>
-
-#if defined(_WIN32)
-#pragma warning(disable : 4267)
-#pragma warning(disable : 4800)
-#endif
-
-const int OBJ_LINE_SIZE = 4096;
-
-namespace
-{
-char strequal(const char *s1, const char *s2)
-{
-  if(strcmp(s1, s2) == 0)
-    {
-    return 1;
-    }
-  return 0;
-}
-
-int localVerbosity = 0;
-
-}
-
-void obj_set_material_defaults(vtkOBJImportedMaterial* mtl)
-{
-  mtl->amb[0] = 0.2;
-  mtl->amb[1] = 0.2;
-  mtl->amb[2] = 0.2;
-  mtl->diff[0] = 0.8;
-  mtl->diff[1] = 0.8;
-  mtl->diff[2] = 0.8;
-  mtl->spec[0] = 1.0;
-  mtl->spec[1] = 1.0;
-  mtl->spec[2] = 1.0;
-  mtl->reflect = 0.0;
-  mtl->trans = 1;
-  mtl->glossy = 98;
-  mtl->shiny = 0;
-  mtl->refract_index = 1;
-  mtl->texture_filename[0] = '\0';
-
-  if( localVerbosity > 0 )
-    {
-    vtkGenericWarningMacro("Created a default vtkOBJImportedMaterial, texture filename is "
-                           << std::string(mtl->texture_filename));
-    }
-}
-
-std::vector<vtkOBJImportedMaterial*> vtkOBJPolyDataProcessor::ParseOBJandMTL(
-  std::string Filename, int& result_code)
-{
-
-  std::vector<vtkOBJImportedMaterial*>  listOfMaterials;
-  result_code    = 0;
-  const char* filename = Filename.c_str();
-
-  int line_number = 0;
-  char *current_token;
-  char current_line[OBJ_LINE_SIZE];
-  char material_open = 0;
-  vtkOBJImportedMaterial* current_mtl = NULL;
-  FILE *mtl_file_stream;
-
-  // open scene
-  mtl_file_stream = fopen( filename, "r");
-  if(mtl_file_stream == 0)
-    {
-    vtkErrorMacro("Error reading file: " << filename);
-    result_code = -1;
-    return listOfMaterials;
-    }
-
-  while( fgets(current_line, OBJ_LINE_SIZE, mtl_file_stream) )
-    {
-    current_token = strtok( current_line, " \t\n\r");
-    line_number++;
-
-    //skip comments
-    if( current_token == NULL || strequal(current_token, "//") || strequal(current_token, "#"))
-      {
-      continue;
-      }
-
-    //start material
-    else if( strequal(current_token, "newmtl"))
-      {
-      material_open = 1;
-      current_mtl = (new vtkOBJImportedMaterial);
-      listOfMaterials.push_back(current_mtl);
-      obj_set_material_defaults(current_mtl);
-
-      // get the name
-      strncpy(current_mtl->name, strtok(NULL, " \t\n"), MATERIAL_NAME_SIZE);
-      }
-
-    //ambient
-    else if( strequal(current_token, "Ka") && material_open)
-      {
-      // But this is ... right? no?
-      current_mtl->amb[0] = atof( strtok(NULL, " \t"));
-      current_mtl->amb[1] = atof( strtok(NULL, " \t"));
-      current_mtl->amb[2] = atof( strtok(NULL, " \t"));
-      }
-
-    //diff
-    else if( strequal(current_token, "Kd") && material_open)
-      {
-      current_mtl->diff[0] = atof( strtok(NULL, " \t"));
-      current_mtl->diff[1] = atof( strtok(NULL, " \t"));
-      current_mtl->diff[2] = atof( strtok(NULL, " \t"));
-      }
-
-    //specular
-    else if( strequal(current_token, "Ks") && material_open)
-      {
-      current_mtl->spec[0] = atof( strtok(NULL, " \t"));
-      current_mtl->spec[1] = atof( strtok(NULL, " \t"));
-      current_mtl->spec[2] = atof( strtok(NULL, " \t"));
-      }
-    //shiny
-    else if( strequal(current_token, "Ns") && material_open)
-      {
-      current_mtl->shiny = atof( strtok(NULL, " \t"));
-      }
-    //transparent
-    else if( strequal(current_token, "d") && material_open)
-      {
-      current_mtl->trans = atof( strtok(NULL, " \t"));
-      }
-    //reflection
-    else if( strequal(current_token, "r") && material_open)
-      {
-      current_mtl->reflect = atof( strtok(NULL, " \t"));
-      }
-    //glossy
-    else if( strequal(current_token, "sharpness") && material_open)
-      {
-      current_mtl->glossy = atof( strtok(NULL, " \t"));
-      }
-    //refract index
-    else if( strequal(current_token, "Ni") && material_open)
-      {
-      current_mtl->refract_index = atof( strtok(NULL, " \t"));
-      }
-    // illumination type
-    else if( strequal(current_token, "illum") && material_open)
-      {
-      }
-    // texture map
-    else if( strequal(current_token, "map_Kd") && material_open)
-      {   /** (pk note: why was this map_Ka initially? should map_Ka be supported? ) */
-      strncpy(current_mtl->texture_filename, strtok(NULL, " \t\n"), OBJ_FILENAME_LENGTH);
-      bool bFileExistsNoPath    = vtksys::SystemTools::FileExists(current_mtl->texture_filename);
-      std::vector<std::string> path_and_file(2);
-      path_and_file[0]   = this->GetTexturePath();
-      path_and_file[1]   = std::string(current_mtl->texture_filename);
-      std::string joined =  vtksys::SystemTools::JoinPath(path_and_file);
-      bool bFileExistsInPath    = vtksys::SystemTools::FileExists( joined );
-      if(! (bFileExistsNoPath || bFileExistsInPath ) )
-        {
-        vtkGenericWarningMacro(
-          << "mtl file " << current_mtl->name
-          << "requests texture file that appears not to exist: "
-          << current_mtl->texture_filename << "; texture path: " <<this->TexturePath<<"\r\n");
-        }
-      }
-    else
-      {
-      // just skip it; got an unsupported feature or a comment in file.
-      vtkDebugMacro("Unknown command " << current_token
-                    << " in material file " << filename
-                    << " at line " << line_number
-                    << ":\n\t" << current_line);
-      }
-    }
-
-  fclose(mtl_file_stream);
-
-  return listOfMaterials;
-}
-
-
-void  bindTexturedPolydataToRenderWindow( vtkRenderWindow* renderWindow,
-                                          vtkRenderer* renderer,
-                                          vtkOBJPolyDataProcessor* reader )
-{
-  if( NULL == (renderWindow) )
-    {
-    vtkErrorWithObjectMacro(reader, "RenderWindow is null, failure!");
-    return;
-    }
-  if( NULL == (renderer) )
-    {
-    vtkErrorWithObjectMacro(reader, "Renderer is null, failure!");
-    return;
-    }
-  if( NULL == (reader) )
-    {
-    vtkErrorWithObjectMacro(reader, "vtkOBJPolyDataProcessor is null, failure!");
-    return;
-    }
-
-  reader->actor_list.clear();
-  reader->actor_list.reserve( reader->GetNumberOfOutputPorts() );
-
-  for( int port_idx=0; port_idx < reader->GetNumberOfOutputPorts(); port_idx++)
-    {
-    vtkPolyData* objPoly = reader->GetOutput(port_idx);
-
-    vtkSmartPointer<vtkPolyDataMapper> mapper = vtkSmartPointer<vtkPolyDataMapper>::New();
-    mapper->SetInputData(objPoly);
-
-    vtkDebugWithObjectMacro(reader, "Grabbed objPoly " << objPoly
-                            << ", port index " << port_idx << "\n"
-                            << "numPolys = " << objPoly->GetNumberOfPolys()
-                            << " numPoints = " << objPoly->GetNumberOfPoints());
-
-    // For each named material, load and bind the texture, add it to the renderer
-    vtkSmartPointer<vtkTexture> vtk_texture = vtkSmartPointer<vtkTexture>::New();
-
-    std::string textureFilename = reader->GetTextureFilename(port_idx);
-
-    vtkSmartPointer<vtkJPEGReader> tex_jpg_Loader = vtkSmartPointer<vtkJPEGReader>::New();
-    vtkSmartPointer<vtkPNGReader>  tex_png_Loader = vtkSmartPointer<vtkPNGReader>::New();
-    int bIsReadableJPEG = tex_jpg_Loader->CanReadFile( textureFilename.c_str() );
-    int bIsReadablePNG  = tex_png_Loader->CanReadFile( textureFilename.c_str() );
-
-    // TODO: what if there is no texture image? seems required now?
-    if( bIsReadableJPEG )
-      {
-      tex_jpg_Loader->SetFileName( textureFilename.c_str() );
-      tex_jpg_Loader->Update();
-      vtk_texture->AddInputConnection( tex_jpg_Loader->GetOutputPort() );
-      }
-    else if( bIsReadablePNG )
-      {
-      tex_png_Loader->SetFileName( textureFilename.c_str() );
-      tex_png_Loader->Update();
-      vtk_texture->AddInputConnection( tex_png_Loader->GetOutputPort() );
-      }
-    else
-      {
-        if(!textureFilename.empty()) // OK to have no texture image, but if its not empty it ought to exist.
-        {
-          vtkErrorWithObjectMacro(reader, "Nonexistant texture image type!? imagefile: "
-                                  <<textureFilename);
-        }
-      }
-    vtk_texture->InterpolateOff(); // Faster?? (yes clearly faster for largish texture)
-
-    vtkSmartPointer<vtkActor> actor =
-      vtkSmartPointer<vtkActor>::New();
-    actor->SetMapper(mapper);
-    actor->SetTexture(vtk_texture);
-    vtkSmartPointer<vtkProperty> properties =
-      vtkSmartPointer<vtkProperty>::New();
-
-    vtkOBJImportedMaterial* raw_mtl_data =
-      reader->GetMaterial(port_idx);
-    properties->SetDiffuseColor(raw_mtl_data->diff);
-    properties->SetSpecularColor(raw_mtl_data->spec);
-    properties->SetAmbientColor(raw_mtl_data->amb);
-    properties->SetOpacity(raw_mtl_data->trans);
-    properties->SetInterpolationToPhong();
-    properties->SetLighting(true);
-    properties->SetSpecular( raw_mtl_data->get_spec_coeff() );
-    properties->SetAmbient( raw_mtl_data->get_amb_coeff() );
-    properties->SetDiffuse( raw_mtl_data->get_diff_coeff() );
-    actor->SetProperty(properties);
-    renderer->AddActor(actor);
-
-    //properties->ShadingOn(); // use ShadingOn() if loading vtkMaterial from xml
-    // available in mtl parser are:
-    //    double amb[3];
-    //    double diff[3];
-    //    double spec[3];
-    //    double reflect;
-    //    double refract;
-    //    double trans;
-    //    double shiny;
-    //    double glossy;
-    //    double refract_index;
-
-    reader->actor_list.push_back(actor); // keep a handle on actors to animate later
-    }
-  /** post-condition of this function: the renderer has had a bunch of actors added to it */
-}
-
-
-vtkOBJImportedMaterial::vtkOBJImportedMaterial()
-{
-  name[0] = 'x';
-  name[1] = '\0';
-  obj_set_material_defaults(this);
-}
diff --git a/IO/Import/vtkOBJImporterInternals.h b/IO/Import/vtkOBJImporterInternals.h
deleted file mode 100644
index cbf4fa3..0000000
--- a/IO/Import/vtkOBJImporterInternals.h
+++ /dev/null
@@ -1,159 +0,0 @@
-/*=========================================================================
-  Program:   Visualization Toolkit
-  Module:    vtkOBJImporterInternals.h
-  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.
-=========================================================================*/
-
-#ifndef vtkOBJImporterInternals_h
-#define vtkOBJImporterInternals_h
-
-#include <string>
-#include "vtkOBJImporter.h"
-#include "vtkPolyDataAlgorithm.h"
-#include <memory>
-#include <vector>
-#include <map>
-#include "vtkActor.h"
-
-const int OBJ_FILENAME_LENGTH = 8192;
-const int MATERIAL_NAME_SIZE  = 8192;
-
-struct vtkOBJImportedMaterial
-{
-  char name[MATERIAL_NAME_SIZE]; // use std::array<char,N> when got {gcc4.7+,vs2012+}
-  char texture_filename[OBJ_FILENAME_LENGTH];
-  double amb[3];
-  double diff[3];
-  double spec[3];
-  double reflect;
-  double refract;
-  double trans;
-  double shiny;
-  double glossy;
-  double refract_index;
-  double get_amb_coeff()
-  {
-    return sqrt( amb[0]*amb[0]+amb[1]*amb[1]+amb[2]*amb[2] );
-  }
-  double get_diff_coeff()
-  {
-    return sqrt( diff[0]*diff[0]+diff[1]*diff[1]+diff[2]*diff[2] );
-  }
-  double get_spec_coeff()
-  {
-    return sqrt( spec[0]*spec[0]+spec[1]*spec[1]+spec[2]*spec[2] );
-  }
-  const char *GetClassName() {return "vtkOBJImportedMaterial";}
-  vtkOBJImportedMaterial();
-};
-
-
-void obj_set_material_defaults(vtkOBJImportedMaterial* mtl);
-
-struct vtkOBJImportedPolyDataWithMaterial;
-
-class vtkOBJPolyDataProcessor : public vtkPolyDataAlgorithm
-{
-public:
-  static vtkOBJPolyDataProcessor *New();
-  vtkTypeMacro(vtkOBJPolyDataProcessor,vtkPolyDataAlgorithm)
-  virtual void PrintSelf(ostream& os, vtkIndent indent);
-
-  // Description:
-  // Specify file name of Wavefront .obj file.
-  void SetFileName(const char* arg)
-  { // by default assume prefix.obj => prefix.obj.mtl
-    FileName    = std::string(arg);
-    MTLFileName = FileName + ".mtl";
-  }
-  void SetMTLfileName( const char* arg )
-  {
-    MTLFileName = std::string(arg);
-  }
-  void SetTexturePath( const char* arg )
-  {
-    TexturePath = std::string(arg);
-    if(TexturePath.empty())
-      return;
-    char sep    = '/';
-#if defined(_WIN32)
-    sep = '\\';
-#endif
-    if(TexturePath.at(TexturePath.size()-1) != sep )
-      TexturePath += sep;
-  }
-  const std::string& GetTexturePath(  ) const
-  {
-    return TexturePath;
-  }
-
-  const std::string& GetFileName(  ) const
-  {
-    return FileName;
-  }
-
-  const std::string& GetMTLFileName(  ) const
-  {
-    return MTLFileName;
-  }
-
-  vtkSetMacro(VertexScale,double)
-  vtkGetMacro(VertexScale,double)
-  vtkGetMacro(SuccessParsingFiles,int)
-
-  virtual vtkPolyData* GetOutput(int idx);
-
-  vtkOBJImportedMaterial*  GetMaterial(int k);
-
-  std::string GetTextureFilename( int idx ); // return string by index
-
-  double VertexScale; // scale vertices by this during import
-
-  std::map<std::string,vtkOBJImportedMaterial*>  mtlName_to_mtlData;
-
-  // our internal parsing/storage
-  std::vector<vtkOBJImportedPolyDataWithMaterial*> poly_list;
-
-  // what gets returned to client code via GetOutput()
-  std::vector<vtkSmartPointer<vtkPolyData> >  outVector_of_vtkPolyData;
-
-  std::vector<std::string> outVector_of_textureFilnames;
-
-  std::vector<vtkSmartPointer<vtkActor> >  actor_list;
-  /////////////////////
-
-  std::vector<vtkOBJImportedMaterial*> ParseOBJandMTL(std::string filename,int& result_code);
-
-  void ReadVertices(bool gotFirstUseMaterialTag, char *pLine, float xyz, int lineNr, const double v_scale, bool everything_ok, vtkPoints* points, const bool use_scale);
-protected:
-  vtkOBJPolyDataProcessor();
-  ~vtkOBJPolyDataProcessor();
-  int RequestData(vtkInformation *,
-                  vtkInformationVector **, vtkInformationVector *) /*override*/;
-
-  vtkSetMacro(SuccessParsingFiles,int)
-
-  std::string FileName;     // filename (.obj) being read
-  std::string MTLFileName;  // associated .mtl to *.obj, typically it is *.obj.mtl
-  std::string TexturePath;
-  int         SuccessParsingFiles;
-
-private:
-  vtkOBJPolyDataProcessor(const vtkOBJPolyDataProcessor&);  // Not implemented.
-  void operator=(const vtkOBJPolyDataProcessor&);  // Not implemented.
-};
-
-class vtkRenderWindow;
-class vtkRenderer;
-void  bindTexturedPolydataToRenderWindow( vtkRenderWindow* renderWindow,
-                                          vtkRenderer* renderer,
-                                          vtkOBJPolyDataProcessor* reader );
-
-#endif
-// VTK-HeaderTest-Exclude: vtkOBJImporterInternals.h
diff --git a/IO/Infovis/vtkDIMACSGraphWriter.cxx b/IO/Infovis/vtkDIMACSGraphWriter.cxx
index 902de58..8f04218 100644
--- a/IO/Infovis/vtkDIMACSGraphWriter.cxx
+++ b/IO/Infovis/vtkDIMACSGraphWriter.cxx
@@ -35,16 +35,29 @@ vtkStandardNewMacro(vtkDIMACSGraphWriter);
 
 void vtkDIMACSGraphWriter::WriteData()
 {
+  ostream *fp;
   vtkGraph* const input = this->GetInput();
 
   vtkDebugMacro(<<"Writing vtk graph data...");
 
-  ostream *fp = this->OpenVTKFile();
-  if(!fp)
-  {
-    vtkErrorMacro("Falied to open output stream");
+  if( !(fp=this->OpenVTKFile()) )
+    {
+    if(fp)
+      {
+      if(this->FileName)
+        {
+        vtkErrorMacro("Problem opening file: "
+                      << this->FileName);
+        this->CloseVTKFile(fp);
+        }
+      else
+        {
+        this->CloseVTKFile(fp);
+        vtkErrorMacro("The FileName was not set correctly");
+        }
+      }
     return;
-  }
+    }
 
   *fp << "c vtkGraph as DIMACS format\n";
 
diff --git a/IO/Infovis/vtkDelimitedTextReader.cxx b/IO/Infovis/vtkDelimitedTextReader.cxx
index 62cb65b..2ef70c1 100644
--- a/IO/Infovis/vtkDelimitedTextReader.cxx
+++ b/IO/Infovis/vtkDelimitedTextReader.cxx
@@ -137,6 +137,18 @@ public:
       }
   }
 
+  DelimitedTextIterator& operator=(const DelimitedTextIterator& c)
+  {
+    if(this != &c)
+      {
+      this->CurrentField = c.CurrentField;
+      this->CurrentFieldIndex = c.CurrentFieldIndex;
+      this->CurrentRecordIndex = c.CurrentRecordIndex;
+      this->OutputTable = c.OutputTable;
+      }
+    return *this;
+  }
+
   DelimitedTextIterator& operator=(const vtkUnicodeString::value_type value)
   {
     // If we've already read our maximum number of records, we're done ...
diff --git a/IO/Infovis/vtkFixedWidthTextReader.cxx b/IO/Infovis/vtkFixedWidthTextReader.cxx
index 2a76a48..c4f876d 100644
--- a/IO/Infovis/vtkFixedWidthTextReader.cxx
+++ b/IO/Infovis/vtkFixedWidthTextReader.cxx
@@ -137,7 +137,7 @@ int vtkFixedWidthTextReader::RequestData(
       // here because an unsigned int will never take up enough
       // characters to fill up this buffer.
       char fieldName[64];
-      sprintf(fieldName, "Field %u", i);
+      sprintf(fieldName, "Field %d", i);
       headers.push_back(fieldName);
       }
     }
diff --git a/IO/Infovis/vtkNewickTreeWriter.cxx b/IO/Infovis/vtkNewickTreeWriter.cxx
index 601e451..6bffa66 100644
--- a/IO/Infovis/vtkNewickTreeWriter.cxx
+++ b/IO/Infovis/vtkNewickTreeWriter.cxx
@@ -46,12 +46,25 @@ void vtkNewickTreeWriter::WriteData()
   this->NodeNameArray =
     input->GetVertexData()->GetAbstractArray(this->NodeNameArrayName.c_str());
 
-  ostream *fp = this->OpenVTKFile();
-  if(!fp)
-  {
-    vtkErrorMacro("Falied to open output stream");
+  ostream *fp;
+  if( !(fp=this->OpenVTKFile()) )
+    {
+    if(fp)
+      {
+      if(this->FileName)
+        {
+        vtkErrorMacro("Problem opening file: "
+                      << this->FileName);
+        this->CloseVTKFile(fp);
+        }
+      else
+        {
+        this->CloseVTKFile(fp);
+        vtkErrorMacro("The FileName was not set correctly");
+        }
+      }
     return;
-  }
+    }
 
   this->WriteVertex(fp, input, input->GetRoot());
 
diff --git a/IO/LSDyna/CMakeLists.txt b/IO/LSDyna/CMakeLists.txt
index 0ab24de..581738a 100644
--- a/IO/LSDyna/CMakeLists.txt
+++ b/IO/LSDyna/CMakeLists.txt
@@ -22,15 +22,7 @@ set_source_files_properties(
   vtkLSDynaPartCollection
   private/LSDynaFamily
   private/LSDynaMetaData
-  PROPERTIES
-    WRAP_EXCLUDE 1
-  )
-
-set_source_files_properties(
-  private/LSDynaFamily
-  private/LSDynaMetaData
-  PROPERTIES
-    SKIP_HEADER_INSTALL 1
+  WRAP_EXCLUDE
   )
 
 vtk_module_library(vtkIOLSDyna ${Module_SRCS})
diff --git a/IO/LSDyna/private/LSDynaFamily.cxx b/IO/LSDyna/private/LSDynaFamily.cxx
index 64d2a63..97e19fb 100644
--- a/IO/LSDyna/private/LSDynaFamily.cxx
+++ b/IO/LSDyna/private/LSDynaFamily.cxx
@@ -46,8 +46,12 @@ int LS_DYNA_STAT(const char* fname, struct stat64& s)
 #else
 int LS_DYNA_STAT(const char* fname, struct __stat64& s)
 {
-  //Windows
+  //windows
+#if defined(_MSC_VER) && _MSC_VER < 1400
+  return _stat64(fname, &s);
+#else
   return __stat64(fname, &s);
+#endif
 }
 #endif
 
diff --git a/IO/LSDyna/private/LSDynaFamily.h b/IO/LSDyna/private/LSDynaFamily.h
index 96c396a..ad930bd 100644
--- a/IO/LSDyna/private/LSDynaFamily.h
+++ b/IO/LSDyna/private/LSDynaFamily.h
@@ -319,7 +319,7 @@ inline vtkIdType LSDynaFamily::GetNextWordAsInt()
 template<typename T>
 inline T* LSDynaFamily::GetBufferAs()
 {
-  return reinterpret_cast<T*>(this->Chunk);
+  return (T*)this->Chunk;
 }
 
 
diff --git a/IO/LSDyna/vtkLSDynaPart.cxx b/IO/LSDyna/vtkLSDynaPart.cxx
index 118bfa8..36ff3af 100644
--- a/IO/LSDyna/vtkLSDynaPart.cxx
+++ b/IO/LSDyna/vtkLSDynaPart.cxx
@@ -601,7 +601,7 @@ vtkUnstructuredGrid* vtkLSDynaPart::RemoveDeletedCells()
   newPoints->FastDelete();
 
   this->ThresholdGrid->Squeeze();
-  cd->RemoveArray(vtkDataSetAttributes::GhostArrayName());
+  cd->RemoveArray("vtkGhostLevels");
 
   return this->ThresholdGrid;
 }
@@ -620,10 +620,10 @@ void vtkLSDynaPart::EnableDeadCells(const int& deadCellsAsGhostArray)
     this->CellProperties->SetDeadCellArray(dead);
     }
 
-  if(!this->Grid->GetCellData()->HasArray(vtkDataSetAttributes::GhostArrayName()))
+  if(!this->Grid->GetCellData()->HasArray("vtkGhostLevels"))
     {
     vtkUnsignedCharArray *deadCells = vtkUnsignedCharArray::New();
-    deadCells->SetName(vtkDataSetAttributes::GhostArrayName());
+    deadCells->SetName("vtkGhostLevels");
     deadCells->SetVoidArray(this->CellProperties->GetDeadVoidPtr(),
                              this->NumberOfCells,1);
 
@@ -636,9 +636,9 @@ void vtkLSDynaPart::EnableDeadCells(const int& deadCellsAsGhostArray)
 void vtkLSDynaPart::DisableDeadCells()
 {
   this->HasDeadCells = false;
-  if(this->Grid->GetCellData()->HasArray(vtkDataSetAttributes::GhostArrayName()))
+  if(this->Grid->GetCellData()->HasArray("vtkGhostLevels"))
     {
-    this->Grid->GetCellData()->RemoveArray(vtkDataSetAttributes::GhostArrayName());
+    this->Grid->GetCellData()->RemoveArray("vtkGhostLevels");
     }
 }
 
diff --git a/IO/LSDyna/vtkLSDynaPartCollection.cxx b/IO/LSDyna/vtkLSDynaPartCollection.cxx
index 0b7b423..289381a 100644
--- a/IO/LSDyna/vtkLSDynaPartCollection.cxx
+++ b/IO/LSDyna/vtkLSDynaPartCollection.cxx
@@ -977,7 +977,7 @@ void vtkLSDynaPartCollection::FillPointProperty(const vtkIdType& numTuples,
       ++partIt;
       }
     }
-  if(leftOver>0 && !sortedParts.empty())
+  if(leftOver>0 && sortedParts.size() > 0)
     {
     p->Fam.BufferChunk(LSDynaFamily::Float, leftOver*numComps);
     buf = p->Fam.GetBufferAs<T>();
diff --git a/IO/LSDyna/vtkLSDynaReader.cxx b/IO/LSDyna/vtkLSDynaReader.cxx
index 3bb46d6..33cd98f 100644
--- a/IO/LSDyna/vtkLSDynaReader.cxx
+++ b/IO/LSDyna/vtkLSDynaReader.cxx
@@ -1497,7 +1497,6 @@ int vtkLSDynaReader::ReadHeaderInformation( int curAdapt )
     break;
   case 7:
     p->ReadRigidRoadMvmt = 1;
-    VTK_FALLTHROUGH;
   case 5:
     p->Dict["MATTYP"] = 1;
     p->ConnectivityUnpacked = 1;
diff --git a/IO/Legacy/Testing/Cxx/CMakeLists.txt b/IO/Legacy/Testing/Cxx/CMakeLists.txt
index 38e89e1..ea7406d 100644
--- a/IO/Legacy/Testing/Cxx/CMakeLists.txt
+++ b/IO/Legacy/Testing/Cxx/CMakeLists.txt
@@ -1,6 +1,6 @@
 vtk_add_test_cxx(${vtk-module}CxxTests tests
-  TestLegacyCompositeDataReaderWriter.cxx,NO_VALID
-  TestLegacyGhostCellsImport.cxx)
+  NO_VALID
+  TestLegacyCompositeDataReaderWriter.cxx)
 vtk_test_cxx_executable(${vtk-module}CxxTests tests
     RENDERING_FACTORY
     )
diff --git a/IO/Legacy/Testing/Cxx/TestLegacyGhostCellsImport.cxx b/IO/Legacy/Testing/Cxx/TestLegacyGhostCellsImport.cxx
deleted file mode 100644
index d52eb97..0000000
--- a/IO/Legacy/Testing/Cxx/TestLegacyGhostCellsImport.cxx
+++ /dev/null
@@ -1,80 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    TestLegacyGhostCellsImport.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.
-
-=========================================================================*/
-
-// Test converting from a vtkGhostLevels to vtkGhostType
-// see http://www.kitware.com/blog/home/post/856
-// Ghost and Blanking (Visibility) Changes
-
-#include "vtkActor.h"
-#include "vtkCellData.h"
-#include "vtkCellType.h"
-#include "vtkDataSetSurfaceFilter.h"
-#include "vtkGeometryFilter.h"
-#include "vtkNew.h"
-#include "vtkPoints.h"
-#include "vtkPolyDataMapper.h"
-#include "vtkRegressionTestImage.h"
-#include "vtkRenderer.h"
-#include "vtkRenderWindow.h"
-#include "vtkRenderWindowInteractor.h"
-#include "vtkSmartPointer.h"
-#include "vtkTesting.h"
-#include "vtkUnsignedCharArray.h"
-#include "vtkUnstructuredGrid.h"
-#include "vtkUnstructuredGridReader.h"
-
-int TestLegacyGhostCellsImport(int argc, char *argv[])
-{
-  vtkNew<vtkTesting> testing;
-  testing->AddArguments(argc, argv);
-
-  std::string filename = testing->GetDataRoot();
-  filename += "/Data/ghost_cells.vtk";
-
-  vtkNew<vtkUnstructuredGridReader> reader;
-  reader->SetFileName(filename.c_str());
-
-  // this filter removes the ghost cells
-  vtkNew<vtkGeometryFilter> surfaces;
-  surfaces->SetInputConnection(reader->GetOutputPort());
-
-  vtkNew<vtkPolyDataMapper> mapper;
-  mapper->SetInputConnection(surfaces->GetOutputPort());
-
-  vtkNew<vtkActor> actor;
-  actor->SetMapper(mapper.GetPointer());
-
-  vtkNew<vtkRenderer> renderer;
-  renderer->AddActor(actor.GetPointer());
-
-  vtkNew<vtkRenderWindow> renwin;
-  renwin->AddRenderer(renderer.GetPointer());
-  renwin->SetSize(300, 300);
-
-  vtkNew<vtkRenderWindowInteractor> iren;
-  iren->SetRenderWindow(renwin.GetPointer());
-  iren->Initialize();
-
-  renwin->Render();
-
-  int retVal = vtkRegressionTestImage( renwin.GetPointer() );
-
-  if ( retVal == vtkRegressionTester::DO_INTERACTOR)
-    {
-    iren->Start();
-    }
-
-  return !retVal;
-}
diff --git a/IO/Legacy/Testing/Data/Baseline/TestLegacyGhostCellsImport.png.md5 b/IO/Legacy/Testing/Data/Baseline/TestLegacyGhostCellsImport.png.md5
deleted file mode 100644
index 8597cac..0000000
--- a/IO/Legacy/Testing/Data/Baseline/TestLegacyGhostCellsImport.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-aaef81612cb7340592e1474ba029257e
diff --git a/IO/Legacy/vtkDataReader.cxx b/IO/Legacy/vtkDataReader.cxx
index 0b60657..756ca87 100644
--- a/IO/Legacy/vtkDataReader.cxx
+++ b/IO/Legacy/vtkDataReader.cxx
@@ -27,7 +27,6 @@
 #include "vtkInformation.h"
 #include "vtkInformationVector.h"
 #include "vtkIntArray.h"
-#include "vtkLegacyReaderVersion.h"
 #include "vtkLongArray.h"
 #include "vtkLookupTable.h"
 #include "vtkObjectFactory.h"
@@ -122,8 +121,6 @@ vtkDataReader::vtkDataReader()
   this->ReadAllColorScalars = 0;
   this->ReadAllTCoords = 0;
   this->ReadAllFields = 0;
-  this->FileMajorVersion = 0;
-  this->FileMinorVersion = 0;
 
   this->SetNumberOfInputPorts(0);
   this->SetNumberOfOutputPorts(1);
@@ -145,7 +142,10 @@ vtkDataReader::~vtkDataReader()
 
   this->SetInputArray(0);
   this->InitializeCharacteristics();
-  delete this->IS;
+  if ( this->IS )
+    {
+    delete this->IS;
+    }
 }
 
 void vtkDataReader::SetInputString(const char *in)
@@ -462,8 +462,7 @@ int vtkDataReader::ReadHeader()
     this->SetErrorCode( vtkErrorCode::PrematureEndOfFileError );
     return 0;
     }
-  const int VERSION_PREFIX_LENGTH = 22;
-  if ( strncmp ("# vtk DataFile Version", line, VERSION_PREFIX_LENGTH) )
+  if ( strncmp ("# vtk DataFile Version", line, 20) )
     {
     vtkErrorMacro(<< "Unrecognized file type: "<< line << " for file: "
                   << (this->FileName?this->FileName:"(Null FileName)"));
@@ -471,25 +470,6 @@ int vtkDataReader::ReadHeader()
     this->SetErrorCode( vtkErrorCode::UnrecognizedFileTypeError );
     return 0;
     }
-  if (sscanf (line + VERSION_PREFIX_LENGTH,
-              "%d.%d", &this->FileMajorVersion, &this->FileMinorVersion) != 2)
-    {
-    vtkWarningMacro(<< "Cannot read file version: " << line << " for file: "
-                    << (this->FileName?this->FileName:"(Null FileName)"));
-    this->FileMajorVersion = 0;
-    this->FileMinorVersion = 0;
-    }
-  if (this->FileMajorVersion > vtkLegacyReaderMajorVersion ||
-      (this->FileMajorVersion == vtkLegacyReaderMajorVersion &&
-       this->FileMinorVersion > vtkLegacyReaderMinorVersion))
-    {
-    // newer file than the reader version
-    vtkWarningMacro(
-      << "Reading file version: " << this->FileMajorVersion
-      << "." << this->FileMinorVersion << " with older reader version "
-      << vtkLegacyReaderMajorVersion << "." << vtkLegacyReaderMinorVersion);
-    }
-
   //
   // read title
   //
@@ -722,7 +702,7 @@ int vtkDataReader::ReadCellData(vtkDataSet *ds, int numCells)
     else if ( ! strncmp(line, "field", 5) )
       {
       vtkFieldData *f;
-      if ( ! (f=this->ReadFieldData(CELL_DATA)) )
+      if ( ! (f=this->ReadFieldData()) )
         {
         return 0;
         }
@@ -881,7 +861,7 @@ int vtkDataReader::ReadPointData(vtkDataSet *ds, int numPts)
     else if ( ! strncmp(line, "field", 5) )
       {
       vtkFieldData *f;
-      if ( ! (f=this->ReadFieldData(POINT_DATA)) )
+      if ( ! (f=this->ReadFieldData()) )
         {
         return 0;
         }
@@ -2767,38 +2747,7 @@ int vtkDataReader::ReadCells(int size, int *data,
   return 1;
 }
 
-void vtkDataReader::ConvertGhostLevelsToGhostType(
-  FieldType fieldType, vtkAbstractArray *data) const
-{
-  vtkUnsignedCharArray* ucData = vtkUnsignedCharArray::SafeDownCast(data);
-  const char* name = data->GetName();
-  int numComp = data->GetNumberOfComponents();
-  if (this->FileMajorVersion < 4 && ucData &&
-      numComp == 1 && (fieldType == CELL_DATA || fieldType == POINT_DATA) &&
-      !strcmp(name, "vtkGhostLevels"))
-    {
-    // convert ghost levels to ghost type
-    unsigned char* ghosts = ucData->GetPointer(0);
-    // only CELL_DATA or POINT_DATA are possible at this point.
-    unsigned char newValue = vtkDataSetAttributes::DUPLICATEPOINT;
-    if (fieldType == CELL_DATA)
-      {
-      newValue = vtkDataSetAttributes::DUPLICATECELL;
-      }
-    vtkIdType numTuples = ucData->GetNumberOfTuples();
-    for (int i = 0; i < numTuples; ++i)
-      {
-      if (ghosts[i] > 0)
-        {
-        ghosts[i] = newValue;
-        }
-      }
-    data->SetName(vtkDataSetAttributes::GhostArrayName());
-    }
-}
-
-
-vtkFieldData *vtkDataReader::ReadFieldData(FieldType fieldType)
+vtkFieldData *vtkDataReader::ReadFieldData()
 {
   int i, numArrays=0, skipField=0;
   vtkFieldData *f;
@@ -2838,10 +2787,9 @@ vtkFieldData *vtkDataReader::ReadFieldData(FieldType fieldType)
     data = this->ReadArray(type, numTuples, numComp);
     if ( data != NULL )
       {
+      data->SetName(name);
       if ( ! skipField  || this->ReadAllFields )
         {
-        data->SetName(name);
-        this->ConvertGhostLevelsToGhostType(fieldType, data);
         f->AddArray(data);
         }
       data->Delete();
diff --git a/IO/Legacy/vtkDataReader.h b/IO/Legacy/vtkDataReader.h
index 9c3c125..02452bd 100644
--- a/IO/Legacy/vtkDataReader.h
+++ b/IO/Legacy/vtkDataReader.h
@@ -46,15 +46,6 @@ class vtkTable;
 class VTKIOLEGACY_EXPORT vtkDataReader : public vtkAlgorithm
 {
 public:
-  enum FieldType
-  {
-    POINT_DATA,
-    CELL_DATA,
-    FIELD_DATA,
-  };
-
-
-
   static vtkDataReader *New();
   vtkTypeMacro(vtkDataReader,vtkAlgorithm);
   void PrintSelf(ostream& os, vtkIndent indent);
@@ -292,13 +283,7 @@ public:
   // Description:
   // Helper functions for reading data.
   vtkAbstractArray *ReadArray(const char *dataType, int numTuples, int numComp);
-  vtkFieldData *ReadFieldData(FieldType fieldType = FIELD_DATA);
-
-  // Description:
-  // Return major and minor version of the file.
-  // Returns version 3.0 if the version cannot be read from file.
-  vtkGetMacro(FileMajorVersion, int);
-  vtkGetMacro(FileMinorVersion, int);
+  vtkFieldData *ReadFieldData();
 
 //BTX
   // Description:
@@ -421,8 +406,6 @@ protected:
   int ReadAllColorScalars;
   int ReadAllTCoords;
   int ReadAllFields;
-  int FileMajorVersion;
-  int FileMinorVersion;
 
   void InitializeCharacteristics();
   int CharacterizeFile(); //read entire file, storing important characteristics
@@ -452,9 +435,6 @@ protected:
 private:
   vtkDataReader(const vtkDataReader&);  // Not implemented.
   void operator=(const vtkDataReader&);  // Not implemented.
-
-  void ConvertGhostLevelsToGhostType(
-    FieldType fieldType, vtkAbstractArray *data) const;
 };
 
 #endif
diff --git a/IO/Legacy/vtkDataWriter.cxx b/IO/Legacy/vtkDataWriter.cxx
index c54a1fe..e7ec4f1 100644
--- a/IO/Legacy/vtkDataWriter.cxx
+++ b/IO/Legacy/vtkDataWriter.cxx
@@ -27,7 +27,6 @@
 #include "vtkFloatArray.h"
 #include "vtkGraph.h"
 #include "vtkIntArray.h"
-#include "vtkLegacyReaderVersion.h"
 #include "vtkLongArray.h"
 #include "vtkLookupTable.h"
 #include "vtkObjectFactory.h"
@@ -101,9 +100,12 @@ vtkDataWriter::~vtkDataWriter()
   delete [] this->LookupTableName;
   delete [] this->FieldDataName;
 
-  delete [] this->OutputString;
-  this->OutputString = NULL;
-  this->OutputStringLength = 0;
+  if (this->OutputString)
+    {
+    delete [] this->OutputString;
+    this->OutputString = NULL;
+    this->OutputStringLength = 0;
+    }
 }
 
 
@@ -124,10 +126,12 @@ ostream *vtkDataWriter::OpenVTKFile()
   if (this->WriteToOutputString)
     {
     // Get rid of any old output string.
-    delete [] this->OutputString;
-    this->OutputString = NULL;
-    this->OutputStringLength = 0;
-
+    if (this->OutputString)
+      {
+      delete [] this->OutputString;
+      this->OutputString = NULL;
+      this->OutputStringLength = 0;
+      }
     // Allocate the new output string. (Note: this will only work with binary).
     if (!this->GetInputExecutive(0, 0))
       {
@@ -174,8 +178,7 @@ int vtkDataWriter::WriteHeader(ostream *fp)
 {
   vtkDebugMacro(<<"Writing header...");
 
-  *fp << "# vtk DataFile Version " << vtkLegacyReaderMajorVersion << "."
-      << vtkLegacyReaderMinorVersion << "\n";
+  *fp << "# vtk DataFile Version 3.0\n";
   *fp << this->Header << "\n";
 
   if ( this->FileType == VTK_ASCII )
diff --git a/IO/Legacy/vtkLegacyReaderVersion.h b/IO/Legacy/vtkLegacyReaderVersion.h
deleted file mode 100644
index c7e9c2e..0000000
--- a/IO/Legacy/vtkLegacyReaderVersion.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkLegacyReaderVersion.h
-
-  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.
-
-=========================================================================*/
-// .NAME vtkLegacyReaderVersion - version number for legacy readers/writers
-
-#ifndef vtkLegacyReaderVersion_h
-#define vtkLegacyReaderVersion_h
-
-const int vtkLegacyReaderMajorVersion = 4;
-const int vtkLegacyReaderMinorVersion = 0;
-
-#endif // vtkLegacyReaderVersion_h
-// VTK-HeaderTest-Exclude: vtkLegacyReaderVersion.h
diff --git a/IO/Legacy/vtkStructuredGridReader.cxx b/IO/Legacy/vtkStructuredGridReader.cxx
index ac7040b..a11b219 100644
--- a/IO/Legacy/vtkStructuredGridReader.cxx
+++ b/IO/Legacy/vtkStructuredGridReader.cxx
@@ -14,12 +14,10 @@
 =========================================================================*/
 #include "vtkStructuredGridReader.h"
 
-#include "vtkDataSetAttributes.h"
 #include "vtkFieldData.h"
 #include "vtkInformation.h"
 #include "vtkInformationVector.h"
 #include "vtkObjectFactory.h"
-#include "vtkPointData.h"
 #include "vtkStreamingDemandDrivenPipeline.h"
 #include "vtkStructuredGrid.h"
 #include "vtkUnsignedCharArray.h"
@@ -235,7 +233,7 @@ int vtkStructuredGridReader::RequestData(
         dimsRead = 1;
         }
 
-      else if ( this->FileMajorVersion < 4 && ! strncmp(line,"blanking",8) )
+      else if ( ! strncmp(line,"blanking",8) )
         {
         if (!this->Read(&npts))
           {
@@ -256,20 +254,7 @@ int vtkStructuredGridReader::RequestData(
 
         if ( data != NULL )
           {
-          vtkUnsignedCharArray *ghosts = vtkUnsignedCharArray::New();
-          ghosts->SetNumberOfValues(numPts);
-          ghosts->SetName(vtkDataSetAttributes::GhostArrayName());
-          for(vtkIdType ptId = 0; ptId < numPts; ++ptId)
-            {
-            unsigned char value = 0;
-            if(data->GetValue(ptId) == 0)
-              {
-              value |= vtkDataSetAttributes::HIDDENPOINT;
-              }
-            ghosts->SetValue(ptId, value);
-            }
-          output->GetPointData()->AddArray(ghosts);
-          ghosts->Delete();
+          output->SetPointVisibilityArray(data);
           data->Delete();
           }
         }
diff --git a/IO/Legacy/vtkStructuredGridWriter.cxx b/IO/Legacy/vtkStructuredGridWriter.cxx
index 4ba6e54..b20427e 100644
--- a/IO/Legacy/vtkStructuredGridWriter.cxx
+++ b/IO/Legacy/vtkStructuredGridWriter.cxx
@@ -71,6 +71,19 @@ void vtkStructuredGridWriter::WriteData()
     return;
     }
 
+  // If blanking, write that information out
+  if ( input->GetPointBlanking() )
+    {
+    if (!this->WriteBlanking(fp, input))
+      {
+      vtkErrorMacro("Ran out of disk space; deleting file: "
+                    << this->FileName);
+      this->CloseVTKFile(fp);
+      unlink(this->FileName);
+      return;
+      }
+    }
+
   if (!this->WriteCellData(fp, input))
     {
     vtkErrorMacro("Ran out of disk space; deleting file: " << this->FileName);
@@ -89,6 +102,15 @@ void vtkStructuredGridWriter::WriteData()
   this->CloseVTKFile(fp);
 }
 
+int vtkStructuredGridWriter::WriteBlanking(ostream *fp, vtkStructuredGrid *grid)
+{
+  vtkUnsignedCharArray *blanking=grid->GetPointVisibilityArray();
+
+  int numPts = grid->GetNumberOfPoints();
+  *fp << "BLANKING " << numPts;
+  return this->WriteArray(fp, VTK_UNSIGNED_CHAR, blanking, " %s\n", numPts, 1);
+}
+
 int vtkStructuredGridWriter::FillInputPortInformation(int,
                                                       vtkInformation *info)
 {
diff --git a/IO/Legacy/vtkStructuredGridWriter.h b/IO/Legacy/vtkStructuredGridWriter.h
index 1380144..b0ea805 100644
--- a/IO/Legacy/vtkStructuredGridWriter.h
+++ b/IO/Legacy/vtkStructuredGridWriter.h
@@ -45,6 +45,7 @@ protected:
   ~vtkStructuredGridWriter() {}
 
   void WriteData();
+  int WriteBlanking(ostream *fp, vtkStructuredGrid *ds);
 
   virtual int FillInputPortInformation(int port, vtkInformation *info);
 
diff --git a/IO/MINC/Testing/Data/Baseline/TestMNITagPoints.png.md5 b/IO/MINC/Testing/Data/Baseline/TestMNITagPoints.png.md5
index c9df02b..cfcc163 100644
--- a/IO/MINC/Testing/Data/Baseline/TestMNITagPoints.png.md5
+++ b/IO/MINC/Testing/Data/Baseline/TestMNITagPoints.png.md5
@@ -1 +1 @@
-fb06aa7262efeac5a5f3bd5630465542
+7a664d7609f76ad2871110f412691c7e
diff --git a/IO/MINC/vtkMNITagPointWriter.cxx b/IO/MINC/vtkMNITagPointWriter.cxx
index f61b15a..f04294e 100644
--- a/IO/MINC/vtkMNITagPointWriter.cxx
+++ b/IO/MINC/vtkMNITagPointWriter.cxx
@@ -558,5 +558,8 @@ void vtkMNITagPointWriter::CloseFile(ostream *fp)
 {
   vtkDebugMacro(<<"Closing file\n");
 
-  delete fp;
+  if ( fp != NULL )
+    {
+    delete fp;
+    }
 }
diff --git a/IO/MINC/vtkMNITransformReader.cxx b/IO/MINC/vtkMNITransformReader.cxx
index fd6149b..3a35d38 100644
--- a/IO/MINC/vtkMNITransformReader.cxx
+++ b/IO/MINC/vtkMNITransformReader.cxx
@@ -203,7 +203,10 @@ int vtkMNITransformReader::ReadLineAfterComments(
       }
     else if (*cp != '\0')
       {
-      delete [] this->Comments;
+      if (this->Comments)
+        {
+        delete [] this->Comments;
+        }
       this->Comments = new char[comments.length() + 1];
       strcpy(this->Comments, comments.c_str());
       return 1;
@@ -721,7 +724,7 @@ int vtkMNITransformReader::ReadGridTransform(
     return 0;
     }
 
-  char filename[VTK_MAXPATH];
+  char filename[256];
   if (!this->ParseStringValue(infile, linetext, cpp, filename))
     {
     return 0;
diff --git a/IO/MPIImage/Testing/Cxx/ParallelIso.cxx b/IO/MPIImage/Testing/Cxx/ParallelIso.cxx
index 146e4a8..4546d62 100644
--- a/IO/MPIImage/Testing/Cxx/ParallelIso.cxx
+++ b/IO/MPIImage/Testing/Cxx/ParallelIso.cxx
@@ -205,7 +205,7 @@ void MyMain( vtkMultiProcessController *controller, void *arg )
     app->AddInputData(outputCopy);
     outputCopy->Delete();
     app->Update();
-    outputCopy->RemoveGhostCells();
+    outputCopy->RemoveGhostCells(1);
     renWindow->Render();
 
     *(args->retVal) =
diff --git a/IO/MPIParallel/CMakeLists.txt b/IO/MPIParallel/CMakeLists.txt
index 8452ccb..98f0fb7 100644
--- a/IO/MPIParallel/CMakeLists.txt
+++ b/IO/MPIParallel/CMakeLists.txt
@@ -1,26 +1,49 @@
 include(vtkMPI)
 
-# We don't build the parallel readers on windows
+# We don't build the parallel WindBlade reader on windows
 # because there's problems with the MPI_File_open()
 # function when there's paths in the filenames.
-set (vtk_module_overrides)
+set(PWindBladeReader vtkPWindBladeReader.cxx)
 if(WIN32)
-  set(Module_SRCS)
-else()
-  set(Module_SRCS
-    vtkPWindBladeReader.cxx
-    vtkMPIMultiBlockPLOT3DReader.cxx
-    )
-
-  vtk_add_override(vtkWindBladeReader vtkPWindBladeReader)
-  vtk_add_override(vtkMultiBlockPLOT3DReader vtkMPIMultiBlockPLOT3DReader)
+  set(PWindBladeReader)
 endif()
 
-# Now to generate our object factory.
-vtk_object_factory_configure("${vtk_module_overrides}")
-list(APPEND Module_SRCS
+set(Module_SRCS
+  ${PWindBladeReader}
   ${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.cxx
   )
-set_source_files_properties(${vtk-module}ObjectFactory WRAP_EXCLUDE)
+
+set_source_files_properties(
+  ${vtk-module}ObjectFactory
+  WRAP_EXCLUDE
+  )
+
+# Now to generate our object factory.
+set( vtk_module_overrides
+  WindBladeReader
+  )
+if(WIN32)
+  set( vtk_module_overrides )
+endif()
+
+foreach(_class ${vtk_module_overrides})
+  set(_override vtkP${_class})
+  set(_vtk_override_includes "${_vtk_override_includes} #include \"${_override}.h\"")
+  set(_vtk_override_creates "${_vtk_override_creates}
+VTK_CREATE_CREATE_FUNCTION(${_override})")
+  set(_vtk_override_do "${_vtk_override_do}
+  this->RegisterOverride(\"vtk${_class}\",
+                         \"${_override}\",
+                         \"Override for ${vtk-module} module\", 1,
+                         vtkObjectFactoryCreate${_override});")
+endforeach()
+
+# Now lets create the object factory classes
+string(TOUPPER ${vtk-module} VTK-MODULE)
+configure_file(${VTK_CMAKE_DIR}/vtkObjectFactory.h.in
+  ${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.h)
+configure_file(${VTK_CMAKE_DIR}/vtkObjectFactory.cxx.in
+  ${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.cxx)
+
 vtk_module_library(${vtk-module} ${Module_SRCS})
 vtk_mpi_link(${vtk-module})
diff --git a/IO/MPIParallel/Testing/Cxx/TestPWindBladeReader.cxx b/IO/MPIParallel/Testing/Cxx/TestPWindBladeReader.cxx
index c98950e..df8e08b 100644
--- a/IO/MPIParallel/Testing/Cxx/TestPWindBladeReader.cxx
+++ b/IO/MPIParallel/Testing/Cxx/TestPWindBladeReader.cxx
@@ -143,7 +143,6 @@ int TestPWindBladeReader( int argc, char *argv[] )
   bounds[2] -= 150;
   ren->ResetCamera(bounds);
   camera->Elevation(-90);
-  camera->SetViewUp(0,0,1);
   camera->Zoom(1.2);
 
   ren->AddActor(fieldActor);
diff --git a/IO/MPIParallel/Testing/Python/CMakeLists.txt b/IO/MPIParallel/Testing/Python/CMakeLists.txt
deleted file mode 100644
index 128ba0b..0000000
--- a/IO/MPIParallel/Testing/Python/CMakeLists.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-vtk_add_test_python_mpi(
-  Plot3DMPIIO.py,NO_VALID
-)
diff --git a/IO/MPIParallel/Testing/Python/Plot3DMPIIO.py b/IO/MPIParallel/Testing/Python/Plot3DMPIIO.py
deleted file mode 100755
index c501fe1..0000000
--- a/IO/MPIParallel/Testing/Python/Plot3DMPIIO.py
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/usr/bin/env python
-import sys
-import vtk
-from vtk.test import Testing
-from vtk.util.misc import vtkGetDataRoot
-VTK_DATA_ROOT = vtkGetDataRoot()
-
-def Gather(c, arr, root):
-    vtkArr = vtk.vtkDoubleArray()
-    count = len(arr)
-    vtkArr.SetNumberOfTuples(count)
-    for i in range(count):
-        vtkArr.SetValue(i, arr[i])
-    vtkResult = vtk.vtkDoubleArray()
-    c.Gather(vtkArr, vtkResult, root)
-    result = [vtkResult.GetValue(i) for i in range(vtkResult.GetNumberOfTuples())]
-    return [ tuple(result[i : i + count]) \
-                for i in xrange(0, vtkResult.GetNumberOfTuples(), count) ]
-
-renWin = vtk.vtkRenderWindow()
-
-iren = vtk.vtkRenderWindowInteractor()
-iren.SetRenderWindow(renWin)
-
-r = vtk.vtkMultiBlockPLOT3DReader()
-# Since vtkMPIMultiBlockPLOT3DReader is not created on Windows even when MPI
-# is enabled.
-assert r.IsA("vtkMPIMultiBlockPLOT3DReader") == 1 or sys.platform == "win32"
-
-r.SetFileName(VTK_DATA_ROOT + "/Data/multi-bin.xyz")
-r.SetQFileName(VTK_DATA_ROOT + "/Data/multi-bin-oflow.q")
-r.SetFunctionFileName(VTK_DATA_ROOT + "/Data/multi-bin.f")
-r.AutoDetectFormatOn()
-
-r.Update()
-
-c = vtk.vtkMPIController.GetGlobalController()
-size = c.GetNumberOfProcesses()
-rank = c.GetLocalProcessId()
-block = 0
-
-bounds = r.GetOutput().GetBlock(block).GetBounds()
-bounds = Gather(c, bounds, root=0)
-
-if rank == 0:
-    print "Reader:", r.GetClassName()
-    print "Bounds:"
-    for i in range(size):
-        print bounds[i]
-
-c.Barrier()
-aname = "StagnationEnergy"
-rng = r.GetOutput().GetBlock(block).GetPointData().GetArray(aname).GetRange(0)
-
-rng = Gather(c, rng, root=0)
-if rank == 0:
-    print "StagnationEnergy Ranges:"
-    for i in range(size):
-        print rng[i]
-        assert rng[i][0] > 1.1 and rng[i][0] < 24.1 and \
-               rng[i][1] > 1.1 and rng[i][1] < 24.1
diff --git a/IO/MPIParallel/module.cmake b/IO/MPIParallel/module.cmake
index 47a6607..9647262 100644
--- a/IO/MPIParallel/module.cmake
+++ b/IO/MPIParallel/module.cmake
@@ -1,15 +1,13 @@
 vtk_module(vtkIOMPIParallel
   IMPLEMENTS
     vtkIOGeometry
-    vtkIOParallel
   GROUPS
     MPI
   DEPENDS
     vtkIOGeometry
-    vtkIOParallel
+    vtkParallelMPI
   PRIVATE_DEPENDS
     vtksys
-    vtkParallelMPI
   TEST_DEPENDS
     vtkRendering${VTK_RENDERING_BACKEND}
     vtkTestingRendering
diff --git a/IO/MPIParallel/vtkMPIMultiBlockPLOT3DReader.cxx b/IO/MPIParallel/vtkMPIMultiBlockPLOT3DReader.cxx
deleted file mode 100644
index c038ada..0000000
--- a/IO/MPIParallel/vtkMPIMultiBlockPLOT3DReader.cxx
+++ /dev/null
@@ -1,345 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkMPIMultiBlockPLOT3DReader.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 "vtkMPIMultiBlockPLOT3DReader.h"
-
-#include "vtkByteSwap.h"
-#include "vtkDataArrayDispatcher.h"
-#include "vtkErrorCode.h"
-#include "vtkMPICommunicator.h"
-#include "vtkMPIController.h"
-#include "vtkMPI.h"
-#include "vtkMultiBlockPLOT3DReaderInternals.h"
-#include "vtkObjectFactory.h"
-#include "vtkStructuredData.h"
-
-#include <exception>
-#include <cassert>
-
-#define DEFINE_MPI_TYPE(ctype, mpitype) \
-  template <> struct mpi_type<ctype> { static MPI_Datatype type() { return mpitype; }  };
-
-namespace
-{
-  template <class T> struct mpi_type {};
-  DEFINE_MPI_TYPE(char, MPI_CHAR);
-  DEFINE_MPI_TYPE(signed char, MPI_SIGNED_CHAR);
-  DEFINE_MPI_TYPE(unsigned char, MPI_UNSIGNED_CHAR);
-  DEFINE_MPI_TYPE(short, MPI_SHORT);
-  DEFINE_MPI_TYPE(unsigned short, MPI_UNSIGNED_SHORT);
-  DEFINE_MPI_TYPE(int, MPI_INT);
-  DEFINE_MPI_TYPE(unsigned int, MPI_UNSIGNED);
-  DEFINE_MPI_TYPE(long, MPI_LONG);
-  DEFINE_MPI_TYPE(unsigned long, MPI_UNSIGNED_LONG);
-  DEFINE_MPI_TYPE(float, MPI_FLOAT);
-  DEFINE_MPI_TYPE(double, MPI_DOUBLE);
-#if defined(VTK_TYPE_USE_LONG_LONG)
-  DEFINE_MPI_TYPE(long long, MPI_LONG_LONG);
-  DEFINE_MPI_TYPE(unsigned long long, MPI_UNSIGNED_LONG_LONG);
-#endif
-#if defined(VTK_TYPE_USE___INT64)
-# if VTK_SIZEOF_LONG == 8
-  DEFINE_MPI_TYPE(__int64, MPI_LONG);
-  DEFINE_MPI_TYPE(unsigned __int64, MPI_UNSIGNED_LONG);
-# elif defined(MPI_LONG_LONG)
-  DEFINE_MPI_TYPE(__int64, MPI_LONG_LONG);
-  DEFINE_MPI_TYPE(__int64, MPI_UNSIGNED_LONG_LONG);
-# endif
-#endif
-
-  class MPIPlot3DException : public std::exception
-  {
-  };
-
-  class SetupFileViewFunctor
-  {
-    vtkMPICommunicatorOpaqueComm& Communicator;
-    vtkMPIOpaqueFileHandle& Handle;
-    int Extent[6];
-    int WExtent[6];
-    vtkTypeUInt64 Offset;
-    int ByteOrder;
-
-  public:
-    SetupFileViewFunctor(
-      vtkMPICommunicatorOpaqueComm& comm,
-      vtkMPIOpaqueFileHandle& handle,
-        const int extent[6], const int wextent[6], vtkTypeUInt64 offset, int byteOrder)
-      : Communicator(comm), Handle(handle), Offset(offset), ByteOrder(byteOrder)
-    {
-    std::copy(extent, extent+6, this->Extent);
-    std::copy(wextent, wextent+6, this->WExtent);
-    }
-
-    template <class T>
-    void operator()(vtkDataArrayDispatcherPointer<T> array) const
-    {
-    int array_of_sizes[3];
-    int array_of_subsizes[3];
-    int array_of_starts[3];
-    for (int cc=0; cc < 3; ++cc)
-      {
-      array_of_sizes[cc]    = this->WExtent[cc*2+1] - this->WExtent[cc*2] + 1;
-      array_of_subsizes[cc] = this->Extent[cc*2+1] - this->Extent[cc*2] + 1;
-      array_of_starts[cc]   = this->Extent[cc*2];
-      }
-
-    // Define the file type for this process.
-    MPI_Datatype filetype;
-    if (MPI_Type_create_subarray(3,
-        array_of_sizes,
-        array_of_subsizes,
-        array_of_starts,
-        MPI_ORDER_FORTRAN,
-        mpi_type<T>::type(),
-        &filetype) != MPI_SUCCESS)
-      {
-      throw MPIPlot3DException();
-      }
-    MPI_Type_commit(&filetype);
-
-    // For each component.
-    const vtkIdType valuesToRead = vtkStructuredData::GetNumberOfPoints(
-      const_cast<int*>(this->Extent));
-    const vtkIdType valuesTotal = vtkStructuredData::GetNumberOfPoints(
-      const_cast<int*>(this->WExtent));
-
-    const int _INT_MAX = 2e9 / sizeof(T); /// XXX: arbitrary limit that seems
-                                          /// to work when reading large files.
-
-    int numIterations = static_cast<int>(valuesToRead/_INT_MAX) + 1;
-    int maxNumIterations;
-    if (MPI_Allreduce(&numIterations, &maxNumIterations, 1, mpi_type<int>::type(),
-        MPI_MAX, *this->Communicator.GetHandle()) != MPI_SUCCESS)
-      {
-      throw MPIPlot3DException();
-      }
-
-    vtkTypeUInt64 byteOffset = this->Offset;
-    // simply use the VTK array for scalars.
-    T *buffer = array.NumberOfComponents == 1? array.RawPointer : new T[valuesToRead];
-    try
-      {
-      for (int comp=0; comp < array.NumberOfComponents; ++comp)
-        {
-        // Define the view.
-        if (MPI_File_set_view(this->Handle.Handle, byteOffset, mpi_type<T>::type(),
-            filetype, const_cast<char*>("native"), MPI_INFO_NULL) != MPI_SUCCESS)
-          {
-          throw MPIPlot3DException();
-          }
-
-        // Read contents from the file in 2GB chunks.
-        vtkIdType valuesRead = 0;
-        for (int iteration = 0; iteration < maxNumIterations; ++iteration)
-          {
-          vtkIdType valuesToReadInIteration =
-            std::min((valuesToRead - valuesRead), static_cast<vtkIdType>(_INT_MAX));
-          if (MPI_File_read_all(this->Handle.Handle, buffer + valuesRead,
-              static_cast<int>(valuesToReadInIteration),
-              mpi_type<T>::type(), MPI_STATUS_IGNORE) != MPI_SUCCESS)
-            {
-            throw MPIPlot3DException();
-            }
-          valuesRead += valuesToReadInIteration;
-          }
-        if (buffer != array.RawPointer)
-          {
-          for (vtkIdType i=0; i < valuesToRead; ++i)
-            {
-            array.RawPointer[array.NumberOfComponents*i + comp] = buffer[i];
-            }
-          }
-        byteOffset += valuesTotal * sizeof(T);
-        }
-      }
-    catch (MPIPlot3DException)
-      {
-      if (buffer != array.RawPointer)
-        {
-        delete [] buffer;
-        }
-      MPI_Type_free(&filetype);
-      throw MPIPlot3DException();
-      }
-    if (buffer != array.RawPointer)
-      {
-      delete [] buffer;
-      }
-    MPI_Type_free(&filetype);
-    // finally, handle byte order.
-    if (this->ByteOrder == vtkMultiBlockPLOT3DReader::FILE_LITTLE_ENDIAN)
-      {
-      vtkByteSwap::SwapLERange(array.RawPointer, array.NumberOfComponents*array.NumberOfTuples);
-      }
-    else
-      {
-      vtkByteSwap::SwapBERange(array.RawPointer, array.NumberOfComponents*array.NumberOfTuples);
-      }
-    }
-  };
-}
-
-vtkStandardNewMacro(vtkMPIMultiBlockPLOT3DReader);
-//----------------------------------------------------------------------------
-vtkMPIMultiBlockPLOT3DReader::vtkMPIMultiBlockPLOT3DReader()
-{
-  this->UseMPIIO = true;
-}
-
-//----------------------------------------------------------------------------
-vtkMPIMultiBlockPLOT3DReader::~vtkMPIMultiBlockPLOT3DReader()
-{
-}
-
-//----------------------------------------------------------------------------
-bool vtkMPIMultiBlockPLOT3DReader::CanUseMPIIO()
-{
-  return (this->UseMPIIO && this->BinaryFile &&
-    this->Internal->Settings.NumberOfDimensions == 3 &&
-    vtkMPIController::SafeDownCast(this->Controller) != NULL);
-}
-
-//----------------------------------------------------------------------------
-int vtkMPIMultiBlockPLOT3DReader::OpenFileForDataRead(void*& vfp, const char* fname)
-{
-  if (!this->CanUseMPIIO())
-    {
-    return this->Superclass::OpenFileForDataRead(vfp, fname);
-    }
-
-  vtkMPICommunicator* mpiComm = vtkMPICommunicator::SafeDownCast(
-    this->Controller->GetCommunicator());
-  assert(mpiComm);
-
-  vtkMPIOpaqueFileHandle* handle = new vtkMPIOpaqueFileHandle();
-  try
-    {
-    if (MPI_File_open(*mpiComm->GetMPIComm()->GetHandle(),
-                      const_cast<char*>(fname), MPI_MODE_RDONLY,
-                      MPI_INFO_NULL, &handle->Handle) != MPI_SUCCESS)
-      {
-      this->SetErrorCode(vtkErrorCode::FileNotFoundError);
-      vtkErrorMacro("File: " << fname << " not found.");
-      throw MPIPlot3DException();
-      }
-    }
-  catch (MPIPlot3DException)
-    {
-    delete handle;
-    vfp = NULL;
-    return VTK_ERROR;
-    }
-  vfp = handle;
-  return VTK_OK;
-}
-
-//----------------------------------------------------------------------------
-void vtkMPIMultiBlockPLOT3DReader::CloseFile(void* vfp)
-{
-  if (!this->CanUseMPIIO())
-    {
-    this->Superclass::CloseFile(vfp);
-    return;
-    }
-
-  vtkMPIOpaqueFileHandle* handle = reinterpret_cast<vtkMPIOpaqueFileHandle*>(vfp);
-  assert(handle);
-  if (MPI_File_close(&handle->Handle) != MPI_SUCCESS)
-    {
-    vtkErrorMacro("Failed to close file!");
-    }
-}
-
-//----------------------------------------------------------------------------
-int vtkMPIMultiBlockPLOT3DReader::ReadIntScalar(
-  void* vfp, int extent[6], int wextent[6],
-  vtkDataArray* scalar, vtkTypeUInt64 offset)
-{
-  if (!this->CanUseMPIIO())
-    {
-    return this->Superclass::ReadIntScalar(vfp, extent, wextent, scalar, offset);
-    }
-
-  return this->ReadScalar(vfp, extent, wextent, scalar, offset);
-}
-
-//----------------------------------------------------------------------------
-int vtkMPIMultiBlockPLOT3DReader::ReadScalar(
-    void* vfp,
-    int extent[6], int wextent[6],
-    vtkDataArray* scalar, vtkTypeUInt64 offset)
-{
-  if (!this->CanUseMPIIO())
-    {
-    return this->Superclass::ReadScalar(vfp, extent, wextent, scalar, offset);
-    }
-
-  vtkMPIOpaqueFileHandle* handle = reinterpret_cast<vtkMPIOpaqueFileHandle*>(vfp);
-  assert(handle);
-
-  vtkMPICommunicatorOpaqueComm* comm =
-    vtkMPICommunicator::SafeDownCast(this->Controller->GetCommunicator())->GetMPIComm();
-  assert(comm);
-
-  SetupFileViewFunctor work(*comm, *handle, extent, wextent, offset, this->Internal->Settings.ByteOrder);
-  vtkDataArrayDispatcher<SetupFileViewFunctor> dispatcher(work);
-  try
-    {
-    dispatcher.Go(scalar);
-    }
-  catch (MPIPlot3DException)
-    {
-    return 0;
-    }
-  return 1;
-}
-
-//----------------------------------------------------------------------------
-int vtkMPIMultiBlockPLOT3DReader::ReadVector(
-  void* vfp,
-  int extent[6], int wextent[6],
-  int numDims, vtkDataArray* vector, vtkTypeUInt64 offset)
-{
-  if (!this->CanUseMPIIO())
-    {
-    return this->Superclass::ReadVector(vfp, extent, wextent, numDims, vector, offset);
-    }
-
-  vtkMPIOpaqueFileHandle* handle = reinterpret_cast<vtkMPIOpaqueFileHandle*>(vfp);
-  assert(handle);
-
-  vtkMPICommunicatorOpaqueComm* comm =
-    vtkMPICommunicator::SafeDownCast(this->Controller->GetCommunicator())->GetMPIComm();
-  assert(comm);
-
-  SetupFileViewFunctor work(*comm, *handle, extent, wextent, offset, this->Internal->Settings.ByteOrder);
-  vtkDataArrayDispatcher<SetupFileViewFunctor> dispatcher(work);
-  try
-    {
-    dispatcher.Go(vector);
-    }
-  catch (MPIPlot3DException)
-    {
-    return 0;
-    }
-  return 1;
-}
-
-//----------------------------------------------------------------------------
-void vtkMPIMultiBlockPLOT3DReader::PrintSelf(ostream& os, vtkIndent indent)
-{
-  this->Superclass::PrintSelf(os, indent);
-  os << indent << "UseMPIIO: " << this->UseMPIIO << endl;
-}
diff --git a/IO/MPIParallel/vtkMPIMultiBlockPLOT3DReader.h b/IO/MPIParallel/vtkMPIMultiBlockPLOT3DReader.h
deleted file mode 100644
index 4692d5b..0000000
--- a/IO/MPIParallel/vtkMPIMultiBlockPLOT3DReader.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkMPIMultiBlockPLOT3DReader.h
-
-  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.
-
-=========================================================================*/
-// .NAME vtkMPIMultiBlockPLOT3DReader - vtkMultiBlockPLOT3DReader subclass that
-// uses MPI-IO to efficiently read binary files for 3D domains in parallel using
-// MPI-IO.
-// .SECTION Description
-// vtkMPIMultiBlockPLOT3DReader extends vtkMultiBlockPLOT3DReader to use MPI-IO
-// instead of POSIX IO to read file in parallel.
-
-#ifndef vtkMPIMultiBlockPLOT3DReader_h
-#define vtkMPIMultiBlockPLOT3DReader_h
-
-#include "vtkMultiBlockPLOT3DReader.h"
-#include "vtkIOMPIParallelModule.h" // For export macro
-
-class VTKIOMPIPARALLEL_EXPORT vtkMPIMultiBlockPLOT3DReader : public vtkMultiBlockPLOT3DReader
-{
-public:
-  static vtkMPIMultiBlockPLOT3DReader* New();
-  vtkTypeMacro(vtkMPIMultiBlockPLOT3DReader, vtkMultiBlockPLOT3DReader);
-  void PrintSelf(ostream& os, vtkIndent indent);
-
-  // Description:
-  // Use this to override using MPI-IO. When set to false (default is true),
-  // this class will simply forward all method calls to the superclass.
-  vtkSetMacro(UseMPIIO, bool);
-  vtkGetMacro(UseMPIIO, bool);
-  vtkBooleanMacro(UseMPIIO, bool);
-
-protected:
-  vtkMPIMultiBlockPLOT3DReader();
-  ~vtkMPIMultiBlockPLOT3DReader();
-
-  // Description:
-  // Determines we should use MPI-IO for the current file. We don't use MPI-IO
-  // for 2D files or ASCII files.
-  bool CanUseMPIIO();
-
-  virtual int OpenFileForDataRead(void*& fp, const char* fname);
-  virtual void CloseFile(void* fp);
-
-  virtual int ReadIntScalar(
-    void* vfp,
-    int extent[6], int wextent[6],
-    vtkDataArray* scalar, vtkTypeUInt64 offset);
-  virtual int ReadScalar(
-    void* vfp,
-    int extent[6], int wextent[6],
-    vtkDataArray* scalar, vtkTypeUInt64 offset);
-  virtual int ReadVector(
-    void* vfp,
-    int extent[6], int wextent[6],
-    int numDims, vtkDataArray* vector, vtkTypeUInt64 offset);
-
-  bool UseMPIIO;
-private:
-  vtkMPIMultiBlockPLOT3DReader(const vtkMPIMultiBlockPLOT3DReader&); // Not implemented.
-  void operator=(const vtkMPIMultiBlockPLOT3DReader&); // Not implemented.
-};
-
-#endif
diff --git a/IO/NetCDF/vtkMPASReader.cxx b/IO/NetCDF/vtkMPASReader.cxx
index b2dd5b3..d6fb35d 100644
--- a/IO/NetCDF/vtkMPASReader.cxx
+++ b/IO/NetCDF/vtkMPASReader.cxx
@@ -117,7 +117,10 @@ class vtkMPASReader::Internal {
   };
   ~Internal()
   {
-    delete ncFile;
+    if(this->ncFile)
+      {
+      delete ncFile;
+      }
   };
 
   NcFile* ncFile;
diff --git a/IO/NetCDF/vtkNetCDFCAMReader.cxx b/IO/NetCDF/vtkNetCDFCAMReader.cxx
index 1ff4c36..4daf091 100644
--- a/IO/NetCDF/vtkNetCDFCAMReader.cxx
+++ b/IO/NetCDF/vtkNetCDFCAMReader.cxx
@@ -18,7 +18,6 @@
 #include "vtkDoubleArray.h"
 #include "vtkFieldData.h"
 #include "vtkFloatArray.h"
-#include "vtkIncrementalOctreePointLocator.h"
 #include "vtkInformation.h"
 #include "vtkInformationVector.h"
 #include "vtkMath.h"
@@ -30,7 +29,7 @@
 #include "vtkStreamingDemandDrivenPipeline.h"
 #include "vtkUnstructuredGrid.h"
 
-#include <vector>
+#include <map>
 #include <vtk_netcdfcpp.h>
 
 namespace
@@ -39,30 +38,14 @@ namespace
 // a cell that wraps from the right side of the domain to the left side)
   bool IsCellInverted(double points[4][3])
   {
-    // We test the normal 3 points at a time. Not all grids are well-behaved
-    // i.e. consistenly use 0 or 360. We've had grid where 3 points on the left
-    // side, and just 1 on the right. Just checking the first 3 points (which is
-    // what ComputeNormal() does, we may (and do) miss a few cells.
-    // See BUG #0014897.
     double normal[3];
-    vtkPolygon::ComputeNormal(3, points[0], normal);
-    if(normal[2] > 0)
-      {
-      return true;
-      }
-    vtkPolygon::ComputeNormal(3, points[1], normal);
+    vtkPolygon::ComputeNormal(4, points[0], normal);
     if(normal[2] > 0)
       {
       return true;
       }
     return false;
   }
-
-  template <class T>
-  inline bool IsZero(const T& val)
-    {
-    return std::abs(val) < std::numeric_limits<T>::epsilon();
-    }
 }
 
 vtkStandardNewMacro(vtkNetCDFCAMReader);
@@ -77,6 +60,7 @@ vtkNetCDFCAMReader::vtkNetCDFCAMReader()
   this->PointsFile = NULL;
   this->ConnectivityFile = NULL;
   this->SingleLevel = 0;
+  this->CellLayerRight = 1;
   this->TimeSteps = NULL;
   this->NumberOfTimeSteps = 0;
   this->SetNumberOfInputPorts(0);
@@ -154,8 +138,11 @@ void vtkNetCDFCAMReader::SetConnectivityFileName(const char* fileName)
     {
     return;
     }
-  delete this->ConnectivityFile;
-  this->ConnectivityFile = NULL;
+  if(this->ConnectivityFile)
+    {
+    delete this->ConnectivityFile;
+    this->ConnectivityFile = NULL;
+    }
   delete [] this->ConnectivityFileName;
   if (fileName)
     {
@@ -218,7 +205,10 @@ int vtkNetCDFCAMReader::RequestInformation(
 
   if (this->NumberOfTimeSteps > 0)
     {
-    delete []this->TimeSteps;
+    if(this->TimeSteps)
+      {
+      delete []this->TimeSteps;
+      }
     this->TimeSteps = new double[this->NumberOfTimeSteps];
     NcVar* timeVar = this->PointsFile->get_var("time");
     timeVar->get(this->TimeSteps, this->NumberOfTimeSteps);
@@ -346,8 +336,6 @@ int vtkNetCDFCAMReader::RequestData(
   NcVar* lon = this->PointsFile->get_var("lon");
   NcVar* lat = this->PointsFile->get_var("lat");
   vtkSmartPointer<vtkPoints> points = vtkSmartPointer<vtkPoints>::New();
-  output->SetPoints(points);
-
   long numFilePoints = dimension->size();
   if(lat == NULL || lon == NULL)
     {
@@ -396,19 +384,11 @@ int vtkNetCDFCAMReader::RequestData(
   // domain and only the points on the left boundary are included in
   // the points file.  if a cell uses a point that is on the left
   // boundary and it should be on the right boundary we will have
-  // to create that point.  That's what boundaryPoints is used for.
-  // The (index + numFilePoints) gives us the new point id, and the value
-  // for that in this array will correspond to the original point id that the
-  // boundaryPoint is duplicate of.
-  std::vector<vtkIdType> boundaryPoints;
-
-  // To avoid creating multiple duplicates, we we a
-  // vtkIncrementalOctreePointLocator.
-  vtkSmartPointer<vtkIncrementalOctreePointLocator> locator =
-    vtkSmartPointer<vtkIncrementalOctreePointLocator>::New();
-  locator->SetDataSet(output); // dataset only has points right now.
-  locator->BuildLocator();
-
+  // to create that point.  that's what boundaryPoints is used for.
+  // note that if this->CellLayerRight is false then we do the opposite
+  // and make the 'connecting' cell on the left side of the domain
+  // we don't actually build the cells yet though.
+  std::map<vtkIdType, vtkIdType> boundaryPoints;
   dimension = this->ConnectivityFile->get_dim("ncells");
   if(dimension == NULL)
     {
@@ -437,6 +417,8 @@ int vtkNetCDFCAMReader::RequestData(
   connectivity->set_cur(0, beginCell);
   connectivity->get(&(cellConnectivity[0]), 4, numLocalCells);
 
+  double leftSide = 1.;
+  double rightSide = 359.;
   for(long i=0;i<numLocalCells;i++)
     {
     vtkIdType pointIds[4];
@@ -446,87 +428,45 @@ int vtkNetCDFCAMReader::RequestData(
       pointIds[j] = cellConnectivity[i+j*numLocalCells]-1;
       points->GetPoint(pointIds[j], coords[j]);
       }
-    if (IsCellInverted(coords) == true)
+    if(IsCellInverted(coords) == true)
       {
-      // First decide whether we're putting this cell on the 360 side (right) or on the
-      // 0 side (left). We decide this based on which side will have the
-      // smallest protrusion.
-      double delta = 0.0;
-      bool anchorLeft = false;
-      for (int j=0; j < 4; ++j)
+      for(int j=0;j<4;j++)
         {
-        // We're assured that coords[j][0] is in the range [0, 360].
-        // We just that fact to avoid having to do a std::abs() here.
-        double rightDelta = (360.0 - coords[j][0]);
-        double leftDelta = coords[j][0]; // i.e. (coords[j][0] - 0.0).
-        if (IsZero(rightDelta) || IsZero(leftDelta) || rightDelta == leftDelta)
+        if(this->CellLayerRight && coords[j][0] < leftSide)
           {
-          // if the point is equidistant from both ends or is one of the ends,
-          // we let the other points in this cell dictate where the cell should
-          // anchor since this point can easily be anchored on either side with
-          // no side effects.
-          continue;
-          }
-        if (rightDelta < leftDelta)
-          {
-          if (rightDelta > delta)
-            {
-            delta = rightDelta;
-            anchorLeft = false;
-            }
-          }
-        else
-          {
-          if (leftDelta > delta)
-            {
-            delta = leftDelta;
-            anchorLeft = true;
-            }
-          }
-        }
-      // Once we've decided where we're anchoring we adjust the points.
-      for (int j=0; j < 4; ++j)
-        {
-        if (anchorLeft)
-          {
-          // if coords[j] is closer to right (360), move it to the left.
-          if ( (360.0 - coords[j][0]) < coords[j][0] )
-            {
-            coords[j][0] -= 360.0;
+          std::map<vtkIdType, vtkIdType>::iterator otherPoint =
+            boundaryPoints.find(pointIds[j]);
+          if(otherPoint != boundaryPoints.end())
+            { // already made point on the right boundary
+            cellConnectivity[i+j*numLocalCells] = otherPoint->second + 1;
             }
           else
-            {
-            continue;
+            { // need to make point on the right boundary
+            vtkIdType index =
+              points->InsertNextPoint(coords[j][0]+360., coords[j][1], coords[j][2]);
+            cellConnectivity[i+j*numLocalCells] = index+1;
+            boundaryPoints[pointIds[j]] = index;
             }
           }
-        else
+        else if(this->CellLayerRight == 0 && coords[j][0] > rightSide)
           {
-          // if coords[j] is closer to left (0), move it to the right
-          if ( coords[j][0] < (360.0 - coords[j][0]) )
-            {
-            coords[j][0] += 360.0;
+          std::map<vtkIdType, vtkIdType>::iterator otherPoint =
+            boundaryPoints.find(pointIds[j]);
+          if(otherPoint != boundaryPoints.end())
+            { // already made point on the right boundary
+            cellConnectivity[i+j*numLocalCells] = otherPoint->second+1;
             }
           else
-            {
-            continue;
+            { // need to make point on the right boundary
+            vtkIdType index =
+              points->InsertNextPoint(coords[j][0]-360., coords[j][1], coords[j][2]);
+            cellConnectivity[i+j*numLocalCells] = index+1;
+            boundaryPoints[pointIds[j]] = index;
             }
           }
-        // Okay, we have moved the coords. Update the boundaryPoints so which
-        // original point id is this new point id a clone of.
-        vtkIdType newPtId;
-        if (locator->InsertUniquePoint(coords[j], newPtId) == 1)
-          {
-          // if a new point was indeed inserted, we need to update the
-          // boundaryPoints to keep track of it.
-          assert(newPtId >= numFilePoints && pointIds[j] < newPtId);
-          assert(static_cast<vtkIdType>(boundaryPoints.size()) == (newPtId-numFilePoints));
-          boundaryPoints.push_back(pointIds[j]);
-          }
-        cellConnectivity[i+j*numLocalCells] = (newPtId + 1); // note: 1-indexed.
         }
       }
     }
-  locator = NULL; // release the locator memory.
 
   // we now have all of the points at a single level.  build them up
   // for the rest of the levels before creating the cells.
@@ -550,7 +490,7 @@ int vtkNetCDFCAMReader::RequestData(
     }
 
   points->Modified();
-  points->Squeeze();
+  output->SetPoints(points);
 
   this->SetProgress(.5);  // educated guess for progress
 
@@ -667,16 +607,13 @@ int vtkNetCDFCAMReader::RequestData(
   pointData->CopyAllOn();
   pointData->CopyAllocate(output->GetPointData(),
                           output->GetNumberOfPoints());
-
-  vtkIdType newPtId=0;
-  for (std::vector<vtkIdType>::const_iterator it=
-        boundaryPoints.begin(); it!=boundaryPoints.end(); ++it, ++newPtId)
+  for(std::map<vtkIdType, vtkIdType>::const_iterator it=
+        boundaryPoints.begin();it!=boundaryPoints.end();it++)
     {
     for(long lev=0;lev<numLocalCellLevels+1-this->SingleLevel;lev++)
       {
-      vtkIdType srcId = (*it) + lev * numPointsPerLevel;
-      vtkIdType destId = (newPtId + numFilePoints) + lev * numPointsPerLevel;
-      pointData->CopyData(pointData, srcId, destId);
+      pointData->CopyData(pointData, it->first+lev*numPointsPerLevel,
+                          it->second+lev*numPointsPerLevel);
       }
     }
 
@@ -825,23 +762,6 @@ bool vtkNetCDFCAMReader::GetPartitioning(
 }
 
 //----------------------------------------------------------------------------
-#if !defined(VTK_LEGACY_REMOVE)
-void vtkNetCDFCAMReader::SetCellLayerRight(int)
-{
-  VTK_LEGACY_BODY(vtkNetCDFCAMReader::SetCellLayerRight, "VTK 6.3");
-}
-#endif
-
-//----------------------------------------------------------------------------
-#if !defined(VTK_LEGACY_REMOVE)
-int vtkNetCDFCAMReader::GetCellLayerRight()
-{
-  VTK_LEGACY_BODY(vtkNetCDFCAMReader::GetCellLayerRight, "VTK 6.3");
-  return 0;
-}
-#endif
-
-//----------------------------------------------------------------------------
 void vtkNetCDFCAMReader::PrintSelf(ostream& os, vtkIndent indent)
 {
   this->Superclass::PrintSelf(os,indent);
@@ -851,6 +771,7 @@ void vtkNetCDFCAMReader::PrintSelf(ostream& os, vtkIndent indent)
     (this->ConnectivityFileName ? this->ConnectivityFileName : "(NULL)")
      << endl;
   os << indent << "SingleLevel: " << this->SingleLevel << endl;
+  os << indent << "CellLayerRight: " << this->CellLayerRight << endl;
   if(this->PointsFile)
     {
     os << indent << "PointsFile: " << this->PointsFile << endl;
diff --git a/IO/NetCDF/vtkNetCDFCAMReader.h b/IO/NetCDF/vtkNetCDFCAMReader.h
index 43f0b63..6100dfc 100644
--- a/IO/NetCDF/vtkNetCDFCAMReader.h
+++ b/IO/NetCDF/vtkNetCDFCAMReader.h
@@ -67,10 +67,8 @@ public:
   // Specify which "side" of the domain to add the connecting
   // cells at.  0 indicates left side and 1 indicates right side.
   // The default is the right side.
-  // @deprecated This method is no longer supported. The reader automatically
-  // decides which side to pad cells on. Using this method has no effect.
-  VTK_LEGACY(void SetCellLayerRight(int));
-  VTK_LEGACY(int GetCellLayerRight());
+  vtkSetMacro(CellLayerRight, int);
+  vtkGetMacro(CellLayerRight, int);
 
 protected:
   vtkNetCDFCAMReader();
@@ -112,6 +110,8 @@ private:
 
   int SingleLevel;
 
+  int CellLayerRight;
+
   double * TimeSteps;
 
   long NumberOfTimeSteps;
diff --git a/IO/NetCDF/vtkNetCDFCFReader.cxx b/IO/NetCDF/vtkNetCDFCFReader.cxx
index b6ac639..18e8eb4 100644
--- a/IO/NetCDF/vtkNetCDFCFReader.cxx
+++ b/IO/NetCDF/vtkNetCDFCFReader.cxx
@@ -1090,13 +1090,6 @@ int vtkNetCDFCFReader::RequestData(vtkInformation *request,
         // Just fake some coordinates (related to ParaView bug #11543).
         this->FakeRectilinearCoordinates(rectilinearOutput);
         break;
-      case COORDS_UNIFORM_RECTILINEAR:
-      case COORDS_NONUNIFORM_RECTILINEAR:
-      case COORDS_REGULAR_SPHERICAL:
-      case COORDS_2D_EUCLIDEAN:
-      case COORDS_2D_SPHERICAL:
-      case COORDS_EUCLIDEAN_4SIDED_CELLS:
-      case COORDS_SPHERICAL_4SIDED_CELLS:
       default:
         this->AddRectilinearCoordinates(rectilinearOutput);
       }
@@ -2024,9 +2017,6 @@ void vtkNetCDFCFReader::IdentifySphericalCoordinates(vtkIntArray *dimensions,
       case vtkDimensionInfo::LATITUDE_UNITS:
         latitudeDim = i;
         break;
-      case vtkDimensionInfo::UNDEFINED_UNITS:
-      case vtkDimensionInfo::TIME_UNITS:
-      case vtkDimensionInfo::VERTICAL_UNITS:
       default:
         verticalDim = i;
         break;
diff --git a/IO/PLY/vtkPLY.cxx b/IO/PLY/vtkPLY.cxx
index 32c84e0..1250c19 100644
--- a/IO/PLY/vtkPLY.cxx
+++ b/IO/PLY/vtkPLY.cxx
@@ -1253,7 +1253,7 @@ PlyOtherElems *vtkPLY::ply_get_other_element (
 
   /* set up for getting elements */
   other->other_props = vtkPLY::ply_get_other_properties (plyfile, elem_name,
-                         static_cast<int>(offsetof(OtherData,other_props)));
+                         offsetof(OtherData,other_props));
 
   /* grab all these elements */
   for (i = 0; i < other->elem_count; i++) {
@@ -1297,7 +1297,7 @@ void vtkPLY::ply_describe_other_elements (
     other = &(other_elems->other_list[i]);
     vtkPLY::ply_element_count (plyfile, other->elem_name, other->elem_count);
     vtkPLY::ply_describe_other_properties (plyfile, other->other_props,
-                       static_cast<int>(offsetof(OtherData,other_props)));
+                                   offsetof(OtherData,other_props));
   }
 }
 
diff --git a/IO/PLY/vtkPLYReader.h b/IO/PLY/vtkPLYReader.h
index 5490995..fb9976e 100644
--- a/IO/PLY/vtkPLYReader.h
+++ b/IO/PLY/vtkPLYReader.h
@@ -31,12 +31,12 @@
 #define vtkPLYReader_h
 
 #include "vtkIOPLYModule.h" // For export macro
-#include "vtkAbstractPolyDataReader.h"
+#include "vtkPolyDataAlgorithm.h"
 
-class VTKIOPLY_EXPORT vtkPLYReader : public vtkAbstractPolyDataReader
+class VTKIOPLY_EXPORT vtkPLYReader : public vtkPolyDataAlgorithm
 {
 public:
-  vtkTypeMacro(vtkPLYReader,vtkAbstractPolyDataReader);
+  vtkTypeMacro(vtkPLYReader,vtkPolyDataAlgorithm);
   void PrintSelf(ostream& os, vtkIndent indent);
 
   // Description:
@@ -44,6 +44,11 @@ public:
   static vtkPLYReader *New();
 
   // Description:
+  // Specify file name of stereo lithography file.
+  vtkSetStringMacro(FileName);
+  vtkGetStringMacro(FileName);
+
+  // Description:
   // A simple, non-exhaustive check to see if a file is a valid ply file.
   static int CanReadFile(const char *filename);
 
@@ -51,6 +56,8 @@ protected:
   vtkPLYReader();
   ~vtkPLYReader();
 
+  char *FileName;
+
   int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *);
 private:
   vtkPLYReader(const vtkPLYReader&);  // Not implemented.
diff --git a/IO/PLY/vtkPLYWriter.cxx b/IO/PLY/vtkPLYWriter.cxx
index 4ab2bea..a922da4 100644
--- a/IO/PLY/vtkPLYWriter.cxx
+++ b/IO/PLY/vtkPLYWriter.cxx
@@ -47,8 +47,11 @@ vtkPLYWriter::~vtkPLYWriter()
     {
     this->LookupTable->Delete();
     }
-  delete [] this->ArrayName;
-  delete [] this->FileName;
+  if ( this->ArrayName )
+    {
+    delete [] this->ArrayName;
+    }
+  delete[] this->FileName;
 }
 
 typedef struct _plyVertex {
diff --git a/IO/Parallel/CMakeLists.txt b/IO/Parallel/CMakeLists.txt
index 84397a8..3b4af83 100644
--- a/IO/Parallel/CMakeLists.txt
+++ b/IO/Parallel/CMakeLists.txt
@@ -1,9 +1,6 @@
 set(Module_SRCS
   vtkEnSightWriter.cxx
   # vtkExodusIIWriter.cxx needs vtkMultiProcessController
-  vtkMultiBlockPLOT3DReader.cxx
-  vtkMultiBlockPLOT3DReaderInternals.cxx
-  vtkPlot3DMetaReader.cxx
   vtkPChacoReader.cxx
   vtkPDataSetReader.cxx
   vtkPDataSetWriter.cxx
@@ -12,9 +9,4 @@ set(Module_SRCS
   vtkPSLACReader.cxx
   )
 
-set_source_files_properties(
-  vtkMultiBlockPLOT3DReaderInternals
-  WRAP_EXCLUDE
-  )
-
 vtk_module_library(vtkIOParallel ${Module_SRCS})
diff --git a/IO/Parallel/Testing/Python/TestPDataSetReaderGrid.py b/IO/Parallel/Testing/Python/TestPDataSetReaderGrid.py
index 94ea224..9b7e920 100755
--- a/IO/Parallel/Testing/Python/TestPDataSetReaderGrid.py
+++ b/IO/Parallel/Testing/Python/TestPDataSetReaderGrid.py
@@ -38,12 +38,6 @@ if (catch.catch(globals(),"""channel = open("test.tmp", "w")""") == 0):
     mapper.SetPiece(0)
     mapper.SetGhostLevel(1)
     mapper.Update()
-    w = vtk.vtkDataSetWriter()
-#    w.SetInputData(mapper.GetInput())
-    w.SetInputData(surface.GetInput())
-    w.SetFileName("foo.vtk")
-    w.SetFileTypeToASCII()
-    w.Write()
     file.delete("-force", "comb.pvtk")
     file.delete("-force", "comb.0.vtk")
     file.delete("-force", "comb.1.vtk")
@@ -81,7 +75,7 @@ if (catch.catch(globals(),"""channel = open("test.tmp", "w")""") == 0):
     mapper2.SetGhostLevel(0)
     mapper2.Update()
     # Strip the ghost cells requested by the contour filter
-    mapper2.GetInput().RemoveGhostCells()
+    mapper2.GetInput().RemoveGhostCells(1)
     file.delete("-force", "fractal.pvtk")
     file.delete("-force", "fractal.0.vtk")
     file.delete("-force", "fractal.1.vtk")
diff --git a/IO/Parallel/module.cmake b/IO/Parallel/module.cmake
index 92e6ca0..1b3049b 100644
--- a/IO/Parallel/module.cmake
+++ b/IO/Parallel/module.cmake
@@ -9,9 +9,7 @@ vtk_module(vtkIOParallel
     vtkIOImage
   PRIVATE_DEPENDS
     vtkexodusII
-    vtkjsoncpp
     vtknetcdf
-    vtksys
   TEST_DEPENDS
     vtkParallelMPI
     vtkRenderingParallel
diff --git a/IO/Parallel/vtkEnSightWriter.cxx b/IO/Parallel/vtkEnSightWriter.cxx
index 47ecac8..d93a65d 100644
--- a/IO/Parallel/vtkEnSightWriter.cxx
+++ b/IO/Parallel/vtkEnSightWriter.cxx
@@ -295,9 +295,9 @@ void vtkEnSightWriter::WriteData()
     }
 
   //get the Ghost Cell Array if it exists
-  vtkDataArray *GhostData=input->GetCellData()->GetScalars(vtkDataSetAttributes::GhostArrayName());
+  vtkDataArray *GhostData=input->GetCellData()->GetScalars("vtkGhostLevels");
   //if the strings are not the same then we did not get the ghostData array
-  if (GhostData==NULL || strcmp(GhostData->GetName(), vtkDataSetAttributes::GhostArrayName()))
+  if (GhostData==NULL || strcmp(GhostData->GetName(),"vtkGhostLevels"))
     {
     GhostData=NULL;
     }
@@ -463,10 +463,7 @@ void vtkEnSightWriter::WriteData()
       if (GhostData)
         {
         ghostLevel=(int)(GhostData->GetTuple(CellsByPart[part][j])[0]);
-        if (ghostLevel & vtkDataSetAttributes::DUPLICATECELL)
-          {
-          ghostLevel=1;
-          }
+        if (ghostLevel>1) ghostLevel=1;
         }
       //we want to sort out the ghost cells from the normal cells
       //so the element type will be ghostMultiplier*ghostLevel+elementType
diff --git a/IO/Parallel/vtkMultiBlockPLOT3DReader.cxx b/IO/Parallel/vtkMultiBlockPLOT3DReader.cxx
deleted file mode 100644
index 81ffb69..0000000
--- a/IO/Parallel/vtkMultiBlockPLOT3DReader.cxx
+++ /dev/null
@@ -1,3391 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkMultiBlockPLOT3DReader.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 "vtkMultiBlockPLOT3DReader.h"
-
-#include "vtkByteSwap.h"
-#include "vtkCompositeDataPipeline.h"
-#include "vtkDoubleArray.h"
-#include "vtkErrorCode.h"
-#include "vtkExtentTranslator.h"
-#include "vtkFieldData.h"
-#include "vtkFloatArray.h"
-#include "vtkMultiBlockDataSet.h"
-#include "vtkInformation.h"
-#include "vtkInformationVector.h"
-#include "vtkIntArray.h"
-#include "vtkObjectFactory.h"
-#include "vtkPointData.h"
-#include "vtkStreamingDemandDrivenPipeline.h"
-#include "vtkStructuredGrid.h"
-#include "vtkUnsignedCharArray.h"
-#include "vtkIdList.h"
-#include "vtkCellData.h"
-#include "vtkMultiProcessController.h"
-#include "vtkDummyController.h"
-
-#include "vtkNew.h"
-
-#include "vtkMultiBlockPLOT3DReaderInternals.h"
-
-#include <exception>
-
-#ifdef _WIN64
-# define vtk_fseek _fseeki64
-# define vtk_ftell _ftelli64
-# define vtk_off_t __int64
-#else
-# define vtk_fseek fseek
-# define vtk_ftell ftell
-# define vtk_off_t long
-#endif
-
-vtkObjectFactoryNewMacro(vtkMultiBlockPLOT3DReader);
-
-vtkCxxSetObjectMacro(vtkMultiBlockPLOT3DReader,
-                     Controller,
-                     vtkMultiProcessController);
-
-#define VTK_RHOINF 1.0
-#define VTK_CINF 1.0
-#define VTK_PINF ((VTK_RHOINF*VTK_CINF) * (VTK_RHOINF*VTK_CINF) / this->Gamma)
-#define VTK_CV (this->R / (this->Gamma-1.0))
-
-template <class DataType>
-class vtkPLOT3DArrayReader
-{
-public:
-  vtkPLOT3DArrayReader() : ByteOrder(
-    vtkMultiBlockPLOT3DReader::FILE_BIG_ENDIAN)
-    {
-    }
-
-  vtkIdType ReadScalar(FILE* fp,
-                    vtkIdType preskip,
-                    vtkIdType n,
-                    vtkIdType postskip,
-                    DataType* scalar)
-    {
-      if (preskip > 0)
-        {
-        vtk_fseek(fp, preskip*sizeof(DataType), SEEK_CUR);
-        }
-      vtkIdType retVal = static_cast<vtkIdType>(
-        fread(scalar, sizeof(DataType), n, fp));
-      vtk_fseek(fp, postskip*sizeof(DataType), SEEK_CUR);
-      if (this->ByteOrder == vtkMultiBlockPLOT3DReader::FILE_LITTLE_ENDIAN)
-        {
-        if (sizeof(DataType) == 4)
-          {
-          vtkByteSwap::Swap4LERange(scalar, n);
-          }
-        else
-          {
-          vtkByteSwap::Swap8LERange(scalar, n);
-          }
-        }
-      else
-        {
-        if (sizeof(DataType) == 4)
-          {
-          vtkByteSwap::Swap4BERange(scalar, n);
-          }
-        else
-          {
-          vtkByteSwap::Swap8BERange(scalar, n);
-          }
-        }
-      return retVal;
-    }
-
-  void CalculateSkips(int extent[6], int wextent[6],
-                      vtkIdType& preskip, vtkIdType& postskip)
-    {
-    vtkIdType nPtsInPlane = static_cast<vtkIdType>(wextent[1]+1)*(wextent[3]+1);
-    preskip = nPtsInPlane * extent[4];
-    postskip = nPtsInPlane * (wextent[5] - extent[5]);
-    }
-
-  vtkIdType ReadVector(FILE* fp,
-                    int extent[6], int wextent[6],
-                    int numDims, DataType* vector)
-    {
-      vtkIdType n = vtkStructuredData::GetNumberOfPoints(extent);
-
-      // Setting to 0 in case numDims == 0. We still need to
-      // populate an array with 3 components but the code below
-      // does not read the 3rd component (it doesn't exist
-      // in the file)
-      memset(vector, 0, n*3*sizeof(DataType));
-
-      vtkIdType retVal = 0;
-      DataType* buffer = new DataType[n];
-      for (int component = 0; component < numDims; component++)
-        {
-        vtkIdType preskip, postskip;
-        this->CalculateSkips(extent, wextent, preskip, postskip);
-        retVal += this->ReadScalar(fp, preskip, n, postskip, buffer);
-        for (vtkIdType i=0; i<n; i++)
-          {
-          vector[3*i+component] = buffer[i];
-          }
-        }
-      delete[] buffer;
-
-      return retVal;
-    }
-
-  int ByteOrder;
-};
-
-vtkMultiBlockPLOT3DReader::vtkMultiBlockPLOT3DReader()
-{
-  this->Internal = new vtkMultiBlockPLOT3DReaderInternals;
-
-  this->XYZFileName = NULL;
-  this->QFileName = NULL;
-  this->FunctionFileName = NULL;
-  this->BinaryFile = 1;
-  this->HasByteCount = 0;
-  this->FileSize = 0;
-  this->MultiGrid = 0;
-  this->ForceRead = 0;
-  this->ByteOrder = FILE_BIG_ENDIAN;
-  this->IBlanking = 0;
-  this->TwoDimensionalGeometry = 0;
-  this->DoublePrecision = 0;
-  this->AutoDetectFormat = 0;
-
-  this->R = 1.0;
-  this->Gamma = 1.4;
-
-  this->FunctionList = vtkIntArray::New();
-
-  this->ScalarFunctionNumber = -1;
-  this->SetScalarFunctionNumber(100);
-  this->VectorFunctionNumber = -1;
-  this->SetVectorFunctionNumber(202);
-
-  this->SetNumberOfInputPorts(0);
-
-  this->Controller = 0;
-  this->SetController(vtkMultiProcessController::GetGlobalController());
-
-  this->ExecutedGhostLevels = 0;
-}
-
-vtkMultiBlockPLOT3DReader::~vtkMultiBlockPLOT3DReader()
-{
-  delete [] this->XYZFileName;
-  delete [] this->QFileName;
-  delete [] this->FunctionFileName;
-  this->FunctionList->Delete();
-  this->ClearGeometryCache();
-
-  delete this->Internal;
-
-  this->SetController(0);
-}
-
-void vtkMultiBlockPLOT3DReader::ClearGeometryCache()
-{
-  this->Internal->Blocks.clear();
-}
-
-int vtkMultiBlockPLOT3DReader::AutoDetectionCheck(FILE* fp)
-{
-  this->Internal->CheckBinaryFile(fp, this->FileSize);
-
-  if (!this->Internal->Settings.BinaryFile)
-    {
-    vtkDebugMacro("Auto-detection only works with binary files.");
-    if (this->BinaryFile)
-      {
-      vtkWarningMacro("This appears to be an ASCII file. Please make sure "
-                      "that all settings are correct to read it correctly.");
-      }
-    this->Internal->Settings.ByteOrder = this->ByteOrder;
-    this->Internal->Settings.HasByteCount = this->HasByteCount;
-    this->Internal->Settings.MultiGrid = this->MultiGrid;
-    this->Internal->Settings.NumberOfDimensions = this->TwoDimensionalGeometry ? 2 : 3;
-    this->Internal->Settings.Precision = this->DoublePrecision ? 8 : 4;
-    this->Internal->Settings.IBlanking = this->IBlanking;
-    return 1;
-    }
-
-  if (!this->Internal->CheckByteOrder(fp))
-    {
-    vtkErrorMacro("Could not determine big/little endianness of file.")
-    return 0;
-    }
-  if (!this->Internal->CheckByteCount(fp))
-    {
-    vtkErrorMacro("Could not determine if file has Fortran byte counts.")
-    return 0;
-    }
-
-  if (!this->Internal->Settings.HasByteCount)
-    {
-    if (!this->Internal->CheckCFile(fp, this->FileSize))
-      {
-      vtkErrorMacro("Could not determine settings for file. Cannot read.")
-      return 0;
-      }
-    }
-  else
-    {
-    if (!this->Internal->CheckMultiGrid(fp))
-      {
-      vtkErrorMacro("Could not determine settings for file. Cannot read.")
-      return 0;
-      }
-    if (!this->Internal->Check2DGeom(fp))
-      {
-      vtkErrorMacro("Could not determine settings for file. Cannot read.")
-      return 0;
-      }
-    if (!this->Internal->CheckBlankingAndPrecision(fp))
-      {
-      vtkErrorMacro("Could not determine settings for file. Cannot read.")
-      return 0;
-      }
-    }
-  if (!this->AutoDetectFormat)
-    {
-    if ( !this->ForceRead && (
-           this->Internal->Settings.BinaryFile != this->BinaryFile ||
-           this->Internal->Settings.ByteOrder != this->ByteOrder ||
-           this->Internal->Settings.HasByteCount != this->HasByteCount ||
-           this->Internal->Settings.MultiGrid != this->MultiGrid ||
-           this->Internal->Settings.NumberOfDimensions != (this->TwoDimensionalGeometry ? 2 : 3) ||
-           this->Internal->Settings.Precision != (this->DoublePrecision ? 8 : 4) ||
-           this->Internal->Settings.IBlanking != this->IBlanking ) )
-      {
-      vtkErrorMacro(<< "The settings that you provided do not match what was auto-detected "
-              << "in the file. The detected settings are: " << "\n"
-              << "BinaryFile: " << (this->Internal->Settings.BinaryFile ? 1 : 0) << "\n"
-              << "ByteOrder: " << this->Internal->Settings.ByteOrder << "\n"
-              << "HasByteCount: " << (this->Internal->Settings.HasByteCount ? 1 : 0) << "\n"
-              << "MultiGrid: " << (this->Internal->Settings.MultiGrid ? 1 : 0) << "\n"
-              << "NumberOfDimensions: " << this->Internal->Settings.NumberOfDimensions << "\n"
-              << "DoublePrecision: " << (this->Internal->Settings.Precision == 4 ? 0 : 1) << "\n"
-              << "IBlanking: " << (this->Internal->Settings.IBlanking ? 1 : 0) << endl);
-      return 0;
-      }
-    this->Internal->Settings.BinaryFile = this->BinaryFile;
-    this->Internal->Settings.ByteOrder = this->ByteOrder;
-    this->Internal->Settings.HasByteCount = this->HasByteCount;
-    this->Internal->Settings.MultiGrid = this->MultiGrid;
-    this->Internal->Settings.NumberOfDimensions = this->TwoDimensionalGeometry ? 2 : 3;
-    this->Internal->Settings.Precision = this->DoublePrecision ? 8 : 4;
-    this->Internal->Settings.IBlanking = this->IBlanking;
-    return 1;
-    }
-  return 1;
-}
-
-int vtkMultiBlockPLOT3DReader::OpenFileForDataRead(void*& fp, const char* fname)
-{
-  if (this->BinaryFile)
-    {
-    fp = fopen(fname, "rb");
-    }
-  else
-    {
-    fp = fopen(fname, "r");
-    }
-  if ( fp == NULL)
-    {
-    this->SetErrorCode(vtkErrorCode::FileNotFoundError);
-    vtkErrorMacro(<< "File: " << fname << " not found.");
-    return VTK_ERROR;
-    }
-  return VTK_OK;
-}
-
-void vtkMultiBlockPLOT3DReader::CloseFile(void* fp)
-{
-  fclose(reinterpret_cast<FILE*>(fp));
-}
-
-int vtkMultiBlockPLOT3DReader::CheckFile(FILE*& fp, const char* fname)
-{
-  if (this->BinaryFile)
-    {
-    fp = fopen(fname, "rb");
-    }
-  else
-    {
-    fp = fopen(fname, "r");
-    }
-  if ( fp == NULL)
-    {
-    this->SetErrorCode(vtkErrorCode::FileNotFoundError);
-    vtkErrorMacro(<< "File: " << fname << " not found.");
-    return VTK_ERROR;
-    }
-  return VTK_OK;
-}
-
-int vtkMultiBlockPLOT3DReader::CheckGeometryFile(FILE*& xyzFp)
-{
-  if ( this->XYZFileName == NULL || this->XYZFileName[0] == '\0'  )
-    {
-    this->SetErrorCode(vtkErrorCode::NoFileNameError);
-    vtkErrorMacro(<< "Must specify geometry file");
-    return VTK_ERROR;
-    }
-  return this->CheckFile(xyzFp, this->XYZFileName);
-}
-
-int vtkMultiBlockPLOT3DReader::CheckSolutionFile(FILE*& qFp)
-{
-  if ( this->QFileName == NULL || this->QFileName[0] == '\0' )
-    {
-    this->SetErrorCode(vtkErrorCode::NoFileNameError);
-    vtkErrorMacro(<< "Must specify geometry file");
-    return VTK_ERROR;
-    }
-  return this->CheckFile(qFp, this->QFileName);
-}
-
-int vtkMultiBlockPLOT3DReader::CheckFunctionFile(FILE*& fFp)
-{
-  if ( this->FunctionFileName == NULL || this->FunctionFileName[0] == '\0' )
-    {
-    this->SetErrorCode(vtkErrorCode::NoFileNameError);
-    vtkErrorMacro(<< "Must specify geometry file");
-    return VTK_ERROR;
-    }
-  return this->CheckFile(fFp, this->FunctionFileName);
-}
-
-int vtkMultiBlockPLOT3DReader::GetByteCountSize()
-{
-  if (this->Internal->Settings.BinaryFile && this->Internal->Settings.HasByteCount)
-    {
-    return sizeof(int);
-    }
-  return 0;
-}
-
-// Skip Fortran style byte count.
-int vtkMultiBlockPLOT3DReader::SkipByteCount(FILE* fp)
-{
-  int byteCountSize = this->GetByteCountSize();
-  if (byteCountSize > 0)
-    {
-    int tmp;
-    if (fread(&tmp, byteCountSize, 1, fp) != 1)
-      {
-      vtkErrorMacro ("MultiBlockPLOT3DReader error reading file: " << this->XYZFileName
-                     << " Premature EOF while reading skipping byte count.");
-      fclose (fp);
-      return 0;
-      }
-    if (this->Internal->Settings.ByteOrder == vtkMultiBlockPLOT3DReader::FILE_LITTLE_ENDIAN)
-      {
-      vtkByteSwap::Swap4LERange(&tmp, 1);
-      }
-    else
-      {
-      vtkByteSwap::Swap4BERange(&tmp, 1);
-      }
-
-    return tmp;
-    }
-  return 0;
-}
-
-// Read a block of ints (ascii or binary) and return number read.
-int vtkMultiBlockPLOT3DReader::ReadIntBlock(FILE* fp, int n, int* block)
-{
-  if (this->Internal->Settings.BinaryFile)
-    {
-    vtkIdType retVal=static_cast<vtkIdType>(fread(block, sizeof(int), n, fp));
-    if (this->Internal->Settings.ByteOrder == FILE_LITTLE_ENDIAN)
-      {
-      vtkByteSwap::Swap4LERange(block, n);
-      }
-    else
-      {
-      vtkByteSwap::Swap4BERange(block, n);
-      }
-    return retVal == n;
-    }
-  else
-    {
-    vtkIdType count = 0;
-    for(int i=0; i<n; i++)
-      {
-      int num = fscanf(fp, "%d", &(block[i]));
-      if ( num > 0 )
-        {
-        count++;
-        }
-      else
-        {
-        return 0;
-        }
-      }
-    return count == n;
-    }
-}
-
-vtkDataArray* vtkMultiBlockPLOT3DReader::NewFloatArray()
-{
-  if (this->Internal->Settings.Precision == 4)
-    {
-    return vtkFloatArray::New();
-    }
-  else
-    {
-    return vtkDoubleArray::New();
-    }
-}
-
-vtkIdType vtkMultiBlockPLOT3DReader::ReadValues(
-  FILE* fp, int n, vtkDataArray* scalar)
-{
-  if (this->Internal->Settings.BinaryFile)
-    {
-    if (this->Internal->Settings.Precision == 4)
-      {
-      vtkPLOT3DArrayReader<float> arrayReader;
-      arrayReader.ByteOrder = this->Internal->Settings.ByteOrder;
-      vtkFloatArray* floatArray = static_cast<vtkFloatArray*>(scalar);
-      return arrayReader.ReadScalar(fp, 0, n, 0, floatArray->GetPointer(0));
-      }
-    else
-      {
-      vtkPLOT3DArrayReader<double> arrayReader;
-      arrayReader.ByteOrder = this->Internal->Settings.ByteOrder;
-      vtkDoubleArray* doubleArray = static_cast<vtkDoubleArray*>(scalar);
-      return arrayReader.ReadScalar(fp, 0, n, 0, doubleArray->GetPointer(0));
-      }
-    }
-  else
-    {
-    if (this->Internal->Settings.Precision == 4)
-      {
-      vtkFloatArray* floatArray = static_cast<vtkFloatArray*>(scalar);
-      float* values = floatArray->GetPointer(0);
-
-      int count = 0;
-      for(int i=0; i<n; i++)
-        {
-        int num = fscanf(fp, "%f", &(values[i]));
-        if ( num > 0 )
-          {
-          count++;
-          }
-        else
-          {
-          return 0;
-          }
-        }
-      return count;
-      }
-    else
-      {
-      vtkDoubleArray* doubleArray = static_cast<vtkDoubleArray*>(scalar);
-      double* values = doubleArray->GetPointer(0);
-
-      int count = 0;
-      for(int i=0; i<n; i++)
-        {
-        int num = fscanf(fp, "%lf", &(values[i]));
-        if ( num > 0 )
-          {
-          count++;
-          }
-        else
-          {
-          return 0;
-          }
-        }
-      return count;
-      }
-    }
-}
-
-int vtkMultiBlockPLOT3DReader::ReadIntScalar(
-  void* vfp, int extent[6], int wextent[6],
-  vtkDataArray* scalar, vtkTypeUInt64 offset)
-{
-  FILE* fp = reinterpret_cast<FILE*>(vfp);
-  vtkIdType n = vtkStructuredData::GetNumberOfPoints(extent);
-
-  if (this->Internal->Settings.BinaryFile)
-    {
-    if (vtk_fseek(fp, offset, SEEK_SET) != 0)
-      {
-      return 0;
-      }
-
-    vtkPLOT3DArrayReader<int> arrayReader;
-    arrayReader.ByteOrder = this->Internal->Settings.ByteOrder;
-    vtkIdType preskip, postskip;
-    arrayReader.CalculateSkips(extent, wextent, preskip, postskip);
-    vtkIntArray* intArray = static_cast<vtkIntArray*>(scalar);
-    return arrayReader.ReadScalar(
-      fp, preskip, n, postskip, intArray->GetPointer(0)) == n;
-    }
-  else
-    {
-    vtkIntArray* intArray = static_cast<vtkIntArray*>(scalar);
-    return this->ReadIntBlock(fp, n, intArray->GetPointer(0));
-    }
-}
-
-int vtkMultiBlockPLOT3DReader::ReadScalar(
-  void* vfp, int extent[6], int wextent[6],
-  vtkDataArray* scalar, vtkTypeUInt64 offset)
-{
-  vtkIdType n = vtkStructuredData::GetNumberOfPoints(extent);
-
-  FILE* fp = reinterpret_cast<FILE*>(vfp);
-
-  if (this->Internal->Settings.BinaryFile)
-    {
-    if (vtk_fseek(fp, offset, SEEK_SET) != 0)
-      {
-      return 0;
-      }
-
-    if (this->Internal->Settings.Precision == 4)
-      {
-      vtkPLOT3DArrayReader<float> arrayReader;
-      arrayReader.ByteOrder = this->Internal->Settings.ByteOrder;
-      vtkIdType preskip, postskip;
-      arrayReader.CalculateSkips(extent, wextent, preskip, postskip);
-      vtkFloatArray* floatArray = static_cast<vtkFloatArray*>(scalar);
-      return arrayReader.ReadScalar(
-        fp, preskip, n, postskip, floatArray->GetPointer(0)) == n;
-      }
-    else
-      {
-      vtkPLOT3DArrayReader<double> arrayReader;
-      arrayReader.ByteOrder = this->Internal->Settings.ByteOrder;
-      vtkIdType preskip, postskip;
-      arrayReader.CalculateSkips(extent, wextent, preskip, postskip);
-      vtkDoubleArray* doubleArray = static_cast<vtkDoubleArray*>(scalar);
-      return arrayReader.ReadScalar(
-        fp, preskip, n, postskip, doubleArray->GetPointer(0)) == n;
-      }
-    }
-  else
-    {
-    if (this->Internal->Settings.Precision == 4)
-      {
-      vtkFloatArray* floatArray = static_cast<vtkFloatArray*>(scalar);
-      float* values = floatArray->GetPointer(0);
-
-      int count = 0;
-      for(int i=0; i<n; i++)
-        {
-        int num = fscanf(fp, "%f", &(values[i]));
-        if ( num > 0 )
-          {
-          count++;
-          }
-        else
-          {
-          return 0;
-          }
-        }
-      return count == n;
-      }
-    else
-      {
-      vtkDoubleArray* doubleArray = static_cast<vtkDoubleArray*>(scalar);
-      double* values = doubleArray->GetPointer(0);
-
-      int count = 0;
-      for(int i=0; i<n; i++)
-        {
-        int num = fscanf(fp, "%lf", &(values[i]));
-        if ( num > 0 )
-          {
-          count++;
-          }
-        else
-          {
-          return 0;
-          }
-        }
-      return count == n;
-      }
-    }
-}
-
-int vtkMultiBlockPLOT3DReader::ReadVector(
-  void* vfp, int extent[6], int wextent[6],
-  int numDims, vtkDataArray* vector, vtkTypeUInt64 offset)
-{
-  vtkIdType n = vtkStructuredData::GetNumberOfPoints(extent);
-  vtkIdType nValues = n*numDims;
-
-  FILE* fp = reinterpret_cast<FILE*>(vfp);
-
-  if (this->Internal->Settings.BinaryFile)
-    {
-    if (vtk_fseek(fp, offset, SEEK_SET) != 0)
-      {
-      return 0;
-      }
-    if (this->Internal->Settings.Precision == 4)
-      {
-      vtkPLOT3DArrayReader<float> arrayReader;
-      arrayReader.ByteOrder = this->Internal->Settings.ByteOrder;
-      vtkFloatArray* floatArray = static_cast<vtkFloatArray*>(vector);
-      return arrayReader.ReadVector(
-        fp, extent, wextent, numDims, floatArray->GetPointer(0)) == nValues;
-      }
-    else
-      {
-      vtkPLOT3DArrayReader<double> arrayReader;
-      arrayReader.ByteOrder = this->Internal->Settings.ByteOrder;
-      vtkDoubleArray* doubleArray = static_cast<vtkDoubleArray*>(vector);
-      return arrayReader.ReadVector(
-        fp, extent, wextent, numDims, doubleArray->GetPointer(0)) == nValues;
-      }
-    }
-  else
-    {
-
-    // Initialize the 3rd component to 0 in case the input file is
-    // 2D
-    vector->FillComponent(2, 0);
-
-    vtkIdType count = 0;
-
-    if (this->Internal->Settings.Precision == 4)
-      {
-      vtkFloatArray* floatArray = static_cast<vtkFloatArray*>(vector);
-
-      vtkFloatArray* tmpArray = vtkFloatArray::New();
-      tmpArray->Allocate(n);
-      for (int component = 0; component < numDims; component++)
-        {
-        count += this->ReadValues(fp, n, tmpArray);
-        for (vtkIdType i=0; i<n; i++)
-          {
-          floatArray->SetValue(3*i+component, tmpArray->GetValue(i));
-          }
-        }
-      tmpArray->Delete();
-      }
-    else
-      {
-      vtkDoubleArray* doubleArray = static_cast<vtkDoubleArray*>(vector);
-
-      vtkDoubleArray* tmpArray = vtkDoubleArray::New();
-      tmpArray->Allocate(n);
-      for (int component = 0; component < numDims; component++)
-        {
-        count += this->ReadValues(fp, n, tmpArray);
-        for (vtkIdType i=0; i<n; i++)
-          {
-          doubleArray->SetValue(3*i+component, tmpArray->GetValue(i));
-          }
-        }
-      tmpArray->Delete();
-      }
-
-    return count == nValues;
-    }
-}
-
-// Read a block of floats (ascii or binary) and return number read.
-void vtkMultiBlockPLOT3DReader::CalculateFileSize(FILE* fp)
-{
-  vtk_off_t curPos = vtk_ftell(fp);
-  vtk_fseek(fp, 0, SEEK_END);
-  this->FileSize = static_cast<size_t>(vtk_ftell(fp));
-  vtk_fseek(fp, curPos, SEEK_SET);
-}
-
-int vtkMultiBlockPLOT3DReader::CanReadBinaryFile(const char* fname)
-{
-  FILE* xyzFp;
-
-  if (!fname || fname[0] == '\0')
-    {
-    return 0;
-    }
-
-  if ( this->CheckFile(xyzFp, fname) != VTK_OK)
-    {
-    return 0;
-    }
-
-  this->CalculateFileSize(xyzFp);
-
-  if (!this->AutoDetectionCheck(xyzFp))
-    {
-    fclose(xyzFp);
-    return 0;
-    }
-  rewind(xyzFp);
-
-  int numBlocks = this->GetNumberOfBlocksInternal(xyzFp, 0);
-  fclose(xyzFp);
-  if (numBlocks != 0)
-    {
-    return 1;
-    }
-  return 0;
-}
-
-// Read the header and return the number of grids.
-int vtkMultiBlockPLOT3DReader::GetNumberOfBlocksInternal(FILE* xyzFp, int vtkNotUsed(allocate))
-{
-  int numGrid = 0;
-
-  if ( this->Internal->Settings.MultiGrid )
-    {
-    this->SkipByteCount(xyzFp);
-    this->ReadIntBlock(xyzFp, 1, &numGrid);
-    this->SkipByteCount(xyzFp);
-    }
-  else
-    {
-    numGrid=1;
-    }
-
-
-  if ( numGrid > (int)this->Internal->Dimensions.size() )
-    {
-    this->Internal->Dimensions.resize(numGrid);
-    }
-
-  return numGrid;
-}
-
-int vtkMultiBlockPLOT3DReader::ReadGeometryHeader(FILE* fp)
-{
-  int numGrid = this->GetNumberOfBlocksInternal(fp, 1);
-  int i;
-  vtkDebugMacro("Geometry number of grids: " << numGrid);
-  if ( numGrid == 0 )
-    {
-    return VTK_ERROR;
-    }
-
-  // Read and set extents of all blocks.
-  this->SkipByteCount(fp);
-  for(i=0; i<numGrid; i++)
-    {
-    int n[3];
-    n[2] = 1;
-    this->ReadIntBlock(fp, this->Internal->Settings.NumberOfDimensions, n);
-    vtkDebugMacro("Geometry, block " << i << " dimensions: "
-                  << n[0] << " " << n[1] << " " << n[2]);
-    memcpy(this->Internal->Dimensions[i].Values, n, 3*sizeof(int));
-    }
-  this->SkipByteCount(fp);
-
-  return VTK_OK;
-}
-
-int vtkMultiBlockPLOT3DReader::ReadQHeader(FILE* fp,
-                                           bool checkGrid,
-                                           int& nq,
-                                           int& nqc,
-                                           int& overflow)
-{
-  int numGrid = this->GetNumberOfBlocksInternal(fp, 0);
-  vtkDebugMacro("Q number of grids: " << numGrid);
-  if ( numGrid == 0 )
-    {
-    return VTK_ERROR;
-    }
-
-  // If the numbers of grids still do not match, the
-  // q file is wrong
-  if (checkGrid &&
-      numGrid != static_cast<int>(this->Internal->Blocks.size()))
-    {
-    vtkErrorMacro("The number of grids between the geometry "
-                  "and the q file do not match.");
-    return VTK_ERROR;
-    }
-
-  int bytes = this->SkipByteCount(fp);
-  // If the header contains 2 additional ints, then we assume
-  // that this is an Overflow file.
-  if (bytes > 0 &&
-      bytes == (numGrid*this->Internal->Settings.NumberOfDimensions+2)*4)
-    {
-    overflow = 1;
-    }
-  else
-    {
-    overflow = 0;
-    }
-  for(int i=0; i<numGrid; i++)
-    {
-    int n[3];
-    n[2] = 1;
-    this->ReadIntBlock(fp, this->Internal->Settings.NumberOfDimensions, n);
-    vtkDebugMacro("Q, block " << i << " dimensions: "
-                  << n[0] << " " << n[1] << " " << n[2]);
-
-    if (checkGrid)
-      {
-      int* dims = this->Internal->Dimensions[i].Values;
-      int extent[6] = {0, dims[0]-1, 0, dims[1]-1, 0, dims[2]-1};
-      if ( extent[1] != n[0]-1 || extent[3] != n[1]-1 || extent[5] != n[2]-1)
-        {
-        this->SetErrorCode(vtkErrorCode::FileFormatError);
-        vtkErrorMacro("Geometry and data dimensions do not match. "
-                      "Data file may be corrupt.");
-        this->Internal->Blocks[i]->Initialize();
-        return VTK_ERROR;
-        }
-      }
-    }
-  if (overflow)
-    {
-    this->ReadIntBlock(fp, 1, &nq);
-    this->ReadIntBlock(fp, 1, &nqc);
-    }
-  else
-    {
-    nq = 5;
-    nqc = 0;
-    }
-  this->SkipByteCount(fp);
-  return VTK_OK;
-}
-
-int vtkMultiBlockPLOT3DReader::ReadFunctionHeader(FILE* fp, int* nFunctions)
-{
-  int numGrid = this->GetNumberOfBlocksInternal(fp, 0);
-  vtkDebugMacro("Function number of grids: " << numGrid);
-  if ( numGrid == 0 )
-    {
-    return VTK_ERROR;
-    }
-
-  // If the numbers of grids still do not match, the
-  // function file is wrong
-  if (numGrid != static_cast<int>(this->Internal->Blocks.size()))
-    {
-    vtkErrorMacro("The number of grids between the geometry "
-                  "and the function file do not match.");
-    return VTK_ERROR;
-    }
-
-  this->SkipByteCount(fp);
-  for(int i=0; i<numGrid; i++)
-    {
-    int n[3];
-    n[2] = 1;
-    this->ReadIntBlock(fp, this->Internal->Settings.NumberOfDimensions, n);
-    vtkDebugMacro("Function, block " << i << " dimensions: "
-                  << n[0] << " " << n[1] << " " << n[2]);
-
-    int* dims = this->Internal->Dimensions[i].Values;
-    int extent[6] = {0, dims[0]-1, 0, dims[1]-1, 0, dims[2]-1};
-    if ( extent[1] != n[0]-1 || extent[3] != n[1]-1 || extent[5] != n[2]-1)
-      {
-      this->SetErrorCode(vtkErrorCode::FileFormatError);
-      vtkErrorMacro("Geometry and data dimensions do not match. "
-                    "Data file may be corrupt.");
-      this->Internal->Blocks[i]->Initialize();
-      return VTK_ERROR;
-      }
-    this->ReadIntBlock(fp, 1, nFunctions+i);
-    }
-  this->SkipByteCount(fp);
-  return VTK_OK;
-}
-
-void vtkMultiBlockPLOT3DReader::SetXYZFileName( const char* name )
-{
-  if ( this->XYZFileName && ! strcmp( this->XYZFileName, name ) )
-    {
-    return;
-    }
-
-  delete [] this->XYZFileName;
-
-  if ( name )
-    {
-    this->XYZFileName = new char [ strlen( name ) + 1 ];
-    strcpy( this->XYZFileName, name );
-    }
-  else
-    {
-    this->XYZFileName = 0;
-    }
-
-  this->Internal->NeedToCheckXYZFile = true;
-  this->ClearGeometryCache();
-  this->Modified();
-}
-
-void vtkMultiBlockPLOT3DReader::SetScalarFunctionNumber(int num)
-{
-  if ( this->ScalarFunctionNumber == num)
-    {
-    return;
-    }
-  if (num >= 0)
-    {
-    // If this function is not in the list, add it.
-    int found=0;
-    for (int i=0; i < this->FunctionList->GetNumberOfTuples(); i++ )
-      {
-      if ( this->FunctionList->GetValue(i) == num )
-        {
-        found=1;
-        }
-      }
-    if (!found)
-      {
-      this->AddFunction(num);
-      }
-    }
-  this->ScalarFunctionNumber = num;
-}
-
-void vtkMultiBlockPLOT3DReader::SetVectorFunctionNumber(int num)
-{
-  if ( this->VectorFunctionNumber == num)
-    {
-    return;
-    }
-  if (num >= 0)
-    {
-    // If this function is not in the list, add it.
-    int found=0;
-    for (int i=0; i < this->FunctionList->GetNumberOfTuples(); i++ )
-      {
-      if ( this->FunctionList->GetValue(i) == num )
-        {
-        found=1;
-        }
-      }
-    if (!found)
-      {
-      this->AddFunction(num);
-      }
-    }
-  this->VectorFunctionNumber = num;
-}
-
-void vtkMultiBlockPLOT3DReader::RemoveFunction(int fnum)
-{
-  for (int i=0; i < this->FunctionList->GetNumberOfTuples(); i++ )
-    {
-    if ( this->FunctionList->GetValue(i) == fnum )
-      {
-      this->FunctionList->SetValue(i,-1);
-      this->Modified();
-      }
-    }
-}
-
-namespace
-{
-class Plot3DException : public std::exception
-{
-};
-}
-
-int vtkMultiBlockPLOT3DReader::RequestInformation(
-  vtkInformation*,
-  vtkInformationVector**,
-  vtkInformationVector* outputVector)
-{
-  vtkInformation* info = outputVector->GetInformationObject(0);
-  info->Set(vtkAlgorithm::CAN_HANDLE_PIECE_REQUEST(), 1);
-
-  int rank = 0;
-  // For now, only first rank does any reading.
-  if (this->Controller)
-    {
-    rank = this->Controller->GetLocalProcessId();
-    }
-
-  double times[2];
-  bool hasTime = false;
-  int retval = 1;
-  if (rank == 0)
-    {
-    try
-      {
-      if (this->XYZFileName &&
-          this->XYZFileName[0] != '\0' &&
-          (this->Internal->NeedToCheckXYZFile ||
-           this->Internal->Blocks.size() == 0))
-        {
-        FILE* xyzFp;
-        if ( this->CheckGeometryFile(xyzFp) != VTK_OK)
-          {
-          fclose(xyzFp);
-          throw Plot3DException();
-          }
-
-        this->CalculateFileSize(xyzFp);
-
-        if (!this->AutoDetectionCheck(xyzFp))
-          {
-          fclose(xyzFp);
-          throw Plot3DException();
-          }
-        this->Internal->NeedToCheckXYZFile = false;
-        fclose(xyzFp);
-        }
-
-      // We report time from the Q file for meta-type readers that
-      // might support file series of Q files.
-      if (this->QFileName && this->QFileName[0] != '\0')
-        {
-        FILE* qFp;
-        if ( this->CheckSolutionFile(qFp) != VTK_OK)
-          {
-          throw Plot3DException();
-          }
-        int nq, nqc, overflow;
-        if (this->ReadQHeader(qFp, false, nq, nqc, overflow) != VTK_OK)
-          {
-          fclose(qFp);
-          throw Plot3DException();
-          }
-
-        // I have seen Plot3D files with bogus time values so the only
-        // type I have some confidence about having correct time values
-        // is Overflow output.
-        if (overflow)
-          {
-          vtkDataArray* properties = this->NewFloatArray();
-
-          this->SkipByteCount(qFp);
-          properties->SetNumberOfTuples(4);
-
-          // Read fsmach, alpha, re, time;
-          if (this->ReadValues(qFp, 4, properties) != 4)
-            {
-            vtkErrorMacro("Encountered premature end-of-file while reading "
-                          "the q file (or the file is corrupt).");
-            this->SetErrorCode(vtkErrorCode::PrematureEndOfFileError);
-            fclose(qFp);
-            properties->Delete();
-            throw Plot3DException();
-            }
-          double time = properties->GetTuple1(3);
-          times[0] = times[1] = time;
-          hasTime = true;
-          properties->Delete();
-          }
-        fclose(qFp);
-        }
-      }
-    catch (Plot3DException&)
-      {
-      retval = 0;
-      }
-    }
-
-  if (this->Controller)
-    {
-    int vals[2] = {retval, (hasTime? 1 : 0)};
-    this->Controller->Broadcast(vals, 2, 0);
-    retval = vals[0];
-    hasTime = (vals[1] == 1);
-    }
-
-  if (!retval)
-    {
-    return 0;
-    }
-
-  if (hasTime)
-    {
-    if (this->Controller)
-      {
-      this->Controller->Broadcast(times, 2, 0);
-      }
-    info->Set(vtkStreamingDemandDrivenPipeline::TIME_STEPS(), times, 1);
-    info->Set(vtkStreamingDemandDrivenPipeline::TIME_RANGE(), times, 2);
-    }
-
-  return 1;
-}
-
-int vtkMultiBlockPLOT3DReader::RequestData(
-  vtkInformation*, vtkInformationVector**, vtkInformationVector* outputVector)
-{
-  vtkInformation* info = outputVector->GetInformationObject(0);
-
-  vtkDataObject* doOutput =
-    info->Get(vtkDataObject::DATA_OBJECT());
-  vtkMultiBlockDataSet* mb =
-    vtkMultiBlockDataSet::SafeDownCast(doOutput);
-  if (!mb)
-    {
-    this->ClearGeometryCache();
-    return 0;
-    }
-
-  int updateNumPieces = info->Get(
-    vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_PIECES());
-
-  int igl = info->Get(
-    vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_GHOST_LEVELS());
-  if (updateNumPieces > 1)
-    {
-    if (igl == 0)
-      {
-      igl = 1;
-      }
-    mb->GetInformation()->Set(
-      vtkDataObject::DATA_NUMBER_OF_GHOST_LEVELS(), igl);
-    }
-
-  if (igl > this->ExecutedGhostLevels)
-    {
-    this->ClearGeometryCache();
-    }
-
-  this->SetErrorCode(vtkErrorCode::NoError);
-
-  // This may be wrong if geometry is not cached. It is
-  // updated below.
-  int numBlocks = static_cast<int>(this->Internal->Blocks.size());
-
-  vtkSmartPointer<vtkMultiProcessController> mp;
-  if (this->Controller)
-    {
-    mp = this->Controller;
-    }
-  else
-    {
-    mp.TakeReference(vtkDummyController::New());
-    }
-
-  int rank = mp->GetLocalProcessId();
-  int size = mp->GetNumberOfProcesses();
-  int realSize = size;
-
-  int* settings = reinterpret_cast<int*>(&this->Internal->Settings);
-  mp->Broadcast(settings, sizeof(
-    vtkMultiBlockPLOT3DReaderInternals::InternalSettings) / sizeof(int), 0);
-
-  // Special case where we are reading an ASCII or
-  // 2D file in parallel. All the work is done by
-  // rank 0 but we still need to communicate numBlocks
-  // for other ranks to allocate output with the right
-  // shape.
-  if (!this->Internal->Settings.BinaryFile ||
-      this->Internal->Settings.NumberOfDimensions == 2)
-    {
-    if (rank > 0)
-      {
-      this->Controller->Broadcast(&numBlocks, 1, 0);
-      mb->SetNumberOfBlocks(numBlocks);
-      this->ClearGeometryCache();
-      return 1;
-      }
-    else
-      {
-      mp.TakeReference(vtkDummyController::New());
-      rank = 0;
-      size = 1;
-      }
-    }
-
-  vtkNew<vtkExtentTranslator> et;
-  et->SetPiece(rank);
-  et->SetNumberOfPieces(size);
-  et->SetSplitModeToZSlab();
-
-  FILE* xyzFp = 0;
-
-  // Don't read the geometry if we already have it!
-  if ( numBlocks == 0 )
-    {
-    this->ExecutedGhostLevels = igl;
-
-    vtkTypeUInt64 offset = 0;
-
-    int error = 0;
-
-    // Only the first rank does meta-data checking
-    // using POSIX IO.
-    if (rank == 0)
-      {
-      try
-        {
-        if ( this->CheckGeometryFile(xyzFp) != VTK_OK)
-          {
-          throw Plot3DException();
-          }
-
-        if ( this->ReadGeometryHeader(xyzFp) != VTK_OK )
-          {
-          vtkErrorMacro("Error reading geometry file.");
-          fclose(xyzFp);
-          throw Plot3DException();
-          }
-
-        // Update from the value in the file.
-        numBlocks = static_cast<int>(this->Internal->Dimensions.size());
-
-        if (this->Internal->Settings.BinaryFile)
-          {
-          offset = vtk_ftell(xyzFp);
-          fclose(xyzFp);
-          }
-        }
-      catch (Plot3DException&)
-        {
-        error = 1;
-        }
-      }
-
-    mp->Broadcast(&error, 1, 0);
-    if (error)
-      {
-      vtkErrorMacro("Error reading file " << this->XYZFileName);
-      this->ClearGeometryCache();
-      return 0;
-      }
-
-    // All meta-data needs to be broadcasted.
-    mp->Broadcast(&numBlocks, 1, 0);
-    if (rank > 0)
-      {
-      this->Internal->Dimensions.resize(numBlocks);
-      }
-
-    int* rawdims = reinterpret_cast<int*>(&this->Internal->Dimensions[0]);
-    mp->Broadcast(rawdims, 3*numBlocks, 0);
-
-    mp->Broadcast(&offset, 1, 0);
-
-    // Heavy reading is done collectively. POSIX in this
-    // class but MPI-IO in subclass.
-    void* xyzFp2;
-    if (this->Internal->Settings.BinaryFile)
-      {
-      this->OpenFileForDataRead(xyzFp2, this->XYZFileName);
-      }
-    else
-      {
-      // For ASCII files, the first rank keeps reading without
-      // worrying about offsets and such.
-      xyzFp2 = xyzFp;
-      }
-
-    this->Internal->Blocks.resize(numBlocks);
-
-    for(int i=0; i<numBlocks; i++)
-      {
-      offset += this->GetByteCountSize();
-
-      // Read the geometry of this grid.
-
-      int* dims = this->Internal->Dimensions[i].Values;
-      int wextent[6] = {0, dims[0]-1, 0, dims[1]-1, 0, dims[2]-1};
-      int extent[6];
-      et->SetWholeExtent(wextent);
-      et->SetGhostLevel(igl);
-      et->PieceToExtent();
-      et->GetExtent(extent);
-
-      vtkStructuredGrid* nthOutput = this->Internal->Blocks[i];
-      if (!nthOutput)
-        {
-        nthOutput = vtkStructuredGrid::New();
-        this->Internal->Blocks[i] = nthOutput;
-        nthOutput->SetExtent(extent);
-        nthOutput->Delete();
-        }
-
-      vtkDataArray* pointArray = this->NewFloatArray();
-      pointArray->SetNumberOfComponents(3);
-      vtkIdType npts = vtkStructuredData::GetNumberOfPoints(extent);
-      vtkIdType nTotalPts = (vtkIdType)dims[0]*dims[1]*dims[2];
-      pointArray->SetNumberOfTuples(npts);
-
-      vtkPoints* points = vtkPoints::New();
-      points->SetData(pointArray);
-      pointArray->Delete();
-      nthOutput->SetPoints(points);
-      points->Delete();
-      if ( this->ReadVector(xyzFp2,
-                            extent, wextent,
-                            this->Internal->Settings.NumberOfDimensions,
-                            pointArray,
-                            offset) == 0)
-        {
-        vtkErrorMacro("Encountered premature end-of-file while reading "
-                      "the geometry file (or the file is corrupt).");
-        this->SetErrorCode(vtkErrorCode::PrematureEndOfFileError);
-        this->CloseFile(xyzFp2);
-        this->ClearGeometryCache();
-        return 0;
-        }
-      // Increment the offset for next read. This points to the
-      // beginning of next block.
-      offset += this->Internal->Settings.NumberOfDimensions*
-         nTotalPts*this->Internal->Settings.Precision;
-
-      if (this->Internal->Settings.IBlanking)
-        {
-        vtkIntArray* iblank = vtkIntArray::New();
-        iblank->SetName("IBlank");
-        iblank->SetNumberOfTuples(npts);
-        if ( this->ReadIntScalar(xyzFp2, extent, wextent, iblank, offset) == 0)
-          {
-          vtkErrorMacro("Encountered premature end-of-file while reading "
-                        "the xyz file (or the file is corrupt).");
-          this->SetErrorCode(vtkErrorCode::PrematureEndOfFileError);
-          this->CloseFile(xyzFp2);
-          this->ClearGeometryCache();
-          return 0;
-          }
-
-        int* ib = iblank->GetPointer(0);
-        nthOutput->GetPointData()->AddArray(iblank);
-        iblank->Delete();
-        offset += nTotalPts*sizeof(int);
-
-        vtkUnsignedCharArray *ghosts = vtkUnsignedCharArray::New();
-        ghosts->SetNumberOfValues(nthOutput->GetNumberOfCells());
-        ghosts->SetName(vtkDataSetAttributes::GhostArrayName());
-        vtkIdList* ids = vtkIdList::New();
-        ids->SetNumberOfIds(8);
-        vtkIdType numCells = nthOutput->GetNumberOfCells();
-        for (vtkIdType cellId=0; cellId<numCells; cellId++)
-          {
-          nthOutput->GetCellPoints(cellId, ids);
-          vtkIdType numIds = ids->GetNumberOfIds();
-          unsigned char value = 0;
-          for (vtkIdType ptIdx=0; ptIdx<numIds; ptIdx++)
-            {
-            if (ib[ids->GetId(ptIdx)] == 0)
-              {
-              value |= vtkDataSetAttributes::HIDDENCELL;
-              break;
-              }
-            }
-          ghosts->SetValue(cellId, value);
-          }
-        ids->Delete();
-        nthOutput->GetCellData()->AddArray(ghosts);
-        ghosts->Delete();
-        }
-
-      if (igl > 0)
-        {
-        et->SetGhostLevel(0);
-        et->PieceToExtent();
-        int zeroExtent[6];
-        et->GetExtent(zeroExtent);
-        nthOutput->GenerateGhostArray(zeroExtent, true);
-        }
-
-      offset += this->GetByteCountSize();
-      }
-
-    this->CloseFile(xyzFp2);
-    }
-
-  // Special case where we are reading an ASCII or
-  // 2D file in parallel. All the work is done by
-  // rank 0 but we still need to communicate numBlocks
-  // for other ranks to allocate output with the right
-  // shape.
-  if (!this->Internal->Settings.BinaryFile ||
-      this->Internal->Settings.NumberOfDimensions == 2)
-    {
-    if (realSize > 1)
-      {
-      // This needs to broadcast with this->Controller
-      // because mp is a dummy controller.
-      this->Controller->Broadcast(&numBlocks, 1, 0);
-      }
-    }
-
-  // Now read the solution.
-  if (this->QFileName && this->QFileName[0] != '\0')
-    {
-    FILE* qFp = 0;
-    int nq=0, nqc=0, isOverflow=0;
-
-    int error = 0;
-    if (rank == 0)
-      {
-      try
-        {
-        if ( this->CheckSolutionFile(qFp) != VTK_OK)
-          {
-          throw Plot3DException();
-          }
-
-        if ( this->ReadQHeader(qFp, true, nq, nqc, isOverflow) != VTK_OK )
-          {
-          fclose(qFp);
-          throw Plot3DException();
-          }
-        }
-      catch (Plot3DException&)
-        {
-        error = 1;
-        }
-      }
-
-    mp->Broadcast(&error, 1, 0);
-    if (error)
-      {
-      vtkErrorMacro("Error reading file " << this->XYZFileName);
-      this->ClearGeometryCache();
-      return 0;
-      }
-
-    int vals[3] = {nq, nqc, isOverflow};
-    mp->Broadcast(vals, 3, 0);
-    nq = vals[0];
-    nqc = vals[1];
-    isOverflow = vals[2];
-
-    vtkTypeUInt64 offset = 0;
-
-    void* qFp2;
-    if (this->Internal->Settings.BinaryFile)
-      {
-      this->OpenFileForDataRead(qFp2, this->QFileName);
-      }
-    else
-      {
-      // We treat ASCII specially. We don't worry about
-      // offsets and let the file move forward while reading
-      // from the original file handle.
-      qFp2 = qFp;
-      }
-
-    for(int i=0; i<numBlocks; i++)
-      {
-      vtkStructuredGrid* nthOutput = this->Internal->Blocks[i];
-
-      // Save the properties first
-      vtkDataArray* properties = this->NewFloatArray();
-      properties->SetName("Properties");
-
-      int numProperties = 4;
-      if (rank == 0)
-        {
-        int count = this->SkipByteCount(qFp);
-        // We have a byte count to tell us how many Q values to
-        // read. If this is more that 4, this is probably an Overflow
-        // file.
-        if (isOverflow)
-          {
-          // We take 4 bytes because there is an int there that
-          // we will throw away
-          numProperties = (count-4) / this->Internal->Settings.Precision + 1;
-          }
-        }
-      mp->Broadcast(&numProperties, 1, 0);
-      properties->SetNumberOfTuples(numProperties);
-
-      error = 0;
-      if (rank == 0)
-        {
-        try
-          {
-          // Read fsmach, alpha, re, time;
-          if ( this->ReadValues(qFp, 4, properties) != 4)
-            {
-            vtkErrorMacro("Encountered premature end-of-file while reading "
-                          "the q file (or the file is corrupt).");
-            this->SetErrorCode(vtkErrorCode::PrematureEndOfFileError);
-            fclose(qFp);
-            properties->Delete();
-            throw Plot3DException();
-            }
-
-          if (isOverflow)
-            {
-            // We create a dummy array to use with ReadValues
-            vtkDataArray* dummyArray = properties->NewInstance();
-            dummyArray->SetVoidArray(properties->GetVoidPointer(4), 3, 1);
-
-            // Read GAMINF, BETA, TINF
-            if ( this->ReadValues(qFp, 3, dummyArray) != 3)
-              {
-              vtkErrorMacro("Encountered premature end-of-file while reading "
-                            "the q file (or the file is corrupt).");
-              this->SetErrorCode(vtkErrorCode::PrematureEndOfFileError);
-              fclose(qFp);
-              properties->Delete();
-              throw Plot3DException();
-              }
-
-            // igam is an int
-            int igam;
-            this->ReadIntBlock(qFp, 1, &igam);
-            properties->SetTuple1(7, igam);
-
-            dummyArray->SetVoidArray(properties->GetVoidPointer(8), 3, 1);
-            // Read the rest of properties
-            if ( this->ReadValues(qFp, numProperties - 8, dummyArray) !=
-                 numProperties - 8)
-              {
-              vtkErrorMacro("Encountered premature end-of-file while reading "
-                            "the q file (or the file is corrupt).");
-              this->SetErrorCode(vtkErrorCode::PrematureEndOfFileError);
-              fclose(qFp);
-              properties->Delete();
-              throw Plot3DException();
-              }
-            dummyArray->Delete();
-            }
-          this->SkipByteCount(qFp);
-          }
-        catch (Plot3DException&)
-          {
-          error = 1;
-          }
-        }
-      mp->Broadcast(&error, 1, 0);
-      if (error)
-        {
-        vtkErrorMacro("Error reading file " << this->XYZFileName);
-        this->ClearGeometryCache();
-        return 0;
-        }
-
-      mp->Broadcast(properties, 0);
-
-      nthOutput->GetFieldData()->AddArray(properties);
-      properties->Delete();
-
-      if (mp->GetLocalProcessId() == 0 &&
-          this->Internal->Settings.BinaryFile)
-        {
-        offset = vtk_ftell(qFp);
-        }
-      mp->Broadcast(&offset, 1, 0);
-
-      int* dims = this->Internal->Dimensions[i].Values;
-      int wextent[6] = {0, dims[0]-1, 0, dims[1]-1, 0, dims[2]-1};
-      int extent[6];
-      et->SetWholeExtent(wextent);
-      et->SetGhostLevel(igl);
-      et->PieceToExtent();
-      et->GetExtent(extent);
-
-      vtkIdType npts = vtkStructuredData::GetNumberOfPoints(extent);
-      vtkIdType nTotalPts = (vtkIdType)dims[0]*dims[1]*dims[2];
-
-      offset += this->GetByteCountSize();
-
-      vtkDataArray* density = this->NewFloatArray();
-      density->SetNumberOfComponents(1);
-      density->SetNumberOfTuples( npts );
-      density->SetName("Density");
-      if ( this->ReadScalar(qFp2, extent, wextent, density, offset) == 0)
-        {
-        vtkErrorMacro("Encountered premature end-of-file while reading "
-                      "the q file (or the file is corrupt).");
-        this->SetErrorCode(vtkErrorCode::PrematureEndOfFileError);
-        if (rank == 0 && this->Internal->Settings.BinaryFile)
-          {
-          fclose(qFp);
-          }
-        this->CloseFile(qFp2);
-        density->Delete();
-        this->ClearGeometryCache();
-        return 0;
-        }
-      nthOutput->GetPointData()->AddArray(density);
-      density->Delete();
-      offset += nTotalPts*this->Internal->Settings.Precision;
-
-      vtkDataArray* momentum = this->NewFloatArray();
-      momentum->SetNumberOfComponents(3);
-      momentum->SetNumberOfTuples( npts );
-      momentum->SetName("Momentum");
-      if ( this->ReadVector(qFp2,
-                            extent, wextent,
-                            this->Internal->Settings.NumberOfDimensions,
-                            momentum,
-                            offset) == 0)
-        {
-        vtkErrorMacro("Encountered premature end-of-file while reading "
-                      "the q file (or the file is corrupt).");
-        this->SetErrorCode(vtkErrorCode::PrematureEndOfFileError);
-        if (rank == 0 && this->Internal->Settings.BinaryFile)
-          {
-          fclose(qFp);
-          }
-        this->CloseFile(qFp2);
-        momentum->Delete();
-        this->ClearGeometryCache();
-        return 0;
-        }
-      nthOutput->GetPointData()->AddArray(momentum);
-      momentum->Delete();
-      offset += this->Internal->Settings.NumberOfDimensions*
-         nTotalPts*this->Internal->Settings.Precision;
-
-      vtkDataArray* se = this->NewFloatArray();
-      se->SetNumberOfComponents(1);
-      se->SetNumberOfTuples( npts );
-      se->SetName("StagnationEnergy");
-      if ( this->ReadScalar(qFp2, extent, wextent, se, offset) == 0)
-        {
-        vtkErrorMacro("Encountered premature end-of-file while reading "
-                      "the q file (or the file is corrupt).");
-        if (rank == 0 && this->Internal->Settings.BinaryFile)
-          {
-          fclose(qFp);
-          }
-        this->CloseFile(qFp2);
-        se->Delete();
-        this->ClearGeometryCache();
-        return 0;
-        }
-      nthOutput->GetPointData()->AddArray(se);
-      se->Delete();
-      offset += nTotalPts*this->Internal->Settings.Precision;
-
-      if (isOverflow)
-        {
-        if(nq >= 6) /// super new
-          {
-          vtkDataArray* gamma = this->NewFloatArray();
-          gamma->SetNumberOfComponents(1);
-          gamma->SetNumberOfTuples(npts);
-          gamma->SetName("Gamma");
-          if (this->ReadScalar(qFp2, extent, wextent, gamma, offset) == 0)
-            {
-            vtkErrorMacro("Encountered premature end-of-file while reading "
-                          "the q file (or the file is corrupt).");
-            if (rank == 0 && this->Internal->Settings.BinaryFile)
-              {
-              fclose(qFp);
-              }
-            this->CloseFile(qFp2);
-            gamma->Delete();
-            this->ClearGeometryCache();
-            return 0;
-            }
-          nthOutput->GetPointData()->AddArray(gamma);
-          gamma->Delete();
-          offset += nTotalPts*this->Internal->Settings.Precision;
-          } /// end of new
-
-        char res[100];
-        // Read species and turbulence variables for overflow q files
-        for(int j=0; j<nqc; j++)
-          {
-          vtkDataArray* temp = this->NewFloatArray();
-          temp->SetNumberOfComponents(1);
-          temp->SetNumberOfTuples(npts);
-          int k = j+1;
-          sprintf(res, "Species Density #%d", k);
-          temp->SetName(res);
-          if (this->ReadScalar(qFp2, extent, wextent, temp, offset) == 0)
-            {
-            vtkErrorMacro("Encountered premature end-of-file while reading "
-                          "the q file (or the file is corrupt).");
-            if (rank == 0 && this->Internal->Settings.BinaryFile)
-              {
-              fclose(qFp);
-              }
-            this->CloseFile(qFp2);
-            temp->Delete();
-            this->ClearGeometryCache();
-            return 0;
-            }
-          nthOutput->GetPointData()->AddArray(temp);
-          offset += nTotalPts*this->Internal->Settings.Precision;
-          temp->Delete();
-          }
-        float d, r;
-        for(int v=0; v<nqc; v++)
-          {
-          vtkDataArray* rat = this->NewFloatArray();
-          sprintf(res, "Species Density #%d", v+1);
-          vtkPointData* outputPD = nthOutput->GetPointData();
-          vtkDataArray* spec = outputPD->GetArray(res);
-          vtkDataArray* dens = outputPD->GetArray("Density");
-          rat->SetNumberOfComponents(1);
-          rat->SetNumberOfTuples(dims[0]*dims[1]*dims[2]);
-          sprintf(res, "Spec Dens #%d / rho", v+1);
-          rat->SetName(res);
-          for(int w=0; w<npts; w++)
-            {
-            r = dens->GetComponent(w,0);
-            r = (r != 0.0 ? r : 1.0);
-            d = spec->GetComponent(w,0);
-            rat->SetTuple1(w, d/r);
-            }
-          nthOutput->GetPointData()->AddArray(rat);
-          rat->Delete();
-          }
-        for(int a=0; a<nq-6-nqc; a++)
-          {
-          vtkDataArray* temp = this->NewFloatArray();
-          temp->SetNumberOfComponents(1);
-          temp->SetNumberOfTuples(dims[0]*dims[1]*dims[2]);
-          int k = a+1;
-          sprintf(res, "Turb Field Quant #%d", k);
-          temp->SetName(res);
-          if (this->ReadScalar(qFp2, extent, wextent, temp, offset) == 0)
-            {
-            vtkErrorMacro("Encountered premature end-of-file while reading "
-                          "the q file (or the file is corrupt).");
-            if (rank == 0 && this->Internal->Settings.BinaryFile)
-              {
-              fclose(qFp);
-              }
-            this->CloseFile(qFp2);
-            temp->Delete();
-            this->ClearGeometryCache();
-            return 0;
-            }
-          nthOutput->GetPointData()->AddArray(temp);
-          offset += nTotalPts*this->Internal->Settings.Precision;
-          temp->Delete();
-          }
-        }
-
-      offset += this->GetByteCountSize();
-
-      if (rank == 0 && this->Internal->Settings.BinaryFile)
-        {
-        vtk_fseek(qFp, offset, SEEK_SET);
-        }
-
-      if ( this->FunctionList->GetNumberOfTuples() > 0 )
-        {
-        int fnum;
-        for (int tup=0; tup < this->FunctionList->GetNumberOfTuples(); tup++)
-          {
-          if ( (fnum=this->FunctionList->GetValue(tup)) >= 0 )
-            {
-            this->MapFunction(fnum, nthOutput);
-            }
-          }
-        }
-      this->AssignAttribute(this->ScalarFunctionNumber, nthOutput,
-                            vtkDataSetAttributes::SCALARS);
-      this->AssignAttribute(this->VectorFunctionNumber, nthOutput,
-                            vtkDataSetAttributes::VECTORS);
-      }
-    if (rank == 0 && this->Internal->Settings.BinaryFile)
-      {
-      fclose(qFp);
-      }
-    this->CloseFile(qFp2);
-    }
-
-  // Now read the functions.
-  if (this->FunctionFileName && this->FunctionFileName[0] != '\0')
-    {
-    vtkTypeUInt64 offset = 0;
-
-    FILE* fFp = 0;
-
-    std::vector<int> nFunctions(numBlocks);
-    int error = 0;
-    if (rank == 0)
-      {
-      try
-        {
-        if ( this->CheckFunctionFile(fFp) != VTK_OK)
-          {
-          throw Plot3DException();
-          }
-
-        if ( this->ReadFunctionHeader(fFp, &nFunctions[0]) != VTK_OK )
-          {
-          fclose(fFp);
-          throw Plot3DException();
-          }
-        offset = vtk_ftell(fFp);
-        fclose(fFp);
-        }
-      catch (Plot3DException&)
-        {
-        error = 1;
-        }
-      }
-    mp->Broadcast(&error, 1, 0);
-    if (error)
-      {
-      vtkErrorMacro("Error reading file " << this->XYZFileName);
-      this->ClearGeometryCache();
-      return 0;
-      }
-
-    mp->Broadcast(&nFunctions[0], numBlocks, 0);
-    mp->Broadcast(&offset, 1, 0);
-
-
-    void* fFp2;
-    if (this->Internal->Settings.BinaryFile)
-      {
-      this->OpenFileForDataRead(fFp2, this->FunctionFileName);
-      }
-    else
-      {
-      fFp2 = fFp;
-      }
-
-    for(int i=0; i<numBlocks; i++)
-      {
-      vtkStructuredGrid* nthOutput = this->Internal->Blocks[i];
-
-      int* dims = this->Internal->Dimensions[i].Values;
-      int wextent[6] = {0, dims[0]-1, 0, dims[1]-1, 0, dims[2]-1};
-      int extent[6];
-      et->SetWholeExtent(wextent);
-      et->SetSplitModeToZSlab();
-      et->PieceToExtent();
-      et->GetExtent(extent);
-
-      vtkIdType npts = vtkStructuredData::GetNumberOfPoints(extent);
-      vtkIdType nTotalPts = (vtkIdType)dims[0]*dims[1]*dims[2];
-
-      offset += this->GetByteCountSize();
-
-      for (int j=0; j<nFunctions[i]; j++)
-        {
-        vtkDataArray* functionArray = this->NewFloatArray();
-        functionArray->SetNumberOfTuples(npts);
-        char functionName[20];
-        sprintf(functionName, "Function%d", j);
-        functionArray->SetName(functionName);
-        if (this->ReadScalar(fFp2, extent, wextent, functionArray, offset) == 0)
-          {
-          vtkErrorMacro("Encountered premature end-of-file while reading "
-                        "the function file (or the file is corrupt).");
-          this->CloseFile(fFp2);
-          functionArray->Delete();
-          this->ClearGeometryCache();
-          return 0;
-          }
-        offset += nTotalPts*this->Internal->Settings.Precision;
-        nthOutput->GetPointData()->AddArray(functionArray);
-        functionArray->Delete();
-        }
-
-      offset += this->GetByteCountSize();
-      }
-    this->CloseFile(fFp2);
-    }
-
-  mb->SetNumberOfBlocks(numBlocks);
-  for(int i=0; i<numBlocks; i++)
-    {
-    vtkStructuredGrid* nthOutput = this->Internal->Blocks[i];
-    mb->SetBlock(i, nthOutput);
-    }
-
-  return 1;
-}
-
-// Various PLOT3D functions.....................
-void vtkMultiBlockPLOT3DReader::MapFunction(int fNumber, vtkStructuredGrid* output)
-{
-  switch (fNumber)
-    {
-    case 100: //Density
-      break;
-
-    case 110: //Pressure
-      this->ComputePressure(output);
-      break;
-
-    case 111: // Pressure Coefficient
-      this->ComputePressureCoefficient(output);
-      break;
-
-    case 112: // Mach Number
-      this->ComputeMachNumber(output);
-      break;
-
-    case 113: // Sound Speed
-      this->ComputeSoundSpeed(output);
-      break;
-
-    case 120: //Temperature
-      this->ComputeTemperature(output);
-      break;
-
-    case 130: //Enthalpy
-      this->ComputeEnthalpy(output);
-      break;
-
-    case 140: //Internal Energy
-      break;
-
-    case 144: //Kinetic Energy
-      this->ComputeKineticEnergy(output);
-      break;
-
-    case 153: //Velocity Magnitude
-      this->ComputeVelocityMagnitude(output);
-      break;
-
-    case 163: //Stagnation energy
-      break;
-
-    case 170: //Entropy
-      this->ComputeEntropy(output);
-      break;
-
-    case 184: //Swirl
-      this->ComputeSwirl(output);
-      break;
-
-    case 200: //Velocity
-      this->ComputeVelocity(output);
-      break;
-
-    case 201: //Vorticity
-      this->ComputeVorticity(output);
-      break;
-
-    case 202: //Momentum
-      break;
-
-    case 210: //PressureGradient
-      this->ComputePressureGradient(output);
-      break;
-
-    case 211: // Vorticity Magnitude
-      this->ComputeVorticityMagnitude(output);
-      break;
-
-    case 212: // Strain Rate
-      this->ComputeStrainRate(output);
-      break;
-
-    default:
-      vtkErrorMacro(<<"No function number " << fNumber);
-    }
-}
-
-void vtkMultiBlockPLOT3DReader::AssignAttribute(int fNumber, vtkStructuredGrid* output,
-                                  int attributeType)
-{
-  switch (fNumber)
-    {
-    case -1:  //empty mapping
-      output->GetPointData()->SetActiveAttribute(0,
-                                                 attributeType);
-      break;
-
-    case 100: //Density
-      output->GetPointData()->SetActiveAttribute("Density",
-                                                 attributeType);
-      break;
-
-    case 110: //Pressure
-      output->GetPointData()->SetActiveAttribute("Pressure",
-                                                 attributeType);
-      break;
-
-    case 120: //Temperature
-      output->GetPointData()->SetActiveAttribute("Temperature",
-                                                 attributeType);
-      break;
-
-    case 130: //Enthalpy
-      output->GetPointData()->SetActiveAttribute("Enthalpy",
-                                                 attributeType);
-      break;
-
-    case 140: //Internal Energy
-      output->GetPointData()->SetActiveAttribute("StagnationEnergy",
-                                                 attributeType);
-      break;
-
-    case 144: //Kinetic Energy
-      output->GetPointData()->SetActiveAttribute("KineticEnergy",
-                                                 attributeType);
-      break;
-
-    case 153: //Velocity Magnitude
-      output->GetPointData()->SetActiveAttribute("VelocityMagnitude",
-                                                 attributeType);
-      break;
-
-    case 163: //Stagnation energy
-      output->GetPointData()->SetActiveAttribute("StagnationEnergy",
-                                                 attributeType);
-      break;
-
-    case 170: //Entropy
-      output->GetPointData()->SetActiveAttribute("Entropy",
-                                                 attributeType);
-      break;
-
-    case 184: //Swirl
-      output->GetPointData()->SetActiveAttribute("Swirl",
-                                                 attributeType);
-      break;
-
-    case 200: //Velocity
-      output->GetPointData()->SetActiveAttribute("Velocity",
-                                                 attributeType);
-      break;
-
-    case 201: //Vorticity
-      output->GetPointData()->SetActiveAttribute("Vorticity",
-                                                 attributeType);
-      break;
-
-    case 202: //Momentum
-      output->GetPointData()->SetActiveAttribute("Momentum",
-                                                 attributeType);
-      break;
-
-    case 210: //PressureGradient
-      output->GetPointData()->SetActiveAttribute("PressureGradient",
-                                                 attributeType);
-      break;
-
-    default:
-      vtkErrorMacro(<<"No function number " << fNumber);
-    }
-}
-
-void vtkMultiBlockPLOT3DReader::ComputeTemperature(vtkStructuredGrid* output)
-{
-  double *m, e, rr, u, v, w, v2, p, d, rrgas;
-  vtkIdType i;
-  vtkDataArray *temperature;
-
-  //  Check that the required data is available
-  //
-  vtkPointData* outputPD = output->GetPointData();
-  vtkDataArray* density = outputPD->GetArray("Density");
-  vtkDataArray* momentum = outputPD->GetArray("Momentum");
-  vtkDataArray* energy = outputPD->GetArray("StagnationEnergy");
-
-  if ( density == NULL || momentum == NULL ||
-       energy == NULL )
-    {
-    vtkErrorMacro(<<"Cannot compute temperature");
-    return;
-    }
-
-  vtkIdType numPts = density->GetNumberOfTuples();
-  temperature = this->NewFloatArray();
-  temperature->SetNumberOfTuples(numPts);
-
-  //  Compute the temperature
-  //
-  rrgas = 1.0 / this->R;
-  for (i=0; i < numPts; i++)
-    {
-    d = density->GetComponent(i,0);
-    d = (d != 0.0 ? d : 1.0);
-    m = momentum->GetTuple(i);
-    e = energy->GetComponent(i,0);
-    rr = 1.0 / d;
-    u = m[0] * rr;
-    v = m[1] * rr;
-    w = m[2] * rr;
-    v2 = u*u + v*v + w*w;
-    p = (this->Gamma-1.) * (e - 0.5 * d * v2);
-    temperature->SetTuple1(i, p*rr*rrgas);
-  }
-
-  temperature->SetName("Temperature");
-  outputPD->AddArray(temperature);
-
-  temperature->Delete();
-  vtkDebugMacro(<<"Created temperature scalar");
-}
-
-void vtkMultiBlockPLOT3DReader::ComputePressure(vtkStructuredGrid* output)
-{
-  double *m, e, u, v, w, v2, p, d, rr;
-  vtkIdType i;
-  vtkDataArray *pressure;
-
-  //  Check that the required data is available
-  //
-  vtkPointData* outputPD = output->GetPointData();
-  vtkDataArray* density = outputPD->GetArray("Density");
-  vtkDataArray* momentum = outputPD->GetArray("Momentum");
-  vtkDataArray* energy = outputPD->GetArray("StagnationEnergy");
-  if ( density == NULL || momentum == NULL ||
-       energy == NULL )
-    {
-    vtkErrorMacro(<<"Cannot compute pressure");
-    return;
-    }
-
-  vtkIdType numPts = density->GetNumberOfTuples();
-  pressure = this->NewFloatArray();
-  pressure->SetNumberOfTuples(numPts);
-
-  //  Compute the pressure
-  //
-  for (i=0; i < numPts; i++)
-    {
-    d = density->GetComponent(i,0);
-    d = (d != 0.0 ? d : 1.0);
-    m = momentum->GetTuple(i);
-    e = energy->GetComponent(i,0);
-    rr = 1.0 / d;
-    u = m[0] * rr;
-    v = m[1] * rr;
-    w = m[2] * rr;
-    v2 = u*u + v*v + w*w;
-    p = (this->Gamma-1.) * (e - 0.5 * d * v2);
-    pressure->SetTuple1(i, p);
-  }
-
-  pressure->SetName("Pressure");
-  outputPD->AddArray(pressure);
-  pressure->Delete();
-  vtkDebugMacro(<<"Created pressure scalar");
-}
-
-void vtkMultiBlockPLOT3DReader::ComputeEnthalpy(vtkStructuredGrid* output)
-{
-  double *m, e, u, v, w, v2, d, rr;
-  vtkIdType i;
-  vtkDataArray *enthalpy;
-
-  //  Check that the required data is available
-  //
-  vtkPointData* outputPD = output->GetPointData();
-  vtkDataArray* density = outputPD->GetArray("Density");
-  vtkDataArray* momentum = outputPD->GetArray("Momentum");
-  vtkDataArray* energy = outputPD->GetArray("StagnationEnergy");
-  if ( density == NULL || momentum == NULL ||
-       energy == NULL )
-    {
-    vtkErrorMacro(<<"Cannot compute enthalpy");
-    return;
-    }
-
-  vtkIdType numPts = density->GetNumberOfTuples();
-  enthalpy = this->NewFloatArray();
-  enthalpy->SetNumberOfTuples(numPts);
-
-  //  Compute the enthalpy
-  //
-  for (i=0; i < numPts; i++)
-    {
-    d = density->GetComponent(i,0);
-    d = (d != 0.0 ? d : 1.0);
-    m = momentum->GetTuple(i);
-    e = energy->GetComponent(i,0);
-    rr = 1.0 / d;
-    u = m[0] * rr;
-    v = m[1] * rr;
-    w = m[2] * rr;
-    v2 = u*u + v*v + w*w;
-    enthalpy->SetTuple1(i, this->Gamma*(e*rr - 0.5*v2));
-  }
-  enthalpy->SetName("Enthalpy");
-  outputPD->AddArray(enthalpy);
-  enthalpy->Delete();
-  vtkDebugMacro(<<"Created enthalpy scalar");
-}
-
-void vtkMultiBlockPLOT3DReader::ComputeKineticEnergy(vtkStructuredGrid* output)
-{
-  double *m, u, v, w, v2, d, rr;
-  vtkIdType i;
-  vtkDataArray *kineticEnergy;
-
-  //  Check that the required data is available
-  //
-  vtkPointData* outputPD = output->GetPointData();
-  vtkDataArray* density = outputPD->GetArray("Density");
-  vtkDataArray* momentum = outputPD->GetArray("Momentum");
-  if ( density == NULL || momentum == NULL )
-    {
-    vtkErrorMacro(<<"Cannot compute kinetic energy");
-    return;
-    }
-
-  vtkIdType numPts = density->GetNumberOfTuples();
-  kineticEnergy = this->NewFloatArray();
-  kineticEnergy->SetNumberOfTuples(numPts);
-
-  //  Compute the kinetic energy
-  //
-  for (i=0; i < numPts; i++)
-    {
-    d = density->GetComponent(i,0);
-    d = (d != 0.0 ? d : 1.0);
-    m = momentum->GetTuple(i);
-    rr = 1.0 / d;
-    u = m[0] * rr;
-    v = m[1] * rr;
-    w = m[2] * rr;
-    v2 = u*u + v*v + w*w;
-    kineticEnergy->SetTuple1(i, 0.5*v2);
-  }
-  kineticEnergy->SetName("KineticEnergy");
-  outputPD->AddArray(kineticEnergy);
-  kineticEnergy->Delete();
-  vtkDebugMacro(<<"Created kinetic energy scalar");
-}
-
-void vtkMultiBlockPLOT3DReader::ComputeVelocityMagnitude(vtkStructuredGrid* output)
-{
-  double *m, u, v, w, v2, d, rr;
-  vtkIdType i;
-  vtkDataArray *velocityMag;
-
-  //  Check that the required data is available
-  //
-  vtkPointData* outputPD = output->GetPointData();
-  vtkDataArray* density = outputPD->GetArray("Density");
-  vtkDataArray* momentum = outputPD->GetArray("Momentum");
-  vtkDataArray* energy = outputPD->GetArray("StagnationEnergy");
-  if ( density == NULL || momentum == NULL ||
-       energy == NULL )
-    {
-    vtkErrorMacro(<<"Cannot compute velocity magnitude");
-    return;
-    }
-
-  vtkIdType numPts = density->GetNumberOfTuples();
-  velocityMag = this->NewFloatArray();
-  velocityMag->SetNumberOfTuples(numPts);
-
-  //  Compute the velocity magnitude
-  //
-  for (i=0; i < numPts; i++)
-    {
-    d = density->GetComponent(i,0);
-    d = (d != 0.0 ? d : 1.0);
-    m = momentum->GetTuple(i);
-    rr = 1.0 / d;
-    u = m[0] * rr;
-    v = m[1] * rr;
-    w = m[2] * rr;
-    v2 = u*u + v*v + w*w;
-    velocityMag->SetTuple1(i, sqrt((double)v2));
-    }
-  velocityMag->SetName("VelocityMagnitude");
-  outputPD->AddArray(velocityMag);
-  velocityMag->Delete();
-  vtkDebugMacro(<<"Created velocity magnitude scalar");
-}
-
-void vtkMultiBlockPLOT3DReader::ComputeEntropy(vtkStructuredGrid* output)
-{
-  double *m, u, v, w, v2, d, rr, s, p, e;
-  vtkIdType i;
-  vtkDataArray *entropy;
-
-  //  Check that the required data is available
-  //
-  vtkPointData* outputPD = output->GetPointData();
-  vtkDataArray* density = outputPD->GetArray("Density");
-  vtkDataArray* momentum = outputPD->GetArray("Momentum");
-  vtkDataArray* energy = outputPD->GetArray("StagnationEnergy");
-  if ( density == NULL || momentum == NULL ||
-       energy == NULL )
-    {
-    vtkErrorMacro(<<"Cannot compute entropy");
-    return;
-    }
-
-  vtkIdType numPts = density->GetNumberOfTuples();
-  entropy = this->NewFloatArray();
-  entropy->SetNumberOfTuples(numPts);
-
-  //  Compute the entropy
-  //
-  for (i=0; i < numPts; i++)
-    {
-    d = density->GetComponent(i,0);
-    d = (d != 0.0 ? d : 1.0);
-    m = momentum->GetTuple(i);
-    e = energy->GetComponent(i,0);
-    rr = 1.0 / d;
-    u = m[0] * rr;
-    v = m[1] * rr;
-    w = m[2] * rr;
-    v2 = u*u + v*v + w*w;
-    p = (this->Gamma-1.)*(e - 0.5*d*v2);
-    s = VTK_CV * log((p/VTK_PINF)/pow((double)d/VTK_RHOINF,(double)this->Gamma));
-    entropy->SetTuple1(i,s);
-  }
-  entropy->SetName("Entropy");
-  outputPD->AddArray(entropy);
-  entropy->Delete();
-  vtkDebugMacro(<<"Created entropy scalar");
-}
-
-void vtkMultiBlockPLOT3DReader::ComputeSwirl(vtkStructuredGrid* output)
-{
-  vtkDataArray *vorticity;
-  double d, rr, *m, u, v, w, v2, *vort, s;
-  vtkIdType i;
-  vtkDataArray *swirl;
-
-  //  Check that the required data is available
-  //
-  vtkPointData* outputPD = output->GetPointData();
-  vtkDataArray* density = outputPD->GetArray("Density");
-  vtkDataArray* momentum = outputPD->GetArray("Momentum");
-  vtkDataArray* energy = outputPD->GetArray("StagnationEnergy");
-  if ( density == NULL || momentum == NULL ||
-       energy == NULL )
-    {
-    vtkErrorMacro(<<"Cannot compute swirl");
-    return;
-    }
-
-  vtkIdType numPts = density->GetNumberOfTuples();
-  swirl = this->NewFloatArray();
-  swirl->SetNumberOfTuples(numPts);
-
-  this->ComputeVorticity(output);
-  vorticity = outputPD->GetArray("Vorticity");
-//
-//  Compute the swirl
-//
-  for (i=0; i < numPts; i++)
-    {
-    d = density->GetComponent(i,0);
-    d = (d != 0.0 ? d : 1.0);
-    m = momentum->GetTuple(i);
-    vort = vorticity->GetTuple(i);
-    rr = 1.0 / d;
-    u = m[0] * rr;
-    v = m[1] * rr;
-    w = m[2] * rr;
-    v2 = u*u + v*v + w*w;
-    if ( v2 != 0.0 )
-      {
-      s = (vort[0]*m[0] + vort[1]*m[1] + vort[2]*m[2]) / v2;
-      }
-    else
-      {
-      s = 0.0;
-      }
-
-    swirl->SetTuple1(i,s);
-  }
-  swirl->SetName("Swirl");
-  outputPD->AddArray(swirl);
-  swirl->Delete();
-  vtkDebugMacro(<<"Created swirl scalar");
-
-}
-
-// Vector functions
-void vtkMultiBlockPLOT3DReader::ComputeVelocity(vtkStructuredGrid* output)
-{
-  double *m, v[3], d, rr;
-  vtkIdType i;
-  vtkDataArray *velocity;
-
-  //  Check that the required data is available
-  //
-  vtkPointData* outputPD = output->GetPointData();
-  vtkDataArray* density = outputPD->GetArray("Density");
-  vtkDataArray* momentum = outputPD->GetArray("Momentum");
-  vtkDataArray* energy = outputPD->GetArray("StagnationEnergy");
-  if ( density == NULL || momentum == NULL ||
-       energy == NULL )
-    {
-    vtkErrorMacro(<<"Cannot compute velocity");
-    return;
-    }
-
-  vtkIdType numPts = density->GetNumberOfTuples();
-  velocity = this->NewFloatArray();
-  velocity->SetNumberOfComponents(3);
-  velocity->SetNumberOfTuples(numPts);
-
-  //  Compute the velocity
-  //
-  for (i=0; i < numPts; i++)
-    {
-    d = density->GetComponent(i,0);
-    d = (d != 0.0 ? d : 1.0);
-    m = momentum->GetTuple(i);
-    rr = 1.0 / d;
-    v[0] = m[0] * rr;
-    v[1] = m[1] * rr;
-    v[2] = m[2] * rr;
-    velocity->SetTuple(i, v);
-  }
-  velocity->SetName("Velocity");
-  outputPD->AddArray(velocity);
-  velocity->Delete();
-  vtkDebugMacro(<<"Created velocity vector");
-}
-
-void vtkMultiBlockPLOT3DReader::ComputeVorticity(vtkStructuredGrid* output)
-{
-  vtkDataArray *velocity;
-  vtkDataArray *vorticity;
-  int dims[3], ijsize;
-  vtkPoints *points;
-  int i, j, k, idx, idx2, ii;
-  double vort[3], xp[3], xm[3], vp[3], vm[3], factor;
-  double xxi, yxi, zxi, uxi, vxi, wxi;
-  double xeta, yeta, zeta, ueta, veta, weta;
-  double xzeta, yzeta, zzeta, uzeta, vzeta, wzeta;
-  double aj, xix, xiy, xiz, etax, etay, etaz, zetax, zetay, zetaz;
-
-  //  Check that the required data is available
-  //
-  vtkPointData* outputPD = output->GetPointData();
-  vtkDataArray* density = outputPD->GetArray("Density");
-  vtkDataArray* momentum = outputPD->GetArray("Momentum");
-  vtkDataArray* energy = outputPD->GetArray("StagnationEnergy");
-  if ( (points=output->GetPoints()) == NULL ||
-       density == NULL || momentum == NULL ||
-       energy == NULL )
-    {
-    vtkErrorMacro(<<"Cannot compute vorticity");
-    return;
-    }
-
-  vtkIdType numPts = density->GetNumberOfTuples();
-  vorticity = this->NewFloatArray();
-  vorticity->SetNumberOfComponents(3);
-  vorticity->SetNumberOfTuples(numPts);
-
-  this->ComputeVelocity(output);
-  velocity = outputPD->GetArray("Velocity");
-
-  output->GetDimensions(dims);
-  ijsize = dims[0]*dims[1];
-
-  for (k=0; k<dims[2]; k++)
-    {
-    for (j=0; j<dims[1]; j++)
-      {
-      for (i=0; i<dims[0]; i++)
-        {
-        //  Xi derivatives.
-        if ( dims[0] == 1 ) // 2D in this direction
-          {
-          factor = 1.0;
-          for (ii=0; ii<3; ii++)
-            {
-            vp[ii] = vm[ii] = xp[ii] = xm[ii] = 0.0;
-            }
-          xp[0] = 1.0;
-          }
-        else if ( i == 0 )
-          {
-          factor = 1.0;
-          idx = (i+1) + j*dims[0] + k*ijsize;
-          idx2 = i + j*dims[0] + k*ijsize;
-          points->GetPoint(idx,xp);
-          points->GetPoint(idx2,xm);
-          velocity->GetTuple(idx,vp);
-          velocity->GetTuple(idx2,vm);
-          }
-        else if ( i == (dims[0]-1) )
-          {
-          factor = 1.0;
-          idx = i + j*dims[0] + k*ijsize;
-          idx2 = i-1 + j*dims[0] + k*ijsize;
-          points->GetPoint(idx,xp);
-          points->GetPoint(idx2,xm);
-          velocity->GetTuple(idx,vp);
-          velocity->GetTuple(idx2,vm);
-          }
-        else
-          {
-          factor = 0.5;
-          idx = (i+1) + j*dims[0] + k*ijsize;
-          idx2 = (i-1) + j*dims[0] + k*ijsize;
-          points->GetPoint(idx,xp);
-          points->GetPoint(idx2,xm);
-          velocity->GetTuple(idx,vp);
-          velocity->GetTuple(idx2,vm);
-          }
-
-        xxi = factor * (xp[0] - xm[0]);
-        yxi = factor * (xp[1] - xm[1]);
-        zxi = factor * (xp[2] - xm[2]);
-        uxi = factor * (vp[0] - vm[0]);
-        vxi = factor * (vp[1] - vm[1]);
-        wxi = factor * (vp[2] - vm[2]);
-
-        //  Eta derivatives.
-        if ( dims[1] == 1 ) // 2D in this direction
-          {
-          factor = 1.0;
-          for (ii=0; ii<3; ii++)
-            {
-            vp[ii] = vm[ii] = xp[ii] = xm[ii] = 0.0;
-            }
-          xp[1] = 1.0;
-          }
-        else if ( j == 0 )
-          {
-          factor = 1.0;
-          idx = i + (j+1)*dims[0] + k*ijsize;
-          idx2 = i + j*dims[0] + k*ijsize;
-          points->GetPoint(idx,xp);
-          points->GetPoint(idx2,xm);
-          velocity->GetTuple(idx,vp);
-          velocity->GetTuple(idx2,vm);
-          }
-        else if ( j == (dims[1]-1) )
-          {
-          factor = 1.0;
-          idx = i + j*dims[0] + k*ijsize;
-          idx2 = i + (j-1)*dims[0] + k*ijsize;
-          points->GetPoint(idx,xp);
-          points->GetPoint(idx2,xm);
-          velocity->GetTuple(idx,vp);
-          velocity->GetTuple(idx2,vm);
-          }
-        else
-          {
-          factor = 0.5;
-          idx = i + (j+1)*dims[0] + k*ijsize;
-          idx2 = i + (j-1)*dims[0] + k*ijsize;
-          points->GetPoint(idx,xp);
-          points->GetPoint(idx2,xm);
-          velocity->GetTuple(idx,vp);
-          velocity->GetTuple(idx2,vm);
-          }
-
-
-        xeta = factor * (xp[0] - xm[0]);
-        yeta = factor * (xp[1] - xm[1]);
-        zeta = factor * (xp[2] - xm[2]);
-        ueta = factor * (vp[0] - vm[0]);
-        veta = factor * (vp[1] - vm[1]);
-        weta = factor * (vp[2] - vm[2]);
-
-        //  Zeta derivatives.
-        if ( dims[2] == 1 ) // 2D in this direction
-          {
-          factor = 1.0;
-          for (ii=0; ii<3; ii++)
-            {
-            vp[ii] = vm[ii] = xp[ii] = xm[ii] = 0.0;
-            }
-          xp[2] = 1.0;
-          }
-        else if ( k == 0 )
-          {
-          factor = 1.0;
-          idx = i + j*dims[0] + (k+1)*ijsize;
-          idx2 = i + j*dims[0] + k*ijsize;
-          points->GetPoint(idx,xp);
-          points->GetPoint(idx2,xm);
-          velocity->GetTuple(idx,vp);
-          velocity->GetTuple(idx2,vm);
-          }
-        else if ( k == (dims[2]-1) )
-          {
-          factor = 1.0;
-          idx = i + j*dims[0] + k*ijsize;
-          idx2 = i + j*dims[0] + (k-1)*ijsize;
-          points->GetPoint(idx,xp);
-          points->GetPoint(idx2,xm);
-          velocity->GetTuple(idx,vp);
-          velocity->GetTuple(idx2,vm);
-          }
-        else
-          {
-          factor = 0.5;
-          idx = i + j*dims[0] + (k+1)*ijsize;
-          idx2 = i + j*dims[0] + (k-1)*ijsize;
-          points->GetPoint(idx,xp);
-          points->GetPoint(idx2,xm);
-          velocity->GetTuple(idx,vp);
-          velocity->GetTuple(idx2,vm);
-          }
-
-        xzeta = factor * (xp[0] - xm[0]);
-        yzeta = factor * (xp[1] - xm[1]);
-        zzeta = factor * (xp[2] - xm[2]);
-        uzeta = factor * (vp[0] - vm[0]);
-        vzeta = factor * (vp[1] - vm[1]);
-        wzeta = factor * (vp[2] - vm[2]);
-
-        // Now calculate the Jacobian.  Grids occasionally have
-        // singularities, or points where the Jacobian is infinite (the
-        // inverse is zero).  For these cases, we'll set the Jacobian to
-        // zero, which will result in a zero vorticity.
-        //
-        aj =  xxi*yeta*zzeta+yxi*zeta*xzeta+zxi*xeta*yzeta
-              -zxi*yeta*xzeta-yxi*xeta*zzeta-xxi*zeta*yzeta;
-        if (aj != 0.0)
-          {
-          aj = 1. / aj;
-          }
-
-        //  Xi metrics.
-        xix  =  aj*(yeta*zzeta-zeta*yzeta);
-        xiy  = -aj*(xeta*zzeta-zeta*xzeta);
-        xiz  =  aj*(xeta*yzeta-yeta*xzeta);
-
-        //  Eta metrics.
-        etax = -aj*(yxi*zzeta-zxi*yzeta);
-        etay =  aj*(xxi*zzeta-zxi*xzeta);
-        etaz = -aj*(xxi*yzeta-yxi*xzeta);
-
-        //  Zeta metrics.
-        zetax=  aj*(yxi*zeta-zxi*yeta);
-        zetay= -aj*(xxi*zeta-zxi*xeta);
-        zetaz=  aj*(xxi*yeta-yxi*xeta);
-
-        //  Finally, the vorticity components.
-        //
-        vort[0]= xiy*wxi+etay*weta+zetay*wzeta - xiz*vxi-etaz*veta-zetaz*vzeta;
-        vort[1]= xiz*uxi+etaz*ueta+zetaz*uzeta - xix*wxi-etax*weta-zetax*wzeta;
-        vort[2]= xix*vxi+etax*veta+zetax*vzeta - xiy*uxi-etay*ueta-zetay*uzeta;
-        idx = i + j*dims[0] + k*ijsize;
-        vorticity->SetTuple(idx,vort);
-        }
-      }
-    }
-  vorticity->SetName("Vorticity");
-  outputPD->AddArray(vorticity);
-  vorticity->Delete();
-  vtkDebugMacro(<<"Created vorticity vector");
-}
-
-void vtkMultiBlockPLOT3DReader::ComputePressureGradient(vtkStructuredGrid* output)
-{
-  vtkDataArray *pressure;
-  vtkDataArray *gradient;
-  int dims[3], ijsize;
-  vtkPoints *points;
-  int i, j, k, idx, idx2, ii;
-  double g[3], xp[3], xm[3], pp, pm, factor;
-  double xxi, yxi, zxi, pxi;
-  double xeta, yeta, zeta, peta;
-  double xzeta, yzeta, zzeta, pzeta;
-  double aj, xix, xiy, xiz, etax, etay, etaz, zetax, zetay, zetaz;
-
-  //  Check that the required data is available
-  //
-  vtkPointData* outputPD = output->GetPointData();
-  vtkDataArray* density = outputPD->GetArray("Density");
-  vtkDataArray* momentum = outputPD->GetArray("Momentum");
-  vtkDataArray* energy = outputPD->GetArray("StagnationEnergy");
-  if ( (points=output->GetPoints()) == NULL ||
-       density == NULL || momentum == NULL ||
-       energy == NULL )
-    {
-    vtkErrorMacro(<<"Cannot compute pressure gradient");
-    return;
-    }
-
-  vtkIdType numPts = density->GetNumberOfTuples();
-  gradient = this->NewFloatArray();
-  gradient->SetNumberOfComponents(3);
-  gradient->SetNumberOfTuples(numPts);
-
-  this->ComputePressure(output);
-  pressure = outputPD->GetArray("Pressure");
-
-  output->GetDimensions(dims);
-  ijsize = dims[0]*dims[1];
-
-  for (k=0; k<dims[2]; k++)
-    {
-    for (j=0; j<dims[1]; j++)
-      {
-      for (i=0; i<dims[0]; i++)
-        {
-        //  Xi derivatives.
-        if ( dims[0] == 1 ) // 2D in this direction
-          {
-          factor = 1.0;
-          for (ii=0; ii<3; ii++)
-            {
-            xp[ii] = xm[ii] = 0.0;
-            }
-          xp[0] = 1.0; pp = pm = 0.0;
-          }
-        else if ( i == 0 )
-          {
-          factor = 1.0;
-          idx = (i+1) + j*dims[0] + k*ijsize;
-          idx2 = i + j*dims[0] + k*ijsize;
-          points->GetPoint(idx,xp);
-          points->GetPoint(idx2,xm);
-          pp = pressure->GetComponent(idx,0);
-          pm = pressure->GetComponent(idx2,0);
-          }
-        else if ( i == (dims[0]-1) )
-          {
-          factor = 1.0;
-          idx = i + j*dims[0] + k*ijsize;
-          idx2 = i-1 + j*dims[0] + k*ijsize;
-          points->GetPoint(idx,xp);
-          points->GetPoint(idx2,xm);
-          pp = pressure->GetComponent(idx,0);
-          pm = pressure->GetComponent(idx2,0);
-          }
-        else
-          {
-          factor = 0.5;
-          idx = (i+1) + j*dims[0] + k*ijsize;
-          idx2 = (i-1) + j*dims[0] + k*ijsize;
-          points->GetPoint(idx,xp);
-          points->GetPoint(idx2,xm);
-          pp = pressure->GetComponent(idx,0);
-          pm = pressure->GetComponent(idx2,0);
-          }
-
-        xxi = factor * (xp[0] - xm[0]);
-        yxi = factor * (xp[1] - xm[1]);
-        zxi = factor * (xp[2] - xm[2]);
-        pxi = factor * (pp - pm);
-
-        //  Eta derivatives.
-        if ( dims[1] == 1 ) // 2D in this direction
-          {
-          factor = 1.0;
-          for (ii=0; ii<3; ii++)
-            {
-            xp[ii] = xm[ii] = 0.0;
-            }
-          xp[1] = 1.0; pp = pm = 0.0;
-          }
-        else if ( j == 0 )
-          {
-          factor = 1.0;
-          idx = i + (j+1)*dims[0] + k*ijsize;
-          idx2 = i + j*dims[0] + k*ijsize;
-          points->GetPoint(idx,xp);
-          points->GetPoint(idx2,xm);
-          pp = pressure->GetComponent(idx,0);
-          pm = pressure->GetComponent(idx2,0);
-          }
-        else if ( j == (dims[1]-1) )
-          {
-          factor = 1.0;
-          idx = i + j*dims[0] + k*ijsize;
-          idx2 = i + (j-1)*dims[0] + k*ijsize;
-          points->GetPoint(idx,xp);
-          points->GetPoint(idx2,xm);
-          pp = pressure->GetComponent(idx,0);
-          pm = pressure->GetComponent(idx2,0);
-          }
-        else
-          {
-          factor = 0.5;
-          idx = i + (j+1)*dims[0] + k*ijsize;
-          idx2 = i + (j-1)*dims[0] + k*ijsize;
-          points->GetPoint(idx,xp);
-          points->GetPoint(idx2,xm);
-          pp = pressure->GetComponent(idx,0);
-          pm = pressure->GetComponent(idx2,0);
-          }
-
-        xeta = factor * (xp[0] - xm[0]);
-        yeta = factor * (xp[1] - xm[1]);
-        zeta = factor * (xp[2] - xm[2]);
-        peta = factor * (pp - pm);
-
-        //  Zeta derivatives.
-        if ( dims[2] == 1 ) // 2D in this direction
-          {
-          factor = 1.0;
-          for (ii=0; ii<3; ii++)
-            {
-            xp[ii] = xm[ii] = 0.0;
-            }
-          xp[2] = 1.0; pp = pm = 0.0;
-          }
-        else if ( k == 0 )
-          {
-          factor = 1.0;
-          idx = i + j*dims[0] + (k+1)*ijsize;
-          idx2 = i + j*dims[0] + k*ijsize;
-          points->GetPoint(idx,xp);
-          points->GetPoint(idx2,xm);
-          pp = pressure->GetComponent(idx,0);
-          pm = pressure->GetComponent(idx2,0);
-          }
-        else if ( k == (dims[2]-1) )
-          {
-          factor = 1.0;
-          idx = i + j*dims[0] + k*ijsize;
-          idx2 = i + j*dims[0] + (k-1)*ijsize;
-          points->GetPoint(idx,xp);
-          points->GetPoint(idx2,xm);
-          pp = pressure->GetComponent(idx,0);
-          pm = pressure->GetComponent(idx2,0);
-          }
-        else
-          {
-          factor = 0.5;
-          idx = i + j*dims[0] + (k+1)*ijsize;
-          idx2 = i + j*dims[0] + (k-1)*ijsize;
-          points->GetPoint(idx,xp);
-          points->GetPoint(idx2,xm);
-          pp = pressure->GetComponent(idx,0);
-          pm = pressure->GetComponent(idx2,0);
-          }
-
-        xzeta = factor * (xp[0] - xm[0]);
-        yzeta = factor * (xp[1] - xm[1]);
-        zzeta = factor * (xp[2] - xm[2]);
-        pzeta = factor * (pp - pm);
-
-        //  Now calculate the Jacobian.  Grids occasionally have
-        //  singularities, or points where the Jacobian is infinite (the
-        //  inverse is zero).  For these cases, we'll set the Jacobian to
-        //  zero, which will result in a zero vorticity.
-        //
-        aj =  xxi*yeta*zzeta+yxi*zeta*xzeta+zxi*xeta*yzeta
-              -zxi*yeta*xzeta-yxi*xeta*zzeta-xxi*zeta*yzeta;
-        if (aj != 0.0)
-          {
-          aj = 1. / aj;
-          }
-
-        //  Xi metrics.
-        xix  =  aj*(yeta*zzeta-zeta*yzeta);
-        xiy  = -aj*(xeta*zzeta-zeta*xzeta);
-        xiz  =  aj*(xeta*yzeta-yeta*xzeta);
-
-        //  Eta metrics.
-        etax = -aj*(yxi*zzeta-zxi*yzeta);
-        etay =  aj*(xxi*zzeta-zxi*xzeta);
-        etaz = -aj*(xxi*yzeta-yxi*xzeta);
-
-        //  Zeta metrics.
-        zetax=  aj*(yxi*zeta-zxi*yeta);
-        zetay= -aj*(xxi*zeta-zxi*xeta);
-        zetaz=  aj*(xxi*yeta-yxi*xeta);
-
-        //  Finally, the vorticity components.
-        g[0]= xix*pxi+etax*peta+zetax*pzeta;
-        g[1]= xiy*pxi+etay*peta+zetay*pzeta;
-        g[2]= xiz*pxi+etaz*peta+zetaz*pzeta;
-
-        idx = i + j*dims[0] + k*ijsize;
-        gradient->SetTuple(idx,g);
-        }
-      }
-    }
-  gradient->SetName("PressureGradient");
-  outputPD->AddArray(gradient);
-  gradient->Delete();
-  vtkDebugMacro(<<"Created pressure gradient vector");
-}
-
-void vtkMultiBlockPLOT3DReader::ComputePressureCoefficient(vtkStructuredGrid* output)
-{
-  double *m, e, u, v, w, v2, p, d, g, rr, pc, gi, pi, fsm, den;
-  vtkIdType i;
-
-  //  Check that the required data is available
-  //
-  vtkPointData* outputPD = output->GetPointData();
-  vtkFieldData* outputFD = output->GetFieldData();
-  // It's already computed
-  if (outputPD->GetArray("PressureCoefficient"))
-    {
-    return;
-    }
-  vtkDataArray* density = outputPD->GetArray("Density");
-  vtkDataArray* momentum = outputPD->GetArray("Momentum");
-  vtkDataArray* energy = outputPD->GetArray("StagnationEnergy");
-  vtkDataArray* gamma = outputPD->GetArray("Gamma");
-  vtkDataArray* props = outputFD->GetArray("Properties");
-  if ( density == NULL || momentum == NULL ||
-       energy == NULL  || gamma == NULL || props == NULL)
-    {
-    vtkErrorMacro(<<"Cannot compute pressure coefficient");
-    return;
-    }
-
-  vtkIdType numPts = density->GetNumberOfTuples();
-  vtkDataArray* pressure_coeff = this->NewFloatArray();
-  pressure_coeff->SetNumberOfTuples(numPts);
-  //  Compute the pressure coefficient
-  //
-  gi = props->GetComponent(0,4);
-  fsm = props->GetComponent(0,0);
-  den = .5*fsm*fsm;
-  for (i=0; i < numPts; i++)
-    {
-    d = density->GetComponent(i,0);
-    d = (d != 0.0 ? d : 1.0);
-    m = momentum->GetTuple(i);
-    e = energy->GetComponent(i,0);
-    g = gamma->GetComponent(i,0);
-    pi = 1.0 / gi;
-    rr = 1.0 / d;
-    u = m[0] * rr;
-    v = m[1] * rr;
-    w = m[2] * rr;
-    v2 = u*u + v*v + w*w;
-    p = (g-1.) * (e - 0.5 * d * v2);
-    pc = (p - pi)/den;
-    pressure_coeff->SetTuple1(i, pc);
-    }
-
-  pressure_coeff->SetName("PressureCoefficient");
-  outputPD->AddArray(pressure_coeff);
-  pressure_coeff->Delete();
-  vtkDebugMacro(<<"Created pressure coefficient scalar");
-}
-
-void vtkMultiBlockPLOT3DReader::ComputeMachNumber(vtkStructuredGrid* output)
-{
-  double *m, e, u, v, w, v2, a2, d, g, rr;
-  vtkIdType i;
-
-  //  Check that the required data is available
-  //
-  vtkPointData* outputPD = output->GetPointData();
-  // It's already computed
-  if (outputPD->GetArray("MachNumber"))
-    {
-    return;
-    }
-  vtkDataArray* density = outputPD->GetArray("Density");
-  vtkDataArray* momentum = outputPD->GetArray("Momentum");
-  vtkDataArray* energy = outputPD->GetArray("StagnationEnergy");
-  vtkDataArray* gamma = outputPD->GetArray("Gamma");
-  if ( density == NULL || momentum == NULL ||
-       energy == NULL  || gamma == NULL)
-    {
-    vtkErrorMacro(<<"Cannot compute mach number");
-    return;
-    }
-
-  vtkIdType numPts = density->GetNumberOfTuples();
-  vtkDataArray* machnumber = this->NewFloatArray();
-  machnumber->SetNumberOfTuples(numPts);
-
-  //  Compute the mach number
-  //
-  for (i=0; i < numPts; i++)
-    {
-    d = density->GetComponent(i,0);
-    d = (d != 0.0 ? d : 1.0);
-    m = momentum->GetTuple(i);
-    e = energy->GetComponent(i,0);
-    g = gamma->GetComponent(i,0);
-    rr = 1.0 / d;
-    u = m[0] * rr;
-    v = m[1] * rr;
-    w = m[2] * rr;
-    v2 = u*u + v*v + w*w;
-    a2 = g * (g-1.) * (e * rr - .5*v2);
-    machnumber->SetTuple1(i, sqrt(v2/a2));
-  }
-
-  machnumber->SetName("MachNumber");
-  outputPD->AddArray(machnumber);
-  machnumber->Delete();
-  vtkDebugMacro(<<"Created mach number scalar");
-}
-
-void vtkMultiBlockPLOT3DReader::ComputeSoundSpeed(vtkStructuredGrid* output)
-{
-  double *m, e, u, v, w, v2, p, d, g, rr;
-  vtkIdType i;
-
-  //  Check that the required data is available
-  //
-  vtkPointData* outputPD = output->GetPointData();
-  // It's already computed
-  if (outputPD->GetArray("SoundSpeed"))
-    {
-    return;
-    }
-  vtkDataArray* density = outputPD->GetArray("Density");
-  vtkDataArray* momentum = outputPD->GetArray("Momentum");
-  vtkDataArray* energy = outputPD->GetArray("StagnationEnergy");
-  vtkDataArray* gamma = outputPD->GetArray("Gamma");
-  if ( density == NULL || momentum == NULL ||
-       energy == NULL  || gamma == NULL)
-    {
-    vtkErrorMacro(<<"Cannot compute sound speed");
-    return;
-    }
-
-  vtkIdType numPts = density->GetNumberOfTuples();
-  vtkDataArray* soundspeed = this->NewFloatArray();
-  soundspeed->SetNumberOfTuples(numPts);
-
-  //  Compute sound speed
-  //
-  for (i=0; i < numPts; i++)
-    {
-    d = density->GetComponent(i,0);
-    d = (d != 0.0 ? d : 1.0);
-    m = momentum->GetTuple(i);
-    e = energy->GetComponent(i,0);
-    g = gamma->GetComponent(i,0);
-    rr = 1.0 / d;
-    u = m[0] * rr;
-    v = m[1] * rr;
-    w = m[2] * rr;
-    v2 = u*u + v*v + w*w;
-    p = (g-1.) * (e - 0.5 * d * v2);
-    soundspeed->SetTuple1(i, sqrt(g*p*rr));
-  }
-
-  soundspeed->SetName("SoundSpeed");
-  outputPD->AddArray(soundspeed);
-  soundspeed->Delete();
-  vtkDebugMacro(<<"Created sound speed scalar");
-}
-
-void vtkMultiBlockPLOT3DReader::ComputeVorticityMagnitude(vtkStructuredGrid* output)
-{
-  vtkPointData* outputPD = output->GetPointData();
-  // It's already computed
-  if (outputPD->GetArray("VorticityMagnitude"))
-    {
-    return;
-    }
-  this->ComputeVorticity(output);
-  vtkDataArray* vorticity = outputPD->GetArray("Vorticity");
-  vtkDataArray* vm = this->NewFloatArray();
-  vtkIdType numPts = vorticity->GetNumberOfTuples();
-  vm->SetNumberOfTuples(numPts);
-  for (vtkIdType idx=0; idx<numPts; idx++)
-    {
-    double* vort = vorticity->GetTuple(idx);
-    double magnitude = sqrt(vort[0]*vort[0]+
-                            vort[1]*vort[1]+vort[2]*vort[2]);
-    vm->SetTuple1(idx, magnitude);
-    }
-  vm->SetName("VorticityMagnitude");
-  outputPD->AddArray(vm);
-  vm->Delete();
-}
-
-void vtkMultiBlockPLOT3DReader::ComputeStrainRate(vtkStructuredGrid* output)
-{
-  vtkDataArray *velocity;
-  int dims[3], ijsize;
-  int i, j, k, idx, idx2, ii;
-  double stRate[3], xp[3], xm[3], vp[3], vm[3], factor;
-  double xxi, yxi, zxi, uxi, vxi, wxi;
-  double xeta, yeta, zeta, ueta, veta, weta;
-  double xzeta, yzeta, zzeta, uzeta, vzeta, wzeta;
-  double aj, xix, xiy, xiz, etax, etay, etaz, zetax, zetay, zetaz;
-
-  //  Check that the required data is available
-  //
-  vtkPointData* outputPD = output->GetPointData();
-  if (outputPD->GetArray("StrainRate"))
-    {
-    return;
-    }
-  vtkDataArray* density = outputPD->GetArray("Density");
-  vtkDataArray* momentum = outputPD->GetArray("Momentum");
-  if ( density == NULL || momentum == NULL )
-    {
-    vtkErrorMacro("Cannot compute strain rate.");
-    return;
-    }
-
-  vtkIdType numPts = density->GetNumberOfTuples();
-  vtkDataArray* strainRate = this->NewFloatArray();
-  strainRate->SetNumberOfComponents(3);
-  strainRate->SetNumberOfTuples(numPts);
-  strainRate->SetName("StrainRate");
-
-  this->ComputeVelocity(output);
-  velocity = outputPD->GetArray("Velocity");
-  if(!velocity)
-    {
-    vtkErrorMacro("Could not compute strain rate.");
-    return;
-    }
-
-  output->GetDimensions(dims);
-  ijsize = dims[0]*dims[1];
-
-  for (k=0; k<dims[2]; k++)
-    {
-    for (j=0; j<dims[1]; j++)
-      {
-      for (i=0; i<dims[0]; i++)
-        {
-        //  Xi derivatives.
-        if ( dims[0] == 1 ) // 2D in this direction
-          {
-          factor = 1.0;
-          for (ii=0; ii<3; ii++)
-            {
-            vp[ii] = vm[ii] = xp[ii] = xm[ii] = 0.0;
-            }
-          xp[0] = 1.0;
-          }
-        else if ( i == 0 )
-          {
-          factor = 1.0;
-          idx = (i+1) + j*dims[0] + k*ijsize;
-          idx2 = i + j*dims[0] + k*ijsize;
-          output->GetPoint(idx,xp);
-          output->GetPoint(idx2,xm);
-          velocity->GetTuple(idx,vp);
-          velocity->GetTuple(idx2,vm);
-          }
-        else if ( i == (dims[0]-1) )
-          {
-          factor = 1.0;
-          idx = i + j*dims[0] + k*ijsize;
-          idx2 = i-1 + j*dims[0] + k*ijsize;
-          output->GetPoint(idx,xp);
-          output->GetPoint(idx2,xm);
-          velocity->GetTuple(idx,vp);
-          velocity->GetTuple(idx2,vm);
-          }
-        else
-          {
-          factor = 0.5;
-          idx = (i+1) + j*dims[0] + k*ijsize;
-          idx2 = (i-1) + j*dims[0] + k*ijsize;
-          output->GetPoint(idx,xp);
-          output->GetPoint(idx2,xm);
-          velocity->GetTuple(idx,vp);
-          velocity->GetTuple(idx2,vm);
-          }
-
-        xxi = factor * (xp[0] - xm[0]);
-        yxi = factor * (xp[1] - xm[1]);
-        zxi = factor * (xp[2] - xm[2]);
-        uxi = factor * (vp[0] - vm[0]);
-        vxi = factor * (vp[1] - vm[1]);
-        wxi = factor * (vp[2] - vm[2]);
-
-        //  Eta derivatives.
-        if ( dims[1] == 1 ) // 2D in this direction
-          {
-          factor = 1.0;
-          for (ii=0; ii<3; ii++)
-            {
-            vp[ii] = vm[ii] = xp[ii] = xm[ii] = 0.0;
-            }
-          xp[1] = 1.0;
-          }
-        else if ( j == 0 )
-          {
-          factor = 1.0;
-          idx = i + (j+1)*dims[0] + k*ijsize;
-          idx2 = i + j*dims[0] + k*ijsize;
-          output->GetPoint(idx,xp);
-          output->GetPoint(idx2,xm);
-          velocity->GetTuple(idx,vp);
-          velocity->GetTuple(idx2,vm);
-          }
-        else if ( j == (dims[1]-1) )
-          {
-          factor = 1.0;
-          idx = i + j*dims[0] + k*ijsize;
-          idx2 = i + (j-1)*dims[0] + k*ijsize;
-          output->GetPoint(idx,xp);
-          output->GetPoint(idx2,xm);
-          velocity->GetTuple(idx,vp);
-          velocity->GetTuple(idx2,vm);
-          }
-        else
-          {
-          factor = 0.5;
-          idx = i + (j+1)*dims[0] + k*ijsize;
-          idx2 = i + (j-1)*dims[0] + k*ijsize;
-          output->GetPoint(idx,xp);
-          output->GetPoint(idx2,xm);
-          velocity->GetTuple(idx,vp);
-          velocity->GetTuple(idx2,vm);
-          }
-
-
-        xeta = factor * (xp[0] - xm[0]);
-        yeta = factor * (xp[1] - xm[1]);
-        zeta = factor * (xp[2] - xm[2]);
-        ueta = factor * (vp[0] - vm[0]);
-        veta = factor * (vp[1] - vm[1]);
-        weta = factor * (vp[2] - vm[2]);
-
-        //  Zeta derivatives.
-        if ( dims[2] == 1 ) // 2D in this direction
-          {
-          factor = 1.0;
-          for (ii=0; ii<3; ii++)
-            {
-            vp[ii] = vm[ii] = xp[ii] = xm[ii] = 0.0;
-            }
-          xp[2] = 1.0;
-          }
-        else if ( k == 0 )
-          {
-          factor = 1.0;
-          idx = i + j*dims[0] + (k+1)*ijsize;
-          idx2 = i + j*dims[0] + k*ijsize;
-          output->GetPoint(idx,xp);
-          output->GetPoint(idx2,xm);
-          velocity->GetTuple(idx,vp);
-          velocity->GetTuple(idx2,vm);
-          }
-        else if ( k == (dims[2]-1) )
-          {
-          factor = 1.0;
-          idx = i + j*dims[0] + k*ijsize;
-          idx2 = i + j*dims[0] + (k-1)*ijsize;
-          output->GetPoint(idx,xp);
-          output->GetPoint(idx2,xm);
-          velocity->GetTuple(idx,vp);
-          velocity->GetTuple(idx2,vm);
-          }
-        else
-          {
-          factor = 0.5;
-          idx = i + j*dims[0] + (k+1)*ijsize;
-          idx2 = i + j*dims[0] + (k-1)*ijsize;
-          output->GetPoint(idx,xp);
-          output->GetPoint(idx2,xm);
-          velocity->GetTuple(idx,vp);
-          velocity->GetTuple(idx2,vm);
-          }
-
-        xzeta = factor * (xp[0] - xm[0]);
-        yzeta = factor * (xp[1] - xm[1]);
-        zzeta = factor * (xp[2] - xm[2]);
-        uzeta = factor * (vp[0] - vm[0]);
-        vzeta = factor * (vp[1] - vm[1]);
-        wzeta = factor * (vp[2] - vm[2]);
-
-        // Now calculate the Jacobian.  Grids occasionally have
-        // singularities, or points where the Jacobian is infinite (the
-        // inverse is zero).  For these cases, we'll set the Jacobian to
-        // zero, which will result in a zero vorticity.
-        //
-        aj =  xxi*yeta*zzeta+yxi*zeta*xzeta+zxi*xeta*yzeta
-              -zxi*yeta*xzeta-yxi*xeta*zzeta-xxi*zeta*yzeta;
-        if (aj != 0.0)
-          {
-          aj = 1. / aj;
-          }
-
-        //  Xi metrics.
-        xix  =  aj*(yeta*zzeta-zeta*yzeta);
-        xiy  = -aj*(xeta*zzeta-zeta*xzeta);
-        xiz  =  aj*(xeta*yzeta-yeta*xzeta);
-
-        //  Eta metrics.
-        etax = -aj*(yxi*zzeta-zxi*yzeta);
-        etay =  aj*(xxi*zzeta-zxi*xzeta);
-        etaz = -aj*(xxi*yzeta-yxi*xzeta);
-
-        //  Zeta metrics.
-        zetax=  aj*(yxi*zeta-zxi*yeta);
-        zetay= -aj*(xxi*zeta-zxi*xeta);
-        zetaz=  aj*(xxi*yeta-yxi*xeta);
-
-        //  Finally, the strain rate components.
-        //
-        stRate[0] = xix*uxi+etax*ueta+zetax*uzeta;
-        stRate[1] = xiy*vxi+etay*veta+zetay*vzeta;
-        stRate[2] = xiz*wxi+etaz*weta+zetaz*wzeta;
-        idx = i + j*dims[0] + k*ijsize;
-        strainRate->SetTuple(idx,stRate);
-        }
-      }
-    }
-  outputPD->AddArray(strainRate);
-  strainRate->Delete();
-}
-
-void vtkMultiBlockPLOT3DReader::SetByteOrderToBigEndian()
-{
-  this->ByteOrder = FILE_BIG_ENDIAN;
-}
-
-void vtkMultiBlockPLOT3DReader::SetByteOrderToLittleEndian()
-{
-  this->ByteOrder = FILE_LITTLE_ENDIAN;
-}
-
-const char *vtkMultiBlockPLOT3DReader::GetByteOrderAsString()
-{
-  if ( this->ByteOrder ==  FILE_LITTLE_ENDIAN)
-    {
-    return "LittleEndian";
-    }
-  else
-    {
-    return "BigEndian";
-    }
-}
-
-void vtkMultiBlockPLOT3DReader::AddFunction(int functionNumber)
-{
-  this->FunctionList->InsertNextValue(functionNumber);
-  this->Modified();
-}
-
-void vtkMultiBlockPLOT3DReader::RemoveAllFunctions()
-{
-  this->FunctionList->Reset();
-  this->Modified();
-}
-
-int vtkMultiBlockPLOT3DReader::FillOutputPortInformation(
-  int vtkNotUsed(port), vtkInformation* info)
-{
-  info->Set(vtkDataObject::DATA_TYPE_NAME(), "vtkMultiBlockDataSet");
-  return 1;
-}
-
-void vtkMultiBlockPLOT3DReader::PrintSelf(ostream& os, vtkIndent indent)
-{
-  this->Superclass::PrintSelf(os,indent);
-
-  os << indent << "XYZ File Name: " <<
-    (this->XYZFileName ? this->XYZFileName : "(none)") << "\n";
-  os << indent << "Q File Name: " <<
-    (this->QFileName ? this->QFileName : "(none)") << "\n";
-  os << indent << "Function File Name: " <<
-    (this->FunctionFileName ? this->FunctionFileName : "(none)") << "\n";
-  os << indent << "BinaryFile: " << this->BinaryFile << endl;
-  os << indent << "HasByteCount: " << this->HasByteCount << endl;
-  os << indent << "Gamma: " << this->Gamma << endl;
-  os << indent << "R: " << this->R << endl;
-  os << indent << "ScalarFunctionNumber: " << this->ScalarFunctionNumber << endl;
-  os << indent << "VectorFunctionNumber: " << this->VectorFunctionNumber << endl;
-  os << indent << "MultiGrid: " << this->MultiGrid << endl;
-  os << indent << "ForceRead: " << this->ForceRead << endl;
-  os << indent << "IBlanking: " << this->IBlanking << endl;
-  os << indent << "ByteOrder: " << this->ByteOrder << endl;
-  os << indent << "TwoDimensionalGeometry: " << (this->TwoDimensionalGeometry?"on":"off")
-     << endl;
-  os << indent << "Double Precision:" << this->DoublePrecision << endl;
-  os << indent << "Auto Detect Format: " << this->AutoDetectFormat << endl;
-}
diff --git a/IO/Parallel/vtkMultiBlockPLOT3DReader.h b/IO/Parallel/vtkMultiBlockPLOT3DReader.h
deleted file mode 100644
index 0efa317..0000000
--- a/IO/Parallel/vtkMultiBlockPLOT3DReader.h
+++ /dev/null
@@ -1,372 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkMultiBlockPLOT3DReader.h
-
-  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.
-
-=========================================================================*/
-// .NAME vtkMultiBlockPLOT3DReader - read PLOT3D data files
-// .SECTION Description
-// vtkMultiBlockPLOT3DReader is a reader object that reads PLOT3D formatted
-// files and generates structured grid(s) on output. PLOT3D is a computer
-// graphics program designed to visualize the grids and solutions of
-// computational fluid dynamics. This reader also supports the variant
-// of the PLOT3D format used by NASA's OVERFLOW CFD software, including
-// full support for all Q variables. Please see the "PLOT3D User's Manual"
-// available from NASA Ames Research Center, Moffett Field CA.
-//
-// PLOT3D files consist of a grid file (also known as XYZ file), an
-// optional solution file (also known as a Q file), and an optional function
-// file that contains user created data (currently unsupported). The Q file
-// contains solution  information as follows: the four parameters free stream
-// mach number (Fsmach), angle of attack (Alpha), Reynolds number (Re), and
-// total integration time (Time). This information is stored in an array
-// called Properties in the FieldData of each output (tuple 0: fsmach, tuple 1:
-// alpha, tuple 2: re, tuple 3: time). In addition, the solution file contains
-// the flow density (scalar), flow momentum (vector), and flow energy (scalar).
-//
-// Note that this reader does not support time series data which is usually
-// stored as a series of Q and optionally XYZ files. If you want to read such
-// a file series, use vtkPlot3DMetaReader.
-//
-// The reader can generate additional scalars and vectors (or "functions")
-// from this information. To use vtkMultiBlockPLOT3DReader, you must specify the
-// particular function number for the scalar and vector you want to visualize.
-// This implementation of the reader provides the following functions. The
-// scalar functions are:
-//    -1  - don't read or compute any scalars
-//    100 - density
-//    110 - pressure
-//    111 - pressure coefficient (requires Overflow file with Gamma)
-//    112 - mach number (requires Overflow file with Gamma)
-//    113 - sounds speed (requires Overflow file with Gamma)
-//    120 - temperature
-//    130 - enthalpy
-//    140 - internal energy
-//    144 - kinetic energy
-//    153 - velocity magnitude
-//    163 - stagnation energy
-//    170 - entropy
-//    184 - swirl
-//    211 - vorticity magnitude
-//
-// The vector functions are:
-//    -1  - don't read or compute any vectors
-//    200 - velocity
-//    201 - vorticity
-//    202 - momentum
-//    210 - pressure gradient.
-//    212 - strain rate
-//
-// (Other functions are described in the PLOT3D spec, but only those listed are
-// implemented here.) Note that by default, this reader creates the density
-// scalar (100), stagnation energy (163) and momentum vector (202) as output.
-// (These are just read in from the solution file.) Please note that the validity
-// of computation is a function of this class's gas constants (R, Gamma) and the
-// equations used. They may not be suitable for your computational domain.
-//
-// Additionally, you can read other data and associate it as a vtkDataArray
-// into the output's point attribute data. Use the method AddFunction()
-// to list all the functions that you'd like to read. AddFunction() accepts
-// an integer parameter that defines the function number.
-//
-// .SECTION See Also
-// vtkMultiBlockDataSet vtkStructuredGrid vtkPlot3DMetaReader
-
-#ifndef vtkMultiBlockPLOT3DReader_h
-#define vtkMultiBlockPLOT3DReader_h
-
-#include "vtkIOParallelModule.h" // For export macro
-#include "vtkMultiBlockDataSetAlgorithm.h"
-
-class vtkDataArray;
-class vtkUnsignedCharArray;
-class vtkIntArray;
-class vtkStructuredGrid;
-class vtkMultiProcessController;
-
-struct vtkMultiBlockPLOT3DReaderInternals;
-
-class VTKIOPARALLEL_EXPORT vtkMultiBlockPLOT3DReader : public vtkMultiBlockDataSetAlgorithm
-{
-public:
-  static vtkMultiBlockPLOT3DReader *New();
-  vtkTypeMacro(vtkMultiBlockPLOT3DReader,vtkMultiBlockDataSetAlgorithm);
-  void PrintSelf(ostream& os, vtkIndent indent);
-
-  // Description:
-  // Set/Get the PLOT3D geometry filename.
-  void SetFileName(const char* name) { this->SetXYZFileName(name); }
-  const char* GetFileName() { return this->GetXYZFileName(); }
-  virtual void SetXYZFileName( const char* );
-  vtkGetStringMacro(XYZFileName);
-
-  // Description:
-  // Set/Get the PLOT3D solution filename.
-  vtkSetStringMacro(QFileName);
-  vtkGetStringMacro(QFileName);
-
-  // Description:
-  // Set/Get the PLOT3D function filename.
-  vtkSetStringMacro(FunctionFileName);
-  vtkGetStringMacro(FunctionFileName);
-
-  // Description:
-  // When this option is turned on, the reader will try to figure
-  // out the values of various options such as byte order, byte
-  // count etc. automatically. This options works only for binary
-  // files. When it is turned on, the reader should be able to read
-  // most Plot3D files automatically. The default is OFF for backwards
-  // compatibility reasons. For binary files, it is strongly recommended
-  // that you turn on AutoDetectFormat and leave the other file format
-  // related options untouched.
-  vtkSetMacro(AutoDetectFormat, int);
-  vtkGetMacro(AutoDetectFormat, int);
-  vtkBooleanMacro(AutoDetectFormat, int);
-
-  // Description:
-  // Is the file to be read written in binary format (as opposed
-  // to ascii).
-  vtkSetMacro(BinaryFile, int);
-  vtkGetMacro(BinaryFile, int);
-  vtkBooleanMacro(BinaryFile, int);
-
-  // Description:
-  // Does the file to be read contain information about number of
-  // grids. In some PLOT3D files, the first value contains the number
-  // of grids (even if there is only 1). If reading such a file,
-  // set this to true.
-  vtkSetMacro(MultiGrid, int);
-  vtkGetMacro(MultiGrid, int);
-  vtkBooleanMacro(MultiGrid, int);
-
-  // Description:
-  // Were the arrays written with leading and trailing byte counts ?
-  // Usually, files written by a fortran program will contain these
-  // byte counts whereas the ones written by C/C++ won't.
-  vtkSetMacro(HasByteCount, int);
-  vtkGetMacro(HasByteCount, int);
-  vtkBooleanMacro(HasByteCount, int);
-
-  // Description:
-  // Is there iblanking (point visibility) information in the file.
-  // If there is iblanking arrays, these will be read and assigned
-  // to the PointVisibility array of the output.
-  vtkSetMacro(IBlanking, int);
-  vtkGetMacro(IBlanking, int);
-  vtkBooleanMacro(IBlanking, int);
-
-  // Description:
-  // If only two-dimensional data was written to the file,
-  // turn this on.
-  vtkSetMacro(TwoDimensionalGeometry, int);
-  vtkGetMacro(TwoDimensionalGeometry, int);
-  vtkBooleanMacro(TwoDimensionalGeometry, int);
-
-  // Description:
-  // Is this file in double precision or single precision.
-  // This only matters for binary files.
-  // Default is single.
-  vtkSetMacro(DoublePrecision, int);
-  vtkGetMacro(DoublePrecision, int);
-  vtkBooleanMacro(DoublePrecision, int);
-
-  // Description:
-  // Try to read a binary file even if the file length seems to be
-  // inconsistent with the header information. Use this with caution,
-  // if the file length is not the same as calculated from the header.
-  // either the file is corrupt or the settings are wrong.
-  vtkSetMacro(ForceRead, int);
-  vtkGetMacro(ForceRead, int);
-  vtkBooleanMacro(ForceRead, int);
-
-  // Description:
-  // Set the byte order of the file (remember, more Unix workstations
-  // write big endian whereas PCs write little endian). Default is
-  // big endian (since most older PLOT3D files were written by
-  // workstations).
-  void SetByteOrderToBigEndian();
-  void SetByteOrderToLittleEndian();
-  vtkSetMacro(ByteOrder, int);
-  vtkGetMacro(ByteOrder, int);
-  const char *GetByteOrderAsString();
-
-  // Description:
-  // Set/Get the gas constant. Default is 1.0.
-  vtkSetMacro(R,double);
-  vtkGetMacro(R,double);
-
-  // Description:
-  // Set/Get the ratio of specific heats. Default is 1.4.
-  vtkSetMacro(Gamma,double);
-  vtkGetMacro(Gamma,double);
-
-  // Description:
-  // Specify the scalar function to extract. If ==(-1), then no scalar
-  // function is extracted.
-  void SetScalarFunctionNumber(int num);
-  vtkGetMacro(ScalarFunctionNumber,int);
-
-  // Description:
-  // Specify the vector function to extract. If ==(-1), then no vector
-  // function is extracted.
-  void SetVectorFunctionNumber(int num);
-  vtkGetMacro(VectorFunctionNumber,int);
-
-  // Description:
-  // Specify additional functions to read. These are placed into the
-  // point data as data arrays. Later on they can be used by labeling
-  // them as scalars, etc.
-  void AddFunction(int functionNumber);
-  void RemoveFunction(int);
-  void RemoveAllFunctions();
-
-  // Description:
-  // Return 1 if the reader can read the given file name. Only meaningful
-  // for binary files.
-  virtual int CanReadBinaryFile(const char* fname);
-
-  // Description:
-  // Set/Get the communicator object (we'll use global World controller
-  // if you don't set a different one).
-  void SetController(vtkMultiProcessController *c);
-  vtkGetObjectMacro(Controller, vtkMultiProcessController);
-
-//BTX
-  enum
-  {
-    FILE_BIG_ENDIAN=0,
-    FILE_LITTLE_ENDIAN=1
-  };
-//ETX
-
-protected:
-  vtkMultiBlockPLOT3DReader();
-  ~vtkMultiBlockPLOT3DReader();
-
-  vtkDataArray* CreateFloatArray();
-
-  int CheckFile(FILE*& fp, const char* fname);
-  int CheckGeometryFile(FILE*& xyzFp);
-  int CheckSolutionFile(FILE*& qFp);
-  int CheckFunctionFile(FILE*& fFp);
-
-  int GetByteCountSize();
-  int SkipByteCount (FILE* fp);
-  int ReadIntBlock  (FILE* fp, int n, int*   block);
-
-  vtkIdType ReadValues(
-    FILE* fp,
-    int n,
-    vtkDataArray* scalar);
-  virtual int ReadIntScalar(
-    void* vfp,
-    int extent[6], int wextent[6],
-    vtkDataArray* scalar, vtkTypeUInt64 offset);
-  virtual int ReadScalar(
-    void* vfp,
-    int extent[6], int wextent[6],
-    vtkDataArray* scalar, vtkTypeUInt64 offset);
-  virtual int ReadVector(
-    void* vfp,
-    int extent[6], int wextent[6],
-    int numDims, vtkDataArray* vector, vtkTypeUInt64 offset);
-  virtual int OpenFileForDataRead(void*& fp, const char* fname);
-  virtual void CloseFile(void* fp);
-
-  int GetNumberOfBlocksInternal(FILE* xyzFp, int allocate);
-
-  int ReadGeometryHeader(FILE* fp);
-  int ReadQHeader(FILE* fp, bool checkGrid, int& nq, int& nqc, int& overflow);
-  int ReadFunctionHeader(FILE* fp, int* nFunctions);
-
-  void CalculateFileSize(FILE* fp);
-
-  int AutoDetectionCheck(FILE* fp);
-
-  void AssignAttribute(int fNumber, vtkStructuredGrid* output,
-                       int attributeType);
-  void MapFunction(int fNumber, vtkStructuredGrid* output);
-  void ComputeTemperature(vtkStructuredGrid* output);
-  void ComputePressure(vtkStructuredGrid* output);
-  void ComputeEnthalpy(vtkStructuredGrid* output);
-  void ComputeKineticEnergy(vtkStructuredGrid* output);
-  void ComputeVelocityMagnitude(vtkStructuredGrid* output);
-  void ComputeEntropy(vtkStructuredGrid* output);
-  void ComputeSwirl(vtkStructuredGrid* output);
-  void ComputeVelocity(vtkStructuredGrid* output);
-  void ComputeVorticity(vtkStructuredGrid* output);
-  void ComputePressureGradient(vtkStructuredGrid* output);
-  void ComputePressureCoefficient(vtkStructuredGrid* output);
-  void ComputeMachNumber(vtkStructuredGrid* output);
-  void ComputeSoundSpeed(vtkStructuredGrid* output);
-  void ComputeVorticityMagnitude(vtkStructuredGrid* output);
-  void ComputeStrainRate(vtkStructuredGrid* output);
-
-  // Returns a vtkFloatArray or a vtkDoubleArray depending
-  // on DoublePrecision setting
-  vtkDataArray* NewFloatArray();
-
-  // Delete references to any existing vtkPoints and
-  // I-blank arrays. The next Update() will (re)read
-  // the XYZ file.
-  void ClearGeometryCache();
-
-  //plot3d FileNames
-  char *XYZFileName;
-  char *QFileName;
-  char *FunctionFileName;
-
-  int BinaryFile;
-  int HasByteCount;
-  int TwoDimensionalGeometry;
-  int MultiGrid;
-  int ForceRead;
-  int ByteOrder;
-  int IBlanking;
-  int DoublePrecision;
-  int AutoDetectFormat;
-
-  int ExecutedGhostLevels;
-
-  size_t FileSize;
-
-  //parameters used in computing derived functions
-  double R;
-  double Gamma;
-  double Uvinf;
-  double Vvinf;
-  double Wvinf;
-
-  //functions to read that are not scalars or vectors
-  vtkIntArray *FunctionList;
-
-  int ScalarFunctionNumber;
-  int VectorFunctionNumber;
-
-  virtual int FillOutputPortInformation(int port, vtkInformation* info);
-
-  virtual int RequestData(vtkInformation*,
-                          vtkInformationVector**,
-                          vtkInformationVector*);
-  virtual int RequestInformation(vtkInformation*,
-                                 vtkInformationVector**,
-                                 vtkInformationVector*);
-
-  vtkMultiBlockPLOT3DReaderInternals* Internal;
-
-  vtkMultiProcessController *Controller;
-
-private:
-  vtkMultiBlockPLOT3DReader(const vtkMultiBlockPLOT3DReader&);  // Not implemented.
-  void operator=(const vtkMultiBlockPLOT3DReader&);  // Not implemented.
-};
-
-#endif
diff --git a/IO/Parallel/vtkMultiBlockPLOT3DReaderInternals.cxx b/IO/Parallel/vtkMultiBlockPLOT3DReaderInternals.cxx
deleted file mode 100644
index 7747bc8..0000000
--- a/IO/Parallel/vtkMultiBlockPLOT3DReaderInternals.cxx
+++ /dev/null
@@ -1,411 +0,0 @@
-
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkMultiBlockPLOT3DReaderInternals.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 "vtkMultiBlockPLOT3DReaderInternals.h"
-
-int vtkMultiBlockPLOT3DReaderInternals::ReadInts(FILE* fp, int n, int* val)
-{
-  int retVal = static_cast<int>(fread(val, sizeof(int), n, fp));
-  if (this->Settings.ByteOrder == vtkMultiBlockPLOT3DReader::FILE_LITTLE_ENDIAN)
-    {
-    vtkByteSwap::Swap4LERange(val, n);
-    }
-  else
-    {
-    vtkByteSwap::Swap4BERange(val, n);
-    }
-  return retVal;
-}
-
-void vtkMultiBlockPLOT3DReaderInternals::CheckBinaryFile(FILE *fp, size_t fileSize)
-{
-  rewind(fp);
-  this->Settings.BinaryFile = 0;
-
-  // The shortest binary file is 12 files: 2 ints for block dims + 1 float for
-  // a coordinate.
-  if (fileSize < 12)
-    {
-    return;
-    }
-
-  char bytes[12];
-  if (fread(bytes, 1, 12, fp) != 12)
-    {
-    return;
-    }
-  // Check the first 12 bytes. If we find non-ascii characters, then we
-  // assume that it is binary.
-  for (int i=0; i<12; i++)
-    {
-    if (!(isdigit(bytes[i]) || bytes[i] == '.' ||
-          bytes[i] == ' ' || bytes[i] == '\r' ||
-          bytes[i] == '\n' || bytes[i] == '\t'))
-      {
-      this->Settings.BinaryFile = 1;
-      return;
-      }
-    }
-}
-
-int vtkMultiBlockPLOT3DReaderInternals::CheckByteOrder(FILE* fp)
-{
-  rewind(fp);
-  int i;
-  if (fread(&i, sizeof(int), 1, fp) < 1)
-    {
-    return 0;
-    }
-  char* cpy = (char*)&i;
-
-  // If binary, we can assume that the first value is going to be either a
-  // count (Fortran) or a number of block or a dimension. We assume that
-  // this number will be smaller than 2^24. Then we check the first byte.
-  // If it is 0 and the last byte is not 0, it is likely that this is big
-  // endian.
-  if(cpy[0] == 0 && cpy[3] != 0)
-    {
-    this->Settings.ByteOrder = vtkMultiBlockPLOT3DReader::FILE_BIG_ENDIAN;
-    }
-  else
-    {
-    this->Settings.ByteOrder = vtkMultiBlockPLOT3DReader::FILE_LITTLE_ENDIAN;
-    }
-  return 1;
-}
-
-int vtkMultiBlockPLOT3DReaderInternals::CheckByteCount(FILE* fp)
-{
-  rewind(fp);
-  // Read the first integer, then skip by that many bytes, then
-  // read the value again. If the two match, it is likely that
-  // the file has byte counts.
-  int count;
-  if (!this->ReadInts(fp, 1, &count))
-    {
-    return 0;
-    }
-  if (fseek(fp, count, SEEK_CUR) != 0)
-    {
-    return 0;
-    }
-  int count2;
-  if (!this->ReadInts(fp, 1, &count2))
-    {
-    return 0;
-    }
-  if (count == count2)
-    {
-    this->Settings.HasByteCount = 1;
-    }
-  else
-    {
-    this->Settings.HasByteCount = 0;
-    }
-  return 1;
-}
-
-int vtkMultiBlockPLOT3DReaderInternals::CheckMultiGrid(FILE* fp)
-{
-  if (this->Settings.HasByteCount)
-    {
-    rewind(fp);
-    // We read the byte count, if it is 4 (1 int),
-    // then this is multi-grid because the first
-    // value is the number of grids rather than
-    // an array of 2 or 3 values.
-    int recMarkBeg;
-    if (!this->ReadInts(fp, 1, &recMarkBeg))
-      {
-      return 0;
-      }
-    if(recMarkBeg == sizeof(int))
-      {
-      this->Settings.MultiGrid = 1;
-      }
-    else
-      {
-      this->Settings.MultiGrid = 0;
-      }
-    return 1;
-    }
-  return 0;
-}
-
-int vtkMultiBlockPLOT3DReaderInternals::Check2DGeom(FILE* fp)
-{
-  if (this->Settings.HasByteCount)
-    {
-    rewind(fp);
-    int recMarkBeg, recMarkEnd;
-    int numGrids = 1;
-    if(this->Settings.MultiGrid)
-      {
-      if (!this->ReadInts(fp, 1, &recMarkBeg) ||
-          !this->ReadInts(fp, 1, &numGrids) ||
-          !this->ReadInts(fp, 1, &recMarkEnd))
-        {
-        return 0;
-        }
-      }
-    if (!this->ReadInts(fp, 1, &recMarkBeg))
-      {
-      return 0;
-      }
-    int nMax = 3*numGrids;
-    int ndims;
-    if(recMarkBeg == static_cast<int>(nMax*sizeof(int) + 2*sizeof(int)))
-      {
-      ndims = 3;
-      }
-    else
-      {
-      if(recMarkBeg == static_cast<int>(nMax*sizeof(int)))
-        {
-        ndims = 3;
-        }
-      else
-        {
-        ndims = 2;
-        }
-      }
-    this->Settings.NumberOfDimensions = ndims;
-    return 1;
-    }
-  return 0;
-}
-
-int vtkMultiBlockPLOT3DReaderInternals::CheckBlankingAndPrecision(FILE* fp)
-{
-  int recMarkBeg, recMarkEnd, numGrids = 1, nMax, totPts;
-  int* jmax;
-
-  rewind(fp);
-  if(this->Settings.MultiGrid)
-    {
-    if (!this->ReadInts(fp, 1, &recMarkBeg) ||
-        !this->ReadInts(fp, 1, &numGrids) ||
-        !this->ReadInts(fp, 1, &recMarkEnd))
-      {
-      return 0;
-      }
-    }
-  if (!this->ReadInts(fp, 1, &recMarkBeg))
-    {
-    return 0;
-    }
-  nMax = this->Settings.NumberOfDimensions * numGrids;
-  jmax = new int[numGrids*3]; // allocate memory for jmax
-  if (!this->ReadInts(fp, nMax, jmax) ||
-      !this->ReadInts(fp, 1, &recMarkEnd))
-    {
-    delete[] jmax;
-    return 0;
-    }
-  totPts = 1;
-  for (int i=0; i<this->Settings.NumberOfDimensions; i++)
-    {
-    totPts *= jmax[i];
-    }
-  this->ReadInts(fp, 1, &recMarkBeg);
-  // single precision, with iblanking
-  if(recMarkBeg == totPts*(this->Settings.NumberOfDimensions*4 + 4))
-    {
-    this->Settings.Precision = 4;
-    this->Settings.IBlanking = 1;
-    delete[] jmax;
-    return 1;
-    }
-  // double precision, with iblanking
-  else if(recMarkBeg == totPts*(this->Settings.NumberOfDimensions*8 + 4))
-    {
-    this->Settings.Precision = 8;
-    this->Settings.IBlanking = 1;
-    delete[] jmax;
-    return 1;
-    }
-  // single precision, no iblanking
-  else if(recMarkBeg == totPts*this->Settings.NumberOfDimensions*4)
-    {
-    this->Settings.Precision = 4;
-    this->Settings.IBlanking = 0;
-    delete[] jmax;
-    return 1;
-    }
-  // double precision, no iblanking
-  else if(recMarkBeg == totPts*this->Settings.NumberOfDimensions*8)
-    {
-    this->Settings.Precision = 8;
-    this->Settings.IBlanking = 0;
-    delete[] jmax;
-    return 1;
-    }
-  return 0;
-}
-
-// Unfortunately, a Plot3D file written in C is trickier
-// to check becaues it has no byte count markers. We need
-// to do a bit more brute force checks based on reading
-// data and estimating file size.
-int vtkMultiBlockPLOT3DReaderInternals::CheckCFile(FILE* fp, size_t fileSize)
-{
-  int precisions[2] = {4, 8};
-  int blankings[2] = {0, 1};
-  int dimensions[2] = {2, 3};
-
-  rewind(fp);
-  int gridDims[3];
-  if (this->ReadInts(fp, 3, gridDims) != 3)
-    {
-    return 0;
-    }
-
-  // Single grid
-  for (int i=0; i<2; i++)
-    {
-    int precision = precisions[i];
-    for (int j=0; j<2; j++)
-      {
-      int blanking = blankings[j];
-      for (int k=0; k<2; k++)
-        {
-        int dimension = dimensions[k];
-
-        if (fileSize ==
-            this->CalculateFileSize(false,
-                                    precision,
-                                    blanking,
-                                    dimension,
-                                    false, // always
-                                    1,
-                                    gridDims))
-          {
-          this->Settings.MultiGrid = 0;
-          this->Settings.Precision = precision;
-          this->Settings.IBlanking = blanking;
-          this->Settings.NumberOfDimensions = dimension;
-          return 1;
-          }
-        }
-      }
-    }
-
-  // Multi grid
-  int nGrids;
-  rewind(fp);
-  if (!this->ReadInts(fp, 1, &nGrids))
-    {
-    return 0;
-    }
-  int* gridDims2 = new int[3*nGrids];
-  if (this->ReadInts(fp, nGrids*3, gridDims2) != nGrids*3)
-    {
-    delete[] gridDims2;
-    return 0;
-    }
-
-  for (int i=0; i<2; i++)
-    {
-    int precision = precisions[i];
-    for (int j=0; j<2; j++)
-      {
-      int blanking = blankings[j];
-      for (int k=0; k<2; k++)
-        {
-        int dimension = dimensions[k];
-
-        if (fileSize ==
-            this->CalculateFileSize(true,
-                                    precision,
-                                    blanking,
-                                    dimension,
-                                    false, // always
-                                    nGrids,
-                                    gridDims2))
-          {
-          this->Settings.MultiGrid = 1;
-          this->Settings.Precision = precision;
-          this->Settings.IBlanking = blanking;
-          this->Settings.NumberOfDimensions = dimension;
-          delete[] gridDims2;
-          return 1;
-          }
-        }
-      }
-    }
-  delete[] gridDims2;
-  return 0;
-}
-
-size_t vtkMultiBlockPLOT3DReaderInternals::CalculateFileSize(int mgrid,
-                                                           int precision, // in bytes
-                                                           int blanking,
-                                                           int ndims,
-                                                           int hasByteCount,
-                                                           int nGrids,
-                                                           int* gridDims)
-{
-  size_t size = 0; // the header portion, 3 ints
-
-  // N grids
-  if (mgrid)
-    {
-    size += 4; // int for nblocks
-    if (hasByteCount)
-      {
-      size += 2*4; // byte counts for nblocks
-      }
-    }
-  // Header
-  size += nGrids*ndims*4;
-
-  if (hasByteCount)
-    {
-    size += 2*4; // byte counts for grid dims
-    }
-  for (int i=0; i<nGrids; i++)
-    {
-    size += this->CalculateFileSizeForBlock(
-      precision, blanking, ndims, hasByteCount, gridDims + ndims*i);
-    }
-  return size;
-}
-
-size_t vtkMultiBlockPLOT3DReaderInternals::CalculateFileSizeForBlock(int precision, // in bytes
-                                                                   int blanking,
-                                                                   int ndims,
-                                                                   int hasByteCount,
-                                                                   int* gridDims)
-{
-  size_t size = 0;
-  // x, y, (z)
-  size_t npts = 1;
-  for (int i=0; i<ndims; i++)
-    {
-    npts *= gridDims[i];
-    }
-  size += npts*ndims*precision;
-
-  if (blanking)
-    {
-    size += npts*4;
-    }
-
-  if (hasByteCount)
-    {
-    size += 2*4;
-    }
-  return size;
-}
diff --git a/IO/Parallel/vtkMultiBlockPLOT3DReaderInternals.h b/IO/Parallel/vtkMultiBlockPLOT3DReaderInternals.h
deleted file mode 100644
index 2d85cec..0000000
--- a/IO/Parallel/vtkMultiBlockPLOT3DReaderInternals.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkMultiBlockPLOT3DReaderInternals.h
-
-  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.
-
-=========================================================================*/
-#ifndef vtkMultiBlockPLOT3DReaderInternals_h
-#define vtkMultiBlockPLOT3DReaderInternals_h
-
-#include "vtkByteSwap.h"
-#include "vtkMultiBlockPLOT3DReader.h"
-#include "vtkSmartPointer.h"
-#include "vtkStructuredGrid.h"
-
-#include <vector>
-
-struct vtkMultiBlockPLOT3DReaderInternals
-{
-  struct Dims
-  {
-
-  Dims()
-  {
-    memset(this->Values, 0, 3*sizeof(int));
-  }
-
-  int Values[3];
-  };
-
-  std::vector<Dims> Dimensions;
-  std::vector<vtkSmartPointer<vtkStructuredGrid> > Blocks;
-
-  struct InternalSettings
-  {
-    int BinaryFile;
-    int ByteOrder;
-    int HasByteCount;
-    int MultiGrid;
-    int NumberOfDimensions;
-    int Precision; // in bytes
-    int IBlanking;
-    InternalSettings() :
-      BinaryFile(1),
-      ByteOrder(vtkMultiBlockPLOT3DReader::FILE_BIG_ENDIAN),
-      HasByteCount(1),
-      MultiGrid(0),
-      NumberOfDimensions(3),
-      Precision(4),
-      IBlanking(0)
-      {
-      }
-  };
-
-  InternalSettings Settings;
-  bool NeedToCheckXYZFile;
-
-  vtkMultiBlockPLOT3DReaderInternals() :
-    NeedToCheckXYZFile(true)
-    {
-    }
-
-  int ReadInts(FILE* fp, int n, int* val);
-  void CheckBinaryFile(FILE *fp, size_t fileSize);
-  int CheckByteOrder(FILE* fp);
-  int CheckByteCount(FILE* fp);
-  int CheckMultiGrid(FILE* fp);
-  int Check2DGeom(FILE* fp);
-  int CheckBlankingAndPrecision(FILE* fp);
-  int CheckCFile(FILE* fp, size_t fileSize);
-  size_t CalculateFileSize(int mgrid,
-                         int precision, // in bytes
-                         int blanking,
-                         int ndims,
-                         int hasByteCount,
-                         int nGrids,
-                         int* gridDims);
-  size_t CalculateFileSizeForBlock(int precision, // in bytes
-                                 int blanking,
-                                 int ndims,
-                                 int hasByteCount,
-                                 int* gridDims);
-};
-#endif
-// VTK-HeaderTest-Exclude: vtkMultiBlockPLOT3DReaderInternals.h
diff --git a/IO/Parallel/vtkPDataSetReader.cxx b/IO/Parallel/vtkPDataSetReader.cxx
index fe4260d..e1ca4bd 100644
--- a/IO/Parallel/vtkPDataSetReader.cxx
+++ b/IO/Parallel/vtkPDataSetReader.cxx
@@ -71,18 +71,27 @@ void vtkPDataSetReader::SetNumberOfPieces(int num)
   // Delete the previous file names/extents.
   for (i = 0; i < this->NumberOfPieces; ++i)
     {
-    delete [] this->PieceFileNames[i];
-    this->PieceFileNames[i] = NULL;
+    if (this->PieceFileNames[i])
+      {
+      delete [] this->PieceFileNames[i];
+      this->PieceFileNames[i] = NULL;
+      }
     if (this->PieceExtents && this->PieceExtents[i])
       {
       delete [] this->PieceExtents[i];
       this->PieceExtents[i] = NULL;
       }
     }
-  delete [] this->PieceFileNames;
-  this->PieceFileNames = NULL;
-  delete [] this->PieceExtents;
-  this->PieceExtents = NULL;
+  if (this->PieceFileNames)
+    {
+    delete [] this->PieceFileNames;
+    this->PieceFileNames = NULL;
+    }
+  if (this->PieceExtents)
+    {
+    delete [] this->PieceExtents;
+    this->PieceExtents = NULL;
+    }
   this->NumberOfPieces = 0;
 
 
@@ -652,14 +661,16 @@ void vtkPDataSetReader::ReadVTKFileInformation(
 
   vtkInformation* info = outputVector->GetInformationObject(0);
 
+  // To avoid UMR in the first string comparison
+  strcpy(str, "        ");
+
   // Try to find the line that specifies the dataset type.
   i = 0;
-  do
+  while (strncmp(str, "DATASET", 7) != 0 && i < 6)
     {
     file->getline(str, 1024);
     ++i;
     }
-  while (strncmp(str, "DATASET", 7) != 0 && i < 6);
 
   if (strncmp(str, "DATASET POLYDATA", 16) == 0)
     {
@@ -712,8 +723,7 @@ void vtkPDataSetReader::ReadVTKFileInformation(
     this->DataType = VTK_IMAGE_DATA;
     file->getline(str, 1024, ' ');
     // hack to stop reading.
-    while (strncmp(str, "DIMENSIONS", 10) == 0 || strncmp(str, "SPACING", 7) == 0 ||
-           strncmp(str, "ASPECT_RATIO", 12) == 0 || strncmp(str, "ORIGIN", 6) == 0)
+    while (strlen(str) > 5)
       {
       if (strncmp(str, "DIMENSIONS", 10) == 0)
         {
@@ -854,7 +864,10 @@ ifstream *vtkPDataSetReader::OpenFile(const char* filename)
 
   if (! file || file->fail())
     {
-    delete file;
+    if (file)
+      {
+      delete file;
+      }
     vtkErrorMacro(<< "Initialize: Could not open file " << filename);
     return NULL;
     }
@@ -1181,7 +1194,7 @@ int vtkPDataSetReader::ImageDataExecute(
     et->PieceToExtent();
     int zeroExt[6];
     et->GetExtent(zeroExt);
-    output->GenerateGhostArray(zeroExt);
+    output->GenerateGhostLevelArray(zeroExt);
     }
 
   return 1;
@@ -1375,7 +1388,7 @@ int vtkPDataSetReader::StructuredGridExecute(
     et->PieceToExtent();
     int zeroExt[6];
     et->GetExtent(zeroExt);
-    output->GenerateGhostArray(zeroExt);
+    output->GenerateGhostLevelArray(zeroExt);
     }
 
   return 1;
diff --git a/IO/Parallel/vtkPImageWriter.cxx b/IO/Parallel/vtkPImageWriter.cxx
index d080732..f268ac7 100644
--- a/IO/Parallel/vtkPImageWriter.cxx
+++ b/IO/Parallel/vtkPImageWriter.cxx
@@ -44,8 +44,8 @@ vtkStandardNewMacro(vtkPImageWriter);
 //----------------------------------------------------------------------------
 vtkPImageWriter::vtkPImageWriter()
 {
-  // Set a default memory limit of a gibibyte
-  this->MemoryLimit = 1 * 1024 * 1024;
+  // Set a default memory limit of a gigabyte
+  this->MemoryLimit = 1000000;
 
   this->SizeEstimator = vtkPipelineSize::New();
 }
@@ -67,7 +67,7 @@ void vtkPImageWriter::PrintSelf(ostream& os, vtkIndent indent)
 {
   this->Superclass::PrintSelf(os,indent);
 
-  os << indent << "MemoryLimit (in kibibytes): " << this->MemoryLimit << "\n";
+  os << indent << "MemoryLimit: " << this->MemoryLimit << "\n";
 }
 
 
diff --git a/IO/Parallel/vtkPImageWriter.h b/IO/Parallel/vtkPImageWriter.h
index cae7984..a7ced24 100644
--- a/IO/Parallel/vtkPImageWriter.h
+++ b/IO/Parallel/vtkPImageWriter.h
@@ -35,7 +35,7 @@ public:
   void PrintSelf(ostream& os, vtkIndent indent);
 
   // Description:
-  // Set / Get the memory limit in kibibytes (1024 bytes). The writer will
+  // Set / Get the memory limit in kilobytes. The writer will
   // stream to attempt to keep the pipeline size within this limit
   vtkSetMacro(MemoryLimit, unsigned long);
   vtkGetMacro(MemoryLimit, unsigned long);
diff --git a/IO/Parallel/vtkPlot3DMetaReader.cxx b/IO/Parallel/vtkPlot3DMetaReader.cxx
deleted file mode 100644
index 0838567..0000000
--- a/IO/Parallel/vtkPlot3DMetaReader.cxx
+++ /dev/null
@@ -1,513 +0,0 @@
-/*=========================================================================
-
-  Program:   ParaView
-  Module:    $RCSfile: vtkPlot3DMetaReader.cxx,v $
-
-  Copyright (c) Kitware, Inc.
-  All rights reserved.
-  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html 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 "vtkPlot3DMetaReader.h"
-
-#include "vtkStreamingDemandDrivenPipeline.h"
-#include "vtkInformation.h"
-#include "vtkInformationVector.h"
-#include "vtkMath.h"
-#include "vtkMultiBlockDataSet.h"
-#include "vtkObjectFactory.h"
-#include "vtkMultiBlockPLOT3DReader.h"
-
-#include <vtksys/SystemTools.hxx>
-
-#include <map>
-#include <vector>
-#include <string>
-
-#include "vtk_jsoncpp.h"
-
-#define CALL_MEMBER_FN(object,ptrToMember)  ((object).*(ptrToMember))
-
-vtkStandardNewMacro(vtkPlot3DMetaReader);
-
-typedef void (vtkPlot3DMetaReader::*Plot3DFunction)(Json::Value* val);
-
-struct Plot3DTimeStep
-{
-  double Time;
-  std::string XYZFile;
-  std::string QFile;
-  std::string FunctionFile;
-};
-
-struct vtkPlot3DMetaReaderInternals
-{
-  std::map<std::string, Plot3DFunction> FunctionMap;
-  std::vector<Plot3DTimeStep> TimeSteps;
-
-  std::string ResolveFileName(std::string metaFileName,
-                              std::string fileName)
-    {
-      if (vtksys::SystemTools::FileIsFullPath(fileName.c_str()))
-        {
-        return fileName;
-        }
-      else
-        {
-        std::string path = vtksys::SystemTools::GetFilenamePath(metaFileName);
-        std::vector<std::string> components;
-        components.push_back(path + "/");
-        components.push_back(fileName);
-        return vtksys::SystemTools::JoinPath(components);
-        }
-    }
-};
-
-//-----------------------------------------------------------------------------
-vtkPlot3DMetaReader::vtkPlot3DMetaReader()
-{
-  this->SetNumberOfInputPorts(0);
-  this->SetNumberOfOutputPorts(1);
-
-  this->Reader = vtkMultiBlockPLOT3DReader::New();
-  this->Reader->AutoDetectFormatOn();
-
-  this->FileName = 0;
-
-  this->Internal = new vtkPlot3DMetaReaderInternals;
-
-  this->Internal->FunctionMap["auto-detect-format"] =
-    &vtkPlot3DMetaReader::SetAutoDetectFormat;
-  this->Internal->FunctionMap["byte-order"] =
-    &vtkPlot3DMetaReader::SetByteOrder;
-  this->Internal->FunctionMap["precision"] =
-    &vtkPlot3DMetaReader::SetPrecision;
-  this->Internal->FunctionMap["multi-grid"] =
-    &vtkPlot3DMetaReader::SetMultiGrid;
-  this->Internal->FunctionMap["format"] =
-    &vtkPlot3DMetaReader::SetFormat;
-  this->Internal->FunctionMap["blanking"] =
-    &vtkPlot3DMetaReader::SetBlanking;
-  this->Internal->FunctionMap["language"] =
-    &vtkPlot3DMetaReader::SetLanguage;
-  this->Internal->FunctionMap["2D"] =
-    &vtkPlot3DMetaReader::Set2D;
-  this->Internal->FunctionMap["R"] =
-    &vtkPlot3DMetaReader::SetR;
-  this->Internal->FunctionMap["gamma"] =
-    &vtkPlot3DMetaReader::SetGamma;
-  this->Internal->FunctionMap["filenames"] =
-    &vtkPlot3DMetaReader::SetFileNames;
-  this->Internal->FunctionMap["functions"] =
-    &vtkPlot3DMetaReader::AddFunctions;
-}
-
-//-----------------------------------------------------------------------------
-vtkPlot3DMetaReader::~vtkPlot3DMetaReader()
-{
-  this->Reader->Delete();
-
-  delete this->Internal;
-
-  delete[] this->FileName;
-}
-
-//-----------------------------------------------------------------------------
-void vtkPlot3DMetaReader::SetAutoDetectFormat(Json::Value* val)
-{
-  bool value = val->asBool();
-  if (value)
-    {
-    this->Reader->AutoDetectFormatOn();
-    }
-  else
-    {
-    this->Reader->AutoDetectFormatOff();
-    }
-}
-
-//-----------------------------------------------------------------------------
-void vtkPlot3DMetaReader::SetByteOrder(Json::Value* val)
-{
-  std::string value = val->asString();
-  if (value == "little")
-    {
-    this->Reader->SetByteOrderToLittleEndian();
-    }
-  else if (value == "big")
-    {
-    this->Reader->SetByteOrderToBigEndian();
-    }
-  else
-    {
-    vtkErrorMacro("Unrecognized byte order: " <<
-                  value.c_str()<< ". Valid options are \"little\" and \"big\"."
-                  " Setting to little endian");
-    this->Reader->SetByteOrderToLittleEndian();
-    }
-}
-
-//-----------------------------------------------------------------------------
-void vtkPlot3DMetaReader::SetLanguage(Json::Value* val)
-{
-  std::string value = val->asString();
-  if (value == "fortran")
-    {
-    this->Reader->HasByteCountOn();
-    }
-  else if (value == "C")
-    {
-    this->Reader->HasByteCountOff();
-    }
-  else
-    {
-    vtkErrorMacro("Unrecognized language: " <<
-                  value.c_str()<< ". Valid options are \"fortran\" and \"C\"."
-                  " Setting to little fortran");
-    this->Reader->HasByteCountOn();
-    }
-}
-
-//-----------------------------------------------------------------------------
-void vtkPlot3DMetaReader::SetPrecision(Json::Value* val)
-{
-  int value = val->asInt();
-  if (value == 32)
-    {
-    this->Reader->DoublePrecisionOff();
-    }
-  else if (value == 64)
-    {
-    this->Reader->DoublePrecisionOn();
-    }
-  else
-    {
-    vtkErrorMacro("Unrecognized precision: " <<
-                  value << ". Valid options are 32 and 64 (bits)."
-                  " Setting to 32 bits");
-    this->Reader->DoublePrecisionOff();
-    }
-}
-
-//-----------------------------------------------------------------------------
-void vtkPlot3DMetaReader::SetMultiGrid(Json::Value* val)
-{
-  bool value = val->asBool();
-  if (value)
-    {
-    this->Reader->MultiGridOn();
-    }
-  else
-    {
-    this->Reader->MultiGridOff();
-    }
-}
-
-//-----------------------------------------------------------------------------
-void vtkPlot3DMetaReader::SetFormat(Json::Value* val)
-{
-  std::string value = val->asString();
-  if (value == "binary")
-    {
-    this->Reader->BinaryFileOn();
-    }
-  else if (value == "ascii")
-    {
-    this->Reader->BinaryFileOff();
-    }
-  else
-    {
-    vtkErrorMacro("Unrecognized file type: " <<
-                  value.c_str()<< ". Valid options are \"binary\" and \"ascii\"."
-                  " Setting to binary");
-    this->Reader->BinaryFileOn();
-    }
-}
-
-//-----------------------------------------------------------------------------
-void vtkPlot3DMetaReader::SetBlanking(Json::Value* val)
-{
-  bool value = val->asBool();
-  if (value)
-    {
-    this->Reader->IBlankingOn();
-    }
-  else
-    {
-    this->Reader->IBlankingOff();
-    }
-}
-
-//-----------------------------------------------------------------------------
-void vtkPlot3DMetaReader::Set2D(Json::Value* val)
-{
-  bool value = val->asBool();
-  if (value)
-    {
-    this->Reader->TwoDimensionalGeometryOn();
-    }
-  else
-    {
-    this->Reader->TwoDimensionalGeometryOff();
-    }
-}
-
-//-----------------------------------------------------------------------------
-void vtkPlot3DMetaReader::SetR(Json::Value* val)
-{
-  double R = val->asDouble();
-  this->Reader->SetR(R);
-}
-
-//-----------------------------------------------------------------------------
-void vtkPlot3DMetaReader::SetGamma(Json::Value* val)
-{
-  double gamma = val->asDouble();
-  this->Reader->SetGamma(gamma);
-}
-
-//-----------------------------------------------------------------------------
-void vtkPlot3DMetaReader::AddFunctions(Json::Value* val)
-{
-  const Json::Value& functions = *val;
-  for ( size_t index = 0; index < functions.size(); ++index )
-    {
-    this->Reader->AddFunction(functions[(int)index].asInt());
-    }
-}
-
-//-----------------------------------------------------------------------------
-void vtkPlot3DMetaReader::SetFileNames(Json::Value* val)
-{
-  const Json::Value& filenames = *val;
-  for ( size_t index = 0; index < filenames.size(); ++index )
-    {
-    const Json::Value& astep = filenames[(int)index];
-    bool doAdd = true;
-    Plot3DTimeStep aTime;
-    if (!astep.isMember("time"))
-      {
-      vtkErrorMacro("Missing time value in timestep " << index);
-      doAdd = false;
-      }
-    else
-      {
-      aTime.Time = astep["time"].asDouble();
-      }
-
-    if (!astep.isMember("xyz"))
-      {
-      vtkErrorMacro("Missing xyz filename in timestep " << index);
-      doAdd = false;
-      }
-    else
-      {
-      std::string xyzfile = astep["xyz"].asString();
-      aTime.XYZFile = this->Internal->ResolveFileName(this->FileName,
-                                                      xyzfile);
-      }
-
-    if (astep.isMember("q"))
-      {
-      std::string qfile = astep["q"].asString();
-      aTime.QFile = this->Internal->ResolveFileName(this->FileName,
-                                                    qfile);
-      }
-
-    if (astep.isMember("function"))
-      {
-      std::string functionfile = astep["function"].asString();
-      aTime.FunctionFile = this->Internal->ResolveFileName(this->FileName,
-                                                           functionfile);
-      }
-
-    if (doAdd)
-      {
-      this->Internal->TimeSteps.push_back(aTime);
-      }
-    }
-}
-
-//----------------------------------------------------------------------------
-int vtkPlot3DMetaReader::RequestInformation(
-  vtkInformation* vtkNotUsed(request),
-  vtkInformationVector** vtkNotUsed(inputVector),
-  vtkInformationVector* outputVector)
-{
-  vtkInformation* outInfo = outputVector->GetInformationObject(0);
-  outInfo->Set(vtkAlgorithm::CAN_HANDLE_PIECE_REQUEST(), 1);
-
-  this->Internal->TimeSteps.clear();
-
-  this->Reader->RemoveAllFunctions();
-
-  if (!this->FileName)
-    {
-    vtkErrorMacro("No file name was specified. Cannot execute.");
-    return 0;
-    }
-
-  ifstream file(this->FileName);
-
-  Json::Value root;
-  Json::Reader reader;
-  bool parsingSuccessful = reader.parse(file, root);
-  if (!parsingSuccessful)
-    {
-    // report to the user the failure and their locations in the document.
-    vtkErrorMacro("Failed to parse configuration\n"
-                  << reader.getFormattedErrorMessages().c_str());
-    return 0;
-    }
-
-  Json::Value::Members members = root.getMemberNames();
-  Json::Value::Members::iterator memberIterator;
-  for (memberIterator = members.begin();
-       memberIterator != members.end();
-       memberIterator++)
-    {
-    std::map<std::string, Plot3DFunction>::iterator iter =
-      this->Internal->FunctionMap.find(*memberIterator);
-    if (iter != this->Internal->FunctionMap.end())
-      {
-      Json::Value val = root[*memberIterator];
-      Plot3DFunction func = iter->second;
-      CALL_MEMBER_FN(*this, func)(&val);
-      }
-    else
-      {
-      vtkErrorMacro("Syntax error in file. Option \""
-                    << memberIterator->c_str()
-                    << "\" is not valid.");
-      }
-    }
-
-  std::vector<Plot3DTimeStep>::iterator iter;
-  std::vector<double> timeValues;
-  for (iter  = this->Internal->TimeSteps.begin();
-       iter != this->Internal->TimeSteps.end();
-       iter++)
-    {
-    timeValues.push_back(iter->Time);
-    }
-
-  size_t numSteps = timeValues.size();
-  if (numSteps > 0)
-    {
-    outInfo->Set(vtkStreamingDemandDrivenPipeline::TIME_STEPS(),
-                 &timeValues[0],
-                 (int)numSteps);
-
-    double timeRange[2];
-    timeRange[0] = timeValues[0];
-    timeRange[1] = timeValues[numSteps - 1];
-    outInfo->Set(vtkStreamingDemandDrivenPipeline::TIME_RANGE(),
-                 timeRange,
-                 2);
-    }
-
-  return 1;
-}
-
-//----------------------------------------------------------------------------
-int vtkPlot3DMetaReader::RequestData(
-  vtkInformation*,
-  vtkInformationVector**,
-  vtkInformationVector* outputVector)
-{
-  vtkInformation* outInfo = outputVector->GetInformationObject(0);
-  vtkMultiBlockDataSet* output = vtkMultiBlockDataSet::GetData(
-    outputVector->GetInformationObject(0));
-
-  double timeValue = 0;
-  if (outInfo->Has(vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEP()))
-    {
-    // Get the requested time step. We only supprt requests of a single time
-    // step in this reader right now
-    timeValue =
-      outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEP());
-    }
-
-  int tsLength =
-    outInfo->Length(vtkStreamingDemandDrivenPipeline::TIME_STEPS());
-  double *steps =
-    outInfo->Get(vtkStreamingDemandDrivenPipeline::TIME_STEPS());
-
-  if (tsLength < 1)
-    {
-    vtkErrorMacro("No timesteps were found. Please specify at least one "
-                  "filenames entry in the input file.");
-    return 0;
-    }
-
-
-  // find the first time value larger than requested time value
-  // this logic could be improved
-  int cnt = 0;
-  while (cnt < tsLength-1 && steps[cnt] < timeValue)
-    {
-    cnt++;
-    }
-
-  int updateTime = cnt;
-
-  if (updateTime >= tsLength)
-    {
-    updateTime = tsLength - 1;
-    }
-
-  if (tsLength > updateTime)
-    {
-    this->Reader->SetXYZFileName(
-      this->Internal->TimeSteps[updateTime].XYZFile.c_str());
-    const char* qname = this->Internal->TimeSteps[updateTime].QFile.c_str();
-    if (strlen(qname) > 0)
-      {
-      this->Reader->SetQFileName(qname);
-      }
-    else
-      {
-      this->Reader->SetQFileName(0);
-      }
-    const char* fname =
-      this->Internal->TimeSteps[updateTime].FunctionFile.c_str();
-    if (strlen(fname) > 0)
-      {
-      this->Reader->SetFunctionFileName(fname);
-      }
-    else
-      {
-      this->Reader->SetFunctionFileName(0);
-      }
-    this->Reader->UpdateInformation();
-    this->Reader->SetUpdateExtent(
-      outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_PIECE_NUMBER()),
-      outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_PIECES()),
-      outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_GHOST_LEVELS())
-      );
-    this->Reader->Update();
-    vtkDataObject* ioutput = this->Reader->GetOutput();
-    output->ShallowCopy(ioutput);
-    output->GetInformation()->Set(
-      vtkDataObject::DATA_NUMBER_OF_GHOST_LEVELS(),
-      ioutput->GetInformation()->Get(
-        vtkDataObject::DATA_NUMBER_OF_GHOST_LEVELS()));
-    }
-  else
-    {
-    vtkErrorMacro("Time step " << updateTime << " was not found.");
-    return 0;
-    }
-
-  return 1;
-}
-
-//-----------------------------------------------------------------------------
-void vtkPlot3DMetaReader::PrintSelf(ostream& os, vtkIndent indent)
-{
-  this->Superclass::PrintSelf(os, indent);
-}
diff --git a/IO/Parallel/vtkPlot3DMetaReader.h b/IO/Parallel/vtkPlot3DMetaReader.h
deleted file mode 100644
index cf7e36c..0000000
--- a/IO/Parallel/vtkPlot3DMetaReader.h
+++ /dev/null
@@ -1,138 +0,0 @@
-/*=========================================================================
-
-  Program:   ParaView
-  Module:    $RCSfile: vtkPlot3DMetaReader.h,v $
-
-  Copyright (c) Kitware, Inc.
-  All rights reserved.
-  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html 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.
-
-=========================================================================*/
-// .NAME vtkPlot3DMetaReader - reads meta-files points to PLOT3D files
-// .SECTION Description:
-// The main goal of this reader is to make it easy to read PLOT3D files,
-// specifically time series of PLOT3D files. PLOT3D files can take many
-// different forms based on their content. Unfortunately, it is not a
-// self-describing format therefore the user needs to pass information
-// about the contents of the file to the reader. Normally, this is done
-// by setting a number of member variables. The goal of this reader is
-// to provide a simple format that enable the writer of the PLOT3D file
-// to describe its settings as well as group a number of files as a time
-// series. Note that for binary files, the auto-detect-format option,
-// which is on by default negates the need to specify most other option.
-// However, this reader is still very useful when trying to read file
-// series even for binary files. The format for this meta-file is very simple
-// and is based on JSON (there is no need to know anything about JSON to
-// understand this format). Below is an example with comments (followed by //)
-// that describe the format. Note that the PLOT3D file names are relative
-// to the location of the meta-file unless they start with a leading /.
-//
-// \verbatim
-// {
-// "auto-detect-format" : true // Tells the reader to try to figure out the format automatically. Only works
-//                             // with binary file. This is on by default, negating the need for most other
-//                             // options for binary files (format, byte-order, precision, multi-grid,
-//                             // blanking, 2D).
-// "format" : "binary",  // Is this a binary or ascii file, values : binary, ascii
-// "byte-order" : "big", // Byte order for binary files, values : little, big (denoting little or big endian)
-// "precision" : 32,     // Precision of floating point values, can be 32 or 64 (bits)
-// "multi-grid" : false, // Is this a multi-grid file, values: true, false
-// "language" : "C",     // Which language was this file written in, values : C, fortran. This is
-//                       // used to determine if an binary PLOT3D file contains byte counts, used by
-//                       // Fortran IO routines.
-// "blanking" : false,   // Does this file have blanking information (iblanks), values : true, false
-// "2D" : false,         // Is this a 2D dataset, values : true, false
-// "R" : 8.314,          // The value of the gas constant, default is 1.0. Set this according to the dimensions you use
-// "gamma" : 1.4,        // Ratio of specific heats. Default is 1.4.
-// "functions": [ 110, 200, 201 ],  // Additional derived values to calculate. This is an array of integers formatted
-//                                  // as [ value, value, value, ...]
-// "filenames" : [     // List of xyz (geometry) and q (value) file names along with the time values.
-//                     // This is an array which contains items in the format:
-//                     // {"time" : values, "xyz" : "xyz file name", "q" : "q file name", "function" : "function file name"}
-//                     // Note that q and function are optional. Also, you can repeat the same file name for xyz or q
-//                     // if they don't change over time. The reader will not read files unnecessarily.
-//  { "time" : 3.5, "xyz" : "combxyz.bin", "q" : "combq.1.bin", "function" : "combf.1.bin" },
-//  { "time" : 4.5, "xyz" : "combxyz.bin", "q" : "combq.2.bin", "function" : "combf.2.bin" }
-// ]
-// }
-// \endverbatim
-//
-// This reader leverages vtkMultiBlockPLOT3DReader to do the actual
-// reading so you may want to refer to the documenation of
-// vtkMultiBlockPLOT3DReader about the details of some of these
-// parameters including the function numbers for derived value
-// calculation.
-//
-// .SECTION See Also
-// vtkMultiBlockPLOT3DReader
-
-#ifndef vtkPlot3DMetaReader_h
-#define vtkPlot3DMetaReader_h
-
-#include "vtkIOParallelModule.h" // For export macro
-#include "vtkMultiBlockDataSetAlgorithm.h"
-
-//BTX
-struct vtkPlot3DMetaReaderInternals;
-//ETX
-
-class vtkMultiBlockPLOT3DReader;
-
-namespace Json
-{
-  class Value;
-}
-
-class VTKIOPARALLEL_EXPORT vtkPlot3DMetaReader : public vtkMultiBlockDataSetAlgorithm
-{
-public:
-  static vtkPlot3DMetaReader* New();
-  vtkTypeMacro(vtkPlot3DMetaReader, vtkMultiBlockDataSetAlgorithm);
-  void PrintSelf(ostream& os, vtkIndent indent);
-
-  // Description:
-  // Set/Get the meta PLOT3D filename. See the class documentation for
-  // format details.
-  vtkSetStringMacro(FileName);
-  vtkGetStringMacro(FileName);
-
-protected:
-  vtkPlot3DMetaReader();
-  ~vtkPlot3DMetaReader();
-
-  virtual int RequestInformation(vtkInformation* request,
-                                 vtkInformationVector** inputVector,
-                                 vtkInformationVector* outputVector);
-  virtual int RequestData(vtkInformation*,
-                          vtkInformationVector**,
-                          vtkInformationVector*);
-
-
-  char* FileName;
-
-  void SetAutoDetectFormat(Json::Value* value);
-  void SetByteOrder(Json::Value* value);
-  void SetPrecision(Json::Value* val);
-  void SetMultiGrid(Json::Value* val);
-  void SetFormat(Json::Value* val);
-  void SetBlanking(Json::Value* val);
-  void Set2D(Json::Value* val);
-  void SetR(Json::Value* val);
-  void SetGamma(Json::Value* val);
-  void SetFileNames(Json::Value* val);
-  void SetLanguage(Json::Value* val);
-  void AddFunctions(Json::Value* val);
-
-private:
-  vtkPlot3DMetaReader(const vtkPlot3DMetaReader&); // Not implemented.
-  void operator=(const vtkPlot3DMetaReader&); // Not implemented.
-
-  vtkMultiBlockPLOT3DReader* Reader;
-  vtkPlot3DMetaReaderInternals* Internal;
-};
-
-#endif
diff --git a/IO/ParallelExodus/vtkPExodusIIReader.cxx b/IO/ParallelExodus/vtkPExodusIIReader.cxx
index f602622..76a5b83 100644
--- a/IO/ParallelExodus/vtkPExodusIIReader.cxx
+++ b/IO/ParallelExodus/vtkPExodusIIReader.cxx
@@ -176,7 +176,10 @@ vtkPExodusIIReader::~vtkPExodusIIReader()
     {
     for (int i=0; i<this->NumberOfFileNames; i++)
       {
-      delete [] this->FileNames[i];
+      if ( this->FileNames[i] )
+        {
+        delete [] this->FileNames[i];
+        }
       }
       delete [] this->FileNames;
     }
@@ -746,7 +749,10 @@ void vtkPExodusIIReader::SetFileNames( int nfiles, const char** names )
     {
     for ( int i = 0; i < this->NumberOfFileNames; ++ i )
       {
-      delete [] this->FileNames[i];
+      if ( this->FileNames[i] )
+        {
+        delete [] this->FileNames[i];
+        }
       }
     delete [] this->FileNames;
     this->FileNames = NULL;
@@ -997,6 +1003,37 @@ vtkIdType vtkPExodusIIReader::GetTotalNumberOfNodes()
   return total;
 }
 
+void vtkPExodusIIReader::UpdateTimeInformation()
+{
+  // Before we start, make sure that we have readers to read (i.e. that
+  // RequestData() has been called.
+  if ( this->ReaderList.size() == 0 )
+    {
+    return;
+    }
+
+  int lastTimeStep = VTK_INT_MAX;
+  int numTimeSteps = 0;
+  for ( size_t reader_idx = 0; reader_idx < this->ReaderList.size(); ++ reader_idx )
+    {
+    vtkExodusIIReader *reader = this->ReaderList[reader_idx];
+
+    // In order to get an up-to-date number of timesteps, update the reader's
+    // time information first
+    reader->UpdateTimeInformation();
+    numTimeSteps = reader->GetNumberOfTimeSteps();
+
+    // if this reader's last time step is less than the one we have, use it instead
+    lastTimeStep = numTimeSteps-1 < lastTimeStep ? numTimeSteps-1 : lastTimeStep;
+    }
+
+  this->LastCommonTimeStep = lastTimeStep;
+
+  this->Superclass::UpdateTimeInformation();
+  this->Modified();
+  this->UpdateInformation();
+}
+
 static void BroadcastXmitString( vtkMultiProcessController* ctrl, char* str )
 {
   int len;
diff --git a/IO/ParallelExodus/vtkPExodusIIReader.h b/IO/ParallelExodus/vtkPExodusIIReader.h
index fb522e3..3f448ca 100644
--- a/IO/ParallelExodus/vtkPExodusIIReader.h
+++ b/IO/ParallelExodus/vtkPExodusIIReader.h
@@ -104,6 +104,15 @@ public:
   virtual vtkIdType GetTotalNumberOfNodes();
 
   // Description:
+  // Calls UpdateTimeInformation() on all serial readers so they'll re-read
+  // their time info from the file.
+  // The last time step that they all have in common
+  // is stored in LastCommonTimeStep, which is used in RequestInformation()
+  // to override the output time-specific information keys with the range
+  // of times that ALL readers can actually read.
+  virtual void UpdateTimeInformation();
+
+  // Description:
   // Sends metadata (that read from the input file, not settings modified
   // through this API) from the rank 0 node to all other processes in a job.
   virtual void Broadcast( vtkMultiProcessController* ctrl );
diff --git a/IO/ParallelNetCDF/vtkPNetCDFPOPReader.cxx b/IO/ParallelNetCDF/vtkPNetCDFPOPReader.cxx
index 262bb2f..1f4666c 100644
--- a/IO/ParallelNetCDF/vtkPNetCDFPOPReader.cxx
+++ b/IO/ParallelNetCDF/vtkPNetCDFPOPReader.cxx
@@ -128,8 +128,11 @@ vtkPNetCDFPOPReader::~vtkPNetCDFPOPReader()
     this->SelectionObserver->Delete();
     this->SelectionObserver = NULL;
     }
-  delete this->Internals;
-  this->Internals = NULL;
+  if(this->Internals)
+    {
+    delete this->Internals;
+    this->Internals = NULL;
+    }
 }
 
 //----------------------------------------------------------------------------
diff --git a/IO/ParallelXML/vtkXMLPMultiBlockDataWriter.cxx b/IO/ParallelXML/vtkXMLPMultiBlockDataWriter.cxx
index 0448013..1221601 100644
--- a/IO/ParallelXML/vtkXMLPMultiBlockDataWriter.cxx
+++ b/IO/ParallelXML/vtkXMLPMultiBlockDataWriter.cxx
@@ -16,11 +16,9 @@
 
 #include "vtkDataObjectTreeIterator.h"
 #include "vtkCompositeDataSet.h"
-#include "vtkInformationVector.h"
 #include "vtkMultiProcessController.h"
 #include "vtkObjectFactory.h"
 #include "vtkSmartPointer.h"
-#include "vtkStreamingDemandDrivenPipeline.h"
 #include "vtkXMLDataElement.h"
 #include "vtkInformation.h"
 
@@ -39,20 +37,30 @@ class vtkXMLPMultiBlockDataWriter::vtkInternal
 public:
   vtkInternal()
     {
+      this->PieceProcessList = 0;
     }
   ~vtkInternal()
     {
+      if(this->PieceProcessList)
+        {
+        delete []this->PieceProcessList;
+        this->PieceProcessList = 0;
+        }
     }
   void Allocate(int numPieces, int numProcs)
     {
       this->NumberOfPieces = numPieces;
       this->NumberOfProcesses = numProcs;
-      this->PieceProcessList.resize(numPieces*numProcs);
+      if(this->PieceProcessList)
+        {
+        delete []this->PieceProcessList;
+        }
+      this->PieceProcessList = new int[numPieces*numProcs];
     }
 
   void GetPieceProcessList(int piece, int* processList)
     {
-      if(this->PieceProcessList.empty() || piece >= this->NumberOfPieces ||
+      if(!this->PieceProcessList || piece >= this->NumberOfPieces ||
          piece < 0)
         {
         return;
@@ -67,10 +75,7 @@ public:
   // For each piece it keeps the processes that have that piece.
   // This is built and used only on the root node.
   // PieceProcessList[piece+NumPieces*process] = dataset type (-1 for NULL)
-  // This NumberOfPieces is based on the number of blocks in the multiblock
-  // which is different than the vtkXMLPMultiBlockDataWriter::NumberOfPieces
-  // which is usually the number of parallel processes.
-  std::vector<int> PieceProcessList;
+  int* PieceProcessList;
   int NumberOfPieces;
   int NumberOfProcesses;
 };
@@ -78,8 +83,6 @@ public:
 //----------------------------------------------------------------------------
 vtkXMLPMultiBlockDataWriter::vtkXMLPMultiBlockDataWriter()
 {
-  this->StartPiece = 0;
-  this->NumberOfPieces = 1;
   this->Internal = new vtkInternal();
   this->Controller = 0;
   this->SetController(vtkMultiProcessController::GetGlobalController());
@@ -124,30 +127,6 @@ void vtkXMLPMultiBlockDataWriter::PrintSelf(ostream& os, vtkIndent indent)
     {
     os << "(none)" << endl;
     }
-  os << indent << "NumberOfPieces: " << this->NumberOfPieces << "\n";
-  os << indent << "StartPiece: " << this->StartPiece << "\n";
-}
-
-//----------------------------------------------------------------------------
-int vtkXMLPMultiBlockDataWriter::ProcessRequest(
-  vtkInformation* request,
-  vtkInformationVector** inputVector,
-  vtkInformationVector* outputVector)
-{
-  if (request->Has(vtkStreamingDemandDrivenPipeline::REQUEST_UPDATE_EXTENT()))
-    {
-    vtkInformation* inInfo = inputVector[0]->GetInformationObject(0);
-    inInfo->Set(
-      vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_PIECES(),
-      this->NumberOfPieces);
-    inInfo->Set(
-      vtkStreamingDemandDrivenPipeline::UPDATE_PIECE_NUMBER(), this->StartPiece);
-    inInfo->Set(
-      vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_GHOST_LEVELS(),
-      this->GhostLevel);
-    return 1;
-    }
-  return this->Superclass::ProcessRequest(request, inputVector, outputVector);
 }
 
 //----------------------------------------------------------------------------
@@ -172,11 +151,8 @@ void vtkXMLPMultiBlockDataWriter::FillDataTypes(vtkCompositeDataSet* hdInput)
   this->Internal->Allocate(numBlocks, this->Controller->GetNumberOfProcesses());
 
   // gather on to root node.
-  if(numBlocks)
-    {
-    this->Controller->Gather(myDataTypes, &this->Internal->PieceProcessList[0],
-                             numBlocks, 0);
-    }
+  this->Controller->Gather(myDataTypes, this->Internal->PieceProcessList,
+                           numBlocks, 0);
 }
 
 //----------------------------------------------------------------------------
diff --git a/IO/ParallelXML/vtkXMLPMultiBlockDataWriter.h b/IO/ParallelXML/vtkXMLPMultiBlockDataWriter.h
index 1f053ae..50617be 100644
--- a/IO/ParallelXML/vtkXMLPMultiBlockDataWriter.h
+++ b/IO/ParallelXML/vtkXMLPMultiBlockDataWriter.h
@@ -37,16 +37,6 @@ public:
   void PrintSelf(ostream& os, vtkIndent indent);
 
   // Description:
-  // Get/Set the number of pieces that are being written in parallel.
-  vtkSetMacro(NumberOfPieces, int);
-  vtkGetMacro(NumberOfPieces, int);
-
-  // Description:
-  // Get/Set the range of pieces assigned to this writer.
-  vtkSetMacro(StartPiece, int);
-  vtkGetMacro(StartPiece, int);
-
-  // Description:
   // Controller used to communicate data type of blocks.
   // By default, the global controller is used. If you want another
   // controller to be used, set it with this.
@@ -61,11 +51,6 @@ public:
   // WriteMetaFile set to 0 by default.
   virtual void SetWriteMetaFile(int flag);
 
-  // See the vtkAlgorithm for a desciption of what these do
-  int ProcessRequest(vtkInformation*,
-                     vtkInformationVector**,
-                     vtkInformationVector*);
-
 //BTX
 protected:
   vtkXMLPMultiBlockDataWriter();
@@ -119,11 +104,6 @@ protected:
   // in case writer failed.
   virtual void RemoveWrittenFiles(const char* subDirectory);
 
-  // Description:
-  // Piece information.
-  int StartPiece;
-  int NumberOfPieces;
-
 private:
   vtkXMLPMultiBlockDataWriter(const vtkXMLPMultiBlockDataWriter&); // Not implemented.
   void operator=(const vtkXMLPMultiBlockDataWriter&); // Not implemented.
diff --git a/IO/PostgreSQL/vtkPostgreSQLDatabase.cxx b/IO/PostgreSQL/vtkPostgreSQLDatabase.cxx
index d188431..be473bd 100644
--- a/IO/PostgreSQL/vtkPostgreSQLDatabase.cxx
+++ b/IO/PostgreSQL/vtkPostgreSQLDatabase.cxx
@@ -266,7 +266,10 @@ bool vtkPostgreSQLDatabase::Open( const char* password )
     }
   if ( password && this->Password != password )
     {
-    delete [] this->Password;
+    if ( this->Password )
+      {
+      delete [] this->Password;
+      }
     this->Password = password ? vtksys::SystemTools::DuplicateString( password ) : 0;
     }
   if ( this->Password && strlen( this->Password ) > 0 )
diff --git a/IO/PostgreSQL/vtkPostgreSQLQuery.cxx b/IO/PostgreSQL/vtkPostgreSQLQuery.cxx
index b6cb69c..e429dc4 100644
--- a/IO/PostgreSQL/vtkPostgreSQLQuery.cxx
+++ b/IO/PostgreSQL/vtkPostgreSQLQuery.cxx
@@ -606,8 +606,11 @@ void
 vtkPostgreSQLQuery::DeleteQueryResults()
 {
   this->Active = false;
-  delete this->QueryInternals;
-  this->QueryInternals = NULL;
+  if (this->QueryInternals)
+    {
+    delete this->QueryInternals;
+    this->QueryInternals = NULL;
+    }
 }
 
 // ----------------------------------------------------------------------
diff --git a/IO/SQL/Testing/Data/Input/simple_table.vtk.md5 b/IO/SQL/Testing/Data/Input/simple_table.vtk.md5
index cc16adf..ee95258 100644
--- a/IO/SQL/Testing/Data/Input/simple_table.vtk.md5
+++ b/IO/SQL/Testing/Data/Input/simple_table.vtk.md5
@@ -1 +1 @@
-c6f73e45eef0f842650975e7e025396a
+7fea0586c39ab4442ac43970cc78fedc
diff --git a/IO/SQL/vtkSQLGraphReader.h b/IO/SQL/vtkSQLGraphReader.h
index 4a82e3a..a422fb3 100644
--- a/IO/SQL/vtkSQLGraphReader.h
+++ b/IO/SQL/vtkSQLGraphReader.h
@@ -114,7 +114,7 @@ public:
   // Description:
   // When set, creates a graph with no parallel arcs.
   // Parallel arcs are combined into one arc.
-  // No cell fields are passed to the output, except the vtkGhostType array if
+  // No cell fields are passed to the output, except the vtkGhostLevels array if
   // it exists, but a new field "weight" is created that holds the number of
   // duplicates of that arc in the input.
   vtkSetMacro(CollapseEdges, bool);
diff --git a/IO/SQL/vtkSQLQuery.cxx b/IO/SQL/vtkSQLQuery.cxx
index aad591e..72d7ae4 100644
--- a/IO/SQL/vtkSQLQuery.cxx
+++ b/IO/SQL/vtkSQLQuery.cxx
@@ -249,7 +249,10 @@ bool vtkSQLQuery::SetQuery(const char *queryString)
     {
     return true; // query string isn't changing
     }
-  delete [] this->Query;
+  if (this->Query)
+    {
+    delete [] this->Query;
+    }
   if (queryString)
     {
     size_t n = strlen(queryString) + 1;
diff --git a/IO/SQL/vtkSQLiteQuery.cxx b/IO/SQL/vtkSQLiteQuery.cxx
index 4b22c4a..614f47b 100644
--- a/IO/SQL/vtkSQLiteQuery.cxx
+++ b/IO/SQL/vtkSQLiteQuery.cxx
@@ -106,7 +106,10 @@ bool vtkSQLiteQuery::SetQuery(const char *newQuery)
     return true; // we've already got that query
     }
 
-  delete [] this->Query;
+  if (this->Query)
+    {
+    delete [] this->Query;
+    }
 
   if (newQuery)
     {
diff --git a/IO/SQL/vtkTableToSQLiteWriter.cxx b/IO/SQL/vtkTableToSQLiteWriter.cxx
index a76f5e9..eeb30e7 100644
--- a/IO/SQL/vtkTableToSQLiteWriter.cxx
+++ b/IO/SQL/vtkTableToSQLiteWriter.cxx
@@ -68,8 +68,8 @@ void vtkTableToSQLiteWriter::WriteData()
   insertPreamble += "(";
 
   //get the columns from the vtkTable to finish the query
-  vtkIdType numColumns = this->GetInput()->GetNumberOfColumns();
-  for(vtkIdType i = 0; i < numColumns; i++)
+  int numColumns = this->GetInput()->GetNumberOfColumns();
+  for(int i = 0; i < numColumns; i++)
     {
     //get this column's name
     std::string columnName = this->GetInput()->GetColumn(i)->GetName();
@@ -118,11 +118,11 @@ void vtkTableToSQLiteWriter::WriteData()
     }
 
   //iterate over the rows of the vtkTable to complete the insert query
-  vtkIdType numRows = this->GetInput()->GetNumberOfRows();
-  for(vtkIdType i = 0; i < numRows; i++)
+  int numRows = this->GetInput()->GetNumberOfRows();
+  for(int i = 0; i < numRows; i++)
     {
     std::string insertQuery = insertPreamble;
-    for (vtkIdType j = 0; j < numColumns; j++)
+    for (int j = 0; j < numColumns; j++)
       {
       insertQuery += "'" + this->GetInput()->GetValue(i, j).ToString() + "'";
       if(j < numColumns - 1)
diff --git a/IO/VPIC/vtkVPICReader.cxx b/IO/VPIC/vtkVPICReader.cxx
index e0b8102..c1bccf1 100644
--- a/IO/VPIC/vtkVPICReader.cxx
+++ b/IO/VPIC/vtkVPICReader.cxx
@@ -94,12 +94,6 @@ vtkVPICReader::vtkVPICReader()
     }
 
   this->UsedRank = 0;
-
-  this->XExtent[0] = this->XExtent[1] = 0;
-  this->YExtent[0] = this->YExtent[1] = 0;
-  this->ZExtent[0] = this->ZExtent[1] = 0;
-
-  this->Stride[0] = this->Stride[1] = this->Stride[2] = 1;
 }
 
 //----------------------------------------------------------------------------
@@ -107,7 +101,10 @@ vtkVPICReader::vtkVPICReader()
 //----------------------------------------------------------------------------
 vtkVPICReader::~vtkVPICReader()
 {
-  delete [] this->FileName;
+  if (this->FileName)
+    {
+    delete [] this->FileName;
+    }
   this->PointDataArraySelection->Delete();
 
   delete this->vpicData;
diff --git a/IO/Video/vtkMILVideoSource.cxx b/IO/Video/vtkMILVideoSource.cxx
index 52e689f..4ae9deb 100644
--- a/IO/Video/vtkMILVideoSource.cxx
+++ b/IO/Video/vtkMILVideoSource.cxx
@@ -80,8 +80,11 @@ vtkMILVideoSource::~vtkMILVideoSource()
 {
   this->vtkMILVideoSource::ReleaseSystemResources();
 
-  delete [] this->MILDigitizerDCF;
-  this->MILDigitizerDCF = NULL;
+  if (this->MILDigitizerDCF != NULL)
+    {
+    delete [] this->MILDigitizerDCF;
+    this->MILDigitizerDCF = NULL;
+    }
 
   this->SetMILSystemType(0);
 }
diff --git a/IO/Video/vtkVideoSource.cxx b/IO/Video/vtkVideoSource.cxx
index bfb6901..abc3c9a 100644
--- a/IO/Video/vtkVideoSource.cxx
+++ b/IO/Video/vtkVideoSource.cxx
@@ -442,7 +442,7 @@ void vtkVideoSource::InternalGrab()
   while (--i >= 0)
     {
     randNum = 1664525*randNum + 1013904223;
-    *ptr1 = static_cast<unsigned char>(randNum);
+    *ptr1 = randNum;
     ptr1 += 16;
     }
   randsave = randNum;
diff --git a/IO/Video/vtkWin32VideoSource.cxx b/IO/Video/vtkWin32VideoSource.cxx
index 2ebd6ba..c7be404 100644
--- a/IO/Video/vtkWin32VideoSource.cxx
+++ b/IO/Video/vtkWin32VideoSource.cxx
@@ -78,7 +78,10 @@ vtkWin32VideoSource::~vtkWin32VideoSource()
 {
   this->vtkWin32VideoSource::ReleaseSystemResources();
 
-  delete [] (char *)(this->Internal->BitMapPtr);
+  if (this->Internal->BitMapPtr != NULL)
+    {
+    delete [] (char *)(this->Internal->BitMapPtr);
+    }
   this->Internal->BitMapPtr = NULL;
   this->BitMapSize = 0;
   delete this->Internal;
@@ -346,7 +349,7 @@ void vtkWin32VideoSource::Initialize()
     }
 
   // set user data for callbacks
-  if (!capSetUserData(this->Internal->CapWnd,this))
+  if (!capSetUserData(this->Internal->CapWnd,(long)this))
     {
     vtkErrorMacro(<< "Initialize: couldn't set user data for callback"\
                     << " (" << GetLastError() << ")");
@@ -1038,7 +1041,10 @@ void vtkWin32VideoSource::DoVFWFormatCheck()
   int formatSize = capGetVideoFormatSize(this->Internal->CapWnd);
   if (formatSize > this->BitMapSize)
     {
-    delete [] ((char *)this->Internal->BitMapPtr);
+    if (this->Internal->BitMapPtr)
+      {
+      delete [] ((char *)this->Internal->BitMapPtr);
+      }
     this->Internal->BitMapPtr = (LPBITMAPINFO) new char[formatSize];
     this->BitMapSize = formatSize;
     }
@@ -1125,7 +1131,10 @@ void vtkWin32VideoSource::DoVFWFormatSetup()
   int formatSize = capGetVideoFormatSize(this->Internal->CapWnd);
   if (formatSize > this->BitMapSize)
     {
-    delete [] ((char *)this->Internal->BitMapPtr);
+    if (this->Internal->BitMapPtr)
+      {
+      delete [] ((char *)this->Internal->BitMapPtr);
+      }
     this->Internal->BitMapPtr = (LPBITMAPINFO) new char[formatSize];
     this->BitMapSize = formatSize;
     }
@@ -1138,7 +1147,7 @@ void vtkWin32VideoSource::DoVFWFormatSetup()
   this->Internal->BitMapPtr->bmiHeader.biClrUsed = 0;
   this->Internal->BitMapPtr->bmiHeader.biClrImportant = 0;
 
-  for (i = 0; i < 3; i++)
+  for (i = 0; i < 4; i++)
     { // try for a
     if (this->OutputFormat == VTK_RGBA || this->OutputFormat == VTK_RGB)
       {
diff --git a/IO/XML/Testing/Cxx/CMakeLists.txt b/IO/XML/Testing/Cxx/CMakeLists.txt
index c9973dd..db58e02 100644
--- a/IO/XML/Testing/Cxx/CMakeLists.txt
+++ b/IO/XML/Testing/Cxx/CMakeLists.txt
@@ -2,11 +2,9 @@ set(TestXML_ARGS "DATA{${VTK_TEST_INPUT_DIR}/sample.xml}")
 vtk_add_test_cxx(${vtk-module}CxxTests tests
   TestAMRXMLIO.cxx,NO_VALID
   TestHyperOctreeIO.cxx
-  TestXMLGhostCellsImport.cxx
   TestXMLHierarchicalBoxDataFileConverter.cxx,NO_VALID
   TestXMLUnstructuredGridReader.cxx
   TestXML.cxx,NO_DATA,NO_VALID,NO_OUTPUT
-  TestXMLToString.cxx,NO_DATA,NO_VALID,NO_OUTPUT
   TestDataObjectXMLIO.cxx,NO_VALID
   )
 
diff --git a/IO/XML/Testing/Cxx/TestXMLGhostCellsImport.cxx b/IO/XML/Testing/Cxx/TestXMLGhostCellsImport.cxx
deleted file mode 100644
index 30039d1..0000000
--- a/IO/XML/Testing/Cxx/TestXMLGhostCellsImport.cxx
+++ /dev/null
@@ -1,125 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    TestXMLGhostCellsImport.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.
-
-=========================================================================*/
-
-// Test converting from a vtkGhostLevels to vtkGhostType
-// see http://www.kitware.com/blog/home/post/856
-// Ghost and Blanking (Visibility) Changes
-
-#include "vtkActor.h"
-#include "vtkCellData.h"
-#include "vtkCellType.h"
-#include "vtkDataSetSurfaceFilter.h"
-#include "vtkGeometryFilter.h"
-#include "vtkNew.h"
-#include "vtkPoints.h"
-#include "vtkPolyDataMapper.h"
-#include "vtkRegressionTestImage.h"
-#include "vtkRenderer.h"
-#include "vtkRenderWindow.h"
-#include "vtkRenderWindowInteractor.h"
-#include "vtkSmartPointer.h"
-#include "vtkTesting.h"
-#include "vtkUnsignedCharArray.h"
-#include "vtkUnstructuredGrid.h"
-#include "vtkXMLUnstructuredGridReader.h"
-#include "vtkXMLUnstructuredGridWriter.h"
-
-// ghost_cells.vtu was created using this function
-vtkSmartPointer<vtkUnstructuredGrid> CreateThreeTetra()
-{
-  vtkNew<vtkPoints> points;
-  points->InsertPoint(0, 0,    0,   0);
-  points->InsertPoint(1, 1,    0,   0);
-  points->InsertPoint(2, 0.5,  1,   0);
-  points->InsertPoint(3, 0.5,  0.5, 1);
-  points->InsertPoint(4, 0.5, -1,   0);
-  points->InsertPoint(5, 0.5, -0.5, 1);
-
-  vtkIdType v[3][4] = {{0,1,2,3}, {0,4,1,5}, {5,3,1,0}};
-
-  vtkSmartPointer<vtkUnstructuredGrid> grid =
-    vtkSmartPointer<vtkUnstructuredGrid>::New();
-  grid->InsertNextCell(VTK_TETRA, 4, v[0]);
-  grid->InsertNextCell(VTK_TETRA, 4, v[1]);
-  grid->InsertNextCell(VTK_TETRA, 4, v[2]);
-  grid->SetPoints(points.GetPointer());
-
-  vtkNew<vtkUnsignedCharArray> ghosts;
-  ghosts->InsertNextValue(0);
-  ghosts->InsertNextValue(1);
-  ghosts->InsertNextValue(2);
-  ghosts->SetName("vtkGhostLevels");
-  grid->GetCellData()->AddArray(ghosts.GetPointer());
-
-  return grid;
-}
-
-void WriteThreeTetra()
-{
-  vtkSmartPointer<vtkUnstructuredGrid> grid = CreateThreeTetra();
-
-  vtkNew<vtkXMLUnstructuredGridWriter> writer;
-  writer->SetInputData(grid);
-  writer->SetFileName("ghost_cells.vtu");
-  writer->Write();
-}
-
-
-int TestXMLGhostCellsImport(int argc, char *argv[])
-{
-  vtkNew<vtkTesting> testing;
-  testing->AddArguments(argc, argv);
-
-  // this was used to generate ghost_cells.vtu
-  //WriteThreeTetra();
-
-  std::string filename = testing->GetDataRoot();
-  filename += "/Data/ghost_cells.vtu";
-
-  vtkNew<vtkXMLUnstructuredGridReader> reader;
-  reader->SetFileName(filename.c_str());
-
-  // this filter removes the ghost cells
-  vtkNew<vtkGeometryFilter> surfaces;
-  surfaces->SetInputConnection(reader->GetOutputPort());
-
-  vtkNew<vtkPolyDataMapper> mapper;
-  mapper->SetInputConnection(surfaces->GetOutputPort());
-
-  vtkNew<vtkActor> actor;
-  actor->SetMapper(mapper.GetPointer());
-
-  vtkNew<vtkRenderer> renderer;
-  renderer->AddActor(actor.GetPointer());
-
-  vtkNew<vtkRenderWindow> renwin;
-  renwin->AddRenderer(renderer.GetPointer());
-  renwin->SetSize(300, 300);
-
-  vtkNew<vtkRenderWindowInteractor> iren;
-  iren->SetRenderWindow(renwin.GetPointer());
-  iren->Initialize();
-
-  renwin->Render();
-
-  int retVal = vtkRegressionTestImage( renwin.GetPointer() );
-
-  if ( retVal == vtkRegressionTester::DO_INTERACTOR)
-    {
-    iren->Start();
-    }
-
-  return !retVal;
-}
diff --git a/IO/XML/Testing/Cxx/TestXMLToString.cxx b/IO/XML/Testing/Cxx/TestXMLToString.cxx
deleted file mode 100644
index 9a37a95..0000000
--- a/IO/XML/Testing/Cxx/TestXMLToString.cxx
+++ /dev/null
@@ -1,21 +0,0 @@
-#include "vtkNew.h"
-#include "vtkSphereSource.h"
-#include "vtkTestUtilities.h"
-#include "vtkXMLPolyDataWriter.h"
-
-int TestXMLToString(int /*argc*/, char* /*argv*/[])
-{
-  vtkNew<vtkSphereSource> sphere;
-  vtkNew<vtkXMLPolyDataWriter> writer;
-
-  writer->WriteToOutputStringOn();
-
-  writer->SetInputConnection(0, sphere->GetOutputPort(0));
-
-  writer->Update();
-  writer->Write();
-
-  writer->GetOutputString();
-
-  return 0;
-}
diff --git a/IO/XML/Testing/Data/Baseline/TestXMLGhostCellsImport.png.md5 b/IO/XML/Testing/Data/Baseline/TestXMLGhostCellsImport.png.md5
deleted file mode 100644
index 8597cac..0000000
--- a/IO/XML/Testing/Data/Baseline/TestXMLGhostCellsImport.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-aaef81612cb7340592e1474ba029257e
diff --git a/IO/XML/vtkXMLCompositeDataReader.h b/IO/XML/vtkXMLCompositeDataReader.h
index 70193f8..f6e6f9b 100644
--- a/IO/XML/vtkXMLCompositeDataReader.h
+++ b/IO/XML/vtkXMLCompositeDataReader.h
@@ -98,6 +98,17 @@ protected:
   // process should read the dataset.
   int ShouldReadDataSet(unsigned int datasetIndex);
 
+  // Description:
+  // Test if the reader can read a file with the given version number.
+  virtual int CanReadFileVersion(int major, int vtkNotUsed(minor))
+    {
+    if (major > 1)
+      {
+      return 0;
+      }
+    return 1;
+    }
+
 private:
   vtkXMLCompositeDataReader(const vtkXMLCompositeDataReader&);  // Not implemented.
   void operator=(const vtkXMLCompositeDataReader&);  // Not implemented.
diff --git a/IO/XML/vtkXMLDataReader.cxx b/IO/XML/vtkXMLDataReader.cxx
index 638f252..e85d5e3 100644
--- a/IO/XML/vtkXMLDataReader.cxx
+++ b/IO/XML/vtkXMLDataReader.cxx
@@ -20,14 +20,12 @@
 #include "vtkDataArray.h"
 #include "vtkDataArraySelection.h"
 #include "vtkDataSet.h"
-#include "vtkInformation.h"
-#include "vtkInformationVector.h"
 #include "vtkPointData.h"
-#include "vtkStreamingDemandDrivenPipeline.h"
-#include "vtkUnsignedCharArray.h"
 #include "vtkXMLDataElement.h"
 #include "vtkXMLDataParser.h"
-
+#include "vtkInformationVector.h"
+#include "vtkInformation.h"
+#include "vtkStreamingDemandDrivenPipeline.h"
 
 #include <cassert>
 
@@ -272,12 +270,8 @@ void vtkXMLDataReader::SetupOutputData()
     for (int i = 0; i < ePointData->GetNumberOfNestedElements(); i++)
       {
       vtkXMLDataElement* eNested = ePointData->GetNestedElement(i);
-      if (pointData->HasArray(eNested->GetAttribute("Name")))
-        {
-        vtkErrorMacro("Duplicate array names.");
-        this->DataError = 1;
-        }
-      if (this->PointDataArrayIsEnabled(eNested))
+      if (this->PointDataArrayIsEnabled(eNested) &&
+        !pointData->HasArray(eNested->GetAttribute("Name")))
         {
         this->NumberOfPointArrays++;
         vtkAbstractArray* array = this->CreateArray(eNested);
@@ -302,12 +296,8 @@ void vtkXMLDataReader::SetupOutputData()
     for (int i = 0; i < eCellData->GetNumberOfNestedElements(); i++)
       {
       vtkXMLDataElement* eNested = eCellData->GetNestedElement(i);
-      if (cellData->HasArray(eNested->GetAttribute("Name")))
-        {
-        vtkErrorMacro("Duplicate array names.");
-        this->DataError = 1;
-        }
-      if (this->CellDataArrayIsEnabled(eNested))
+      if (this->CellDataArrayIsEnabled(eNested) &&
+        !cellData->HasArray(eNested->GetAttribute("Name")))
         {
         this->NumberOfCellArrays++;
         vtkAbstractArray* array = this->CreateArray(eNested);
@@ -534,8 +524,7 @@ int vtkXMLDataReader::ReadArrayForPoints(vtkXMLDataElement* da,
 {
   vtkIdType components = outArray->GetNumberOfComponents();
   vtkIdType numberOfTuples = this->GetNumberOfPoints();
-  return this->ReadArrayValues(
-    da, 0, outArray,0, numberOfTuples*components, POINT_DATA);
+  return this->ReadArrayValues(da, 0, outArray,0, numberOfTuples*components);
 }
 
 //----------------------------------------------------------------------------
@@ -544,8 +533,7 @@ int vtkXMLDataReader::ReadArrayForCells(vtkXMLDataElement* da,
 {
   vtkIdType components = outArray->GetNumberOfComponents();
   vtkIdType numberOfTuples = this->GetNumberOfCells();
-  return this->ReadArrayValues(
-    da, 0, outArray,0, numberOfTuples*components, CELL_DATA);
+  return this->ReadArrayValues(da, 0, outArray,0, numberOfTuples*components);
 }
 
 //----------------------------------------------------------------------------
@@ -684,42 +672,9 @@ int vtkXMLDataReaderReadArrayValues(
 }
 
 //----------------------------------------------------------------------------
-void vtkXMLDataReader::ConvertGhostLevelsToGhostType(
-  FieldType fieldType, vtkAbstractArray* data, vtkIdType startIndex,
-  vtkIdType numValues)
-{
-  vtkUnsignedCharArray* ucData = vtkUnsignedCharArray::SafeDownCast(data);
-  int numComp = data->GetNumberOfComponents();
-  const char* name = data->GetName();
-  if (this->GetFileMajorVersion() < 2 && ucData &&
-      numComp == 1 && name && !strcmp(name, "vtkGhostLevels"))
-    {
-    // convert ghost levels to ghost type
-    unsigned char* ghosts = ucData->GetPointer(0);
-    // only CELL_DATA or POINT_DATA are possible at this point.
-    unsigned char newValue = vtkDataSetAttributes::DUPLICATEPOINT;
-    if (fieldType == CELL_DATA)
-      {
-      newValue = vtkDataSetAttributes::DUPLICATECELL;
-      }
-    for (int i = startIndex; i < numValues; ++i)
-      {
-      if (ghosts[i] > 0)
-        {
-        ghosts[i] = newValue;
-        }
-      }
-    data->SetName(vtkDataSetAttributes::GhostArrayName());
-    }
-}
-
-
-
-//----------------------------------------------------------------------------
-int vtkXMLDataReader::ReadArrayValues(
-  vtkXMLDataElement* da, vtkIdType arrayIndex,
+int vtkXMLDataReader::ReadArrayValues(vtkXMLDataElement* da, vtkIdType arrayIndex,
   vtkAbstractArray* array, vtkIdType startIndex,
-  vtkIdType numValues, FieldType fieldType)
+  vtkIdType numValues)
 {
   // Skip real read if aborting.
   if (this->AbortExecute)
@@ -742,8 +697,6 @@ int vtkXMLDataReader::ReadArrayValues(
     {
     iter->Delete();
     }
-
-  this->ConvertGhostLevelsToGhostType(fieldType, array, startIndex, numValues);
   // Marking the array modified is essential, since otherwise, when reading
   // multiple time-steps, the array does not realize that its contents may have
   // changed and does not recompute the array ranges.
diff --git a/IO/XML/vtkXMLDataReader.h b/IO/XML/vtkXMLDataReader.h
index c773828..0b14202 100644
--- a/IO/XML/vtkXMLDataReader.h
+++ b/IO/XML/vtkXMLDataReader.h
@@ -30,14 +30,6 @@
 class VTKIOXML_EXPORT vtkXMLDataReader : public vtkXMLReader
 {
 public:
-  enum FieldType
-  {
-    POINT_DATA,
-    CELL_DATA,
-    OTHER
-  };
-
-
   vtkTypeMacro(vtkXMLDataReader,vtkXMLReader);
   void PrintSelf(ostream& os, vtkIndent indent);
 
@@ -89,9 +81,8 @@ protected:
   // This method assumes that the array is of correct size to
   // accommodate all numValues values. arrayIndex is the value index at which the read
   // values will be put in the array.
-  int ReadArrayValues(
-    vtkXMLDataElement* da, vtkIdType arrayIndex, vtkAbstractArray* array,
-    vtkIdType startIndex, vtkIdType numValues, FieldType type = OTHER);
+  int ReadArrayValues(vtkXMLDataElement* da, vtkIdType arrayIndex, vtkAbstractArray* array,
+    vtkIdType startIndex, vtkIdType numValues);
 
 
 
@@ -137,11 +128,6 @@ protected:
 private:
   vtkXMLDataReader(const vtkXMLDataReader&);  // Not implemented.
   void operator=(const vtkXMLDataReader&);  // Not implemented.
-
-  void ConvertGhostLevelsToGhostType(
-    FieldType type, vtkAbstractArray* data, vtkIdType startIndex,
-    vtkIdType numValues);
-
 };
 
 #endif
diff --git a/IO/XML/vtkXMLPDataReader.cxx b/IO/XML/vtkXMLPDataReader.cxx
index fe83ebc..3b7dd87 100644
--- a/IO/XML/vtkXMLPDataReader.cxx
+++ b/IO/XML/vtkXMLPDataReader.cxx
@@ -56,7 +56,10 @@ vtkXMLPDataReader::~vtkXMLPDataReader()
     {
     this->DestroyPieces();
     }
-  delete [] this->PathName;
+  if(this->PathName)
+    {
+    delete [] this->PathName;
+    }
   this->PieceProgressObserver->Delete();
 }
 
@@ -474,8 +477,11 @@ void vtkXMLPDataReader::SplitFileName()
 #endif
 
   // Extract the path name up to the last '/'.
-  delete [] this->PathName;
-  this->PathName = 0;
+  if(this->PathName)
+    {
+    delete [] this->PathName;
+    this->PathName = 0;
+    }
   char* rbegin = end-1;
   char* rend = begin-1;
   for(s=rbegin;s != rend;--s)
diff --git a/IO/XML/vtkXMLPolyDataReader.cxx b/IO/XML/vtkXMLPolyDataReader.cxx
index bc9d66b..11204c0 100644
--- a/IO/XML/vtkXMLPolyDataReader.cxx
+++ b/IO/XML/vtkXMLPolyDataReader.cxx
@@ -451,9 +451,8 @@ int vtkXMLPolyDataReader::ReadArrayForCells(vtkXMLDataElement* da,
   vtkIdType inStartCell = 0;
   vtkIdType outStartCell = this->StartVert;
   vtkIdType numCells = this->NumberOfVerts[this->Piece];
-  if (!this->ReadArrayValues(
-        da, outStartCell * components, outArray,
-        inStartCell * components, numCells * components, CELL_DATA))
+  if (!this->ReadArrayValues(da, outStartCell * components, outArray,
+      inStartCell * components, numCells * components))
     {
     return 0;
     }
@@ -465,9 +464,8 @@ int vtkXMLPolyDataReader::ReadArrayForCells(vtkXMLDataElement* da,
   inStartCell += numCells;
   outStartCell = this->TotalNumberOfVerts + this->StartLine;
   numCells = this->NumberOfLines[this->Piece];
-  if (!this->ReadArrayValues(
-        da, outStartCell * components, outArray,
-        inStartCell * components, numCells * components, CELL_DATA))
+  if (!this->ReadArrayValues(da, outStartCell * components, outArray,
+      inStartCell * components, numCells * components))
     {
     return 0;
     }
@@ -482,7 +480,7 @@ int vtkXMLPolyDataReader::ReadArrayForCells(vtkXMLDataElement* da,
 
   numCells = this->NumberOfStrips[this->Piece];
   if (!this->ReadArrayValues(da, outStartCell * components, outArray,
-      inStartCell * components, numCells * components, CELL_DATA))
+      inStartCell * components, numCells * components))
     {
     return 0;
     }
@@ -498,7 +496,7 @@ int vtkXMLPolyDataReader::ReadArrayForCells(vtkXMLDataElement* da,
 
   numCells = this->NumberOfPolys[this->Piece];
   if (!this->ReadArrayValues(da, outStartCell * components, outArray,
-      inStartCell * components, numCells * components, CELL_DATA))
+      inStartCell * components, numCells * components))
     {
     return 0;
     }
diff --git a/IO/XML/vtkXMLReader.cxx b/IO/XML/vtkXMLReader.cxx
index 969a294..b4ee2fb 100644
--- a/IO/XML/vtkXMLReader.cxx
+++ b/IO/XML/vtkXMLReader.cxx
@@ -24,7 +24,6 @@
 #include "vtkXMLDataElement.h"
 #include "vtkXMLDataParser.h"
 #include "vtkXMLFileReadTester.h"
-#include "vtkXMLReaderVersion.h"
 #include "vtkZLibDataCompressor.h"
 #include "vtkInformation.h"
 #include "vtkInformationVector.h"
@@ -189,7 +188,7 @@ vtkDataSet* vtkXMLReader::GetOutputAsDataSet(int index)
 // functionality that can be safely ignored by older readers.
 int vtkXMLReader::CanReadFileVersion(int major, int vtkNotUsed(minor))
 {
-  return (major > vtkXMLReaderMajorVersion) ? 0 : 1;
+  return (major > 1) ? 0 : 1;
 }
 
 //----------------------------------------------------------------------------
@@ -244,8 +243,11 @@ int vtkXMLReader::OpenVTKFile()
   if (!this->FileStream || !(*this->FileStream))
     {
     vtkErrorMacro("Error opening file " << this->FileName);
-    delete this->FileStream;
-    this->FileStream = 0;
+    if (this->FileStream)
+      {
+      delete this->FileStream;
+      this->FileStream = 0;
+      }
     return 0;
     }
 
@@ -281,8 +283,11 @@ int vtkXMLReader::OpenVTKString()
   if(!this->StringStream || !(*this->StringStream))
     {
     vtkErrorMacro("Error opening string stream");
-    delete this->StringStream;
-    this->StringStream = 0;
+    if(this->StringStream)
+      {
+      delete this->StringStream;
+      this->StringStream = 0;
+      }
     return 0;
     }
 
@@ -631,9 +636,9 @@ int vtkXMLReader::ReadVTKFile(vtkXMLDataElement* eVTKFile)
   const char* version = eVTKFile->GetAttribute("version");
   if (version && !this->CanReadFileVersionString(version))
     {
-    vtkWarningMacro("File version: " << version << " is higher than "
-                    "this reader supports " << vtkXMLReaderMajorVersion << "."
-                    << vtkXMLReaderMinorVersion);
+    vtkErrorMacro("File version: " << version << " is is higher than "
+                  "this reader supports. Cannot read file.");
+    return 0;
     }
 
   ::ReadStringVersion(version, this->FileMajorVersion, this->FileMinorVersion);
@@ -839,7 +844,18 @@ int vtkXMLReader::CanReadFile(const char* name)
     {
     if (this->CanReadFileWithDataType(tester->GetFileDataType()))
       {
-      result = 1;
+      const char* version = tester->GetFileVersion();
+      if (version)
+        {
+        if (this->CanReadFileVersionString(version))
+          {
+          result = 3;
+          }
+        }
+      else
+        {
+        result = 3;
+        }
       }
     }
 
diff --git a/IO/XML/vtkXMLReader.h b/IO/XML/vtkXMLReader.h
index 7c3af89..f853980 100644
--- a/IO/XML/vtkXMLReader.h
+++ b/IO/XML/vtkXMLReader.h
@@ -55,11 +55,8 @@ public:
   void SetInputString(std::string s) { this->InputString = s; }
 
   // Description:
-  // Test whether the file (type) with the given name can be read by this
-  // reader. If the file has a newer version than the reader, we still say
-  // we can read the file type and we fail later, when we try to read the file.
-  // This enables clients (ParaView) to distinguish between failures when we
-  // need to look for another reader and failures when we don't.
+  // Test whether the file with the given name can be read by this
+  // reader.
   virtual int CanReadFile(const char* name);
 
   // Description:
diff --git a/IO/XML/vtkXMLReaderVersion.h b/IO/XML/vtkXMLReaderVersion.h
deleted file mode 100644
index 72e0900..0000000
--- a/IO/XML/vtkXMLReaderVersion.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkXMLReaderVersion.h
-
-  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.
-
-=========================================================================*/
-// .NAME vtkXMLReaderVersion - version number for legacy readers/writers
-
-#ifndef vtkXMLReaderVersion_h
-#define vtkXMLReaderVersion_h
-
-const int vtkXMLReaderMajorVersion = 2;
-const int vtkXMLReaderMinorVersion = 0;
-
-#endif // vtkXMLReaderVersion_h
-// VTK-HeaderTest-Exclude: vtkXMLReaderVersion.h
diff --git a/IO/XML/vtkXMLStructuredDataReader.cxx b/IO/XML/vtkXMLStructuredDataReader.cxx
index 01a1645..6248256 100644
--- a/IO/XML/vtkXMLStructuredDataReader.cxx
+++ b/IO/XML/vtkXMLStructuredDataReader.cxx
@@ -348,10 +348,10 @@ int vtkXMLStructuredDataReader::ReadArrayForPoints(vtkXMLDataElement* da,
   int* piecePointDimensions = this->PiecePointDimensions + this->Piece*3;
   vtkIdType* piecePointIncrements = this->PiecePointIncrements + this->Piece*3;
   if (!this->ReadSubExtent(pieceExtent, piecePointDimensions,
-                           piecePointIncrements, this->UpdateExtent,
-                           this->PointDimensions, this->PointIncrements,
-                           this->SubExtent, this->SubPointDimensions,
-                           da, outArray, POINT_DATA))
+                          piecePointIncrements, this->UpdateExtent,
+                          this->PointDimensions, this->PointIncrements,
+                          this->SubExtent, this->SubPointDimensions,
+                          da, outArray))
     {
     vtkErrorMacro("Error reading extent "
       << this->SubExtent[0] << " " << this->SubExtent[1] << " "
@@ -371,10 +371,10 @@ int vtkXMLStructuredDataReader::ReadArrayForCells(vtkXMLDataElement* da,
   int* pieceCellDimensions = this->PieceCellDimensions + this->Piece*3;
   vtkIdType* pieceCellIncrements = this->PieceCellIncrements + this->Piece*3;
   if (!this->ReadSubExtent(pieceExtent, pieceCellDimensions,
-                           pieceCellIncrements, this->UpdateExtent,
-                           this->CellDimensions, this->CellIncrements,
-                           this->SubExtent, this->SubCellDimensions,
-                           da, outArray, CELL_DATA))
+                          pieceCellIncrements, this->UpdateExtent,
+                          this->CellDimensions, this->CellIncrements,
+                          this->SubExtent, this->SubCellDimensions,
+                          da, outArray))
     {
     vtkErrorMacro("Error reading extent "
       << this->SubExtent[0] << " " << this->SubExtent[1] << " "
@@ -418,7 +418,7 @@ int vtkXMLStructuredDataReader::ReadSubExtent(
   int* inExtent, int* inDimensions, vtkIdType* inIncrements,
   int* outExtent, int* outDimensions, vtkIdType* outIncrements,
   int* subExtent, int* subDimensions, vtkXMLDataElement* da,
-  vtkAbstractArray* array, FieldType fieldType)
+  vtkAbstractArray* array)
 {
   int components = array->GetNumberOfComponents();
 
@@ -446,9 +446,8 @@ int vtkXMLStructuredDataReader::ReadSubExtent(
         this->GetStartTuple(outExtent, outIncrements,
                             subExtent[0], subExtent[2], subExtent[4]);
 
-      if (!this->ReadArrayValues(
-            da, destTuple*components, array,
-            sourceTuple*components, volumeTuples*components, fieldType))
+      if (!this->ReadArrayValues(da, destTuple*components, array,
+          sourceTuple*components, volumeTuples*components))
         {
         return 0;
         }
@@ -477,9 +476,8 @@ int vtkXMLStructuredDataReader::ReadSubExtent(
         this->SetProgressRange(progressRange, k, subDimensions[2]);
 
         // Read the slice.
-        if (!this->ReadArrayValues(
-              da, destTuple*components, array,
-              sourceTuple*components, sliceTuples*components, fieldType))
+        if (!this->ReadArrayValues(da, destTuple*components, array,
+            sourceTuple*components, sliceTuples*components))
           {
           return 0;
           }
@@ -511,10 +509,9 @@ int vtkXMLStructuredDataReader::ReadSubExtent(
                                  subDimensions[2]*subDimensions[1]);
 
           // Read the row.
-          if (!this->ReadArrayValues(
-                da, destTuple*components,
-                array, sourceTuple*components,
-                rowTuples*components, fieldType))
+          if (!this->ReadArrayValues(da, destTuple*components,
+              array, sourceTuple*components,
+              rowTuples*components))
             {
             return 0;
             }
@@ -556,9 +553,8 @@ int vtkXMLStructuredDataReader::ReadSubExtent(
         this->SetProgressRange(progressRange, k, subDimensions[2]);
 
         // Read the slice.
-        if (!this->ReadArrayValues(
-              da, 0, temp, inTuple*components,
-              partialSliceTuples*components, fieldType))
+        if (!this->ReadArrayValues(da, 0, temp, inTuple*components,
+            partialSliceTuples*components))
           {
           temp->Delete();
           return 0;
diff --git a/IO/XML/vtkXMLStructuredDataReader.h b/IO/XML/vtkXMLStructuredDataReader.h
index 6c84834..b023055 100644
--- a/IO/XML/vtkXMLStructuredDataReader.h
+++ b/IO/XML/vtkXMLStructuredDataReader.h
@@ -104,10 +104,10 @@ protected:
   // Internal utility methods.
   int ReadPiece(vtkXMLDataElement* ePiece);
   virtual int ReadSubExtent(
-    int* inExtent, int* inDimensions, vtkIdType* inIncrements,
-    int* outExtent,int* outDimensions,vtkIdType* outIncrements,
-    int* subExtent, int* subDimensions, vtkXMLDataElement* da,
-    vtkAbstractArray* array, FieldType type);
+      int* inExtent, int* inDimensions, vtkIdType* inIncrements,
+      int* outExtent,int* outDimensions,vtkIdType* outIncrements,
+      int* subExtent, int* subDimensions, vtkXMLDataElement* da,
+      vtkAbstractArray* array);
 
 private:
   vtkXMLStructuredDataReader(const vtkXMLStructuredDataReader&);  // Not implemented.
diff --git a/IO/XML/vtkXMLStructuredDataWriter.cxx b/IO/XML/vtkXMLStructuredDataWriter.cxx
index db1602c..33b8c29 100644
--- a/IO/XML/vtkXMLStructuredDataWriter.cxx
+++ b/IO/XML/vtkXMLStructuredDataWriter.cxx
@@ -141,13 +141,6 @@ int vtkXMLStructuredDataWriter::ProcessRequest(
         {
         return 0;
         }
-      if (this->GetInputAsDataSet() != NULL &&
-          (this->GetInputAsDataSet()->GetPointGhostArray() != NULL ||
-           this->GetInputAsDataSet()->GetCellGhostArray() != NULL))
-        {
-        // use the current version for the file
-        this->UsePreviousVersion = false;
-        }
       // Write the file.
       if (!this->StartFile())
         {
diff --git a/IO/XML/vtkXMLUniformGridAMRReader.cxx b/IO/XML/vtkXMLUniformGridAMRReader.cxx
index 406b5c4..35cf691 100644
--- a/IO/XML/vtkXMLUniformGridAMRReader.cxx
+++ b/IO/XML/vtkXMLUniformGridAMRReader.cxx
@@ -218,7 +218,8 @@ int vtkXMLUniformGridAMRReader::ReadPrimaryElement(vtkXMLDataElement* ePrimary)
     return 0;
     }
 
-  if (this->GetFileMajorVersion() == -1 && this->GetFileMinorVersion() == -1)
+  if (this->GetFileMajorVersion() != 1 ||
+    this->GetFileMinorVersion() != 1)
     {
     // for old files, we don't support providing meta-data for
     // RequestInformation() pass.
@@ -361,7 +362,8 @@ void vtkXMLUniformGridAMRReader::ReadComposite(vtkXMLDataElement* element,
     return;
     }
 
-  if (this->GetFileMajorVersion() == -1 && this->GetFileMinorVersion() == -1)
+  if (this->GetFileMajorVersion() != 1 ||
+    this->GetFileMinorVersion() != 1)
     {
     vtkErrorMacro(
       "Version not supported. Use vtkXMLHierarchicalBoxDataReader instead.");
diff --git a/IO/XML/vtkXMLUniformGridAMRReader.h b/IO/XML/vtkXMLUniformGridAMRReader.h
index eb9ae56..dd0f856 100644
--- a/IO/XML/vtkXMLUniformGridAMRReader.h
+++ b/IO/XML/vtkXMLUniformGridAMRReader.h
@@ -58,6 +58,12 @@ protected:
   vtkXMLUniformGridAMRReader();
   ~vtkXMLUniformGridAMRReader();
 
+  // Test if the reader can read a file with the given version number.
+  virtual int CanReadFileVersion(int major, int minor)
+    {
+    return (major == 1 && minor == 1)? 1 : 0;
+    }
+
   // Description:
   // This method is used by CanReadFile() to check if the reader can read an XML
   // with the primary element with the given name. Default implementation
diff --git a/IO/XML/vtkXMLUnstructuredDataReader.cxx b/IO/XML/vtkXMLUnstructuredDataReader.cxx
index 1c15173..5b85472 100644
--- a/IO/XML/vtkXMLUnstructuredDataReader.cxx
+++ b/IO/XML/vtkXMLUnstructuredDataReader.cxx
@@ -548,7 +548,7 @@ int vtkXMLUnstructuredDataReader::ReadCellArray(vtkIdType numberOfCells,
   // connectivity array ahead of time to calculate the real fraction.
   float progressRange[2] = {0,0};
   this->GetProgressRange(progressRange);
-  float fractions[3] = {0, 0.2f, 1};
+  float fractions[3] = {0, 0.2, 1};
 
   // Set range of progress for offsets array.
   this->SetProgressRange(progressRange, 0, fractions);
@@ -578,7 +578,7 @@ int vtkXMLUnstructuredDataReader::ReadCellArray(vtkIdType numberOfCells,
     }
   c1->SetNumberOfTuples(numberOfCells);
   if(!this->ReadArrayValues(eOffsets, 0, c1,
-                            0, numberOfCells, CELL_DATA))
+      0, numberOfCells))
     {
     vtkErrorMacro("Cannot read cell offsets from " << eCells->GetName()
                   << " in piece " << this->Piece
@@ -641,7 +641,7 @@ int vtkXMLUnstructuredDataReader::ReadCellArray(vtkIdType numberOfCells,
     return 0;
     }
   c0->SetNumberOfTuples(cpLength);
-  if(!this->ReadArrayValues(eConn, 0, c0, 0, cpLength, CELL_DATA))
+  if(!this->ReadArrayValues(eConn, 0, c0, 0, cpLength))
     {
     vtkErrorMacro("Cannot read cell connectivity from " << eCells->GetName()
                   << " in piece " << this->Piece
@@ -726,7 +726,7 @@ int vtkXMLUnstructuredDataReader::ReadFaceArray(vtkIdType numberOfCells,
   // to calculate the real fraction.
   float progressRange[2] = {0,0};
   this->GetProgressRange(progressRange);
-  float fractions[3] = {0, 0.2f, 1};
+  float fractions[3] = {0, 0.2, 1};
 
   // Set range of progress for offsets array.
   this->SetProgressRange(progressRange, 0, fractions);
@@ -925,7 +925,7 @@ int vtkXMLUnstructuredDataReader::ReadArrayForPoints(vtkXMLDataElement* da,
   vtkIdType numPoints = this->NumberOfPoints[this->Piece];
   vtkIdType components = outArray->GetNumberOfComponents();
   return this->ReadArrayValues(da, startPoint*components,outArray,
-                               0, numPoints*components, POINT_DATA);
+    0, numPoints*components);
 }
 
 //----------------------------------------------------------------------------
diff --git a/IO/XML/vtkXMLUnstructuredDataWriter.cxx b/IO/XML/vtkXMLUnstructuredDataWriter.cxx
index 888fb91..2580631 100644
--- a/IO/XML/vtkXMLUnstructuredDataWriter.cxx
+++ b/IO/XML/vtkXMLUnstructuredDataWriter.cxx
@@ -114,11 +114,10 @@ int vtkXMLUnstructuredDataWriter::ProcessRequest(vtkInformation* request,
     {
     this->SetErrorCode(vtkErrorCode::NoError);
 
-    if(!this->Stream && !this->FileName && !this->WriteToOutputString)
+    if(!this->Stream && !this->FileName)
       {
       this->SetErrorCode(vtkErrorCode::NoFileNameError);
-      vtkErrorMacro("The FileName or Stream must be set first or "
-        "the output must be written to a string.");
+      vtkErrorMacro("The FileName or Stream must be set first.");
       return 0;
       }
 
@@ -152,15 +151,6 @@ int vtkXMLUnstructuredDataWriter::ProcessRequest(vtkInformation* request,
         this->NumberOfPieces = numPieces;
         return 0;
         }
-
-      if (this->GetInputAsDataSet() != NULL &&
-          (this->GetInputAsDataSet()->GetPointGhostArray() != NULL &&
-           this->GetInputAsDataSet()->GetCellGhostArray() != NULL))
-        {
-        // use the current version for the file.
-        this->UsePreviousVersion = false;
-        }
-
       // Write the file.
       if (!this->StartFile())
         {
@@ -550,7 +540,7 @@ void vtkXMLUnstructuredDataWriter::WriteAppendedPieceData(int index)
   this->SetProgressRange(progressRange, 2, fractions);
 
   // Write the point specification array.
-  // Since we are writing the point let save the Modified Time of vtkPoints:
+  // Since we are writting the point let save the Modified Time of vtkPoints:
   this->WritePointsAppendedData(input->GetPoints(), this->CurrentTimeIndex,
                                 &this->PointsOM->GetPiece(index));
 }
diff --git a/IO/XML/vtkXMLWriter.cxx b/IO/XML/vtkXMLWriter.cxx
index 034d6f3..70bc48e 100644
--- a/IO/XML/vtkXMLWriter.cxx
+++ b/IO/XML/vtkXMLWriter.cxx
@@ -39,7 +39,6 @@
 #include "vtkXMLDataHeaderPrivate.h"
 #undef vtkXMLDataHeaderPrivate_DoNotInclude
 #include "vtkXMLDataElement.h"
-#include "vtkXMLReaderVersion.h"
 #include "vtkInformationQuadratureSchemeDefinitionVectorKey.h"
 #include "vtkQuadratureSchemeDefinition.h"
 #include "vtkInformationStringKey.h"
@@ -340,7 +339,6 @@ vtkXMLWriter::vtkXMLWriter()
   this->UserContinueExecuting = -1; //invalid state
   this->NumberOfTimeValues = NULL;
   this->FieldDataOM = new OffsetsManagerGroup;
-  this->UsePreviousVersion = true;
 }
 
 //----------------------------------------------------------------------------
@@ -349,10 +347,17 @@ vtkXMLWriter::~vtkXMLWriter()
   this->SetFileName(0);
   this->DataStream->Delete();
   this->SetCompressor(0);
-  delete this->OutFile;
-  this->OutFile = 0;
-  delete this->OutStringStream;
-  this->OutStringStream = 0;
+  if (this->OutFile)
+    {
+    delete this->OutFile;
+    this->OutFile = 0;
+    }
+  if (this->OutStringStream)
+    {
+    delete this->OutStringStream;
+    this->OutStringStream = 0;
+    }
+
   delete this->FieldDataOM;
   delete[] this->NumberOfTimeValues;
 }
@@ -714,8 +719,11 @@ int vtkXMLWriter::OpenStream()
 //----------------------------------------------------------------------------
 int vtkXMLWriter::OpenFile()
 {
-  delete this->OutFile;
-  this->OutFile = 0;
+  if (this->OutFile)
+    {
+    delete this->OutFile;
+    this->OutFile = 0;
+    }
 
   // Strip trailing whitespace from the filename.
   int len = static_cast<int>(strlen(this->FileName));
@@ -750,7 +758,12 @@ int vtkXMLWriter::OpenFile()
 //----------------------------------------------------------------------------
 int vtkXMLWriter::OpenString()
 {
-  delete this->OutStringStream;
+  if (this->OutStringStream)
+    {
+    delete this->OutStringStream;
+    this->OutStringStream = 0;
+    }
+
   this->OutStringStream = new vtksys_ios::ostringstream();
   this->Stream = this->OutStringStream;
 
@@ -822,27 +835,13 @@ int vtkXMLWriter::WriteInternal()
 //----------------------------------------------------------------------------
 int vtkXMLWriter::GetDataSetMajorVersion()
 {
-  if (this->UsePreviousVersion)
-    {
-    return (this->HeaderType == vtkXMLWriter::UInt64) ? 1 : 0;
-    }
-  else
-    {
-    return vtkXMLReaderMajorVersion;
-    }
+  return (this->HeaderType == vtkXMLWriter::UInt64) ? 1 : 0;
 }
 
 //----------------------------------------------------------------------------
 int vtkXMLWriter::GetDataSetMinorVersion()
 {
-  if (this->UsePreviousVersion)
-    {
-    return (this->HeaderType == vtkXMLWriter::UInt64) ? 0 : 1;
-    }
-  else
-    {
-    return vtkXMLReaderMinorVersion;
-    }
+  return (this->HeaderType == vtkXMLWriter::UInt64) ? 0 : 1;
 }
 
 //----------------------------------------------------------------------------
@@ -912,10 +911,11 @@ void vtkXMLWriter::WriteFileAttributes()
     {
     os << " header_type=\"UInt64\"";
     }
-  else
+#if 0 // future: else if (this->FileMajorVersion >= 1)
     {
     os << " header_type=\"UInt32\"";
     }
+#endif
 
   // Write the compressor that will be used for the file.
   if (this->Compressor)
@@ -1282,7 +1282,7 @@ int vtkXMLWriter::WriteBinaryDataInternal(vtkAbstractArray* a)
     }
 
   // Free the byte swap buffer if it was allocated.
-  if (!this->Int32IdTypeBuffer)
+  if (this->ByteSwapBuffer && !this->Int32IdTypeBuffer)
     {
     delete [] this->ByteSwapBuffer;
     this->ByteSwapBuffer = 0;
@@ -1540,7 +1540,6 @@ size_t vtkXMLWriter::GetWordTypeSize(int dataType)
 
     case VTK_STRING:
       size = sizeof(vtkStdString::value_type);
-      break;
 
     default:
       vtkWarningMacro("Unsupported data type: " << dataType);
@@ -1558,7 +1557,7 @@ const char* vtkXMLWriter::GetWordTypeName(int dataType)
   // These string values must match vtkXMLDataElement::GetWordTypeAttribute().
   switch (dataType)
     {
-    case VTK_STRING:         return "String";
+  case VTK_STRING:           return "String";
     case VTK_FLOAT:          return "Float32";
     case VTK_DOUBLE:         return "Float64";
     case VTK_ID_TYPE:
@@ -1816,12 +1815,15 @@ inline ostream& vtkXMLWriteAsciiValue(ostream& os, const signed char &c)
 VTK_TEMPLATE_SPECIALIZE
 inline ostream& vtkXMLWriteAsciiValue(ostream& os, const vtkStdString& str)
 {
-  vtkStdString::const_iterator iter;
-  for (iter = str.begin(); iter != str.end(); ++iter)
+  vtkStdString::const_iterator iter = str.begin();
+  vtkXMLWriteAsciiValue(os, *iter);
+  iter++;
+  for (; iter != str.end(); ++iter)
     {
-    vtkXMLWriteAsciiValue(os, *iter);
     os << " ";
+    vtkXMLWriteAsciiValue(os, *iter);
     }
+  os << " ";
   char delim = 0x0;
   return vtkXMLWriteAsciiValue(os, delim);
 }
diff --git a/IO/XML/vtkXMLWriter.h b/IO/XML/vtkXMLWriter.h
index f08c6c1..83fa04f 100644
--- a/IO/XML/vtkXMLWriter.h
+++ b/IO/XML/vtkXMLWriter.h
@@ -460,14 +460,6 @@ protected:
   // when using the Start/Stop/WriteNextTime API
   int UserContinueExecuting; //can only be -1 = invalid, 0 = stop, 1 = start
 
-  // This variable is used to ease transition to new versions of VTK XML files.
-  // If data that needs to be written satisfies certain conditions,
-  // the writer can use the previous file version version.
-  // For version change 0.1 -> 2.0 (UInt32 header) and 1.0 -> 2.0
-  // (UInt64 header), if data does not have a vtkGhostType array,
-  // the file is written with version: 0.1/1.0.
-  bool UsePreviousVersion;
-
   vtkTypeInt64 *NumberOfTimeValues; //one per piece / per timestep
   //BTX
   friend class vtkXMLWriterHelper;
diff --git a/IO/XML/vtkXMLWriterC.cxx b/IO/XML/vtkXMLWriterC.cxx
index 7eaab50..b75209a 100644
--- a/IO/XML/vtkXMLWriterC.cxx
+++ b/IO/XML/vtkXMLWriterC.cxx
@@ -325,15 +325,9 @@ void vtkXMLWriterC_SetCoordinates(vtkXMLWriterC* self, int axis,
       {
       switch(axis)
         {
-        case 0:
-          dataObject->SetXCoordinates(array);
-          break;
-        case 1:
-          dataObject->SetYCoordinates(array);
-          break;
-        case 2:
-          dataObject->SetZCoordinates(array);
-          break;
+        case 0: dataObject->SetXCoordinates(array);
+        case 1: dataObject->SetYCoordinates(array);
+        case 2: dataObject->SetZCoordinates(array);
         }
       }
     }
diff --git a/IO/XMLParser/vtkXMLDataParser.cxx b/IO/XMLParser/vtkXMLDataParser.cxx
index 919c57d..c60ca04 100644
--- a/IO/XMLParser/vtkXMLDataParser.cxx
+++ b/IO/XMLParser/vtkXMLDataParser.cxx
@@ -493,10 +493,16 @@ int vtkXMLDataParser::ReadCompressionHeader()
 
   // Allocate the size and offset parts of the header.
   ch->Resize(this->NumberOfBlocks);
-  delete [] this->BlockCompressedSizes;
-  this->BlockCompressedSizes = 0;
-  delete [] this->BlockStartOffsets;
-  this->BlockStartOffsets = 0;
+  if(this->BlockCompressedSizes)
+    {
+    delete [] this->BlockCompressedSizes;
+    this->BlockCompressedSizes = 0;
+    }
+  if(this->BlockStartOffsets)
+    {
+    delete [] this->BlockStartOffsets;
+    this->BlockStartOffsets = 0;
+    }
   if(this->NumberOfBlocks > 0)
     {
     this->BlockCompressedSizes = new size_t[this->NumberOfBlocks];
diff --git a/IO/Xdmf2/README-VTK.txt b/IO/Xdmf2/README-VTK.txt
index 6c1e49c..0181e17 100644
--- a/IO/Xdmf2/README-VTK.txt
+++ b/IO/Xdmf2/README-VTK.txt
@@ -40,7 +40,8 @@ appropriate date and version number:
  git commit --amend
 
 Edit the commit message to describe the procedure used to obtain the
-content. Then push the changes back up to the main local repository:
+content. Be sure to add a gerrit change-id line to the bottom of the
+message. Then push the changes back up to the main local repository:
 
  git push .. HEAD:xdmf2vtk-upstream
  cd ..
diff --git a/IO/Xdmf2/Testing/Cxx/CMakeLists.txt b/IO/Xdmf2/Testing/Cxx/CMakeLists.txt
index f7a7b0e..d93ef02 100644
--- a/IO/Xdmf2/Testing/Cxx/CMakeLists.txt
+++ b/IO/Xdmf2/Testing/Cxx/CMakeLists.txt
@@ -1,9 +1,5 @@
-ExternalData_Expand_Arguments(VTKData _
-  "DATA{${VTK_TEST_INPUT_DIR}/XDMF/,REGEX:.*}"
-  )
-
 vtk_add_test_cxx(${vtk-module}CxxTests tests
-  TestTemporalXdmfReaderWriter.cxx,NO_VALID
-  XdmfTestVTKIO.cxx,NO_VALID
+  NO_DATA NO_VALID
+  XdmfTestVTKIO.cxx
   )
 vtk_test_cxx_executable(${vtk-module}CxxTests tests)
diff --git a/IO/Xdmf2/Testing/Cxx/TestTemporalXdmfReaderWriter.cxx b/IO/Xdmf2/Testing/Cxx/TestTemporalXdmfReaderWriter.cxx
deleted file mode 100644
index 10e1df7..0000000
--- a/IO/Xdmf2/Testing/Cxx/TestTemporalXdmfReaderWriter.cxx
+++ /dev/null
@@ -1,105 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    TestTemporalXdmfReaderWriter.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.
-
-=========================================================================*/
-// Description:
-// This tests temporal reading and writing of static meshes using
-// vtkXdmfReader and vtkXdmfWriter.
-
-#include "vtkInformation.h"
-#include "vtkMultiBlockDataSet.h"
-#include "vtkNew.h"
-#include "vtkPointData.h"
-#include "vtkStreamingDemandDrivenPipeline.h"
-#include "vtkTestUtilities.h"
-#include "vtkThreshold.h"
-#include "vtkUnstructuredGrid.h"
-#include "vtkXdmfReader.h"
-#include "vtkXdmfWriter.h"
-#include "vtksys/SystemTools.hxx"
-
-#define ASSERT_TEST(_cond_, _msg_) \
-  if (!(_cond_)) { std::cerr << _msg_ << std::endl; return VTK_ERROR; }
-
-int TestStaticMesh(vtkXdmfReader* reader)
-{
-  reader->UpdateInformation();
-
-  vtkInformation* outInfo = reader->GetExecutive()->GetOutputInformation(0);
-
-  int steps = (outInfo->Has(vtkStreamingDemandDrivenPipeline::TIME_STEPS())) ?
-    outInfo->Length(vtkStreamingDemandDrivenPipeline::TIME_STEPS()) : 0;
-  ASSERT_TEST(steps == 3, "Read data does not have 3 time steps as expected!");
-  double* timeSteps =
-      outInfo->Get(vtkStreamingDemandDrivenPipeline::TIME_STEPS());
-
-  vtkPoints* geometryAtT0 = 0;
-  vtkCellArray* topologyAtT0 = 0;
-  for (int i = 0; i < steps; i++)
-  {
-    double updateTime = timeSteps[i];
-    outInfo->Set(vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEP(),
-      updateTime);
-    reader->Update();
-    vtkMultiBlockDataSet* mb =
-      vtkMultiBlockDataSet::SafeDownCast(reader->GetOutputDataObject(0));
-    ASSERT_TEST(mb, "Root data is not a multiblock data set as expected!");
-    ASSERT_TEST(mb->GetNumberOfBlocks() == 2, "Root multiblock data is supposed to have 2 blocks!");
-    vtkUnstructuredGrid* grid =
-      vtkUnstructuredGrid::SafeDownCast(mb->GetBlock(0));
-    ASSERT_TEST(grid, "Block 0 is not an unstructured grid as expected!");
-    if (i == 0)
-      {
-      geometryAtT0 = grid->GetPoints();
-      topologyAtT0 = grid->GetCells();
-      }
-
-    ASSERT_TEST(grid->GetPoints() == geometryAtT0, "Geometry is not static over time as expected!");
-    ASSERT_TEST(grid->GetCells() == topologyAtT0, "Topology is not static over time as expected!");
-  }
-  return 0;
-}
-
-int TestTemporalXdmfReaderWriter(int argc, char *argv[])
-{
-  // Read the input data file
-  char *filePath = vtkTestUtilities::ExpandDataFileName(argc, argv,
-    "Data/XDMF/temporalStaticMeshes.xmf");
-  vtkNew<vtkXdmfReader> reader;
-  reader->SetFileName(filePath);
-  if (TestStaticMesh(reader.Get()) == VTK_ERROR)
-    {
-    std::cerr << "Error while reading " << reader->GetFileName() << std::endl;
-    return VTK_ERROR;
-    }
-
-  // Write the input data to a new Xdmf file
-  std::string outFilePath = "temporalStaticMeshesTest.xmf";
-  vtkNew<vtkXdmfWriter> writer;
-  writer->SetFileName(outFilePath.c_str());
-  writer->WriteAllTimeStepsOn();
-  writer->MeshStaticOverTimeOn();
-  writer->SetInputConnection(reader->GetOutputPort());
-  writer->Write();
-
-  // Test written file
-  vtkNew<vtkXdmfReader> reader2;
-  reader2->SetFileName(outFilePath.c_str());
-  if (TestStaticMesh(reader2.Get()) == VTK_ERROR)
-    {
-      std::cerr << "Error while reading " << reader2->GetFileName() << std::endl;
-    return VTK_ERROR;
-    }
-
-  return 0;
-}
diff --git a/IO/Xdmf2/Testing/Cxx/XdmfTestVTKIO.cxx b/IO/Xdmf2/Testing/Cxx/XdmfTestVTKIO.cxx
index de2e3ba..b45d99d 100644
--- a/IO/Xdmf2/Testing/Cxx/XdmfTestVTKIO.cxx
+++ b/IO/Xdmf2/Testing/Cxx/XdmfTestVTKIO.cxx
@@ -138,9 +138,9 @@ bool DoDataObjectsDiffer(vtkDataObject *dobj1, vtkDataObject *dobj2)
 
 bool TestXDMFConversion(vtkDataObject*input, char *prefix)
 {
-  char xdmffile[VTK_MAXPATH];
-  char hdf5file[VTK_MAXPATH];
-  char vtkfile[VTK_MAXPATH];
+  char xdmffile[256];
+  char hdf5file[256];
+  char vtkfile[256];
   sprintf(xdmffile, "%s.xmf", prefix);
   sprintf(hdf5file, "%s.h5", prefix);
   sprintf(vtkfile, "%s.vtk", prefix);
@@ -206,7 +206,7 @@ int XdmfTestVTKIO (int ac, char *av[])
   int i = 0;
   while (!fail && i<NUMTESTS)
   {
-    char filename[VTK_MAXPATH];
+    char filename[256];
     sprintf(filename, "xdmfIOtest_%d", i);
     cerr << "Test vtk object " << testobject[i] << endl;
     dog->SetProgram(testobject[i]);
diff --git a/IO/Xdmf2/vtkXdmfHeavyData.cxx b/IO/Xdmf2/vtkXdmfHeavyData.cxx
index 57a1cb0..75a8937 100644
--- a/IO/Xdmf2/vtkXdmfHeavyData.cxx
+++ b/IO/Xdmf2/vtkXdmfHeavyData.cxx
@@ -43,8 +43,6 @@
 #include <deque>
 #include <cassert>
 
-#include <libxml/tree.h>
-
 using namespace xdmf2;
 
 static void vtkScaleExtents(int in_exts[6], int out_exts[6], int stride[3])
@@ -139,7 +137,7 @@ vtkDataObject* vtkXdmfHeavyData::ReadData()
 }
 
 //----------------------------------------------------------------------------
-vtkDataObject* vtkXdmfHeavyData::ReadData(XdmfGrid* xmfGrid, int blockId)
+vtkDataObject* vtkXdmfHeavyData::ReadData(XdmfGrid* xmfGrid)
 {
   if (!xmfGrid || xmfGrid->GetGridType() == XDMF_GRID_UNSET)
     {
@@ -153,7 +151,7 @@ vtkDataObject* vtkXdmfHeavyData::ReadData(XdmfGrid* xmfGrid, int blockId)
     {
     // grid is a temporal collection, pick the sub-grid with matching time and
     // process that.
-    return this->ReadTemporalCollection(xmfGrid, blockId);
+    return this->ReadTemporalCollection(xmfGrid);
     }
   else if (gridType == XDMF_GRID_COLLECTION ||
     gridType == XDMF_GRID_TREE)
@@ -162,7 +160,7 @@ vtkDataObject* vtkXdmfHeavyData::ReadData(XdmfGrid* xmfGrid, int blockId)
     }
 
   // grid is a primitive grid, so read the data.
-  return this->ReadUniformData(xmfGrid, blockId);
+  return this->ReadUniformData(xmfGrid);
 }
 
 //----------------------------------------------------------------------------
@@ -191,7 +189,7 @@ vtkDataObject* vtkXdmfHeavyData::ReadComposite(XdmfGrid* xmfComposite)
     if (!child_is_leaf || !distribute_leaf_nodes ||
       (number_of_leaf_nodes % this->NumberOfPieces) == this->Piece)
       {
-      vtkDataObject* childDO = this->ReadData(xmfChild, cc);
+      vtkDataObject* childDO = this->ReadData(xmfChild);
       if (childDO)
         {
         multiBlock->SetBlock(cc, childDO);
@@ -206,7 +204,7 @@ vtkDataObject* vtkXdmfHeavyData::ReadComposite(XdmfGrid* xmfComposite)
 
 //----------------------------------------------------------------------------
 vtkDataObject* vtkXdmfHeavyData::ReadTemporalCollection(
-  XdmfGrid* xmfTemporalCollection, int blockId)
+  XdmfGrid* xmfTemporalCollection)
 {
   assert(xmfTemporalCollection->GetGridType() & XDMF_GRID_COLLECTION &&
     xmfTemporalCollection->GetCollectionType() == XDMF_GRID_COLLECTION_TEMPORAL
@@ -256,7 +254,7 @@ vtkDataObject* vtkXdmfHeavyData::ReadTemporalCollection(
   std::deque<XdmfGrid*>::iterator iter;
   for (iter = valid_children.begin(); iter != valid_children.end(); ++iter)
     {
-    vtkDataObject* childDO = this->ReadData(*iter, blockId);
+    vtkDataObject* childDO = this->ReadData(*iter);
     if (childDO)
       {
       child_data_objects.push_back(childDO);
@@ -288,7 +286,7 @@ vtkDataObject* vtkXdmfHeavyData::ReadTemporalCollection(
 //----------------------------------------------------------------------------
 // Read a non-composite grid. Note here uniform has nothing to do with
 // vtkUniformGrid but to what Xdmf's GridType="Uniform".
-vtkDataObject* vtkXdmfHeavyData::ReadUniformData(XdmfGrid* xmfGrid, int blockId)
+vtkDataObject* vtkXdmfHeavyData::ReadUniformData(XdmfGrid* xmfGrid)
 {
   assert(xmfGrid->IsUniform() && "Input must be a uniform xdmf grid.");
 
@@ -302,79 +300,6 @@ vtkDataObject* vtkXdmfHeavyData::ReadUniformData(XdmfGrid* xmfGrid, int blockId)
 
   // Read heavy data for grid geometry/topology. This does not read any
   // data-arrays. They are read explicitly.
-  XdmfTopology* topo = xmfGrid->GetTopology();
-  XdmfGeometry* geom = xmfGrid->GetGeometry();
-  xmlChar* filePtr;
-
-  bool caching = true;
-  XdmfDOM* topoDom = topo->GetDOM();
-  XdmfXmlNode topoNode = topo->GetElement();
-  XdmfXmlNode topoNodeDataItem = topoDom->FindElement("DataItem", 0, topoNode);
-  std::string topoFilename = "NULL";
-  if (topoNodeDataItem && caching)
-    {
-    filePtr = topoNodeDataItem->children->content;
-    if (filePtr != NULL)
-      {
-      topoFilename = reinterpret_cast<char*>(filePtr);
-      }
-    else
-      {
-      vtkErrorWithObjectMacro(this->Reader, << "Cannot find DataItem element in topology xml, no caching possible");
-      caching = false;
-      }
-    }
-  else
-    {
-    caching = false;
-    }
-
-  XdmfDOM* geomDom = geom->GetDOM();
-  XdmfXmlNode geomNode = geom->GetElement();
-  XdmfXmlNode geomNodeDataItem = geomDom->FindElement("DataItem", 0, geomNode);
-  std::string geomFilename = "NULL";
-  if (geomNodeDataItem && caching)
-    {
-    filePtr =  geomNodeDataItem->children->content;
-    if (filePtr != NULL)
-      {
-      geomFilename = reinterpret_cast<char*>(filePtr);
-      }
-    else
-      {
-      vtkErrorWithObjectMacro(this->Reader, << "Cannot find DataItem element in geometry xml, no caching possible");
-      caching = false;
-      }
-    }
-  else
-    {
-    caching = false;
-    }
-
-  vtkXdmfReader::XdmfReaderCachedData& cache =
-    vtkXdmfReader::SafeDownCast(this->Reader)->GetDataSetCache();
-  vtkXdmfReader::XdmfDataSetTopoGeoPath& cachedData = cache[blockId];
-  if (caching &&
-    (cachedData.topologyPath == topoFilename) && (cachedData.geometryPath == geomFilename))
-    {
-    vtkDataSet* ds = vtkDataSet::SafeDownCast(
-      vtkDataObjectTypes::NewDataObject(cachedData.dataset->GetDataObjectType()));
-    ds->ShallowCopy(cachedData.dataset);
-    this->ReadAttributes(ds, xmfGrid);
-    return ds;
-    }
-
-  if (caching)
-    {
-    cachedData.topologyPath = topoFilename;
-    cachedData.geometryPath = geomFilename;
-    if (cache[blockId].dataset != NULL)
-      {
-      cache[blockId].dataset->Delete();
-      cache[blockId].dataset = NULL;
-      }
-    }
-
   XdmfInt32 status = xmfGrid->Update();
   if (status == XDMF_FAIL)
     {
@@ -410,11 +335,6 @@ vtkDataObject* vtkXdmfHeavyData::ReadUniformData(XdmfGrid* xmfGrid, int blockId)
     return 0;
     }
 
-  if (caching)
-    {
-    cache[blockId].dataset = vtkDataSet::SafeDownCast(dataObject);
-    dataObject->Register(0);
-    }
   return dataObject;
 }
 
@@ -1240,7 +1160,7 @@ vtkDataArray* vtkXdmfHeavyData::ReadAttribute(XdmfAttribute* xmfAttribute,
 
 //-----------------------------------------------------------------------------
 // Read ghost cell/point information. This is simply loaded info a
-// vtkGhostType attribute array.
+// vtkGhostLevels attribute array.
 bool vtkXdmfHeavyData::ReadGhostSets(vtkDataSet* dataSet, XdmfGrid* xmfGrid,
   int *vtkNotUsed(update_extents)/*=0*/)
 {
@@ -1257,19 +1177,16 @@ bool vtkXdmfHeavyData::ReadGhostSets(vtkDataSet* dataSet, XdmfGrid* xmfGrid,
     XdmfInt32 setCenter = xmfSet->GetSetType();
     vtkIdType numElems = 0;
     vtkDataSetAttributes* dsa = 0;
-    unsigned char ghostFlag = 0;
     switch (setCenter)
       {
     case XDMF_SET_TYPE_NODE:
       dsa = dataSet->GetPointData();
       numElems = dataSet->GetNumberOfPoints();
-      ghostFlag = vtkDataSetAttributes::DUPLICATEPOINT;
       break;
 
     case XDMF_SET_TYPE_CELL:
       dsa = dataSet->GetCellData();
       numElems = dataSet->GetNumberOfCells();
-      ghostFlag = vtkDataSetAttributes::DUPLICATECELL;
       break;
 
     default:
@@ -1278,20 +1195,20 @@ bool vtkXdmfHeavyData::ReadGhostSets(vtkDataSet* dataSet, XdmfGrid* xmfGrid,
       continue;
       }
 
-    vtkUnsignedCharArray* ghosts = vtkUnsignedCharArray::SafeDownCast(
-      dsa->GetArray(vtkDataSetAttributes::GhostArrayName()));
-    if (!ghosts)
+    vtkUnsignedCharArray* ghostLevels = vtkUnsignedCharArray::SafeDownCast(
+      dsa->GetArray("vtkGhostLevels"));
+    if (!ghostLevels)
       {
-      ghosts = vtkUnsignedCharArray::New();
-      ghosts->SetName(vtkDataSetAttributes::GhostArrayName());
-      ghosts->SetNumberOfComponents(1);
-      ghosts->SetNumberOfTuples(numElems);
-      ghosts->FillComponent(0, 0);
-      dsa->AddArray(ghosts);
-      ghosts->Delete();
+      ghostLevels = vtkUnsignedCharArray::New();
+      ghostLevels->SetName("vtkGhostLevels");
+      ghostLevels->SetNumberOfComponents(1);
+      ghostLevels->SetNumberOfTuples(numElems);
+      ghostLevels->FillComponent(0, 0);
+      dsa->AddArray(ghostLevels);
+      ghostLevels->Delete();
       }
 
-    unsigned char* ptrGhosts = ghosts->GetPointer(0);
+    unsigned char* ptrGhostLevels = ghostLevels->GetPointer(0);
 
     // Read heavy data. We cannot do anything smart if update_extents or stride
     // is specified here. We have to read the entire set and then prune it.
@@ -1313,7 +1230,7 @@ bool vtkXdmfHeavyData::ReadGhostSets(vtkDataSet* dataSet, XdmfGrid* xmfGrid,
           "No such cell or point exists: " << ids[kk]);
         continue;
         }
-      ptrGhosts[ids[kk]] = ghostFlag;
+      ptrGhostLevels[ids[kk]] = ghost_value;
       }
     delete []ids;
     }
diff --git a/IO/Xdmf2/vtkXdmfHeavyData.h b/IO/Xdmf2/vtkXdmfHeavyData.h
index e30640e..5c1ddb2 100644
--- a/IO/Xdmf2/vtkXdmfHeavyData.h
+++ b/IO/Xdmf2/vtkXdmfHeavyData.h
@@ -55,7 +55,7 @@ public:
   ~vtkXdmfHeavyData();
 
   // Description:
-  vtkDataObject* ReadData(xdmf2::XdmfGrid* xmfGrid, int blockId = -1);
+  vtkDataObject* ReadData(xdmf2::XdmfGrid* xmfGrid);
 
   // Description:
   vtkDataObject* ReadData();
@@ -70,11 +70,10 @@ public:
   // of points possible.
   static int GetNumberOfPointsPerCell(int vtk_cell_type);
 
-
 private:
   // Description:
   // Read a temporal collection.
-  vtkDataObject* ReadTemporalCollection(xdmf2::XdmfGrid* xmfTemporalCollection, int blockId);
+  vtkDataObject* ReadTemporalCollection(xdmf2::XdmfGrid* xmfTemporalCollection);
 
   // Description:
   // Read a spatial-collection or a tree.
@@ -83,7 +82,7 @@ private:
   // Description:
   // Read a non-composite grid. Note here uniform has nothing to do with
   // vtkUniformGrid but to what Xdmf's GridType="Uniform".
-  vtkDataObject* ReadUniformData(xdmf2::XdmfGrid* xmfGrid, int blockId);
+  vtkDataObject* ReadUniformData(xdmf2::XdmfGrid* xmfGrid);
 
   // Description:
   // Reads the topology and geometry for an unstructured grid. Does not read any
@@ -157,6 +156,7 @@ private:
   // Creates a new dataset with egdes selected by the set, extracting them from
   // the input dataset.
   vtkDataSet* ExtractEdges(xdmf2::XdmfSet* xmfSet, vtkDataSet* dataSet);
+
 };
 
 #endif
diff --git a/IO/Xdmf2/vtkXdmfReader.cxx b/IO/Xdmf2/vtkXdmfReader.cxx
index a6a6c2c..5221741 100644
--- a/IO/Xdmf2/vtkXdmfReader.cxx
+++ b/IO/Xdmf2/vtkXdmfReader.cxx
@@ -19,7 +19,6 @@
 #include "vtkCharArray.h"
 #include "vtkCompositeDataPipeline.h"
 #include "vtkDataObjectTypes.h"
-#include "vtkDataSet.h"
 #include "vtkExtentTranslator.h"
 #include "vtkInformation.h"
 #include "vtkInformationVector.h"
@@ -117,8 +116,6 @@ vtkXdmfReader::~vtkXdmfReader()
   delete this->CellArraysCache;
   delete this->GridsCache;
   delete this->SetsCache;
-
-  this->ClearDataSetCache();
 }
 
 //----------------------------------------------------------------------------
@@ -322,13 +319,8 @@ int vtkXdmfReader::RequestInformation(vtkInformation *, vtkInformationVector **,
   outInfo->Set(vtkDataObject::SIL(), domain->GetSIL());
 
   // * Publish time information.
-  const std::map<int, XdmfFloat64>& ts = domain->GetTimeStepsRev();
-  std::vector<double> time_steps(ts.size());
-  std::map<int, XdmfFloat64>::const_iterator it = ts.begin();
-  for (int i = 0; it != ts.end(); i++, ++it)
-    {
-    time_steps[i] = it->second;
-    }
+  std::vector<double> time_steps(domain->GetTimeSteps().begin(),
+    domain->GetTimeSteps().end());
 
   if (time_steps.size() > 0)
     {
@@ -394,10 +386,6 @@ int vtkXdmfReader::RequestData(vtkInformation *, vtkInformationVector **,
     }
 
   this->LastTimeIndex = this->ChooseTimeStep(outInfo);
-  if (this->LastTimeIndex == 0)
-    {
-    this->ClearDataSetCache();
-    }
 
   vtkXdmfHeavyData dataReader(this->XdmfDocument->GetActiveDomain(), this);
   dataReader.Piece = updatePiece;
@@ -627,24 +615,3 @@ vtkGraph* vtkXdmfReader::GetSIL()
     }
   return 0;
 }
-
-//----------------------------------------------------------------------------
-void vtkXdmfReader::ClearDataSetCache()
-{
-  XdmfReaderCachedData::iterator it = this->DataSetCache.begin();
-  while (it != this->DataSetCache.end())
-    {
-    if (it->second.dataset != NULL)
-      {
-      it->second.dataset->Delete();
-      }
-    ++it;
-    }
-  this->DataSetCache.clear();
-}
-
-//----------------------------------------------------------------------------
-vtkXdmfReader::XdmfReaderCachedData& vtkXdmfReader::GetDataSetCache()
-{
-  return this->DataSetCache;
-}
diff --git a/IO/Xdmf2/vtkXdmfReader.h b/IO/Xdmf2/vtkXdmfReader.h
index a7ecc58..c932de9 100644
--- a/IO/Xdmf2/vtkXdmfReader.h
+++ b/IO/Xdmf2/vtkXdmfReader.h
@@ -35,7 +35,6 @@
 
 #include "vtkIOXdmf2Module.h" // For export macro
 #include "vtkDataReader.h"
-#include <map> // for caching
 
 class vtkXdmfArraySelection;
 class vtkXdmfDocument;
@@ -141,21 +140,6 @@ public:
   virtual vtkGraph* GetSIL();
 
 //BTX
-  class XdmfDataSetTopoGeoPath
-  {
-  public:
-    XdmfDataSetTopoGeoPath() : dataset(0), topologyPath(), geometryPath() {}
-    vtkDataSet* dataset;
-    std::string topologyPath;
-    std::string geometryPath;
-  };
-
-  typedef std::map<int, XdmfDataSetTopoGeoPath> XdmfReaderCachedData;
-
-  // Description
-  // Get the data set cache
-  XdmfReaderCachedData& GetDataSetCache();
-
 protected:
   vtkXdmfReader();
   ~vtkXdmfReader();
@@ -198,16 +182,11 @@ protected:
   vtkXdmfArraySelection* SetsCache;
 
   int SILUpdateStamp;
-
-  XdmfReaderCachedData DataSetCache;
-
 private:
   // Description:
   // Prepares the XdmfDocument.
   bool PrepareDocument();
 
-  void ClearDataSetCache();
-
   // Description:
   // Returns the time-step index requested using the UPDATE_TIME_STEPS from the
   // information.
diff --git a/IO/Xdmf2/vtkXdmfReaderInternal.cxx b/IO/Xdmf2/vtkXdmfReaderInternal.cxx
index ae7d61e..f4b7703 100644
--- a/IO/Xdmf2/vtkXdmfReaderInternal.cxx
+++ b/IO/Xdmf2/vtkXdmfReaderInternal.cxx
@@ -218,7 +218,7 @@ vtkXdmfDomain::vtkXdmfDomain(XdmfDOM* xmlDom, int domain_index)
   this->NumberOfGrids = this->XMLDOM->FindNumberOfElements("Grid", this->XMLDomain);
   this->XMFGrids = new XdmfGrid[this->NumberOfGrids+1];
 
-  XdmfXmlNode xmlGrid = this->XMLDOM->FindElement("Grid", 0, this->XMLDomain);
+  XdmfXmlNode xmlGrid = this->XMLDOM->FindElement("Grid", 0, this->XMLDomain); 
   XdmfInt64 cc=0;
   while (xmlGrid)
     {
@@ -297,14 +297,14 @@ int vtkXdmfDomain::GetVTKDataType(XdmfGrid* xmfGrid)
     {
     return VTK_MULTIBLOCK_DATA_SET;
     }
-  if (xmfGrid->GetTopology()->GetClass() == XDMF_UNSTRUCTURED )
+  if (xmfGrid->GetTopology()->GetClass() == XDMF_UNSTRUCTURED ) 
     {
     return VTK_UNSTRUCTURED_GRID;
-    }
+    } 
   XdmfInt32 topologyType = xmfGrid->GetTopology()->GetTopologyType();
   if (topologyType == XDMF_2DSMESH || topologyType == XDMF_3DSMESH )
-    {
-    return VTK_STRUCTURED_GRID;
+    { 
+    return VTK_STRUCTURED_GRID; 
     }
   else if (topologyType == XDMF_2DCORECTMESH ||
     topologyType == XDMF_3DCORECTMESH)
@@ -325,13 +325,7 @@ int vtkXdmfDomain::GetVTKDataType(XdmfGrid* xmfGrid)
 //----------------------------------------------------------------------------
 int vtkXdmfDomain::GetIndexForTime(double time)
 {
-  std::map<XdmfFloat64, int>::const_iterator iter = this->TimeSteps.find(time);
-  if (iter != this->TimeSteps.end())
-    {
-    return iter->second;
-    }
-
-  iter = this->TimeSteps.upper_bound(time);
+  std::set<XdmfFloat64>::iterator iter = this->TimeSteps.upper_bound(time);
   if (iter == this->TimeSteps.begin())
     {
     // The requested time step is before any available time.  We will use it by
@@ -343,7 +337,7 @@ int vtkXdmfDomain::GetIndexForTime(double time)
     iter--;
     }
 
-  std::map<XdmfFloat64, int>::iterator iter2 = this->TimeSteps.begin();
+  std::set<XdmfFloat64>::iterator iter2 = this->TimeSteps.begin();
   int counter = 0;
   while (iter2 != iter)
     {
@@ -443,7 +437,7 @@ bool vtkXdmfDomain::GetOriginAndSpacing(XdmfGrid* xmfGrid,
 
   XdmfGeometry *xmfGeometry = xmfGrid->GetGeometry();
   if (xmfGeometry->GetGeometryType() == XDMF_GEOMETRY_ORIGIN_DXDYDZ )
-    {
+    { 
     // Update geometry so that origin and spacing are read
     xmfGeometry->Update(); // read heavy-data for the geometry.
     XdmfFloat64 *xmfOrigin = xmfGeometry->GetOrigin();
@@ -548,7 +542,7 @@ void vtkXdmfDomain::CollectMetaData()
     this->Grids->clear();
 
     // We have aborted collecting grids information since it was too numerous to
-    // be of any use to the user.
+    // be of any use to the user. 
     this->SILBuilder->Initialize();
     blocksRoot = this->SILBuilder->AddVertex("Blocks");
     hierarchyRoot = this->SILBuilder->AddVertex("Hierarchy");
@@ -629,7 +623,7 @@ void vtkXdmfDomain::CollectNonLeafMetaData(XdmfGrid* xmfGrid,
   XdmfInt32 numChildren = xmfGrid->GetNumberOfChildren();
   for (XdmfInt32 cc=0; cc < numChildren; cc++)
     {
-    XdmfGrid* xmfChild = xmfGrid->GetChild(cc);
+    XdmfGrid* xmfChild = xmfGrid->GetChild(cc); 
     this->CollectMetaData(xmfChild, silVertex);
     }
 
@@ -647,12 +641,7 @@ void vtkXdmfDomain::CollectNonLeafMetaData(XdmfGrid* xmfGrid,
     XdmfTime* xmfTime = xmfGrid->GetTime();
     if (xmfTime && xmfTime->GetTimeType() != XDMF_TIME_UNSET)
       {
-      int step = static_cast<int>(this->TimeSteps.size());
-      if (this->TimeSteps.find(xmfTime->GetValue()) == this->TimeSteps.end())
-        {
-        this->TimeSteps[xmfTime->GetValue()] = step;
-        this->TimeStepsRev[step] = xmfTime->GetValue();
-        }
+      this->TimeSteps.insert(xmfTime->GetValue());
       }
     }
 }
@@ -730,7 +719,7 @@ void vtkXdmfDomain::CollectLeafMetaData(XdmfGrid* xmfGrid, vtkIdType silParent)
 
     // XdmfInt32 setCenter = xmfSet->GetSetType();
     // Not sure if we want to create separate lists for different types of sets
-    // or just treat all the sets as same. For now, we are treating them as
+    // or just treat all the sets as same. For now, we are treating them as 
     // the same.
     this->Sets->AddArray(name);
     }
@@ -739,12 +728,7 @@ void vtkXdmfDomain::CollectLeafMetaData(XdmfGrid* xmfGrid, vtkIdType silParent)
   XdmfTime* xmfTime = xmfGrid->GetTime();
   if (xmfTime && xmfTime->GetTimeType() != XDMF_TIME_UNSET)
     {
-    int step = static_cast<int>(this->TimeSteps.size());
-    if (this->TimeSteps.find(xmfTime->GetValue()) == this->TimeSteps.end())
-      {
-      this->TimeSteps[xmfTime->GetValue()] = step;
-      this->TimeStepsRev[step] = xmfTime->GetValue();
-      }
+    this->TimeSteps.insert(xmfTime->GetValue());
     }
 }
 
diff --git a/IO/Xdmf2/vtkXdmfReaderInternal.h b/IO/Xdmf2/vtkXdmfReaderInternal.h
index 4604813..36e7ac9 100644
--- a/IO/Xdmf2/vtkXdmfReaderInternal.h
+++ b/IO/Xdmf2/vtkXdmfReaderInternal.h
@@ -203,9 +203,8 @@ private:
   vtkXdmfArraySelection* CellArrays;
   vtkXdmfArraySelection* Grids;
   vtkXdmfArraySelection* Sets;
-  std::map<XdmfFloat64, int> TimeSteps; //< Only discrete timesteps are currently
+  std::set<XdmfFloat64> TimeSteps; //< Only discrete timesteps are currently
                                  //  supported.
-  std::map<int, XdmfFloat64> TimeStepsRev;
 
 public:
   //---------------------------------------------------------------------------
@@ -245,10 +244,8 @@ public:
   //---------------------------------------------------------------------------
   // Description:
   // Returns the timesteps.
-  const std::map<XdmfFloat64, int>& GetTimeSteps()
+  const std::set<XdmfFloat64>& GetTimeSteps()
     { return this->TimeSteps; }
-  const std::map<int,XdmfFloat64>& GetTimeStepsRev()
-    { return this->TimeStepsRev; }
 
   //---------------------------------------------------------------------------
   // Description:
@@ -260,8 +257,18 @@ public:
   // Returns the time value at the given index.
   XdmfFloat64 GetTimeForIndex(int index)
     {
-    std::map<int, XdmfFloat64>::iterator iter = this->TimeStepsRev.find(index);
-    return (iter != this->TimeStepsRev.end()) ? iter->second : 0.0;
+    std::set<XdmfFloat64>::iterator iter;
+    int cc=0;
+    for (iter = this->TimeSteps.begin(); iter != this->TimeSteps.end();
+      iter++, cc++)
+      {
+      if (cc == index)
+        {
+        return *iter;
+        }
+      }
+    // invalid index.
+    return 0.0;
     }
 
   //---------------------------------------------------------------------------
diff --git a/IO/Xdmf2/vtkXdmfWriter.cxx b/IO/Xdmf2/vtkXdmfWriter.cxx
index 1d63d08..c7f8c26 100644
--- a/IO/Xdmf2/vtkXdmfWriter.cxx
+++ b/IO/Xdmf2/vtkXdmfWriter.cxx
@@ -41,7 +41,6 @@
 #include "vtkStructuredGrid.h"
 #include "vtkTypeTraits.h"
 #include "vtkUnstructuredGrid.h"
-#include "vtksys/SystemTools.hxx"
 
 #include "XdmfArray.h"
 #include "XdmfAttribute.h"
@@ -57,7 +56,6 @@
 #include <algorithm>
 #include <map>
 #include <stdio.h>
-#include <sstream>
 #include <vector>
 
 #include <libxml/tree.h> // always after std::blah stuff
@@ -188,7 +186,6 @@ vtkXdmfWriter::vtkXdmfWriter()
   this->TopTemporalGrid = NULL;
   this->DomainMemoryHandler = NULL;
   this->SetNumberOfOutputPorts(0);
-  this->MeshStaticOverTime = false;
 }
 
 //----------------------------------------------------------------------------
@@ -197,12 +194,21 @@ vtkXdmfWriter::~vtkXdmfWriter()
   this->SetFileName(NULL);
   this->SetHeavyDataFileName(NULL);
   this->SetHeavyDataGroupName(NULL);
-  delete this->DOM;
-  this->DOM = NULL;
+  if (this->DOM)
+    {
+    delete this->DOM;
+    this->DOM = NULL;
+    }
+  if (this->DomainMemoryHandler)
+    {
+    delete this->DomainMemoryHandler;
+    }
+  if (this->TopTemporalGrid)
+    {
+    delete this->TopTemporalGrid;
+    this->TopTemporalGrid = NULL;
+    }
   delete this->DomainMemoryHandler;
-  this->DomainMemoryHandler = NULL;
-  delete this->TopTemporalGrid;
-  this->TopTemporalGrid = NULL;
 
   //TODO: Verify memory isn't leaking
 }
@@ -251,10 +257,6 @@ int vtkXdmfWriter::Write()
   // always write even if the data hasn't changed
   this->Modified();
 
-  this->TopologyAtT0.clear();
-  this->GeometryAtT0.clear();
-  this->UnlabelledDataArrayId = 0;
-
   //TODO: Specify name of heavy data companion file?
   if (!this->DOM)
     {
@@ -267,7 +269,10 @@ int vtkXdmfWriter::Write()
   root.SetVersion(2.2);
   root.Build();
 
-  delete this->DomainMemoryHandler;
+  if (this->DomainMemoryHandler)
+    {
+    delete this->DomainMemoryHandler;
+    }
   this->DomainMemoryHandler = new vtkXdmfWriterDomainMemoryHandler();
   this->DomainMemoryHandler->InsertIntoRoot(root);
 
@@ -338,15 +343,6 @@ int vtkXdmfWriter::RequestData(
     return 1;
     }
 
-  this->WorkingDirectory = vtksys::SystemTools::GetFilenamePath(this->FileName);
-  this->BaseFileName     = vtksys::SystemTools::GetFilenameWithoutLastExtension(this->FileName);
-
-  // If mesh is static we force heavy data to be exported in HDF
-  int lightDataLimit = this->LightDataLimit;
-  this->LightDataLimit = this->MeshStaticOverTime ? 1 : this->LightDataLimit;
-
-  this->CurrentBlockIndex = 0;
-
   if (this->CurrentTimeIndex == 0 &&
       this->WriteAllTimeSteps &&
       this->NumberOfTimeSteps > 1)
@@ -355,20 +351,23 @@ int vtkXdmfWriter::RequestData(
     request->Set(vtkStreamingDemandDrivenPipeline::CONTINUE_EXECUTING(), 1);
 
     // make a top level temporal grid just under domain
-    delete this->TopTemporalGrid;
-    this->TopTemporalGrid = NULL;
+    if (this->TopTemporalGrid)
+      {
+      delete this->TopTemporalGrid;
+      this->TopTemporalGrid = NULL;
+      }
 
     xdmf2::XdmfGrid *tgrid = new xdmf2::XdmfGrid();
     tgrid->SetDeleteOnGridDelete(true);
     tgrid->SetGridType(XDMF_GRID_COLLECTION);
     tgrid->SetCollectionType(XDMF_GRID_COLLECTION_TEMPORAL);
-    tgrid->SetName(this->BaseFileName.c_str());
     XdmfTopology *t = tgrid->GetTopology();
     t->SetTopologyType(XDMF_NOTOPOLOGY);
     XdmfGeometry *geo = tgrid->GetGeometry();
     geo->SetGeometryType(XDMF_GEOMETRY_NONE);
 
     this->DomainMemoryHandler->InsertGrid(tgrid);
+
     this->TopTemporalGrid = tgrid;
     }
 
@@ -383,21 +382,19 @@ int vtkXdmfWriter::RequestData(
     this->DomainMemoryHandler->InsertGrid(grid);
     }
 
-  this->CurrentTime = 0;
-
   vtkInformation* inInfo = inputVector[0]->GetInformationObject(0);
   vtkDataObject* input = inInfo->Get(vtkDataObject::DATA_OBJECT());
   vtkInformation *inDataInfo = input->GetInformation();
   if (inDataInfo->Has(vtkDataObject::DATA_TIME_STEP()))
     {
     //I am assuming we are not given a temporal data object and getting just one time.
-    this->CurrentTime = input->GetInformation()->Get(vtkDataObject::DATA_TIME_STEP());
-    //cerr << "Writing timestep" << this->CurrentTimeIndex << " (" << this->CurrentTime << ")" << endl;
+    double dataT = input->GetInformation()->Get(vtkDataObject::DATA_TIME_STEP());
+    //cerr << "Writing " << this->CurrentTimeIndex << " " << *dataT << endl;
 
     XdmfTime *xT = grid->GetTime();
     xT->SetDeleteOnGridDelete(true);
     xT->SetTimeType(XDMF_TIME_SINGLE);
-    xT->SetValue(this->CurrentTime);
+    xT->SetValue(dataT);
     grid->Insert(xT);
     }
 
@@ -415,7 +412,6 @@ int vtkXdmfWriter::RequestData(
     this->TopTemporalGrid = NULL;
     }
 
-  this->LightDataLimit = lightDataLimit;
   return 1;
 }
 
@@ -501,19 +497,6 @@ int vtkXdmfWriter::WriteCompositeDataSet(vtkCompositeDataSet *dobj, xdmf2::XdmfG
 
   return 1;
 }
-
-//----------------------------------------------------------------------------
-void vtkXdmfWriter::SetupDataArrayXML(XdmfElement* e, XdmfArray* a) const
-{
-  std::stringstream ss;
-  ss << "<DataItem Dimensions = \"" << a->GetShapeAsString() <<
-    "\" NumberType = \"" << XdmfTypeToClassString(a->GetNumberType()) <<
-    "\" Precision = \"" << a->GetElementSize() <<
-    "\" Format = \"HDF\">" <<
-    a->GetHeavyDataSetName() << "</DataItem>";
-  e->SetDataXml(ss.str().c_str());
-}
-
 //------------------------------------------------------------------------------
 int vtkXdmfWriter::CreateTopology(vtkDataSet *ds, xdmf2::XdmfGrid *grid, vtkIdType PDims[3], vtkIdType CDims[3], vtkIdType &PRank, vtkIdType &CRank, void *staticdata)
 {
@@ -526,35 +509,14 @@ int vtkXdmfWriter::CreateTopology(vtkDataSet *ds, xdmf2::XdmfGrid *grid, vtkIdTy
   if (this->HeavyDataFileName)
     {
     heavyDataSetName = std::string(this->HeavyDataFileName) + ":";
-    if (this->MeshStaticOverTime)
-      {
-      std::stringstream hdf5group;
-      hdf5group << "/Topology_";
-      if (this->CurrentBlockIndex >= 0)
-        {
-        if (grid->GetName())
-          {
-          hdf5group << grid->GetName();
-          }
-        else
-          {
-          hdf5group << "Block_" << this->CurrentBlockIndex;
-          }
-        heavyDataSetName = heavyDataSetName + hdf5group.str();
-        }
-      }
-    else
+    if (this->HeavyDataGroupName)
       {
-      if (this->HeavyDataGroupName)
-        {
-        heavyDataSetName = heavyDataSetName + HeavyDataGroupName + "/Topology";
-        }
+      heavyDataSetName = heavyDataSetName + HeavyDataGroupName + "/Topology";
       }
     heavyName = heavyDataSetName.c_str();
     }
 
   XdmfTopology *t = grid->GetTopology();
-  t->SetLightDataLimit(this->LightDataLimit);
 
   //
   // If the topology is unchanged from last grid written, we can reuse the XML
@@ -581,28 +543,6 @@ int vtkXdmfWriter::CreateTopology(vtkDataSet *ds, xdmf2::XdmfGrid *grid, vtkIdTy
     }
   }
 
-  if (this->MeshStaticOverTime)
-    {
-    if (this->CurrentTimeIndex == 0)
-      {
-      // Save current topology node at t0 for next time steps
-      this->TopologyAtT0.push_back(t);
-      }
-    else if (static_cast<int>(this->TopologyAtT0.size()) > this->CurrentBlockIndex)
-      {
-      // Get topology node at t0
-      XdmfTopology* topo = this->TopologyAtT0[this->CurrentBlockIndex];
-      // Setup current topology node with t0 properties
-      t->SetTopologyTypeFromString(topo->GetTopologyTypeAsString());
-      t->SetNumberOfElements(topo->GetNumberOfElements());
-
-      // Setup connectivity data XML according t0 one
-      this->SetupDataArrayXML(t, topo->GetConnectivity());
-      reusing_topology = true;
-      // process continue as need to setup PDims parameters
-      }
-    }
-
   //Topology
   switch (ds->GetDataObjectType()) {
   case VTK_STRUCTURED_POINTS:
@@ -763,7 +703,6 @@ int vtkXdmfWriter::CreateTopology(vtkDataSet *ds, xdmf2::XdmfGrid *grid, vtkIdTy
         {
         di->SetNumberType(XDMF_INT32_TYPE);
         }
-
       XdmfInt64 hDim[2];
       hDim[0] = ds->GetNumberOfCells();
       hDim[1] = ppCell;
@@ -942,29 +881,9 @@ int vtkXdmfWriter::CreateGeometry(vtkDataSet *ds, xdmf2::XdmfGrid *grid, void *s
   if (this->HeavyDataFileName)
     {
     heavyDataSetName = std::string(this->HeavyDataFileName) + ":";
-    if (this->MeshStaticOverTime)
-      {
-      std::stringstream hdf5group;
-      hdf5group << "/Geometry_";
-      if (this->CurrentBlockIndex >= 0)
-        {
-        if (grid->GetName())
-          {
-          hdf5group << grid->GetName();
-          }
-        else
-          {
-          hdf5group << "Block_" << this->CurrentBlockIndex;
-          }
-        heavyDataSetName = heavyDataSetName + hdf5group.str();
-        }
-      }
-    else
+    if (this->HeavyDataGroupName)
       {
-      if (this->HeavyDataGroupName)
-        {
-        heavyDataSetName = heavyDataSetName + HeavyDataGroupName + "/Geometry";
-        }
+      heavyDataSetName = heavyDataSetName + HeavyDataGroupName + "/Geometry";
       }
     heavyName = heavyDataSetName.c_str();
     }
@@ -982,25 +901,6 @@ int vtkXdmfWriter::CreateGeometry(vtkDataSet *ds, xdmf2::XdmfGrid *grid, void *s
     }
   }
 
-  if (this->MeshStaticOverTime)
-    {
-    if (this->CurrentTimeIndex == 0)
-      {
-      // Save current geometry node at t0 for next time steps
-      this->GeometryAtT0.push_back(geo);
-      }
-    else if (static_cast<int>(this->TopologyAtT0.size()) > this->CurrentBlockIndex)
-      {
-      // Get geometry node at t0
-      XdmfGeometry* geo0 = this->GeometryAtT0[this->CurrentBlockIndex];
-      // Setup current geometry node with t0 properties
-      geo->SetGeometryTypeFromString(geo0->GetGeometryTypeAsString());
-      // Setup points data XML according t0 one
-      this->SetupDataArrayXML(geo, geo0->GetPoints());
-      return 1;
-      }
-    }
-
   switch (ds->GetDataObjectType()) {
   case VTK_STRUCTURED_POINTS:
   case VTK_IMAGE_DATA:
@@ -1071,7 +971,6 @@ int vtkXdmfWriter::CreateGeometry(vtkDataSet *ds, xdmf2::XdmfGrid *grid, void *s
 
   return 1;
 }
-
 //------------------------------------------------------------------------------
 int vtkXdmfWriter::WriteAtomicDataSet(vtkDataObject *dobj, xdmf2::XdmfGrid *grid)
 {
@@ -1084,8 +983,6 @@ int vtkXdmfWriter::WriteAtomicDataSet(vtkDataObject *dobj, xdmf2::XdmfGrid *grid
     return 0;
     }
 
-  this->DOM->SetWorkingDirectory(this->WorkingDirectory.c_str());
-
   //Attributes
   vtkIdType FRank = 1;
   vtkIdType FDims[1];
@@ -1094,29 +991,6 @@ int vtkXdmfWriter::WriteAtomicDataSet(vtkDataObject *dobj, xdmf2::XdmfGrid *grid
   vtkIdType PRank = 3;
   vtkIdType PDims[3];
 
-  // We need to force a data and group name for supporting still mesh over time
-  // otherwise names are generated when the data is dumped in HDF5: too late
-  // because we need the name to reuse it when building the tree.
-  std::string hdf5name = this->BaseFileName + ".h5";
-  this->SetHeavyDataFileName(hdf5name.c_str());
-
-  std::stringstream hdf5group;
-  hdf5group << "/";
-  if (this->CurrentBlockIndex >= 0)
-    {
-    if (grid->GetName())
-      {
-      hdf5group << grid->GetName();
-      }
-    else
-      {
-      hdf5group << "Block_" << this->CurrentBlockIndex;
-      }
-    }
-  hdf5group << "_t" << setw(6) << setfill('0') << this->CurrentTime;
-  hdf5group << ends;
-  this->SetHeavyDataGroupName(hdf5group.str().c_str());
-
   this->CreateTopology(ds, grid, PDims, CDims, PRank, CRank, NULL);
   if (!this->CreateGeometry(ds, grid, NULL))
     {
@@ -1128,8 +1002,6 @@ int vtkXdmfWriter::WriteAtomicDataSet(vtkDataObject *dobj, xdmf2::XdmfGrid *grid
   this->WriteArrays(ds->GetCellData(), grid,XDMF_ATTRIBUTE_CENTER_CELL, CRank, CDims, "Cell");
   this->WriteArrays(ds->GetPointData(),grid,XDMF_ATTRIBUTE_CENTER_NODE, PRank, PDims, "Node");
 
-  this->CurrentBlockIndex++;
-
   return 1;
 }
 
@@ -1313,22 +1185,10 @@ void vtkXdmfWriter::ConvertVToXArray(vtkDataArray *vda,
       }
     }
 
-  if (heavyprefix)
-    {
-    std::string name;
-    if (vda->GetName())
-      {
-      name = vda->GetName();
-      }
-    else
-      {
-      std::stringstream ss;
-      ss << "DataArray" << this->UnlabelledDataArrayId++;
-      name = ss.str();
-      }
-    std::string dsname = std::string(heavyprefix) + "/" + name;
+  if (heavyprefix) {
+    std::string dsname = std::string(heavyprefix) + "/" + std::string(vda->GetName());
     xda->SetHeavyDataSetName(dsname.c_str());
-    }
+  }
 
   //TODO: if we can make xdmf write out immediately, then wouldn't have to keep around
   //arrays when working with temporal data
diff --git a/IO/Xdmf2/vtkXdmfWriter.h b/IO/Xdmf2/vtkXdmfWriter.h
index 2cdeb43..e489e40 100644
--- a/IO/Xdmf2/vtkXdmfWriter.h
+++ b/IO/Xdmf2/vtkXdmfWriter.h
@@ -27,9 +27,6 @@
 
 #include "vtkDataObjectAlgorithm.h"
 
-#include <string> // Needed for private members
-#include <vector> //
-
 class vtkExecutive;
 
 class vtkCompositeDataSet;
@@ -45,10 +42,7 @@ namespace xdmf2
 {
 class XdmfArray;
 class XdmfDOM;
-class XdmfElement;
 class XdmfGrid;
-class XdmfGeometry;
-class XdmfTopology;
 }
 
 class VTKIOXDMF2_EXPORT vtkXdmfWriter : public vtkDataObjectAlgorithm
@@ -88,7 +82,6 @@ public:
   // Description:
   // Topology Geometry and Attribute arrays smaller than this are written in line into the XML.
   // Default is 100.
-  // Node: LightDataLimit is forced to 1 when MeshStaticOverTime is TRUE.
   vtkSetMacro(LightDataLimit, int);
   vtkGetMacro(LightDataLimit, int);
 
@@ -100,15 +93,6 @@ public:
   vtkGetMacro(WriteAllTimeSteps, int);
   vtkBooleanMacro(WriteAllTimeSteps, int);
 
-  // Description:
-  // Set of get the flag that specify if input mesh is static over time.
-  // If so, the mesh topology and geometry heavy data will be written only once.
-  // Default if FALSE.
-  // Note: this mode requires that all data is dumped in the heavy data file.
-  vtkSetMacro(MeshStaticOverTime, bool);
-  vtkGetMacro(MeshStaticOverTime, bool);
-  vtkBooleanMacro(MeshStaticOverTime, bool);
-
     // Description:
   // Called in parallel runs to identify the portion this process is responsible for
   // TODO: respect this
@@ -159,36 +143,24 @@ protected:
                                 vtkIdType rank, vtkIdType *dims,
                                 int AllocStrategy, const char *heavyprefix);
 
-  virtual void SetupDataArrayXML(xdmf2::XdmfElement*, xdmf2::XdmfArray*) const;
-
   char *FileName;
   char *HeavyDataFileName;
   char *HeavyDataGroupName;
-  std::string WorkingDirectory;
-  std::string BaseFileName;
 
   int LightDataLimit;
 
   int WriteAllTimeSteps;
   int NumberOfTimeSteps;
-  double CurrentTime;
   int CurrentTimeIndex;
-  int CurrentBlockIndex;
-  int UnlabelledDataArrayId;
 
   int Piece;
   int NumberOfPieces;
 
-  bool MeshStaticOverTime;
-
   xdmf2::XdmfDOM *DOM;
   xdmf2::XdmfGrid *TopTemporalGrid;
 
   vtkXdmfWriterDomainMemoryHandler *DomainMemoryHandler;
 
-  std::vector<xdmf2::XdmfTopology*> TopologyAtT0;
-  std::vector<xdmf2::XdmfGeometry*> GeometryAtT0;
-
 private:
   vtkXdmfWriter(const vtkXdmfWriter&); // Not implemented
   void operator=(const vtkXdmfWriter&); // Not implemented
diff --git a/Imaging/Color/vtkImageMapToWindowLevelColors.cxx b/Imaging/Color/vtkImageMapToWindowLevelColors.cxx
index 37bf096..737f632 100644
--- a/Imaging/Color/vtkImageMapToWindowLevelColors.cxx
+++ b/Imaging/Color/vtkImageMapToWindowLevelColors.cxx
@@ -208,21 +208,16 @@ void vtkImageMapToWindowLevelClamps ( vtkImageData *data, double w,
     }
 
   // now compute the lower and upper values
-  if (w > 0.0)
+  if (w >= 0)
     {
     f_lower_val = 255.0*(adjustedLower - f_lower)/w;
     f_upper_val = 255.0*(adjustedUpper - f_lower)/w;
     }
-  else if (w < 0.0)
+  else
     {
     f_lower_val = 255.0 + 255.0*(adjustedLower - f_lower)/w;
     f_upper_val = 255.0 + 255.0*(adjustedUpper - f_lower)/w;
     }
-  else
-    {
-    f_lower_val = 0.0;
-    f_upper_val = 255.0;
-    }
 
   if (f_upper_val > 255)
     {
diff --git a/Imaging/Core/Testing/Python/TestChangeInformation.py b/Imaging/Core/Testing/Python/TestChangeInformation.py
index e1c58bc..105cbbc 100755
--- a/Imaging/Core/Testing/Python/TestChangeInformation.py
+++ b/Imaging/Core/Testing/Python/TestChangeInformation.py
@@ -22,7 +22,6 @@ reslice.SetInterpolationModeToCubic()
 # to do this, it is just put in as an example)
 information2 = vtk.vtkImageChangeInformation()
 information2.SetInputConnection(reslice.GetOutputPort())
-reader.Update()
 information2.SetInformationInputData(reader.GetOutput())
 viewer = vtk.vtkImageViewer()
 viewer.SetInputConnection(information2.GetOutputPort())
diff --git a/Imaging/Core/Testing/Python/resampledTexture.py b/Imaging/Core/Testing/Python/resampledTexture.py
index 14d8905..62d2f35 100755
--- a/Imaging/Core/Testing/Python/resampledTexture.py
+++ b/Imaging/Core/Testing/Python/resampledTexture.py
@@ -21,7 +21,7 @@ v16.SetImageRange(1,93)
 v16.SetDataSpacing(3.2,3.2,1.5)
 extract = vtk.vtkExtractVOI()
 extract.SetInputConnection(v16.GetOutputPort())
-extract.SetVOI(32,32,0,63,0,92)
+extract.SetVOI(32,32,0,63,0,93)
 atext = vtk.vtkTexture()
 atext.SetInputConnection(extract.GetOutputPort())
 atext.InterpolateOn()
diff --git a/Imaging/Core/Testing/Tcl/TestChangeInformation.tcl b/Imaging/Core/Testing/Tcl/TestChangeInformation.tcl
index 97860e0..415716c 100644
--- a/Imaging/Core/Testing/Tcl/TestChangeInformation.tcl
+++ b/Imaging/Core/Testing/Tcl/TestChangeInformation.tcl
@@ -22,7 +22,6 @@ reslice SetInterpolationModeToCubic
 # to do this, it is just put in as an example)
 vtkImageChangeInformation information2
 information2 SetInputConnection [reslice GetOutputPort]
-reader Update
 information2 SetInformationInputData [reader GetOutput]
 
 vtkImageViewer viewer
diff --git a/Imaging/Core/vtkImageBSplineInterpolator.cxx b/Imaging/Core/vtkImageBSplineInterpolator.cxx
index 353e78c..5bc2168 100644
--- a/Imaging/Core/vtkImageBSplineInterpolator.cxx
+++ b/Imaging/Core/vtkImageBSplineInterpolator.cxx
@@ -29,7 +29,6 @@
 # define VTK_USE_UINT64 0
 
 #define VTK_BSPLINE_KERNEL_SIZE_MAX (VTK_IMAGE_BSPLINE_DEGREE_MAX + 1)
-#define VTK_BSPLINE_INT_INITIALIZER { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }
 
 // kernel lookup table size must be 256*n where n is kernel half-width
 // in order to provide sufficient precision for 16-bit images
@@ -661,9 +660,7 @@ void vtkImageBSplineInterpolatorPrecomputeWeights(
         }
       else
         {
-        // initialization is needed to avoid a warning for gcc 4.9.2, but
-        // not for other compilers or for valgrind
-        int inId[VTK_BSPLINE_KERNEL_SIZE_MAX] = VTK_BSPLINE_INT_INITIALIZER;
+        int inId[VTK_BSPLINE_KERNEL_SIZE_MAX];
 
         int l = 0;
         switch (weights->BorderMode)
diff --git a/Imaging/Core/vtkImageBlend.cxx b/Imaging/Core/vtkImageBlend.cxx
index b255ca9..633c08d 100644
--- a/Imaging/Core/vtkImageBlend.cxx
+++ b/Imaging/Core/vtkImageBlend.cxx
@@ -546,9 +546,8 @@ static void vtkImageBlendCopyData(vtkImageData *inData, vtkImageData *outData,
 {
   int idxY, idxZ, maxY, maxZ;
   vtkIdType inIncX, inIncY, inIncZ;
-  vtkIdType outIncX, outIncY, outIncZ;
   int rowLength;
-  unsigned char *inPtr, *inPtr1, *outPtr,*outPtr1;
+  unsigned char *inPtr, *inPtr1, *outPtr;
 
   inPtr = static_cast<unsigned char *>(inData->GetScalarPointerForExtent(ext));
   outPtr =
@@ -556,7 +555,6 @@ static void vtkImageBlendCopyData(vtkImageData *inData, vtkImageData *outData,
 
   // Get increments to march through inData
   inData->GetIncrements(inIncX, inIncY, inIncZ);
-  outData->GetIncrements(outIncX, outIncY, outIncZ);
 
   // find the region to loop over
   rowLength = (ext[1] - ext[0]+1)*inIncX*inData->GetScalarSize();
@@ -565,18 +563,16 @@ static void vtkImageBlendCopyData(vtkImageData *inData, vtkImageData *outData,
 
   inIncY *= inData->GetScalarSize();
   inIncZ *= inData->GetScalarSize();
-  outIncY *= outData->GetScalarSize();
-  outIncZ *= outData->GetScalarSize();
+
   // Loop through outData pixels
   for (idxZ = 0; idxZ <= maxZ; idxZ++)
     {
     inPtr1 = inPtr + idxZ*inIncZ;
-    outPtr1 = outPtr + idxZ*outIncZ;
     for (idxY = 0; idxY <= maxY; idxY++)
       {
-      memcpy(outPtr1,inPtr1,rowLength);
+      memcpy(outPtr,inPtr1,rowLength);
       inPtr1 += inIncY;
-      outPtr1 += outIncY;
+      outPtr += rowLength;
       }
     }
 }
diff --git a/Imaging/Core/vtkImageInterpolator.cxx b/Imaging/Core/vtkImageInterpolator.cxx
index 7b117ce..038feb2 100644
--- a/Imaging/Core/vtkImageInterpolator.cxx
+++ b/Imaging/Core/vtkImageInterpolator.cxx
@@ -759,11 +759,9 @@ void vtkImageNLCRowInterpolate<F, T>::Tricubic(
       case 4:
         iX3 = iX[3];
         fX3 = fX[3];
-        VTK_FALLTHROUGH;
       case 3:
         iX2 = iX[2];
         fX2 = fX[2];
-        VTK_FALLTHROUGH;
       case 2:
         iX1 = iX[1];
         fX1 = fX[1];
diff --git a/Imaging/Core/vtkImageInterpolatorInternals.h b/Imaging/Core/vtkImageInterpolatorInternals.h
index 9b50b91..69b0d17 100644
--- a/Imaging/Core/vtkImageInterpolatorInternals.h
+++ b/Imaging/Core/vtkImageInterpolatorInternals.h
@@ -103,7 +103,7 @@ inline int vtkInterpolationMath::Floor(double x, F &f)
   return static_cast<int>(i - 103079215104i64);
 #else
   long long i = static_cast<long long>(x);
-  f = static_cast<F>(x - i);
+  f = x - i;
   return static_cast<int>(i - 103079215104LL);
 #endif
 #elif defined VTK_INTERPOLATE_32BIT_FLOOR
diff --git a/Imaging/Core/vtkImageMapToColors.cxx b/Imaging/Core/vtkImageMapToColors.cxx
index 8bd094b..ccbbe0c 100644
--- a/Imaging/Core/vtkImageMapToColors.cxx
+++ b/Imaging/Core/vtkImageMapToColors.cxx
@@ -260,13 +260,10 @@ static void vtkImageMapToColorsExecute(vtkImageMapToColors *self,
               {
             case 4:
               outPtr2[3] = nanColor[3];
-              VTK_FALLTHROUGH;
             case 3:
               outPtr2[2] = nanColor[2];
-              VTK_FALLTHROUGH;
             case 2:
               outPtr2[1] = nanColor[1];
-              VTK_FALLTHROUGH;
             case 1:
               outPtr2[0] = nanColor[0];
               }
diff --git a/Imaging/Core/vtkImageResize.cxx b/Imaging/Core/vtkImageResize.cxx
index 0d8fa85..3682456 100644
--- a/Imaging/Core/vtkImageResize.cxx
+++ b/Imaging/Core/vtkImageResize.cxx
@@ -602,15 +602,12 @@ void vtkImageResizeFilter3D(
 
     if (pixelCounter > 0)
       {
-      T *tmpOutPtrHead = outPtr;
       for (int idZ = idZMin; idZ <= idZMax; idZ++)
         {
         const T *tmpPtrZ = inPtr + (*aZ++);
         const vtkIdType *aYtmp = aY;
-        T *tmpOutPtrHeadZ = tmpOutPtrHead + (idZ - idZMin)*outInc[2];
         for (int idY = idYMin; idY <= idYMax; idY++)
           {
-          outPtr = tmpOutPtrHeadZ + (idY - idYMin)*outInc[1];
           const T *tmpPtrY = tmpPtrZ + (*aYtmp++);
           const vtkIdType *aXtmp = aX;
 
diff --git a/Imaging/Core/vtkImageReslice.cxx b/Imaging/Core/vtkImageReslice.cxx
index 1606270..1fb4ce4 100644
--- a/Imaging/Core/vtkImageReslice.cxx
+++ b/Imaging/Core/vtkImageReslice.cxx
@@ -584,7 +584,6 @@ int vtkImageReslice::RequestUpdateExtent(
   vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
 
   outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_EXTENT(), outExt);
-  this->HitInputExtent = 1;
 
   if (this->ResliceTransform)
     {
@@ -706,6 +705,7 @@ int vtkImageReslice::RequestUpdateExtent(
   // Clip to whole extent, make sure we hit the extent
   int wholeExtent[6];
   inInfo->Get(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT(), wholeExtent);
+  this->HitInputExtent = 1;
 
   for (int k = 0; k < 3; k++)
     {
@@ -1774,7 +1774,6 @@ void vtkGetSetPixelsFunc(
         default:
           *setpixels = 0;
         }
-      break;
     case 2:
       switch (dataType)
         {
@@ -1784,7 +1783,6 @@ void vtkGetSetPixelsFunc(
         default:
           *setpixels = 0;
         }
-      break;
     case 3:
       switch (dataType)
         {
@@ -1794,7 +1792,6 @@ void vtkGetSetPixelsFunc(
         default:
           *setpixels = 0;
         }
-      break;
     case 4:
       switch (dataType)
         {
@@ -1804,7 +1801,6 @@ void vtkGetSetPixelsFunc(
         default:
           *setpixels = 0;
         }
-      break;
     default:
       switch (dataType)
         {
diff --git a/Imaging/Core/vtkImageStencilData.cxx b/Imaging/Core/vtkImageStencilData.cxx
index 0f777c4..c2f2b4f 100644
--- a/Imaging/Core/vtkImageStencilData.cxx
+++ b/Imaging/Core/vtkImageStencilData.cxx
@@ -127,17 +127,6 @@ void vtkImageStencilData::CopyInformationFromPipeline(vtkInformation*meta_data)
 }
 
 //----------------------------------------------------------------------------
-void vtkImageStencilData::CopyInformationToPipeline(vtkInformation* info)
-{
-  // Let the superclass copy information to the pipeline
-  this->Superclass::CopyInformationToPipeline(info);
-
-  // Copy the origin and spacing to the pipeline
-  info->Set(vtkDataObject::SPACING(), this->Spacing, 3);
-  info->Set(vtkDataObject::ORIGIN(), this->Origin, 3);
-}
-
-//----------------------------------------------------------------------------
 void vtkImageStencilData::CopyOriginAndSpacingFromPipeline(
   vtkInformation* meta_data)
 {
diff --git a/Imaging/Core/vtkImageStencilData.h b/Imaging/Core/vtkImageStencilData.h
index ef7f342..3f14f31 100644
--- a/Imaging/Core/vtkImageStencilData.h
+++ b/Imaging/Core/vtkImageStencilData.h
@@ -125,7 +125,6 @@ public:
   // Override these to handle origin, spacing, scalar type, and scalar
   // number of components.  See vtkDataObject for details.
   virtual void CopyInformationFromPipeline(vtkInformation* meta_data);
-  virtual void CopyInformationToPipeline(vtkInformation* meta_data);
 
   //BTX
   // Description:
diff --git a/Imaging/Core/vtkImageStencilIterator.txx b/Imaging/Core/vtkImageStencilIterator.txx
index 2192ad5..a452e62 100644
--- a/Imaging/Core/vtkImageStencilIterator.txx
+++ b/Imaging/Core/vtkImageStencilIterator.txx
@@ -87,7 +87,6 @@ void vtkImageStencilIterator<DType>::Initialize(
   vtkIdType tmp;
   image->GetContinuousIncrements(
     extent, tmp, this->RowEndIncrement, this->SliceEndIncrement);
-  this->SliceEndIncrement = this->SliceEndIncrement + this->RowEndIncrement;
 
   this->Pointer = static_cast<DType *>(
     image->GetScalarPointerForExtent(extent));
diff --git a/Imaging/General/vtkImageMedian3D.cxx b/Imaging/General/vtkImageMedian3D.cxx
index 3e2fb8f..55a4258 100644
--- a/Imaging/General/vtkImageMedian3D.cxx
+++ b/Imaging/General/vtkImageMedian3D.cxx
@@ -23,8 +23,6 @@
 #include "vtkPointData.h"
 #include "vtkStreamingDemandDrivenPipeline.h"
 
-#include <algorithm> // for std::nth_element
-
 vtkStandardNewMacro(vtkImageMedian3D);
 
 //-----------------------------------------------------------------------------
@@ -85,22 +83,101 @@ void vtkImageMedian3D::SetKernelSize(int size0, int size1, int size2)
 namespace {
 
 //-----------------------------------------------------------------------------
-// Compute the median with std::nth_element
-template<class T>
-T vtkComputeMedianOfArray(T *aBegin, T *aEnd)
+// Add a sample to the median computation
+double *vtkImageMedian3DAccumulateMedian(int &UpNum, int &DownNum,
+                                         int &UpMax, int &DownMax,
+                                         int &NumNeighborhood,
+                                         double *Median, double val)
 {
-  T *aMid = aBegin + (aEnd - aBegin)/2;
-  std::nth_element(aBegin, aMid, aEnd);
-  T m = *aMid;
+  int idx, max;
+  double temp, *ptr;
 
-  // if even size, get max of lower part of array and compute the average
-  if (aMid - aBegin == aEnd - aMid)
+  // special case: no samples yet
+  if (UpNum == 0)
     {
-    T *lowMid = std::max_element(aBegin, aMid);
-    m = *lowMid + (m - *lowMid)/2;
+    *(Median) = val;
+    // length of up and down arrays inclusive of current
+    UpNum = DownNum = 1;
+    // median is guaranteed to be in this range (length of array)
+    DownMax = UpMax = (NumNeighborhood + 1) / 2;
+    return Median;
     }
 
-  return m;
+  // Case: value is above median
+  if (val >= *(Median))
+    {
+    // move the median if necessary
+    if (UpNum > DownNum)
+      {
+      // Move the median Up one
+      ++Median;
+      --UpNum;
+      ++DownNum;
+      --UpMax;
+      ++DownMax;
+      }
+    // find the position for val in the sorted array
+    max = (UpNum < UpMax) ? UpNum : UpMax;
+    ptr = Median;
+    idx = 0;
+    while (idx < max && val >= *ptr)
+      {
+      ++ptr;
+      ++idx;
+      }
+    // place val and move all others up
+    while (idx < max)
+      {
+      temp = *ptr;
+      *ptr = val;
+      val = temp;
+      ++ptr;
+      ++idx;
+      }
+    *ptr = val;
+    // Update counts
+    ++UpNum;
+    --DownMax;
+    return Median;
+    }
+
+  // Case: value is below median
+  // If we got here, val < *(Median)
+
+  // move the median if necessary
+  if (DownNum > UpNum)
+    {
+    // Move the median Down one
+    --Median;
+    --DownNum;
+    ++UpNum;
+    --DownMax;
+    ++UpMax;
+    }
+  // find the position for val in the sorted array
+  max = (DownNum < DownMax) ? DownNum : DownMax;
+  ptr = Median;
+  idx = 0;
+  while (idx < max && val <= *ptr)
+    {
+    --ptr;
+    ++idx;
+    }
+  // place val and move all others up
+  while (idx < max)
+    {
+    temp = *ptr;
+    *ptr = val;
+    val = temp;
+    --ptr;
+    ++idx;
+    }
+  *ptr = val;
+  // Update counts
+  ++DownNum;
+  --UpMax;
+
+  return Median;
 }
 
 } // end anonymous namespace
@@ -116,6 +193,7 @@ void vtkImageMedian3DExecute(vtkImageMedian3D *self,
                              vtkDataArray *inArray)
 {
   int *kernelMiddle, *kernelSize;
+  int NumberOfElements;
   // For looping though output (and input) pixels.
   int outIdx0, outIdx1, outIdx2;
   vtkIdType inInc0, inInc1, inInc2;
@@ -130,6 +208,12 @@ void vtkImageMedian3DExecute(vtkImageMedian3D *self,
   // The portion of the out image that needs no boundary processing.
   int middleMin0, middleMax0, middleMin1, middleMax1, middleMin2, middleMax2;
   int numComp;
+  // variables for the median calc
+  int UpNum = 0;
+  int DownNum = 0;
+  int UpMax = 0;
+  int DownMax = 0;
+  double *Median;
   int *inExt;
   unsigned long count = 0;
   unsigned long target;
@@ -139,8 +223,7 @@ void vtkImageMedian3DExecute(vtkImageMedian3D *self,
     return;
     }
 
-  // Array used to compute the median
-  T *workArray = new T[self->GetNumberOfElements()];
+  double *Sort = new double[(self->GetNumberOfElements() + 8)];
 
   // Get information to march through data
   inData->GetIncrements(inInc0, inInc1, inInc2);
@@ -182,6 +265,8 @@ void vtkImageMedian3DExecute(vtkImageMedian3D *self,
                                       (outExt[3] - outExt[2] + 1)/50.0);
   target++;
 
+  NumberOfElements = self->GetNumberOfElements();
+
   // loop through pixel of output
   inPtr = static_cast<T *>(
     inArray->GetVoidPointer((hoodMin0 - inExt[0])* inInc0 +
@@ -212,8 +297,10 @@ void vtkImageMedian3DExecute(vtkImageMedian3D *self,
         for (outIdxC = 0; outIdxC < numComp; outIdxC++)
           {
           // Compute median of neighborhood
-          T *workEnd = workArray;
-
+          // Note: For boundary, NumNeighborhood could be changed for
+          // a faster sort.
+          DownNum = UpNum = 0;
+          Median = Sort + (NumberOfElements / 2) + 4;
           // loop through neighborhood pixels
           tmpPtr2 = inPtr0 + outIdxC;
           for (hoodIdx2 = hoodMin2; hoodIdx2 <= hoodMax2; ++hoodIdx2)
@@ -225,7 +312,12 @@ void vtkImageMedian3DExecute(vtkImageMedian3D *self,
               for (hoodIdx0 = hoodMin0; hoodIdx0 <= hoodMax0; ++hoodIdx0)
                 {
                 // Add this pixel to the median
-                *workEnd++ = *tmpPtr0;
+                Median = vtkImageMedian3DAccumulateMedian(UpNum, DownNum,
+                                                          UpMax, DownMax,
+                                                          NumberOfElements,
+                                                          Median,
+                                                          double(*tmpPtr0));
+
                 tmpPtr0 += inInc0;
                 }
               tmpPtr1 += inInc1;
@@ -234,7 +326,8 @@ void vtkImageMedian3DExecute(vtkImageMedian3D *self,
             }
 
           // Replace this pixel with the hood median
-          *outPtr++ = vtkComputeMedianOfArray(workArray, workEnd);
+          *outPtr = static_cast<T>(*Median);
+          outPtr++;
           }
 
         // shift neighborhood considering boundaries
@@ -273,7 +366,7 @@ void vtkImageMedian3DExecute(vtkImageMedian3D *self,
     outPtr += outIncZ;
     }
 
-  delete [] workArray;
+  delete [] Sort;
 }
 
 //-----------------------------------------------------------------------------
diff --git a/Imaging/General/vtkImageSlabReslice.h b/Imaging/General/vtkImageSlabReslice.h
index 0e72748..3a7eb8e 100644
--- a/Imaging/General/vtkImageSlabReslice.h
+++ b/Imaging/General/vtkImageSlabReslice.h
@@ -45,6 +45,13 @@
 #include "vtkImagingGeneralModule.h" // For export macro
 #include "vtkImageReslice.h"
 
+// For backwards compatibility
+#ifndef VTK_LEGACY_REMOVE
+#define VTK_IMAGESLAB_BLEND_MIN VTK_IMAGE_SLAB_MIN
+#define VTK_IMAGESLAB_BLEND_MAX VTK_IMAGE_SLAB_MAX
+#define VTK_IMAGESLAB_BLEND_MEAN VTK_IMAGE_SLAB_MEAN
+#endif
+
 class VTKIMAGINGGENERAL_EXPORT vtkImageSlabReslice : public vtkImageReslice
 {
 public:
diff --git a/Imaging/Hybrid/CMakeLists.txt b/Imaging/Hybrid/CMakeLists.txt
index 0264795..f2bee29 100644
--- a/Imaging/Hybrid/CMakeLists.txt
+++ b/Imaging/Hybrid/CMakeLists.txt
@@ -5,7 +5,6 @@ set(Module_SRCS
   vtkSurfaceReconstructionFilter.cxx
   vtkFastSplatter.cxx
   vtkGaussianSplatter.cxx
-  vtkCheckerboardSplatter.cxx
   vtkSampleFunction.cxx
   vtkPointLoad.cxx
   vtkImageCursor3D.cxx
diff --git a/Imaging/Hybrid/Testing/Data/Baseline/TestCheckerboardSplatter.png.md5 b/Imaging/Hybrid/Testing/Data/Baseline/TestCheckerboardSplatter.png.md5
deleted file mode 100644
index 0b4a908..0000000
--- a/Imaging/Hybrid/Testing/Data/Baseline/TestCheckerboardSplatter.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-13aafba940ccd78a2b696839c58c456c
diff --git a/Imaging/Hybrid/Testing/Python/CMakeLists.txt b/Imaging/Hybrid/Testing/Python/CMakeLists.txt
index e44dc7b..48d80f4 100644
--- a/Imaging/Hybrid/Testing/Python/CMakeLists.txt
+++ b/Imaging/Hybrid/Testing/Python/CMakeLists.txt
@@ -3,5 +3,4 @@ vtk_add_test_python(
   iceCream.py
   shepards.py
   triangularTexture.py
-  TestCheckerboardSplatter.py
   )
diff --git a/Imaging/Hybrid/Testing/Python/TestCheckerboardSplatter.py b/Imaging/Hybrid/Testing/Python/TestCheckerboardSplatter.py
deleted file mode 100644
index 0d320df..0000000
--- a/Imaging/Hybrid/Testing/Python/TestCheckerboardSplatter.py
+++ /dev/null
@@ -1,71 +0,0 @@
-
-import vtk
-import vtk.test.Testing
-from vtk.util.misc import vtkGetDataRoot
-VTK_DATA_ROOT = vtkGetDataRoot()
-
-# Slat points into a cube
-math = vtk.vtkMath()
-points = vtk.vtkPoints()
-i = 0
-while i < 100000:
-    points.InsertPoint(i,math.Random(0,1),math.Random(0,1),math.Random(0,1))
-    i = i + 1
-
-profile = vtk.vtkPolyData()
-profile.SetPoints(points)
-
-# Checkerboard
-cbdSplatter = vtk.vtkCheckerboardSplatter()
-cbdSplatter.SetInputData(profile)
-cbdSplatter.SetSampleDimensions(100, 100, 100)
-cbdSplatter.ScalarWarpingOff()
-cbdSplatter.SetFootprint(2)
-cbdSplatter.SetParallelSplatCrossover(2)
-#cbdSplatter.SetRadius(0.05)
-
-cbdSurface = vtk.vtkMarchingContourFilter()
-cbdSurface.SetInputConnection(cbdSplatter.GetOutputPort())
-cbdSurface.SetValue(0, 0.01)
-
-cbdMapper = vtk.vtkPolyDataMapper()
-cbdMapper.SetInputConnection(cbdSurface.GetOutputPort())
-cbdMapper.ScalarVisibilityOff()
-
-cbdActor = vtk.vtkActor()
-cbdActor.SetMapper(cbdMapper)
-cbdActor.GetProperty().SetColor(1.0, 0.0, 0.0)
-
-timer = vtk.vtkExecutionTimer()
-timer.SetFilter(cbdSplatter)
-cbdSplatter.Update()
-CBDwallClock = timer.GetElapsedWallClockTime()
-#print ("CBDSplat:", CBDwallClock)
-
-# Graphics stuff
-#
-ren = vtk.vtkRenderer()
-renWin = vtk.vtkRenderWindow()
-renWin.AddRenderer(ren)
-
-camera = vtk.vtkCamera()
-camera.SetFocalPoint(0,0,0)
-camera.SetPosition(1,1,1)
-ren.SetActiveCamera(camera)
-
-# Add the actors to the renderer, set the background and size
-#
-ren.AddActor(cbdActor)
-ren.SetBackground(1, 1, 1)
-renWin.SetSize(400, 400)
-ren.ResetCamera()
-
-# render and interact with data
-iRen = vtk.vtkRenderWindowInteractor()
-iRen.SetRenderWindow(renWin);
-renWin.Render()
-
-#iRen.Start()
-
-# prevent the tk window from showing up then start the event loop
-# --- end of script --
diff --git a/Imaging/Hybrid/vtkCheckerboardSplatter.cxx b/Imaging/Hybrid/vtkCheckerboardSplatter.cxx
deleted file mode 100644
index da2323d..0000000
--- a/Imaging/Hybrid/vtkCheckerboardSplatter.cxx
+++ /dev/null
@@ -1,929 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkCheckerboardSplatter.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 "vtkCheckerboardSplatter.h"
-
-#include "vtkCompositeDataIterator.h"
-#include "vtkCompositeDataSet.h"
-#include "vtkDoubleArray.h"
-#include "vtkImageData.h"
-#include "vtkInformation.h"
-#include "vtkInformationVector.h"
-#include "vtkMultiBlockDataSet.h"
-#include "vtkNew.h"
-#include "vtkObjectFactory.h"
-#include "vtkStreamingDemandDrivenPipeline.h"
-#include "vtkPointData.h"
-#include "vtkPointSet.h"
-#include "vtkSMPTools.h"
-
-#include <algorithm>
-#include <math.h>
-
-#undef VTK_USE_RAW_TBB
-#ifdef VTK_USE_RAW_TBB
-#include "tbb/parallel_sort.h"
-using namespace tbb;
-#endif
-
-vtkStandardNewMacro(vtkCheckerboardSplatter);
-
-//----------------------------------------------------------------------------
-// Algorithm and integration with vtkSMPTools
-template <typename TPoints, typename TScalars>
-class vtkCheckerboardSplatterAlgorithm
-{
-public:
-  // Pointers to functions which are selected based on user input
-  double (vtkCheckerboardSplatterAlgorithm::*Sample)(
-    vtkIdType ptId, double x[3], double p[3]);
-  double (vtkCheckerboardSplatterAlgorithm::*SampleFactor)(vtkIdType ptId);
-
-  // Information from the VTK class
-  vtkCheckerboardSplatter *Splatter;
-  vtkIdType NPts;
-  TPoints  *Pts;
-  TScalars *Scalars;
-  vtkDataArray  *InScalars, *InNormals;
-  vtkIdType Dims[3], SliceSize;
-  double *Origin, *Spacing;
-  double R2, E2; //radius squared, eccentricity squared
-  double ExponentFactor; //scale the gaussian exponent
-  double ScaleFactor; //scale the gaussian
-  int AccumulationMode; // how to combine scalar values
-  TScalars InitialValue; // initial value of scalars before splatting
-  int ParallelSplatCrossover; //at which point to parallelize splatting
-
-  // Points are grouped according to their checkerboard square address
-  struct SortedPoints
-  {
-    vtkIdType PtId;
-    vtkIdType Addr;
-    //Operator< used to support sorting operation.
-    bool operator<(const SortedPoints& spts) const
-      {return Addr < spts.Addr;}
-  };
-  SortedPoints *SPts; //sorted points array
-
-  // Checkerboard squares refer to the points inside of them.
-  struct Squares
-  {
-    vtkIdType NPts; //the number of points in this square
-    vtkIdType Pts;  //the list of points in this square
-    Squares():NPts(0),Pts(0) {}
-  };
-  Squares *CBoard; // the actual 3D checkerboard
-
-  // Checkerboard information: number and spacing of squares in
-  // each direction.
-  vtkIdType CBWidth, CBDims[3]; //checkerboard information
-  double CBOrigin[3], CBSpacing[3];
-  int Footprint; //the footprint radius of a splat measured in voxels
-  unsigned char MaxDim; //max number of squares in any of the i-j-k dirs
-  vtkIdType BDims[3], BSliceSize; //8-way checkerboard blocks/groups
-
-  // The addresses of the eight colors / groups. The ninth value is
-  // added to simplify looping later on. Note that this can be thought of
-  // as eight separate volumes, one for each checkerboard square color.
-  vtkIdType NSquares; //number of squares of a particular color, 8 colors total
-  vtkIdType Offsets[9];
-
-  // Construct the algorithm; initialize key data members.
-  vtkCheckerboardSplatterAlgorithm() {}
-
-  // Integration between VTK and templated algorithm
-  static void SplatPoints(vtkCheckerboardSplatter *self, vtkIdType npts,
-                          TPoints *points, vtkDataArray *inScalars,
-                          vtkDataArray *inNormals, vtkImageData *output,
-                          int extent[6], TScalars *scalars);
-
-  // Various sampling functions centered around point p. These returns a
-  // distance value (depending on eccentricity). Eccentric splats are available
-  // when normals are available, and NormalWarping is enabled.
-  double Gaussian (vtkIdType, double x[3], double p[3])
-    {
-      return ((x[0]-p[0])*(x[0]-p[0]) + (x[1]-p[1])*(x[1]-p[1]) +
-            (x[2]-p[2])*(x[2]-p[2]) );
-    }
-  double EccentricGaussian (vtkIdType ptId, double x[3], double p[3])
-    {
-      double   v[3], r2, z2, rxy2, mag, n[3];
-      this->InNormals->GetTuple(ptId,n);
-
-      v[0] = x[0] - p[0];
-      v[1] = x[1] - p[1];
-      v[2] = x[2] - p[2];
-      r2 = v[0]*v[0] + v[1]*v[1] + v[2]*v[2];
-
-      if ( (mag=n[0]*n[0] + n[1]*n[1] + n[2]*n[2]) != 1.0  )
-        {
-        mag = (mag == 0.0 ? 1.0 : sqrt(mag));
-        }
-
-      z2 = (v[0]*n[0] + v[1]*n[1] + v[2]*n[2])/mag;
-      z2 = z2*z2;
-      rxy2 = r2 - z2;
-
-      return (rxy2/this->E2 + z2);
-    }
-
-  // Different ways of affecting scale from scalar value. The scalar value is
-  // used when scalars are available and ScalarWarping is enabled.
-  double ScalarSampling(vtkIdType ptId)
-    {
-      return this->ScaleFactor * this->InScalars->GetComponent(ptId,0);
-    }
-  double PositionSampling(vtkIdType)
-    {return this->ScaleFactor;}
-
-  // Assign membership of points to checkerboard squares
-  template <typename TTPoints> class AssignSquares
-  {
-  public:
-    vtkCheckerboardSplatterAlgorithm *Algo;
-    AssignSquares(vtkCheckerboardSplatterAlgorithm *algo)
-      {this->Algo = algo;}
-    void  operator()(vtkIdType ptId, vtkIdType end)
-      {
-        vtkIdType addr;
-        unsigned char i, j, k, oct;
-        TPoints *x;
-        for ( ; ptId < end; ++ptId )
-          {
-          // First, map the point prior to sorting
-          this->Algo->SPts[ptId].PtId = ptId;
-
-          // Determine the square that the point is in
-          x = this->Algo->Pts + 3*ptId;
-          i = static_cast<unsigned char>(
-            (x[0] - this->Algo->CBOrigin[0]) / this->Algo->CBSpacing[0]);
-          j = static_cast<unsigned char>(
-            (x[1] - this->Algo->CBOrigin[1]) / this->Algo->CBSpacing[1]);
-          k = static_cast<unsigned char>(
-            (x[2] - this->Algo->CBOrigin[2]) / this->Algo->CBSpacing[2]);
-          oct = (i%2) | ((j%2)<<1) | ((k%2)<<2);
-
-          // Compute the address based on the particular color / block
-          addr = this->Algo->Offsets[oct] + (i/2) +
-            (j/2)*this->Algo->BDims[0] + (k/2)*this->Algo->BSliceSize;
-          this->Algo->SPts[ptId].Addr = addr;
-          }//over all points in given range
-      }
-  };
-
-  // Process all points in given range of checkerboard squares
-  template <typename TTPoints> class SplatSquares
-  {
-  public:
-    vtkCheckerboardSplatterAlgorithm *Algo;
-    SplatSquares(vtkCheckerboardSplatterAlgorithm *algo)
-      {this->Algo = algo;}
-    void  operator()(vtkIdType sqNum, vtkIdType end)
-      {
-        vtkIdType npts, pts;
-        for ( ; sqNum < end; ++sqNum )
-          {
-          if (this->Algo->CBoard[sqNum].NPts > 0)
-            {
-            npts = this->Algo->CBoard[sqNum].NPts;
-            pts = this->Algo->CBoard[sqNum].Pts;
-            for (int i=0; i<npts; ++i)
-              {
-              this->Algo->SplatPoint(this->Algo->SPts[pts+i].PtId);
-              }
-            }
-          }
-      }
-  };
-
-  // Do the actual work of splatting the point
-  void SplatPoint(vtkIdType ptId);
-  template <typename TTPoints> class Splat
-  {
-  public:
-    vtkCheckerboardSplatterAlgorithm *Algo;
-    vtkIdType XMin, XMax, YMin, YMax, PtId;
-    double PD[3];
-    Splat(vtkCheckerboardSplatterAlgorithm *algo)
-      {this->Algo = algo;}
-    void SetSliceBounds(vtkIdType min[3], vtkIdType max[3])
-      {
-        this->XMin = min[0]; this->XMax = max[0];
-        this->YMin = min[1]; this->YMax = max[1];
-      }
-    void SetSplatPoint(vtkIdType ptId, TTPoints p[3])
-      {
-        this->PtId = ptId;
-        this->PD[0] = static_cast<double>(p[0]);
-        this->PD[1] = static_cast<double>(p[1]);
-        this->PD[2] = static_cast<double>(p[2]);
-      }
-    void  operator()(vtkIdType slice, vtkIdType end)
-      {
-      vtkIdType i, j, jOffset, kOffset, idx;
-      double x[3];
-      for ( ; slice < end; ++slice )
-        {
-        // Loop over all sample points in volume within footprint and
-        // evaluate the splat
-        x[2] = this->Algo->Origin[2] + this->Algo->Spacing[2]*slice;
-        kOffset = slice*this->Algo->SliceSize;
-        for (j=YMin; j<=YMax; ++j)
-          {
-          x[1] = this->Algo->Origin[1] + this->Algo->Spacing[1]*j;
-          jOffset = j*this->Algo->Dims[0];
-          for (i=XMin; i<=XMax; ++i)
-            {
-            x[0] = this->Algo->Origin[0] + this->Algo->Spacing[0]*i;
-            idx = i + jOffset + kOffset;
-            this->Algo->SetScalar(this->PtId, this->PD, x,
-                                  this->Algo->Scalars+idx);
-            }//i
-          }//j
-        }//k within splat footprint
-      }
-  };
-
-  // Accumlate scalar values as appropriate
-  void SetScalar(vtkIdType ptId, double pd[3], double x[3], TScalars *sPtr)
-  {
-    double dist2 = (this->*Sample)(ptId,x,pd);
-    double v = (this->*SampleFactor)(ptId) * exp(static_cast<double>
-      (this->ExponentFactor*(dist2)/(this->R2)));
-
-    TScalars Tv = static_cast<TScalars>(v);
-    switch (this->AccumulationMode)
-      {
-      case VTK_ACCUMULATION_MODE_MIN:
-        if ( Tv < *sPtr )
-          {
-          *sPtr = Tv;
-          }
-        break;
-      case VTK_ACCUMULATION_MODE_MAX:
-        if ( Tv > *sPtr )
-          {
-          *sPtr = Tv;
-          }
-        break;
-      case VTK_ACCUMULATION_MODE_SUM:
-        *sPtr += Tv;
-        break;
-      }
-  }
-
-  // Cap the boundary if requested.
-  void Cap(TScalars *s, TScalars capValue);
-};
-
-//----------------------------------------------------------------------------
-// This is where the work is actually done and the points are splatted. Note
-// that splatting is only parallelized when the splat footprint is large
-// enough (to avoid multithreading overhead).
-template <typename TPoints, typename TScalars>
-void vtkCheckerboardSplatterAlgorithm<TPoints,TScalars>::
-SplatPoint(vtkIdType ptId)
-{
-  // Configure the parallel splat
-  Splat<TPoints> splat(this);
-  TPoints *p = this->Pts + 3*ptId;
-  splat.SetSplatPoint(ptId,p); //casts the point into double precision
-
-  // Determine which voxel the point lies in
-  vtkIdType loc[3], min[3], max[3];
-  loc[0] = (p[0]-this->Origin[0]) / this->Spacing[0];
-  loc[1] = (p[1]-this->Origin[1]) / this->Spacing[1];
-  loc[2] = (p[2]-this->Origin[2]) / this->Spacing[2];
-
-  // Determine the splat footprint
-  vtkIdType i;
-  for (i=0; i<3; i++)
-    {
-    min[i] = static_cast<vtkIdType>(floor(static_cast<double>(loc[i]) -
-                                          this->Footprint));
-    max[i] = static_cast<vtkIdType>(ceil(static_cast<double>(loc[i]) +
-                                         this->Footprint));
-    if ( min[i] < 0 )
-      {
-      min[i] = 0;
-      }
-    if ( max[i] >= this->Dims[i] )
-      {
-      max[i] = this->Dims[i] - 1;
-      }
-    }
-
-  // The parallel splat across the splat footprint. If the footprint is too
-  // small then use serial processing to avoid thread inefficiency. Note that
-  // empirically the crossover point seems to be a footprint=1 (e.g., 3x3x3
-  // splat footprint and smaller is processed in serial).
-  splat.SetSliceBounds(min,max);
-  if ( this->Footprint < this->ParallelSplatCrossover )
-    {
-    splat(min[2],max[2]+1);
-    }
-  else
-    {//parallelize splat
-    vtkSMPTools::For(min[2],max[2]+1, splat);
-    }
-}
-
-//----------------------------------------------------------------------------
-// Cap the boundaries with a specific value (the capValue).
-template <typename TPoints, typename TScalars>
-void vtkCheckerboardSplatterAlgorithm<TPoints,TScalars>::
-Cap(TScalars *s, TScalars capValue)
-{
-  vtkIdType i, j, k, jOffset, kOffset;
-
-  // i-j planes
-  //k = 0;
-  for (j=0; j<this->Dims[1]; j++)
-    {
-    jOffset = j*this->Dims[0];
-    for (i=0; i<this->Dims[0]; i++)
-      {
-      s[i+jOffset] = capValue;
-      }
-    }
-  kOffset = (this->Dims[2] - 1) * this->SliceSize;
-  for (j=0; j<this->Dims[1]; j++)
-    {
-    jOffset = j*this->Dims[0];
-    for (i=0; i<this->Dims[0]; i++)
-      {
-      s[i+jOffset+kOffset] = capValue;
-      }
-    }
-
-  // j-k planes
-  //i = 0;
-  for (k=0; k<this->Dims[2]; k++)
-    {
-    kOffset = k*this->SliceSize;
-    for (j=0; j<this->Dims[1]; j++)
-      {
-      s[j*this->Dims[0]+kOffset] = capValue;
-      }
-    }
-  i = this->Dims[0] - 1;
-  for (k=0; k<this->Dims[2]; k++)
-    {
-    kOffset = k*this->SliceSize;
-    for (j=0; j<this->Dims[1]; j++)
-      {
-      s[i+j*this->Dims[0]+kOffset] = capValue;
-      }
-    }
-
-  // i-k planes
-  //j = 0;
-  for (k=0; k<this->Dims[2]; k++)
-    {
-    kOffset = k*this->SliceSize;
-    for (i=0; i<this->Dims[0]; i++)
-      {
-      s[i+kOffset] = capValue;
-      }
-    }
-  jOffset = (this->Dims[1] - 1) * this->Dims[0];
-  for (k=0; k<this->Dims[2]; k++)
-    {
-    kOffset = k*this->SliceSize;
-    for (i=0; i<this->Dims[0]; i++)
-      {
-      s[i+jOffset+kOffset] = capValue;
-      }
-    }
-}
-
-//----------------------------------------------------------------------------
-// The algorithm driver method.
-template <typename TPoints, typename TScalars>
-void vtkCheckerboardSplatterAlgorithm<TPoints,TScalars>::
-SplatPoints(vtkCheckerboardSplatter *self, vtkIdType npts, TPoints *pts,
-            vtkDataArray *inScalars, vtkDataArray *inNormals,
-            vtkImageData *output, int extent[6], TScalars *scalars)
-{
-  int i;
-
-  // Populate the algorithm with relevant information from the VTK class
-  vtkCheckerboardSplatterAlgorithm<TPoints,TScalars> algo;
-  algo.Splatter = self;
-  algo.NPts = npts;
-  algo.Pts = pts;
-  algo.Scalars = scalars;
-  algo.InScalars = inScalars;
-  algo.InNormals = inNormals;
-  algo.Origin = output->GetOrigin();
-  algo.Spacing = output->GetSpacing();
-  for (i=0; i<3; ++i) //dimensions expressed in voxel cells
-    {
-    algo.Dims[i] = extent[2*i+1] - extent[2*i] + 1;
-    }
-  algo.SliceSize = algo.Dims[0]*algo.Dims[1];
-
-  if ( self->GetRadius() <= 0.0 )
-    {
-    algo.R2 = algo.Spacing[0]*algo.Spacing[0] +
-      algo.Spacing[1]*algo.Spacing[1] +
-      algo.Spacing[2]*algo.Spacing[2];
-    }
-  else
-    {
-    algo.R2 = self->GetRadius()*self->GetRadius();
-    }
-  algo.E2 = self->GetEccentricity()*self->GetEccentricity();
-  algo.ScaleFactor = self->GetScaleFactor();
-  algo.ExponentFactor = self->GetExponentFactor();
-  algo.AccumulationMode = self->GetAccumulationMode();
-  algo.InitialValue = static_cast<TScalars>(self->GetNullValue());
-  algo.ParallelSplatCrossover = self->GetParallelSplatCrossover();
-
-  //  Set up function pointers to sample functions
-  if ( self->GetNormalWarping() && (algo.InNormals != NULL) )
-    {
-    algo.Sample = &vtkCheckerboardSplatterAlgorithm::EccentricGaussian;
-    }
-  else
-    {
-    algo.Sample = &vtkCheckerboardSplatterAlgorithm::Gaussian;
-    }
-
-  if ( self->GetScalarWarping() && algo.InScalars != NULL )
-    {
-    algo.SampleFactor = &vtkCheckerboardSplatterAlgorithm::ScalarSampling;
-    }
-  else
-    {
-    algo.SampleFactor = &vtkCheckerboardSplatterAlgorithm::PositionSampling;
-    }
-
-  // Okay now setup the checkerboard. It overlays the volume (note that some
-  // of the checkerboard squares will be empty, and/or partially cover the
-  // volume). Rectangular groups of 8 checkerboard squares are arranged into
-  // blocks (like an octree) corresponding to the eight square colors. These
-  // eight colors (or groups) are processed in parallel, Note that the splat
-  // footprint is carefully designed to avoid write contention during
-  // parallel splatting, thus the width of each checkerboard square is a
-  // function of the splat footprint.
-  algo.MaxDim = self->GetMaximumDimension();
-  algo.Footprint = self->GetFootprint();
-  algo.CBWidth = 2*algo.Footprint + 1;
-
-  // Set up dimensions for the checkerboard and the grouping block
-  // structure. Ensure that the checkerboard dimensions are evenly divisible
-  // by two.
-  for (i=0; i<3; ++i)
-    {
-    algo.CBDims[i] = static_cast<vtkIdType>( ceil(
-      static_cast<double>(algo.Dims[i]-1) / static_cast<double>(algo.CBWidth) ));
-    algo.CBDims[i] = (algo.CBDims[i] > algo.MaxDim ?
-                      algo.MaxDim : algo.CBDims[i]);
-    algo.CBDims[i] = ((algo.CBDims[i] % 2) ? algo.CBDims[i]+1 : algo.CBDims[i]);
-    algo.CBOrigin[i] = algo.Origin[i];
-    algo.CBSpacing[i] = algo.CBWidth * algo.Spacing[i];
-    algo.BDims[i] = algo.CBDims[i] / 2;
-    }
-  algo.BSliceSize = algo.BDims[0] * algo.BDims[1];
-
-  // The NSquares is the number of squares of a given color (there are eight
-  // total colors / groups). Because the checkerboard dimensions are a
-  // multiple of two, the total number of all colors of squares is divisible
-  // by 8. Also set up offsets for each color / group which is used in
-  // determing addresses and later processing.
-  algo.NSquares = algo.BDims[0]*algo.BDims[1]*algo.BDims[2];
-  for (i=0; i<9; ++i)
-    {
-    algo.Offsets[i] = i*algo.NSquares;
-    }
-
-  // The checkerboard tracks (npts,pts) for each square, where npts is the
-  // number of points in each square, and pts is a location into the sorted
-  // points array.
-  algo.CBoard = new Squares [algo.NSquares*8];
-
-  // The sorted points array contains the offset into the original points array
-  // and a checkerboard address.
-  algo.SPts = new SortedPoints [algo.NPts];
-
-  // Loop over all points, computing address into checkerboard. This consists
-  // of (octNum,i,j,k) where the checkerboard square number is a value
-  // (0<=octNum<8) indicating which of the eight octants/squares the point
-  // belongs to (i.e., each point is associated with one of eight spatially
-  // distinct groups). The (i,j,k) indicate which checkerboard square the
-  // point is contained.
-  AssignSquares<TPoints> assign(&algo);
-  vtkSMPTools::For(0,npts, assign);
-
-  // Now sort points based on checkerboard address. This will separate
-  // points into squares which will be processed in parallel. At some point
-  // in the future this should be parallelized.
-#ifdef VTK_USE_RAW_TBB
-  parallel_sort(algo.SPts, algo.SPts+npts); //I'm seeing about 10% improvement
-#else
-  std::sort(algo.SPts, algo.SPts+npts);
-#endif
-
-  // Okay now run through the sorted points and build pointers to
-  // each checkerboard square (and associated points, if any). This could be
-  // parallelized but it may not be worth it.
-  vtkIdType currentAddr, pStart, pEnd=0;
-  while ( pEnd < npts )
-    {
-    currentAddr = algo.SPts[pEnd].Addr;
-    pStart = pEnd;
-    while ( currentAddr == algo.SPts[pEnd].Addr && pEnd < npts )
-      {
-      pEnd++;
-      }
-    algo.CBoard[currentAddr].NPts = pEnd - pStart;
-    algo.CBoard[currentAddr].Pts = pStart;
-    }
-
-  // Finally we can process the 8-way checkerboard, where we process in
-  // parallel all squares in a particular color/group. Need to initialize the
-  // output with the fill operation.
-  std::fill_n(scalars, algo.Dims[0]*algo.Dims[1]*algo.Dims[2], algo.InitialValue);
-  SplatSquares<TPoints> splatSquares(&algo);
-  for (i=0; i < 8; ++i) //loop over all eight checkerboard colors
-    {
-    vtkSMPTools::For(algo.Offsets[i], algo.Offsets[i+1], splatSquares);
-    }
-
-  // Cap the boundary if requested
-  if ( self->GetCapping() )
-    {
-    algo.Cap(algo.Scalars,static_cast<TScalars>(self->GetCapValue()));
-    }
-
-  // Free up memory
-  delete [] algo.CBoard;
-  delete [] algo.SPts;
-}
-
-
-//----------------------------------------------------------------------------
-// Create the VTK class proper.  Construct object with dimensions=(50,50,50);
-// automatic computation of bounds; a splat radius of 0.1; an exponent factor
-// of -5; and normal and scalar warping turned on.
-vtkCheckerboardSplatter::vtkCheckerboardSplatter()
-{
-  this->OutputScalarType = VTK_FLOAT;
-
-  this->SampleDimensions[0] = 50;
-  this->SampleDimensions[1] = 50;
-  this->SampleDimensions[2] = 50;
-
-  this->Footprint = 2;
-  this->Radius = 0.0; //automatically compute
-  this->ExponentFactor = -5.0;
-
-  this->ModelBounds[0] = 0.0;
-  this->ModelBounds[1] = 0.0;
-  this->ModelBounds[2] = 0.0;
-  this->ModelBounds[3] = 0.0;
-  this->ModelBounds[4] = 0.0;
-  this->ModelBounds[5] = 0.0;
-
-  this->NormalWarping = 1;
-  this->Eccentricity = 2.5;
-
-  this->ScalarWarping = 1;
-  this->ScaleFactor = 1.0;
-
-  this->Capping = 1;
-  this->CapValue = 0.0;
-
-  this->AccumulationMode = VTK_ACCUMULATION_MODE_MAX;
-  this->NullValue = 0.0;
-
-  this->MaximumDimension = 50;
-
-  this->ParallelSplatCrossover = 2;
-}
-
-//----------------------------------------------------------------------------
-int vtkCheckerboardSplatter::FillInputPortInformation(
-  int vtkNotUsed(port), vtkInformation* info)
-{
-  info->Set(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "vtkPointSet");
-  return 1;
-}
-
-//----------------------------------------------------------------------------
-int vtkCheckerboardSplatter::RequestInformation (
-  vtkInformation * vtkNotUsed(request),
-  vtkInformationVector ** vtkNotUsed( inputVector ),
-  vtkInformationVector *outputVector)
-{
-  // get the info objects
-  vtkInformation* outInfo = outputVector->GetInformationObject(0);
-
-  // use model bounds if set
-  this->Origin[0] = 0;
-  this->Origin[1] = 0;
-  this->Origin[2] = 0;
-  if ( this->ModelBounds[0] < this->ModelBounds[1] &&
-       this->ModelBounds[2] < this->ModelBounds[3] &&
-       this->ModelBounds[4] < this->ModelBounds[5] )
-    {
-    this->Origin[0] = this->ModelBounds[0];
-    this->Origin[1] = this->ModelBounds[2];
-    this->Origin[2] = this->ModelBounds[4];
-    }
-
-  outInfo->Set(vtkDataObject::ORIGIN(), this->Origin, 3);
-
-  int i;
-  for (i=0; i<3; i++)
-    {
-    this->Spacing[i] = (this->ModelBounds[2*i+1] - this->ModelBounds[2*i])
-      / (this->SampleDimensions[i] - 1);
-    if ( this->Spacing[i] <= 0.0 )
-      {
-      this->Spacing[i] = 1.0;
-      }
-    }
-  outInfo->Set(vtkDataObject::SPACING(),this->Spacing,3);
-
-  outInfo->Set(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT(),
-               0, this->SampleDimensions[0] - 1,
-               0, this->SampleDimensions[1] - 1,
-               0, this->SampleDimensions[2] - 1);
-  vtkDataObject::
-    SetPointDataActiveScalarInfo(outInfo, this->OutputScalarType, 1);
-
-  return 1;
-}
-
-//----------------------------------------------------------------------------
-int vtkCheckerboardSplatter::RequestData(
-  vtkInformation* vtkNotUsed( request ),
-  vtkInformationVector** inputVector,
-  vtkInformationVector* outputVector)
-{
-  // get the data object
-  vtkInformation *outInfo = outputVector->GetInformationObject(0);
-  vtkImageData *output = vtkImageData::GetData(outputVector,0);
-
-  vtkPointSet *input = vtkPointSet::GetData(inputVector[0]);
-  vtkPoints *points = input->GetPoints();
-
-  output->SetExtent(
-    outInfo->Get(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT()));
-  output->AllocateScalars(outInfo);
-  int* extent =
-    this->GetExecutive()->GetOutputInformation(0)->Get(
-      vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT());
-  vtkDataArray *outScalars = output->GetPointData()->GetScalars();
-
-  // Configure the output
-  output->SetDimensions(this->GetSampleDimensions());
-  this->ComputeModelBounds(input, output, outInfo);
-
-  //  Make sure points are available
-  vtkIdType npts = input->GetNumberOfPoints();
-  if ( npts == 0 )
-    {
-    vtkDebugMacro(<<"No points to splat!");
-    vtkWarningMacro(<<"No POINTS to splat!!");
-    return 1;
-    }
-  else
-    {
-    vtkDebugMacro(<< "Splatting data, total of: " << npts << " points.");
-    }
-
-  // Grab relevant attribute data
-  vtkDataArray *inScalars = input->GetPointData()->GetScalars();
-  vtkDataArray *inNormals = input->GetPointData()->GetNormals();
-
-  // Okay actually execute the algorithm. Manage all the crazy template
-  // stuff. Note that the output types are currently limitied to
-  // (float,double) to manage precision. The point type is also limited
-  // to real types but could be easily extended to other types.
-  void *ptsPtr = points->GetVoidPointer(0);
-  void *scalarPtr = output->GetArrayPointerForExtent(outScalars, extent);
-
-  if ( this->OutputScalarType == VTK_FLOAT )
-    {
-    switch (points->GetDataType())
-      {
-      case VTK_DOUBLE:
-        vtkCheckerboardSplatterAlgorithm<double,float>::
-          SplatPoints(this, npts, static_cast<double*>(ptsPtr), inScalars, inNormals,
-                      output, extent, static_cast<float*>(scalarPtr));
-        break;
-      case VTK_FLOAT:
-        vtkCheckerboardSplatterAlgorithm<float,float>::
-          SplatPoints(this, npts, static_cast<float*>(ptsPtr), inScalars, inNormals,
-                      output, extent, static_cast<float*>(scalarPtr));
-        break;
-      default:
-        vtkWarningMacro(<<"Undefined input point type");
-      }
-    }
-  else if ( this->OutputScalarType == VTK_DOUBLE )
-    {
-    switch (points->GetDataType())
-      {
-      case VTK_DOUBLE:
-        vtkCheckerboardSplatterAlgorithm<double,double>::
-          SplatPoints(this, npts, static_cast<double*>(ptsPtr), inScalars, inNormals,
-                      output, extent, static_cast<double*>(scalarPtr));
-        break;
-      case VTK_FLOAT:
-        vtkCheckerboardSplatterAlgorithm<float,double>::
-          SplatPoints(this, npts, static_cast<float*>(ptsPtr), inScalars, inNormals,
-                      output, extent, static_cast<double*>(scalarPtr));
-        break;
-      default:
-        vtkWarningMacro(<<"Undefined input point type");
-      }
-    }
-  else //warning output type not supported
-    {
-    vtkWarningMacro(<<"Only FLOAT or DOUBLE output scalar type is supported");
-    }
-
-  return 1;
-}
-
-//----------------------------------------------------------------------------
-// Compute the size of the sample bounding box automatically from the
-// input data.
-void vtkCheckerboardSplatter::ComputeModelBounds(vtkDataSet *input,
-                                                 vtkImageData *output,
-                                                 vtkInformation *outInfo)
-{
-  double *bounds;
-  int i, adjustBounds=0;
-
-  // compute model bounds if not set previously
-  if ( this->ModelBounds[0] >= this->ModelBounds[1] ||
-       this->ModelBounds[2] >= this->ModelBounds[3] ||
-       this->ModelBounds[4] >= this->ModelBounds[5] )
-    {
-    adjustBounds = 1;
-    bounds = input->GetBounds();
-    }
-  else
-    {
-    bounds = this->ModelBounds;
-    }
-
-  // Adjust bounds so model fits strictly inside (only if not set previously)
-  if ( adjustBounds )
-    {
-    for (i=0; i<3; i++)
-      {
-      this->ModelBounds[2*i] = bounds[2*i];
-      this->ModelBounds[2*i+1] = bounds[2*i+1];
-      }
-    }
-
-  // Set volume origin and data spacing
-  outInfo->Set(vtkDataObject::ORIGIN(),
-               this->ModelBounds[0],this->ModelBounds[2],
-               this->ModelBounds[4]);
-  memcpy(this->Origin,outInfo->Get(vtkDataObject::ORIGIN()), sizeof(double)*3);
-  output->SetOrigin(this->Origin);
-
-  for (i=0; i<3; i++)
-    {
-    this->Spacing[i] = (this->ModelBounds[2*i+1] - this->ModelBounds[2*i])
-      / (this->SampleDimensions[i] - 1);
-    if ( this->Spacing[i] <= 0.0 )
-      {
-      this->Spacing[i] = 1.0;
-      }
-    }
-  outInfo->Set(vtkDataObject::SPACING(),this->Spacing,3);
-  output->SetSpacing(this->Spacing);
-}
-
-//----------------------------------------------------------------------------
-// Set the dimensions of the sampling structured point set.
-void vtkCheckerboardSplatter::SetSampleDimensions(int i, int j, int k)
-{
-  int dim[3];
-
-  dim[0] = i;
-  dim[1] = j;
-  dim[2] = k;
-
-  this->SetSampleDimensions(dim);
-}
-
-//----------------------------------------------------------------------------
-void vtkCheckerboardSplatter::SetSampleDimensions(int dim[3])
-{
-  int dataDim, i;
-
-  vtkDebugMacro(<< " setting SampleDimensions to (" << dim[0] << ","
-                << dim[1] << "," << dim[2] << ")");
-
-  if (dim[0] != this->SampleDimensions[0] ||
-      dim[1] != this->SampleDimensions[1] ||
-      dim[2] != this->SampleDimensions[2] )
-    {
-    if ( dim[0]<1 || dim[1]<1 || dim[2]<1 )
-      {
-      vtkErrorMacro (<< "Bad Sample Dimensions, retaining previous values");
-      return;
-      }
-
-    for (dataDim=0, i=0; i<3 ; i++)
-      {
-      if (dim[i] > 1)
-        {
-        dataDim++;
-        }
-      }
-
-    if ( dataDim  < 3 )
-      {
-      vtkErrorMacro(<<"Sample dimensions must define a volume!");
-      return;
-      }
-
-    for ( i=0; i<3; i++)
-      {
-      this->SampleDimensions[i] = dim[i];
-      }
-
-    this->Modified();
-    }
-}
-
-//----------------------------------------------------------------------------
-const char *vtkCheckerboardSplatter::GetAccumulationModeAsString()
-{
-  if ( this->AccumulationMode == VTK_ACCUMULATION_MODE_MIN )
-    {
-    return "Minimum";
-    }
-  else if ( this->AccumulationMode == VTK_ACCUMULATION_MODE_MAX )
-    {
-    return "Maximum";
-    }
-  else //if ( this->AccumulationMode == VTK_ACCUMULATION_MODE_SUM )
-    {
-    return "Sum";
-    }
-}
-
-//----------------------------------------------------------------------------
-void vtkCheckerboardSplatter::PrintSelf(ostream& os, vtkIndent indent)
-{
-  this->Superclass::PrintSelf(os,indent);
-
-  os << indent << "Sample Dimensions: ("
-               << this->SampleDimensions[0] << ", "
-               << this->SampleDimensions[1] << ", "
-               << this->SampleDimensions[2] << ")\n";
-
-  os << indent << "Footprint: " << this->Footprint << "\n";
-  os << indent << "Radius: " << this->Radius << "\n";
-  os << indent << "Exponent Factor: " << this->ExponentFactor << "\n";
-
-  os << indent << "ModelBounds: \n";
-  os << indent << "  Xmin,Xmax: (" << this->ModelBounds[0]
-     << ", " << this->ModelBounds[1] << ")\n";
-  os << indent << "  Ymin,Ymax: (" << this->ModelBounds[2]
-     << ", " << this->ModelBounds[3] << ")\n";
-  os << indent << "  Zmin,Zmax: (" << this->ModelBounds[4]
-     << ", " << this->ModelBounds[5] << ")\n";
-
-  os << indent << "Scalar Warping: "
-     << (this->ScalarWarping ? "On\n" : "Off\n");
-  os << indent << "Scale Factor: " << this->ScaleFactor << "\n";
-
-  os << indent << "Normal Warping: "
-     << (this->NormalWarping ? "On\n" : "Off\n");
-  os << indent << "Eccentricity: " << this->Eccentricity << "\n";
-
-  os << indent << "Capping: " << (this->Capping ? "On\n" : "Off\n");
-  os << indent << "Cap Value: " << this->CapValue << "\n";
-
-  os << indent << "Accumulation Mode: "
-     << this->GetAccumulationModeAsString() << "\n";
-
-  os << indent << "Null Value: " << this->NullValue << "\n";
-  os << indent << "Maximum Dimension: " << this->MaximumDimension << "\n";
-
-  os << indent << "Parallel Splat Crossover: "
-     << this->ParallelSplatCrossover << "\n";
-}
diff --git a/Imaging/Hybrid/vtkCheckerboardSplatter.h b/Imaging/Hybrid/vtkCheckerboardSplatter.h
deleted file mode 100644
index f334964..0000000
--- a/Imaging/Hybrid/vtkCheckerboardSplatter.h
+++ /dev/null
@@ -1,298 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkCheckerboardSplatter.h
-
-  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.
-
-=========================================================================*/
-// .NAME vtkCheckerboardSplatter - splat points into a volume with an elliptical, Gaussian distribution
-// .SECTION Description
-// vtkCheckerboardSplatter is a filter that injects input points into a
-// structured points (volume) dataset using a multithreaded 8-way
-// checkerboard approach. It produces a scalar field of a specified type. As
-// each point is injected, it "splats" or distributes values to nearby
-// voxels. Data is distributed using an elliptical, Gaussian distribution
-// function. The distribution function is modified using scalar values
-// (expands distribution) or normals (creates ellipsoidal distribution rather
-// than spherical). This algorithm is designed for scalability through
-// multithreading.
-//
-// In general, the Gaussian distribution function f(x) around a given
-// splat point p is given by
-//
-//     f(x) = ScaleFactor * exp( ExponentFactor*((r/Radius)**2) )
-//
-// where x is the current voxel sample point; r is the distance |x-p|
-// ExponentFactor <= 0.0, and ScaleFactor can be multiplied by the scalar
-// value of the point p that is currently being splatted.
-//
-// If point normals are present (and NormalWarping is on), then the splat
-// function becomes elliptical (as compared to the spherical one described
-// by the previous equation). The Gaussian distribution function then
-// becomes:
-//
-//     f(x) = ScaleFactor *
-//               exp( ExponentFactor*( ((rxy/E)**2 + z**2)/R**2) )
-//
-// where E is a user-defined eccentricity factor that controls the elliptical
-// shape of the splat; z is the distance of the current voxel sample point
-// along normal N; and rxy is the distance of x in the direction
-// prependicular to N.
-//
-// This class is typically used to convert point-valued distributions into
-// a volume representation. The volume is then usually iso-surfaced or
-// volume rendered to generate a visualization. It can be used to create
-// surfaces from point distributions, or to create structure (i.e.,
-// topology) when none exists.
-//
-// This class makes use of vtkSMPTools to implement a parallel, shared-memory
-// implementation. Hence performance will be significantly improved if VTK is
-// built with VTK_SMP_IMPLEMENTATION_TYPE set to something other than
-// "Sequential" (typically TBB). For example, on a standard laptop with four
-// threads it is common to see a >10x speedup as compared to the serial
-// version of vtkGaussianSplatter.
-//
-// In summary, the algorithm operates by dividing the volume into a 3D
-// checkerboard, where the squares of the checkerboard overlay voxels in the
-// volume. The checkerboard overlay is designed as a function of the splat
-// footprint, so that when splatting occurs in a group (or color) of
-// checkerboard squares, the splat operation will not cause write contention
-// as the splatting proceeds in parallel. There are eight colors in this
-// checkerboard (like an octree) and parallel splatting occurs simultaneously
-// in one of the eight colors (e.g., octants). A single splat operation
-// (across the given 3D footprint) may also be parallelized if the splat is
-// large enough.
-
-// .SECTION Caveats
-// The input to this filter is of type vtkPointSet. Currently only real types
-// (e.g., float, double) are supported as input, but this could easily be
-// extended to other types. The output type is limited to real types as well.
-//
-// Some voxels may never receive a contribution during the splatting process.
-// The final value of these points can be specified with the "NullValue"
-// instance variable. Note that NullValue is also the initial value of the
-// output voxel values and will affect the accumulation process.
-//
-// While this class is very similar to vtkGaussianSplatter, it does produce
-// slightly different output in most cases (due to the way the footprint is
-// computed).
-
-// .SECTION See Also
-// vtkShepardMethod vtkGaussianSplatter
-
-#ifndef vtkCheckerboardSplatter_h
-#define vtkCheckerboardSplatter_h
-
-#include "vtkImagingHybridModule.h" // For export macro
-#include "vtkImageAlgorithm.h"
-
-#define VTK_ACCUMULATION_MODE_MIN 0
-#define VTK_ACCUMULATION_MODE_MAX 1
-#define VTK_ACCUMULATION_MODE_SUM 2
-
-class vtkDoubleArray;
-class vtkCompositeDataSet;
-
-class VTKIMAGINGHYBRID_EXPORT vtkCheckerboardSplatter : public vtkImageAlgorithm
-{
-public:
-  vtkTypeMacro(vtkCheckerboardSplatter,vtkImageAlgorithm);
-  void PrintSelf(ostream& os, vtkIndent indent);
-
-  // Description:
-  // Construct object with dimensions=(50,50,50); automatic computation of
-  // bounds; a Footprint of 2; a Radius of 0; an exponent factor of -5; and normal and
-  // scalar warping enabled; and Capping enabled.
-  static vtkCheckerboardSplatter *New();
-
-  // Description:
-  // Set / get the dimensions of the sampling structured point set. Higher
-  // values produce better results but may be much slower.
-  void SetSampleDimensions(int i, int j, int k);
-  void SetSampleDimensions(int dim[3]);
-  vtkGetVectorMacro(SampleDimensions,int,3);
-
-  // Description:
-  // Set / get the (xmin,xmax, ymin,ymax, zmin,zmax) bounding box in which
-  // the sampling is performed. If any of the (min,max) bounds values are
-  // min >= max, then the bounds will be computed automatically from the input
-  // data. Otherwise, the user-specified bounds will be used.
-  vtkSetVector6Macro(ModelBounds,double);
-  vtkGetVectorMacro(ModelBounds,double,6);
-
-  // Description:
-  // Control the footprint size of the splat in terms of propagation across a
-  // voxel neighborhood. The Footprint value simply indicates the number of
-  // neigboring voxels in the i-j-k directions to extend the splat. A value
-  // of zero means that only the voxel containing the splat point is
-  // affected. A value of one means the immediate neighbors touching the
-  // affected voxel are affected as well. Larger numbers increase the splat
-  // footprint and significantly increase processing time. Note that the
-  // footprint is always 3D rectangular.
-  vtkSetClampMacro(Footprint,int,0,VTK_INT_MAX);
-  vtkGetMacro(Footprint,int);
-
-  // Description:
-  // Set / get the radius variable that controls the Gaussian exponential
-  // function (see equation above). If set to zero, it is automatically set
-  // to the radius of the circumsphere bounding a single voxel. (By default,
-  // the Radius is set to zero and is automatically computed.)
-  vtkSetClampMacro(Radius,double,0.0,VTK_DOUBLE_MAX);
-  vtkGetMacro(Radius,double);
-
-  // Description:
-  // Multiply Gaussian splat distribution by this value. If ScalarWarping
-  // is on, then the Scalar value will be multiplied by the ScaleFactor
-  // times the Gaussian function.
-  vtkSetClampMacro(ScaleFactor,double,0.0,VTK_DOUBLE_MAX);
-  vtkGetMacro(ScaleFactor,double);
-
-  // Description:
-  // Set / get the sharpness of decay of the splats. This is the exponent
-  // constant in the Gaussian equation described above. Normally this is a
-  // negative value.
-  vtkSetMacro(ExponentFactor,double);
-  vtkGetMacro(ExponentFactor,double);
-
-  // Description:
-  // Turn on/off the scaling of splats by scalar value.
-  vtkSetMacro(ScalarWarping,int);
-  vtkGetMacro(ScalarWarping,int);
-  vtkBooleanMacro(ScalarWarping,int);
-
-  // Description:
-  // Turn on/off the generation of elliptical splats. If normal warping is
-  // on, then the input normals affect the distribution of the splat. This
-  // boolean is used in combination with the Eccentricity ivar.
-  vtkSetMacro(NormalWarping,int);
-  vtkGetMacro(NormalWarping,int);
-  vtkBooleanMacro(NormalWarping,int);
-
-  // Description:
-  // Control the shape of elliptical splatting. Eccentricity is the ratio
-  // of the major axis (aligned along normal) to the minor (axes) aligned
-  // along other two axes. So Eccentricity > 1 creates needles with the
-  // long axis in the direction of the normal; Eccentricity<1 creates
-  // pancakes perpendicular to the normal vector.
-  vtkSetClampMacro(Eccentricity,double,0.001,VTK_DOUBLE_MAX);
-  vtkGetMacro(Eccentricity,double);
-
-  // Description:
-  // Specify the scalar accumulation mode. This mode expresses how scalar
-  // values are combined when splats overlap one another. The Max mode acts
-  // like a set union operation and is the most commonly used; the Min mode
-  // acts like a set intersection, and the sum is just weird (and can
-  // potentially cause accumulation overflow in extreme cases). Note that the
-  // NullValue must be set consistent with the accumulation operation.
-  vtkSetClampMacro(AccumulationMode,int,
-                   VTK_ACCUMULATION_MODE_MIN,VTK_ACCUMULATION_MODE_SUM);
-  vtkGetMacro(AccumulationMode,int);
-  void SetAccumulationModeToMin()
-    {this->SetAccumulationMode(VTK_ACCUMULATION_MODE_MIN);}
-  void SetAccumulationModeToMax()
-    {this->SetAccumulationMode(VTK_ACCUMULATION_MODE_MAX);}
-  void SetAccumulationModeToSum()
-    {this->SetAccumulationMode(VTK_ACCUMULATION_MODE_SUM);}
-  const char *GetAccumulationModeAsString();
-
-  // Description:
-  // Set what type of scalar data this source should generate. Only double
-  // and float types are supported currently due to precision requirements
-  // during accumulation. By default, float scalars are produced.
-  vtkSetMacro(OutputScalarType,int);
-  vtkGetMacro(OutputScalarType,int);
-  void SetOutputScalarTypeToDouble()
-    {this->SetOutputScalarType(VTK_DOUBLE);}
-  void SetOutputScalarTypeToFloat()
-    {this->SetOutputScalarType(VTK_FLOAT);}
-
-  // Description:
-  // Turn on/off the capping of the outer boundary of the volume
-  // to a specified cap value. This can be used to close surfaces
-  // (after iso-surfacing) and create other effects.
-  vtkSetMacro(Capping,int);
-  vtkGetMacro(Capping,int);
-  vtkBooleanMacro(Capping,int);
-
-  // Description:
-  // Specify the cap value to use. (This instance variable only has effect
-  // if the ivar Capping is on.)
-  vtkSetMacro(CapValue,double);
-  vtkGetMacro(CapValue,double);
-
-  // Description:
-  // Set the Null value for output points not receiving a contribution from
-  // the input points. (This is the initial value of the voxel samples, by
-  // default it is set to zero.) Note that the value should be consistent
-  // with the output dataset type. The NullValue also provides the initial
-  // value on which the accumulations process operates.
-  vtkSetMacro(NullValue,double);
-  vtkGetMacro(NullValue,double);
-
-  // Description:
-  // Set/Get the maximum dimension of the checkerboard (i.e., the number of
-  // squares in any of the i, j, or k directions). This number also impacts
-  // the granularity of the parallel threading (since each checker square is
-  // processed separaely). Because of the internal addressing, the maximum
-  // dimension is limited to 255 (maximum value of an unsigned char).
-  vtkSetClampMacro(MaximumDimension,int,0,255);
-  vtkGetMacro(MaximumDimension,int);
-
-  // Description:
-  // Set/get the crossover point expressed in footprint size where the
-  // splatting operation is parallelized (through vtkSMPTools). By default
-  // the parallel crossover point is for splat footprints of size two or
-  // greater (i.e., at footprint=2 then splat is 5x5x5 and parallel splatting
-  // occurs). This is really meant for experimental purposes.
-  vtkSetClampMacro(ParallelSplatCrossover,int,0,255);
-  vtkGetMacro(ParallelSplatCrossover,int);
-
-  // Description:
-  // Compute the size of the sample bounding box automatically from the
-  // input data. This is an internal helper function.
-  void ComputeModelBounds(vtkDataSet *input, vtkImageData *output,
-                          vtkInformation *outInfo);
-
-protected:
-  vtkCheckerboardSplatter();
-  ~vtkCheckerboardSplatter() {}
-
-  virtual int FillInputPortInformation(int port, vtkInformation* info);
-  virtual int RequestInformation (vtkInformation *,
-                                  vtkInformationVector **,
-                                  vtkInformationVector *);
-  virtual int RequestData(vtkInformation *,
-                          vtkInformationVector **,
-                          vtkInformationVector *);
-
-  int OutputScalarType; //the type of output scalars
-  int SampleDimensions[3]; // dimensions of volume to splat into
-  double Radius; // Radius factor in the Gaussian exponential function
-  int Footprint; // maximum distance splat propagates (in voxels 0->Dim)
-  double ExponentFactor; // scale exponent of gaussian function
-  double ModelBounds[6]; // bounding box of splatting dimensions
-  double Origin[3], Spacing[3]; // output geometry
-  int NormalWarping; // on/off warping of splat via normal
-  double Eccentricity;// elliptic distortion due to normals
-  int ScalarWarping; // on/off warping of splat via scalar
-  double ScaleFactor; // splat size influenced by scale factor
-  int Capping; // Cap side of volume to close surfaces
-  double CapValue; // value to use for capping
-  int AccumulationMode; // how to combine scalar values
-  double NullValue; // initial value of voxels
-  unsigned char MaximumDimension; // max resolution of checkerboard
-  int ParallelSplatCrossover; //the point at which parallel splatting occurs
-
-private:
-  vtkCheckerboardSplatter(const vtkCheckerboardSplatter&);  // Not implemented.
-  void operator=(const vtkCheckerboardSplatter&);  // Not implemented.
-};
-
-#endif
diff --git a/Imaging/Hybrid/vtkGaussianSplatter.cxx b/Imaging/Hybrid/vtkGaussianSplatter.cxx
index 2323311..343eb87 100644
--- a/Imaging/Hybrid/vtkGaussianSplatter.cxx
+++ b/Imaging/Hybrid/vtkGaussianSplatter.cxx
@@ -26,71 +26,15 @@
 #include "vtkSmartPointer.h"
 #include "vtkStreamingDemandDrivenPipeline.h"
 #include "vtkPointData.h"
-#include "vtkSMPTools.h"
 
 #include <algorithm>
 #include <math.h>
 
 vtkStandardNewMacro(vtkGaussianSplatter);
 
-//----------------------------------------------------------------------------
-// Algorithm and integration into vtkSMPTools
-class vtkGaussianSplatterAlgorithm
-{
-public:
-  vtkGaussianSplatter *Splatter;
-  double *Scalars;
-  vtkIdType Dims[3], SliceSize;
-  double Origin[3], Spacing[3], Radius2;
-
-  class Splat
-    {
-    public:
-      vtkGaussianSplatterAlgorithm *Algo;
-      vtkIdType XMin, XMax, YMin, YMax, ZMin, ZMax;
-      Splat(vtkGaussianSplatterAlgorithm *algo)
-        {this->Algo = algo;}
-      void SetBounds(int min[3], int max[3])
-        {
-          this->XMin = min[0]; this->XMax = max[0];
-          this->YMin = min[1]; this->YMax = max[1];
-          this->ZMin = min[2]; this->ZMax = max[2];
-        }
-      void  operator()(vtkIdType slice, vtkIdType end)
-        {
-        vtkIdType i, j, jOffset, kOffset, idx;
-        double cx[3], dist2;
-        for ( ; slice < end; ++slice )
-          {
-          // Loop over all sample points in volume within footprint and
-          // evaluate the splat
-          cx[2] = this->Algo->Origin[2] + this->Algo->Spacing[2]*slice;
-          kOffset = slice*this->Algo->SliceSize;
-          for (j=this->YMin; j<=this->YMax; j++)
-            {
-            cx[1] = this->Algo->Origin[1] + this->Algo->Spacing[1]*j;
-            jOffset = j*this->Algo->Dims[0];
-            for (i=this->XMin; i<=this->XMax; i++)
-              {
-              cx[0] = this->Algo->Origin[0] + this->Algo->Spacing[0]*i;
-              dist2 = this->Algo->Splatter->SamplePoint(cx);
-              if ( dist2 <= this->Algo->Radius2 )
-                {
-                idx = i + jOffset + kOffset;
-                this->Algo->Splatter->SetScalar(idx,dist2, this->Algo->Scalars+idx);
-                }//if within splat radius
-              }//i
-            }//j
-          }//k within splat footprint
-        }
-    };
-};
-
-
-//----------------------------------------------------------------------------
-// Create the VTK class proper.  Construct object with dimensions=(50,50,50);
-// automatic computation of bounds; a splat radius of 0.1; an exponent factor
-// of -5; and normal and scalar warping turned on.
+// Construct object with dimensions=(50,50,50); automatic computation of
+// bounds; a splat radius of 0.1; an exponent factor of -5; and normal and
+// scalar warping turned on.
 vtkGaussianSplatter::vtkGaussianSplatter()
 {
   this->SampleDimensions[0] = 50;
@@ -178,11 +122,12 @@ int vtkGaussianSplatter::RequestData(
     outInfo->Get(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT()));
   output->AllocateScalars(outInfo);
 
-  vtkIdType totalNumPts, numNewPts, ptId, i;
+  vtkIdType totalNumPts, numNewPts, ptId, idx, i;
+  int j, k;
   int min[3], max[3];
   vtkPointData *pd;
   vtkDataArray *inNormals=NULL;
-  double loc[3];
+  double loc[3], dist2, cx[3];
   vtkDoubleArray *newScalars =
     vtkDoubleArray::SafeDownCast(output->GetPointData()->GetScalars());
   newScalars->SetName("SplatterValues");
@@ -197,6 +142,7 @@ int vtkGaussianSplatter::RequestData(
     tempComposite->SetBlock(0,inputDS);
     inputComposite = tempComposite.GetPointer();
     }
+  int sliceSize=this->SampleDimensions[0]*this->SampleDimensions[1];
 
   vtkDebugMacro(<< "Splatting data");
 
@@ -238,10 +184,15 @@ int vtkGaussianSplatter::RequestData(
 
   numNewPts = this->SampleDimensions[0] * this->SampleDimensions[1] *
               this->SampleDimensions[2];
-  double *scalars = newScalars->WritePointer(0,numNewPts);
-  std::fill_n(scalars,numNewPts,this->NullValue);
+  for (i=0; i<numNewPts; i++)
+    {
+    newScalars->SetTuple(i,&this->NullValue);
+    }
   this->Visited = new char[numNewPts];
-  std::fill_n(this->Visited,numNewPts,0);
+  for (i=0; i < numNewPts; i++)
+    {
+    this->Visited[i] = 0;
+    }
 
   pd = ds->GetPointData();
   bool useScalars = false;
@@ -275,21 +226,7 @@ int vtkGaussianSplatter::RequestData(
                    //but this makes purify happy.
     }
 
-  // Prepare for parallel splatting
-  vtkGaussianSplatterAlgorithm algo;
-  algo.Splatter = this;
-  algo.Scalars = scalars;
-  algo.Radius2 = this->Radius2;
-  algo.SliceSize = this->SampleDimensions[0]*this->SampleDimensions[1];
-  for (i=0; i<3; ++i)
-    {
-    algo.Dims[i] = this->SampleDimensions[i];
-    algo.Origin[i] = this->Origin[i];
-    algo.Spacing[i] = this->Spacing[i];
-    }
-  vtkGaussianSplatterAlgorithm::Splat splat(&algo);
 
-  // Process all input datasets
   for (dataItr->InitTraversal(); !dataItr->IsDoneWithTraversal(); dataItr->GoToNextItem())
     {
     vtkDataSet* input = vtkDataSet::SafeDownCast(dataItr->GetCurrentDataObject());
@@ -360,10 +297,8 @@ int vtkGaussianSplatter::RequestData(
       // Determine splat footprint
       for (i=0; i<3; i++)
         {
-        min[i] = static_cast<int>(floor(static_cast<double>(
-                                          loc[i])-this->SplatDistance[i]));
-        max[i] = static_cast<int>(ceil(static_cast<double>(
-                                         loc[i])+this->SplatDistance[i]));
+        min[i] = static_cast<int>(floor(static_cast<double>(loc[i])-this->SplatDistance[i]));
+        max[i] = static_cast<int>(ceil(static_cast<double>(loc[i])+this->SplatDistance[i]));
         if ( min[i] < 0 )
           {
           min[i] = 0;
@@ -374,12 +309,27 @@ int vtkGaussianSplatter::RequestData(
           }
         }
 
-      // Parallel splat the point
-      splat.SetBounds(min,max);
-      vtkSMPTools::For(min[2],max[2]+1, splat);
-
+      // Loop over all sample points in volume within footprint and
+      // evaluate the splat
+      for (k=min[2]; k<=max[2]; k++)
+        {
+        cx[2] = this->Origin[2] + this->Spacing[2]*k;
+        for (j=min[1]; j<=max[1]; j++)
+          {
+          cx[1] = this->Origin[1] + this->Spacing[1]*j;
+          for (i=min[0]; i<=max[0]; i++)
+            {
+            cx[0] = this->Origin[0] + this->Spacing[0]*i;
+            if ( (dist2=(this->*Sample)(cx)) <= this->Radius2 )
+              {
+              idx = i + j*this->SampleDimensions[0] + k*sliceSize;
+              this->SetScalar(idx,dist2, newScalars);
+              }//if within splat radius
+            }
+          }
+        }//within splat footprint
       }//for all input points
-    }//for all datasets
+    }
 
   // If capping is turned on, set the distances of the outside of the volume
   // to the CapValue.
@@ -398,7 +348,6 @@ int vtkGaussianSplatter::RequestData(
   return 1;
 }
 
-//----------------------------------------------------------------------------
 void vtkGaussianSplatter::ComputeModelBounds(vtkCompositeDataSet *input,
                                              vtkImageData *output,
                                              vtkInformation *outInfo)
@@ -720,6 +669,38 @@ double vtkGaussianSplatter::EccentricGaussian (double cx[3])
 }
 
 //----------------------------------------------------------------------------
+void vtkGaussianSplatter::SetScalar(int idx, double dist2,
+                                    vtkDoubleArray *newScalars)
+{
+  double v = (this->*SampleFactor)(this->S) * exp(
+    static_cast<double>
+    (this->ExponentFactor*(dist2)/(this->Radius2)));
+
+  if ( ! this->Visited[idx] )
+    {
+    this->Visited[idx] = 1;
+    newScalars->SetValue(idx,v);
+    }
+  else
+    {
+    double s = newScalars->GetValue(idx);
+    switch (this->AccumulationMode)
+      {
+      case VTK_ACCUMULATION_MODE_MIN:
+        newScalars->SetValue(idx,(s<v ? s : v));
+        break;
+      case VTK_ACCUMULATION_MODE_MAX:
+        newScalars->SetValue(idx,(s>v ? s : v));
+        break;
+      case VTK_ACCUMULATION_MODE_SUM:
+        s += v;
+        newScalars->SetValue(idx,s);
+        break;
+      }
+    }//not first visit
+}
+
+//----------------------------------------------------------------------------
 const char *vtkGaussianSplatter::GetAccumulationModeAsString()
 {
   if ( this->AccumulationMode == VTK_ACCUMULATION_MODE_MIN )
diff --git a/Imaging/Hybrid/vtkGaussianSplatter.h b/Imaging/Hybrid/vtkGaussianSplatter.h
index 45cff89..05efcb9 100644
--- a/Imaging/Hybrid/vtkGaussianSplatter.h
+++ b/Imaging/Hybrid/vtkGaussianSplatter.h
@@ -73,7 +73,6 @@
 
 class vtkDoubleArray;
 class vtkCompositeDataSet;
-class vtkGaussianSplatterAlgorithm;
 
 class VTKIMAGINGHYBRID_EXPORT vtkGaussianSplatter : public vtkImageAlgorithm
 {
@@ -190,48 +189,6 @@ public:
   void ComputeModelBounds(vtkCompositeDataSet *input, vtkImageData *output,
                           vtkInformation *outInfo);
 
-//BTX
-  // Description:
-  // Provide access to templated helper class. Note that SamplePoint() method
-  // is public here because some compilers don't handle friend functions
-  // properly.
-  friend class vtkGaussianSplatterAlgorithm;
-  double SamplePoint(double x[3]) //for compilers who can't handle this
-    {return (this->*Sample)(x);}
-  void SetScalar(int idx, double dist2, double *sPtr)
-  {
-    double v = (this->*SampleFactor)(this->S) * exp(static_cast<double>
-      (this->ExponentFactor*(dist2)/(this->Radius2)));
-
-    if ( ! this->Visited[idx] )
-      {
-      this->Visited[idx] = 1;
-      *sPtr = v;
-      }
-    else
-      {
-      switch (this->AccumulationMode)
-        {
-        case VTK_ACCUMULATION_MODE_MIN:
-          if ( *sPtr > v )
-            {
-            *sPtr = v;
-            }
-          break;
-        case VTK_ACCUMULATION_MODE_MAX:
-          if ( *sPtr < v )
-            {
-            *sPtr = v;
-            }
-          break;
-        case VTK_ACCUMULATION_MODE_SUM:
-          *sPtr += v;
-          break;
-        }
-      }//not first visit
-  }
-//ETX
-
 protected:
   vtkGaussianSplatter();
   ~vtkGaussianSplatter() {}
@@ -263,6 +220,7 @@ protected:
     {return this->ScaleFactor * s;}
   double PositionSampling(double)
     {return this->ScaleFactor;}
+  void SetScalar(int idx, double dist2, vtkDoubleArray *newScalars);
 
 //BTX
 private:
@@ -286,3 +244,5 @@ private:
 };
 
 #endif
+
+
diff --git a/Imaging/Hybrid/vtkSampleFunction.cxx b/Imaging/Hybrid/vtkSampleFunction.cxx
index 39258af..7057e40 100644
--- a/Imaging/Hybrid/vtkSampleFunction.cxx
+++ b/Imaging/Hybrid/vtkSampleFunction.cxx
@@ -25,226 +25,10 @@
 #include "vtkObjectFactory.h"
 #include "vtkStreamingDemandDrivenPipeline.h"
 #include "vtkPointData.h"
-#include "vtkSMPTools.h"
 
 vtkStandardNewMacro(vtkSampleFunction);
 vtkCxxSetObjectMacro(vtkSampleFunction,ImplicitFunction,vtkImplicitFunction);
 
-// The heart of the algorithm plus interface to the SMP tools.
-template <class T>
-class vtkSampleFunctionAlgorithm
-{
-public:
-  vtkImplicitFunction *ImplicitFunction;
-  T         *Scalars;
-  float     *Normals;
-  vtkIdType  Extent[6];
-  vtkIdType  Dims[3];
-  vtkIdType  SliceSize;
-  double     Origin[3];
-  double     Spacing[3];
-  double     CapValue;
-
-  // Contructor
-  vtkSampleFunctionAlgorithm();
-
-  // Interface between VTK and templated functions
-  static void SampleAcrossImage(vtkSampleFunction *self, vtkImageData *output,
-                                int extent[6], T *scalars, float *normals);
-
-  // Cap the boundaries with the specified cap value (if requested).
-  void Cap();
-
-  // Interface implicit function computation to SMP tools.
-  template <class TT> class FunctionValueOp
-    {
-    public:
-      FunctionValueOp(vtkSampleFunctionAlgorithm<TT> *algo)
-        { this->Algo = algo;}
-      vtkSampleFunctionAlgorithm *Algo;
-      void  operator() (vtkIdType k, vtkIdType end)
-        {
-        double x[3];
-        vtkIdType i, j, jOffset, kOffset;
-        for ( ; k < end; ++k)
-          {
-          x[2] = this->Algo->Origin[2] + k*this->Algo->Spacing[2];
-          kOffset = k*this->Algo->SliceSize;
-          for (j=0; j<this->Algo->Dims[1]; ++j)
-            {
-            x[1] = this->Algo->Origin[1] + j*this->Algo->Spacing[1];
-            jOffset = j*this->Algo->Dims[0];
-            for (i=0; i<this->Algo->Dims[0]; ++i)
-              {
-              x[0] = this->Algo->Origin[0] + i*this->Algo->Spacing[0];
-              this->Algo->Scalars[i+jOffset+kOffset] =
-                static_cast<TT>(this->Algo->ImplicitFunction->FunctionValue(x));
-              }
-            }
-          }
-        }
-    };
-
-  // Interface implicit function graadient computation to SMP tools.
-  template <class TT> class FunctionGradientOp
-    {
-    public:
-      FunctionGradientOp(vtkSampleFunctionAlgorithm<TT> *algo)
-        { this->Algo = algo;}
-      vtkSampleFunctionAlgorithm *Algo;
-      void  operator() (vtkIdType k, vtkIdType end)
-        {
-        double x[3], n[3];
-        float *nPtr;
-        vtkIdType i, j, jOffset, kOffset;
-        for ( ; k < end; ++k)
-          {
-          x[2] = this->Algo->Origin[2] + k*this->Algo->Spacing[2];
-          kOffset = k*this->Algo->SliceSize;
-          for (j=0; j<this->Algo->Dims[1]; ++j)
-            {
-            x[1] = this->Algo->Origin[1] + j*this->Algo->Spacing[1];
-            jOffset = j*this->Algo->Dims[0];
-            for (i=0; i<this->Algo->Dims[0]; ++i)
-              {
-              x[0] = this->Algo->Origin[0] + i*this->Algo->Spacing[0];
-              this->Algo->ImplicitFunction->FunctionGradient(x,n);
-              nPtr = this->Algo->Normals + 3*(i+jOffset+kOffset);
-              nPtr[0] = static_cast<TT>(-n[0]);
-              nPtr[1] = static_cast<TT>(-n[1]);
-              nPtr[2] = static_cast<TT>(-n[2]);
-              }//i
-            }//j
-          }//k
-        }
-    };
-};
-
-//----------------------------------------------------------------------------
-// Initialized mainly to eliminate compiler warnings.
-template <class T> vtkSampleFunctionAlgorithm<T>::
-vtkSampleFunctionAlgorithm():Scalars(NULL),Normals(NULL)
-{
-  for (int i=0; i<3; ++i)
-    {
-    this->Extent[2*i] = this->Extent[2*i+1] = 0;
-    this->Dims[i] = 0;
-    this->Origin[i] = this->Spacing[i] = 0.0;
-    }
-  this->SliceSize = 0;
-  this->CapValue = 0.0;
-}
-
-//----------------------------------------------------------------------------
-// Templated class is glue between VTK and templated algorithms.
-template <class T> void vtkSampleFunctionAlgorithm<T>::
-SampleAcrossImage(vtkSampleFunction *self, vtkImageData *output,
-                  int extent[6], T *scalars, float *normals)
-{
-  // Populate data into local storage
-  vtkSampleFunctionAlgorithm<T> algo;
-  algo.ImplicitFunction = self->GetImplicitFunction();
-  algo.Scalars = scalars;
-  algo.Normals = normals;
-  for (int i=0; i<3; ++i)
-    {
-    algo.Extent[2*i] = extent[2*i];
-    algo.Extent[2*i+1] = extent[2*i+1];
-    algo.Dims[i] = extent[2*i+1] - extent[2*i] + 1;
-    }
-  algo.SliceSize = algo.Dims[0]*algo.Dims[1];
-  output->GetOrigin(algo.Origin);
-  output->GetSpacing(algo.Spacing);
-  algo.CapValue = self->GetCapValue();
-
-  // Okay now generate samples using SMP tools
-  FunctionValueOp<T> values(&algo);
-  vtkSMPTools::For(0,algo.Dims[2], values);
-
-  // If requested, generate normals
-  if ( algo.Normals )
-    {
-    FunctionGradientOp<T> gradient(&algo);
-    vtkSMPTools::For(0,algo.Dims[2], gradient);
-    }
-
-  // If requested, cap boundaries
-  if ( self->GetCapping() )
-    {
-    algo.Cap();
-    }
-}
-
-//----------------------------------------------------------------------------
-// Cap the boundaries of the volume if requested.
-template <class T> void vtkSampleFunctionAlgorithm<T>::Cap()
-{
-  vtkIdType i,j,k;
-  vtkIdType idx;
-
-  // i-j planes
-  //k = this->Extent[4];
-  for (j=this->Extent[2]; j<=this->Extent[3]; j++)
-    {
-    for (i=this->Extent[0]; i<=this->Extent[1]; i++)
-      {
-      this->Scalars[i+j*this->Dims[0]] = this->CapValue;
-      }
-    }
-
-  idx = this->Extent[5]*this->SliceSize;
-  for (j=this->Extent[2]; j<=this->Extent[3]; j++)
-    {
-    for (i=this->Extent[0]; i<=this->Extent[1]; i++)
-      {
-      this->Scalars[idx+i+j*this->Dims[0]] = this->CapValue;
-      }
-    }
-
-  // j-k planes
-  //i = this->Extent[0];
-  for (k=this->Extent[4]; k<=this->Extent[5]; k++)
-    {
-    for (j=this->Extent[2]; j<=this->Extent[3]; j++)
-      {
-      this->Scalars[j*this->Dims[0]+k*this->SliceSize] =
-        this->CapValue;
-      }
-    }
-
-  i = this->Extent[1];
-  for (k=this->Extent[4]; k<=this->Extent[5]; k++)
-    {
-    for (j=this->Extent[2]; j<=this->Extent[3]; j++)
-      {
-      this->Scalars[i+j*this->Dims[0]+k*this->SliceSize] =
-        this->CapValue;
-      }
-    }
-
-  // i-k planes
-  //j = this->Extent[2];
-  for (k=this->Extent[4]; k<=this->Extent[5]; k++)
-    {
-    for (i=this->Extent[0]; i<=this->Extent[1]; i++)
-      {
-      this->Scalars[i+k*this->SliceSize] = this->CapValue;
-      }
-    }
-
-  j = this->Extent[3];
-  idx = j*this->Dims[0];
-  for (k=this->Extent[4]; k<=this->Extent[5]; k++)
-    {
-    for (i=this->Extent[0]; i<=this->Extent[1]; i++)
-      {
-      this->Scalars[idx+i+k*this->SliceSize] = this->CapValue;
-      }
-    }
-}
-
-//----------------------------------------------------------------------------
-// Okay define the VTK class proper
 vtkSampleFunction::vtkSampleFunction()
 {
   this->ModelBounds[0] = -1.0;
@@ -272,10 +56,10 @@ vtkSampleFunction::vtkSampleFunction()
   this->NormalArrayName=0;
   this->SetNormalArrayName("normals");
 
+
   this->SetNumberOfInputPorts(0);
 }
 
-//----------------------------------------------------------------------------
 vtkSampleFunction::~vtkSampleFunction()
 {
   this->SetImplicitFunction(NULL);
@@ -283,7 +67,6 @@ vtkSampleFunction::~vtkSampleFunction()
   this->SetNormalArrayName(NULL);
 }
 
-//----------------------------------------------------------------------------
 // Specify the dimensions of the data on which to sample.
 void vtkSampleFunction::SetSampleDimensions(int i, int j, int k)
 {
@@ -296,7 +79,6 @@ void vtkSampleFunction::SetSampleDimensions(int i, int j, int k)
   this->SetSampleDimensions(dim);
 }
 
-//----------------------------------------------------------------------------
 // Specify the dimensions of the data on which to sample.
 void vtkSampleFunction::SetSampleDimensions(int dim[3])
 {
@@ -314,8 +96,7 @@ void vtkSampleFunction::SetSampleDimensions(int dim[3])
     }
 }
 
-//----------------------------------------------------------------------------
-// Set the bounds of the model.
+// Set the bounds of the model
 void vtkSampleFunction::SetModelBounds(const double bounds[6])
 {
   this->SetModelBounds(bounds[0], bounds[1],
@@ -323,8 +104,6 @@ void vtkSampleFunction::SetModelBounds(const double bounds[6])
                        bounds[4], bounds[5]);
 
 }
-
-//----------------------------------------------------------------------------
 void vtkSampleFunction::SetModelBounds(double xMin, double xMax,
                                        double yMin, double yMax,
                                        double zMin, double zMax)
@@ -361,7 +140,6 @@ void vtkSampleFunction::SetModelBounds(double xMin, double xMax,
     }
 }
 
-//----------------------------------------------------------------------------
 int vtkSampleFunction::RequestInformation (
   vtkInformation * vtkNotUsed(request),
   vtkInformationVector ** vtkNotUsed( inputVector ),
@@ -397,20 +175,19 @@ int vtkSampleFunction::RequestInformation (
   outInfo->Set(vtkDataObject::ORIGIN(),origin,3);
   outInfo->Set(vtkDataObject::SPACING(),ar,3);
 
-  vtkDataObject::
-    SetPointDataActiveScalarInfo(outInfo,this->OutputScalarType,1);
+  vtkDataObject::SetPointDataActiveScalarInfo(outInfo,this->OutputScalarType,
+                                              1);
 
   return 1;
 }
 
-//----------------------------------------------------------------------------
-// Produce the data.
-void vtkSampleFunction::
-ExecuteDataWithInformation(vtkDataObject *outp, vtkInformation *outInfo)
+
+void vtkSampleFunction::ExecuteDataWithInformation(vtkDataObject *outp, vtkInformation *outInfo)
 {
+  vtkIdType idx, i, j, k;
   vtkFloatArray *newNormals=NULL;
-  float *normals=NULL;
-
+  vtkIdType numPts;
+  double p[3], s;
   vtkImageData *output=this->GetOutput();
   int* extent =
     this->GetExecutive()->GetOutputInformation(0)->Get(
@@ -419,7 +196,6 @@ ExecuteDataWithInformation(vtkDataObject *outp, vtkInformation *outInfo)
   output->SetExtent(extent);
   output = this->AllocateOutputData(outp, outInfo);
   vtkDataArray *newScalars =output->GetPointData()->GetScalars();
-  vtkIdType numPts = newScalars->GetNumberOfTuples();
 
   vtkDebugMacro(<< "Sampling implicit function");
 
@@ -431,24 +207,67 @@ ExecuteDataWithInformation(vtkDataObject *outp, vtkInformation *outInfo)
     return;
     }
 
+  numPts = newScalars->GetNumberOfTuples();
+
+  // Traverse all points evaluating implicit function at each point
+  //
+  double spacing[3];
+  output->GetSpacing(spacing);
+
+  for ( idx=0, k=extent[4]; k <= extent[5]; k++ )
+    {
+    p[2] = this->ModelBounds[4] + k*spacing[2];
+    for ( j=extent[2]; j <= extent[3]; j++ )
+      {
+      p[1] = this->ModelBounds[2] + j*spacing[1];
+      for ( i=extent[0]; i <= extent[1]; i++ )
+        {
+        p[0] = this->ModelBounds[0] + i*spacing[0];
+        s = this->ImplicitFunction->FunctionValue(p);
+        newScalars->SetTuple1(idx++,s);
+        }
+      }
+    }
+
+  // If normal computation turned on, compute them
+  //
   if ( this->ComputeNormals )
     {
+    double n[3];
     newNormals = vtkFloatArray::New();
     newNormals->SetNumberOfComponents(3);
     newNormals->SetNumberOfTuples(numPts);
-    normals = newNormals->WritePointer(0,numPts);
+    for ( idx=0, k=extent[4]; k <= extent[5]; k++ )
+      {
+      p[2] = this->ModelBounds[4] + k*spacing[2];
+      for ( j=extent[2]; j <= extent[3]; j++ )
+        {
+        p[1] = this->ModelBounds[2] + j*spacing[1];
+        for ( i=extent[0]; i <= extent[1]; i++ )
+          {
+          p[0] = this->ModelBounds[0] + i*spacing[0];
+          this->ImplicitFunction->FunctionGradient(p, n);
+          n[0] *= -1;
+          n[1] *= -1;
+          n[2] *= -1;
+          vtkMath::Normalize(n);
+          newNormals->SetTuple(idx++,n);
+          }
+        }
+      }
     }
 
-  void *ptr = output->GetArrayPointerForExtent(newScalars, extent);
-  switch (newScalars->GetDataType())
+  newScalars->SetName(this->ScalarArrayName);
+
+
+  // If capping is turned on, set the distances of the outside of the volume
+  // to the CapValue.
+  //
+  if ( this->Capping )
     {
-    vtkTemplateMacro(vtkSampleFunctionAlgorithm<VTK_TT>::
-                     SampleAcrossImage(this, output, extent, (VTK_TT *)ptr,
-                                       normals));
+    this->Cap(newScalars);
     }
 
-  newScalars->SetName(this->ScalarArrayName);
-
   // Update self
   //
   if (newNormals)
@@ -457,12 +276,13 @@ ExecuteDataWithInformation(vtkDataObject *outp, vtkInformation *outInfo)
     // it will make ImplicitSum, TestBoxFunction and TestDiscreteMarchingCubes
     // to fail.
     newNormals->SetName(this->NormalArrayName);
+
     output->GetPointData()->SetNormals(newNormals);
     newNormals->Delete();
     }
 }
 
-//----------------------------------------------------------------------------
+
 unsigned long vtkSampleFunction::GetMTime()
 {
   unsigned long mTime=this->Superclass::GetMTime();
@@ -477,7 +297,86 @@ unsigned long vtkSampleFunction::GetMTime()
   return mTime;
 }
 
-//----------------------------------------------------------------------------
+void vtkSampleFunction::Cap(vtkDataArray *s)
+{
+  int i,j,k;
+  vtkIdType idx;
+  int d01=this->SampleDimensions[0]*this->SampleDimensions[1];
+  const int* extent =
+    this->GetExecutive()->GetOutputInformation(0)->Get(
+      vtkStreamingDemandDrivenPipeline::UPDATE_EXTENT());
+
+  // i-j planes
+  //k = extent[4];
+  for (j=extent[2]; j<=extent[3]; j++)
+    {
+    for (i=extent[0]; i<=extent[1]; i++)
+      {
+      s->SetComponent(i+j*this->SampleDimensions[0], 0, this->CapValue);
+      }
+    }
+
+  k = extent[5];
+  idx = k*d01;
+  for (j=extent[2]; j<=extent[3]; j++)
+    {
+    for (i=extent[0]; i<=extent[1]; i++)
+      {
+      s->SetComponent(idx+i+j*this->SampleDimensions[0], 0, this->CapValue);
+      }
+    }
+
+  // j-k planes
+  //i = extent[0];
+  for (k=extent[4]; k<=extent[5]; k++)
+    {
+    for (j=extent[2]; j<=extent[3]; j++)
+      {
+      s->SetComponent(j*this->SampleDimensions[0]+k*d01, 0, this->CapValue);
+      }
+    }
+
+  i = extent[1];
+  for (k=extent[4]; k<=extent[5]; k++)
+    {
+    for (j=extent[2]; j<=extent[3]; j++)
+      {
+      s->SetComponent(i+j*this->SampleDimensions[0]+k*d01, 0, this->CapValue);
+      }
+    }
+
+  // i-k planes
+  //j = extent[2];
+  for (k=extent[4]; k<=extent[5]; k++)
+    {
+    for (i=extent[0]; i<=extent[1]; i++)
+      {
+      s->SetComponent(i+k*d01, 0, this->CapValue);
+      }
+    }
+
+  j = extent[3];
+  idx = j*this->SampleDimensions[0];
+  for (k=extent[4]; k<=extent[5]; k++)
+    {
+    for (i=extent[0]; i<=extent[1]; i++)
+      {
+      s->SetComponent(idx+i+k*d01, 0, this->CapValue);
+      }
+    }
+}
+
+#ifndef VTK_LEGACY_REMOVE
+void vtkSampleFunction::SetScalars(vtkDataArray *da)
+{
+  VTK_LEGACY_BODY(vtkSampleFunction::SetScalars, "VTK 6.0");
+  if (da)
+    {
+    this->SetOutputScalarType(da->GetDataType());
+    }
+}
+#endif
+
 void vtkSampleFunction::PrintSelf(ostream& os, vtkIndent indent)
 {
   this->Superclass::PrintSelf(os,indent);
diff --git a/Imaging/Hybrid/vtkSampleFunction.h b/Imaging/Hybrid/vtkSampleFunction.h
index c440254..4fc0573 100644
--- a/Imaging/Hybrid/vtkSampleFunction.h
+++ b/Imaging/Hybrid/vtkSampleFunction.h
@@ -75,6 +75,12 @@ public:
     {this->SetOutputScalarType(VTK_UNSIGNED_CHAR);}
 
   // Description:
+  // Control the type of the scalars object by explicitly providing a scalar
+  // object.  THIS IS DEPRECATED, although it still works!!! Please use
+  // SetOutputScalarType instead.
+  VTK_LEGACY(virtual void SetScalars(vtkDataArray *da));
+
+  // Description:
   // Specify the dimensions of the data on which to sample.
   void SetSampleDimensions(int i, int j, int k);
 
diff --git a/Imaging/Hybrid/vtkSliceCubes.cxx b/Imaging/Hybrid/vtkSliceCubes.cxx
index 2d15b20..a90c2bf 100644
--- a/Imaging/Hybrid/vtkSliceCubes.cxx
+++ b/Imaging/Hybrid/vtkSliceCubes.cxx
@@ -136,7 +136,7 @@ template <class T, class S>
 int vtkSliceCubesContour(T *slice, S *scalars, int imageRange[2], int dims[3],
                          double origin[3], double Spacing[3], double value,
                          double xmin[3], double xmax[3], FILE *outFP,
-                         vtkVolumeReader *reader, bool debug)
+                         vtkVolumeReader *reader, unsigned char debug)
 {
   S *slice0scalars=NULL, *slice1scalars=NULL;
   S *slice2scalars, *slice3scalars;
diff --git a/Imaging/Morphological/vtkImageNonMaximumSuppression.cxx b/Imaging/Morphological/vtkImageNonMaximumSuppression.cxx
index 3ce0258..f1e6134 100644
--- a/Imaging/Morphological/vtkImageNonMaximumSuppression.cxx
+++ b/Imaging/Morphological/vtkImageNonMaximumSuppression.cxx
@@ -196,7 +196,7 @@ void vtkImageNonMaximumSuppressionExecute(vtkImageNonMaximumSuppression *self,
           d = vector[2] = static_cast<double>(in2Ptr[2]) * ratio[2];
           normalizeFactor += (d * d);
           }
-        if (normalizeFactor != 0.0)
+        if (normalizeFactor)
           {
           normalizeFactor = 1.0 / sqrt(normalizeFactor);
           }
diff --git a/Imaging/Morphological/vtkImageSeedConnectivity.h b/Imaging/Morphological/vtkImageSeedConnectivity.h
index deeeea6..98819eb 100644
--- a/Imaging/Morphological/vtkImageSeedConnectivity.h
+++ b/Imaging/Morphological/vtkImageSeedConnectivity.h
@@ -50,18 +50,18 @@ public:
 
   // Description:
   // Set/Get what value is considered as connecting pixels.
-  vtkSetMacro(InputConnectValue, unsigned char);
-  vtkGetMacro(InputConnectValue, unsigned char);
+  vtkSetMacro(InputConnectValue, int);
+  vtkGetMacro(InputConnectValue, int);
 
   // Description:
   // Set/Get the value to set connected pixels to.
-  vtkSetMacro(OutputConnectedValue, unsigned char);
-  vtkGetMacro(OutputConnectedValue, unsigned char);
+  vtkSetMacro(OutputConnectedValue, int);
+  vtkGetMacro(OutputConnectedValue, int);
 
   // Description:
   // Set/Get the value to set unconnected pixels to.
-  vtkSetMacro(OutputUnconnectedValue, unsigned char);
-  vtkGetMacro(OutputUnconnectedValue, unsigned char);
+  vtkSetMacro(OutputUnconnectedValue, int);
+  vtkGetMacro(OutputUnconnectedValue, int);
 
   // Description:
   // Get the vtkImageCOnnector used by this filter.
diff --git a/Imaging/Morphological/vtkImageSkeleton2D.cxx b/Imaging/Morphological/vtkImageSkeleton2D.cxx
index 5d7f315..2a4eca4 100644
--- a/Imaging/Morphological/vtkImageSkeleton2D.cxx
+++ b/Imaging/Morphological/vtkImageSkeleton2D.cxx
@@ -222,14 +222,14 @@ void vtkImageSkeleton2DExecute(vtkImageSkeleton2D *self,
                   // special condition (making another prune level)
                   // pruning 135 degree corners
                   if (prune || countFaces != 2 || countCorners != 2 ||
-                      ((n[1]==0 || n[2]==0 || n[3]==0 || n[4]!=0) &&
-                       (n[0]==0 || n[1]==0 || n[2]==0 || n[3]!=0) &&
-                       (n[7]==0 || n[0]==0 || n[1]==0 || n[2]!=0) &&
-                       (n[6]==0 || n[7]==0 || n[0]==0 || n[1]!=0) &&
-                       (n[5]==0 || n[6]==0 || n[7]==0 || n[0]!=0) &&
-                       (n[4]==0 || n[5]==0 || n[6]==0 || n[7]!=0) &&
-                       (n[3]==0 || n[4]==0 || n[5]==0 || n[6]!=0) &&
-                       (n[2]==0 || n[3]==0 || n[4]==0 || n[5]!=0)))
+                      ((n[1]==0 || n[2]==0 || n[3]==0 || n[4]) &&
+                       (n[0]==0 || n[1]==0 || n[2]==0 || n[3]) &&
+                       (n[7]==0 || n[0]==0 || n[1]==0 || n[2]) &&
+                       (n[6]==0 || n[7]==0 || n[0]==0 || n[1]) &&
+                       (n[5]==0 || n[6]==0 || n[7]==0 || n[0]) &&
+                       (n[4]==0 || n[5]==0 || n[6]==0 || n[7]) &&
+                       (n[3]==0 || n[4]==0 || n[5]==0 || n[6]) &&
+                       (n[2]==0 || n[3]==0 || n[4]==0 || n[5])))
                     {
                     // remaining pixels need to be connected.
                     // do not break corner connectivity
diff --git a/Imaging/Statistics/vtkImageHistogram.cxx b/Imaging/Statistics/vtkImageHistogram.cxx
index a6e8705..946f060 100644
--- a/Imaging/Statistics/vtkImageHistogram.cxx
+++ b/Imaging/Statistics/vtkImageHistogram.cxx
@@ -707,8 +707,8 @@ int vtkImageHistogram::RequestData(
   this->Threader->SetSingleMethod(vtkImageHistogramThreadedExecute, &ts);
 
   // always shut off debugging to avoid threading problems with GetMacros
-  bool debug = this->Debug;
-  this->Debug = false;
+  int debug = this->Debug;
+  this->Debug = 0;
   this->Threader->SingleMethodExecute();
   this->Debug = debug;
 
diff --git a/Imaging/Statistics/vtkImageHistogramStatistics.cxx b/Imaging/Statistics/vtkImageHistogramStatistics.cxx
index 293a409..86ef394 100644
--- a/Imaging/Statistics/vtkImageHistogramStatistics.cxx
+++ b/Imaging/Statistics/vtkImageHistogramStatistics.cxx
@@ -84,14 +84,14 @@ int vtkImageHistogramStatistics::RequestData(
   vtkIdType lowSum = static_cast<vtkIdType>(total*lowPercentile);
   vtkIdType highSum = static_cast<vtkIdType>(total*highPercentile);
   vtkIdType midSum = total/2;
-  vtkIdType lowVal = 0;
-  vtkIdType highVal = 0;
-  vtkIdType midVal = 0;
-  vtkIdType minVal = -1;
-  vtkIdType maxVal = 0;
+  int lowVal = 0;
+  int highVal = 0;
+  int midVal = 0;
+  int minVal = -1;
+  int maxVal = 0;
   double mom1 = 0;
   double mom2 = 0;
-  vtkIdType nx = this->Histogram->GetNumberOfTuples();
+  int nx = this->Histogram->GetNumberOfTuples();
   vtkIdType *histogram = this->Histogram->GetPointer(0);
   for (int ix = 0; ix < nx; ++ix)
     {
diff --git a/Infovis/BoostGraphAlgorithms/module.cmake b/Infovis/BoostGraphAlgorithms/module.cmake
index a973f02..f4bcf69 100644
--- a/Infovis/BoostGraphAlgorithms/module.cmake
+++ b/Infovis/BoostGraphAlgorithms/module.cmake
@@ -8,6 +8,7 @@ vtk_module(vtkInfovisBoostGraphAlgorithms
     vtkInteractionStyle
     vtkIOInfovis
     vtkViewsInfovis
+    vtkRenderingFreeType${VTK_RENDERING_BACKEND}
     vtkChartsCore
     vtkViewsContext2D
   )
diff --git a/Infovis/Core/vtkThresholdTable.cxx b/Infovis/Core/vtkThresholdTable.cxx
index 6fe985e..2410152 100644
--- a/Infovis/Core/vtkThresholdTable.cxx
+++ b/Infovis/Core/vtkThresholdTable.cxx
@@ -49,19 +49,14 @@ void vtkThresholdTable::PrintSelf(ostream& os, vtkIndent indent)
     {
     case ACCEPT_LESS_THAN:
       os << "Accept less than";
-      break;
     case ACCEPT_GREATER_THAN:
       os << "Accept greater than";
-      break;
     case ACCEPT_BETWEEN:
       os << "Accept between";
-      break;
     case ACCEPT_OUTSIDE:
       os << "Accept outside";
-      break;
     default:
       os << "Undefined";
-      break;
     }
   os << endl;
 }
diff --git a/Infovis/Layout/vtkCirclePackFrontChainLayoutStrategy.cxx b/Infovis/Layout/vtkCirclePackFrontChainLayoutStrategy.cxx
index 1702e17..43f305e 100644
--- a/Infovis/Layout/vtkCirclePackFrontChainLayoutStrategy.cxx
+++ b/Infovis/Layout/vtkCirclePackFrontChainLayoutStrategy.cxx
@@ -436,8 +436,8 @@ void vtkCirclePackFrontChainLayoutStrategyImplementation::packBrotherNodes(std::
       }
     }
 
-  double scaleFactor = (layoutRadius == 0) ? 1.0 : (enclosingCircleRadius/layoutRadius);
-
+  double scaleFactor = enclosingCircleRadius/layoutRadius;
+  if (layoutRadius == 0) scaleFactor = 1;
   // Scale and translate each circle
   for(int i = 0;i < (int) packedNodes.size();i++)
     {
diff --git a/Infovis/Layout/vtkCosmicTreeLayoutStrategy.cxx b/Infovis/Layout/vtkCosmicTreeLayoutStrategy.cxx
index d7973b2..2e5a7ae 100644
--- a/Infovis/Layout/vtkCosmicTreeLayoutStrategy.cxx
+++ b/Infovis/Layout/vtkCosmicTreeLayoutStrategy.cxx
@@ -438,7 +438,7 @@ void vtkCosmicTreeLayoutStrategy::LayoutChildren(
     // Unit size means we can stop descending when depth == 0... all entries in radii are initialized to 1.0
     if ( depth < 0 && this->LayoutDepth >= 0 )
       return;
-    VTK_FALLTHROUGH;
+    // fall through:
   case LEAVES:
     // We must descend all the way down to the leaves, regardless of LayoutDepth.
     for ( childIdx = 0; childIdx < numberOfChildren; ++ childIdx )
diff --git a/Interaction/Widgets/CMakeLists.txt b/Interaction/Widgets/CMakeLists.txt
index 2fbd745..561f8b8 100644
--- a/Interaction/Widgets/CMakeLists.txt
+++ b/Interaction/Widgets/CMakeLists.txt
@@ -42,7 +42,6 @@ set(Module_SRCS
   vtkContourLineInterpolator.cxx
   vtkContourRepresentation.cxx
   vtkContourWidget.cxx
-  vtkCurveRepresentation.cxx
   vtkDijkstraImageContourLineInterpolator.cxx
   vtkDistanceRepresentation2D.cxx
   vtkDistanceRepresentation3D.cxx
@@ -86,8 +85,6 @@ set(Module_SRCS
   vtkPolyDataContourLineInterpolator.cxx
   vtkPolyDataPointPlacer.cxx
   vtkPolyDataSourceWidget.cxx
-  vtkPolyLineRepresentation.cxx
-  vtkPolyLineWidget.cxx
   vtkPolygonalHandleRepresentation3D.cxx
   vtkPolygonalSurfaceContourLineInterpolator.cxx
   vtkPolygonalSurfacePointPlacer.cxx
@@ -145,7 +142,6 @@ set_source_files_properties(
   vtkContinuousValueWidgetRepresentation
   vtkContourLineInterpolator
   vtkContourRepresentation
-  vtkCurveRepresentation
   vtkFocalPlaneContourRepresentation
   vtkDistanceRepresentation
   vtkHandleRepresentation
diff --git a/Interaction/Widgets/Testing/Cxx/CMakeLists.txt b/Interaction/Widgets/Testing/Cxx/CMakeLists.txt
index 578d17f..15a32d5 100644
--- a/Interaction/Widgets/Testing/Cxx/CMakeLists.txt
+++ b/Interaction/Widgets/Testing/Cxx/CMakeLists.txt
@@ -72,11 +72,8 @@ vtk_add_test_cxx(${vtk-module}CxxTests no_valid_tests
   vtkHoverWidgetTest1.cxx
   vtkLineRepresentationTest1.cxx
   vtkLineWidget2Test1.cxx
-  vtkPolyLineRepresentationTest1.cxx
-  vtkPolyLineWidgetTest1.cxx
   vtkSeedRepresentationTest1.cxx
   vtkSeedWidgetTest1.cxx
-  vtkSplineRepresentationTest1.cxx
   vtkSplineWidget2Test1.cxx
   vtkTextRepresentationTest1.cxx
   vtkTextWidgetTest1.cxx
@@ -138,12 +135,3 @@ if(NOT VTK_OPENGL_HAS_OSMESA)
   set_tests_properties(${vtk-module}Cxx-TestPickingManagerSeedWidget
     PROPERTIES TIMEOUT ${VTK_TEST_TIMEOUT_TestPickingManagerSeedWidget})
 endif()
-
-# On some machines this test takes ~220 seconds to complete, allow for some
-# extra time
-if(NOT VTK_TEST_TIMEOUT_TestSphereHandleWidget)
-  set(VTK_TEST_TIMEOUT_TestSphereHandleWidget 300)
-endif()
-set_tests_properties(${vtk-module}Cxx-TestSphereHandleWidget
-    PROPERTIES TIMEOUT ${VTK_TEST_TIMEOUT_TestSphereHandleWidget}
-               RUN_SERIAL ON)
diff --git a/Interaction/Widgets/Testing/Cxx/ImagePlaneWidget.cxx b/Interaction/Widgets/Testing/Cxx/ImagePlaneWidget.cxx
index fada626..60e1a8e 100644
--- a/Interaction/Widgets/Testing/Cxx/ImagePlaneWidget.cxx
+++ b/Interaction/Widgets/Testing/Cxx/ImagePlaneWidget.cxx
@@ -36,7 +36,7 @@
 
 #include "vtkTestUtilities.h"
 
-static char IPWeventLog[] =
+char IPWeventLog[] =
   "# StreamVersion 1\n"
   "CharEvent 179 195 0 0 98 1 i\n"
   "MiddleButtonPressEvent 179 195 0 0 0 0 i\n"
diff --git a/Interaction/Widgets/Testing/Cxx/TerrainPolylineEditor.cxx b/Interaction/Widgets/Testing/Cxx/TerrainPolylineEditor.cxx
index 3c05eee..eb46eb5 100644
--- a/Interaction/Widgets/Testing/Cxx/TerrainPolylineEditor.cxx
+++ b/Interaction/Widgets/Testing/Cxx/TerrainPolylineEditor.cxx
@@ -44,133 +44,652 @@ const char TerrainPolylineEditorLog[] =
 "# StreamVersion 1\n"
 "EnterEvent 522 259 0 0 0 0 0 i\n"
 "MouseMoveEvent 446 277 0 0 0 0 0 i\n"
+"MouseMoveEvent 392 287 0 0 0 0 0 i\n"
+"MouseMoveEvent 348 301 0 0 0 0 0 i\n"
+"MouseMoveEvent 310 309 0 0 0 0 0 i\n"
+"MouseMoveEvent 292 323 0 0 0 0 0 i\n"
+"MouseMoveEvent 282 351 0 0 0 0 0 i\n"
+"MouseMoveEvent 278 365 0 0 0 0 0 i\n"
+"MouseMoveEvent 278 366 0 0 0 0 0 i\n"
+"MouseMoveEvent 304 348 0 0 0 0 0 i\n"
+"MouseMoveEvent 324 332 0 0 0 0 0 i\n"
+"MouseMoveEvent 330 318 0 0 0 0 0 i\n"
+"MouseMoveEvent 330 306 0 0 0 0 0 i\n"
+"MouseMoveEvent 312 296 0 0 0 0 0 i\n"
+"MouseMoveEvent 284 302 0 0 0 0 0 i\n"
+"MouseMoveEvent 260 308 0 0 0 0 0 i\n"
+"MouseMoveEvent 232 312 0 0 0 0 0 i\n"
+"MouseMoveEvent 204 316 0 0 0 0 0 i\n"
+"MouseMoveEvent 182 320 0 0 0 0 0 i\n"
 "MouseMoveEvent 166 322 0 0 0 0 0 i\n"
+"MouseMoveEvent 156 322 0 0 0 0 0 i\n"
+"MouseMoveEvent 148 322 0 0 0 0 0 i\n"
+"MouseMoveEvent 147 321 0 0 0 0 0 i\n"
+"MouseMoveEvent 146 321 0 0 0 0 0 i\n"
+"MouseMoveEvent 145 320 0 0 0 0 0 i\n"
+"MouseMoveEvent 144 320 0 0 0 0 0 i\n"
+"MouseMoveEvent 143 320 0 0 0 0 0 i\n"
+"MouseMoveEvent 140 320 0 0 0 0 0 i\n"
+"MouseMoveEvent 137 320 0 0 0 0 0 i\n"
+"MouseMoveEvent 136 320 0 0 0 0 0 i\n"
+"MouseMoveEvent 135 320 0 0 0 0 0 i\n"
+"MouseMoveEvent 135 321 0 0 0 0 0 i\n"
+"MouseMoveEvent 135 322 0 0 0 0 0 i\n"
+"MouseMoveEvent 135 323 0 0 0 0 0 i\n"
+"MouseMoveEvent 135 324 0 0 0 0 0 i\n"
+"MouseMoveEvent 135 326 0 0 0 0 0 i\n"
+"MouseMoveEvent 135 327 0 0 0 0 0 i\n"
+"MouseMoveEvent 136 328 0 0 0 0 0 i\n"
+"MouseMoveEvent 136 330 0 0 0 0 0 i\n"
+"MouseMoveEvent 137 331 0 0 0 0 0 i\n"
+"MouseMoveEvent 138 332 0 0 0 0 0 i\n"
 "MouseMoveEvent 138 333 0 0 0 0 0 i\n"
 "LeftButtonPressEvent 138 333 0 0 0 0 0 i\n"
 "LeftButtonReleaseEvent 138 333 0 0 0 0 0 i\n"
 "MouseMoveEvent 170 338 0 0 0 0 0 i\n"
+"MouseMoveEvent 176 336 0 0 0 0 0 i\n"
+"MouseMoveEvent 178 336 0 0 0 0 0 i\n"
+"MouseMoveEvent 180 336 0 0 0 0 0 i\n"
+"MouseMoveEvent 181 336 0 0 0 0 0 i\n"
+"MouseMoveEvent 182 336 0 0 0 0 0 i\n"
+"MouseMoveEvent 183 336 0 0 0 0 0 i\n"
 "MouseMoveEvent 184 336 0 0 0 0 0 i\n"
+"MouseMoveEvent 185 336 0 0 0 0 0 i\n"
+"MouseMoveEvent 186 336 0 0 0 0 0 i\n"
+"MouseMoveEvent 188 336 0 0 0 0 0 i\n"
+"MouseMoveEvent 189 336 0 0 0 0 0 i\n"
+"MouseMoveEvent 189 335 0 0 0 0 0 i\n"
 "MouseMoveEvent 190 335 0 0 0 0 0 i\n"
 "LeftButtonPressEvent 190 335 0 0 0 0 0 i\n"
 "LeftButtonReleaseEvent 190 335 0 0 0 0 0 i\n"
 "MouseMoveEvent 234 328 0 0 0 0 0 i\n"
+"MouseMoveEvent 235 328 0 0 0 0 0 i\n"
 "MouseMoveEvent 235 327 0 0 0 0 0 i\n"
 "LeftButtonPressEvent 235 327 0 0 0 0 0 i\n"
 "LeftButtonReleaseEvent 235 327 0 0 0 0 0 i\n"
 "MouseMoveEvent 263 310 0 0 0 0 0 i\n"
+"MouseMoveEvent 265 309 0 0 0 0 0 i\n"
+"MouseMoveEvent 266 308 0 0 0 0 0 i\n"
+"MouseMoveEvent 267 308 0 0 0 0 0 i\n"
 "MouseMoveEvent 267 307 0 0 0 0 0 i\n"
 "LeftButtonPressEvent 267 307 0 0 0 0 0 i\n"
 "LeftButtonReleaseEvent 267 307 0 0 0 0 0 i\n"
 "MouseMoveEvent 270 294 0 0 0 0 0 i\n"
+"MouseMoveEvent 271 294 0 0 0 0 0 i\n"
+"MouseMoveEvent 271 293 0 0 0 0 0 i\n"
+"MouseMoveEvent 271 291 0 0 0 0 0 i\n"
+"MouseMoveEvent 271 290 0 0 0 0 0 i\n"
 "MouseMoveEvent 271 289 0 0 0 0 0 i\n"
+"MouseMoveEvent 271 287 0 0 0 0 0 i\n"
+"MouseMoveEvent 271 286 0 0 0 0 0 i\n"
+"MouseMoveEvent 271 285 0 0 0 0 0 i\n"
+"MouseMoveEvent 271 284 0 0 0 0 0 i\n"
+"MouseMoveEvent 271 283 0 0 0 0 0 i\n"
+"MouseMoveEvent 272 282 0 0 0 0 0 i\n"
 "MouseMoveEvent 272 281 0 0 0 0 0 i\n"
 "LeftButtonPressEvent 272 281 0 0 0 0 0 i\n"
 "MouseMoveEvent 281 263 0 0 0 0 0 i\n"
 "LeftButtonReleaseEvent 272 280 0 0 0 0 0 i\n"
 "MouseMoveEvent 281 263 0 0 0 0 0 i\n"
+"MouseMoveEvent 283 262 0 0 0 0 0 i\n"
+"MouseMoveEvent 285 262 0 0 0 0 0 i\n"
+"MouseMoveEvent 287 261 0 0 0 0 0 i\n"
+"MouseMoveEvent 288 259 0 0 0 0 0 i\n"
+"MouseMoveEvent 290 259 0 0 0 0 0 i\n"
 "MouseMoveEvent 290 258 0 0 0 0 0 i\n"
 "MouseMoveEvent 291 258 0 0 0 0 0 i\n"
 "LeftButtonPressEvent 291 258 0 0 0 0 0 i\n"
 "LeftButtonReleaseEvent 291 258 0 0 0 0 0 i\n"
 "MouseMoveEvent 335 251 0 0 0 0 0 i\n"
+"MouseMoveEvent 338 251 0 0 0 0 0 i\n"
+"MouseMoveEvent 341 251 0 0 0 0 0 i\n"
+"MouseMoveEvent 343 251 0 0 0 0 0 i\n"
+"MouseMoveEvent 346 251 0 0 0 0 0 i\n"
+"MouseMoveEvent 348 251 0 0 0 0 0 i\n"
 "MouseMoveEvent 350 251 0 0 0 0 0 i\n"
+"MouseMoveEvent 351 251 0 0 0 0 0 i\n"
+"MouseMoveEvent 353 251 0 0 0 0 0 i\n"
 "MouseMoveEvent 354 251 0 0 0 0 0 i\n"
 "LeftButtonPressEvent 354 251 0 0 0 0 0 i\n"
 "LeftButtonReleaseEvent 354 251 0 0 0 0 0 i\n"
 "MouseMoveEvent 440 247 0 0 0 0 0 i\n"
+"MouseMoveEvent 441 248 0 0 0 0 0 i\n"
+"MouseMoveEvent 442 248 0 0 0 0 0 i\n"
+"MouseMoveEvent 442 249 0 0 0 0 0 i\n"
+"MouseMoveEvent 442 250 0 0 0 0 0 i\n"
+"MouseMoveEvent 442 251 0 0 0 0 0 i\n"
+"MouseMoveEvent 442 252 0 0 0 0 0 i\n"
+"MouseMoveEvent 442 253 0 0 0 0 0 i\n"
+"MouseMoveEvent 440 254 0 0 0 0 0 i\n"
+"MouseMoveEvent 439 255 0 0 0 0 0 i\n"
+"MouseMoveEvent 438 255 0 0 0 0 0 i\n"
 "MouseMoveEvent 437 256 0 0 0 0 0 i\n"
+"MouseMoveEvent 437 257 0 0 0 0 0 i\n"
+"MouseMoveEvent 437 258 0 0 0 0 0 i\n"
+"MouseMoveEvent 437 259 0 0 0 0 0 i\n"
+"MouseMoveEvent 437 260 0 0 0 0 0 i\n"
+"MouseMoveEvent 438 261 0 0 0 0 0 i\n"
+"MouseMoveEvent 438 262 0 0 0 0 0 i\n"
 "MouseMoveEvent 438 263 0 0 0 0 0 i\n"
 "LeftButtonPressEvent 438 263 0 0 0 0 0 i\n"
 "MouseMoveEvent 472 252 0 0 0 0 0 i\n"
 "LeftButtonReleaseEvent 439 263 0 0 0 0 0 i\n"
 "MouseMoveEvent 472 252 0 0 0 0 0 i\n"
+"MouseMoveEvent 473 252 0 0 0 0 0 i\n"
+"MouseMoveEvent 474 252 0 0 0 0 0 i\n"
+"MouseMoveEvent 474 251 0 0 0 0 0 i\n"
+"MouseMoveEvent 475 251 0 0 0 0 0 i\n"
 "MouseMoveEvent 475 250 0 0 0 0 0 i\n"
 "MouseMoveEvent 475 249 0 0 0 0 0 i\n"
 "LeftButtonPressEvent 475 249 0 0 0 0 0 i\n"
 "LeftButtonReleaseEvent 475 249 0 0 0 0 0 i\n"
 "MouseMoveEvent 475 248 0 0 0 0 0 i\n"
+"MouseMoveEvent 475 247 0 0 0 0 0 i\n"
+"MouseMoveEvent 475 246 0 0 0 0 0 i\n"
+"MouseMoveEvent 475 245 0 0 0 0 0 i\n"
+"MouseMoveEvent 475 243 0 0 0 0 0 i\n"
+"MouseMoveEvent 475 241 0 0 0 0 0 i\n"
+"MouseMoveEvent 474 239 0 0 0 0 0 i\n"
+"MouseMoveEvent 474 237 0 0 0 0 0 i\n"
+"MouseMoveEvent 474 236 0 0 0 0 0 i\n"
+"MouseMoveEvent 475 236 0 0 0 0 0 i\n"
+"MouseMoveEvent 476 237 0 0 0 0 0 i\n"
+"MouseMoveEvent 477 238 0 0 0 0 0 i\n"
+"MouseMoveEvent 478 239 0 0 0 0 0 i\n"
+"MouseMoveEvent 479 239 0 0 0 0 0 i\n"
+"MouseMoveEvent 480 239 0 0 0 0 0 i\n"
+"MouseMoveEvent 481 239 0 0 0 0 0 i\n"
+"MouseMoveEvent 483 239 0 0 0 0 0 i\n"
+"MouseMoveEvent 485 239 0 0 0 0 0 i\n"
+"MouseMoveEvent 487 239 0 0 0 0 0 i\n"
+"MouseMoveEvent 489 239 0 0 0 0 0 i\n"
 "MouseMoveEvent 491 239 0 0 0 0 0 i\n"
+"MouseMoveEvent 492 239 0 0 0 0 0 i\n"
+"MouseMoveEvent 493 239 0 0 0 0 0 i\n"
+"MouseMoveEvent 494 239 0 0 0 0 0 i\n"
+"MouseMoveEvent 495 240 0 0 0 0 0 i\n"
+"MouseMoveEvent 496 240 0 0 0 0 0 i\n"
+"MouseMoveEvent 498 240 0 0 0 0 0 i\n"
+"MouseMoveEvent 499 240 0 0 0 0 0 i\n"
+"MouseMoveEvent 500 240 0 0 0 0 0 i\n"
+"MouseMoveEvent 501 240 0 0 0 0 0 i\n"
+"MouseMoveEvent 503 240 0 0 0 0 0 i\n"
+"MouseMoveEvent 504 239 0 0 0 0 0 i\n"
+"MouseMoveEvent 506 239 0 0 0 0 0 i\n"
+"MouseMoveEvent 507 238 0 0 0 0 0 i\n"
+"MouseMoveEvent 508 238 0 0 0 0 0 i\n"
+"MouseMoveEvent 509 238 0 0 0 0 0 i\n"
+"MouseMoveEvent 510 238 0 0 0 0 0 i\n"
 "MouseMoveEvent 511 238 0 0 0 0 0 i\n"
 "LeftButtonPressEvent 511 238 0 0 0 0 0 i\n"
 "LeftButtonReleaseEvent 511 238 0 0 0 0 0 i\n"
 "MouseMoveEvent 541 217 0 0 0 0 0 i\n"
+"MouseMoveEvent 542 217 0 0 0 0 0 i\n"
+"MouseMoveEvent 543 216 0 0 0 0 0 i\n"
+"MouseMoveEvent 543 215 0 0 0 0 0 i\n"
+"MouseMoveEvent 543 214 0 0 0 0 0 i\n"
 "MouseMoveEvent 544 213 0 0 0 0 0 i\n"
 "MouseMoveEvent 544 212 0 0 0 0 0 i\n"
 "LeftButtonPressEvent 544 212 0 0 0 0 0 i\n"
 "LeftButtonReleaseEvent 544 212 0 0 0 0 0 i\n"
 "MouseMoveEvent 542 209 0 0 0 0 0 i\n"
+"MouseMoveEvent 541 208 0 0 0 0 0 i\n"
+"MouseMoveEvent 540 206 0 0 0 0 0 i\n"
+"MouseMoveEvent 540 205 0 0 0 0 0 i\n"
+"MouseMoveEvent 539 205 0 0 0 0 0 i\n"
+"MouseMoveEvent 538 204 0 0 0 0 0 i\n"
+"MouseMoveEvent 537 203 0 0 0 0 0 i\n"
+"MouseMoveEvent 536 202 0 0 0 0 0 i\n"
+"MouseMoveEvent 536 201 0 0 0 0 0 i\n"
+"MouseMoveEvent 535 201 0 0 0 0 0 i\n"
+"MouseMoveEvent 534 200 0 0 0 0 0 i\n"
+"MouseMoveEvent 533 200 0 0 0 0 0 i\n"
+"MouseMoveEvent 532 199 0 0 0 0 0 i\n"
+"MouseMoveEvent 532 198 0 0 0 0 0 i\n"
 "MouseMoveEvent 531 198 0 0 0 0 0 i\n"
+"MouseMoveEvent 529 197 0 0 0 0 0 i\n"
+"MouseMoveEvent 528 197 0 0 0 0 0 i\n"
+"MouseMoveEvent 527 197 0 0 0 0 0 i\n"
+"MouseMoveEvent 528 197 0 0 0 0 0 i\n"
+"MouseMoveEvent 530 198 0 0 0 0 0 i\n"
+"MouseMoveEvent 534 202 0 0 0 0 0 i\n"
+"MouseMoveEvent 540 204 0 0 0 0 0 i\n"
+"MouseMoveEvent 541 204 0 0 0 0 0 i\n"
+"MouseMoveEvent 543 205 0 0 0 0 0 i\n"
+"MouseMoveEvent 544 206 0 0 0 0 0 i\n"
+"MouseMoveEvent 545 206 0 0 0 0 0 i\n"
+"MouseMoveEvent 546 207 0 0 0 0 0 i\n"
+"MouseMoveEvent 547 207 0 0 0 0 0 i\n"
+"MouseMoveEvent 548 207 0 0 0 0 0 i\n"
+"MouseMoveEvent 550 207 0 0 0 0 0 i\n"
+"MouseMoveEvent 551 207 0 0 0 0 0 i\n"
+"MouseMoveEvent 552 207 0 0 0 0 0 i\n"
+"MouseMoveEvent 553 207 0 0 0 0 0 i\n"
 "MouseMoveEvent 553 208 0 0 0 0 0 i\n"
+"MouseMoveEvent 553 209 0 0 0 0 0 i\n"
 "MouseMoveEvent 554 209 0 0 0 0 0 i\n"
 "RightButtonPressEvent 554 209 0 0 0 0 0 i\n"
 "RightButtonReleaseEvent 554 209 0 0 0 0 0 i\n"
 "MouseMoveEvent 533 200 0 0 0 0 0 i\n"
+"MouseMoveEvent 523 198 0 0 0 0 0 i\n"
+"MouseMoveEvent 509 194 0 0 0 0 0 i\n"
+"MouseMoveEvent 493 194 0 0 0 0 0 i\n"
+"MouseMoveEvent 477 194 0 0 0 0 0 i\n"
+"MouseMoveEvent 461 192 0 0 0 0 0 i\n"
+"MouseMoveEvent 445 192 0 0 0 0 0 i\n"
+"MouseMoveEvent 429 192 0 0 0 0 0 i\n"
+"MouseMoveEvent 415 192 0 0 0 0 0 i\n"
+"MouseMoveEvent 403 192 0 0 0 0 0 i\n"
+"MouseMoveEvent 391 192 0 0 0 0 0 i\n"
+"MouseMoveEvent 381 192 0 0 0 0 0 i\n"
+"MouseMoveEvent 369 192 0 0 0 0 0 i\n"
+"MouseMoveEvent 359 192 0 0 0 0 0 i\n"
+"MouseMoveEvent 349 196 0 0 0 0 0 i\n"
+"MouseMoveEvent 341 198 0 0 0 0 0 i\n"
+"MouseMoveEvent 333 200 0 0 0 0 0 i\n"
+"MouseMoveEvent 327 202 0 0 0 0 0 i\n"
+"MouseMoveEvent 319 206 0 0 0 0 0 i\n"
+"MouseMoveEvent 311 208 0 0 0 0 0 i\n"
+"MouseMoveEvent 303 212 0 0 0 0 0 i\n"
+"MouseMoveEvent 301 213 0 0 0 0 0 i\n"
+"MouseMoveEvent 295 215 0 0 0 0 0 i\n"
+"MouseMoveEvent 293 215 0 0 0 0 0 i\n"
+"MouseMoveEvent 291 216 0 0 0 0 0 i\n"
+"MouseMoveEvent 291 217 0 0 0 0 0 i\n"
+"MouseMoveEvent 290 219 0 0 0 0 0 i\n"
+"MouseMoveEvent 284 221 0 0 0 0 0 i\n"
+"MouseMoveEvent 278 227 0 0 0 0 0 i\n"
+"MouseMoveEvent 270 233 0 0 0 0 0 i\n"
+"MouseMoveEvent 260 241 0 0 0 0 0 i\n"
+"MouseMoveEvent 250 247 0 0 0 0 0 i\n"
+"MouseMoveEvent 240 251 0 0 0 0 0 i\n"
 "MouseMoveEvent 230 257 0 0 0 0 0 i\n"
+"MouseMoveEvent 224 261 0 0 0 0 0 i\n"
+"MouseMoveEvent 220 267 0 0 0 0 0 i\n"
+"MouseMoveEvent 216 271 0 0 0 0 0 i\n"
+"MouseMoveEvent 212 275 0 0 0 0 0 i\n"
+"MouseMoveEvent 212 277 0 0 0 0 0 i\n"
+"MouseMoveEvent 212 279 0 0 0 0 0 i\n"
+"MouseMoveEvent 212 280 0 0 0 0 0 i\n"
+"MouseMoveEvent 212 281 0 0 0 0 0 i\n"
+"MouseMoveEvent 212 282 0 0 0 0 0 i\n"
+"MouseMoveEvent 212 283 0 0 0 0 0 i\n"
+"MouseMoveEvent 212 284 0 0 0 0 0 i\n"
+"MouseMoveEvent 212 285 0 0 0 0 0 i\n"
+"MouseMoveEvent 211 285 0 0 0 0 0 i\n"
+"MouseMoveEvent 210 285 0 0 0 0 0 i\n"
+"MouseMoveEvent 209 285 0 0 0 0 0 i\n"
+"MouseMoveEvent 208 285 0 0 0 0 0 i\n"
+"MouseMoveEvent 208 287 0 0 0 0 0 i\n"
+"MouseMoveEvent 210 295 0 0 0 0 0 i\n"
+"MouseMoveEvent 214 303 0 0 0 0 0 i\n"
+"MouseMoveEvent 218 311 0 0 0 0 0 i\n"
+"MouseMoveEvent 224 315 0 0 0 0 0 i\n"
+"MouseMoveEvent 228 319 0 0 0 0 0 i\n"
+"MouseMoveEvent 232 323 0 0 0 0 0 i\n"
+"MouseMoveEvent 233 324 0 0 0 0 0 i\n"
+"MouseMoveEvent 234 325 0 0 0 0 0 i\n"
+"MouseMoveEvent 236 325 0 0 0 0 0 i\n"
 "MouseMoveEvent 237 325 0 0 0 0 0 i\n"
+"MouseMoveEvent 238 325 0 0 0 0 0 i\n"
+"MouseMoveEvent 241 325 0 0 0 0 0 i\n"
+"MouseMoveEvent 243 325 0 0 0 0 0 i\n"
+"MouseMoveEvent 245 325 0 0 0 0 0 i\n"
+"MouseMoveEvent 246 325 0 0 0 0 0 i\n"
+"MouseMoveEvent 247 325 0 0 0 0 0 i\n"
+"MouseMoveEvent 248 325 0 0 0 0 0 i\n"
+"MouseMoveEvent 249 324 0 0 0 0 0 i\n"
+"MouseMoveEvent 250 322 0 0 0 0 0 i\n"
+"MouseMoveEvent 252 322 0 0 0 0 0 i\n"
+"MouseMoveEvent 253 320 0 0 0 0 0 i\n"
+"MouseMoveEvent 254 318 0 0 0 0 0 i\n"
+"MouseMoveEvent 256 317 0 0 0 0 0 i\n"
+"MouseMoveEvent 257 316 0 0 0 0 0 i\n"
+"MouseMoveEvent 258 314 0 0 0 0 0 i\n"
+"MouseMoveEvent 260 314 0 0 0 0 0 i\n"
 "MouseMoveEvent 261 314 0 0 0 0 0 i\n"
+"MouseMoveEvent 261 313 0 0 0 0 0 i\n"
+"MouseMoveEvent 262 313 0 0 0 0 0 i\n"
+"MouseMoveEvent 263 313 0 0 0 0 0 i\n"
+"MouseMoveEvent 264 313 0 0 0 0 0 i\n"
+"MouseMoveEvent 265 313 0 0 0 0 0 i\n"
 "MouseMoveEvent 266 313 0 0 0 0 0 i\n"
 "LeftButtonPressEvent 266 313 0 0 0 0 0 i\n"
 "MouseMoveEvent 267 313 0 0 0 0 0 i\n"
+"MouseMoveEvent 297 311 0 0 0 0 0 i\n"
+"MouseMoveEvent 306 314 0 0 0 0 0 i\n"
+"MouseMoveEvent 307 315 0 0 0 0 0 i\n"
+"MouseMoveEvent 308 315 0 0 0 0 0 i\n"
+"MouseMoveEvent 310 315 0 0 0 0 0 i\n"
 "MouseMoveEvent 310 316 0 0 0 0 0 i\n"
+"MouseMoveEvent 299 318 0 0 0 0 0 i\n"
+"MouseMoveEvent 298 320 0 0 0 0 0 i\n"
+"MouseMoveEvent 298 319 0 0 0 0 0 i\n"
 "MouseMoveEvent 299 316 0 0 0 0 0 i\n"
 "LeftButtonReleaseEvent 299 316 0 0 0 0 0 i\n"
 "MouseMoveEvent 295 312 0 0 0 0 0 i\n"
+"MouseMoveEvent 294 310 0 0 0 0 0 i\n"
+"MouseMoveEvent 290 304 0 0 0 0 0 i\n"
+"MouseMoveEvent 286 296 0 0 0 0 0 i\n"
+"MouseMoveEvent 280 290 0 0 0 0 0 i\n"
+"MouseMoveEvent 276 282 0 0 0 0 0 i\n"
+"MouseMoveEvent 272 276 0 0 0 0 0 i\n"
+"MouseMoveEvent 272 273 0 0 0 0 0 i\n"
+"MouseMoveEvent 270 267 0 0 0 0 0 i\n"
+"MouseMoveEvent 269 266 0 0 0 0 0 i\n"
+"MouseMoveEvent 268 265 0 0 0 0 0 i\n"
+"MouseMoveEvent 268 263 0 0 0 0 0 i\n"
 "MouseMoveEvent 267 263 0 0 0 0 0 i\n"
+"MouseMoveEvent 267 262 0 0 0 0 0 i\n"
+"MouseMoveEvent 267 261 0 0 0 0 0 i\n"
+"MouseMoveEvent 267 260 0 0 0 0 0 i\n"
+"MouseMoveEvent 267 259 0 0 0 0 0 i\n"
+"MouseMoveEvent 267 258 0 0 0 0 0 i\n"
+"MouseMoveEvent 267 257 0 0 0 0 0 i\n"
+"MouseMoveEvent 269 257 0 0 0 0 0 i\n"
+"MouseMoveEvent 270 257 0 0 0 0 0 i\n"
+"MouseMoveEvent 271 257 0 0 0 0 0 i\n"
+"MouseMoveEvent 273 257 0 0 0 0 0 i\n"
+"MouseMoveEvent 274 257 0 0 0 0 0 i\n"
 "MouseMoveEvent 274 258 0 0 0 0 0 i\n"
+"MouseMoveEvent 275 258 0 0 0 0 0 i\n"
+"MouseMoveEvent 275 259 0 0 0 0 0 i\n"
+"MouseMoveEvent 276 259 0 0 0 0 0 i\n"
+"MouseMoveEvent 277 260 0 0 0 0 0 i\n"
+"MouseMoveEvent 278 260 0 0 0 0 0 i\n"
+"MouseMoveEvent 279 261 0 0 0 0 0 i\n"
+"MouseMoveEvent 281 261 0 0 0 0 0 i\n"
+"MouseMoveEvent 282 261 0 0 0 0 0 i\n"
+"MouseMoveEvent 283 261 0 0 0 0 0 i\n"
+"MouseMoveEvent 284 261 0 0 0 0 0 i\n"
+"MouseMoveEvent 285 261 0 0 0 0 0 i\n"
 "MouseMoveEvent 285 262 0 0 0 0 0 i\n"
+"MouseMoveEvent 284 263 0 0 0 0 0 i\n"
 "MouseMoveEvent 285 263 0 0 0 0 0 i\n"
 "LeftButtonPressEvent 285 263 0 0 0 0 0 i\n"
 "MouseMoveEvent 286 262 0 0 0 0 0 i\n"
+"MouseMoveEvent 290 262 0 0 0 0 0 i\n"
+"MouseMoveEvent 310 265 0 0 0 0 0 i\n"
 "MouseMoveEvent 314 266 0 0 0 0 0 i\n"
 "LeftButtonReleaseEvent 314 266 0 0 0 0 0 i\n"
 "MouseMoveEvent 316 266 0 0 0 0 0 i\n"
+"MouseMoveEvent 319 266 0 0 0 0 0 i\n"
+"MouseMoveEvent 327 266 0 0 0 0 0 i\n"
+"MouseMoveEvent 335 264 0 0 0 0 0 i\n"
+"MouseMoveEvent 341 262 0 0 0 0 0 i\n"
+"MouseMoveEvent 342 262 0 0 0 0 0 i\n"
+"MouseMoveEvent 341 263 0 0 0 0 0 i\n"
+"MouseMoveEvent 335 265 0 0 0 0 0 i\n"
+"MouseMoveEvent 323 269 0 0 0 0 0 i\n"
+"MouseMoveEvent 307 273 0 0 0 0 0 i\n"
+"MouseMoveEvent 287 281 0 0 0 0 0 i\n"
+"MouseMoveEvent 265 289 0 0 0 0 0 i\n"
+"MouseMoveEvent 239 297 0 0 0 0 0 i\n"
 "MouseMoveEvent 217 305 0 0 0 0 0 i\n"
+"MouseMoveEvent 197 313 0 0 0 0 0 i\n"
+"MouseMoveEvent 177 321 0 0 0 0 0 i\n"
+"MouseMoveEvent 165 327 0 0 0 0 0 i\n"
+"MouseMoveEvent 153 329 0 0 0 0 0 i\n"
+"MouseMoveEvent 151 330 0 0 0 0 0 i\n"
+"MouseMoveEvent 149 330 0 0 0 0 0 i\n"
+"MouseMoveEvent 148 330 0 0 0 0 0 i\n"
+"MouseMoveEvent 147 330 0 0 0 0 0 i\n"
+"MouseMoveEvent 145 330 0 0 0 0 0 i\n"
+"MouseMoveEvent 144 330 0 0 0 0 0 i\n"
+"MouseMoveEvent 143 331 0 0 0 0 0 i\n"
+"MouseMoveEvent 143 332 0 0 0 0 0 i\n"
+"MouseMoveEvent 143 333 0 0 0 0 0 i\n"
+"MouseMoveEvent 142 333 0 0 0 0 0 i\n"
+"MouseMoveEvent 141 334 0 0 0 0 0 i\n"
 "MouseMoveEvent 140 335 0 0 0 0 0 i\n"
+"MouseMoveEvent 139 336 0 0 0 0 0 i\n"
+"MouseMoveEvent 138 336 0 0 0 0 0 i\n"
+"MouseMoveEvent 138 337 0 0 0 0 0 i\n"
+"MouseMoveEvent 139 337 0 0 0 0 0 i\n"
+"MouseMoveEvent 141 337 0 0 0 0 0 i\n"
+"MouseMoveEvent 147 339 0 0 0 0 0 i\n"
+"MouseMoveEvent 159 339 0 0 0 0 0 i\n"
+"MouseMoveEvent 169 339 0 0 0 0 0 i\n"
+"MouseMoveEvent 179 339 0 0 0 0 0 i\n"
+"MouseMoveEvent 182 339 0 0 0 0 0 i\n"
+"MouseMoveEvent 184 339 0 0 0 0 0 i\n"
 "MouseMoveEvent 185 339 0 0 0 0 0 i\n"
+"MouseMoveEvent 186 339 0 0 0 0 0 i\n"
+"MouseMoveEvent 187 339 0 0 0 0 0 i\n"
+"MouseMoveEvent 189 339 0 0 0 0 0 i\n"
+"MouseMoveEvent 190 339 0 0 0 0 0 i\n"
 "MouseMoveEvent 191 339 0 0 0 0 0 i\n"
 "LeftButtonPressEvent 191 339 0 0 0 0 0 i\n"
 "MouseMoveEvent 191 340 0 0 0 0 0 i\n"
+"MouseMoveEvent 197 351 0 0 0 0 0 i\n"
 "MouseMoveEvent 199 353 0 0 0 0 0 i\n"
 "LeftButtonReleaseEvent 199 353 0 0 0 0 0 i\n"
 "MouseMoveEvent 199 351 0 0 0 0 0 i\n"
+"MouseMoveEvent 199 349 0 0 0 0 0 i\n"
+"MouseMoveEvent 199 347 0 0 0 0 0 i\n"
+"MouseMoveEvent 199 345 0 0 0 0 0 i\n"
+"MouseMoveEvent 199 344 0 0 0 0 0 i\n"
+"MouseMoveEvent 199 343 0 0 0 0 0 i\n"
+"MouseMoveEvent 199 342 0 0 0 0 0 i\n"
+"MouseMoveEvent 201 341 0 0 0 0 0 i\n"
+"MouseMoveEvent 207 337 0 0 0 0 0 i\n"
+"MouseMoveEvent 217 335 0 0 0 0 0 i\n"
+"MouseMoveEvent 227 331 0 0 0 0 0 i\n"
+"MouseMoveEvent 237 329 0 0 0 0 0 i\n"
+"MouseMoveEvent 243 327 0 0 0 0 0 i\n"
+"MouseMoveEvent 244 327 0 0 0 0 0 i\n"
+"MouseMoveEvent 243 327 0 0 0 0 0 i\n"
+"MouseMoveEvent 242 328 0 0 0 0 0 i\n"
+"MouseMoveEvent 241 328 0 0 0 0 0 i\n"
+"MouseMoveEvent 240 329 0 0 0 0 0 i\n"
+"MouseMoveEvent 240 330 0 0 0 0 0 i\n"
+"MouseMoveEvent 239 330 0 0 0 0 0 i\n"
+"MouseMoveEvent 238 331 0 0 0 0 0 i\n"
+"MouseMoveEvent 237 331 0 0 0 0 0 i\n"
+"MouseMoveEvent 236 332 0 0 0 0 0 i\n"
 "MouseMoveEvent 235 332 0 0 0 0 0 i\n"
 "MouseMoveEvent 235 333 0 0 0 0 0 i\n"
 "LeftButtonPressEvent 235 333 0 0 0 0 0 i\n"
 "MouseMoveEvent 235 332 0 0 0 0 0 i\n"
+"MouseMoveEvent 244 342 0 0 0 0 0 i\n"
+"MouseMoveEvent 248 345 0 0 0 0 0 i\n"
 "MouseMoveEvent 248 346 0 0 0 0 0 i\n"
 "LeftButtonReleaseEvent 248 346 0 0 0 0 0 i\n"
 "MouseMoveEvent 248 344 0 0 0 0 0 i\n"
+"MouseMoveEvent 248 342 0 0 0 0 0 i\n"
+"MouseMoveEvent 248 339 0 0 0 0 0 i\n"
+"MouseMoveEvent 246 331 0 0 0 0 0 i\n"
+"MouseMoveEvent 246 323 0 0 0 0 0 i\n"
 "MouseMoveEvent 246 313 0 0 0 0 0 i\n"
+"MouseMoveEvent 246 301 0 0 0 0 0 i\n"
+"MouseMoveEvent 246 291 0 0 0 0 0 i\n"
+"MouseMoveEvent 248 279 0 0 0 0 0 i\n"
+"MouseMoveEvent 252 269 0 0 0 0 0 i\n"
+"MouseMoveEvent 254 261 0 0 0 0 0 i\n"
+"MouseMoveEvent 256 253 0 0 0 0 0 i\n"
+"MouseMoveEvent 258 245 0 0 0 0 0 i\n"
+"MouseMoveEvent 258 243 0 0 0 0 0 i\n"
+"MouseMoveEvent 259 241 0 0 0 0 0 i\n"
+"MouseMoveEvent 259 240 0 0 0 0 0 i\n"
+"MouseMoveEvent 259 239 0 0 0 0 0 i\n"
 "MouseMoveEvent 259 238 0 0 0 0 0 i\n"
+"MouseMoveEvent 259 237 0 0 0 0 0 i\n"
+"MouseMoveEvent 259 236 0 0 0 0 0 i\n"
+"MouseMoveEvent 259 235 0 0 0 0 0 i\n"
+"MouseMoveEvent 259 234 0 0 0 0 0 i\n"
+"MouseMoveEvent 258 234 0 0 0 0 0 i\n"
+"MouseMoveEvent 258 233 0 0 0 0 0 i\n"
+"MouseMoveEvent 257 233 0 0 0 0 0 i\n"
+"MouseMoveEvent 257 232 0 0 0 0 0 i\n"
+"MouseMoveEvent 256 231 0 0 0 0 0 i\n"
+"MouseMoveEvent 256 229 0 0 0 0 0 i\n"
+"MouseMoveEvent 256 228 0 0 0 0 0 i\n"
+"MouseMoveEvent 256 226 0 0 0 0 0 i\n"
+"MouseMoveEvent 256 225 0 0 0 0 0 i\n"
+"MouseMoveEvent 258 224 0 0 0 0 0 i\n"
+"MouseMoveEvent 264 222 0 0 0 0 0 i\n"
+"MouseMoveEvent 276 218 0 0 0 0 0 i\n"
 "MouseMoveEvent 294 216 0 0 0 0 0 i\n"
+"MouseMoveEvent 320 212 0 0 0 0 0 i\n"
+"MouseMoveEvent 348 210 0 0 0 0 0 i\n"
+"MouseMoveEvent 380 208 0 0 0 0 0 i\n"
+"MouseMoveEvent 410 206 0 0 0 0 0 i\n"
+"MouseMoveEvent 438 206 0 0 0 0 0 i\n"
+"MouseMoveEvent 462 206 0 0 0 0 0 i\n"
+"MouseMoveEvent 478 206 0 0 0 0 0 i\n"
+"MouseMoveEvent 490 206 0 0 0 0 0 i\n"
+"MouseMoveEvent 493 206 0 0 0 0 0 i\n"
+"MouseMoveEvent 499 208 0 0 0 0 0 i\n"
+"MouseMoveEvent 502 208 0 0 0 0 0 i\n"
+"MouseMoveEvent 503 209 0 0 0 0 0 i\n"
+"MouseMoveEvent 504 209 0 0 0 0 0 i\n"
+"MouseMoveEvent 505 210 0 0 0 0 0 i\n"
 "MouseMoveEvent 506 211 0 0 0 0 0 i\n"
+"MouseMoveEvent 508 212 0 0 0 0 0 i\n"
+"MouseMoveEvent 510 212 0 0 0 0 0 i\n"
+"MouseMoveEvent 512 212 0 0 0 0 0 i\n"
+"MouseMoveEvent 515 212 0 0 0 0 0 i\n"
+"MouseMoveEvent 516 212 0 0 0 0 0 i\n"
+"MouseMoveEvent 517 212 0 0 0 0 0 i\n"
+"MouseMoveEvent 518 212 0 0 0 0 0 i\n"
+"MouseMoveEvent 519 212 0 0 0 0 0 i\n"
+"MouseMoveEvent 522 212 0 0 0 0 0 i\n"
+"MouseMoveEvent 524 212 0 0 0 0 0 i\n"
+"MouseMoveEvent 530 210 0 0 0 0 0 i\n"
+"MouseMoveEvent 538 208 0 0 0 0 0 i\n"
+"MouseMoveEvent 541 208 0 0 0 0 0 i\n"
 "MouseMoveEvent 547 206 0 0 0 0 0 i\n"
+"MouseMoveEvent 549 206 0 0 0 0 0 i\n"
+"MouseMoveEvent 550 206 0 0 0 0 0 i\n"
+"MouseMoveEvent 551 206 0 0 0 0 0 i\n"
+"MouseMoveEvent 552 206 0 0 0 0 0 i\n"
+"MouseMoveEvent 553 206 0 0 0 0 0 i\n"
+"MouseMoveEvent 554 206 0 0 0 0 0 i\n"
+"MouseMoveEvent 554 207 0 0 0 0 0 i\n"
+"MouseMoveEvent 554 208 0 0 0 0 0 i\n"
 "MouseMoveEvent 554 209 0 0 0 0 0 i\n"
 "MouseMoveEvent 555 210 0 0 0 0 0 i\n"
 "LeftButtonPressEvent 555 210 0 0 0 0 0 i\n"
 "MouseMoveEvent 555 209 0 0 0 0 0 i\n"
+"MouseMoveEvent 550 173 0 0 0 0 0 i\n"
+"MouseMoveEvent 544 155 0 0 0 0 0 i\n"
+"MouseMoveEvent 543 154 0 0 0 0 0 i\n"
+"MouseMoveEvent 542 152 0 0 0 0 0 i\n"
+"MouseMoveEvent 533 135 0 0 0 0 0 i\n"
+"MouseMoveEvent 519 122 0 0 0 0 0 i\n"
 "MouseMoveEvent 511 115 0 0 0 0 0 i\n"
 "MouseMoveEvent 510 114 0 0 0 0 0 i\n"
 "LeftButtonReleaseEvent 510 114 0 0 0 0 0 i\n"
 "MouseMoveEvent 512 115 0 0 0 0 0 i\n"
+"MouseMoveEvent 513 117 0 0 0 0 0 i\n"
+"MouseMoveEvent 515 118 0 0 0 0 0 i\n"
+"MouseMoveEvent 521 124 0 0 0 0 0 i\n"
+"MouseMoveEvent 525 132 0 0 0 0 0 i\n"
+"MouseMoveEvent 529 138 0 0 0 0 0 i\n"
+"MouseMoveEvent 530 140 0 0 0 0 0 i\n"
+"MouseMoveEvent 532 146 0 0 0 0 0 i\n"
+"MouseMoveEvent 533 148 0 0 0 0 0 i\n"
+"MouseMoveEvent 534 150 0 0 0 0 0 i\n"
+"MouseMoveEvent 534 153 0 0 0 0 0 i\n"
 "MouseMoveEvent 534 154 0 0 0 0 0 i\n"
+"MouseMoveEvent 534 157 0 0 0 0 0 i\n"
+"MouseMoveEvent 534 158 0 0 0 0 0 i\n"
+"MouseMoveEvent 534 159 0 0 0 0 0 i\n"
+"MouseMoveEvent 534 161 0 0 0 0 0 i\n"
+"MouseMoveEvent 534 162 0 0 0 0 0 i\n"
+"MouseMoveEvent 534 163 0 0 0 0 0 i\n"
+"MouseMoveEvent 534 164 0 0 0 0 0 i\n"
+"MouseMoveEvent 534 165 0 0 0 0 0 i\n"
+"MouseMoveEvent 533 165 0 0 0 0 0 i\n"
+"MouseMoveEvent 532 165 0 0 0 0 0 i\n"
 "MouseMoveEvent 531 165 0 0 0 0 0 i\n"
+"MouseMoveEvent 530 165 0 0 0 0 0 i\n"
+"MouseMoveEvent 529 165 0 0 0 0 0 i\n"
+"MouseMoveEvent 529 166 0 0 0 0 0 i\n"
+"MouseMoveEvent 528 167 0 0 0 0 0 i\n"
+"MouseMoveEvent 527 167 0 0 0 0 0 i\n"
+"MouseMoveEvent 527 168 0 0 0 0 0 i\n"
+"MouseMoveEvent 526 168 0 0 0 0 0 i\n"
 "MouseMoveEvent 526 169 0 0 0 0 0 i\n"
 "LeftButtonPressEvent 526 169 0 0 0 0 0 i\n"
 "LeftButtonReleaseEvent 526 169 0 0 0 0 0 i\n"
 "MouseMoveEvent 525 166 0 0 0 0 0 i\n"
+"MouseMoveEvent 525 165 0 0 0 0 0 i\n"
+"MouseMoveEvent 525 164 0 0 0 0 0 i\n"
+"MouseMoveEvent 525 163 0 0 0 0 0 i\n"
+"MouseMoveEvent 525 162 0 0 0 0 0 i\n"
+"MouseMoveEvent 525 161 0 0 0 0 0 i\n"
+"MouseMoveEvent 525 162 0 0 0 0 0 i\n"
+"MouseMoveEvent 526 163 0 0 0 0 0 i\n"
+"MouseMoveEvent 526 164 0 0 0 0 0 i\n"
+"MouseMoveEvent 526 165 0 0 0 0 0 i\n"
 "MouseMoveEvent 526 166 0 0 0 0 0 i\n"
+"MouseMoveEvent 526 167 0 0 0 0 0 i\n"
+"MouseMoveEvent 526 169 0 0 0 0 0 i\n"
+"MouseMoveEvent 526 170 0 0 0 0 0 i\n"
+"MouseMoveEvent 526 171 0 0 0 0 0 i\n"
+"MouseMoveEvent 526 172 0 0 0 0 0 i\n"
 "MouseMoveEvent 526 173 0 0 0 0 0 i\n"
 "LeftButtonPressEvent 526 173 0 0 0 0 0 i\n"
 "MouseMoveEvent 526 174 0 0 0 0 0 i\n"
 "MouseMoveEvent 510 179 0 0 0 0 0 i\n"
 "LeftButtonReleaseEvent 510 179 0 0 0 0 0 i\n"
 "MouseMoveEvent 510 177 0 0 0 0 0 i\n"
+"MouseMoveEvent 510 175 0 0 0 0 0 i\n"
+"MouseMoveEvent 510 172 0 0 0 0 0 i\n"
+"MouseMoveEvent 512 164 0 0 0 0 0 i\n"
+"MouseMoveEvent 512 154 0 0 0 0 0 i\n"
+"MouseMoveEvent 514 142 0 0 0 0 0 i\n"
+"MouseMoveEvent 514 134 0 0 0 0 0 i\n"
+"MouseMoveEvent 514 131 0 0 0 0 0 i\n"
+"MouseMoveEvent 513 129 0 0 0 0 0 i\n"
+"MouseMoveEvent 513 127 0 0 0 0 0 i\n"
+"MouseMoveEvent 512 126 0 0 0 0 0 i\n"
 "MouseMoveEvent 510 125 0 0 0 0 0 i\n"
+"MouseMoveEvent 509 124 0 0 0 0 0 i\n"
+"MouseMoveEvent 507 118 0 0 0 0 0 i\n"
+"MouseMoveEvent 503 114 0 0 0 0 0 i\n"
+"MouseMoveEvent 502 112 0 0 0 0 0 i\n"
+"MouseMoveEvent 501 112 0 0 0 0 0 i\n"
+"MouseMoveEvent 500 111 0 0 0 0 0 i\n"
+"MouseMoveEvent 499 111 0 0 0 0 0 i\n"
+"MouseMoveEvent 499 110 0 0 0 0 0 i\n"
+"MouseMoveEvent 499 112 0 0 0 0 0 i\n"
+"MouseMoveEvent 501 118 0 0 0 0 0 i\n"
+"MouseMoveEvent 501 120 0 0 0 0 0 i\n"
+"MouseMoveEvent 501 121 0 0 0 0 0 i\n"
 "MouseMoveEvent 500 121 0 0 0 0 0 i\n"
+"MouseMoveEvent 500 120 0 0 0 0 0 i\n"
+"MouseMoveEvent 499 119 0 0 0 0 0 i\n"
+"MouseMoveEvent 497 119 0 0 0 0 0 i\n"
+"MouseMoveEvent 495 118 0 0 0 0 0 i\n"
+"MouseMoveEvent 487 114 0 0 0 0 0 i\n"
+"MouseMoveEvent 481 112 0 0 0 0 0 i\n"
+"MouseMoveEvent 471 110 0 0 0 0 0 i\n"
+"MouseMoveEvent 461 108 0 0 0 0 0 i\n"
+"MouseMoveEvent 453 106 0 0 0 0 0 i\n"
+"MouseMoveEvent 445 104 0 0 0 0 0 i\n"
 "MouseMoveEvent 435 104 0 0 0 0 0 i\n"
+"MouseMoveEvent 432 104 0 0 0 0 0 i\n"
+"MouseMoveEvent 430 104 0 0 0 0 0 i\n"
+"MouseMoveEvent 429 104 0 0 0 0 0 i\n"
+"MouseMoveEvent 425 108 0 0 0 0 0 i\n"
+"MouseMoveEvent 424 109 0 0 0 0 0 i\n"
 "MouseMoveEvent 422 109 0 0 0 0 0 i\n"
+"MouseMoveEvent 421 111 0 0 0 0 0 i\n"
+"MouseMoveEvent 417 115 0 0 0 0 0 i\n"
+"MouseMoveEvent 413 119 0 0 0 0 0 i\n"
+"MouseMoveEvent 411 120 0 0 0 0 0 i\n"
+"MouseMoveEvent 410 121 0 0 0 0 0 i\n"
 "MouseMoveEvent 409 121 0 0 0 0 0 i\n"
+"MouseMoveEvent 409 122 0 0 0 0 0 i\n"
+"MouseMoveEvent 409 123 0 0 0 0 0 i\n"
+"MouseMoveEvent 409 124 0 0 0 0 0 i\n"
+"MouseMoveEvent 408 124 0 0 0 0 0 i\n"
+"MouseMoveEvent 408 125 0 0 0 0 0 i\n"
+"MouseMoveEvent 407 125 0 0 0 0 0 i\n"
+"MouseMoveEvent 403 129 0 0 0 0 0 i\n"
+"MouseMoveEvent 403 130 0 0 0 0 0 i\n"
 "MouseMoveEvent 402 130 0 0 0 0 0 i\n"
 "KeyPressEvent 402 130 0 0 113 1 q i\n"
 "CharEvent 402 130 0 0 113 1 q i\n"
diff --git a/Interaction/Widgets/Testing/Cxx/TestButtonWidget.cxx b/Interaction/Widgets/Testing/Cxx/TestButtonWidget.cxx
index 319f0fd..b2049b5 100644
--- a/Interaction/Widgets/Testing/Cxx/TestButtonWidget.cxx
+++ b/Interaction/Widgets/Testing/Cxx/TestButtonWidget.cxx
@@ -48,7 +48,7 @@
 #define VTK_CREATE(type, name) \
   vtkSmartPointer<type> name = vtkSmartPointer<type>::New()
 
-static char ButtonWidgetEventLog[] =
+char ButtonWidgetEventLog[] =
   "# StreamVersion 1\n"
   "RenderEvent 0 0 0 0 0 0 0\n"
   "EnterEvent 125 299 0 0 0 0 0\n"
diff --git a/Interaction/Widgets/Testing/Cxx/TestImageActorContourWidget.cxx b/Interaction/Widgets/Testing/Cxx/TestImageActorContourWidget.cxx
index 017405c..ad36fef 100644
--- a/Interaction/Widgets/Testing/Cxx/TestImageActorContourWidget.cxx
+++ b/Interaction/Widgets/Testing/Cxx/TestImageActorContourWidget.cxx
@@ -78,7 +78,7 @@
 #include "vtkRenderWindow.h"
 #include "vtkProperty.h"
 
-static char TestImageActorContourWidgetLog[] =
+char TestImageActorContourWidgetLog[] =
 "# StreamVersion 1\n"
 "ConfigureEvent 0 499 0 0 0 0 0\n"
 "RenderEvent 0 499 0 0 0 0 0\n"
diff --git a/Interaction/Widgets/Testing/Cxx/TestImplicitPlaneWidget2b.cxx b/Interaction/Widgets/Testing/Cxx/TestImplicitPlaneWidget2b.cxx
index 5454de2..c500f57 100644
--- a/Interaction/Widgets/Testing/Cxx/TestImplicitPlaneWidget2b.cxx
+++ b/Interaction/Widgets/Testing/Cxx/TestImplicitPlaneWidget2b.cxx
@@ -34,7 +34,7 @@
 #include "vtkRenderer.h"
 #include "vtkSphereSource.h"
 
-static double TestImplicitPlaneWidget2bPlaneOrigins[3][3] =
+double TestImplicitPlaneWidget2bPlaneOrigins[3][3] =
 { { 0, 10, 0 }, { 10, 0 , 0 }, { 0, 0, 0 } };
 
 class vtkTimerCallback : public vtkCommand
diff --git a/Interaction/Widgets/Testing/Cxx/TestResliceCursorWidget2.cxx b/Interaction/Widgets/Testing/Cxx/TestResliceCursorWidget2.cxx
index 41f6e35..f7eb696 100644
--- a/Interaction/Widgets/Testing/Cxx/TestResliceCursorWidget2.cxx
+++ b/Interaction/Widgets/Testing/Cxx/TestResliceCursorWidget2.cxx
@@ -220,7 +220,6 @@ int TestResliceCursorWidget2( int argc, char *argv[] )
   vtkSmartPointer< vtkResliceCursorWidget > resliceCursorWidget[3];
   vtkSmartPointer< vtkResliceCursorLineRepresentation > resliceCursorRep[3];
 
-  double viewUp[3][3] = {{0, 0, -1}, {0, 0, 1}, {0, 1, 0}};
   for (int i = 0; i < 3; i++)
     {
     resliceCursorWidget[i] = vtkSmartPointer< vtkResliceCursorWidget >::New();
@@ -250,8 +249,6 @@ int TestResliceCursorWidget2( int argc, char *argv[] )
     ren[i]->GetActiveCamera()->SetPosition(camPos);
 
     ren[i]->GetActiveCamera()->ParallelProjectionOn();
-    ren[i]->GetActiveCamera()->SetViewUp(
-      viewUp[i][0], viewUp[i][1], viewUp[i][2]);
     ren[i]->ResetCamera();
     //ren[i]->ResetCameraClippingRange();
 
@@ -283,6 +280,10 @@ int TestResliceCursorWidget2( int argc, char *argv[] )
   renWin->SetSize( 600, 600);
   //renWin->SetFullScreen(1);
 
+  ren[0]->GetActiveCamera()->SetViewUp( 0, 0, -1 );
+  ren[1]->GetActiveCamera()->SetViewUp( 0, 0, 1 );
+  ren[2]->GetActiveCamera()->SetViewUp( 0, 1, 0 );
+
   ren[0]->SetViewport(0,0,0.5,0.5);
   ren[1]->SetViewport(0.5,0,1,0.5);
   ren[2]->SetViewport(0,0.5,0.5,1);
diff --git a/Interaction/Widgets/Testing/Cxx/TestResliceCursorWidget3.cxx b/Interaction/Widgets/Testing/Cxx/TestResliceCursorWidget3.cxx
index fb03db5..12b4966 100644
--- a/Interaction/Widgets/Testing/Cxx/TestResliceCursorWidget3.cxx
+++ b/Interaction/Widgets/Testing/Cxx/TestResliceCursorWidget3.cxx
@@ -220,7 +220,6 @@ int TestResliceCursorWidget3( int argc, char *argv[] )
   vtkSmartPointer< vtkResliceCursorWidget > resliceCursorWidget[3];
   vtkSmartPointer< vtkResliceCursorThickLineRepresentation > resliceCursorRep[3];
 
-  double viewUp[3][3] = {{0, 0, -1}, {0, 0, 1}, {0, 1, 0}};
   for (int i = 0; i < 3; i++)
     {
     resliceCursorWidget[i] = vtkSmartPointer< vtkResliceCursorWidget >::New();
@@ -250,7 +249,6 @@ int TestResliceCursorWidget3( int argc, char *argv[] )
     ren[i]->GetActiveCamera()->SetPosition(camPos);
 
     ren[i]->GetActiveCamera()->ParallelProjectionOn();
-    ren[i]->GetActiveCamera()->SetViewUp(viewUp[i]);
     ren[i]->ResetCamera();
     //ren[i]->ResetCameraClippingRange();
 
@@ -282,6 +280,10 @@ int TestResliceCursorWidget3( int argc, char *argv[] )
   renWin->SetSize( 600, 600);
   //renWin->SetFullScreen(1);
 
+  ren[0]->GetActiveCamera()->SetViewUp( 0, 0, -1 );
+  ren[1]->GetActiveCamera()->SetViewUp( 0, 0, 1 );
+  ren[2]->GetActiveCamera()->SetViewUp( 0, 1, 0 );
+
   ren[0]->SetViewport(0,0,0.5,0.5);
   ren[1]->SetViewport(0.5,0,1,0.5);
   ren[2]->SetViewport(0,0.5,0.5,1);
diff --git a/Interaction/Widgets/Testing/Cxx/TestSplineWidget.cxx b/Interaction/Widgets/Testing/Cxx/TestSplineWidget.cxx
index a9f1699..affac1b 100644
--- a/Interaction/Widgets/Testing/Cxx/TestSplineWidget.cxx
+++ b/Interaction/Widgets/Testing/Cxx/TestSplineWidget.cxx
@@ -26,7 +26,7 @@
 
 #include "vtkTestUtilities.h"
 
-static char TSWeventLog[] =
+char TSWeventLog[] =
   "# StreamVersion 1\n"
   "CharEvent 133 125 0 0 98 1 i\n"
   "KeyReleaseEvent 133 125 0 0 98 1 i\n"
diff --git a/Interaction/Widgets/Testing/Cxx/WidgetTestingMacros.h b/Interaction/Widgets/Testing/Cxx/WidgetTestingMacros.h
index 29012d3..9e6ae0f 100644
--- a/Interaction/Widgets/Testing/Cxx/WidgetTestingMacros.h
+++ b/Interaction/Widgets/Testing/Cxx/WidgetTestingMacros.h
@@ -1,27 +1,35 @@
 #ifndef __WidgetTestingMacros_h
 #define __WidgetTestingMacros_h
 
-#include <vtkAbstractTransform.h>
-#include <vtkActor.h>
-#include <vtkAssemblyPath.h>
-#include "vtkCamera.h"
 #include "vtkDebugLeaks.h"
-#include <vtkFollower.h>
-#include <vtkInformation.h>
-#include <vtkLineWidget2.h>
+#include "vtkSmartPointer.h"
 #include "vtkMath.h"
+
+#include "vtkRenderWindow.h"
+#include "vtkRenderWindowInteractor.h"
+#include "vtkRenderer.h"
+#include "vtkCamera.h"
+
+#include <vtkAssemblyPath.h>
+#include <vtkPropCollection.h>
+#include <vtkInformation.h>
 #include <vtkMatrix4x4.h>
-#include <vtkPointHandleRepresentation2D.h>
+#include <vtkProp.h>
+#include <vtkActor.h>
 #include <vtkPointPlacer.h>
+
 #include <vtkPolyData.h>
-#include <vtkPropCollection.h>
-#include <vtkProperty2D.h>
 #include <vtkProperty.h>
-#include <vtkProp.h>
-#include "vtkRenderWindow.h"
-#include "vtkRenderWindowInteractor.h"
-#include "vtkRenderer.h"
-#include "vtkSmartPointer.h"
+#include <vtkProperty2D.h>
+
+#include <vtkAbstractTransform.h>
+#include <vtkFollower.h>
+
+// to instantiate some variables for testing
+#include <vtkPointHandleRepresentation2D.h>
+#include <vtkLineWidget2.h>
+
+
 
 /// tests basic vtkObject methods
 #define EXERCISE_BASIC_OBJECT_METHODS( object ) \
@@ -34,7 +42,7 @@
     object->Print( std::cout );  \
     std::cout << "Name of Class = " << object->GetClassName() << std::endl; \
     std::cout << "Name of Superclass = " << object->Superclass::GetClassName() << std::endl; \
-}
+    }
 
 /// test object by calling Set on the variable with false, true, 0, 1, On, Off
 #define TEST_SET_GET_BOOLEAN( object, variable ) \
@@ -489,6 +497,7 @@
 
 /// test vtkWidgetRepresentation methods
 #define EXERCISE_BASIC_REPRESENTATION_METHODS(className, object)   \
+    EXERCISE_BASIC_PROP_METHODS(className, object);                     \
     std::cout << "Creating a renderer and a default widget..." << std::endl; \
     vtkSmartPointer< vtkCamera > cam1 =  vtkSmartPointer< vtkCamera >::New(); \
     vtkSmartPointer< vtkRenderer > ren1 = vtkSmartPointer< vtkRenderer >::New(); \
@@ -538,12 +547,14 @@
     std::cout << "Trying to get back to init state for further testing." << std::endl; \
     object->SetPlaceFactor(0.5);                                        \
     object->SetHandleSize(0.05);                                        \
-    std::cout << "Done basic rep methods" << std::endl;                 \
-    EXERCISE_BASIC_PROP_METHODS(className, object);
+    std::cout << "Done basic rep methods" << std::endl;
+
 
 /// test vtkAngleRepresentation methods
 #define EXERCISE_BASIC_ANGLE_REPRESENTATION_METHODS(className, object)  \
   {                                                                     \
+    EXERCISE_BASIC_REPRESENTATION_METHODS(className, object); \
+                                                                        \
     vtkSmartPointer<vtkPointHandleRepresentation2D> phandle0 = vtkSmartPointer<vtkPointHandleRepresentation2D>::New(); \
     object->SetHandleRepresentation(phandle0);                           \
     object->InstantiateHandleRepresentation();                          \
@@ -611,7 +622,6 @@
                                                                         \
     double e[2] = {5.0, 1.0};                                           \
     object->CenterWidgetInteraction(e);                                 \
-    EXERCISE_BASIC_REPRESENTATION_METHODS(className, object);           \
   }
 
 /// test vtkBorderRepresentation methods
diff --git a/Interaction/Widgets/Testing/Cxx/vtkPolyLineRepresentationTest1.cxx b/Interaction/Widgets/Testing/Cxx/vtkPolyLineRepresentationTest1.cxx
deleted file mode 100644
index 05df5e3..0000000
--- a/Interaction/Widgets/Testing/Cxx/vtkPolyLineRepresentationTest1.cxx
+++ /dev/null
@@ -1,216 +0,0 @@
-#include "vtkPolyLineRepresentation.h"
-
-#include <cstdlib>
-#include <iostream>
-
-#include "WidgetTestingMacros.h"
-
-#include <vtkPointHandleRepresentation3D.h>
-#include <vtkPlaneSource.h>
-
-#include <vtkPolyData.h>
-#include <vtkProperty.h>
-
-#include <vtkDoubleArray.h>
-
-int vtkPolyLineRepresentationTest1(int , char * [] )
-{
-  vtkSmartPointer< vtkPolyLineRepresentation > node1 = vtkSmartPointer< vtkPolyLineRepresentation >::New();
-
-  EXERCISE_BASIC_REPRESENTATION_METHODS(vtkPolyLineRepresentation, node1);
-
-  vtkSmartPointer<vtkPlaneSource> planeSource = vtkSmartPointer<vtkPlaneSource>::New();
-  node1->SetPlaneSource(planeSource);
-
-  TEST_SET_GET_BOOLEAN(node1, ProjectToPlane);
-
-  // clamped 0-3
-  TEST_SET_GET_INT_RANGE(node1, ProjectionNormal, 1, 2);
-  node1->SetProjectionNormalToXAxes();
-  node1->SetProjectionNormalToYAxes();
-  node1->SetProjectionNormalToZAxes();
-  node1->SetProjectionNormalToOblique();
-
-  TEST_SET_GET_DOUBLE_RANGE(node1, ProjectionPosition, -10.0, 10.0);
-
-  vtkSmartPointer<vtkPolyData> pd =  vtkSmartPointer<vtkPolyData>::New();
-  node1->GetPolyData(pd);
-  if (pd == NULL)
-    {
-    std::cout << "Polydata is null" << std::endl;
-    }
-
-
-  vtkSmartPointer<vtkProperty> prop = node1->GetHandleProperty();
-  if (prop == NULL)
-    {
-    std::cout << "Handle Property is NULL." << std::endl;
-    }
-  prop = node1->GetSelectedHandleProperty();
-  if (prop == NULL)
-    {
-    std::cout << "Selected Handle Property is NULL." << std::endl;
-    }
-
-  prop = node1->GetLineProperty();
-  if (prop == NULL)
-    {
-    std::cout << "Line Property is NULL." << std::endl;
-    }
-  prop = node1->GetSelectedLineProperty();
-  if (prop == NULL)
-    {
-    std::cout << "Selected Line Property is NULL." << std::endl;
-    }
-
-  double pt3[3] = {1, 2, 3};
-  node1->SetHandlePosition(3, pt3);
-
-  node1->SetNumberOfHandles(10);
-  int numHandles = node1->GetNumberOfHandles();
-  if (numHandles != 10)
-    {
-    std::cerr << "Error in Setting number of Handles to 10, got " << numHandles << std::endl;
-    return EXIT_FAILURE;
-    }
-
-  double testPt[3];
-  node1->GetHandlePosition(3, testPt);
-  if (testPt[0] != pt3[0] || testPt[1] != pt3[1] || testPt[2] != pt3[2])
-    {
-    std::cerr << "Handle position 3 changed after resize, but should have stayed the same.\n";
-    return EXIT_FAILURE;
-    }
-
-  node1->SetNumberOfHandles(-1);
-  numHandles = node1->GetNumberOfHandles();
-  std::cout << "After setting num handles to -1, got back "  << numHandles << std::endl;
-  node1->SetNumberOfHandles(0);
-  numHandles = node1->GetNumberOfHandles();
-  std::cout << "After setting num handles to 0, got back "  << numHandles << std::endl;
-
-  numHandles = 5;
-  node1->SetNumberOfHandles(numHandles);
-  double x, y, z;
-  x = y = z = 0.0;
-  double xyz[3] = {0.0, 0.0, 0.0};
-  double* hpos;
-  double hpos2[3];
-  for (int h = 0; h < numHandles; h++)
-    {
-    node1->SetHandlePosition(h, x, y, z);
-    hpos = node1->GetHandlePosition(h);
-    if (!hpos)
-      {
-      std::cerr << "Null handle position back for handle " << h << std::endl;
-      return EXIT_FAILURE;
-      }
-    else if (hpos[0] != x ||
-             hpos[1] != y ||
-             hpos[2] != z)
-      {
-      std::cerr << "Failure in SetHandlePosition(" << h << "," << x << "," << y << "," << z << "), got " << hpos[0] << ", " << hpos[1] << ", " << hpos[2] << std::endl;
-      return EXIT_FAILURE;
-      }
-    else
-      {
-      std::cout << "Handle " << h << " position = " << hpos[0] << ", " << hpos[1] << ", " << hpos[2] << std::endl;
-      }
-    node1->GetHandlePosition(h, hpos2);
-    if (hpos2[0] != x ||
-        hpos2[1] != y ||
-        hpos2[2] != z)
-      {
-      std::cerr << "Failure in SetHandlePosition(" << h << "," << x << "," << y << "," << z << "), got " << hpos2[0] << ", " << hpos2[1] << ", " << hpos2[2] << std::endl;
-      return EXIT_FAILURE;
-      }
-    else
-      {
-      std::cout << "Handle " << h << " position = " << hpos2[0] << ", " << hpos2[1] << ", " << hpos2[2] << std::endl;
-      }
-
-    node1->SetHandlePosition(h, xyz);
-    hpos = node1->GetHandlePosition(h);
-    if (!hpos)
-      {
-      std::cerr << "Null handle position back for handle " << h << std::endl;
-      return EXIT_FAILURE;
-      }
-    else if (hpos[0] != xyz[0] ||
-             hpos[1] != xyz[1] ||
-             hpos[2] != xyz[2])
-      {
-      std::cerr << "Failure in SetHandlePosition(" << h << ", xyz), expected " <<  xyz[0] << ", " <<  xyz[1] << ", " <<  xyz[2] << ", got " << hpos[0] << ", " << hpos[1] << ", " << hpos[2] << std::endl;
-      return EXIT_FAILURE;
-      }
-    else
-      {
-      std::cout << "Handle " << h << " position = " << hpos[0] << ", " << hpos[1] << ", " << hpos[2] << std::endl;
-      }
-    node1->GetHandlePosition(h, hpos2);
-    if (hpos2[0] != xyz[0] ||
-        hpos2[1] != xyz[1] ||
-        hpos2[2] != xyz[2])
-      {
-      std::cerr << "Failure in SetHandlePosition(" << h << ",xyz), , expected " <<  xyz[0] << ", " <<  xyz[1] << ", " <<  xyz[2] << ", got " << hpos2[0] << ", " << hpos2[1] << ", " << hpos2[2] << std::endl;
-      return EXIT_FAILURE;
-      }
-    else
-      {
-      std::cout << "Handle " << h << " position xyz = " << hpos2[0] << ", " << hpos2[1] << ", " << hpos2[2] << std::endl;
-      }
-    x -= 1.0;
-    y += 1.0;
-    z += 2.5;
-    xyz[0] += 1.0;
-    xyz[1] -= 1.0;
-    xyz[2] += 3.9;
-    }
-  vtkSmartPointer<vtkDoubleArray> da = node1->GetHandlePositions();
-  if (da == NULL)
-    {
-    std::cerr << "HandlePositions array is null!" << std::endl;
-    return EXIT_FAILURE;
-    }
-  else
-    {
-    for (vtkIdType i = 0; i < da->GetNumberOfTuples(); i++)
-      {
-      double val[3];
-      da->GetTupleValue(i, val);
-      std::cout << i << " = " << val[0] << ", " << val[1] << ", " << val[2] << std::endl;
-      }
-    }
-
-
-  TEST_SET_GET_BOOLEAN(node1, Closed);
-  std::cout << "Closed = " << node1->IsClosed() << std::endl;
-
-  std::cout << "Summed Length = " << node1->GetSummedLength();
-
-  vtkSmartPointer<vtkPoints> points =  vtkSmartPointer<vtkPoints>::New();
-  points->SetNumberOfPoints(2);
-  points->SetPoint(0, 3.0, 6.8, -9.9);
-  points->SetPoint(1, -3.0, -6.8, 9.9);
-  node1->InitializeHandles(points);
-  da = node1->GetHandlePositions();
-  if (da == NULL)
-    {
-    std::cerr << "HandlePositions array is null after initing with vtkPoints!" << std::endl;
-    return EXIT_FAILURE;
-    }
-  else
-    {
-    for (vtkIdType i = 0; i < da->GetNumberOfTuples(); i++)
-      {
-      double val[3];
-      da->GetTupleValue(i, val);
-      std::cout << i << " = " << val[0] << ", " << val[1] << ", " << val[2] << std::endl;
-      }
-    }
-
-  node1->SetLineColor(1.0, 0.5, 0.3);
-
-
-  return EXIT_SUCCESS;
-}
diff --git a/Interaction/Widgets/Testing/Cxx/vtkPolyLineWidgetTest1.cxx b/Interaction/Widgets/Testing/Cxx/vtkPolyLineWidgetTest1.cxx
deleted file mode 100644
index 5e2189c..0000000
--- a/Interaction/Widgets/Testing/Cxx/vtkPolyLineWidgetTest1.cxx
+++ /dev/null
@@ -1,21 +0,0 @@
-#include "vtkPolyLineWidget.h"
-#include "vtkPolyLineRepresentation.h"
-
-#include <cstdlib>
-#include <iostream>
-
-#include "WidgetTestingMacros.h"
-
-int vtkPolyLineWidgetTest1(int , char * [] )
-{
-  vtkSmartPointer< vtkPolyLineWidget > node1 = vtkSmartPointer< vtkPolyLineWidget >::New();
-
-  EXERCISE_BASIC_ABSTRACT_METHODS ( node1 );
-
-  vtkSmartPointer<vtkPolyLineRepresentation> rep1 = vtkSmartPointer<vtkPolyLineRepresentation>::New();
-  node1->SetRepresentation(rep1);
-
-  EXERCISE_BASIC_INTERACTOR_OBSERVER_METHODS( node1 );
-
-  return EXIT_SUCCESS;
-}
diff --git a/Interaction/Widgets/Testing/Cxx/vtkSplineRepresentationTest1.cxx b/Interaction/Widgets/Testing/Cxx/vtkSplineRepresentationTest1.cxx
index be3ec34..edb77ef 100644
--- a/Interaction/Widgets/Testing/Cxx/vtkSplineRepresentationTest1.cxx
+++ b/Interaction/Widgets/Testing/Cxx/vtkSplineRepresentationTest1.cxx
@@ -45,7 +45,7 @@ int vtkSplineRepresentationTest1(int , char * [] )
   vtkSmartPointer<vtkProperty> prop = node1->GetHandleProperty();
   if (prop == NULL)
     {
-    std::cout << "Handle Property is NULL." << std::endl;
+    std::cout << "Hanlde Property is NULL." << std::endl;
     }
   prop = node1->GetSelectedHandleProperty();
   if (prop == NULL)
@@ -79,11 +79,9 @@ int vtkSplineRepresentationTest1(int , char * [] )
   std::cout << "After setting num handles to 0, got back "  << numHandles << std::endl;
 
   // 0 is invalid
-  TEST_SET_GET_INT_RANGE(node1, Resolution, 10, 100);
+  TEST_SET_GET_INT_RANGE(node1, Resolution, 2, 100);
 
   vtkSmartPointer<vtkParametricSpline> pspline = vtkSmartPointer<vtkParametricSpline>::New();
-
-  pspline->SetPoints(node1->GetParametricSpline()->GetPoints());
   node1->SetParametricSpline(pspline);
   vtkSmartPointer<vtkParametricSpline> pspline2 = node1->GetParametricSpline();
   if (pspline2 != pspline)
@@ -99,7 +97,7 @@ int vtkSplineRepresentationTest1(int , char * [] )
   double xyz[3] = {0.0, 0.0, 0.0};
   double* hpos;
   double hpos2[3];
-  for (int h = 0; h < numHandles; h++)
+  for (int h = -1; h <= numHandles; h++)
     {
     node1->SetHandlePosition(h, x, y, z);
     hpos = node1->GetHandlePosition(h);
@@ -212,6 +210,7 @@ int vtkSplineRepresentationTest1(int , char * [] )
       }
     }
 
+
   node1->SetLineColor(1.0, 0.5, 0.3);
 
 
diff --git a/Interaction/Widgets/Testing/Data/Baseline/TestBrokenLineWidget.png.md5 b/Interaction/Widgets/Testing/Data/Baseline/TestBrokenLineWidget.png.md5
index 5e15a1a..1ee2bec 100644
--- a/Interaction/Widgets/Testing/Data/Baseline/TestBrokenLineWidget.png.md5
+++ b/Interaction/Widgets/Testing/Data/Baseline/TestBrokenLineWidget.png.md5
@@ -1 +1 @@
-8360389146591650459b85656826df5e
+ebcb961a0475b137adce04a38836877b
diff --git a/Interaction/Widgets/Testing/Data/Baseline/TestBrokenLineWidget_1.png.md5 b/Interaction/Widgets/Testing/Data/Baseline/TestBrokenLineWidget_1.png.md5
index 3e94feb..30b6ac5 100644
--- a/Interaction/Widgets/Testing/Data/Baseline/TestBrokenLineWidget_1.png.md5
+++ b/Interaction/Widgets/Testing/Data/Baseline/TestBrokenLineWidget_1.png.md5
@@ -1 +1 @@
-75fc0dad32793b4285c89d6d566b0d16
+d6cb885f9062133d16cc9a30dc8e5e77
diff --git a/Interaction/Widgets/Testing/Data/Baseline/TestBrokenLineWidget_2.png.md5 b/Interaction/Widgets/Testing/Data/Baseline/TestBrokenLineWidget_2.png.md5
index f0e1857..ff458ef 100644
--- a/Interaction/Widgets/Testing/Data/Baseline/TestBrokenLineWidget_2.png.md5
+++ b/Interaction/Widgets/Testing/Data/Baseline/TestBrokenLineWidget_2.png.md5
@@ -1 +1 @@
-64bb950e86f358099daf3294da6a36db
+f787e367d2defeeef5dee69bc090e8fc
diff --git a/Interaction/Widgets/Testing/Data/Baseline/TestBrokenLineWidget_3.png.md5 b/Interaction/Widgets/Testing/Data/Baseline/TestBrokenLineWidget_3.png.md5
deleted file mode 100644
index 56901bd..0000000
--- a/Interaction/Widgets/Testing/Data/Baseline/TestBrokenLineWidget_3.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-67c104f1d36a78db7a705d41ff739298
diff --git a/Interaction/Widgets/Testing/Data/Baseline/TestCellCentersPointPlacer.png.md5 b/Interaction/Widgets/Testing/Data/Baseline/TestCellCentersPointPlacer.png.md5
index 1c3b7f8..05ad7c7 100644
--- a/Interaction/Widgets/Testing/Data/Baseline/TestCellCentersPointPlacer.png.md5
+++ b/Interaction/Widgets/Testing/Data/Baseline/TestCellCentersPointPlacer.png.md5
@@ -1 +1 @@
-212b8b72b01f8d5ffb0eee5809cf3cee
+de5399415d68f614b583f5dd2f9673b6
diff --git a/Interaction/Widgets/Testing/Data/Baseline/TestOrientationMarkerWidget_3.png.md5 b/Interaction/Widgets/Testing/Data/Baseline/TestOrientationMarkerWidget_3.png.md5
deleted file mode 100644
index 4c46625..0000000
--- a/Interaction/Widgets/Testing/Data/Baseline/TestOrientationMarkerWidget_3.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-f2ef65c3b337f9bf5fd9b2b991b8c1b1
diff --git a/Interaction/Widgets/Testing/Data/Baseline/TestOrientationMarkerWidget_4.png.md5 b/Interaction/Widgets/Testing/Data/Baseline/TestOrientationMarkerWidget_4.png.md5
deleted file mode 100644
index db0a95f..0000000
--- a/Interaction/Widgets/Testing/Data/Baseline/TestOrientationMarkerWidget_4.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-6e626c8645220634d369804e9cd369be
diff --git a/Interaction/Widgets/Testing/Data/Baseline/TestParallelopipedWidget.png.md5 b/Interaction/Widgets/Testing/Data/Baseline/TestParallelopipedWidget.png.md5
index be233e1..a6b8578 100644
--- a/Interaction/Widgets/Testing/Data/Baseline/TestParallelopipedWidget.png.md5
+++ b/Interaction/Widgets/Testing/Data/Baseline/TestParallelopipedWidget.png.md5
@@ -1 +1 @@
-eb54be77de7d45a06fd8e54b4179fe15
+5f803c9ed07b324a88e29abbb3c934d2
diff --git a/Interaction/Widgets/Testing/Data/Baseline/TestRectilinearWipeWidget_2.png.md5 b/Interaction/Widgets/Testing/Data/Baseline/TestRectilinearWipeWidget_2.png.md5
deleted file mode 100644
index 6cbc35d..0000000
--- a/Interaction/Widgets/Testing/Data/Baseline/TestRectilinearWipeWidget_2.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-dbaf7b1c8b5c0c3caeea0dc326214603
diff --git a/Interaction/Widgets/Testing/Data/Baseline/TestScalarBarWidget.png.md5 b/Interaction/Widgets/Testing/Data/Baseline/TestScalarBarWidget.png.md5
index a52d95a..ffefb09 100644
--- a/Interaction/Widgets/Testing/Data/Baseline/TestScalarBarWidget.png.md5
+++ b/Interaction/Widgets/Testing/Data/Baseline/TestScalarBarWidget.png.md5
@@ -1 +1 @@
-3b0edf02b2dc1b4c6f56fa2fcbed7aa7
+c5a7a5bf34ab101cfcc1df899fb7a76f
diff --git a/Interaction/Widgets/Testing/Data/Baseline/TestSphereWidget.png.md5 b/Interaction/Widgets/Testing/Data/Baseline/TestSphereWidget.png.md5
index 3201b71..62cbb02 100644
--- a/Interaction/Widgets/Testing/Data/Baseline/TestSphereWidget.png.md5
+++ b/Interaction/Widgets/Testing/Data/Baseline/TestSphereWidget.png.md5
@@ -1 +1 @@
-b5744928c96a8faac2562de3ee136e2e
+190416acc5e5b4433c1ed6c8b8a8ddd9
diff --git a/Interaction/Widgets/Testing/Data/Baseline/TestSphereWidget_1.png.md5 b/Interaction/Widgets/Testing/Data/Baseline/TestSphereWidget_1.png.md5
index 7b63dcf..9c9edc4 100644
--- a/Interaction/Widgets/Testing/Data/Baseline/TestSphereWidget_1.png.md5
+++ b/Interaction/Widgets/Testing/Data/Baseline/TestSphereWidget_1.png.md5
@@ -1 +1 @@
-4be79e0ff536f2145cc648cd44c0fe40
+cc899a8042f4f5ee1d2b64dae88115e3
diff --git a/Interaction/Widgets/Testing/Data/Baseline/TestSphereWidget_2.png.md5 b/Interaction/Widgets/Testing/Data/Baseline/TestSphereWidget_2.png.md5
index 87814bd..d0db896 100644
--- a/Interaction/Widgets/Testing/Data/Baseline/TestSphereWidget_2.png.md5
+++ b/Interaction/Widgets/Testing/Data/Baseline/TestSphereWidget_2.png.md5
@@ -1 +1 @@
-c69c5718f1c6a275ce50eebd8c4cdcdb
+fcf2037a960b6d1aa6e9d9ea1e7f5ee6
diff --git a/Interaction/Widgets/Testing/Data/Baseline/TestSphereWidget_3.png.md5 b/Interaction/Widgets/Testing/Data/Baseline/TestSphereWidget_3.png.md5
index ed27c63..cead665 100644
--- a/Interaction/Widgets/Testing/Data/Baseline/TestSphereWidget_3.png.md5
+++ b/Interaction/Widgets/Testing/Data/Baseline/TestSphereWidget_3.png.md5
@@ -1 +1 @@
-3c0150abc485a44f0a3b1e5447ecfedb
+ee260182653dc69c6f396651e0740ca3
diff --git a/Interaction/Widgets/Testing/Data/Baseline/TestSphereWidget_4.png.md5 b/Interaction/Widgets/Testing/Data/Baseline/TestSphereWidget_4.png.md5
deleted file mode 100644
index 61ce91e..0000000
--- a/Interaction/Widgets/Testing/Data/Baseline/TestSphereWidget_4.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-8354df47a5e6724689d6d6c93cd51911
diff --git a/Interaction/Widgets/Testing/Data/Baseline/TestSplineWidget.png.md5 b/Interaction/Widgets/Testing/Data/Baseline/TestSplineWidget.png.md5
index 0cb65d1..2202c51 100644
--- a/Interaction/Widgets/Testing/Data/Baseline/TestSplineWidget.png.md5
+++ b/Interaction/Widgets/Testing/Data/Baseline/TestSplineWidget.png.md5
@@ -1 +1 @@
-3b929d447a109e4832b7ef89c9a7b84b
+3d9b516347c2c5af1bf69339c721044d
diff --git a/Interaction/Widgets/Testing/Data/Baseline/TestSplineWidget_1.png.md5 b/Interaction/Widgets/Testing/Data/Baseline/TestSplineWidget_1.png.md5
new file mode 100644
index 0000000..4841bcf
--- /dev/null
+++ b/Interaction/Widgets/Testing/Data/Baseline/TestSplineWidget_1.png.md5
@@ -0,0 +1 @@
+9e9c69f1213a63055cde977020d355fd
diff --git a/Interaction/Widgets/Testing/Data/Baseline/TestTextWidget.png.md5 b/Interaction/Widgets/Testing/Data/Baseline/TestTextWidget.png.md5
index 4d4bb49..53b3a59 100644
--- a/Interaction/Widgets/Testing/Data/Baseline/TestTextWidget.png.md5
+++ b/Interaction/Widgets/Testing/Data/Baseline/TestTextWidget.png.md5
@@ -1 +1 @@
-78336893af3e6cef40f12e3d2ba4f941
+0a2ac843ff94fccc108dfef68568c88c
diff --git a/Interaction/Widgets/module.cmake b/Interaction/Widgets/module.cmake
index 737d544..e5fbb64 100644
--- a/Interaction/Widgets/module.cmake
+++ b/Interaction/Widgets/module.cmake
@@ -13,8 +13,8 @@ vtk_module(vtkInteractionWidgets
   TEST_DEPENDS
     vtkIOLegacy
     vtkIOXML
-    vtkIOParallel
     vtkRenderingVolume${VTK_RENDERING_BACKEND}
+    vtkRenderingFreeType${VTK_RENDERING_BACKEND}
     vtkTestingRendering
     vtkInteractionImage
     vtkInteractionStyle
diff --git a/Interaction/Widgets/vtkBiDimensionalRepresentation2D.cxx b/Interaction/Widgets/vtkBiDimensionalRepresentation2D.cxx
index e85ed30..56b11fa 100644
--- a/Interaction/Widgets/vtkBiDimensionalRepresentation2D.cxx
+++ b/Interaction/Widgets/vtkBiDimensionalRepresentation2D.cxx
@@ -73,6 +73,7 @@ vtkBiDimensionalRepresentation2D::vtkBiDimensionalRepresentation2D() : vtkBiDime
   this->TextMapper->SetInput("0.0");
   this->TextActor = vtkActor2D::New();
   this->TextActor->SetMapper(this->TextMapper);
+  this->TextActor->VisibilityOff();
 }
 
 //----------------------------------------------------------------------
@@ -722,16 +723,15 @@ void vtkBiDimensionalRepresentation2D::BuildRepresentation()
       minX = static_cast<int>(p4[0]);
       minY = static_cast<int>(p4[1]);
       }
-    this->TextMapper->GetTextProperty()->SetJustificationToCentered();
+    int textSize[2];
+    this->TextMapper->GetSize(this->Renderer, textSize);
     if (this->ShowLabelAboveWidget)
       {
-      this->TextActor->SetPosition(maxX, maxY + 9);
-      this->TextMapper->GetTextProperty()->SetVerticalJustificationToBottom();
+      this->TextActor->SetPosition(maxX - textSize[0]/2, maxY+9);
       }
     else
       {
-      this->TextActor->SetPosition(minX, minY - 9);
-      this->TextMapper->GetTextProperty()->SetVerticalJustificationToTop();
+      this->TextActor->SetPosition(minX - textSize[0]/2, minY-(textSize[1]+9));
       }
 
     this->BuildTime.Modified();
diff --git a/Interaction/Widgets/vtkCaptionRepresentation.cxx b/Interaction/Widgets/vtkCaptionRepresentation.cxx
index 063520c..faa349d 100644
--- a/Interaction/Widgets/vtkCaptionRepresentation.cxx
+++ b/Interaction/Widgets/vtkCaptionRepresentation.cxx
@@ -193,19 +193,10 @@ void vtkCaptionRepresentation::AdjustCaptionBoundary()
       return;
       }
 
-    vtkWindow *win = this->Renderer->GetVTKWindow();
-    if (!win)
-      {
-      vtkErrorMacro(<<"No render window available: cannot determine DPI.");
-      return;
-      }
-
     int text_bbox[4];
     if (!tren->GetBoundingBox(this->CaptionActor2D->GetCaptionTextProperty(),
-                              this->CaptionActor2D->GetCaption(), text_bbox,
-                              win->GetDPI()))
+                              this->CaptionActor2D->GetCaption(), text_bbox))
       {
-      vtkErrorMacro(<<"Error calculating caption bounding box.");
       return;
       }
 
diff --git a/Interaction/Widgets/vtkCurveRepresentation.cxx b/Interaction/Widgets/vtkCurveRepresentation.cxx
deleted file mode 100644
index 5df0cd2..0000000
--- a/Interaction/Widgets/vtkCurveRepresentation.cxx
+++ /dev/null
@@ -1,993 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkCurveRepresentation.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 "vtkCurveRepresentation.h"
-
-#include "vtkActor.h"
-#include "vtkAssemblyPath.h"
-#include "vtkBoundingBox.h"
-#include "vtkCallbackCommand.h"
-#include "vtkCamera.h"
-#include "vtkCellArray.h"
-#include "vtkCellPicker.h"
-#include "vtkInteractorObserver.h"
-#include "vtkMath.h"
-#include "vtkObjectFactory.h"
-#include "vtkPickingManager.h"
-#include "vtkPlaneSource.h"
-#include "vtkPolyData.h"
-#include "vtkPolyDataMapper.h"
-#include "vtkProperty.h"
-#include "vtkRenderer.h"
-#include "vtkRenderWindow.h"
-#include "vtkRenderWindowInteractor.h"
-#include "vtkSphereSource.h"
-#include "vtkTransform.h"
-
-//----------------------------------------------------------------------------
-vtkCurveRepresentation::vtkCurveRepresentation()
-{
-  this->LastEventPosition[0] = VTK_DOUBLE_MAX;
-  this->LastEventPosition[1] = VTK_DOUBLE_MAX;
-  this->LastEventPosition[2] = VTK_DOUBLE_MAX;
-
-  this->Bounds[0] =  VTK_DOUBLE_MAX;
-  this->Bounds[1] = -VTK_DOUBLE_MAX;
-  this->Bounds[2] =  VTK_DOUBLE_MAX;
-  this->Bounds[3] = -VTK_DOUBLE_MAX;
-  this->Bounds[4] =  VTK_DOUBLE_MAX;
-  this->Bounds[5] = -VTK_DOUBLE_MAX;
-
-  this->HandleSize = 5.0;
-
-  this->InteractionState = vtkCurveRepresentation::Outside;
-  this->ProjectToPlane = 0;  //default off
-  this->ProjectionNormal = 0;  //default YZ not used
-  this->ProjectionPosition = 0.0;
-  this->PlaneSource = NULL;
-  this->Closed = 0;
-
-  // Build the representation of the widget
-
-  // Create the handles along a straight line within the bounds of a unit cube
-  this->NumberOfHandles = 5;
-  this->Handle         = new vtkActor* [this->NumberOfHandles];
-  this->HandleGeometry = new vtkSphereSource* [this->NumberOfHandles];
-
-  for ( int i = 0; i < this->NumberOfHandles; ++i )
-    {
-    this->HandleGeometry[i] = vtkSphereSource::New();
-    this->HandleGeometry[i]->SetThetaResolution(16);
-    this->HandleGeometry[i]->SetPhiResolution(8);
-    vtkPolyDataMapper* handleMapper = vtkPolyDataMapper::New();
-    handleMapper->SetInputConnection(
-      this->HandleGeometry[i]->GetOutputPort());
-    this->Handle[i] = vtkActor::New();
-    this->Handle[i]->SetMapper(handleMapper);
-    handleMapper->Delete();
-    }
-
-  this->LineActor = vtkActor::New();
-
-  // Default bounds to get started
-  double bounds[6] = { -0.5, 0.5, -0.5, 0.5, -0.5, 0.5 };
-
-  // Initial creation of the widget, serves to initialize it
-  this->PlaceFactor = 1.0;
-  this->PlaceWidget(bounds);
-
-  // Manage the picking stuff
-  this->HandlePicker = vtkCellPicker::New();
-  this->HandlePicker->SetTolerance(0.005);
-
-  for ( int i = 0; i < this->NumberOfHandles; ++i )
-    {
-    this->HandlePicker->AddPickList(this->Handle[i]);
-    }
-  this->HandlePicker->PickFromListOn();
-
-  this->LinePicker = vtkCellPicker::New();
-  this->LinePicker->SetTolerance(0.01);
-  this->LinePicker->AddPickList(this->LineActor);
-  this->LinePicker->PickFromListOn();
-
-  this->LastPickPosition[0] = VTK_DOUBLE_MAX;
-  this->LastPickPosition[1] = VTK_DOUBLE_MAX;
-  this->LastPickPosition[2] = VTK_DOUBLE_MAX;
-
-  this->CurrentHandle = NULL;
-  this->CurrentHandleIndex = -1;
-
-  this->Transform = vtkTransform::New();
-
-  // Set up the initial properties
-  this->HandleProperty = NULL;
-  this->SelectedHandleProperty = NULL;
-  this->LineProperty = NULL;
-  this->SelectedLineProperty = NULL;
-  this->CreateDefaultProperties();
-
-  this->Centroid[0] = 0.0;
-  this->Centroid[1] = 0.0;
-  this->Centroid[2] = 0.0;
-}
-
-//----------------------------------------------------------------------------
-vtkCurveRepresentation::~vtkCurveRepresentation()
-{
-  this->LineActor->Delete();
-
-  for ( int i = 0; i < this->NumberOfHandles; ++i )
-    {
-    this->HandleGeometry[i]->Delete();
-    this->Handle[i]->Delete();
-    }
-  delete [] this->Handle;
-  delete [] this->HandleGeometry;
-
-  this->HandlePicker->Delete();
-  this->LinePicker->Delete();
-
-  if ( this->HandleProperty )
-    {
-    this->HandleProperty->Delete();
-    }
-  if ( this->SelectedHandleProperty )
-    {
-    this->SelectedHandleProperty->Delete();
-    }
-  if ( this->LineProperty )
-    {
-    this->LineProperty->Delete();
-    }
-  if ( this->SelectedLineProperty )
-    {
-    this->SelectedLineProperty->Delete();
-    }
-
-  this->Transform->Delete();
-}
-
-//----------------------------------------------------------------------------
-void vtkCurveRepresentation::SetClosed(int closed)
-{
-  if ( this->Closed == closed )
-    {
-    return;
-    }
-  this->Closed = closed;
-
-  this->BuildRepresentation();
-}
-
-//----------------------------------------------------------------------
-void vtkCurveRepresentation::RegisterPickers()
-{
-  this->Renderer->GetRenderWindow()->GetInteractor()->GetPickingManager()
-    ->AddPicker(this->HandlePicker, this);
-  this->Renderer->GetRenderWindow()->GetInteractor()->GetPickingManager()
-    ->AddPicker(this->LinePicker, this);
-}
-
-//----------------------------------------------------------------------------
-void vtkCurveRepresentation::SetHandlePosition(int handle, double x,
-                                        double y, double z)
-{
-  if ( handle < 0 || handle >= this->NumberOfHandles )
-    {
-    vtkErrorMacro(<<"vtkCurveRepresentation: handle index out of range.");
-    return;
-    }
-  this->HandleGeometry[handle]->SetCenter(x,y,z);
-  this->HandleGeometry[handle]->Update();
-  if ( this->ProjectToPlane )
-    {
-    this->ProjectPointsToPlane();
-    }
-  this->BuildRepresentation();
-}
-
-//----------------------------------------------------------------------------
-void vtkCurveRepresentation::SetHandlePosition(int handle, double xyz[3])
-{
-  this->SetHandlePosition(handle,xyz[0],xyz[1],xyz[2]);
-}
-
-//----------------------------------------------------------------------------
-void vtkCurveRepresentation::GetHandlePosition(int handle, double xyz[3])
-{
-  if ( handle < 0 || handle >= this->NumberOfHandles )
-    {
-    vtkErrorMacro(<<"vtkCurveRepresentation: handle index out of range.");
-    return;
-    }
-
-  this->HandleGeometry[handle]->GetCenter(xyz);
-}
-
-//----------------------------------------------------------------------------
-double* vtkCurveRepresentation::GetHandlePosition(int handle)
-{
-  if ( handle < 0 || handle >= this->NumberOfHandles )
-    {
-    vtkErrorMacro(<<"vtkCurveRepresentation: handle index out of range.");
-    return NULL;
-    }
-
-  return this->HandleGeometry[handle]->GetCenter();
-}
-
-//----------------------------------------------------------------------------
-void vtkCurveRepresentation::ProjectPointsToPlane()
-{
-  if ( this->ProjectionNormal == VTK_PROJECTION_OBLIQUE )
-    {
-    if ( this->PlaneSource != NULL )
-      {
-      this->ProjectPointsToObliquePlane();
-      }
-    else
-      {
-      vtkGenericWarningMacro(<<"Set the plane source for oblique projections...");
-      }
-    }
-  else
-    {
-    this->ProjectPointsToOrthoPlane();
-    }
-}
-
-//----------------------------------------------------------------------------
-void vtkCurveRepresentation::ProjectPointsToObliquePlane()
-{
-  double o[3];
-  double u[3];
-  double v[3];
-
-  this->PlaneSource->GetPoint1(u);
-  this->PlaneSource->GetPoint2(v);
-  this->PlaneSource->GetOrigin(o);
-
-  int i;
-  for ( i = 0; i < 3; ++i )
-    {
-    u[i] = u[i] - o[i];
-    v[i] = v[i] - o[i];
-    }
-  vtkMath::Normalize(u);
-  vtkMath::Normalize(v);
-
-  double o_dot_u = vtkMath::Dot(o,u);
-  double o_dot_v = vtkMath::Dot(o,v);
-  double fac1;
-  double fac2;
-  double ctr[3];
-  for ( i = 0; i < this->NumberOfHandles; ++i )
-    {
-    this->HandleGeometry[i]->GetCenter(ctr);
-    fac1 = vtkMath::Dot(ctr,u) - o_dot_u;
-    fac2 = vtkMath::Dot(ctr,v) - o_dot_v;
-    ctr[0] = o[0] + fac1*u[0] + fac2*v[0];
-    ctr[1] = o[1] + fac1*u[1] + fac2*v[1];
-    ctr[2] = o[2] + fac1*u[2] + fac2*v[2];
-    this->HandleGeometry[i]->SetCenter(ctr);
-    this->HandleGeometry[i]->Update();
-    }
-}
-
-//----------------------------------------------------------------------------
-void vtkCurveRepresentation::ProjectPointsToOrthoPlane()
-{
-  double ctr[3];
-  for ( int i = 0; i < this->NumberOfHandles; ++i )
-    {
-    this->HandleGeometry[i]->GetCenter(ctr);
-    ctr[this->ProjectionNormal] = this->ProjectionPosition;
-    this->HandleGeometry[i]->SetCenter(ctr);
-    this->HandleGeometry[i]->Update();
-    }
-}
-
-//----------------------------------------------------------------------------
-int vtkCurveRepresentation::HighlightHandle(vtkProp *prop)
-{
-  // First unhighlight anything picked
-  if ( this->CurrentHandle )
-    {
-    this->CurrentHandle->SetProperty(this->HandleProperty);
-    }
-
-  this->CurrentHandle = static_cast<vtkActor *>(prop);
-
-  if ( this->CurrentHandle )
-    {
-    for ( int i = 0; i < this->NumberOfHandles; ++i ) // find handle
-      {
-      if ( this->CurrentHandle == this->Handle[i] )
-        {
-        this->CurrentHandle->SetProperty(this->SelectedHandleProperty);
-        return i;
-        }
-      }
-    }
-  return -1;
-}
-
-//----------------------------------------------------------------------------
-void vtkCurveRepresentation::HighlightLine(int highlight)
-{
-  if ( highlight )
-    {
-    this->LineActor->SetProperty(this->SelectedLineProperty);
-    }
-  else
-    {
-    this->LineActor->SetProperty(this->LineProperty);
-    }
-}
-
-//----------------------------------------------------------------------------
-void vtkCurveRepresentation::MovePoint(double *p1, double *p2)
-{
-  if ( this->CurrentHandleIndex < 0 || this->CurrentHandleIndex >= this->NumberOfHandles )
-    {
-    vtkGenericWarningMacro(<<"Poly line handle index out of range.");
-    return;
-    }
-  // Get the motion vector
-  double v[3];
-  v[0] = p2[0] - p1[0];
-  v[1] = p2[1] - p1[1];
-  v[2] = p2[2] - p1[2];
-
-  double *ctr = this->HandleGeometry[this->CurrentHandleIndex]->GetCenter();
-
-  double newCtr[3];
-  newCtr[0] = ctr[0] + v[0];
-  newCtr[1] = ctr[1] + v[1];
-  newCtr[2] = ctr[2] + v[2];
-
-  this->HandleGeometry[this->CurrentHandleIndex]->SetCenter(newCtr);
-  this->HandleGeometry[this->CurrentHandleIndex]->Update();
-}
-
-//----------------------------------------------------------------------------
-void vtkCurveRepresentation::Translate(double *p1, double *p2)
-{
-  // Get the motion vector
-  double v[3];
-  v[0] = p2[0] - p1[0];
-  v[1] = p2[1] - p1[1];
-  v[2] = p2[2] - p1[2];
-
-  double newCtr[3];
-  for ( int i = 0; i < this->NumberOfHandles; ++i )
-    {
-    double* ctr =  this->HandleGeometry[i]->GetCenter();
-    for ( int j = 0; j < 3; ++j )
-      {
-      newCtr[j] = ctr[j] + v[j];
-      }
-     this->HandleGeometry[i]->SetCenter(newCtr);
-     this->HandleGeometry[i]->Update();
-    }
-}
-
-//----------------------------------------------------------------------------
-void vtkCurveRepresentation::Scale(double *p1, double *p2, int vtkNotUsed(X), int Y)
-{
-  // Get the motion vector
-  double v[3];
-  v[0] = p2[0] - p1[0];
-  v[1] = p2[1] - p1[1];
-  v[2] = p2[2] - p1[2];
-
-  double center[3] = {0.0,0.0,0.0};
-  double avgdist = 0.0;
-  double *prevctr = this->HandleGeometry[0]->GetCenter();
-  double *ctr;
-
-  center[0] += prevctr[0];
-  center[1] += prevctr[1];
-  center[2] += prevctr[2];
-
-  int i;
-  for ( i = 1; i < this->NumberOfHandles; ++i )
-    {
-    ctr = this->HandleGeometry[i]->GetCenter();
-    center[0] += ctr[0];
-    center[1] += ctr[1];
-    center[2] += ctr[2];
-    avgdist += sqrt(vtkMath::Distance2BetweenPoints(ctr,prevctr));
-    prevctr = ctr;
-    }
-
-  avgdist /= this->NumberOfHandles;
-
-  center[0] /= this->NumberOfHandles;
-  center[1] /= this->NumberOfHandles;
-  center[2] /= this->NumberOfHandles;
-
-  // Compute the scale factor
-  double sf = vtkMath::Norm(v) / avgdist;
-  if ( Y > this->LastEventPosition[1] )
-    {
-    sf = 1.0 + sf;
-    }
-  else
-    {
-    sf = 1.0 - sf;
-    }
-
-  // Move the handle points
-  double newCtr[3];
-  for ( i = 0; i < this->NumberOfHandles; ++i )
-    {
-    ctr = this->HandleGeometry[i]->GetCenter();
-    for ( int j = 0; j < 3; ++j )
-      {
-      newCtr[j] = sf * (ctr[j] - center[j]) + center[j];
-      }
-    this->HandleGeometry[i]->SetCenter(newCtr);
-    this->HandleGeometry[i]->Update();
-    }
-}
-
-//----------------------------------------------------------------------------
-void vtkCurveRepresentation::Spin(double *p1, double *p2, double *vpn)
-{
-  // Mouse motion vector in world space
-  double v[3];
-  v[0] = p2[0] - p1[0];
-  v[1] = p2[1] - p1[1];
-  v[2] = p2[2] - p1[2];
-
-  // Axis of rotation
-  double axis[3] = {0.0,0.0,0.0};
-
-  if ( this->ProjectToPlane )
-    {
-    if ( this->ProjectionNormal == VTK_PROJECTION_OBLIQUE && \
-         this->PlaneSource != NULL )
-      {
-      double* normal = this->PlaneSource->GetNormal();
-      axis[0] = normal[0];
-      axis[1] = normal[1];
-      axis[2] = normal[2];
-      vtkMath::Normalize(axis);
-      }
-    else
-      {
-      axis[ this->ProjectionNormal ] = 1.0;
-      }
-    }
-  else
-    {
-  // Create axis of rotation and angle of rotation
-    vtkMath::Cross(vpn,v,axis);
-    if ( vtkMath::Normalize(axis) == 0.0 )
-      {
-      return;
-      }
-    }
-
-  // Radius vector (from mean center to cursor position)
-  double rv[3] = {p2[0] - this->Centroid[0],
-                  p2[1] - this->Centroid[1],
-                  p2[2] - this->Centroid[2]};
-
-  // Distance between center and cursor location
-  double rs = vtkMath::Normalize(rv);
-
-  // Spin direction
-  double ax_cross_rv[3];
-  vtkMath::Cross(axis,rv,ax_cross_rv);
-
-  // Spin angle
-  double theta = 360.0 * vtkMath::Dot(v,ax_cross_rv) / rs;
-
-  // Manipulate the transform to reflect the rotation
-  this->Transform->Identity();
-  this->Transform->Translate(this->Centroid[0],this->Centroid[1],this->Centroid[2]);
-  this->Transform->RotateWXYZ(theta,axis);
-  this->Transform->Translate(-this->Centroid[0],-this->Centroid[1],-this->Centroid[2]);
-
-  // Set the handle points
-  double newCtr[3];
-  double ctr[3];
-  for ( int i = 0; i < this->NumberOfHandles; ++i )
-    {
-    this->HandleGeometry[i]->GetCenter(ctr);
-    this->Transform->TransformPoint(ctr,newCtr);
-    this->HandleGeometry[i]->SetCenter(newCtr);
-    this->HandleGeometry[i]->Update();
-    }
-}
-
-//----------------------------------------------------------------------------
-void vtkCurveRepresentation::CreateDefaultProperties()
-{
-  this->HandleProperty = vtkProperty::New();
-  this->HandleProperty->SetColor(1,1,1);
-
-  this->SelectedHandleProperty = vtkProperty::New();
-  this->SelectedHandleProperty->SetColor(1,0,0);
-
-  this->LineProperty = vtkProperty::New();
-  this->LineProperty->SetRepresentationToWireframe();
-  this->LineProperty->SetAmbient(1.0);
-  this->LineProperty->SetColor(1.0,1.0,0.0);
-  this->LineProperty->SetLineWidth(2.0);
-
-  this->SelectedLineProperty = vtkProperty::New();
-  this->SelectedLineProperty->SetRepresentationToWireframe();
-  this->SelectedLineProperty->SetAmbient(1.0);
-  this->SelectedLineProperty->SetAmbientColor(0.0,1.0,0.0);
-  this->SelectedLineProperty->SetLineWidth(2.0);
-}
-
-//----------------------------------------------------------------------------
-void vtkCurveRepresentation::SetProjectionPosition(double position)
-{
-  this->ProjectionPosition = position;
-  if ( this->ProjectToPlane )
-    {
-    this->ProjectPointsToPlane();
-    }
-  this->BuildRepresentation();
-}
-
-//----------------------------------------------------------------------------
-void vtkCurveRepresentation::SetPlaneSource(vtkPlaneSource* plane)
-{
-  if (this->PlaneSource == plane)
-    {
-    return;
-    }
-  this->PlaneSource = plane;
-}
-
-//----------------------------------------------------------------------------
-void vtkCurveRepresentation::Initialize(void)
-{
-  int i;
-  for ( i = 0; i < this->NumberOfHandles; ++i )
-    {
-    this->HandlePicker->DeletePickList(this->Handle[i]);
-    this->HandleGeometry[i]->Delete();
-    this->Handle[i]->Delete();
-    }
-
-  this->NumberOfHandles = 0;
-
-  delete [] this->Handle;
-  delete [] this->HandleGeometry;
-}
-
-//----------------------------------------------------------------------------
-void vtkCurveRepresentation::SizeHandles()
-{
-  if (this->NumberOfHandles > 0)
-    {
-    double radius = this->SizeHandlesInPixels(1.5,
-      this->HandleGeometry[0]->GetCenter());
-    //cout << "Raduis: " << radius << endl;
-    for ( int i = 0; i < this->NumberOfHandles; ++i )
-      {
-      this->HandleGeometry[i]->SetRadius(radius);
-      }
-    }
-}
-
-//----------------------------------------------------------------------------
-void vtkCurveRepresentation::CalculateCentroid()
-{
-  this->Centroid[0] = 0.0;
-  this->Centroid[1] = 0.0;
-  this->Centroid[2] = 0.0;
-
-  double ctr[3];
-  for ( int i = 0; i < this->NumberOfHandles; ++i )
-    {
-    this->HandleGeometry[i]->GetCenter(ctr);
-    this->Centroid[0] += ctr[0];
-    this->Centroid[1] += ctr[1];
-    this->Centroid[2] += ctr[2];
-    }
-
-  this->Centroid[0] /= this->NumberOfHandles;
-  this->Centroid[1] /= this->NumberOfHandles;
-  this->Centroid[2] /= this->NumberOfHandles;
-}
-
-//----------------------------------------------------------------------------
-void vtkCurveRepresentation::InsertHandleOnLine(double* pos)
-{
-  if (this->NumberOfHandles < 2) { return; }
-
-  vtkIdType id = this->LinePicker->GetCellId();
-  if (id == -1){ return; }
-
-  vtkIdType subid = this->LinePicker->GetSubId();
-
-  vtkPoints* newpoints = vtkPoints::New(VTK_DOUBLE);
-  newpoints->SetNumberOfPoints(this->NumberOfHandles+1);
-
-  int istart = subid;
-  int istop = istart + 1;
-  int count = 0;
-  int i;
-  for ( i = 0; i <= istart; ++i )
-    {
-    newpoints->SetPoint(count++,this->HandleGeometry[i]->GetCenter());
-    }
-
-  newpoints->SetPoint(count++,pos);
-
-  for ( i = istop; i < this->NumberOfHandles; ++i )
-    {
-    newpoints->SetPoint(count++,this->HandleGeometry[i]->GetCenter());
-    }
-
-  this->InitializeHandles(newpoints);
-  newpoints->Delete();
-}
-
-//----------------------------------------------------------------------------
-void vtkCurveRepresentation::EraseHandle(const int& index)
-{
-  if ( this->NumberOfHandles < 3 || index < 0 || index >= this->NumberOfHandles )
-    {
-    return;
-    }
-
-  vtkPoints* newpoints = vtkPoints::New(VTK_DOUBLE);
-  newpoints->SetNumberOfPoints(this->NumberOfHandles-1);
-  int count = 0;
-  for (int i = 0; i < this->NumberOfHandles; ++i )
-    {
-    if ( i != index )
-      {
-      newpoints->SetPoint(count++,this->HandleGeometry[i]->GetCenter());
-      }
-    }
-
-  this->InitializeHandles(newpoints);
-  newpoints->Delete();
-}
-
-//----------------------------------------------------------------------------
-int vtkCurveRepresentation::IsClosed()
-{
-  if ( this->NumberOfHandles < 3 || !this->Closed ) { return 0; }
-
-  vtkPolyData* lineData = vtkPolyData::New();
-  this->GetPolyData(lineData);
-  if ( !lineData || !(lineData->GetPoints()) )
-    {
-    vtkErrorMacro(<<"No line data to query geometric closure");
-    return 0;
-    }
-
-  vtkPoints *points = lineData->GetPoints();
-  int numPoints = points->GetNumberOfPoints();
-
-  if ( numPoints < 3 )
-    {
-    return 0;
-    }
-
-  int numEntries = lineData->GetLines()->GetNumberOfConnectivityEntries();
-
-  double p0[3];
-  double p1[3];
-
-  points->GetPoint( 0, p0 );
-  points->GetPoint( numPoints - 1, p1 );
-  int minusNth = ( p0[0] == p1[0] && p0[1] == p1[1] && p0[2] == p1[2] ) ? 1 : 0;
-  int result;
-  if ( minusNth ) //definitely closed
-    {
-    result = 1;
-    }
-  else       // not physically closed, check connectivity
-    {
-    result = ( ( numEntries - numPoints ) == 2 ) ? 1 : 0;
-    }
-
-  return result;
-}
-
-//----------------------------------------------------------------------------
-void vtkCurveRepresentation::ReleaseGraphicsResources(vtkWindow* win)
-{
-  this->LineActor->ReleaseGraphicsResources(win);
-  for (int cc=0; cc < this->NumberOfHandles; cc++)
-    {
-    this->Handle[cc]->ReleaseGraphicsResources(win);
-    }
-}
-
-//----------------------------------------------------------------------------
-int vtkCurveRepresentation::RenderOpaqueGeometry(vtkViewport* win)
-{
-  this->BuildRepresentation();
-
-  int count = 0;
-  count += this->LineActor->RenderOpaqueGeometry(win);
-  for (int cc=0; cc < this->NumberOfHandles; cc++)
-    {
-    count+= this->Handle[cc]->RenderOpaqueGeometry(win);
-    }
-  return count;
-}
-
-//----------------------------------------------------------------------------
-int vtkCurveRepresentation::RenderTranslucentPolygonalGeometry(
-  vtkViewport* win)
-{
-  int count = 0;
-  count += this->LineActor->RenderTranslucentPolygonalGeometry(win);
-  for (int cc=0; cc < this->NumberOfHandles; cc++)
-    {
-    count += this->Handle[cc]->RenderTranslucentPolygonalGeometry(win);
-    }
-  return count;
-}
-
-//----------------------------------------------------------------------------
-int vtkCurveRepresentation::RenderOverlay(vtkViewport* win)
-{
-  int count = 0;
-  count += this->LineActor->RenderOverlay(win);
-  for (int cc=0; cc < this->NumberOfHandles; cc++)
-    {
-    count += this->Handle[cc]->RenderOverlay(win);
-    }
-  return count;
-}
-
-//----------------------------------------------------------------------------
-int vtkCurveRepresentation::HasTranslucentPolygonalGeometry()
-{
-  this->BuildRepresentation();
-  int count = 0;
-  count |= this->LineActor->HasTranslucentPolygonalGeometry();
-  for (int cc=0; cc < this->NumberOfHandles; cc++)
-    {
-    count |= this->Handle[cc]->HasTranslucentPolygonalGeometry();
-    }
-  return count;
-}
-
-//----------------------------------------------------------------------------
-int vtkCurveRepresentation::ComputeInteractionState(int X, int Y,
-  int vtkNotUsed(modify))
-{
-  this->InteractionState = vtkCurveRepresentation::Outside;
-  if (!this->Renderer || !this->Renderer->IsInViewport(X, Y))
-    {
-    return this->InteractionState;
-    }
-
-  // Try and pick a handle first. This allows the picking of the handle even
-  // if it is "behind" the poly line.
-  int handlePicked = 0;
-
-  vtkAssemblyPath* path = this->GetAssemblyPath(X, Y, 0., this->HandlePicker);
-
-  if ( path != NULL )
-    {
-    this->ValidPick = 1;
-    this->InteractionState = vtkCurveRepresentation::OnHandle;
-    this->CurrentHandleIndex =
-      this->HighlightHandle(path->GetFirstNode()->GetViewProp());
-    this->HandlePicker->GetPickPosition(this->LastPickPosition);
-    handlePicked = 1;
-    }
-  else
-    {
-    this->CurrentHandleIndex = this->HighlightHandle(NULL);
-    }
-
-  if (!handlePicked)
-    {
-    path = this->GetAssemblyPath(X, Y, 0., this->LinePicker);
-
-    if ( path != NULL )
-      {
-      this->ValidPick = 1;
-      this->LinePicker->GetPickPosition(this->LastPickPosition);
-      this->HighlightLine(1);
-      this->InteractionState = vtkCurveRepresentation::OnLine;
-      }
-    else
-      {
-      this->HighlightLine(0);
-      }
-    }
-  else
-    {
-    this->HighlightLine(0);
-    }
-
-  return this->InteractionState;
-}
-
-//----------------------------------------------------------------------------
-void vtkCurveRepresentation::StartWidgetInteraction(double e[2])
-{
-  // Store the start position
-  this->StartEventPosition[0] = e[0];
-  this->StartEventPosition[1] = e[1];
-  this->StartEventPosition[2] = 0.0;
-
-  // Store the start position
-  this->LastEventPosition[0] = e[0];
-  this->LastEventPosition[1] = e[1];
-  this->LastEventPosition[2] = 0.0;
-
-  this->ComputeInteractionState(static_cast<int>(e[0]),static_cast<int>(e[1]),0);
-}
-
-//----------------------------------------------------------------------------
-void vtkCurveRepresentation::WidgetInteraction(double e[2])
-{
-  // Convert events to appropriate coordinate systems
-  vtkCamera *camera = this->Renderer->GetActiveCamera();
-  if ( !camera )
-    {
-    return;
-    }
-  double focalPoint[4], pickPoint[4], prevPickPoint[4];
-  double z, vpn[3];
-
-  // Compute the two points defining the motion vector
-  vtkInteractorObserver::ComputeWorldToDisplay(this->Renderer,
-    this->LastPickPosition[0], this->LastPickPosition[1], this->LastPickPosition[2],
-    focalPoint);
-  z = focalPoint[2];
-  vtkInteractorObserver::ComputeDisplayToWorld(this->Renderer,this->LastEventPosition[0],
-                                               this->LastEventPosition[1], z, prevPickPoint);
-  vtkInteractorObserver::ComputeDisplayToWorld(this->Renderer, e[0], e[1], z, pickPoint);
-
-  // Process the motion
-  if (this->InteractionState == vtkCurveRepresentation::Moving)
-    {
-    if (this->CurrentHandleIndex != -1)
-      {
-      this->MovePoint(prevPickPoint, pickPoint);
-      }
-    else
-      {
-       this->Translate(prevPickPoint, pickPoint);
-      }
-    }
-  else if (this->InteractionState == vtkCurveRepresentation::Scaling)
-    {
-    this->Scale(prevPickPoint, pickPoint,
-      static_cast<int>(e[0]), static_cast<int>(e[1]));
-    }
-  else if (this->InteractionState == vtkCurveRepresentation::Spinning)
-    {
-    camera->GetViewPlaneNormal(vpn);
-    this->Spin(prevPickPoint, pickPoint, vpn);
-    }
-
-  if (this->ProjectToPlane)
-    {
-    this->ProjectPointsToPlane();
-    }
-
-  this->BuildRepresentation();
-
-  // Store the position
-  this->LastEventPosition[0] = e[0];
-  this->LastEventPosition[1] = e[1];
-  this->LastEventPosition[2] = 0.0;
-}
-
-//----------------------------------------------------------------------------
-void vtkCurveRepresentation::EndWidgetInteraction(double[2])
-{
-  switch (this->InteractionState)
-    {
-  case vtkCurveRepresentation::Inserting:
-    this->InsertHandleOnLine(this->LastPickPosition);
-    break;
-
-  case vtkCurveRepresentation::Erasing:
-    if (this->CurrentHandleIndex)
-      {
-      int index = this->CurrentHandleIndex;
-      this->CurrentHandleIndex = this->HighlightHandle(NULL);
-      this->EraseHandle(index);
-      }
-    }
-
-  this->HighlightLine(0);
-  this->InteractionState = vtkCurveRepresentation::Outside;
-}
-
-//----------------------------------------------------------------------------
-double* vtkCurveRepresentation::GetBounds()
-{
-  this->BuildRepresentation();
-
-  vtkBoundingBox bbox;
-  bbox.AddBounds(this->LineActor->GetBounds());
-  for (int cc=0; cc < this->NumberOfHandles; cc++)
-    {
-    bbox.AddBounds(this->HandleGeometry[cc]->GetOutput()->GetBounds());
-    }
-  bbox.GetBounds(this->Bounds);
-  return this->Bounds;
-}
-
-
-//----------------------------------------------------------------------------
-void vtkCurveRepresentation::SetLineColor(double r, double g, double b)
-{
-  this->GetLineProperty()->SetColor(r, g, b);
-}
-
-//----------------------------------------------------------------------------
-void vtkCurveRepresentation::PrintSelf(ostream& os, vtkIndent indent)
-{
-  this->Superclass::PrintSelf(os,indent);
-
-  if ( this->HandleProperty )
-    {
-    os << indent << "Handle Property: " << this->HandleProperty << "\n";
-    }
-  else
-    {
-    os << indent << "Handle Property: (none)\n";
-    }
-  if ( this->SelectedHandleProperty )
-    {
-    os << indent << "Selected Handle Property: "
-       << this->SelectedHandleProperty << "\n";
-    }
-  else
-    {
-    os << indent << "Selected Handle Property: (none)\n";
-    }
-  if ( this->LineProperty )
-    {
-    os << indent << "Line Property: " << this->LineProperty << "\n";
-    }
-  else
-    {
-    os << indent << "Line Property: (none)\n";
-    }
-  if ( this->SelectedLineProperty )
-    {
-    os << indent << "Selected Line Property: "
-       << this->SelectedLineProperty << "\n";
-    }
-  else
-    {
-    os << indent << "Selected Line Property: (none)\n";
-    }
-
-  os << indent << "Project To Plane: "
-     << (this->ProjectToPlane ? "On" : "Off") << "\n";
-  os << indent << "Projection Normal: " << this->ProjectionNormal << "\n";
-  os << indent << "Projection Position: " << this->ProjectionPosition << "\n";
-  os << indent << "Number Of Handles: " << this->NumberOfHandles << "\n";
-  os << indent << "Closed: "
-     << (this->Closed ? "On" : "Off") << "\n";
-  os << indent << "InteractionState: " << this->InteractionState << endl;
-}
diff --git a/Interaction/Widgets/vtkCurveRepresentation.h b/Interaction/Widgets/vtkCurveRepresentation.h
deleted file mode 100644
index b836d98..0000000
--- a/Interaction/Widgets/vtkCurveRepresentation.h
+++ /dev/null
@@ -1,264 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkCurveRepresentation
-
-  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.
-
-=========================================================================*/
-// .NAME vtkCurveRepresentation - vtkWidgetRepresentation
-// base class for a widget that represents an curve that connects control
-// points.
-// .SECTION Description
-// Base class for widgets used to define curves from points, such as
-// vtkPolyLineRepresentation and vtkSplineRepresentation.  This class
-// uses handles, the number of which can be changed, to represent the
-// points that define the curve. The handles can be picked can be
-// picked on the curve itself to translate or rotate it in the scene.
-
-#ifndef vtkCurveRepresentation_h
-#define vtkCurveRepresentation_h
-
-#include "vtkInteractionWidgetsModule.h" // For export macro
-#include "vtkWidgetRepresentation.h"
-
-class vtkActor;
-class vtkCellPicker;
-class vtkDoubleArray;
-class vtkPlaneSource;
-class vtkPoints;
-class vtkPolyData;
-class vtkProp;
-class vtkProperty;
-class vtkSphereSource;
-class vtkTransform;
-
-#define VTK_PROJECTION_YZ 0
-#define VTK_PROJECTION_XZ 1
-#define VTK_PROJECTION_XY 2
-#define VTK_PROJECTION_OBLIQUE 3
-class VTKINTERACTIONWIDGETS_EXPORT vtkCurveRepresentation : public vtkWidgetRepresentation
-{
-public:
-  vtkTypeMacro(vtkCurveRepresentation, vtkWidgetRepresentation);
-  void PrintSelf(ostream& os, vtkIndent indent);
-//BTX
-  // Used to manage the InteractionState of the widget
-  enum _InteractionState {
-    Outside=0,
-    OnHandle,
-    OnLine,
-    Moving,
-    Scaling,
-    Spinning,
-    Inserting,
-    Erasing
-  };
-//ETX
-
-  // Description:
-  // Set the interaction state
-  vtkSetMacro(InteractionState, int);
-
-  // Description:
-  // Force the widget to be projected onto one of the orthogonal
-  // planes.  Remember that when the InteractionState changes, a
-  // ModifiedEvent is invoked.  This can be used to snap the curve to
-  // the plane if it is originally not aligned.  The normal in
-  // SetProjectionNormal is 0,1,2 for YZ,XZ,XY planes respectively and
-  // 3 for arbitrary oblique planes when the widget is tied to a
-  // vtkPlaneSource.
-  vtkSetMacro(ProjectToPlane,int);
-  vtkGetMacro(ProjectToPlane,int);
-  vtkBooleanMacro(ProjectToPlane,int);
-
-  // Description:
-  // Set up a reference to a vtkPlaneSource that could be from another widget
-  // object, e.g. a vtkPolyDataSourceWidget.
-  void SetPlaneSource(vtkPlaneSource* plane);
-
-  vtkSetClampMacro(ProjectionNormal,int,VTK_PROJECTION_YZ,VTK_PROJECTION_OBLIQUE);
-  vtkGetMacro(ProjectionNormal,int);
-  void SetProjectionNormalToXAxes()
-    { this->SetProjectionNormal(0); }
-  void SetProjectionNormalToYAxes()
-    { this->SetProjectionNormal(1); }
-  void SetProjectionNormalToZAxes()
-    { this->SetProjectionNormal(2); }
-  void SetProjectionNormalToOblique()
-    { this->SetProjectionNormal(3); }
-
-  // Description:
-  // Set the position of poly line handles and points in terms of a plane's
-  // position. i.e., if ProjectionNormal is 0, all of the x-coordinate
-  // values of the points are set to position. Any value can be passed (and is
-  // ignored) to update the poly line points when Projection normal is set to 3
-  // for arbritrary plane orientations.
-  void SetProjectionPosition(double position);
-  vtkGetMacro(ProjectionPosition, double);
-
-  // Description:
-  // Grab the polydata (including points) that defines the
-  // interpolating curve. Points are guaranteed to be up-to-date when
-  // either the InteractionEvent or EndInteraction events are
-  // invoked. The user provides the vtkPolyData and the points and
-  // polyline are added to it.
-  virtual void GetPolyData(vtkPolyData *pd) = 0;
-
-  // Description:
-  // Set/Get the handle properties (the spheres are the handles). The
-  // properties of the handles when selected and unselected can be manipulated.
-  vtkGetObjectMacro(HandleProperty, vtkProperty);
-  vtkGetObjectMacro(SelectedHandleProperty, vtkProperty);
-
-  // Description:
-  // Set/Get the line properties. The properties of the line when selected
-  // and unselected can be manipulated.
-  vtkGetObjectMacro(LineProperty, vtkProperty);
-  vtkGetObjectMacro(SelectedLineProperty, vtkProperty);
-
-  // Description:
-  // Set/Get the number of handles for this widget.
-  virtual void SetNumberOfHandles(int npts) = 0;
-  vtkGetMacro(NumberOfHandles, int);
-
-  // Description:
-  // Set/Get the position of the handles. Call GetNumberOfHandles
-  // to determine the valid range of handle indices.
-  virtual void SetHandlePosition(int handle, double x, double y, double z);
-  virtual void SetHandlePosition(int handle, double xyz[3]);
-  virtual void GetHandlePosition(int handle, double xyz[3]);
-  virtual double* GetHandlePosition(int handle);
-  virtual vtkDoubleArray* GetHandlePositions() = 0;
-
-  // Description:
-  // Control whether the curve is open or closed. A closed forms a
-  // continuous loop: the first and last points are the same.  A
-  // minimum of 3 handles are required to form a closed loop.
-  void SetClosed(int closed);
-  vtkGetMacro(Closed,int);
-  vtkBooleanMacro(Closed,int);
-
-  // Description:
-  // Convenience method to determine whether the curve is
-  // closed in a geometric sense.  The widget may be set "closed" but still
-  // be geometrically open (e.g., a straight line).
-  int IsClosed();
-
-  // Description:
-  // Get the approximate vs. the true arc length of the curve. Calculated as
-  // the summed lengths of the individual straight line segments. Use
-  // SetResolution to control the accuracy.
-  virtual double GetSummedLength() = 0;
-
-  // Description:
-  // Convenience method to allocate and set the handles from a
-  // vtkPoints instance.  If the first and last points are the same,
-  // the curve sets Closed to the on InteractionState and disregards
-  // the last point, otherwise Closed remains unchanged.
-  virtual void InitializeHandles(vtkPoints* points) = 0;
-
-  // Description:
-  // These are methods that satisfy vtkWidgetRepresentation's
-  // API. Note that a version of place widget is available where the
-  // center and handle position are specified.
-  virtual void BuildRepresentation() = 0;
-  virtual int ComputeInteractionState(int X, int Y, int modify=0);
-  virtual void StartWidgetInteraction(double e[2]);
-  virtual void WidgetInteraction(double e[2]);
-  virtual void EndWidgetInteraction(double e[2]);
-  virtual double *GetBounds();
-
-  // Description:
-  // Methods supporting, and required by, the rendering process.
-  virtual void ReleaseGraphicsResources(vtkWindow*);
-  virtual int RenderOpaqueGeometry(vtkViewport*);
-  virtual int RenderTranslucentPolygonalGeometry(vtkViewport*);
-  virtual int RenderOverlay(vtkViewport*);
-  virtual int HasTranslucentPolygonalGeometry();
-
-  // Description:
-  // Convenience method to set the line color.
-  // Ideally one should use GetLineProperty()->SetColor().
-  void SetLineColor(double r, double g, double b);
-
-//BTX
-protected:
-  vtkCurveRepresentation();
-  ~vtkCurveRepresentation();
-
-  double LastEventPosition[3];
-  double Bounds[6];
-
-  // Controlling vars
-  int             ProjectionNormal;
-  double          ProjectionPosition;
-  int             ProjectToPlane;
-  vtkPlaneSource* PlaneSource;
-
-  // Projection capabilities
-  void ProjectPointsToPlane();
-  void ProjectPointsToOrthoPlane();
-  void ProjectPointsToObliquePlane();
-
-  int NumberOfHandles;
-  int Closed;
-
-  // The line segments
-  vtkActor           *LineActor;
-  void HighlightLine(int highlight);
-
-  // Glyphs representing hot spots (e.g., handles)
-  vtkActor          **Handle;
-  vtkSphereSource   **HandleGeometry;
-  void Initialize();
-  int  HighlightHandle(vtkProp *prop); //returns handle index or -1 on fail
-  virtual void SizeHandles();
-  virtual void InsertHandleOnLine(double* pos) = 0;
-  void EraseHandle(const int&);
-
-  // Do the picking
-  vtkCellPicker *HandlePicker;
-  vtkCellPicker *LinePicker;
-  double LastPickPosition[3];
-  vtkActor *CurrentHandle;
-  int CurrentHandleIndex;
-
-  // Register internal Pickers within PickingManager
-  virtual void RegisterPickers();
-
-  // Methods to manipulate the curve.
-  void MovePoint(double *p1, double *p2);
-  void Scale(double *p1, double *p2, int X, int Y);
-  void Translate(double *p1, double *p2);
-  void Spin(double *p1, double *p2, double *vpn);
-
-  // Transform the control points (used for spinning)
-  vtkTransform *Transform;
-
-  // Properties used to control the appearance of selected objects and
-  // the manipulator in general.
-  vtkProperty *HandleProperty;
-  vtkProperty *SelectedHandleProperty;
-  vtkProperty *LineProperty;
-  vtkProperty *SelectedLineProperty;
-  void CreateDefaultProperties();
-
-  // For efficient spinning
-  double Centroid[3];
-  void CalculateCentroid();
-
-private:
-  vtkCurveRepresentation(const vtkCurveRepresentation&); // Not implemented.
-  void operator=(const vtkCurveRepresentation&); // Not implemented.
-//ETX
-};
-
-
-#endif
diff --git a/Interaction/Widgets/vtkEllipsoidTensorProbeRepresentation.cxx b/Interaction/Widgets/vtkEllipsoidTensorProbeRepresentation.cxx
index d93c5c6..a4b7d2a 100644
--- a/Interaction/Widgets/vtkEllipsoidTensorProbeRepresentation.cxx
+++ b/Interaction/Widgets/vtkEllipsoidTensorProbeRepresentation.cxx
@@ -199,7 +199,6 @@ void vtkEllipsoidTensorProbeRepresentation::GetActors(vtkPropCollection *pc)
 void vtkEllipsoidTensorProbeRepresentation::ReleaseGraphicsResources(vtkWindow *win)
 {
   this->EllipsoidActor->ReleaseGraphicsResources(win);
-  this->Superclass::ReleaseGraphicsResources(win);
 }
 
 //----------------------------------------------------------------------
diff --git a/Interaction/Widgets/vtkImageTracerWidget.cxx b/Interaction/Widgets/vtkImageTracerWidget.cxx
index e450760..48394af 100644
--- a/Interaction/Widgets/vtkImageTracerWidget.cxx
+++ b/Interaction/Widgets/vtkImageTracerWidget.cxx
@@ -1529,3 +1529,28 @@ void vtkImageTracerWidget::SizeHandles()
   // TODO...
   return;
 }
+
+//----------------------------------------------------------------------------
+#ifndef VTK_LEGACY_REMOVE
+# ifdef VTK_WORKAROUND_WINDOWS_MANGLE
+#  undef SetProp
+void vtkImageTracerWidget::SetPropA(vtkProp* prop)
+{
+  VTK_LEGACY_REPLACED_BODY(vtkImageTracerWidget::SetProp, "VTK 5.0",
+                           vtkImageTracerWidget::SetViewProp);
+  this->SetViewProp(prop);
+}
+void vtkImageTracerWidget::SetPropW(vtkProp* prop)
+{
+  VTK_LEGACY_REPLACED_BODY(vtkImageTracerWidget::SetProp, "VTK 5.0",
+                           vtkImageTracerWidget::SetViewProp);
+  this->SetViewProp(prop);
+}
+# endif
+void vtkImageTracerWidget::SetProp(vtkProp* prop)
+{
+  VTK_LEGACY_REPLACED_BODY(vtkImageTracerWidget::SetProp, "VTK 5.0",
+                           vtkImageTracerWidget::SetViewProp);
+  this->SetViewProp(prop);
+}
+#endif
diff --git a/Interaction/Widgets/vtkImageTracerWidget.h b/Interaction/Widgets/vtkImageTracerWidget.h
index 824713a..2ed2512 100644
--- a/Interaction/Widgets/vtkImageTracerWidget.h
+++ b/Interaction/Widgets/vtkImageTracerWidget.h
@@ -226,9 +226,17 @@ public:
 # define SetPropW SetProp
 #endif
 
+  // Description:
+  // @deprecated Replaced by vtkImageTracerWidget::SetViewProp() as of VTK 5.0.
+  VTK_LEGACY(void SetProp(vtkProp* prop));
+
 #ifdef VTK_WORKAROUND_WINDOWS_MANGLE
 # undef SetPropA
 # undef SetPropW
+  //BTX
+  VTK_LEGACY(void SetPropA(vtkProp*));
+  VTK_LEGACY(void SetPropW(vtkProp*));
+  //ETX
 #endif
 
 protected:
diff --git a/Interaction/Widgets/vtkImplicitPlaneRepresentation.cxx b/Interaction/Widgets/vtkImplicitPlaneRepresentation.cxx
index d51919f..c62fab9 100644
--- a/Interaction/Widgets/vtkImplicitPlaneRepresentation.cxx
+++ b/Interaction/Widgets/vtkImplicitPlaneRepresentation.cxx
@@ -1222,16 +1222,6 @@ void vtkImplicitPlaneRepresentation::BuildRepresentation()
     return;
     }
 
-  vtkInformation *info = this->GetPropertyKeys();
-  this->OutlineActor->SetPropertyKeys(info);
-  this->CutActor->SetPropertyKeys(info);
-  this->EdgesActor->SetPropertyKeys(info);
-  this->ConeActor->SetPropertyKeys(info);
-  this->LineActor->SetPropertyKeys(info);
-  this->ConeActor2->SetPropertyKeys(info);
-  this->LineActor2->SetPropertyKeys(info);
-  this->SphereActor->SetPropertyKeys(info);
-
   if ( this->GetMTime() > this->BuildTime ||
        this->Plane->GetMTime() > this->BuildTime )
     {
diff --git a/Interaction/Widgets/vtkPolyLineRepresentation.cxx b/Interaction/Widgets/vtkPolyLineRepresentation.cxx
deleted file mode 100644
index db61574..0000000
--- a/Interaction/Widgets/vtkPolyLineRepresentation.cxx
+++ /dev/null
@@ -1,297 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkPolyLineRepresentation.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 "vtkPolyLineRepresentation.h"
-
-#include "vtkActor.h"
-#include "vtkBoundingBox.h"
-#include "vtkCellPicker.h"
-#include "vtkDoubleArray.h"
-#include "vtkMath.h"
-#include "vtkObjectFactory.h"
-#include "vtkPolyData.h"
-#include "vtkPolyDataMapper.h"
-#include "vtkPolyLineSource.h"
-#include "vtkSphereSource.h"
-
-//----------------------------------------------------------------------------
-vtkStandardNewMacro(vtkPolyLineRepresentation);
-
-//----------------------------------------------------------------------------
-vtkPolyLineRepresentation::vtkPolyLineRepresentation()
-{
-  // Build the representation of the widget
-
-  // Default bounds to get started
-  double x0 = -0.5;
-  double x1 =  0.5;
-  double y0 = -0.5;
-  double y1 =  0.5;
-  double z0 = -0.5;
-  double z1 =  0.5;
-
-  vtkPoints* points = vtkPoints::New(VTK_DOUBLE);
-  points->SetNumberOfPoints(this->NumberOfHandles);
-
-  for ( int i = 0; i < this->NumberOfHandles; ++i )
-    {
-    double u = i / (this->NumberOfHandles - 1.0);
-    double x = (1.0 - u)*x0 + u*x1;
-    double y = (1.0 - u)*y0 + u*y1;
-    double z = (1.0 - u)*z0 + u*z1;
-    points->SetPoint(i, x, y, z);
-    this->HandleGeometry[i]->SetCenter(x,y,z);
-    }
-
-  this->PolyLineSource = vtkPolyLineSource::New();
-  this->PolyLineSource->SetPoints(points);
-  points->Delete();
-  this->PolyLineSource->Update();
-
-  vtkPolyDataMapper* lineMapper = vtkPolyDataMapper::New();
-  lineMapper->SetInputConnection(
-    this->PolyLineSource->GetOutputPort()) ;
-  lineMapper->ImmediateModeRenderingOn();
-  lineMapper->SetResolveCoincidentTopologyToPolygonOffset();
-
-  this->LineActor->SetMapper( lineMapper );
-  lineMapper->Delete();
-}
-
-//----------------------------------------------------------------------------
-vtkPolyLineRepresentation::~vtkPolyLineRepresentation()
-{
-  this->PolyLineSource->Delete();
-}
-
-//----------------------------------------------------------------------------
-vtkDoubleArray* vtkPolyLineRepresentation::GetHandlePositions()
-{
-  return vtkDoubleArray::SafeDownCast(
-    this->PolyLineSource->GetPoints()->GetData());
-}
-
-//----------------------------------------------------------------------------
-void vtkPolyLineRepresentation::BuildRepresentation()
-{
-  this->ValidPick = 1;
-  // TODO: Avoid unnecessary rebuilds.
-  // Handles have changed position, re-compute the points
-  vtkPoints* points = this->PolyLineSource->GetPoints();
-  if ( points->GetNumberOfPoints() != this->NumberOfHandles )
-    {
-    points->SetNumberOfPoints( this->NumberOfHandles );
-    }
-
-  vtkBoundingBox bbox;
-  for ( int i = 0; i < this->NumberOfHandles; ++i )
-    {
-    double pt[3];
-    this->HandleGeometry[i]->GetCenter(pt);
-    points->SetPoint(i, pt);
-    bbox.AddPoint(pt);
-    }
-  this->PolyLineSource->SetClosed(this->Closed);
-  this->PolyLineSource->Modified();
-
-  double bounds[6];
-  bbox.GetBounds(bounds);
-  this->InitialLength = sqrt((bounds[1]-bounds[0])*(bounds[1]-bounds[0]) +
-                             (bounds[3]-bounds[2])*(bounds[3]-bounds[2]) +
-                             (bounds[5]-bounds[4])*(bounds[5]-bounds[4]));
-  this->SizeHandles();
-}
-//----------------------------------------------------------------------------
-void vtkPolyLineRepresentation::SetNumberOfHandles(int npts)
-{
-  if ( this->NumberOfHandles == npts )
-    {
-    return;
-    }
-  if (npts < 1)
-    {
-    vtkGenericWarningMacro(<<"vtkPolyLineRepresentation: minimum of 1 points required.");
-    return;
-    }
-
-  // Ensure that no handle is current
-  this->HighlightHandle(NULL);
-
-  double radius = this->HandleGeometry[0]->GetRadius();
-  this->Initialize();
-
-  this->NumberOfHandles = npts;
-
-  vtkIdType prevNumPoints = this->PolyLineSource->GetNumberOfPoints();
-  if (this->PolyLineSource->GetNumberOfPoints() != npts)
-    {
-    this->PolyLineSource->Resize(npts);
-    for (vtkIdType i = prevNumPoints; i < npts; ++i)
-      {
-      double pt[3] = {0.0, 0.0, 0.0};
-      this->PolyLineSource->GetPoints()->SetPoint(i, pt);
-      }
-    }
-
-  // Create the handles
-  this->Handle         = new vtkActor* [this->NumberOfHandles];
-  this->HandleGeometry = new vtkSphereSource* [this->NumberOfHandles];
-
-  for ( int i = 0; i < this->NumberOfHandles; ++i )
-    {
-    this->HandleGeometry[i] = vtkSphereSource::New();
-    this->HandleGeometry[i]->SetThetaResolution(16);
-    this->HandleGeometry[i]->SetPhiResolution(8);
-    vtkPolyDataMapper* handleMapper = vtkPolyDataMapper::New();
-    handleMapper->SetInputConnection(
-      this->HandleGeometry[i]->GetOutputPort());
-    this->Handle[i] = vtkActor::New();
-    this->Handle[i]->SetMapper(handleMapper);
-    handleMapper->Delete();
-    this->Handle[i]->SetProperty(this->HandleProperty);
-    double pt[3];
-    this->PolyLineSource->GetPoints()->GetPoint(i, pt);
-    this->HandleGeometry[i]->SetCenter(pt);
-    this->HandleGeometry[i]->SetRadius(radius);
-    this->HandlePicker->AddPickList(this->Handle[i]);
-    }
-
-  if (this->CurrentHandleIndex >= 0 &&
-    this->CurrentHandleIndex < this->NumberOfHandles)
-    {
-    this->CurrentHandleIndex =
-      this->HighlightHandle(this->Handle[this->CurrentHandleIndex]);
-    }
-  else
-    {
-    this->CurrentHandleIndex = this->HighlightHandle(NULL);
-    }
-
-  this->BuildRepresentation();
-}
-
-//----------------------------------------------------------------------------
-void vtkPolyLineRepresentation::GetPolyData(vtkPolyData *pd)
-{
-  pd->ShallowCopy( this->PolyLineSource->GetOutput() );
-}
-
-
-//----------------------------------------------------------------------------
-double vtkPolyLineRepresentation::GetSummedLength()
-{
-  vtkPoints* points = this->PolyLineSource->GetOutput()->GetPoints();
-  int npts = points->GetNumberOfPoints();
-
-  if ( npts < 2 ) { return 0.0; }
-
-  double a[3];
-  double b[3];
-  double sum = 0.0;
-  int i = 0;
-  points->GetPoint(i, a);
-  int imax = (npts % 2 == 0) ? npts-2 : npts-1;
-
-  while ( i < imax )
-    {
-    points->GetPoint(i+1, b);
-    sum += sqrt(vtkMath::Distance2BetweenPoints(a, b));
-    i = i + 2;
-    points->GetPoint(i, a);
-    sum = sum + sqrt(vtkMath::Distance2BetweenPoints(a, b));
-    }
-
-  if ( npts % 2 == 0 )
-    {
-    points->GetPoint(i+1, b);
-    sum += sqrt(vtkMath::Distance2BetweenPoints(a, b));
-    }
-
-  return sum;
-}
-
-//----------------------------------------------------------------------------
-void vtkPolyLineRepresentation::InsertHandleOnLine(double* pos)
-{
-  if (this->NumberOfHandles < 2) { return; }
-
-  vtkIdType id = this->LinePicker->GetCellId();
-  if (id == -1){ return; }
-
-  vtkIdType subid = this->LinePicker->GetSubId();
-
-  vtkPoints* newpoints = vtkPoints::New(VTK_DOUBLE);
-  newpoints->SetNumberOfPoints(this->NumberOfHandles+1);
-
-  int istart = subid;
-  int istop = istart + 1;
-  int count = 0;
-  for ( int i = 0; i <= istart; ++i )
-    {
-    newpoints->SetPoint(count++,this->HandleGeometry[i]->GetCenter());
-    }
-
-  newpoints->SetPoint(count++,pos);
-
-  for ( int i = istop; i < this->NumberOfHandles; ++i )
-    {
-    newpoints->SetPoint(count++,this->HandleGeometry[i]->GetCenter());
-    }
-
-  this->InitializeHandles(newpoints);
-  newpoints->Delete();
-}
-
-//----------------------------------------------------------------------------
-void vtkPolyLineRepresentation::InitializeHandles(vtkPoints* points)
-{
-  if ( !points ){ return; }
-
-  int npts = points->GetNumberOfPoints();
-  if ( npts < 2 ){ return; }
-
-  double p0[3];
-  double p1[3];
-
-  points->GetPoint(0,p0);
-  points->GetPoint(npts-1,p1);
-
-  if ( vtkMath::Distance2BetweenPoints(p0,p1) == 0.0 )
-    {
-    --npts;
-    this->Closed = 1;
-    this->PolyLineSource->ClosedOn();
-    }
-
-  this->SetNumberOfHandles(npts);
-  for ( int i = 0; i < npts; ++i )
-    {
-    this->SetHandlePosition(i,points->GetPoint(i));
-    }
-}
-
-//----------------------------------------------------------------------------
-void vtkPolyLineRepresentation::PrintSelf(ostream& os, vtkIndent indent)
-{
-  this->Superclass::PrintSelf(os,indent);
-  if ( this->PolyLineSource )
-    {
-    os << indent << "PolyLineSource: "
-       << this->PolyLineSource << "\n";
-    }
-  else
-    {
-    os << indent << "PolyLineSource: (none)\n";
-    }
-}
diff --git a/Interaction/Widgets/vtkPolyLineRepresentation.h b/Interaction/Widgets/vtkPolyLineRepresentation.h
deleted file mode 100644
index 52b96ca..0000000
--- a/Interaction/Widgets/vtkPolyLineRepresentation.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkPolyLineRepresentation.h
-
-  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.
-
-=========================================================================*/
-// .NAME vtkPolyLineRepresentation - vtkWidgetRepresentation for a poly line.
-// .SECTION Description
-// vtkPolyLineRepresentation is a vtkCurveRepresentation for a poly
-// line. This 3D widget defines a poly line that can be interactively
-// placed in a scene. The poly line has handles, the number of which
-// can be changed, plus the widget can be picked on the poly line
-// itself to translate or rotate it in the scene.
-// Based on vtkCurveRepresentation
-// .SECTION See Also
-// vtkSplineRepresentation
-
-#ifndef vtkPolyLineRepresentation_h
-#define vtkPolyLineRepresentation_h
-
-#include "vtkInteractionWidgetsModule.h" // For export macro
-#include "vtkCurveRepresentation.h"
-
-class vtkPolyLineSource;
-class vtkPoints;
-class vtkPolyData;
-
-class VTKINTERACTIONWIDGETS_EXPORT vtkPolyLineRepresentation : public vtkCurveRepresentation
-{
-public:
-  static vtkPolyLineRepresentation* New();
-  vtkTypeMacro(vtkPolyLineRepresentation, vtkCurveRepresentation);
-  void PrintSelf(ostream& os, vtkIndent indent);
-
-  // Description:
-  // Grab the polydata (including points) that defines the poly line.
-  // polydata consists of points and line segments between consecutive
-  // points. Points are guaranteed to be up-to-date when either the
-  // InteractionEvent or EndInteraction events are invoked. The user
-  // provides the vtkPolyData and the points and polyline are added to
-  // it.
-  void GetPolyData(vtkPolyData *pd);
-
-  // Description:
-  // Set the number of handles for this widget.
-  virtual void SetNumberOfHandles(int npts);
-
-  // Description:
-  // Get the positions of the handles.
-  virtual vtkDoubleArray* GetHandlePositions();
-
-  // Description:
-  // Get the true length of the poly line. Calculated as the summed
-  // lengths of the individual straight line segments.
-  double GetSummedLength();
-
-  // Description:
-  // Convenience method to allocate and set the handles from a
-  // vtkPoints instance.  If the first and last points are the same,
-  // the poly line sets Closed to on and disregards the last point,
-  // otherwise Closed remains unchanged.
-  virtual void InitializeHandles(vtkPoints* points);
-
-  // Description:
-  // Build the representation for the poly line.
-  virtual void BuildRepresentation();
-
-//BTX
-protected:
-  vtkPolyLineRepresentation();
-  ~vtkPolyLineRepresentation();
-
-  // The poly line source
-  vtkPolyLineSource *PolyLineSource;
-
-  // Specialized method to insert a handle on the poly line.
-  virtual void InsertHandleOnLine(double* pos);
-
-private:
-  vtkPolyLineRepresentation(const vtkPolyLineRepresentation&); // Not implemented.
-  void operator=(const vtkPolyLineRepresentation&); // Not implemented.
-//ETX
-};
-
-#endif
diff --git a/Interaction/Widgets/vtkPolyLineWidget.cxx b/Interaction/Widgets/vtkPolyLineWidget.cxx
deleted file mode 100644
index 450dba2..0000000
--- a/Interaction/Widgets/vtkPolyLineWidget.cxx
+++ /dev/null
@@ -1,249 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkPolyLineWidget.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 "vtkPolyLineWidget.h"
-
-#include "vtkCallbackCommand.h"
-#include "vtkCommand.h"
-#include "vtkEvent.h"
-#include "vtkObjectFactory.h"
-#include "vtkPolyLineRepresentation.h"
-#include "vtkRenderer.h"
-#include "vtkRenderWindow.h"
-#include "vtkRenderWindowInteractor.h"
-#include "vtkWidgetCallbackMapper.h"
-#include "vtkWidgetEvent.h"
-#include "vtkWidgetEventTranslator.h"
-
-vtkStandardNewMacro(vtkPolyLineWidget);
-//----------------------------------------------------------------------------
-vtkPolyLineWidget::vtkPolyLineWidget()
-{
-  this->WidgetState = vtkPolyLineWidget::Start;
-  this->ManagesCursor = 1;
-
-  // Define widget events
-  this->CallbackMapper->SetCallbackMethod(vtkCommand::LeftButtonPressEvent,
-                                          vtkWidgetEvent::Select,
-                                          this, vtkPolyLineWidget::SelectAction);
-  this->CallbackMapper->SetCallbackMethod(vtkCommand::LeftButtonReleaseEvent,
-                                          vtkWidgetEvent::EndSelect,
-                                          this, vtkPolyLineWidget::EndSelectAction);
-  this->CallbackMapper->SetCallbackMethod(vtkCommand::MiddleButtonPressEvent,
-                                          vtkWidgetEvent::Translate,
-                                          this, vtkPolyLineWidget::TranslateAction);
-  this->CallbackMapper->SetCallbackMethod(vtkCommand::MiddleButtonReleaseEvent,
-                                          vtkWidgetEvent::EndTranslate,
-                                          this, vtkPolyLineWidget::EndSelectAction);
-  this->CallbackMapper->SetCallbackMethod(vtkCommand::RightButtonPressEvent,
-                                          vtkWidgetEvent::Scale,
-                                          this, vtkPolyLineWidget::ScaleAction);
-  this->CallbackMapper->SetCallbackMethod(vtkCommand::RightButtonReleaseEvent,
-                                          vtkWidgetEvent::EndScale,
-                                          this, vtkPolyLineWidget::EndSelectAction);
-  this->CallbackMapper->SetCallbackMethod(vtkCommand::MouseMoveEvent,
-                                          vtkWidgetEvent::Move,
-                                          this, vtkPolyLineWidget::MoveAction);
-}
-
-//----------------------------------------------------------------------------
-vtkPolyLineWidget::~vtkPolyLineWidget()
-{
-}
-
-//----------------------------------------------------------------------
-void vtkPolyLineWidget::SelectAction(vtkAbstractWidget *w)
-{
-  // We are in a static method, cast to ourself
-  vtkPolyLineWidget *self = vtkPolyLineWidget::SafeDownCast(w);
-
-  // Get the event position
-  int X = self->Interactor->GetEventPosition()[0];
-  int Y = self->Interactor->GetEventPosition()[1];
-
-  // Okay, make sure that the pick is in the current renderer
-  if ( !self->CurrentRenderer ||
-       !self->CurrentRenderer->IsInViewport(X,Y) )
-    {
-    self->WidgetState = vtkPolyLineWidget::Start;
-    return;
-    }
-
-  // Begin the widget interaction which has the side effect of setting the
-  // interaction state.
-  double e[2];
-  e[0] = static_cast<double>(X);
-  e[1] = static_cast<double>(Y);
-  self->WidgetRep->StartWidgetInteraction(e);
-  int interactionState = self->WidgetRep->GetInteractionState();
-  if ( interactionState == vtkPolyLineRepresentation::Outside )
-    {
-    return;
-    }
-
-  // We are definitely selected
-  self->WidgetState = vtkPolyLineWidget::Active;
-  self->GrabFocus(self->EventCallbackCommand);
-
-  if (interactionState == vtkPolyLineRepresentation::OnLine &&
-    self->Interactor->GetControlKey())
-    {
-    // Add point.
-    reinterpret_cast<vtkPolyLineRepresentation*>(self->WidgetRep)->
-      SetInteractionState(vtkPolyLineRepresentation::Inserting);
-    }
-  else if (interactionState == vtkPolyLineRepresentation::OnHandle &&
-    self->Interactor->GetShiftKey())
-    {
-    // remove point.
-    reinterpret_cast<vtkPolyLineRepresentation*>(self->WidgetRep)->
-      SetInteractionState(vtkPolyLineRepresentation::Erasing);
-    }
-  else
-    {
-    reinterpret_cast<vtkPolyLineRepresentation*>(self->WidgetRep)->
-      SetInteractionState(vtkPolyLineRepresentation::Moving);
-    }
-
-  // start the interaction
-  self->EventCallbackCommand->SetAbortFlag(1);
-  self->StartInteraction();
-  self->InvokeEvent(vtkCommand::StartInteractionEvent,NULL);
-  self->Render();
-}
-
-//----------------------------------------------------------------------
-void vtkPolyLineWidget::TranslateAction(vtkAbstractWidget *w)
-{
-  // Not sure this should be any different that SelectAction
-  vtkPolyLineWidget::SelectAction(w);
-}
-
-//----------------------------------------------------------------------
-void vtkPolyLineWidget::ScaleAction(vtkAbstractWidget *w)
-{
-  // We are in a static method, cast to ourself
-  vtkPolyLineWidget *self = reinterpret_cast<vtkPolyLineWidget*>(w);
-
-  // Get the event position
-  int X = self->Interactor->GetEventPosition()[0];
-  int Y = self->Interactor->GetEventPosition()[1];
-
-  // Okay, make sure that the pick is in the current renderer
-  if ( !self->CurrentRenderer ||
-       !self->CurrentRenderer->IsInViewport(X,Y) )
-    {
-    self->WidgetState = vtkPolyLineWidget::Start;
-    return;
-    }
-
-  // Begin the widget interaction which has the side effect of setting the
-  // interaction state.
-  double e[2];
-  e[0] = static_cast<double>(X);
-  e[1] = static_cast<double>(Y);
-  self->WidgetRep->StartWidgetInteraction(e);
-  int interactionState = self->WidgetRep->GetInteractionState();
-  if ( interactionState == vtkPolyLineRepresentation::Outside )
-    {
-    return;
-    }
-
-  // We are definitely selected
-  self->WidgetState = vtkPolyLineWidget::Active;
-  self->GrabFocus(self->EventCallbackCommand);
-  //Scale
-  reinterpret_cast<vtkPolyLineRepresentation*>(self->WidgetRep)->
-    SetInteractionState(vtkPolyLineRepresentation::Scaling);
-
-  // start the interaction
-  self->EventCallbackCommand->SetAbortFlag(1);
-  self->StartInteraction();
-  self->InvokeEvent(vtkCommand::StartInteractionEvent,NULL);
-  self->Render();
-}
-
-//----------------------------------------------------------------------
-void vtkPolyLineWidget::MoveAction(vtkAbstractWidget *w)
-{
-  vtkPolyLineWidget *self = reinterpret_cast<vtkPolyLineWidget*>(w);
-
-  // See whether we're active
-  if ( self->WidgetState == vtkPolyLineWidget::Start )
-    {
-    return;
-    }
-
-  // compute some info we need for all cases
-  int X = self->Interactor->GetEventPosition()[0];
-  int Y = self->Interactor->GetEventPosition()[1];
-
-  // Okay, adjust the representation
-  double e[2];
-  e[0] = static_cast<double>(X);
-  e[1] = static_cast<double>(Y);
-  self->WidgetRep->WidgetInteraction(e);
-
-  // moving something
-  self->EventCallbackCommand->SetAbortFlag(1);
-  self->InvokeEvent(vtkCommand::InteractionEvent,NULL);
-  self->Render();
-}
-
-//----------------------------------------------------------------------
-void vtkPolyLineWidget::EndSelectAction(vtkAbstractWidget *w)
-{
-  vtkPolyLineWidget *self = reinterpret_cast<vtkPolyLineWidget*>(w);
-  if ( self->WidgetState == vtkPolyLineWidget::Start )
-    {
-    return;
-    }
-
-  // compute some info we need for all cases
-  int X = self->Interactor->GetEventPosition()[0];
-  int Y = self->Interactor->GetEventPosition()[1];
-
-  // Okay, adjust the representation
-  double e[2];
-  e[0] = static_cast<double>(X);
-  e[1] = static_cast<double>(Y);
-
-  self->WidgetRep->EndWidgetInteraction(e);
-
-  // Return state to not active
-  self->WidgetState = vtkPolyLineWidget::Start;
-  reinterpret_cast<vtkPolyLineRepresentation*>(self->WidgetRep)->
-    SetInteractionState(vtkPolyLineRepresentation::Outside);
-  self->ReleaseFocus();
-
-  self->EventCallbackCommand->SetAbortFlag(1);
-  self->EndInteraction();
-  self->InvokeEvent(vtkCommand::EndInteractionEvent,NULL);
-  self->Render();
-}
-
-//----------------------------------------------------------------------
-void vtkPolyLineWidget::CreateDefaultRepresentation()
-{
-  if ( ! this->WidgetRep )
-    {
-    this->WidgetRep = vtkPolyLineRepresentation::New();
-    }
-}
-
-//----------------------------------------------------------------------------
-void vtkPolyLineWidget::PrintSelf(ostream& os, vtkIndent indent)
-{
-  this->Superclass::PrintSelf(os, indent);
-}
diff --git a/Interaction/Widgets/vtkPolyLineWidget.h b/Interaction/Widgets/vtkPolyLineWidget.h
deleted file mode 100644
index 803f470..0000000
--- a/Interaction/Widgets/vtkPolyLineWidget.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkPolyLineWidget.h
-
-  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.
-
-=========================================================================*/
-// .NAME vtkPolyLineWidget - widget for vtkPolyLineRepresentation.
-// .SECTION Description
-// vtkPolyLineWidget is the vtkAbstractWidget subclass for
-// vtkPolyLineRepresentation which manages the interactions with
-// vtkPolyLineRepresentation. This is based on vtkPolyLineWidget.
-// .SECTION See Also
-// vtkPolyLineRepresentation, vtkPolyLineWidget
-
-#ifndef vtkPolyLineWidget_h
-#define vtkPolyLineWidget_h
-
-#include "vtkInteractionWidgetsModule.h" // For export macro
-#include "vtkAbstractWidget.h"
-
-class vtkPolyLineRepresentation;
-
-class VTKINTERACTIONWIDGETS_EXPORT vtkPolyLineWidget : public vtkAbstractWidget
-{
-public:
-  static vtkPolyLineWidget* New();
-  vtkTypeMacro(vtkPolyLineWidget, vtkAbstractWidget);
-  void PrintSelf(ostream& os, vtkIndent indent);
-
-  // Description:
-  // Specify an instance of vtkWidgetRepresentation used to represent this
-  // widget in the scene. Note that the representation is a subclass of
-  // vtkProp so it can be added to the renderer independent of the widget.
-  void SetRepresentation(vtkPolyLineRepresentation *r)
-    {
-    this->Superclass::SetWidgetRepresentation(
-      reinterpret_cast<vtkWidgetRepresentation*>(r));
-    }
-
-  // Description:
-  // Create the default widget representation if one is not set. By default,
-  // this is an instance of the vtkPolyLineRepresentation class.
-  void CreateDefaultRepresentation();
-//BTX
-protected:
-  vtkPolyLineWidget();
-  ~vtkPolyLineWidget();
-
-  int WidgetState;
-  enum _WidgetState {Start=0,Active};
-
-  // These methods handle events
-  static void SelectAction(vtkAbstractWidget*);
-  static void EndSelectAction(vtkAbstractWidget*);
-  static void TranslateAction(vtkAbstractWidget*);
-  static void ScaleAction(vtkAbstractWidget*);
-  static void MoveAction(vtkAbstractWidget*);
-
-private:
-  vtkPolyLineWidget(const vtkPolyLineWidget&); // Not implemented.
-  void operator=(const vtkPolyLineWidget&); // Not implemented.
-//ETX
-};
-
-#endif
diff --git a/Interaction/Widgets/vtkResliceCursor.cxx b/Interaction/Widgets/vtkResliceCursor.cxx
index db5a9c0..c39f6a2 100644
--- a/Interaction/Widgets/vtkResliceCursor.cxx
+++ b/Interaction/Widgets/vtkResliceCursor.cxx
@@ -376,91 +376,140 @@ void vtkResliceCursor::BuildPolyData()
   vtkSmartPointer< vtkCellArray > lines
     = vtkSmartPointer< vtkCellArray >::New();
 
-  // Precompute the half thickness prior to use within the loop.
-  const double ht[3] = { this->Thickness[0] / 2.0,
-                         this->Thickness[1] / 2.0,
-                         this->Thickness[2] / 2.0 };
-
-  points->Allocate(24);
-  lines->Allocate(lines->Allocate(lines->EstimateSize(18,4)));
-
-  double pts[30][3];
-  for (int i = 0; i < 3; i++)
+  if (1)
     {
-    pts[0][i] = this->Center[i] - pdLength * this->XAxis[i];
-    pts[1][i] = this->Center[i] + pdLength * this->XAxis[i];
-    pts[2][i] = pts[0][i] - ht[1] * this->YAxis[i] - ht[2] * this->ZAxis[i];
-    pts[3][i] = pts[1][i] - ht[1] * this->YAxis[i] - ht[2] * this->ZAxis[i];
-    pts[4][i] = pts[0][i] + ht[1] * this->YAxis[i] - ht[2] * this->ZAxis[i];
-    pts[5][i] = pts[1][i] + ht[1] * this->YAxis[i] - ht[2] * this->ZAxis[i];
-    pts[6][i] = pts[0][i] + ht[1] * this->YAxis[i] + ht[2] * this->ZAxis[i];
-    pts[7][i] = pts[1][i] + ht[1] * this->YAxis[i] + ht[2] * this->ZAxis[i];
-    pts[8][i] = pts[0][i] - ht[1] * this->YAxis[i] + ht[2] * this->ZAxis[i];
-    pts[9][i] = pts[1][i] - ht[1] * this->YAxis[i] + ht[2] * this->ZAxis[i];
-
-    pts[10][i] = this->Center[i] - pdLength * this->YAxis[i];
-    pts[11][i] = this->Center[i] + pdLength * this->YAxis[i];
-    pts[12][i] = pts[10][i] - ht[0] * this->XAxis[i] - ht[2] * this->ZAxis[i];
-    pts[13][i] = pts[11][i] - ht[0] * this->XAxis[i] - ht[2] * this->ZAxis[i];
-    pts[14][i] = pts[10][i] + ht[0] * this->XAxis[i] - ht[2] * this->ZAxis[i];
-    pts[15][i] = pts[11][i] + ht[0] * this->XAxis[i] - ht[2] * this->ZAxis[i];
-    pts[16][i] = pts[10][i] + ht[0] * this->XAxis[i] + ht[2] * this->ZAxis[i];
-    pts[17][i] = pts[11][i] + ht[0] * this->XAxis[i] + ht[2] * this->ZAxis[i];
-    pts[18][i] = pts[10][i] - ht[0] * this->XAxis[i] + ht[2] * this->ZAxis[i];
-    pts[19][i] = pts[11][i] - ht[0] * this->XAxis[i] + ht[2] * this->ZAxis[i];
-
-    pts[20][i] = this->Center[i] - pdLength * this->ZAxis[i];
-    pts[21][i] = this->Center[i] + pdLength * this->ZAxis[i];
-    pts[22][i] = pts[20][i] - ht[1] * this->YAxis[i] - ht[0] * this->XAxis[i];
-    pts[23][i] = pts[21][i] - ht[1] * this->YAxis[i] - ht[0] * this->XAxis[i];
-    pts[24][i] = pts[20][i] + ht[1] * this->YAxis[i] - ht[0] * this->XAxis[i];
-    pts[25][i] = pts[21][i] + ht[1] * this->YAxis[i] - ht[0] * this->XAxis[i];
-    pts[26][i] = pts[20][i] + ht[1] * this->YAxis[i] + ht[0] * this->XAxis[i];
-    pts[27][i] = pts[21][i] + ht[1] * this->YAxis[i] + ht[0] * this->XAxis[i];
-    pts[28][i] = pts[20][i] - ht[1] * this->YAxis[i] + ht[0] * this->XAxis[i];
-    pts[29][i] = pts[21][i] - ht[1] * this->YAxis[i] + ht[0] * this->XAxis[i];
-    }
 
-  vtkIdType ptIds[2];
+    // Precompute the half thickness prior to use within the loop.
+    const double ht[3] = { this->Thickness[0] / 2.0,
+                           this->Thickness[1] / 2.0,
+                           this->Thickness[2] / 2.0 };
 
-  vtkIdType facePtIds[6][4] =
-    { { 0, 2, 4, 6 }, { 1, 7, 5, 3 }, { 1,3,2,0 }, { 0,6,7,1 }, { 2,3,5,4 }, {6,4,5,7} };
+    points->Allocate(24);
+    lines->Allocate(lines->Allocate(lines->EstimateSize(18,4)));
 
-  for (int j = 0; j < 3; j++)
-    {
+    double pts[30][3];
+    for (int i = 0; i < 3; i++)
+      {
+      pts[0][i] = this->Center[i] - pdLength * this->XAxis[i];
+      pts[1][i] = this->Center[i] + pdLength * this->XAxis[i];
+      pts[2][i] = pts[0][i] - ht[1] * this->YAxis[i] - ht[2] * this->ZAxis[i];
+      pts[3][i] = pts[1][i] - ht[1] * this->YAxis[i] - ht[2] * this->ZAxis[i];
+      pts[4][i] = pts[0][i] + ht[1] * this->YAxis[i] - ht[2] * this->ZAxis[i];
+      pts[5][i] = pts[1][i] + ht[1] * this->YAxis[i] - ht[2] * this->ZAxis[i];
+      pts[6][i] = pts[0][i] + ht[1] * this->YAxis[i] + ht[2] * this->ZAxis[i];
+      pts[7][i] = pts[1][i] + ht[1] * this->YAxis[i] + ht[2] * this->ZAxis[i];
+      pts[8][i] = pts[0][i] - ht[1] * this->YAxis[i] + ht[2] * this->ZAxis[i];
+      pts[9][i] = pts[1][i] - ht[1] * this->YAxis[i] + ht[2] * this->ZAxis[i];
+
+      pts[10][i] = this->Center[i] - pdLength * this->YAxis[i];
+      pts[11][i] = this->Center[i] + pdLength * this->YAxis[i];
+      pts[12][i] = pts[10][i] - ht[0] * this->XAxis[i] - ht[2] * this->ZAxis[i];
+      pts[13][i] = pts[11][i] - ht[0] * this->XAxis[i] - ht[2] * this->ZAxis[i];
+      pts[14][i] = pts[10][i] + ht[0] * this->XAxis[i] - ht[2] * this->ZAxis[i];
+      pts[15][i] = pts[11][i] + ht[0] * this->XAxis[i] - ht[2] * this->ZAxis[i];
+      pts[16][i] = pts[10][i] + ht[0] * this->XAxis[i] + ht[2] * this->ZAxis[i];
+      pts[17][i] = pts[11][i] + ht[0] * this->XAxis[i] + ht[2] * this->ZAxis[i];
+      pts[18][i] = pts[10][i] - ht[0] * this->XAxis[i] + ht[2] * this->ZAxis[i];
+      pts[19][i] = pts[11][i] - ht[0] * this->XAxis[i] + ht[2] * this->ZAxis[i];
+
+      pts[20][i] = this->Center[i] - pdLength * this->ZAxis[i];
+      pts[21][i] = this->Center[i] + pdLength * this->ZAxis[i];
+      pts[22][i] = pts[20][i] - ht[1] * this->YAxis[i] - ht[0] * this->XAxis[i];
+      pts[23][i] = pts[21][i] - ht[1] * this->YAxis[i] - ht[0] * this->XAxis[i];
+      pts[24][i] = pts[20][i] + ht[1] * this->YAxis[i] - ht[0] * this->XAxis[i];
+      pts[25][i] = pts[21][i] + ht[1] * this->YAxis[i] - ht[0] * this->XAxis[i];
+      pts[26][i] = pts[20][i] + ht[1] * this->YAxis[i] + ht[0] * this->XAxis[i];
+      pts[27][i] = pts[21][i] + ht[1] * this->YAxis[i] + ht[0] * this->XAxis[i];
+      pts[28][i] = pts[20][i] - ht[1] * this->YAxis[i] + ht[0] * this->XAxis[i];
+      pts[29][i] = pts[21][i] - ht[1] * this->YAxis[i] + ht[0] * this->XAxis[i];
+      }
 
-    vtkPoints *centerlinePoints = this->CenterlineAxis[j]->GetPoints();
+    vtkIdType ptIds[2];
+
+    vtkIdType facePtIds[6][4] =
+      { { 0, 2, 4, 6 }, { 1, 7, 5, 3 }, { 1,3,2,0 }, { 0,6,7,1 }, { 2,3,5,4 }, {6,4,5,7} };
 
-    for (int i = 0; i < 4; i++)
+    for (int j = 0; j < 3; j++)
       {
-      ptIds[0] = 10 * j + 2 + 2*i;
-      ptIds[1] = ptIds[0] + 1;
 
-      points->InsertNextPoint(pts[ptIds[0]]);
-      points->InsertNextPoint(pts[ptIds[1]]);
+      vtkPoints *centerlinePoints = this->CenterlineAxis[j]->GetPoints();
+
+      for (int i = 0; i < 4; i++)
+        {
+        ptIds[0] = 10 * j + 2 + 2*i;
+        ptIds[1] = ptIds[0] + 1;
+
+        points->InsertNextPoint(pts[ptIds[0]]);
+        points->InsertNextPoint(pts[ptIds[1]]);
+        }
+
+      centerlinePoints->SetPoint(0, pts[10*j]);
+      centerlinePoints->SetPoint(1, pts[10*j+1]);
+
+      vtkSmartPointer< vtkCellArray > slabPolys =
+        vtkSmartPointer< vtkCellArray >::New();
+      slabPolys->Allocate(slabPolys->EstimateSize(6,4));
+
+      for (int i = 0; i < 6; i++)
+        {
+        vtkIdType currFacePtIds[4] = {facePtIds[i][0] + 8*j,
+                                      facePtIds[i][1] + 8*j,
+                                      facePtIds[i][2] + 8*j,
+                                      facePtIds[i][3] + 8*j };
+        lines->InsertNextCell(4,currFacePtIds);
+        slabPolys->InsertNextCell(4,facePtIds[i]);
+        }
+
+      this->CenterlineAxis[j]->Modified();
       }
 
-    centerlinePoints->SetPoint(0, pts[10*j]);
-    centerlinePoints->SetPoint(1, pts[10*j+1]);
+    this->PolyData->SetPolys(lines);
+    }
+  else
+    {
+
+    // Allocate space for 6 points, 3 cells.
+    points->Allocate(6);
+    lines->Allocate(lines->Allocate(lines->EstimateSize(3,2)));
+
+    // Just 3 cells..
 
-    vtkSmartPointer< vtkCellArray > slabPolys =
-      vtkSmartPointer< vtkCellArray >::New();
-    slabPolys->Allocate(slabPolys->EstimateSize(6,4));
+    double pts[6][3];
+    vtkIdType ptIds[2];
+    for (int i = 0; i < 3; i++)
+      {
+      pts[0][i] = this->Center[i] - pdLength * this->XAxis[i];
+      pts[1][i] = this->Center[i] + pdLength * this->XAxis[i];
+      pts[2][i] = this->Center[i] - pdLength * this->YAxis[i];
+      pts[3][i] = this->Center[i] + pdLength * this->YAxis[i];
+      pts[4][i] = this->Center[i] - pdLength * this->ZAxis[i];
+      pts[5][i] = this->Center[i] + pdLength * this->ZAxis[i];
+      }
 
     for (int i = 0; i < 6; i++)
       {
-      vtkIdType currFacePtIds[4] = {facePtIds[i][0] + 8*j,
-                                    facePtIds[i][1] + 8*j,
-                                    facePtIds[i][2] + 8*j,
-                                    facePtIds[i][3] + 8*j };
-      lines->InsertNextCell(4,currFacePtIds);
-      slabPolys->InsertNextCell(4,facePtIds[i]);
+      points->InsertNextPoint(pts[i]);
       }
 
-    this->CenterlineAxis[j]->Modified();
-    }
+    ptIds[0] = 0;
+    ptIds[1] = 1;
+    lines->InsertNextCell(2, ptIds);
+    ptIds[0] = 2;
+    ptIds[1] = 3;
+    lines->InsertNextCell(2, ptIds);
+    ptIds[0] = 4;
+    ptIds[1] = 5;
+    lines->InsertNextCell(2, ptIds);
 
-  this->PolyData->SetPolys(lines);
+    for (int i = 0; i < 3; i++)
+      {
+      vtkPoints *centerlinePoints = this->CenterlineAxis[i]->GetPoints();
+      centerlinePoints->SetPoint(2*i, pts[2*i]);
+      centerlinePoints->SetPoint(2*i+1, pts[2*i+1]);
+      this->CenterlineAxis[i]->Modified();
+      }
+    this->PolyData->SetLines(lines);
+    }
 
   this->PolyData->SetPoints(points);
   this->PolyData->Modified();
diff --git a/Interaction/Widgets/vtkResliceCursorPicker.cxx b/Interaction/Widgets/vtkResliceCursorPicker.cxx
index 6e897de..3aae256 100644
--- a/Interaction/Widgets/vtkResliceCursorPicker.cxx
+++ b/Interaction/Widgets/vtkResliceCursorPicker.cxx
@@ -77,9 +77,12 @@ int vtkResliceCursorPicker::Pick(double selectionX, double selectionY,
   double *clipRange;
   double ray[3], rayLength;
   double windowLowerLeft[4], windowUpperRight[4];
+  double bounds[6], tol;
   double tF, tB;
   double cameraDOP[3];
 
+  bounds[0] = bounds[1] = bounds[2] = bounds[3] = bounds[4] = bounds[5] = 0;
+
   //  Initialize picking process
   this->Initialize();
   this->Renderer = renderer;
@@ -197,7 +200,6 @@ int vtkResliceCursorPicker::Pick(double selectionX, double selectionY,
   renderer->DisplayToWorld();
   renderer->GetWorldPoint(windowUpperRight);
 
-  double tol;
   for (tol=0.0,i=0; i<3; i++)
     {
     tol += (windowUpperRight[i] - windowLowerLeft[i]) *
diff --git a/Interaction/Widgets/vtkScalarBarRepresentation.cxx b/Interaction/Widgets/vtkScalarBarRepresentation.cxx
index f47d1c2..a528b9c 100644
--- a/Interaction/Widgets/vtkScalarBarRepresentation.cxx
+++ b/Interaction/Widgets/vtkScalarBarRepresentation.cxx
@@ -40,8 +40,6 @@ vtkScalarBarRepresentation::vtkScalarBarRepresentation()
   this->PositionCoordinate->SetValue(0.82, 0.1);
   this->Position2Coordinate->SetValue(0.17, 0.8);
 
-  this->AutoOrient = true;
-
   this->ScalarBarActor = NULL;
   vtkScalarBarActor *actor = vtkScalarBarActor::New();
   this->SetScalarBarActor(actor);
@@ -92,10 +90,9 @@ void vtkScalarBarRepresentation::PrintSelf(ostream &os, vtkIndent indent)
 //-----------------------------------------------------------------------------
 void vtkScalarBarRepresentation::SetOrientation(int orientation)
 {
-  if (this->ScalarBarActor &&
-      this->ScalarBarActor->GetOrientation() != orientation)
+  if (this->ScalarBarActor)
     {
-    this->SwapOrientation();
+    this->ScalarBarActor->SetOrientation(orientation);
     }
 }
 
@@ -129,36 +126,6 @@ void vtkScalarBarRepresentation::WidgetInteraction(double eventPos[2])
   this->Superclass::WidgetInteraction(eventPos);
 
   // Check to see if we need to change the orientation.
-  if (this->AutoOrient)
-    {
-    double *fpos1 = this->PositionCoordinate->GetValue();
-    double *fpos2 = this->Position2Coordinate->GetValue();
-    double center[2];
-    center[0] = fpos1[0] + 0.5*fpos2[0];
-    center[1] = fpos1[1] + 0.5*fpos2[1];
-
-    if (fabs(center[0] - 0.5) > 0.2+fabs(center[1] - 0.5))
-      {
-      // Close enough to left/right to be swapped to vertical
-      if (this->ScalarBarActor->GetOrientation() == VTK_ORIENT_HORIZONTAL)
-        {
-        this->SwapOrientation();
-        }
-      }
-    else if (fabs(center[1] - 0.5) > 0.2+fabs(center[0] - 0.5))
-      {
-      // Close enough to left/right to be swapped to horizontal
-      if (this->ScalarBarActor->GetOrientation() == VTK_ORIENT_VERTICAL)
-        {
-        this->SwapOrientation();
-        }
-      }
-    } // if this->AutoOrient
-}
-
-//-----------------------------------------------------------------------------
-void vtkScalarBarRepresentation::SwapOrientation()
-{
   double *fpos1 = this->PositionCoordinate->GetValue();
   double *fpos2 = this->Position2Coordinate->GetValue();
   double par1[2];
@@ -170,30 +137,43 @@ void vtkScalarBarRepresentation::SwapOrientation()
   double center[2];
   center[0] = fpos1[0] + 0.5*fpos2[0];
   center[1] = fpos1[1] + 0.5*fpos2[1];
-
-  // Change the corners to effectively rotate 90 degrees.
-  par2[0] = center[0] + center[1] - par1[1];
-  par2[1] = center[1] + center[0] - par1[0];
-  par1[0] = 2*center[0] - par2[0];
-  par1[1] = 2*center[1] - par2[1];
-
-  if (this->ScalarBarActor->GetOrientation() == VTK_ORIENT_HORIZONTAL)
+  bool orientationSwapped = false;
+  if (fabs(center[0] - 0.5) > 0.2+fabs(center[1] - 0.5))
     {
-    this->ScalarBarActor->SetOrientation(VTK_ORIENT_VERTICAL);
+    // Close enough to left/right to be swapped to vertical
+    if (this->ScalarBarActor->GetOrientation() == VTK_ORIENT_HORIZONTAL)
+      {
+      this->ScalarBarActor->SetOrientation(VTK_ORIENT_VERTICAL);
+      orientationSwapped = true;
+      }
     }
-  else
+  else if (fabs(center[1] - 0.5) > 0.2+fabs(center[0] - 0.5))
     {
-    this->ScalarBarActor->SetOrientation(VTK_ORIENT_HORIZONTAL);
+    // Close enough to left/right to be swapped to horizontal
+    if (this->ScalarBarActor->GetOrientation() == VTK_ORIENT_VERTICAL)
+      {
+      this->ScalarBarActor->SetOrientation(VTK_ORIENT_HORIZONTAL);
+      orientationSwapped = true;
+      }
     }
 
-  this->PositionCoordinate->SetValue(par1[0],par1[1]);
-  this->Position2Coordinate->SetValue(par2[0] - par1[0], par2[1] - par1[1]);
+  if (orientationSwapped)
+    {
+    // Change the corners to effectively rotate 90 degrees.
+    par2[0] = center[0] + center[1] - par1[1];
+    par2[1] = center[1] + center[0] - par1[0];
+    par1[0] = 2*center[0] - par2[0];
+    par1[1] = 2*center[1] - par2[1];
+
+    this->PositionCoordinate->SetValue(par1[0],par1[1]);
+    this->Position2Coordinate->SetValue(par2[0] - par1[0], par2[1] - par1[1]);
 
-  std::swap(this->ShowHorizontalBorder, this->ShowVerticalBorder);
+    std::swap(this->ShowHorizontalBorder, this->ShowVerticalBorder);
 
-  this->Modified();
-  this->UpdateShowBorder();
-  this->BuildRepresentation();
+    this->Modified();
+    this->UpdateShowBorder();
+    this->BuildRepresentation();
+  }
 }
 
 //-----------------------------------------------------------------------------
@@ -273,3 +253,4 @@ int vtkScalarBarRepresentation::HasTranslucentPolygonalGeometry()
     }
   return result;
 }
+
diff --git a/Interaction/Widgets/vtkScalarBarRepresentation.h b/Interaction/Widgets/vtkScalarBarRepresentation.h
index 2949e78..6c8c1af 100644
--- a/Interaction/Widgets/vtkScalarBarRepresentation.h
+++ b/Interaction/Widgets/vtkScalarBarRepresentation.h
@@ -77,12 +77,6 @@ public:
   virtual int HasTranslucentPolygonalGeometry();
 
   // Description:
-  // If true, the orientation will be updated based on the widget's position.
-  // Default is true.
-  vtkSetMacro(AutoOrient, bool)
-  vtkGetMacro(AutoOrient, bool)
-
-  // Description:
   // Get/Set the orientation.
   void SetOrientation(int orient);
   int GetOrientation();
@@ -91,14 +85,7 @@ protected:
   vtkScalarBarRepresentation();
   ~vtkScalarBarRepresentation();
 
-  // Description:
-  // Change horizontal <--> vertical orientation, rotate the corners of the
-  // bar to preserve size, and swap the resize handle locations.
-  void SwapOrientation();
-
   vtkScalarBarActor *ScalarBarActor;
-  bool AutoOrient;
-
 private:
   vtkScalarBarRepresentation(const vtkScalarBarRepresentation &); // Not implemented
   void operator=(const vtkScalarBarRepresentation &);   // Not implemented
diff --git a/Interaction/Widgets/vtkSphereRepresentation.cxx b/Interaction/Widgets/vtkSphereRepresentation.cxx
index 2ea7e2b..36927c9 100644
--- a/Interaction/Widgets/vtkSphereRepresentation.cxx
+++ b/Interaction/Widgets/vtkSphereRepresentation.cxx
@@ -325,13 +325,8 @@ void vtkSphereRepresentation::WidgetInteraction(double e[2])
 
     if ( path != NULL )
       {
-      double pos[3], dir[3], c[3];
-      this->SpherePicker->GetPickPosition(pos);
-      this->SphereSource->GetCenter(c);
-      dir[0] = pos[0] - c[0];
-      dir[1] = pos[1] - c[1];
-      dir[2] = pos[2] - c[2];
-      this->SetHandleDirection(dir);
+      this->HandleSource->SetCenter(this->SpherePicker->GetPickPosition());
+      this->SpherePicker->GetPickPosition(this->HandlePosition);
       }
     }
 
@@ -477,7 +472,6 @@ void vtkSphereRepresentation::SetRadius(double r)
 }
 
 //----------------------------------------------------------------------------
-// This method may change the radius of the sphere
 void vtkSphereRepresentation::SetHandlePosition(double handle[3])
 {
   double h[3];
@@ -492,7 +486,7 @@ void vtkSphereRepresentation::SetHandlePosition(double handle[3])
     this->HandleDirection[2] = handle[2] - c[2];
     double r = static_cast<double>(
       vtkMath::Distance2BetweenPoints(handle,c) );
-    this->SphereSource->SetRadius(sqrt(r));
+    this->SphereSource->SetRadius(r);
     this->SphereSource->Update();
     this->HandleSource->Update();
     this->Modified();
@@ -500,24 +494,24 @@ void vtkSphereRepresentation::SetHandlePosition(double handle[3])
 }
 
 //----------------------------------------------------------------------------
-// This method preserves the radius of the sphere. The handle is repositioned
-// on the existing sphere but in the new direction. So the handle will move across
-// the surface of the sphere. Note that the HandlePosition[3] data member is
-// adjusted to be consistent with the sphere center and the current sphere radius.
 void vtkSphereRepresentation::SetHandleDirection(double dir[3])
 {
   double *d = this->HandleDirection;
-  double dirMag = vtkMath::Norm(dir);
-  if ( (dirMag != 0.0) && (d[0] != dir[0] || d[1] != dir[1] || d[2] != dir[2]) )
+  if ( d[0] != dir[0] || d[1] != dir[1] || d[2] != dir[2] )
     {
-    double r, f, c[3];
-    r = this->SphereSource->GetRadius();
-    f = r / dirMag;
+    double c[3], handle[3];
     this->SphereSource->GetCenter(c);
-    this->HandlePosition[0] = c[0] + f*dir[0];
-    this->HandlePosition[1] = c[1] + f*dir[1];
-    this->HandlePosition[2] = c[2] + f*dir[2];
-    this->HandleSource->SetCenter(this->HandlePosition);
+    handle[0] = c[0] + dir[0];
+    handle[1] = c[1] + dir[1];
+    handle[2] = c[2] + dir[2];
+    this->HandleSource->SetCenter(handle);
+    this->HandleDirection[0] = dir[0];
+    this->HandleDirection[1] = dir[1];
+    this->HandleDirection[2] = dir[2];
+    double r = static_cast<double>(
+      vtkMath::Distance2BetweenPoints(handle,c) );
+    this->SphereSource->SetRadius(r);
+    this->SphereSource->Update();
     this->HandleSource->Update();
     this->Modified();
     }
diff --git a/Interaction/Widgets/vtkSphereRepresentation.h b/Interaction/Widgets/vtkSphereRepresentation.h
index 91ef00e..d784457 100644
--- a/Interaction/Widgets/vtkSphereRepresentation.h
+++ b/Interaction/Widgets/vtkSphereRepresentation.h
@@ -148,8 +148,8 @@ public:
 
   // Description:
   // Set/Get the direction vector of the handle relative to the center of
-  // the sphere. Setting the direction may affect the position of the handle
-  // but will not affect the radius or position of the sphere.
+  // the sphere. This may affect the position of the handle and the radius
+  // of the sphere.
   void SetHandleDirection(double dir[3]);
   void SetHandleDirection(double dx, double dy, double dz)
     {double d[3]; d[0]=dx; d[1]=dy; d[2]=dz; this->SetHandleDirection(d);}
diff --git a/Interaction/Widgets/vtkSplineRepresentation.cxx b/Interaction/Widgets/vtkSplineRepresentation.cxx
index 7eefeea..360ab6e 100644
--- a/Interaction/Widgets/vtkSplineRepresentation.cxx
+++ b/Interaction/Widgets/vtkSplineRepresentation.cxx
@@ -39,31 +39,57 @@
 #include "vtkTransform.h"
 #include "vtkDoubleArray.h"
 
-//----------------------------------------------------------------------------
 vtkStandardNewMacro(vtkSplineRepresentation);
-
 //----------------------------------------------------------------------------
 vtkSplineRepresentation::vtkSplineRepresentation()
 {
+  this->HandleSize = 5.0;
+
+  this->InteractionState = vtkSplineRepresentation::Outside;
+  this->ProjectToPlane = 0;  //default off
+  this->ProjectionNormal = 0;  //default YZ not used
+  this->ProjectionPosition = 0.0;
+  this->PlaneSource = NULL;
+  this->Closed = 0;
+
   // Build the representation of the widget
 
-  // Create the handles along a straight line within the bounds of a unit cube
-  double x0 = -0.5;
-  double x1 =  0.5;
-  double y0 = -0.5;
-  double y1 =  0.5;
-  double z0 = -0.5;
-  double z1 =  0.5;
+  // Default bounds to get started
+  double bounds[6] = { -0.5, 0.5, -0.5, 0.5, -0.5, 0.5 };
 
+  // Create the handles along a straight line within the bounds of a unit cube
+  this->NumberOfHandles = 5;
+  this->Handle         = new vtkActor* [this->NumberOfHandles];
+  this->HandleGeometry = new vtkSphereSource* [this->NumberOfHandles];
+  int i;
+  double u[3];
+  double x0 = bounds[0];
+  double x1 = bounds[1];
+  double y0 = bounds[2];
+  double y1 = bounds[3];
+  double z0 = bounds[4];
+  double z1 = bounds[5];
+  double x;
+  double y;
+  double z;
   vtkPoints* points = vtkPoints::New(VTK_DOUBLE);
   points->SetNumberOfPoints(this->NumberOfHandles);
 
-  for ( int i = 0; i < this->NumberOfHandles; ++i )
+  for ( i = 0; i < this->NumberOfHandles; ++i )
     {
-    double u = i / (this->NumberOfHandles - 1.0);
-    double x = (1.0 - u)*x0 + u*x1;
-    double y = (1.0 - u)*y0 + u*y1;
-    double z = (1.0 - u)*z0 + u*z1;
+    this->HandleGeometry[i] = vtkSphereSource::New();
+    this->HandleGeometry[i]->SetThetaResolution(16);
+    this->HandleGeometry[i]->SetPhiResolution(8);
+    vtkPolyDataMapper* handleMapper = vtkPolyDataMapper::New();
+    handleMapper->SetInputConnection(
+      this->HandleGeometry[i]->GetOutputPort());
+    this->Handle[i] = vtkActor::New();
+    this->Handle[i]->SetMapper(handleMapper);
+    handleMapper->Delete();
+    u[0] = i/(this->NumberOfHandles - 1.0);
+    x = (1.0 - u[0])*x0 + u[0]*x1;
+    y = (1.0 - u[0])*y0 + u[0]*y1;
+    z = (1.0 - u[0])*z0 + u[0]*z1;
     points->SetPoint(i, x, y, z);
     this->HandleGeometry[i]->SetCenter(x,y,z);
     }
@@ -72,6 +98,7 @@ vtkSplineRepresentation::vtkSplineRepresentation()
   this->ParametricSpline = vtkParametricSpline::New();
   this->ParametricSpline->Register(this);
   this->ParametricSpline->SetPoints(points);
+  //this->ParametricSpline->ParameterizeByLengthOff();
   points->Delete();
   this->ParametricSpline->Delete();
 
@@ -91,8 +118,40 @@ vtkSplineRepresentation::vtkSplineRepresentation()
   lineMapper->ImmediateModeRenderingOn();
   lineMapper->SetResolveCoincidentTopologyToPolygonOffset();
 
+  this->LineActor = vtkActor::New();
   this->LineActor->SetMapper( lineMapper );
   lineMapper->Delete();
+
+  // Initial creation of the widget, serves to initialize it
+  this->PlaceFactor = 1.0;
+  this->PlaceWidget(bounds);
+
+  // Manage the picking stuff
+  this->HandlePicker = vtkCellPicker::New();
+  this->HandlePicker->SetTolerance(0.005);
+
+  for ( i = 0; i < this->NumberOfHandles; ++i )
+    {
+    this->HandlePicker->AddPickList(this->Handle[i]);
+    }
+  this->HandlePicker->PickFromListOn();
+
+  this->LinePicker = vtkCellPicker::New();
+  this->LinePicker->SetTolerance(0.01);
+  this->LinePicker->AddPickList(this->LineActor);
+  this->LinePicker->PickFromListOn();
+
+  this->CurrentHandle = NULL;
+  this->CurrentHandleIndex = -1;
+
+  this->Transform = vtkTransform::New();
+
+  // Set up the initial properties
+  this->HandleProperty = NULL;
+  this->SelectedHandleProperty = NULL;
+  this->LineProperty = NULL;
+  this->SelectedLineProperty = NULL;
+  this->CreateDefaultProperties();
 }
 
 //----------------------------------------------------------------------------
@@ -104,6 +163,51 @@ vtkSplineRepresentation::~vtkSplineRepresentation()
     }
 
   this->ParametricFunctionSource->Delete();
+
+  this->LineActor->Delete();
+
+  for ( int i = 0; i < this->NumberOfHandles; ++i )
+    {
+    this->HandleGeometry[i]->Delete();
+    this->Handle[i]->Delete();
+    }
+  delete [] this->Handle;
+  delete [] this->HandleGeometry;
+
+  this->HandlePicker->Delete();
+  this->LinePicker->Delete();
+
+  if ( this->HandleProperty )
+    {
+    this->HandleProperty->Delete();
+    }
+  if ( this->SelectedHandleProperty )
+    {
+    this->SelectedHandleProperty->Delete();
+    }
+  if ( this->LineProperty )
+    {
+    this->LineProperty->Delete();
+    }
+  if ( this->SelectedLineProperty )
+    {
+    this->SelectedLineProperty->Delete();
+    }
+
+  this->Transform->Delete();
+}
+
+//----------------------------------------------------------------------------
+void vtkSplineRepresentation::SetClosed(int closed)
+{
+  if ( this->Closed == closed )
+    {
+    return;
+    }
+  this->Closed = closed;
+  this->ParametricSpline->SetClosed(this->Closed);
+
+  this->BuildRepresentation();
 }
 
 //----------------------------------------------------------------------------
@@ -126,6 +230,15 @@ void vtkSplineRepresentation::SetParametricSpline(vtkParametricSpline* spline)
     }
 }
 
+//----------------------------------------------------------------------
+void vtkSplineRepresentation::RegisterPickers()
+{
+  this->Renderer->GetRenderWindow()->GetInteractor()->GetPickingManager()
+    ->AddPicker(this->HandlePicker, this);
+  this->Renderer->GetRenderWindow()->GetInteractor()->GetPickingManager()
+    ->AddPicker(this->LinePicker, this);
+}
+
 //----------------------------------------------------------------------------
 vtkDoubleArray* vtkSplineRepresentation::GetHandlePositions()
 {
@@ -134,6 +247,125 @@ vtkDoubleArray* vtkSplineRepresentation::GetHandlePositions()
 }
 
 //----------------------------------------------------------------------------
+void vtkSplineRepresentation::SetHandlePosition(int handle, double x,
+                                        double y, double z)
+{
+  if ( handle < 0 || handle >= this->NumberOfHandles )
+    {
+    vtkErrorMacro(<<"vtkSplineRepresentation: handle index out of range.");
+    return;
+    }
+  this->HandleGeometry[handle]->SetCenter(x,y,z);
+  this->HandleGeometry[handle]->Update();
+  if ( this->ProjectToPlane )
+    {
+    this->ProjectPointsToPlane();
+    }
+  this->BuildRepresentation();
+}
+
+//----------------------------------------------------------------------------
+void vtkSplineRepresentation::SetHandlePosition(int handle, double xyz[3])
+{
+  this->SetHandlePosition(handle,xyz[0],xyz[1],xyz[2]);
+}
+
+//----------------------------------------------------------------------------
+void vtkSplineRepresentation::GetHandlePosition(int handle, double xyz[3])
+{
+  if ( handle < 0 || handle >= this->NumberOfHandles )
+    {
+    vtkErrorMacro(<<"vtkSplineRepresentation: handle index out of range.");
+    return;
+    }
+
+  this->HandleGeometry[handle]->GetCenter(xyz);
+}
+
+//----------------------------------------------------------------------------
+double* vtkSplineRepresentation::GetHandlePosition(int handle)
+{
+  if ( handle < 0 || handle >= this->NumberOfHandles )
+    {
+    vtkErrorMacro(<<"vtkSplineRepresentation: handle index out of range.");
+    return NULL;
+    }
+
+  return this->HandleGeometry[handle]->GetCenter();
+}
+
+//----------------------------------------------------------------------------
+void vtkSplineRepresentation::ProjectPointsToPlane()
+{
+  if ( this->ProjectionNormal == VTK_PROJECTION_OBLIQUE )
+    {
+    if ( this->PlaneSource != NULL )
+      {
+      this->ProjectPointsToObliquePlane();
+      }
+    else
+      {
+      vtkGenericWarningMacro(<<"Set the plane source for oblique projections...");
+      }
+    }
+  else
+    {
+    this->ProjectPointsToOrthoPlane();
+    }
+}
+
+//----------------------------------------------------------------------------
+void vtkSplineRepresentation::ProjectPointsToObliquePlane()
+{
+  double o[3];
+  double u[3];
+  double v[3];
+
+  this->PlaneSource->GetPoint1(u);
+  this->PlaneSource->GetPoint2(v);
+  this->PlaneSource->GetOrigin(o);
+
+  int i;
+  for ( i = 0; i < 3; ++i )
+    {
+    u[i] = u[i] - o[i];
+    v[i] = v[i] - o[i];
+    }
+  vtkMath::Normalize(u);
+  vtkMath::Normalize(v);
+
+  double o_dot_u = vtkMath::Dot(o,u);
+  double o_dot_v = vtkMath::Dot(o,v);
+  double fac1;
+  double fac2;
+  double ctr[3];
+  for ( i = 0; i < this->NumberOfHandles; ++i )
+    {
+    this->HandleGeometry[i]->GetCenter(ctr);
+    fac1 = vtkMath::Dot(ctr,u) - o_dot_u;
+    fac2 = vtkMath::Dot(ctr,v) - o_dot_v;
+    ctr[0] = o[0] + fac1*u[0] + fac2*v[0];
+    ctr[1] = o[1] + fac1*u[1] + fac2*v[1];
+    ctr[2] = o[2] + fac1*u[2] + fac2*v[2];
+    this->HandleGeometry[i]->SetCenter(ctr);
+    this->HandleGeometry[i]->Update();
+    }
+}
+
+//----------------------------------------------------------------------------
+void vtkSplineRepresentation::ProjectPointsToOrthoPlane()
+{
+  double ctr[3];
+  for ( int i = 0; i < this->NumberOfHandles; ++i )
+    {
+    this->HandleGeometry[i]->GetCenter(ctr);
+    ctr[this->ProjectionNormal] = this->ProjectionPosition;
+    this->HandleGeometry[i]->SetCenter(ctr);
+    this->HandleGeometry[i]->Update();
+    }
+}
+
+//----------------------------------------------------------------------------
 void vtkSplineRepresentation::BuildRepresentation()
 {
   this->ValidPick = 1;
@@ -145,15 +377,15 @@ void vtkSplineRepresentation::BuildRepresentation()
     points->SetNumberOfPoints( this->NumberOfHandles );
     }
 
+  double pt[3];
+  int i;
   vtkBoundingBox bbox;
-  for ( int i = 0; i < this->NumberOfHandles; ++i )
+  for ( i = 0; i < this->NumberOfHandles; ++i )
     {
-    double pt[3];
     this->HandleGeometry[i]->GetCenter(pt);
     points->SetPoint(i, pt);
     bbox.AddPoint(pt);
     }
-  this->ParametricSpline->SetClosed(this->Closed);
   this->ParametricSpline->Modified();
 
   double bounds[6];
@@ -165,6 +397,265 @@ void vtkSplineRepresentation::BuildRepresentation()
 }
 
 //----------------------------------------------------------------------------
+int vtkSplineRepresentation::HighlightHandle(vtkProp *prop)
+{
+  // First unhighlight anything picked
+  if ( this->CurrentHandle )
+    {
+    this->CurrentHandle->SetProperty(this->HandleProperty);
+    }
+
+  this->CurrentHandle = static_cast<vtkActor *>(prop);
+
+  if ( this->CurrentHandle )
+    {
+    for ( int i = 0; i < this->NumberOfHandles; ++i ) // find handle
+      {
+      if ( this->CurrentHandle == this->Handle[i] )
+        {
+        this->CurrentHandle->SetProperty(this->SelectedHandleProperty);
+        return i;
+        }
+      }
+    }
+  return -1;
+}
+
+//----------------------------------------------------------------------------
+void vtkSplineRepresentation::HighlightLine(int highlight)
+{
+  if ( highlight )
+    {
+    this->LineActor->SetProperty(this->SelectedLineProperty);
+    }
+  else
+    {
+    this->LineActor->SetProperty(this->LineProperty);
+    }
+}
+
+//----------------------------------------------------------------------------
+void vtkSplineRepresentation::MovePoint(double *p1, double *p2)
+{
+  if ( this->CurrentHandleIndex < 0 || this->CurrentHandleIndex >= this->NumberOfHandles )
+    {
+    vtkGenericWarningMacro(<<"Spline handle index out of range.");
+    return;
+    }
+  // Get the motion vector
+  double v[3];
+  v[0] = p2[0] - p1[0];
+  v[1] = p2[1] - p1[1];
+  v[2] = p2[2] - p1[2];
+
+  double *ctr = this->HandleGeometry[this->CurrentHandleIndex]->GetCenter();
+
+  double newCtr[3];
+  newCtr[0] = ctr[0] + v[0];
+  newCtr[1] = ctr[1] + v[1];
+  newCtr[2] = ctr[2] + v[2];
+
+  this->HandleGeometry[this->CurrentHandleIndex]->SetCenter(newCtr);
+  this->HandleGeometry[this->CurrentHandleIndex]->Update();
+}
+
+//----------------------------------------------------------------------------
+void vtkSplineRepresentation::Translate(double *p1, double *p2)
+{
+  // Get the motion vector
+  double v[3];
+  v[0] = p2[0] - p1[0];
+  v[1] = p2[1] - p1[1];
+  v[2] = p2[2] - p1[2];
+
+  double newCtr[3];
+  for ( int i = 0; i < this->NumberOfHandles; ++i )
+    {
+    double* ctr =  this->HandleGeometry[i]->GetCenter();
+    for ( int j = 0; j < 3; ++j )
+      {
+      newCtr[j] = ctr[j] + v[j];
+      }
+     this->HandleGeometry[i]->SetCenter(newCtr);
+     this->HandleGeometry[i]->Update();
+    }
+}
+
+//----------------------------------------------------------------------------
+void vtkSplineRepresentation::Scale(double *p1, double *p2, int vtkNotUsed(X), int Y)
+{
+  // Get the motion vector
+  double v[3];
+  v[0] = p2[0] - p1[0];
+  v[1] = p2[1] - p1[1];
+  v[2] = p2[2] - p1[2];
+
+  double center[3] = {0.0,0.0,0.0};
+  double avgdist = 0.0;
+  double *prevctr = this->HandleGeometry[0]->GetCenter();
+  double *ctr;
+
+  center[0] += prevctr[0];
+  center[1] += prevctr[1];
+  center[2] += prevctr[2];
+
+  int i;
+  for ( i = 1; i < this->NumberOfHandles; ++i )
+    {
+    ctr = this->HandleGeometry[i]->GetCenter();
+    center[0] += ctr[0];
+    center[1] += ctr[1];
+    center[2] += ctr[2];
+    avgdist += sqrt(vtkMath::Distance2BetweenPoints(ctr,prevctr));
+    prevctr = ctr;
+    }
+
+  avgdist /= this->NumberOfHandles;
+
+  center[0] /= this->NumberOfHandles;
+  center[1] /= this->NumberOfHandles;
+  center[2] /= this->NumberOfHandles;
+
+  // Compute the scale factor
+  double sf = vtkMath::Norm(v) / avgdist;
+  if ( Y > this->LastEventPosition[1] )
+    {
+    sf = 1.0 + sf;
+    }
+  else
+    {
+    sf = 1.0 - sf;
+    }
+
+  // Move the handle points
+  double newCtr[3];
+  for ( i = 0; i < this->NumberOfHandles; ++i )
+    {
+    ctr = this->HandleGeometry[i]->GetCenter();
+    for ( int j = 0; j < 3; ++j )
+      {
+      newCtr[j] = sf * (ctr[j] - center[j]) + center[j];
+      }
+    this->HandleGeometry[i]->SetCenter(newCtr);
+    this->HandleGeometry[i]->Update();
+    }
+}
+
+//----------------------------------------------------------------------------
+void vtkSplineRepresentation::Spin(double *p1, double *p2, double *vpn)
+{
+  // Mouse motion vector in world space
+  double v[3];
+  v[0] = p2[0] - p1[0];
+  v[1] = p2[1] - p1[1];
+  v[2] = p2[2] - p1[2];
+
+  // Axis of rotation
+  double axis[3] = {0.0,0.0,0.0};
+
+  if ( this->ProjectToPlane )
+    {
+    if ( this->ProjectionNormal == VTK_PROJECTION_OBLIQUE && \
+         this->PlaneSource != NULL )
+      {
+      double* normal = this->PlaneSource->GetNormal();
+      axis[0] = normal[0];
+      axis[1] = normal[1];
+      axis[2] = normal[2];
+      vtkMath::Normalize(axis);
+      }
+    else
+      {
+      axis[ this->ProjectionNormal ] = 1.0;
+      }
+    }
+  else
+    {
+  // Create axis of rotation and angle of rotation
+    vtkMath::Cross(vpn,v,axis);
+    if ( vtkMath::Normalize(axis) == 0.0 )
+      {
+      return;
+      }
+    }
+
+  // Radius vector (from mean center to cursor position)
+  double rv[3] = {p2[0] - this->Centroid[0],
+                  p2[1] - this->Centroid[1],
+                  p2[2] - this->Centroid[2]};
+
+  // Distance between center and cursor location
+  double rs = vtkMath::Normalize(rv);
+
+  // Spin direction
+  double ax_cross_rv[3];
+  vtkMath::Cross(axis,rv,ax_cross_rv);
+
+  // Spin angle
+  double theta = 360.0 * vtkMath::Dot(v,ax_cross_rv) / rs;
+
+  // Manipulate the transform to reflect the rotation
+  this->Transform->Identity();
+  this->Transform->Translate(this->Centroid[0],this->Centroid[1],this->Centroid[2]);
+  this->Transform->RotateWXYZ(theta,axis);
+  this->Transform->Translate(-this->Centroid[0],-this->Centroid[1],-this->Centroid[2]);
+
+  // Set the handle points
+  double newCtr[3];
+  double ctr[3];
+  for ( int i = 0; i < this->NumberOfHandles; ++i )
+    {
+    this->HandleGeometry[i]->GetCenter(ctr);
+    this->Transform->TransformPoint(ctr,newCtr);
+    this->HandleGeometry[i]->SetCenter(newCtr);
+    this->HandleGeometry[i]->Update();
+    }
+}
+
+//----------------------------------------------------------------------------
+void vtkSplineRepresentation::CreateDefaultProperties()
+{
+  this->HandleProperty = vtkProperty::New();
+  this->HandleProperty->SetColor(1,1,1);
+
+  this->SelectedHandleProperty = vtkProperty::New();
+  this->SelectedHandleProperty->SetColor(1,0,0);
+
+  this->LineProperty = vtkProperty::New();
+  this->LineProperty->SetRepresentationToWireframe();
+  this->LineProperty->SetAmbient(1.0);
+  this->LineProperty->SetColor(1.0,1.0,0.0);
+  this->LineProperty->SetLineWidth(2.0);
+
+  this->SelectedLineProperty = vtkProperty::New();
+  this->SelectedLineProperty->SetRepresentationToWireframe();
+  this->SelectedLineProperty->SetAmbient(1.0);
+  this->SelectedLineProperty->SetAmbientColor(0.0,1.0,0.0);
+  this->SelectedLineProperty->SetLineWidth(2.0);
+}
+
+//----------------------------------------------------------------------------
+void vtkSplineRepresentation::SetProjectionPosition(double position)
+{
+  this->ProjectionPosition = position;
+  if ( this->ProjectToPlane )
+    {
+    this->ProjectPointsToPlane();
+    }
+  this->BuildRepresentation();
+}
+
+//----------------------------------------------------------------------------
+void vtkSplineRepresentation::SetPlaneSource(vtkPlaneSource* plane)
+{
+  if (this->PlaneSource == plane)
+    {
+    return;
+    }
+  this->PlaneSource = plane;
+}
+
+//----------------------------------------------------------------------------
 void vtkSplineRepresentation::SetNumberOfHandles(int npts)
 {
   if ( this->NumberOfHandles == npts )
@@ -189,7 +680,10 @@ void vtkSplineRepresentation::SetNumberOfHandles(int npts)
   this->Handle         = new vtkActor* [this->NumberOfHandles];
   this->HandleGeometry = new vtkSphereSource* [this->NumberOfHandles];
 
-  for ( int i = 0; i < this->NumberOfHandles; ++i )
+  int i;
+  double pt[3];
+  double u[3];
+  for ( i = 0; i < this->NumberOfHandles; ++i )
     {
     this->HandleGeometry[i] = vtkSphereSource::New();
     this->HandleGeometry[i]->SetThetaResolution(16);
@@ -201,7 +695,6 @@ void vtkSplineRepresentation::SetNumberOfHandles(int npts)
     this->Handle[i]->SetMapper(handleMapper);
     handleMapper->Delete();
     this->Handle[i]->SetProperty(this->HandleProperty);
-    double u[3], pt[3];
     u[0] = i/(this->NumberOfHandles - 1.0);
     this->ParametricSpline->Evaluate(u, pt, NULL);
     this->HandleGeometry[i]->SetCenter(pt);
@@ -209,7 +702,7 @@ void vtkSplineRepresentation::SetNumberOfHandles(int npts)
     this->HandlePicker->AddPickList(this->Handle[i]);
     }
 
-  if (this->CurrentHandleIndex >= 0 &&
+  if (this->CurrentHandleIndex >=0 &&
     this->CurrentHandleIndex < this->NumberOfHandles)
     {
     this->CurrentHandleIndex =
@@ -224,6 +717,23 @@ void vtkSplineRepresentation::SetNumberOfHandles(int npts)
 }
 
 //----------------------------------------------------------------------------
+void vtkSplineRepresentation::Initialize(void)
+{
+  int i;
+  for ( i = 0; i < this->NumberOfHandles; ++i )
+    {
+    this->HandlePicker->DeletePickList(this->Handle[i]);
+    this->HandleGeometry[i]->Delete();
+    this->Handle[i]->Delete();
+    }
+
+  this->NumberOfHandles = 0;
+
+  delete [] this->Handle;
+  delete [] this->HandleGeometry;
+}
+
+//----------------------------------------------------------------------------
 void vtkSplineRepresentation::SetResolution(int resolution)
 {
   if ( this->Resolution == resolution || resolution < (this->NumberOfHandles-1) )
@@ -243,6 +753,21 @@ void vtkSplineRepresentation::GetPolyData(vtkPolyData *pd)
 }
 
 //----------------------------------------------------------------------------
+void vtkSplineRepresentation::SizeHandles()
+{
+  if (this->NumberOfHandles > 0)
+    {
+    double radius = this->SizeHandlesInPixels(1.5,
+      this->HandleGeometry[0]->GetCenter());
+    //cout << "Raduis: " << radius << endl;
+    for ( int i = 0; i < this->NumberOfHandles; ++i )
+      {
+      this->HandleGeometry[i]->SetRadius(radius);
+      }
+    }
+}
+
+//----------------------------------------------------------------------------
 double vtkSplineRepresentation::GetSummedLength()
 {
   vtkPoints* points = this->ParametricFunctionSource->GetOutput()->GetPoints();
@@ -255,7 +780,7 @@ double vtkSplineRepresentation::GetSummedLength()
   double sum = 0.0;
   int i = 0;
   points->GetPoint(i, a);
-  int imax = (npts % 2 == 0) ? npts-2 : npts-1;
+  int imax = (npts%2 == 0) ? npts-2 : npts-1;
 
   while ( i < imax )
     {
@@ -266,7 +791,7 @@ double vtkSplineRepresentation::GetSummedLength()
     sum = sum + sqrt(vtkMath::Distance2BetweenPoints(a, b));
     }
 
-  if ( npts % 2 == 0 )
+  if ( npts%2 == 0 )
     {
     points->GetPoint(i+1, b);
     sum += sqrt(vtkMath::Distance2BetweenPoints(a, b));
@@ -276,6 +801,27 @@ double vtkSplineRepresentation::GetSummedLength()
 }
 
 //----------------------------------------------------------------------------
+void vtkSplineRepresentation::CalculateCentroid()
+{
+  this->Centroid[0] = 0.0;
+  this->Centroid[1] = 0.0;
+  this->Centroid[2] = 0.0;
+
+  double ctr[3];
+  for ( int i = 0; i < this->NumberOfHandles; ++i )
+    {
+    this->HandleGeometry[i]->GetCenter(ctr);
+    this->Centroid[0] += ctr[0];
+    this->Centroid[1] += ctr[1];
+    this->Centroid[2] += ctr[2];
+    }
+
+  this->Centroid[0] /= this->NumberOfHandles;
+  this->Centroid[1] /= this->NumberOfHandles;
+  this->Centroid[2] /= this->NumberOfHandles;
+}
+
+//----------------------------------------------------------------------------
 void vtkSplineRepresentation::InsertHandleOnLine(double* pos)
 {
   if (this->NumberOfHandles < 2) { return; }
@@ -292,14 +838,15 @@ void vtkSplineRepresentation::InsertHandleOnLine(double* pos)
     static_cast<double>(this->Resolution));
   int istop = istart + 1;
   int count = 0;
-  for ( int i = 0; i <= istart; ++i )
+  int i;
+  for ( i = 0; i <= istart; ++i )
     {
     newpoints->SetPoint(count++,this->HandleGeometry[i]->GetCenter());
     }
 
   newpoints->SetPoint(count++,pos);
 
-  for ( int i = istop; i < this->NumberOfHandles; ++i )
+  for ( i = istop; i < this->NumberOfHandles; ++i )
     {
     newpoints->SetPoint(count++,this->HandleGeometry[i]->GetCenter());
     }
@@ -309,6 +856,29 @@ void vtkSplineRepresentation::InsertHandleOnLine(double* pos)
 }
 
 //----------------------------------------------------------------------------
+void vtkSplineRepresentation::EraseHandle(const int& index)
+{
+  if ( this->NumberOfHandles < 3 || index < 0 || index >= this->NumberOfHandles )
+    {
+    return;
+    }
+
+  vtkPoints* newpoints = vtkPoints::New(VTK_DOUBLE);
+  newpoints->SetNumberOfPoints(this->NumberOfHandles-1);
+  int count = 0;
+  for (int i = 0; i < this->NumberOfHandles; ++i )
+    {
+    if ( i != index )
+      {
+      newpoints->SetPoint(count++,this->HandleGeometry[i]->GetCenter());
+      }
+    }
+
+  this->InitializeHandles(newpoints);
+  newpoints->Delete();
+}
+
+//----------------------------------------------------------------------------
 void vtkSplineRepresentation::InitializeHandles(vtkPoints* points)
 {
   if ( !points ){ return; }
@@ -330,16 +900,326 @@ void vtkSplineRepresentation::InitializeHandles(vtkPoints* points)
     }
 
   this->SetNumberOfHandles(npts);
-  for ( int i = 0; i < npts; ++i )
+  int i;
+  for ( i = 0; i < npts; ++i )
     {
     this->SetHandlePosition(i,points->GetPoint(i));
     }
 }
 
 //----------------------------------------------------------------------------
+int vtkSplineRepresentation::IsClosed()
+{
+  if ( this->NumberOfHandles < 3 || !this->Closed ) { return 0; }
+
+  vtkPolyData* lineData = this->ParametricFunctionSource->GetOutput();
+  if ( !lineData || !(lineData->GetPoints()) )
+    {
+    vtkErrorMacro(<<"No line data to query geometric closure");
+    return 0;
+    }
+
+  vtkPoints *points = lineData->GetPoints();
+  int numPoints = points->GetNumberOfPoints();
+
+  if ( numPoints < 3 )
+    {
+    return 0;
+    }
+
+  int numEntries = lineData->GetLines()->GetNumberOfConnectivityEntries();
+
+  double p0[3];
+  double p1[3];
+
+  points->GetPoint( 0, p0 );
+  points->GetPoint( numPoints - 1, p1 );
+  int minusNth = ( p0[0] == p1[0] && p0[1] == p1[1] && p0[2] == p1[2] ) ? 1 : 0;
+  int result;
+  if ( minusNth ) //definitely closed
+    {
+    result = 1;
+    }
+  else       // not physically closed, check connectivity
+    {
+    result = ( ( numEntries - numPoints ) == 2 ) ? 1 : 0;
+    }
+
+  return result;
+}
+
+//----------------------------------------------------------------------------
+void vtkSplineRepresentation::ReleaseGraphicsResources(vtkWindow* win)
+{
+  this->LineActor->ReleaseGraphicsResources(win);
+  for (int cc=0; cc < this->NumberOfHandles; cc++)
+    {
+    this->Handle[cc]->ReleaseGraphicsResources(win);
+    }
+}
+
+//----------------------------------------------------------------------------
+int vtkSplineRepresentation::RenderOpaqueGeometry(vtkViewport* win)
+{
+  this->BuildRepresentation();
+
+  int count = 0;
+  count += this->LineActor->RenderOpaqueGeometry(win);
+  for (int cc=0; cc < this->NumberOfHandles; cc++)
+    {
+    count+= this->Handle[cc]->RenderOpaqueGeometry(win);
+    }
+  return count;
+}
+
+//----------------------------------------------------------------------------
+int vtkSplineRepresentation::RenderTranslucentPolygonalGeometry(
+  vtkViewport* win)
+{
+  int count = 0;
+  count += this->LineActor->RenderTranslucentPolygonalGeometry(win);
+  for (int cc=0; cc < this->NumberOfHandles; cc++)
+    {
+    count += this->Handle[cc]->RenderTranslucentPolygonalGeometry(win);
+    }
+  return count;
+}
+
+//----------------------------------------------------------------------------
+int vtkSplineRepresentation::RenderOverlay(vtkViewport* win)
+{
+  int count = 0;
+  count += this->LineActor->RenderOverlay(win);
+  for (int cc=0; cc < this->NumberOfHandles; cc++)
+    {
+    count += this->Handle[cc]->RenderOverlay(win);
+    }
+  return count;
+}
+
+//----------------------------------------------------------------------------
+int vtkSplineRepresentation::HasTranslucentPolygonalGeometry()
+{
+  this->BuildRepresentation();
+  int count = 0;
+  count |= this->LineActor->HasTranslucentPolygonalGeometry();
+  for (int cc=0; cc < this->NumberOfHandles; cc++)
+    {
+    count |= this->Handle[cc]->HasTranslucentPolygonalGeometry();
+    }
+  return count;
+}
+
+//----------------------------------------------------------------------------
+int vtkSplineRepresentation::ComputeInteractionState(int X, int Y,
+  int vtkNotUsed(modify))
+{
+  this->InteractionState = vtkSplineRepresentation::Outside;
+  if (!this->Renderer || !this->Renderer->IsInViewport(X, Y))
+    {
+    return this->InteractionState;
+    }
+
+  // Try and pick a handle first. This allows the picking of the handle even
+  // if it is "behind" the spline.
+  int handlePicked = 0;
+
+  vtkAssemblyPath* path = this->GetAssemblyPath(X, Y, 0., this->HandlePicker);
+
+  if ( path != NULL )
+    {
+    this->ValidPick = 1;
+    this->InteractionState = vtkSplineRepresentation::OnHandle;
+    this->CurrentHandleIndex =
+      this->HighlightHandle(path->GetFirstNode()->GetViewProp());
+    this->HandlePicker->GetPickPosition(this->LastPickPosition);
+    handlePicked = 1;
+    }
+  else
+    {
+    this->CurrentHandleIndex = this->HighlightHandle(NULL);
+    }
+
+  if (!handlePicked)
+    {
+    path = this->GetAssemblyPath(X, Y, 0., this->LinePicker);
+
+    if ( path != NULL )
+      {
+      this->ValidPick = 1;
+      this->LinePicker->GetPickPosition(this->LastPickPosition);
+      this->HighlightLine(1);
+      this->InteractionState = vtkSplineRepresentation::OnLine;
+      }
+    else
+      {
+      this->HighlightLine(0);
+      }
+    }
+  else
+    {
+    this->HighlightLine(0);
+    }
+
+  return this->InteractionState;
+}
+
+//----------------------------------------------------------------------------
+void vtkSplineRepresentation::StartWidgetInteraction(double e[2])
+{
+  // Store the start position
+  this->StartEventPosition[0] = e[0];
+  this->StartEventPosition[1] = e[1];
+  this->StartEventPosition[2] = 0.0;
+
+  // Store the start position
+  this->LastEventPosition[0] = e[0];
+  this->LastEventPosition[1] = e[1];
+  this->LastEventPosition[2] = 0.0;
+
+  this->ComputeInteractionState(static_cast<int>(e[0]),static_cast<int>(e[1]),0);
+}
+
+//----------------------------------------------------------------------------
+void vtkSplineRepresentation::WidgetInteraction(double e[2])
+{
+  // Convert events to appropriate coordinate systems
+  vtkCamera *camera = this->Renderer->GetActiveCamera();
+  if ( !camera )
+    {
+    return;
+    }
+  double focalPoint[4], pickPoint[4], prevPickPoint[4];
+  double z, vpn[3];
+
+  // Compute the two points defining the motion vector
+  vtkInteractorObserver::ComputeWorldToDisplay(this->Renderer,
+    this->LastPickPosition[0], this->LastPickPosition[1], this->LastPickPosition[2],
+    focalPoint);
+  z = focalPoint[2];
+  vtkInteractorObserver::ComputeDisplayToWorld(this->Renderer,this->LastEventPosition[0],
+                                               this->LastEventPosition[1], z, prevPickPoint);
+  vtkInteractorObserver::ComputeDisplayToWorld(this->Renderer, e[0], e[1], z, pickPoint);
+
+  // Process the motion
+  if (this->InteractionState == vtkSplineRepresentation::Moving)
+    {
+    if (this->CurrentHandleIndex != -1)
+      {
+      this->MovePoint(prevPickPoint, pickPoint);
+      }
+    else
+      {
+       this->Translate(prevPickPoint, pickPoint);
+      }
+    }
+  else if (this->InteractionState == vtkSplineRepresentation::Scaling)
+    {
+    this->Scale(prevPickPoint, pickPoint,
+      static_cast<int>(e[0]), static_cast<int>(e[1]));
+    }
+  else if (this->InteractionState == vtkSplineRepresentation::Spinning)
+    {
+    camera->GetViewPlaneNormal(vpn);
+    this->Spin(prevPickPoint, pickPoint, vpn);
+    }
+
+  if (this->ProjectToPlane)
+    {
+    this->ProjectPointsToPlane();
+    }
+
+  this->BuildRepresentation();
+
+  // Store the position
+  this->LastEventPosition[0] = e[0];
+  this->LastEventPosition[1] = e[1];
+  this->LastEventPosition[2] = 0.0;
+}
+
+//----------------------------------------------------------------------------
+void vtkSplineRepresentation::EndWidgetInteraction(double[2])
+{
+  switch (this->InteractionState)
+    {
+  case vtkSplineRepresentation::Inserting:
+    this->InsertHandleOnLine(this->LastPickPosition);
+    break;
+
+  case vtkSplineRepresentation::Erasing:
+    if (this->CurrentHandleIndex)
+      {
+      int index = this->CurrentHandleIndex;
+      this->CurrentHandleIndex = this->HighlightHandle(NULL);
+      this->EraseHandle(index);
+      }
+    }
+
+  this->HighlightLine(0);
+  this->InteractionState = vtkSplineRepresentation::Outside;
+}
+
+//----------------------------------------------------------------------------
+double* vtkSplineRepresentation::GetBounds()
+{
+  this->BuildRepresentation();
+
+  vtkBoundingBox bbox;
+  bbox.AddBounds(this->LineActor->GetBounds());
+  for (int cc=0; cc < this->NumberOfHandles; cc++)
+    {
+    bbox.AddBounds(this->HandleGeometry[cc]->GetOutput()->GetBounds());
+    }
+  bbox.GetBounds(this->Bounds);
+  return this->Bounds;
+}
+
+
+//----------------------------------------------------------------------------
+void vtkSplineRepresentation::SetLineColor(double r, double g, double b)
+{
+  this->GetLineProperty()->SetColor(r, g, b);
+}
+
+//----------------------------------------------------------------------------
 void vtkSplineRepresentation::PrintSelf(ostream& os, vtkIndent indent)
 {
   this->Superclass::PrintSelf(os,indent);
+
+  if ( this->HandleProperty )
+    {
+    os << indent << "Handle Property: " << this->HandleProperty << "\n";
+    }
+  else
+    {
+    os << indent << "Handle Property: (none)\n";
+    }
+  if ( this->SelectedHandleProperty )
+    {
+    os << indent << "Selected Handle Property: "
+       << this->SelectedHandleProperty << "\n";
+    }
+  else
+    {
+    os << indent << "Selected Handle Property: (none)\n";
+    }
+  if ( this->LineProperty )
+    {
+    os << indent << "Line Property: " << this->LineProperty << "\n";
+    }
+  else
+    {
+    os << indent << "Line Property: (none)\n";
+    }
+  if ( this->SelectedLineProperty )
+    {
+    os << indent << "Selected Line Property: "
+       << this->SelectedLineProperty << "\n";
+    }
+  else
+    {
+    os << indent << "Selected Line Property: (none)\n";
+    }
   if ( this->ParametricSpline )
     {
     os << indent << "ParametricSpline: "
@@ -349,4 +1229,14 @@ void vtkSplineRepresentation::PrintSelf(ostream& os, vtkIndent indent)
     {
     os << indent << "ParametricSpline: (none)\n";
     }
+
+  os << indent << "Project To Plane: "
+     << (this->ProjectToPlane ? "On" : "Off") << "\n";
+  os << indent << "Projection Normal: " << this->ProjectionNormal << "\n";
+  os << indent << "Projection Position: " << this->ProjectionPosition << "\n";
+  os << indent << "Resolution: " << this->Resolution << "\n";
+  os << indent << "Number Of Handles: " << this->NumberOfHandles << "\n";
+  os << indent << "Closed: "
+     << (this->Closed ? "On" : "Off") << "\n";
+  os << indent << "InteractionState: " << this->InteractionState << endl;
 }
diff --git a/Interaction/Widgets/vtkSplineRepresentation.h b/Interaction/Widgets/vtkSplineRepresentation.h
index 3686622..bfb12e7 100644
--- a/Interaction/Widgets/vtkSplineRepresentation.h
+++ b/Interaction/Widgets/vtkSplineRepresentation.h
@@ -12,7 +12,7 @@
      PURPOSE.  See the above copyright notice for more information.
 
 =========================================================================*/
-// .NAME vtkSplineRepresentation - representation for a spline.
+// .NAME vtkSplineRepresentation - vtkWidgetRepresentation for a spline.
 // .SECTION Description
 // vtkSplineRepresentation is a vtkWidgetRepresentation for a spline.
 // This 3D widget defines a spline that can be interactively placed in a
@@ -26,7 +26,7 @@
 #define vtkSplineRepresentation_h
 
 #include "vtkInteractionWidgetsModule.h" // For export macro
-#include "vtkCurveRepresentation.h"
+#include "vtkWidgetRepresentation.h"
 
 class vtkActor;
 class vtkCellPicker;
@@ -41,24 +41,92 @@ class vtkProperty;
 class vtkSphereSource;
 class vtkTransform;
 
-class VTKINTERACTIONWIDGETS_EXPORT vtkSplineRepresentation : public vtkCurveRepresentation
+#define VTK_PROJECTION_YZ 0
+#define VTK_PROJECTION_XZ 1
+#define VTK_PROJECTION_XY 2
+#define VTK_PROJECTION_OBLIQUE 3
+class VTKINTERACTIONWIDGETS_EXPORT vtkSplineRepresentation : public vtkWidgetRepresentation
 {
 public:
   static vtkSplineRepresentation* New();
-  vtkTypeMacro(vtkSplineRepresentation, vtkCurveRepresentation);
+  vtkTypeMacro(vtkSplineRepresentation, vtkWidgetRepresentation);
   void PrintSelf(ostream& os, vtkIndent indent);
+//BTX
+  // Used to manage the InteractionState of the widget
+  enum _InteractionState {
+    Outside=0,
+    OnHandle,
+    OnLine,
+    Moving,
+    Scaling,
+    Spinning,
+    Inserting,
+    Erasing
+  };
+//ETX
+
+  vtkSetMacro(InteractionState, int);
+
+  // Description:
+  // Force the spline widget to be projected onto one of the orthogonal planes.
+  // Remember that when the InteractionState changes, a ModifiedEvent is invoked.
+  // This can be used to snap the spline to the plane if it is originally
+  // not aligned.  The normal in SetProjectionNormal is 0,1,2 for YZ,XZ,XY
+  // planes respectively and 3 for arbitrary oblique planes when the widget
+  // is tied to a vtkPlaneSource.
+  vtkSetMacro(ProjectToPlane,int);
+  vtkGetMacro(ProjectToPlane,int);
+  vtkBooleanMacro(ProjectToPlane,int);
+
+  // Description:
+  // Set up a reference to a vtkPlaneSource that could be from another widget
+  // object, e.g. a vtkPolyDataSourceWidget.
+  void SetPlaneSource(vtkPlaneSource* plane);
+
+  vtkSetClampMacro(ProjectionNormal,int,VTK_PROJECTION_YZ,VTK_PROJECTION_OBLIQUE);
+  vtkGetMacro(ProjectionNormal,int);
+  void SetProjectionNormalToXAxes()
+    { this->SetProjectionNormal(0); }
+  void SetProjectionNormalToYAxes()
+    { this->SetProjectionNormal(1); }
+  void SetProjectionNormalToZAxes()
+    { this->SetProjectionNormal(2); }
+  void SetProjectionNormalToOblique()
+    { this->SetProjectionNormal(3); }
+
+  // Description:
+  // Set the position of spline handles and points in terms of a plane's
+  // position. i.e., if ProjectionNormal is 0, all of the x-coordinate
+  // values of the points are set to position. Any value can be passed (and is
+  // ignored) to update the spline points when Projection normal is set to 3
+  // for arbritrary plane orientations.
+  void SetProjectionPosition(double position);
+  vtkGetMacro(ProjectionPosition, double);
 
   // Description:
   // Grab the polydata (including points) that defines the spline.  The
   // polydata consists of points and line segments numbering Resolution + 1
-  // and Resolution, respectively. Points are guaranteed to be up-to-date when
+  // and Resoltuion, respectively. Points are guaranteed to be up-to-date when
   // either the InteractionEvent or  EndInteraction events are invoked. The
   // user provides the vtkPolyData and the points and polyline are added to it.
   void GetPolyData(vtkPolyData *pd);
 
   // Description:
-  // Set the number of handles for this widget.
+  // Set/Get the handle properties (the spheres are the handles). The
+  // properties of the handles when selected and unselected can be manipulated.
+  vtkGetObjectMacro(HandleProperty, vtkProperty);
+  vtkGetObjectMacro(SelectedHandleProperty, vtkProperty);
+
+  // Description:
+  // Set/Get the line properties. The properties of the line when selected
+  // and unselected can be manipulated.
+  vtkGetObjectMacro(LineProperty, vtkProperty);
+  vtkGetObjectMacro(SelectedLineProperty, vtkProperty);
+
+  // Description:
+  // Set/Get the number of handles for this widget.
   virtual void SetNumberOfHandles(int npts);
+  vtkGetMacro(NumberOfHandles, int);
 
   // Description:
   // Set/Get the number of line segments representing the spline for
@@ -68,7 +136,7 @@ public:
 
   // Description:
   // Set the parametric spline object. Through vtkParametricSpline's API, the
-  // user can supply and configure one of two types of spline:
+  // user can supply and configure one of currently two types of spline:
   // vtkCardinalSpline, vtkKochanekSpline. The widget controls the open
   // or closed configuration of the spline.
   // WARNING: The widget does not enforce internal consistency so that all
@@ -77,10 +145,31 @@ public:
   vtkGetObjectMacro(ParametricSpline,vtkParametricSpline);
 
   // Description:
-  // Get the position of the spline handles.
+  // Set/Get the position of the spline handles. Call GetNumberOfHandles
+  // to determine the valid range of handle indices.
+  void SetHandlePosition(int handle, double x, double y, double z);
+  void SetHandlePosition(int handle, double xyz[3]);
+  void GetHandlePosition(int handle, double xyz[3]);
+  double* GetHandlePosition(int handle);
   vtkDoubleArray* GetHandlePositions();
 
   // Description:
+  // Control whether the spline is open or closed. A closed spline forms
+  // a continuous loop: the first and last points are the same, and
+  // derivatives are continuous.  A minimum of 3 handles are required to
+  // form a closed loop.  This method enforces consistency with
+  // user supplied subclasses of vtkSpline.
+  void SetClosed(int closed);
+  vtkGetMacro(Closed,int);
+  vtkBooleanMacro(Closed,int);
+
+  // Description:
+  // Convenience method to determine whether the spline is
+  // closed in a geometric sense.  The widget may be set "closed" but still
+  // be geometrically open (e.g., a straight line).
+  int IsClosed();
+
+  // Description:
   // Get the approximate vs. the true arc length of the spline. Calculated as
   // the summed lengths of the individual straight line segments. Use
   // SetResolution to control the accuracy.
@@ -98,21 +187,94 @@ public:
   // version of place widget is available where the center and handle position
   // are specified.
   virtual void BuildRepresentation();
+  virtual int ComputeInteractionState(int X, int Y, int modify=0);
+  virtual void StartWidgetInteraction(double e[2]);
+  virtual void WidgetInteraction(double e[2]);
+  virtual void EndWidgetInteraction(double e[2]);
+  virtual double *GetBounds();
+
+  // Description:
+  // Methods supporting, and required by, the rendering process.
+  virtual void ReleaseGraphicsResources(vtkWindow*);
+  virtual int RenderOpaqueGeometry(vtkViewport*);
+  virtual int RenderTranslucentPolygonalGeometry(vtkViewport*);
+  virtual int RenderOverlay(vtkViewport*);
+  virtual int HasTranslucentPolygonalGeometry();
+
+  // Description:
+  // Convenience method to set the line color.
+  // Ideally one should use GetLineProperty()->SetColor().
+  void SetLineColor(double r, double g, double b);
 
 //BTX
 protected:
   vtkSplineRepresentation();
   ~vtkSplineRepresentation();
 
+  double LastEventPosition[3];
+  double Bounds[6];
+
+  // Controlling vars
+  int   ProjectionNormal;
+  double ProjectionPosition;
+  int   ProjectToPlane;
+  vtkPlaneSource* PlaneSource;
+
+  // Projection capabilities
+  void ProjectPointsToPlane();
+  void ProjectPointsToOrthoPlane();
+  void ProjectPointsToObliquePlane();
+
   // The spline
   vtkParametricSpline *ParametricSpline;
   vtkParametricFunctionSource *ParametricFunctionSource;
+  int NumberOfHandles;
+  int Closed;
 
-  // The number of line segments used to represent the spline.
+  // The line segments
+  vtkActor           *LineActor;
+  void HighlightLine(int highlight);
   int Resolution;
 
-  // Specialized method to insert a handle on the poly line.
-  virtual void InsertHandleOnLine(double* pos);
+  // Glyphs representing hot spots (e.g., handles)
+  vtkActor          **Handle;
+  vtkSphereSource   **HandleGeometry;
+  void Initialize();
+  int  HighlightHandle(vtkProp *prop); //returns handle index or -1 on fail
+  virtual void SizeHandles();
+  void InsertHandleOnLine(double* pos);
+  void EraseHandle(const int&);
+
+  // Do the picking
+  vtkCellPicker *HandlePicker;
+  vtkCellPicker *LinePicker;
+  double LastPickPosition[3];
+  vtkActor *CurrentHandle;
+  int CurrentHandleIndex;
+
+  // Register internal Pickers within PickingManager
+  virtual void RegisterPickers();
+
+  // Methods to manipulate the spline.
+  void MovePoint(double *p1, double *p2);
+  void Scale(double *p1, double *p2, int X, int Y);
+  void Translate(double *p1, double *p2);
+  void Spin(double *p1, double *p2, double *vpn);
+
+  // Transform the control points (used for spinning)
+  vtkTransform *Transform;
+
+  // Properties used to control the appearance of selected objects and
+  // the manipulator in general.
+  vtkProperty *HandleProperty;
+  vtkProperty *SelectedHandleProperty;
+  vtkProperty *LineProperty;
+  vtkProperty *SelectedLineProperty;
+  void CreateDefaultProperties();
+
+  // For efficient spinning
+  double Centroid[3];
+  void CalculateCentroid();
 
 private:
   vtkSplineRepresentation(const vtkSplineRepresentation&); // Not implemented.
diff --git a/Interaction/Widgets/vtkTextRepresentation.cxx b/Interaction/Widgets/vtkTextRepresentation.cxx
index 6068f8e..f423a0d 100644
--- a/Interaction/Widgets/vtkTextRepresentation.cxx
+++ b/Interaction/Widgets/vtkTextRepresentation.cxx
@@ -20,7 +20,6 @@
 #include "vtkRenderer.h"
 #include "vtkStdString.h"
 #include "vtkCommand.h"
-#include "vtkWindow.h"
 
 class vtkTextRepresentationObserver : public vtkCommand
 {
@@ -271,16 +270,9 @@ void vtkTextRepresentation::CheckTextBoundary()
 
     this->TextActor->ComputeScaledFont(this->GetRenderer());
 
-    vtkWindow *win = this->Renderer->GetVTKWindow();
-    if (!win)
-      {
-      vtkErrorMacro(<<"No render window available: cannot determine DPI.");
-      return;
-      }
-
     int text_bbox[4];
     if (!tren->GetBoundingBox(this->TextActor->GetScaledTextProperty(),
-                              this->GetText(), text_bbox, win->GetDPI()))
+                              this->GetText(), text_bbox))
       {
       return;
       }
@@ -382,21 +374,15 @@ void vtkTextRepresentation::PrintSelf(ostream& os, vtkIndent indent)
     {
     case LowerLeftCorner:
       os << "LowerLeftCorner\n";
-      break;
     case LowerRightCorner:
       os << "LowerRightCorner\n";
-      break;
     case LowerCenter:
       os << "LowerCenter\n";
-      break;
     case UpperLeftCorner:
       os << "UpperLeftCorner\n";
-      break;
     case UpperRightCorner:
       os << "UpperRightCorner\n";
-      break;
     case UpperCenter:
       os << "UpperCenter\n";
-      break;
     }
 }
diff --git a/Parallel/Core/Testing/Data/Baseline/TestPolyDataPieces.png.md5 b/Parallel/Core/Testing/Data/Baseline/TestPolyDataPieces.png.md5
index 9f97ef5..0b653ec 100644
--- a/Parallel/Core/Testing/Data/Baseline/TestPolyDataPieces.png.md5
+++ b/Parallel/Core/Testing/Data/Baseline/TestPolyDataPieces.png.md5
@@ -1 +1 @@
-53459a5a35d52ce823085db77fbde9d5
+ff62bf9a6fd1abe05dc3d186a209fa5b
diff --git a/Parallel/Core/Testing/Python/TestPolyDataPieces.py b/Parallel/Core/Testing/Python/TestPolyDataPieces.py
index 341a8d7..54f78ac 100755
--- a/Parallel/Core/Testing/Python/TestPolyDataPieces.py
+++ b/Parallel/Core/Testing/Python/TestPolyDataPieces.py
@@ -41,7 +41,7 @@ mapper2.SetPiece(1)
 mapper2.SetScalarRange(0, 4)
 mapper2.SetScalarModeToUseCellFieldData()
 mapper2.SetColorModeToMapScalars()
-mapper2.ColorByArrayComponent(vtk.vtkDataSetAttributes.GhostArrayName(), 0)
+mapper2.ColorByArrayComponent("vtkGhostLevels", 0)
 mapper2.SetGhostLevel(4)
 
 # check the pipeline size
@@ -50,9 +50,8 @@ psize = vtk.vtkPipelineSize()
 if (psize.GetEstimatedSize(extract2, 0, 0) > 100):
     print ("ERROR: Pipeline Size increased")
     pass
-if (psize.GetNumberOfSubPieces(10, mapper2) != 1):
-    print ("ERROR: Number of sub pieces changed",
-           psize.GetNumberOfSubPieces(10, mapper2))
+if (psize.GetNumberOfSubPieces(10, mapper2) != 2):
+    print ("ERROR: Number of sub pieces changed")
     pass
 
 actor2 = vtk.vtkActor()
diff --git a/Parallel/Core/Testing/Tcl/TestPolyDataPieces.tcl b/Parallel/Core/Testing/Tcl/TestPolyDataPieces.tcl
index 440761c..c9ab783 100644
--- a/Parallel/Core/Testing/Tcl/TestPolyDataPieces.tcl
+++ b/Parallel/Core/Testing/Tcl/TestPolyDataPieces.tcl
@@ -1,9 +1,6 @@
 package require vtk
 package require vtkinteraction
 
-
-
-
 vtkMath math
 math RandomSeed 22
 
@@ -34,7 +31,6 @@ sphere2 SetThetaResolution 32
 vtkExtractPolyDataPiece extract2
 extract2 SetInputConnection [sphere2 GetOutputPort]
 
-vtkDataSetAttributes attributes
 vtkPolyDataMapper mapper2
 mapper2 SetInputConnection [extract2 GetOutputPort]
 mapper2 SetNumberOfPieces 2
@@ -42,8 +38,9 @@ mapper2 SetPiece 1
 mapper2 SetScalarRange 0 4
 mapper2 SetScalarModeToUseCellFieldData
 mapper2 SetColorModeToMapScalars
-mapper2 ColorByArrayComponent [attributes GhostArrayName] 0
+mapper2 ColorByArrayComponent "vtkGhostLevels" 0
 mapper2 SetGhostLevel 4
+
 # check the pipeline size
 extract2 UpdateInformation
 vtkPipelineSize psize
@@ -54,7 +51,6 @@ if {[psize GetNumberOfSubPieces 10 mapper2] != 2} {
    puts stderr "ERROR: Number of sub pieces changed"
 }
 
-
 vtkActor actor2
 actor2 SetMapper mapper2
 actor2 SetPosition 1.5 0 0
diff --git a/Parallel/Core/vtkCommunicator.cxx b/Parallel/Core/vtkCommunicator.cxx
index 3be13e6..d9afcc9 100644
--- a/Parallel/Core/vtkCommunicator.cxx
+++ b/Parallel/Core/vtkCommunicator.cxx
@@ -18,7 +18,6 @@
 #include "vtkCharArray.h"
 #include "vtkCompositeDataSet.h"
 #include "vtkDataObjectTypes.h"
-#include "vtkDataSetAttributes.h"
 #include "vtkDataSetReader.h"
 #include "vtkDataSetWriter.h"
 #include "vtkDoubleArray.h"
@@ -30,13 +29,11 @@
 #include "vtkIntArray.h"
 #include "vtkMultiProcessController.h"
 #include "vtkMultiProcessStream.h"
-#include "vtkNew.h"
 #include "vtkRectilinearGrid.h"
 #include "vtkSmartPointer.h"
 #include "vtkStructuredGrid.h"
 #include "vtkStructuredPoints.h"
 #include "vtkTypeTraits.h"
-#include "vtkTable.h"
 #include "vtkUnsignedCharArray.h"
 #include "vtkUnsignedLongArray.h"
 
@@ -229,8 +226,6 @@ int vtkCommunicator::SendElementalDataObject(
   // could not marshal data
   return 0;
 }
-
-//----------------------------------------------------------------------------
 int vtkCommunicator::Send(vtkDataArray* data, int remoteHandle, int tag)
 {
   // If the receiving end is using with ANY_SOURCE, we have a problem because
@@ -962,8 +957,8 @@ int vtkCommunicator::GatherVoidArray(const void *sendBuffer,
 
 //-----------------------------------------------------------------------------
 int vtkCommunicator::Gather(vtkDataArray *sendBuffer,
-                             vtkDataArray *recvBuffer,
-                             int destProcessId)
+                            vtkDataArray *recvBuffer,
+                            int destProcessId)
 {
   int type = sendBuffer->GetDataType();
   const void *sb = sendBuffer->GetVoidPointer(0);
@@ -986,119 +981,6 @@ int vtkCommunicator::Gather(vtkDataArray *sendBuffer,
 }
 
 //-----------------------------------------------------------------------------
-int vtkCommunicator::GatherV(vtkDataArray *sendBuffer,
-                             vtkDataArray* recvBuffer,
-                             vtkSmartPointer<vtkDataArray> *recvBuffers,
-                             int destProcessId)
-{
-  vtkNew<vtkIdTypeArray> recvLengths;
-  vtkNew<vtkIdTypeArray> offsets;
-  int retValue = this->GatherV(
-    sendBuffer, recvBuffer,
-    recvLengths.GetPointer(), offsets.GetPointer(), destProcessId);
-  if (destProcessId == this->LocalProcessId)
-    {
-    int numComponents = sendBuffer->GetNumberOfComponents();
-    for (int i = 0; i < this->NumberOfProcesses; ++i)
-      {
-      recvBuffers[i]->SetNumberOfComponents(numComponents);
-      recvBuffers[i]->SetVoidArray(
-        static_cast<unsigned char*>(recvBuffer->GetVoidPointer(0))  +
-        offsets->GetValue(i) * recvBuffer->GetElementComponentSize(),
-        recvLengths->GetValue(i) * recvBuffer->GetElementComponentSize(), 1);
-      }
-    }
-  return retValue;
-}
-
-//-----------------------------------------------------------------------------
-int vtkCommunicator::GatherVElementalDataObject(
-  vtkDataObject* sendData, vtkSmartPointer<vtkDataObject>* receiveData,
-  int destProcessId)
-{
-  vtkNew<vtkCharArray> sendBuffer;
-  vtkNew<vtkCharArray> recvBuffer;
-  std::vector<vtkSmartPointer<vtkDataArray> > recvBuffers(
-    this->NumberOfProcesses);
-
-  vtkCommunicator::MarshalDataObject(sendData, sendBuffer.GetPointer());
-  if (this->LocalProcessId == destProcessId)
-    {
-    for (int i = 0; i < this->NumberOfProcesses; ++i)
-      {
-      recvBuffers[i] = vtkSmartPointer<vtkCharArray>::New();
-      }
-    }
-  if (this->GatherV(sendBuffer.GetPointer(), recvBuffer.GetPointer(),
-                    &recvBuffers[0], destProcessId))
-    {
-    if (this->LocalProcessId == destProcessId)
-      {
-      for (int i = 0; i < this->NumberOfProcesses; ++i)
-        {
-        if (! vtkCommunicator::UnMarshalDataObject(
-              vtkCharArray::SafeDownCast(recvBuffers[i].GetPointer()),
-              receiveData[i]))
-          {
-          return 0;
-          }
-        }
-      }
-    }
-  else
-    {
-    return 0;
-    }
-  return 1;
-}
-
-//----------------------------------------------------------------------------
-int vtkCommunicator::GatherV(vtkDataObject *sendData,
-                             vtkSmartPointer<vtkDataObject>* receiveData,
-                             int destProcessId)
-{
-  int sendType = sendData? sendData->GetDataObjectType() : -1;
-  switch(sendType)
-    {
-  case -1:
-    // NULL data.
-    return 1;
-
-    //error on types we can't send
-    case VTK_DATA_OBJECT:
-    case VTK_DATA_SET:
-    case VTK_PIECEWISE_FUNCTION:
-    case VTK_POINT_SET:
-    case VTK_UNIFORM_GRID:
-    case VTK_GENERIC_DATA_SET:
-    case VTK_HYPER_OCTREE:
-    case VTK_COMPOSITE_DATA_SET:
-    case VTK_HIERARCHICAL_BOX_DATA_SET: // since we cannot send vtkUniformGrid anyways.
-    case VTK_MULTIGROUP_DATA_SET: // obsolete
-    case VTK_HIERARCHICAL_DATA_SET: //obsolete
-    default:
-      vtkErrorMacro(<< "Cannot gather " << sendData->GetClassName());
-      return 0;
-
-    //send elemental data objects
-    case VTK_DIRECTED_GRAPH:
-    case VTK_UNDIRECTED_GRAPH:
-    case VTK_IMAGE_DATA:
-    case VTK_POLY_DATA:
-    case VTK_RECTILINEAR_GRID:
-    case VTK_STRUCTURED_GRID:
-    case VTK_STRUCTURED_POINTS:
-    case VTK_TABLE:
-    case VTK_TREE:
-    case VTK_UNSTRUCTURED_GRID:
-    case VTK_MULTIBLOCK_DATA_SET:
-    case VTK_UNIFORM_GRID_AMR:
-      return this->GatherVElementalDataObject(
-        sendData, receiveData, destProcessId);
-    }
-}
-
-//-----------------------------------------------------------------------------
 int vtkCommunicator::GatherVVoidArray(const void *sendBuffer,
                                       void *recvBuffer,
                                       vtkIdType sendLength,
@@ -1140,16 +1022,6 @@ int vtkCommunicator::GatherVVoidArray(const void *sendBuffer,
 
 //-----------------------------------------------------------------------------
 int vtkCommunicator::GatherV(vtkDataArray *sendBuffer, vtkDataArray *recvBuffer,
-                             int destProcessId)
-{
-  vtkNew<vtkIdTypeArray> recvLengths;
-  vtkNew<vtkIdTypeArray> offsets;
-  return this->GatherV(sendBuffer, recvBuffer, recvLengths.GetPointer(),
-                       offsets.GetPointer(), destProcessId);
-}
-
-//-----------------------------------------------------------------------------
-int vtkCommunicator::GatherV(vtkDataArray *sendBuffer, vtkDataArray *recvBuffer,
                              vtkIdType *recvLengths, vtkIdType *offsets,
                              int destProcessId)
 {
@@ -1170,18 +1042,14 @@ int vtkCommunicator::GatherV(vtkDataArray *sendBuffer, vtkDataArray *recvBuffer,
 
 //-----------------------------------------------------------------------------
 int vtkCommunicator::GatherV(vtkDataArray *sendBuffer, vtkDataArray *recvBuffer,
-                             vtkIdTypeArray* recvLengthsArray,
-                             vtkIdTypeArray* offsetsArray,
                              int destProcessId)
 {
-  vtkIdType* recvLengths =
-    recvLengthsArray->WritePointer(0, this->GetNumberOfProcesses());
-  vtkIdType* offsets =
-    offsetsArray->WritePointer(0, this->GetNumberOfProcesses() + 1);
+  std::vector<vtkIdType> recvLengths(this->NumberOfProcesses);
+  std::vector<vtkIdType> offsets(this->NumberOfProcesses + 1);
   int numComponents = sendBuffer->GetNumberOfComponents();
   vtkIdType numTuples = sendBuffer->GetNumberOfTuples();
   vtkIdType sendLength = numComponents*numTuples;
-  if (!this->Gather(&sendLength, recvLengths, 1, destProcessId))
+  if (!this->Gather(&sendLength, &recvLengths.at(0), 1, destProcessId))
     {
     return 0;
     }
@@ -1198,10 +1066,10 @@ int vtkCommunicator::GatherV(vtkDataArray *sendBuffer, vtkDataArray *recvBuffer,
       }
     recvBuffer->SetNumberOfComponents(numComponents);
     recvBuffer->SetNumberOfTuples(
-      offsets[this->NumberOfProcesses]/numComponents);
+                                offsets[this->NumberOfProcesses]/numComponents);
     }
   return this->GatherV(sendBuffer, recvBuffer,
-                       recvLengths, offsets, destProcessId);
+                       &recvLengths.at(0), &offsets.at(0), destProcessId);
 }
 
 //-----------------------------------------------------------------------------
@@ -1440,7 +1308,10 @@ int vtkCommunicator::ReduceVoidArray(const void *sendBuffer,
 
   int retVal = this->ReduceVoidArray(sendBuffer, recvBuffer, length, type,
                                      opClass, destProcessId);
-  delete opClass;
+  if (opClass)
+    {
+    delete opClass;
+    }
 
   return retVal;
 
@@ -1689,3 +1560,4 @@ int vtkCommunicator::Receive(vtkMultiProcessStream& stream, int remoteId, int ta
     }
   return 1;
 }
+
diff --git a/Parallel/Core/vtkCommunicator.h b/Parallel/Core/vtkCommunicator.h
index f346713..b0ed11e 100644
--- a/Parallel/Core/vtkCommunicator.h
+++ b/Parallel/Core/vtkCommunicator.h
@@ -31,14 +31,12 @@
 
 #include "vtkParallelCoreModule.h" // For export macro
 #include "vtkObject.h"
-#include "vtkSmartPointer.h"
 
 class vtkBoundingBox;
 class vtkCharArray;
 class vtkDataArray;
 class vtkDataObject;
 class vtkDataSet;
-class vtkIdTypeArray;
 class vtkImageData;
 class vtkMultiBlockDataSet;
 class vtkMultiProcessStream;
@@ -145,16 +143,6 @@ public:
   int Send(const unsigned int* data, vtkIdType length, int remoteHandle, int tag) {
     return this->SendVoidArray(data, length, VTK_INT, remoteHandle, tag);
   }
-  int Send(const short* data, vtkIdType length, int remoteHandle, int tag) {
-    return this->SendVoidArray(data, length, VTK_SHORT, remoteHandle, tag);
-  }
-  int Send(const unsigned short* data, vtkIdType length, int remoteHandle, int tag) {
-    return this->SendVoidArray(data, length, VTK_UNSIGNED_SHORT, remoteHandle, tag);
-  }
-  int Send(const long* data, vtkIdType length,
-           int remoteHandle, int tag) {
-    return this->SendVoidArray(data, length,VTK_LONG,remoteHandle,tag);
-  }
   int Send(const unsigned long* data, vtkIdType length,
            int remoteHandle, int tag) {
     return this->SendVoidArray(data, length,VTK_UNSIGNED_LONG,remoteHandle,tag);
@@ -166,9 +154,6 @@ public:
   int Send(const char* data, vtkIdType length, int remoteHandle, int tag) {
     return this->SendVoidArray(data, length, VTK_CHAR, remoteHandle, tag);
   }
-  int Send(const signed char* data, vtkIdType length, int remoteHandle, int tag) {
-    return this->SendVoidArray(data, length, VTK_SIGNED_CHAR, remoteHandle, tag);
-  }
   int Send(const float* data, vtkIdType length, int remoteHandle, int tag) {
     return this->SendVoidArray(data, length, VTK_FLOAT, remoteHandle, tag);
   }
@@ -179,15 +164,6 @@ public:
   int Send(const vtkIdType* data, vtkIdType length, int remoteHandle, int tag) {
     return this->SendVoidArray(data, length, VTK_ID_TYPE, remoteHandle, tag);
   }
-#elif defined(VTK_TYPE_USE_LONG_LONG)
-  int Send(const long long* data, vtkIdType length, int remoteHandle, int tag) {
-    return this->SendVoidArray(data, length, VTK_LONG_LONG, remoteHandle, tag);
-  }
-#endif
-#ifdef VTK_TYPE_USE_LONG_LONG
-  int Send(const unsigned long long* data, vtkIdType length, int remoteHandle, int tag) {
-    return this->SendVoidArray(data, length, VTK_UNSIGNED_LONG_LONG, remoteHandle, tag);
-  }
 #endif
 //BTX
   int Send(const vtkMultiProcessStream& stream, int remoteId, int tag);
@@ -229,15 +205,6 @@ public:
   int Receive(unsigned int* data, vtkIdType maxlength, int remoteHandle, int tag) {
     return this->ReceiveVoidArray(data, maxlength, VTK_INT, remoteHandle, tag);
   }
-  int Receive(short* data, vtkIdType maxlength, int remoteHandle, int tag) {
-    return this->ReceiveVoidArray(data, maxlength, VTK_SHORT, remoteHandle, tag);
-  }
-  int Receive(unsigned short* data, vtkIdType maxlength, int remoteHandle, int tag) {
-    return this->ReceiveVoidArray(data, maxlength, VTK_UNSIGNED_SHORT, remoteHandle, tag);
-  }
-  int Receive(long* data, vtkIdType maxlength, int remoteHandle, int tag) {
-    return this->ReceiveVoidArray(data, maxlength, VTK_LONG, remoteHandle, tag);
-  }
   int Receive(unsigned long* data, vtkIdType maxlength, int remoteHandle, int tag){
     return this->ReceiveVoidArray(data, maxlength, VTK_UNSIGNED_LONG, remoteHandle,
                                   tag);
@@ -249,9 +216,6 @@ public:
   int Receive(char* data, vtkIdType maxlength, int remoteHandle, int tag) {
     return this->ReceiveVoidArray(data, maxlength, VTK_CHAR, remoteHandle, tag);
   }
-  int Receive(signed char* data, vtkIdType maxlength, int remoteHandle, int tag) {
-    return this->ReceiveVoidArray(data, maxlength, VTK_SIGNED_CHAR, remoteHandle, tag);
-  }
   int Receive(float* data, vtkIdType maxlength, int remoteHandle, int tag) {
     return this->ReceiveVoidArray(data, maxlength, VTK_FLOAT, remoteHandle, tag);
   }
@@ -262,15 +226,6 @@ public:
   int Receive(vtkIdType* data, vtkIdType maxlength, int remoteHandle, int tag) {
     return this->ReceiveVoidArray(data, maxlength, VTK_ID_TYPE, remoteHandle, tag);
   }
-#elif defined(VTK_TYPE_USE_LONG_LONG)
-  int Receive(long long* data, vtkIdType maxlength, int remoteHandle, int tag) {
-    return this->ReceiveVoidArray(data, maxlength, VTK_LONG_LONG, remoteHandle, tag);
-  }
-#endif
-#ifdef VTK_TYPE_USE_LONG_LONG
-  int Receive(unsigned long long* data, vtkIdType maxlength, int remoteHandle, int tag) {
-    return this->ReceiveVoidArray(data, maxlength, VTK_UNSIGNED_LONG_LONG, remoteHandle, tag);
-  }
 #endif
 //BTX
   int Receive(vtkMultiProcessStream& stream, int remoteId, int tag);
@@ -302,15 +257,6 @@ public:
   int Broadcast(unsigned int *data, vtkIdType length, int srcProcessId) {
     return this->BroadcastVoidArray(data, length, VTK_UNSIGNED_INT, srcProcessId);
   }
-  int Broadcast(short *data, vtkIdType length, int srcProcessId) {
-    return this->BroadcastVoidArray(data, length, VTK_SHORT, srcProcessId);
-  }
-  int Broadcast(unsigned short *data, vtkIdType length, int srcProcessId) {
-    return this->BroadcastVoidArray(data, length, VTK_UNSIGNED_SHORT, srcProcessId);
-  }
-  int Broadcast(long *data, vtkIdType length, int srcProcessId) {
-    return this->BroadcastVoidArray(data, length, VTK_LONG, srcProcessId);
-  }
   int Broadcast(unsigned long *data, vtkIdType length, int srcProcessId) {
     return this->BroadcastVoidArray(data,length,VTK_UNSIGNED_LONG,srcProcessId);
   }
@@ -320,9 +266,6 @@ public:
   int Broadcast(char *data, vtkIdType length, int srcProcessId) {
     return this->BroadcastVoidArray(data, length, VTK_CHAR, srcProcessId);
   }
-  int Broadcast(signed char *data, vtkIdType length, int srcProcessId) {
-    return this->BroadcastVoidArray(data, length, VTK_SIGNED_CHAR, srcProcessId);
-  }
   int Broadcast(float *data, vtkIdType length, int srcProcessId) {
     return this->BroadcastVoidArray(data, length, VTK_FLOAT, srcProcessId);
   }
@@ -333,15 +276,6 @@ public:
   int Broadcast(vtkIdType *data, vtkIdType length, int srcProcessId) {
     return this->BroadcastVoidArray(data, length, VTK_ID_TYPE, srcProcessId);
   }
-#elif defined(VTK_TYPE_USE_LONG_LONG)
-  int Broadcast(long long *data, vtkIdType length, int srcProcessId) {
-    return this->BroadcastVoidArray(data, length, VTK_LONG_LONG, srcProcessId);
-  }
-#endif
-#ifdef VTK_TYPE_USE_LONG_LONG
-  int Broadcast(unsigned long long *data, vtkIdType length, int srcProcessId) {
-    return this->BroadcastVoidArray(data, length, VTK_UNSIGNED_LONG_LONG, srcProcessId);
-  }
 #endif
   int Broadcast(vtkDataObject *data, int srcProcessId);
   int Broadcast(vtkDataArray *data, int srcProcessId);
@@ -362,26 +296,6 @@ public:
     return this->GatherVoidArray(sendBuffer, recvBuffer, length,
                                  VTK_INT, destProcessId);
   }
-  int Gather(const unsigned int *sendBuffer, unsigned int *recvBuffer,
-             vtkIdType length, int destProcessId) {
-    return this->GatherVoidArray(sendBuffer, recvBuffer, length,
-                                 VTK_UNSIGNED_INT, destProcessId);
-  }
-  int Gather(const short *sendBuffer, short *recvBuffer,
-             vtkIdType length, int destProcessId) {
-    return this->GatherVoidArray(sendBuffer, recvBuffer, length,
-                                 VTK_SHORT, destProcessId);
-  }
-  int Gather(const unsigned short *sendBuffer, unsigned short *recvBuffer,
-             vtkIdType length, int destProcessId) {
-    return this->GatherVoidArray(sendBuffer, recvBuffer, length,
-                                 VTK_UNSIGNED_SHORT, destProcessId);
-  }
-  int Gather(const long *sendBuffer, long *recvBuffer,
-             vtkIdType length, int destProcessId) {
-    return this->GatherVoidArray(sendBuffer, recvBuffer, length,
-                                 VTK_LONG, destProcessId);
-  }
   int Gather(const unsigned long *sendBuffer, unsigned long *recvBuffer,
              vtkIdType length, int destProcessId) {
     return this->GatherVoidArray(sendBuffer, recvBuffer, length,
@@ -397,11 +311,6 @@ public:
     return this->GatherVoidArray(sendBuffer, recvBuffer, length,
                                  VTK_CHAR, destProcessId);
   }
-  int Gather(const signed char *sendBuffer, signed char *recvBuffer,
-             vtkIdType length, int destProcessId) {
-    return this->GatherVoidArray(sendBuffer, recvBuffer, length,
-                                 VTK_SIGNED_CHAR, destProcessId);
-  }
   int Gather(const float *sendBuffer, float *recvBuffer,
              vtkIdType length, int destProcessId) {
     return this->GatherVoidArray(sendBuffer, recvBuffer, length,
@@ -418,19 +327,6 @@ public:
     return this->GatherVoidArray(sendBuffer, recvBuffer, length,
                                  VTK_ID_TYPE, destProcessId);
   }
-#elif defined(VTK_TYPE_USE_LONG_LONG)
-  int Gather(const long long *sendBuffer, long long *recvBuffer,
-             vtkIdType length, int destProcessId) {
-    return this->GatherVoidArray(sendBuffer, recvBuffer, length,
-                                 VTK_LONG_LONG, destProcessId);
-  }
-#endif
-#ifdef VTK_TYPE_USE_LONG_LONG
-  int Gather(const unsigned long long *sendBuffer, unsigned long long *recvBuffer,
-             vtkIdType length, int destProcessId) {
-    return this->GatherVoidArray(sendBuffer, recvBuffer, length,
-                                 VTK_UNSIGNED_LONG_LONG, destProcessId);
-  }
 #endif
   int Gather(vtkDataArray *sendBuffer, vtkDataArray *recvBuffer,
              int destProcessId);
@@ -452,34 +348,6 @@ public:
                                   sendLength, recvLengths,
                                   offsets, VTK_INT, destProcessId);
   }
-  int GatherV(const unsigned int* sendBuffer, unsigned int* recvBuffer,
-              vtkIdType sendLength, vtkIdType* recvLengths, vtkIdType* offsets,
-              int destProcessId) {
-    return this->GatherVVoidArray(sendBuffer, recvBuffer,
-                                  sendLength, recvLengths,
-                                  offsets, VTK_UNSIGNED_INT, destProcessId);
-  }
-  int GatherV(const short* sendBuffer, short* recvBuffer,
-              vtkIdType sendLength, vtkIdType* recvLengths, vtkIdType* offsets,
-              int destProcessId) {
-    return this->GatherVVoidArray(sendBuffer, recvBuffer,
-                                  sendLength, recvLengths,
-                                  offsets, VTK_SHORT, destProcessId);
-  }
-  int GatherV(const unsigned short* sendBuffer, unsigned short* recvBuffer,
-              vtkIdType sendLength, vtkIdType* recvLengths, vtkIdType* offsets,
-              int destProcessId) {
-    return this->GatherVVoidArray(sendBuffer, recvBuffer,
-                                  sendLength, recvLengths,
-                                  offsets, VTK_UNSIGNED_SHORT, destProcessId);
-  }
-  int GatherV(const long* sendBuffer, long* recvBuffer,
-              vtkIdType sendLength, vtkIdType* recvLengths, vtkIdType* offsets,
-              int destProcessId) {
-    return this->GatherVVoidArray(sendBuffer, recvBuffer,
-                                  sendLength, recvLengths,
-                                  offsets, VTK_LONG, destProcessId);
-  }
   int GatherV(const unsigned long* sendBuffer, unsigned long* recvBuffer,
               vtkIdType sendLength, vtkIdType* recvLengths, vtkIdType* offsets,
               int destProcessId) {
@@ -501,13 +369,6 @@ public:
                                   sendLength, recvLengths,
                                   offsets, VTK_CHAR, destProcessId);
   }
-  int GatherV(const signed char* sendBuffer, signed char* recvBuffer,
-              vtkIdType sendLength, vtkIdType* recvLengths, vtkIdType* offsets,
-              int destProcessId) {
-    return this->GatherVVoidArray(sendBuffer, recvBuffer,
-                                  sendLength, recvLengths,
-                                  offsets, VTK_SIGNED_CHAR, destProcessId);
-  }
   int GatherV(const float* sendBuffer, float* recvBuffer,
               vtkIdType sendLength, vtkIdType* recvLengths, vtkIdType* offsets,
               int destProcessId) {
@@ -530,51 +391,11 @@ public:
                                   sendLength, recvLengths,
                                   offsets, VTK_ID_TYPE, destProcessId);
   }
-#elif defined(VTK_TYPE_USE_LONG_LONG)
-  int GatherV(const long long* sendBuffer, long long* recvBuffer,
-              vtkIdType sendLength, vtkIdType* recvLengths, vtkIdType* offsets,
-              int destProcessId) {
-    return this->GatherVVoidArray(sendBuffer, recvBuffer,
-                                  sendLength, recvLengths,
-                                  offsets, VTK_LONG_LONG, destProcessId);
-  }
 #endif
-#ifdef VTK_TYPE_USE_LONG_LONG
-  int GatherV(const unsigned long long* sendBuffer, unsigned long long* recvBuffer,
-              vtkIdType sendLength, vtkIdType* recvLengths, vtkIdType* offsets,
-              int destProcessId) {
-    return this->GatherVVoidArray(sendBuffer, recvBuffer,
-                                  sendLength, recvLengths,
-                                  offsets, VTK_UNSIGNED_LONG_LONG, destProcessId);
-  }
-#endif
-  // Description:
-  // For the first GatherV variant, \c recvLenghts and \c offsets known on
-  // \c destProcessId and are passed in as parameters
-  // For the second GatherV variant, \c recvLenghts and \c offsets are not known
-  // on \c destProcessId.  The \c recvLenghts is set using a gather operation
-  // and \c offsets is computed from \c recvLenghts. recvLengths has
-  // \c NumberOfProcesses elements and \offsets has NumberOfProcesses + 1 elements.
-  // The third variant is the same as the second variant but it does not expose
-  // \c recvLength and \c offsets
-  int GatherV(vtkDataArray *sendBuffer, vtkDataArray *recvBuffer,
-              vtkIdType *recvLengths, vtkIdType *offsets,
-              int destProcessId);
   int GatherV(vtkDataArray *sendBuffer, vtkDataArray *recvBuffer,
-              vtkIdTypeArray* recvLengths,
-              vtkIdTypeArray* offsets,
-              int destProcessId);
+              vtkIdType *recvLengths, vtkIdType *offsets, int destProcessId);
   int GatherV(vtkDataArray *sendBuffer, vtkDataArray *recvBuffer,
               int destProcessId);
-  // Description:
-  // Collects data objects in the process with id \c
-  // destProcessId.  Each process (including the destination) marshals
-  // and then sends the data object to the destination process.  The
-  // destination process unmarshals and then stores the data objects
-  // in rank order. The \c recvData (on the destination process) must
-  // be of length numProcesses.
-  int GatherV(vtkDataObject* sendData, vtkSmartPointer<vtkDataObject>* recvData,
-              int destProcessId);
 
   // Description:
   // Scatter takes an array in the process with id \c srcProcessId and
@@ -587,26 +408,6 @@ public:
     return this->ScatterVoidArray(sendBuffer, recvBuffer, length,
                                   VTK_INT, srcProcessId);
   }
-  int Scatter(const unsigned int *sendBuffer, unsigned int *recvBuffer,
-             vtkIdType length, int srcProcessId) {
-    return this->ScatterVoidArray(sendBuffer, recvBuffer, length,
-                                  VTK_UNSIGNED_INT, srcProcessId);
-  }
-  int Scatter(const short *sendBuffer, short *recvBuffer,
-             vtkIdType length, int srcProcessId) {
-    return this->ScatterVoidArray(sendBuffer, recvBuffer, length,
-                                  VTK_SHORT, srcProcessId);
-  }
-  int Scatter(const unsigned short *sendBuffer, unsigned short *recvBuffer,
-             vtkIdType length, int srcProcessId) {
-    return this->ScatterVoidArray(sendBuffer, recvBuffer, length,
-                                  VTK_UNSIGNED_SHORT, srcProcessId);
-  }
-  int Scatter(const long *sendBuffer, long *recvBuffer,
-             vtkIdType length, int srcProcessId) {
-    return this->ScatterVoidArray(sendBuffer, recvBuffer, length,
-                                  VTK_INT, srcProcessId);
-  }
   int Scatter(const unsigned long *sendBuffer, unsigned long *recvBuffer,
              vtkIdType length, int srcProcessId) {
     return this->ScatterVoidArray(sendBuffer, recvBuffer, length,
@@ -622,11 +423,6 @@ public:
     return this->ScatterVoidArray(sendBuffer, recvBuffer, length,
                                   VTK_CHAR, srcProcessId);
   }
-  int Scatter(const signed char *sendBuffer, signed char *recvBuffer,
-             vtkIdType length, int srcProcessId) {
-    return this->ScatterVoidArray(sendBuffer, recvBuffer, length,
-                                  VTK_SIGNED_CHAR, srcProcessId);
-  }
   int Scatter(const float *sendBuffer, float *recvBuffer,
              vtkIdType length, int srcProcessId) {
     return this->ScatterVoidArray(sendBuffer, recvBuffer, length,
@@ -643,19 +439,6 @@ public:
     return this->ScatterVoidArray(sendBuffer, recvBuffer, length,
                                   VTK_ID_TYPE, srcProcessId);
   }
-#elif defined(VTK_TYPE_USE_LONG_LONG)
-  int Scatter(const long long *sendBuffer, long long *recvBuffer,
-             vtkIdType length, int srcProcessId) {
-    return this->ScatterVoidArray(sendBuffer, recvBuffer, length,
-                                  VTK_LONG_LONG, srcProcessId);
-  }
-#endif
-#ifdef VTK_TYPE_USE_LONG_LONG
-  int Scatter(const unsigned long long *sendBuffer, unsigned long long *recvBuffer,
-             vtkIdType length, int srcProcessId) {
-    return this->ScatterVoidArray(sendBuffer, recvBuffer, length,
-                                  VTK_UNSIGNED_LONG_LONG, srcProcessId);
-  }
 #endif
   int Scatter(vtkDataArray *sendBuffer, vtkDataArray *recvBuffer,
              int srcProcessId);
@@ -673,34 +456,6 @@ public:
                                    sendLengths, offsets, recvLength,
                                    VTK_INT, srcProcessId);
   }
-  int ScatterV(const unsigned int *sendBuffer, unsigned int *recvBuffer,
-               vtkIdType *sendLengths, vtkIdType *offsets,
-               vtkIdType recvLength, int srcProcessId) {
-    return this->ScatterVVoidArray(sendBuffer, recvBuffer,
-                                   sendLengths, offsets, recvLength,
-                                   VTK_UNSIGNED_INT, srcProcessId);
-  }
-  int ScatterV(const short *sendBuffer, short *recvBuffer,
-               vtkIdType *sendLengths, vtkIdType *offsets,
-               vtkIdType recvLength, int srcProcessId) {
-    return this->ScatterVVoidArray(sendBuffer, recvBuffer,
-                                   sendLengths, offsets, recvLength,
-                                   VTK_SHORT, srcProcessId);
-  }
-  int ScatterV(const unsigned short *sendBuffer, unsigned short *recvBuffer,
-               vtkIdType *sendLengths, vtkIdType *offsets,
-               vtkIdType recvLength, int srcProcessId) {
-    return this->ScatterVVoidArray(sendBuffer, recvBuffer,
-                                   sendLengths, offsets, recvLength,
-                                   VTK_UNSIGNED_SHORT, srcProcessId);
-  }
-  int ScatterV(const long *sendBuffer, long *recvBuffer,
-               vtkIdType *sendLengths, vtkIdType *offsets,
-               vtkIdType recvLength, int srcProcessId) {
-    return this->ScatterVVoidArray(sendBuffer, recvBuffer,
-                                   sendLengths, offsets, recvLength,
-                                   VTK_LONG, srcProcessId);
-  }
   int ScatterV(const unsigned long *sendBuffer, unsigned long *recvBuffer,
                vtkIdType *sendLengths, vtkIdType *offsets,
                vtkIdType recvLength, int srcProcessId) {
@@ -722,13 +477,6 @@ public:
                                    sendLengths, offsets, recvLength,
                                    VTK_CHAR, srcProcessId);
   }
-  int ScatterV(const signed char *sendBuffer, signed char *recvBuffer,
-               vtkIdType *sendLengths, vtkIdType *offsets,
-               vtkIdType recvLength, int srcProcessId) {
-    return this->ScatterVVoidArray(sendBuffer, recvBuffer,
-                                   sendLengths, offsets, recvLength,
-                                   VTK_SIGNED_CHAR, srcProcessId);
-  }
   int ScatterV(const float *sendBuffer, float *recvBuffer,
                vtkIdType *sendLengths, vtkIdType *offsets,
                vtkIdType recvLength, int srcProcessId) {
@@ -751,23 +499,6 @@ public:
                                    sendLengths, offsets, recvLength,
                                    VTK_ID_TYPE, srcProcessId);
   }
-#elif defined(VTK_TYPE_USE_LONG_LONG)
-  int ScatterV(const long long *sendBuffer, long long *recvBuffer,
-               vtkIdType *sendLengths, vtkIdType *offsets,
-               vtkIdType recvLength, int srcProcessId) {
-    return this->ScatterVVoidArray(sendBuffer, recvBuffer,
-                                   sendLengths, offsets, recvLength,
-                                   VTK_LONG_LONG, srcProcessId);
-  }
-#endif
-#ifdef VTK_TYPE_USE_LONG_LONG
-  int ScatterV(const unsigned long long *sendBuffer, unsigned long long *recvBuffer,
-               vtkIdType *sendLengths, vtkIdType *offsets,
-               vtkIdType recvLength, int srcProcessId) {
-    return this->ScatterVVoidArray(sendBuffer, recvBuffer,
-                                   sendLengths, offsets, recvLength,
-                                   VTK_UNSIGNED_LONG_LONG, srcProcessId);
-  }
 #endif
 
   // Description:
@@ -775,22 +506,6 @@ public:
   int AllGather(const int *sendBuffer, int *recvBuffer, vtkIdType length) {
     return this->AllGatherVoidArray(sendBuffer, recvBuffer, length, VTK_INT);
   }
-  int AllGather(const unsigned int *sendBuffer, unsigned int *recvBuffer,
-                vtkIdType length) {
-    return this->AllGatherVoidArray(sendBuffer, recvBuffer, length,
-                                    VTK_UNSIGNED_INT);
-  }
-  int AllGather(const short *sendBuffer, short *recvBuffer, vtkIdType length) {
-    return this->AllGatherVoidArray(sendBuffer, recvBuffer, length, VTK_SHORT);
-  }
-  int AllGather(const unsigned short *sendBuffer, unsigned short *recvBuffer,
-                vtkIdType length) {
-    return this->AllGatherVoidArray(sendBuffer, recvBuffer, length,
-                                    VTK_UNSIGNED_SHORT);
-  }
-  int AllGather(const long *sendBuffer, long *recvBuffer, vtkIdType length) {
-    return this->AllGatherVoidArray(sendBuffer, recvBuffer, length, VTK_LONG);
-  }
   int AllGather(const unsigned long *sendBuffer,
                 unsigned long *recvBuffer, vtkIdType length) {
     return this->AllGatherVoidArray(sendBuffer, recvBuffer, length,
@@ -804,11 +519,6 @@ public:
   int AllGather(const char *sendBuffer, char *recvBuffer, vtkIdType length) {
     return this->AllGatherVoidArray(sendBuffer, recvBuffer, length, VTK_CHAR);
   }
-  int AllGather(const signed char *sendBuffer, signed char *recvBuffer,
-                vtkIdType length) {
-    return this->AllGatherVoidArray(sendBuffer, recvBuffer, length,
-                                    VTK_SIGNED_CHAR);
-  }
   int AllGather(const float *sendBuffer, float *recvBuffer, vtkIdType length) {
     return this->AllGatherVoidArray(sendBuffer, recvBuffer, length, VTK_FLOAT);
   }
@@ -822,19 +532,6 @@ public:
     return this->AllGatherVoidArray(sendBuffer, recvBuffer, length,
                                     VTK_ID_TYPE);
   }
-#elif defined(VTK_TYPE_USE_LONG_LONG)
-  int AllGather(const long long *sendBuffer, long long *recvBuffer,
-                vtkIdType length) {
-    return this->AllGatherVoidArray(sendBuffer, recvBuffer, length,
-                                    VTK_LONG_LONG);
-  }
-#endif
-#ifdef VTK_TYPE_USE_LONG_LONG
-  int AllGather(const unsigned long long *sendBuffer,
-                unsigned long long *recvBuffer, vtkIdType length) {
-    return this->AllGatherVoidArray(sendBuffer, recvBuffer, length,
-                                    VTK_UNSIGNED_LONG_LONG);
-  }
 #endif
   int AllGather(vtkDataArray *sendBuffer, vtkDataArray *recvBuffer);
 
@@ -847,34 +544,6 @@ public:
                                      sendLength, recvLengths,
                                      offsets, VTK_INT);
   }
-  int AllGatherV(const unsigned int* sendBuffer, unsigned int* recvBuffer,
-                 vtkIdType sendLength, vtkIdType* recvLengths,
-                 vtkIdType* offsets) {
-    return this->AllGatherVVoidArray(sendBuffer, recvBuffer,
-                                     sendLength, recvLengths,
-                                     offsets, VTK_UNSIGNED_INT);
-  }
-  int AllGatherV(const short* sendBuffer, short* recvBuffer,
-                 vtkIdType sendLength, vtkIdType* recvLengths,
-                 vtkIdType* offsets) {
-    return this->AllGatherVVoidArray(sendBuffer, recvBuffer,
-                                     sendLength, recvLengths,
-                                     offsets, VTK_SHORT);
-  }
-  int AllGatherV(const unsigned short* sendBuffer, unsigned short* recvBuffer,
-                 vtkIdType sendLength, vtkIdType* recvLengths,
-                 vtkIdType* offsets) {
-    return this->AllGatherVVoidArray(sendBuffer, recvBuffer,
-                                     sendLength, recvLengths,
-                                     offsets, VTK_UNSIGNED_SHORT);
-  }
-  int AllGatherV(const long* sendBuffer, long* recvBuffer,
-                 vtkIdType sendLength, vtkIdType* recvLengths,
-                 vtkIdType* offsets) {
-    return this->AllGatherVVoidArray(sendBuffer, recvBuffer,
-                                     sendLength, recvLengths,
-                                     offsets, VTK_LONG);
-  }
   int AllGatherV(const unsigned long* sendBuffer, unsigned long* recvBuffer,
                  vtkIdType sendLength, vtkIdType* recvLengths,
                  vtkIdType* offsets) {
@@ -896,13 +565,6 @@ public:
                                      sendLength, recvLengths,
                                      offsets, VTK_CHAR);
   }
-  int AllGatherV(const signed char* sendBuffer, signed char* recvBuffer,
-                 vtkIdType sendLength, vtkIdType* recvLengths,
-                 vtkIdType* offsets) {
-    return this->AllGatherVVoidArray(sendBuffer, recvBuffer,
-                                     sendLength, recvLengths,
-                                     offsets, VTK_UNSIGNED_CHAR);
-  }
   int AllGatherV(const float* sendBuffer, float* recvBuffer,
                  vtkIdType sendLength, vtkIdType* recvLengths,
                  vtkIdType* offsets) {
@@ -925,23 +587,6 @@ public:
                                      sendLength, recvLengths,
                                      offsets, VTK_ID_TYPE);
   }
-#elif defined(VTK_TYPE_USE_LONG_LONG)
-  int AllGatherV(const long long* sendBuffer, long long* recvBuffer,
-                 vtkIdType sendLength, vtkIdType* recvLengths,
-                 vtkIdType* offsets) {
-    return this->AllGatherVVoidArray(sendBuffer, recvBuffer,
-                                     sendLength, recvLengths,
-                                     offsets, VTK_LONG_LONG);
-  }
-#endif
-#ifdef VTK_TYPE_USE_LONG_LONG
-  int AllGatherV(const unsigned long long* sendBuffer, unsigned long long* recvBuffer,
-                 vtkIdType sendLength, vtkIdType* recvLengths,
-                 vtkIdType* offsets) {
-    return this->AllGatherVVoidArray(sendBuffer, recvBuffer,
-                                     sendLength, recvLengths,
-                                     offsets, VTK_UNSIGNED_LONG_LONG);
-  }
 #endif
   int AllGatherV(vtkDataArray *sendBuffer, vtkDataArray *recvBuffer,
                  vtkIdType *recvLengths, vtkIdType *offsets);
@@ -961,21 +606,6 @@ public:
     return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
                                  VTK_UNSIGNED_INT, operation, destProcessId);
   }
-  int Reduce(const short *sendBuffer, short *recvBuffer,
-             vtkIdType length, int operation, int destProcessId) {
-    return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
-                                 VTK_SHORT, operation, destProcessId);
-  }
-  int Reduce(const unsigned short *sendBuffer, unsigned short *recvBuffer,
-             vtkIdType length, int operation, int destProcessId) {
-    return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
-                                 VTK_UNSIGNED_SHORT, operation, destProcessId);
-  }
-  int Reduce(const long *sendBuffer, long *recvBuffer,
-             vtkIdType length, int operation, int destProcessId) {
-    return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
-                                 VTK_LONG, operation, destProcessId);
-  }
   int Reduce(const unsigned long *sendBuffer, unsigned long *recvBuffer,
              vtkIdType length, int operation, int destProcessId) {
     return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
@@ -991,11 +621,6 @@ public:
     return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
                                  VTK_CHAR, operation, destProcessId);
   }
-  int Reduce(const signed char *sendBuffer, signed char *recvBuffer,
-             vtkIdType length, int operation, int destProcessId) {
-    return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
-                                 VTK_SIGNED_CHAR, operation, destProcessId);
-  }
   int Reduce(const float *sendBuffer, float *recvBuffer,
              vtkIdType length, int operation, int destProcessId) {
     return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
@@ -1012,19 +637,6 @@ public:
     return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
                                  VTK_ID_TYPE, operation, destProcessId);
   }
-#elif defined(VTK_TYPE_USE_LONG_LONG)
-  int Reduce(const long long *sendBuffer, long long *recvBuffer,
-             vtkIdType length, int operation, int destProcessId) {
-    return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
-                                 VTK_LONG_LONG, operation, destProcessId);
-  }
-#endif
-#ifdef VTK_TYPE_USE_LONG_LONG
-  int Reduce(const unsigned long long *sendBuffer, unsigned long long *recvBuffer,
-             vtkIdType length, int operation, int destProcessId) {
-    return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
-                                 VTK_UNSIGNED_LONG_LONG, operation, destProcessId);
-  }
 #endif
   int Reduce(vtkDataArray *sendBuffer, vtkDataArray *recvBuffer,
              int operation, int destProcessId);
@@ -1037,26 +649,6 @@ public:
     return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
                                  VTK_INT, operation, destProcessId);
   }
-  int Reduce(const unsigned int *sendBuffer, unsigned int *recvBuffer,
-             vtkIdType length, Operation *operation, int destProcessId) {
-    return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
-                                 VTK_UNSIGNED_INT, operation, destProcessId);
-  }
-  int Reduce(const short *sendBuffer, short *recvBuffer,
-             vtkIdType length, Operation *operation, int destProcessId) {
-    return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
-                                 VTK_SHORT, operation, destProcessId);
-  }
-  int Reduce(const unsigned short *sendBuffer, unsigned short *recvBuffer,
-             vtkIdType length, Operation *operation, int destProcessId) {
-    return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
-                                 VTK_UNSIGNED_SHORT, operation, destProcessId);
-  }
-  int Reduce(const long *sendBuffer, long *recvBuffer,
-             vtkIdType length, Operation *operation, int destProcessId) {
-    return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
-                                 VTK_LONG, operation, destProcessId);
-  }
   int Reduce(const unsigned long *sendBuffer, unsigned long *recvBuffer,
              vtkIdType length, Operation *operation, int destProcessId) {
     return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
@@ -1072,11 +664,6 @@ public:
     return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
                                  VTK_CHAR, operation, destProcessId);
   }
-  int Reduce(const signed char *sendBuffer, signed char *recvBuffer,
-             vtkIdType length, Operation *operation, int destProcessId) {
-    return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
-                                 VTK_SIGNED_CHAR, operation, destProcessId);
-  }
   int Reduce(const float *sendBuffer, float *recvBuffer,
              vtkIdType length, Operation *operation, int destProcessId) {
     return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
@@ -1093,19 +680,6 @@ public:
     return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
                                  VTK_ID_TYPE, operation, destProcessId);
   }
-#elif defined(VTK_TYPE_USE_LONG_LONG)
-  int Reduce(const long long *sendBuffer, long long *recvBuffer,
-             vtkIdType length, Operation *operation, int destProcessId) {
-    return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
-                                 VTK_LONG_LONG, operation, destProcessId);
-  }
-#endif
-#ifdef VTK_TYPE_USE_LONG_LONG
-  int Reduce(const unsigned long long *sendBuffer, unsigned long long *recvBuffer,
-             vtkIdType length, Operation *operation, int destProcessId) {
-    return this->ReduceVoidArray(sendBuffer, recvBuffer, length,
-                                 VTK_UNSIGNED_LONG_LONG, operation, destProcessId);
-  }
 #endif
   int Reduce(vtkDataArray *sendBuffer, vtkDataArray *recvBuffer,
              Operation *operation, int destProcessId);
@@ -1117,26 +691,6 @@ public:
     return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
                                     VTK_INT, operation);
   }
-  int AllReduce(const unsigned int *sendBuffer, unsigned int *recvBuffer,
-                vtkIdType length, int operation) {
-    return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
-                                    VTK_UNSIGNED_INT, operation);
-  }
-  int AllReduce(const short *sendBuffer, short *recvBuffer,
-                vtkIdType length, int operation) {
-    return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
-                                    VTK_SHORT, operation);
-  }
-  int AllReduce(const unsigned short *sendBuffer, unsigned short *recvBuffer,
-                vtkIdType length, int operation) {
-    return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
-                                    VTK_UNSIGNED_SHORT, operation);
-  }
-  int AllReduce(const long *sendBuffer, long *recvBuffer,
-                vtkIdType length, int operation) {
-    return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
-                                    VTK_LONG, operation);
-  }
   int AllReduce(const unsigned long *sendBuffer, unsigned long *recvBuffer,
                 vtkIdType length, int operation) {
     return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
@@ -1152,11 +706,6 @@ public:
     return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
                                     VTK_CHAR, operation);
   }
-  int AllReduce(const signed char *sendBuffer, signed char *recvBuffer,
-                vtkIdType length, int operation) {
-    return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
-                                    VTK_SIGNED_CHAR, operation);
-  }
   int AllReduce(const float *sendBuffer, float *recvBuffer,
                 vtkIdType length, int operation) {
     return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
@@ -1173,19 +722,6 @@ public:
     return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
                                     VTK_ID_TYPE, operation);
   }
-#elif defined(VTK_TYPE_USE_LONG_LONG)
-  int AllReduce(const long long *sendBuffer, long long *recvBuffer,
-                vtkIdType length, int operation) {
-    return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
-                                    VTK_LONG_LONG, operation);
-  }
-#endif
-#ifdef VTK_TYPE_USE_LONG_LONG
-  int AllReduce(const unsigned long long *sendBuffer, unsigned long long *recvBuffer,
-                vtkIdType length, int operation) {
-    return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
-                                    VTK_UNSIGNED_LONG_LONG, operation);
-  }
 #endif
   int AllReduce(vtkDataArray *sendBuffer, vtkDataArray *recvBuffer,
                 int operation);
@@ -1194,26 +730,6 @@ public:
     return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
                                     VTK_INT, operation);
   }
-  int AllReduce(const unsigned int *sendBuffer, unsigned int *recvBuffer,
-                vtkIdType length, Operation *operation) {
-    return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
-                                    VTK_UNSIGNED_INT, operation);
-  }
-  int AllReduce(const short *sendBuffer, short *recvBuffer,
-                vtkIdType length, Operation *operation) {
-    return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
-                                    VTK_SHORT, operation);
-  }
-  int AllReduce(const unsigned short *sendBuffer, unsigned short *recvBuffer,
-                vtkIdType length, Operation *operation) {
-    return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
-                                    VTK_UNSIGNED_SHORT, operation);
-  }
-  int AllReduce(const long *sendBuffer, long *recvBuffer,
-                vtkIdType length, Operation *operation) {
-    return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
-                                    VTK_LONG, operation);
-  }
   int AllReduce(const unsigned long *sendBuffer, unsigned long *recvBuffer,
                 vtkIdType length, Operation *operation) {
     return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
@@ -1229,11 +745,6 @@ public:
     return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
                                     VTK_CHAR, operation);
   }
-  int AllReduce(const signed char *sendBuffer, signed char *recvBuffer,
-                vtkIdType length, Operation *operation) {
-    return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
-                                    VTK_SIGNED_CHAR, operation);
-  }
   int AllReduce(const float *sendBuffer, float *recvBuffer,
                 vtkIdType length, Operation *operation) {
     return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
@@ -1250,19 +761,6 @@ public:
     return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
                                     VTK_ID_TYPE, operation);
   }
-#elif defined(VTK_TYPE_USE_LONG_LONG)
-  int AllReduce(const long long *sendBuffer, long long *recvBuffer,
-                vtkIdType length, Operation *operation) {
-    return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
-                                    VTK_LONG_LONG, operation);
-  }
-#endif
-#ifdef VTK_TYPE_USE_LONG_LONG
-  int AllReduce(const unsigned long long *sendBuffer, unsigned long long *recvBuffer,
-                vtkIdType length, Operation *operation) {
-    return this->AllReduceVoidArray(sendBuffer, recvBuffer, length,
-                                    VTK_UNSIGNED_LONG_LONG, operation);
-  }
 #endif
   int AllReduce(vtkDataArray *sendBuffer, vtkDataArray *recvBuffer,
                 Operation *operation);
@@ -1347,19 +845,6 @@ protected:
 
   // Internal methods called by Send/Receive(vtkDataObject *... ) above.
   int SendElementalDataObject(vtkDataObject* data, int remoteHandle, int tag);
-  // Description:
-  // GatherV collects arrays in the process with id \c destProcessId.
-  // Each process (including the destination) sends its sendArray to
-  // the destination process.  The destination process receives the
-  // arrays and stores them in rank order in recvArrays.  The \c recvArays is an
-  // array containing  \c NumberOfProcesses elements. The \c recvArray allocates
-  // and manages memory for \c recvArrays.
-  int GatherV(vtkDataArray *sendArray, vtkDataArray* recvArray,
-              vtkSmartPointer<vtkDataArray>* recvArrays, int destProcessId);
-  int GatherVElementalDataObject(vtkDataObject* sendData,
-                                 vtkSmartPointer<vtkDataObject>* receiveData,
-                                 int destProcessId);
-
   int ReceiveDataObject(vtkDataObject* data,
                         int remoteHandle, int tag, int type=-1);
   int ReceiveElementalDataObject(vtkDataObject* data,
@@ -1382,4 +867,5 @@ private:
 };
 
 #endif // vtkCommunicator_h
-// VTK-HeaderTest-Exclude: vtkCommunicator.h
+
+
diff --git a/Parallel/Core/vtkMultiProcessController.cxx b/Parallel/Core/vtkMultiProcessController.cxx
index 8cd8069..98c7a77 100644
--- a/Parallel/Core/vtkMultiProcessController.cxx
+++ b/Parallel/Core/vtkMultiProcessController.cxx
@@ -547,8 +547,11 @@ int vtkMultiProcessController::BroadcastProcessRMIs(
 
     this->ProcessRMI(0 /*we broadcast from rank 0*/, arg, argLength,rmiTag);
 
-    delete [] arg;
-    arg = NULL;
+    if( arg != NULL )
+      {
+      delete [] arg;
+      arg = NULL;
+      }
 
     // check for break
     if (this->BreakFlag)
@@ -715,8 +718,11 @@ int vtkMultiProcessController::ProcessRMIs(int reportErrors, int dont_loop)
       }
     this->ProcessRMI(triggerMessage[2], arg, triggerMessage[1],
       triggerMessage[0]);
-    delete [] arg;
-    arg = NULL;
+    if (arg)
+      {
+      delete [] arg;
+      arg = NULL;
+      }
 
     // check for break
     if (this->BreakFlag)
diff --git a/Parallel/Core/vtkMultiProcessController.h b/Parallel/Core/vtkMultiProcessController.h
index 7e43d30..842ebc1 100644
--- a/Parallel/Core/vtkMultiProcessController.h
+++ b/Parallel/Core/vtkMultiProcessController.h
@@ -355,25 +355,15 @@ public:
   // vtkMultiProcessController has reserved tags between 1 and 4.
   // vtkCommunicator has reserved tags between 10 and 16.
   int Send(const int* data, vtkIdType length, int remoteProcessId, int tag);
-  int Send(const short* data, vtkIdType length, int remoteProcessId, int tag);
-  int Send(const unsigned short* data, vtkIdType length, int remoteProcessId, int tag);
   int Send(const unsigned int* data, vtkIdType length, int remoteProcessId, int tag);
   int Send(const unsigned long* data, vtkIdType length, int remoteProcessId,
            int tag);
-  int Send(const long* data, vtkIdType length, int remoteProcessId,
-           int tag);
-  int Send(const signed char* data, vtkIdType length, int remoteProcessId, int tag);
   int Send(const char* data, vtkIdType length, int remoteProcessId, int tag);
   int Send(const unsigned char* data, vtkIdType length, int remoteProcessId, int tag);
   int Send(const float* data, vtkIdType length, int remoteProcessId, int tag);
   int Send(const double* data, vtkIdType length, int remoteProcessId, int tag);
 #ifdef VTK_USE_64BIT_IDS
   int Send(const vtkIdType* data, vtkIdType length, int remoteProcessId, int tag);
-#elif defined(VTK_TYPE_USE_LONG_LONG)
-  int Send(const long long* data, vtkIdType length, int remoteProcessId, int tag);
-#endif
-#ifdef VTK_TYPE_USE_LONG_LONG
-  int Send(const unsigned long long* data, vtkIdType length, int remoteProcessId, int tag);
 #endif
   int Send(vtkDataObject *data, int remoteId, int tag);
   int Send(vtkDataArray *data, int remoteId, int tag);
@@ -398,23 +388,14 @@ public:
   // GetCount() method to determine the actual size of the data received.
   int Receive(int* data, vtkIdType maxlength, int remoteProcessId, int tag);
   int Receive(unsigned int* data, vtkIdType maxlength, int remoteProcessId, int tag);
-  int Receive(short* data, vtkIdType maxlength, int remoteProcessId, int tag);
-  int Receive(unsigned short* data, vtkIdType maxlength, int remoteProcessId, int tag);
-  int Receive(long* data, vtkIdType maxlength, int remoteProcessId, int tag);
   int Receive(unsigned long* data, vtkIdType maxlength, int remoteProcessId,
               int tag);
   int Receive(char* data, vtkIdType maxlength, int remoteProcessId, int tag);
   int Receive(unsigned char* data, vtkIdType maxlength, int remoteProcessId, int tag);
-  int Receive(signed char* data, vtkIdType maxlength, int remoteProcessId, int tag);
   int Receive(float* data, vtkIdType maxlength, int remoteProcessId, int tag);
   int Receive(double* data, vtkIdType maxlength, int remoteProcessId, int tag);
 #ifdef VTK_USE_64BIT_IDS
   int Receive(vtkIdType* data, vtkIdType maxlength, int remoteProcessId, int tag);
-#elif defined(VTK_TYPE_USE_LONG_LONG)
-  int Receive(long long* data, vtkIdType maxLength, int remoteProcessId, int tag);
-#endif
-#ifdef VTK_TYPE_USE_LONG_LONG
-  int Receive(unsigned long long* data, vtkIdType maxLength, int remoteProcessId, int tag);
 #endif
   int Receive(vtkDataObject* data, int remoteId, int tag);
   int Receive(vtkDataArray* data, int remoteId, int tag);
@@ -447,15 +428,6 @@ public:
   int Broadcast(unsigned int *data, vtkIdType length, int srcProcessId) {
     return this->Communicator->Broadcast(data, length, srcProcessId);
   }
-  int Broadcast(short *data, vtkIdType length, int srcProcessId) {
-    return this->Communicator->Broadcast(data, length, srcProcessId);
-  }
-  int Broadcast(unsigned short *data, vtkIdType length, int srcProcessId) {
-    return this->Communicator->Broadcast(data, length, srcProcessId);
-  }
-  int Broadcast(long *data, vtkIdType length, int srcProcessId) {
-    return this->Communicator->Broadcast(data, length, srcProcessId);
-  }
   int Broadcast(unsigned long *data, vtkIdType length, int srcProcessId) {
     return this->Communicator->Broadcast(data, length, srcProcessId);
   }
@@ -465,9 +437,6 @@ public:
   int Broadcast(char *data, vtkIdType length, int srcProcessId) {
     return this->Communicator->Broadcast(data, length, srcProcessId);
   }
-  int Broadcast(signed char *data, vtkIdType length, int srcProcessId) {
-    return this->Communicator->Broadcast(data, length, srcProcessId);
-  }
   int Broadcast(float *data, vtkIdType length, int srcProcessId) {
     return this->Communicator->Broadcast(data, length, srcProcessId);
   }
@@ -478,15 +447,6 @@ public:
   int Broadcast(vtkIdType *data, vtkIdType length, int srcProcessId) {
     return this->Communicator->Broadcast(data, length, srcProcessId);
   }
-#elif defined(VTK_TYPE_USE_LONG_LONG)
-  int Broadcast(long long *data, vtkIdType length, int srcProcessId) {
-    return this->Communicator->Broadcast(data, length, srcProcessId);
-  }
-#endif
-#ifdef VTK_TYPE_USE_LONG_LONG
-  int Broadcast(unsigned long long *data, vtkIdType length, int srcProcessId) {
-    return this->Communicator->Broadcast(data, length, srcProcessId);
-  }
 #endif
   int Broadcast(vtkDataObject *data, int srcProcessId) {
     return this->Communicator->Broadcast(data, srcProcessId);
@@ -513,26 +473,6 @@ public:
     return this->Communicator->Gather(sendBuffer, recvBuffer, length,
                                       destProcessId);
   }
-  int Gather(const unsigned int *sendBuffer, unsigned int *recvBuffer,
-             vtkIdType length, int destProcessId) {
-    return this->Communicator->Gather(sendBuffer, recvBuffer, length,
-                                      destProcessId);
-  }
-  int Gather(const short *sendBuffer, short *recvBuffer,
-             vtkIdType length, int destProcessId) {
-    return this->Communicator->Gather(sendBuffer, recvBuffer, length,
-                                      destProcessId);
-  }
-  int Gather(const unsigned short *sendBuffer, unsigned short *recvBuffer,
-             vtkIdType length, int destProcessId) {
-    return this->Communicator->Gather(sendBuffer, recvBuffer, length,
-                                      destProcessId);
-  }
-  int Gather(const long *sendBuffer, long *recvBuffer,
-             vtkIdType length, int destProcessId) {
-    return this->Communicator->Gather(sendBuffer, recvBuffer, length,
-                                      destProcessId);
-  }
   int Gather(const unsigned long *sendBuffer, unsigned long *recvBuffer,
              vtkIdType length, int destProcessId) {
     return this->Communicator->Gather(sendBuffer, recvBuffer, length,
@@ -548,11 +488,6 @@ public:
     return this->Communicator->Gather(sendBuffer, recvBuffer, length,
                                       destProcessId);
   }
-  int Gather(const signed char *sendBuffer, signed char *recvBuffer,
-             vtkIdType length, int destProcessId) {
-    return this->Communicator->Gather(sendBuffer, recvBuffer, length,
-                                      destProcessId);
-  }
   int Gather(const float *sendBuffer, float *recvBuffer,
              vtkIdType length, int destProcessId) {
     return this->Communicator->Gather(sendBuffer, recvBuffer, length,
@@ -569,19 +504,6 @@ public:
     return this->Communicator->Gather(sendBuffer, recvBuffer, length,
                                       destProcessId);
   }
-#elif defined(VTK_TYPE_USE_LONG_LONG)
-  int Gather(const long long *sendBuffer, long long *recvBuffer,
-             vtkIdType length, int destProcessId) {
-    return this->Communicator->Gather(sendBuffer, recvBuffer, length,
-                                      destProcessId);
-  }
-#endif
-#ifdef VTK_TYPE_USE_LONG_LONG
-  int Gather(const unsigned long long *sendBuffer, unsigned long long *recvBuffer,
-             vtkIdType length, int destProcessId) {
-    return this->Communicator->Gather(sendBuffer, recvBuffer, length,
-                                      destProcessId);
-  }
 #endif
   int Gather(vtkDataArray *sendBuffer, vtkDataArray *recvBuffer,
              int destProcessId) {
@@ -605,34 +527,6 @@ public:
                                        sendLength, recvLengths,
                                        offsets, destProcessId);
   }
-  int GatherV(const unsigned int* sendBuffer, unsigned int* recvBuffer,
-              vtkIdType sendLength, vtkIdType* recvLengths, vtkIdType* offsets,
-              int destProcessId) {
-    return this->Communicator->GatherV(sendBuffer, recvBuffer,
-                                       sendLength, recvLengths,
-                                       offsets, destProcessId);
-  }
-  int GatherV(const short* sendBuffer, short* recvBuffer,
-              vtkIdType sendLength, vtkIdType* recvLengths, vtkIdType* offsets,
-              int destProcessId) {
-    return this->Communicator->GatherV(sendBuffer, recvBuffer,
-                                       sendLength, recvLengths,
-                                       offsets, destProcessId);
-  }
-  int GatherV(const unsigned short* sendBuffer, unsigned short* recvBuffer,
-              vtkIdType sendLength, vtkIdType* recvLengths, vtkIdType* offsets,
-              int destProcessId) {
-    return this->Communicator->GatherV(sendBuffer, recvBuffer,
-                                       sendLength, recvLengths,
-                                       offsets, destProcessId);
-  }
-  int GatherV(const long* sendBuffer, long* recvBuffer,
-              vtkIdType sendLength, vtkIdType* recvLengths, vtkIdType* offsets,
-              int destProcessId) {
-    return this->Communicator->GatherV(sendBuffer, recvBuffer,
-                                       sendLength, recvLengths,
-                                       offsets, destProcessId);
-  }
   int GatherV(const unsigned long* sendBuffer, unsigned long* recvBuffer,
               vtkIdType sendLength, vtkIdType* recvLengths, vtkIdType* offsets,
               int destProcessId) {
@@ -654,13 +548,6 @@ public:
                                        sendLength, recvLengths,
                                        offsets, destProcessId);
   }
-  int GatherV(const signed char* sendBuffer, signed char* recvBuffer,
-              vtkIdType sendLength, vtkIdType* recvLengths, vtkIdType* offsets,
-              int destProcessId) {
-    return this->Communicator->GatherV(sendBuffer, recvBuffer,
-                                       sendLength, recvLengths,
-                                       offsets, destProcessId);
-  }
   int GatherV(const float* sendBuffer, float* recvBuffer,
               vtkIdType sendLength, vtkIdType* recvLengths, vtkIdType* offsets,
               int destProcessId) {
@@ -683,24 +570,6 @@ public:
                                        sendLength, recvLengths,
                                        offsets, destProcessId);
   }
-#elif defined(VTK_TYPE_USE_LONG_LONG)
-  int GatherV(const long long* sendBuffer, long long* recvBuffer,
-              vtkIdType sendLength, vtkIdType* recvLengths, vtkIdType* offsets,
-              int destProcessId) {
-    return this->Communicator->GatherV(sendBuffer, recvBuffer,
-                                       sendLength, recvLengths,
-                                       offsets, destProcessId);
-  }
-#endif
-#ifdef VTK_TYPE_USE_LONG_LONG
-  int GatherV(const unsigned long long* sendBuffer, unsigned long long* recvBuffer,
-              vtkIdType sendLength, vtkIdType* recvLengths, vtkIdType* offsets,
-              int destProcessId) {
-    return this->Communicator->GatherV(sendBuffer, recvBuffer,
-                                       sendLength, recvLengths,
-                                       offsets, destProcessId);
-  }
-
 #endif
   int GatherV(vtkDataArray *sendBuffer, vtkDataArray *recvBuffer,
               vtkIdType *recvLengths, vtkIdType *offsets, int destProcessId) {
@@ -708,15 +577,6 @@ public:
                                        recvLengths, offsets,
                                        destProcessId);
   }
-  int GatherV(vtkDataArray *sendBuffer, vtkDataArray *recvBuffer,
-              vtkIdTypeArray* recvLengths,
-              vtkIdTypeArray* offsets,
-              int destProcessId)
-  {
-    return this->Communicator->GatherV(sendBuffer, recvBuffer,
-                                       recvLengths, offsets, destProcessId);
-  }
-
 
   // Description:
   // This special form of GatherV will automatically determine \c recvLengths
@@ -727,11 +587,6 @@ public:
               int destProcessId) {
     return this->Communicator->GatherV(sendBuffer, recvBuffer, destProcessId);
   }
-  int GatherV(vtkDataObject* sendData, vtkSmartPointer<vtkDataObject>* recvData,
-              int destProcessId)
-  {
-    return this->Communicator->GatherV(sendData, recvData, destProcessId);
-  }
 
   // Description:
   // Scatter takes an array in the process with id \c srcProcessId and
@@ -744,26 +599,6 @@ public:
     return this->Communicator->Scatter(sendBuffer, recvBuffer, length,
                                        srcProcessId);
   }
-  int Scatter(const unsigned int *sendBuffer, unsigned int *recvBuffer,
-              vtkIdType length, int srcProcessId) {
-    return this->Communicator->Scatter(sendBuffer, recvBuffer, length,
-                                       srcProcessId);
-  }
-  int Scatter(const short *sendBuffer, short *recvBuffer,
-              vtkIdType length, int srcProcessId) {
-    return this->Communicator->Scatter(sendBuffer, recvBuffer, length,
-                                       srcProcessId);
-  }
-  int Scatter(const unsigned short *sendBuffer, unsigned short *recvBuffer,
-              vtkIdType length, int srcProcessId) {
-    return this->Communicator->Scatter(sendBuffer, recvBuffer, length,
-                                       srcProcessId);
-  }
-  int Scatter(const long *sendBuffer, long *recvBuffer,
-              vtkIdType length, int srcProcessId) {
-    return this->Communicator->Scatter(sendBuffer, recvBuffer, length,
-                                       srcProcessId);
-  }
   int Scatter(const unsigned long *sendBuffer, unsigned long *recvBuffer,
               vtkIdType length, int srcProcessId) {
     return this->Communicator->Scatter(sendBuffer, recvBuffer, length,
@@ -779,11 +614,6 @@ public:
     return this->Communicator->Scatter(sendBuffer, recvBuffer, length,
                                        srcProcessId);
   }
-  int Scatter(const signed char *sendBuffer, signed char *recvBuffer,
-              vtkIdType length, int srcProcessId) {
-    return this->Communicator->Scatter(sendBuffer, recvBuffer, length,
-                                       srcProcessId);
-  }
   int Scatter(const float *sendBuffer, float *recvBuffer,
               vtkIdType length, int srcProcessId) {
     return this->Communicator->Scatter(sendBuffer, recvBuffer, length,
@@ -800,19 +630,6 @@ public:
     return this->Communicator->Scatter(sendBuffer, recvBuffer, length,
                                        srcProcessId);
   }
-#elif defined(VTK_TYPE_USE_LONG_LONG)
-  int Scatter(const long long *sendBuffer, long long *recvBuffer,
-              vtkIdType length, int srcProcessId) {
-    return this->Communicator->Scatter(sendBuffer, recvBuffer, length,
-                                       srcProcessId);
-  }
-#endif
-#ifdef VTK_TYPE_USE_LONG_LONG
-  int Scatter(const unsigned long long *sendBuffer, unsigned long long *recvBuffer,
-              vtkIdType length, int srcProcessId) {
-    return this->Communicator->Scatter(sendBuffer, recvBuffer, length,
-                                       srcProcessId);
-  }
 #endif
   int Scatter(vtkDataArray *sendBuffer, vtkDataArray *recvBuffer,
               int srcProcessId) {
@@ -832,34 +649,6 @@ public:
                                         sendLengths, offsets, recvLength,
                                         srcProcessId);
   }
-  int ScatterV(const unsigned int *sendBuffer, unsigned int *recvBuffer,
-               vtkIdType *sendLengths, vtkIdType *offsets,
-               vtkIdType recvLength, int srcProcessId) {
-    return this->Communicator->ScatterV(sendBuffer, recvBuffer,
-                                        sendLengths, offsets, recvLength,
-                                        srcProcessId);
-  }
-  int ScatterV(const short *sendBuffer, short *recvBuffer,
-               vtkIdType *sendLengths, vtkIdType *offsets,
-               vtkIdType recvLength, int srcProcessId) {
-    return this->Communicator->ScatterV(sendBuffer, recvBuffer,
-                                        sendLengths, offsets, recvLength,
-                                        srcProcessId);
-  }
-  int ScatterV(const unsigned short *sendBuffer, unsigned short *recvBuffer,
-               vtkIdType *sendLengths, vtkIdType *offsets,
-               vtkIdType recvLength, int srcProcessId) {
-    return this->Communicator->ScatterV(sendBuffer, recvBuffer,
-                                        sendLengths, offsets, recvLength,
-                                        srcProcessId);
-  }
-  int ScatterV(const long *sendBuffer, long *recvBuffer,
-               vtkIdType *sendLengths, vtkIdType *offsets,
-               vtkIdType recvLength, int srcProcessId) {
-    return this->Communicator->ScatterV(sendBuffer, recvBuffer,
-                                        sendLengths, offsets, recvLength,
-                                        srcProcessId);
-  }
   int ScatterV(const unsigned long *sendBuffer, unsigned long *recvBuffer,
                vtkIdType *sendLengths, vtkIdType *offsets,
                vtkIdType recvLength, int srcProcessId) {
@@ -881,13 +670,6 @@ public:
                                         sendLengths, offsets, recvLength,
                                         srcProcessId);
   }
-  int ScatterV(const signed char *sendBuffer, signed char *recvBuffer,
-               vtkIdType *sendLengths, vtkIdType *offsets,
-               vtkIdType recvLength, int srcProcessId) {
-    return this->Communicator->ScatterV(sendBuffer, recvBuffer,
-                                        sendLengths, offsets, recvLength,
-                                        srcProcessId);
-  }
   int ScatterV(const float *sendBuffer, float *recvBuffer,
                vtkIdType *sendLengths, vtkIdType *offsets,
                vtkIdType recvLength, int srcProcessId) {
@@ -910,23 +692,6 @@ public:
                                         sendLengths, offsets, recvLength,
                                         srcProcessId);
   }
-#elif defined(VTK_TYPE_USE_LONG_LONG)
-  int ScatterV(const long long *sendBuffer, long long *recvBuffer,
-               vtkIdType *sendLengths, vtkIdType *offsets,
-               vtkIdType recvLength, int srcProcessId) {
-    return this->Communicator->ScatterV(sendBuffer, recvBuffer,
-                                        sendLengths, offsets, recvLength,
-                                        srcProcessId);
-  }
-#endif
-#ifdef VTK_TYPE_USE_LONG_LONG
-  int ScatterV(const unsigned long long *sendBuffer, unsigned long long *recvBuffer,
-               vtkIdType *sendLengths, vtkIdType *offsets,
-               vtkIdType recvLength, int srcProcessId) {
-    return this->Communicator->ScatterV(sendBuffer, recvBuffer,
-                                        sendLengths, offsets, recvLength,
-                                        srcProcessId);
-  }
 #endif
 
   // Description:
@@ -934,18 +699,6 @@ public:
   int AllGather(const int *sendBuffer, int *recvBuffer, vtkIdType length) {
     return this->Communicator->AllGather(sendBuffer, recvBuffer, length);
   }
-  int AllGather(const unsigned int *sendBuffer, unsigned int *recvBuffer, vtkIdType length) {
-    return this->Communicator->AllGather(sendBuffer, recvBuffer, length);
-  }
-  int AllGather(const short *sendBuffer, short *recvBuffer, vtkIdType length) {
-    return this->Communicator->AllGather(sendBuffer, recvBuffer, length);
-  }
-  int AllGather(const unsigned short *sendBuffer, unsigned short *recvBuffer, vtkIdType length) {
-    return this->Communicator->AllGather(sendBuffer, recvBuffer, length);
-  }
-  int AllGather(const long *sendBuffer, long *recvBuffer, vtkIdType length) {
-    return this->Communicator->AllGather(sendBuffer, recvBuffer, length);
-  }
   int AllGather(const unsigned long *sendBuffer,
                 unsigned long *recvBuffer, vtkIdType length) {
     return this->Communicator->AllGather(sendBuffer, recvBuffer, length);
@@ -957,9 +710,6 @@ public:
   int AllGather(const char *sendBuffer, char *recvBuffer, vtkIdType length) {
     return this->Communicator->AllGather(sendBuffer, recvBuffer, length);
   }
-  int AllGather(const signed char *sendBuffer, signed char *recvBuffer, vtkIdType length) {
-    return this->Communicator->AllGather(sendBuffer, recvBuffer, length);
-  }
   int AllGather(const float *sendBuffer, float *recvBuffer, vtkIdType length) {
     return this->Communicator->AllGather(sendBuffer, recvBuffer, length);
   }
@@ -972,15 +722,6 @@ public:
                 vtkIdType length) {
     return this->Communicator->AllGather(sendBuffer, recvBuffer, length);
   }
-#elif defined(VTK_TYPE_USE_LONG_LONG)
-  int AllGather(const long long *sendBuffer, long long *recvBuffer, vtkIdType length) {
-    return this->Communicator->AllGather(sendBuffer, recvBuffer, length);
-  }
-#endif
-#ifdef VTK_TYPE_USE_LONG_LONG
-  int AllGather(const unsigned long long *sendBuffer, unsigned long long *recvBuffer, vtkIdType length) {
-    return this->Communicator->AllGather(sendBuffer, recvBuffer, length);
-  }
 #endif
   int AllGather(vtkDataArray *sendBuffer, vtkDataArray *recvBuffer) {
     return this->Communicator->AllGather(sendBuffer, recvBuffer);
@@ -995,34 +736,6 @@ public:
                                           sendLength, recvLengths,
                                           offsets);
   }
-  int AllGatherV(const unsigned int* sendBuffer, unsigned int* recvBuffer,
-                 vtkIdType sendLength, vtkIdType* recvLengths,
-                 vtkIdType* offsets) {
-    return this->Communicator->AllGatherV(sendBuffer, recvBuffer,
-                                          sendLength, recvLengths,
-                                          offsets);
-  }
-  int AllGatherV(const short* sendBuffer, short* recvBuffer,
-                 vtkIdType sendLength, vtkIdType* recvLengths,
-                 vtkIdType* offsets) {
-    return this->Communicator->AllGatherV(sendBuffer, recvBuffer,
-                                          sendLength, recvLengths,
-                                          offsets);
-  }
-  int AllGatherV(const unsigned short* sendBuffer, unsigned short* recvBuffer,
-                 vtkIdType sendLength, vtkIdType* recvLengths,
-                 vtkIdType* offsets) {
-    return this->Communicator->AllGatherV(sendBuffer, recvBuffer,
-                                          sendLength, recvLengths,
-                                          offsets);
-  }
-  int AllGatherV(const long* sendBuffer, long* recvBuffer,
-                 vtkIdType sendLength, vtkIdType* recvLengths,
-                 vtkIdType* offsets) {
-    return this->Communicator->AllGatherV(sendBuffer, recvBuffer,
-                                          sendLength, recvLengths,
-                                          offsets);
-  }
   int AllGatherV(const unsigned long* sendBuffer, unsigned long* recvBuffer,
                  vtkIdType sendLength, vtkIdType* recvLengths,
                  vtkIdType* offsets) {
@@ -1044,13 +757,6 @@ public:
                                           sendLength, recvLengths,
                                           offsets);
   }
-  int AllGatherV(const signed char* sendBuffer, signed char* recvBuffer,
-                 vtkIdType sendLength, vtkIdType* recvLengths,
-                 vtkIdType* offsets) {
-    return this->Communicator->AllGatherV(sendBuffer, recvBuffer,
-                                          sendLength, recvLengths,
-                                          offsets);
-  }
   int AllGatherV(const float* sendBuffer, float* recvBuffer,
                  vtkIdType sendLength, vtkIdType* recvLengths,
                  vtkIdType* offsets) {
@@ -1073,23 +779,6 @@ public:
                                           sendLength, recvLengths,
                                           offsets);
   }
-#elif defined(VTK_TYPE_USE_LONG_LONG)
-  int AllGatherV(const long long* sendBuffer, long long* recvBuffer,
-                 vtkIdType sendLength, vtkIdType* recvLengths,
-                 vtkIdType* offsets) {
-    return this->Communicator->AllGatherV(sendBuffer, recvBuffer,
-                                          sendLength, recvLengths,
-                                          offsets);
-  }
-#endif
-#ifdef VTK_TYPE_USE_LONG_LONG
-  int AllGatherV(const unsigned long long* sendBuffer, unsigned long long* recvBuffer,
-                 vtkIdType sendLength, vtkIdType* recvLengths,
-                 vtkIdType* offsets) {
-    return this->Communicator->AllGatherV(sendBuffer, recvBuffer,
-                                          sendLength, recvLengths,
-                                          offsets);
-  }
 #endif
   int AllGatherV(vtkDataArray *sendBuffer, vtkDataArray *recvBuffer,
                  vtkIdType *recvLengths, vtkIdType *offsets) {
@@ -1120,21 +809,6 @@ public:
     return this->Communicator->Reduce(sendBuffer, recvBuffer, length,
                                       operation, destProcessId);
   }
-  int Reduce(const short *sendBuffer, short *recvBuffer,
-             vtkIdType length, int operation, int destProcessId) {
-    return this->Communicator->Reduce(sendBuffer, recvBuffer, length,
-                                      operation, destProcessId);
-  }
-  int Reduce(const unsigned short *sendBuffer, unsigned short *recvBuffer,
-             vtkIdType length, int operation, int destProcessId) {
-    return this->Communicator->Reduce(sendBuffer, recvBuffer, length,
-                                      operation, destProcessId);
-  }
-  int Reduce(const long *sendBuffer, long *recvBuffer,
-             vtkIdType length, int operation, int destProcessId) {
-    return this->Communicator->Reduce(sendBuffer, recvBuffer, length,
-                                      operation, destProcessId);
-  }
   int Reduce(const unsigned long *sendBuffer, unsigned long *recvBuffer,
              vtkIdType length, int operation, int destProcessId) {
     return this->Communicator->Reduce(sendBuffer, recvBuffer, length,
@@ -1150,11 +824,6 @@ public:
     return this->Communicator->Reduce(sendBuffer, recvBuffer, length,
                                       operation, destProcessId);
   }
-  int Reduce(const signed char *sendBuffer, signed char *recvBuffer,
-             vtkIdType length, int operation, int destProcessId) {
-    return this->Communicator->Reduce(sendBuffer, recvBuffer, length,
-                                      operation, destProcessId);
-  }
   int Reduce(const float *sendBuffer, float *recvBuffer,
              vtkIdType length, int operation, int destProcessId) {
     return this->Communicator->Reduce(sendBuffer, recvBuffer, length,
@@ -1171,19 +840,6 @@ public:
     return this->Communicator->Reduce(sendBuffer, recvBuffer, length,
                                       operation, destProcessId);
   }
-#elif defined(VTK_TYPE_USE_LONG_LONG)
-  int Reduce(const long long *sendBuffer, long long *recvBuffer,
-             vtkIdType length, int operation, int destProcessId) {
-    return this->Communicator->Reduce(sendBuffer, recvBuffer, length,
-                                      operation, destProcessId);
-  }
-#endif
-#ifdef VTK_TYPE_USE_LONG_LONG
-  int Reduce(const unsigned long long *sendBuffer, unsigned long long *recvBuffer,
-             vtkIdType length, int operation, int destProcessId) {
-    return this->Communicator->Reduce(sendBuffer, recvBuffer, length,
-                                      operation, destProcessId);
-  }
 #endif
   int Reduce(vtkDataArray *sendBuffer, vtkDataArray *recvBuffer,
              int operation, int destProcessId) {
@@ -1201,30 +857,6 @@ public:
     return this->Communicator->Reduce(sendBuffer, recvBuffer, length,
                                       operation, destProcessId);
   }
-  int Reduce(const unsigned int *sendBuffer, unsigned int *recvBuffer,
-             vtkIdType length, vtkCommunicator::Operation *operation,
-             int destProcessId) {
-    return this->Communicator->Reduce(sendBuffer, recvBuffer, length,
-                                      operation, destProcessId);
-  }
-  int Reduce(const short *sendBuffer, short *recvBuffer,
-             vtkIdType length, vtkCommunicator::Operation *operation,
-             int destProcessId) {
-    return this->Communicator->Reduce(sendBuffer, recvBuffer, length,
-                                      operation, destProcessId);
-  }
-  int Reduce(const unsigned short *sendBuffer, unsigned short *recvBuffer,
-             vtkIdType length, vtkCommunicator::Operation *operation,
-             int destProcessId) {
-    return this->Communicator->Reduce(sendBuffer, recvBuffer, length,
-                                      operation, destProcessId);
-  }
-  int Reduce(const long *sendBuffer, long *recvBuffer,
-             vtkIdType length, vtkCommunicator::Operation *operation,
-             int destProcessId) {
-    return this->Communicator->Reduce(sendBuffer, recvBuffer, length,
-                                      operation, destProcessId);
-  }
   int Reduce(const unsigned long *sendBuffer, unsigned long *recvBuffer,
              vtkIdType length, vtkCommunicator::Operation *operation,
              int destProcessId) {
@@ -1243,12 +875,6 @@ public:
     return this->Communicator->Reduce(sendBuffer, recvBuffer, length,
                                       operation, destProcessId);
   }
-  int Reduce(const signed char *sendBuffer, signed char *recvBuffer,
-             vtkIdType length, vtkCommunicator::Operation *operation,
-             int destProcessId) {
-    return this->Communicator->Reduce(sendBuffer, recvBuffer, length,
-                                      operation, destProcessId);
-  }
   int Reduce(const float *sendBuffer, float *recvBuffer,
              vtkIdType length, vtkCommunicator::Operation *operation,
              int destProcessId) {
@@ -1268,21 +894,6 @@ public:
     return this->Communicator->Reduce(sendBuffer, recvBuffer, length,
                                       operation, destProcessId);
   }
-#elif defined(VTK_TYPE_USE_LONG_LONG)
-  int Reduce(const long long *sendBuffer, long long *recvBuffer,
-             vtkIdType length, vtkCommunicator::Operation *operation,
-             int destProcessId) {
-    return this->Communicator->Reduce(sendBuffer, recvBuffer, length,
-                                      operation, destProcessId);
-  }
-#endif
-#ifdef VTK_TYPE_USE_LONG_LONG
-  int Reduce(const unsigned long long *sendBuffer, unsigned long long *recvBuffer,
-             vtkIdType length, vtkCommunicator::Operation *operation,
-             int destProcessId) {
-    return this->Communicator->Reduce(sendBuffer, recvBuffer, length,
-                                      operation, destProcessId);
-  }
 #endif
   int Reduce(vtkDataArray *sendBuffer, vtkDataArray *recvBuffer,
              vtkCommunicator::Operation *operation, int destProcessId) {
@@ -1298,26 +909,6 @@ public:
     return this->Communicator->AllReduce(sendBuffer, recvBuffer, length,
                                          operation);
   }
-  int AllReduce(const unsigned int *sendBuffer, unsigned int *recvBuffer,
-                vtkIdType length, int operation) {
-    return this->Communicator->AllReduce(sendBuffer, recvBuffer, length,
-                                         operation);
-  }
-  int AllReduce(const short *sendBuffer, short *recvBuffer,
-                vtkIdType length, int operation) {
-    return this->Communicator->AllReduce(sendBuffer, recvBuffer, length,
-                                         operation);
-  }
-  int AllReduce(const unsigned short *sendBuffer, unsigned short *recvBuffer,
-                vtkIdType length, int operation) {
-    return this->Communicator->AllReduce(sendBuffer, recvBuffer, length,
-                                         operation);
-  }
-  int AllReduce(const long *sendBuffer, long *recvBuffer,
-                vtkIdType length, int operation) {
-    return this->Communicator->AllReduce(sendBuffer, recvBuffer, length,
-                                         operation);
-  }
   int AllReduce(const unsigned long *sendBuffer, unsigned long *recvBuffer,
                 vtkIdType length, int operation) {
     return this->Communicator->AllReduce(sendBuffer, recvBuffer, length,
@@ -1333,11 +924,6 @@ public:
     return this->Communicator->AllReduce(sendBuffer, recvBuffer, length,
                                          operation);
   }
-  int AllReduce(const signed char *sendBuffer, signed char *recvBuffer,
-                vtkIdType length, int operation) {
-    return this->Communicator->AllReduce(sendBuffer, recvBuffer, length,
-                                         operation);
-  }
   int AllReduce(const float *sendBuffer, float *recvBuffer,
                 vtkIdType length, int operation) {
     return this->Communicator->AllReduce(sendBuffer, recvBuffer, length,
@@ -1354,19 +940,6 @@ public:
     return this->Communicator->AllReduce(sendBuffer, recvBuffer, length,
                                          operation);
   }
-#elif defined(VTK_TYPE_USE_LONG_LONG)
-  int AllReduce(const long long *sendBuffer, long long *recvBuffer,
-                vtkIdType length, int operation) {
-    return this->Communicator->AllReduce(sendBuffer, recvBuffer, length,
-                                         operation);
-  }
-#endif
-#ifdef VTK_TYPE_USE_LONG_LONG
-  int AllReduce(const unsigned long long *sendBuffer, unsigned long long *recvBuffer,
-                vtkIdType length, int operation) {
-    return this->Communicator->AllReduce(sendBuffer, recvBuffer, length,
-                                         operation);
-  }
 #endif
   int AllReduce(vtkDataArray *sendBuffer, vtkDataArray *recvBuffer,
                 int operation) {
@@ -1378,26 +951,6 @@ public:
     return this->Communicator->AllReduce(sendBuffer, recvBuffer, length,
                                          operation);
   }
-  int AllReduce(const unsigned int *sendBuffer, unsigned int *recvBuffer,
-                vtkIdType length, vtkCommunicator::Operation *operation) {
-    return this->Communicator->AllReduce(sendBuffer, recvBuffer, length,
-                                         operation);
-  }
-  int AllReduce(const short *sendBuffer, short *recvBuffer,
-                vtkIdType length, vtkCommunicator::Operation *operation) {
-    return this->Communicator->AllReduce(sendBuffer, recvBuffer, length,
-                                         operation);
-  }
-  int AllReduce(const unsigned short *sendBuffer, unsigned short *recvBuffer,
-                vtkIdType length, vtkCommunicator::Operation *operation) {
-    return this->Communicator->AllReduce(sendBuffer, recvBuffer, length,
-                                         operation);
-  }
-  int AllReduce(const long *sendBuffer, long *recvBuffer,
-                vtkIdType length, vtkCommunicator::Operation *operation) {
-    return this->Communicator->AllReduce(sendBuffer, recvBuffer, length,
-                                         operation);
-  }
   int AllReduce(const unsigned long *sendBuffer, unsigned long *recvBuffer,
                 vtkIdType length, vtkCommunicator::Operation *operation) {
     return this->Communicator->AllReduce(sendBuffer, recvBuffer, length,
@@ -1413,11 +966,6 @@ public:
     return this->Communicator->AllReduce(sendBuffer, recvBuffer, length,
                                          operation);
   }
-  int AllReduce(const signed char *sendBuffer, signed char *recvBuffer,
-                vtkIdType length, vtkCommunicator::Operation *operation) {
-    return this->Communicator->AllReduce(sendBuffer, recvBuffer, length,
-                                         operation);
-  }
   int AllReduce(const float *sendBuffer, float *recvBuffer,
                 vtkIdType length, vtkCommunicator::Operation *operation) {
     return this->Communicator->AllReduce(sendBuffer, recvBuffer, length,
@@ -1434,19 +982,6 @@ public:
     return this->Communicator->AllReduce(sendBuffer, recvBuffer, length,
                                          operation);
   }
-#elif defined(VTK_TYPE_USE_LONG_LONG)
-  int AllReduce(const long long *sendBuffer, long long *recvBuffer,
-                vtkIdType length, vtkCommunicator::Operation *operation) {
-    return this->Communicator->AllReduce(sendBuffer, recvBuffer, length,
-                                         operation);
-  }
-#endif
-#ifdef VTK_TYPE_USE_LONG_LONG
-  int AllReduce(const unsigned long long *sendBuffer, unsigned long long *recvBuffer,
-                vtkIdType length, vtkCommunicator::Operation *operation) {
-    return this->Communicator->AllReduce(sendBuffer, recvBuffer, length,
-                                         operation);
-  }
 #endif
   int AllReduce(vtkDataArray *sendBuffer, vtkDataArray *recvBuffer,
                 vtkCommunicator::Operation *operation) {
@@ -1559,32 +1094,6 @@ inline int vtkMultiProcessController::Send(const int* data, vtkIdType length,
     }
 }
 
-inline int vtkMultiProcessController::Send(const short* data, vtkIdType length,
-                                           int remoteProcessId, int tag)
-{
-  if (this->Communicator)
-    {
-    return this->Communicator->Send(data, length, remoteProcessId, tag);
-    }
-  else
-    {
-    return 0;
-    }
-}
-
-inline int vtkMultiProcessController::Send(const unsigned short* data, vtkIdType length,
-                                           int remoteProcessId, int tag)
-{
-  if (this->Communicator)
-    {
-    return this->Communicator->Send(data, length, remoteProcessId, tag);
-    }
-  else
-    {
-    return 0;
-    }
-}
-
 inline int vtkMultiProcessController::Send(const unsigned int* data, vtkIdType length,
                                            int remoteProcessId, int tag)
 {
@@ -1613,34 +1122,6 @@ inline int vtkMultiProcessController::Send(const unsigned long* data,
     }
 }
 
-inline int vtkMultiProcessController::Send(const long* data,
-                                           vtkIdType length,
-                                           int remoteProcessId,
-                                           int tag)
-{
-  if (this->Communicator)
-    {
-    return this->Communicator->Send(data, length, remoteProcessId, tag);
-    }
-  else
-    {
-    return 0;
-    }
-}
-
-inline int vtkMultiProcessController::Send(const signed char* data, vtkIdType length,
-                                           int remoteProcessId, int tag)
-{
-  if (this->Communicator)
-    {
-    return this->Communicator->Send(data, length, remoteProcessId, tag);
-    }
-  else
-    {
-    return 0;
-    }
-}
-
 inline int vtkMultiProcessController::Send(const char* data, vtkIdType length,
                                            int remoteProcessId, int tag)
 {
@@ -1708,37 +1189,6 @@ inline int vtkMultiProcessController::Send(const vtkIdType* data,
     return 0;
     }
 }
-#elif defined(VTK_TYPE_USE_LONG_LONG)
-inline int vtkMultiProcessController::Send(const long long* data,
-                                           vtkIdType length,
-                                           int remoteProcessId, int tag)
-{
-  if (this->Communicator)
-    {
-    return this->Communicator->Send(data, length, remoteProcessId, tag);
-    }
-  else
-    {
-    return 0;
-    }
-}
-#endif
-#ifdef VTK_TYPE_USE_LONG_LONG
-
-inline int vtkMultiProcessController::Send(const unsigned long long* data,
-                                           vtkIdType length,
-                                           int remoteProcessId, int tag)
-{
-  if (this->Communicator)
-    {
-    return this->Communicator->Send(data, length, remoteProcessId, tag);
-    }
-  else
-    {
-    return 0;
-    }
-}
-
 #endif
 
 inline int vtkMultiProcessController::Send(const vtkMultiProcessStream& stream,
@@ -1816,46 +1266,6 @@ inline int vtkMultiProcessController::Receive(unsigned int* data, vtkIdType leng
     }
 }
 
-inline int vtkMultiProcessController::Receive(short* data, vtkIdType length,
-                                              int remoteProcessId, int tag)
-{
-  if (this->Communicator)
-    {
-    return this->Communicator->Receive(data, length, remoteProcessId, tag);
-    }
-  else
-    {
-    return 0;
-    }
-}
-
-inline int vtkMultiProcessController::Receive(unsigned short* data, vtkIdType length,
-                                              int remoteProcessId, int tag)
-{
-  if (this->Communicator)
-    {
-    return this->Communicator->Receive(data, length, remoteProcessId, tag);
-    }
-  else
-    {
-    return 0;
-    }
-}
-
-inline int vtkMultiProcessController::Receive(long* data, vtkIdType length,
-                                              int remoteProcessId, int tag)
-{
-  if (this->Communicator)
-    {
-    return this->Communicator->Receive(data, length, remoteProcessId, tag);
-    }
-  else
-    {
-    return 0;
-    }
-}
-
-
 inline int vtkMultiProcessController::Receive(unsigned long* data,
                                               vtkIdType length,
                                               int remoteProcessId,
@@ -1898,20 +1308,6 @@ inline int vtkMultiProcessController::Receive(unsigned char* data,
     }
 }
 
-inline int vtkMultiProcessController::Receive(signed char* data, vtkIdType length,
-                                              int remoteProcessId, int tag)
-{
-  if (this->Communicator)
-    {
-    return this->Communicator->Receive(data, length, remoteProcessId, tag);
-    }
-  else
-    {
-    return 0;
-    }
-}
-
-
 inline int vtkMultiProcessController::Receive(float* data, vtkIdType length,
                                               int remoteProcessId, int tag)
 {
@@ -1952,34 +1348,6 @@ inline int vtkMultiProcessController::Receive(vtkIdType* data,
     return 0;
     }
 }
-#elif defined(VTK_TYPE_USE_LONG_LONG)
-inline int vtkMultiProcessController::Receive(long long* data, vtkIdType length,
-                                              int remoteProcessId, int tag)
-{
-  if (this->Communicator)
-    {
-    return this->Communicator->Receive(data, length, remoteProcessId, tag);
-    }
-  else
-    {
-    return 0;
-    }
-}
-#endif
-
-#ifdef VTK_TYPE_USE_LONG_LONG
-inline int vtkMultiProcessController::Receive(unsigned long long* data, vtkIdType length,
-                                              int remoteProcessId, int tag)
-{
-  if (this->Communicator)
-    {
-    return this->Communicator->Receive(data, length, remoteProcessId, tag);
-    }
-  else
-    {
-    return 0;
-    }
-}
 #endif
 
 
diff --git a/Parallel/Core/vtkMultiProcessStream.cxx b/Parallel/Core/vtkMultiProcessStream.cxx
index 3cdd6ee..b66a457 100644
--- a/Parallel/Core/vtkMultiProcessStream.cxx
+++ b/Parallel/Core/vtkMultiProcessStream.cxx
@@ -693,7 +693,7 @@ vtkMultiProcessStream& vtkMultiProcessStream::operator >> (int &value)
     {
     vtkTypeInt64 value64;
     (*this) >> value64;
-    value = static_cast<int>(value64);
+    value = value64;
     return (*this);
     }
   assert(this->Internals->Data.front() == vtkInternals::int32_value);
@@ -825,7 +825,10 @@ void vtkMultiProcessStream::SetRawData(const std::vector<unsigned char>& data)
 void vtkMultiProcessStream::GetRawData(
     unsigned char*& data, unsigned int &size )
 {
-  delete [] data;
+  if( data != NULL )
+    {
+    delete [] data;
+    }
 
   size = this->Size()+1;
   data = new unsigned char[ size+1 ];
diff --git a/Parallel/Core/vtkSocketCommunicator.cxx b/Parallel/Core/vtkSocketCommunicator.cxx
index f916096..5c42fbe 100644
--- a/Parallel/Core/vtkSocketCommunicator.cxx
+++ b/Parallel/Core/vtkSocketCommunicator.cxx
@@ -213,8 +213,11 @@ int vtkSocketCommunicator::LogToFile(const char* name)
 int vtkSocketCommunicator::LogToFile(const char* name, int append)
 {
   // Close old logging file.
-  delete this->LogFile;
-  this->LogFile = 0;
+  if(this->LogFile)
+    {
+    delete this->LogFile;
+    this->LogFile = 0;
+    }
   this->LogStream = 0;
 
   // Log to given file, if any.
diff --git a/Parallel/Core/vtkSubGroup.cxx b/Parallel/Core/vtkSubGroup.cxx
index f36806d..fa04146 100644
--- a/Parallel/Core/vtkSubGroup.cxx
+++ b/Parallel/Core/vtkSubGroup.cxx
@@ -48,7 +48,10 @@ int vtkSubGroup::Initialize(int p0=0, int p1=0, int me=0, int itag=0, vtkCommuni
   this->tag = itag;
   this->comm = c;
 
-  delete [] this->members;
+  if (this->members)
+    {
+    delete [] this->members;
+    }
 
   this->members = new int [this->nmembers];
 
diff --git a/Parallel/MPI/Testing/Cxx/ExerciseMultiProcessController.cxx b/Parallel/MPI/Testing/Cxx/ExerciseMultiProcessController.cxx
index 002d6bd..9525a93 100644
--- a/Parallel/MPI/Testing/Cxx/ExerciseMultiProcessController.cxx
+++ b/Parallel/MPI/Testing/Cxx/ExerciseMultiProcessController.cxx
@@ -767,10 +767,10 @@ void ExerciseType(vtkMultiProcessController *controller)
   tmpSource->SetNumberOfTuples(lengths[rank]);
   buffer->SetNumberOfTuples(offsets[numProc-1]+lengths[numProc-1]);
   result = 1;
-  controller->GatherV(tmpSource, buffer,
-                      &lengths[0], &offsets[0], destProcessId);
   if (rank == destProcessId)
     {
+    controller->GatherV(tmpSource, buffer,
+                        &lengths[0], &offsets[0], destProcessId);
     for (i = 0; i < numProc; i++)
       {
       for (int j = 0; j < lengths[i]; j++)
@@ -784,6 +784,10 @@ void ExerciseType(vtkMultiProcessController *controller)
         }
       }
     }
+  else
+    {
+    controller->GatherV(tmpSource, NULL, NULL, NULL, destProcessId);
+    }
   CheckSuccess(controller, result);
 
   COUT("Vector Gather with vtkDataArray (automatic receive sizes)");
diff --git a/Parallel/MPI/Testing/Cxx/TestDistributedDataShadowMapPass.cxx b/Parallel/MPI/Testing/Cxx/TestDistributedDataShadowMapPass.cxx
index ff9ff88..e49c8e9 100644
--- a/Parallel/MPI/Testing/Cxx/TestDistributedDataShadowMapPass.cxx
+++ b/Parallel/MPI/Testing/Cxx/TestDistributedDataShadowMapPass.cxx
@@ -93,6 +93,7 @@ class MyProcess : public vtkProcess
 {
 public:
   static MyProcess *New();
+  vtkTypeMacro(MyProcess, vtkProcess);
 
   virtual void Execute();
 
diff --git a/Parallel/MPI/vtkMPICommunicator.cxx b/Parallel/MPI/vtkMPICommunicator.cxx
index b47f32a..5262ea5 100644
--- a/Parallel/MPI/vtkMPICommunicator.cxx
+++ b/Parallel/MPI/vtkMPICommunicator.cxx
@@ -381,7 +381,7 @@ vtkMPICommunicator* vtkMPICommunicator::GetWorldCommunicator()
     {
     // Install an error handler
     MPI_Errhandler errhandler;
-#if (MPI_VERSION > 2) || ((MPI_VERSION == 2) && (MPI_SUBVERSION >= 0))
+#if (MPI_VERSION > 2) || ((MPI_VERSION == 2) && (MPI_SUBVERSION >= 2))
     MPI_Comm_create_errhandler(vtkMPICommunicatorMPIErrorHandler, &errhandler);
     MPI_Comm_set_errhandler(MPI_COMM_WORLD, errhandler);
 #else
@@ -639,7 +639,10 @@ int vtkMPICommunicator::InitializeExternal (vtkMPICommunicatorOpaqueComm* comm)
 {
   this->KeepHandleOn();
 
-  delete this->MPIComm->Handle;
+  if (this->MPIComm->Handle)
+    {
+    delete this->MPIComm->Handle;
+    }
   this->MPIComm->Handle = new MPI_Comm (*(comm->GetHandle()));
   this->InitializeNumberOfProcesses();
   this->Initialized = 1;
diff --git a/Parallel/MPI4Py/CMakeLists.txt b/Parallel/MPI4Py/CMakeLists.txt
index 7fdebba..dde5b31 100644
--- a/Parallel/MPI4Py/CMakeLists.txt
+++ b/Parallel/MPI4Py/CMakeLists.txt
@@ -11,7 +11,6 @@ if(VTK_USE_SYSTEM_MPI4PY)
       COMMAND "${PYTHON_EXECUTABLE}" -c
               "import mpi4py; print(mpi4py.get_include())"
       OUTPUT_VARIABLE mpi4py_include_dir
-      OUTPUT_STRIP_TRAILING_WHITESPACE
       )
     set(MPI4PY_INCLUDE_DIR "${mpi4py_include_dir}"
       CACHE PATH "Path the the MPI4Py include directory")
diff --git a/README.html b/README.html
new file mode 100644
index 0000000..5c45067
--- /dev/null
+++ b/README.html
@@ -0,0 +1,565 @@
+<HTML>
+<header>
+<title>VTK README</title>
+</header>
+<body>
+
+<H1>
+<IMG ALIGN="middle" SRC=vtkBanner.gif><br>
+Welcome To The Visualization Toolkit
+</H1>
+    <UL>
+    <LI> <A HREF="#Introduction">Introduction</A>
+    <LI> <A HREF="#Copyright">Copyright Notice</A>
+    <LI> <A HREF="#Organization">Organization</A>
+    <LI> <A HREF="#Documentation">Documentation</A>
+    <LI> <A HREF="#Compilation">Compilation</A>
+        <UL>
+        <LI> <A HREF="#Building">Building with CMake</A>
+        <LI> <A HREF="#Configuration">Configuration Options in CMake</A>
+        </UL>
+    <LI> <A HREF="#Installation">Installation</A>
+    <LI> <A HREF="#Problems">Common Problems</A>
+    <LI> <A HREF="#Data">Getting Data</A>
+    <LI> <A HREF="#Running">Running VTK</A>
+    <LI> <A HREF="#NewClass">Adding A New Class</A>
+    <LI> <A HREF="#Help">Getting Help / Mailing List</A>
+    </UL>
+<HR>
+<h1><A NAME="Introduction">Introduction</h1>
+
+VTK is an open-source software system for image processing, 3D graphics,
+volume rendering and visualization. VTK includes many advanced algorithms
+(e.g., surface reconstruction, implicit modelling, decimation) and rendering
+techniques (e.g., hardware-accelerated volume rendering, LOD control).<p>
+
+VTK is used by academicians for teaching and research; by government research
+institutions such as Los Alamos National Lab in the US or CINECA in Italy; and
+by many commercial firms who use VTK to build or extend products.<p>
+
+The origin of VTK is with the textbook "The Visualization Toolkit, an
+Object-Oriented Approach to 3D Graphics" originally published by
+Prentice Hall and now published by Kitware, Inc. (Third Edition
+ISBN 1-930934-07-6). VTK has grown (since its initial release in 1994)
+to a world-wide user base in the commercial, academic, and research
+communities.<p>
+
+This README is written for VTK version 5.0 and greater. For more information,
+additional resources, and the FAQ see the web page at
+<A HREF="http://www.vtk.org">http://www.vtk.org</A><p>
+
+<HR>
+<h1><A NAME="Copyright">Copyright Notice</h1>
+
+VTK has a generous open-source copyright modelled after the BSD license. Yes,
+you can use VTK in commercial products. The complete text of the
+copyright follows.
+
+<pre>
+Copyright (c) 1993-2005 Ken Martin, Will Schroeder, Bill Lorensen
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+   this list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright notice,
+   this list of conditions and the following disclaimer in the documentation
+   and/or other materials provided with the distribution.
+
+ * Neither name of Ken Martin, Will Schroeder, or Bill Lorensen nor the names
+   of any contributors may be used to endorse or promote products derived
+   from this software without specific prior written permission.
+
+ * Modified source versions must be plainly marked as such, and must not be
+   misrepresented as being the original software.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+</pre>
+
+<HR>
+<h1><A NAME="Organization">Organization</h1>
+The VTK source code repository is organized into four major sections.
+  <ul>
+
+  <li>The toolkit source code is found in the following directories
+      next to this README.  In some cases an additional README.html
+      file may be found in the named directory. Please see these for
+      more information.
+         <ul>
+         <li><b>Common</b>- Core classes commonly used by other kits
+         <li><b>Filtering</b>- Data pipeline implementation superclasses
+         <li><b>Rendering</b>- Classes used to render a scene (surface primitives)
+         <li><b>Graphics</b>- Filters that process 3D data
+         <li><b>Imaging</b>- Specialized image processing filters (2D & 3D)
+         <li><b>Infovis</b>- Classes for information visualization
+         <li><b>IO</b>- Classes for reading and writing data
+         <li><b>Views</b>- Classes for application-level views
+         <li><b>VolumeRendering</b>- Classes for rendering volume data
+         <li><b>Hybrid</b>- Complex classes that depend on imaging and graphics
+         <li><b>Widgets</b>- Classes for interacting with the objects in the scene
+         <li><b>Parallel</b>- Parallel processing support such as MPI
+         <li><b>GenericFiltering</b>- Part of an adaptor framework
+         supporting integration of VTK with external systems
+         </ul>
+         </li><p>
+  <li><B>Examples</B> that are reasonably well documented are found in the
+         VTK/Examples directory. You may wish to start with the examples
+         found in the Tutorial directory.<p></li>
+  <li>The <B>Utilities</B> directory includes things like jpeg, png,
+         and zlib source code. This code is used by VTK in various ways
+         (reading/writing data, etc.)<p></li>
+  <li>The <B>Wrapping</B> directory contains code related to VTK's automated
+         wrapping process. The wrapping process automatically generates
+         Tcl, Python, and/or Java bindings depending on how the build
+         process is configured.<p></li>
+  </ul>
+
+There are hundreds of testing examples located in the Testing/ directory
+under each source code directory (e.g., Graphics/Testing). These are
+undocumented tests but can be helpful in some cases.<p>
+
+
+<HR>
+<h1><A NAME="Documentation">Documentation</h1>
+
+The ideal way to learn about the software is from two books:
+<i>The Visualization Toolkit, An Object-Oriented Approach to 3D Graphics</i>
+and <i>The VTK User's Guide</i> both published by Kitware, Inc. (Note:
+<i>The Visualization Toolkit</i> was originally published by Prentice-Hall,
+the third edition is published by Kitware.)
+You may order the books from the following locations (Amazon.com also
+carries the books.)
+<pre>
+  The Visualization Toolkit, An Object-Oriented Approach to 3D Graphics (Third Edition)
+  by Will Schroeder, Ken Martin and Bill Lorensen.
+  Kitware, Inc.,
+  ISBN 1-930934-07-6
+  <A HREF="http://www.kitware.com/products/vtktextbook.html">http://www.kitware.com/products/vtktextbook.html</A>
+
+  The VTK User's Guide (VTK 4.2 Edition)
+  Kitware, Inc.,
+  ISBN 1-930934-08-4
+  <A HREF="http://www.kitware.com/products/vtkguide.html">http://www.kitware.com/products/vtkguide.html</A>
+</pre>
+
+On-line Doxygen man pages are also available at
+<A href="http://www.vtk.org/doc/nightly/html/">
+http://www.vtk.org/doc/nightly/html/</a><p>
+
+<hr>
+<h1><a name="Compilation">Compilation</h1>
+
+<div align="left" style="width:720;">
+The Visualization Toolkit can be built on UNIX, PC (Windows
+NT/2000/XP/7), and Mac OS X 10.5 Leopard (or greater) systems.  VTK uses
+<a href="http://www.cmake.org">CMake</a> to generate its build system.
+To build VTK one must first install CMake version 2.8.5 or higher.
+CMake may be downloaded from <a
+href="http://www.cmake.org/HTML/Download.html">http://www.cmake.org/HTML/Download.html</a>.
+The instructions below cover the basics of running CMake for VTK under
+the assumption that CMake is already installed.  See the CMake web
+page for details on
+  <a href="http://www.cmake.org/HTML/Install.html">intalling</a> and
+  <a href="http://www.cmake.org/HTML/RunningCMake.html">running</a> CMake.
+<p>
+Compiling VTK requires a complete VTK source tree.  Running VTK tests
+requires a complete VTK data tree.  Now is the time to extract the
+source and data archives if one has not done so already.  These
+instructions assume there is a directory "<code>VTK</code>" containing
+the source code and optionally a sibling directory
+"<code>VTKData</code>" containing the data.
+<p>
+
+<h2><a name="Building">Building with CMake</h2>
+
+CMake must be run to generate a build system for VTK.  The build
+system may be placed either in the VTK source tree (an
+<i>in-source</i> build) or in a separate binary tree (an
+<i>out-of-source</i> build).  We strongly encourage use of
+out-of-source builds because they make it easy to have multiple builds
+with different configurations sharing the same source tree.  Once a
+single in-source build has been created it is the only build tree that
+can be associated with that source tree.  A source tree may not be
+used both for an in-source build and an out-of-source build, but any
+number of out-of-source builds may share a source tree that does not
+have an in-source build.  Having multiple out-of-source builds is
+particularly useful for installing VTK on multiple architectures using
+a single source tree on a shared disk.
+<p>
+CMake provides both a command-line tool and interactive interfaces.
+Advanced users may wish to use the command-line tool but here we
+document the CMake interactive interface for each platform:
+
+<ul>
+  <li><b>Windows</b><br>
+
+      Run the CMakeSetup dialog to get started.  It must be executed
+      from an environment configured to run the compiler to be used.
+      In the case of the Visual Studio IDE no special environment is
+      needed and CMakeSetup can be started from its icon.  In the case
+      of a Visual Studio NMake, Borland C++, or MinGW build the
+      CMakeSetup dialog should be executed from a command prompt with
+      the appropriate environment set.
+      <p>
+      The dialog prompts for the location of the source and binary
+      trees.  There may also be prompt for the build system generator
+      to be used ("Build For:").  Once these are set then CMake is
+      ready for a first pass at configuring the VTK build system.  Use
+      the "Configure" button to initiate this process.  If there was
+      no earlier prompt for the build system generator a separate
+      dialog will appear during the first configuration step to prompt
+      for generator selection.  After a while the dialog will present
+      a set of configuration options.
+      See <a href="#Configuration">below</a> for details on the meaning of
+      each of these options.  After setting the options as desired
+      press "Configure" again to make another pass at configuring VTK.
+      New options may appear when earlier options are adjusted.  Keep
+      adjusting options and pressing "Configure" until the desired
+      configuration is reached.  Finally press the "Generate" button
+      to actually generate the build system.
+      <p>
+      Now that the build system has been generated the corresponding
+      native tools can be used to build VTK.  In the case of the
+      Visual Studio IDE simply run it and load the VTK workspace or
+      solution file from the binary tree specified in the CMakeSetup
+      dialog.  Select and build the <code>ALL_BUILD</code> target.  In
+      the case of a Visual Studio NMake, Borland C++, or MinGW build
+      use the corresponding make tool (<code>nmake</code>,
+      <code>make</code>, and <code>make</code>, respectively) from the
+      command line.
+
+  <li><b>UNIX / Cygwin / Mac OS X</b><br>
+
+      CMake should be run from the command line on these platforms.
+      The current working directory should be set to the desired
+      binary tree location in which the build system should be
+      generated.  One command-line argument is used to specify the
+      location of the source tree.  CMake will usually choose the
+      system C and C++ compilers automatically but it can be told to
+      use specific compilers through the "<code>CC</code>" and
+      "<code>CXX</code>" environment variables.
+      <p>
+      A typical in-source build for VTK might look like this:
+      <blockquote>
+        <code>
+         $ ls -d VTK<br>
+         VTK/<br>
+         $ cd VTK<br>
+         $ ccmake .<br>
+         $ make<br>
+        </code>
+      </blockquote>
+      A typical out-of-source build for VTK might look like this:
+      <blockquote>
+        <code>
+         $ ls -d VTK<br>
+         VTK/<br>
+         $ mkdir VTK-build<br>
+         $ cd VTK-build<br>
+         $ ccmake ../VTK<br>
+         $ make<br>
+        </code>
+      </blockquote>
+      In the above examples the call to <code>ccmake</code> may be
+      replaced by
+      <blockquote>
+        <code>
+         $ env CC=/your/c/compiler CXX=/your/C++/compiler ccmake /path/to/VTK<br>
+        </code>
+      </blockquote>
+      in order to tell CMake to use specific C and C++ compilers.
+      Setting the environment in this way will only change the
+      compilers the <i>first</i> time CMake is run for a specific
+      build tree.  Do not attempt to change the compiler of an
+      existing build tree.  Instead one should create a separate build
+      tree for each desired compiler.
+      <p>
+      The <code>ccmake</code> tool is a curses-based dialog that may
+      be used to interactively configure VTK.  When it appears press
+      'c' on the keyboard to run the initial configuration of the VTK
+      build system.  Eventually a set of configuration options will
+      appear.  These may be edited using the arrow-keys and the ENTER
+      key for navigation.  See <a href="#Configuration">below</a> for
+      details on the meaning of each of these options.
+      <p>
+      Once the options have been set as desired press 'c' again to
+      reconfigure.  New options may appear when earlier options are
+      adjusted.  Keep adjusting options and pressing 'c' until the
+      desired configuration is reached.  Finally press 'g' to actually
+      generate the build system.  Now that the build system has been
+      generated just run <code>make</code> or <code>gmake</code> to
+      build VTK.
+      <p>
+      NOTE: The <code>ccmake</code> curses dialog is the most commonly
+      used interactive interface for CMake on UNIX-like platforms, so
+      these instructions assume it is available.  Some system
+      administrators may not have installed curses in which case
+      <code>ccmake</code> will not be available.  On these platforms
+      one may use the command "<code>cmake -i</code>" in place of
+      <code>ccmake</code> and follow the on-screen instructions to
+      configure VTK.  A last resort is to use the command-line
+      interface to <code>cmake</code>, but that is beyond the scope of
+      this document.  See CMake documentation for further details.
+
+</ul>
+
+<h2><a name="Configuration">Configuration Options in CMake</h2>
+
+VTK is a large toolkit providing a wide variety of functionality.
+Several configuration options are available to customize the VTK build
+system.  These options are configured through an interactive CMake
+interface as described <a href="#Building">above</a>.  Note that not
+all options are available on all platforms, and some options are
+available only when other options are set to a particular value.
+<p>
+The interactive CMake interface provides brief documentation for every
+option.  Some options have more meaning than can be described in one
+sentence, so additional documentation is provided here:
+
+<p>
+<ul>
+  <li><b>BUILD_SHARED_LIBS</b><br>
+    <p>
+    Sets whether the compiled VTK libraries will be shared libraries
+    or static libraries.  When linking executables against static
+    libraries the needed symbols will be copied from the libraries
+    into the executables enabling them to run without access to the
+    original libraries.  When linking executables against shared
+    libraries references to the symbols are placed into the
+    executables.  This has the advantage that many executables can
+    share a large library without producing many copies of its code.
+    </p>
+    <p>
+    Shared libraries have the disadvantage that they must be found at
+    runtime in order for an executable to run.  Each operating system
+    supporting shared libraries has a component known as the
+    <i>dynamic loader</i>.  This component is responsible for finding
+    the shared libraries needed by an executable when it is run.  In
+    order to run VTK executables from the build tree when using shared
+    libraries one may need to help the dynamic loader find the
+    libraries (usually the bin subdirectory of the build tree).
+    </p>
+    <p>
+    On Windows, the dynamic loader will look for shared libraries in
+    the directory containing the executable, in directories listed in
+    the PATH environment variable, and in some system directories.
+    Since VTK places all of its executables and libraries in the same
+    directory nothing needs to be set to get them to run.  However,
+    when one builds outside projects against VTK the PATH environment
+    variable must be set to point at the directory containing the VTK
+    shared libraries.
+    </p>
+    <p>
+    On UNIX-style platforms, the dynamic loader will use an
+    environment variable such as LD_LIBRARY_PATH (Linux and many UNIX
+    systems) or DYLD_LIBRARY_PATH (Mac OS X) to look for shared
+    libraries.  In order to run VTK executables from the build tree
+    one must set the appropriate environment variable to point at the
+    directory containing the VTK shared libraries.  The same environment
+    setting must be used for running outside projects build against the
+    shared VTK libraries.
+    </p>
+  </li>
+
+  <li><b>VTK_WRAP_TCL</b><br>
+
+    <p>
+    Enable/Disable automatic generation of VTK bindings in the Tcl
+    language.  In order to build the Tcl-based VTK interpreter one
+    will need to have Tcl and Tk version 8.2 or newer. Look to
+
+      <a href="http://www.tcl.tk">http://www.tcl.tk</a>
+
+    for information about getting Tcl and Tk. To turn on Tcl wrapping,
+    set VTK_WRAP_TCL to ON during the configuration process.  One may
+    then have to set the values for Tcl/Tk include directories and
+    libraries during the next CMake configure iteration.  If there is
+    more than one version of Tcl installed on the computer, make sure
+    all the TCL_* and TK_* configuration options are set consistently
+    to use the proper version.  This is especially important when
+    Cygwin is installed because the Cygwin Tcl will not work for a
+    native Windows VTK build and a Windows Tcl will not work for a
+    Cygwin VTK build.  When building the Tcl/Tk wrappers on Cygwin one
+    must also install the Cygwin sources for Tcl/Tk and set
+    TK_XLIB_PATH to "/usr/src/tcltk-20030901-1/tk/xlib" or the
+    corresponding directory for one's Cygwin Tcl version.  See
+
+      <a href="Wrapping/Tcl/README">Wrapping/Tcl/README</a>
+
+    for details on using the Tcl wrappers once they are built.
+    </p>
+  </li>
+
+  <li><b>VTK_WRAP_PYTHON</b><br>
+
+    <p>
+    Enable/Disable automatic generation of VTK bindings in the Python
+    language.  In order to build the Python-based VTK interpreter one
+    will need to have Python installed. Look to
+
+      <a href="http://www.python.org">http://www.python.org</a>
+
+    for information about getting Python.  To turn on Python wrapping,
+    set VTK_WRAP_PYTHON and BUILD_SHARED_LIBS to ON during the
+    configuration process.  One may then have to set the values for
+    Python include directories and libraries during the next CMake
+    configure iteration.  If there is more than one version of Python
+    installed on the computer, make sure all the PYTHON_*
+    configuration options are set consistently to use the proper
+    version.  This is especially important when Cygwin is installed
+    because the Cygwin Python will not work for a native Windows VTK
+    build and a Windows Python will not work for a Cygwin VTK build.
+    In order to use Tkinter with VTK-Python make sure that the Tcl/Tk
+    libraries that are set correspond to the same version used by
+    Tkinter.
+    </p>
+    <p>
+    Note that the VTK-Python modules are now installed by default via
+    'make install', which is a change from previous VTK versions.  The
+    automatic python module installation is highly configurable. The
+    <a href="Wrapping/Python/README.txt">Wrapping/Python/README.txt</a>
+    file documents the installation procedure and the VTK-Python
+    modules.
+    </p>
+  </li>
+
+  <li><b>CMAKE_INSTALL_PREFIX</b><br>
+    <p>
+    When VTK is <a href="#Installation">installed</a> all files are
+    placed in a directory structure rooted at the directory specified
+    by CMAKE_INSTALL_PREFIX.
+    </p>
+  </li>
+</ul>
+
+<HR>
+<h1><A NAME="Installation">Installation</h1>
+
+Installing VTK from a source distribution requires first that it be
+compiled in a build tree.  See the <a
+href="#Compilation">compilation</a> section above for details.  Once
+VTK has been compiled in a build tree one may build the <i>install</i>
+target to actually put VTK in an installation tree.  If VTK was built
+using a CMake Makefile generator then this is done by running "make
+install" from the top of the build tree.  If VTK was built using a
+CMake project file generator (such as Visual Studio), then building
+the INSTALL project from inside the IDE will install VTK.  The
+installation process will install all files in a directory structure
+rooted at the directory specified by CMAKE_INSTALL_PREFIX.
+
+</div>
+
+<HR>
+<h1><A NAME="Problems">Common Problems</h1>
+  <ul>
+  <li>Strange compile errors on UNIX, typically involving system
+      headers and types. Make sure that you specify the environment
+      variables CC and CXX prior to running CMake.  If you have
+      already run CMake you must create a fresh build-tree and start
+      again.  If you ran CMake in the source tree then you must delete
+      the source tree, re-extract the sources, and start again.
+  <li>Errors on Tcl or Tk include files or libraries. Make sure that
+      you set the TCL_* and TK_* configuration variables to the
+      correct location when running CMake.
+  <li>Link errors on Windows platforms. Make sure that the swap space is
+      at least 300 MByte.
+  <li>Link error with borland: TCL82.LIB contains invalid OMF record,
+      type 0x21 (possibly COFF). You have to convert Tcl libraries
+      from coff to omf with the Borland utilitiy coff2omf. Once you
+      have created OMF versions, re-run cmake to tell it where the Borland
+      versions of Tcl and Tk are located. Also, make sure that you are using
+      Tcl/Tk 8.3.2.
+  </ul>
+
+<HR>
+<h1><A NAME="Data">Getting Data and Test Images</h1>
+
+Many of the examples require data. There are two ways to get data. The
+first is to download the file VTKData.tgz. The second is to access the
+data via CVS checkout. The CVS checkout also includes many test images
+used by the testing process (see <A href="http://public.kitware.com/dashboard.php">http://public.kitware.com/dashboard.php</A>).
+These can be used if you wish to test VTK or submit testing dashboards.
+The VTKData.tgz contains only data in compressed form is therefore can
+be obtained much faster.
+
+<pre>
+  1) Download the data at ftp://public.kitware.com/pub/vtk/VTKData.tgz
+
+  2) Checkout the data from CVS using the following commands:
+     cvs -d :pserver:anoncvs at www.vtk.org:/cvsroot/VTK login
+        (there is no password...just press enter)
+     cvs -d :pserver:anoncvs at www.vtk.org:/cvsroot/VTK checkout VTKData
+</pre>
+
+<HR>
+<h1><A NAME="Running">Running VTK</h1>
+
+Many C++ examples will be compiled if BUILD_TESTING and/or
+BUILD_EXAMPLES are enabled in CMake. To run these C++ examples just
+type their name. (They will be found in the binary build directory.)
+If you have built shared libraries, make sure the PATH environment
+variable (Windows) or the LD_LIBRARY_PATH (Unix) point to the shared
+libraries (see above documentation of the BUILD_SHARED_LIBS for
+details).
+
+If you have enabled Tcl wrapping, you will want to set TCLLIBPATH to point to
+the VTK/Wrapping/Tcl directory and check the instructions located in the <A
+href="Wrapping/Tcl/README">Wrapping/Tcl/README</A> file. You will then run
+the VTK executable found in the bin directory where the code was
+compiled. Assuming that the executable VTK is in your path, or has been
+aliased, you would type:
+<pre>
+  vtk mace.tcl
+</pre>
+Note that most Tcl scripts allow you to type "u" in the render window to
+obtain an interpreter. You can use the interpreter to modify the application
+at run-time.
+
+<P>
+If you have enabled Python Wrapping you should read the instructions
+located in the <A
+href="Wrapping/Python/README.txt">Wrapping/Python/README.txt</A> file.
+</P>
+
+<HR>
+<h1><A NAME="NewClass">Writing Your Own Class</h1> There are several ways to
+extend VTK. The simplest way is, in your own code, create classes that
+inherit from the appropriate VTK classes.  Please see the
+<a href="Examples/Build/vtkLocal/README"><code>vtkLocal</code></a> example
+for instructions to build your classes outside VTK.
+
+<HR>
+<h1><A NAME="Help">Getting Help / Mailing List</h1>
+For general information go to the VTK web site
+<a href="http://www.vtk.org">http://www.vtk.org</a>
+<p>
+If you run into problems, your best bet is to join the VTK mailing list.
+Visit <a href="http://www.vtk.org/mailman/listinfo/vtkusers">
+http://www.vtk.org/mailman/listinfo/vtkusers</a> to join the list.
+<p>
+Commercial support contracts are available from Kitware at
+<a href="http://www.kitware.com/products/vtksupport.html">
+http://www.kitware.com/products/vtksupport.html</a>.
+<p>
+Kitware also provides consulting services. Read more at
+<a href="http://www.kitware.com/products/consult.html">
+http://www.kitware.com/products/consult.html</a>.
+<p>
+Training is also available from Kitware. See
+<a href="http://www.kitware.com/products/vtktrain.html">
+http://www.kitware.com/products/vtktrain.html</a>.
+
+</body>
+</HTML>
diff --git a/README.md b/README.md
deleted file mode 100644
index 20c9f15..0000000
--- a/README.md
+++ /dev/null
@@ -1,73 +0,0 @@
-![VTK - The Visualization Toolkit](vtkBanner.gif)
-
-Introduction
-============
-
-VTK is an open-source software system for image processing, 3D
-graphics, volume rendering and visualization. VTK includes many
-advanced algorithms (e.g., surface reconstruction, implicit modelling,
-decimation) and rendering techniques (e.g., hardware-accelerated
-volume rendering, LOD control).
-
-VTK is used by academicians for teaching and research; by government
-research institutions such as Los Alamos National Lab in the US or
-CINECA in Italy; and by many commercial firms who use VTK to build or
-extend products.
-
-The origin of VTK is with the textbook "The Visualization Toolkit, an
-Object-Oriented Approach to 3D Graphics" originally published by
-Prentice Hall and now published by Kitware, Inc. (Third Edition ISBN
-1-930934-07-6). VTK has grown (since its initial release in 1994) to a
-world-wide user base in the commercial, academic, and research
-communities.
-
-Learning Resources
-==================
-
-* General information is available at the [VTK Homepage][].
-
-* Community discussion takes place on the [VTK Mailing Lists][].
-
-* Commercial [support][Kitware Support] and [training][Kitware Training]
-  are available from [Kitware][].
-
-* Doxygen-generated nightly reference documentation is
-  available [online][Doxygen].
-
-[VTK Homepage]: http://www.vtk.org
-[Doxygen]: http://www.vtk.org/doc/nightly/html
-[VTK Mailing Lists]: http://www.vtk.org/VTK/help/mailing.html
-[Kitware]: http://www.kitware.com/
-[Kitware Support]: http://www.kitware.com/products/support.html
-[Kitware Training]: http://www.kitware.com/products/protraining.php
-
-Reporting Bugs
-==============
-
-If you have found a bug:
-
-1. If you have a patch, please read the [CONTRIBUTING.md][] document.
-
-2. Otherwise, please join the one of the [VTK Mailing Lists][] and ask
-   about the expected and observed behaviors to determine if it is
-   really a bug.
-
-3. Finally, if the issue is not resolved by the above steps, open
-   an entry in the [VTK Issue Tracker][].
-
-[VTK Issue Tracker]: http://www.vtk.org/Bug
-
-Contributing
-============
-
-See [CONTRIBUTING.md][] for instructions to contribute.
-
-[CONTRIBUTING.md]: CONTRIBUTING.md
-
-License
-=======
-
-VTK is distributed under the OSI-approved BSD 3-clause License.
-See [Copyright.txt][] for details.
-
-[Copyright.txt]: Copyright.txt
diff --git a/Remote/CMakeLists.txt b/Remote/CMakeLists.txt
deleted file mode 100644
index 4275895..0000000
--- a/Remote/CMakeLists.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-# Functions to fetch remote modules.
-include(vtkModuleRemote)
-
-file(GLOB remotes "*.remote.cmake")
-foreach(remote_module ${remotes})
-  include(${remote_module})
-endforeach()
diff --git a/Remote/PoissonReconstruction.remote.cmake b/Remote/PoissonReconstruction.remote.cmake
deleted file mode 100644
index 32606fd..0000000
--- a/Remote/PoissonReconstruction.remote.cmake
+++ /dev/null
@@ -1,10 +0,0 @@
-#
-# Poisson Reconstruction
-#
-
-vtk_fetch_module(PoissonReconstruction
-  "Poisson Surface reconstruction from unorganized points"
-  GIT_REPOSITORY https://github.com/lorensen/PoissonReconstruction
-  # July 5, 2015 - first working as a remote module
-  GIT_TAG a3fdb529774d48329a2e807e542f2fe589060ccb
-  )
diff --git a/Remote/README.md b/Remote/README.md
deleted file mode 100644
index ef06036..0000000
--- a/Remote/README.md
+++ /dev/null
@@ -1,20 +0,0 @@
-Remote Modules
-==============
-
-This directory is a place-holder for all remote modules distributed
-outside VTK's main repository.  Remote modules share the same
-directory structure as modules in the main repository.  They will be
-picked up by the configuration system and entered into the build after
-they are downloaded into this directory.
-
-Modules can be easily downloaded and accessible to the community by
-listing the module in the current directory.  For more information on
-adding a new module to the list of new modules, see the page that
-describes the policy and procedures for adding a new module:
-
-[Adding Remote Modules to VTK](http://www.vtk.org/Wiki/VTK/Remote_Modules)
-
-__NOTE__ that in each `<remote module name>.remote.cmake`, the first
-argument of the function vtk_fetch_module() is the name of the remote
-module, and it has to be consistent with the module name defined in
-the correponding module.cmake.
diff --git a/Remote/vtkAddon.remote.cmake b/Remote/vtkAddon.remote.cmake
deleted file mode 100644
index 1a40a22..0000000
--- a/Remote/vtkAddon.remote.cmake
+++ /dev/null
@@ -1,9 +0,0 @@
-#
-# vtkAddon
-#
-
-vtk_fetch_module(vtkAddon
-  "Slicer additions to vtk"
-  GIT_REPOSITORY https://github.com/lorensen/vtkAddon
-  GIT_TAG 0d324d0a7afbd2f7ddd79ae52640fddd15091b34
-  )
diff --git a/Remote/vtkDICOM.remote.cmake b/Remote/vtkDICOM.remote.cmake
deleted file mode 100644
index 3238339..0000000
--- a/Remote/vtkDICOM.remote.cmake
+++ /dev/null
@@ -1,10 +0,0 @@
-#
-# Dicom Classes
-#
-
-vtk_fetch_module(vtkDICOM
-  "Dicom classes and utilities"
-  GIT_REPOSITORY https://github.com/lorensen/vtk-dicom
-  # July 9, 2015 - first working as a vtk remote module
-  GIT_TAG vtkRemote
-  )
diff --git a/Rendering/Annotation/Testing/Cxx/TestCornerAnnotation.cxx b/Rendering/Annotation/Testing/Cxx/TestCornerAnnotation.cxx
index c20e2fd..0c234e3 100644
--- a/Rendering/Annotation/Testing/Cxx/TestCornerAnnotation.cxx
+++ b/Rendering/Annotation/Testing/Cxx/TestCornerAnnotation.cxx
@@ -18,13 +18,7 @@
 #include "vtkRenderWindow.h"
 #include "vtkRenderWindowInteractor.h"
 #include "vtkTextProperty.h"
-#include "vtkImageData.h"
-#include "vtkImageShiftScale.h"
-#include "vtkImageActor.h"
-#include "vtkImageMapper3D.h"
-#include "vtkImageMapToWindowLevelColors.h"
-#include "vtkImageMandelbrotSource.h"
-
+#include "vtkSphereSource.h"
 #include "vtkPolyDataMapper.h"
 #include "vtkActor.h"
 #include "vtkCornerAnnotation.h"
@@ -32,58 +26,38 @@
 
 int TestCornerAnnotation( int argc, char * argv [] )
 {
-  vtkSmartPointer<vtkImageMandelbrotSource> imageSource =
-    vtkSmartPointer<vtkImageMandelbrotSource>::New();
+  vtkSmartPointer<vtkSphereSource> sphereSource =
+      vtkSmartPointer<vtkSphereSource>::New();
+  sphereSource->Update();
 
-  vtkSmartPointer<vtkImageShiftScale> imageCast =
-    vtkSmartPointer<vtkImageShiftScale>::New();
-  imageCast->SetInputConnection(imageSource->GetOutputPort());
-  imageCast->SetScale(10000);
-  imageCast->SetShift(0);
-  imageCast->SetOutputScalarTypeToShort();
-  imageCast->Update();
+  vtkSmartPointer<vtkPolyDataMapper> mapper =
+      vtkSmartPointer<vtkPolyDataMapper>::New();
+  mapper->SetInputConnection(sphereSource->GetOutputPort());
 
-  vtkSmartPointer<vtkImageMapToWindowLevelColors> imageWL =
-    vtkSmartPointer<vtkImageMapToWindowLevelColors>::New();
-  imageWL->SetInputConnection(imageCast->GetOutputPort());
-  imageWL->SetWindow(10000);
-  imageWL->SetLevel(5000);
-  vtkSmartPointer<vtkImageActor> imageActor =
-    vtkSmartPointer<vtkImageActor>::New();
-  imageActor->GetMapper()->SetInputConnection(imageWL->GetOutputPort());
+  vtkSmartPointer<vtkActor> actor =
+      vtkSmartPointer<vtkActor>::New();
+  actor->SetMapper(mapper);
 
   // Visualize
   vtkSmartPointer<vtkRenderer> renderer = vtkSmartPointer<vtkRenderer>::New();
   vtkSmartPointer<vtkRenderWindow> renderWindow = vtkSmartPointer<vtkRenderWindow>::New();
   renderWindow->AddRenderer(renderer);
 
-  renderWindow->SetSize(800, 600);
   vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor =
       vtkSmartPointer<vtkRenderWindowInteractor>::New();
   renderWindowInteractor->SetRenderWindow(renderWindow);
-  renderer->AddActor(imageActor);
+  renderer->AddActor(actor);
 
    // Annotate the image with window/level and mouse over pixel information
   vtkSmartPointer<vtkCornerAnnotation> cornerAnnotation =
       vtkSmartPointer<vtkCornerAnnotation>::New();
-
-  cornerAnnotation->SetImageActor(imageActor);
-  cornerAnnotation->SetWindowLevel(imageWL);
-
   cornerAnnotation->SetLinearFontScaleFactor( 2 );
   cornerAnnotation->SetNonlinearFontScaleFactor( 1 );
   cornerAnnotation->SetMaximumFontSize( 20 );
-
-  cornerAnnotation->SetText(vtkCornerAnnotation::LowerLeft,  "LL (<image>)" );
-  cornerAnnotation->SetText(vtkCornerAnnotation::LowerRight, "LR (<image_and_max>)" );
-  cornerAnnotation->SetText(vtkCornerAnnotation::UpperLeft,  "UL (<slice>)" );
-  cornerAnnotation->SetText(vtkCornerAnnotation::UpperRight, "UR (<slice_and_max>)" );
-
-  cornerAnnotation->SetText(vtkCornerAnnotation::UpperEdge,  "T (<window_level>)");
-  cornerAnnotation->SetText(vtkCornerAnnotation::LowerEdge,  "B (<slice_pos>)");
-  cornerAnnotation->SetText(vtkCornerAnnotation::LeftEdge,   "L (<window>)");
-  cornerAnnotation->SetText(vtkCornerAnnotation::RightEdge,  "R (<level>)");
-
+  cornerAnnotation->SetText( vtkCornerAnnotation::LowerLeft, "lower left" );
+  cornerAnnotation->SetText( vtkCornerAnnotation::LowerRight, "lower right" );
+  cornerAnnotation->SetText( vtkCornerAnnotation::UpperLeft, "upper left" );
+  cornerAnnotation->SetText( vtkCornerAnnotation::UpperRight, "upper right" );
   cornerAnnotation->GetTextProperty()->SetColor( 1,0,0);
 
   renderer->AddViewProp(cornerAnnotation);
diff --git a/Rendering/Annotation/Testing/Data/Baseline/TestBarChartActor.png.md5 b/Rendering/Annotation/Testing/Data/Baseline/TestBarChartActor.png.md5
index c5249ee..898f121 100644
--- a/Rendering/Annotation/Testing/Data/Baseline/TestBarChartActor.png.md5
+++ b/Rendering/Annotation/Testing/Data/Baseline/TestBarChartActor.png.md5
@@ -1 +1 @@
-c3eb6bd658da220fe45ab75ed022b543
+04429ee8d697b00be9b658c152cc34a7
diff --git a/Rendering/Annotation/Testing/Data/Baseline/TestBarChartActor_1.png.md5 b/Rendering/Annotation/Testing/Data/Baseline/TestBarChartActor_1.png.md5
deleted file mode 100644
index c310729..0000000
--- a/Rendering/Annotation/Testing/Data/Baseline/TestBarChartActor_1.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-5a4f59aefa73419fc065da8c4027be77
diff --git a/Rendering/Annotation/Testing/Data/Baseline/TestCaptionActor.png.md5 b/Rendering/Annotation/Testing/Data/Baseline/TestCaptionActor.png.md5
index 547b3ad..3b372b3 100644
--- a/Rendering/Annotation/Testing/Data/Baseline/TestCaptionActor.png.md5
+++ b/Rendering/Annotation/Testing/Data/Baseline/TestCaptionActor.png.md5
@@ -1 +1 @@
-50101c180fac543f8e5cff299c31cd59
+a84ace11ef6ec63994f9be321a24b5f9
diff --git a/Rendering/Annotation/Testing/Data/Baseline/TestCaptionActor2D.png.md5 b/Rendering/Annotation/Testing/Data/Baseline/TestCaptionActor2D.png.md5
index 0ee349c..e90232a 100644
--- a/Rendering/Annotation/Testing/Data/Baseline/TestCaptionActor2D.png.md5
+++ b/Rendering/Annotation/Testing/Data/Baseline/TestCaptionActor2D.png.md5
@@ -1 +1 @@
-aec09dbc013b0a090fb2a7123c34526e
+8da4ee7c48f341511c0e61a4e851b8c9
diff --git a/Rendering/Annotation/Testing/Data/Baseline/TestCaptionActor_1.png.md5 b/Rendering/Annotation/Testing/Data/Baseline/TestCaptionActor_1.png.md5
index 12a2d04..bb356d3 100644
--- a/Rendering/Annotation/Testing/Data/Baseline/TestCaptionActor_1.png.md5
+++ b/Rendering/Annotation/Testing/Data/Baseline/TestCaptionActor_1.png.md5
@@ -1 +1 @@
-3b0a123f21ae9514f9b02beab27ab73c
+cef3b676f5b613333f0299bef1304b2d
diff --git a/Rendering/Annotation/Testing/Data/Baseline/TestCaptionActor_2.png.md5 b/Rendering/Annotation/Testing/Data/Baseline/TestCaptionActor_2.png.md5
new file mode 100644
index 0000000..92dbb6d
--- /dev/null
+++ b/Rendering/Annotation/Testing/Data/Baseline/TestCaptionActor_2.png.md5
@@ -0,0 +1 @@
+9d81d2defe95ef7a25c7cfd22afce23e
diff --git a/Rendering/Annotation/Testing/Data/Baseline/TestCornerAnnotation.png.md5 b/Rendering/Annotation/Testing/Data/Baseline/TestCornerAnnotation.png.md5
index 8d607ae..69a388a 100644
--- a/Rendering/Annotation/Testing/Data/Baseline/TestCornerAnnotation.png.md5
+++ b/Rendering/Annotation/Testing/Data/Baseline/TestCornerAnnotation.png.md5
@@ -1 +1 @@
-e152ee480a291a7717edb72a5fac09a7
+217d4fbb2dec6374dcf20b9f290393d7
diff --git a/Rendering/Annotation/Testing/Data/Baseline/TestLegendBoxActor.png.md5 b/Rendering/Annotation/Testing/Data/Baseline/TestLegendBoxActor.png.md5
index 6720a2f..eb55064 100644
--- a/Rendering/Annotation/Testing/Data/Baseline/TestLegendBoxActor.png.md5
+++ b/Rendering/Annotation/Testing/Data/Baseline/TestLegendBoxActor.png.md5
@@ -1 +1 @@
-649dcabbd3ba870d3249fa077b606d13
+4cd8dd4e342d6a9f11d6230c6279bb5d
diff --git a/Rendering/Annotation/Testing/Data/Baseline/TestLegendBoxActor_1.png.md5 b/Rendering/Annotation/Testing/Data/Baseline/TestLegendBoxActor_1.png.md5
deleted file mode 100644
index e28cd1c..0000000
--- a/Rendering/Annotation/Testing/Data/Baseline/TestLegendBoxActor_1.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-8df4ac3a93e967582ca9d744b5e786a2
diff --git a/Rendering/Annotation/Testing/Data/Baseline/TestLegendScaleActor.png.md5 b/Rendering/Annotation/Testing/Data/Baseline/TestLegendScaleActor.png.md5
index 4ed237d..3987701 100644
--- a/Rendering/Annotation/Testing/Data/Baseline/TestLegendScaleActor.png.md5
+++ b/Rendering/Annotation/Testing/Data/Baseline/TestLegendScaleActor.png.md5
@@ -1 +1 @@
-30ad85258e5adf350f914408e634bc7c
+95c7d56f81fcc353b075455692b34966
diff --git a/Rendering/Annotation/Testing/Data/Baseline/TestPieChartActor.png.md5 b/Rendering/Annotation/Testing/Data/Baseline/TestPieChartActor.png.md5
index a1567b6..43491af 100644
--- a/Rendering/Annotation/Testing/Data/Baseline/TestPieChartActor.png.md5
+++ b/Rendering/Annotation/Testing/Data/Baseline/TestPieChartActor.png.md5
@@ -1 +1 @@
-9a82661b11e14f7f620b2af79ead0851
+e6ad191d6bcccba8e581e33543086147
diff --git a/Rendering/Annotation/Testing/Data/Baseline/TestPieChartActor_1.png.md5 b/Rendering/Annotation/Testing/Data/Baseline/TestPieChartActor_1.png.md5
deleted file mode 100644
index c5abf87..0000000
--- a/Rendering/Annotation/Testing/Data/Baseline/TestPieChartActor_1.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-2866033eb2e9ec2ebf9a9f10f8f52dc7
diff --git a/Rendering/Annotation/Testing/Data/Baseline/TestScalarBar.png.md5 b/Rendering/Annotation/Testing/Data/Baseline/TestScalarBar.png.md5
index 8d4ad3d..a2f18d0 100644
--- a/Rendering/Annotation/Testing/Data/Baseline/TestScalarBar.png.md5
+++ b/Rendering/Annotation/Testing/Data/Baseline/TestScalarBar.png.md5
@@ -1 +1 @@
-243828cd3f3c307e1ce2a652ffe163e7
+e553913d5caa95e2bbc6cd66846ad5b4
diff --git a/Rendering/Annotation/Testing/Data/Baseline/TestScalarBar_1.png.md5 b/Rendering/Annotation/Testing/Data/Baseline/TestScalarBar_1.png.md5
index d7a5165..b190db6 100644
--- a/Rendering/Annotation/Testing/Data/Baseline/TestScalarBar_1.png.md5
+++ b/Rendering/Annotation/Testing/Data/Baseline/TestScalarBar_1.png.md5
@@ -1 +1 @@
-a17999b8c873e0240b485aa0b77ae5dc
+251f24cebaf8165749840c5309e5e2eb
diff --git a/Rendering/Annotation/Testing/Data/Baseline/TestScalarBar_2.png.md5 b/Rendering/Annotation/Testing/Data/Baseline/TestScalarBar_2.png.md5
index ccc2560..fcb9e69 100644
--- a/Rendering/Annotation/Testing/Data/Baseline/TestScalarBar_2.png.md5
+++ b/Rendering/Annotation/Testing/Data/Baseline/TestScalarBar_2.png.md5
@@ -1 +1 @@
-55a198239c36b28ff6ed276a64c345a7
+2be4701c82336e7cd457a2df49da9581
diff --git a/Rendering/Annotation/Testing/Data/Baseline/TestSpiderPlotActor.png.md5 b/Rendering/Annotation/Testing/Data/Baseline/TestSpiderPlotActor.png.md5
index 40ac9a9..131022b 100644
--- a/Rendering/Annotation/Testing/Data/Baseline/TestSpiderPlotActor.png.md5
+++ b/Rendering/Annotation/Testing/Data/Baseline/TestSpiderPlotActor.png.md5
@@ -1 +1 @@
-78fee8561231415c57d2198267fda8af
+ead5faed95820ec7c4bf16d60b12b9f3
diff --git a/Rendering/Annotation/Testing/Data/Baseline/TestXYPlotActor.png.md5 b/Rendering/Annotation/Testing/Data/Baseline/TestXYPlotActor.png.md5
index 34417d4..2d116ca 100644
--- a/Rendering/Annotation/Testing/Data/Baseline/TestXYPlotActor.png.md5
+++ b/Rendering/Annotation/Testing/Data/Baseline/TestXYPlotActor.png.md5
@@ -1 +1 @@
-cee403d44e508721e173a434f43c5c8b
+d51a530c9fc10acc93932a70bac222d8
diff --git a/Rendering/Annotation/Testing/Data/Baseline/TestXYPlotActor_1.png.md5 b/Rendering/Annotation/Testing/Data/Baseline/TestXYPlotActor_1.png.md5
deleted file mode 100644
index 52338cc..0000000
--- a/Rendering/Annotation/Testing/Data/Baseline/TestXYPlotActor_1.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-cb2d066c25100384fd8041c92be67473
diff --git a/Rendering/Annotation/Testing/Data/Baseline/TestXYPlotActor_2.png.md5 b/Rendering/Annotation/Testing/Data/Baseline/TestXYPlotActor_2.png.md5
deleted file mode 100644
index 189f8f6..0000000
--- a/Rendering/Annotation/Testing/Data/Baseline/TestXYPlotActor_2.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-0c506679a90798d265ea39589cc7ede3
diff --git a/Rendering/Annotation/Testing/Data/Baseline/cubeAxes.png.md5 b/Rendering/Annotation/Testing/Data/Baseline/cubeAxes.png.md5
index 02351d9..93ab8b6 100644
--- a/Rendering/Annotation/Testing/Data/Baseline/cubeAxes.png.md5
+++ b/Rendering/Annotation/Testing/Data/Baseline/cubeAxes.png.md5
@@ -1 +1 @@
-835bc13d6872348b780a3a0410ce4dc9
+6b4583336635f57c04ba32972b11f63b
diff --git a/Rendering/Annotation/Testing/Data/Baseline/cubeAxes_1.png.md5 b/Rendering/Annotation/Testing/Data/Baseline/cubeAxes_1.png.md5
deleted file mode 100644
index 346f636..0000000
--- a/Rendering/Annotation/Testing/Data/Baseline/cubeAxes_1.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-1b87b24843bb0d8eb188b0293aae3ec6
diff --git a/Rendering/Annotation/Testing/Data/Baseline/xyPlot.png.md5 b/Rendering/Annotation/Testing/Data/Baseline/xyPlot.png.md5
index fe89cac..ce1fea3 100644
--- a/Rendering/Annotation/Testing/Data/Baseline/xyPlot.png.md5
+++ b/Rendering/Annotation/Testing/Data/Baseline/xyPlot.png.md5
@@ -1 +1 @@
-9644ca55b5f36bf84fc6daa8a21e3636
+196e4ea3291b715f85476b4c5a956b9f
diff --git a/Rendering/Annotation/Testing/Data/Baseline/xyPlot2.png.md5 b/Rendering/Annotation/Testing/Data/Baseline/xyPlot2.png.md5
index ada5c16..6d76aea 100644
--- a/Rendering/Annotation/Testing/Data/Baseline/xyPlot2.png.md5
+++ b/Rendering/Annotation/Testing/Data/Baseline/xyPlot2.png.md5
@@ -1 +1 @@
-463d81760506b3a65fdbd4920ac76f81
+4a158d59253c6015ca93f0ff651106ca
diff --git a/Rendering/Annotation/Testing/Data/Baseline/xyPlot2_1.png.md5 b/Rendering/Annotation/Testing/Data/Baseline/xyPlot2_1.png.md5
index e29946b..2748282 100644
--- a/Rendering/Annotation/Testing/Data/Baseline/xyPlot2_1.png.md5
+++ b/Rendering/Annotation/Testing/Data/Baseline/xyPlot2_1.png.md5
@@ -1 +1 @@
-2eb3c74177942200df52da0ec3dcc7cb
+09a93338ffb37a25864dd3fa0a8fc7c6
diff --git a/Rendering/Annotation/Testing/Data/Baseline/xyPlot3.png.md5 b/Rendering/Annotation/Testing/Data/Baseline/xyPlot3.png.md5
index df49d27..a0bfd2f 100644
--- a/Rendering/Annotation/Testing/Data/Baseline/xyPlot3.png.md5
+++ b/Rendering/Annotation/Testing/Data/Baseline/xyPlot3.png.md5
@@ -1 +1 @@
-3b6ccfe9711670c60eb1b1f375172b77
+04770d5576f14ea141682ac0cf58537a
diff --git a/Rendering/Annotation/Testing/Data/Baseline/xyPlot3_1.png.md5 b/Rendering/Annotation/Testing/Data/Baseline/xyPlot3_1.png.md5
new file mode 100644
index 0000000..9d5c7e8
--- /dev/null
+++ b/Rendering/Annotation/Testing/Data/Baseline/xyPlot3_1.png.md5
@@ -0,0 +1 @@
+6dc1603c1bcd200f332bec93f2d6a570
diff --git a/Rendering/Annotation/Testing/Data/Baseline/xyPlot4.png.md5 b/Rendering/Annotation/Testing/Data/Baseline/xyPlot4.png.md5
index ada5c16..6d76aea 100644
--- a/Rendering/Annotation/Testing/Data/Baseline/xyPlot4.png.md5
+++ b/Rendering/Annotation/Testing/Data/Baseline/xyPlot4.png.md5
@@ -1 +1 @@
-463d81760506b3a65fdbd4920ac76f81
+4a158d59253c6015ca93f0ff651106ca
diff --git a/Rendering/Annotation/Testing/Data/Baseline/xyPlot4_1.png.md5 b/Rendering/Annotation/Testing/Data/Baseline/xyPlot4_1.png.md5
index e29946b..2748282 100644
--- a/Rendering/Annotation/Testing/Data/Baseline/xyPlot4_1.png.md5
+++ b/Rendering/Annotation/Testing/Data/Baseline/xyPlot4_1.png.md5
@@ -1 +1 @@
-2eb3c74177942200df52da0ec3dcc7cb
+09a93338ffb37a25864dd3fa0a8fc7c6
diff --git a/Rendering/Annotation/Testing/Tcl/cubeAxes.tcl b/Rendering/Annotation/Testing/Tcl/cubeAxes.tcl
index 98d75c8..9100f22 100644
--- a/Rendering/Annotation/Testing/Tcl/cubeAxes.tcl
+++ b/Rendering/Annotation/Testing/Tcl/cubeAxes.tcl
@@ -52,7 +52,9 @@ vtkRenderWindowInteractor iren
 ren1 AddViewProp foheActor
 ren1 AddViewProp outlineActor
 ren2 AddViewProp foheActor
-ren2 AddViewProp outlineActor
+if { [info command "rtExMath"] == ""} {
+  ren2 AddViewProp outlineActor
+}
 
 ren1 SetBackground 0.1 0.2 0.4
 ren2 SetBackground 0.1 0.2 0.4
diff --git a/Rendering/Annotation/module.cmake b/Rendering/Annotation/module.cmake
index 4d0d4af..daf6f32 100644
--- a/Rendering/Annotation/module.cmake
+++ b/Rendering/Annotation/module.cmake
@@ -8,12 +8,10 @@ vtk_module(vtkRenderingAnnotation
     vtkFiltersSources
   TEST_DEPENDS
     vtkIOGeometry
-    vtkIOParallel
-    vtkRendering${VTK_RENDERING_BACKEND}
+    vtkRenderingFreeType${VTK_RENDERING_BACKEND}
     vtkTestingRendering
     vtkInteractionStyle
     vtkRenderingLOD
-    vtkImagingSources
   KIT
     vtkRendering
   )
diff --git a/Rendering/Annotation/vtkAxisActor.cxx b/Rendering/Annotation/vtkAxisActor.cxx
index eb12abd..0faa965 100644
--- a/Rendering/Annotation/vtkAxisActor.cxx
+++ b/Rendering/Annotation/vtkAxisActor.cxx
@@ -33,7 +33,6 @@
 #include "vtkTextProperty.h"
 #include "vtkVectorText.h"
 #include "vtkViewport.h"
-#include "vtkWindow.h"
 
 vtkStandardNewMacro(vtkAxisActor);
 vtkCxxSetObjectMacro(vtkAxisActor, Camera, vtkCamera);
@@ -680,7 +679,7 @@ int vtkAxisActor::HasTranslucentPolygonalGeometry()
       }
 
     if (this->DrawGridpolys &&
-        this->GridpolysActor->HasTranslucentPolygonalGeometry())
+        this-GridpolysActor->HasTranslucentPolygonalGeometry())
       {
       return 1;
       }
@@ -987,13 +986,6 @@ vtkAxisActor::SetLabelPositions2D(vtkViewport *viewport, bool force)
     return;
     }
 
-  vtkWindow *win = viewport->GetVTKWindow();
-  if (!win)
-    {
-    vtkErrorMacro(<<"No render window available: cannot determine DPI.");
-    return;
-    }
-
   for (int i = 0; i < this->NumberOfLabelsBuilt; i++)
     {
     ptIdx = 4*i + 1;
@@ -1010,8 +1002,7 @@ vtkAxisActor::SetLabelPositions2D(vtkViewport *viewport, bool force)
 
     int bbox[4];
     if (!tren->GetBoundingBox(this->LabelActors2D[i]->GetTextProperty(),
-                              this->LabelActors2D[i]->GetInput(), bbox,
-                              win->GetDPI()))
+                              this->LabelActors2D[i]->GetInput(), bbox))
       {
       vtkErrorMacro(<< "Unable to calculate bounding box for label "
                     << this->LabelActors2D[i]->GetInput());
diff --git a/Rendering/Annotation/vtkAxisActor2D.cxx b/Rendering/Annotation/vtkAxisActor2D.cxx
index e246be7..a404917 100644
--- a/Rendering/Annotation/vtkAxisActor2D.cxx
+++ b/Rendering/Annotation/vtkAxisActor2D.cxx
@@ -358,6 +358,7 @@ void vtkAxisActor2D::BuildAxis(vtkViewport *viewport)
   // Initialize and get important info
   this->Axis->Initialize();
   this->AxisActor->SetProperty(this->GetProperty());
+  this->TitleActor->SetProperty(this->GetProperty());
 
   // Compute the location of tick marks and labels
 
@@ -441,7 +442,7 @@ void vtkAxisActor2D::BuildAxis(vtkViewport *viewport)
     const double worldLength = vtkMath::Norm(wp21);
     const double worldDistance = this->RulerDistance / (this->NumberOfMinorTicks+1);
     numTicks = static_cast<int>(
-      worldDistance <= 0.0 ? 0.0 : (worldLength / worldDistance));
+      worldDistance <= 0.0 ? 0. : (worldLength / worldDistance));
     const double precision = std::numeric_limits<double>::epsilon();
     const bool hasRemainderInDivision = worldDistance <= 0.0 ? false:
       std::fmod(worldLength, worldDistance) > precision;
@@ -452,7 +453,7 @@ void vtkAxisActor2D::BuildAxis(vtkViewport *viewport)
     // Tick distance was computed in world coordinates, convert to viewport
     // coordinates.
     const double worldToLocalRatio =
-      (worldLength <= 0.0 ? 0.0 : length / worldLength);
+      (worldLength < 0.0 ? 0. : length / worldLength);
     distance = worldDistance * worldToLocalRatio;
     }
   else
@@ -535,6 +536,7 @@ void vtkAxisActor2D::BuildAxis(vtkViewport *viewport)
     // Copy prop and text prop eventually
     for (i = 0; i < this->AdjustedNumberOfLabels; i++)
         {
+        this->LabelActors[i]->SetProperty(this->GetProperty());
         if (this->LabelTextProperty->GetMTime() > this->BuildTime ||
             this->AdjustedRangeBuildTime > this->BuildTime)
           {
diff --git a/Rendering/Annotation/vtkBarChartActor.cxx b/Rendering/Annotation/vtkBarChartActor.cxx
index 3d2f53b..61f9695 100644
--- a/Rendering/Annotation/vtkBarChartActor.cxx
+++ b/Rendering/Annotation/vtkBarChartActor.cxx
@@ -91,7 +91,6 @@ vtkBarChartActor::vtkBarChartActor()
   this->GlyphSource->SetGlyphTypeToNone();
   this->GlyphSource->DashOn();
   this->GlyphSource->FilledOff();
-  this->GlyphSource->Update();
 
   this->YAxis = vtkAxisActor2D::New();
   this->YAxis->GetPositionCoordinate()->SetCoordinateSystemToViewport();
diff --git a/Rendering/Annotation/vtkCornerAnnotation.cxx b/Rendering/Annotation/vtkCornerAnnotation.cxx
index d4bca8b..1d77977 100644
--- a/Rendering/Annotation/vtkCornerAnnotation.cxx
+++ b/Rendering/Annotation/vtkCornerAnnotation.cxx
@@ -53,7 +53,7 @@ vtkCornerAnnotation::vtkCornerAnnotation()
   this->TextProperty = vtkTextProperty::New();
   this->TextProperty->ShadowOff();
 
-  for (int i = 0; i < NumTextPositions; i++)
+  for (int i = 0; i < 4; i++)
     {
     this->CornerText[i] = NULL;
     this->TextMapper[i] = vtkTextMapper::New();
@@ -76,7 +76,7 @@ vtkCornerAnnotation::~vtkCornerAnnotation()
 {
   this->SetTextProperty(NULL);
 
-  for (int i = 0; i < NumTextPositions; i++)
+  for (int i = 0; i < 4; i++)
     {
     delete [] this->CornerText[i];
     this->TextMapper[i]->Delete();
@@ -94,7 +94,7 @@ vtkCornerAnnotation::~vtkCornerAnnotation()
 void vtkCornerAnnotation::ReleaseGraphicsResources(vtkWindow *win)
 {
   this->Superclass::ReleaseGraphicsResources(win);
-  for (int i = 0; i < NumTextPositions; i++)
+  for (int i = 0; i < 4; i++)
     {
     this->TextActor[i]->ReleaseGraphicsResources(win);
     }
@@ -142,7 +142,7 @@ void vtkCornerAnnotation::TextReplace(vtkImageActor *ia,
 
 
   // search for tokens, replace and then assign to TextMappers
-  for (i = 0; i < NumTextPositions; i++)
+  for (i = 0; i < 4; i++)
     {
     if (this->CornerText[i] && strlen(this->CornerText[i]))
       {
@@ -350,7 +350,7 @@ int vtkCornerAnnotation::RenderOverlay(vtkViewport *viewport)
   // only render if font is at least minimum font
   if (this->FontSize >= this->MinimumFontSize)
     {
-    for (int i = 0; i < NumTextPositions; i++)
+    for (int i = 0; i < 4; i++)
       {
       this->TextActor[i]->RenderOverlay(viewport);
       }
@@ -384,6 +384,7 @@ int GetNumberOfLines(const char *str)
 int vtkCornerAnnotation::RenderOpaqueGeometry(vtkViewport *viewport)
 {
   int fontSize;
+  int i;
 
   // Check to see whether we have to rebuild everything
   // If the viewport has changed we may - or may not need
@@ -411,7 +412,7 @@ int vtkCornerAnnotation::RenderOpaqueGeometry(vtkViewport *viewport)
     {
     vtkPropCollection *pc = viewport->GetViewProps();
     int numProps = pc->GetNumberOfItems();
-    for (int i = 0; i < numProps; i++)
+    for (i = 0; i < numProps; i++)
       {
       ia = vtkImageActor::SafeDownCast(pc->GetItemAsObject(i));
       if (ia)
@@ -461,12 +462,22 @@ int vtkCornerAnnotation::RenderOpaqueGeometry(vtkViewport *viewport)
 
       if (tprop_has_changed)
         {
-        for (int i = 0; i < NumTextPositions; i++)
-          {
-          vtkTextProperty *tprop = this->TextMapper[i]->GetTextProperty();
-          tprop->ShallowCopy(this->TextProperty);
-          tprop->SetFontSize(fontSize);
-          }
+        vtkTextProperty *tprop = this->TextMapper[0]->GetTextProperty();
+        tprop->ShallowCopy(this->TextProperty);
+        tprop->SetFontSize(fontSize);
+
+        tprop = this->TextMapper[1]->GetTextProperty();
+        tprop->ShallowCopy(this->TextProperty);
+        tprop->SetFontSize(fontSize);
+
+        tprop = this->TextMapper[2]->GetTextProperty();
+        tprop->ShallowCopy(this->TextProperty);
+        tprop->SetFontSize(fontSize);
+
+        tprop = this->TextMapper[3]->GetTextProperty();
+        tprop->ShallowCopy(this->TextProperty);
+        tprop->SetFontSize(fontSize);
+
         this->SetTextActorsJustification();
         }
 
@@ -474,18 +485,17 @@ int vtkCornerAnnotation::RenderOpaqueGeometry(vtkViewport *viewport)
       // use the last size as a first guess
 
       /*
-          +---------+
-          |2   7   3|
-          |         |
-          |6       5|
-          |         |
-          |0   4   1|
-          +---------+
+          +--------+
+          |2      3|
+          |        |
+          |        |
+          |0      1|
+          +--------+
       */
 
-      int tempi[2*NumTextPositions];
+      int tempi[8];
       int allZeros = 1;
-      for (int i = 0; i < NumTextPositions; i++)
+      for (i = 0; i < 4; i++)
         {
         this->TextMapper[i]->GetSize(viewport, tempi + i * 2);
         if (tempi[2*i] > 0 || tempi[2*i+1] > 0)
@@ -499,16 +509,13 @@ int vtkCornerAnnotation::RenderOpaqueGeometry(vtkViewport *viewport)
         return 0;
         }
 
-      int height_02 = tempi[1] + tempi[5];  // total height of text in left top/bottom corners
-      int height_13 = tempi[3] + tempi[7];  // total height of text in right top/bottom corners
-      int height_47 = tempi[9] + tempi[15]; // total height of text at center of top/bottom edges
+      int height_02 = tempi[1] + tempi[5];
+      int height_13 = tempi[3] + tempi[7];
 
-      int width_01 = tempi[0] + tempi[2];   // total width of text on botttom left/right corners
-      int width_23 = tempi[4] + tempi[6];   // total width of text on top left/right corners
-      int width_56 = tempi[10] + tempi[12]; // total width of text at center of left/right edges
+      int width_01 = tempi[0] + tempi[2];
+      int width_23 = tempi[4] + tempi[6];
 
-      int max_width_corners = (width_01 > width_23) ? width_01 : width_23;
-      int max_width         = (width_56 > max_width_corners) ? width_56 : max_width_corners;
+      int max_width = (width_01 > width_23) ? width_01 : width_23;
 
       int num_lines_02 = GetNumberOfLines(this->TextMapper[0]->GetInput())
           + GetNumberOfLines(this->TextMapper[2]->GetInput());
@@ -516,18 +523,12 @@ int vtkCornerAnnotation::RenderOpaqueGeometry(vtkViewport *viewport)
       int num_lines_13 = GetNumberOfLines(this->TextMapper[1]->GetInput())
           + GetNumberOfLines(this->TextMapper[3]->GetInput());
 
-      int num_lines_47 = GetNumberOfLines(this->TextMapper[4]->GetInput())
-          + GetNumberOfLines(this->TextMapper[7]->GetInput());
-
       int line_max_02 = (int)(vSize[1] * this->MaximumLineHeight) *
         (num_lines_02 ? num_lines_02 : 1);
 
       int line_max_13 = (int)(vSize[1] * this->MaximumLineHeight) *
         (num_lines_13 ? num_lines_13 : 1);
 
-      int line_max_47 = (int)(vSize[1] * this->MaximumLineHeight) *
-        (num_lines_47 ? num_lines_47 : 1);
-
       // Target size is to use 90% of x and y
 
       int tSize[2];
@@ -538,58 +539,44 @@ int vtkCornerAnnotation::RenderOpaqueGeometry(vtkViewport *viewport)
 
       while (height_02 < tSize[1] &&
              height_13 < tSize[1] &&
-             height_47 < tSize[1] &&
              max_width < tSize[0] &&
              height_02 < line_max_02 &&
              height_13 < line_max_13 &&
-             height_47 < line_max_47 &&
              fontSize < 100)
         {
         fontSize++;
-        for (int i = 0; i < NumTextPositions; i++)
+        for (i = 0; i < 4; i++)
           {
           this->TextMapper[i]->GetTextProperty()->SetFontSize(fontSize);
           this->TextMapper[i]->GetSize(viewport, tempi + i * 2);
           }
         height_02 = tempi[1] + tempi[5];
         height_13 = tempi[3] + tempi[7];
-        height_47 = tempi[9] + tempi[15];
-
         width_01 = tempi[0] + tempi[2];
         width_23 = tempi[4] + tempi[6];
-        width_56 = tempi[10] + tempi[12];
-
-        max_width_corners = (width_01 > width_23) ? width_01 : width_23;
-        max_width         = (width_56 > max_width_corners) ? width_56 : max_width_corners;
+        max_width = (width_01 > width_23) ? width_01 : width_23;
         }
 
       // While the size is too large decrease it
 
       while ((height_02 > tSize[1] ||
               height_13 > tSize[1] ||
-              height_47 > tSize[1] ||
               max_width > tSize[0] ||
               height_02 > line_max_02 ||
-              height_13 > line_max_13 ||
-              height_47 > line_max_47) &&
+              height_13 > line_max_13) &&
              fontSize > 0)
         {
         fontSize--;
-        for (int i = 0; i < NumTextPositions; i++)
+        for (i = 0; i < 4; i++)
           {
           this->TextMapper[i]->GetTextProperty()->SetFontSize(fontSize);
           this->TextMapper[i]->GetSize(viewport, tempi + i * 2);
           }
         height_02 = tempi[1] + tempi[5];
         height_13 = tempi[3] + tempi[7];
-        height_47 = tempi[9] + tempi[15];
-
         width_01 = tempi[0] + tempi[2];
         width_23 = tempi[4] + tempi[6];
-        width_56 = tempi[10] + tempi[12];
-
-        max_width_corners = (width_01 > width_23) ? width_01 : width_23;
-        max_width         = (width_56 > max_width_corners) ? width_56 : max_width_corners;
+        max_width = (width_01 > width_23) ? width_01 : width_23;
         }
 
       fontSize = static_cast<int>(pow((double)fontSize,
@@ -599,7 +586,7 @@ int vtkCornerAnnotation::RenderOpaqueGeometry(vtkViewport *viewport)
         fontSize = this->MaximumFontSize;
         }
       this->FontSize = fontSize;
-      for (int i = 0; i < NumTextPositions; i++)
+      for (i = 0; i < 4; i++)
         {
         this->TextMapper[i]->GetTextProperty()->SetFontSize(fontSize);
         }
@@ -608,7 +595,7 @@ int vtkCornerAnnotation::RenderOpaqueGeometry(vtkViewport *viewport)
 
       this->SetTextActorsPosition(vSize);
 
-      for (int i = 0; i < NumTextPositions; i++)
+      for (i = 0; i < 4; i++)
         {
         this->TextActor[i]->SetProperty(this->GetProperty());
         }
@@ -621,7 +608,7 @@ int vtkCornerAnnotation::RenderOpaqueGeometry(vtkViewport *viewport)
 
   if (this->FontSize >= this->MinimumFontSize)
     {
-    for (int i = 0; i < NumTextPositions; i++)
+    for (i = 0; i < 4; i++)
       {
       this->TextActor[i]->RenderOpaqueGeometry(viewport);
       }
@@ -641,57 +628,36 @@ int vtkCornerAnnotation::HasTranslucentPolygonalGeometry()
 //----------------------------------------------------------------------------
 void vtkCornerAnnotation::SetTextActorsPosition(int vsize[2])
 {
-  this->TextActor[LowerLeft]->SetPosition  ( 5,             5             );
-  this->TextActor[LowerRight]->SetPosition ( vsize[0] - 5,  5             );
-  this->TextActor[UpperLeft]->SetPosition  ( 5,             vsize[1] - 5  );
-  this->TextActor[UpperRight]->SetPosition ( vsize[0] - 5,  vsize[1] - 5  );
-
-  this->TextActor[LowerEdge]->SetPosition  ( vsize[0]/2,    5             );
-  this->TextActor[UpperEdge]->SetPosition  ( vsize[0]/2,    vsize[1] - 5  );
-  this->TextActor[LeftEdge]->SetPosition   ( 5,             vsize[1]/2    );
-  this->TextActor[RightEdge]->SetPosition  ( vsize[0] - 5,  vsize[1]/2    );
+  this->TextActor[LowerLeft]->SetPosition(5, 5);
+  this->TextActor[LowerRight]->SetPosition(vsize[0] - 5, 5);
+  this->TextActor[UpperLeft]->SetPosition(5, vsize[1] - 5);
+  this->TextActor[UpperRight]->SetPosition(vsize[0] - 5, vsize[1] - 5);
 }
 
 //----------------------------------------------------------------------------
 void vtkCornerAnnotation::SetTextActorsJustification()
 {
-  vtkTextProperty *tprop = this->TextMapper[LowerLeft]->GetTextProperty();
+  vtkTextProperty *tprop = this->TextMapper[0]->GetTextProperty();
   tprop->SetJustificationToLeft();
   tprop->SetVerticalJustificationToBottom();
 
-  tprop = this->TextMapper[LowerRight]->GetTextProperty();
+  tprop = this->TextMapper[1]->GetTextProperty();
   tprop->SetJustificationToRight();
   tprop->SetVerticalJustificationToBottom();
 
-  tprop = this->TextMapper[UpperLeft]->GetTextProperty();
+  tprop = this->TextMapper[2]->GetTextProperty();
   tprop->SetJustificationToLeft();
   tprop->SetVerticalJustificationToTop();
 
-  tprop = this->TextMapper[UpperRight]->GetTextProperty();
+  tprop = this->TextMapper[3]->GetTextProperty();
   tprop->SetJustificationToRight();
   tprop->SetVerticalJustificationToTop();
-
-  tprop = this->TextMapper[LowerEdge]->GetTextProperty();
-  tprop->SetJustificationToCentered();
-  tprop->SetVerticalJustificationToBottom();
-
-  tprop = this->TextMapper[UpperEdge]->GetTextProperty();
-  tprop->SetJustificationToCentered();
-  tprop->SetVerticalJustificationToTop();
-
-  tprop = this->TextMapper[LeftEdge]->GetTextProperty();
-  tprop->SetJustificationToLeft();
-  tprop->SetVerticalJustificationToCentered();
-
-  tprop = this->TextMapper[RightEdge]->GetTextProperty();
-  tprop->SetJustificationToRight();
-  tprop->SetVerticalJustificationToCentered();
 }
 
 //----------------------------------------------------------------------------
 void vtkCornerAnnotation::SetText(int i, const char *text)
 {
-  if (i < 0 || i >= NumTextPositions)
+  if (i < 0 || i > 3)
     {
     return;
     }
@@ -710,7 +676,7 @@ void vtkCornerAnnotation::SetText(int i, const char *text)
 //----------------------------------------------------------------------------
 const char* vtkCornerAnnotation::GetText(int i)
 {
-  if (i < 0 || i >= NumTextPositions)
+  if (i < 0 || i > 3)
     {
     return NULL;
     }
@@ -721,7 +687,7 @@ const char* vtkCornerAnnotation::GetText(int i)
 //----------------------------------------------------------------------------
 void vtkCornerAnnotation::ClearAllTexts()
 {
-  for (int i = 0; i < NumTextPositions; i++)
+  for (int i = 0; i < 4; i++)
     {
     this->SetText(i, "");
     }
@@ -730,7 +696,7 @@ void vtkCornerAnnotation::ClearAllTexts()
 //----------------------------------------------------------------------------
 void vtkCornerAnnotation::CopyAllTextsFrom(vtkCornerAnnotation *ca)
 {
-  for (int i = 0; i < NumTextPositions; i++)
+  for (int i = 0; i < 4; i++)
     {
     this->SetText(i, ca->GetText(i));
     }
diff --git a/Rendering/Annotation/vtkCornerAnnotation.h b/Rendering/Annotation/vtkCornerAnnotation.h
index c8591f6..7f8abd0 100644
--- a/Rendering/Annotation/vtkCornerAnnotation.h
+++ b/Rendering/Annotation/vtkCornerAnnotation.h
@@ -104,13 +104,8 @@ public:
     LowerLeft = 0, ///< Uses the lower left corner.
     LowerRight,    ///< Uses the lower right corner.
     UpperLeft,     ///< Uses the upper left corner.
-    UpperRight,    ///< Uses the upper right corner.
-    LowerEdge,     ///< Uses the lower edge center.
-    RightEdge,     ///< Uses the right edge center.
-    LeftEdge,      ///< Uses the left edge center
-    UpperEdge      ///< Uses the upper edge center.
+    UpperRight     ///< Uses the upper right corner.
     };
-  static const int NumTextPositions = 8;
 
   // Description:
   // Set/Get the text to be displayed for each corner
@@ -166,13 +161,13 @@ protected:
   vtkImageActor *ImageActor;
   vtkImageActor *LastImageActor;
 
-  char *CornerText[NumTextPositions];
+  char *CornerText[4];
 
   int FontSize;
-  vtkActor2D    *TextActor[NumTextPositions];
+  vtkActor2D    *TextActor[4];
   vtkTimeStamp   BuildTime;
   int            LastSize[2];
-  vtkTextMapper *TextMapper[NumTextPositions];
+  vtkTextMapper *TextMapper[4];
 
   int MinimumFontSize;
   int MaximumFontSize;
diff --git a/Rendering/Annotation/vtkCubeAxesActor.cxx b/Rendering/Annotation/vtkCubeAxesActor.cxx
index 0bf9cc4..cfc4df4 100644
--- a/Rendering/Annotation/vtkCubeAxesActor.cxx
+++ b/Rendering/Annotation/vtkCubeAxesActor.cxx
@@ -2206,6 +2206,8 @@ void vtkCubeAxesActor::BuildLabels(vtkAxisActor *axes[NUMBER_OF_ALIGNED_AXIS])
   double axis[3] = { p2[0]-p1[0], p2[1]-p1[1], p2[2]-p1[2] };
   double axisLength = vtkMath::Norm(axis);
   double extents = range[1] - range[0];
+  double rangeScale = axisLength / extents;
+  double labelCountAsDouble = (axisLength - (val-range[0])*rangeScale) / deltaMajor;
   bool mustAdjustValue = 0;
   int lastPow = 0;
   int axisIndex = 0;
@@ -2236,14 +2238,12 @@ void vtkCubeAxesActor::BuildLabels(vtkAxisActor *axes[NUMBER_OF_ALIGNED_AXIS])
     }
   customizedLabels = this->AxisLabels[axisIndex];
   // figure out how many labels we need:
-  if(extents == 0)
+  if(extents == 0 || vtkMath::IsNan(labelCountAsDouble))
     {
     labelCount = 0;
     }
   else
     {
-    double rangeScale = axisLength / extents;
-    double labelCountAsDouble = (axisLength - (val-range[0])*rangeScale) / deltaMajor;
     labelCount = vtkMath::Floor(labelCountAsDouble+2*FLT_EPSILON) + 1;
     }
 
diff --git a/Rendering/Annotation/vtkLegendBoxActor.cxx b/Rendering/Annotation/vtkLegendBoxActor.cxx
index 5c1095e..5d04234 100644
--- a/Rendering/Annotation/vtkLegendBoxActor.cxx
+++ b/Rendering/Annotation/vtkLegendBoxActor.cxx
@@ -555,11 +555,6 @@ double* vtkLegendBoxActor::GetEntryColor(int i)
 // resources to release.
 void vtkLegendBoxActor::ReleaseGraphicsResources(vtkWindow *win)
 {
-  if ( this->BackgroundActor )
-     {
-     this->BackgroundActor->ReleaseGraphicsResources(win);
-     }
-
   if ( this->BorderActor )
      {
      this->BorderActor->ReleaseGraphicsResources(win);
@@ -675,6 +670,7 @@ int vtkLegendBoxActor::RenderOpaqueGeometry(vtkViewport *viewport)
     //Find the longest string and symbol width ratio
     int length, maxLength;
     int maxTextMapper = 0;
+    char *str;
     int tempi[2], fontSize;
     double sf, twr, swr;
     double *bounds;
@@ -683,13 +679,16 @@ int vtkLegendBoxActor::RenderOpaqueGeometry(vtkViewport *viewport)
 
     for (swr=0.0, maxLength=i=0; i<this->NumberOfEntries; i++)
       {
-      this->TextMapper[i]->GetTextProperty()->SetFontSize(12);
-      length = this->TextMapper[i]->GetWidth(viewport);
-      if ( length > maxLength )
+      str = this->TextMapper[i]->GetInput();
+      if ( str ) //if there is a string
         {
-        maxLength = length;
-        maxTextMapper = i;
-        }
+        length = static_cast<int>(strlen(str));
+        if ( length > maxLength )
+          {
+          maxLength = length;
+          maxTextMapper = i;
+          }
+        }//if string
 
       if ( this->Symbol[i] ) //if there is a symbol
         {
@@ -818,9 +817,7 @@ int vtkLegendBoxActor::RenderOpaqueGeometry(vtkViewport *viewport)
       posY = p2[1] - this->Padding - (double)i*size[1] - 0.5*size[1];
       this->TextActor[i]->SetPosition(posX,posY);
       this->TextMapper[i]->GetTextProperty()->SetFontSize(fontSize);
-      this->TextMapper[i]->GetTextProperty()->SetVerticalJustification(
-            VTK_TEXT_CENTERED);
-      this->TextMapper[i]->GetTextProperty()->SetJustification(VTK_TEXT_LEFT);
+      this->TextActor[i]->GetProperty()->DeepCopy(this->GetProperty());
       this->Colors->GetTuple(i, color);
       if ( color[0] >= 0.0 && color[1] >= 0.0 && color[2] >= 0.0 )
         {
diff --git a/Rendering/Annotation/vtkLegendScaleActor.cxx b/Rendering/Annotation/vtkLegendScaleActor.cxx
index b867a9c..09c06bf 100644
--- a/Rendering/Annotation/vtkLegendScaleActor.cxx
+++ b/Rendering/Annotation/vtkLegendScaleActor.cxx
@@ -192,13 +192,6 @@ void vtkLegendScaleActor::ReleaseGraphicsResources(vtkWindow *w)
   this->TopAxis->ReleaseGraphicsResources(w);
   this->LeftAxis->ReleaseGraphicsResources(w);
   this->BottomAxis->ReleaseGraphicsResources(w);
-
-  this->LegendActor->ReleaseGraphicsResources(w);
-
-  for (int i=0; i<6; i++)
-    {
-    this->LabelActors[i]->ReleaseGraphicsResources(w);
-    }
 }
 
 //----------------------------------------------------------------------
diff --git a/Rendering/Annotation/vtkPieChartActor.cxx b/Rendering/Annotation/vtkPieChartActor.cxx
index 1b8afb1..6c45514 100644
--- a/Rendering/Annotation/vtkPieChartActor.cxx
+++ b/Rendering/Annotation/vtkPieChartActor.cxx
@@ -106,7 +106,6 @@ vtkPieChartActor::vtkPieChartActor()
   this->GlyphSource->SetGlyphTypeToNone();
   this->GlyphSource->DashOn();
   this->GlyphSource->FilledOff();
-  this->GlyphSource->Update();
 
   this->PlotData = vtkPolyData::New();
   this->PlotMapper = vtkPolyDataMapper2D::New();
@@ -638,6 +637,7 @@ int vtkPieChartActor::PlaceAxes(vtkViewport *viewport, int* vtkNotUsed(size))
 
   this->TitleActor->GetPositionCoordinate()->
     SetValue(this->Center[0],this->Center[1]+this->Radius+tsize[1]);
+  this->TitleActor->SetProperty(this->GetProperty());
 
   //Clean up
   webPts->Delete();
diff --git a/Rendering/Annotation/vtkScalarBarActor.cxx b/Rendering/Annotation/vtkScalarBarActor.cxx
index 76331cf..5664396 100644
--- a/Rendering/Annotation/vtkScalarBarActor.cxx
+++ b/Rendering/Annotation/vtkScalarBarActor.cxx
@@ -144,11 +144,6 @@ vtkScalarBarActor::vtkScalarBarActor()
   this->P->AnnotationLeadersActor->GetPositionCoordinate()->
     SetReferenceCoordinate(this->PositionCoordinate);
 
-  this->P->TitleBox.Posn[0] = 0;
-  this->P->TitleBox.Posn[1] = 0;
-  this->P->TitleBox.Size[0] = 0;
-  this->P->TitleBox.Size[1] = 0;
-
   // If opacity is on, a jail like texture is displayed behind it..
 
   this->UseOpacity       = 0;
@@ -2066,7 +2061,7 @@ struct vtkScalarBarHLabelPlacer
 
     // II. Loop over all labels checking for interference.
     // Where found, close current line and start new one on the other side.
-    int ic = static_cast<int>(this->Places.size()) / 2;
+    int ic = this->Places.size() / 2;
     int lf, rt;
     bool done = false;
     if (!this->HaveCtr)
diff --git a/Rendering/Annotation/vtkScalarBarActorInternal.h b/Rendering/Annotation/vtkScalarBarActorInternal.h
index c2024aa..4d79e1e 100644
--- a/Rendering/Annotation/vtkScalarBarActorInternal.h
+++ b/Rendering/Annotation/vtkScalarBarActorInternal.h
@@ -3,6 +3,7 @@
 // VTK-HeaderTest-Exclude: vtkScalarBarActorInternal.h
 
 #include "vtkColor.h" // for AnnotationColors, LabelColorMap, and tuples
+#include "vtkFreeTypeUtilities.h" // for bounding box calculations
 #include "vtkSmartPointer.h" // for "smart vectors"
 #include "vtkStdString.h" // for LabelMap
 
diff --git a/Rendering/Annotation/vtkSpiderPlotActor.cxx b/Rendering/Annotation/vtkSpiderPlotActor.cxx
index 1001dd5..a2dc69e 100644
--- a/Rendering/Annotation/vtkSpiderPlotActor.cxx
+++ b/Rendering/Annotation/vtkSpiderPlotActor.cxx
@@ -808,6 +808,7 @@ int vtkSpiderPlotActor::PlaceAxes(vtkViewport *viewport, int* vtkNotUsed(size))
 
   this->TitleActor->GetPositionCoordinate()->
     SetValue(this->Center[0],this->Center[1]+this->Radius+tsize[1]);
+  this->TitleActor->SetProperty(this->GetProperty());
 
   //Clean up
   webPts->Delete();
diff --git a/Rendering/Annotation/vtkXYPlotActor.cxx b/Rendering/Annotation/vtkXYPlotActor.cxx
index 80d1bd8..e6300fd 100644
--- a/Rendering/Annotation/vtkXYPlotActor.cxx
+++ b/Rendering/Annotation/vtkXYPlotActor.cxx
@@ -299,8 +299,11 @@ vtkXYPlotActor::~vtkXYPlotActor()
     {
     for ( int i = 0; i < num; ++i )
       {
-      delete [] this->SelectedInputScalars[i];
-      this->SelectedInputScalars[i] = NULL;
+      if ( this->SelectedInputScalars[i] )
+        {
+        delete [] this->SelectedInputScalars[i];
+        this->SelectedInputScalars[i] = NULL;
+        }
       }
     delete [] this->SelectedInputScalars;
     this->SelectedInputScalars = NULL;
@@ -509,8 +512,11 @@ void vtkXYPlotActor::RemoveAllDataSetInputConnections()
 
   for ( idx = 0; idx < num; ++idx )
     {
-    delete [] this->SelectedInputScalars[idx];
-    this->SelectedInputScalars[idx] = NULL;
+    if ( this->SelectedInputScalars[idx] )
+      {
+      delete [] this->SelectedInputScalars[idx];
+      this->SelectedInputScalars[idx] = NULL;
+      }
     }
   this->SelectedInputScalarsComponent->Reset();
 
@@ -561,8 +567,11 @@ void vtkXYPlotActor::RemoveDataSetInputConnection( vtkAlgorithmOutput *in,
 
   // Do not bother reallocating the SelectedInputScalars
   // string array to make it smaller.
-  delete [] this->SelectedInputScalars[found];
-  this->SelectedInputScalars[found] = NULL;
+  if ( this->SelectedInputScalars[found] )
+    {
+    delete [] this->SelectedInputScalars[found];
+    this->SelectedInputScalars[found] = NULL;
+    }
   for ( int idx = found+1; idx < num; ++idx )
     {
     this->SelectedInputScalars[idx-1] = this->SelectedInputScalars[idx];
@@ -1106,6 +1115,8 @@ int vtkXYPlotActor::RenderOpaqueGeometry( vtkViewport* viewport )
         this->TitleActor->GetPositionCoordinate()
           ->SetValue( this->TitlePosition[0], this->TitlePosition[1] );
         }
+
+      this->TitleActor->SetProperty( this->GetProperty() );
       }
 
     //Border and box - may adjust spacing based on font size relationship
diff --git a/Rendering/Context2D/vtkContext2D.cxx b/Rendering/Context2D/vtkContext2D.cxx
index 30d0be0..259be73 100644
--- a/Rendering/Context2D/vtkContext2D.cxx
+++ b/Rendering/Context2D/vtkContext2D.cxx
@@ -198,32 +198,6 @@ void vtkContext2D::DrawPoly(float *points, int n,
 }
 
 //-----------------------------------------------------------------------------
-void vtkContext2D::DrawLines(vtkPoints2D *points)
-{
-  // Construct an array with the correct coordinate packing for OpenGL.
-  int n = static_cast<int>(points->GetNumberOfPoints());
-  // If the points are of type float then call OpenGL directly
-  float *f = vtkFloatArray::SafeDownCast(points->GetData())->GetPointer(0);
-  this->DrawLines(f, n);
-}
-
-//-----------------------------------------------------------------------------
-void vtkContext2D::DrawLines(float *points, int n)
-{
-  if (!this->Device)
-    {
-    vtkErrorMacro(<< "Attempted to paint with no active vtkContextDevice2D.");
-    return;
-    }
-  if (n < 2)
-    {
-    vtkErrorMacro(<< "Attempted to paint a line with <2 points.");
-    return;
-    }
-  this->Device->DrawLines(points, n);
-}
-
-//-----------------------------------------------------------------------------
 void vtkContext2D::DrawPoint(float x, float y)
 {
   float p[] = { x, y };
diff --git a/Rendering/Context2D/vtkContext2D.h b/Rendering/Context2D/vtkContext2D.h
index e365870..a637541 100644
--- a/Rendering/Context2D/vtkContext2D.h
+++ b/Rendering/Context2D/vtkContext2D.h
@@ -125,16 +125,6 @@ public:
                 unsigned char *colors, int nc_comps);
 
   // Description:
-  // Draw multiple lines between the specified pairs of points.
-  // \sa DrawPoly()
-  void DrawLines(vtkPoints2D *points);
-
-  // Description:
-  // Draw multiple lines between the specified pairs of points
-  // \sa DrawPoly()
-  void DrawLines(float *points, int n);
-
-  // Description:
   // Draw a point at the supplied x and y coordinate
   void DrawPoint(float x, float y);
 
diff --git a/Rendering/Context2D/vtkContextDevice2D.h b/Rendering/Context2D/vtkContextDevice2D.h
index 2e5fea1..926e994 100644
--- a/Rendering/Context2D/vtkContextDevice2D.h
+++ b/Rendering/Context2D/vtkContextDevice2D.h
@@ -55,19 +55,10 @@ public:
   // layout of the coordinates. The line will be colored by
   // the colors array, which must be have nc_comps components (defining a single
   // color).
-  // \sa DrawLines()
   virtual void DrawPoly(float *points, int n,
                         unsigned char *colors = 0, int nc_comps = 0) = 0;
 
   // Description:
-  // Draw lines using the points - memory layout is as follows:
-  // l1p1,l1p2,l2p1,l2p2... The lines will be colored by colors array
-  // which has nc_comps components (defining a single color).
-  // \sa DrawPoly()
-  virtual void DrawLines(float *f, int n, unsigned char *colors = 0,
-                         int nc_comps = 0) = 0;
-
-  // Description:
   // Draw a series of points - fastest code path due to memory layout of the
   // coordinates. The colors and nc_comps are optional - color array.
   virtual void DrawPoints(float *points, int n, unsigned char* colors = 0,
diff --git a/Rendering/Context2D/vtkContextDevice3D.h b/Rendering/Context2D/vtkContextDevice3D.h
index 836e532..66de5cf 100644
--- a/Rendering/Context2D/vtkContextDevice3D.h
+++ b/Rendering/Context2D/vtkContextDevice3D.h
@@ -45,17 +45,10 @@ public:
 
   // Description:
   // Draw a polyline between the specified points.
-  // \sa DrawLines()
   virtual void DrawPoly(const float *verts, int n,
                         const unsigned char *colors = 0, int nc = 0) = 0;
 
   // Description:
-  // Draw lines defined by specified pair of points.
-  // \sa DrawPoly()
-  virtual void DrawLines(const float *verts, int n,
-                         const unsigned char *colors = 0, int nc = 0) = 0;
-
-  // Description:
   // Draw points at the vertex positions specified.
   virtual void DrawPoints(const float *verts, int n,
                           const unsigned char *colors = 0, int nc = 0) = 0;
diff --git a/Rendering/Context2D/vtkContextMouseEvent.h b/Rendering/Context2D/vtkContextMouseEvent.h
index 54aa336..b64fd0e 100644
--- a/Rendering/Context2D/vtkContextMouseEvent.h
+++ b/Rendering/Context2D/vtkContextMouseEvent.h
@@ -109,7 +109,11 @@ public:
   // are NO_MODIFIER, ALT_MODIFIER, SHIFT_MODIFIER and/or CONTROL_MODIFIER.
   int GetModifiers() const;
 
+#ifdef VTK_LEGACY_REMOVE
+  // Deprecating the public exposure of member variables for mouse events
+  // Deprecated in VTK 5.9.
 protected:
+#endif
   // Description:
   // Position of the mouse in item coordinate system.
   vtkVector2f Pos;
diff --git a/Rendering/Context2D/vtkContextScene.cxx b/Rendering/Context2D/vtkContextScene.cxx
index cbfae20..5f57697 100644
--- a/Rendering/Context2D/vtkContextScene.cxx
+++ b/Rendering/Context2D/vtkContextScene.cxx
@@ -232,17 +232,6 @@ int vtkContextScene::GetSceneHeight()
 }
 
 //-----------------------------------------------------------------------------
-vtkVector2i vtkContextScene::GetLogicalTileScale()
-{
-  vtkVector2i result(1);
-  if (this->ScaleTiles && this->Renderer && this->Renderer->GetRenderWindow())
-    {
-    this->Renderer->GetRenderWindow()->GetTileScale(result.GetData());
-    }
-  return result;
-}
-
-//-----------------------------------------------------------------------------
 void vtkContextScene::SetDirty(bool isDirty)
 {
   if (this->Storage->IsDirty == isDirty)
diff --git a/Rendering/Context2D/vtkContextScene.h b/Rendering/Context2D/vtkContextScene.h
index 9418473..f32e445 100644
--- a/Rendering/Context2D/vtkContextScene.h
+++ b/Rendering/Context2D/vtkContextScene.h
@@ -26,7 +26,6 @@
 #include "vtkRenderingContext2DModule.h" // For export macro
 #include "vtkObject.h"
 #include "vtkWeakPointer.h" // Needed for weak pointer to the window.
-#include "vtkVector.h" // For vtkVector return type.
 
 class vtkContext2D;
 class vtkAbstractContextItem;
@@ -134,13 +133,6 @@ public:
   vtkBooleanMacro(ScaleTiles, bool);
 
   // Description:
-  // The tile scale of the target vtkRenderWindow. Hardcoded pixel offsets, etc
-  // should properly account for these <x, y> scale factors. This will simply
-  // return vtkVector2i(1, 1) if ScaleTiles is false or if this->Renderer is
-  // NULL.
-  vtkVector2i GetLogicalTileScale();
-
-  // Description:
   // This should not be necessary as the context view should take care of
   // rendering.
   virtual void SetRenderer(vtkRenderer *renderer);
diff --git a/Rendering/ContextOpenGL/vtkOpenGLContextDevice2D.cxx b/Rendering/ContextOpenGL/vtkOpenGLContextDevice2D.cxx
index ec3866e..7946ebe 100644
--- a/Rendering/ContextOpenGL/vtkOpenGLContextDevice2D.cxx
+++ b/Rendering/ContextOpenGL/vtkOpenGLContextDevice2D.cxx
@@ -285,43 +285,6 @@ void vtkOpenGLContextDevice2D::DrawPoly(float *f, int n, unsigned char *colors,
 }
 
 //-----------------------------------------------------------------------------
-void vtkOpenGLContextDevice2D::DrawLines(float *f, int n, unsigned char *colors,
-                                         int nc)
-{
-  assert("f must be non-null" && f != NULL);
-  assert("n must be greater than 0" && n > 0);
-
-  vtkOpenGLClearErrorMacro();
-
-  this->SetLineType(this->Pen->GetLineType());
-  this->SetLineWidth(this->Pen->GetWidth());
-
-  if (colors)
-    {
-    glEnableClientState(GL_COLOR_ARRAY);
-    glColorPointer(nc, GL_UNSIGNED_BYTE, 0, colors);
-    }
-  else
-    {
-    glColor4ubv(this->Pen->GetColor());
-    }
-  glEnableClientState(GL_VERTEX_ARRAY);
-  glVertexPointer(2, GL_FLOAT, 0, f);
-  glDrawArrays(GL_LINES, 0, n);
-  glDisableClientState(GL_VERTEX_ARRAY);
-  if (colors)
-    {
-    glDisableClientState(GL_COLOR_ARRAY);
-    }
-
-  // Restore line type and width.
-  this->SetLineType(vtkPen::SOLID_LINE);
-  this->SetLineWidth(1.0f);
-
-  vtkOpenGLCheckErrorMacro("failed after DrawLines");
-}
-
-//-----------------------------------------------------------------------------
 void vtkOpenGLContextDevice2D::DrawPoints(float *f, int n, unsigned char *c,
                                           int nc)
 {
@@ -863,24 +826,15 @@ void vtkOpenGLContextDevice2D::DrawString(float *point,
   float p[] = { std::floor(point[0] * xScale) / xScale,
                 std::floor(point[1] * yScale) / yScale };
 
-  // TODO this currently ignores vtkContextScene::ScaleTiles. Not sure how to
-  // get at that from here, but this is better than ignoring scaling altogether.
-  // TODO Also, FreeType supports anisotropic DPI. Might be needed if the
-  // tileScale isn't homogeneous, but we'll need to update the textrenderer API
-  // and see if MPL/mathtext can support it.
-  int tileScale[2];
-  this->RenderWindow->GetTileScale(tileScale);
-  int dpi = this->RenderWindow->GetDPI() * std::max(tileScale[0], tileScale[1]);
-
   // Cache rendered text strings
   vtkTextureImageCache<UTF16TextPropertyKey>::CacheData &cache =
       this->Storage->TextTextureCache.GetCacheData(
-        UTF16TextPropertyKey(this->TextProp, string, dpi));
+        UTF16TextPropertyKey(this->TextProp, string));
   vtkImageData* image = cache.ImageData;
   if (image->GetNumberOfPoints() == 0 && image->GetNumberOfCells() == 0)
     {
     int textDims[2];
-    if (!this->TextRenderer->RenderString(this->TextProp, string, dpi, image,
+    if (!this->TextRenderer->RenderString(this->TextProp, string, image,
                                           textDims))
       {
       return;
@@ -932,16 +886,7 @@ void vtkOpenGLContextDevice2D::DrawString(float *point,
 void vtkOpenGLContextDevice2D::ComputeStringBounds(const vtkUnicodeString &string,
                                                    float bounds[4])
 {
-  // TODO this currently ignores vtkContextScene::ScaleTiles. Not sure how to
-  // get at that from here, but this is better than ignoring scaling altogether.
-  // TODO Also, FreeType supports anisotropic DPI. Might be needed if the
-  // tileScale isn't homogeneous, but we'll need to update the textrenderer API
-  // and see if MPL/mathtext can support it.
-  int tileScale[2];
-  this->RenderWindow->GetTileScale(tileScale);
-  int dpi = this->RenderWindow->GetDPI() * std::max(tileScale[0], tileScale[1]);
-
-  vtkVector2i box = this->TextRenderer->GetBounds(this->TextProp, string, dpi);
+  vtkVector2i box = this->TextRenderer->GetBounds(this->TextProp, string);
   // Check for invalid bounding box
   if (box[0] == VTK_INT_MIN || box[0] == VTK_INT_MAX ||
       box[1] == VTK_INT_MIN || box[1] == VTK_INT_MAX)
@@ -952,7 +897,6 @@ void vtkOpenGLContextDevice2D::ComputeStringBounds(const vtkUnicodeString &strin
     bounds[3] = static_cast<float>(0);
     return;
     }
-
   GLfloat mv[16];
   glGetFloatv(GL_MODELVIEW_MATRIX, mv);
   float xScale = mv[0];
@@ -968,7 +912,7 @@ void vtkOpenGLContextDevice2D::DrawMathTextString(float point[2],
                                                   const vtkStdString &string)
 {
   vtkMathTextUtilities *mathText = vtkMathTextUtilities::GetInstance();
-  if (!mathText || !mathText->IsAvailable())
+  if (!mathText)
     {
     vtkWarningMacro(<<"MathText is not available to parse string "
                     << string.c_str() << ". Install matplotlib and enable "
@@ -980,25 +924,16 @@ void vtkOpenGLContextDevice2D::DrawMathTextString(float point[2],
 
   float p[] = { std::floor(point[0]), std::floor(point[1]) };
 
-  // TODO this currently ignores vtkContextScene::ScaleTiles. Not sure how to
-  // get at that from here, but this is better than ignoring scaling altogether.
-  // TODO Also, FreeType supports anisotropic DPI. Might be needed if the
-  // tileScale isn't homogeneous, but we'll need to update the textrenderer API
-  // and see if MPL/mathtext can support it.
-  int tileScale[2];
-  this->RenderWindow->GetTileScale(tileScale);
-  int dpi = this->RenderWindow->GetDPI() * std::max(tileScale[0], tileScale[1]);
-
   // Cache rendered text strings
   vtkTextureImageCache<UTF8TextPropertyKey>::CacheData &cache =
     this->Storage->MathTextTextureCache.GetCacheData(
-      UTF8TextPropertyKey(this->TextProp, string, dpi));
+      UTF8TextPropertyKey(this->TextProp, string));
   vtkImageData* image = cache.ImageData;
   if (image->GetNumberOfPoints() == 0 && image->GetNumberOfCells() == 0)
     {
     int textDims[2];
-    if (!mathText->RenderString(string.c_str(), image, this->TextProp, dpi,
-                                textDims))
+    if (!mathText->RenderString(string.c_str(), image, this->TextProp,
+                                this->RenderWindow->GetDPI(), textDims))
       {
       return;
       }
@@ -1538,7 +1473,6 @@ vtkImageData *vtkOpenGLContextDevice2D::GenerateMarker(int shape, int width,
       }
     default: // Maintaining old behavior, which produces plus for unknown shape
       vtkWarningMacro(<<"Invalid marker shape: " << shape);
-      VTK_FALLTHROUGH;
     case VTK_MARKER_PLUS:
       {
       int center = (width + 1) / 2;
@@ -1614,20 +1548,20 @@ void vtkOpenGLContextDevice2D::PrintSelf(ostream &os, vtkIndent indent)
   this->Superclass::PrintSelf(os, indent);
   os << indent << "Renderer: ";
   if (this->Renderer)
-    {
+  {
     os << endl;
     this->Renderer->PrintSelf(os, indent.GetNextIndent());
-    }
+  }
   else
     {
     os << "(none)" << endl;
     }
   os << indent << "Text Renderer: ";
-  if (this->TextRenderer)
-    {
+  if (this->Renderer)
+  {
     os << endl;
     this->TextRenderer->PrintSelf(os, indent.GetNextIndent());
-    }
+  }
   else
     {
     os << "(none)" << endl;
diff --git a/Rendering/ContextOpenGL/vtkOpenGLContextDevice2D.h b/Rendering/ContextOpenGL/vtkOpenGLContextDevice2D.h
index 32bce6a..9124a5b 100644
--- a/Rendering/ContextOpenGL/vtkOpenGLContextDevice2D.h
+++ b/Rendering/ContextOpenGL/vtkOpenGLContextDevice2D.h
@@ -52,23 +52,14 @@ public:
   // Description:
   // Draw a poly line using the points - fastest code path due to memory
   // layout of the coordinates. The line will be colored by colors array
-  // which has nc_comps components.
-  // \sa DrawLines()
+  // which has nc_comps components
   virtual void DrawPoly(float *f, int n, unsigned char *colors = 0,
                         int nc_comps = 0);
 
   // Description:
-  // Draw lines using the points - memory layout is as follows:
-  // l1p1,l1p2,l2p1,l2p2... The lines will be colored by colors array
-  // which has nc_comps components.
-  // \sa DrawPoly()
-  virtual void DrawLines(float *f, int n, unsigned char *colors = 0,
-                         int nc_comps = 0);
-
-  // Description:
   // Draw a series of points - fastest code path due to memory
   // layout of the coordinates. Points are colored by colors array
-  // which has nc_comps components.
+  // which has nc_comps components
   virtual void DrawPoints(float *points, int n, unsigned char* colors = 0,
                           int nc_comps = 0);
 
diff --git a/Rendering/ContextOpenGL/vtkOpenGLContextDevice2DPrivate.h b/Rendering/ContextOpenGL/vtkOpenGLContextDevice2DPrivate.h
index 4e07643..65026cd 100644
--- a/Rendering/ContextOpenGL/vtkOpenGLContextDevice2DPrivate.h
+++ b/Rendering/ContextOpenGL/vtkOpenGLContextDevice2DPrivate.h
@@ -172,16 +172,14 @@ struct TextPropertyKey
   // Transform a text property into an unsigned long
   static unsigned int GetIdFromTextProperty(vtkTextProperty* textProperty)
   {
-    size_t id;
+    unsigned long id;
     vtkFreeTypeTools::GetInstance()->MapTextPropertyToId(textProperty, &id);
-    // Truncation on 64-bit machines! The id is a pointer.
     return static_cast<unsigned int>(id);
   }
 
   // Description:
   // Creates a TextPropertyKey.
-  TextPropertyKey(vtkTextProperty* textProperty, const StringType& text,
-                  int dpi)
+  TextPropertyKey(vtkTextProperty* textProperty, const StringType& text)
   {
     this->TextPropertyId = GetIdFromTextProperty(textProperty);
     this->FontSize = textProperty->GetFontSize();
@@ -192,7 +190,6 @@ struct TextPropertyKey
                     static_cast<unsigned char>(color[2] * 255),
                     static_cast<unsigned char>(textProperty->GetOpacity() * 255));
     this->Text = text;
-    this->DPI = dpi;
   }
 
   // Description:
@@ -206,8 +203,7 @@ struct TextPropertyKey
       this->Color[0] == other.Color[0] &&
       this->Color[1] == other.Color[1] &&
       this->Color[2] == other.Color[2] &&
-      this->Color[3] == other.Color[3] &&
-      this->DPI == other.DPI;
+      this->Color[3] == other.Color[3];
   }
 
   unsigned short FontSize;
@@ -215,7 +211,6 @@ struct TextPropertyKey
   // States in the function not to use more than 32 bits - int works fine here.
   unsigned int TextPropertyId;
   StringType Text;
-  int DPI;
 };
 
 typedef TextPropertyKey<vtkStdString> UTF8TextPropertyKey;
diff --git a/Rendering/ContextOpenGL/vtkOpenGLContextDevice3D.cxx b/Rendering/ContextOpenGL/vtkOpenGLContextDevice3D.cxx
index a4aefce..635a3cc 100644
--- a/Rendering/ContextOpenGL/vtkOpenGLContextDevice3D.cxx
+++ b/Rendering/ContextOpenGL/vtkOpenGLContextDevice3D.cxx
@@ -143,7 +143,6 @@ vtkOpenGLContextDevice3D::~vtkOpenGLContextDevice3D()
   delete Storage;
 }
 
-//-----------------------------------------------------------------------------
 void vtkOpenGLContextDevice3D::DrawPoly(const float *verts, int n,
                                         const unsigned char *colors, int nc)
 {
@@ -180,43 +179,6 @@ void vtkOpenGLContextDevice3D::DrawPoly(const float *verts, int n,
   vtkOpenGLCheckErrorMacro("failed after DrawPoly");
 }
 
-//-----------------------------------------------------------------------------
-void vtkOpenGLContextDevice3D::DrawLines(const float *verts, int n,
-                                         const unsigned char *colors, int nc)
-{
-  assert("verts must be non-null" && verts != NULL);
-  assert("n must be greater than 0" && n > 0);
-
-  vtkOpenGLClearErrorMacro();
-
-  this->EnableDepthBuffer();
-
-  this->Storage->SetLineType(this->Pen->GetLineType());
-  glLineWidth(this->Pen->GetWidth());
-
-  if (colors)
-    {
-    glEnableClientState(GL_COLOR_ARRAY);
-    glColorPointer(nc, GL_UNSIGNED_BYTE, 0, colors);
-    }
-  else
-    {
-    glColor4ubv(this->Pen->GetColor());
-    }
-  glEnableClientState(GL_VERTEX_ARRAY);
-  glVertexPointer(3, GL_FLOAT, 0, verts);
-  glDrawArrays(GL_LINE, 0, n);
-  glDisableClientState(GL_VERTEX_ARRAY);
-  if (colors)
-    {
-    glDisableClientState(GL_COLOR_ARRAY);
-    }
-
-  this->DisableDepthBuffer();
-
-  vtkOpenGLCheckErrorMacro("failed after DrawLines");
-}
-
 void vtkOpenGLContextDevice3D::DrawPoints(const float *verts, int n,
                                           const unsigned char *colors, int nc)
 {
diff --git a/Rendering/ContextOpenGL/vtkOpenGLContextDevice3D.h b/Rendering/ContextOpenGL/vtkOpenGLContextDevice3D.h
index 7eeb62f..e2a2143 100644
--- a/Rendering/ContextOpenGL/vtkOpenGLContextDevice3D.h
+++ b/Rendering/ContextOpenGL/vtkOpenGLContextDevice3D.h
@@ -39,15 +39,9 @@ public:
 
   // Description:
   // Draw a polyline between the specified points.
-  // \sa DrawLines()
   void DrawPoly(const float *verts, int n, const unsigned char *colors, int nc);
 
   // Description:
-  // Draw lines defined by specified pair of points.
-  // \sa DrawPoly()
-  void DrawLines(const float *verts, int n, const unsigned char *colors, int nc);
-
-  // Description:
   // Draw points at the vertex positions specified.
   void DrawPoints(const float *verts, int n,
                   const unsigned char *colors, int nc);
diff --git a/Rendering/ContextOpenGL2/CMakeLists.txt b/Rendering/ContextOpenGL2/CMakeLists.txt
index 9b38ee7..866a003 100644
--- a/Rendering/ContextOpenGL2/CMakeLists.txt
+++ b/Rendering/ContextOpenGL2/CMakeLists.txt
@@ -6,12 +6,14 @@ include(vtkObjectFactory)
 
 set(module_SRCS
   vtkOpenGLContextActor.cxx
+  vtkOpenGL2ContextDevice2D.cxx
   vtkOpenGLContextBufferId.cxx
   vtkOpenGLContextDevice2D.cxx
   vtkOpenGLContextDevice3D.cxx
   )
 
 set_source_files_properties(
+  vtkOpenGL2ContextDevice2D
   vtkOpenGLContextBufferId
   vtkOpenGLContextDevice2D
   vtkOpenGLContextDevice3D
diff --git a/Rendering/ContextOpenGL2/vtkOpenGL2ContextDevice2D.cxx b/Rendering/ContextOpenGL2/vtkOpenGL2ContextDevice2D.cxx
new file mode 100644
index 0000000..698cd58
--- /dev/null
+++ b/Rendering/ContextOpenGL2/vtkOpenGL2ContextDevice2D.cxx
@@ -0,0 +1,189 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+  Module:    vtkOpenGL2ContextDevice2D.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 "vtkOpenGL2ContextDevice2D.h"
+
+#include "vtkVector.h"
+#include "vtkRect.h"
+#include "vtkPen.h"
+#include "vtkBrush.h"
+#include "vtkTextProperty.h"
+#include "vtkPoints2D.h"
+#include "vtkMatrix3x3.h"
+#include "vtkFloatArray.h"
+#include "vtkSmartPointer.h"
+
+#include "vtkMath.h"
+#include "vtkObjectFactory.h"
+
+#include "vtkViewport.h"
+#include "vtkWindow.h"
+
+#include "vtkTexture.h"
+#include "vtkImageData.h"
+
+#include "vtkRenderer.h"
+#include "vtkOpenGLRenderer.h"
+#include "vtkOpenGLRenderWindow.h"
+#include "vtkOpenGLError.h"
+
+#include "vtkObjectFactory.h"
+
+#include "vtkOpenGLContextDevice2DPrivate.h"
+
+//-----------------------------------------------------------------------------
+vtkStandardNewMacro(vtkOpenGL2ContextDevice2D);
+
+//-----------------------------------------------------------------------------
+bool vtkOpenGL2ContextDevice2D::IsSupported(vtkViewport *)
+{
+  return true;
+}
+
+//-----------------------------------------------------------------------------
+vtkOpenGL2ContextDevice2D::vtkOpenGL2ContextDevice2D()
+{
+}
+
+//-----------------------------------------------------------------------------
+vtkOpenGL2ContextDevice2D::~vtkOpenGL2ContextDevice2D()
+{
+}
+
+//-----------------------------------------------------------------------------
+void vtkOpenGL2ContextDevice2D::DrawPointSprites(vtkImageData *sprite,
+                                                 float *points, int n,
+                                                 unsigned char *colors,
+                                                 int nc_comps)
+{
+  vtkOpenGLClearErrorMacro();
+  if (points && n > 0)
+    {
+    this->SetPointSize(this->Pen->GetWidth());
+    if (sprite)
+      {
+      if (!this->Storage->SpriteTexture)
+        {
+        this->Storage->SpriteTexture = vtkTexture::New();
+        }
+      int properties = this->Brush->GetTextureProperties();
+      this->Storage->SpriteTexture->SetInputData(sprite);
+      this->Storage->SpriteTexture->SetRepeat(properties & vtkContextDevice2D::Repeat);
+      this->Storage->SpriteTexture->SetInterpolate(properties & vtkContextDevice2D::Linear);
+      this->Storage->SpriteTexture->Render(this->Renderer);
+      glEnable(GL_TEXTURE_2D);
+      }
+
+    // We can actually use point sprites here
+    glEnable(GL_POINT_SPRITE);
+    glTexEnvi(GL_POINT_SPRITE, GL_COORD_REPLACE, GL_TRUE);
+    glPointParameteri(GL_POINT_SPRITE_COORD_ORIGIN, GL_LOWER_LEFT);
+
+    this->DrawPoints(points, n, colors, nc_comps);
+
+    glTexEnvi(GL_POINT_SPRITE, GL_COORD_REPLACE, GL_FALSE);
+    glDisable(GL_POINT_SPRITE);
+
+    if (sprite)
+      {
+      this->Storage->SpriteTexture->PostRender(this->Renderer);
+      glDisable(GL_TEXTURE_2D);
+      }
+    }
+  else
+    {
+    vtkWarningMacro(<< "Points supplied without a valid image or pointer.");
+    }
+  vtkOpenGLCheckErrorMacro("failed after DrawPointSprites");
+}
+
+//-----------------------------------------------------------------------------
+void vtkOpenGL2ContextDevice2D::DrawImage(float p[2], float scale,
+                                         vtkImageData *image)
+{
+  vtkOpenGLClearErrorMacro();
+  this->SetTexture(image);
+  this->Storage->Texture->Render(this->Renderer);
+  glEnable(GL_TEXTURE_2D);
+  int *extent = image->GetExtent();
+  float points[] = { p[0]                     , p[1],
+                     p[0]+scale*extent[1]+1.0f, p[1],
+                     p[0]+scale*extent[1]+1.0f, p[1]+scale*extent[3]+1.0f,
+                     p[0]                     , p[1]+scale*extent[3]+1.0f };
+
+  float texCoord[] = { 0.0f, 0.0f,
+                       1.0f, 0.0f,
+                       1.0f, 1.0f,
+                       0.0f, 1.0f };
+
+  glColor4ub(255, 255, 255, 255);
+  glEnableClientState(GL_VERTEX_ARRAY);
+  glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+  glVertexPointer(2, GL_FLOAT, 0, &points[0]);
+  glTexCoordPointer(2, GL_FLOAT, 0, &texCoord[0]);
+  glDrawArrays(GL_QUADS, 0, 4);
+  glDisableClientState(GL_TEXTURE_COORD_ARRAY);
+  glDisableClientState(GL_VERTEX_ARRAY);
+
+  this->Storage->Texture->PostRender(this->Renderer);
+  glDisable(GL_TEXTURE_2D);
+  vtkOpenGLCheckErrorMacro("failed after DrawImage");
+}
+
+//-----------------------------------------------------------------------------
+void vtkOpenGL2ContextDevice2D::DrawImage(const vtkRectf& pos,
+                                         vtkImageData *image)
+{
+  vtkOpenGLClearErrorMacro();
+  GLuint index = this->Storage->TextureFromImage(image);
+//  this->SetTexture(image);
+//  this->Storage->Texture->Render(this->Renderer);
+  glEnable(GL_TEXTURE_2D);
+  float points[] = { pos.GetX()              , pos.GetY(),
+                     pos.GetX() + pos.GetWidth(), pos.GetY(),
+                     pos.GetX() + pos.GetWidth(), pos.GetY() + pos.GetHeight(),
+                     pos.GetX()              , pos.GetY() + pos.GetHeight() };
+
+  float texCoord[] = { 0.0, 0.0,
+                       1.0, 0.0,
+                       1.0, 1.0,
+                       0.0, 1.0 };
+
+  glColor4ub(255, 255, 255, 255);
+  glEnableClientState(GL_VERTEX_ARRAY);
+  glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+  glVertexPointer(2, GL_FLOAT, 0, &points[0]);
+  glTexCoordPointer(2, GL_FLOAT, 0, &texCoord[0]);
+  glDrawArrays(GL_QUADS, 0, 4);
+  glDisableClientState(GL_TEXTURE_COORD_ARRAY);
+  glDisableClientState(GL_VERTEX_ARRAY);
+
+//  this->Storage->Texture->PostRender(this->Renderer);
+  glDisable(GL_TEXTURE_2D);
+  glDeleteTextures(1, &index);
+  vtkOpenGLCheckErrorMacro("failed after DrawImage");
+}
+
+//----------------------------------------------------------------------------
+void vtkOpenGL2ContextDevice2D::ReleaseGraphicsResources(vtkWindow *window)
+{
+  this->vtkOpenGLContextDevice2D::ReleaseGraphicsResources(window);
+}
+
+//-----------------------------------------------------------------------------
+void vtkOpenGL2ContextDevice2D::PrintSelf(ostream &os, vtkIndent indent)
+{
+  this->Superclass::PrintSelf(os, indent);
+}
diff --git a/Rendering/ContextOpenGL2/vtkOpenGL2ContextDevice2D.h b/Rendering/ContextOpenGL2/vtkOpenGL2ContextDevice2D.h
new file mode 100644
index 0000000..4b80ee6
--- /dev/null
+++ b/Rendering/ContextOpenGL2/vtkOpenGL2ContextDevice2D.h
@@ -0,0 +1,85 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+  Module:    vtkOpenGL2ContextDevice2D.h
+
+  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.
+
+=========================================================================*/
+
+// .NAME vtkOpenGL2ContextDevice2D - Class for drawing 2D primitives using
+// OpenGL 2.
+//
+// .SECTION Description
+// This class takes care of drawing the 2D primitives for the vtkContext2D class.
+// In general this class should not be used directly, but called by vtkContext2D
+// which takes care of many of the higher level details.
+//
+// It assumes that OpenGL 2 is available, which is taken care of by the
+// vtkContextActor class. If OpenGL 2 is not available, but OpenGL rendering is
+// required the vtkOpenGLContextDevice2D class should be used (employs GL 1.1).
+//
+// .SECTION See Also
+// vtkOpenGLContextDevice2D
+
+#ifndef vtkOpenGL2ContextDevice2D_h
+#define vtkOpenGL2ContextDevice2D_h
+
+#include "vtkOpenGLContextDevice2D.h"
+
+class VTKRENDERINGCONTEXTOPENGL2_EXPORT vtkOpenGL2ContextDevice2D :
+    public vtkOpenGLContextDevice2D
+{
+public:
+  vtkTypeMacro(vtkOpenGL2ContextDevice2D, vtkOpenGLContextDevice2D);
+  virtual void PrintSelf(ostream &os, vtkIndent indent);
+
+  // Description:
+  // Creates a 2D Painter object.
+  static vtkOpenGL2ContextDevice2D *New();
+
+  // Description:
+  // Return true if the current rendering context supports this device.
+  static bool IsSupported(vtkViewport *viewport);
+
+  // Description:
+  // Draw a series of point sprites, images centred at the points supplied.
+  // The supplied vtkImageData is the sprite to be drawn, only squares will be
+  // drawn and the size is set using SetPointSize. Points are colored by colors array
+  // which has nc_comps components
+  virtual void DrawPointSprites(vtkImageData *sprite, float *points, int n,
+                                unsigned char* colors = 0, int nc_comps = 0);
+
+  // Description:
+  // Draw the supplied image at the given x, y (p[0], p[1]) (bottom corner),
+  // scaled by scale (1.0 would match the image).
+  virtual void DrawImage(float p[2], float scale, vtkImageData *image);
+
+  // Description:
+  // Draw the supplied image at the given position. The origin, width, and
+  // height are specified by the supplied vtkRectf variable pos. The image
+  // will be drawn scaled to that size.
+  void DrawImage(const vtkRectf& pos, vtkImageData *image);
+
+  // Description:
+  // Release any graphics resources that are being consumed by this device.
+  // The parameter window could be used to determine which graphic
+  // resources to release.
+  virtual void ReleaseGraphicsResources(vtkWindow *window);
+
+protected:
+  vtkOpenGL2ContextDevice2D();
+  virtual ~vtkOpenGL2ContextDevice2D();
+
+private:
+  vtkOpenGL2ContextDevice2D(const vtkOpenGL2ContextDevice2D &); // Not implemented.
+  void operator=(const vtkOpenGL2ContextDevice2D &);   // Not implemented.
+};
+
+#endif //vtkOpenGL2ContextDevice2D_h
diff --git a/Rendering/ContextOpenGL2/vtkOpenGLContextActor.cxx b/Rendering/ContextOpenGL2/vtkOpenGLContextActor.cxx
index 7888d37..ade400f 100644
--- a/Rendering/ContextOpenGL2/vtkOpenGLContextActor.cxx
+++ b/Rendering/ContextOpenGL2/vtkOpenGLContextActor.cxx
@@ -15,12 +15,13 @@
 #include "vtkOpenGLContextActor.h"
 
 #include "vtkContext2D.h"
+#include "vtkOpenGLContextDevice2D.h"
+#include "vtkOpenGL2ContextDevice2D.h"
+
 #include "vtkContext3D.h"
+#include "vtkOpenGLContextDevice3D.h"
 #include "vtkContextScene.h"
 #include "vtkObjectFactory.h"
-#include "vtkOpenGLContextDevice2D.h"
-#include "vtkOpenGLContextDevice3D.h"
-#include "vtkRenderer.h"
 
 vtkStandardNewMacro(vtkOpenGLContextActor);
 
@@ -51,44 +52,26 @@ void vtkOpenGLContextActor::ReleaseGraphicsResources(vtkWindow *window)
 }
 
 //----------------------------------------------------------------------------
-// Renders an actor2D's property and then it's mapper.
-int vtkOpenGLContextActor::RenderOverlay(vtkViewport* viewport)
+void vtkOpenGLContextActor::Initialize(vtkViewport* viewport)
 {
-  vtkDebugMacro(<< "vtkContextActor::RenderOverlay");
+  vtkOpenGLContextDevice3D *dev = vtkOpenGLContextDevice3D::New();
+  this->Context3D->Begin(dev);
+  dev->Delete();
 
-  if (!this->Context.GetPointer())
+  vtkContextDevice2D *device = NULL;
+  if (vtkOpenGL2ContextDevice2D::IsSupported(viewport))
     {
-    vtkErrorMacro(<< "vtkContextActor::Render - No painter set");
-    return 0;
+    vtkDebugMacro("Using OpenGL 2 for 2D rendering.")
+    device = vtkOpenGL2ContextDevice2D::New();
     }
-
-  if (!this->Initialized)
+  else
     {
-    this->Initialize(viewport);
+    vtkDebugMacro("Using OpenGL 1 for 2D rendering.")
+    device = vtkOpenGLContextDevice2D::New();
     }
-
-  vtkOpenGLContextDevice3D::SafeDownCast(
-    this->Context3D->GetDevice())->Begin(viewport);
-
-  return this->Superclass::RenderOverlay(viewport);
-}
-
-
-//----------------------------------------------------------------------------
-void vtkOpenGLContextActor::Initialize(vtkViewport* viewport)
-{
-  vtkOpenGLContextDevice2D *device = NULL;
-  vtkDebugMacro("Using OpenGL 2 for 2D rendering.")
-  device = vtkOpenGLContextDevice2D::New();
   if (device)
     {
     this->Context->Begin(device);
-
-    vtkOpenGLContextDevice3D *dev = vtkOpenGLContextDevice3D::New();
-    dev->Initialize(vtkRenderer::SafeDownCast(viewport), device);
-    this->Context3D->Begin(dev);
-    dev->Delete();
-
     device->Delete();
     this->Initialized = true;
     }
diff --git a/Rendering/ContextOpenGL2/vtkOpenGLContextActor.h b/Rendering/ContextOpenGL2/vtkOpenGLContextActor.h
index cddb511..b239119 100644
--- a/Rendering/ContextOpenGL2/vtkOpenGLContextActor.h
+++ b/Rendering/ContextOpenGL2/vtkOpenGLContextActor.h
@@ -38,10 +38,6 @@ public:
   // resources to release.
   virtual void ReleaseGraphicsResources(vtkWindow *window);
 
-  // Description:
-  // We only render in the overlay for the context scene.
-  virtual int RenderOverlay(vtkViewport *viewport);
-
 protected:
   vtkOpenGLContextActor();
   ~vtkOpenGLContextActor();
diff --git a/Rendering/ContextOpenGL2/vtkOpenGLContextBufferId.cxx b/Rendering/ContextOpenGL2/vtkOpenGLContextBufferId.cxx
index 36b660e..7f807f3 100644
--- a/Rendering/ContextOpenGL2/vtkOpenGLContextBufferId.cxx
+++ b/Rendering/ContextOpenGL2/vtkOpenGLContextBufferId.cxx
@@ -167,9 +167,16 @@ vtkIdType vtkOpenGLContextBufferId::GetPickedItem(int x, int y)
         glDisable(GL_BLEND);
         }
 
+      // Fixed-pipeline stuff
+      glActiveTexture(GL_TEXTURE0);
+      this->Texture->Bind();
+      glTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_REPLACE);
+      glEnable(GL_TEXTURE_2D);
       this->Texture->CopyToFrameBuffer(x,y,x,y,x,y,
         this->Context->GetSize()[0],
         this->Context->GetSize()[1],NULL,NULL);
+      glDisable(GL_TEXTURE_2D);
+      glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); // restore
 
       GLint savedReadBuffer;
       glGetIntegerv(GL_READ_BUFFER,&savedReadBuffer);
diff --git a/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2D.cxx b/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2D.cxx
index 3311595..0587285 100644
--- a/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2D.cxx
+++ b/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2D.cxx
@@ -15,45 +15,40 @@
 
 #include "vtkOpenGLContextDevice2D.h"
 
-#include "vtkAbstractContextBufferId.h"
-#include "vtkBrush.h"
-#include "vtkFloatArray.h"
-#include "vtkImageData.h"
-#include "vtkMath.h"
 #include "vtkMathTextUtilities.h"
-#include "vtkMatrix3x3.h"
-#include "vtkObjectFactory.h"
-#include "vtkOpenGLError.h"
-#include "vtkOpenGLIndexBufferObject.h"
-#include "vtkOpenGLRenderWindow.h"
-#include "vtkOpenGLRenderer.h"
-#include "vtkOpenGLShaderCache.h"
-#include "vtkOpenGLTexture.h"
-#include "vtkOpenGLVertexArrayObject.h"
-#include "vtkOpenGLVertexBufferObject.h"
+#include "vtkTextRendererStringToImage.h"
+
+#include "vtkVector.h"
+#include "vtkRect.h"
 #include "vtkPen.h"
+#include "vtkBrush.h"
+#include "vtkTextProperty.h"
 #include "vtkPoints2D.h"
-#include "vtkRect.h"
-#include "vtkShaderProgram.h"
+#include "vtkMatrix3x3.h"
+#include "vtkFloatArray.h"
 #include "vtkSmartPointer.h"
-#include "vtkTextProperty.h"
-#include "vtkTextRendererStringToImage.h"
-#include "vtkTexture.h"
-#include "vtkTextureUnitManager.h"
-#include "vtkTransform.h"
-#include "vtkVector.h"
+
+#include "vtkMath.h"
+#include "vtkObjectFactory.h"
+
 #include "vtkViewport.h"
 #include "vtkWindow.h"
-#include "vtkOpenGLHelper.h"
+
+#include "vtkTexture.h"
+#include "vtkImageData.h"
+
+#include "vtkOpenGLRenderer.h"
+#include "vtkOpenGLRenderWindow.h"
+#include "vtkOpenGLError.h"
 
 #include "vtkObjectFactory.h"
 
 #include "vtkOpenGLContextDevice2DPrivate.h"
+#include "vtkAbstractContextBufferId.h"
 
-#include <algorithm>
-
-#define BUFFER_OFFSET(i) ((char *)NULL + (i))
+#include "vtkOpenGLShaderCache.h"
 
+#include <algorithm>
 
 //-----------------------------------------------------------------------------
 vtkStandardNewMacro(vtkOpenGLContextDevice2D)
@@ -67,29 +62,11 @@ vtkOpenGLContextDevice2D::vtkOpenGLContextDevice2D()
   this->Storage = new vtkOpenGLContextDevice2D::Private;
   this->RenderWindow = NULL;
   this->MaximumMarkerCacheSize = 20;
-  this->ProjectionMatrix = vtkTransform::New();
-  this->ModelMatrix = vtkTransform::New();
-  this->VBO =  new vtkOpenGLHelper;
-  this->VCBO =  new vtkOpenGLHelper;
-  this->VTBO =  new vtkOpenGLHelper;
-  this->SBO =  new vtkOpenGLHelper;
-  this->SCBO =  new vtkOpenGLHelper;
 }
 
 //-----------------------------------------------------------------------------
 vtkOpenGLContextDevice2D::~vtkOpenGLContextDevice2D()
 {
-  delete this->VBO;
-  this->VBO = 0;
-  delete this->VCBO;
-  this->VCBO = 0;
-  delete this->SBO;
-  this->SBO = 0;
-  delete this->SCBO;
-  this->SCBO = 0;
-  delete this->VTBO;
-  this->VTBO = 0;
-
   while (!this->MarkerCache.empty())
     {
     this->MarkerCache.back().Value->Delete();
@@ -97,21 +74,9 @@ vtkOpenGLContextDevice2D::~vtkOpenGLContextDevice2D()
     }
 
   this->TextRenderer->Delete();
-  this->ProjectionMatrix->Delete();
-  this->ModelMatrix->Delete();
   delete this->Storage;
 }
 
-vtkMatrix4x4 *vtkOpenGLContextDevice2D::GetProjectionMatrix()
-{
-  return this->ProjectionMatrix->GetMatrix();
-}
-
-vtkMatrix4x4 *vtkOpenGLContextDevice2D::GetModelMatrix()
-{
-  return this->ModelMatrix->GetMatrix();
-}
-
 //-----------------------------------------------------------------------------
 void vtkOpenGLContextDevice2D::Begin(vtkViewport* viewport)
 {
@@ -126,49 +91,40 @@ void vtkOpenGLContextDevice2D::Begin(vtkViewport* viewport)
                          static_cast<int>(vp[3]));
 
   // push a 2D matrix on the stack
-  this->ProjectionMatrix->Push();
-  this->ProjectionMatrix->Identity();
-  this->PushMatrix();
-  this->ModelMatrix->Identity();
-
-  double offset = 0.5;
-  double xmin = offset;
-  double xmax = vp[2]+offset-1.0;
-  double ymin = offset;
-  double ymax = vp[3]+offset-1.0;
-  double znear = -2000;
-  double zfar = 2000;
-
-  double matrix[4][4];
-  vtkMatrix4x4::Identity(*matrix);
-
-  matrix[0][0] = 2/(xmax - xmin);
-  matrix[1][1] = 2/(ymax - ymin);
-  matrix[2][2] = -2/(zfar - znear);
-
-  matrix[0][3] = -(xmin + xmax)/(xmax - xmin);
-  matrix[1][3] = -(ymin + ymax)/(ymax - ymin);
-  matrix[2][3] = -(znear + zfar)/(zfar - znear);
-
-  this->ProjectionMatrix->SetMatrix(*matrix);
+  glMatrixMode(GL_PROJECTION);
+  glPushMatrix();
+  glLoadIdentity();
+  float offset = 0.5;
+  glOrtho(offset, vp[2]+offset-1.0,
+          offset, vp[3]+offset-1.0,
+          -2000, 2000);
+
+  glMatrixMode(GL_MODELVIEW);
+  glPushMatrix();
+  glLoadIdentity();
 
   // Store the previous state before changing it
   this->Storage->SaveGLState();
+  glDisable(GL_LIGHTING);
   glDisable(GL_DEPTH_TEST);
   glEnable(GL_BLEND);
 
   this->Renderer = vtkRenderer::SafeDownCast(viewport);
 
-  this->RenderWindow = vtkOpenGLRenderWindow::SafeDownCast(this->Renderer->GetRenderWindow());
-  this->RenderWindow->GetShaderCache()->ReleaseCurrentShader();
+  vtkOpenGLRenderWindow *renWin = vtkOpenGLRenderWindow::SafeDownCast(this->Renderer->GetRenderWindow());
+  renWin->GetShaderCache()->ReleaseCurrentShader();
 
   // Enable simple line, point and polygon antialiasing if multisampling is on.
   if (this->Renderer->GetRenderWindow()->GetMultiSamples())
     {
     glEnable(GL_LINE_SMOOTH);
+    glEnable(GL_POINT_SMOOTH);
     glEnable(GL_POLYGON_SMOOTH);
     }
 
+  // Make sure we are on the default texture setting
+  glBindTexture(GL_TEXTURE_2D, 0);
+
   this->InRender = true;
   vtkOpenGLCheckErrorMacro("failed after Begin");
 }
@@ -181,11 +137,14 @@ void vtkOpenGLContextDevice2D::End()
     return;
     }
 
-  this->ProjectionMatrix->Pop();
-  this->PopMatrix();
-
   vtkOpenGLClearErrorMacro();
 
+  // push a 2D matrix on the stack
+  glMatrixMode(GL_PROJECTION);
+  glPopMatrix();
+  glMatrixMode(GL_MODELVIEW);
+  glPopMatrix();
+
   // Restore the GL state that we changed
   this->Storage->RestoreGLState();
 
@@ -193,6 +152,7 @@ void vtkOpenGLContextDevice2D::End()
   if (this->Renderer->GetRenderWindow()->GetMultiSamples())
     {
     glDisable(GL_LINE_SMOOTH);
+    glDisable(GL_POINT_SMOOTH);
     glDisable(GL_POLYGON_SMOOTH);
     }
 
@@ -220,35 +180,20 @@ void vtkOpenGLContextDevice2D::BufferIdModeBegin(
   int usize, vsize;
   this->Renderer->GetTiledSizeAndOrigin(&usize,&vsize,lowerLeft,lowerLeft+1);
 
-  // push a 2D matrix on the stack
-  this->ProjectionMatrix->Push();
-  this->ProjectionMatrix->Identity();
-  this->PushMatrix();
-  this->ModelMatrix->Identity();
-
-  double xmin = 0.5;
-  double xmax = usize+0.5;
-  double ymin = 0.5;
-  double ymax = vsize+0.5;
-  double znear = -1;
-  double zfar = 1;
-
-  double matrix[4][4];
-  vtkMatrix4x4::Identity(*matrix);
-
-  matrix[0][0] = 2/(xmax - xmin);
-  matrix[1][1] = 2/(ymax - ymin);
-  matrix[2][2] = -2/(zfar - znear);
-
-  matrix[0][3] = -(xmin + xmax)/(xmax - xmin);
-  matrix[1][3] = -(ymin + ymax)/(ymax - ymin);
-  matrix[2][3] = -(znear + zfar)/(zfar - znear);
-
-  this->ProjectionMatrix->SetMatrix(*matrix);
+  glMatrixMode(GL_PROJECTION);
+  glPushMatrix();
+  glLoadIdentity();
+  glOrtho( 0.5, usize+0.5,
+           0.5, vsize+0.5,
+          -1, 1);
+  glMatrixMode(GL_MODELVIEW);
+  glPushMatrix();
+  glLoadIdentity();
 
   glDrawBuffer(GL_BACK_LEFT);
   glClearColor(0.0,0.0,0.0,0.0); // id=0 means no hit, just background
   glClear(GL_COLOR_BUFFER_BIT);
+  glDisable(GL_LIGHTING);
   glDisable(GL_ALPHA_TEST);
   glDisable(GL_STENCIL_TEST);
   glDisable(GL_DEPTH_TEST);
@@ -272,8 +217,12 @@ void vtkOpenGLContextDevice2D::BufferIdModeEnd()
   this->Renderer->GetTiledSizeAndOrigin(&usize,&vsize,lowerLeft,lowerLeft+1);
   this->BufferId->SetValues(lowerLeft[0],lowerLeft[1]);
 
-  this->ProjectionMatrix->Pop();
-  this->PopMatrix();
+  // Restore OpenGL state (only if it's different to avoid too much state
+  // change).
+  glMatrixMode(GL_PROJECTION);
+  glPopMatrix();
+  glMatrixMode(GL_MODELVIEW);
+  glPopMatrix();
 
   this->Storage->RestoreGLState(true);
 
@@ -284,265 +233,6 @@ void vtkOpenGLContextDevice2D::BufferIdModeEnd()
   assert("post: done" && !this->GetBufferIdMode());
 }
 
-
-void vtkOpenGLContextDevice2D::SetMatrices(vtkShaderProgram *prog)
-{
-  prog->SetUniformMatrix("WCDCMatrix",
-    this->ProjectionMatrix->GetMatrix());
-  prog->SetUniformMatrix("MCWCMatrix",
-    this->ModelMatrix->GetMatrix());
-}
-
-void vtkOpenGLContextDevice2D::BuildVBO(
-  vtkOpenGLHelper *cellBO,
-  float *f, int nv,
-  unsigned char *colors, int nc,
-  float *tcoords)
-{
-  int stride = 2;
-  int cOffset = 0;
-  int tOffset = 0;
-  if (colors)
-    {
-    cOffset = stride;
-    stride++;
-    }
-  if (tcoords)
-    {
-    tOffset = stride;
-    stride += 2;
-    }
-
-  std::vector<float> va;
-  va.resize(nv*stride);
-  vtkucfloat c;
-  for (int i = 0; i < nv; i++)
-    {
-    va[i*stride] = f[i*2];
-    va[i*stride+1] = f[i*2+1];
-    if (colors)
-      {
-      c.c[0] = colors[nc*i];
-      c.c[1] = colors[nc*i+1];
-      c.c[2] = colors[nc*i+2];
-      if (nc == 4)
-        {
-        c.c[3] = colors[nc*i+3];
-        }
-      else
-        {
-        c.c[3] =  255;
-        }
-      va[i*stride+cOffset] = c.f;
-      }
-    if (tcoords)
-      {
-      va[i*stride+tOffset] = tcoords[i*2];
-      va[i*stride+tOffset+1] = tcoords[i*2+1];
-      }
-    }
-
-  // upload the data
-  cellBO->IBO->Upload(va, vtkOpenGLBufferObject::ArrayBuffer);
-  cellBO->VAO->Bind();
-  if (!cellBO->VAO->AddAttributeArray(
-        cellBO->Program, cellBO->IBO,
-        "vertexMC", 0,
-        sizeof(float)*stride,
-        VTK_FLOAT, 2, false))
-    {
-    vtkErrorMacro(<< "Error setting vertexMC in shader VAO.");
-    }
-  if (colors)
-    {
-    if (!cellBO->VAO->AddAttributeArray(
-          cellBO->Program, cellBO->IBO,
-          "vertexScalar", sizeof(float)*cOffset,
-          sizeof(float)*stride,
-          VTK_UNSIGNED_CHAR, 4, true))
-      {
-      vtkErrorMacro(<< "Error setting vertexScalar in shader VAO.");
-      }
-    }
-  if (tcoords)
-    {
-    if (!cellBO->VAO->AddAttributeArray(
-          cellBO->Program, cellBO->IBO,
-          "tcoordMC", sizeof(float)*tOffset,
-          sizeof(float)*stride,
-          VTK_FLOAT, 2, false))
-      {
-      vtkErrorMacro(<< "Error setting tcoordMC in shader VAO.");
-      }
-    }
-
-  cellBO->VAO->Bind();
-}
-
-void vtkOpenGLContextDevice2D::ReadyVBOProgram()
-{
-  if (!this->VBO->Program)
-    {
-    this->VBO->Program  =
-        this->RenderWindow->GetShaderCache()->ReadyShaderProgram(
-        // vertex shader
-        "//VTK::System::Dec\n"
-        "attribute vec2 vertexMC;\n"
-        "uniform mat4 WCDCMatrix;\n"
-        "uniform mat4 MCWCMatrix;\n"
-        "void main() {\n"
-        "vec4 vertex = vec4(vertexMC.xy, 0.0, 1.0);\n"
-        "gl_Position = vertex*MCWCMatrix*WCDCMatrix; }\n",
-        // fragment shader
-        "//VTK::System::Dec\n"
-        "//VTK::Output::Dec\n"
-        "uniform vec4 vertexColor;\n"
-        "void main() { gl_FragData[0] = vertexColor; }",
-        // geometry shader
-        "");
-    }
-  else
-    {
-    this->RenderWindow->GetShaderCache()->ReadyShaderProgram(this->VBO->Program);
-    }
-}
-
-void vtkOpenGLContextDevice2D::ReadyVCBOProgram()
-{
-  if (!this->VCBO->Program)
-    {
-    this->VCBO->Program  =
-        this->RenderWindow->GetShaderCache()->ReadyShaderProgram(
-        // vertex shader
-        "//VTK::System::Dec\n"
-        "attribute vec2 vertexMC;\n"
-        "attribute vec4 vertexScalar;\n"
-        "uniform mat4 WCDCMatrix;\n"
-        "uniform mat4 MCWCMatrix;\n"
-        "varying vec4 vertexColor;\n"
-        "void main() {\n"
-        "vec4 vertex = vec4(vertexMC.xy, 0.0, 1.0);\n"
-        "vertexColor = vertexScalar;\n"
-        "gl_Position = vertex*MCWCMatrix*WCDCMatrix; }\n",
-        // fragment shader
-        "//VTK::System::Dec\n"
-        "//VTK::Output::Dec\n"
-        "varying vec4 vertexColor;\n"
-        "void main() { gl_FragData[0] = vertexColor; }",
-        // geometry shader
-        "");
-    }
-  else
-    {
-    this->RenderWindow->GetShaderCache()->ReadyShaderProgram(this->VCBO->Program);
-    }
-}
-
-void vtkOpenGLContextDevice2D::ReadyVTBOProgram()
-{
-  if (!this->VTBO->Program)
-    {
-    this->VTBO->Program  =
-        this->RenderWindow->GetShaderCache()->ReadyShaderProgram(
-        // vertex shader
-        "//VTK::System::Dec\n"
-        "attribute vec2 vertexMC;\n"
-        "attribute vec2 tcoordMC;\n"
-        "uniform mat4 WCDCMatrix;\n"
-        "uniform mat4 MCWCMatrix;\n"
-        "varying vec2 tcoord;\n"
-        "void main() {\n"
-        "vec4 vertex = vec4(vertexMC.xy, 0.0, 1.0);\n"
-        "tcoord = tcoordMC;\n"
-        "gl_Position = vertex*MCWCMatrix*WCDCMatrix; }\n",
-        // fragment shader
-        "//VTK::System::Dec\n"
-        "//VTK::Output::Dec\n"
-        "varying vec2 tcoord;\n"
-        "uniform sampler2D texture1;\n"
-        "void main() { gl_FragData[0] = texture2D(texture1, tcoord); }",
-        // geometry shader
-        "");
-    }
-  else
-    {
-    this->RenderWindow->GetShaderCache()->ReadyShaderProgram(this->VTBO->Program);
-    }
-}
-
-void vtkOpenGLContextDevice2D::ReadySBOProgram()
-{
-  if (!this->SBO->Program)
-    {
-    this->SBO->Program  =
-        this->RenderWindow->GetShaderCache()->ReadyShaderProgram(
-        // vertex shader
-        "//VTK::System::Dec\n"
-        "attribute vec2 vertexMC;\n"
-        "uniform mat4 WCDCMatrix;\n"
-        "uniform mat4 MCWCMatrix;\n"
-        "void main() {\n"
-        "vec4 vertex = vec4(vertexMC.xy, 0.0, 1.0);\n"
-        "gl_Position = vertex*MCWCMatrix*WCDCMatrix; }\n",
-        // fragment shader
-        "//VTK::System::Dec\n"
-        "//VTK::Output::Dec\n"
-        "uniform vec4 vertexColor;\n"
-        "uniform sampler2D texture1;\n"
-        "void main() { gl_FragData[0] = vertexColor*texture2D(texture1, gl_PointCoord); }",
-        // geometry shader
-        "");
-    }
-  else
-    {
-    this->RenderWindow->GetShaderCache()->ReadyShaderProgram(this->SBO->Program);
-    }
-}
-
-void vtkOpenGLContextDevice2D::ReadySCBOProgram()
-{
-  if (!this->SCBO->Program)
-    {
-    this->SCBO->Program  =
-        this->RenderWindow->GetShaderCache()->ReadyShaderProgram(
-        // vertex shader
-        "//VTK::System::Dec\n"
-        "attribute vec2 vertexMC;\n"
-        "attribute vec4 vertexScalar;\n"
-        "uniform mat4 WCDCMatrix;\n"
-        "uniform mat4 MCWCMatrix;\n"
-        "varying vec4 vertexColor;\n"
-        "void main() {\n"
-        "vec4 vertex = vec4(vertexMC.xy, 0.0, 1.0);\n"
-        "vertexColor = vertexScalar;\n"
-        "gl_Position = vertex*MCWCMatrix*WCDCMatrix; }\n",
-        // fragment shader
-        "//VTK::System::Dec\n"
-        "//VTK::Output::Dec\n"
-        "varying vec4 vertexColor;\n"
-        "uniform sampler2D texture1;\n"
-        "void main() { gl_FragData[0] = vertexColor*texture2D(texture1, gl_PointCoord); }",
-        // geometry shader
-        "");
-    }
-  else
-    {
-    this->RenderWindow->GetShaderCache()->ReadyShaderProgram(this->SCBO->Program);
-    }
-}
-
-namespace
-{
-  void copyColors(std::vector<unsigned char> &newColors,
-    unsigned char *colors, int nc)
-    {
-    for (int j = 0; j < nc; j++)
-      {
-      newColors.push_back(colors[j]);
-      }
-    }
-}
-
 //-----------------------------------------------------------------------------
 void vtkOpenGLContextDevice2D::DrawPoly(float *f, int n, unsigned char *colors,
                                         int nc)
@@ -550,184 +240,34 @@ void vtkOpenGLContextDevice2D::DrawPoly(float *f, int n, unsigned char *colors,
   assert("f must be non-null" && f != NULL);
   assert("n must be greater than 0" && n > 0);
 
-  if (this->Pen->GetLineType() == vtkPen::NO_PEN)
-    {
-    return;
-    }
-
-  vtkOpenGLClearErrorMacro();
-  this->SetLineType(this->Pen->GetLineType());
-
-  vtkOpenGLHelper *cbo = 0;
-  if (colors)
-    {
-    this->ReadyVCBOProgram();
-    cbo = this->VCBO;
-    }
-  else
-    {
-    this->ReadyVBOProgram();
-    cbo = this->VBO;
-    cbo->Program->SetUniform4uc("vertexColor",
-      this->Pen->GetColor());
-    }
-
-  this->SetMatrices(cbo->Program);
-
-  if (this->Pen->GetWidth() > 1.0)
-    {
-    double *scale = this->ModelMatrix->GetScale();
-    // convert to triangles and draw, this is because
-    // OpenGL no longer supports wide lines directly
-    float hwidth = this->Pen->GetWidth()/2.0;
-    std::vector<float> newVerts;
-    std::vector<unsigned char> newColors;
-    for (int i = 0; i < n-1; i++)
-      {
-      // for each line segment draw two triangles
-      // start by computing the direction
-      vtkVector2f dir((f[i*2+2] - f[i*2])*scale[0],
-        (f[i*2+3] - f[i*2+1])*scale[1]);
-      vtkVector2f norm(-dir.GetY(),dir.GetX());
-      norm.Normalize();
-      norm.SetX(hwidth*norm.GetX()/scale[0]);
-      norm.SetY(hwidth*norm.GetY()/scale[1]);
-
-      newVerts.push_back(f[i*2]+norm.GetX());
-      newVerts.push_back(f[i*2+1]+norm.GetY());
-      newVerts.push_back(f[i*2]-norm.GetX());
-      newVerts.push_back(f[i*2+1]-norm.GetY());
-      newVerts.push_back(f[i*2+2]-norm.GetX());
-      newVerts.push_back(f[i*2+3]-norm.GetY());
-
-      newVerts.push_back(f[i*2]+norm.GetX());
-      newVerts.push_back(f[i*2+1]+norm.GetY());
-      newVerts.push_back(f[i*2+2]-norm.GetX());
-      newVerts.push_back(f[i*2+3]-norm.GetY());
-      newVerts.push_back(f[i*2+2]+norm.GetX());
-      newVerts.push_back(f[i*2+3]+norm.GetY());
-
-      if (colors)
-        {
-        copyColors(newColors, colors+i*nc, nc);
-        copyColors(newColors, colors+i*nc, nc);
-        copyColors(newColors, colors+(i+1)*nc, nc);
-        copyColors(newColors, colors+i*nc, nc);
-        copyColors(newColors, colors+(i+1)*nc, nc);
-        copyColors(newColors, colors+(i+1)*nc, nc);
-        }
-      }
-
-    this->BuildVBO(cbo, &(newVerts[0]), newVerts.size()/2,
-      colors ? &(newColors[0]) : NULL, nc, NULL);
-    glDrawArrays(GL_TRIANGLES, 0, newVerts.size()/2);
-    }
-  else
-    {
-    this->SetLineWidth(this->Pen->GetWidth());
-    this->BuildVBO(cbo, f, n, colors, nc, NULL);
-    glDrawArrays(GL_LINE_STRIP, 0, n);
-    this->SetLineWidth(1.0);
-    }
-
-  // free everything
-  cbo->ReleaseGraphicsResources(this->RenderWindow);
-
-  vtkOpenGLCheckErrorMacro("failed after DrawPoly");
-}
-
-//-----------------------------------------------------------------------------
-void vtkOpenGLContextDevice2D::DrawLines(float *f, int n, unsigned char *colors,
-                                         int nc)
-{
-  assert("f must be non-null" && f != NULL);
-  assert("n must be greater than 0" && n > 0);
-
-  if (this->Pen->GetLineType() == vtkPen::NO_PEN)
-    {
-    return;
-    }
-
   vtkOpenGLClearErrorMacro();
 
   this->SetLineType(this->Pen->GetLineType());
+  this->SetLineWidth(this->Pen->GetWidth());
 
-  vtkOpenGLHelper *cbo = 0;
   if (colors)
     {
-    this->ReadyVCBOProgram();
-    cbo = this->VCBO;
+    glEnableClientState(GL_COLOR_ARRAY);
+    glColorPointer(nc, GL_UNSIGNED_BYTE, 0, colors);
     }
   else
     {
-    this->ReadyVBOProgram();
-    cbo = this->VBO;
-    cbo->Program->SetUniform4uc("vertexColor",
-      this->Pen->GetColor());
+    glColor4ubv(this->Pen->GetColor());
     }
-
-  this->SetMatrices(cbo->Program);
-
-  if (this->Pen->GetWidth() > 1.0)
-    {
-    double *scale = this->ModelMatrix->GetScale();
-    // convert to triangles and draw, this is because
-    // OpenGL no longer supports wide lines directly
-    float hwidth = this->Pen->GetWidth()/2.0;
-    std::vector<float> newVerts;
-    std::vector<unsigned char> newColors;
-    for (int i = 0; i < n-1; i += 2)
-      {
-      // for each line segment draw two triangles
-      // start by computing the direction
-      vtkVector2f dir((f[i*2+2] - f[i*2])*scale[0],
-        (f[i*2+3] - f[i*2+1])*scale[1]);
-      vtkVector2f norm(-dir.GetY(),dir.GetX());
-      norm.Normalize();
-      norm.SetX(hwidth*norm.GetX()/scale[0]);
-      norm.SetY(hwidth*norm.GetY()/scale[1]);
-
-      newVerts.push_back(f[i*2]+norm.GetX());
-      newVerts.push_back(f[i*2+1]+norm.GetY());
-      newVerts.push_back(f[i*2]-norm.GetX());
-      newVerts.push_back(f[i*2+1]-norm.GetY());
-      newVerts.push_back(f[i*2+2]-norm.GetX());
-      newVerts.push_back(f[i*2+3]-norm.GetY());
-
-      newVerts.push_back(f[i*2]+norm.GetX());
-      newVerts.push_back(f[i*2+1]+norm.GetY());
-      newVerts.push_back(f[i*2+2]-norm.GetX());
-      newVerts.push_back(f[i*2+3]-norm.GetY());
-      newVerts.push_back(f[i*2+2]+norm.GetX());
-      newVerts.push_back(f[i*2+3]+norm.GetY());
-
-      if (colors)
-        {
-        copyColors(newColors, colors+i*nc, nc);
-        copyColors(newColors, colors+i*nc, nc);
-        copyColors(newColors, colors+(i+1)*nc, nc);
-        copyColors(newColors, colors+i*nc, nc);
-        copyColors(newColors, colors+(i+1)*nc, nc);
-        copyColors(newColors, colors+(i+1)*nc, nc);
-        }
-      }
-
-    this->BuildVBO(cbo, &(newVerts[0]), newVerts.size()/2,
-      colors ? &(newColors[0]) : NULL, nc, NULL);
-    glDrawArrays(GL_TRIANGLES, 0, newVerts.size()/2);
-    }
-  else
+  glEnableClientState(GL_VERTEX_ARRAY);
+  glVertexPointer(2, GL_FLOAT, 0, f);
+  glDrawArrays(GL_LINE_STRIP, 0, n);
+  glDisableClientState(GL_VERTEX_ARRAY);
+  if (colors)
     {
-    this->SetLineWidth(this->Pen->GetWidth());
-    this->BuildVBO(cbo, f, n, colors, nc, NULL);
-    glDrawArrays(GL_LINES, 0, n);
-    this->SetLineWidth(1.0);
+    glDisableClientState(GL_COLOR_ARRAY);
     }
 
-  // free everything
-  cbo->ReleaseGraphicsResources(this->RenderWindow);
+  // Restore line type and width.
+  this->SetLineType(vtkPen::SOLID_LINE);
+  this->SetLineWidth(1.0f);
 
-  vtkOpenGLCheckErrorMacro("failed after DrawLines");
+  vtkOpenGLCheckErrorMacro("failed after DrawPoly");
 }
 
 //-----------------------------------------------------------------------------
@@ -736,30 +276,32 @@ void vtkOpenGLContextDevice2D::DrawPoints(float *f, int n, unsigned char *c,
 {
   vtkOpenGLClearErrorMacro();
 
-  vtkOpenGLHelper *cbo = 0;
-  if (c)
+  if (f && n > 0)
     {
-    this->ReadyVCBOProgram();
-    cbo = this->VCBO;
+    this->SetPointSize(this->Pen->GetWidth());
+    glEnableClientState(GL_VERTEX_ARRAY);
+    if (c && nc)
+      {
+      glEnableClientState(GL_COLOR_ARRAY);
+      glColorPointer(nc, GL_UNSIGNED_BYTE, 0, c);
+      }
+    else
+      {
+      glColor4ubv(this->Pen->GetColor());
+      }
+    glVertexPointer(2, GL_FLOAT, 0, f);
+    glDrawArrays(GL_POINTS, 0, n);
+    glDisableClientState(GL_VERTEX_ARRAY);
+    if (c && nc)
+      {
+      glDisableClientState(GL_COLOR_ARRAY);
+      }
     }
   else
     {
-    this->ReadyVBOProgram();
-    cbo = this->VBO;
-    cbo->Program->SetUniform4uc("vertexColor",
-      this->Pen->GetColor());
+    vtkWarningMacro(<< "Points supplied that were not of type float.");
     }
 
-  this->SetPointSize(this->Pen->GetWidth());
-
-  this->BuildVBO(cbo, f, n, c, nc, NULL);
-  this->SetMatrices(cbo->Program);
-
-  glDrawArrays(GL_POINTS, 0, n);
-
-  // free everything
-  cbo->ReleaseGraphicsResources(this->RenderWindow);
-
   vtkOpenGLCheckErrorMacro("failed after DrawPoints");
 }
 
@@ -773,24 +315,6 @@ void vtkOpenGLContextDevice2D::DrawPointSprites(vtkImageData *sprite,
   if (points && n > 0)
     {
     this->SetPointSize(this->Pen->GetWidth());
-
-    vtkOpenGLHelper *cbo = 0;
-    if (colors)
-      {
-      this->ReadySCBOProgram();
-      cbo = this->SCBO;
-      }
-    else
-      {
-      this->ReadySBOProgram();
-      cbo = this->SBO;
-      cbo->Program->SetUniform4uc("vertexColor",
-        this->Pen->GetColor());
-      }
-
-    this->BuildVBO(cbo, points, n, colors, nc_comps, NULL);
-    this->SetMatrices(cbo->Program);
-
     if (sprite)
       {
       if (!this->Storage->SpriteTexture)
@@ -801,34 +325,72 @@ void vtkOpenGLContextDevice2D::DrawPointSprites(vtkImageData *sprite,
       this->Storage->SpriteTexture->SetInputData(sprite);
       this->Storage->SpriteTexture->SetRepeat(properties & vtkContextDevice2D::Repeat);
       this->Storage->SpriteTexture->SetInterpolate(properties & vtkContextDevice2D::Linear);
+      glEnable(GL_TEXTURE_2D);
       this->Storage->SpriteTexture->Render(this->Renderer);
-      int tunit = vtkOpenGLTexture::SafeDownCast(
-        this->Storage->SpriteTexture)->GetTextureUnit();
-      cbo->Program->SetUniformi("texture1", tunit);
       }
 
-    // We can actually use point sprites here
-    if (!vtkOpenGLRenderWindow::GetContextSupportsOpenGL32())
-      {
-      glEnable(GL_POINT_SPRITE);
-      glTexEnvi(GL_POINT_SPRITE, GL_COORD_REPLACE, GL_TRUE);
-      }
-    glPointParameteri(GL_POINT_SPRITE_COORD_ORIGIN, GL_LOWER_LEFT);
+    // Must emulate the point sprites - slower but at least they see something.
+    GLfloat width = 1.0;
+    glGetFloatv(GL_POINT_SIZE, &width);
+    width /= 2.0;
 
-    glDrawArrays(GL_POINTS, 0, n);
+    // Need to get the model view matrix for scaling factors...
+    GLfloat mv[16];
+    glGetFloatv(GL_MODELVIEW_MATRIX, mv);
+    float xWidth = width / mv[0];
+    float yWidth = width / mv[5];
 
-    // free everything
-    cbo->ReleaseGraphicsResources(this->RenderWindow);
+    // Four 2D points on the quad.
+    float p[4 * 2] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
 
-    if (!vtkOpenGLRenderWindow::GetContextSupportsOpenGL32())
+    // This will be the same every time
+    float texCoord[] = { 0.0, 0.0,
+                         1.0, 0.0,
+                         1.0, 1.0,
+                         0.0, 1.0 };
+
+    if (!colors || !nc_comps)
       {
-      glTexEnvi(GL_POINT_SPRITE, GL_COORD_REPLACE, GL_FALSE);
-      glDisable(GL_POINT_SPRITE);
+      glColor4ubv(this->Pen->GetColor());
       }
+    glEnableClientState(GL_VERTEX_ARRAY);
+    glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+    glTexCoordPointer(2, GL_FLOAT, 0, texCoord);
+
+    for (int i = 0; i < n; ++i)
+      {
+      p[0] = points[2*i] - xWidth;
+      p[1] = points[2*i+1] - yWidth;
+      p[2] = points[2*i] + xWidth;
+      p[3] = points[2*i+1] - yWidth;
+      p[4] = points[2*i] + xWidth;
+      p[5] = points[2*i+1] + yWidth;
+      p[6] = points[2*i] - xWidth;
+      p[7] = points[2*i+1] + yWidth;
+
+      // If we have a color array, set the color for each quad.
+      if (colors && nc_comps)
+        {
+        if (nc_comps == 3)
+          {
+          glColor3ubv(&colors[3 * i]);
+          }
+        else if (nc_comps == 4)
+          {
+          glColor4ubv(&colors[4 * i]);
+          }
+        }
+
+      glVertexPointer(2, GL_FLOAT, 0, p);
+      glDrawArrays(GL_QUADS, 0, 4);
+      }
+    glDisableClientState(GL_TEXTURE_COORD_ARRAY);
+    glDisableClientState(GL_VERTEX_ARRAY);
 
     if (sprite)
       {
       this->Storage->SpriteTexture->PostRender(this->Renderer);
+      glDisable(GL_TEXTURE_2D);
       }
     }
   else
@@ -852,65 +414,33 @@ void vtkOpenGLContextDevice2D::DrawMarkers(int shape, bool highlight,
 //-----------------------------------------------------------------------------
 void vtkOpenGLContextDevice2D::DrawQuad(float *f, int n)
 {
+  vtkOpenGLClearErrorMacro();
   if (!f || n <= 0)
     {
     vtkWarningMacro(<< "Points supplied that were not of type float.");
     return;
     }
-
-  // convert quads to triangles
-  std::vector<float> tverts;
-  int numTVerts = 6*n/4;
-  tverts.resize(numTVerts*2);
-  int offset[6] = {0,1,2,0,2,3};
-  for (int i = 0; i < numTVerts; i++)
-    {
-    int index = 2*(4*(i/6)+offset[i%6]);
-    tverts[i*2] = f[index];
-    tverts[i*2+1] = f[index+1];
-    }
-
-  this->CoreDrawTriangles(tverts);
-}
-
-void vtkOpenGLContextDevice2D::CoreDrawTriangles(
-  std::vector<float> &tverts)
-{
-  vtkOpenGLClearErrorMacro();
-
+  glColor4ubv(this->Brush->GetColor());
   float* texCoord = 0;
-  vtkOpenGLHelper *cbo = 0;
   if (this->Brush->GetTexture())
     {
-    this->ReadyVTBOProgram();
-    cbo = this->VTBO;
     this->SetTexture(this->Brush->GetTexture(),
                      this->Brush->GetTextureProperties());
+    glEnable(GL_TEXTURE_2D);
     this->Storage->Texture->Render(this->Renderer);
-    texCoord = this->Storage->TexCoords(&(tverts[0]), tverts.size()/2);
-
-    int tunit = vtkOpenGLTexture::SafeDownCast(this->Storage->Texture)->GetTextureUnit();
-    cbo->Program->SetUniformi("texture1", tunit);
-    }
-  else
-    {
-    this->ReadyVBOProgram();
-    cbo = this->VBO;
-    }
-  cbo->Program->SetUniform4uc("vertexColor",
-      this->Brush->GetColor());
-
-  this->BuildVBO(cbo, &(tverts[0]), tverts.size()/2, NULL, 0, texCoord);
-  this->SetMatrices(cbo->Program);
-
-  glDrawArrays(GL_TRIANGLES, 0, tverts.size()/2);
-
-  // free everything
-  cbo->ReleaseGraphicsResources(this->RenderWindow);
-
+    glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+    texCoord = this->Storage->TexCoords(f, n);
+    glTexCoordPointer(2, GL_FLOAT, 0, &texCoord[0]);
+    }
+  glEnableClientState(GL_VERTEX_ARRAY);
+  glVertexPointer(2, GL_FLOAT, 0, f);
+  glDrawArrays(GL_QUADS, 0, n);
+  glDisableClientState(GL_VERTEX_ARRAY);
   if (this->Storage->Texture)
     {
+    glDisableClientState(GL_TEXTURE_COORD_ARRAY);
     this->Storage->Texture->PostRender(this->Renderer);
+    glDisable(GL_TEXTURE_2D);
     delete [] texCoord;
     }
   vtkOpenGLCheckErrorMacro("failed after DrawQuad");
@@ -919,51 +449,70 @@ void vtkOpenGLContextDevice2D::CoreDrawTriangles(
 //-----------------------------------------------------------------------------
 void vtkOpenGLContextDevice2D::DrawQuadStrip(float *f, int n)
 {
+  vtkOpenGLClearErrorMacro();
   if (!f || n <= 0)
     {
     vtkWarningMacro(<< "Points supplied that were not of type float.");
     return;
     }
-
-  // convert quad strips to triangles
-  std::vector<float> tverts;
-  int numTVerts = 3*(n-2);
-  tverts.resize(numTVerts*2);
-  int offset[6] = {0,1,3,0,3,2};
-  for (int i = 0; i < numTVerts; i++)
+  glColor4ubv(this->Brush->GetColor());
+  float* texCoord = 0;
+  if (this->Brush->GetTexture())
+    {
+    this->SetTexture(this->Brush->GetTexture(),
+                     this->Brush->GetTextureProperties());
+    glEnable(GL_TEXTURE_2D);
+    this->Storage->Texture->Render(this->Renderer);
+    glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+    texCoord = this->Storage->TexCoords(f, n);
+    glTexCoordPointer(2, GL_FLOAT, 0, &texCoord[0]);
+    }
+  glEnableClientState(GL_VERTEX_ARRAY);
+  glVertexPointer(2, GL_FLOAT, 0, f);
+  glDrawArrays(GL_QUAD_STRIP, 0, n);
+  glDisableClientState(GL_VERTEX_ARRAY);
+  if (this->Storage->Texture)
     {
-    int index = 2*(2*(i/6)+offset[i%6]);
-    tverts[i*2] = f[index];
-    tverts[i*2+1] = f[index+1];
+    glDisableClientState(GL_TEXTURE_COORD_ARRAY);
+    this->Storage->Texture->PostRender(this->Renderer);
+    glDisable(GL_TEXTURE_2D);
+    delete [] texCoord;
     }
-
-  this->CoreDrawTriangles(tverts);
+  vtkOpenGLCheckErrorMacro("failed after DrawQuadStrip");
 }
-
 //-----------------------------------------------------------------------------
 void vtkOpenGLContextDevice2D::DrawPolygon(float *f, int n)
 {
+  vtkOpenGLClearErrorMacro();
   if (!f || n <= 0)
     {
     vtkWarningMacro(<< "Points supplied that were not of type float.");
     return;
     }
-
-  // convert polygon to triangles
-  std::vector<float> tverts;
-  int numTVerts = 3*(n-2);
-  tverts.resize(numTVerts*2);
-  for (int i = 0; i < n-2; i++)
+  glColor4ubv(this->Brush->GetColor());
+  float* texCoord = 0;
+  if (this->Brush->GetTexture())
+    {
+    this->SetTexture(this->Brush->GetTexture(),
+                     this->Brush->GetTextureProperties());
+    glEnable(GL_TEXTURE_2D);
+    this->Storage->Texture->Render(this->Renderer);
+    glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+    texCoord = this->Storage->TexCoords(f, n);
+    glTexCoordPointer(2, GL_FLOAT, 0, &texCoord[0]);
+    }
+  glEnableClientState(GL_VERTEX_ARRAY);
+  glVertexPointer(2, GL_FLOAT, 0, f);
+  glDrawArrays(GL_POLYGON, 0, n);
+  glDisableClientState(GL_VERTEX_ARRAY);
+  if (this->Storage->Texture)
     {
-    tverts.push_back(f[0]);
-    tverts.push_back(f[1]);
-    tverts.push_back(f[i*2+2]);
-    tverts.push_back(f[i*2+3]);
-    tverts.push_back(f[i*2+4]);
-    tverts.push_back(f[i*2+5]);
+    glDisableClientState(GL_TEXTURE_COORD_ARRAY);
+    this->Storage->Texture->PostRender(this->Renderer);
+    glDisable(GL_TEXTURE_2D);
+    delete [] texCoord;
     }
-
-  this->CoreDrawTriangles(tverts);
+  vtkOpenGLCheckErrorMacro("failed after DrawPolygon");
 }
 
 //-----------------------------------------------------------------------------
@@ -986,9 +535,13 @@ void vtkOpenGLContextDevice2D::DrawEllipseWedge(float x, float y, float outRx,
     return;
     }
 
+  vtkOpenGLClearErrorMacro();
+
   int iterations=this->GetNumberOfArcIterations(outRx,outRy,startAngle,
                                                 stopAngle);
 
+  float *p=new float[4*(iterations+1)];
+
   // step in radians.
   double step =
     vtkMath::RadiansFromDegrees(stopAngle-startAngle)/(iterations);
@@ -1004,22 +557,30 @@ void vtkOpenGLContextDevice2D::DrawEllipseWedge(float x, float y, float outRx,
   // OpenGL spec)
   // we are iterating counterclockwise
 
-  // convert polygon to triangles
-  std::vector<float> tverts;
-  int numTVerts = 6*iterations;
-  tverts.resize(numTVerts*2);
-  int offset[6] = {0,1,3,0,3,2};
-  for (int i = 0; i < numTVerts; i++)
+  int i=0;
+  while(i<=iterations)
     {
-    int index = i/6 + offset[i%6]/2;
-    double radiusX = offset[i%6]%2 ? outRx : inRx;
-    double radiusY = offset[i%6]%2 ? outRy : inRy;
-    double a=rstart+index*step;
-    tverts.push_back(radiusX * cos(a) + x);
-    tverts.push_back(radiusY * sin(a) + y);
+    // A vertex (inner side)
+    double a=rstart+i*step;
+    p[4*i  ] = inRx * cos(a) + x;
+    p[4*i+1] = inRy * sin(a) + y;
+
+    // B vertex (outer side)
+    p[4*i+2] = outRx * cos(a) + x;
+    p[4*i+3] = outRy * sin(a) + y;
+
+    ++i;
     }
 
-  this->CoreDrawTriangles(tverts);
+  glColor4ubv(this->Brush->GetColor());
+  glEnableClientState(GL_VERTEX_ARRAY);
+  glVertexPointer(2, GL_FLOAT, 0, p);
+  glDrawArrays(GL_TRIANGLE_STRIP, 0, 2*(iterations+1));
+  glDisableClientState(GL_VERTEX_ARRAY);
+
+  delete[] p;
+
+  vtkOpenGLCheckErrorMacro("failed after DrawEllipseWedge");
 }
 
 // ----------------------------------------------------------------------------
@@ -1058,8 +619,19 @@ void vtkOpenGLContextDevice2D::DrawEllipticArc(float x, float y, float rX,
     p[2*i+1] = rY * sin(a) + y;
     }
 
-  this->DrawPolygon(p,iterations+1);
-  this->DrawPoly(p,iterations+1);
+  this->SetLineType(this->Pen->GetLineType());
+  this->SetLineWidth(this->Pen->GetWidth());
+  glEnableClientState(GL_VERTEX_ARRAY);
+  glVertexPointer(2, GL_FLOAT, 0, p);
+  glColor4ubv(this->Brush->GetColor());
+  glDrawArrays(GL_TRIANGLE_FAN, 0, iterations+1);
+  glColor4ubv(this->Pen->GetColor());
+  glDrawArrays(GL_LINE_STRIP, 0, iterations+1);
+  glDisableClientState(GL_VERTEX_ARRAY);
+  // Restore line type and width.
+  this->SetLineType(vtkPen::SOLID_LINE);
+  this->SetLineWidth(1.0f);
+
   delete[] p;
 
   vtkOpenGLCheckErrorMacro("failed after DrawEllipseArc");
@@ -1232,31 +804,23 @@ void vtkOpenGLContextDevice2D::DrawString(float *point,
 {
   vtkOpenGLClearErrorMacro();
 
-  double *mv = this->ModelMatrix->GetMatrix()->Element[0];
+  GLfloat mv[16];
+  glGetFloatv(GL_MODELVIEW_MATRIX, mv);
   float xScale = mv[0];
   float yScale = mv[5];
 
   float p[] = { std::floor(point[0] * xScale) / xScale,
                 std::floor(point[1] * yScale) / yScale };
 
-  // TODO this currently ignores vtkContextScene::ScaleTiles. Not sure how to
-  // get at that from here, but this is better than ignoring scaling altogether.
-  // TODO Also, FreeType supports anisotropic DPI. Might be needed if the
-  // tileScale isn't homogeneous, but we'll need to update the textrenderer API
-  // and see if MPL/mathtext can support it.
-  int tileScale[2];
-  this->RenderWindow->GetTileScale(tileScale);
-  int dpi = this->RenderWindow->GetDPI() * std::max(tileScale[0], tileScale[1]);
-
   // Cache rendered text strings
   vtkTextureImageCache<UTF16TextPropertyKey>::CacheData &cache =
       this->Storage->TextTextureCache.GetCacheData(
-        UTF16TextPropertyKey(this->TextProp, string, dpi));
+        UTF16TextPropertyKey(this->TextProp, string));
   vtkImageData* image = cache.ImageData;
   if (image->GetNumberOfPoints() == 0 && image->GetNumberOfCells() == 0)
     {
     int textDims[2];
-    if (!this->TextRenderer->RenderString(this->TextProp, string, dpi, image,
+    if (!this->TextRenderer->RenderString(this->TextProp, string, image,
                                           textDims))
       {
       return;
@@ -1265,6 +829,7 @@ void vtkOpenGLContextDevice2D::DrawString(float *point,
     cache.TextHeight = textDims[1];
     }
   vtkTexture* texture = cache.Texture;
+  glEnable(GL_TEXTURE_2D);
   texture->Render(this->Renderer);
 
   int imgDims[3];
@@ -1281,34 +846,24 @@ void vtkOpenGLContextDevice2D::DrawString(float *point,
   float points[] = { p[0]        , p[1],
                      p[0] + width, p[1],
                      p[0] + width, p[1] + height,
-                     p[0]        , p[1],
-                     p[0] + width, p[1] + height,
                      p[0]        , p[1] + height };
 
   float texCoord[] = { 0.0f, 0.0f,
                        xw,   0.0f,
                        xw,   xh,
-                       0.0f,   0.0f,
-                       xw,   xh,
                        0.0f, xh };
 
-  vtkOpenGLClearErrorMacro();
-
-  vtkOpenGLHelper *cbo = 0;
-  this->ReadyVTBOProgram();
-  cbo = this->VTBO;
-  int tunit = vtkOpenGLTexture::SafeDownCast(texture)->GetTextureUnit();
-  cbo->Program->SetUniformi("texture1", tunit);
-
-  this->BuildVBO(cbo, points, 6, NULL, 0, texCoord);
-  this->SetMatrices(cbo->Program);
-
-  glDrawArrays(GL_TRIANGLES, 0, 6);
-
-  // free everything
-  cbo->ReleaseGraphicsResources(this->RenderWindow);
+  glColor4ub(255, 255, 255, 255);
+  glEnableClientState(GL_VERTEX_ARRAY);
+  glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+  glVertexPointer(2, GL_FLOAT, 0, points);
+  glTexCoordPointer(2, GL_FLOAT, 0, texCoord);
+  glDrawArrays(GL_QUADS, 0, 4);
+  glDisableClientState(GL_TEXTURE_COORD_ARRAY);
+  glDisableClientState(GL_VERTEX_ARRAY);
 
   texture->PostRender(this->Renderer);
+  glDisable(GL_TEXTURE_2D);
 
   vtkOpenGLCheckErrorMacro("failed after DrawString");
 }
@@ -1317,16 +872,7 @@ void vtkOpenGLContextDevice2D::DrawString(float *point,
 void vtkOpenGLContextDevice2D::ComputeStringBounds(const vtkUnicodeString &string,
                                                    float bounds[4])
 {
-  // TODO this currently ignores vtkContextScene::ScaleTiles. Not sure how to
-  // get at that from here, but this is better than ignoring scaling altogether.
-  // TODO Also, FreeType supports anisotropic DPI. Might be needed if the
-  // tileScale isn't homogeneous, but we'll need to update the textrenderer API
-  // and see if MPL/mathtext can support it.
-  int tileScale[2];
-  this->RenderWindow->GetTileScale(tileScale);
-  int dpi = this->RenderWindow->GetDPI() * std::max(tileScale[0], tileScale[1]);
-
-  vtkVector2i box = this->TextRenderer->GetBounds(this->TextProp, string, dpi);
+  vtkVector2i box = this->TextRenderer->GetBounds(this->TextProp, string);
   // Check for invalid bounding box
   if (box[0] == VTK_INT_MIN || box[0] == VTK_INT_MAX ||
       box[1] == VTK_INT_MIN || box[1] == VTK_INT_MAX)
@@ -1337,8 +883,8 @@ void vtkOpenGLContextDevice2D::ComputeStringBounds(const vtkUnicodeString &strin
     bounds[3] = static_cast<float>(0);
     return;
     }
-
-  double *mv = this->ModelMatrix->GetMatrix()->Element[0];
+  GLfloat mv[16];
+  glGetFloatv(GL_MODELVIEW_MATRIX, mv);
   float xScale = mv[0];
   float yScale = mv[5];
   bounds[0] = static_cast<float>(0);
@@ -1352,7 +898,7 @@ void vtkOpenGLContextDevice2D::DrawMathTextString(float point[2],
                                                   const vtkStdString &string)
 {
   vtkMathTextUtilities *mathText = vtkMathTextUtilities::GetInstance();
-  if (!mathText || !mathText->IsAvailable())
+  if (!mathText)
     {
     vtkWarningMacro(<<"MathText is not available to parse string "
                     << string.c_str() << ". Install matplotlib and enable "
@@ -1364,25 +910,16 @@ void vtkOpenGLContextDevice2D::DrawMathTextString(float point[2],
 
   float p[] = { std::floor(point[0]), std::floor(point[1]) };
 
-  // TODO this currently ignores vtkContextScene::ScaleTiles. Not sure how to
-  // get at that from here, but this is better than ignoring scaling altogether.
-  // TODO Also, FreeType supports anisotropic DPI. Might be needed if the
-  // tileScale isn't homogeneous, but we'll need to update the textrenderer API
-  // and see if MPL/mathtext can support it.
-  int tileScale[2];
-  this->RenderWindow->GetTileScale(tileScale);
-  int dpi = this->RenderWindow->GetDPI() * std::max(tileScale[0], tileScale[1]);
-
   // Cache rendered text strings
   vtkTextureImageCache<UTF8TextPropertyKey>::CacheData &cache =
     this->Storage->MathTextTextureCache.GetCacheData(
-      UTF8TextPropertyKey(this->TextProp, string, dpi));
+      UTF8TextPropertyKey(this->TextProp, string));
   vtkImageData* image = cache.ImageData;
   if (image->GetNumberOfPoints() == 0 && image->GetNumberOfCells() == 0)
     {
     int textDims[2];
-    if (!mathText->RenderString(string.c_str(), image, this->TextProp, dpi,
-                                textDims))
+    if (!mathText->RenderString(string.c_str(), image, this->TextProp,
+                                this->RenderWindow->GetDPI(), textDims))
       {
       return;
       }
@@ -1391,9 +928,11 @@ void vtkOpenGLContextDevice2D::DrawMathTextString(float point[2],
     }
 
   vtkTexture* texture = cache.Texture;
+  glEnable(GL_TEXTURE_2D);
   texture->Render(this->Renderer);
 
-  double *mv = this->ModelMatrix->GetMatrix()->Element[0];
+  GLfloat mv[16];
+  glGetFloatv(GL_MODELVIEW_MATRIX, mv);
   float xScale = mv[0];
   float yScale = mv[5];
 
@@ -1411,34 +950,24 @@ void vtkOpenGLContextDevice2D::DrawMathTextString(float point[2],
   float points[] = { p[0]        , p[1],
                      p[0] + width, p[1],
                      p[0] + width, p[1] + height,
-                     p[0]        , p[1],
-                     p[0] + width, p[1] + height,
                      p[0]        , p[1] + height };
 
   float texCoord[] = { 0.0f, 0.0f,
                        xw,   0.0f,
                        xw,   xh,
-                       0.0f,   0.0f,
-                       xw,   xh,
                        0.0f, xh };
 
-  vtkOpenGLClearErrorMacro();
-
-  vtkOpenGLHelper *cbo = 0;
-  this->ReadyVTBOProgram();
-  cbo = this->VTBO;
-  int tunit = vtkOpenGLTexture::SafeDownCast(texture)->GetTextureUnit();
-  cbo->Program->SetUniformi("texture1", tunit);
-
-  this->BuildVBO(cbo, points, 6, NULL, 0, texCoord);
-  this->SetMatrices(cbo->Program);
-
-  glDrawArrays(GL_TRIANGLES, 0, 6);
-
-  // free everything
-  cbo->ReleaseGraphicsResources(this->RenderWindow);
+  glColor4ub(255, 255, 255, 255);
+  glEnableClientState(GL_VERTEX_ARRAY);
+  glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+  glVertexPointer(2, GL_FLOAT, 0, points);
+  glTexCoordPointer(2, GL_FLOAT, 0, texCoord);
+  glDrawArrays(GL_QUADS, 0, 4);
+  glDisableClientState(GL_TEXTURE_COORD_ARRAY);
+  glDisableClientState(GL_VERTEX_ARRAY);
 
   texture->PostRender(this->Renderer);
+  glDisable(GL_TEXTURE_2D);
 
   vtkOpenGLCheckErrorMacro("failed after DrawMathTexString");
 }
@@ -1450,46 +979,30 @@ void vtkOpenGLContextDevice2D::DrawImage(float p[2], float scale,
   vtkOpenGLClearErrorMacro();
 
   this->SetTexture(image);
+  glEnable(GL_TEXTURE_2D);
   this->Storage->Texture->Render(this->Renderer);
   int *extent = image->GetExtent();
   float points[] = { p[0]                     , p[1],
                      p[0]+scale*extent[1]+1.0f, p[1],
                      p[0]+scale*extent[1]+1.0f, p[1]+scale*extent[3]+1.0f,
-                     p[0]                     , p[1],
-                     p[0]+scale*extent[1]+1.0f, p[1]+scale*extent[3]+1.0f,
                      p[0]                     , p[1]+scale*extent[3]+1.0f };
 
-  float texCoord[] = { 0.0f,   0.0f,
-                       1.0f,   0.0f,
-                       1.0f,   1.0f,
-                       0.0f,   0.0f,
-                       1.0f,   1.0f,
-                       0.0f,   1.0f };
-
-  vtkOpenGLClearErrorMacro();
-
-  vtkOpenGLHelper *cbo = 0;
-  this->ReadyVTBOProgram();
-  cbo = this->VTBO;
-  int tunit = vtkOpenGLTexture::SafeDownCast(
-    this->Storage->Texture)->GetTextureUnit();
-  cbo->Program->SetUniformi("texture1", tunit);
-
-    cerr << "doing image\n";
-    if (this->Storage->Texture->GetTransform())
-      {
-        cerr << "have a transform\n";
-      }
-
-  this->BuildVBO(cbo, points, 6, NULL, 0, texCoord);
-  this->SetMatrices(cbo->Program);
-
-  glDrawArrays(GL_TRIANGLES, 0, 6);
-
-  // free everything
-  cbo->ReleaseGraphicsResources(this->RenderWindow);
+  float texCoord[] = { 0.0f, 0.0f,
+                       1.0f, 0.0f,
+                       1.0f, 1.0f,
+                       0.0f, 1.0f };
+
+  glColor4ub(255, 255, 255, 255);
+  glEnableClientState(GL_VERTEX_ARRAY);
+  glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+  glVertexPointer(2, GL_FLOAT, 0, &points[0]);
+  glTexCoordPointer(2, GL_FLOAT, 0, &texCoord[0]);
+  glDrawArrays(GL_QUADS, 0, 4);
+  glDisableClientState(GL_TEXTURE_COORD_ARRAY);
+  glDisableClientState(GL_VERTEX_ARRAY);
 
   this->Storage->Texture->PostRender(this->Renderer);
+  glDisable(GL_TEXTURE_2D);
 
   vtkOpenGLCheckErrorMacro("failed after DrawImage");
 }
@@ -1498,7 +1011,10 @@ void vtkOpenGLContextDevice2D::DrawImage(float p[2], float scale,
 void vtkOpenGLContextDevice2D::DrawImage(const vtkRectf& pos,
                                          vtkImageData *image)
 {
+  vtkOpenGLClearErrorMacro();
+
   vtkVector2f tex(1.0, 1.0);
+  glEnable(GL_TEXTURE_2D);
   GLuint index = 0;
   if (this->Storage->PowerOfTwoTextures)
     {
@@ -1508,62 +1024,44 @@ void vtkOpenGLContextDevice2D::DrawImage(const vtkRectf& pos,
     {
     index = this->Storage->TextureFromImage(image, tex);
     }
+//  this->SetTexture(image);
+//  this->Storage->Texture->Render(this->Renderer);
+  float points[] = { pos.GetX()              , pos.GetY(),
+                     pos.GetX() + pos.GetWidth(), pos.GetY(),
+                     pos.GetX() + pos.GetWidth(), pos.GetY() + pos.GetHeight(),
+                     pos.GetX()              , pos.GetY() + pos.GetHeight() };
 
-  float points[] = {
-    pos.GetX()                 , pos.GetY(),
-    pos.GetX() + pos.GetWidth(), pos.GetY(),
-    pos.GetX() + pos.GetWidth(), pos.GetY() + pos.GetHeight(),
-    pos.GetX()                 , pos.GetY(),
-    pos.GetX() + pos.GetWidth(), pos.GetY() + pos.GetHeight(),
-    pos.GetX()                 , pos.GetY() + pos.GetHeight() };
-
-  float texCoord[] = { 0.0f,   0.0f,
-                       tex[0], 0.0f,
+  float texCoord[] = { 0.0   , 0.0,
+                       tex[0], 0.0,
                        tex[0], tex[1],
-                       0.0f,   0.0f,
-                       tex[0], tex[1],
-                       0.0f,   tex[1]};
-
-
-  vtkOpenGLHelper *cbo = 0;
-  this->ReadyVTBOProgram();
-  cbo = this->VTBO;
-  int tunit =  this->RenderWindow->GetTextureUnitManager()->Allocate();
-  if (tunit < 0)
-    {
-    vtkErrorMacro("Hardware does not support the number of textures defined.");
-    return;
-    }
-  glActiveTexture(GL_TEXTURE0 + tunit);
-
-  cbo->Program->SetUniformi("texture1", tunit);
-
-  this->BuildVBO(cbo, points, 6, NULL, 0, texCoord);
-  this->SetMatrices(cbo->Program);
-
-  glDrawArrays(GL_TRIANGLES, 0, 6);
-
-  this->RenderWindow->GetTextureUnitManager()->Free(tunit);
-
-  // free everything
-  cbo->ReleaseGraphicsResources(this->RenderWindow);
-
+                       0.0   , tex[1] };
+
+  glColor4ub(255, 255, 255, 255);
+  glEnableClientState(GL_VERTEX_ARRAY);
+  glEnableClientState(GL_TEXTURE_COORD_ARRAY);
+  glVertexPointer(2, GL_FLOAT, 0, &points[0]);
+  glTexCoordPointer(2, GL_FLOAT, 0, &texCoord[0]);
+  glDrawArrays(GL_QUADS, 0, 4);
+  glDisableClientState(GL_TEXTURE_COORD_ARRAY);
+  glDisableClientState(GL_VERTEX_ARRAY);
+
+//  this->Storage->Texture->PostRender(this->Renderer);
+  glDisable(GL_TEXTURE_2D);
   glDeleteTextures(1, &index);
 
   vtkOpenGLCheckErrorMacro("failed after DrawImage");
-
 }
 
 //-----------------------------------------------------------------------------
-void vtkOpenGLContextDevice2D::SetColor4(unsigned char *)
+void vtkOpenGLContextDevice2D::SetColor4(unsigned char *color)
 {
-  vtkErrorMacro("color cannot be set this way\n");
+  glColor4ubv(color);
 }
 
 //-----------------------------------------------------------------------------
-void vtkOpenGLContextDevice2D::SetColor(unsigned char *)
+void vtkOpenGLContextDevice2D::SetColor(unsigned char *color)
 {
-  vtkErrorMacro("color cannot be set this way\n");
+  glColor3ubv(color);
 }
 
 //-----------------------------------------------------------------------------
@@ -1604,11 +1102,36 @@ void vtkOpenGLContextDevice2D::SetLineWidth(float width)
 //-----------------------------------------------------------------------------
 void vtkOpenGLContextDevice2D::SetLineType(int type)
 {
-  if (type == vtkPen::SOLID_LINE || type == vtkPen::NO_PEN)
+  if (type == vtkPen::SOLID_LINE)
     {
-    return;
+    glDisable(GL_LINE_STIPPLE);
+    }
+  else
+    {
+    glEnable(GL_LINE_STIPPLE);
     }
-  vtkWarningMacro(<< "Line Stipples are no longer supported");
+  GLushort pattern = 0x0000;
+  switch (type)
+    {
+    case vtkPen::NO_PEN:
+      pattern = 0x0000;
+      break;
+    case vtkPen::DASH_LINE:
+      pattern = 0x00FF;
+      break;
+    case vtkPen::DOT_LINE:
+      pattern = 0x0101;
+      break;
+    case vtkPen::DASH_DOT_LINE:
+      pattern = 0x0C0F;
+      break;
+    case vtkPen::DASH_DOT_DOT_LINE:
+      pattern = 0x1C47;
+      break;
+    default:
+      pattern = 0x0000;
+    }
+  glLineStipple(1, pattern);
 }
 
 //-----------------------------------------------------------------------------
@@ -1618,24 +1141,28 @@ void vtkOpenGLContextDevice2D::MultiplyMatrix(vtkMatrix3x3 *m)
   double *M = m->GetData();
   double matrix[16];
 
+  // Convert from row major (C++ two dimensional arrays) to OpenGL
   matrix[0] = M[0];
-  matrix[1] = M[1];
+  matrix[1] = M[3];
   matrix[2] = 0.0;
-  matrix[3] = M[2];
-  matrix[4] = M[3];
+  matrix[3] = M[6];
+
+  matrix[4] = M[1];
   matrix[5] = M[4];
   matrix[6] = 0.0;
-  matrix[7] = M[5];
+  matrix[7] = M[7];
+
   matrix[8] = 0.0;
   matrix[9] = 0.0;
   matrix[10] = 1.0;
   matrix[11] = 0.0;
-  matrix[12] = M[6];
-  matrix[13] = M[7];
+
+  matrix[12] = M[2];
+  matrix[13] = M[5];
   matrix[14] = 0.0;
   matrix[15] = M[8];
 
-  this->ModelMatrix->Concatenate(matrix);
+  glMultMatrixd(matrix);
 }
 
 //-----------------------------------------------------------------------------
@@ -1645,24 +1172,28 @@ void vtkOpenGLContextDevice2D::SetMatrix(vtkMatrix3x3 *m)
   double *M = m->GetData();
   double matrix[16];
 
+  // Convert from row major (C++ two dimensional arrays) to OpenGL
   matrix[0] = M[0];
-  matrix[1] = M[1];
+  matrix[1] = M[3];
   matrix[2] = 0.0;
-  matrix[3] = M[2];
-  matrix[4] = M[3];
+  matrix[3] = M[6];
+
+  matrix[4] = M[1];
   matrix[5] = M[4];
   matrix[6] = 0.0;
-  matrix[7] = M[5];
+  matrix[7] = M[7];
+
   matrix[8] = 0.0;
   matrix[9] = 0.0;
   matrix[10] = 1.0;
   matrix[11] = 0.0;
-  matrix[12] = M[6];
-  matrix[13] = M[7];
+
+  matrix[12] = M[2];
+  matrix[13] = M[5];
   matrix[14] = 0.0;
   matrix[15] = M[8];
 
-  this->ModelMatrix->SetMatrix(matrix);
+  glLoadMatrixd(matrix);
 }
 
 //-----------------------------------------------------------------------------
@@ -1671,16 +1202,18 @@ void vtkOpenGLContextDevice2D::GetMatrix(vtkMatrix3x3 *m)
   assert("pre: non_null" && m != NULL);
   // We must construct a 4x4 matrix from the 3x3 matrix for OpenGL
   double *M = m->GetData();
-  double *matrix = this->ModelMatrix->GetMatrix()->Element[0];
+  double matrix[16];
+  glGetDoublev(GL_MODELVIEW_MATRIX, matrix);
 
+  // Convert from row major (C++ two dimensional arrays) to OpenGL
   M[0] = matrix[0];
-  M[1] = matrix[1];
-  M[2] = matrix[3];
-  M[3] = matrix[4];
+  M[1] = matrix[4];
+  M[2] = matrix[12];
+  M[3] = matrix[1];
   M[4] = matrix[5];
-  M[5] = matrix[7];
-  M[6] = matrix[12];
-  M[7] = matrix[13];
+  M[5] = matrix[13];
+  M[6] = matrix[3];
+  M[7] = matrix[7];
   M[8] = matrix[15];
 
   m->Modified();
@@ -1689,13 +1222,19 @@ void vtkOpenGLContextDevice2D::GetMatrix(vtkMatrix3x3 *m)
 //-----------------------------------------------------------------------------
 void vtkOpenGLContextDevice2D::PushMatrix()
 {
-  this->ModelMatrix->Push();
+  vtkOpenGLClearErrorMacro();
+  glMatrixMode( GL_MODELVIEW );
+  glPushMatrix();
+  vtkOpenGLCheckErrorMacro("failed after PushMatrix");
 }
 
 //-----------------------------------------------------------------------------
 void vtkOpenGLContextDevice2D::PopMatrix()
 {
-  this->ModelMatrix->Pop();
+  vtkOpenGLClearErrorMacro();
+  glMatrixMode( GL_MODELVIEW );
+  glPopMatrix();
+  vtkOpenGLCheckErrorMacro("failed after PopMatrix");
 }
 
 //-----------------------------------------------------------------------------
@@ -1755,11 +1294,6 @@ bool vtkOpenGLContextDevice2D::SetStringRendererToQt()
 //----------------------------------------------------------------------------
 void vtkOpenGLContextDevice2D::ReleaseGraphicsResources(vtkWindow *window)
 {
-  this->VBO->ReleaseGraphicsResources(window);
-  this->VCBO->ReleaseGraphicsResources(window);
-  this->SBO->ReleaseGraphicsResources(window);
-  this->SCBO->ReleaseGraphicsResources(window);
-  this->VTBO->ReleaseGraphicsResources(window);
   if (this->Storage->Texture)
     {
     this->Storage->Texture->ReleaseGraphicsResources(window);
@@ -1879,7 +1413,6 @@ vtkImageData *vtkOpenGLContextDevice2D::GenerateMarker(int shape, int width,
       }
     default: // Maintaining old behavior, which produces plus for unknown shape
       vtkWarningMacro(<<"Invalid marker shape: " << shape);
-      VTK_FALLTHROUGH;
     case VTK_MARKER_PLUS:
       {
       int center = (width + 1) / 2;
@@ -1955,20 +1488,20 @@ void vtkOpenGLContextDevice2D::PrintSelf(ostream &os, vtkIndent indent)
   this->Superclass::PrintSelf(os, indent);
   os << indent << "Renderer: ";
   if (this->Renderer)
-    {
+  {
     os << endl;
     this->Renderer->PrintSelf(os, indent.GetNextIndent());
-    }
+  }
   else
     {
     os << "(none)" << endl;
     }
   os << indent << "Text Renderer: ";
-  if (this->TextRenderer)
-    {
+  if (this->Renderer)
+  {
     os << endl;
     this->TextRenderer->PrintSelf(os, indent.GetNextIndent());
-    }
+  }
   else
     {
     os << "(none)" << endl;
diff --git a/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2D.h b/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2D.h
index d1e18f6..8638d10 100644
--- a/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2D.h
+++ b/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2D.h
@@ -30,19 +30,14 @@
 #include "vtkRenderingContextOpenGL2Module.h" // For export macro
 #include "vtkContextDevice2D.h"
 
-#include <vector> // STL Header
 #include <list> // for std::list
 
-class vtkMatrix4x4;
-class vtkOpenGLExtensionManager;
-class vtkOpenGLHelper;
-class vtkOpenGLRenderWindow;
+class vtkWindow;
+class vtkViewport;
 class vtkRenderer;
-class vtkShaderProgram;
 class vtkStringToImage;
-class vtkTransform;
-class vtkViewport;
-class vtkWindow;
+class vtkOpenGLRenderWindow;
+class vtkOpenGLExtensionManager;
 
 class VTKRENDERINGCONTEXTOPENGL2_EXPORT vtkOpenGLContextDevice2D : public vtkContextDevice2D
 {
@@ -62,14 +57,6 @@ public:
                         int nc_comps = 0);
 
   // Description:
-  // Draw lines using the points - memory layout is as follows:
-  // l1p1,l1p2,l2p1,l2p2... The lines will be colored by colors array
-  // which has nc_comps components.
-  // \sa DrawPoly()
-  virtual void DrawLines(float *f, int n, unsigned char *colors = 0,
-                         int nc_comps = 0);
-
-  // Description:
   // Draw a series of points - fastest code path due to memory
   // layout of the coordinates. Points are colored by colors array
   // which has nc_comps components
@@ -285,11 +272,6 @@ public:
   // resources to release.
   virtual void ReleaseGraphicsResources(vtkWindow *window);
 
-  // Description:
-  // Get the projection matrix this is needed
-  vtkMatrix4x4 *GetProjectionMatrix();
-  vtkMatrix4x4 *GetModelMatrix();
-
 //BTX
 protected:
   vtkOpenGLContextDevice2D();
@@ -331,24 +313,6 @@ protected:
   // The OpenGL render window being used by the device
   vtkOpenGLRenderWindow* RenderWindow;
 
-  vtkOpenGLHelper *VCBO;  // vertex + color
-  void ReadyVCBOProgram();
-  vtkOpenGLHelper *VBO;  // vertex
-  void ReadyVBOProgram();
-  vtkOpenGLHelper *VTBO;  // vertex + tcoord
-  void ReadyVTBOProgram();
-  vtkOpenGLHelper *SCBO;  // sprite + color
-  void ReadySCBOProgram();
-  vtkOpenGLHelper *SBO;  // sprite
-  void ReadySBOProgram();
-
-  void SetMatrices(vtkShaderProgram *prog);
-  void BuildVBO(vtkOpenGLHelper *cbo,
-    float *v, int nv,
-    unsigned char *coolors, int nc,
-    float *tcoords);
-  void CoreDrawTriangles(std::vector<float> &tverts);
-
 private:
   vtkOpenGLContextDevice2D(const vtkOpenGLContextDevice2D &); // Not implemented.
   void operator=(const vtkOpenGLContextDevice2D &);   // Not implemented.
@@ -373,9 +337,6 @@ private:
     }
   };
 
-  vtkTransform *ProjectionMatrix;
-  vtkTransform *ModelMatrix;
-
   std::list<vtkMarkerCacheObject> MarkerCache;
   int MaximumMarkerCacheSize;
 
diff --git a/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2DPrivate.h b/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2DPrivate.h
index 24b8da1..b43dc40 100644
--- a/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2DPrivate.h
+++ b/Rendering/ContextOpenGL2/vtkOpenGLContextDevice2DPrivate.h
@@ -172,16 +172,14 @@ struct TextPropertyKey
   // Transform a text property into an unsigned long
   static unsigned int GetIdFromTextProperty(vtkTextProperty* textProperty)
   {
-    size_t id;
+    unsigned long id;
     vtkFreeTypeTools::GetInstance()->MapTextPropertyToId(textProperty, &id);
-    // Truncation on 64-bit machines! The id is a pointer.
     return static_cast<unsigned int>(id);
   }
 
   // Description:
   // Creates a TextPropertyKey.
-  TextPropertyKey(vtkTextProperty* textProperty, const StringType& text,
-                  int dpi)
+  TextPropertyKey(vtkTextProperty* textProperty, const StringType& text)
   {
     this->TextPropertyId = GetIdFromTextProperty(textProperty);
     this->FontSize = textProperty->GetFontSize();
@@ -192,7 +190,6 @@ struct TextPropertyKey
                     static_cast<unsigned char>(color[2] * 255),
                     static_cast<unsigned char>(textProperty->GetOpacity() * 255));
     this->Text = text;
-    this->DPI = dpi;
   }
 
   // Description:
@@ -206,8 +203,7 @@ struct TextPropertyKey
       this->Color[0] == other.Color[0] &&
       this->Color[1] == other.Color[1] &&
       this->Color[2] == other.Color[2] &&
-      this->Color[3] == other.Color[3] &&
-      this->DPI == other.DPI;
+      this->Color[3] == other.Color[3];
   }
 
   unsigned short FontSize;
@@ -215,7 +211,6 @@ struct TextPropertyKey
   // States in the function not to use more than 32 bits - int works fine here.
   unsigned int TextPropertyId;
   StringType Text;
-  int DPI;
 };
 
 typedef TextPropertyKey<vtkStdString> UTF8TextPropertyKey;
@@ -230,6 +225,7 @@ public:
     this->TextureProperties = vtkContextDevice2D::Linear |
         vtkContextDevice2D::Stretch;
     this->SpriteTexture = NULL;
+    this->SavedLighting = GL_TRUE;
     this->SavedDepthTest = GL_TRUE;
     this->SavedAlphaTest = GL_TRUE;
     this->SavedStencilTest = GL_TRUE;
@@ -240,6 +236,8 @@ public:
                                this->SavedClearColor[3] = 0.0f;
     this->TextCounter = 0;
     this->GLExtensionsLoaded = true;
+    this->OpenGL15 = true;
+    this->OpenGL20 = true;
     this->GLSL = true;
     this->PowerOfTwoTextures = false;
   }
@@ -260,6 +258,7 @@ public:
 
   void SaveGLState(bool colorBuffer = false)
   {
+    this->SavedLighting = glIsEnabled(GL_LIGHTING);
     this->SavedDepthTest = glIsEnabled(GL_DEPTH_TEST);
 
     if (colorBuffer)
@@ -274,6 +273,7 @@ public:
 
   void RestoreGLState(bool colorBuffer = false)
   {
+    this->SetGLCapability(GL_LIGHTING, this->SavedLighting);
     this->SetGLCapability(GL_DEPTH_TEST, this->SavedDepthTest);
 
     if (colorBuffer)
@@ -420,6 +420,9 @@ public:
     glGenTextures(1, &tmpIndex);
     glBindTexture(GL_TEXTURE_2D, tmpIndex);
 
+    glTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_REPLACE);
+    glTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_ALPHA, GL_REPLACE);
+
     glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
     glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
     glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S,
@@ -430,6 +433,12 @@ public:
     glTexImage2D(GL_TEXTURE_2D, 0 , glInternalFormat,
                  newImg[0], newImg[1], 0, glFormat,
                  GL_UNSIGNED_BYTE, static_cast<const GLvoid *>(dataPtr));
+    glAlphaFunc(GL_GREATER, static_cast<GLclampf>(0));
+    glEnable(GL_ALPHA_TEST);
+    glMatrixMode(GL_TEXTURE);
+    glLoadIdentity();
+    glMatrixMode(GL_MODELVIEW);
+    glEnable(GL_TEXTURE_2D);
     delete [] dataPtr;
     return tmpIndex;
     }
@@ -454,6 +463,9 @@ public:
     glGenTextures(1, &tmpIndex);
     glBindTexture(GL_TEXTURE_2D, tmpIndex);
 
+    glTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_RGB, GL_REPLACE);
+    glTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_ALPHA, GL_REPLACE);
+
     glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
     glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
     glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S,
@@ -464,6 +476,12 @@ public:
     glTexImage2D(GL_TEXTURE_2D, 0 , glInternalFormat,
                  size[0], size[1], 0, glFormat,
                  GL_UNSIGNED_BYTE, static_cast<const GLvoid *>(dataPtr));
+    glAlphaFunc(GL_GREATER, static_cast<GLclampf>(0));
+    glEnable(GL_ALPHA_TEST);
+    glMatrixMode(GL_TEXTURE);
+    glLoadIdentity();
+    glMatrixMode(GL_MODELVIEW);
+    glEnable(GL_TEXTURE_2D);
     return tmpIndex;
   }
 
@@ -471,6 +489,7 @@ public:
   unsigned int TextureProperties;
   vtkTexture *SpriteTexture;
   // Store the previous GL state so that we can restore it when complete
+  GLboolean SavedLighting;
   GLboolean SavedDepthTest;
   GLboolean SavedAlphaTest;
   GLboolean SavedStencilTest;
@@ -482,6 +501,8 @@ public:
   vtkVector2i Dim;
   vtkVector2i Offset;
   bool GLExtensionsLoaded;
+  bool OpenGL15;
+  bool OpenGL20;
   bool GLSL;
   bool PowerOfTwoTextures;
 
diff --git a/Rendering/ContextOpenGL2/vtkOpenGLContextDevice3D.cxx b/Rendering/ContextOpenGL2/vtkOpenGLContextDevice3D.cxx
index c7901b5..bd8bc79 100644
--- a/Rendering/ContextOpenGL2/vtkOpenGLContextDevice3D.cxx
+++ b/Rendering/ContextOpenGL2/vtkOpenGLContextDevice3D.cxx
@@ -16,27 +16,20 @@
 #include "vtkOpenGLContextDevice3D.h"
 
 #include "vtkBrush.h"
+#include "vtkPen.h"
+
 #include "vtkMatrix4x4.h"
-#include "vtkObjectFactory.h"
-#include "vtkOpenGLCamera.h"
-#include "vtkOpenGLContextDevice2D.h"
-#include "vtkOpenGLError.h"
-#include "vtkOpenGLHelper.h"
-#include "vtkOpenGLIndexBufferObject.h"
-#include "vtkOpenGLRenderWindow.h"
 #include "vtkOpenGLRenderer.h"
-#include "vtkOpenGLShaderCache.h"
-#include "vtkOpenGLVertexArrayObject.h"
-#include "vtkOpenGLVertexBufferObject.h"
-#include "vtkPen.h"
-#include "vtkShaderProgram.h"
-#include "vtkTransform.h"
+#include "vtkOpenGLError.h"
+
+#include "vtkObjectFactory.h"
 
 class vtkOpenGLContextDevice3D::Private
 {
 public:
   Private()
   {
+    this->SavedLighting = GL_TRUE;
     this->SavedDepthTest = GL_TRUE;
   }
 
@@ -46,12 +39,14 @@ public:
 
   void SaveGLState()
   {
+    this->SavedLighting = glIsEnabled(GL_LIGHTING);
     this->SavedDepthTest = glIsEnabled(GL_DEPTH_TEST);
     this->SavedBlending = glIsEnabled(GL_BLEND);
   }
 
   void RestoreGLState()
   {
+    this->SetGLCapability(GL_LIGHTING, this->SavedLighting);
     this->SetGLCapability(GL_DEPTH_TEST, this->SavedDepthTest);
     this->SetGLCapability(GL_BLEND, this->SavedBlending);
   }
@@ -94,11 +89,36 @@ public:
 
   void SetLineType(int type)
   {
-  if (type == vtkPen::SOLID_LINE || type == vtkPen::NO_PEN)
-    {
-    return;
-    }
-  vtkGenericWarningMacro(<< "Line Stipples are no longer supported");
+    if (type == vtkPen::SOLID_LINE)
+      {
+      glDisable(GL_LINE_STIPPLE);
+      }
+    else
+      {
+      glEnable(GL_LINE_STIPPLE);
+      }
+    GLushort pattern = 0x0000;
+    switch (type)
+      {
+      case vtkPen::NO_PEN:
+        pattern = 0x0000;
+        break;
+      case vtkPen::DASH_LINE:
+        pattern = 0x00FF;
+        break;
+      case vtkPen::DOT_LINE:
+        pattern = 0x0101;
+        break;
+      case vtkPen::DASH_DOT_LINE:
+        pattern = 0x0C0F;
+        break;
+      case vtkPen::DASH_DOT_DOT_LINE:
+        pattern = 0x1C47;
+        break;
+      default:
+        pattern = 0x0000;
+      }
+    glLineStipple(1, pattern);
   }
 
   // Store the previous GL state so that we can restore it when complete
@@ -114,370 +134,47 @@ vtkStandardNewMacro(vtkOpenGLContextDevice3D)
 
 vtkOpenGLContextDevice3D::vtkOpenGLContextDevice3D() : Storage(new Private)
 {
-  this->ModelMatrix = vtkTransform::New();
-  this->ModelMatrix->Identity();
-  this->VBO =  new vtkOpenGLHelper;
-  this->VCBO =  new vtkOpenGLHelper;
-  this->ClippingPlaneStates.resize(6,false);
-  this->ClippingPlaneValues.resize(24);
 }
 
 vtkOpenGLContextDevice3D::~vtkOpenGLContextDevice3D()
 {
-  delete this->VBO;
-  this->VBO = 0;
-  delete this->VCBO;
-  this->VCBO = 0;
-
-  this->ModelMatrix->Delete();
   delete Storage;
 }
 
-void vtkOpenGLContextDevice3D::Initialize(vtkRenderer *ren,
-  vtkOpenGLContextDevice2D *dev)
-{
-  this->Device2D = dev;
-  this->Renderer = ren;
-  this->RenderWindow =
-    vtkOpenGLRenderWindow::SafeDownCast(ren->GetVTKWindow());
-}
-//-----------------------------------------------------------------------------
-void vtkOpenGLContextDevice3D::Begin(vtkViewport* vtkNotUsed(viewport))
-{
-  this->ModelMatrix->Identity();
-  for (int i = 0; i < 6; i++)
-    {
-    this->ClippingPlaneStates[i] = false;
-    }
-}
-
-void vtkOpenGLContextDevice3D::SetMatrices(vtkShaderProgram *prog)
-{
-
-    glDisable(GL_SCISSOR_TEST);
-  prog->SetUniformMatrix("WCDCMatrix",
-    this->Device2D->GetProjectionMatrix());
-
-  vtkMatrix4x4 *mvm = this->Device2D->GetModelMatrix();
-  vtkMatrix4x4 *tmp = vtkMatrix4x4::New();
-  vtkMatrix4x4::Multiply4x4(mvm,this->ModelMatrix->GetMatrix(),tmp);
-
-  prog->SetUniformMatrix("MCWCMatrix",
-//    this->ModelMatrix->GetMatrix());
-  tmp);
-  tmp->Delete();
-
-  // add all the clipping planes
-  int numClipPlanes = 0;
-  float planeEquations[6][4];
-  for (int i = 0; i < 6; i++)
-    {
-    if (this->ClippingPlaneStates[i])
-      {
-      planeEquations[numClipPlanes][0] = this->ClippingPlaneValues[i*4];
-      planeEquations[numClipPlanes][1] = this->ClippingPlaneValues[i*4+1];
-      planeEquations[numClipPlanes][2] = this->ClippingPlaneValues[i*4+2];
-      planeEquations[numClipPlanes][3] = this->ClippingPlaneValues[i*4+3];
-      numClipPlanes++;
-      }
-    }
-  prog->SetUniformi("numClipPlanes", numClipPlanes);
-  prog->SetUniform4fv("clipPlanes", 6, planeEquations);
-}
-
-void vtkOpenGLContextDevice3D::BuildVBO(
-  vtkOpenGLHelper *cellBO,
-  const float *f, int nv,
-  const unsigned char *colors, int nc,
-  float *tcoords)
-{
-  int stride = 3;
-  int cOffset = 0;
-  int tOffset = 0;
-  if (colors)
-    {
-    cOffset = stride;
-    stride++;
-    }
-  if (tcoords)
-    {
-    tOffset = stride;
-    stride += 2;
-    }
-
-  std::vector<float> va;
-  va.resize(nv*stride);
-  vtkucfloat c;
-  for (int i = 0; i < nv; i++)
-    {
-    va[i*stride] = f[i*3];
-    va[i*stride+1] = f[i*3+1];
-    va[i*stride+2] = f[i*3+2];
-    if (colors)
-      {
-      c.c[0] = colors[nc*i];
-      c.c[1] = colors[nc*i+1];
-      c.c[2] = colors[nc*i+2];
-      if (nc == 4)
-        {
-        c.c[3] = colors[nc*i+3];
-        }
-      else
-        {
-        c.c[3] =  255;
-        }
-      va[i*stride+cOffset] = c.f;
-      }
-    if (tcoords)
-      {
-      va[i*stride+tOffset] = tcoords[i*2];
-      va[i*stride+tOffset+1] = tcoords[i*2+1];
-      }
-    }
-
-  // upload the data
-  cellBO->IBO->Upload(va, vtkOpenGLBufferObject::ArrayBuffer);
-  cellBO->VAO->Bind();
-  if (!cellBO->VAO->AddAttributeArray(
-        cellBO->Program, cellBO->IBO,
-        "vertexMC", 0,
-        sizeof(float)*stride,
-        VTK_FLOAT, 3, false))
-    {
-    vtkErrorMacro(<< "Error setting vertexMC in shader VAO.");
-    }
-  if (colors)
-    {
-    if (!cellBO->VAO->AddAttributeArray(
-          cellBO->Program, cellBO->IBO,
-          "vertexScalar", sizeof(float)*cOffset,
-          sizeof(float)*stride,
-          VTK_UNSIGNED_CHAR, 4, true))
-      {
-      vtkErrorMacro(<< "Error setting vertexScalar in shader VAO.");
-      }
-    }
-  if (tcoords)
-    {
-    if (!cellBO->VAO->AddAttributeArray(
-          cellBO->Program, cellBO->IBO,
-          "tcoordMC", sizeof(float)*tOffset,
-          sizeof(float)*stride,
-          VTK_FLOAT, 2, false))
-      {
-      vtkErrorMacro(<< "Error setting tcoordMC in shader VAO.");
-      }
-    }
-
-  cellBO->VAO->Bind();
-}
-
-void vtkOpenGLContextDevice3D::ReadyVBOProgram()
-{
-  if (!this->VBO->Program)
-    {
-    this->VBO->Program  =
-        this->RenderWindow->GetShaderCache()->ReadyShaderProgram(
-        // vertex shader
-        "//VTK::System::Dec\n"
-        "attribute vec3 vertexMC;\n"
-        "uniform mat4 WCDCMatrix;\n"
-        "uniform mat4 MCWCMatrix;\n"
-        "uniform int numClipPlanes;\n"
-        "uniform vec4 clipPlanes[6];\n"
-        "varying float clipDistances[6];\n"
-        "void main() {\n"
-        "vec4 vertex = vec4(vertexMC.xyz, 1.0);\n"
-        "for (int planeNum = 0; planeNum < numClipPlanes; planeNum++)\n"
-        "  {\n"
-        "  clipDistances[planeNum] = dot(clipPlanes[planeNum], vertex*MCWCMatrix);\n"
-        "  }\n"
-        "gl_Position = vertex*MCWCMatrix*WCDCMatrix; }\n",
-        // fragment shader
-        "//VTK::System::Dec\n"
-        "//VTK::Output::Dec\n"
-        "uniform vec4 vertexColor;\n"
-        "uniform int numClipPlanes;\n"
-        "varying float clipDistances[6];\n"
-        "void main() { \n"
-        "  for (int planeNum = 0; planeNum < numClipPlanes; planeNum++)\n"
-        "    {\n"
-        "    if (clipDistances[planeNum] < 0.0) discard;\n"
-        "    }\n"
-        "  gl_FragData[0] = vertexColor; }",
-        // geometry shader
-        "");
-    }
-  else
-    {
-    this->RenderWindow->GetShaderCache()->ReadyShaderProgram(this->VBO->Program);
-    }
-}
-
-void vtkOpenGLContextDevice3D::ReadyVCBOProgram()
-{
-  if (!this->VCBO->Program)
-    {
-    this->VCBO->Program  =
-        this->RenderWindow->GetShaderCache()->ReadyShaderProgram(
-        // vertex shader
-        "//VTK::System::Dec\n"
-        "attribute vec3 vertexMC;\n"
-        "attribute vec4 vertexScalar;\n"
-        "uniform mat4 WCDCMatrix;\n"
-        "uniform mat4 MCWCMatrix;\n"
-        "varying vec4 vertexColor;\n"
-        "uniform int numClipPlanes;\n"
-        "uniform vec4 clipPlanes[6];\n"
-        "varying float clipDistances[6];\n"
-        "void main() {\n"
-        "vec4 vertex = vec4(vertexMC.xyz, 1.0);\n"
-        "vertexColor = vertexScalar;\n"
-        "for (int planeNum = 0; planeNum < numClipPlanes; planeNum++)\n"
-        "  {\n"
-        "  clipDistances[planeNum] = dot(clipPlanes[planeNum], vertex*MCWCMatrix);\n"
-        "  }\n"
-        "gl_Position = vertex*MCWCMatrix*WCDCMatrix; }\n",
-        // fragment shader
-        "//VTK::System::Dec\n"
-        "//VTK::Output::Dec\n"
-        "varying vec4 vertexColor;\n"
-        "uniform int numClipPlanes;\n"
-        "varying float clipDistances[6];\n"
-        "void main() { \n"
-        "  for (int planeNum = 0; planeNum < numClipPlanes; planeNum++)\n"
-        "    {\n"
-        "    if (clipDistances[planeNum] < 0.0) discard;\n"
-        "    }\n"
-        "  gl_FragData[0] = vertexColor; }",
-        // geometry shader
-        "");
-    }
-  else
-    {
-    this->RenderWindow->GetShaderCache()->ReadyShaderProgram(this->VCBO->Program);
-    }
-}
-
-bool vtkOpenGLContextDevice3D::HaveWideLines()
-{
-  if (this->Pen->GetWidth() > 1.0
-      && vtkOpenGLRenderWindow::GetContextSupportsOpenGL32())
-    {
-    // we have wide lines, but the OpenGL implementation may
-    // actually support them, check the range to see if we
-    // really need have to implement our own wide lines
-    return !(this->RenderWindow &&
-      this->RenderWindow->GetMaximumHardwareLineWidth() >= this->Pen->GetWidth());
-    }
-  return false;
-}
-
-
 void vtkOpenGLContextDevice3D::DrawPoly(const float *verts, int n,
                                         const unsigned char *colors, int nc)
 {
   assert("verts must be non-null" && verts != NULL);
   assert("n must be greater than 0" && n > 0);
 
-  if (this->Pen->GetLineType() == vtkPen::NO_PEN)
-    {
-    return;
-    }
-
   vtkOpenGLClearErrorMacro();
 
   this->EnableDepthBuffer();
 
   this->Storage->SetLineType(this->Pen->GetLineType());
+  glLineWidth(this->Pen->GetWidth());
 
-  vtkOpenGLHelper *cbo = 0;
   if (colors)
     {
-    this->ReadyVCBOProgram();
-    cbo = this->VCBO;
+    glEnableClientState(GL_COLOR_ARRAY);
+    glColorPointer(nc, GL_UNSIGNED_BYTE, 0, colors);
     }
   else
     {
-    this->ReadyVBOProgram();
-    cbo = this->VBO;
-    if (this->HaveWideLines())
-      {
-      vtkWarningMacro(<< "a line width has been requested that is larger than your system supports");
-      }
-    else
-      {
-      glLineWidth(this->Pen->GetWidth());
-      }
-    cbo->Program->SetUniform4uc("vertexColor",
-      this->Pen->GetColor());
+    glColor4ubv(this->Pen->GetColor());
     }
-
-  this->BuildVBO(cbo, verts, n, colors, nc, NULL);
-  this->SetMatrices(cbo->Program);
-
+  glEnableClientState(GL_VERTEX_ARRAY);
+  glVertexPointer(3, GL_FLOAT, 0, verts);
   glDrawArrays(GL_LINE_STRIP, 0, n);
-
-  // free everything
-  cbo->ReleaseGraphicsResources(this->RenderWindow);
-  glLineWidth(1.0);
-
-  this->DisableDepthBuffer();
-
-  vtkOpenGLCheckErrorMacro("failed after DrawPoly");
-}
-
-
-//-----------------------------------------------------------------------------
-void vtkOpenGLContextDevice3D::DrawLines(const float *verts, int n,
-                                         const unsigned char *colors, int nc)
-{
-  assert("verts must be non-null" && verts != NULL);
-  assert("n must be greater than 0" && n > 0);
-
-  if (this->Pen->GetLineType() == vtkPen::NO_PEN)
-    {
-    return;
-    }
-
-  vtkOpenGLClearErrorMacro();
-
-  this->EnableDepthBuffer();
-
-  this->Storage->SetLineType(this->Pen->GetLineType());
-
-  if (this->Pen->GetWidth() > 1.0)
-    {
-    vtkErrorMacro(<< "lines wider than 1.0 are not supported\n");
-    }
-  glLineWidth(this->Pen->GetWidth());
-
-  vtkOpenGLHelper *cbo = 0;
+  glDisableClientState(GL_VERTEX_ARRAY);
   if (colors)
     {
-    this->ReadyVCBOProgram();
-    cbo = this->VCBO;
-    }
-  else
-    {
-    this->ReadyVBOProgram();
-    cbo = this->VBO;
-    cbo->Program->SetUniform4uc("vertexColor",
-      this->Pen->GetColor());
+    glDisableClientState(GL_COLOR_ARRAY);
     }
 
-  this->BuildVBO(cbo, verts, n, colors, nc, NULL);
-  this->SetMatrices(cbo->Program);
-
-  glDrawArrays(GL_LINE, 0, n);
-
-  // free everything
-  cbo->ReleaseGraphicsResources(this->RenderWindow);
-  glLineWidth(1.0);
-
   this->DisableDepthBuffer();
 
-  vtkOpenGLCheckErrorMacro("failed after DrawLines");
+  vtkOpenGLCheckErrorMacro("failed after DrawPoly");
 }
 
 void vtkOpenGLContextDevice3D::DrawPoints(const float *verts, int n,
@@ -491,28 +188,23 @@ void vtkOpenGLContextDevice3D::DrawPoints(const float *verts, int n,
   this->EnableDepthBuffer();
 
   glPointSize(this->Pen->GetWidth());
-
-  vtkOpenGLHelper *cbo = 0;
-  if (colors)
+  glEnableClientState(GL_VERTEX_ARRAY);
+  if (colors && nc)
     {
-    this->ReadyVCBOProgram();
-    cbo = this->VCBO;
+    glEnableClientState(GL_COLOR_ARRAY);
+    glColorPointer(nc, GL_UNSIGNED_BYTE, 0, colors);
     }
   else
     {
-    this->ReadyVBOProgram();
-    cbo = this->VBO;
-    cbo->Program->SetUniform4uc("vertexColor",
-      this->Pen->GetColor());
+    glColor4ubv(this->Pen->GetColor());
     }
-
-  this->BuildVBO(cbo, verts, n, colors, nc, NULL);
-  this->SetMatrices(cbo->Program);
-
+  glVertexPointer(3, GL_FLOAT, 0, verts);
   glDrawArrays(GL_POINTS, 0, n);
-
-  // free everything
-  cbo->ReleaseGraphicsResources(this->RenderWindow);
+  glDisableClientState(GL_VERTEX_ARRAY);
+  if (colors && nc)
+    {
+    glDisableClientState(GL_COLOR_ARRAY);
+    }
 
   this->DisableDepthBuffer();
 
@@ -530,27 +222,24 @@ void vtkOpenGLContextDevice3D::DrawTriangleMesh(const float *mesh, int n,
 
   this->EnableDepthBuffer();
 
-  vtkOpenGLHelper *cbo = 0;
-  if (colors)
+  glPointSize(this->Pen->GetWidth());
+  glEnableClientState(GL_VERTEX_ARRAY);
+  if (colors && nc)
     {
-    this->ReadyVCBOProgram();
-    cbo = this->VCBO;
+    glEnableClientState(GL_COLOR_ARRAY);
+    glColorPointer(nc, GL_UNSIGNED_BYTE, 0, colors);
     }
   else
     {
-    this->ReadyVBOProgram();
-    cbo = this->VBO;
-    cbo->Program->SetUniform4uc("vertexColor",
-      this->Pen->GetColor());
+    glColor4ubv(this->Pen->GetColor());
     }
-
-  this->BuildVBO(cbo, mesh, n, colors, nc, NULL);
-  this->SetMatrices(cbo->Program);
-
+  glVertexPointer(3, GL_FLOAT, 0, mesh);
   glDrawArrays(GL_TRIANGLES, 0, n);
-
-  // free everything
-  cbo->ReleaseGraphicsResources(this->RenderWindow);
+  glDisableClientState(GL_VERTEX_ARRAY);
+  if (colors && nc)
+    {
+    glDisableClientState(GL_COLOR_ARRAY);
+    }
 
   this->DisableDepthBuffer();
 
@@ -567,31 +256,45 @@ void vtkOpenGLContextDevice3D::ApplyBrush(vtkBrush *brush)
   this->Brush->DeepCopy(brush);
 }
 
-//-----------------------------------------------------------------------------
-void vtkOpenGLContextDevice3D::PushMatrix()
+void vtkOpenGLContextDevice3D::SetMatrix(vtkMatrix4x4 *m)
 {
-  this->ModelMatrix->Push();
+  double matrix[16];
+  double *M = m->Element[0];
+  this->Storage->Transpose(M, matrix);
+
+  glLoadMatrixd(matrix);
 }
 
-//-----------------------------------------------------------------------------
-void vtkOpenGLContextDevice3D::PopMatrix()
+void vtkOpenGLContextDevice3D::GetMatrix(vtkMatrix4x4 *m)
 {
-  this->ModelMatrix->Pop();
+  double *M = m->Element[0];
+  m->Transpose();
+  double matrix[16];
+  glGetDoublev(GL_MODELVIEW_MATRIX, matrix);
+  this->Storage->Transpose(matrix, M);
 }
 
-void vtkOpenGLContextDevice3D::SetMatrix(vtkMatrix4x4 *m)
+void vtkOpenGLContextDevice3D::MultiplyMatrix(vtkMatrix4x4 *m)
 {
-  this->ModelMatrix->SetMatrix(m);
+  double matrix[16];
+  double *M = m->Element[0];
+  this->Storage->Transpose(M, matrix);
+
+  glMultMatrixd(matrix);
 }
 
-void vtkOpenGLContextDevice3D::GetMatrix(vtkMatrix4x4 *m)
+void vtkOpenGLContextDevice3D::PushMatrix()
 {
-  m->DeepCopy(this->ModelMatrix->GetMatrix());
+  glMatrixMode(GL_MODELVIEW);
+  glPushMatrix();
+  vtkOpenGLCheckErrorMacro("failed after PushMatrix");
 }
 
-void vtkOpenGLContextDevice3D::MultiplyMatrix(vtkMatrix4x4 *m)
+void vtkOpenGLContextDevice3D::PopMatrix()
 {
-  this->ModelMatrix->Concatenate(m);
+  glMatrixMode(GL_MODELVIEW);
+  glPopMatrix();
+  vtkOpenGLCheckErrorMacro("failed after PopMatrix");
 }
 
 void vtkOpenGLContextDevice3D::SetClipping(const vtkRecti &rect)
@@ -634,26 +337,17 @@ void vtkOpenGLContextDevice3D::EnableClipping(bool enable)
 
 void vtkOpenGLContextDevice3D::EnableClippingPlane(int i, double *planeEquation)
 {
-  if (i >= 6)
-    {
-    vtkOpenGLCheckErrorMacro("only 6 ClippingPlane allowed");
-    return;
-    }
-  this->ClippingPlaneStates[i] = true;
-  this->ClippingPlaneValues[i*4] = planeEquation[0];
-  this->ClippingPlaneValues[i*4+1] = planeEquation[1];
-  this->ClippingPlaneValues[i*4+2] = planeEquation[2];
-  this->ClippingPlaneValues[i*4+3] = planeEquation[3];
+  GLenum clipPlaneId = static_cast<GLenum>(GL_CLIP_PLANE0+i);
+  glEnable(clipPlaneId);
+  glClipPlane(clipPlaneId, planeEquation);
+  vtkOpenGLCheckErrorMacro("failed after EnableClippingPlane");
 }
 
 void vtkOpenGLContextDevice3D::DisableClippingPlane(int i)
 {
-  if (i >= 6)
-    {
-    vtkOpenGLCheckErrorMacro("only 6 ClippingPlane allowed");
-    return;
-    }
-  this->ClippingPlaneStates[i] = false;
+  GLenum clipPlaneId = static_cast<GLenum>(GL_CLIP_PLANE0+i);
+  glDisable(clipPlaneId);
+  vtkOpenGLCheckErrorMacro("failed after DisableClippingPlane");
 }
 
 void vtkOpenGLContextDevice3D::EnableDepthBuffer()
diff --git a/Rendering/ContextOpenGL2/vtkOpenGLContextDevice3D.h b/Rendering/ContextOpenGL2/vtkOpenGLContextDevice3D.h
index 0f170af..372aac3 100644
--- a/Rendering/ContextOpenGL2/vtkOpenGLContextDevice3D.h
+++ b/Rendering/ContextOpenGL2/vtkOpenGLContextDevice3D.h
@@ -25,16 +25,9 @@
 #include "vtkRenderingContextOpenGL2Module.h" // For export macro
 #include "vtkContextDevice3D.h"
 #include "vtkNew.h"             // For ivars.
-#include <vector> // STL Header
 
 class vtkBrush;
-class vtkOpenGLContextDevice2D;
-class vtkOpenGLHelper;
-class vtkOpenGLRenderWindow;
 class vtkPen;
-class vtkRenderer;
-class vtkShaderProgram;
-class vtkTransform;
 
 class VTKRENDERINGCONTEXTOPENGL2_EXPORT vtkOpenGLContextDevice3D : public vtkContextDevice3D
 {
@@ -49,11 +42,6 @@ public:
   void DrawPoly(const float *verts, int n, const unsigned char *colors, int nc);
 
   // Description:
-  // Draw lines defined by specified pair of points.
-  // \sa DrawPoly()
-  void DrawLines(const float *verts, int n, const unsigned char *colors, int nc);
-
-  // Description:
   // Draw points at the vertex positions specified.
   void DrawPoints(const float *verts, int n,
                   const unsigned char *colors, int nc);
@@ -113,14 +101,6 @@ public:
   void EnableClippingPlane(int i, double *planeEquation);
   void DisableClippingPlane(int i);
 
-  // Description
-  // This must be set during initialization
-  void Initialize(vtkRenderer *, vtkOpenGLContextDevice2D *);
-
-  // Description:
-  // Begin drawing, pass in the viewport to set up the view.
-  virtual void Begin(vtkViewport* viewport);
-
 protected:
   vtkOpenGLContextDevice3D();
   ~vtkOpenGLContextDevice3D();
@@ -133,34 +113,6 @@ protected:
   // End drawing, turn off the depth buffer.
   virtual void DisableDepthBuffer();
 
-  vtkOpenGLHelper *VCBO;  // vertex + color
-  void ReadyVCBOProgram();
-  vtkOpenGLHelper *VBO;  // vertex
-  void ReadyVBOProgram();
-
-  void SetMatrices(vtkShaderProgram *prog);
-  void BuildVBO(vtkOpenGLHelper *cbo,
-    const float *v, int nv,
-    const unsigned char *coolors, int nc,
-    float *tcoords);
-  void CoreDrawTriangles(std::vector<float> &tverts);
-
-  // do we have wide lines that require special handling
-  virtual bool HaveWideLines();
-
-  vtkTransform *ModelMatrix;
-
-  // Description:
-  // The OpenGL render window being used by the device
-  vtkOpenGLRenderWindow* RenderWindow;
-
-  // Description:
-  // We need to store a pointer to get the camera mats
-  vtkRenderer *Renderer;
-
-  std::vector<bool> ClippingPlaneStates;
-  std::vector<double> ClippingPlaneValues;
-
 private:
   vtkOpenGLContextDevice3D(const vtkOpenGLContextDevice3D &); // Not implemented.
   void operator=(const vtkOpenGLContextDevice3D &);   // Not implemented.
@@ -170,11 +122,6 @@ private:
   class Private;
   Private *Storage;
 
-  // we need a pointer to this because only
-  // the 2D device gets a Begin and sets up
-  // the ortho matrix
-  vtkOpenGLContextDevice2D *Device2D;
-
   vtkNew<vtkBrush> Brush;
   vtkNew<vtkPen>   Pen;
 };
diff --git a/Rendering/Core/Testing/Cxx/CMakeLists.txt b/Rendering/Core/Testing/Cxx/CMakeLists.txt
index d5ae447..c3e5c8c 100644
--- a/Rendering/Core/Testing/Cxx/CMakeLists.txt
+++ b/Rendering/Core/Testing/Cxx/CMakeLists.txt
@@ -1,12 +1,7 @@
 if(VTK_RENDERING_BACKEND STREQUAL "OpenGL2")
   set(extra_opengl2_tests
     TestCompositePolyDataMapper2.cxx,NO_DATA
-    TestCompositePolyDataMapper2Scalars.cxx,NO_DATA
-    # the following produce incorrect results in OpenGL
-    TestTranslucentLUTAlphaBlending.cxx
-    TestTranslucentLUTTextureAlphaBlending.cxx
-    TestAreaSelections.cxx
-    )
+    TestAreaSelections.cxx) # incorrect results in OpenGL
 endif()
 
 vtk_add_test_cxx(${vtk-module}CxxTests tests
@@ -27,7 +22,6 @@ vtk_add_test_cxx(${vtk-module}CxxTests tests
   TestColorByPointDataStringArray.cxx
   TestColorByStringArrayDefaultLookupTable.cxx
   TestColorByStringArrayDefaultLookupTable2D.cxx
-  TestColorTransferFunction.cxx,NO_VALID
   TestColorTransferFunctionStringArray.cxx,NO_VALID
   TestDirectScalarsToColors.cxx
   TestDiscretizableColorTransferFunction.cxx,NO_VALID
@@ -44,7 +38,6 @@ vtk_add_test_cxx(${vtk-module}CxxTests tests
   TestInteractorStyleImageProperty.cxx,NO_VALID
   TestInteractorTimers.cxx,NO_VALID
   TestLabeledContourMapper.cxx
-  TestLabeledContourMapperWithActorMatrix.cxx
   TestPickingManager.cxx,NO_VALID
   TestManyActors.cxx,NO_VALID
   TestMapVectorsAsRGBColors.cxx
@@ -66,7 +59,9 @@ vtk_add_test_cxx(${vtk-module}CxxTests tests
   TestTransformCoordinateUseDouble.cxx
   TestTranslucentImageActorAlphaBlending.cxx
   TestTranslucentImageActorDepthPeeling.cxx
+  TestTranslucentLUTAlphaBlending.cxx
   TestTranslucentLUTDepthPeeling.cxx
+  TestTranslucentLUTTextureAlphaBlending.cxx
   TestTranslucentLUTTextureDepthPeeling.cxx
   TestTStripsColorsTCoords.cxx
   TestTStripsNormalsColorsTCoords.cxx
diff --git a/Rendering/Core/Testing/Cxx/RGrid.cxx b/Rendering/Core/Testing/Cxx/RGrid.cxx
index 5b2dd31..755cda2 100644
--- a/Rendering/Core/Testing/Cxx/RGrid.cxx
+++ b/Rendering/Core/Testing/Cxx/RGrid.cxx
@@ -29,28 +29,28 @@
 int RGrid( int argc, char *argv[] )
 {
   int i;
-  static float x[47]={-1.22396f, -1.17188f, -1.11979f, -1.06771f, -1.01562f, -0.963542f,
-                      -0.911458f, -0.859375f, -0.807292f, -0.755208f, -0.703125f, -0.651042f,
-                      -0.598958f, -0.546875f, -0.494792f, -0.442708f, -0.390625f, -0.338542f,
-                      -0.286458f, -0.234375f, -0.182292f, -0.130209f, -0.078125f, -0.026042f,
-                       0.0260415f, 0.078125f, 0.130208f, 0.182291f, 0.234375f, 0.286458f,
-                       0.338542f, 0.390625f, 0.442708f, 0.494792f, 0.546875f, 0.598958f,
-                       0.651042f, 0.703125f, 0.755208f, 0.807292f, 0.859375f, 0.911458f,
-                       0.963542f, 1.01562f, 1.06771f, 1.11979f, 1.17188f};
-  static float y[33]={-1.25f, -1.17188f, -1.09375f, -1.01562f, -0.9375f, -0.859375f,
-                      -0.78125f, -0.703125f, -0.625f, -0.546875f, -0.46875f, -0.390625f,
-                      -0.3125f, -0.234375f, -0.15625f, -0.078125f, 0.0f, 0.078125f,
-                       0.15625f, 0.234375f, 0.3125f, 0.390625f, 0.46875f, 0.546875f,
-                       0.625f, 0.703125f, 0.78125f, 0.859375f, 0.9375f, 1.01562f,
-                       1.09375f, 1.17188f, 1.25f};
-  static float z[44]={0.0f, 0.1f, 0.2f, 0.3f, 0.4f, 0.5f,
-                      0.6f, 0.7f, 0.75f, 0.8f, 0.9f, 1.0f,
-                      1.1f, 1.2f, 1.3f, 1.4f, 1.5f, 1.6f,
-                      1.7f, 1.75f, 1.8f, 1.9f, 2.0f, 2.1f,
-                      2.2f, 2.3f, 2.4f, 2.5f, 2.6f, 2.7f,
-                      2.75f, 2.8f, 2.9f, 3.0f, 3.1f, 3.2f,
-                      3.3f, 3.4f, 3.5f, 3.6f, 3.7f, 3.75f,
-                      3.8f, 3.9f};
+  static float x[47]={-1.22396, -1.17188, -1.11979, -1.06771, -1.01562, -0.963542,
+                      -0.911458, -0.859375, -0.807292, -0.755208, -0.703125, -0.651042,
+                      -0.598958, -0.546875, -0.494792, -0.442708, -0.390625, -0.338542,
+                      -0.286458, -0.234375, -0.182292, -0.130209, -0.078125, -0.026042,
+                       0.0260415, 0.078125, 0.130208, 0.182291, 0.234375, 0.286458,
+                       0.338542, 0.390625, 0.442708, 0.494792, 0.546875, 0.598958,
+                       0.651042, 0.703125, 0.755208, 0.807292, 0.859375, 0.911458,
+                       0.963542, 1.01562, 1.06771, 1.11979, 1.17188};
+  static float y[33]={-1.25, -1.17188, -1.09375, -1.01562, -0.9375, -0.859375,
+                      -0.78125, -0.703125, -0.625, -0.546875, -0.46875, -0.390625,
+                      -0.3125, -0.234375, -0.15625, -0.078125, 0, 0.078125,
+                       0.15625, 0.234375, 0.3125, 0.390625, 0.46875, 0.546875,
+                       0.625, 0.703125, 0.78125, 0.859375, 0.9375, 1.01562,
+                       1.09375, 1.17188, 1.25};
+  static float z[44]={0, 0.1, 0.2, 0.3, 0.4, 0.5,
+                      0.6, 0.7, 0.75, 0.8, 0.9, 1,
+                      1.1, 1.2, 1.3, 1.4, 1.5, 1.6,
+                      1.7, 1.75, 1.8, 1.9, 2, 2.1,
+                      2.2, 2.3, 2.4, 2.5, 2.6, 2.7,
+                      2.75, 2.8, 2.9, 3, 3.1, 3.2,
+                      3.3, 3.4, 3.5, 3.6, 3.7, 3.75,
+                      3.8, 3.9};
 
   vtkRenderer *renderer = vtkRenderer::New();
   vtkRenderWindow *renWin = vtkRenderWindow::New();
diff --git a/Rendering/Core/Testing/Cxx/TestColorByStringArrayDefaultLookupTable.cxx b/Rendering/Core/Testing/Cxx/TestColorByStringArrayDefaultLookupTable.cxx
index 0d70e3e..dc20671 100644
--- a/Rendering/Core/Testing/Cxx/TestColorByStringArrayDefaultLookupTable.cxx
+++ b/Rendering/Core/Testing/Cxx/TestColorByStringArrayDefaultLookupTable.cxx
@@ -66,11 +66,6 @@ int TestColorByStringArrayDefaultLookupTable(int argc, char* argv[])
   mapper->SetScalarModeToUseCellFieldData();
   mapper->SelectColorArray(arrayName);
 
-  // Direct coloring shouldn't be possible with string arrays, so we
-  // enable direct scalars to test that the string arrays get mapped
-  // despite the color mode setting being direct scalars.
-  mapper->SetColorModeToDirectScalars();
-
   vtkNew<vtkActor> actor;
   actor->SetMapper(mapper.Get());
 
diff --git a/Rendering/Core/Testing/Cxx/TestColorTransferFunction.cxx b/Rendering/Core/Testing/Cxx/TestColorTransferFunction.cxx
deleted file mode 100644
index 06c7667..0000000
--- a/Rendering/Core/Testing/Cxx/TestColorTransferFunction.cxx
+++ /dev/null
@@ -1,50 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    TestColorTransferFunctionStringArray.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 <vtkColorTransferFunction.h>
-#include <vtkSmartPointer.h>
-
-int TestColorTransferFunction(int vtkNotUsed(argc), char* vtkNotUsed(argv)[])
-{
-  vtkSmartPointer<vtkColorTransferFunction> ctf = vtkSmartPointer<vtkColorTransferFunction>::New();
-
-  // Test for crash when getting table with no points
-  ctf->RemoveAllPoints();
-
-  // Range should be [0, 0]. Honest to goodness 0, not just very close to 0.
-  double range[2];
-  ctf->GetRange(range);
-
-  if (range[0] != 0.0 || range[1] != 0.0)
-    {
-    std::cerr << "After RemoveAllPoints() is called, range should be [0, 0]. "
-              << "It was [" << range[0] << ", " << range[1] << "].\n";
-    return EXIT_FAILURE;
-    }
-
-  double table[256*3];
-  ctf->GetTable(0.0, 1.0, 256, table);
-
-  // Table should be all black.
-  for (int i = 0; i < 3*256; ++i)
-    {
-    if (table[i] != 0.0)
-      {
-      std::cerr << "Table should have all zeros.\n";
-      return EXIT_FAILURE;
-      }
-    }
-
-  return EXIT_SUCCESS;
-}
\ No newline at end of file
diff --git a/Rendering/Core/Testing/Cxx/TestCompositePolyDataMapper2.cxx b/Rendering/Core/Testing/Cxx/TestCompositePolyDataMapper2.cxx
index b19d183..294dc29 100644
--- a/Rendering/Core/Testing/Cxx/TestCompositePolyDataMapper2.cxx
+++ b/Rendering/Core/Testing/Cxx/TestCompositePolyDataMapper2.cxx
@@ -92,7 +92,7 @@ int TestCompositePolyDataMapper2(int argc, char* argv[])
           cyl->Update();
           child->DeepCopy(cyl->GetOutput(0));
           blocks[parent]->SetBlock(
-            block, (block % 2) ? NULL : child.GetPointer());
+            block, block % 2 ? NULL : child.GetPointer());
           blocks[parent]->GetMetaData(block)->Set(
             vtkCompositeDataSet::NAME(), blockName.c_str());
           // test not setting it on some
diff --git a/Rendering/Core/Testing/Cxx/TestCompositePolyDataMapper2Scalars.cxx b/Rendering/Core/Testing/Cxx/TestCompositePolyDataMapper2Scalars.cxx
deleted file mode 100644
index 91e17f3..0000000
--- a/Rendering/Core/Testing/Cxx/TestCompositePolyDataMapper2Scalars.cxx
+++ /dev/null
@@ -1,168 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkCompositePolyDataMapper2.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 "vtkActor.h"
-#include "vtkCamera.h"
-#include "vtkCompositeDataSet.h"
-#include "vtkCompositeDataDisplayAttributes.h"
-#include "vtkCompositePolyDataMapper2.h"
-#include "vtkCullerCollection.h"
-#include "vtkInformation.h"
-#include "vtkMath.h"
-#include "vtkMultiBlockDataSet.h"
-#include "vtkNew.h"
-#include "vtkProperty.h"
-#include "vtkRenderer.h"
-#include "vtkRenderWindow.h"
-#include "vtkRenderWindowInteractor.h"
-#include "vtkSmartPointer.h"
-#include "vtkTimerLog.h"
-#include "vtkTrivialProducer.h"
-
-#include <vtkTestUtilities.h>
-#include <vtkRegressionTestImage.h>
-
-#include "vtkCylinderSource.h"
-#include "vtkElevationFilter.h"
-
-int TestCompositePolyDataMapper2Scalars(int argc, char* argv[])
-{
-  vtkSmartPointer<vtkRenderWindow> win =
-    vtkSmartPointer<vtkRenderWindow>::New();
-  vtkSmartPointer<vtkRenderWindowInteractor> iren =
-    vtkSmartPointer<vtkRenderWindowInteractor>::New();
-  vtkSmartPointer<vtkRenderer> ren =
-    vtkSmartPointer<vtkRenderer>::New();
-  win->AddRenderer(ren);
-  win->SetInteractor(iren);
-
-  vtkSmartPointer<vtkCompositePolyDataMapper2> mapper =
-    vtkSmartPointer<vtkCompositePolyDataMapper2>::New();
-  vtkNew<vtkCompositeDataDisplayAttributes> cdsa;
-  mapper->SetCompositeDataDisplayAttributes(cdsa.GetPointer());
-
-  int resolution = 18;
-  vtkNew<vtkCylinderSource> cyl;
-  cyl->CappingOn();
-  cyl->SetRadius(0.2);
-  cyl->SetResolution(resolution);
-
-  vtkNew<vtkElevationFilter> elev;
-  elev->SetInputConnection(cyl->GetOutputPort());
-  // geometry range is -0.5 to 0.5 but these colors are
-  // pretty
-  elev->SetLowPoint(0,-1.0,0);
-  elev->SetHighPoint(0.0,1.0,0.0);
-
-  // build a composite dataset
-  vtkNew<vtkMultiBlockDataSet> data;
-//  int blocksPerLevel[3] = {1,64,256};
-  int blocksPerLevel[3] = {1,32,64};
-  std::vector<vtkSmartPointer<vtkMultiBlockDataSet> > blocks;
-  blocks.push_back(data.GetPointer());
-  unsigned levelStart = 0;
-  unsigned levelEnd = 1;
-  int numLevels = sizeof(blocksPerLevel) / sizeof(blocksPerLevel[0]);
-  int numLeaves = 0;
-  int numNodes = 0;
-  vtkStdString blockName("Rolf");
-  for (int level = 1; level < numLevels; ++level)
-    {
-    int nblocks=blocksPerLevel[level];
-    for (unsigned parent = levelStart; parent < levelEnd; ++parent)
-      {
-      blocks[parent]->SetNumberOfBlocks(nblocks);
-      for (int block=0; block < nblocks; ++block, ++numNodes)
-        {
-        if (level == numLevels - 1)
-          {
-          vtkNew<vtkPolyData> child;
-          cyl->SetCenter(block*0.25, 0.0, parent*0.5);
-          elev->Update();
-          child->DeepCopy(elev->GetOutput(0));
-          blocks[parent]->SetBlock(
-            block, (block % 2) ? NULL : child.GetPointer());
-          blocks[parent]->GetMetaData(block)->Set(
-            vtkCompositeDataSet::NAME(), blockName.c_str());
-          // test not setting it on some
-          if (block % 11)
-            {
-            mapper->SetBlockOpacity(parent+numLeaves, (block + 3) % 7 == 0 ? 0.3 : 1.0);
-            mapper->SetBlockVisibility(parent+numLeaves, (block % 7) != 0);
-            }
-          ++numLeaves;
-          }
-        else
-          {
-          vtkNew<vtkMultiBlockDataSet> child;
-          blocks[parent]->SetBlock(block, child.GetPointer());
-          blocks.push_back(child.GetPointer());
-          }
-        }
-      }
-    levelStart = levelEnd;
-    levelEnd = static_cast<unsigned>(blocks.size());
-    }
-
-  mapper->SetInputData((vtkPolyData *)(data.GetPointer()));
-
-  vtkSmartPointer<vtkActor> actor =
-    vtkSmartPointer<vtkActor>::New();
-  actor->SetMapper(mapper);
-  //actor->GetProperty()->SetEdgeColor(1,0,0);
-  //actor->GetProperty()->EdgeVisibilityOn();
-  ren->AddActor(actor);
-  win->SetSize(400,400);
-
-  ren->RemoveCuller(ren->GetCullers()->GetLastItem());
-  ren->ResetCamera();
-
-  vtkSmartPointer<vtkTimerLog> timer = vtkSmartPointer<vtkTimerLog>::New();
-  win->Render();  // get the window up
-
-  // modify the data to force a rebuild of OpenGL structs
-  // after rendering set one cylinder to white
-  mapper->SetBlockColor(911,1.0,1.0,1.0);
-  mapper->SetBlockOpacity(911,1.0);
-  mapper->SetBlockVisibility(911,1.0);
-
-  timer->StartTimer();
-  win->Render();
-  timer->StopTimer();
-  cout << "First frame time: " << timer->GetElapsedTime() << "\n";
-
-  timer->StartTimer();
-
-  int numFrames = 2;
-  for (int i = 0; i <= numFrames; i++)
-    {
-    ren->GetActiveCamera()->Elevation(40.0/numFrames);
-    ren->GetActiveCamera()->Zoom(pow(2.0,1.0/numFrames));
-    ren->GetActiveCamera()->Roll(20.0/numFrames);
-    win->Render();
-    }
-
-  timer->StopTimer();
-  double t =  timer->GetElapsedTime();
-  cout << "Avg Frame time: " << t/numFrames << " Frame Rate: " << numFrames / t << "\n";
-
-  int retVal = vtkRegressionTestImageThreshold( win.GetPointer(),15);
-  if ( retVal == vtkRegressionTester::DO_INTERACTOR)
-    {
-    iren->Start();
-    }
-
-  return !retVal;
-}
diff --git a/Rendering/Core/Testing/Cxx/TestGlyph3DMapperPicking.cxx b/Rendering/Core/Testing/Cxx/TestGlyph3DMapperPicking.cxx
index 25f0581..2236091 100644
--- a/Rendering/Core/Testing/Cxx/TestGlyph3DMapperPicking.cxx
+++ b/Rendering/Core/Testing/Cxx/TestGlyph3DMapperPicking.cxx
@@ -45,7 +45,7 @@
 #include "vtkSelectionNode.h"
 #include <cassert>
 
-static vtkRenderer *renderer = NULL;
+vtkRenderer *renderer = NULL;
 
 class MyEndPickCommand : public vtkCommand
 {
diff --git a/Rendering/Core/Testing/Cxx/TestLabeledContourMapper.cxx b/Rendering/Core/Testing/Cxx/TestLabeledContourMapper.cxx
index ca7aec6..6e241a4 100644
--- a/Rendering/Core/Testing/Cxx/TestLabeledContourMapper.cxx
+++ b/Rendering/Core/Testing/Cxx/TestLabeledContourMapper.cxx
@@ -18,7 +18,6 @@
 #include "vtkActor.h"
 #include "vtkCamera.h"
 #include "vtkContourFilter.h"
-#include "vtkDoubleArray.h"
 #include "vtkDEMReader.h"
 #include "vtkImageData.h"
 #include "vtkNew.h"
@@ -34,8 +33,6 @@
 #include "vtkTestUtilities.h"
 #include "vtkRegressionTestImage.h"
 
-#include <algorithm>
-
 //----------------------------------------------------------------------------
 int TestLabeledContourMapper(int argc, char *argv[])
 {
@@ -57,7 +54,7 @@ int TestLabeledContourMapper(int argc, char *argv[])
   contourStripper->SetInputConnection(contours->GetOutputPort());
   contourStripper->Update();
 
-  // Setup text properties that will be rotated across the isolines:
+  // Setup three text properties that will be rotated across the isolines:
   vtkNew<vtkTextPropertyCollection> tprops;
   vtkNew<vtkTextProperty> tprop1;
   tprop1->SetBold(1);
@@ -77,33 +74,9 @@ int TestLabeledContourMapper(int argc, char *argv[])
   tprop3->SetColor(.3, .8, .2);
   tprops->AddItem(tprop3.GetPointer());
 
-  vtkNew<vtkTextProperty> tprop4;
-  tprop4->ShallowCopy(tprop1.GetPointer());
-  tprop4->SetColor(.6, .0, .8);
-  tprops->AddItem(tprop4.GetPointer());
-
-  vtkNew<vtkTextProperty> tprop5;
-  tprop5->ShallowCopy(tprop1.GetPointer());
-  tprop5->SetColor(.0, .0, .9);
-  tprops->AddItem(tprop5.GetPointer());
-
-  vtkNew<vtkTextProperty> tprop6;
-  tprop6->ShallowCopy(tprop1.GetPointer());
-  tprop6->SetColor(.7, .8, .2);
-  tprops->AddItem(tprop6.GetPointer());
-
-  // Create a text propery mapping that will reverse the coloring:
-  double *values = contours->GetValues();
-  double *valuesEnd = values + contours->GetNumberOfContours();
-  vtkNew<vtkDoubleArray> tpropMapping;
-  tpropMapping->SetNumberOfComponents(1);
-  tpropMapping->SetNumberOfTuples(valuesEnd - values);
-  std::reverse_copy(values, valuesEnd, tpropMapping->Begin());
-
   vtkNew<vtkLabeledContourMapper> mapper;
   mapper->GetPolyDataMapper()->ScalarVisibilityOff();
   mapper->SetTextProperties(tprops.GetPointer());
-  mapper->SetTextPropertyMapping(tpropMapping.GetPointer());
   mapper->SetInputConnection(contourStripper->GetOutputPort());
 
   vtkNew<vtkActor> actor;
diff --git a/Rendering/Core/Testing/Cxx/TestLabeledContourMapperWithActorMatrix.cxx b/Rendering/Core/Testing/Cxx/TestLabeledContourMapperWithActorMatrix.cxx
deleted file mode 100644
index f80e4c7..0000000
--- a/Rendering/Core/Testing/Cxx/TestLabeledContourMapperWithActorMatrix.cxx
+++ /dev/null
@@ -1,127 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    TestLabeledContourMapperWithActorMatrix.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 "vtkLabeledContourMapper.h"
-
-#include "vtkActor.h"
-#include "vtkCamera.h"
-#include "vtkContourFilter.h"
-#include "vtkDEMReader.h"
-#include "vtkImageData.h"
-#include "vtkNew.h"
-#include "vtkPointData.h"
-#include "vtkPolyData.h"
-#include "vtkPolyDataMapper.h"
-#include "vtkRenderWindow.h"
-#include "vtkRenderWindowInteractor.h"
-#include "vtkRenderer.h"
-#include "vtkStripper.h"
-#include "vtkTextProperty.h"
-#include "vtkTextPropertyCollection.h"
-#include "vtkTestUtilities.h"
-#include "vtkTransform.h"
-#include "vtkRegressionTestImage.h"
-
-//----------------------------------------------------------------------------
-int TestLabeledContourMapperWithActorMatrix(int argc, char *argv[])
-{
-  char* fname =
-    vtkTestUtilities::ExpandDataFileName(argc, argv, "Data/SainteHelens.dem");
-  vtkNew<vtkDEMReader> demReader;
-  demReader->SetFileName(fname);
-  delete [] fname;
-
-  double range[2];
-  demReader->Update();
-  demReader->GetOutput()->GetPointData()->GetScalars()->GetRange(range);
-
-  vtkNew<vtkContourFilter> contours;
-  contours->SetInputConnection(demReader->GetOutputPort());
-  contours->GenerateValues(21, range[0], range[1]);
-
-  vtkNew<vtkStripper> contourStripper;
-  contourStripper->SetInputConnection(contours->GetOutputPort());
-  contourStripper->Update();
-
-  // Setup three text properties that will be rotated across the isolines:
-  vtkNew<vtkTextPropertyCollection> tprops;
-  vtkNew<vtkTextProperty> tprop1;
-  tprop1->SetBold(1);
-  tprop1->SetFontSize(12);
-  tprop1->SetBackgroundColor(0.5, 0.5, 0.5);
-  tprop1->SetBackgroundOpacity(0.25);
-  tprop1->SetColor(1., 1., 1.);
-  tprops->AddItem(tprop1.GetPointer());
-
-  vtkNew<vtkTextProperty> tprop2;
-  tprop2->ShallowCopy(tprop1.GetPointer());
-  tprop2->SetColor(.8, .2, .3);
-  tprops->AddItem(tprop2.GetPointer());
-
-  vtkNew<vtkTextProperty> tprop3;
-  tprop3->ShallowCopy(tprop1.GetPointer());
-  tprop3->SetColor(.3, .8, .2);
-  tprops->AddItem(tprop3.GetPointer());
-
-  vtkNew<vtkLabeledContourMapper> mapper;
-  mapper->GetPolyDataMapper()->ScalarVisibilityOff();
-  mapper->SetTextProperties(tprops.GetPointer());
-  mapper->SetInputConnection(contourStripper->GetOutputPort());
-
-  vtkNew<vtkActor> actor;
-  actor->SetMapper(mapper.GetPointer());
-
-  vtkNew<vtkTransform> xform;
-  xform->Identity();
-  xform->Scale(0.5, 0.25, 10.);
-  xform->RotateWXYZ(196, 0.0, 0.0, 1.0);
-  xform->Translate(50, 50, 50);
-  actor->SetUserTransform(xform.GetPointer());
-
-  vtkNew<vtkRenderer> ren;
-  ren->AddActor(actor.GetPointer());
-
-  vtkNew<vtkRenderWindow> win;
-  win->SetStencilCapable(1); // Needed for vtkLabeledContourMapper
-  win->AddRenderer(ren.GetPointer());
-
-  double bounds[6];
-  contourStripper->GetOutput()->GetBounds(bounds);
-
-  win->SetSize(600, 600);
-  ren->SetBackground(0.0, 0.0, 0.0);
-  ren->GetActiveCamera()->SetViewUp(0, 1, 0);
-  ren->GetActiveCamera()->SetPosition((bounds[0] + bounds[1]) / 2.,
-                                      (bounds[2] + bounds[3]) / 2., 0);
-
-  ren->GetActiveCamera()->SetFocalPoint((bounds[0] + bounds[1]) / 2.,
-                                        (bounds[2] + bounds[3]) / 2.,
-                                        (bounds[4] + bounds[5]) / 2.);
-  ren->ResetCamera();
-  ren->GetActiveCamera()->Dolly(6.5);
-  ren->ResetCameraClippingRange();
-
-  win->SetMultiSamples(0);
-
-  vtkNew<vtkRenderWindowInteractor> iren;
-  iren->SetRenderWindow(win.GetPointer());
-
-  int retVal = vtkRegressionTestImage(win.GetPointer());
-  if (retVal == vtkRegressionTester::DO_INTERACTOR)
-    {
-    iren->Start();
-    }
-  return !retVal;
-}
diff --git a/Rendering/Core/Testing/Cxx/TestOSConeCxx.cxx b/Rendering/Core/Testing/Cxx/TestOSConeCxx.cxx
index 1b74f2d..a46722b 100644
--- a/Rendering/Core/Testing/Cxx/TestOSConeCxx.cxx
+++ b/Rendering/Core/Testing/Cxx/TestOSConeCxx.cxx
@@ -32,7 +32,6 @@ int TestOSConeCxx(int argc, char* argv[])
 {
   vtkRenderWindow *renWin = vtkRenderWindow::New();
   renWin->OffScreenRenderingOn();
-  renWin->SetMultiSamples(0);
 
   vtkRenderer *renderer = vtkRenderer::New();
   renWin->AddRenderer(renderer);
diff --git a/Rendering/Core/Testing/Cxx/TestOrderedTriangulator.cxx b/Rendering/Core/Testing/Cxx/TestOrderedTriangulator.cxx
index e6418f7..bb325a8 100644
--- a/Rendering/Core/Testing/Cxx/TestOrderedTriangulator.cxx
+++ b/Rendering/Core/Testing/Cxx/TestOrderedTriangulator.cxx
@@ -30,7 +30,7 @@
 #include "vtkRegressionTestImage.h"
 
 //------------------------------------------------------------------------------
-static double para_coord1[24] = {
+double para_coord1[24] = {
   0.0, 0.0, 0.0, //0
   1.0, 0.0, 0.0, //1
   0.0, 1.0, 0.0, //2
@@ -39,7 +39,7 @@ static double para_coord1[24] = {
   0.0, 0.0, 1.0, //5
 };
 
-static double para_coord2[24] = {
+double para_coord2[24] = {
   0.0, 1.0, 0.0, //0
   0.0, 0.0, 0.0, //1
   1.0, 0.0, 0.0, //2
@@ -48,7 +48,7 @@ static double para_coord2[24] = {
   0.0, 0.0, 1.0, //5
   };
 
-static double points[33] = {
+double points[33] = {
   0.0, 0.0, 0.0, //0
   0.0,-1.0, 0.0, //1
   1.0, 0.0, 0.0, //2
diff --git a/Rendering/Core/Testing/Data/Baseline/ScalarBar.png.md5 b/Rendering/Core/Testing/Data/Baseline/ScalarBar.png.md5
index d42339c..32eeb1f 100644
--- a/Rendering/Core/Testing/Data/Baseline/ScalarBar.png.md5
+++ b/Rendering/Core/Testing/Data/Baseline/ScalarBar.png.md5
@@ -1 +1 @@
-1bf50ed5b1333fbfe623a59c7528d82f
+1f6cc90096869bbc14e82b671115d00e
diff --git a/Rendering/Core/Testing/Data/Baseline/TestCompositePolyDataMapper2Scalars.png.md5 b/Rendering/Core/Testing/Data/Baseline/TestCompositePolyDataMapper2Scalars.png.md5
deleted file mode 100644
index 0a45983..0000000
--- a/Rendering/Core/Testing/Data/Baseline/TestCompositePolyDataMapper2Scalars.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-7aed4dbab110d76be6ff122c22441b90
diff --git a/Rendering/Core/Testing/Data/Baseline/TestCompositePolyDataMapper2Scalars_1.png.md5 b/Rendering/Core/Testing/Data/Baseline/TestCompositePolyDataMapper2Scalars_1.png.md5
deleted file mode 100644
index 9253b99..0000000
--- a/Rendering/Core/Testing/Data/Baseline/TestCompositePolyDataMapper2Scalars_1.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-fd1cb2cfeeefa960bf051e4580c997bb
diff --git a/Rendering/Core/Testing/Data/Baseline/TestEdgeFlags_1.png.md5 b/Rendering/Core/Testing/Data/Baseline/TestEdgeFlags_1.png.md5
deleted file mode 100644
index 4009afe..0000000
--- a/Rendering/Core/Testing/Data/Baseline/TestEdgeFlags_1.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-6f06f45af82c561636b7725bef9e0323
diff --git a/Rendering/Core/Testing/Data/Baseline/TestLabeledContourMapper.png.md5 b/Rendering/Core/Testing/Data/Baseline/TestLabeledContourMapper.png.md5
index e6ddb04..14be038 100644
--- a/Rendering/Core/Testing/Data/Baseline/TestLabeledContourMapper.png.md5
+++ b/Rendering/Core/Testing/Data/Baseline/TestLabeledContourMapper.png.md5
@@ -1 +1 @@
-55f5e6097a29efcfc4a59859a17e4e63
+77b1b4303fb2703732f2ef704494e305
diff --git a/Rendering/Core/Testing/Data/Baseline/TestLabeledContourMapperWithActorMatrix.png.md5 b/Rendering/Core/Testing/Data/Baseline/TestLabeledContourMapperWithActorMatrix.png.md5
deleted file mode 100644
index 0f802d2..0000000
--- a/Rendering/Core/Testing/Data/Baseline/TestLabeledContourMapperWithActorMatrix.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-ce458c3baaaf836dfd4d21ad530817a2
diff --git a/Rendering/Core/Testing/Data/Baseline/TestLeaderActor2D.png.md5 b/Rendering/Core/Testing/Data/Baseline/TestLeaderActor2D.png.md5
index 46de726..6a8c959 100644
--- a/Rendering/Core/Testing/Data/Baseline/TestLeaderActor2D.png.md5
+++ b/Rendering/Core/Testing/Data/Baseline/TestLeaderActor2D.png.md5
@@ -1 +1 @@
-e00be1f27f8c8979ef42893ebb88120b
+849acc13369267fe650459c6e74ac407
diff --git a/Rendering/Core/Testing/Data/Baseline/TestTranslucentLUTAlphaBlending.png.md5 b/Rendering/Core/Testing/Data/Baseline/TestTranslucentLUTAlphaBlending.png.md5
index 59cf57b..ce6dd3d 100644
--- a/Rendering/Core/Testing/Data/Baseline/TestTranslucentLUTAlphaBlending.png.md5
+++ b/Rendering/Core/Testing/Data/Baseline/TestTranslucentLUTAlphaBlending.png.md5
@@ -1 +1 @@
-6c9b293a7537053efa4ed43fdc8a9d96
+8687dc14fab46f34e86c8da88aa1dc0e
diff --git a/Rendering/Core/Testing/Data/Baseline/TestTranslucentLUTTextureAlphaBlending.png.md5 b/Rendering/Core/Testing/Data/Baseline/TestTranslucentLUTTextureAlphaBlending.png.md5
index 415b80e..f6ba28f 100644
--- a/Rendering/Core/Testing/Data/Baseline/TestTranslucentLUTTextureAlphaBlending.png.md5
+++ b/Rendering/Core/Testing/Data/Baseline/TestTranslucentLUTTextureAlphaBlending.png.md5
@@ -1 +1 @@
-fe13050895f474f78ccb8b11c7f23fff
+37acc3384cefefe8255a444552a922f3
diff --git a/Rendering/Core/Testing/Data/Baseline/cells.png.md5 b/Rendering/Core/Testing/Data/Baseline/cells.png.md5
index 8c9881f..42fd62b 100644
--- a/Rendering/Core/Testing/Data/Baseline/cells.png.md5
+++ b/Rendering/Core/Testing/Data/Baseline/cells.png.md5
@@ -1 +1 @@
-121ff787703d267738057fd9184b75b8
+961d03a790ec660a21e02244f74575b1
diff --git a/Rendering/Core/Testing/Python/cells.py b/Rendering/Core/Testing/Python/cells.py
index 4bc580e..3439568 100755
--- a/Rendering/Core/Testing/Python/cells.py
+++ b/Rendering/Core/Testing/Python/cells.py
@@ -619,11 +619,11 @@ class cells(vtk.test.Testing.vtkTest):
             aRIBProperty.SetVariable("veinfreq", "float")
             aRIBProperty.AddVariable("warpfreq", "float")
             aRIBProperty.AddVariable("veincolor", "color")
-            aRIBProperty.AddSurfaceShaderParameter("veinfreq", " 2")
-            aRIBProperty.AddSurfaceShaderParameter("veincolor", "1.0000 1.0000 0.9412")
+            aRIBProperty.AddParameter("veinfreq", " 2")
+            aRIBProperty.AddParameter("veincolor", "1.0000 1.0000 0.9412")
             bRIBProperty = vtk.vtkRIBProperty()
             bRIBProperty.SetVariable("Km", "float")
-            bRIBProperty.SetSurfaceShaderParameter("Km", "1.0")
+            bRIBProperty.SetParameter("Km", "1.0")
             bRIBProperty.SetDisplacementShader("dented")
             bRIBProperty.SetSurfaceShader("plastic")
         aProperty = vtk.vtkProperty()
@@ -653,13 +653,12 @@ class cells(vtk.test.Testing.vtkTest):
 
         if hasattr(vtk, 'vtkRIBLight'):
             aRIBLight = vtk.vtkRIBLight()
-
-        ren.AddLight(aRIBLight)
+            aRIBLight.ShadowsOn()
         aLight = vtk.vtkLight()
 
         aLight.PositionalOn()
-        aLight.SetConeAngle(10.0)
-        aLight.SetIntensity(20.0)
+        aLight.SetConeAngle(25)
+
         ren.AddLight(aLight)
 
         ren.ResetCamera()
@@ -668,6 +667,9 @@ class cells(vtk.test.Testing.vtkTest):
         ren.GetActiveCamera().Dolly(2.8)
         ren.ResetCameraClippingRange()
 
+        aLight.SetFocalPoint(ren.GetActiveCamera().GetFocalPoint())
+        aLight.SetPosition(ren.GetActiveCamera().GetPosition())
+
         # write to the temp directory if possible, otherwise use .
         dir = tempfile.gettempdir()
 
@@ -678,11 +680,6 @@ class cells(vtk.test.Testing.vtkTest):
         atext.InterpolateOff()
         aTriangleActor.SetTexture(atext)
 
-        aRIBLight.SetFocalPoint(ren.GetActiveCamera().GetFocalPoint())
-        aRIBLight.SetPosition(ren.GetActiveCamera().GetPosition())
-        aLight.SetFocalPoint(ren.GetActiveCamera().GetFocalPoint())
-        aLight.SetPosition(ren.GetActiveCamera().GetPosition())
-
         # bascially have IO/Export ?
         if hasattr(vtk, 'vtkRIBExporter'):
             rib = vtk.vtkRIBExporter()
@@ -690,6 +687,7 @@ class cells(vtk.test.Testing.vtkTest):
             rib.SetFilePrefix(dir + '/cells')
             rib.SetTexturePrefix(dir + '/cells')
             rib.Write()
+            os.remove(dir + '/cells.rib')
 
             iv = vtk.vtkIVExporter()
             iv.SetInput(renWin)
diff --git a/Rendering/Core/Testing/Tcl/CMakeLists.txt b/Rendering/Core/Testing/Tcl/CMakeLists.txt
index 48ae2c7..88d1245 100644
--- a/Rendering/Core/Testing/Tcl/CMakeLists.txt
+++ b/Rendering/Core/Testing/Tcl/CMakeLists.txt
@@ -7,6 +7,7 @@ vtk_add_test_tcl(
   TestCameraInterpolator.tcl
   TestOpacity2.tcl
   TexturedSphere.tcl
+  cells.tcl
   cowHair2.tcl
   cowHair.tcl
   rendererSource.tcl
diff --git a/Rendering/Core/Testing/Tcl/TestGLSLShader.tcl b/Rendering/Core/Testing/Tcl/TestGLSLShader.tcl
new file mode 100644
index 0000000..9ff8bb3
--- /dev/null
+++ b/Rendering/Core/Testing/Tcl/TestGLSLShader.tcl
@@ -0,0 +1,38 @@
+package require vtk
+package require vtkinteraction
+
+vtkRenderWindow renWin
+vtkRenderWindowInteractor iren
+iren SetRenderWindow renWin
+
+vtkRenderer renderer
+renWin AddRenderer renderer
+
+vtkSphereSource src1
+src1 SetRadius 5
+src1 SetPhiResolution 20
+src1 SetThetaResolution 20
+
+vtkPolyDataMapper mapper
+mapper SetInputConnection [src1 GetOutputPort]
+
+vtkActor actor
+actor SetMapper mapper
+# Load the material. Here, we are loading a material
+# defined in the Vtk Library. One can also specify
+# a filename to a material description xml.
+[actor GetProperty] LoadMaterial "GLSLTwisted"
+
+# Turn shading on. Otherwise, shaders are not used.
+[actor GetProperty] ShadingOn
+
+# Pass a shader variable need by GLSLTwisted.
+[actor GetProperty] AddShaderVariable "Rate" 1.0
+
+renderer AddActor actor
+renWin Render
+
+[renderer GetActiveCamera] Azimuth -50
+[renderer GetActiveCamera] Roll 70
+renWin Render
+wm withdraw .
diff --git a/Rendering/Core/Testing/Tcl/TestGenericVertexAttributesGLSL.tcl b/Rendering/Core/Testing/Tcl/TestGenericVertexAttributesGLSL.tcl
new file mode 100644
index 0000000..0d737b4
--- /dev/null
+++ b/Rendering/Core/Testing/Tcl/TestGenericVertexAttributesGLSL.tcl
@@ -0,0 +1,78 @@
+# tests the support to pass generic vertex attributes to be used in Cg shaders.
+
+set xmlMaterial {<?xml version="1.0" encoding="UTF-8"?>
+<Material name="GenericAttributes1">
+  <Shader
+    scope="Vertex"
+    name="VertexShader"
+    location="Inline"
+    language="GLSL"
+    entry="main">
+    attribute vec3 genAttrVector;
+    varying vec4 color;
+
+    void main(void)
+    {
+      gl_Position = gl_ModelViewProjectionMatrix *gl_Vertex;
+      color = vec4(normalize(genAttrVector), 1.0);
+    }
+  </Shader>
+
+  <Shader scope="Fragment" name="FragmentShader" location="Inline"
+    language="GLSL" entry="main">
+    varying vec4 color;
+    void main(void)
+    {
+      gl_FragColor = color;
+    }
+  </Shader>
+</Material>
+}
+
+package require vtk
+package require vtkinteraction
+
+vtkRenderWindow renWin
+vtkRenderWindowInteractor iren
+iren SetRenderWindow renWin
+
+vtkRenderer renderer
+renWin AddRenderer renderer
+
+vtkSphereSource src1
+src1 SetRadius 5
+src1 SetPhiResolution 20
+src1 SetThetaResolution 20
+
+vtkBrownianPoints randomVectors
+randomVectors SetMinimumSpeed 0
+randomVectors SetMaximumSpeed 1
+randomVectors SetInputConnection [src1 GetOutputPort]
+
+vtkPolyDataMapper mapper
+mapper SetInputConnection [randomVectors GetOutputPort]
+
+vtkActor actor
+actor SetMapper mapper
+# Load the material. Here, we are loading a material
+# defined in the Vtk Library. One can also specify
+# a filename to a material description xml.
+[actor GetProperty] LoadMaterialFromString $xmlMaterial
+
+# Set red color to show if shading fails.
+[actor GetProperty] SetColor 1.0 0 0
+
+# Turn shading on. Otherwise, shaders are not used.
+[actor GetProperty] ShadingOn
+
+# Map PointData.BrownianVectors (all 3 components) to genAttrVector
+mapper MapDataArrayToVertexAttribute "genAttrVector" "BrownianVectors" 0 -1
+
+renderer AddActor actor
+renderer SetBackground 0.5 0.5 0.5
+renWin Render
+
+[renderer GetActiveCamera] Azimuth -50
+[renderer GetActiveCamera] Roll 70
+renWin Render
+wm withdraw .
diff --git a/Rendering/Core/Testing/Tcl/TestParallelCoordinates.tcl b/Rendering/Core/Testing/Tcl/TestParallelCoordinates.tcl
new file mode 100644
index 0000000..88fd206
--- /dev/null
+++ b/Rendering/Core/Testing/Tcl/TestParallelCoordinates.tcl
@@ -0,0 +1,46 @@
+package require vtk
+package require vtkinteraction
+
+# This example converts data to a field and then displays it using
+# parallel coordinates,
+
+# Create a reader and write out the field
+vtkUnstructuredGridReader reader
+    reader SetFileName "$VTK_DATA_ROOT/Data/blow.vtk"
+    reader SetVectorsName "displacement9"
+    reader SetScalarsName "thickness9"
+vtkDataSetToDataObjectFilter ds2do
+    ds2do SetInputConnection [reader GetOutputPort]
+    ds2do Update
+vtkParallelCoordinatesActor actor
+    actor SetInputConnection [ds2do GetOutputPort]
+    actor SetTitle "Parallel Coordinates Plot of blow.tcl"
+    actor SetIndependentVariablesToColumns
+    [actor GetPositionCoordinate] SetValue 0.05 0.05 0.0
+    [actor GetPosition2Coordinate] SetValue 0.95 0.85 0.0
+    [actor GetProperty] SetColor 1 0 0
+    # Set text colors (same as actor for backward compat with test)
+    [actor GetTitleTextProperty] SetColor 1 0 0
+    [actor GetLabelTextProperty] SetColor 1 0 0
+
+# Create the RenderWindow, Renderer and both Actors
+vtkRenderer ren1
+vtkRenderWindow renWin
+    renWin SetMultiSamples 0
+    renWin AddRenderer ren1
+vtkRenderWindowInteractor iren
+    iren SetRenderWindow renWin
+
+ren1 AddActor actor
+ren1 SetBackground 1 1 1
+renWin SetSize 500 200
+
+# render the image
+#
+iren AddObserver UserEvent {wm deiconify .vtkInteract}
+renWin Render
+
+# prevent the tk window from showing up then start the event loop
+wm withdraw .
+
+
diff --git a/Rendering/Core/Testing/Tcl/cells.tcl b/Rendering/Core/Testing/Tcl/cells.tcl
new file mode 100644
index 0000000..8765c7f
--- /dev/null
+++ b/Rendering/Core/Testing/Tcl/cells.tcl
@@ -0,0 +1,752 @@
+package require vtk
+package require vtkinteraction
+
+# Demonstrates all cell types
+#
+# NOTE: the use of NewInstance/DeepCopy is included to increase
+# regression coverage.  It is not required in most applications.
+
+vtkRenderer ren1
+# turn off all cullers
+[ren1 GetCullers] RemoveAllItems
+
+vtkRenderWindow renWin
+  renWin AddRenderer ren1
+  renWin SetSize 300 150
+vtkRenderWindowInteractor iren
+  iren SetRenderWindow renWin
+
+# create a scene with one of each cell type
+
+# Voxel
+
+vtkPoints voxelPoints
+  voxelPoints SetNumberOfPoints 8
+  voxelPoints InsertPoint 0 0 0 0
+  voxelPoints InsertPoint 1 1 0 0
+  voxelPoints InsertPoint 2 0 1 0
+  voxelPoints InsertPoint 3 1 1 0
+  voxelPoints InsertPoint 4 0 0 1
+  voxelPoints InsertPoint 5 1 0 1
+  voxelPoints InsertPoint 6 0 1 1
+  voxelPoints InsertPoint 7 1 1 1
+
+vtkVoxel aVoxel
+  [aVoxel GetPointIds] SetId 0 0
+  [aVoxel GetPointIds] SetId 1 1
+  [aVoxel GetPointIds] SetId 2 2
+  [aVoxel GetPointIds] SetId 3 3
+  [aVoxel GetPointIds] SetId 4 4
+  [aVoxel GetPointIds] SetId 5 5
+  [aVoxel GetPointIds] SetId 6 6
+  [aVoxel GetPointIds] SetId 7 7
+
+set bVoxel [aVoxel NewInstance]
+$bVoxel DeepCopy aVoxel
+
+vtkUnstructuredGrid aVoxelGrid
+  aVoxelGrid Allocate 1 1
+  aVoxelGrid InsertNextCell [aVoxel GetCellType] [aVoxel GetPointIds]
+  aVoxelGrid SetPoints voxelPoints
+
+vtkDataSetMapper aVoxelMapper
+aVoxelMapper SetInputData aVoxelGrid
+
+vtkActor aVoxelActor
+  aVoxelActor SetMapper aVoxelMapper
+  [aVoxelActor GetProperty] BackfaceCullingOn
+
+# Hexahedron
+
+vtkPoints hexahedronPoints
+  hexahedronPoints SetNumberOfPoints 8
+  hexahedronPoints InsertPoint 0 0 0 0
+  hexahedronPoints InsertPoint 1 1 0 0
+  hexahedronPoints InsertPoint 2 1 1 0
+  hexahedronPoints InsertPoint 3 0 1 0
+  hexahedronPoints InsertPoint 4 0 0 1
+  hexahedronPoints InsertPoint 5 1 0 1
+  hexahedronPoints InsertPoint 6 1 1 1
+  hexahedronPoints InsertPoint 7 0 1 1
+
+vtkHexahedron aHexahedron
+  [aHexahedron GetPointIds] SetId 0 0
+  [aHexahedron GetPointIds] SetId 1 1
+  [aHexahedron GetPointIds] SetId 2 2
+  [aHexahedron GetPointIds] SetId 3 3
+  [aHexahedron GetPointIds] SetId 4 4
+  [aHexahedron GetPointIds] SetId 5 5
+  [aHexahedron GetPointIds] SetId 6 6
+  [aHexahedron GetPointIds] SetId 7 7
+
+set bHexahedron [aHexahedron NewInstance]
+$bHexahedron DeepCopy aHexahedron
+
+vtkUnstructuredGrid aHexahedronGrid
+  aHexahedronGrid Allocate 1 1
+  aHexahedronGrid InsertNextCell [aHexahedron GetCellType] [aHexahedron GetPointIds]
+  aHexahedronGrid SetPoints hexahedronPoints
+
+vtkDataSetMapper aHexahedronMapper
+  aHexahedronMapper SetInputData aHexahedronGrid
+
+vtkActor aHexahedronActor
+  aHexahedronActor SetMapper aHexahedronMapper
+  aHexahedronActor AddPosition 2 0 0
+  [aHexahedronActor GetProperty] BackfaceCullingOn
+
+# Tetra
+
+vtkPoints tetraPoints
+  tetraPoints SetNumberOfPoints 4
+  tetraPoints InsertPoint 0 0 0 0
+  tetraPoints InsertPoint 1 1 0 0
+  tetraPoints InsertPoint 2 .5 1 0
+  tetraPoints InsertPoint 3 .5 .5 1
+
+vtkTetra aTetra
+  [aTetra GetPointIds] SetId 0 0
+  [aTetra GetPointIds] SetId 1 1
+  [aTetra GetPointIds] SetId 2 2
+  [aTetra GetPointIds] SetId 3 3
+
+set bTetra [aTetra NewInstance]
+$bTetra DeepCopy aTetra
+
+vtkUnstructuredGrid aTetraGrid
+  aTetraGrid Allocate 1 1
+  aTetraGrid InsertNextCell [aTetra GetCellType] [aTetra GetPointIds]
+  aTetraGrid SetPoints tetraPoints
+
+vtkUnstructuredGrid aTetraCopy
+  aTetraCopy ShallowCopy aTetraGrid
+
+vtkDataSetMapper aTetraMapper
+  aTetraMapper SetInputData aTetraCopy
+
+vtkActor aTetraActor
+  aTetraActor SetMapper aTetraMapper
+  aTetraActor AddPosition 4 0 0
+  [aTetraActor GetProperty] BackfaceCullingOn
+
+# Wedge
+
+vtkPoints wedgePoints
+  wedgePoints SetNumberOfPoints 6
+  wedgePoints InsertPoint 0 0 1 0
+  wedgePoints InsertPoint 1 0 0 0
+  wedgePoints InsertPoint 2 0 .5 .5
+  wedgePoints InsertPoint 3 1 1 0
+  wedgePoints InsertPoint 4 1 0 0
+  wedgePoints InsertPoint 5 1 .5 .5
+
+vtkWedge aWedge
+  [aWedge GetPointIds] SetId 0 0
+  [aWedge GetPointIds] SetId 1 1
+  [aWedge GetPointIds] SetId 2 2
+  [aWedge GetPointIds] SetId 3 3
+  [aWedge GetPointIds] SetId 4 4
+  [aWedge GetPointIds] SetId 5 5
+
+set bWedge [aWedge NewInstance]
+$bWedge DeepCopy aWedge
+
+vtkUnstructuredGrid aWedgeGrid
+  aWedgeGrid Allocate 1 1
+  aWedgeGrid InsertNextCell [aWedge GetCellType] [aWedge GetPointIds]
+  aWedgeGrid SetPoints wedgePoints
+
+vtkUnstructuredGrid aWedgeCopy
+  aWedgeCopy DeepCopy aWedgeGrid
+
+vtkDataSetMapper aWedgeMapper
+  aWedgeMapper SetInputData aWedgeCopy
+
+vtkActor aWedgeActor
+  aWedgeActor SetMapper aWedgeMapper
+  aWedgeActor AddPosition 6 0 0
+  [aWedgeActor GetProperty] BackfaceCullingOn
+
+# Pyramid
+
+vtkPoints pyramidPoints
+  pyramidPoints SetNumberOfPoints 5
+  pyramidPoints InsertPoint 0 0 0 0
+  pyramidPoints InsertPoint 1 1 0 0
+  pyramidPoints InsertPoint 2 1 1 0
+  pyramidPoints InsertPoint 3 0 1 0
+  pyramidPoints InsertPoint 4 .5 .5 1
+
+vtkPyramid aPyramid
+  [aPyramid GetPointIds] SetId 0 0
+  [aPyramid GetPointIds] SetId 1 1
+  [aPyramid GetPointIds] SetId 2 2
+  [aPyramid GetPointIds] SetId 3 3
+  [aPyramid GetPointIds] SetId 4 4
+
+set bPyramid [aPyramid NewInstance]
+$bPyramid DeepCopy aPyramid
+
+vtkUnstructuredGrid aPyramidGrid
+  aPyramidGrid Allocate 1 1
+  aPyramidGrid InsertNextCell [aPyramid GetCellType] [aPyramid GetPointIds]
+  aPyramidGrid SetPoints pyramidPoints
+
+vtkDataSetMapper aPyramidMapper
+  aPyramidMapper SetInputData aPyramidGrid
+
+vtkActor aPyramidActor
+  aPyramidActor SetMapper aPyramidMapper
+  aPyramidActor AddPosition 8 0 0
+  [aPyramidActor GetProperty] BackfaceCullingOn
+
+# Pixel
+
+vtkPoints pixelPoints
+  pixelPoints SetNumberOfPoints 4
+  pixelPoints InsertPoint 0 0 0 0
+  pixelPoints InsertPoint 1 1 0 0
+  pixelPoints InsertPoint 2 0 1 0
+  pixelPoints InsertPoint 3 1 1 0
+
+vtkPixel aPixel
+  [aPixel GetPointIds] SetId 0 0
+  [aPixel GetPointIds] SetId 1 1
+  [aPixel GetPointIds] SetId 2 2
+  [aPixel GetPointIds] SetId 3 3
+
+set bPixel [aPixel NewInstance]
+$bPixel DeepCopy aPixel
+
+vtkUnstructuredGrid aPixelGrid
+  aPixelGrid Allocate 1 1
+  aPixelGrid InsertNextCell [aPixel GetCellType] [aPixel GetPointIds]
+  aPixelGrid SetPoints pixelPoints
+
+vtkDataSetMapper aPixelMapper
+  aPixelMapper SetInputData aPixelGrid
+
+vtkActor aPixelActor
+  aPixelActor SetMapper aPixelMapper
+  aPixelActor AddPosition 0 0 2
+  [aPixelActor GetProperty] BackfaceCullingOn
+
+# Quad
+
+vtkPoints quadPoints
+  quadPoints SetNumberOfPoints 4
+  quadPoints InsertPoint 0 0 0 0
+  quadPoints InsertPoint 1 1 0 0
+  quadPoints InsertPoint 2 1 1 0
+  quadPoints InsertPoint 3 0 1 0
+
+vtkQuad aQuad
+  [aQuad GetPointIds] SetId 0 0
+  [aQuad GetPointIds] SetId 1 1
+  [aQuad GetPointIds] SetId 2 2
+  [aQuad GetPointIds] SetId 3 3
+
+set bQuad [aQuad NewInstance]
+$bQuad DeepCopy aQuad
+
+vtkUnstructuredGrid aQuadGrid
+  aQuadGrid Allocate 1 1
+  aQuadGrid InsertNextCell [aQuad GetCellType] [aQuad GetPointIds]
+  aQuadGrid SetPoints quadPoints
+
+vtkDataSetMapper aQuadMapper
+  aQuadMapper SetInputData aQuadGrid
+
+vtkActor aQuadActor
+  aQuadActor SetMapper aQuadMapper
+  aQuadActor AddPosition 2 0 2
+  [aQuadActor GetProperty] BackfaceCullingOn
+
+# Triangle
+
+vtkPoints trianglePoints
+  trianglePoints SetNumberOfPoints 3
+  trianglePoints InsertPoint 0 0 0 0
+  trianglePoints InsertPoint 1 1 0 0
+  trianglePoints InsertPoint 2 .5 .5 0
+
+vtkFloatArray triangleTCoords
+  triangleTCoords SetNumberOfComponents 2
+  triangleTCoords SetNumberOfTuples 3
+  triangleTCoords InsertTuple2 0 1 1
+  triangleTCoords InsertTuple2 1 2 2
+  triangleTCoords InsertTuple2 2 3 3
+
+vtkTriangle aTriangle
+  [aTriangle GetPointIds] SetId 0 0
+  [aTriangle GetPointIds] SetId 1 1
+  [aTriangle GetPointIds] SetId 2 2
+
+set bTriangle [aTriangle NewInstance]
+$bTriangle DeepCopy aTriangle
+
+vtkUnstructuredGrid aTriangleGrid
+  aTriangleGrid Allocate 1 1
+  aTriangleGrid InsertNextCell [aTriangle GetCellType] [aTriangle GetPointIds]
+  aTriangleGrid SetPoints trianglePoints
+  [aTriangleGrid GetPointData] SetTCoords triangleTCoords
+
+vtkDataSetMapper aTriangleMapper
+  aTriangleMapper SetInputData aTriangleGrid
+
+vtkActor aTriangleActor
+  aTriangleActor SetMapper aTriangleMapper
+  aTriangleActor AddPosition 4 0 2
+  [aTriangleActor GetProperty] BackfaceCullingOn
+
+# Polygon
+
+vtkPoints polygonPoints
+  polygonPoints SetNumberOfPoints 4
+  polygonPoints InsertPoint 0 0 0 0
+  polygonPoints InsertPoint 1 1 0 0
+  polygonPoints InsertPoint 2 1 1 0
+  polygonPoints InsertPoint 3 0 1 0
+
+vtkPolygon aPolygon
+  [aPolygon GetPointIds] SetNumberOfIds 4
+  [aPolygon GetPointIds] SetId 0 0
+  [aPolygon GetPointIds] SetId 1 1
+  [aPolygon GetPointIds] SetId 2 2
+  [aPolygon GetPointIds] SetId 3 3
+
+set bPolygon [aPolygon NewInstance]
+$bPolygon DeepCopy aPolygon
+
+vtkUnstructuredGrid aPolygonGrid
+  aPolygonGrid Allocate 1 1
+  aPolygonGrid InsertNextCell [aPolygon GetCellType] [aPolygon GetPointIds]
+  aPolygonGrid SetPoints polygonPoints
+
+vtkDataSetMapper aPolygonMapper
+  aPolygonMapper SetInputData aPolygonGrid
+
+vtkActor aPolygonActor
+  aPolygonActor SetMapper aPolygonMapper
+  aPolygonActor AddPosition 6 0 2
+  [aPolygonActor GetProperty] BackfaceCullingOn
+
+# Triangle Strip
+
+vtkPoints triangleStripPoints
+  triangleStripPoints SetNumberOfPoints 5
+  triangleStripPoints InsertPoint 0 0 1 0
+  triangleStripPoints InsertPoint 1 0 0 0
+  triangleStripPoints InsertPoint 2 1 1 0
+  triangleStripPoints InsertPoint 3 1 0 0
+  triangleStripPoints InsertPoint 4 2 1 0
+
+vtkFloatArray triangleStripTCoords
+  triangleStripTCoords SetNumberOfComponents 2
+  triangleStripTCoords SetNumberOfTuples 3
+  triangleStripTCoords InsertTuple2 0 1 1
+  triangleStripTCoords InsertTuple2 1 2 2
+  triangleStripTCoords InsertTuple2 2 3 3
+  triangleStripTCoords InsertTuple2 3 4 4
+  triangleStripTCoords InsertTuple2 4 5 5
+
+vtkTriangleStrip aTriangleStrip
+  [aTriangleStrip GetPointIds] SetNumberOfIds 5
+  [aTriangleStrip GetPointIds] SetId 0 0
+  [aTriangleStrip GetPointIds] SetId 1 1
+  [aTriangleStrip GetPointIds] SetId 2 2
+  [aTriangleStrip GetPointIds] SetId 3 3
+  [aTriangleStrip GetPointIds] SetId 4 4
+
+set bTriangleStrip [aTriangleStrip NewInstance]
+$bTriangleStrip DeepCopy aTriangleStrip
+
+vtkUnstructuredGrid aTriangleStripGrid
+  aTriangleStripGrid Allocate 1 1
+  aTriangleStripGrid InsertNextCell [aTriangleStrip GetCellType] [aTriangleStrip GetPointIds]
+  aTriangleStripGrid SetPoints triangleStripPoints
+  [aTriangleStripGrid GetPointData] SetTCoords triangleStripTCoords
+
+vtkDataSetMapper aTriangleStripMapper
+  aTriangleStripMapper SetInputData aTriangleStripGrid
+
+vtkActor aTriangleStripActor
+  aTriangleStripActor SetMapper aTriangleStripMapper
+  aTriangleStripActor AddPosition 8 0 2
+  [aTriangleStripActor GetProperty] BackfaceCullingOn
+
+# Line
+
+vtkPoints linePoints
+  linePoints SetNumberOfPoints 2
+  linePoints InsertPoint 0 0 0 0
+  linePoints InsertPoint 1 1 1 0
+
+vtkLine aLine
+  [aLine GetPointIds] SetId 0 0
+  [aLine GetPointIds] SetId 1 1
+
+set bLine [aLine NewInstance]
+$bLine DeepCopy aLine
+
+vtkUnstructuredGrid aLineGrid
+  aLineGrid Allocate 1 1
+  aLineGrid InsertNextCell [aLine GetCellType] [aLine GetPointIds]
+  aLineGrid SetPoints linePoints
+
+vtkDataSetMapper aLineMapper
+  aLineMapper SetInputData aLineGrid
+
+vtkActor aLineActor
+  aLineActor SetMapper aLineMapper
+  aLineActor AddPosition 0 0 4
+  [aLineActor GetProperty] BackfaceCullingOn
+
+# Poly line
+
+vtkPoints polyLinePoints
+  polyLinePoints SetNumberOfPoints 3
+  polyLinePoints InsertPoint 0 0 0 0
+  polyLinePoints InsertPoint 1 1 1 0
+  polyLinePoints InsertPoint 2 1 0 0
+
+vtkPolyLine aPolyLine
+  [aPolyLine GetPointIds] SetNumberOfIds 3
+  [aPolyLine GetPointIds] SetId 0 0
+  [aPolyLine GetPointIds] SetId 1 1
+  [aPolyLine GetPointIds] SetId 2 2
+
+set bPolyLine [aPolyLine NewInstance]
+$bPolyLine DeepCopy aPolyLine
+
+vtkUnstructuredGrid aPolyLineGrid
+  aPolyLineGrid Allocate 1 1
+  aPolyLineGrid InsertNextCell [aPolyLine GetCellType] [aPolyLine GetPointIds]
+  aPolyLineGrid SetPoints polyLinePoints
+
+vtkDataSetMapper aPolyLineMapper
+  aPolyLineMapper SetInputData aPolyLineGrid
+
+vtkActor aPolyLineActor
+  aPolyLineActor SetMapper aPolyLineMapper
+  aPolyLineActor AddPosition 2 0 4
+  [aPolyLineActor GetProperty] BackfaceCullingOn
+
+# Vertex
+
+vtkPoints vertexPoints
+  vertexPoints SetNumberOfPoints 1
+  vertexPoints InsertPoint 0 0 0 0
+
+vtkVertex aVertex
+  [aVertex GetPointIds] SetId 0 0
+
+set bVertex [aVertex NewInstance]
+$bVertex DeepCopy aVertex
+
+vtkUnstructuredGrid aVertexGrid
+  aVertexGrid Allocate 1 1
+  aVertexGrid InsertNextCell [aVertex GetCellType] [aVertex GetPointIds]
+  aVertexGrid SetPoints vertexPoints
+
+vtkDataSetMapper aVertexMapper
+  aVertexMapper SetInputData aVertexGrid
+
+vtkActor aVertexActor
+  aVertexActor SetMapper aVertexMapper
+  aVertexActor AddPosition 0 0 6
+  [aVertexActor GetProperty] BackfaceCullingOn
+
+# Poly Vertex
+
+vtkPoints polyVertexPoints
+  polyVertexPoints SetNumberOfPoints 3
+  polyVertexPoints InsertPoint 0 0 0 0
+  polyVertexPoints InsertPoint 1 1 0 0
+  polyVertexPoints InsertPoint 2 1 1 0
+
+vtkPolyVertex aPolyVertex
+  [aPolyVertex GetPointIds] SetNumberOfIds 3
+  [aPolyVertex GetPointIds] SetId 0 0
+  [aPolyVertex GetPointIds] SetId 1 1
+  [aPolyVertex GetPointIds] SetId 2 2
+
+set bPolyVertex [aPolyVertex NewInstance]
+$bPolyVertex DeepCopy aPolyVertex
+
+vtkUnstructuredGrid aPolyVertexGrid
+  aPolyVertexGrid Allocate 1 1
+  aPolyVertexGrid InsertNextCell [aPolyVertex GetCellType] [aPolyVertex GetPointIds]
+  aPolyVertexGrid SetPoints polyVertexPoints
+
+vtkDataSetMapper aPolyVertexMapper
+  aPolyVertexMapper SetInputData aPolyVertexGrid
+
+vtkActor aPolyVertexActor
+  aPolyVertexActor SetMapper aPolyVertexMapper
+  aPolyVertexActor AddPosition 2 0 6
+  [aPolyVertexActor GetProperty] BackfaceCullingOn
+
+# Pentagonal prism
+
+vtkPoints pentaPoints
+  pentaPoints SetNumberOfPoints 10
+  pentaPoints InsertPoint 0 0.25 0.0 0.0
+  pentaPoints InsertPoint 1 0.75 0.0 0.0
+  pentaPoints InsertPoint 2 1.0  0.5 0.0
+  pentaPoints InsertPoint 3 0.5  1.0 0.0
+  pentaPoints InsertPoint 4 0.0  0.5 0.0
+  pentaPoints InsertPoint 5 0.25 0.0 1.0
+  pentaPoints InsertPoint 6 0.75 0.0 1.0
+  pentaPoints InsertPoint 7 1.0  0.5 1.0
+  pentaPoints InsertPoint 8 0.5  1.0 1.0
+  pentaPoints InsertPoint 9 0.0  0.5 1.0
+
+vtkPentagonalPrism aPenta
+  [aPenta GetPointIds] SetId 0 0
+  [aPenta GetPointIds] SetId 1 1
+  [aPenta GetPointIds] SetId 2 2
+  [aPenta GetPointIds] SetId 3 3
+  [aPenta GetPointIds] SetId 4 4
+  [aPenta GetPointIds] SetId 5 5
+  [aPenta GetPointIds] SetId 6 6
+  [aPenta GetPointIds] SetId 7 7
+  [aPenta GetPointIds] SetId 8 8
+  [aPenta GetPointIds] SetId 9 9
+
+set bPenta [aPenta NewInstance]
+$bPenta DeepCopy aPenta
+
+vtkUnstructuredGrid aPentaGrid
+  aPentaGrid Allocate 1 1
+  aPentaGrid InsertNextCell [aPenta GetCellType] [aPenta GetPointIds]
+  aPentaGrid SetPoints pentaPoints
+
+vtkUnstructuredGrid aPentaCopy
+  aPentaCopy DeepCopy aPentaGrid
+
+vtkDataSetMapper aPentaMapper
+  aPentaMapper SetInputData aPentaCopy
+
+vtkActor aPentaActor
+  aPentaActor SetMapper aPentaMapper
+  aPentaActor AddPosition 10 0 0
+  [aPentaActor GetProperty] BackfaceCullingOn
+
+# Hexagonal prism
+
+vtkPoints hexaPoints
+  hexaPoints SetNumberOfPoints 12
+  hexaPoints InsertPoint 0 0.0 0.0 0.0
+  hexaPoints InsertPoint 1 0.5 0.0 0.0
+  hexaPoints InsertPoint 2 1.0 0.5 0.0
+  hexaPoints InsertPoint 3 1.0 1.0 0.0
+  hexaPoints InsertPoint 4 0.5 1.0 0.0
+  hexaPoints InsertPoint 5 0.0 0.5 0.0
+  hexaPoints InsertPoint 6 0.0 0.0 1.0
+  hexaPoints InsertPoint 7 0.5 0.0 1.0
+  hexaPoints InsertPoint 8 1.0 0.5 1.0
+  hexaPoints InsertPoint 9 1.0 1.0 1.0
+  hexaPoints InsertPoint 10 0.5 1.0 1.0
+  hexaPoints InsertPoint 11 0.0 0.5 1.0
+
+vtkHexagonalPrism aHexa
+  [aHexa GetPointIds] SetId 0 0
+  [aHexa GetPointIds] SetId 1 1
+  [aHexa GetPointIds] SetId 2 2
+  [aHexa GetPointIds] SetId 3 3
+  [aHexa GetPointIds] SetId 4 4
+  [aHexa GetPointIds] SetId 5 5
+  [aHexa GetPointIds] SetId 6 6
+  [aHexa GetPointIds] SetId 7 7
+  [aHexa GetPointIds] SetId 8 8
+  [aHexa GetPointIds] SetId 9 9
+  [aHexa GetPointIds] SetId 10 10
+  [aHexa GetPointIds] SetId 11 11
+
+set bHexa [aHexa NewInstance]
+$bHexa DeepCopy aHexa
+
+vtkUnstructuredGrid aHexaGrid
+  aHexaGrid Allocate 1 1
+  aHexaGrid InsertNextCell [aHexa GetCellType] [aHexa GetPointIds]
+  aHexaGrid SetPoints hexaPoints
+
+vtkUnstructuredGrid aHexaCopy
+  aHexaCopy DeepCopy aHexaGrid
+
+vtkDataSetMapper aHexaMapper
+  aHexaMapper SetInputData aHexaCopy
+
+vtkActor aHexaActor
+  aHexaActor SetMapper aHexaMapper
+  aHexaActor AddPosition 12 0 0
+  [aHexaActor GetProperty] BackfaceCullingOn
+
+# RIB property
+
+if { [info command vtkRIBProperty] != "" } {
+vtkRIBProperty aProperty
+  aProperty SetVariable Km float
+  aProperty SetSurfaceShader LGVeinedmarble
+  aProperty SetVariable veinfreq float
+  aProperty AddVariable warpfreq float
+  aProperty AddVariable veincolor color
+  aProperty AddParameter veinfreq 2
+  aProperty AddParameter veincolor "1.0000 1.0000 0.9412"
+vtkRIBProperty bProperty
+  bProperty SetVariable Km float
+  bProperty SetParameter Km 1.0
+  bProperty SetDisplacementShader dented
+  bProperty SetSurfaceShader plastic
+} else {
+  vtkProperty aProperty
+  vtkProperty bProperty
+}
+aTriangleActor SetProperty aProperty
+aTriangleStripActor SetProperty bProperty
+
+ren1 SetBackground .1 .2 .4
+
+ren1 AddActor aVoxelActor; [aVoxelActor GetProperty] SetDiffuseColor 1 0 0
+ren1 AddActor aHexahedronActor; [aHexahedronActor GetProperty] SetDiffuseColor 1 1 0
+ren1 AddActor aTetraActor; [aTetraActor GetProperty] SetDiffuseColor 0 1 0
+ren1 AddActor aWedgeActor; [aWedgeActor GetProperty] SetDiffuseColor 0 1 1
+ren1 AddActor aPyramidActor; [aPyramidActor GetProperty] SetDiffuseColor 1 0 1
+ren1 AddActor aPixelActor; [aPixelActor GetProperty] SetDiffuseColor 0 1 1
+ren1 AddActor aQuadActor; [aQuadActor GetProperty] SetDiffuseColor 1 0 1
+ren1 AddActor aTriangleActor; [aTriangleActor GetProperty] SetDiffuseColor .3 1 .5
+ren1 AddActor aPolygonActor; [aPolygonActor GetProperty] SetDiffuseColor 1 .4 .5
+ren1 AddActor aTriangleStripActor; [aTriangleStripActor GetProperty] SetDiffuseColor .3 .7 1
+ren1 AddActor aLineActor; [aLineActor GetProperty] SetDiffuseColor .2 1 1
+ren1 AddActor aPolyLineActor; [aPolyLineActor GetProperty] SetDiffuseColor 1 1 1
+ren1 AddActor aVertexActor; [aVertexActor GetProperty] SetDiffuseColor 1 1 1
+ren1 AddActor aPolyVertexActor; [aPolyVertexActor GetProperty] SetDiffuseColor 1 1 1
+ren1 AddActor aPentaActor; [aPentaActor GetProperty] SetDiffuseColor .2 .4 .7
+ren1 AddActor aHexaActor; [aHexaActor GetProperty] SetDiffuseColor .7 .5 1
+
+if { [info command vtkRIBLight] != "" } {
+    vtkRIBLight aLight
+    aLight ShadowsOn
+} else {
+    vtkLight aLight
+}
+aLight PositionalOn
+aLight SetConeAngle 25
+
+ren1 AddLight aLight
+
+ren1 ResetCamera
+[ren1 GetActiveCamera] Azimuth 30
+[ren1 GetActiveCamera] Elevation 20
+[ren1 GetActiveCamera] Dolly 2.8
+ren1 ResetCameraClippingRange
+
+eval aLight SetFocalPoint [[ren1 GetActiveCamera] GetFocalPoint]
+eval aLight SetPosition [[ren1 GetActiveCamera] GetPosition]
+renWin Render
+
+#
+# write to the temp directory if possible, otherwise use .
+set dir "."
+if {[info commands rtTester] == "rtTester"}  {
+   set dir [rtTester GetTempDirectory]
+}
+
+vtkTexture atext
+vtkBMPReader pnmReader
+  pnmReader SetFileName "$VTK_DATA_ROOT/Data/masonry.bmp"
+atext SetInputConnection [pnmReader GetOutputPort]
+atext InterpolateOff
+aTriangleActor SetTexture atext
+
+if { [info command vtkRIBExporter] != "" } {
+  vtkRIBExporter rib
+    rib SetInput renWin
+    rib SetFilePrefix $dir/cells
+    rib SetTexturePrefix $dir/cells
+}
+
+# if we do not have IO?Export then skip all these
+if { [info command vtkIVExporter] != "" } {
+vtkIVExporter iv
+  iv SetInput renWin
+  iv SetFileName $dir/cells.iv
+
+vtkOBJExporter obj
+  obj SetInput renWin
+  obj SetFilePrefix $dir/cells
+
+vtkVRMLExporter vrml
+  vrml SetInput renWin
+  vrml SetStartWrite {vrml SetFileName $dir/cells.wrl}
+  vrml SetEndWrite {vrml SetFileName /a/acells.wrl}
+  vrml SetSpeed 5.5
+
+vtkOOGLExporter oogl
+  oogl SetInput renWin
+  oogl SetFileName $dir/cells.oogl
+
+
+#
+# If the current directory is writable, then test the witers
+#
+
+if {[catch {set channel [open $dir/test.tmp w]}] == 0 } {
+   close $channel
+   file delete -force $dir/test.tmp
+
+   iv Write
+   file delete -force $dir/cells.iv
+   obj Write
+   file delete -force $dir/cells.obj
+   file delete -force $dir/cells.mtl
+   vrml Write
+   file delete -force $dir/cells.wrl
+   oogl Write
+   file delete -force $dir/cells.oogl
+
+   if { [info command vtkRIBExporter] != "" } {
+      rib Write
+      file delete -force $dir/cells.rib
+      catch {eval file delete -force [glob -nocomplain $dir/cells_*_*.tif]}
+   }
+}
+}
+
+# render the image
+#
+iren AddObserver UserEvent {wm deiconify .vtkInteract}
+iren Initialize
+wm withdraw .
+
+
+# the UnRegister calls are because make object is the same as New,
+# and causes memory leaks. (Tcl does not treat NewInstance the same as New).
+proc DeleteCopies {} {
+  global bVoxel bHexahedron bTetra bPixel bQuad bTriangle bPolygon
+  global bTriangleStrip bLine bPolyLine bVertex bPolyVertex
+  global bWedge bPyramid bPenta bHexa
+   $bVoxel UnRegister {}
+   $bHexahedron UnRegister {}
+   $bTetra UnRegister {}
+   $bWedge UnRegister {}
+   $bPyramid UnRegister {}
+   $bPixel UnRegister {}
+   $bQuad UnRegister {}
+   $bTriangle UnRegister {}
+   $bPolygon UnRegister {}
+   $bTriangleStrip UnRegister {}
+   $bLine UnRegister {}
+   $bPolyLine UnRegister {}
+   $bVertex UnRegister {}
+   $bPolyVertex UnRegister {}
+   $bPenta UnRegister {}
+   $bHexa UnRegister {}
+}
+
+DeleteCopies
+
+# for testing
+set threshold 20
+
diff --git a/Rendering/Core/module.cmake b/Rendering/Core/module.cmake
index 6c143a4..43ae08e 100644
--- a/Rendering/Core/module.cmake
+++ b/Rendering/Core/module.cmake
@@ -12,7 +12,6 @@ vtk_module(vtkRenderingCore
     vtksys
   TEST_DEPENDS
     vtkIOLegacy
-    vtkIOParallel
     vtkIOXML
     vtkTestingCore
     vtkTestingRendering
diff --git a/Rendering/Core/vtkColorTransferFunction.cxx b/Rendering/Core/vtkColorTransferFunction.cxx
index 9ef61cf..42aa731 100644
--- a/Rendering/Core/vtkColorTransferFunction.cxx
+++ b/Rendering/Core/vtkColorTransferFunction.cxx
@@ -829,9 +829,6 @@ void vtkColorTransferFunction::GetTable( double xStart, double xEnd,
     // Are we at or past the end? If so, just use the last value
     if ( x > this->Range[1])
       {
-      tptr[0] = 0.0;
-      tptr[1] = 0.0;
-      tptr[2] = 0.0;
       if (this->Clamping)
         {
         if (this->GetUseAboveRangeColor())
@@ -845,14 +842,17 @@ void vtkColorTransferFunction::GetTable( double xStart, double xEnd,
           tptr[2] = lastB;
           }
         }
+      else
+        {
+        tptr[0] = 0.0;
+        tptr[1] = 0.0;
+        tptr[2] = 0.0;
+        }
       }
     // Are we before the first node? If so, duplicate this node's values.
     // We have to deal with -inf here
     else if (x < this->Range[0] || (vtkMath::IsInf(x) && x < 0))
       {
-      tptr[0] = 0.0;
-      tptr[1] = 0.0;
-      tptr[2] = 0.0;
       if (this->Clamping)
         {
         if (this->GetUseBelowRangeColor())
@@ -861,23 +861,11 @@ void vtkColorTransferFunction::GetTable( double xStart, double xEnd,
           }
         else
           {
-          if (numNodes > 0)
-            {
-            tptr[0] = this->Internal->Nodes[0]->R;
-            tptr[1] = this->Internal->Nodes[0]->G;
-            tptr[2] = this->Internal->Nodes[0]->B;
-            }
+          tptr[0] = this->Internal->Nodes[0]->R;
+          tptr[1] = this->Internal->Nodes[0]->G;
+          tptr[2] = this->Internal->Nodes[0]->B;
           }
         }
-      }
-    else if (idx == 0 && std::fabs(x - xStart) < 1e-6)
-      {
-      if (numNodes > 0)
-        {
-        tptr[0] = this->Internal->Nodes[0]->R;
-        tptr[1] = this->Internal->Nodes[0]->G;
-        tptr[2] = this->Internal->Nodes[0]->B;
-        }
       else
         {
         tptr[0] = 0.0;
@@ -885,6 +873,12 @@ void vtkColorTransferFunction::GetTable( double xStart, double xEnd,
         tptr[2] = 0.0;
         }
       }
+    else if (idx == 0 && std::fabs(x - xStart) < 1e-6)
+      {
+      tptr[0] = this->Internal->Nodes[0]->R;
+      tptr[1] = this->Internal->Nodes[0]->G;
+      tptr[2] = this->Internal->Nodes[0]->B;
+      }
     // Otherwise, we are between two nodes - interpolate
     else
       {
@@ -1910,3 +1904,5 @@ void vtkColorTransferFunction::PrintSelf(ostream& os, vtkIndent indent)
     }
 }
 
+
+
diff --git a/Rendering/Core/vtkCoordinate.cxx b/Rendering/Core/vtkCoordinate.cxx
index 24a0451..ec3f31c 100644
--- a/Rendering/Core/vtkCoordinate.cxx
+++ b/Rendering/Core/vtkCoordinate.cxx
@@ -199,19 +199,14 @@ double *vtkCoordinate::GetComputedWorldValue(vtkViewport* viewport)
     {
     case VTK_DISPLAY:
       viewport->DisplayToNormalizedDisplay(val[0],val[1]);
-      VTK_FALLTHROUGH;
     case VTK_NORMALIZED_DISPLAY:
       viewport->NormalizedDisplayToViewport(val[0],val[1]);
-      VTK_FALLTHROUGH;
     case VTK_VIEWPORT:
       viewport->ViewportToNormalizedViewport(val[0],val[1]);
-      VTK_FALLTHROUGH;
     case VTK_NORMALIZED_VIEWPORT:
       viewport->NormalizedViewportToView(val[0],val[1],val[2]);
-      VTK_FALLTHROUGH;
     case VTK_VIEW:
       viewport->ViewToWorld(val[0],val[1],val[2]);
-      break;
     }
 
   if (this->ReferenceCoordinate && this->CoordinateSystem == VTK_WORLD)
@@ -365,13 +360,10 @@ double *vtkCoordinate::GetComputedDoubleDisplayValue(vtkViewport* viewport)
         val[2] += refValue[2];
         }
       viewport->WorldToView(val[0],val[1],val[2]);
-      VTK_FALLTHROUGH;
     case VTK_VIEW:
       viewport->ViewToNormalizedViewport(val[0],val[1],val[2]);
-      VTK_FALLTHROUGH;
     case VTK_NORMALIZED_VIEWPORT:
       viewport->NormalizedViewportToViewport(val[0],val[1]);
-      VTK_FALLTHROUGH;
     case VTK_VIEWPORT:
       if ((this->CoordinateSystem == VTK_NORMALIZED_VIEWPORT ||
            this->CoordinateSystem == VTK_VIEWPORT) &&
@@ -382,10 +374,9 @@ double *vtkCoordinate::GetComputedDoubleDisplayValue(vtkViewport* viewport)
         val[1] += refValue[1];
         }
       viewport->ViewportToNormalizedDisplay(val[0],val[1]);
-      VTK_FALLTHROUGH;
     case VTK_NORMALIZED_DISPLAY:
       viewport->NormalizedDisplayToDisplay(val[0],val[1]);
-      break;
+      break; // do not remove this break statement!
     case VTK_USERDEFINED:
       this->GetComputedUserDefinedValue(viewport);
       val[0] = this->ComputedUserDefinedValue[0];
diff --git a/Rendering/Core/vtkGraphMapper.cxx b/Rendering/Core/vtkGraphMapper.cxx
index 1c1f7ed..e73c13d 100644
--- a/Rendering/Core/vtkGraphMapper.cxx
+++ b/Rendering/Core/vtkGraphMapper.cxx
@@ -157,7 +157,10 @@ vtkGraphMapper::~vtkGraphMapper()
   this->VertexLookupTable = 0;
   this->EdgeLookupTable->Delete();
   this->EdgeLookupTable = 0;
-  delete[] this->ScalingArrayName;
+  if(this->ScalingArrayName!=0)
+    {
+    delete[] this->ScalingArrayName;
+    }
 }
 
 //----------------------------------------------------------------------------
@@ -436,21 +439,9 @@ vtkGraph *vtkGraphMapper::GetInput()
 //----------------------------------------------------------------------------
 void vtkGraphMapper::ReleaseGraphicsResources( vtkWindow *renWin )
 {
-  if (this->EdgeActor)
-    {
-    this->EdgeActor->ReleaseGraphicsResources( renWin );
-    }
-  if (this->VertexActor)
-    {
-    this->VertexActor->ReleaseGraphicsResources( renWin );
-    }
-  if (this->OutlineActor)
-    {
-    this->OutlineActor->ReleaseGraphicsResources( renWin );
-    }
-  if (this->IconActor)
+  if (this->EdgeMapper)
     {
-    this->IconActor->ReleaseGraphicsResources( renWin );
+    this->EdgeMapper->ReleaseGraphicsResources( renWin );
     }
 }
 
diff --git a/Rendering/Core/vtkHardwareSelector.cxx b/Rendering/Core/vtkHardwareSelector.cxx
index d0ca257..eaa289d 100644
--- a/Rendering/Core/vtkHardwareSelector.cxx
+++ b/Rendering/Core/vtkHardwareSelector.cxx
@@ -29,9 +29,8 @@
 #include "vtkStructuredExtent.h"
 
 #include <algorithm>
-#include <cassert>
-#include <map>
 #include <set>
+#include <map>
 
 #define ID_OFFSET 1
 
@@ -99,6 +98,11 @@ public:
     for (iter = dataMap.begin(); iter != dataMap.end(); ++iter)
       {
       const PixelInformation &key = iter->first;
+      if (! key.Prop)
+        {
+        // we don't select 2D annotations
+        continue;
+        }
       const std::set<vtkIdType> &id_values = iter->second;
       vtkSelectionNode* child = vtkSelectionNode::New();
       child->SetContentType(vtkSelectionNode::INDICES);
@@ -134,7 +138,7 @@ public:
       vtkIdType cc=0;
       for (idIter = id_values.begin(); idIter != id_values.end(); ++idIter, ++cc)
         {
-        ptr[cc] = *idIter;
+        ptr[cc] = key.Prop->GetConvertedPickValue(*idIter, fieldassociation);
         }
       child->SetSelectionList(ids);
       ids->FastDelete();
@@ -327,7 +331,12 @@ bool vtkHardwareSelector::PassRequired(int pass)
 //----------------------------------------------------------------------------
 void vtkHardwareSelector::SavePixelBuffer(int passNo)
 {
-  delete [] this->PixBuffer[passNo];
+  if (this->PixBuffer[passNo])
+    {
+    delete [] this->PixBuffer[passNo];
+    this->PixBuffer[passNo] = 0;
+    }
+
   this->PixBuffer[passNo] = this->Renderer->GetRenderWindow()->GetPixelData(
     this->Area[0], this->Area[1], this->Area[2], this->Area[3],
     (this->Renderer->GetRenderWindow()->GetSwapBuffers() == 1)? 1 : 0);
@@ -456,8 +465,7 @@ void vtkHardwareSelector::RenderAttributeId(vtkIdType attribid)
 {
   if (attribid < 0)
     {
-    // negative attribid is valid. It happens when rendering higher order
-    // elements where new points are added for rendering smooth surfaces.
+    vtkErrorMacro("Invalid id: " << attribid);
     return;
     }
 
@@ -581,17 +589,12 @@ bool vtkHardwareSelector::IsPropHit(int id)
 
 //----------------------------------------------------------------------------
 vtkHardwareSelector::PixelInformation vtkHardwareSelector::GetPixelInformation(
-  const unsigned int in_display_position[2], int maxDistance,
-  unsigned int out_selected_position[2])
+  unsigned int in_display_position[2], int maxDistance)
 {
-  assert(in_display_position != out_selected_position);
-
   // Base case
   unsigned int maxDist = (maxDistance < 0) ? 0 : static_cast<unsigned int>(maxDistance);
   if (maxDist == 0)
     {
-    out_selected_position[0] = in_display_position[0];
-    out_selected_position[1] = in_display_position[1];
     if (in_display_position[0] < this->Area[0] || in_display_position[0] > this->Area[2] ||
       in_display_position[1] < this->Area[1] || in_display_position[1] > this->Area[3])
       {
@@ -647,7 +650,7 @@ vtkHardwareSelector::PixelInformation vtkHardwareSelector::GetPixelInformation(
   unsigned int disp_pos[2] = {in_display_position[0], in_display_position[1]};
   unsigned int cur_pos[2] = {0, 0};
   PixelInformation info;
-  info = this->GetPixelInformation(in_display_position, 0, out_selected_position);
+  info = this->GetPixelInformation(in_display_position, 0);
   if (info.Valid)
     {
     return info;
@@ -661,14 +664,14 @@ vtkHardwareSelector::PixelInformation vtkHardwareSelector::GetPixelInformation(
       if (disp_pos[0] >= dist)
         {
         cur_pos[0] = disp_pos[0] - dist;
-        info = this->GetPixelInformation(cur_pos, 0, out_selected_position);
+        info = this->GetPixelInformation(cur_pos, 0);
         if (info.Valid)
           {
           return info;
           }
         }
       cur_pos[0] = disp_pos[0] + dist;
-      info = this->GetPixelInformation(cur_pos, 0, out_selected_position);
+      info = this->GetPixelInformation(cur_pos, 0);
       if (info.Valid)
         {
         return info;
@@ -681,14 +684,14 @@ vtkHardwareSelector::PixelInformation vtkHardwareSelector::GetPixelInformation(
       if (disp_pos[1] >= dist)
         {
         cur_pos[1] = disp_pos[1] - dist;
-        info = this->GetPixelInformation(cur_pos, 0, out_selected_position);
+        info = this->GetPixelInformation(cur_pos, 0);
         if (info.Valid)
           {
           return info;
           }
         }
       cur_pos[1] = disp_pos[1] + dist;
-      info = this->GetPixelInformation(cur_pos, 0, out_selected_position);
+      info = this->GetPixelInformation(cur_pos, 0);
       if (info.Valid)
         {
         return info;
@@ -697,12 +700,38 @@ vtkHardwareSelector::PixelInformation vtkHardwareSelector::GetPixelInformation(
     }
 
   // nothing hit.
-  out_selected_position[0] = in_display_position[0];
-  out_selected_position[1] = in_display_position[1];
   return PixelInformation();
 }
 
 //----------------------------------------------------------------------------
+#ifndef VTK_LEGACY_REMOVE
+bool vtkHardwareSelector::GetPixelInformation(unsigned int display_position[2],
+  int& processid,
+  vtkIdType& attrId, vtkProp*& prop,
+  int maxDist)
+{
+  VTK_LEGACY_BODY(vtkHardwareSelector::GetPixelInformation, "VTK 6.0");
+  PixelInformation info = this->GetPixelInformation(display_position, maxDist);
+  processid = info.ProcessID;
+  attrId = info.AttributeID;
+  prop = info.Prop;
+  return info.Valid;
+}
+
+//----------------------------------------------------------------------------
+bool vtkHardwareSelector::GetPixelInformation(unsigned int display_position[2],
+  int& processid, vtkIdType& attrId, vtkProp*& prop)
+{
+  VTK_LEGACY_BODY(vtkHardwareSelector::GetPixelInformation, "VTK 6.0");
+  PixelInformation info = this->GetPixelInformation(display_position, 0);
+  processid = info.ProcessID;
+  attrId = info.AttributeID;
+  prop = info.Prop;
+  return info.Valid;
+}
+#endif
+
+//----------------------------------------------------------------------------
 vtkSelection* vtkHardwareSelector::GenerateSelection(
   unsigned int x1, unsigned int y1,
   unsigned int x2, unsigned int y2)
diff --git a/Rendering/Core/vtkHardwareSelector.h b/Rendering/Core/vtkHardwareSelector.h
index f5406cc..20d70ae 100644
--- a/Rendering/Core/vtkHardwareSelector.h
+++ b/Rendering/Core/vtkHardwareSelector.h
@@ -134,22 +134,28 @@ public:
   // about pixel locations suing GetPixelInformation(). Use ClearBuffers() to
   // clear buffers after one's done with the scene.
   // The optional final parameter maxDist will look for a cell within the specified
-  // number of pixels from display_position. When using the overload with the
-  // optional \c selected_position argument, selected_position is filled with
-  // the position for which the PixelInformation is being returned. This is
-  // useful when maxDist > 0 to determine which position's pixel information is
-  // was returned.
+  // number of pixels from display_position.
   virtual bool CaptureBuffers();
-  PixelInformation GetPixelInformation(const unsigned int display_position[2])
+  PixelInformation GetPixelInformation(unsigned int display_position[2])
     { return this->GetPixelInformation(display_position, 0); }
-  PixelInformation GetPixelInformation(const unsigned int display_position[2], int maxDist)
-    { unsigned int temp[2]; return this->GetPixelInformation(display_position, maxDist, temp); }
-  PixelInformation GetPixelInformation(const unsigned int display_position[2],
-    int maxDist, unsigned int selected_position[2]);
+  PixelInformation GetPixelInformation(unsigned int display_position[2],
+    int maxDist);
   void ClearBuffers()
     { this->ReleasePixBuffers(); }
 
   // Description:
+  // @deprecated Replaced by
+  // PixelInformation* GetPixelInformation(unsigned int position[2]);
+  VTK_LEGACY(bool GetPixelInformation(unsigned int display_position[2],
+    int& processId, vtkIdType& attrId, vtkProp*& prop));
+
+  // Description:
+  // @deprecated Replaced by
+  // PixelInformation* GetPixelInformation(unsigned int position[2], int maxDist);
+  VTK_LEGACY(bool GetPixelInformation(unsigned int display_position[2],
+    int& processId, vtkIdType& attrId, vtkProp*& prop, int maxDist));
+
+  // Description:
   // Called by any vtkMapper or vtkProp subclass to render a composite-index.
   // Currently indices >= 0xffffff are not supported.
   virtual void RenderCompositeIndex(unsigned int index);
@@ -319,7 +325,7 @@ protected:
   virtual void BeginSelection();
   virtual void EndSelection();
 
-  virtual void SavePixelBuffer(int passNo);
+  void SavePixelBuffer(int passNo);
   void BuildPropHitList(unsigned char* rgbData);
 
   // Description:
diff --git a/Rendering/Core/vtkImageActor.cxx b/Rendering/Core/vtkImageActor.cxx
index 449ef47..0008ab5 100644
--- a/Rendering/Core/vtkImageActor.cxx
+++ b/Rendering/Core/vtkImageActor.cxx
@@ -255,14 +255,14 @@ void vtkImageActor::GetDisplayExtent(int extent[6])
 // Get the bounds for this Volume as (Xmin,Xmax,Ymin,Ymax,Zmin,Zmax).
 double *vtkImageActor::GetDisplayBounds()
 {
-  vtkAlgorithm* inputAlg = NULL;
+  vtkAlgorithm* inputAlg = this->Mapper->GetInputAlgorithm();
 
-  if (this->Mapper && this->Mapper->GetNumberOfInputConnections(0) > 0)
+  if (this->Mapper)
     {
     inputAlg = this->Mapper->GetInputAlgorithm();
     }
 
-  if (!inputAlg)
+  if (!this->Mapper || !inputAlg)
     {
     return this->DisplayBounds;
     }
diff --git a/Rendering/Core/vtkImageSlice.cxx b/Rendering/Core/vtkImageSlice.cxx
index df21da4..d0464bb 100644
--- a/Rendering/Core/vtkImageSlice.cxx
+++ b/Rendering/Core/vtkImageSlice.cxx
@@ -315,12 +315,7 @@ void vtkImageSlice::Render(vtkRenderer *ren)
   this->Update();
 
   // only call the mapper if it has an input
-  vtkImageData* input = this->Mapper->GetInput();
-  int* extent = input->GetExtent();
-  if (input &&
-      extent[0] <= extent[1] &&
-      extent[2] <= extent[3] &&
-      extent[4] <= extent[5])
+  if (this->Mapper->GetInput())
     {
     this->Mapper->Render(ren, this);
     this->EstimatedRenderTime += this->Mapper->GetTimeToDraw();
diff --git a/Rendering/Core/vtkImageSliceMapper.cxx b/Rendering/Core/vtkImageSliceMapper.cxx
index c6d14c9..f6e3193 100644
--- a/Rendering/Core/vtkImageSliceMapper.cxx
+++ b/Rendering/Core/vtkImageSliceMapper.cxx
@@ -176,13 +176,8 @@ int vtkImageSliceMapper::ProcessRequest(
       this->SliceNumber = extent[2*orientation + 1];
       }
 
-    // the test is for an empty extent (0, -1, 0, -1, 0, -1) which
-    // otherwise would be changed into (0, -1, 0, -1, -1, -1)
-    if (extent[2*orientation] <= extent[2*orientation + 1])
-      {
-      extent[2*orientation] = this->SliceNumber;
-      extent[2*orientation + 1] = this->SliceNumber;
-      }
+    extent[2*orientation] = this->SliceNumber;
+    extent[2*orientation + 1] = this->SliceNumber;
 
     this->DisplayExtent[0] = extent[0];
     this->DisplayExtent[1] = extent[1];
diff --git a/Rendering/Core/vtkInteractorEventRecorder.cxx b/Rendering/Core/vtkInteractorEventRecorder.cxx
index f5716ce..ea0c7b4 100644
--- a/Rendering/Core/vtkInteractorEventRecorder.cxx
+++ b/Rendering/Core/vtkInteractorEventRecorder.cxx
@@ -18,7 +18,6 @@
 #include "vtkRenderWindowInteractor.h"
 
 #include <vtksys/ios/sstream>
-#include <cassert>
 #include <locale>
 #include <vtksys/SystemTools.hxx>
 
@@ -29,15 +28,10 @@ float vtkInteractorEventRecorder::StreamVersion = 1.0f;
 //----------------------------------------------------------------------------
 vtkInteractorEventRecorder::vtkInteractorEventRecorder()
 {
-  //take over the processing of keypress events from the superclass
+  //take over the processing of delete and keypress events from the superclass
   this->KeyPressCallbackCommand->SetCallback(
     vtkInteractorEventRecorder::ProcessCharEvent);
   this->KeyPressCallbackCommand->SetPassiveObserver(1); // get events first
-  //processes delete events
-  this->DeleteEventCallbackCommand = vtkCallbackCommand::New();
-  this->DeleteEventCallbackCommand->SetClientData(this);
-  this->DeleteEventCallbackCommand->SetCallback(
-    vtkInteractorEventRecorder::ProcessDeleteEvent);
 
   this->EventCallbackCommand->SetCallback(
     vtkInteractorEventRecorder::ProcessEvents);
@@ -72,7 +66,6 @@ vtkInteractorEventRecorder::~vtkInteractorEventRecorder()
 
   delete [] this->InputString;
   this->InputString = NULL;
-  this->DeleteEventCallbackCommand->Delete();
 }
 
 //----------------------------------------------------------------------------
@@ -174,7 +167,10 @@ void vtkInteractorEventRecorder::Play()
         return;
         }
       std::string inputStr(this->InputString, len);
-      delete this->InputStream;
+      if (this->InputStream)
+        {
+        delete this->InputStream;
+        }
       this->InputStream = new vtksys_ios::istringstream(inputStr);
       if (this->InputStream->fail())
         {
@@ -298,7 +294,6 @@ void vtkInteractorEventRecorder::SetInteractor(vtkRenderWindowInteractor* i)
     {
     this->SetEnabled(0); //disable the old interactor
     this->Interactor->RemoveObserver(this->KeyPressCallbackCommand);
-    this->Interactor->RemoveObserver(this->DeleteEventCallbackCommand);
     }
 
   this->Interactor = i;
@@ -309,52 +304,46 @@ void vtkInteractorEventRecorder::SetInteractor(vtkRenderWindowInteractor* i)
     i->AddObserver(vtkCommand::CharEvent,
                    this->KeyPressCallbackCommand, this->Priority);
     i->AddObserver(vtkCommand::DeleteEvent,
-                   this->DeleteEventCallbackCommand, this->Priority);
+                   this->KeyPressCallbackCommand, this->Priority);
     }
 
   this->Modified();
 }
 
 //----------------------------------------------------------------------------
-void vtkInteractorEventRecorder::ProcessDeleteEvent(vtkObject* vtkNotUsed(object),
-                                                    unsigned long event,
-                                                    void* clientData,
-                                                    void* vtkNotUsed(callData))
-{
-  assert (event == vtkCommand::DeleteEvent);
-  (void)event;
-  vtkInteractorEventRecorder* self =
-    reinterpret_cast<vtkInteractorEventRecorder *>( clientData );
-  // if the interactor is being deleted then remove the event handlers
-  self->SetInteractor(0);
-}
-
-//----------------------------------------------------------------------------
 void vtkInteractorEventRecorder::ProcessCharEvent(vtkObject* object,
                                                   unsigned long event,
                                                   void* clientData,
                                                   void* vtkNotUsed(callData))
 {
-  assert (event == vtkCommand::CharEvent);
-  (void)event;
   vtkInteractorEventRecorder* self =
     reinterpret_cast<vtkInteractorEventRecorder *>( clientData );
   vtkRenderWindowInteractor* rwi =
     static_cast<vtkRenderWindowInteractor *>( object );
-  if ( self->KeyPressActivation )
+
+  switch(event)
     {
-    if (rwi->GetKeyCode() == self->KeyPressActivationValue )
-      {
-      if ( !self->Enabled )
-        {
-        self->On();
-        }
-      else
+    case vtkCommand::DeleteEvent:
+      // if the interactor is being deleted then remove the event handlers
+      self->SetInteractor(0);
+      break;
+
+    case vtkCommand::CharEvent:
+      if ( self->KeyPressActivation )
         {
-        self->Off();
-        }
-      }//event not aborted
-    }//if activation enabled
+        if (rwi->GetKeyCode() == self->KeyPressActivationValue )
+          {
+          if ( !self->Enabled )
+            {
+            self->On();
+            }
+          else
+            {
+            self->Off();
+            }
+          }//event not aborted
+        }//if activation enabled
+    }
 }
 
 //----------------------------------------------------------------------------
diff --git a/Rendering/Core/vtkInteractorEventRecorder.h b/Rendering/Core/vtkInteractorEventRecorder.h
index af00295..63b9c29 100644
--- a/Rendering/Core/vtkInteractorEventRecorder.h
+++ b/Rendering/Core/vtkInteractorEventRecorder.h
@@ -88,9 +88,6 @@ protected:
   // file to read/write from
   char *FileName;
 
-  //listens to delete events
-  vtkCallbackCommand* DeleteEventCallbackCommand;
-
   // control whether to read from string
   int ReadFromInputString;
   char *InputString;
@@ -102,8 +99,6 @@ protected:
   //methods for processing events
   static void ProcessCharEvent(vtkObject* object, unsigned long event,
                                void* clientdata, void* calldata);
-  static void ProcessDeleteEvent(vtkObject* object, unsigned long event,
-                                 void* clientdata, void* calldata);
   static void ProcessEvents(vtkObject* object, unsigned long event,
                             void* clientdata, void* calldata);
 
diff --git a/Rendering/Core/vtkInteractorStyle.cxx b/Rendering/Core/vtkInteractorStyle.cxx
index bb755b2..55597b9 100644
--- a/Rendering/Core/vtkInteractorStyle.cxx
+++ b/Rendering/Core/vtkInteractorStyle.cxx
@@ -420,14 +420,9 @@ void vtkInteractorStyle::StartState(int newstate)
     vtkRenderWindowInteractor *rwi = this->Interactor;
     rwi->GetRenderWindow()->SetDesiredUpdateRate(rwi->GetDesiredUpdateRate());
     this->InvokeEvent(vtkCommand::StartInteractionEvent, NULL);
-    if ( this->UseTimers &&
-         !(this->TimerId=rwi->CreateRepeatingTimer(this->TimerDuration)) )
+    if ( this->UseTimers && !(this->TimerId=rwi->CreateRepeatingTimer(this->TimerDuration)) )
       {
-      // vtkTestingInteractor cannot create timers
-      if (std::string(rwi->GetClassName()) != "vtkTestingInteractor")
-        {
-        vtkErrorMacro(<< "Timer start failed");
-        }
+      vtkErrorMacro(<< "Timer start failed");
       this->State = VTKIS_NONE;
       }
     }
@@ -442,10 +437,7 @@ void vtkInteractorStyle::StopState()
     vtkRenderWindowInteractor *rwi = this->Interactor;
     vtkRenderWindow *renwin = rwi->GetRenderWindow();
     renwin->SetDesiredUpdateRate(rwi->GetStillUpdateRate());
-    if (this->UseTimers &&
-        // vtkTestingInteractor cannot create timers
-        std::string(rwi->GetClassName()) != "vtkTestingInteractor" &&
-        !rwi->DestroyTimer(this->TimerId))
+    if (this->UseTimers && !rwi->DestroyTimer(this->TimerId))
       {
       vtkErrorMacro(<< "Timer stop failed");
       }
diff --git a/Rendering/Core/vtkLabeledContourMapper.cxx b/Rendering/Core/vtkLabeledContourMapper.cxx
index b21e82c..4802d1c 100644
--- a/Rendering/Core/vtkLabeledContourMapper.cxx
+++ b/Rendering/Core/vtkLabeledContourMapper.cxx
@@ -18,7 +18,6 @@
 #include "vtkCamera.h"
 #include "vtkCellArray.h"
 #include "vtkCoordinate.h"
-#include "vtkDoubleArray.h"
 #include "vtkExecutive.h"
 #include "vtkInformation.h"
 #include "vtkIntArray.h"
@@ -41,9 +40,7 @@
 #include "vtkWindow.h"
 
 #include <algorithm>
-#include <cassert>
 #include <cmath>
-#include <map>
 #include <sstream>
 #include <string>
 #include <vector>
@@ -51,11 +48,8 @@
 //------------------------------------------------------------------------------
 struct LabelMetric
 {
-  bool Valid;
-  double Value;
-  vtkTextProperty *TProp;
+  double value;
   std::string Text;
-  // These measure the pixel size of the text texture:
   vtkTuple<int, 4> BoundingBox;
   vtkTuple<int, 2> Dimensions;
 };
@@ -63,22 +57,18 @@ struct LabelMetric
 //------------------------------------------------------------------------------
 struct LabelInfo
 {
-  // Position in actor space:
+  // World coordinate:
   vtkVector3d Position;
 
   // Orientation (normalized, world space)
-  vtkVector3d RightW; // Left --> Right
-  vtkVector3d UpW; // Bottom --> Top
+  vtkVector3d Right; // Left --> Right
+  vtkVector3d Up; // Bottom --> Top
 
-  // Orientation (normalized in world space, represented in actor space)
-  vtkVector3d RightA; // Left --> Right
-  vtkVector3d UpA; // Bottom --> Top
-
-  // Corner locations (actor space):
-  vtkVector3d TLa;
-  vtkVector3d TRa;
-  vtkVector3d BRa;
-  vtkVector3d BLa;
+  // Corner locations (world space):
+  vtkVector3d TLw;
+  vtkVector3d TRw;
+  vtkVector3d BRw;
+  vtkVector3d BLw;
 
   // Corner location (display space):
   vtkVector2i TLd;
@@ -87,39 +77,11 @@ struct LabelInfo
   vtkVector2i BLd;
 
   // Factor to scale the text actor by:
-  double ScaleDisplayToActor;
+  double Scale;
 };
 
 namespace {
 
-// Circular iterator through a vtkTextPropertyCollection -----------------------
-class TextPropLoop
-{
-  vtkTextPropertyCollection *TProps;
-public:
-  TextPropLoop(vtkTextPropertyCollection *col)
-    : TProps(col)
-  {
-    TProps->InitTraversal();
-  }
-
-  vtkTextProperty* Next()
-  {
-    // The input checks should fail if this is the case:
-    assert("No text properties set! Prerender check failed!" &&
-           TProps->GetNumberOfItems() != 0);
-
-    vtkTextProperty *result = TProps->GetNextItem();
-    if (!result)
-      {
-      TProps->InitTraversal();
-      result = TProps->GetNextItem();
-      assert("Text property traversal error." && result != NULL);
-      }
-    return result;
-  }
-};
-
 //------------------------------------------------------------------------------
 double calculateSmoothness(double pathLength, double distance)
 {
@@ -138,9 +100,7 @@ struct vtkLabeledContourMapper::Private
   std::vector<std::vector<LabelInfo> > LabelInfos;
 
   // Info for calculating display coordinates:
-  vtkTuple<double, 16> AMVP; // actor-model-view-projection matrix
-  vtkTuple<double, 16> ActorMatrix; // Actor model matrix
-  vtkTuple<double, 16> InverseActorMatrix; // Inverse Actor model matrix
+  vtkTuple<double, 16> MVP; // model-view-projection matrix
   vtkTuple<double, 4> ViewPort; // viewport
   vtkTuple<double, 4> NormalizedViewPort; // see vtkViewport::ViewToNormalizedVP
   vtkTuple<int, 2> WindowSize;
@@ -160,14 +120,12 @@ struct vtkLabeledContourMapper::Private
   // Only want to print the stencil warning once:
   bool AlreadyWarnedAboutStencils;
 
-  // Project coordinates. Note that the vector objects must be unique.
-  void ActorToWorld(const vtkVector3d &actor, vtkVector3d &world) const;
-  void WorldToActor(const vtkVector3d &world, vtkVector3d &actor) const;
-  void ActorToDisplay(const vtkVector3d &actor, vtkVector2i &display) const;
-  void ActorToDisplay(const vtkVector3d &actor, vtkVector2d &display) const;
+  // Project coordinates:
+  void WorldToDisplay(const vtkVector3d &world, vtkVector2i &display);
+  void WorldToDisplay(const vtkVector3d &world, vtkVector2d &display);
 
   // Camera axes:
-  bool SetViewInfo(vtkRenderer *ren, vtkActor *act);
+  bool SetViewInfo(vtkRenderer *ren);
 
   // Visibility test (display space):
   template <typename ScalarType>
@@ -210,9 +168,6 @@ vtkLabeledContourMapper::vtkLabeledContourMapper()
   this->StencilQuadIndicesSize = 0;
 
   this->TextProperties = vtkSmartPointer<vtkTextPropertyCollection>::New();
-  vtkNew<vtkTextProperty> defaultTProp;
-  this->TextProperties->AddItem(defaultTProp.GetPointer());
-
   this->Internal = new vtkLabeledContourMapper::Private();
   this->Internal->PrepareTime = 0.0;
   this->Internal->RenderTime = 0.0;
@@ -233,12 +188,6 @@ vtkLabeledContourMapper::~vtkLabeledContourMapper()
 //------------------------------------------------------------------------------
 void vtkLabeledContourMapper::Render(vtkRenderer *ren, vtkActor *act)
 {
-  // Make sure input data is synced
-  if (vtkAlgorithm *inputAlgorithm = this->GetInputAlgorithm())
-    {
-    inputAlgorithm->Update();
-    }
-
   if (!this->CheckInputs(ren))
     {
     return;
@@ -271,7 +220,7 @@ void vtkLabeledContourMapper::Render(vtkRenderer *ren, vtkActor *act)
       return;
       }
 
-    if (!this->CreateLabels(act))
+    if (!this->CreateLabels())
       {
       return;
       }
@@ -373,32 +322,6 @@ vtkTextPropertyCollection *vtkLabeledContourMapper::GetTextProperties()
 }
 
 //------------------------------------------------------------------------------
-vtkDoubleArray *vtkLabeledContourMapper::GetTextPropertyMapping()
-{
-  return this->TextPropertyMapping;
-}
-
-//------------------------------------------------------------------------------
-void vtkLabeledContourMapper::SetTextPropertyMapping(vtkDoubleArray *mapping)
-{
-  if (this->TextPropertyMapping != mapping)
-    {
-    this->TextPropertyMapping = mapping;
-    this->Modified();
-    }
-}
-
-//------------------------------------------------------------------------------
-void vtkLabeledContourMapper::ReleaseGraphicsResources(vtkWindow *win)
-{
-  this->PolyDataMapper->ReleaseGraphicsResources(win);
-  for (vtkIdType i = 0; i < this->NumberOfTextActors; ++i)
-    {
-    this->TextActors[i]->ReleaseGraphicsResources(win);
-    }
-}
-
-//------------------------------------------------------------------------------
 void vtkLabeledContourMapper::ComputeBounds()
 {
   this->GetInput()->GetBounds(this->Bounds);
@@ -422,17 +345,6 @@ void vtkLabeledContourMapper::PrintSelf(ostream& os, vtkIndent indent)
   this->PolyDataMapper->PrintSelf(os, indent.GetNextIndent());
   os << indent << "TextProperties:\n";
   this->TextProperties->PrintSelf(os, indent.GetNextIndent());
-  os << indent << "TextPropertyMapping:";
-  if (this->TextPropertyMapping)
-    {
-    os << "\n";
-    this->TextPropertyMapping->PrintSelf(os, indent.GetNextIndent());
-    }
-  else
-    {
-    os << " (NULL)\n";
-    }
-
 }
 
 //------------------------------------------------------------------------------
@@ -551,9 +463,9 @@ bool vtkLabeledContourMapper::CheckRebuild(vtkRenderer *, vtkActor *act)
 }
 
 //------------------------------------------------------------------------------
-bool vtkLabeledContourMapper::PrepareRender(vtkRenderer *ren, vtkActor *act)
+bool vtkLabeledContourMapper::PrepareRender(vtkRenderer *ren, vtkActor *)
 {
-  if (!this->Internal->SetViewInfo(ren, act))
+  if (!this->Internal->SetViewInfo(ren))
     {
     return false;
     }
@@ -563,101 +475,27 @@ bool vtkLabeledContourMapper::PrepareRender(vtkRenderer *ren, vtkActor *act)
   vtkCellArray *lines = input->GetLines();
   vtkDataArray *scalars = input->GetPointData()->GetScalars();
   vtkTextRenderer *tren = vtkTextRenderer::GetInstance();
-  if (!tren)
-    {
-    vtkErrorMacro(<< "Text renderer unavailable.");
-    return false;
-    }
 
-  // Maps scalar values to text properties:
-  typedef std::map<double, vtkTextProperty*> LabelPropertyMapType;
-  LabelPropertyMapType labelMap;
-
-  // Initialize with the user-requested mapping, if it exists.
-  if (this->TextPropertyMapping.GetPointer() != NULL)
-    {
-    vtkDoubleArray::Iterator valIt = this->TextPropertyMapping->Begin();
-    vtkDoubleArray::Iterator valItEnd = this->TextPropertyMapping->End();
-    TextPropLoop tprops(this->TextProperties);
-    for (; valIt != valItEnd; ++valIt)
-      {
-      labelMap.insert(std::make_pair(*valIt, tprops.Next()));
-      }
-    }
-
-  // Create the list of metrics, but no text property information yet.
   vtkIdType numPts;
   vtkIdType *ids;
-  for (lines->InitTraversal(); lines->GetNextCell(numPts, ids);)
+  vtkIdType cellId = 0;
+  for (lines->InitTraversal(); lines->GetNextCell(numPts, ids); ++cellId)
     {
-    this->Internal->LabelMetrics.push_back(LabelMetric());
-    LabelMetric &metric = this->Internal->LabelMetrics.back();
-    if (!(metric.Valid = (numPts > 0)))
-      {
-      // Mark as invalid and skip if there are no points.
-      continue;
-      }
-    metric.Value = scalars->GetComponent(ids[0], 0);
+    vtkTextProperty *tprop = this->GetTextPropertyForCellId(cellId);
+    LabelMetric metric;
+    metric.value = numPts > 0 ? scalars->GetComponent(ids[0], 0) : 0.;
     std::ostringstream str;
-    str << metric.Value;
+    str << metric.value;
     metric.Text = str.str();
-
-    // Beware future maintainers: The following line of code has been carefully
-    // crafted to reach a zen-like harmony of compatibility between various
-    // compilers that have differing syntactic requirements for creating a
-    // pair containing a NULL:
-    // - Pedantically strict C++11 compilers (e.g. MSVC 2012) will not compile:
-    //     std::make_pair<double, X*>(someDouble, NULL);
-    //   or any make_pair call with explicit template args and value arguments,
-    //   as the signature expects an rvalue.
-    // - MSVC 2010 compilers also reject:
-    //     std::pair<double, X*>(someDouble, NULL);
-    //   unless the NULL is cast explicitly to X* (as we do below) due to known
-    //   issues with pointer casting.
-
-    // The value will be replaced in the next loop:
-    labelMap.insert(std::pair<double, vtkTextProperty*>(
-                      metric.Value, reinterpret_cast<vtkTextProperty*>(NULL)));
-    }
-
-  // Now that all present scalar values are known, assign text properties:
-  TextPropLoop tprops(this->TextProperties);
-  typedef LabelPropertyMapType::iterator LabelPropertyMapIter;
-  for (LabelPropertyMapIter it = labelMap.begin(), itEnd = labelMap.end();
-       it != itEnd; ++it)
-    {
-    if (!it->second) // Skip if initialized from TextPropertyMapping
-      {
-      it->second = tprops.Next();
-      }
-    }
-
-  // Update metrics with appropriate text info:
-  typedef std::vector<LabelMetric>::iterator MetricsIter;
-  for (MetricsIter it = this->Internal->LabelMetrics.begin(),
-       itEnd = this->Internal->LabelMetrics.end(); it != itEnd; ++it)
-    {
-    if (!it->Valid)
-      {
-      continue;
-      }
-
-    // Look up text property for the scalar value:
-    LabelPropertyMapIter tpropIt = labelMap.find(it->Value);
-    assert("No text property assigned for scalar value." &&
-           tpropIt != labelMap.end());
-    it->TProp = tpropIt->second;
-
-    // Assign bounding box/dims.
-    if (!tren->GetBoundingBox(it->TProp, it->Text, it->BoundingBox.GetData(),
-                              vtkTextActor3D::GetRenderedDPI()))
+    if (!tren->GetBoundingBox(tprop, metric.Text, metric.BoundingBox.GetData()))
       {
       vtkErrorMacro(<<"Error calculating bounding box for string '"
-                    << it->Text << "'.");
+                    << metric.Text << "'.");
       return false;
       }
-    it->Dimensions[0] = it->BoundingBox[1] - it->BoundingBox[0] + 1;
-    it->Dimensions[1] = it->BoundingBox[3] - it->BoundingBox[2] + 1;
+    metric.Dimensions[0] = metric.BoundingBox[1] - metric.BoundingBox[0] + 1;
+    metric.Dimensions[1] = metric.BoundingBox[3] - metric.BoundingBox[2] + 1;
+    this->Internal->LabelMetrics.push_back(metric);
     }
 
   return true;
@@ -795,7 +633,7 @@ bool vtkLabeledContourMapper::ResolveLabels()
 }
 
 //------------------------------------------------------------------------------
-bool vtkLabeledContourMapper::CreateLabels(vtkActor *)
+bool vtkLabeledContourMapper::CreateLabels()
 {
   typedef std::vector<LabelMetric> MetricVector;
   typedef std::vector<LabelInfo> InfoVector;
@@ -824,16 +662,22 @@ bool vtkLabeledContourMapper::CreateLabels(vtkActor *)
   vtkTextActor3D **actor = this->TextActors;
   vtkTextActor3D **actorEnd = this->TextActors + this->NumberOfUsedTextActors;
 
+  vtkIdType cellId = 0;
   while (metrics != metricsEnd &&
          outerLabels != outerLabelsEnd &&
          actor != actorEnd)
     {
+    vtkTextProperty *tprop = this->GetTextPropertyForCellId(cellId);
+
     for (InfoVector::const_iterator label = outerLabels->begin(),
          labelEnd = outerLabels->end(); label != labelEnd; ++label)
       {
+      (*actor)->SetTextProperty(tprop);
       this->Internal->BuildLabel(*actor, *metrics, *label);
       ++actor;
       }
+
+    ++cellId;
     ++metrics;
     ++outerLabels;
     }
@@ -955,18 +799,18 @@ bool vtkLabeledContourMapper::BuildStencilQuads()
     {
     for (InnerIterator in = out->begin(), inEnd = out->end(); in != inEnd; ++in)
       {
-      this->StencilQuads[qIndex +  0] = static_cast<float>(in->TLa[0]);
-      this->StencilQuads[qIndex +  1] = static_cast<float>(in->TLa[1]);
-      this->StencilQuads[qIndex +  2] = static_cast<float>(in->TLa[2]);
-      this->StencilQuads[qIndex +  3] = static_cast<float>(in->TRa[0]);
-      this->StencilQuads[qIndex +  4] = static_cast<float>(in->TRa[1]);
-      this->StencilQuads[qIndex +  5] = static_cast<float>(in->TRa[2]);
-      this->StencilQuads[qIndex +  6] = static_cast<float>(in->BRa[0]);
-      this->StencilQuads[qIndex +  7] = static_cast<float>(in->BRa[1]);
-      this->StencilQuads[qIndex +  8] = static_cast<float>(in->BRa[2]);
-      this->StencilQuads[qIndex +  9] = static_cast<float>(in->BLa[0]);
-      this->StencilQuads[qIndex + 10] = static_cast<float>(in->BLa[1]);
-      this->StencilQuads[qIndex + 11] = static_cast<float>(in->BLa[2]);
+      this->StencilQuads[qIndex +  0] = static_cast<float>(in->TLw[0]);
+      this->StencilQuads[qIndex +  1] = static_cast<float>(in->TLw[1]);
+      this->StencilQuads[qIndex +  2] = static_cast<float>(in->TLw[2]);
+      this->StencilQuads[qIndex +  3] = static_cast<float>(in->TRw[0]);
+      this->StencilQuads[qIndex +  4] = static_cast<float>(in->TRw[1]);
+      this->StencilQuads[qIndex +  5] = static_cast<float>(in->TRw[2]);
+      this->StencilQuads[qIndex +  6] = static_cast<float>(in->BRw[0]);
+      this->StencilQuads[qIndex +  7] = static_cast<float>(in->BRw[1]);
+      this->StencilQuads[qIndex +  8] = static_cast<float>(in->BRw[2]);
+      this->StencilQuads[qIndex +  9] = static_cast<float>(in->BLw[0]);
+      this->StencilQuads[qIndex + 10] = static_cast<float>(in->BLw[1]);
+      this->StencilQuads[qIndex + 11] = static_cast<float>(in->BLw[2]);
 
       this->StencilQuadIndices[iIndex + 0] = eIndex + 0;
       this->StencilQuadIndices[iIndex + 1] = eIndex + 1;
@@ -985,53 +829,34 @@ bool vtkLabeledContourMapper::BuildStencilQuads()
 }
 
 //------------------------------------------------------------------------------
-void vtkLabeledContourMapper::Private::ActorToWorld(const vtkVector3d &in,
-                                                    vtkVector3d &out) const
-{
-  const vtkTuple<double, 16> &x = this->ActorMatrix;
-  double w;
-  out[0] = in[0] * x[0]  + in[1] * x[1]  + in[2] * x[2]  + x[3];
-  out[1] = in[0] * x[4]  + in[1] * x[5]  + in[2] * x[6]  + x[7];
-  out[2] = in[0] * x[8]  + in[1] * x[9]  + in[2] * x[10] + x[11];
-  w      = in[0] * x[12] + in[1] * x[13] + in[2] * x[14] + x[15];
-  out = out * (1. / w);
-}
-
-//------------------------------------------------------------------------------
-void vtkLabeledContourMapper::Private::WorldToActor(const vtkVector3d &in,
-                                                    vtkVector3d &out) const
+vtkTextProperty *
+vtkLabeledContourMapper::GetTextPropertyForCellId(vtkIdType cellId) const
 {
-  const vtkTuple<double, 16> &x = this->InverseActorMatrix;
-  double w;
-  out[0] = in[0] * x[0]  + in[1] * x[1]  + in[2] * x[2]  + x[3];
-  out[1] = in[0] * x[4]  + in[1] * x[5]  + in[2] * x[6]  + x[7];
-  out[2] = in[0] * x[8]  + in[1] * x[9]  + in[2] * x[10] + x[11];
-  w      = in[0] * x[12] + in[1] * x[13] + in[2] * x[14] + x[15];
-  out = out * (1. / w);
+  int idx = static_cast<int>(cellId % this->TextProperties->GetNumberOfItems());
+  return this->TextProperties->GetItem(idx);
 }
 
 //------------------------------------------------------------------------------
-void vtkLabeledContourMapper::Private::ActorToDisplay(const vtkVector3d &actor,
-                                                      vtkVector2i &out) const
+inline void vtkLabeledContourMapper::Private::WorldToDisplay(
+    const vtkVector3d &world, vtkVector2i &display)
 {
   vtkVector2d v;
-  this->ActorToDisplay(actor, v);
-  out = vtkVector2i(v.Cast<int>().GetData());
+  this->WorldToDisplay(world, v);
+  display = vtkVector2i(v.Cast<int>().GetData());
 }
 
 //------------------------------------------------------------------------------
-void vtkLabeledContourMapper::Private::ActorToDisplay(const vtkVector3d &actor,
-                                                      vtkVector2d &v) const
+inline void vtkLabeledContourMapper::Private::WorldToDisplay(
+    const vtkVector3d &world, vtkVector2d &v)
 {
   // This is adapted from vtkCoordinate's world to display conversion. We
   // reimplement it here for efficiency.
 
-  // vtkRenderer::WorldToView (AMVP includes the actor matrix, too)
-  const vtkTuple<double, 16> &x = this->AMVP;
+  // vtkRenderer::WorldToView
   double w;
-  v[0] = actor[0] * x[0]  + actor[1] * x[1]  + actor[2] * x[2]  + x[3];
-  v[1] = actor[0] * x[4]  + actor[1] * x[5]  + actor[2] * x[6]  + x[7];
-  w    = actor[0] * x[12] + actor[1] * x[13] + actor[2] * x[14] + x[15];
+  v[0] = world[0] * MVP[0]  + world[1] * MVP[1]  + world[2] * MVP[2]  + MVP[3];
+  v[1] = world[0] * MVP[4]  + world[1] * MVP[5]  + world[2] * MVP[6]  + MVP[7];
+  w    = world[0] * MVP[12] + world[1] * MVP[13] + world[2] * MVP[14] + MVP[15];
   v = v * (1. / w);
 
   // vtkViewport::ViewToNormalizedViewport
@@ -1055,17 +880,9 @@ void vtkLabeledContourMapper::Private::ActorToDisplay(const vtkVector3d &actor,
 }
 
 //------------------------------------------------------------------------------
-bool vtkLabeledContourMapper::Private::SetViewInfo(vtkRenderer *ren,
-                                                   vtkActor *act)
+bool vtkLabeledContourMapper::Private::SetViewInfo(vtkRenderer *ren)
 {
-  vtkCamera *cam = ren->GetActiveCamera();
-  if (!cam)
-    {
-    vtkGenericWarningMacro(<<"No active camera on renderer.");
-    return false;
-    }
-
-  vtkMatrix4x4 *mat = cam->GetModelViewTransformMatrix();
+  vtkMatrix4x4 *mat = ren->GetActiveCamera()->GetModelViewTransformMatrix();
   this->CameraRight.Set(mat->GetElement(0, 0),
                         mat->GetElement(0, 1),
                         mat->GetElement(0, 2));
@@ -1076,18 +893,9 @@ bool vtkLabeledContourMapper::Private::SetViewInfo(vtkRenderer *ren,
                           mat->GetElement(2, 1),
                           mat->GetElement(2, 2));
 
-  double mvp[16];
   mat = ren->GetActiveCamera()->GetCompositeProjectionTransformMatrix(
         ren->GetTiledAspectRatio(), 0., 1.);
-  vtkMatrix4x4::DeepCopy(mvp, mat);
-
-  // Apply the actor's matrix:
-  vtkMatrix4x4::DeepCopy(this->ActorMatrix.GetData(), act->GetMatrix());
-  vtkMatrix4x4::Multiply4x4(mvp, this->ActorMatrix.GetData(),
-                            this->AMVP.GetData());
-
-  vtkMatrix4x4::Invert(this->ActorMatrix.GetData(),
-                       this->InverseActorMatrix.GetData());
+  vtkMatrix4x4::DeepCopy(this->MVP.GetData(), mat);
 
   if (vtkWindow *win = ren->GetVTKWindow())
     {
@@ -1130,39 +938,39 @@ bool vtkLabeledContourMapper::Private::LineCanBeLabeled(
     const LabelMetric &metrics)
 {
   vtkTuple<int, 4> bbox(0);
-  vtkVector3d actorCoord;
-  vtkVector2i displayCoord;
+  vtkVector3d world;
+  vtkVector2i display;
   if (numIds > 0)
     {
     do
       {
-      points->GetPoint(*(ids++), actorCoord.GetData());
-      this->ActorToDisplay(actorCoord, displayCoord);
+      points->GetPoint(*(ids++), world.GetData());
+      this->WorldToDisplay(world, display);
       --numIds;
       }
-    while (numIds > 0 && !this->PixelIsVisible(displayCoord));
+    while (numIds > 0 && !this->PixelIsVisible(display));
 
-    if (!this->PixelIsVisible(displayCoord))
+    if (!this->PixelIsVisible(display))
       {
       // No visible points
       return false;
       }
 
-    bbox[0] = displayCoord.GetX();
-    bbox[1] = displayCoord.GetX();
-    bbox[2] = displayCoord.GetY();
-    bbox[3] = displayCoord.GetY();
+    bbox[0] = display.GetX();
+    bbox[1] = display.GetX();
+    bbox[2] = display.GetY();
+    bbox[3] = display.GetY();
     }
   while (numIds-- > 0)
     {
-    points->GetPoint(*(ids++), actorCoord.GetData());
-    this->ActorToDisplay(actorCoord, displayCoord);
-    if (this->PixelIsVisible(displayCoord))
+    points->GetPoint(*(ids++), world.GetData());
+    this->WorldToDisplay(world, display);
+    if (this->PixelIsVisible(display))
       {
-      bbox[0] = std::min(bbox[0], displayCoord.GetX());
-      bbox[1] = std::max(bbox[1], displayCoord.GetX());
-      bbox[2] = std::min(bbox[2], displayCoord.GetY());
-      bbox[3] = std::max(bbox[3], displayCoord.GetY());
+      bbox[0] = std::min(bbox[0], display.GetX());
+      bbox[1] = std::max(bbox[1], display.GetX());
+      bbox[2] = std::min(bbox[2], display.GetY());
+      bbox[3] = std::max(bbox[3], display.GetY());
       }
     }
 
@@ -1197,14 +1005,14 @@ bool vtkLabeledContourMapper::Private::NextLabel(
   vtkVector3d startPoint;
   vtkVector2d startPointDisplay;
   points->GetPoint(ids[startIdx], startPoint.GetData());
-  this->ActorToDisplay(startPoint, startPointDisplay);
+  this->WorldToDisplay(startPoint, startPointDisplay);
 
   // Find the first visible point:
   while (startIdx + 1 < numIds && !this->PixelIsVisible(startPointDisplay))
     {
     ++startIdx;
     points->GetPoint(ids[startIdx], startPoint.GetData());
-    this->ActorToDisplay(startPoint, startPointDisplay);
+    this->WorldToDisplay(startPoint, startPointDisplay);
     }
 
   // Start point in current segment.
@@ -1252,7 +1060,7 @@ bool vtkLabeledContourMapper::Private::NextLabel(
 
     // Update current:
     points->GetPoint(ids[curIdx], curPoint.GetData());
-    this->ActorToDisplay(curPoint, curPointDisplay);
+    this->WorldToDisplay(curPoint, curPointDisplay);
 
     // Calculate lengths and smoothness.
     segment = curPointDisplay - prevPointDisplay;
@@ -1288,7 +1096,7 @@ bool vtkLabeledContourMapper::Private::NextLabel(
           {
           ++startIdx;
           points->GetPoint(ids[startIdx], startPoint.GetData());
-          this->ActorToDisplay(startPoint, startPointDisplay);
+          this->WorldToDisplay(startPoint, startPointDisplay);
           }
         while (startIdx < numIds && !this->PixelIsVisible(startPointDisplay));
 
@@ -1311,26 +1119,22 @@ bool vtkLabeledContourMapper::Private::NextLabel(
     // The final index of the segment:
     vtkIdType endIdx = curIdx - 1;
 
-    // The direction of the text.
-    vtkVector3d prevPointWorld;
-    vtkVector3d startPointWorld;
-    this->ActorToWorld(prevPoint, prevPointWorld);
-    this->ActorToWorld(startPoint, startPointWorld);
-    info.RightW = (prevPointWorld - startPointWorld).Normalized();
+    // The direction of the text:
+    info.Right = (prevPoint - startPoint).Normalized();
     // Ensure the text reads left->right:
-    if (info.RightW.Dot(this->CameraRight) < 0.)
+    if (info.Right.Dot(this->CameraRight) < 0.)
       {
-      info.RightW = -info.RightW;
+      info.Right = -info.Right;
       }
 
     // The up vector. Cross the forward direction with the orientation and
     // ensure that the result vector is in the same hemisphere as CameraUp
-    info.UpW = info.RightW.Compare(this->CameraForward, 10e-10)
+    info.Up = info.Right.Compare(this->CameraForward, 10e-10)
         ? this->CameraUp
-        : info.RightW.Cross(this->CameraForward).Normalized();
-    if (info.UpW.Dot(this->CameraUp) < 0.)
+        : info.Right.Cross(this->CameraForward).Normalized();
+    if (info.Up.Dot(this->CameraUp) < 0.)
       {
-      info.UpW = -info.UpW;
+      info.Up = -info.Up;
       }
 
     // Walk through the segment lengths to find where the center is for label
@@ -1351,9 +1155,11 @@ bool vtkLabeledContourMapper::Private::NextLabel(
     targetLength -= rAccum;
     points->GetPoint(ids[startIdx + endIdxOffset - 1], prevPoint.GetData());
     points->GetPoint(ids[startIdx + endIdxOffset], curPoint.GetData());
+    this->WorldToDisplay(prevPoint, prevPointDisplay);
+    this->WorldToDisplay(curPoint, curPointDisplay);
     vtkVector3d offset = curPoint - prevPoint;
-    double rSegmentActor = offset.Normalize();
-    offset = offset * (targetLength * rSegmentActor / rSegment);
+    double rSegmentWorld = offset.Normalize();
+    offset = offset * (targetLength * rSegmentWorld / rSegment);
     info.Position = prevPoint + offset;
 
     this->ComputeLabelInfo(info, metrics);
@@ -1374,9 +1180,7 @@ bool vtkLabeledContourMapper::Private::BuildLabel(vtkTextActor3D *actor,
                                                   const LabelInfo &info)
 
 {
-  assert(metric.Valid);
   actor->SetInput(metric.Text.c_str());
-  actor->SetTextProperty(metric.TProp);
   actor->SetPosition(const_cast<double*>(info.Position.GetData()));
 
   vtkNew<vtkTransform> xform;
@@ -1384,19 +1188,17 @@ bool vtkLabeledContourMapper::Private::BuildLabel(vtkTextActor3D *actor,
 
   xform->Translate((-info.Position).GetData());
 
-  xform->Scale(info.ScaleDisplayToActor,
-               info.ScaleDisplayToActor,
-               info.ScaleDisplayToActor);
+  xform->Scale(info.Scale, info.Scale, info.Scale);
 
-  vtkVector3d forward = info.UpA.Cross(info.RightA);
+  vtkVector3d forward = info.Up.Cross(info.Right);
   double rot[16];
-  rot[4 * 0 + 0] = info.RightA[0];
-  rot[4 * 1 + 0] = info.RightA[1];
-  rot[4 * 2 + 0] = info.RightA[2];
+  rot[4 * 0 + 0] = info.Right[0];
+  rot[4 * 1 + 0] = info.Right[1];
+  rot[4 * 2 + 0] = info.Right[2];
   rot[4 * 3 + 0] = 0;
-  rot[4 * 0 + 1] = info.UpA[0];
-  rot[4 * 1 + 1] = info.UpA[1];
-  rot[4 * 2 + 1] = info.UpA[2];
+  rot[4 * 0 + 1] = info.Up[0];
+  rot[4 * 1 + 1] = info.Up[1];
+  rot[4 * 2 + 1] = info.Up[2];
   rot[4 * 3 + 1] = 0;
   rot[4 * 0 + 2] = forward[0];
   rot[4 * 1 + 2] = forward[1];
@@ -1409,6 +1211,7 @@ bool vtkLabeledContourMapper::Private::BuildLabel(vtkTextActor3D *actor,
   xform->Concatenate(rot);
 
   xform->Translate(info.Position.GetData());
+
   actor->SetUserTransform(xform.GetPointer());
 
   return true;
@@ -1418,49 +1221,34 @@ bool vtkLabeledContourMapper::Private::BuildLabel(vtkTextActor3D *actor,
 void vtkLabeledContourMapper::Private::ComputeLabelInfo(
     LabelInfo &info, const LabelMetric &metrics)
 {
-  // Convert the right and up vectors into actor space:
-  vtkVector3d worldPosition;
-  this->ActorToWorld(info.Position, worldPosition);
-
-  vtkVector3d endW = worldPosition + info.RightW;
-  vtkVector3d endA;
-  this->WorldToActor(endW, endA);
-  info.RightA = endA - info.Position;
-
-  endW = worldPosition + info.UpW;
-  this->WorldToActor(endW, endA);
-  info.UpA = endA - info.Position;
-
   // Compute scaling factor. Use the Up vector for deltas as we know it is
   // perpendicular to the view axis:
-  vtkVector3d delta = info.UpA * (0.5 * metrics.Dimensions[0]);
-  vtkVector3d leftActor = info.Position - delta;
-  vtkVector3d rightActor = info.Position + delta;
+  vtkVector3d delta = info.Up * (0.5 * metrics.Dimensions[0]);
+  vtkVector3d leftWorld = info.Position - delta;
+  vtkVector3d rightWorld = info.Position + delta;
   vtkVector2d leftDisplay;
   vtkVector2d rightDisplay;
-  this->ActorToDisplay(leftActor, leftDisplay);
-  this->ActorToDisplay(rightActor, rightDisplay);
-  info.ScaleDisplayToActor = static_cast<double>(metrics.Dimensions[0]) /
+  this->WorldToDisplay(leftWorld, leftDisplay);
+  this->WorldToDisplay(rightWorld, rightDisplay);
+  info.Scale = static_cast<double>(metrics.Dimensions[0]) /
       (rightDisplay - leftDisplay).Norm();
 
-  // Compute the corners of the quad. Actor coordinates are used to create the
+  // Compute the corners of the quad. World coordinates are used to create the
   // stencil, display coordinates are used to detect collisions.
   // Note that we make this a little bigger (4px) than a tight bbox to give a
   // little breathing room around the text.
   vtkVector3d halfWidth =
-      ((0.5 * metrics.Dimensions[0] + 2) * info.ScaleDisplayToActor)
-      * info.RightA;
+      ((0.5 * metrics.Dimensions[0] + 2) * info.Scale) * info.Right;
   vtkVector3d halfHeight =
-      ((0.5 * metrics.Dimensions[1] + 2) * info.ScaleDisplayToActor)
-      * info.UpA;
-  info.TLa = info.Position + halfHeight - halfWidth;
-  info.TRa = info.Position + halfHeight + halfWidth;
-  info.BRa = info.Position - halfHeight + halfWidth;
-  info.BLa = info.Position - halfHeight - halfWidth;
-  this->ActorToDisplay(info.TLa, info.TLd);
-  this->ActorToDisplay(info.TRa, info.TRd);
-  this->ActorToDisplay(info.BRa, info.BRd);
-  this->ActorToDisplay(info.BLa, info.BLd);
+      ((0.5 * metrics.Dimensions[1] + 2) * info.Scale) * info.Up;
+  info.TLw = info.Position + halfHeight - halfWidth;
+  info.TRw = info.Position + halfHeight + halfWidth;
+  info.BRw = info.Position - halfHeight + halfWidth;
+  info.BLw = info.Position - halfHeight - halfWidth;
+  this->WorldToDisplay(info.TLw, info.TLd);
+  this->WorldToDisplay(info.TRw, info.TRd);
+  this->WorldToDisplay(info.BRw, info.BRd);
+  this->WorldToDisplay(info.BLw, info.BLd);
 }
 
 // Anonymous namespace for some TestOverlap helpers:
diff --git a/Rendering/Core/vtkLabeledContourMapper.h b/Rendering/Core/vtkLabeledContourMapper.h
index 34eb13b..53bcf10 100644
--- a/Rendering/Core/vtkLabeledContourMapper.h
+++ b/Rendering/Core/vtkLabeledContourMapper.h
@@ -23,8 +23,8 @@
 // render window (it is disabled by default). Otherwise the lines will be
 // drawn through the labels.
 
-#ifndef vtkLabeledContourMapper_h
-#define vtkLabeledContourMapper_h
+#ifndef __vtkLabeledContourMapper_h
+#define __vtkLabeledContourMapper_h
 
 #include "vtkRenderingCoreModule.h" // For export macro
 
@@ -32,7 +32,6 @@
 #include "vtkNew.h" // For vtkNew
 #include "vtkSmartPointer.h" // For vtkSmartPointer
 
-class vtkDoubleArray;
 class vtkTextActor3D;
 class vtkTextProperty;
 class vtkTextPropertyCollection;
@@ -70,31 +69,16 @@ public:
   // Description:
   // The text properties used to label the lines. Note that both vertical and
   // horizontal justifications will be reset to "Centered" prior to rendering.
-  //
-  // If the TextPropertyMapping array exists, then it is used to identify which
-  // text property to use for each label as follows: If the scalar value of a
-  // line is found in the mapping, the index of the value in mapping is used to
-  // lookup the text property in the collection. If there are more mapping
-  // values than properties, the properties are looped through until the
-  // mapping is exhausted.
-  //
-  // Lines with scalar values missing from the mapping are assigned text
-  // properties in a round-robin fashion starting from the beginning of the
-  // collection, repeating from the start of the collection as necessary.
+  // The collection is iterated through as the labels are generated, such that
+  // the first line (cell) in the dataset is labeled using the first text
+  // property in the collection, the second line is labeled with the second
+  // property, and so on. If the number of cells exceeds the number of
+  // properties, the property collection is repeated.
   // @sa SetTextProperty
-  // @sa SetTextPropertyMapping
   virtual void SetTextProperties(vtkTextPropertyCollection *coll);
   virtual vtkTextPropertyCollection *GetTextProperties();
 
   // Description:
-  // Values in this array correspond to vtkTextProperty objects in the
-  // TextProperties collection. If a contour line's scalar value exists in
-  // this array, the corresponding text property is used for the label.
-  // See SetTextProperties for more information.
-  virtual vtkDoubleArray* GetTextPropertyMapping();
-  virtual void SetTextPropertyMapping(vtkDoubleArray *mapping);
-
-  // Description:
   // If true, labels will be placed and drawn during rendering. Otherwise,
   // only the mapper returned by GetPolyDataMapper() will be rendered.
   // The default is to draw labels.
@@ -106,8 +90,6 @@ public:
   // The polydata mapper used to render the contours.
   vtkGetNewMacro(PolyDataMapper, vtkPolyDataMapper)
 
-  virtual void ReleaseGraphicsResources(vtkWindow *);
-
 protected:
   vtkLabeledContourMapper();
   ~vtkLabeledContourMapper();
@@ -123,7 +105,7 @@ protected:
   bool PrepareRender(vtkRenderer *ren, vtkActor *act);
   bool PlaceLabels();
   bool ResolveLabels();
-  virtual bool CreateLabels(vtkActor *actor);
+  bool CreateLabels();
   bool BuildStencilQuads();
   virtual bool ApplyStencil(vtkRenderer *ren, vtkActor *act);
   bool RenderPolyData(vtkRenderer *ren, vtkActor *act);
@@ -133,6 +115,8 @@ protected:
   bool AllocateTextActors(vtkIdType num);
   bool FreeTextActors();
 
+  vtkTextProperty* GetTextPropertyForCellId(vtkIdType cellId) const;
+
   bool LabelVisibility;
   vtkIdType NumberOfTextActors;
   vtkIdType NumberOfUsedTextActors;
@@ -140,7 +124,6 @@ protected:
 
   vtkNew<vtkPolyDataMapper> PolyDataMapper;
   vtkSmartPointer<vtkTextPropertyCollection> TextProperties;
-  vtkSmartPointer<vtkDoubleArray> TextPropertyMapping;
 
   float *StencilQuads;
   vtkIdType StencilQuadsSize;
diff --git a/Rendering/Core/vtkMapper.cxx b/Rendering/Core/vtkMapper.cxx
index afd38b2..2aaf205 100644
--- a/Rendering/Core/vtkMapper.cxx
+++ b/Rendering/Core/vtkMapper.cxx
@@ -18,14 +18,12 @@
 #include "vtkColorSeries.h"
 #include "vtkDataArray.h"
 #include "vtkDataSet.h"
-#include "vtkDoubleArray.h"
-#include "vtkDoubleArray.h"
 #include "vtkExecutive.h"
+#include "vtkLookupTable.h"
 #include "vtkFloatArray.h"
 #include "vtkImageData.h"
-#include "vtkLookupTable.h"
-#include "vtkMath.h"
 #include "vtkPointData.h"
+#include "vtkMath.h"
 #include "vtkVariantArray.h"
 
 
@@ -267,58 +265,6 @@ vtkUnsignedCharArray *vtkMapper::MapScalars(double alpha)
   return this->MapScalars(input,alpha);
 }
 
-//-----------------------------------------------------------------------------
-// Returns if we can use texture maps for scalar coloring. Note this doesn't say
-// we "will" use scalar coloring. It says, if we do use scalar coloring, we will
-// use a texture.
-// When rendering multiblock datasets, if any 2 blocks provide different
-// lookup tables for the scalars, then also we cannot use textures. This case can
-// be handled if required.
-int vtkMapper::CanUseTextureMapForColoring(vtkDataObject* input)
-{
-  if (!this->InterpolateScalarsBeforeMapping)
-    {
-    return 0; // user doesn't want us to use texture maps at all.
-    }
-
-  if (input->IsA("vtkDataSet"))
-    {
-    int cellFlag=0;
-    vtkDataSet* ds = static_cast<vtkDataSet*>(input);
-    vtkDataArray* scalars = vtkAbstractMapper::GetScalars(ds,
-      this->ScalarMode, this->ArrayAccessMode, this->ArrayId,
-      this->ArrayName, cellFlag);
-
-    if (!scalars)
-      {
-      // no scalars on  this dataset, we don't care if texture is used at all.
-      return 1;
-      }
-
-    if (cellFlag)
-      {
-      return 0; // cell data colors, don't use textures.
-      }
-
-    if ((this->ColorMode == VTK_COLOR_MODE_DEFAULT &&
-         vtkUnsignedCharArray::SafeDownCast(scalars)) ||
-        this->ColorMode == VTK_COLOR_MODE_DIRECT_SCALARS)
-      {
-      // Don't use texture is direct coloring using RGB unsigned chars is
-      // requested.
-      return 0;
-      }
-    }
-
-  if (this->LookupTable &&
-      this->LookupTable->GetIndexedLookup())
-    {
-    return 0;
-    }
-
-  return 1;
-}
-
 // a side effect of this is that this->Colors is also set
 // to the return value
 vtkUnsignedCharArray *vtkMapper::MapScalars(vtkDataSet *input,
@@ -382,10 +328,17 @@ vtkUnsignedCharArray *vtkMapper::MapScalars(vtkDataSet *input,
   // Decide betweeen texture color or vertex color.
   // Cell data always uses vertext color.
   // Only point data can use both texture and vertext coloring.
-  if (this->CanUseTextureMapForColoring(input))
-    {
-    this->MapScalarsToTexture(scalars, alpha);
-    return 0;
+  if (this->InterpolateScalarsBeforeMapping && ! cellFlag)
+    {
+    // Only use texture color if we are mapping scalars.
+    // Directly coloring with RGB unsigned chars should not use texture.
+    if (dataArray && (this->ColorMode != VTK_COLOR_MODE_DEFAULT ||
+          (vtkUnsignedCharArray::SafeDownCast(scalars)) == 0) &&
+         this->ColorMode != VTK_COLOR_MODE_DIRECT_SCALARS)
+      { // Texture color option.
+      this->MapScalarsToTexture(dataArray, alpha);
+      return 0;
+      }
     }
 
   // Vertex colors are being used.
@@ -666,18 +619,9 @@ void CreateColorTextureCoordinates(T* input, float* output,
                                    vtkIdType numScalars, int numComps,
                                    int component, double* range,
                                    const double* table_range,
-                                   int tableNumberOfColors,
                                    bool use_log_scale)
 {
-  // We have to change the range used for computing texture
-  // coordinates slightly to accomodate the special above- and
-  // below-range colors that are the first and last texels,
-  // respectively.
-  double scalar_texel_width = (range[1] - range[0]) / static_cast<double>(tableNumberOfColors);
-  double padded_range[2];
-  padded_range[0] = range[0] - scalar_texel_width;
-  padded_range[1] = range[1] + scalar_texel_width;
-  double inv_range_width = 1.0 / (padded_range[1] - padded_range[0]);
+  double inv_range_width = 1.0 / (range[1]-range[0]);
 
   if (component < 0 || component >= numComps)
     {
@@ -696,7 +640,7 @@ void CreateColorTextureCoordinates(T* input, float* output,
         magnitude = vtkLookupTable::ApplyLogScale(
           magnitude, table_range, range);
         }
-      ScalarToTextureCoordinate(magnitude, padded_range[0], inv_range_width,
+      ScalarToTextureCoordinate(magnitude, range[0], inv_range_width,
                                 output[0], output[1]);
       output += 2;
       }
@@ -712,7 +656,7 @@ void CreateColorTextureCoordinates(T* input, float* output,
         input_value = vtkLookupTable::ApplyLogScale(
           input_value, table_range, range);
         }
-      ScalarToTextureCoordinate(input_value, padded_range[0], inv_range_width,
+      ScalarToTextureCoordinate(input_value, range[0], inv_range_width,
                                 output[0], output[1]);
       output += 2;
       input = input + numComps;
@@ -722,9 +666,10 @@ void CreateColorTextureCoordinates(T* input, float* output,
 
 } // end anonymous namespace
 
+#define ColorTextureMapSize 256
 // a side effect of this is that this->ColorCoordinates and
 // this->ColorTexture are set.
-void vtkMapper::MapScalarsToTexture(vtkAbstractArray* scalars, double alpha)
+void vtkMapper::MapScalarsToTexture(vtkDataArray* scalars, double alpha)
 {
   double range[2];
   range[0] = this->LookupTable->GetRange()[0];
@@ -763,30 +708,24 @@ void vtkMapper::MapScalarsToTexture(vtkAbstractArray* scalars, double alpha)
     // Get the texture map from the lookup table.
     // Create a dummy ramp of scalars.
     // In the future, we could extend vtkScalarsToColors.
-    vtkIdType numberOfColors = this->LookupTable->GetNumberOfAvailableColors();
-    numberOfColors += 2;
-    double k = (range[1]-range[0]) / (numberOfColors-1-2);
-    vtkDoubleArray* tmp = vtkDoubleArray::New();
-    tmp->SetNumberOfTuples(numberOfColors*2);
-    double* ptr = tmp->GetPointer(0);
-    for (int i = 0; i < numberOfColors; ++i)
+    double k = (range[1]-range[0]) / (ColorTextureMapSize-1);
+    vtkFloatArray* tmp = vtkFloatArray::New();
+    tmp->SetNumberOfTuples(ColorTextureMapSize*2);
+    float* ptr = tmp->GetPointer(0);
+    for (int i = 0; i < ColorTextureMapSize; ++i)
       {
-      *ptr = range[0] + i * k - k; // minus k to start at below range color
-      if (use_log_scale)
-        {
-        *ptr = pow(10.0, *ptr);
-        }
+      *ptr = range[0] + i * k;
       ++ptr;
       }
     // Dimension on NaN.
     double nan = vtkMath::Nan();
-    for (int i = 0; i < numberOfColors; ++i)
+    for (int i = 0; i < ColorTextureMapSize; ++i)
       {
       *ptr = nan;
       ++ptr;
       }
     this->ColorTextureMap = vtkImageData::New();
-    this->ColorTextureMap->SetExtent(0,numberOfColors-1,
+    this->ColorTextureMap->SetExtent(0,ColorTextureMapSize-1,
                                      0,1, 0,0);
     this->ColorTextureMap->GetPointData()->SetScalars(
          this->LookupTable->MapScalars(tmp, this->ColorMode, 0));
@@ -838,11 +777,10 @@ void vtkMapper::MapScalarsToTexture(vtkAbstractArray* scalars, double alpha)
       {
       vtkTemplateMacro(
         CreateColorTextureCoordinates(static_cast<VTK_TT*>(input),
-          output, num, numComps,
-          scalarComponent, range,
-          this->LookupTable->GetRange(),
-          this->LookupTable->GetNumberOfAvailableColors(),
-          use_log_scale)
+                                      output, num, numComps,
+                                      scalarComponent, range,
+                                      this->LookupTable->GetRange(),
+                                      use_log_scale)
         );
       case VTK_BIT:
         vtkErrorMacro("Cannot color by bit array.");
diff --git a/Rendering/Core/vtkMapper.h b/Rendering/Core/vtkMapper.h
index 1378571..f931d2d 100644
--- a/Rendering/Core/vtkMapper.h
+++ b/Rendering/Core/vtkMapper.h
@@ -55,7 +55,6 @@
 #include "vtkRenderingCoreModule.h" // For export macro
 #include "vtkAbstractMapper3D.h"
 #include "vtkSystemIncludes.h" // For VTK_COLOR_MODE_DEFAULT and _MAP_SCALARS
-#include "vtkSmartPointer.h" // needed for vtkSmartPointer.
 
 #define VTK_RESOLVE_OFF 0
 #define VTK_RESOLVE_POLYGON_OFFSET 1
@@ -411,16 +410,6 @@ public:
   // selection.
   virtual bool GetSupportsSelection()
     { return false; }
-
-  // Description:
-  // Returns if we can use texture maps for scalar coloring. Note this doesn't
-  // say we "will" use scalar coloring. It says, if we do use scalar coloring,
-  // we will use a texture.
-  // When rendering multiblock datasets, if any 2 blocks provide different
-  // lookup tables for the scalars, then also we cannot use textures. This case
-  // can be handled if required.
-  virtual int CanUseTextureMapForColoring(vtkDataObject* input);
-
 protected:
   vtkMapper();
   ~vtkMapper();
@@ -433,7 +422,7 @@ protected:
   vtkFloatArray *ColorCoordinates;
   // 1D ColorMap used for the texture image.
   vtkImageData* ColorTextureMap;
-  void MapScalarsToTexture(vtkAbstractArray* scalars, double alpha);
+  void MapScalarsToTexture(vtkDataArray* scalars, double alpha);
 
   vtkScalarsToColors *LookupTable;
   int ScalarVisibility;
diff --git a/Rendering/Core/vtkPainterDeviceAdapter.h b/Rendering/Core/vtkPainterDeviceAdapter.h
index aea017f..4d7f284 100644
--- a/Rendering/Core/vtkPainterDeviceAdapter.h
+++ b/Rendering/Core/vtkPainterDeviceAdapter.h
@@ -158,6 +158,44 @@ public:
   // vtkRenderer.
   virtual int Compatible(vtkRenderer *renderer) = 0;
 
+#ifndef VTK_LEGACY_REMOVE
+  // Description:
+  // @deprecated code that needs access directly to OpenGL state should
+  // manage it locally.
+  // Turns lighting on and off.
+  virtual void MakeLighting(int mode) = 0;
+
+  // Description:
+  // @deprecated code that needs access directly to OpenGL state should
+  // manage it locally.
+  // Returns current lighting setting.
+  virtual int QueryLighting() = 0;
+
+  // Description:
+  // @deprecated code that needs access directly to OpenGL state should
+  // manage it locally.
+  // Turns antialiasing on and off.
+  virtual void MakeMultisampling(int mode) = 0;
+
+  // Description:
+  // @deprecated code that needs access directly to OpenGL state should
+  // manage it locally.
+  // Returns current antialiasing setting.
+  virtual int QueryMultisampling() = 0;
+
+  // Description:
+  // @deprecated code that needs access directly to OpenGL state should
+  // manage it locally.
+  // Turns blending on and off.
+  virtual void MakeBlending(int mode) = 0;
+
+  // Description:
+  // @deprecated code that needs access directly to OpenGL state should
+  // manage it locally.
+  // Returns current blending setting.
+  virtual int QueryBlending() = 0;
+#endif
+
   // Description:
   // Turns emphasis of vertices on or off for vertex selection.
   virtual void MakeVertexEmphasis(bool mode) = 0;
diff --git a/Rendering/Core/vtkPointGaussianMapper.cxx b/Rendering/Core/vtkPointGaussianMapper.cxx
index b9b2890..1c556de 100644
--- a/Rendering/Core/vtkPointGaussianMapper.cxx
+++ b/Rendering/Core/vtkPointGaussianMapper.cxx
@@ -22,8 +22,6 @@ vtkAbstractObjectFactoryNewMacro(vtkPointGaussianMapper)
 vtkPointGaussianMapper::vtkPointGaussianMapper()
 {
   this->ScaleArray = 0;
-  this->DefaultRadius = 1.0;
-  this->Emissive = 1;
 }
 
 //-----------------------------------------------------------------------------
@@ -39,5 +37,4 @@ void vtkPointGaussianMapper::PrintSelf(ostream& os, vtkIndent indent)
 
   os << indent << "Scale Array: " << (this->ScaleArray ? this->ScaleArray : "(none)") << "\n";
   os << indent << "Default Radius: " << this->DefaultRadius << "\n";
-  os << indent << "Emissive: " << this->Emissive << "\n";
 }
diff --git a/Rendering/Core/vtkPointGaussianMapper.h b/Rendering/Core/vtkPointGaussianMapper.h
index 1a7aa02..3215caa 100644
--- a/Rendering/Core/vtkPointGaussianMapper.h
+++ b/Rendering/Core/vtkPointGaussianMapper.h
@@ -14,11 +14,10 @@
 // .NAME vtkPointGaussianMapper - draw PointGaussians using imposters
 // .SECTION Description
 // An  mapper that uses imposters to draw PointGaussians. Supports
-// transparency and picking as well. It draws all the points and
-// does not require or look at any cell arrays
+// transparency and picking as well.
 
-#ifndef vtkPointGaussianMapper_h
-#define vtkPointGaussianMapper_h
+#ifndef __vtkPointGaussianMapper_h
+#define __vtkPointGaussianMapper_h
 
 #include "vtkRenderingCoreModule.h" // For export macro
 #include "vtkPolyDataMapper.h"
@@ -37,25 +36,16 @@ public:
 
   // Description:
   // Set the default radius of the point gaussians.  This is used if the
-  // array to scale with has not been set or is set to NULL. If there
-  // is no scale array and the default radius is set to zero then
-  // the splats wil be rendered as simple points requiring less memory.
+  // array to scale with has not been set or is set to NULL.
   vtkSetMacro(DefaultRadius,double);
   vtkGetMacro(DefaultRadius,double);
 
-  // Description:
-  // Treat the points/splats as emissive light sources. The default is true.
-  vtkSetMacro(Emissive, int);
-  vtkGetMacro(Emissive, int);
-  vtkBooleanMacro(Emissive, int);
-
 protected:
   vtkPointGaussianMapper();
   ~vtkPointGaussianMapper();
 
   char *ScaleArray;
   double DefaultRadius;
-  int Emissive;
 
 private:
   vtkPointGaussianMapper(const vtkPointGaussianMapper&); // Not implemented.
diff --git a/Rendering/Core/vtkProp.h b/Rendering/Core/vtkProp.h
index 3a29cea..39a6b7d 100644
--- a/Rendering/Core/vtkProp.h
+++ b/Rendering/Core/vtkProp.h
@@ -148,6 +148,14 @@ public:
   virtual bool HasKeys(vtkInformation *requiredKeys);
 
   // Description:
+  // Props may provide a mapping from picked value to actual value
+  // This is useful for hardware based pickers where
+  // there is a mapping between the color in the buffer
+  // and the actual pick value
+  virtual vtkIdType GetConvertedPickValue(vtkIdType idIn,
+      int vtkNotUsed(fieldassociation)) { return idIn; }
+
+  // Description:
   // Optional Key Indicating the texture unit for general texture mapping
   // Old OpenGL was a state machine where you would push or pop
   // items. The new OpenGL design is more mapper centric. Some
diff --git a/Rendering/Core/vtkProp3D.cxx b/Rendering/Core/vtkProp3D.cxx
index cf5bdce..484d724 100644
--- a/Rendering/Core/vtkProp3D.cxx
+++ b/Rendering/Core/vtkProp3D.cxx
@@ -421,7 +421,6 @@ void vtkProp3D::ComputeMatrix()
 
     this->Transform->PreMultiply();
     this->Transform->GetMatrix(this->Matrix);
-    this->Matrix->Modified();
     this->MatrixMTime.Modified();
     this->Transform->Pop();
     }
@@ -566,25 +565,22 @@ void vtkProp3D::PokeMatrix(vtkMatrix4x4 *matrix)
     }
   else //we restore our original state
     {
-      if( this->CachedProp3D != NULL )
-        {
-          this->CachedProp3D->GetOrigin(this->Origin);
-          this->CachedProp3D->GetPosition(this->Position);
-          this->CachedProp3D->GetScale(this->Scale);
-          if ( this->CachedProp3D->UserTransform &&
-               this->CachedProp3D->UserTransform->GetMatrix() ==
-               this->CachedProp3D->UserMatrix )
-            {
-            this->SetUserTransform(this->CachedProp3D->UserTransform);
-            }
-          else
-            {
-            this->SetUserMatrix(this->CachedProp3D->UserMatrix);
-            }
-          this->CachedProp3D->SetUserTransform(NULL);
-          this->Transform->SetMatrix(this->CachedProp3D->Transform->GetMatrix());
-          this->Modified();
-        }
+    this->CachedProp3D->GetOrigin(this->Origin);
+    this->CachedProp3D->GetPosition(this->Position);
+    this->CachedProp3D->GetScale(this->Scale);
+    if ( this->CachedProp3D->UserTransform &&
+         this->CachedProp3D->UserTransform->GetMatrix() ==
+         this->CachedProp3D->UserMatrix )
+      {
+      this->SetUserTransform(this->CachedProp3D->UserTransform);
+      }
+    else
+      {
+      this->SetUserMatrix(this->CachedProp3D->UserMatrix);
+      }
+    this->CachedProp3D->SetUserTransform(NULL);
+    this->Transform->SetMatrix(this->CachedProp3D->Transform->GetMatrix());
+    this->Modified();
     }
 }
 
diff --git a/Rendering/Core/vtkRenderWindow.cxx b/Rendering/Core/vtkRenderWindow.cxx
index 729b60e..9ab5d45 100644
--- a/Rendering/Core/vtkRenderWindow.cxx
+++ b/Rendering/Core/vtkRenderWindow.cxx
@@ -85,6 +85,9 @@ vtkRenderWindow::vtkRenderWindow()
   this->AnaglyphColorMask[0] = 4;  // red
   this->AnaglyphColorMask[1] = 3;  // cyan
   this->PainterDeviceAdapter = NULL;
+#ifndef VTK_LEGACY_REMOVE
+  this->ReportGraphicErrors = 0; // false
+#endif
   this->AbortCheckTime = 0.0;
   this->CapturingGL2PSSpecialProps = 0;
   this->MultiSamples = 0;
@@ -786,10 +789,7 @@ void vtkRenderWindow::DoStereoRender()
           {
           aren->ResetCamera();
           }
-        if (this->StereoType != VTK_STEREO_FAKE)
-          {
-          aren->GetActiveCamera()->SetLeftEye(0);
-          }
+        aren->GetActiveCamera()->SetLeftEye(0);
         }
       this->Renderers->Render();
       }
@@ -913,9 +913,55 @@ void vtkRenderWindow::PrintSelf(ostream& os, vtkIndent indent)
   os << indent << "MultiSamples: " << this->MultiSamples << "\n";
   os << indent << "StencilCapable: " <<
     (this->StencilCapable ? "True" : "False") << endl;
+#ifndef VTK_LEGACY_REMOVE
+  os << indent << "ReportGraphicErrors: "
+     << (this->ReportGraphicErrors ? "On" : "Off")<< "\n";
+#endif
+}
+
+#ifndef VTK_LEGACY_REMOVE
+//----------------------------------------------------------------------------
+void vtkRenderWindow::SetReportGraphicErrors(int val)
+{
+  VTK_LEGACY_BODY(vtkRenderWindow::SetReportGraphicsErrors, "VTK 6.1");
+  if (this->ReportGraphicErrors != val)
+    {
+    this->ReportGraphicErrors = val;
+    this->Modified();
+    }
+}
+
+//----------------------------------------------------------------------------
+void vtkRenderWindow::SetReportGraphicErrorsOn()
+{
+  VTK_LEGACY_BODY(vtkRenderWindow::SetReportGraphicsErrorsOn, "VTK 6.1");
+  if (this->ReportGraphicErrors == 0)
+    {
+    this->ReportGraphicErrors = 1;
+    this->Modified();
+    }
 }
 
 //----------------------------------------------------------------------------
+void vtkRenderWindow::SetReportGraphicErrorsOff()
+{
+  VTK_LEGACY_BODY(vtkRenderWindow::GetReportGraphicsErrorsOff, "VTK 6.1");
+  if (this->ReportGraphicErrors != 0)
+    {
+    this->ReportGraphicErrors = 0;
+    this->Modified();
+    }
+}
+
+//----------------------------------------------------------------------------
+int vtkRenderWindow::GetReportGraphicErrors()
+{
+  VTK_LEGACY_BODY(vtkRenderWindow::GetReportGraphicsErrors, "VTK 6.1");
+  return this->ReportGraphicErrors;
+}
+#endif
+
+//----------------------------------------------------------------------------
 // Update the system, if needed, due to stereo rendering. For some stereo
 // methods, subclasses might need to switch some hardware settings here.
 void vtkRenderWindow::StereoUpdate(void)
@@ -1483,8 +1529,6 @@ const char *vtkRenderWindow::GetStereoTypeAsString()
       return "Checkerboard";
     case VTK_STEREO_SPLITVIEWPORT_HORIZONTAL:
       return "SplitViewportHorizontal";
-    case VTK_STEREO_FAKE:
-      return "Fake";
     default:
       return "";
   }
diff --git a/Rendering/Core/vtkRenderWindow.h b/Rendering/Core/vtkRenderWindow.h
index bf6533d..f674c46 100644
--- a/Rendering/Core/vtkRenderWindow.h
+++ b/Rendering/Core/vtkRenderWindow.h
@@ -60,7 +60,6 @@ class vtkUnsignedCharArray;
 #define VTK_STEREO_ANAGLYPH     7
 #define VTK_STEREO_CHECKERBOARD 8
 #define VTK_STEREO_SPLITVIEWPORT_HORIZONTAL 9
-#define VTK_STEREO_FAKE 10
 
 #define VTK_CURSOR_DEFAULT   0
 #define VTK_CURSOR_ARROW     1
@@ -74,6 +73,25 @@ class vtkUnsignedCharArray;
 #define VTK_CURSOR_HAND      9
 #define VTK_CURSOR_CROSSHAIR 10
 
+#ifndef VTK_LEGACY_REMOVE
+// This macro should not be used, see vtkOpenGLError.h for
+// GL error handling functions and macros.
+#if defined NDEBUG
+# define vtkGraphicErrorMacro(renderWindow,message)   \
+  renderWindow->CheckGraphicError();
+#else
+# define vtkGraphicErrorMacro(renderWindow,message)   \
+  renderWindow->CheckGraphicError();                  \
+  if ( renderWindow->GetReportGraphicErrors()         \
+    && renderWindow->HasGraphicError() )              \
+    {                                                 \
+    vtkErrorMacro(                                    \
+      << message << " "                               \
+      << renderWindow->GetLastGraphicErrorString());  \
+    }
+# endif
+#endif
+
 class VTKRENDERINGCORE_EXPORT vtkRenderWindow : public vtkWindow
 {
 public:
@@ -233,10 +251,7 @@ public:
   // image where horizontal lines alternate between left and right
   // views.  StereoLeft and StereoRight modes choose one or the other
   // stereo view.  Dresden mode is yet another stereoscopic
-  // interleaving. Fake simply causes the window to render twice without
-  // actually swapping the camera from left eye to right eye. This is useful in
-  // certain applications that want to emulate the rendering passes without
-  // actually rendering in stereo mode.
+  // interleaving.
   vtkGetMacro(StereoType,int);
   vtkSetMacro(StereoType,int);
   void SetStereoTypeToCrystalEyes()
@@ -257,8 +272,6 @@ public:
     {this->SetStereoType(VTK_STEREO_CHECKERBOARD);}
   void SetStereoTypeToSplitViewportHorizontal()
     {this->SetStereoType(VTK_STEREO_SPLITVIEWPORT_HORIZONTAL);}
-  void SetStereoTypeToFake()
-    {this->SetStereoType(VTK_STEREO_FAKE);}
 
   const char *GetStereoTypeAsString();
 
@@ -552,6 +565,24 @@ public:
   vtkGetMacro(StencilCapable, int);
   vtkBooleanMacro(StencilCapable, int);
 
+  // Description:
+  // @deprecated Replaced by
+  // the CMakeLists variable VTK_REPORT_OPENGL_ERRORS
+  // error reporting is enabled/disabled at compile time
+  VTK_LEGACY(void SetReportGraphicErrors(int val));
+  VTK_LEGACY(void SetReportGraphicErrorsOn());
+  VTK_LEGACY(void SetReportGraphicErrorsOff());
+  VTK_LEGACY(int GetReportGraphicErrors());
+
+#ifndef VTK_LEGACY_REMOVE
+  // Description:
+  // @deprecated Replaced by
+  // vtkOpenGLCheckErrorMacro
+  virtual void CheckGraphicError() = 0;
+  virtual int HasGraphicError() = 0;
+  virtual const char *GetLastGraphicErrorString() = 0;
+#endif
+
 protected:
   vtkRenderWindow();
   ~vtkRenderWindow();
@@ -599,6 +630,14 @@ protected:
   int StencilCapable;
   int CapturingGL2PSSpecialProps;
 
+#ifndef VTK_LEGACY_REMOVE
+  // Description:
+  // @deprecated Replaced by
+  // the CMakeLists variable VTK_REPORT_OPENGL_ERRORS
+  // error reporting is enabled/disabled at compile time
+  int ReportGraphicErrors;
+#endif
+
   // Description:
   // The universal time since the last abort check occurred.
   double AbortCheckTime;
diff --git a/Rendering/Core/vtkRenderer.cxx b/Rendering/Core/vtkRenderer.cxx
index cb67605..12633e9 100644
--- a/Rendering/Core/vtkRenderer.cxx
+++ b/Rendering/Core/vtkRenderer.cxx
@@ -87,7 +87,6 @@ vtkRenderer::vtkRenderer()
   this->PathArrayCount = 0;
 
   this->Layer                    = 0;
-  this->PreserveColorBuffer = 0;
   this->PreserveDepthBuffer = 0;
 
   this->ComputedVisiblePropBounds[0] = VTK_DOUBLE_MAX;
@@ -620,19 +619,6 @@ vtkWindow *vtkRenderer::GetVTKWindow()
   return this->RenderWindow;
 }
 
-// ----------------------------------------------------------------------------
-void vtkRenderer::SetLayer(int layer)
-{
-  vtkDebugMacro(<< this->GetClassName() << " (" << this
-                << "): setting Layer to " << layer);
-  if (this->Layer != layer)
-    {
-    this->Layer = layer;
-    this->Modified();
-    }
-  this->SetPreserveColorBuffer(layer == 0 ? 0 : 1);
-}
-
 // Specify the camera to use for this renderer.
 void vtkRenderer::SetActiveCamera(vtkCamera *cam)
 {
@@ -1365,8 +1351,6 @@ void vtkRenderer::PrintSelf(ostream& os, vtkIndent indent)
   os << indent << "Layer = " << this->Layer << "\n";
   os << indent << "PreserveDepthBuffer: " <<
     (this->PreserveDepthBuffer? "On" : "Off") << "\n";
-  os << indent << "PreserveColorBuffer: " <<
-    (this->PreserveColorBuffer? "On" : "Off") << "\n";
   os << indent << "Interactive = " << (this->Interactive ? "On" : "Off")
      << "\n";
 
@@ -1835,7 +1819,8 @@ void vtkRenderer::ExpandBounds(double bounds[6], vtkMatrix4x4 *matrix)
 
 int  vtkRenderer::Transparent()
 {
-  return this->PreserveColorBuffer;
+  // If our layer is the 0th layer, then we are not transparent, else we are.
+  return (this->Layer == 0 ? 0 : 1);
 }
 
 double vtkRenderer::GetTiledAspectRatio()
diff --git a/Rendering/Core/vtkRenderer.h b/Rendering/Core/vtkRenderer.h
index 70b2ced..225f057 100644
--- a/Rendering/Core/vtkRenderer.h
+++ b/Rendering/Core/vtkRenderer.h
@@ -339,32 +339,12 @@ public:
   // Description:
   // Set/Get the layer that this renderer belongs to.  This is only used if
   // there are layered renderers.
-  //
-  // Note: Changing the layer will update the PreserveColorBuffer setting. If
-  // the layer is 0, PreserveColorBuffer will be set to false, making the
-  // bottom renderer opaque. If the layer is non-zero, PreserveColorBuffer will
-  // be set to true, giving the renderer a transparent background. If other
-  // PreserveColorBuffer configurations are desired, they must be adjusted after
-  // the layer is set.
-  virtual void SetLayer(int layer);
+  vtkSetMacro(Layer, int);
   vtkGetMacro(Layer, int);
 
   // Description:
-  // By default, the renderer at layer 0 is opaque, and all non-zero layer
-  // renderers are transparent. This flag allows this behavior to be overridden.
-  // If true, this setting will force the renderer to preserve the existing
-  // color buffer regardless of layer. If false, it will always be cleared at
-  // the start of rendering.
-  //
-  // This flag influences the Transparent() method, and is updated by calls to
-  // SetLayer(). For this reason it should only be set after changing the layer.
-  vtkGetMacro(PreserveColorBuffer, int);
-  vtkSetMacro(PreserveColorBuffer, int);
-  vtkBooleanMacro(PreserveColorBuffer, int);
-
-  // Description:
-  // By default, the depth buffer is reset for each renderer. If this flag is
-  // true, this renderer will use the existing depth buffer for its rendering.
+  // Normally a renderer is treated as transparent if Layer > 0. To treat a
+  // renderer at Layer 0 as transparent, set this flag to true.
   vtkSetMacro(PreserveDepthBuffer, int);
   vtkGetMacro(PreserveDepthBuffer, int);
   vtkBooleanMacro(PreserveDepthBuffer, int);
@@ -495,7 +475,7 @@ public:
   // Description:
   // Set/Get the texture to be used for the background. If set
   // and enabled this gets the priority over the gradient background.
-  virtual void SetBackgroundTexture(vtkTexture*);
+  void SetBackgroundTexture(vtkTexture*);
   vtkGetObjectMacro(BackgroundTexture, vtkTexture);
 
   // Description:
@@ -569,7 +549,6 @@ protected:
   // Shows what layer this renderer belongs to.  Only of interested when
   // there are layered renderers.
   int                Layer;
-  int                PreserveColorBuffer;
   int                PreserveDepthBuffer;
 
   // Holds the result of ComputeVisiblePropBounds so that it is visible from
diff --git a/Rendering/Core/vtkStringToImage.h b/Rendering/Core/vtkStringToImage.h
index 36b05de..33636f4 100644
--- a/Rendering/Core/vtkStringToImage.h
+++ b/Rendering/Core/vtkStringToImage.h
@@ -49,9 +49,9 @@ public:
   // is valid (it may not if GetBoundingBox() failed or if the string
   // was empty).
   virtual vtkVector2i GetBounds(vtkTextProperty *property,
-                                const vtkUnicodeString& string, int dpi) = 0;
+                                const vtkUnicodeString& string) = 0;
   virtual vtkVector2i GetBounds(vtkTextProperty *property,
-                                const vtkStdString& string, int dpi) = 0;
+                                const vtkStdString& string) = 0;
 
   // Description:
   // Given a text property and a string, this function initializes the
@@ -60,11 +60,11 @@ public:
   // This is useful when ScaleToPowerOfTwo is true, and the image dimensions may
   // not match the dimensions of the rendered text.
   virtual int RenderString(vtkTextProperty *property,
-                           const vtkUnicodeString& string, int dpi,
+                           const vtkUnicodeString& string,
                            vtkImageData *data,
                            int textDims[2] = NULL) = 0;
   virtual int RenderString(vtkTextProperty *property,
-                           const vtkStdString& string, int dpi,
+                           const vtkStdString& string,
                            vtkImageData *data,
                            int text_dims[2] = NULL) = 0;
 
diff --git a/Rendering/Core/vtkTextActor.cxx b/Rendering/Core/vtkTextActor.cxx
index 8f4e872..41a6ef6 100644
--- a/Rendering/Core/vtkTextActor.cxx
+++ b/Rendering/Core/vtkTextActor.cxx
@@ -29,7 +29,6 @@
 #include "vtkMath.h"
 #include "vtkTextRenderer.h"
 #include "vtkRenderer.h"
-#include "vtkRenderWindow.h"
 
 #include <algorithm>
 
@@ -102,7 +101,6 @@ vtkTextActor::vtkTextActor()
   this->InputRendered = false;
 
   this->FormerOrientation = 0.0;
-  this->RenderedDPI = 0;
 
   this->TextRenderer = vtkTextRenderer::GetInstance();
   if (!this->TextRenderer)
@@ -119,7 +117,10 @@ vtkTextActor::~vtkTextActor()
   this->SetTextProperty(NULL);
   this->ScaledTextProperty->Delete();
   this->ScaledTextProperty = NULL;
-  delete [] this->Input;
+  if(this->Input)
+    {
+    delete [] this->Input;
+    }
   this->Rectangle->Delete();
   this->Rectangle = 0;
   this->RectanglePoints->Delete();
@@ -177,8 +178,7 @@ int vtkTextActor::SetConstrainedFontSize(vtkViewport* viewport,
                                           int targetWidth,
                                           int targetHeight)
 {
-  return this->SetConstrainedFontSize(this, viewport, targetWidth,
-                                      targetHeight);
+  return this->SetConstrainedFontSize(this, viewport, targetWidth, targetHeight);
 }
 
 
@@ -333,43 +333,26 @@ void vtkTextActor::SetNonLinearFontScale(double exp, int tgt)
 }
 
 // ----------------------------------------------------------------------------
-bool vtkTextActor::RenderImage(vtkTextProperty *tprop, vtkViewport *vp)
+bool vtkTextActor::RenderImage(vtkTextProperty *tprop, vtkViewport *)
 {
   vtkStdString text;
   if (this->Input && this->Input[0])
     {
     text = this->Input;
     }
-
-  vtkWindow *win = vp->GetVTKWindow();
-  if (!win)
-    {
-    vtkErrorMacro(<<"No render window available: cannot determine DPI.");
-    return false;
-    }
-
-  return this->TextRenderer->RenderString(tprop, text, this->ImageData,
-                                          NULL, win->GetDPI());
+  return this->TextRenderer->RenderString(tprop, text, this->ImageData);
 }
 
 // ----------------------------------------------------------------------------
-bool vtkTextActor::GetImageBoundingBox(vtkTextProperty *tprop, vtkViewport *vp,
-                                       int bbox[4])
+bool vtkTextActor::GetImageBoundingBox(vtkTextProperty *tprop, vtkViewport *,
+                                  int bbox[4])
 {
   vtkStdString text;
   if (this->Input && this->Input[0])
     {
     text = this->Input;
     }
-
-  vtkWindow *win = vp->GetVTKWindow();
-  if (!win)
-    {
-    vtkErrorMacro(<<"No render window available: cannot determine DPI.");
-    return false;
-    }
-
-  return this->TextRenderer->GetBoundingBox(tprop, text, bbox, win->GetDPI());
+  return this->TextRenderer->GetBoundingBox(tprop, text, bbox);
 }
 
 // ----------------------------------------------------------------------------
@@ -377,7 +360,9 @@ void vtkTextActor::SetInput(const char* str)
 {
   if(!str)
     {
-    str = "";
+      vtkErrorMacro(
+        <<"vtkTextActor::SetInput was passed an uninitialized string");
+    return;
     }
   if(this->Input)
     {
@@ -449,7 +434,7 @@ void vtkTextActor::ReleaseGraphicsResources(vtkWindow *win)
 // ----------------------------------------------------------------------------
 int vtkTextActor::RenderOverlay(vtkViewport *viewport)
 {
-  if (!this->Visibility || !this->Input || !this->Input[0])
+  if (!this->Visibility)
     {
     return 0;
     }
@@ -738,16 +723,9 @@ void vtkTextActor::ComputeScaledFont(vtkViewport *viewport)
           }
         int max_height = static_cast<int>(this->MaximumLineHeight * size[1]);
 
-        vtkWindow *win = viewport->GetVTKWindow();
-        if (!win)
-          {
-          vtkErrorMacro(<<"No render window available: cannot determine DPI.");
-          return;
-          }
-
         int fsize = this->TextRenderer->GetConstrainedFontSize(
           this->Input, this->ScaledTextProperty, size[0],
-          (size[1] < max_height ? size[1] : max_height), win->GetDPI());
+          (size[1] < max_height ? size[1] : max_height));
 
         if (fsize == -1)
           {
@@ -887,17 +865,9 @@ int vtkTextActor::UpdateRectangle(vtkViewport* viewport)
     this->ComputeScaledFont(viewport);
     }
 
-  vtkWindow *win = viewport->GetVTKWindow();
-  if (!win)
-    {
-    vtkErrorMacro(<<"No render window available: cannot determine DPI.");
-    return 0;
-    }
-
   //check if we need to render the string
   if(this->ScaledTextProperty->GetMTime() > this->BuildTime ||
-    !this->InputRendered || this->GetMTime() > this->BuildTime ||
-     this->RenderedDPI != win->GetDPI())
+    !this->InputRendered || this->GetMTime() > this->BuildTime)
     {
     if(!this->RenderImage(this->ScaledTextProperty, viewport))
       {
@@ -914,7 +884,6 @@ int vtkTextActor::UpdateRectangle(vtkViewport* viewport)
     this->Texture->SetInputData(this->ImageData);
     this->Texture->Modified();
     this->InputRendered = true;
-    this->RenderedDPI = win->GetDPI();
     this->BuildTime.Modified();
     }
   return 1;
@@ -933,19 +902,14 @@ void vtkTextActor::SpecifiedToDisplay(double *pos, vtkViewport *vport,
   {
   case VTK_WORLD:
     vport->WorldToView(pos[0], pos[1], pos[2]);
-    VTK_FALLTHROUGH;
   case VTK_VIEW:
     vport->ViewToNormalizedViewport(pos[0], pos[1], pos[2]);
-    VTK_FALLTHROUGH;
   case VTK_NORMALIZED_VIEWPORT:
     vport->NormalizedViewportToViewport(pos[0], pos[1]);
-    VTK_FALLTHROUGH;
   case VTK_VIEWPORT:
     vport->ViewportToNormalizedDisplay(pos[0], pos[1]);
-    VTK_FALLTHROUGH;
   case VTK_NORMALIZED_DISPLAY:
     vport->NormalizedDisplayToDisplay(pos[0], pos[1]);
-    VTK_FALLTHROUGH;
   case VTK_DISPLAY:
     break;
   }
diff --git a/Rendering/Core/vtkTextActor.h b/Rendering/Core/vtkTextActor.h
index 4eff5b5..4dd477d 100644
--- a/Rendering/Core/vtkTextActor.h
+++ b/Rendering/Core/vtkTextActor.h
@@ -265,7 +265,6 @@ protected:
   char *Input;
   bool InputRendered;
   double FormerOrientation;
-  int RenderedDPI;
 
   vtkTextProperty *ScaledTextProperty;
 
diff --git a/Rendering/Core/vtkTextActor3D.cxx b/Rendering/Core/vtkTextActor3D.cxx
index 4dab157..273c270 100644
--- a/Rendering/Core/vtkTextActor3D.cxx
+++ b/Rendering/Core/vtkTextActor3D.cxx
@@ -116,8 +116,7 @@ int vtkTextActor3D::GetBoundingBox(int bbox[4])
     return 0;
     }
 
-  if (!tRend->GetBoundingBox(this->TextProperty, this->Input, bbox,
-                             vtkTextActor3D::GetRenderedDPI()))
+  if (!tRend->GetBoundingBox(this->TextProperty, this->Input, bbox))
     {
     vtkErrorMacro(<<"No text in input.");
     return 0;
@@ -138,9 +137,19 @@ int vtkTextActor3D::RenderOverlay(vtkViewport *viewport)
 {
   int rendered_something = 0;
 
-  if (this->UpdateImageActor() &&
-      this->ImageData &&
-      this->ImageData->GetNumberOfPoints() > 0)
+  // Is the viewport's RenderWindow capturing GL2PS-special props?
+  if (vtkRenderer *renderer = vtkRenderer::SafeDownCast(viewport))
+    {
+    if (vtkRenderWindow *renderWindow = renderer->GetRenderWindow())
+      {
+      if (renderWindow->GetCapturingGL2PSSpecialProps())
+        {
+        renderer->CaptureGL2PSSpecialProp(this);
+        }
+      }
+    }
+
+  if (this->UpdateImageActor())
     {
     rendered_something += this->ImageActor->RenderOverlay(viewport);
     }
@@ -153,9 +162,7 @@ int vtkTextActor3D::RenderTranslucentPolygonalGeometry(vtkViewport *viewport)
 {
   int rendered_something = 0;
 
-  if (this->UpdateImageActor() &&
-      this->ImageData &&
-      this->ImageData->GetNumberOfPoints() > 0)
+  if (this->UpdateImageActor())
     {
     rendered_something +=
       this->ImageActor->RenderTranslucentPolygonalGeometry(viewport);
@@ -169,7 +176,14 @@ int vtkTextActor3D::RenderTranslucentPolygonalGeometry(vtkViewport *viewport)
 // Does this prop have some translucent polygonal geometry?
 int vtkTextActor3D::HasTranslucentPolygonalGeometry()
 {
-  return 1;
+  int result = 0;
+
+  if (this->UpdateImageActor())
+    {
+    result=this->ImageActor->HasTranslucentPolygonalGeometry();
+    }
+
+  return result;
 }
 
 // --------------------------------------------------------------------------
@@ -177,20 +191,7 @@ int vtkTextActor3D::RenderOpaqueGeometry(vtkViewport *viewport)
 {
   int rendered_something = 0;
 
-  if (vtkRenderer *renderer = vtkRenderer::SafeDownCast(viewport))
-    {
-    if (vtkRenderWindow *renderWindow = renderer->GetRenderWindow())
-      {
-      // Is the viewport's RenderWindow capturing GL2PS-special props?
-      if (renderWindow->GetCapturingGL2PSSpecialProps())
-        {
-        renderer->CaptureGL2PSSpecialProp(this);
-        }
-      }
-    }
-
-  if (this->UpdateImageActor() &&
-      this->ImageData && this->ImageData->GetNumberOfPoints() > 0)
+  if (this->UpdateImageActor())
     {
     rendered_something += this->ImageActor->RenderOpaqueGeometry(viewport);
     }
@@ -205,7 +206,6 @@ int vtkTextActor3D::UpdateImageActor()
   if (!this->TextProperty)
     {
     vtkErrorMacro(<<"Need a text property to render text actor");
-    this->ImageActor->SetInputData(0);
     return 0;
     }
 
@@ -216,10 +216,6 @@ int vtkTextActor3D::UpdateImageActor()
     return 1;
     }
 
-  // copy information to the delegate
-  vtkInformation *info = this->GetPropertyKeys();
-  this->ImageActor->SetPropertyKeys(info);
-
   // Do we need to (re-)render the text ?
   // Yes if:
   //  - instance has been modified since last build
@@ -243,15 +239,12 @@ int vtkTextActor3D::UpdateImageActor()
     if (!tRend)
       {
       vtkErrorMacro(<<"Failed getting the TextRenderer instance.");
-      this->ImageActor->SetInputData(0);
       return 0;
       }
 
-    if (!tRend->RenderString(this->TextProperty, this->Input, this->ImageData,
-                             NULL, vtkTextActor3D::GetRenderedDPI()))
+    if (!tRend->RenderString(this->TextProperty, this->Input, this->ImageData))
       {
       vtkErrorMacro(<<"Failed rendering text to buffer");
-      this->ImageActor->SetInputData(0);
       return 0;
       }
 
diff --git a/Rendering/Core/vtkTextActor3D.h b/Rendering/Core/vtkTextActor3D.h
index 2f13423..07544c3 100644
--- a/Rendering/Core/vtkTextActor3D.h
+++ b/Rendering/Core/vtkTextActor3D.h
@@ -55,13 +55,6 @@ public:
   vtkGetObjectMacro(TextProperty,vtkTextProperty);
 
   // Description:
-  // Since a 3D text actor is not pixel-aligned and positioned in 3D space,
-  // the text is rendered at a constant DPI, rather than using the current
-  // window DPI. This static method returns the DPI value used to produce the
-  // text images.
-  static int GetRenderedDPI() { return 72; }
-
-  // Description:
   // Shallow copy of this text actor. Overloads the virtual
   // vtkProp method.
   void ShallowCopy(vtkProp *prop);
@@ -72,10 +65,10 @@ public:
   void GetBounds(double bounds[6]) {this->vtkProp3D::GetBounds( bounds );}
 
   // Description:
-  // Get the vtkTextRenderer-derived bounding box for the given vtkTextProperty
+  // Get the Freetype-derived real bounding box for the given vtkTextProperty
   // and text string str.  Results are returned in the four element bbox int
   // array.  This call can be used for sizing other elements.
-  int GetBoundingBox(int bbox[4]);
+  virtual int GetBoundingBox(int bbox[4]);
 
   //BTX
   // Description:
diff --git a/Rendering/Core/vtkTextMapper.cxx b/Rendering/Core/vtkTextMapper.cxx
index be4a968..6267626 100644
--- a/Rendering/Core/vtkTextMapper.cxx
+++ b/Rendering/Core/vtkTextMapper.cxx
@@ -29,7 +29,6 @@
 #include "vtkTextProperty.h"
 #include "vtkTextRenderer.h"
 #include "vtkTexture.h"
-#include "vtkWindow.h"
 
 #include <algorithm>
 
@@ -45,8 +44,6 @@ vtkTextMapper::vtkTextMapper()
   this->Input = NULL;
   this->TextProperty = NULL;
 
-  this->RenderedDPI = 0;
-
   vtkNew<vtkTextProperty> tprop;
   this->SetTextProperty(tprop.GetPointer());
 
@@ -131,17 +128,9 @@ void vtkTextMapper::PrintSelf(ostream& os, vtkIndent indent)
 }
 
 //----------------------------------------------------------------------------
-void vtkTextMapper::GetSize(vtkViewport *vp, int size[2])
+void vtkTextMapper::GetSize(vtkViewport *, int size[])
 {
-  vtkWindow *win = vp ? vp->GetVTKWindow() : NULL;
-  if (!win)
-    {
-    size[0] = size[1] = 0;
-    vtkErrorMacro(<<"No render window available: cannot determine DPI.");
-    return;
-    }
-
-  this->UpdateImage(win->GetDPI());
+  UpdateImage();
   size[0] = this->TextDims[0];
   size[1] = this->TextDims[1];
 }
@@ -172,8 +161,7 @@ int vtkTextMapper::SetConstrainedFontSize(vtkViewport *viewport,
 
 
 //----------------------------------------------------------------------------
-int vtkTextMapper::SetConstrainedFontSize(vtkTextMapper *tmapper,
-                                          vtkViewport *viewport,
+int vtkTextMapper::SetConstrainedFontSize(vtkTextMapper *tmapper, vtkViewport *viewport,
                                           int targetWidth, int targetHeight)
 {
   // If target "empty" just return
@@ -357,28 +345,13 @@ int vtkTextMapper::SetMultipleRelativeFontSize(vtkViewport *viewport,
 //----------------------------------------------------------------------------
 void vtkTextMapper::RenderOverlay(vtkViewport *viewport, vtkActor2D *actor)
 {
-  // This is neccessary for GL2PS exports when this actor/mapper are part of an
-  // composite actor/mapper.
-  if (!actor->GetVisibility())
-    {
-    return;
-    }
-
   vtkDebugMacro(<<"RenderOverlay called");
 
   vtkRenderer *ren = NULL;
   if (this->Input && this->Input[0])
     {
-    vtkWindow *win = viewport->GetVTKWindow();
-    if (!win)
-      {
-      vtkErrorMacro(<<"No render window available: cannot determine DPI.");
-      return;
-      }
-
-    this->UpdateImage(win->GetDPI());
-    this->UpdateQuad(actor, win->GetDPI());
-
+    this->UpdateImage();
+    this->UpdateQuad(actor);
     ren = vtkRenderer::SafeDownCast(viewport);
     if (ren)
       {
@@ -413,7 +386,6 @@ void vtkTextMapper::RenderOverlay(vtkViewport *viewport, vtkActor2D *actor)
 void vtkTextMapper::ReleaseGraphicsResources(vtkWindow *win)
 {
   this->Superclass::ReleaseGraphicsResources(win);
-  this->Mapper->ReleaseGraphicsResources(win);
   this->Texture->ReleaseGraphicsResources(win);
 }
 
@@ -431,10 +403,74 @@ unsigned long vtkTextMapper::GetMTime()
 }
 
 //----------------------------------------------------------------------------
-void vtkTextMapper::UpdateQuad(vtkActor2D *actor, int dpi)
+// Determine the number of lines in the Input string (delimited by "\n").
+#ifndef VTK_LEGACY_REMOVE
+int vtkTextMapper::GetNumberOfLines(const char *input)
+{
+  VTK_LEGACY_BODY(vtkTextMapper::GetNumberOfLines, "VTK 6.0")
+  if ( input == NULL || input[0] == '\0')
+    {
+    return 0;
+    }
+
+  int numLines=1;
+  const char *ptr = input;
+
+  while ( ptr != NULL )
+    {
+    if ( (ptr=strstr(ptr,"\n")) != NULL )
+      {
+      numLines++;
+      ptr++; //skip over \n
+      }
+    }
+
+  return numLines;
+}
+#endif // VTK_LEGACY_REMOVE
+
+//------------------------------------------------------------------------------
+namespace {
+// Given an Actor2D position coordinate (viewport, bottom left corner of actor)
+// and image dimensions, adjust the position to reflect the supplied alignment.
+void AdjustOrigin(int hAlign, int vAlign, int origin[2], const int dims[2])
+{
+  switch (hAlign)
+    {
+    default:
+    case VTK_TEXT_LEFT:
+      break;
+    case VTK_TEXT_CENTERED:
+      origin[0] -= dims[0] / 2;
+      break;
+    case VTK_TEXT_RIGHT:
+      origin[0] -= dims[0];
+      break;
+    }
+
+  switch (vAlign)
+    {
+    default:
+    case VTK_TEXT_TOP:
+      origin[1] -= dims[1];
+      break;
+    case VTK_TEXT_CENTERED:
+      origin[1] -= dims[1] / 2;
+      break;
+    case VTK_TEXT_BOTTOM:
+      break;
+    }
+}
+}
+
+//----------------------------------------------------------------------------
+void vtkTextMapper::UpdateQuad(vtkActor2D *actor)
 {
   vtkDebugMacro(<<"UpdateQuad called");
 
+  // Ensure that the image is up to date.
+  UpdateImage();
+
   // Update texture coordinates:
   if (this->Image->GetMTime() > this->TCoordsTime)
     {
@@ -487,24 +523,13 @@ void vtkTextMapper::UpdateQuad(vtkActor2D *actor, int dpi)
   if (this->CoordsTime < actor->GetMTime() ||
       this->CoordsTime < this->TextProperty->GetMTime())
     {
-    int text_bbox[4];
-    vtkTextRenderer *tren = vtkTextRenderer::GetInstance();
-    if (tren)
-      {
-      if (!tren->GetBoundingBox(this->TextProperty,
-                                this->Input ? this->Input : std::string(),
-                                text_bbox, dpi))
-        {
-        vtkErrorMacro(<<"Error calculating bounding box.");
-        }
-      }
-    else
-      {
-      vtkErrorMacro(<<"Could not locate vtkTextRenderer object.");
-      }
+    int pos[2] = { 0, 0 };
+    AdjustOrigin(this->TextProperty->GetJustification(),
+                 this->TextProperty->GetVerticalJustification(),
+                 pos, this->TextDims);
 
-    double x = static_cast<double>(text_bbox[0]);
-    double y = static_cast<double>(text_bbox[2]);
+    double x = static_cast<double>(pos[0]);
+    double y = static_cast<double>(pos[1]);
     double w = static_cast<double>(this->TextDims[0]);
     double h = static_cast<double>(this->TextDims[1]);
 
@@ -518,23 +543,20 @@ void vtkTextMapper::UpdateQuad(vtkActor2D *actor, int dpi)
 }
 
 //----------------------------------------------------------------------------
-void vtkTextMapper::UpdateImage(int dpi)
+void vtkTextMapper::UpdateImage()
 {
   vtkDebugMacro(<<"UpdateImage called");
   if (this->MTime > this->Image->GetMTime() ||
-      this->RenderedDPI != dpi ||
       this->TextProperty->GetMTime() > this->Image->GetMTime())
     {
     vtkTextRenderer *tren = vtkTextRenderer::GetInstance();
     if (tren)
       {
-      if (!tren->RenderString(this->TextProperty,
-                              this->Input ? this->Input : std::string(),
-                              this->Image.GetPointer(), this->TextDims, dpi))
+      if (!tren->RenderString(this->TextProperty, this->Input,
+                              this->Image.GetPointer(), this->TextDims))
         {
         vtkErrorMacro(<<"Texture generation failed.");
         }
-      this->RenderedDPI = dpi;
       vtkDebugMacro(<< "Text rendered to " << this->TextDims[0] << ", "
                     << this->TextDims[1] << " buffer.");
       }
@@ -544,3 +566,29 @@ void vtkTextMapper::UpdateImage(int dpi)
       }
     }
 }
+
+#ifndef VTK_LEGACY_REMOVE
+int vtkTextMapper::GetNumberOfLines()
+{
+  VTK_LEGACY_BODY(vtkTextMapper::GetNumberOfLines, "VTK 6.0")
+  const char *input = this->Input;
+  if ( input == NULL || input[0] == '\0')
+    {
+    return 0;
+    }
+
+  int numLines=1;
+  const char *ptr = input;
+
+  while ( ptr != NULL )
+    {
+    if ( (ptr=strstr(ptr,"\n")) != NULL )
+      {
+      numLines++;
+      ptr++; //skip over \n
+      }
+    }
+
+  return numLines;
+}
+#endif // VTK_LEGACY_REMOVE
diff --git a/Rendering/Core/vtkTextMapper.h b/Rendering/Core/vtkTextMapper.h
index 2f6978b..acc723f 100644
--- a/Rendering/Core/vtkTextMapper.h
+++ b/Rendering/Core/vtkTextMapper.h
@@ -22,6 +22,13 @@
 //
 // .SECTION See Also
 // vtkActor2D vtkTextActor vtkTextActor3D vtkTextProperty vtkTextRenderer
+//
+// .SECTION Note
+// This class will be overridden by the older vtkOpenGLFreeTypeTextMapper when
+// the vtkRenderingFreeTypeOpenGL library is linked into the executable. That
+// class provides legacy support for regression testing, but lacks many of the
+// newer features provided by this implementation (such as unicode and MathText
+// strings). Do not link with that library if such features are needed.
 
 #ifndef vtkTextMapper_h
 #define vtkTextMapper_h
@@ -73,6 +80,18 @@ public:
   void ShallowCopy(vtkTextMapper *tm);
 
   // Description:
+  // Determine the number of lines in the input string.
+  // @deprecated This is a legacy method that was used in an older
+  // implementation, and may be removed in the future.
+  VTK_LEGACY(int GetNumberOfLines(const char *input));
+
+  // Description:
+  // Get the number of lines in this mapper's input.
+  // @deprecated This is a legacy method that was used in an older
+  // implementation, and may be removed in the future.
+  VTK_LEGACY(int GetNumberOfLines());
+
+  // Description:
   // Set and return the font size (in points) required to make this mapper fit
   // in a given
   // target rectangle (width x height, in pixels). A static version of the method
@@ -102,6 +121,12 @@ public:
                                          int nbOfMappers, int *winSize,
                                          int *stringSize, float sizeFactor);
 
+  // Description:
+  // Get the available system font size matching a font size.
+  // @deprecated This is a legacy method that was used in an older
+  // implementation, and may be removed in the future.
+  VTK_LEGACY(virtual int GetSystemFontSize(int size));
+
   void RenderOverlay(vtkViewport *, vtkActor2D *);
   void ReleaseGraphicsResources(vtkWindow *);
   unsigned long GetMTime();
@@ -117,12 +142,11 @@ private:
   vtkTextMapper(const vtkTextMapper&);  // Not implemented.
   void operator=(const vtkTextMapper&);  // Not implemented.
 
-  void UpdateQuad(vtkActor2D *actor, int dpi);
-  void UpdateImage(int dpi);
+  void UpdateQuad(vtkActor2D *actor);
+  void UpdateImage();
 
   int TextDims[2];
 
-  int RenderedDPI;
   vtkTimeStamp CoordsTime;
   vtkTimeStamp TCoordsTime;
   vtkNew<vtkImageData> Image;
@@ -132,4 +156,14 @@ private:
   vtkNew<vtkTexture> Texture;
 };
 
+
+#ifndef VTK_LEGACY_REMOVE
+inline int vtkTextMapper::GetSystemFontSize(int size)
+{
+  VTK_LEGACY_BODY(vtkTextMapper::GetSystemFontSize, "VTK 6.0")
+  return size;
+}
+#endif // VTK_LEGACY_REMOVE
+
 #endif
+
diff --git a/Rendering/Core/vtkTextProperty.h b/Rendering/Core/vtkTextProperty.h
index 6f9709e..e320ba0 100644
--- a/Rendering/Core/vtkTextProperty.h
+++ b/Rendering/Core/vtkTextProperty.h
@@ -46,7 +46,7 @@ public:
   // Description:
   // Set/Get the text's opacity. 1.0 is totally opaque and 0.0 is completely
   // transparent.
-  vtkSetClampMacro(Opacity, double, 0., 1.);
+  vtkSetMacro(Opacity,double);
   vtkGetMacro(Opacity,double);
 
   // Description:
@@ -57,7 +57,7 @@ public:
   // Description:
   // The background opacity. 1.0 is totally opaque and 0.0 is completely
   // transparent.
-  vtkSetClampMacro(BackgroundOpacity, double, 0., 1.);
+  vtkSetMacro(BackgroundOpacity, double);
   vtkGetMacro(BackgroundOpacity, double);
 
   // Description:
diff --git a/Rendering/Core/vtkTextPropertyCollection.h b/Rendering/Core/vtkTextPropertyCollection.h
index a6f8c17..df7a04e 100644
--- a/Rendering/Core/vtkTextPropertyCollection.h
+++ b/Rendering/Core/vtkTextPropertyCollection.h
@@ -20,8 +20,8 @@
 // .SECTION see also
 // vtkTextProperty vtkCollection
 
-#ifndef vtkTextPropertyCollection_h
-#define vtkTextPropertyCollection_h
+#ifndef __vtkTextPropertyCollection_h
+#define __vtkTextPropertyCollection_h
 
 #include "vtkRenderingCoreModule.h" // For export macro
 #include "vtkCollection.h"
diff --git a/Rendering/Core/vtkTextRenderer.cxx b/Rendering/Core/vtkTextRenderer.cxx
index cf03962..dd94e26 100644
--- a/Rendering/Core/vtkTextRenderer.cxx
+++ b/Rendering/Core/vtkTextRenderer.cxx
@@ -50,6 +50,8 @@ void vtkTextRenderer::PrintSelf(ostream &os, vtkIndent indent)
   this->Superclass::PrintSelf(os, indent);
 
   os << indent << "Instance: " << vtkTextRenderer::Instance << endl;
+  os << indent << "HasFreeType: " << this->HasFreeType << endl;
+  os << indent << "HasMathText: " << this->HasMathText << endl;
   os << indent << "MathTextRegExp: " << this->MathTextRegExp << endl;
   os << indent << "MathTextRegExp2: " << this->MathTextRegExp2 << endl;
 }
@@ -112,6 +114,8 @@ void vtkTextRenderer::SetInstance(vtkTextRenderer *instance)
 vtkTextRenderer::vtkTextRenderer()
   : MathTextRegExp(new vtksys::RegularExpression("[^\\]\\$.+[^\\]\\$")),
     MathTextRegExp2(new vtksys::RegularExpression("^\\$.+[^\\]\\$")),
+    HasFreeType(false),
+    HasMathText(false),
     DefaultBackend(Detect)
 {
 }
diff --git a/Rendering/Core/vtkTextRenderer.h b/Rendering/Core/vtkTextRenderer.h
index d7c8808..7d7cd95 100644
--- a/Rendering/Core/vtkTextRenderer.h
+++ b/Rendering/Core/vtkTextRenderer.h
@@ -138,22 +138,24 @@ public:
 
   // Description:
   // Test for availability of various backends
-  virtual bool FreeTypeIsSupported() { return false; }
-  virtual bool MathTextIsSupported() { return false; }
+  bool FreeTypeIsSupported() { return HasFreeType; }
+  bool MathTextIsSupported() { return HasMathText; }
 
   // Description:
   // Given a text property and a string, get the bounding box {xmin, xmax,
   // ymin, ymax} of the rendered string in pixels. The origin of the bounding
   // box is the anchor point described by the horizontal and vertical
   // justification text property variables.
+  // Some rendering backends need the DPI of the target. If it is not provided,
+  // a DPI of 120 is assumed.
   // Return true on success, false otherwise.
   bool GetBoundingBox(vtkTextProperty *tprop, const vtkStdString &str,
-                      int bbox[4], int dpi, int backend = Default)
+                      int bbox[4], int dpi = 120, int backend = Default)
   {
     return this->GetBoundingBoxInternal(tprop, str, bbox, dpi, backend);
   }
   bool GetBoundingBox(vtkTextProperty *tprop, const vtkUnicodeString &str,
-                      int bbox[4], int dpi, int backend = Default)
+                      int bbox[4], int dpi = 120, int backend = Default)
   {
     return this->GetBoundingBoxInternal(tprop, str, bbox, dpi, backend);
   }
@@ -162,14 +164,16 @@ public:
   // Description:
   // Given a text property and a string, get some metrics for the rendered
   // string.
+  // Some rendering backends need the DPI of the target. If it is not provided,
+  // a DPI of 120 is assumed.
   // Return true on success, false otherwise.
   bool GetMetrics(vtkTextProperty *tprop, const vtkStdString &str,
-                  Metrics &metrics, int dpi, int backend = Default)
+                  Metrics &metrics, int dpi = 120, int backend = Default)
   {
     return this->GetMetricsInternal(tprop, str, metrics, dpi, backend);
   }
   bool GetMetrics(vtkTextProperty *tprop, const vtkUnicodeString &str,
-                  Metrics &metrics, int dpi, int backend = Default)
+                  Metrics &metrics, int dpi = 120, int backend = Default)
   {
     return this->GetMetricsInternal(tprop, str, metrics, dpi, backend);
   }
@@ -187,14 +191,16 @@ public:
   // The origin of the image's extents is aligned with the anchor point
   // described by the text property's vertical and horizontal justification
   // options.
+  // Some rendering backends need the DPI of the target. If it is not provided,
+  // a DPI of 120 is assumed.
   bool RenderString(vtkTextProperty *tprop, const vtkStdString &str,
-                    vtkImageData *data, int textDims[2], int dpi,
+                    vtkImageData *data, int textDims[2] = NULL, int dpi = 120,
                     int backend = Default)
   {
     return this->RenderStringInternal(tprop, str, data, textDims, dpi, backend);
   }
   bool RenderString(vtkTextProperty *tprop, const vtkUnicodeString &str,
-                    vtkImageData *data, int textDims[2], int dpi,
+                    vtkImageData *data, int textDims[2] = NULL, int dpi = 120,
                     int backend = Default)
   {
     return this->RenderStringInternal(tprop, str, data, textDims, dpi, backend);
@@ -205,15 +211,17 @@ public:
   // tprop that is required to fit the string in the target rectangle. The
   // computed font size will be set in @a tprop as well. If an error occurs,
   // this function will return -1.
+  // Some rendering backends need the DPI of the target. If it is not provided,
+  // a DPI of 120 is assumed.
   int GetConstrainedFontSize(const vtkStdString &str, vtkTextProperty *tprop,
-                             int targetWidth, int targetHeight, int dpi,
+                             int targetWidth, int targetHeight, int dpi = 120,
                              int backend = Default)
   {
     return this->GetConstrainedFontSizeInternal(str, tprop, targetWidth,
                                                 targetHeight, dpi, backend);
   }
   int GetConstrainedFontSize(const vtkUnicodeString &str, vtkTextProperty *tprop,
-                             int targetWidth, int targetHeight, int dpi,
+                             int targetWidth, int targetHeight, int dpi = 120,
                              int backend = Default)
   {
     return this->GetConstrainedFontSizeInternal(str, tprop, targetWidth,
@@ -227,14 +235,14 @@ public:
   // property's horizontal and vertical justification options.
   // Return true on success, false otherwise.
   bool StringToPath(vtkTextProperty *tprop, const vtkStdString &str,
-                    vtkPath *path, int dpi, int backend = Default)
+                    vtkPath *path, int backend = Default)
   {
-    return this->StringToPathInternal(tprop, str, path, dpi, backend);
+    return this->StringToPathInternal(tprop, str, path, backend);
   }
   bool StringToPath(vtkTextProperty *tprop, const vtkUnicodeString &str,
-                    vtkPath *path, int dpi, int backend = Default)
+                    vtkPath *path, int backend = Default)
   {
-    return this->StringToPathInternal(tprop, str, path, dpi, backend);
+    return this->StringToPathInternal(tprop, str, path, backend);
   }
 
   // Description:
@@ -285,10 +293,10 @@ protected:
                                              int dpi, int backend) = 0;
   virtual bool StringToPathInternal(vtkTextProperty *tprop,
                                     const vtkStdString &str, vtkPath *path,
-                                    int dpi, int backend) = 0;
+                                    int backend) = 0;
   virtual bool StringToPathInternal(vtkTextProperty *tprop,
                                     const vtkUnicodeString &str, vtkPath *path,
-                                    int dpi, int backend) = 0;
+                                    int backend) = 0;
   virtual void SetScaleToPowerOfTwoInternal(bool scale) = 0;
 
   // Description:
@@ -310,6 +318,12 @@ protected:
   virtual void CleanUpFreeTypeEscapes(vtkUnicodeString &str);
 
   // Description:
+  // Used to cache the availability of backends. Set these in the derived class
+  // constructor
+  bool HasFreeType;
+  bool HasMathText;
+
+  // Description:
   // The backend to use when none is specified. Default: Detect
   int DefaultBackend;
 
diff --git a/Rendering/Core/vtkTexture.h b/Rendering/Core/vtkTexture.h
index e8fb979..9371937 100644
--- a/Rendering/Core/vtkTexture.h
+++ b/Rendering/Core/vtkTexture.h
@@ -212,12 +212,6 @@ protected:
   vtkTexture();
   ~vtkTexture();
 
-  // A texture is a sink, so there is no need to do anything.
-  // This definition avoids a warning when doing Update() on a vtkTexture object.
-  virtual void ExecuteData(vtkDataObject *)
-  {
-  }
-
   int Repeat;
   int EdgeClamp;
   int Interpolate;
diff --git a/Rendering/Core/vtkWindowToImageFilter.cxx b/Rendering/Core/vtkWindowToImageFilter.cxx
index 5d506b9..41a2e68 100644
--- a/Rendering/Core/vtkWindowToImageFilter.cxx
+++ b/Rendering/Core/vtkWindowToImageFilter.cxx
@@ -147,17 +147,11 @@ void vtkWindowToImageFilter::RequestInformation (
     return;
     }
 
-  int tileScale[2];
-  this->Input->GetTileScale(tileScale);
-  int magTileScale[2] = {tileScale[0] * this->Magnification,
-                         tileScale[1] * this->Magnification};
-
-  if((magTileScale[0] > 1 || magTileScale[1] > 1) &&
+  if(this->Magnification > 1 &&
      (this->Viewport[0] != 0 || this->Viewport[1] != 0 ||
       this->Viewport[2] != 1 || this->Viewport[3] != 1))
     {
-    vtkWarningMacro(<<"Viewport extents are not used when Magnification > 1 "
-                    "or tiled displays are used.");
+    vtkWarningMacro(<<"Viewport extents are not used when Magnification > 1");
     this->Viewport[0] = 0;
     this->Viewport[1] = 0;
     this->Viewport[2] = 1;
@@ -242,7 +236,9 @@ void vtkWindowToImageFilter::RequestData(
     return;
     }
 
-  int idxY;
+  int outIncrY;
+  int size[2],winsize[2];
+  int idxY, rowSize;
   int i;
 
   if (! ((out->GetScalarType() == VTK_UNSIGNED_CHAR &&
@@ -253,30 +249,17 @@ void vtkWindowToImageFilter::RequestData(
     return;
     }
 
-  int tileScale[2];
-  int magTileScale[2];
-  this->Input->GetTileScale(tileScale);
-  magTileScale[0] = this->Magnification * tileScale[0];
-  magTileScale[1] = this->Magnification * tileScale[1];
-
-
-  int tileSize[2] = {this->Input->GetActualSize()[0],
-                     this->Input->GetActualSize()[1]};
-
-  // This is the size of the window with all tiles accounted for:
-  int winSize[2] = {this->Input->GetSize()[0], this->Input->GetSize()[1]};
-
-  int vpSize[2];
-  vpSize[0] = int(this->Viewport[2] * winSize[0] + 0.5)
-            - int(this->Viewport[0] * winSize[0]);
-  vpSize[1] = int(this->Viewport[3] * winSize[1] + 0.5)
-            - int(this->Viewport[1] * winSize[1]);
+  // get the size of the render window
+  winsize[0] = this->Input->GetSize()[0];
+  winsize[1] = this->Input->GetSize()[1];
 
-  int imageSize[2] = {vpSize[0] * this->Magnification,
-                      vpSize[1] * this->Magnification};
+  size[0] = int(this->Viewport[2]* winsize[0] + 0.5)
+            - int(this->Viewport[0]* winsize[0]);
+  size[1] = int(this->Viewport[3]* winsize[1] + 0.5)
+            - int(this->Viewport[1]* winsize[1]);
 
-  int inIncrY = tileSize[0] * out->GetNumberOfScalarComponents();
-  int outIncrY = imageSize[0] * out->GetNumberOfScalarComponents();
+  rowSize = size[0]*out->GetNumberOfScalarComponents();
+  outIncrY = size[0]*this->Magnification*out->GetNumberOfScalarComponents();
 
   float *viewAngles;
   double *windowCenters;
@@ -314,69 +297,66 @@ void vtkWindowToImageFilter::RequestData(
     }
 
   // render each of the tiles required to fill this request
-  this->Input->SetTileScale(magTileScale);
+  this->Input->SetTileScale(this->Magnification);
   this->Input->GetSize();
 
   //this->Rescale2DActors();
   int x, y;
 
-  int num_iterations[2] = {magTileScale[0], magTileScale[1]};
+  int num_iterations = this->Magnification;
   bool overlap_viewports = false;
-  if (this->FixBoundary)
+  if (this->Magnification > 1 && this->FixBoundary &&
+    winsize[0] >= 50 && winsize[1] >= 50)
     {
-    if ((magTileScale[0] > 1 || magTileScale[1] > 1) && winSize[0] >= 50)
-      {
-      ++num_iterations[0];
-      ++num_iterations[1];
-      overlap_viewports = true;
-      }
+    num_iterations++;
+    overlap_viewports = true;
     }
 
   // Precompute the tile viewport for each iteration.
-  double *viewports = new double[4 * num_iterations[0] * num_iterations[1]];
-  for (y = 0; y < num_iterations[1]; y++)
+  double *viewports = new double[4*num_iterations*num_iterations];
+  for (y = 0; y < num_iterations; y++)
     {
-    for (x = 0; x < num_iterations[0]; x++)
+    for (x = 0; x < num_iterations; x++)
       {
-      double* cur_viewport = &viewports[(num_iterations[1] * y + x) * 4];
-      cur_viewport[0] = static_cast<double>(x) / magTileScale[0];
-      cur_viewport[1] = static_cast<double>(y) / magTileScale[1];
-      cur_viewport[2] = (x + 1.0) / magTileScale[0];
-      cur_viewport[3] = (y + 1.0) / magTileScale[1];
+      double* cur_viewport = &viewports[ (num_iterations*y + x)*4 ];
+      cur_viewport[0] = static_cast<double>(x)/this->Magnification;
+      cur_viewport[1] = static_cast<double>(y)/this->Magnification;
+      cur_viewport[2] = (x+1.0)/this->Magnification;
+      cur_viewport[3] = (y+1.0)/this->Magnification;
 
       if (overlap_viewports)
         {
-        if (x > 0 && x < num_iterations[0] - 1)
+        if (x > 0 && x < num_iterations-1)
           {
-          cur_viewport[0] -= x * (BORDER_PIXELS * 2.0) / tileSize[0];
-          cur_viewport[2] -= x * (BORDER_PIXELS * 2.0) / tileSize[0];
+          cur_viewport[0] -= x * (BORDER_PIXELS * 2.0)/winsize[0];
+          cur_viewport[2] -= x * (BORDER_PIXELS * 2.0)/winsize[0];
           }
-        if (x == num_iterations[0] - 1)
+        if (x == num_iterations -1)
           {
-          cur_viewport[0] = static_cast<double>(x - 1) / magTileScale[0];
-          cur_viewport[2] = static_cast<double>(x) / magTileScale[0];
+          cur_viewport[0] = static_cast<double>(x-1)/this->Magnification;
+          cur_viewport[2] = static_cast<double>(x)/this->Magnification;
 
           }
-        if (y > 0 && y < num_iterations[1] - 1)
+        if (y > 0 && y < num_iterations-1)
           {
-          cur_viewport[1] -= y * (BORDER_PIXELS * 2.0) / tileSize[1];
-          cur_viewport[3] -= y * (BORDER_PIXELS * 2.0) / tileSize[1];
+          cur_viewport[1] -= y * (BORDER_PIXELS * 2.0)/winsize[1];
+          cur_viewport[3] -= y * (BORDER_PIXELS * 2.0)/winsize[1];
           }
-        if (y == num_iterations[1] - 1)
+        if (y == num_iterations-1)
           {
-          cur_viewport[1] = static_cast<double>(y - 1) / magTileScale[1];
-          cur_viewport[3] = static_cast<double>(y) / magTileScale[1];
+          cur_viewport[1] = static_cast<double>(y-1)/this->Magnification;
+          cur_viewport[3] = static_cast<double>(y)/this->Magnification;
           }
         }
       }
     }
 
-  for (y = 0; y < num_iterations[1]; y++)
+  for (y = 0; y < num_iterations; y++)
     {
-    for (x = 0; x < num_iterations[0]; x++)
+    for (x = 0; x < num_iterations; x++)
       {
       // setup the Window ivars
-      double* cur_viewport = &viewports[(num_iterations[1] * y + x) * 4];
+      double* cur_viewport = &viewports[ (num_iterations*y + x)*4 ];
       this->Input->SetTileViewport(cur_viewport);
       double *tvp = this->Input->GetTileViewport();
 
@@ -421,8 +401,7 @@ void vtkWindowToImageFilter::RequestData(
       // Shift 2d actors just before rendering
       //this->Shift2DActors(size[0]*x, size[1]*y);
       // now render the tile and get the data
-      if (this->ShouldRerender ||
-          num_iterations[0] > 1 || num_iterations[1] > 1)
+      if (this->ShouldRerender || num_iterations > 1)
         {
         // if interactor is present, trigger render through interactor. This
         // allows for custom applications that provide interactors that
@@ -449,18 +428,18 @@ void vtkWindowToImageFilter::RequestData(
         if (this->InputBufferType == VTK_RGB)
           {
           pixels =
-            this->Input->GetPixelData(int(this->Viewport[0]* tileSize[0]),
-                                      int(this->Viewport[1]* tileSize[1]),
-                                      int(this->Viewport[2]* tileSize[0] + 0.5) - 1,
-                                      int(this->Viewport[3]* tileSize[1] + 0.5) - 1, buffer);
+            this->Input->GetPixelData(int(this->Viewport[0]* winsize[0]),
+                                      int(this->Viewport[1]* winsize[1]),
+                                      int(this->Viewport[2]* winsize[0] + 0.5) - 1,
+                                      int(this->Viewport[3]* winsize[1] + 0.5) - 1, buffer);
           }
         else
           {
           pixels =
-            renWin->GetRGBACharPixelData(int(this->Viewport[0]* tileSize[0]),
-                                         int(this->Viewport[1]* tileSize[1]),
-                                         int(this->Viewport[2]* tileSize[0] + 0.5) - 1,
-                                         int(this->Viewport[3]* tileSize[1] + 0.5) - 1, buffer);
+            renWin->GetRGBACharPixelData(int(this->Viewport[0]* winsize[0]),
+                                         int(this->Viewport[1]* winsize[1]),
+                                         int(this->Viewport[2]* winsize[0] + 0.5) - 1,
+                                         int(this->Viewport[3]* winsize[1] + 0.5) - 1, buffer);
 
           }
 
@@ -469,8 +448,8 @@ void vtkWindowToImageFilter::RequestData(
         // now write the data to the output image
         if (overlap_viewports)
           {
-          int xpos = int(cur_viewport[0] * imageSize[0] + 0.5);
-          int ypos = int(cur_viewport[1] * imageSize[1] + 0.5);
+          int xpos = int(cur_viewport[0]*size[0]*this->Magnification + 0.5);
+          int ypos = int(cur_viewport[1]*size[1]*this->Magnification + 0.5);
 
           outPtr = static_cast<unsigned char *>(
             out->GetScalarPointer(xpos,ypos, 0));
@@ -478,34 +457,32 @@ void vtkWindowToImageFilter::RequestData(
           // We skip padding pixels around internal borders.
           int ncomp = out->GetNumberOfScalarComponents();
           int start_x_offset = (x != 0)? BORDER_PIXELS : 0;
-          int end_x_offset = (x != num_iterations[0]-1 && x!=0) ? BORDER_PIXELS
-                                                                : 0;
+          int end_x_offset = (x != num_iterations-1 && x!=0)? BORDER_PIXELS : 0;
           int start_y_offset = (y != 0)? BORDER_PIXELS : 0;
-          int end_y_offset = (y != num_iterations[1]-1)? BORDER_PIXELS : 0;
+          int end_y_offset = (y != num_iterations-1)? BORDER_PIXELS : 0;
           start_x_offset *= ncomp;
           end_x_offset *= ncomp;
-
-          for (idxY = 0; idxY < tileSize[1]; idxY++)
+          for (idxY = 0; idxY < size[1]; idxY++)
             {
-            if (idxY >= start_y_offset && idxY < tileSize[1] - end_y_offset)
+            if (idxY >= start_y_offset && idxY < size[1] - end_y_offset)
               {
               memcpy(outPtr + start_x_offset, pixels1 + start_x_offset,
-                inIncrY - (start_x_offset + end_x_offset));
+                rowSize - (start_x_offset + end_x_offset));
               }
             outPtr += outIncrY;
-            pixels1 += inIncrY;
+            pixels1 += rowSize;
             }
           }
         else
           {
           outPtr = static_cast<unsigned char *>(
-            out->GetScalarPointer(x * tileSize[0], y * tileSize[1], 0));
+            out->GetScalarPointer(x*size[0],y*size[1], 0));
 
-          for (idxY = 0; idxY < tileSize[1]; idxY++)
+          for (idxY = 0; idxY < size[1]; idxY++)
             {
-            memcpy(outPtr,pixels1,inIncrY);
+            memcpy(outPtr,pixels1,rowSize);
             outPtr += outIncrY;
-            pixels1 += inIncrY;
+            pixels1 += rowSize;
             }
 
           }
@@ -516,23 +493,21 @@ void vtkWindowToImageFilter::RequestData(
       else
         { // VTK_ZBUFFER
         float *pixels, *pixels1, *outPtr;
-        pixels = renWin->GetZbufferData(int(this->Viewport[0] * tileSize[0]),
-                                        int(this->Viewport[1] * tileSize[1]),
-                                        int(this->Viewport[2] * tileSize[0] + 0.5) - 1,
-                                        int(this->Viewport[3] * tileSize[1] + 0.5) - 1);
+        pixels = renWin->GetZbufferData(int(this->Viewport[0]* winsize[0]),
+                                        int(this->Viewport[1]* winsize[1]),
+                                        int(this->Viewport[2]* winsize[0] + 0.5) - 1,
+                                        int(this->Viewport[3]* winsize[1] + 0.5) - 1);
 
         pixels1 = pixels;
 
         // now write the data to the output image
         outPtr =
-          static_cast<float *>(out->GetScalarPointer(x * tileSize[0],
-                                                     y * tileSize[1], 0));
-
-        for (idxY = 0; idxY < tileSize[1]; idxY++)
+          static_cast<float *>(out->GetScalarPointer(x*size[0],y*size[1], 0));
+        for (idxY = 0; idxY < size[1]; idxY++)
           {
-          memcpy(outPtr,pixels1,inIncrY*sizeof(float));
+          memcpy(outPtr,pixels1,rowSize*sizeof(float));
           outPtr += outIncrY;
-          pixels1 += inIncrY;
+          pixels1 += rowSize;
           }
 
         // free the memory
@@ -560,7 +535,7 @@ void vtkWindowToImageFilter::RequestData(
   delete [] viewports;
 
   // render each of the tiles required to fill this request
-  this->Input->SetTileScale(tileScale);
+  this->Input->SetTileScale(1);
   this->Input->SetTileViewport(0.0,0.0,1.0,1.0);
   this->Input->GetSize();
   // restore every 2d actors
diff --git a/Rendering/External/CMakeLists.txt b/Rendering/External/CMakeLists.txt
index 5899b83..716df5a 100644
--- a/Rendering/External/CMakeLists.txt
+++ b/Rendering/External/CMakeLists.txt
@@ -1,6 +1,5 @@
 set(Module_SRCS
   ExternalVTKWidget.cxx
-  vtkExternalLight.cxx
   vtkExternalOpenGLCamera.cxx
   vtkExternalOpenGLRenderer.cxx
   vtkExternalOpenGLRenderWindow.cxx
@@ -8,16 +7,9 @@ set(Module_SRCS
 
 set(${vtk-module}_HDRS
   ExternalVTKWidget.h
-  vtkExternalLight.h
   vtkExternalOpenGLCamera.h
   vtkExternalOpenGLRenderer.h
   vtkExternalOpenGLRenderWindow.h
   )
 
 vtk_module_library(vtkRenderingExternal ${Module_SRCS})
-
-if ("${VTK_RENDERING_BACKEND}" STREQUAL "OpenGL2")
-  set_target_properties(
-    vtkRenderingExternal
-    PROPERTIES COMPILE_FLAGS -DVTK_OPENGL2)
-endif ()
diff --git a/Rendering/External/Testing/Cxx/CMakeLists.txt b/Rendering/External/Testing/Cxx/CMakeLists.txt
index 5423ec9..b6abe71 100644
--- a/Rendering/External/Testing/Cxx/CMakeLists.txt
+++ b/Rendering/External/Testing/Cxx/CMakeLists.txt
@@ -10,4 +10,4 @@ VTK_ADD_TEST_CXX(${vtk-module}CxxTests tests
 
 VTK_TEST_CXX_EXECUTABLE(${vtk-module}CxxTests tests)
 TARGET_LINK_LIBRARIES(${vtk-module}CxxTests LINK_PRIVATE
-  vtkRenderingExternal ${OPENGL_LIBRARIES} ${GLUT_LIBRARY})
+  vtkRenderingExternal ${OPENGL_gl_LIBRARY} ${GLUT_LIBRARY})
diff --git a/Rendering/External/Testing/Cxx/TestGLUTRenderWindow.cxx b/Rendering/External/Testing/Cxx/TestGLUTRenderWindow.cxx
index 111cbb3..9b70ab1 100644
--- a/Rendering/External/Testing/Cxx/TestGLUTRenderWindow.cxx
+++ b/Rendering/External/Testing/Cxx/TestGLUTRenderWindow.cxx
@@ -21,14 +21,11 @@
 // vtkExternalOpenGLRenderer by drawing a GL_TRIANGLE in the scene before
 // drawing the vtk sphere.
 
-#include <vtk_glew.h>
 // GLUT includes
 #if defined(__APPLE__)
 # include <GLUT/glut.h> // Include GLUT API.
 #else
-# if defined(_WIN32)
 # include "vtkWindows.h" // Needed to include OpenGL header on Windows.
-# endif // _WIN32
 # include <GL/glut.h> // Include GLUT API.
 #endif
 
@@ -47,11 +44,9 @@
 #include <vtkPolyDataMapper.h>
 #include <vtkTesting.h>
 
-namespace {
-
 // Global variables used by the glutDisplayFunc and glutIdleFunc
 vtkNew<ExternalVTKWidget> externalVTKWidget;
-static bool initialized = false;
+static bool initilaized = false;
 static int NumArgs;
 char** ArgV;
 static bool tested = false;
@@ -65,7 +60,7 @@ static void MakeCurrentCallback(vtkObject* caller,
                                 void * clientData,
                                 void * callData)
 {
-  if (initialized)
+  if (initilaized)
     {
     glutSetWindow(windowId);
     }
@@ -75,9 +70,10 @@ static void MakeCurrentCallback(vtkObject* caller,
    whenever the window needs to be re-painted. */
 void display()
 {
-  if (!initialized)
+  if (!initilaized)
     {
     vtkNew<vtkExternalOpenGLRenderWindow> renWin;
+    renWin->SetSize(windowW, windowH);
     externalVTKWidget->SetRenderWindow(renWin.GetPointer());
     vtkNew<vtkCallbackCommand> callback;
     callback->SetCallback(MakeCurrentCallback);
@@ -94,7 +90,20 @@ void display()
     actor->RotateY(45.0);
     ren->ResetCamera();
 
-    initialized = true;
+    vtkNew<vtkLight> light;
+    light->SetLightTypeToSceneLight();
+    light->SetPosition(0, 0, 1);
+    light->SetConeAngle(25.0);
+    light->SetPositional(true);
+    light->SetFocalPoint(0, 0, 0);
+    light->SetDiffuseColor(1, 0, 0);
+    light->SetAmbientColor(0, 1, 0);
+    light->SetSpecularColor(0, 0, 1);
+    renWin->Render();
+    // Make sure light is added after first render call
+    ren->AddLight(light.GetPointer());
+
+    initilaized = true;
     }
 
   // Enable depth testing. Demonstrates OpenGL context being managed by external
@@ -113,17 +122,6 @@ void display()
     glVertex3f(0.0,1.5,1.0);
   glEnd();
 
-  glEnable(GL_LIGHTING);
-  glEnable(GL_LIGHT0);
-  GLfloat lightpos[] = {-0.5f, 1.0f, 1.0f, 1.0f};
-  glLightfv(GL_LIGHT0, GL_POSITION, lightpos);
-  GLfloat diffuse[] = {0.0f, 0.8f, 0.8f, 1.0f};
-  glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse);
-  GLfloat specular[] = {0.5f, 0.0f, 0.0f, 1.0f};
-  glLightfv(GL_LIGHT0, GL_SPECULAR, specular);
-  GLfloat ambient[] = {1.0f, 1.0f, 0.2f,  1.0f};
-  glLightfv(GL_LIGHT0, GL_AMBIENT, ambient);
-
   externalVTKWidget->GetRenderWindow()->Render();
   glutSwapBuffers();
 }
@@ -162,26 +160,22 @@ void handleResize(int w, int h)
 
 void onexit(void)
 {
-  initialized = false;
+  initilaized = false;
 }
 
-} // end anon namespace
-
 /* Main function: GLUT runs as a console application starting at main()  */
 int TestGLUTRenderWindow(int argc, char** argv)
 {
   NumArgs = argc;
   ArgV = argv;
   glutInit(&argc, argv);                 // Initialize GLUT
-  glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH | GLUT_STENCIL);
   glutInitWindowSize(windowW, windowH);   // Set the window's initial width & height
-  glutInitWindowPosition(101, 201); // Position the window's initial top-left corner
+  glutInitWindowPosition(0, 0); // Position the window's initial top-left corner
   windowId = glutCreateWindow("VTK External Window Test"); // Create a window with the given title
   glutDisplayFunc(display); // Register display callback handler for window re-paint
   glutIdleFunc(test); // Register test callback handler for vtkTesting
   glutReshapeFunc(handleResize); // Register resize callback handler for window resize
   atexit(onexit);  // Register callback to uninitialize on exit
-  glewInit();
   glutMainLoop();  // Enter the infinitely event-processing loop
   return 0;
 }
diff --git a/Rendering/External/Testing/Data/Baseline/TestGLUTRenderWindow.png.md5 b/Rendering/External/Testing/Data/Baseline/TestGLUTRenderWindow.png.md5
index c674cbb..ec98329 100644
--- a/Rendering/External/Testing/Data/Baseline/TestGLUTRenderWindow.png.md5
+++ b/Rendering/External/Testing/Data/Baseline/TestGLUTRenderWindow.png.md5
@@ -1 +1 @@
-81c18a47e92c2df01b19e998ba8e12e3
+2ae18c44f9a2f156a289c3a240b4c5fd
diff --git a/Rendering/External/module.cmake b/Rendering/External/module.cmake
index 2a7fe9f..80d9565 100644
--- a/Rendering/External/module.cmake
+++ b/Rendering/External/module.cmake
@@ -1,9 +1,20 @@
+# This module cannot be built when the rendering backend is OpenGL2
+if (Module_vtkRenderingExternal AND
+    ("${VTK_RENDERING_BACKEND}" STREQUAL "OpenGL2"))
+  message (SEND_ERROR "
+  vtkRenderingExternal cannot be built
+  when the rendering backend is OpenGL2.
+  Please disable vtkRenderingExternal or
+  change VTK_RENDERING_BACKEND to OpenGL.
+  ")
+  return()
+endif()
+
 vtk_module(vtkRenderingExternal
   DEPENDS
     vtkRenderingCore
-    vtkRendering${VTK_RENDERING_BACKEND}
+    vtkRenderingOpenGL
   TEST_DEPENDS
-    vtkglew
     vtkTestingRendering
   EXCLUDE_FROM_ALL
   )
diff --git a/Rendering/External/vtkExternalLight.cxx b/Rendering/External/vtkExternalLight.cxx
deleted file mode 100644
index 9fb38ae..0000000
--- a/Rendering/External/vtkExternalLight.cxx
+++ /dev/null
@@ -1,151 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkExternalLight.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 "vtkExternalLight.h"
-
-#include "vtkObjectFactory.h"
-#include "vtkOpenGL.h"
-
-//-----------------------------------------------------------------------------
-vtkStandardNewMacro(vtkExternalLight);
-
-//-----------------------------------------------------------------------------
-vtkExternalLight::vtkExternalLight()
-{
-  this->LightIndex = GL_LIGHT0;
-  this->ReplaceMode = INDIVIDUAL_PARAMS;
-
-  // By default, nothing is set by user
-  this->PositionSet = false;
-  this->FocalPointSet = false;
-  this->AmbientColorSet = false;
-  this->DiffuseColorSet = false;
-  this->SpecularColorSet = false;
-  this->IntensitySet = false;
-  this->ConeAngleSet = false;
-  this->AttenuationValuesSet = false;
-  this->ExponentSet = false;
-  this->PositionalSet = false;
-
-  // Set the default light type to headlight
-  this->LightType = VTK_LIGHT_TYPE_HEADLIGHT;
-}
-
-//-----------------------------------------------------------------------------
-vtkExternalLight::~vtkExternalLight()
-{
-}
-
-//-----------------------------------------------------------------------------
-void vtkExternalLight::SetPosition(double position1,
-                                   double position2,
-                                   double position3)
-{
-  this->Superclass::SetPosition(position1, position2, position3);
-  this->PositionSet = true;
-}
-
-//-----------------------------------------------------------------------------
-void vtkExternalLight::SetFocalPoint(double focalpoint1,
-                                     double focalpoint2,
-                                     double focalpoint3)
-{
-  this->Superclass::SetFocalPoint(focalpoint1, focalpoint2, focalpoint3);
-  this->FocalPointSet = true;
-}
-
-//-----------------------------------------------------------------------------
-void vtkExternalLight::SetAmbientColor(double color1,
-                                       double color2,
-                                       double color3)
-{
-  this->Superclass::SetAmbientColor(color1, color2, color3);
-  this->AmbientColorSet = true;
-}
-
-//-----------------------------------------------------------------------------
-void vtkExternalLight::SetDiffuseColor(double color1,
-                                       double color2,
-                                       double color3)
-{
-  this->Superclass::SetDiffuseColor(color1, color2, color3);
-  this->DiffuseColorSet = true;
-}
-
-//-----------------------------------------------------------------------------
-void vtkExternalLight::SetSpecularColor(double color1,
-                                        double color2,
-                                        double color3)
-{
-  this->Superclass::SetSpecularColor(color1, color2, color3);
-  this->SpecularColorSet = true;
-}
-
-//-----------------------------------------------------------------------------
-void vtkExternalLight::SetIntensity(double intensity)
-{
-  this->Superclass::SetIntensity(intensity);
-  this->IntensitySet = true;
-}
-
-//-----------------------------------------------------------------------------
-void vtkExternalLight::SetConeAngle(double angle)
-{
-  this->Superclass::SetConeAngle(angle);
-  this->ConeAngleSet = true;
-}
-
-//-----------------------------------------------------------------------------
-void vtkExternalLight::SetAttenuationValues(double value1,
-                                            double value2,
-                                            double value3)
-{
-  this->Superclass::SetAttenuationValues(value1, value2, value3);
-  this->AttenuationValuesSet = true;
-}
-
-//-----------------------------------------------------------------------------
-void vtkExternalLight::SetExponent(double exp)
-{
-  this->Superclass::SetExponent(exp);
-  this->ExponentSet = true;
-}
-
-//-----------------------------------------------------------------------------
-void vtkExternalLight::SetPositional(int p)
-{
-  this->Superclass::SetPositional(p);
-  this->PositionalSet = true;
-}
-
-//-----------------------------------------------------------------------------
-void vtkExternalLight::PrintSelf(ostream& os, vtkIndent indent)
-{
-  this->Superclass::PrintSelf(os, indent);
-
-  os << indent << "LightIndex: " << this->LightIndex << "\n";
-  os << indent << "ReplaceMode: " << this->ReplaceMode << "\n";
-
-  os << indent << "PositionSet: " << this->PositionSet << "\n";
-  os << indent << "FocalPointSet: " << this->FocalPointSet << "\n";
-  os << indent << "AmbientColorSet: " << this->AmbientColorSet << "\n";
-  os << indent << "DiffuseColorSet: " << this->DiffuseColorSet << "\n";
-  os << indent << "SpecularColorSet: " << this->SpecularColorSet << "\n";
-  os << indent << "IntensitySet: " << this->IntensitySet << "\n";
-  os << indent << "ConeAngleSet: " << this->ConeAngleSet << "\n";
-  os << indent << "AttenuationValuesSet: " <<
-    this->AttenuationValuesSet << "\n";
-  os << indent << "ExponentSet: " << this->ExponentSet << "\n";
-  os << indent << "PositionalSet: " << this->PositionalSet << "\n";
-}
diff --git a/Rendering/External/vtkExternalLight.h b/Rendering/External/vtkExternalLight.h
deleted file mode 100644
index ee9e640..0000000
--- a/Rendering/External/vtkExternalLight.h
+++ /dev/null
@@ -1,205 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkExternalLight.h
-
-  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.
-
-=========================================================================*/
-// .NAME vtkExternalLight - a virtual light object for tweaking existing lights
-// in an external 3D rendering context
-//
-// .SECTION Description
-// vtkExternalLight is a virtual light object for tweaking existing lights in
-// an external 3D rendering context. It provides a mechanism to adjust and
-// control parameters of existing lights in an external OpenGL context.
-//
-// It provides methods to locate and point the light,
-// and set its brightness and color. In addition to the
-// basic infinite distance point light source attributes, you can also specify
-// the light attenuation values and cone angle. These attributes are only used
-// if the light is a positional light.
-//
-// By default, vtkExternalLight overrides specific light parameters as set by
-// the user. Setting the #ReplaceMode to ALL_PARAMS, will set all
-// the light parameter values to the ones set in vtkExternalLight.
-//
-// .SECTION Caveats
-// Use the vtkExternalLight object to tweak parameters of lights created in the
-// external context. This class does NOT create new lights in the scene.
-//
-// .SECTION Example
-// Usage example for vtkExternalLight in conjunction with
-// vtkExternalOpenGLRenderer and \ref ExternalVTKWidget
-// \code{.cpp}
-//    vtkNew<vtkExternalLight> exLight;
-//    exLight->SetLightIndex(GL_LIGHT0); // GL_LIGHT0 identifies the external light
-//    exLight->SetDiffuseColor(1.0, 0.0, 0.0); // Changing diffuse color
-//    vtkNew<ExternalVTKWidget> exWidget;
-//    vtkExternalOpenGLRenderer* ren = vtkExternalOpenGLRenderer::SafeDownCast(exWidget->AddRenderer());
-//    ren->AddExternalLight(exLight.GetPointer());
-// \endcode
-//
-// .SECTION see also
-// vtkExternalOpenGLRenderer \ref ExternalVTKWidget
-
-#ifndef vtkExternalLight_h
-#define vtkExternalLight_h
-
-#include "vtkRenderingExternalModule.h" // For export macro
-#include "vtkLight.h"
-
-class VTKRENDERINGEXTERNAL_EXPORT vtkExternalLight : public vtkLight
-{
-public:
-  vtkTypeMacro(vtkExternalLight, vtkLight);
-  void PrintSelf(ostream& os, vtkIndent indent);
-
-  // Description:
-  // Create an external light object with the focal point at the origin and its
-  // position set to (0,0,1). The light is a Headlight, its color is white
-  // (black ambient, white diffuse, white specular),
-  // intensity=1, the light is turned on, positional lighting is off,
-  // ConeAngle=30, AttenuationValues=(1,0,0), Exponent=1 and the
-  // TransformMatrix is NULL. The light index is GL_LIGHT0, which means the
-  // existing light with index GL_LIGHT0 will be affected by this light.
-  static vtkExternalLight *New();
-
-  enum ReplaceModes
-    {
-    INDIVIDUAL_PARAMS   = 0, // default
-    ALL_PARAMS          = 1
-    };
-
-  // Description:
-  // Set/Get light index
-  // This should be the OpenGL light identifier. (e.g.: GL_LIGHT0)
-  // (Default: GL_LIGHT0)
-  vtkSetMacro(LightIndex, int);
-  vtkGetMacro(LightIndex, int);
-
-  // Description:
-  // Set/Get replace mode
-  // This determines how this ExternalLight will be used to tweak parameters on
-  // an existing light in the rendering context.
-  // (Default: INDIVIDUAL_PARAMS)
-  //
-  // \li \c vtkExternalLight::INDIVIDUAL_PARAMS : Replace parameters
-  // specifically set by the user by calling the parameter
-  // Set method. (e.g. SetDiffuseColor())
-  //
-  // \li \c vtkExternalLight::ALL_PARAMS : Replace all
-  // parameters of the light with the parameters in vtkExternalLight object.
-  vtkSetMacro(ReplaceMode, int);
-  vtkGetMacro(ReplaceMode, int);
-
-  // Description:
-  // Override Set method to keep a record of changed value
-  void SetPosition(double, double, double);
-
-  // Description:
-  // Override Set method to keep a record of changed value
-  void SetFocalPoint(double, double, double);
-
-  // Description:
-  // Override Set method to keep a record of changed value
-  void SetAmbientColor(double, double, double);
-
-  // Description:
-  // Override Set method to keep a record of changed value
-  void SetDiffuseColor(double, double, double);
-
-  // Description:
-  // Override Set method to keep a record of changed value
-  void SetSpecularColor(double, double, double);
-
-  // Description:
-  // Override Set method to keep a record of changed value
-  void SetIntensity(double);
-
-  // Description:
-  // Override Set method to keep a record of changed value
-  void SetConeAngle(double);
-
-  // Description:
-  // Override Set method to keep a record of changed value
-  void SetAttenuationValues(double, double, double);
-
-  // Description:
-  // Override Set method to keep a record of changed value
-  void SetExponent(double);
-
-  // Description:
-  // Override Set method to keep a record of changed value
-  void SetPositional(int);
-
-  // Description:
-  // Check whether value set by user
-  vtkGetMacro(PositionSet, bool);
-
-  // Description:
-  // Check whether value set by user
-  vtkGetMacro(FocalPointSet, bool);
-
-  // Description:
-  // Check whether value set by user
-  vtkGetMacro(AmbientColorSet, bool);
-
-  // Description:
-  // Check whether value set by user
-  vtkGetMacro(DiffuseColorSet, bool);
-
-  // Description:
-  // Check whether value set by user
-  vtkGetMacro(SpecularColorSet, bool);
-
-  // Description:
-  // Check whether value set by user
-  vtkGetMacro(IntensitySet, bool);
-
-  // Description:
-  // Check whether value set by user
-  vtkGetMacro(ConeAngleSet, bool);
-
-  // Description:
-  // Check whether value set by user
-  vtkGetMacro(AttenuationValuesSet, bool);
-
-  // Description:
-  // Check whether value set by user
-  vtkGetMacro(ExponentSet, bool);
-
-  // Description:
-  // Check whether value set by user
-  vtkGetMacro(PositionalSet, bool);
-
-protected:
-  vtkExternalLight();
-  ~vtkExternalLight();
-
-  int LightIndex;
-  int ReplaceMode;
-
-  bool PositionSet;
-  bool FocalPointSet;
-  bool AmbientColorSet;
-  bool DiffuseColorSet;
-  bool SpecularColorSet;
-  bool IntensitySet;
-  bool ConeAngleSet;
-  bool AttenuationValuesSet;
-  bool ExponentSet;
-  bool PositionalSet;
-
-private:
-  vtkExternalLight(const vtkExternalLight&); // Not implemented
-  void operator=(const vtkExternalLight&); // Not implemented
-};
-
-#endif // vtkExternalLight_h
diff --git a/Rendering/External/vtkExternalOpenGLCamera.cxx b/Rendering/External/vtkExternalOpenGLCamera.cxx
index 1e0292f..337f023 100644
--- a/Rendering/External/vtkExternalOpenGLCamera.cxx
+++ b/Rendering/External/vtkExternalOpenGLCamera.cxx
@@ -14,10 +14,7 @@
 =========================================================================*/
 #include "vtkExternalOpenGLCamera.h"
 
-#ifndef VTK_OPENGL2
 #include "vtkgluPickMatrix.h"
-#endif
-
 #include "vtkMatrix4x4.h"
 #include "vtkObjectFactory.h"
 #include "vtkOpenGLError.h"
@@ -39,14 +36,17 @@ vtkExternalOpenGLCamera::vtkExternalOpenGLCamera()
   this->UserProvidedViewTransform = false;
 }
 
+
 //----------------------------------------------------------------------------
 // Implement base class method.
 void vtkExternalOpenGLCamera::Render(vtkRenderer *ren)
 {
   vtkOpenGLClearErrorMacro();
 
+  double aspect[2];
   int  lowerLeft[2];
   int usize, vsize;
+  vtkMatrix4x4 *matrix = vtkMatrix4x4::New();
 
   vtkOpenGLRenderWindow *win = vtkOpenGLRenderWindow::SafeDownCast(ren->GetRenderWindow());
 
@@ -54,12 +54,6 @@ void vtkExternalOpenGLCamera::Render(vtkRenderer *ren)
   this->Stereo = (ren->GetRenderWindow())->GetStereoRender();
   ren->GetTiledSizeAndOrigin(&usize, &vsize, lowerLeft, lowerLeft+1);
 
-  // Take the window position into account
-  for (int i = 0; i < 2; ++i)
-    {
-    lowerLeft[i] = lowerLeft[i] + ren->GetRenderWindow()->GetPosition()[i];
-    }
-
   // if were on a stereo renderer draw to special parts of screen
   if (this->Stereo)
     {
@@ -129,11 +123,9 @@ void vtkExternalOpenGLCamera::Render(vtkRenderer *ren)
   glEnable(GL_SCISSOR_TEST);
   glScissor(lowerLeft[0], lowerLeft[1], usize, vsize);
 
-#ifndef VTK_OPENGL2
   // some renderer subclasses may have more complicated computations for the
   // aspect ratio. So take that into account by computing the difference
   // between our simple aspect ratio and what the actual renderer is reporting.
-  double aspect[2];
   ren->ComputeAspect();
   ren->GetAspect(aspect);
   double aspect2[2];
@@ -141,8 +133,6 @@ void vtkExternalOpenGLCamera::Render(vtkRenderer *ren)
   ren->vtkViewport::GetAspect(aspect2);
   double aspectModification = aspect[0] * aspect2[1] / (aspect[1] * aspect2[0]);
 
-  vtkMatrix4x4 *matrix = vtkMatrix4x4::New();
-
   glMatrixMode(GL_PROJECTION);
   if (usize && vsize)
     {
@@ -183,16 +173,14 @@ void vtkExternalOpenGLCamera::Render(vtkRenderer *ren)
     glMultMatrixd(matrix->Element[0]);
     }
 
-  matrix->Delete();
-
-#endif
-
   if ((ren->GetRenderWindow())->GetErase() && ren->GetErase()
       && !ren->GetIsPicking())
     {
     ren->Clear();
     }
 
+  matrix->Delete();
+
   vtkOpenGLCheckErrorMacro("failed after Render");
 }
 
diff --git a/Rendering/External/vtkExternalOpenGLCamera.h b/Rendering/External/vtkExternalOpenGLCamera.h
index 0ca1a9a..7e6ebce 100644
--- a/Rendering/External/vtkExternalOpenGLCamera.h
+++ b/Rendering/External/vtkExternalOpenGLCamera.h
@@ -19,8 +19,8 @@
 // This class extends vtkOpenGLCamera by introducing API wherein the camera
 // matrices can be set explicitly by the application.
 
-#ifndef vtkExternalOpenGLCamera_h
-#define vtkExternalOpenGLCamera_h
+#ifndef __vtkExternalOpenGLCamera_h
+#define __vtkExternalOpenGLCamera_h
 
 #include "vtkRenderingExternalModule.h" // For export macro
 #include "vtkOpenGLCamera.h"
diff --git a/Rendering/External/vtkExternalOpenGLRenderWindow.cxx b/Rendering/External/vtkExternalOpenGLRenderWindow.cxx
index ce73272..1b6b0fc 100644
--- a/Rendering/External/vtkExternalOpenGLRenderWindow.cxx
+++ b/Rendering/External/vtkExternalOpenGLRenderWindow.cxx
@@ -13,10 +13,6 @@
 
 =========================================================================*/
 
-#ifdef VTK_OPENGL2
-  #include "vtk_glew.h"
-#endif
-
 #include "vtkExternalOpenGLRenderWindow.h"
 #include "vtkObjectFactory.h"
 #include "vtkRendererCollection.h"
@@ -27,7 +23,6 @@ vtkStandardNewMacro(vtkExternalOpenGLRenderWindow);
 //----------------------------------------------------------------------------
 vtkExternalOpenGLRenderWindow::vtkExternalOpenGLRenderWindow()
 {
-  this->AutomaticWindowPositionAndResize = 1;
 }
 
 //----------------------------------------------------------------------------
@@ -38,20 +33,6 @@ vtkExternalOpenGLRenderWindow::~vtkExternalOpenGLRenderWindow()
 //----------------------------------------------------------------------------
 void vtkExternalOpenGLRenderWindow::Start(void)
 {
-  // Make sure all important OpenGL options are set for VTK
-  this->OpenGLInit();
-
-  // Use hardware acceleration
-  this->SetIsDirect(1);
-
-  if (this->AutomaticWindowPositionAndResize)
-    {
-    int info[4];
-    glGetIntegerv(GL_VIEWPORT, info);
-    this->SetPosition(info[0], info[1]);
-    this->SetSize(info[2], info[3]);
-    }
-
   // For stereo, render the correct eye based on the OpenGL buffer mode
   GLint bufferType;
   glGetIntegerv(GL_DRAW_BUFFER, &bufferType);
@@ -80,12 +61,6 @@ void vtkExternalOpenGLRenderWindow::Render()
 }
 
 //----------------------------------------------------------------------------
-bool vtkExternalOpenGLRenderWindow::IsCurrent(void)
-{
-  return true;
-}
-
-//----------------------------------------------------------------------------
 void vtkExternalOpenGLRenderWindow::PrintSelf(ostream& os, vtkIndent indent)
 {
   this->Superclass::PrintSelf(os, indent);
diff --git a/Rendering/External/vtkExternalOpenGLRenderWindow.h b/Rendering/External/vtkExternalOpenGLRenderWindow.h
index 6cfa6dd..0d7f12c 100644
--- a/Rendering/External/vtkExternalOpenGLRenderWindow.h
+++ b/Rendering/External/vtkExternalOpenGLRenderWindow.h
@@ -35,8 +35,8 @@
 // WindowIsCurrentEvent and WindowFrameEvent.
 // \sa vtkGenericOpenGLRenderWindow
 
-#ifndef vtkExternalOpenGLRenderWindow_h
-#define vtkExternalOpenGLRenderWindow_h
+#ifndef __vtkExternalOpenGLRenderWindow_h
+#define __vtkExternalOpenGLRenderWindow_h
 
 #include "vtkRenderingExternalModule.h" // For export macro
 #include "vtkGenericOpenGLRenderWindow.h"
@@ -58,33 +58,12 @@ public:
   // before calling the superclass' Render() method
   void Render();
 
-  // Description:
-  // Tells if this window is the current graphics context for the calling
-  // thread.
-  virtual bool IsCurrent();
-
-  // Description:
-  // Turn on/off a flag which enables/disables automatic positioning and
-  // resizing of the render window. By default, vtkExternalOpenGLRenderWindow
-  // queries the viewport position and size (glViewport) from the OpenGL state
-  // and uses it to resize itself. However, in special circumstances this
-  // feature is undesirable. One such circumstance may be to avoid performance
-  // penalty of querying OpenGL state variables. So the following boolean is
-  // provided to disable automatic window resize.
-  // (Turn AutomaticWindowPositionAndResize off if you do not want the viewport
-  // to be queried from the OpenGL state.)
-  vtkGetMacro(AutomaticWindowPositionAndResize,int);
-  vtkSetMacro(AutomaticWindowPositionAndResize,int);
-  vtkBooleanMacro(AutomaticWindowPositionAndResize,int);
-
 protected:
   vtkExternalOpenGLRenderWindow();
   ~vtkExternalOpenGLRenderWindow();
 
-  int AutomaticWindowPositionAndResize;
-
 private:
   vtkExternalOpenGLRenderWindow(const vtkExternalOpenGLRenderWindow&); // Not implemented
   void operator=(const vtkExternalOpenGLRenderWindow&); // Not implemented
 };
-#endif //vtkExternalOpenGLRenderWindow_h
+#endif //__vtkExternalOpenGLRenderWindow_h
diff --git a/Rendering/External/vtkExternalOpenGLRenderer.cxx b/Rendering/External/vtkExternalOpenGLRenderer.cxx
index 832774b..4174143 100644
--- a/Rendering/External/vtkExternalOpenGLRenderer.cxx
+++ b/Rendering/External/vtkExternalOpenGLRenderer.cxx
@@ -16,10 +16,8 @@
 
 #include "vtkCamera.h"
 #include "vtkCommand.h"
-#include "vtkExternalLight.h"
 #include "vtkExternalOpenGLCamera.h"
 #include "vtkLightCollection.h"
-#include "vtkLightCollection.h"
 #include "vtkLight.h"
 #include "vtkMath.h"
 #include "vtkMatrix4x4.h"
@@ -30,8 +28,6 @@
 #include "vtkRenderWindow.h"
 #include "vtkTexture.h"
 
-#define MAX_LIGHTS 8
-
 vtkStandardNewMacro(vtkExternalOpenGLRenderer);
 
 //----------------------------------------------------------------------------
@@ -39,15 +35,116 @@ vtkExternalOpenGLRenderer::vtkExternalOpenGLRenderer()
 {
   this->PreserveColorBuffer = 1;
   this->PreserveDepthBuffer = 1;
-  this->SetAutomaticLightCreation(0);
-  this->ExternalLights = vtkLightCollection::New();
 }
 
 //----------------------------------------------------------------------------
 vtkExternalOpenGLRenderer::~vtkExternalOpenGLRenderer()
 {
-  this->ExternalLights->Delete();
-  this->ExternalLights = NULL;
+}
+
+//----------------------------------------------------------------------------
+void vtkExternalOpenGLRenderer::Clear()
+{
+  vtkOpenGLClearErrorMacro();
+
+  GLbitfield  clear_mask = 0;
+
+  if (!this->Transparent() && !this->GetPreserveColorBuffer())
+    {
+    glClearColor( static_cast<GLclampf>(this->Background[0]),
+                  static_cast<GLclampf>(this->Background[1]),
+                  static_cast<GLclampf>(this->Background[2]),
+                  static_cast<GLclampf>(0.0));
+    clear_mask |= GL_COLOR_BUFFER_BIT;
+    }
+
+  if (!this->GetPreserveDepthBuffer())
+    {
+    glClearDepth(static_cast<GLclampf>(1.0));
+    clear_mask |= GL_DEPTH_BUFFER_BIT;
+    }
+
+  vtkDebugMacro(<< "glClear\n");
+  glClear(clear_mask);
+
+  // If gradient background is turned on, draw it now.
+  if (!this->Transparent() &&
+      (this->GradientBackground || this->TexturedBackground))
+    {
+    double tile_viewport[4];
+    this->GetRenderWindow()->GetTileViewport(tile_viewport);
+    glPushAttrib(GL_ENABLE_BIT | GL_TRANSFORM_BIT);
+    glDisable(GL_ALPHA_TEST);
+    glDisable(GL_DEPTH_TEST);
+    glDisable(GL_LIGHTING);
+    glDisable(GL_TEXTURE_1D);
+    glDisable(GL_TEXTURE_2D);
+    glDisable(GL_BLEND);
+    glShadeModel(GL_SMOOTH); // color interpolation
+
+    glMatrixMode(GL_MODELVIEW);
+    glPushMatrix();
+      {
+      glLoadIdentity();
+      glMatrixMode(GL_PROJECTION);
+      glPushMatrix();
+        {
+        glLoadIdentity();
+        glOrtho(
+          tile_viewport[0],
+          tile_viewport[2],
+          tile_viewport[1],
+          tile_viewport[3],
+          -1.0, 1.0);
+
+        //top vertices
+        if (this->TexturedBackground && this->BackgroundTexture)
+          {
+          glEnable(GL_TEXTURE_2D);
+
+          this->BackgroundTexture->Render(this);
+
+          // NOTE: By default the mode is GL_MODULATE. Since the user
+          // cannot set the mode, the default is set to replace.
+          glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
+          glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+          glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+
+          // NOTE: vtkTexture Render enables the alpha test
+          // so that no buffer is affected if alpha of incoming fragment is
+          // below the threshold. Here we have to enable it so that it won't
+          // rejects the fragments of the quad as the alpha is set to 0 on it.
+          glDisable(GL_ALPHA_TEST);
+          }
+
+        glBegin(GL_QUADS);
+        glColor4d(this->Background[0],this->Background[1],this->Background[2],
+                  0.0);
+        glTexCoord2f(0.0, 0.0);
+        glVertex2f(0.0, 0.0);
+
+        glTexCoord2f(1.0, 0.0);
+        glVertex2f(1.0, 0);
+
+        //bottom vertices
+        glColor4d(this->Background2[0],this->Background2[1],
+                  this->Background2[2],0.0);
+        glTexCoord2f(1.0, 1.0);
+        glVertex2f(1.0, 1.0);
+
+        glTexCoord2f(0.0, 1.0);
+        glVertex2f(0.0, 1.0);
+
+        glEnd();
+        }
+      glMatrixMode(GL_PROJECTION);
+      glPopMatrix();
+      }
+    glMatrixMode(GL_MODELVIEW);
+    glPopMatrix();
+    glPopAttrib();
+    }
+  vtkOpenGLCheckErrorMacro("failed after Clear");
 }
 
 //----------------------------------------------------------------------------
@@ -92,232 +189,26 @@ void vtkExternalOpenGLRenderer::Render(void)
   matrix->MultiplyPoint(focalPoint, newFocalPoint);
   camera->SetFocalPoint(newFocalPoint);
 
-  matrix->Delete();
+  matrix->DeepCopy(mv);
+  matrix->Invert();
 
-  // Lights
-  // Query lights existing in the external context
-  // and tweak them based on vtkExternalLight objects added by the user
-  GLenum curLight;
-  for (curLight = GL_LIGHT0;
-       curLight < GL_LIGHT0 + MAX_LIGHTS;
-       curLight++)
+  vtkCollectionSimpleIterator sit;
+  vtkLight* light;
+  for (this->Lights->InitTraversal(sit);
+    (light = this->Lights->GetNextLight(sit)); )
     {
-    GLboolean status;
-    glGetBooleanv(curLight, &status);
-
-    int l_ind = static_cast<int> (curLight - GL_LIGHT0);
-    vtkLight* light = NULL;
-    bool light_created = false;
-    light = vtkLight::SafeDownCast(
-              this->GetLights()->GetItemAsObject(l_ind));
-    if (light)
-      {
-      if (!status)
-        {
-        // This is the case when we have a VTK light in the scene but no
-        // external light corresponding to that index in the context.
-        // In this case, we remove the VTK light as well.
-        light->SwitchOff();
-        this->RemoveLight(light);
-
-        // No need to go forward
-        continue;
-        }
-      }
-    else
-      {
-      // No matching light found in the VTK light collection
-      if (status)
-        {
-        // Create a new light only if one is present in the external context
-        light = vtkLight::New();
-        // Headlight because VTK will apply transform matrices
-        light->SetLightTypeToHeadlight();
-        light_created = true;
-        }
-      else
-        {
-        // No need to go forward as this light is not being used
-        continue;
-        }
-      }
-
-    // Find out if there is an external light object associated with this
-    // light index.
-    vtkCollectionSimpleIterator sit;
-    vtkExternalLight* eLight;
-    vtkExternalLight* curExtLight = NULL;
-    for (this->ExternalLights->InitTraversal(sit);
-         (eLight = vtkExternalLight::SafeDownCast(
-          this->ExternalLights->GetNextLight(sit))); )
-      {
-      if (eLight &&
-          (static_cast<GLenum>(eLight->GetLightIndex()) == curLight))
-        {
-        curExtLight = eLight;
-        break;
-        }
-      }
-
-    if (curExtLight &&
-        (curExtLight->GetReplaceMode() == vtkExternalLight::ALL_PARAMS))
-      {
-      // If the replace mode is all parameters, blatantly overwrite the
-      // parameters of existing/new light
-      light->DeepCopy(curExtLight);
-      }
-    else
-      {
-
-      GLfloat info[4];
-
-      // Set color parameters
-      if (curExtLight && curExtLight->GetIntensitySet())
-        {
-        light->SetIntensity(curExtLight->GetIntensity());
-        }
-
-      if (curExtLight && curExtLight->GetAmbientColorSet())
-        {
-        light->SetAmbientColor(curExtLight->GetAmbientColor());
-        }
-      else
-        {
-        glGetLightfv(curLight, GL_AMBIENT, info);
-        light->SetAmbientColor(info[0], info[1], info[2]);
-        }
-      if (curExtLight && curExtLight->GetDiffuseColorSet())
-        {
-        light->SetDiffuseColor(curExtLight->GetDiffuseColor());
-        }
-      else
-        {
-        glGetLightfv(curLight, GL_DIFFUSE, info);
-        light->SetDiffuseColor(info[0], info[1], info[2]);
-        }
-      if (curExtLight && curExtLight->GetSpecularColorSet())
-        {
-        light->SetSpecularColor(curExtLight->GetSpecularColor());
-        }
-      else
-        {
-        glGetLightfv(curLight, GL_SPECULAR, info);
-        light->SetSpecularColor(info[0], info[1], info[2]);
-        }
-
-      // Position, focal point and positional
-      glGetLightfv(curLight, GL_POSITION, info);
-
-      if (curExtLight && curExtLight->GetPositionalSet())
-        {
-        light->SetPositional(curExtLight->GetPositional());
-        }
-      else
-        {
-        light->SetPositional(info[3] > 0.0 ? 1 : 0);
-        }
-
-      if (!light->GetPositional())
-        {
-        if (curExtLight && curExtLight->GetFocalPointSet())
-          {
-          light->SetFocalPoint(curExtLight->GetFocalPoint());
-          if (curExtLight->GetPositionSet())
-            {
-            light->SetPosition(curExtLight->GetPosition());
-            }
-          else
-            {
-            light->SetPosition(info[0], info[1], info[2]);
-            }
-          }
-        else
-          {
-          light->SetFocalPoint(0, 0, 0);
-          if (curExtLight && curExtLight->GetPositionSet())
-            {
-            light->SetPosition(curExtLight->GetPosition());
-            }
-          else
-            {
-            light->SetPosition(-info[0], -info[1], -info[2]);
-            }
-          }
-        }
-      else
-        {
-        if (curExtLight && curExtLight->GetPositionSet())
-          {
-          light->SetPosition(curExtLight->GetPosition());
-          }
-        else
-          {
-          light->SetPosition(info[0], info[1], info[2]);
-          }
-
-        // Attenuation
-        if (curExtLight && curExtLight->GetAttenuationValuesSet())
-          {
-          light->SetAttenuationValues(curExtLight->GetAttenuationValues());
-          }
-        else
-          {
-          glGetLightfv(curLight, GL_CONSTANT_ATTENUATION, &info[0]);
-          glGetLightfv(curLight, GL_LINEAR_ATTENUATION, &info[1]);
-          glGetLightfv(curLight, GL_QUADRATIC_ATTENUATION, &info[2]);
-          light->SetAttenuationValues(info[0], info[1], info[2]);
-          }
-
-        // Cutoff
-        if (curExtLight && curExtLight->GetConeAngleSet())
-          {
-          light->SetConeAngle(curExtLight->GetConeAngle());
-          }
-        else
-          {
-          glGetLightfv(curLight, GL_SPOT_CUTOFF, &info[0]);
-          light->SetConeAngle(info[0]);
-          }
-
-        if (light->GetConeAngle() < 180.0)
-          {
-          // Exponent
-          if (curExtLight && curExtLight->GetExponentSet())
-            {
-            light->SetExponent(curExtLight->GetExponent());
-            }
-          else
-            {
-            glGetLightfv(curLight, GL_SPOT_EXPONENT, &info[0]);
-            light->SetExponent(info[0]);
-            }
-
-          // Direction
-          if (curExtLight && curExtLight->GetFocalPointSet())
-            {
-            light->SetFocalPoint(curExtLight->GetFocalPoint());
-            }
-          else
-            {
-            glGetLightfv(curLight, GL_SPOT_DIRECTION, info);
-            for (unsigned int i = 0; i < 3; ++i)
-              {
-              info[i] += light->GetPosition()[i];
-              }
-            light->SetFocalPoint(info[0], info[1], info[2]);
-            }
-          }
-        }
-      }
-
-    // If we created a new VTK light, add it to the collection
-    if (light_created)
+    // If we set the transform matrix then even for the headlight
+    // vtkOpenGLLight will use it and result in wrong lighting computation.
+    // What we want is to use camera position and focal point only
+    // when we have a head light.
+    if (light->LightTypeIsCameraLight())
       {
-      this->AddLight(light);
-      light->Delete();
+      light->SetTransformMatrix(matrix);
       }
     }
 
+  matrix->Delete();
+
   // Forward the call to the Superclass
   this->Superclass::Render();
 }
@@ -331,49 +222,8 @@ vtkCamera* vtkExternalOpenGLRenderer::MakeCamera()
 }
 
 //----------------------------------------------------------------------------
-void vtkExternalOpenGLRenderer::AddExternalLight(vtkExternalLight *light)
-{
-  if (!light)
-    {
-    return;
-    }
-
-  vtkExternalLight* aLight;
-
-  vtkCollectionSimpleIterator sit;
-  for (this->ExternalLights->InitTraversal(sit);
-       (aLight = vtkExternalLight::SafeDownCast(
-          this->ExternalLights->GetNextLight(sit))); )
-    {
-    if (aLight && (aLight->GetLightIndex() == light->GetLightIndex()))
-      {
-      vtkErrorMacro( << "Attempting to add light with index " <<
-                     light->GetLightIndex() <<
-                     ". But light with same index already exists.");
-      return;
-      }
-    }
-
-  this->ExternalLights->AddItem(light);
-}
-
-//----------------------------------------------------------------------------
-void vtkExternalOpenGLRenderer::RemoveExternalLight(vtkExternalLight *light)
-{
-  this->ExternalLights->RemoveItem(light);
-}
-
-//----------------------------------------------------------------------------
-void vtkExternalOpenGLRenderer::RemoveAllExternalLights()
-{
-  this->ExternalLights->RemoveAllItems();
-}
-
-//----------------------------------------------------------------------------
 void vtkExternalOpenGLRenderer::PrintSelf(ostream &os, vtkIndent indent)
 {
+  os << indent << "PreserveColorBuffer: " << this->PreserveColorBuffer << "\n";
   this->Superclass::PrintSelf(os, indent);
-
-  os << indent << "External Lights:\n";
-  this->ExternalLights->PrintSelf(os, indent.GetNextIndent());
 }
diff --git a/Rendering/External/vtkExternalOpenGLRenderer.h b/Rendering/External/vtkExternalOpenGLRenderer.h
index d118869..9294635 100644
--- a/Rendering/External/vtkExternalOpenGLRenderer.h
+++ b/Rendering/External/vtkExternalOpenGLRenderer.h
@@ -27,16 +27,12 @@
 //
 // \sa vtkExternalOpenGLCamera
 
-#ifndef vtkExternalOpenGLRenderer_h
-#define vtkExternalOpenGLRenderer_h
+#ifndef __vtkExternalOpenGLRenderer_h
+#define __vtkExternalOpenGLRenderer_h
 
 #include "vtkRenderingExternalModule.h" // For export macro
 #include "vtkOpenGLRenderer.h"
 
-// Forward declarations
-class vtkLightCollection;
-class vtkExternalLight;
-
 class VTKRENDERINGEXTERNAL_EXPORT vtkExternalOpenGLRenderer :
   public vtkOpenGLRenderer
 {
@@ -46,37 +42,36 @@ public:
   void PrintSelf(ostream& os, vtkIndent indent);
 
   // Description:
+  // Implementation for the Clear method that clears the buffer if requested
+  void Clear(void);
+
+  // Description:
   // Synchronize camera and light parameters
   void Render(void);
 
   // Description:
+  // Normally the vtkOpenGLRenderer clears the color buffer before rendering a
+  // new frame. When this flag is true, the color buffer is not cleared. This
+  // can be helpful when there are multiple visualization systems
+  // sharing the same context. Default value is 1.
+  vtkGetMacro(PreserveColorBuffer, int);
+  vtkSetMacro(PreserveColorBuffer, int);
+  vtkBooleanMacro(PreserveColorBuffer, int);
+
+  // Description:
   // Create a new Camera sutible for use with this type of Renderer.
   // This function creates the vtkExternalOpenGLCamera.
   vtkCamera* MakeCamera();
 
-  // Description:
-  // Add an external light to the list of external lights.
-  virtual void AddExternalLight(vtkExternalLight *);
-
-  // Description:
-  // Remove an external light from the list of external lights.
-  virtual void RemoveExternalLight(vtkExternalLight *);
-
-  // Description:
-  // Remove all external lights
-  virtual void RemoveAllExternalLights();
-
-  // Description:
-
 protected:
   vtkExternalOpenGLRenderer();
   ~vtkExternalOpenGLRenderer();
 
-  vtkLightCollection *ExternalLights;
+  int PreserveColorBuffer;
 
 private:
   vtkExternalOpenGLRenderer(const vtkExternalOpenGLRenderer&);  // Not implemented.
   void operator=(const vtkExternalOpenGLRenderer&);  // Not implemented.
 };
 
-#endif //vtkExternalOpenGLRenderer_h
+#endif //__vtkExternalOpenGLRenderer_h
diff --git a/Rendering/FreeType/Testing/Cxx/CMakeLists.txt b/Rendering/FreeType/Testing/Cxx/CMakeLists.txt
index 435be43..df9207b 100644
--- a/Rendering/FreeType/Testing/Cxx/CMakeLists.txt
+++ b/Rendering/FreeType/Testing/Cxx/CMakeLists.txt
@@ -1,3 +1,11 @@
+# Check that matplotlib is available
+include(FindPythonModules)
+find_python_module(matplotlib MATPLOTLIB_FOUND)
+
+if(NOT MATPLOTLIB_FOUND)
+  message(STATUS "Matplotlib not found! MathText rendering will not be available until it is installed. Disabling tests.")
+endif()
+
 # add tests that do not require data or produce vector output
 set(TestFreeTypeTextMapperNoMath_ARGS DATA{../Data/Fonts/DejaVuSans.ttf})
 set(TestMathTextFreeTypeTextRendererNoMath_ARGS
@@ -13,25 +21,15 @@ vtk_add_test_cxx(${vtk-module}CxxTests tests
   TestTextActorDepthPeeling.cxx
   TestTextActor3DAlphaBlending.cxx
   TestTextActor3DDepthPeeling.cxx
-  TestTextMapper.cxx
   )
 
-# Check for vtkErrorMacro calls in these tests (mainly for empty inputs):
-set_tests_properties(
-  ${vtk-module}Cxx-TestTextActor
-  ${vtk-module}Cxx-TestTextActor3D
-  PROPERTIES FAIL_REGULAR_EXPRESSION "ERROR:"
-)
-
-if(${Module_vtkRenderingMatplotlib})
+if(MATPLOTLIB_FOUND)
   set(TestMathTextFreeTypeTextRenderer_ARGS DATA{../Data/Fonts/DejaVuSans.ttf})
   set(TestFreeTypeTextMapper_ARGS DATA{../Data/Fonts/DejaVuSans.ttf})
-  set(TestFontDPIScaling_ARGS DATA{../Data/Fonts/DejaVuSans.ttf})
 
   vtk_add_test_cxx(${vtk-module}CxxTests matplotlib_tests
     TestMathTextFreeTypeTextRenderer.cxx
     TestFreeTypeTextMapper.cxx
-    TestFontDPIScaling.cxx
     )
   list(APPEND tests
     ${matplotlib_tests})
diff --git a/Rendering/FreeType/Testing/Cxx/TestFTStringToPath.cxx b/Rendering/FreeType/Testing/Cxx/TestFTStringToPath.cxx
index 0fb4a63..14b32c0 100644
--- a/Rendering/FreeType/Testing/Cxx/TestFTStringToPath.cxx
+++ b/Rendering/FreeType/Testing/Cxx/TestFTStringToPath.cxx
@@ -58,9 +58,9 @@ int TestFTStringToPath(int , char *[])
   vtkNew<vtkPath> path;
   vtkNew<vtkTextProperty> tprop;
 
-  vtkFreeTypeTools::GetInstance()->StringToPath(
-        tprop.GetPointer(), vtkStdString("FreeType Path"),
-        view->GetRenderWindow()->GetDPI(), path.GetPointer());
+  vtkFreeTypeTools::GetInstance()->StringToPath(tprop.GetPointer(),
+                                                vtkStdString("FreeType Path"),
+                                                path.GetPointer());
 
   test->SetPath(path.GetPointer());
 
diff --git a/Rendering/FreeType/Testing/Cxx/TestFontDPIScaling.cxx b/Rendering/FreeType/Testing/Cxx/TestFontDPIScaling.cxx
deleted file mode 100644
index 4c22988..0000000
--- a/Rendering/FreeType/Testing/Cxx/TestFontDPIScaling.cxx
+++ /dev/null
@@ -1,225 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    TestMathTextFreeTypeTextRenderer.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 "vtkTextRenderer.h"
-
-#include "vtkNew.h"
-#include "vtkRenderer.h"
-#include "vtkRenderWindow.h"
-#include "vtkRenderWindowInteractor.h"
-#include "vtkStdString.h"
-#include "vtkTextActor.h"
-#include "vtkTextProperty.h"
-
-#include <iostream>
-#include <string>
-
-//----------------------------------------------------------------------------
-int TestFontDPIScaling(int argc, char *argv[])
-{
-  if (argc < 2)
-    {
-    cerr << "Missing font filename." << endl;
-    return EXIT_FAILURE;
-    }
-
-  std::string uncodeFontFile(argv[1]);
-
-  vtkStdString str = "Sample multiline\ntext rendered\nusing FreeTypeTools.";
-
-  vtkNew<vtkTextActor> actor1;
-  actor1->GetTextProperty()->SetFontSize(20);
-  actor1->GetTextProperty()->SetColor(1.0, 0.0, 0.0);
-  actor1->GetTextProperty()->SetJustificationToLeft();
-  actor1->GetTextProperty()->SetVerticalJustificationToTop();
-  actor1->GetTextProperty()->SetFontFamilyToTimes();
-  actor1->SetInput(str.c_str());
-  actor1->SetPosition(10, 590);
-
-  vtkNew<vtkTextActor> actor2;
-  actor2->GetTextProperty()->SetFontSize(20);
-  actor2->GetTextProperty()->SetColor(0.0, 1.0, 0.0);
-  actor2->GetTextProperty()->SetJustificationToRight();
-  actor2->GetTextProperty()->SetVerticalJustificationToTop();
-  actor2->GetTextProperty()->SetFontFamilyToCourier();
-  actor2->SetInput(str.c_str());
-  actor2->SetPosition(590, 590);
-
-  vtkNew<vtkTextActor> actor3;
-  actor3->GetTextProperty()->SetFontSize(20);
-  actor3->GetTextProperty()->SetColor(0.0, 0.0, 1.0);
-  actor3->GetTextProperty()->SetJustificationToLeft();
-  actor3->GetTextProperty()->SetVerticalJustificationToBottom();
-  actor3->GetTextProperty()->SetItalic(1);
-  actor3->SetInput(str.c_str());
-  actor3->SetPosition(10, 10);
-
-  vtkNew<vtkTextActor> actor4;
-  actor4->GetTextProperty()->SetFontSize(20);
-  actor4->GetTextProperty()->SetColor(0.3, 0.4, 0.5);
-  actor4->GetTextProperty()->SetJustificationToRight();
-  actor4->GetTextProperty()->SetVerticalJustificationToBottom();
-  actor4->GetTextProperty()->SetBold(1);
-  actor4->GetTextProperty()->SetShadow(1);
-  actor4->GetTextProperty()->SetShadowOffset(-3, 2);
-  actor4->SetInput(str.c_str());
-  actor4->SetPosition(590, 10);
-
-  vtkNew<vtkTextActor> actor5;
-  actor5->GetTextProperty()->SetFontSize(20);
-  actor5->GetTextProperty()->SetColor(1.0, 1.0, 0.0);
-  actor5->GetTextProperty()->SetJustificationToCentered();
-  actor5->GetTextProperty()->SetVerticalJustificationToCentered();
-  actor5->GetTextProperty()->SetBold(1);
-  actor5->GetTextProperty()->SetItalic(1);
-  actor5->GetTextProperty()->SetShadow(1);
-  actor5->GetTextProperty()->SetShadowOffset(5, -8);
-  actor5->SetInput(str.c_str());
-  actor5->SetPosition(300, 300);
-
-  vtkNew<vtkTextActor> actor6;
-  actor6->GetTextProperty()->SetFontSize(16);
-  actor6->GetTextProperty()->SetColor(1.0, 0.5, 0.2);
-  actor6->GetTextProperty()->SetJustificationToCentered();
-  actor6->GetTextProperty()->SetVerticalJustificationToCentered();
-  actor6->GetTextProperty()->SetOrientation(45);
-  actor6->SetInput(str.c_str());
-  actor6->SetPosition(300, 450);
-
-  vtkNew<vtkTextActor> actor7;
-  actor7->GetTextProperty()->SetFontSize(16);
-  actor7->GetTextProperty()->SetColor(0.5, 0.2, 1.0);
-  actor7->GetTextProperty()->SetJustificationToLeft();
-  actor7->GetTextProperty()->SetVerticalJustificationToCentered();
-  actor7->GetTextProperty()->SetOrientation(45);
-  actor7->SetInput(str.c_str());
-  actor7->SetPosition(100, 156);
-
-  vtkNew<vtkTextActor> actor8;
-  actor8->GetTextProperty()->SetFontSize(16);
-  actor8->GetTextProperty()->SetColor(0.8, 1.0, 0.3);
-  actor8->GetTextProperty()->SetJustificationToRight();
-  actor8->GetTextProperty()->SetVerticalJustificationToCentered();
-  actor8->GetTextProperty()->SetOrientation(45);
-  actor8->SetInput(str.c_str());
-  actor8->SetPosition(500, 249);
-
-  // Mathtext tests
-
-  // Test that escaped "$" are passed through to freetype:
-  vtkNew<vtkTextActor> actor9;
-  actor9->GetTextProperty()->SetFontSize(12);
-  actor9->GetTextProperty()->SetColor(0.2, 0.5, 1.0);
-  actor9->SetInput("Escaped dollar signs:\n\\$10, \\$20");
-  actor9->SetPosition(100, 450);
-
-  vtkNew<vtkTextActor> actor10;
-  actor10->GetTextProperty()->SetFontSize(16);
-  actor10->GetTextProperty()->SetColor(0.5, 0.2, 1.0);
-  actor10->GetTextProperty()->SetJustificationToRight();
-  actor10->GetTextProperty()->SetOrientation(45);
-  actor10->SetInput("Test MathText $\\int_0^\\infty\\frac{2\\pi}"
-                    "{x - \\frac{z}{4}}\\,dx$");
-  actor10->SetPosition(588, 433);
-
-  // Invalid latex markup -- should fallback to freetype.
-  vtkNew<vtkTextActor> actor11;
-  actor11->GetTextProperty()->SetFontSize(15);
-  actor11->GetTextProperty()->SetColor(1.0, 0.5, 0.2);
-  actor11->SetInput("Test FreeType fallback:\n$\\asdf$");
-  actor11->SetPosition(10, 350);
-
-  // Both $...$ and \\$
-  vtkNew<vtkTextActor> actor12;
-  actor12->GetTextProperty()->SetFontSize(18);
-  actor12->GetTextProperty()->SetColor(0.0, 1.0, 0.7);
-  actor12->SetInput("Test MathText '\\$' $\\$\\sqrt[3]{8}$");
-  actor12->SetPosition(10, 300);
-
-  // $...$ without other text.
-  vtkNew<vtkTextActor> actor13;
-  actor13->GetTextProperty()->SetFontSize(18);
-  actor13->GetTextProperty()->SetColor(0.2, 1.0, 1.0);
-  actor13->SetInput("$A = \\pi r^2$");
-  actor13->SetPosition(10, 250);
-
-  // Numbers, using courier, Text that gets 'cut off'
-  vtkNew<vtkTextActor> actor14;
-  actor14->GetTextProperty()->SetFontSize(21);
-  actor14->GetTextProperty()->SetColor(1.0, 0.0, 0.0);
-  actor14->GetTextProperty()->SetJustificationToCentered();
-  actor14->GetTextProperty()->SetVerticalJustificationToCentered();
-  actor14->GetTextProperty()->SetBold(1);
-  actor14->GetTextProperty()->SetItalic(1);
-  actor14->GetTextProperty()->SetFontFamilyToCourier();
-  actor14->SetInput("4.0");
-  actor14->SetPosition(500, 400);
-
-  // UTF-8 freetype handling:
-  vtkNew<vtkTextActor> actor15;
-  actor15->GetTextProperty()->SetFontFamily(VTK_FONT_FILE);
-  actor15->GetTextProperty()->SetFontFile(uncodeFontFile.c_str());
-  actor15->GetTextProperty()->SetJustificationToCentered();
-  actor15->GetTextProperty()->SetVerticalJustificationToCentered();
-  actor15->GetTextProperty()->SetFontSize(18);
-  actor15->GetTextProperty()->SetColor(0.0, 1.0, 0.7);
-  actor15->SetInput("UTF-8 FreeType: \xce\xa8\xd2\x94\xd2\x96\xd1\x84\xd2\xbe");
-  actor15->SetPosition(300, 110);
-
-  // Test for rotated kerning (PR#15301)
-  vtkNew<vtkTextActor> actor16;
-  actor16->GetTextProperty()->SetFontFile(uncodeFontFile.c_str());
-  actor16->GetTextProperty()->SetFontFamily(VTK_FONT_FILE);
-  actor16->GetTextProperty()->SetJustificationToCentered();
-  actor16->GetTextProperty()->SetVerticalJustificationToCentered();
-  actor16->GetTextProperty()->SetFontSize(18);
-  actor16->GetTextProperty()->SetOrientation(90);
-  actor16->GetTextProperty()->SetColor(0.0, 1.0, 0.7);
-  actor16->SetInput("oTeVaVoVAW");
-  actor16->SetPosition(300, 200);
-
-  vtkNew<vtkRenderer> ren;
-  ren->SetBackground(0.1, 0.1, 0.1);
-  vtkNew<vtkRenderWindow> win;
-  win->SetDPI(96);
-  win->SetSize(600, 600);
-  win->AddRenderer(ren.GetPointer());
-  vtkNew<vtkRenderWindowInteractor> iren;
-  iren->SetRenderWindow(win.GetPointer());
-
-  ren->AddActor(actor1.GetPointer());
-  ren->AddActor(actor2.GetPointer());
-  ren->AddActor(actor3.GetPointer());
-  ren->AddActor(actor4.GetPointer());
-  ren->AddActor(actor5.GetPointer());
-  ren->AddActor(actor6.GetPointer());
-  ren->AddActor(actor7.GetPointer());
-  ren->AddActor(actor8.GetPointer());
-  ren->AddActor(actor9.GetPointer());
-  ren->AddActor(actor10.GetPointer());
-  ren->AddActor(actor11.GetPointer());
-  ren->AddActor(actor12.GetPointer());
-  ren->AddActor(actor13.GetPointer());
-  ren->AddActor(actor14.GetPointer());
-  ren->AddActor(actor15.GetPointer());
-  ren->AddActor(actor16.GetPointer());
-
-  win->SetMultiSamples(0);
-  win->Render();
-  win->GetInteractor()->Initialize();
-  win->GetInteractor()->Start();
-
-  return EXIT_SUCCESS;
-}
diff --git a/Rendering/FreeType/Testing/Cxx/TestFreeTypeTextMapper.cxx b/Rendering/FreeType/Testing/Cxx/TestFreeTypeTextMapper.cxx
index 3ac4c04..96b9273 100644
--- a/Rendering/FreeType/Testing/Cxx/TestFreeTypeTextMapper.cxx
+++ b/Rendering/FreeType/Testing/Cxx/TestFreeTypeTextMapper.cxx
@@ -230,20 +230,6 @@ int TestFreeTypeTextMapper(int argc, char *argv[])
   mapper15->SetInput("UTF-8 FreeType: \xce\xa8\xd2\x94\xd2\x96\xd1\x84\xd2\xbe");
   actor15->SetPosition(300, 110);
 
-  // Test for rotated kerning (PR#15301)
-  vtkNew<vtkTextMapper> mapper16;
-  vtkNew<vtkActor2D> actor16;
-  actor16->SetMapper(mapper16.GetPointer());
-  mapper16->GetTextProperty()->SetFontFile(uncodeFontFile.c_str());
-  mapper16->GetTextProperty()->SetFontFamily(VTK_FONT_FILE);
-  mapper16->GetTextProperty()->SetJustificationToCentered();
-  mapper16->GetTextProperty()->SetVerticalJustificationToCentered();
-  mapper16->GetTextProperty()->SetFontSize(18);
-  mapper16->GetTextProperty()->SetOrientation(90);
-  mapper16->GetTextProperty()->SetColor(0.0, 1.0, 0.7);
-  mapper16->SetInput("oTeVaVoVAW");
-  actor16->SetPosition(300, 200);
-
   // Boring rendering setup....
 
   vtkNew<vtkRenderer> ren;
@@ -269,7 +255,6 @@ int TestFreeTypeTextMapper(int argc, char *argv[])
   ren->AddActor(actor13.GetPointer());
   ren->AddActor(actor14.GetPointer());
   ren->AddActor(actor15.GetPointer());
-  ren->AddActor(actor16.GetPointer());
 
   win->SetMultiSamples(0);
   win->Render();
diff --git a/Rendering/FreeType/Testing/Cxx/TestFreeTypeTextMapperNoMath.cxx b/Rendering/FreeType/Testing/Cxx/TestFreeTypeTextMapperNoMath.cxx
index f9a4cf0..c040428 100644
--- a/Rendering/FreeType/Testing/Cxx/TestFreeTypeTextMapperNoMath.cxx
+++ b/Rendering/FreeType/Testing/Cxx/TestFreeTypeTextMapperNoMath.cxx
@@ -181,20 +181,6 @@ int TestFreeTypeTextMapperNoMath(int argc, char *argv[])
   mapper10->SetInput("UTF-8 FreeType: \xce\xa8\xd2\x94\xd2\x96\xd1\x84\xd2\xbe");
   actor10->SetPosition(300, 110);
 
-  // Test for rotated kerning (PR#15301)
-  vtkNew<vtkTextMapper> mapper11;
-  vtkNew<vtkActor2D> actor11;
-  actor11->SetMapper(mapper11.GetPointer());
-  mapper11->GetTextProperty()->SetFontFile(uncodeFontFile.c_str());
-  mapper11->GetTextProperty()->SetFontFamily(VTK_FONT_FILE);
-  mapper11->GetTextProperty()->SetJustificationToCentered();
-  mapper11->GetTextProperty()->SetVerticalJustificationToCentered();
-  mapper11->GetTextProperty()->SetFontSize(18);
-  mapper11->GetTextProperty()->SetOrientation(90);
-  mapper11->GetTextProperty()->SetColor(0.0, 1.0, 0.7);
-  mapper11->SetInput("oTeVaVoVAW");
-  actor11->SetPosition(300, 200);
-
   // Boring rendering setup....
 
   vtkNew<vtkRenderer> ren;
@@ -215,7 +201,6 @@ int TestFreeTypeTextMapperNoMath(int argc, char *argv[])
   ren->AddActor(actor8.GetPointer());
   ren->AddActor(actor9.GetPointer());
   ren->AddActor(actor10.GetPointer());
-  ren->AddActor(actor11.GetPointer());
 
   win->SetMultiSamples(0);
   win->Render();
diff --git a/Rendering/FreeType/Testing/Cxx/TestTextActor.cxx b/Rendering/FreeType/Testing/Cxx/TestTextActor.cxx
index bb18e9e..d77b74f 100644
--- a/Rendering/FreeType/Testing/Cxx/TestTextActor.cxx
+++ b/Rendering/FreeType/Testing/Cxx/TestTextActor.cxx
@@ -129,27 +129,6 @@ int TestTextActor(int, char *[])
   anchorActor->GetProperty()->SetPointSize(5);
   ren->AddActor2D(anchorActor.GetPointer());
 
-  // Add some various 'empty' actors to make sure there are no surprises:
-  vtkNew<vtkTextActor> nullInputActor;
-  nullInputActor->SetInput(NULL);
-  ren->AddActor2D(nullInputActor.GetPointer());
-
-  vtkNew<vtkTextActor> emptyInputActor;
-  emptyInputActor->SetInput("");
-  ren->AddActor2D(emptyInputActor.GetPointer());
-
-  vtkNew<vtkTextActor> spaceActor;
-  spaceActor->SetInput(" ");
-  ren->AddActor2D(spaceActor.GetPointer());
-
-  vtkNew<vtkTextActor> tabActor;
-  tabActor->SetInput("\t");
-  ren->AddActor2D(tabActor.GetPointer());
-
-  vtkNew<vtkTextActor> newlineActor;
-  newlineActor->SetInput("\n");
-  ren->AddActor2D(newlineActor.GetPointer());
-
   vtkNew<vtkRenderWindow> win;
   win->AddRenderer(ren.GetPointer());
   vtkNew<vtkRenderWindowInteractor> iren;
diff --git a/Rendering/FreeType/Testing/Cxx/TestTextActor3D.cxx b/Rendering/FreeType/Testing/Cxx/TestTextActor3D.cxx
index 219ccb5..ffdbb3a 100644
--- a/Rendering/FreeType/Testing/Cxx/TestTextActor3D.cxx
+++ b/Rendering/FreeType/Testing/Cxx/TestTextActor3D.cxx
@@ -123,27 +123,6 @@ int TestTextActor3D(int, char *[])
   anchorActor->GetProperty()->SetPointSize(5);
   ren->AddActor(anchorActor.GetPointer());
 
-  // Add some various 'empty' actors to make sure there are no surprises:
-  vtkNew<vtkTextActor3D> nullInputActor;
-  nullInputActor->SetInput(NULL);
-  ren->AddActor(nullInputActor.GetPointer());
-
-  vtkNew<vtkTextActor3D> emptyInputActor;
-  emptyInputActor->SetInput("");
-  ren->AddActor(emptyInputActor.GetPointer());
-
-  vtkNew<vtkTextActor3D> spaceActor;
-  spaceActor->SetInput(" ");
-  ren->AddActor(spaceActor.GetPointer());
-
-  vtkNew<vtkTextActor3D> tabActor;
-  tabActor->SetInput("\t");
-  ren->AddActor(tabActor.GetPointer());
-
-  vtkNew<vtkTextActor3D> newlineActor;
-  newlineActor->SetInput("\n");
-  ren->AddActor(newlineActor.GetPointer());
-
   vtkNew<vtkRenderWindow> win;
   win->AddRenderer(ren.GetPointer());
   vtkNew<vtkRenderWindowInteractor> iren;
diff --git a/Rendering/FreeType/Testing/Cxx/TestTextMapper.cxx b/Rendering/FreeType/Testing/Cxx/TestTextMapper.cxx
deleted file mode 100644
index 9559740..0000000
--- a/Rendering/FreeType/Testing/Cxx/TestTextMapper.cxx
+++ /dev/null
@@ -1,145 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    TestTextMapper.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 "vtkTextMapper.h"
-
-#include "vtkActor2D.h"
-#include "vtkCamera.h"
-#include "vtkCellArray.h"
-#include "vtkCellData.h"
-#include "vtkNew.h"
-#include "vtkPoints.h"
-#include "vtkPolyData.h"
-#include "vtkPolyDataMapper2D.h"
-#include "vtkProperty2D.h"
-#include "vtkRenderWindow.h"
-#include "vtkRenderWindowInteractor.h"
-#include "vtkRenderer.h"
-#include "vtkTestingInteractor.h"
-#include "vtkTextProperty.h"
-#include "vtkUnsignedCharArray.h"
-
-#include <sstream>
-
-namespace vtkTestTextMapper {
-void setupTextMapper(vtkTextMapper *mapper,
-                     vtkActor2D *actor,
-                     vtkPolyData *anchor)
-{
-  vtkTextProperty *p = mapper->GetTextProperty();
-  std::ostringstream label;
-  label << "TProp Angle: " << p->GetOrientation() << "\n"
-        << "HAlign: " << p->GetJustificationAsString() << "\n"
-        << "VAlign: " << p->GetVerticalJustificationAsString();
-  mapper->SetInput(label.str().c_str());
-
-  // Add the anchor point:
-  double *pos = actor->GetPosition();
-  double *col = p->GetColor();
-  vtkIdType ptId = anchor->GetPoints()->InsertNextPoint(pos[0], pos[1], 0.);
-  anchor->GetVerts()->InsertNextCell(1, &ptId);
-  anchor->GetCellData()->GetScalars()->InsertNextTuple4(col[0] * 255,
-                                                        col[1] * 255,
-                                                        col[2] * 255, 255);
-}
-} // end namespace vtkTestTextMapper
-
-//----------------------------------------------------------------------------
-int TestTextMapper(int, char *[])
-{
-  using namespace vtkTestTextMapper;
-  vtkNew<vtkRenderer> ren;
-
-  int width = 600;
-  int height = 600;
-  int x[3] = {100, 300, 500};
-  int y[3] = {100, 300, 500};
-
-  // Render the anchor points to check alignment:
-  vtkNew<vtkPolyData> anchors;
-  vtkNew<vtkPoints> points;
-  anchors->SetPoints(points.GetPointer());
-  vtkNew<vtkCellArray> verts;
-  anchors->SetVerts(verts.GetPointer());
-  vtkNew<vtkUnsignedCharArray> colors;
-  colors->SetNumberOfComponents(4);
-  anchors->GetCellData()->SetScalars(colors.GetPointer());
-
-  for (size_t row = 0; row < 3; ++row)
-    {
-    for (size_t col = 0; col < 3; ++col)
-      {
-      vtkNew<vtkTextMapper> mapper;
-      switch (row)
-        {
-        case 0:
-          mapper->GetTextProperty()->SetJustificationToRight();
-          break;
-        case 1:
-          mapper->GetTextProperty()->SetJustificationToCentered();
-          break;
-        case 2:
-          mapper->GetTextProperty()->SetJustificationToLeft();
-          break;
-        }
-      switch (col)
-        {
-        case 0:
-          mapper->GetTextProperty()->SetVerticalJustificationToBottom();
-          break;
-        case 1:
-          mapper->GetTextProperty()->SetVerticalJustificationToCentered();
-          break;
-        case 2:
-          mapper->GetTextProperty()->SetVerticalJustificationToTop();
-          break;
-        }
-      mapper->GetTextProperty()->SetOrientation(45.0 * (3 * row + col));
-      mapper->GetTextProperty()->SetColor(0.75, .2 + col * .26, .2 + row * .2);
-      vtkNew<vtkActor2D> actor;
-      actor->SetPosition(x[col], y[row]);
-      actor->SetMapper(mapper.GetPointer());
-      setupTextMapper(mapper.GetPointer(), actor.GetPointer(),
-                      anchors.GetPointer());
-      ren->AddActor2D(actor.GetPointer());
-      }
-    }
-
-  vtkNew<vtkPolyDataMapper2D> anchorMapper;
-  anchorMapper->SetInputData(anchors.GetPointer());
-  vtkNew<vtkActor2D> anchorActor;
-  anchorActor->SetMapper(anchorMapper.GetPointer());
-  anchorActor->GetProperty()->SetPointSize(5);
-  ren->AddActor2D(anchorActor.GetPointer());
-
-  vtkNew<vtkRenderWindow> win;
-  win->AddRenderer(ren.GetPointer());
-  vtkNew<vtkRenderWindowInteractor> iren;
-  iren->SetRenderWindow(win.GetPointer());
-
-  ren->SetBackground(0.0, 0.0, 0.0);
-  ren->GetActiveCamera()->SetPosition(0, 0, 400);
-  ren->GetActiveCamera()->SetFocalPoint(0, 0, 0);
-  ren->GetActiveCamera()->SetViewUp(0, 1, 0);
-  ren->ResetCameraClippingRange();
-  win->SetSize(width, height);
-
-  // Finally render the scene and compare the image to a reference image
-  win->SetMultiSamples(0);
-  win->GetInteractor()->Initialize();
-  win->GetInteractor()->Start();
-
-  return EXIT_SUCCESS;
-}
diff --git a/Rendering/FreeType/Testing/Data/Baseline/OverlayTextOnImage.png.md5 b/Rendering/FreeType/Testing/Data/Baseline/OverlayTextOnImage.png.md5
index 429361a..5e43195 100644
--- a/Rendering/FreeType/Testing/Data/Baseline/OverlayTextOnImage.png.md5
+++ b/Rendering/FreeType/Testing/Data/Baseline/OverlayTextOnImage.png.md5
@@ -1 +1 @@
-18a9e3586c80a0e2f6550ee17d562482
+bc24a92b1b399a114e9cea45f49d29b0
diff --git a/Rendering/FreeType/Testing/Data/Baseline/TestFTStringToPath.png.md5 b/Rendering/FreeType/Testing/Data/Baseline/TestFTStringToPath.png.md5
index 3345551..0db7062 100644
--- a/Rendering/FreeType/Testing/Data/Baseline/TestFTStringToPath.png.md5
+++ b/Rendering/FreeType/Testing/Data/Baseline/TestFTStringToPath.png.md5
@@ -1 +1 @@
-03d6ba4175b83a363ddc20a82507f7e0
+38fa8db449bfd0364cea7c89afecf555
diff --git a/Rendering/FreeType/Testing/Data/Baseline/TestFontDPIScaling.png.md5 b/Rendering/FreeType/Testing/Data/Baseline/TestFontDPIScaling.png.md5
deleted file mode 100644
index 0a9e631..0000000
--- a/Rendering/FreeType/Testing/Data/Baseline/TestFontDPIScaling.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-1c292bb373a07e4e96adfa845b708510
diff --git a/Rendering/FreeType/Testing/Data/Baseline/TestFreeTypeTextMapper.png.md5 b/Rendering/FreeType/Testing/Data/Baseline/TestFreeTypeTextMapper.png.md5
index bc4d540..c17e879 100644
--- a/Rendering/FreeType/Testing/Data/Baseline/TestFreeTypeTextMapper.png.md5
+++ b/Rendering/FreeType/Testing/Data/Baseline/TestFreeTypeTextMapper.png.md5
@@ -1 +1 @@
-f63e7ee1cf1eb018516200803d8a217f
+4676cc01fdf9d501f114207a19a673da
diff --git a/Rendering/FreeType/Testing/Data/Baseline/TestFreeTypeTextMapperNoMath.png.md5 b/Rendering/FreeType/Testing/Data/Baseline/TestFreeTypeTextMapperNoMath.png.md5
index 97acdf8..8832aa0 100644
--- a/Rendering/FreeType/Testing/Data/Baseline/TestFreeTypeTextMapperNoMath.png.md5
+++ b/Rendering/FreeType/Testing/Data/Baseline/TestFreeTypeTextMapperNoMath.png.md5
@@ -1 +1 @@
-9674f2662980d405810aa6c9cab225a3
+89b1b495e8404eab965eaa38e7b8588d
diff --git a/Rendering/FreeType/Testing/Data/Baseline/TestMathTextFreeTypeTextRenderer.png.md5 b/Rendering/FreeType/Testing/Data/Baseline/TestMathTextFreeTypeTextRenderer.png.md5
index ee4f3cd..2a0e489 100644
--- a/Rendering/FreeType/Testing/Data/Baseline/TestMathTextFreeTypeTextRenderer.png.md5
+++ b/Rendering/FreeType/Testing/Data/Baseline/TestMathTextFreeTypeTextRenderer.png.md5
@@ -1 +1 @@
-51d2d54769d8ef1174757be6fcc43392
+c21d4eb489109f9114e12155ac79ba79
diff --git a/Rendering/FreeType/Testing/Data/Baseline/TestMathTextFreeTypeTextRendererNoMath.png.md5 b/Rendering/FreeType/Testing/Data/Baseline/TestMathTextFreeTypeTextRendererNoMath.png.md5
index bad067f..00cf3a7 100644
--- a/Rendering/FreeType/Testing/Data/Baseline/TestMathTextFreeTypeTextRendererNoMath.png.md5
+++ b/Rendering/FreeType/Testing/Data/Baseline/TestMathTextFreeTypeTextRendererNoMath.png.md5
@@ -1 +1 @@
-6f9c7264b8fcade67f0490e1aae70f4a
+311a4721cf6d5685a9031ff56946a36e
diff --git a/Rendering/FreeType/Testing/Data/Baseline/TestTextActor.png.md5 b/Rendering/FreeType/Testing/Data/Baseline/TestTextActor.png.md5
index de4de79..d4936fc 100644
--- a/Rendering/FreeType/Testing/Data/Baseline/TestTextActor.png.md5
+++ b/Rendering/FreeType/Testing/Data/Baseline/TestTextActor.png.md5
@@ -1 +1 @@
-092c060b28c4e98d89f56f4060aad451
+4e70849a90b83bc26f39aa60905bcad4
diff --git a/Rendering/FreeType/Testing/Data/Baseline/TestTextActor3DAlphaBlending.png.md5 b/Rendering/FreeType/Testing/Data/Baseline/TestTextActor3DAlphaBlending.png.md5
index bb340c5..a1a07b8 100644
--- a/Rendering/FreeType/Testing/Data/Baseline/TestTextActor3DAlphaBlending.png.md5
+++ b/Rendering/FreeType/Testing/Data/Baseline/TestTextActor3DAlphaBlending.png.md5
@@ -1 +1 @@
-11eca48cb9fa72e70efb5d82935461e9
+81c1f7e7b43cfae5378cd97f2e2310a4
diff --git a/Rendering/FreeType/Testing/Data/Baseline/TestTextActor3DAlphaBlending_1.png.md5 b/Rendering/FreeType/Testing/Data/Baseline/TestTextActor3DAlphaBlending_1.png.md5
deleted file mode 100644
index ea61689..0000000
--- a/Rendering/FreeType/Testing/Data/Baseline/TestTextActor3DAlphaBlending_1.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-ae507c9ce3e05622d770be71c7916c51
diff --git a/Rendering/FreeType/Testing/Data/Baseline/TestTextActor3DDepthPeeling.png.md5 b/Rendering/FreeType/Testing/Data/Baseline/TestTextActor3DDepthPeeling.png.md5
index bb340c5..a593173 100644
--- a/Rendering/FreeType/Testing/Data/Baseline/TestTextActor3DDepthPeeling.png.md5
+++ b/Rendering/FreeType/Testing/Data/Baseline/TestTextActor3DDepthPeeling.png.md5
@@ -1 +1 @@
-11eca48cb9fa72e70efb5d82935461e9
+cabec47663c0ba7564cb7a6cfbd2bed9
diff --git a/Rendering/FreeType/Testing/Data/Baseline/TestTextActor3DDepthPeeling_1.png.md5 b/Rendering/FreeType/Testing/Data/Baseline/TestTextActor3DDepthPeeling_1.png.md5
deleted file mode 100644
index ea61689..0000000
--- a/Rendering/FreeType/Testing/Data/Baseline/TestTextActor3DDepthPeeling_1.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-ae507c9ce3e05622d770be71c7916c51
diff --git a/Rendering/FreeType/Testing/Data/Baseline/TestTextActorAlphaBlending.png.md5 b/Rendering/FreeType/Testing/Data/Baseline/TestTextActorAlphaBlending.png.md5
index 6f9ea15..a5014b6 100644
--- a/Rendering/FreeType/Testing/Data/Baseline/TestTextActorAlphaBlending.png.md5
+++ b/Rendering/FreeType/Testing/Data/Baseline/TestTextActorAlphaBlending.png.md5
@@ -1 +1 @@
-4d8629ca933c27dd689112b0a3cb4861
+a3c6ec6c8e5dea39bd217d4a1f8cbcad
diff --git a/Rendering/FreeType/Testing/Data/Baseline/TestTextActorDepthPeeling.png.md5 b/Rendering/FreeType/Testing/Data/Baseline/TestTextActorDepthPeeling.png.md5
index 3da91f6..c4dd371 100644
--- a/Rendering/FreeType/Testing/Data/Baseline/TestTextActorDepthPeeling.png.md5
+++ b/Rendering/FreeType/Testing/Data/Baseline/TestTextActorDepthPeeling.png.md5
@@ -1 +1 @@
-37eaf1d22240aec528881940f63ff17b
+91884691205c3eeaa97ef6243f4c9f66
diff --git a/Rendering/FreeType/Testing/Data/Baseline/TestTextMapper.png.md5 b/Rendering/FreeType/Testing/Data/Baseline/TestTextMapper.png.md5
deleted file mode 100644
index 618e256..0000000
--- a/Rendering/FreeType/Testing/Data/Baseline/TestTextMapper.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-e1548cb8e4aea08d12da80f284952732
diff --git a/Rendering/FreeType/Testing/Data/Baseline/multiLineText.png.md5 b/Rendering/FreeType/Testing/Data/Baseline/multiLineText.png.md5
index 97dc572..dfeccd3 100644
--- a/Rendering/FreeType/Testing/Data/Baseline/multiLineText.png.md5
+++ b/Rendering/FreeType/Testing/Data/Baseline/multiLineText.png.md5
@@ -1 +1 @@
-b3f73adf1e94abb074a7c574c448b6c7
+ef344564467fe2f0f4b6ccd8562c5d4b
diff --git a/Rendering/FreeType/Testing/Data/Baseline/multiLineText_1.png.md5 b/Rendering/FreeType/Testing/Data/Baseline/multiLineText_1.png.md5
deleted file mode 100644
index fbc3525..0000000
--- a/Rendering/FreeType/Testing/Data/Baseline/multiLineText_1.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-922940df8b7b78bfad8316b9590ef2f3
diff --git a/Rendering/FreeType/module.cmake b/Rendering/FreeType/module.cmake
index 4670c2a..37e6446 100644
--- a/Rendering/FreeType/module.cmake
+++ b/Rendering/FreeType/module.cmake
@@ -1,10 +1,3 @@
-# The tests can be built without matplotlib, but we add some additional tests
-# if it is enabled.
-set(optional_test_depends)
-if(${Module_vtkRenderingMatplotlib})
-  set(optional_test_depends "vtkRenderingMatplotlib")
-endif()
-
 vtk_module(vtkRenderingFreeType
   IMPLEMENTS
     vtkRenderingCore
@@ -15,7 +8,7 @@ vtk_module(vtkRenderingFreeType
     vtkfreetype
     vtkftgl
   TEST_DEPENDS
-    ${optional_test_depends}
+    vtkRenderingMatplotlib
     vtkTestingRendering
     vtkViewsContext2D
     vtkRendering${VTK_RENDERING_BACKEND}
diff --git a/Rendering/FreeType/vtkFreeTypeStringToImage.cxx b/Rendering/FreeType/vtkFreeTypeStringToImage.cxx
index f865305..a0f6e4d 100644
--- a/Rendering/FreeType/vtkFreeTypeStringToImage.cxx
+++ b/Rendering/FreeType/vtkFreeTypeStringToImage.cxx
@@ -52,8 +52,7 @@ vtkFreeTypeStringToImage::~vtkFreeTypeStringToImage()
 
 //-----------------------------------------------------------------------------
 vtkVector2i vtkFreeTypeStringToImage::GetBounds(vtkTextProperty *property,
-                                                const vtkUnicodeString& string,
-                                                int dpi)
+                                                const vtkUnicodeString& string)
 {
   int tmp[4] = { 0, 0, 0, 0 };
   vtkVector2i recti(tmp);
@@ -62,7 +61,7 @@ vtkVector2i vtkFreeTypeStringToImage::GetBounds(vtkTextProperty *property,
     return recti;
     }
 
-  this->Implementation->FreeType->GetBoundingBox(property, string, dpi, tmp);
+  this->Implementation->FreeType->GetBoundingBox(property, string, tmp);
 
   recti.Set(tmp[1] - tmp[0],
             tmp[3] - tmp[2]);
@@ -72,8 +71,7 @@ vtkVector2i vtkFreeTypeStringToImage::GetBounds(vtkTextProperty *property,
 
 //-----------------------------------------------------------------------------
 vtkVector2i vtkFreeTypeStringToImage::GetBounds(vtkTextProperty *property,
-                                                const vtkStdString& string,
-                                                int dpi)
+                                                const vtkStdString& string)
 {
   vtkVector2i recti(0, 0);
   int tmp[4];
@@ -82,7 +80,7 @@ vtkVector2i vtkFreeTypeStringToImage::GetBounds(vtkTextProperty *property,
     return recti;
     }
 
-  this->Implementation->FreeType->GetBoundingBox(property, string, dpi, tmp);
+  this->Implementation->FreeType->GetBoundingBox(property, string, tmp);
 
   recti.Set(tmp[1] - tmp[0],
             tmp[3] - tmp[2]);
@@ -93,21 +91,34 @@ vtkVector2i vtkFreeTypeStringToImage::GetBounds(vtkTextProperty *property,
 //-----------------------------------------------------------------------------
 int vtkFreeTypeStringToImage::RenderString(vtkTextProperty *property,
                                            const vtkUnicodeString& string,
-                                           int dpi, vtkImageData *data,
-                                           int textDims[2])
+                                           vtkImageData *data, int textDims[2])
 {
+  // Get the required size, and initialize a new QImage to draw on.
+  vtkVector2i box = this->GetBounds(property, string);
+  if (box.GetX() == 0 || box.GetY() == 0)
+    {
+    return 0;
+    }
+
   return this->Implementation->FreeType->RenderString(property,
-                                                      string, dpi,
+                                                      string,
                                                       data, textDims);
 }
 
 //-----------------------------------------------------------------------------
 int vtkFreeTypeStringToImage::RenderString(vtkTextProperty *property,
-                                           const vtkStdString& string, int dpi,
+                                           const vtkStdString& string,
                                            vtkImageData *data, int textDims[2])
 {
-  return this->Implementation->FreeType->RenderString(property, string, dpi,
-                                                      data, textDims);
+  // Get the required size, and initialize a new QImage to draw on.
+  vtkVector2i box = this->GetBounds(property, string);
+  if (box.GetX() == 0 || box.GetY() == 0)
+    {
+    return 0;
+    }
+
+  return this->Implementation->FreeType->RenderString(property, string, data,
+                                                      textDims);
 }
 
 //-----------------------------------------------------------------------------
diff --git a/Rendering/FreeType/vtkFreeTypeStringToImage.h b/Rendering/FreeType/vtkFreeTypeStringToImage.h
index 873a2e8..d88ded7 100644
--- a/Rendering/FreeType/vtkFreeTypeStringToImage.h
+++ b/Rendering/FreeType/vtkFreeTypeStringToImage.h
@@ -46,9 +46,9 @@ public:
   // is valid (it may not if GetBoundingBox() failed or if the string
   // was empty).
   virtual vtkVector2i GetBounds(vtkTextProperty *property,
-                                const vtkUnicodeString& string, int dpi);
+                                const vtkUnicodeString& string);
   virtual vtkVector2i GetBounds(vtkTextProperty *property,
-                                const vtkStdString& string, int dpi);
+                                const vtkStdString& string);
 
   // Description:
   // Given a text property and a string, this function initializes the
@@ -57,11 +57,11 @@ public:
   // This is useful when ScaleToPowerOfTwo is true, and the image dimensions may
   // not match the dimensions of the rendered text.
   virtual int RenderString(vtkTextProperty *property,
-                           const vtkUnicodeString& string, int dpi,
+                           const vtkUnicodeString& string,
                            vtkImageData *data,
                            int textDims[2] = NULL);
   virtual int RenderString(vtkTextProperty *property,
-                           const vtkStdString& string, int dpi,
+                           const vtkStdString& string,
                            vtkImageData *data,
                            int textDims[2] = NULL);
 
diff --git a/Rendering/FreeType/vtkFreeTypeTools.cxx b/Rendering/FreeType/vtkFreeTypeTools.cxx
index a757c3e..36f8151 100644
--- a/Rendering/FreeType/vtkFreeTypeTools.cxx
+++ b/Rendering/FreeType/vtkFreeTypeTools.cxx
@@ -39,8 +39,6 @@
 # include <stdint.h>
 #endif
 
-#include <limits>
-#include <cassert>
 #include <algorithm>
 #include <map>
 #include <vector>
@@ -64,10 +62,10 @@ void rotateVector2i(vtkVector2i &vec, float sinTheta, float cosTheta)
 } // end anon namespace
 
 class vtkTextPropertyLookup
-    : public std::map<size_t, vtkSmartPointer<vtkTextProperty> >
+    : public std::map<unsigned long, vtkSmartPointer<vtkTextProperty> >
 {
 public:
-  bool contains(const size_t id) {return this->find(id) != this->end();}
+  bool contains(const unsigned long id) {return this->find(id) != this->end();}
 };
 
 class vtkFreeTypeTools::MetaData
@@ -75,15 +73,10 @@ class vtkFreeTypeTools::MetaData
 public:
   // Set by PrepareMetaData
   vtkTextProperty *textProperty;
-  size_t textPropertyCacheId;
-  size_t unrotatedTextPropertyCacheId;
-  FTC_ScalerRec scaler;
-  FTC_ScalerRec unrotatedScaler;
+  unsigned long textPropertyCacheId;
+  unsigned long unrotatedTextPropertyCacheId;
   FT_Face face;
   bool faceHasKerning;
-  bool faceIsRotated;
-  FT_Matrix rotation;
-  FT_Matrix inverseRotation;
 
   // Set by CalculateBoundingBox
   int ascent;
@@ -385,16 +378,22 @@ void vtkFreeTypeTools::ReleaseCacheManager()
     this->CacheManager = NULL;
     }
 
-  delete this->ImageCache;
-  this->ImageCache = NULL;
+  if (this->ImageCache)
+    {
+    delete this->ImageCache;
+    this->ImageCache = NULL;
+    }
 
-  delete this->CMapCache;
-  this->CMapCache = NULL;
+  if (this->CMapCache)
+    {
+    delete this->CMapCache;
+    this->CMapCache = NULL;
+    }
 }
 
 //----------------------------------------------------------------------------
 bool vtkFreeTypeTools::GetBoundingBox(vtkTextProperty *tprop,
-                                      const vtkStdString& str, int dpi,
+                                      const vtkStdString& str,
                                       int bbox[4])
 {
   // We need the tprop and bbox
@@ -411,7 +410,7 @@ bool vtkFreeTypeTools::GetBoundingBox(vtkTextProperty *tprop,
     }
 
   MetaData metaData;
-  bool result = this->PrepareMetaData(tprop, dpi, metaData);
+  bool result = this->PrepareMetaData(tprop, metaData);
   if (result)
     {
     result = this->CalculateBoundingBox(str, metaData);
@@ -425,7 +424,7 @@ bool vtkFreeTypeTools::GetBoundingBox(vtkTextProperty *tprop,
 
 //----------------------------------------------------------------------------
 bool vtkFreeTypeTools::GetBoundingBox(vtkTextProperty *tprop,
-                                      const vtkUnicodeString& str, int dpi,
+                                      const vtkUnicodeString& str,
                                       int bbox[4])
 {
   // We need the tprop and bbox
@@ -442,7 +441,7 @@ bool vtkFreeTypeTools::GetBoundingBox(vtkTextProperty *tprop,
     }
 
   MetaData metaData;
-  bool result = this->PrepareMetaData(tprop, dpi, metaData);
+  bool result = this->PrepareMetaData(tprop, metaData);
   if (result)
     {
     result = this->CalculateBoundingBox(str, metaData);
@@ -456,7 +455,7 @@ bool vtkFreeTypeTools::GetBoundingBox(vtkTextProperty *tprop,
 
 //----------------------------------------------------------------------------
 bool vtkFreeTypeTools::GetMetrics(vtkTextProperty *tprop,
-                                  const vtkStdString &str, int dpi,
+                                  const vtkStdString &str,
                                   vtkTextRenderer::Metrics &metrics)
 {
   if (!tprop)
@@ -472,7 +471,7 @@ bool vtkFreeTypeTools::GetMetrics(vtkTextProperty *tprop,
     }
 
   MetaData metaData;
-  bool result = this->PrepareMetaData(tprop, dpi, metaData);
+  bool result = this->PrepareMetaData(tprop, metaData);
   if (result)
     {
     result = this->CalculateBoundingBox(str, metaData);
@@ -490,7 +489,7 @@ bool vtkFreeTypeTools::GetMetrics(vtkTextProperty *tprop,
 
 //----------------------------------------------------------------------------
 bool vtkFreeTypeTools::GetMetrics(vtkTextProperty *tprop,
-                                  const vtkUnicodeString &str, int dpi,
+                                  const vtkUnicodeString &str,
                                   vtkTextRenderer::Metrics &metrics)
 {
   if (!tprop)
@@ -506,7 +505,7 @@ bool vtkFreeTypeTools::GetMetrics(vtkTextProperty *tprop,
     }
 
   MetaData metaData;
-  bool result = this->PrepareMetaData(tprop, dpi, metaData);
+  bool result = this->PrepareMetaData(tprop, metaData);
   if (result)
     {
     result = this->CalculateBoundingBox(str, metaData);
@@ -524,43 +523,41 @@ bool vtkFreeTypeTools::GetMetrics(vtkTextProperty *tprop,
 
 //----------------------------------------------------------------------------
 bool vtkFreeTypeTools::RenderString(vtkTextProperty *tprop,
-                                    const vtkStdString& str, int dpi,
+                                    const vtkStdString& str,
                                     vtkImageData *data, int textDims[2])
 {
-  return this->RenderStringInternal(tprop, str, dpi, data, textDims);
+  return this->RenderStringInternal(tprop, str, data, textDims);
 }
 
 //----------------------------------------------------------------------------
 bool vtkFreeTypeTools::RenderString(vtkTextProperty *tprop,
-                                    const vtkUnicodeString& str, int dpi,
+                                    const vtkUnicodeString& str,
                                     vtkImageData *data, int textDims[2])
 {
-  return this->RenderStringInternal(tprop, str, dpi, data, textDims);
+  return this->RenderStringInternal(tprop, str, data, textDims);
 }
 
 //----------------------------------------------------------------------------
 bool vtkFreeTypeTools::StringToPath(vtkTextProperty *tprop,
-                                    const vtkStdString &str, int dpi,
-                                    vtkPath *path)
+                                    const vtkStdString &str, vtkPath *path)
 {
-  return this->StringToPathInternal(tprop, str, dpi, path);
+  return this->StringToPathInternal(tprop, str, path);
 }
 
 //----------------------------------------------------------------------------
 bool vtkFreeTypeTools::StringToPath(vtkTextProperty *tprop,
-                                    const vtkUnicodeString &str, int dpi,
-                                    vtkPath *path)
+                                    const vtkUnicodeString &str, vtkPath *path)
 {
-  return this->StringToPathInternal(tprop, str, dpi, path);
+  return this->StringToPathInternal(tprop, str, path);
 }
 
 //----------------------------------------------------------------------------
 int vtkFreeTypeTools::GetConstrainedFontSize(const vtkStdString &str,
-                                             vtkTextProperty *tprop, int dpi,
+                                             vtkTextProperty *tprop,
                                              int targetWidth, int targetHeight)
 {
   MetaData metaData;
-  if (!this->PrepareMetaData(tprop, dpi, metaData))
+  if (!this->PrepareMetaData(tprop, metaData))
     {
     vtkErrorMacro(<<"Could not prepare metadata.");
     return false;
@@ -570,11 +567,11 @@ int vtkFreeTypeTools::GetConstrainedFontSize(const vtkStdString &str,
 
 //----------------------------------------------------------------------------
 int vtkFreeTypeTools::GetConstrainedFontSize(const vtkUnicodeString &str,
-                                             vtkTextProperty *tprop, int dpi,
+                                             vtkTextProperty *tprop,
                                              int targetWidth, int targetHeight)
 {
   MetaData metaData;
-  if (!this->PrepareMetaData(tprop, dpi, metaData))
+  if (!this->PrepareMetaData(tprop, metaData))
     {
     vtkErrorMacro(<<"Could not prepare metadata.");
     return false;
@@ -602,7 +599,7 @@ vtkTypeUInt16 vtkFreeTypeTools::HashString(const char *str)
 
 //----------------------------------------------------------------------------
 void vtkFreeTypeTools::MapTextPropertyToId(vtkTextProperty *tprop,
-                                           size_t *id)
+                                           unsigned long *id)
 {
   if (!tprop || !id)
     {
@@ -613,7 +610,7 @@ void vtkFreeTypeTools::MapTextPropertyToId(vtkTextProperty *tprop,
   // Set the first bit to avoid id = 0
   // (the id will be mapped to a pointer, FTC_FaceID, so let's avoid NULL)
   *id = 1;
-  unsigned int bits = 1;
+  int bits = 1;
 
   // The font family is hashed into 16 bits (= 17 bits so far)
   vtkTypeUInt16 familyHash =
@@ -624,29 +621,21 @@ void vtkFreeTypeTools::MapTextPropertyToId(vtkTextProperty *tprop,
   bits += 16;
 
   // Bold is in 1 bit (= 18 bits so far)
-  vtkIdType bold = (tprop->GetBold() ? 1 : 0) << bits;
+  int bold = (tprop->GetBold() ? 1 : 0) << bits;
   ++bits;
 
   // Italic is in 1 bit (= 19 bits so far)
-  vtkIdType italic = (tprop->GetItalic() ? 1 : 0) << bits;
+  int italic = (tprop->GetItalic() ? 1 : 0) << bits;
   ++bits;
 
   // Orientation (in degrees)
   // We need 9 bits for 0 to 360. What do we need for more precisions:
   // - 1/10th degree: 12 bits (11.8) (31 bits)
-  long angle = vtkMath::Round(tprop->GetOrientation() * 10.0) % 3600;
-  if (angle < 0)
-    {
-    angle += 3600;
-    }
-  angle <<= bits;
+  int angle = (vtkMath::Round(tprop->GetOrientation() * 10.0) % 3600) << bits;
 
   // We really should not use more than 32 bits
-  vtkIdType merged = (bold | italic | angle);
-  assert(merged <= std::numeric_limits<vtkTypeUInt32>::max());
-
   // Now final id
-  *id |= merged;
+  *id |= bold | italic | angle;
 
   // Insert the TextProperty into the lookup table
   if (!this->TextPropertyLookup->contains(*id))
@@ -654,7 +643,7 @@ void vtkFreeTypeTools::MapTextPropertyToId(vtkTextProperty *tprop,
 }
 
 //----------------------------------------------------------------------------
-void vtkFreeTypeTools::MapIdToTextProperty(size_t id,
+void vtkFreeTypeTools::MapIdToTextProperty(unsigned long id,
                                            vtkTextProperty *tprop)
 {
   if (!tprop)
@@ -676,38 +665,17 @@ void vtkFreeTypeTools::MapIdToTextProperty(size_t id,
 }
 
 //----------------------------------------------------------------------------
-bool vtkFreeTypeTools::GetSize(size_t tprop_cache_id,
+bool vtkFreeTypeTools::GetSize(unsigned long tprop_cache_id,
                                int font_size,
                                FT_Size *size)
 {
-  if (!size || font_size <= 0)
-    {
-    vtkErrorMacro(<< "Wrong parameters, size is NULL or invalid font size");
-    return 0;
-    }
-
-  // Map the id of a text property in the cache to a FTC_FaceID
-  FTC_FaceID face_id = reinterpret_cast<FTC_FaceID>(tprop_cache_id);
-
-  FTC_ScalerRec scaler_rec;
-  scaler_rec.face_id = face_id;
-  scaler_rec.width = font_size;
-  scaler_rec.height = font_size;
-  scaler_rec.pixel = 1;
-
-  return this->GetSize(&scaler_rec, size);
-}
-
-//----------------------------------------------------------------------------
-bool vtkFreeTypeTools::GetSize(FTC_Scaler scaler, FT_Size *size)
-{
 #if VTK_FTFC_DEBUG_CD
   printf("vtkFreeTypeTools::GetSize()\n");
 #endif
 
-  if (!size)
+  if (!size || font_size <= 0)
     {
-    vtkErrorMacro(<< "Size is NULL.");
+    vtkErrorMacro(<< "Wrong parameters, size is NULL or invalid font size");
     return 0;
     }
 
@@ -718,7 +686,16 @@ bool vtkFreeTypeTools::GetSize(FTC_Scaler scaler, FT_Size *size)
     return 0;
     }
 
-  FT_Error error = FTC_Manager_LookupSize(*manager, scaler, size);
+  // Map the id of a text property in the cache to a FTC_FaceID
+  FTC_FaceID face_id = reinterpret_cast<FTC_FaceID>(tprop_cache_id);
+
+  FTC_ScalerRec scaler_rec;
+  scaler_rec.face_id = face_id;
+  scaler_rec.width = font_size;
+  scaler_rec.height = font_size;
+  scaler_rec.pixel = 1;
+
+  FT_Error error = FTC_Manager_LookupSize(*manager, &scaler_rec, size);
   if (error)
     {
     vtkErrorMacro(<< "Failed looking up a FreeType Size");
@@ -738,14 +715,14 @@ bool vtkFreeTypeTools::GetSize(vtkTextProperty *tprop,
     }
 
   // Map the text property to a unique id that will be used as face id
-  size_t tprop_cache_id;
+  unsigned long tprop_cache_id;
   this->MapTextPropertyToId(tprop, &tprop_cache_id);
 
   return this->GetSize(tprop_cache_id, tprop->GetFontSize(), size);
 }
 
 //----------------------------------------------------------------------------
-bool vtkFreeTypeTools::GetFace(size_t tprop_cache_id,
+bool vtkFreeTypeTools::GetFace(unsigned long tprop_cache_id,
                                FT_Face *face)
 {
 #if VTK_FTFC_DEBUG_CD
@@ -788,14 +765,14 @@ bool vtkFreeTypeTools::GetFace(vtkTextProperty *tprop,
     }
 
   // Map the text property to a unique id that will be used as face id
-  size_t tprop_cache_id;
+  unsigned long tprop_cache_id;
   this->MapTextPropertyToId(tprop, &tprop_cache_id);
 
   return this->GetFace(tprop_cache_id, face);
 }
 
 //----------------------------------------------------------------------------
-bool vtkFreeTypeTools::GetGlyphIndex(size_t tprop_cache_id,
+bool vtkFreeTypeTools::GetGlyphIndex(unsigned long tprop_cache_id,
                                      FT_UInt32 c,
                                      FT_UInt *gindex)
 {
@@ -837,14 +814,14 @@ bool vtkFreeTypeTools::GetGlyphIndex(vtkTextProperty *tprop,
     }
 
   // Map the text property to a unique id that will be used as face id
-  size_t tprop_cache_id;
+  unsigned long tprop_cache_id;
   this->MapTextPropertyToId(tprop, &tprop_cache_id);
 
   return this->GetGlyphIndex(tprop_cache_id, c, gindex);
 }
 
 //----------------------------------------------------------------------------
-bool vtkFreeTypeTools::GetGlyph(size_t tprop_cache_id,
+bool vtkFreeTypeTools::GetGlyph(unsigned long tprop_cache_id,
                                 int font_size,
                                 FT_UInt gindex,
                                 FT_Glyph *glyph,
@@ -893,44 +870,6 @@ bool vtkFreeTypeTools::GetGlyph(size_t tprop_cache_id,
 }
 
 //----------------------------------------------------------------------------
-bool vtkFreeTypeTools::GetGlyph(FTC_Scaler scaler, FT_UInt gindex,
-                                FT_Glyph *glyph, int request)
-{
-#if VTK_FTFC_DEBUG_CD
-  printf("vtkFreeTypeTools::GetGlyph()\n");
-#endif
-
-  if (!glyph)
-    {
-    vtkErrorMacro(<< "Wrong parameters, one of them is NULL");
-    return false;
-    }
-
-  FTC_ImageCache *image_cache = this->GetImageCache();
-  if (!image_cache)
-    {
-    vtkErrorMacro(<< "Failed querying the image cache manager !");
-    return false;
-    }
-
-  FT_ULong loadFlags = FT_LOAD_DEFAULT;
-  if (request == GLYPH_REQUEST_BITMAP)
-    {
-    loadFlags |= FT_LOAD_RENDER;
-    }
-  else if (request == GLYPH_REQUEST_OUTLINE)
-    {
-    loadFlags |= FT_LOAD_NO_BITMAP;
-    }
-
-  // Lookup the glyph
-  FT_Error error = FTC_ImageCache_LookupScaler(
-        *image_cache, scaler, loadFlags, gindex, glyph, NULL);
-
-  return error ? false : true;
-}
-
-//----------------------------------------------------------------------------
 bool vtkFreeTypeTools::LookupFace(vtkTextProperty *tprop, FT_Library lib,
                                   FT_Face *face)
 {
@@ -1066,7 +1005,7 @@ bool vtkFreeTypeTools::GetGlyph(vtkTextProperty *tprop,
     }
 
   // Map the text property to a unique id that will be used as face id
-  size_t tprop_cache_id;
+  unsigned long tprop_cache_id;
   this->MapTextPropertyToId(tprop, &tprop_cache_id);
 
   // Get the character/glyph index
@@ -1132,30 +1071,17 @@ inline bool vtkFreeTypeTools::PrepareImageMetaData(vtkTextProperty *tprop,
 }
 
 //----------------------------------------------------------------------------
-inline bool vtkFreeTypeTools::PrepareMetaData(vtkTextProperty *tprop, int dpi,
+inline bool vtkFreeTypeTools::PrepareMetaData(vtkTextProperty *tprop,
                                               MetaData &metaData)
 {
   // Text properties
   metaData.textProperty = tprop;
-  this->MapTextPropertyToId(tprop, &metaData.textPropertyCacheId);
-
-  metaData.scaler.face_id =
-      reinterpret_cast<FTC_FaceID>(metaData.textPropertyCacheId);
-  metaData.scaler.width = tprop->GetFontSize() * 64; // 26.6 format point size
-  metaData.scaler.height = tprop->GetFontSize() * 64;
-  metaData.scaler.pixel = 0;
-  metaData.scaler.x_res = dpi;
-  metaData.scaler.y_res = dpi;
-
-  FT_Size size;
-  if (!this->GetSize(&metaData.scaler, &size))
+  if (!this->GetFace(tprop, metaData.textPropertyCacheId, metaData.face,
+                     metaData.faceHasKerning))
     {
     return false;
     }
 
-  metaData.face = size->face;
-  metaData.faceHasKerning = (FT_HAS_KERNING(metaData.face) != 0);
-
   // Store an unrotated version of this font, as we'll need this to get accurate
   // ascenders/descenders (see CalculateBoundingBox).
   if (tprop->GetOrientation() != 0.0)
@@ -1163,45 +1089,18 @@ inline bool vtkFreeTypeTools::PrepareMetaData(vtkTextProperty *tprop, int dpi,
     vtkNew<vtkTextProperty> unrotatedTProp;
     unrotatedTProp->ShallowCopy(tprop);
     unrotatedTProp->SetOrientation(0);
-    this->MapTextPropertyToId(unrotatedTProp.GetPointer(),
-                              &metaData.unrotatedTextPropertyCacheId);
-
-    metaData.unrotatedScaler.face_id =
-        reinterpret_cast<FTC_FaceID>(metaData.unrotatedTextPropertyCacheId);
-    metaData.unrotatedScaler.width = tprop->GetFontSize() * 64; // 26.6 format point size
-    metaData.unrotatedScaler.height = tprop->GetFontSize() * 64;
-    metaData.unrotatedScaler.pixel = 0;
-    metaData.unrotatedScaler.x_res = dpi;
-    metaData.unrotatedScaler.y_res = dpi;
+    FT_Face unusedFace;
+    bool unusedBool;
+    if (!this->GetFace(unrotatedTProp.GetPointer(),
+                       metaData.unrotatedTextPropertyCacheId,
+                       unusedFace, unusedBool))
+      {
+      return false;
+      }
     }
   else
     {
     metaData.unrotatedTextPropertyCacheId = metaData.textPropertyCacheId;
-    metaData.unrotatedScaler = metaData.scaler;
-    }
-
-  // Rotation matrices:
-  metaData.faceIsRotated =
-      (fabs(metaData.textProperty->GetOrientation()) > 1e-5);
-  if (metaData.faceIsRotated)
-    {
-    float angle = vtkMath::RadiansFromDegrees(
-          static_cast<float>(metaData.textProperty->GetOrientation()));
-    // 0 -> orientation (used to adjust kerning, PR#15301)
-    float c = cos(angle);
-    float s = sin(angle);
-    metaData.rotation.xx = (FT_Fixed)( c * 0x10000L);
-    metaData.rotation.xy = (FT_Fixed)(-s * 0x10000L);
-    metaData.rotation.yx = (FT_Fixed)( s * 0x10000L);
-    metaData.rotation.yy = (FT_Fixed)( c * 0x10000L);
-
-    // orientation -> 0 (used for width calculations)
-    c = cos(-angle);
-    s = sin(-angle);
-    metaData.inverseRotation.xx = (FT_Fixed)( c * 0x10000L);
-    metaData.inverseRotation.xy = (FT_Fixed)(-s * 0x10000L);
-    metaData.inverseRotation.yx = (FT_Fixed)( s * 0x10000L);
-    metaData.inverseRotation.yy = (FT_Fixed)( c * 0x10000L);
     }
 
   return true;
@@ -1211,7 +1110,6 @@ inline bool vtkFreeTypeTools::PrepareMetaData(vtkTextProperty *tprop, int dpi,
 template <typename StringType>
 bool vtkFreeTypeTools::RenderStringInternal(vtkTextProperty *tprop,
                                             const StringType &str,
-                                            int dpi,
                                             vtkImageData *data,
                                             int textDims[2])
 {
@@ -1231,7 +1129,7 @@ bool vtkFreeTypeTools::RenderStringInternal(vtkTextProperty *tprop,
   ImageMetaData metaData;
 
   // Setup the metadata cache
-  if (!this->PrepareMetaData(tprop, dpi, metaData))
+  if (!this->PrepareMetaData(tprop, metaData))
     {
     vtkErrorMacro(<<"Error prepare text metadata.");
     return false;
@@ -1306,39 +1204,18 @@ bool vtkFreeTypeTools::RenderStringInternal(vtkTextProperty *tprop,
   data->Modified();
 
   // Render image
-  if (!this->PopulateData(str, data, metaData))
-    {
-    vtkErrorMacro(<<"Error rendering text.");
-    return false;
-    }
-
-  // Draw a yellow dot at the anchor point:
-  if (this->DebugTextures)
-    {
-    unsigned char *ptr =
-        static_cast<unsigned char *>(data->GetScalarPointer(0, 0, 0));
-    if (ptr)
-      {
-      ptr[0] = 255;
-      ptr[1] = 255;
-      ptr[2] = 0;
-      ptr[3] = 255;
-      }
-    }
-
-  return true;
+  return this->PopulateData(str, data, metaData);
 }
 
 //----------------------------------------------------------------------------
 template <typename StringType>
 bool vtkFreeTypeTools::StringToPathInternal(vtkTextProperty *tprop,
                                             const StringType &str,
-                                            int dpi,
                                             vtkPath *path)
 {
   // Setup the metadata
   MetaData metaData;
-  if (!this->PrepareMetaData(tprop, dpi, metaData))
+  if (!this->PrepareMetaData(tprop, metaData))
     {
     vtkErrorMacro(<<"Could not prepare metadata.");
     return false;
@@ -1399,6 +1276,7 @@ bool vtkFreeTypeTools::CalculateBoundingBox(const T& str,
   // face values are usually way too big. This is the same string used to
   // determine height in vtkFreeTypeUtilities.
   const char *heightString = "_/7Agfy";
+  int fontSize = metaData.textProperty->GetFontSize();
   metaData.ascent = 0;
   metaData.descent = 0;
   while (*heightString)
@@ -1407,12 +1285,12 @@ bool vtkFreeTypeTools::CalculateBoundingBox(const T& str,
     FT_UInt glyphIndex;
     // Use the unrotated face to get correct metrics:
     FT_Bitmap *bitmap = this->GetBitmap(
-          *heightString, &metaData.unrotatedScaler, glyphIndex, bitmapGlyph);
+          *heightString, metaData.unrotatedTextPropertyCacheId, fontSize,
+          glyphIndex, bitmapGlyph);
     if (bitmap)
       {
       metaData.ascent = std::max(bitmapGlyph->top - 1, metaData.ascent);
-      metaData.descent = std::min(-static_cast<int>((bitmap->rows -
-                                                     (bitmapGlyph->top - 1))),
+      metaData.descent = std::min(-static_cast<int>((bitmap->rows - (bitmapGlyph->top - 1))),
                                   metaData.descent);
       }
     ++heightString;
@@ -1568,23 +1446,67 @@ bool vtkFreeTypeTools::CalculateBoundingBox(const T& str,
       }
     }
 
-  // Compute the background bounding box.
-  vtkTuple<int, 4> bgBbox;
-  bgBbox[0] = std::min(std::min(metaData.TL[0], metaData.TR[0]),
-                       std::min(metaData.BL[0], metaData.BR[0]));
-  bgBbox[1] = std::max(std::max(metaData.TL[0], metaData.TR[0]),
-                       std::max(metaData.BL[0], metaData.BR[0]));
-  bgBbox[2] = std::min(std::min(metaData.TL[1], metaData.TR[1]),
-                       std::min(metaData.BL[1], metaData.BR[1]));
-  bgBbox[3] = std::max(std::max(metaData.TL[1], metaData.TR[1]),
-                       std::max(metaData.BL[1], metaData.BR[1]));
-
-  // Calculate the final bounding box (should just be the bg, but just in
-  // case...)
-  metaData.bbox[0] = std::min(textBbox[0], bgBbox[0]);
-  metaData.bbox[1] = std::max(textBbox[1], bgBbox[1]);
-  metaData.bbox[2] = std::min(textBbox[2], bgBbox[2]);
-  metaData.bbox[3] = std::max(textBbox[3], bgBbox[3]);
+  // If we're drawing the background, include the bg quad in the bbox:
+  if (hasBackground)
+    {
+    // Compute the background bounding box.
+    vtkTuple<int, 4> bgBbox;
+    bgBbox[0] = std::min(std::min(metaData.TL[0], metaData.TR[0]),
+                         std::min(metaData.BL[0], metaData.BR[0]));
+    bgBbox[1] = std::max(std::max(metaData.TL[0], metaData.TR[0]),
+                         std::max(metaData.BL[0], metaData.BR[0]));
+    bgBbox[2] = std::min(std::min(metaData.TL[1], metaData.TR[1]),
+                         std::min(metaData.BL[1], metaData.BR[1]));
+    bgBbox[3] = std::max(std::max(metaData.TL[1], metaData.TR[1]),
+                         std::max(metaData.BL[1], metaData.BR[1]));
+
+    // Calculate the final bounding box (should just be the bg, but just in
+    // case...)
+    metaData.bbox[0] = std::min(textBbox[0], bgBbox[0]);
+    metaData.bbox[1] = std::max(textBbox[1], bgBbox[1]);
+    metaData.bbox[2] = std::min(textBbox[2], bgBbox[2]);
+    metaData.bbox[3] = std::max(textBbox[3], bgBbox[3]);
+    }
+  else
+    {
+    metaData.bbox = textBbox;
+    }
+
+  // Sometimes the components of the bounding box are overestimated if
+  // the ascender/descender isn't utilized. Shift the box so that it contains
+  // 0 for better alignment. This essentially moves the anchor point back onto
+  // the border of the text.
+  int tmpX = 0;
+  int tmpY = 0;
+  if (textBbox[0] > 0)
+    {
+    tmpX = -textBbox[0];
+    }
+  else if (textBbox[1] < 0)
+    {
+    tmpX = -textBbox[1];
+    }
+  if (textBbox[2] > 0)
+    {
+    tmpY = -textBbox[2];
+    }
+  else if (textBbox[3] < 0)
+    {
+    tmpY = -textBbox[3];
+    }
+  if (tmpX != 0 || tmpY != 0)
+    {
+    metaData.bbox[0] += tmpX;
+    metaData.bbox[1] += tmpX;
+    metaData.bbox[2] += tmpY;
+    metaData.bbox[3] += tmpY;
+    for (size_t i = 0; i < metaData.lineMetrics.size(); ++i)
+      {
+      MetaData::LineMetrics &metrics = metaData.lineMetrics[i];
+      metrics.origin[0] += tmpX;
+      metrics.origin[1] += tmpY;
+      }
+    }
 
   return true;
 }
@@ -1879,31 +1801,16 @@ bool vtkFreeTypeTools::RenderCharacter(CharType character, int &x, int &y,
                                        MetaData &metaData)
 {
   ImageMetaData *iMetaData = reinterpret_cast<ImageMetaData*>(&metaData);
-  FT_BitmapGlyph bitmapGlyph = NULL;
+  FT_BitmapGlyph bitmapGlyph;
   FT_UInt glyphIndex;
-  FT_Bitmap *bitmap = this->GetBitmap(character, &iMetaData->scaler,
+  FT_Bitmap *bitmap = this->GetBitmap(character, iMetaData->textPropertyCacheId,
+                                      iMetaData->textProperty->GetFontSize(),
                                       glyphIndex, bitmapGlyph);
 
-  // Add the kerning
-  if (iMetaData->faceHasKerning && previousGlyphIndex && glyphIndex)
-    {
-    FT_Vector kerningDelta;
-    if (FT_Get_Kerning(iMetaData->face, previousGlyphIndex, glyphIndex,
-                       FT_KERNING_DEFAULT, &kerningDelta) == 0)
-      {
-      if (metaData.faceIsRotated) // PR#15301
-        {
-        FT_Vector_Transform(&kerningDelta, &metaData.rotation);
-        }
-      x += kerningDelta.x >> 6;
-      y += kerningDelta.y >> 6;
-      }
-    }
-  previousGlyphIndex = glyphIndex;
-
   if (!bitmap)
     {
     // TODO This should draw an empty rectangle.
+    previousGlyphIndex = glyphIndex;
     return false;
     }
 
@@ -1914,19 +1821,32 @@ bool vtkFreeTypeTools::RenderCharacter(CharType character, int &x, int &y,
     // from the glyph origin (0,0) to the topmost pixel of the glyph bitmap
     // (more precisely, to the pixel just above the bitmap). This distance is
     // expressed in integer pixels, and is positive for upwards y.
-    vtkVector2i pen(x + bitmapGlyph->left, y + bitmapGlyph->top - 1);
+    int penX = x + bitmapGlyph->left;
+    int penY = y + bitmapGlyph->top - 1;
+
+    // Add the kerning
+    if (iMetaData->faceHasKerning && previousGlyphIndex && glyphIndex)
+      {
+      FT_Vector kerningDelta;
+      if (FT_Get_Kerning(iMetaData->face, previousGlyphIndex, glyphIndex,
+                         FT_KERNING_DEFAULT, &kerningDelta) == 0)
+        {
+        penX += kerningDelta.x >> 6;
+        penY += kerningDelta.y >> 6;
+        }
+      }
+    previousGlyphIndex = glyphIndex;
 
     // Render the current glyph into the image
-    unsigned char *ptr = static_cast<unsigned char *>(
-          image->GetScalarPointer(pen[0], pen[1], 0));
+    unsigned char *ptr =
+        static_cast<unsigned char *>(image->GetScalarPointer(penX, penY, 0));
     if (ptr)
       {
       int dataPitch = (-iMetaData->imageDimensions[0] - bitmap->width) *
           iMetaData->imageIncrements[0];
       unsigned char *glyphPtrRow = bitmap->buffer;
       unsigned char *glyphPtr;
-      const unsigned char *fgRGB = iMetaData->rgba;
-      const float fgA = iMetaData->rgba[3] / 255.f;
+      float tpropAlpha = iMetaData->rgba[3] / 255.0;
 
       for (int j = 0; j < static_cast<int>(bitmap->rows); ++j)
         {
@@ -1937,42 +1857,41 @@ bool vtkFreeTypeTools::RenderCharacter(CharType character, int &x, int &y,
           if (*glyphPtr == 0)
             {
             ptr += 4;
+            ++glyphPtr;
             }
           else if (ptr[3] > 0)
             {
             // This is a pixel we've drawn before since it has non-zero alpha.
             // We must therefore blend the colors.
-            const float val = *glyphPtr / 255.f;
-            const float bgA = ptr[3] / 255.0;
-
-            const float fg_blend = fgA * val;
-            const float bg_blend = 1.f - fg_blend;
+            float t_alpha = tpropAlpha * (*glyphPtr / 255.0);
+            float t_1_m_alpha = 1.0 - t_alpha;
+            float data_alpha = ptr[3] / 255.0;
 
-            float r(bg_blend * ptr[0] + fg_blend * fgRGB[0]);
-            float g(bg_blend * ptr[1] + fg_blend * fgRGB[1]);
-            float b(bg_blend * ptr[2] + fg_blend * fgRGB[2]);
-            float a(255 * (fg_blend + bgA * bg_blend));
+            float blendR(t_1_m_alpha * ptr[0] + t_alpha * iMetaData->rgba[0]);
+            float blendG(t_1_m_alpha * ptr[1] + t_alpha * iMetaData->rgba[1]);
+            float blendB(t_1_m_alpha * ptr[2] + t_alpha * iMetaData->rgba[2]);
 
             // Figure out the color.
-            ptr[0] = static_cast<unsigned char>(r);
-            ptr[1] = static_cast<unsigned char>(g);
-            ptr[2] = static_cast<unsigned char>(b);
-            ptr[3] = static_cast<unsigned char>(a);
-
+            ptr[0] = static_cast<unsigned char>(blendR);
+            ptr[1] = static_cast<unsigned char>(blendG);
+            ptr[2] = static_cast<unsigned char>(blendB);
+            ptr[3] = static_cast<unsigned char>(
+                  255 * (t_alpha + data_alpha * t_1_m_alpha));
             ptr += 4;
+            ++glyphPtr;
             }
           else
             {
-            *ptr = fgRGB[0];
+            *ptr = iMetaData->rgba[0];
             ++ptr;
-            *ptr = fgRGB[1];
+            *ptr = iMetaData->rgba[1];
             ++ptr;
-            *ptr = fgRGB[2];
+            *ptr = iMetaData->rgba[2];
             ++ptr;
-            *ptr = static_cast<unsigned char>((*glyphPtr) * fgA);
+            *ptr = static_cast<unsigned char>((*glyphPtr) * tpropAlpha);
             ++ptr;
+            ++glyphPtr;
             }
-          ++glyphPtr;
           }
         glyphPtrRow += bitmap->pitch;
         ptr += dataPitch;
@@ -2004,25 +1923,11 @@ bool vtkFreeTypeTools::RenderCharacter(CharType character, int &x, int &y,
     };
 
   FT_UInt glyphIndex;
-  FT_OutlineGlyph outlineGlyph = NULL;
-  FT_Outline *outline = this->GetOutline(character, &metaData.scaler,
+  FT_OutlineGlyph outlineGlyph;
+  FT_Outline *outline = this->GetOutline(character,
+                                         metaData.textPropertyCacheId,
+                                         metaData.textProperty->GetFontSize(),
                                          glyphIndex, outlineGlyph);
-
-  // Add the kerning
-  if (metaData.faceHasKerning && previousGlyphIndex && glyphIndex)
-    {
-    FT_Vector kerningDelta;
-    FT_Get_Kerning(metaData.face, previousGlyphIndex, glyphIndex,
-                   FT_KERNING_DEFAULT, &kerningDelta);
-    if (metaData.faceIsRotated) // PR#15301
-      {
-      FT_Vector_Transform(&kerningDelta, &metaData.rotation);
-      }
-    x += kerningDelta.x >> 6;
-    y += kerningDelta.y >> 6;
-    }
-  previousGlyphIndex = glyphIndex;
-
   if (!outline)
     {
     // TODO render an empty box.
@@ -2034,6 +1939,17 @@ bool vtkFreeTypeTools::RenderCharacter(CharType character, int &x, int &y,
     int pen_x = x;
     int pen_y = y;
 
+    // Add the kerning
+    if (metaData.faceHasKerning && previousGlyphIndex && glyphIndex)
+      {
+      FT_Vector kerningDelta;
+      FT_Get_Kerning(metaData.face, previousGlyphIndex, glyphIndex,
+                     FT_KERNING_DEFAULT, &kerningDelta);
+      pen_x += kerningDelta.x >> 6;
+      pen_y += kerningDelta.y >> 6;
+      }
+    previousGlyphIndex = glyphIndex;
+
     short point = 0;
     for (short contour = 0; contour < outline->n_contours; ++contour)
       {
@@ -2241,10 +2157,6 @@ int vtkFreeTypeTools::FitStringToBBox(const T &str, MetaData &metaData,
           static_cast<double>(targetWidth)  / static_cast<double>(size[0]),
         static_cast<double>(targetHeight) / static_cast<double>(size[1]));
     metaData.textProperty->SetFontSize(static_cast<int>(fontSize));
-    metaData.scaler.height = fontSize * 64; // 26.6 format points
-    metaData.scaler.width = fontSize * 64; // 26.6 format points
-    metaData.unrotatedScaler.height = fontSize * 64; // 26.6 format points
-    metaData.unrotatedScaler.width = fontSize * 64; // 26.6 format points
     if (!this->CalculateBoundingBox(str, metaData))
       {
       return -1;
@@ -2258,10 +2170,6 @@ int vtkFreeTypeTools::FitStringToBBox(const T &str, MetaData &metaData,
     {
     fontSize += 1.;
     metaData.textProperty->SetFontSize(fontSize);
-    metaData.scaler.height = fontSize * 64; // 26.6 format points
-    metaData.scaler.width = fontSize * 64; // 26.6 format points
-    metaData.unrotatedScaler.height = fontSize * 64; // 26.6 format points
-    metaData.unrotatedScaler.width = fontSize * 64; // 26.6 format points
     if (!this->CalculateBoundingBox(str, metaData))
       {
       return -1;
@@ -2274,10 +2182,6 @@ int vtkFreeTypeTools::FitStringToBBox(const T &str, MetaData &metaData,
     {
     fontSize -= 1.;
     metaData.textProperty->SetFontSize(fontSize);
-    metaData.scaler.height = fontSize * 64; // 26.6 format points
-    metaData.scaler.width = fontSize * 64; // 26.6 format points
-    metaData.unrotatedScaler.height = fontSize * 64; // 26.6 format points
-    metaData.unrotatedScaler.width = fontSize * 64; // 26.6 format points
     if (!this->CalculateBoundingBox(str, metaData))
       {
       return -1;
@@ -2291,7 +2195,7 @@ int vtkFreeTypeTools::FitStringToBBox(const T &str, MetaData &metaData,
 
 //----------------------------------------------------------------------------
 inline bool vtkFreeTypeTools::GetFace(vtkTextProperty *prop,
-                                      size_t &prop_cache_id,
+                                      unsigned long &prop_cache_id,
                                       FT_Face &face, bool &face_has_kerning)
 {
   this->MapTextPropertyToId(prop, &prop_cache_id);
@@ -2306,7 +2210,7 @@ inline bool vtkFreeTypeTools::GetFace(vtkTextProperty *prop,
 
 //----------------------------------------------------------------------------
 inline FT_Bitmap* vtkFreeTypeTools::GetBitmap(FT_UInt32 c,
-                                              size_t prop_cache_id,
+                                              unsigned long prop_cache_id,
                                               int prop_font_size,
                                               FT_UInt &gindex,
                                               FT_BitmapGlyph &bitmap_glyph)
@@ -2340,40 +2244,8 @@ inline FT_Bitmap* vtkFreeTypeTools::GetBitmap(FT_UInt32 c,
 }
 
 //----------------------------------------------------------------------------
-FT_Bitmap *vtkFreeTypeTools::GetBitmap(FT_UInt32 c, FTC_Scaler scaler,
-                                       FT_UInt &gindex,
-                                       FT_BitmapGlyph &bitmap_glyph)
-{
-  // Get the glyph index
-  if (!this->GetGlyphIndex(reinterpret_cast<size_t>(scaler->face_id), c,
-                           &gindex))
-    {
-    return 0;
-    }
-
-  // Get the glyph as a bitmap
-  FT_Glyph glyph;
-  if (!this->GetGlyph(scaler, gindex, &glyph,
-                      vtkFreeTypeTools::GLYPH_REQUEST_BITMAP)
-      || glyph->format != ft_glyph_format_bitmap)
-    {
-    return 0;
-    }
-
-  bitmap_glyph = reinterpret_cast<FT_BitmapGlyph>(glyph);
-  FT_Bitmap *bitmap = &bitmap_glyph->bitmap;
-
-  if (bitmap->pixel_mode != ft_pixel_mode_grays)
-    {
-    return 0;
-    }
-
-  return bitmap;
-}
-
-//----------------------------------------------------------------------------
 inline FT_Outline *vtkFreeTypeTools::GetOutline(FT_UInt32 c,
-                                                size_t prop_cache_id,
+                                                unsigned long prop_cache_id,
                                                 int prop_font_size,
                                                 FT_UInt &gindex,
                                                 FT_OutlineGlyph &outline_glyph)
@@ -2402,38 +2274,25 @@ inline FT_Outline *vtkFreeTypeTools::GetOutline(FT_UInt32 c,
 }
 
 //----------------------------------------------------------------------------
-FT_Outline *vtkFreeTypeTools::GetOutline(FT_UInt32 c, FTC_Scaler scaler,
-                                         FT_UInt &gindex,
-                                         FT_OutlineGlyph &outline_glyph)
-{
-  // Get the glyph index
-  if (!this->GetGlyphIndex(reinterpret_cast<size_t>(scaler->face_id), c,
-                           &gindex))
-    {
-    return 0;
-    }
-
-  // Get the glyph as a outline
-  FT_Glyph glyph;
-  if (!this->GetGlyph(scaler, gindex, &glyph,
-                      vtkFreeTypeTools::GLYPH_REQUEST_OUTLINE)
-      || glyph->format != ft_glyph_format_outline)
-    {
-    return 0;
-    }
-
-  outline_glyph = reinterpret_cast<FT_OutlineGlyph>(glyph);
-  FT_Outline *outline= &outline_glyph->outline;
-
-  return outline;
-}
-
-//----------------------------------------------------------------------------
 template<typename T>
 void vtkFreeTypeTools::GetLineMetrics(T begin, T end, MetaData &metaData,
                                       int &width, int bbox[4])
 {
-  FT_BitmapGlyph bitmapGlyph = NULL;
+  FT_Matrix inverseRotation;
+  bool isRotated = (fabs(metaData.textProperty->GetOrientation()) > 1e-5);
+  if (isRotated)
+    {
+    float angle = -vtkMath::RadiansFromDegrees(
+          static_cast<float>(metaData.textProperty->GetOrientation()));
+    float c = cos(angle);
+    float s = sin(angle);
+    inverseRotation.xx = (FT_Fixed)( c * 0x10000L);
+    inverseRotation.xy = (FT_Fixed)(-s * 0x10000L);
+    inverseRotation.yx = (FT_Fixed)( s * 0x10000L);
+    inverseRotation.yy = (FT_Fixed)( c * 0x10000L);
+    }
+
+  FT_BitmapGlyph bitmapGlyph;
   FT_UInt gindex = 0;
   FT_UInt gindexLast = 0;
   FT_Vector delta;
@@ -2441,34 +2300,28 @@ void vtkFreeTypeTools::GetLineMetrics(T begin, T end, MetaData &metaData,
   int pen[2] = {0, 0};
   bbox[0] = bbox[1] = pen[0];
   bbox[2] = bbox[3] = pen[1];
-
+  int fontSize = metaData.textProperty->GetFontSize();
   for (; begin != end; ++begin)
     {
-    // Get the bitmap and glyph index:
-    FT_Bitmap *bitmap = this->GetBitmap(*begin, &metaData.scaler, gindex,
-                                        bitmapGlyph);
-
     // Adjust the pen location for kerning
     if (metaData.faceHasKerning && gindexLast && gindex)
       {
       if (FT_Get_Kerning(metaData.face, gindexLast, gindex, FT_KERNING_DEFAULT,
                          &delta) == 0)
         {
-        // Kerning is not rotated with the face, no need to rotate/adjust for
-        // width:
-        width += delta.x >> 6;
-        // But we do need to rotate for pen location (see PR#15301)
-        if (metaData.faceIsRotated)
-          {
-          FT_Vector_Transform(&delta, &metaData.rotation);
-          }
         pen[0] += delta.x >> 6;
         pen[1] += delta.y >> 6;
+        if (isRotated)
+          {
+          FT_Vector_Transform(&delta, &inverseRotation);
+          }
+        width += delta.x >> 6;
         }
       }
-    gindexLast = gindex;
 
     // Use the dimensions of the bitmap glyph to get a tight bounding box.
+    FT_Bitmap *bitmap = this->GetBitmap(*begin, metaData.textPropertyCacheId,
+                                        fontSize, gindex, bitmapGlyph);
     if (bitmap)
       {
       bbox[0] = std::min(bbox[0], pen[0] + bitmapGlyph->left);
@@ -2489,9 +2342,9 @@ void vtkFreeTypeTools::GetLineMetrics(T begin, T end, MetaData &metaData,
     pen[0] += (delta.x + 0x8000) >> 16;
     pen[1] += (delta.y + 0x8000) >> 16;
 
-    if (metaData.faceIsRotated)
+    if (isRotated)
       {
-      FT_Vector_Transform(&delta, &metaData.inverseRotation);
+      FT_Vector_Transform(&delta, &inverseRotation);
       }
     width += (delta.x + 0x8000) >> 16;
     }
diff --git a/Rendering/FreeType/vtkFreeTypeTools.h b/Rendering/FreeType/vtkFreeTypeTools.h
index 2ecde27..6868caf 100644
--- a/Rendering/FreeType/vtkFreeTypeTools.h
+++ b/Rendering/FreeType/vtkFreeTypeTools.h
@@ -72,7 +72,7 @@ public:
 
   // Description:
   // If true, images produced by RenderString will have a transparent grey
-  // background and set the justification anchor texel to bright yellow.
+  // background.
   vtkSetMacro(DebugTextures, bool)
   vtkGetMacro(DebugTextures, bool)
   vtkBooleanMacro(DebugTextures, bool)
@@ -100,16 +100,16 @@ public:
   // Returns true on success, false otherwise.
   // @sa GetMetrics
   bool GetBoundingBox(vtkTextProperty *tprop, const vtkStdString& str,
-                      int dpi, int bbox[4]);
+                      int bbox[4]);
   bool GetBoundingBox(vtkTextProperty *tprop, const vtkUnicodeString& str,
-                      int dpi, int bbox[4]);
+                      int bbox[4]);
 
   // Description:
   // Given a text property and a string, get the metrics of the rendered string.
   // Returns true on success, false otherwise.
-  bool GetMetrics(vtkTextProperty *tprop, const vtkStdString& str, int dpi,
+  bool GetMetrics(vtkTextProperty *tprop, const vtkStdString& str,
                   vtkTextRenderer::Metrics &metrics);
-  bool GetMetrics(vtkTextProperty *tprop, const vtkUnicodeString& str, int dpi,
+  bool GetMetrics(vtkTextProperty *tprop, const vtkUnicodeString& str,
                   vtkTextRenderer::Metrics &metrics);
 
   // Description:
@@ -121,29 +121,29 @@ public:
   // The origin of the image's extents is aligned with the anchor point
   // described by the text property's vertical and horizontal justification
   // options.
-  bool RenderString(vtkTextProperty *tprop, const vtkStdString& str, int dpi,
+  bool RenderString(vtkTextProperty *tprop, const vtkStdString& str,
                     vtkImageData *data, int textDims[2] = NULL);
   bool RenderString(vtkTextProperty *tprop, const vtkUnicodeString& str,
-                    int dpi, vtkImageData *data, int textDims[2] = NULL);
+                    vtkImageData *data, int textDims[2] = NULL);
 
   // Description:
   // Given a text property and a string, this function populates the vtkPath
   // path with the outline of the rendered string. The origin of the path
   // coordinates is aligned with the anchor point described by the text
   // property's horizontal and vertical justification options.
-  bool StringToPath(vtkTextProperty *tprop, const vtkStdString& str, int dpi,
+  bool StringToPath(vtkTextProperty *tprop, const vtkStdString& str,
                     vtkPath *path);
   bool StringToPath(vtkTextProperty *tprop, const vtkUnicodeString& str,
-                    int dpi, vtkPath *path);
+                    vtkPath *path);
 
   // Description:
   // This function returns the font size (in points) required to fit the string
   // in the target rectangle. The font size of tprop is updated to the computed
   // value as well. If an error occurs, -1 is returned.
   int GetConstrainedFontSize(const vtkStdString &str, vtkTextProperty *tprop,
-                             int dpi, int targetWidth, int targetHeight);
+                             int targetWidth, int targetHeight);
   int GetConstrainedFontSize(const vtkUnicodeString &str,
-                             vtkTextProperty *tprop, int dpi,
+                             vtkTextProperty *tprop,
                              int targetWidth, int targetHeight);
 
   // Description:
@@ -160,8 +160,8 @@ public:
   // binary mask concatenating the attributes of the text property that are
   // relevant to our cache (Color, Opacity, Justification setting are not
   // stored).
-  void MapTextPropertyToId(vtkTextProperty *tprop, size_t *tprop_cache_id);
-  void MapIdToTextProperty(size_t tprop_cache_id, vtkTextProperty *tprop);
+  void MapTextPropertyToId(vtkTextProperty *tprop, unsigned long *tprop_cache_id);
+  void MapIdToTextProperty(unsigned long tprop_cache_id, vtkTextProperty *tprop);
 
   // Description:
   // Set whether the image produced should be scaled up to the nearest power of
@@ -196,7 +196,7 @@ protected:
   // Used to store state about a particular rendering and cache constant values
   class MetaData;
   class ImageMetaData;
-  bool PrepareMetaData(vtkTextProperty *tprop, int dpi, MetaData &metaData);
+  bool PrepareMetaData(vtkTextProperty *tprop, MetaData &metaData);
   bool PrepareImageMetaData(vtkTextProperty *tprop, vtkImageData *image,
                             ImageMetaData &metaData);
 
@@ -252,20 +252,15 @@ protected:
                 FT_UInt32 c,
                 FT_Glyph *glyph,
                 int request = GLYPH_REQUEST_DEFAULT);
-  bool GetSize(size_t tprop_cache_id, int font_size, FT_Size *size);
-  bool GetSize(FTC_Scaler scaler, FT_Size *size);
-  bool GetFace(size_t tprop_cache_id, FT_Face *face);
-  bool GetGlyphIndex(size_t tprop_cache_id, FT_UInt32 c,
+  bool GetSize(unsigned long tprop_cache_id, int font_size, FT_Size *size);
+  bool GetFace(unsigned long tprop_cache_id, FT_Face *face);
+  bool GetGlyphIndex(unsigned long tprop_cache_id, FT_UInt32 c,
                      FT_UInt *gindex);
-  bool GetGlyph(size_t tprop_cache_id,
+  bool GetGlyph(unsigned long tprop_cache_id,
                 int font_size,
                 FT_UInt gindex,
                 FT_Glyph *glyph,
                 int request = GLYPH_REQUEST_DEFAULT);
-  bool GetGlyph(FTC_Scaler scaler,
-                FT_UInt gindex,
-                FT_Glyph *glyph,
-                int request = GLYPH_REQUEST_DEFAULT);
 
   // Description:
   // Should the image be scaled to the next highest power of 2?
@@ -276,24 +271,20 @@ protected:
 
   // Description:
   // Attempt to get the typeface of the specified font.
-  bool GetFace(vtkTextProperty *prop, size_t &prop_cache_id,
+  bool GetFace(vtkTextProperty *prop, unsigned long &prop_cache_id,
                FT_Face &face, bool &face_has_kerning);
 
   // Description:
   // Now attempt to get the bitmap for the specified character.
-  FT_Bitmap* GetBitmap(FT_UInt32 c, size_t prop_cache_id,
+  FT_Bitmap* GetBitmap(FT_UInt32 c, unsigned long prop_cache_id,
                        int prop_font_size, FT_UInt &gindex,
                        FT_BitmapGlyph &bitmap_glyph);
-  FT_Bitmap* GetBitmap(FT_UInt32 c, FTC_Scaler scaler, FT_UInt &gindex,
-                       FT_BitmapGlyph &bitmap_glyph);
 
   // Description:
   // Attempt to get the outline for the specified character.
-  FT_Outline* GetOutline(FT_UInt32 c, size_t prop_cache_id,
+  FT_Outline* GetOutline(FT_UInt32 c, unsigned long prop_cache_id,
                          int prop_font_size, FT_UInt &gindex,
                          FT_OutlineGlyph &outline_glyph);
-  FT_Outline* GetOutline(FT_UInt32 c, FTC_Scaler scaler, FT_UInt &gindex,
-                         FT_OutlineGlyph &outline_glyph);
 
   // Description:
   // The singleton instance and the singleton cleanup instance
@@ -334,13 +325,13 @@ private:
   // Internal helper called by RenderString methods
   template <typename StringType>
   bool RenderStringInternal(vtkTextProperty *tprop, const StringType &str,
-                            int dpi, vtkImageData *data, int textDims[2]);
+                            vtkImageData *data, int textDims[2]);
 
   // Description:
   // Internal helper method called by StringToPath methods
   template <typename StringType>
   bool StringToPathInternal(vtkTextProperty *tprop, const StringType &str,
-                            int dpi, vtkPath *path);
+                            vtkPath *path);
 
   // Description:
   // This function initializes calculates the size of the required bounding box
diff --git a/Rendering/FreeType/vtkFreeTypeUtilities.cxx b/Rendering/FreeType/vtkFreeTypeUtilities.cxx
index f5103b6..1e15798 100644
--- a/Rendering/FreeType/vtkFreeTypeUtilities.cxx
+++ b/Rendering/FreeType/vtkFreeTypeUtilities.cxx
@@ -33,8 +33,6 @@
 
 #include "fonts/vtkEmbeddedFonts.h"
 
-#include <limits>
-#include <cassert>
 #include <sys/stat.h>
 #ifndef _MSC_VER
 # include <stdint.h>
@@ -251,40 +249,35 @@ void vtkFreeTypeUtilities::MapTextPropertyToId(vtkTextProperty *tprop,
   // (the id will be mapped to a pointer, FTC_FaceID, so let's avoid NULL)
 
   *id = 1;
-  unsigned int bits = 1;
+  int bits = 1;
 
   // The font family is in 4 bits (= 5 bits so far)
   // (2 would be enough right now, but who knows, it might grow)
 
-  unsigned long fam = (tprop->GetFontFamily() - tprop->GetFontFamilyMinValue()) << bits;
+  int fam = (tprop->GetFontFamily() - tprop->GetFontFamilyMinValue()) << bits;
   bits += 4;
 
   // Bold is in 1 bit (= 6 bits so far)
 
-  unsigned long bold = (tprop->GetBold() ? 1 : 0) << bits;
+  int bold = (tprop->GetBold() ? 1 : 0) << bits;
   bits++;
 
   // Italic is in 1 bit (= 7 bits so far)
 
-  unsigned long italic = (tprop->GetItalic() ? 1 : 0) << bits;
+  int italic = (tprop->GetItalic() ? 1 : 0) << bits;
   bits++;
 
   // Orientation (in degrees)
   // We need 9 bits for 0 to 360. What do we need for more precisions:
   // - 1/10th degree: 12 bits (11.8)
-  long angle = vtkMath::Round(tprop->GetOrientation() * 10.0) % 3600;
-  if (angle < 0)
-    {
-    angle += 3600;
-    }
-  angle <<= bits;
+
+  int angle = (vtkMath::Round(tprop->GetOrientation() * 10.0) % 3600) << bits;
 
   // We really should not use more than 32 bits
-  unsigned long merged = (fam | bold | italic | angle);
-  assert(merged <= std::numeric_limits<vtkTypeUInt32>::max());
 
   // Now final id
-  *id |= merged;
+
+  *id |= fam | bold | italic | angle;
 }
 
 //----------------------------------------------------------------------------
@@ -533,11 +526,17 @@ void vtkFreeTypeUtilities::ReleaseCacheManager()
     this->CacheManager = NULL;
     }
 
-  delete this->ImageCache;
-  this->ImageCache = NULL;
+  if (this->ImageCache)
+    {
+    delete this->ImageCache;
+    this->ImageCache = NULL;
+    }
 
-  delete this->CMapCache;
-  this->CMapCache = NULL;
+  if (this->CMapCache)
+    {
+    delete this->CMapCache;
+    this->CMapCache = NULL;
+    }
 #endif
 }
 
@@ -1318,6 +1317,18 @@ int vtkFreeTypeUtilities::PopulateImageData(vtkTextProperty *tprop,
 }
 
 //----------------------------------------------------------------------------
+#ifndef VTK_LEGACY_REMOVE
+int vtkFreeTypeUtilities::RenderString(vtkTextProperty *tprop,
+                                       const char *str,
+                                       int, int,
+                                       vtkImageData *data)
+{
+  VTK_LEGACY_BODY(vtkFreeTypeUtilities::RenderString, "VTK 6.0");
+  return this->RenderString(tprop, str, data);
+}
+#endif
+
+//----------------------------------------------------------------------------
 int vtkFreeTypeUtilities::RenderString(vtkTextProperty *tprop,
                                        const char *str,
                                        vtkImageData *data)
@@ -1433,8 +1444,11 @@ void vtkFreeTypeUtilities::ReleaseEntry(int i)
     this->Entries[i]->TextProperty = NULL;
     }
 
-  delete this->Entries[i]->Font;
-  this->Entries[i]->Font = NULL;
+  if (this->Entries[i]->Font)
+    {
+    delete this->Entries[i]->Font;
+    this->Entries[i]->Font = NULL;
+    }
 
   delete this->Entries[i];
   this->Entries[i] = NULL;
diff --git a/Rendering/FreeType/vtkFreeTypeUtilities.h b/Rendering/FreeType/vtkFreeTypeUtilities.h
index a6ae1e0..9905473 100644
--- a/Rendering/FreeType/vtkFreeTypeUtilities.h
+++ b/Rendering/FreeType/vtkFreeTypeUtilities.h
@@ -184,6 +184,13 @@ public:
                    vtkImageData *data);
 
   // Description:
+  // Deprecated function signature.  int x, y are ignored.
+  VTK_LEGACY(int RenderString(vtkTextProperty *tprop,
+                              const char *str,
+                              int x, int y,
+                              vtkImageData *data));
+
+  // Description:
   // For internal use only.
   // Given a text property 'tprop', get its unique ID in our cache framework.
   // In the same way, given a unique ID in our cache, retrieve the
diff --git a/Rendering/FreeType/vtkMathTextFreeTypeTextRenderer.cxx b/Rendering/FreeType/vtkMathTextFreeTypeTextRenderer.cxx
index ffb9228..e042a83 100644
--- a/Rendering/FreeType/vtkMathTextFreeTypeTextRenderer.cxx
+++ b/Rendering/FreeType/vtkMathTextFreeTypeTextRenderer.cxx
@@ -52,19 +52,6 @@ void vtkMathTextFreeTypeTextRenderer::PrintSelf(ostream &os, vtkIndent indent)
 }
 
 //------------------------------------------------------------------------------
-bool vtkMathTextFreeTypeTextRenderer::FreeTypeIsSupported()
-{
-  return this->FreeTypeTools != NULL;
-}
-
-//------------------------------------------------------------------------------
-bool vtkMathTextFreeTypeTextRenderer::MathTextIsSupported()
-{
-  return this->MathTextUtilities != NULL &&
-         this->MathTextUtilities->IsAvailable();
-}
-
-//------------------------------------------------------------------------------
 bool vtkMathTextFreeTypeTextRenderer::GetBoundingBoxInternal(
     vtkTextProperty *tprop, const vtkStdString &str, int bbox[4], int dpi,
     int backend)
@@ -94,7 +81,7 @@ bool vtkMathTextFreeTypeTextRenderer::GetBoundingBoxInternal(
   switch (static_cast<Backend>(backend))
     {
     case MathText:
-      if (this->MathTextIsSupported())
+      if (this->HasMathText)
         {
         if (this->MathTextUtilities->GetBoundingBox(tprop, str.c_str(), dpi,
                                                     bbox))
@@ -103,17 +90,14 @@ bool vtkMathTextFreeTypeTextRenderer::GetBoundingBoxInternal(
           }
         }
       vtkDebugMacro("MathText unavailable. Falling back to FreeType.");
-      VTK_FALLTHROUGH;
     case FreeType:
       {
       vtkStdString cleanString(str);
       this->CleanUpFreeTypeEscapes(cleanString);
       // Interpret string as UTF-8, use the UTF-16 GetBoundingBox overload:
       return this->FreeTypeTools->GetBoundingBox(
-            tprop, vtkUnicodeString::from_utf8(cleanString), dpi, bbox);
+            tprop, vtkUnicodeString::from_utf8(cleanString), bbox);
       }
-    case Default:
-    case UserBackend:
     default:
       vtkDebugMacro("Unrecognized backend requested: " << backend);
       break;
@@ -154,7 +138,7 @@ bool vtkMathTextFreeTypeTextRenderer::GetBoundingBoxInternal(
   switch (static_cast<Backend>(backend))
     {
     case MathText:
-      if (this->MathTextIsSupported())
+      if (this->HasMathText)
         {
         vtkDebugMacro("Converting UTF16 to UTF8 for MathText rendering.");
         if (this->MathTextUtilities->GetBoundingBox(tprop, str.utf8_str(), dpi,
@@ -164,15 +148,12 @@ bool vtkMathTextFreeTypeTextRenderer::GetBoundingBoxInternal(
           }
         }
       vtkDebugMacro("MathText unavailable. Falling back to FreeType.");
-      VTK_FALLTHROUGH;
     case FreeType:
       {
       vtkUnicodeString cleanString(str);
       this->CleanUpFreeTypeEscapes(cleanString);
-      return this->FreeTypeTools->GetBoundingBox(tprop, cleanString, dpi, bbox);
+      return this->FreeTypeTools->GetBoundingBox(tprop, cleanString, bbox);
       }
-    case Default:
-    case UserBackend:
     default:
       vtkDebugMacro("Unrecognized backend requested: " << backend);
       break;
@@ -213,7 +194,7 @@ bool vtkMathTextFreeTypeTextRenderer::GetMetricsInternal(
   switch (static_cast<Backend>(backend))
     {
     case MathText:
-      if (this->MathTextIsSupported())
+      if (this->HasMathText)
         {
         if (this->MathTextUtilities->GetMetrics(tprop, str.c_str(), dpi,
                                                 metrics))
@@ -222,17 +203,14 @@ bool vtkMathTextFreeTypeTextRenderer::GetMetricsInternal(
           }
         }
       vtkDebugMacro("MathText unavailable. Falling back to FreeType.");
-      VTK_FALLTHROUGH;
     case FreeType:
       {
       vtkStdString cleanString(str);
       this->CleanUpFreeTypeEscapes(cleanString);
       // Interpret string as UTF-8, use the UTF-16 GetBoundingBox overload:
       return this->FreeTypeTools->GetMetrics(
-            tprop, vtkUnicodeString::from_utf8(cleanString), dpi, metrics);
+            tprop, vtkUnicodeString::from_utf8(cleanString), metrics);
       }
-    case Default:
-    case UserBackend:
     default:
       vtkDebugMacro("Unrecognized backend requested: " << backend);
       break;
@@ -273,7 +251,7 @@ bool vtkMathTextFreeTypeTextRenderer::GetMetricsInternal(
   switch (static_cast<Backend>(backend))
     {
     case MathText:
-      if (this->MathTextIsSupported())
+      if (this->HasMathText)
         {
         vtkDebugMacro("Converting UTF16 to UTF8 for MathText rendering.");
         if (this->MathTextUtilities->GetMetrics(tprop, str.utf8_str(), dpi,
@@ -283,15 +261,12 @@ bool vtkMathTextFreeTypeTextRenderer::GetMetricsInternal(
           }
         }
       vtkDebugMacro("MathText unavailable. Falling back to FreeType.");
-      VTK_FALLTHROUGH;
     case FreeType:
       {
       vtkUnicodeString cleanString(str);
       this->CleanUpFreeTypeEscapes(cleanString);
-      return this->FreeTypeTools->GetMetrics(tprop, cleanString, dpi, metrics);
+      return this->FreeTypeTools->GetMetrics(tprop, cleanString, metrics);
       }
-    case Default:
-    case UserBackend:
     default:
       vtkDebugMacro("Unrecognized backend requested: " << backend);
       break;
@@ -326,7 +301,7 @@ bool vtkMathTextFreeTypeTextRenderer::RenderStringInternal(
   switch (static_cast<Backend>(backend))
     {
     case MathText:
-      if (this->MathTextIsSupported())
+      if (this->HasMathText)
         {
         if (this->MathTextUtilities->RenderString(str.c_str(), data, tprop,
                                                   dpi, textDims))
@@ -335,18 +310,14 @@ bool vtkMathTextFreeTypeTextRenderer::RenderStringInternal(
           }
         }
       vtkDebugMacro("MathText unavailable. Falling back to FreeType.");
-      VTK_FALLTHROUGH;
     case FreeType:
       {
       vtkStdString cleanString(str);
       this->CleanUpFreeTypeEscapes(cleanString);
       // Interpret string as UTF-8, use the UTF-16 RenderString overload:
       return this->FreeTypeTools->RenderString(
-            tprop, vtkUnicodeString::from_utf8(cleanString), dpi, data,
-            textDims);
+            tprop, vtkUnicodeString::from_utf8(cleanString), data, textDims);
       }
-    case Default:
-    case UserBackend:
     default:
       vtkDebugMacro("Unrecognized backend requested: " << backend);
       break;
@@ -381,7 +352,7 @@ bool vtkMathTextFreeTypeTextRenderer::RenderStringInternal(
   switch (static_cast<Backend>(backend))
     {
     case MathText:
-      if (this->MathTextIsSupported())
+      if (this->HasMathText)
         {
         vtkDebugMacro("Converting UTF16 to UTF8 for MathText rendering.");
         if (this->MathTextUtilities->RenderString(str.utf8_str(), data, tprop,
@@ -391,16 +362,13 @@ bool vtkMathTextFreeTypeTextRenderer::RenderStringInternal(
           }
         }
       vtkDebugMacro("MathText unavailable. Falling back to FreeType.");
-      VTK_FALLTHROUGH;
     case FreeType:
       {
       vtkUnicodeString cleanString(str);
       this->CleanUpFreeTypeEscapes(cleanString);
-      return this->FreeTypeTools->RenderString(tprop, cleanString, dpi, data,
+      return this->FreeTypeTools->RenderString(tprop, cleanString, data,
                                                textDims);
       }
-    case Default:
-    case UserBackend:
     default:
       vtkDebugMacro("Unrecognized backend requested: " << backend);
       break;
@@ -435,7 +403,7 @@ int vtkMathTextFreeTypeTextRenderer::GetConstrainedFontSizeInternal(
   switch (static_cast<Backend>(backend))
     {
     case MathText:
-      if (this->MathTextIsSupported())
+      if (this->HasMathText)
         {
         if (this->MathTextUtilities->GetConstrainedFontSize(str.c_str(), tprop,
                                                             targetWidth,
@@ -446,17 +414,14 @@ int vtkMathTextFreeTypeTextRenderer::GetConstrainedFontSizeInternal(
           }
         }
       vtkDebugMacro("MathText unavailable. Falling back to FreeType.");
-      VTK_FALLTHROUGH;
     case FreeType:
       {
       vtkStdString cleanString(str);
       this->CleanUpFreeTypeEscapes(cleanString);
       return this->FreeTypeTools->GetConstrainedFontSize(cleanString, tprop,
-                                                         dpi, targetWidth,
+                                                         targetWidth,
                                                          targetHeight);
       }
-    case Default:
-    case UserBackend:
     default:
       vtkDebugMacro("Unrecognized backend requested: " << backend);
       break;
@@ -491,7 +456,7 @@ int vtkMathTextFreeTypeTextRenderer::GetConstrainedFontSizeInternal(
   switch (static_cast<Backend>(backend))
     {
     case MathText:
-      if (this->MathTextIsSupported())
+      if (this->HasMathText)
         {
         vtkDebugMacro("Converting UTF16 to UTF8 for MathText rendering.");
         if (this->MathTextUtilities->GetConstrainedFontSize(str.utf8_str(),
@@ -503,17 +468,14 @@ int vtkMathTextFreeTypeTextRenderer::GetConstrainedFontSizeInternal(
           }
         }
       vtkDebugMacro("MathText unavailable. Falling back to FreeType.");
-      VTK_FALLTHROUGH;
     case FreeType:
       {
       vtkUnicodeString cleanString(str);
       this->CleanUpFreeTypeEscapes(cleanString);
       return this->FreeTypeTools->GetConstrainedFontSize(cleanString, tprop,
-                                                         dpi, targetWidth,
+                                                         targetWidth,
                                                          targetHeight);
       }
-    case Default:
-    case UserBackend:
     default:
       vtkDebugMacro("Unrecognized backend requested: " << backend);
       break;
@@ -526,8 +488,7 @@ int vtkMathTextFreeTypeTextRenderer::GetConstrainedFontSizeInternal(
 
 //------------------------------------------------------------------------------
 bool vtkMathTextFreeTypeTextRenderer::StringToPathInternal(
-    vtkTextProperty *tprop, const vtkStdString &str, vtkPath *path, int dpi,
-    int backend)
+    vtkTextProperty *tprop, const vtkStdString &str, vtkPath *path, int backend)
 {
   if (!path || !tprop)
     {
@@ -548,24 +509,20 @@ bool vtkMathTextFreeTypeTextRenderer::StringToPathInternal(
   switch (static_cast<Backend>(backend))
     {
     case MathText:
-      if (this->MathTextIsSupported())
+      if (this->HasMathText)
         {
-        if (this->MathTextUtilities->StringToPath(str.c_str(), path, tprop,
-                                                  dpi))
+        if (this->MathTextUtilities->StringToPath(str.c_str(), path, tprop))
           {
           return true;
           }
         }
       vtkDebugMacro("MathText unavailable. Falling back to FreeType.");
-      VTK_FALLTHROUGH;
     case FreeType:
       {
       vtkStdString cleanString(str);
       this->CleanUpFreeTypeEscapes(cleanString);
-      return this->FreeTypeTools->StringToPath(tprop, str, dpi, path);
+      return this->FreeTypeTools->StringToPath(tprop, str, path);
       }
-    case Default:
-    case UserBackend:
     default:
       vtkDebugMacro("Unrecognized backend requested: " << backend);
       break;
@@ -578,7 +535,7 @@ bool vtkMathTextFreeTypeTextRenderer::StringToPathInternal(
 
 //------------------------------------------------------------------------------
 bool vtkMathTextFreeTypeTextRenderer::StringToPathInternal(
-    vtkTextProperty *tprop, const vtkUnicodeString &str, vtkPath *path, int dpi,
+    vtkTextProperty *tprop, const vtkUnicodeString &str, vtkPath *path,
     int backend)
 {
   if (!path || !tprop)
@@ -600,25 +557,21 @@ bool vtkMathTextFreeTypeTextRenderer::StringToPathInternal(
   switch (static_cast<Backend>(backend))
     {
     case MathText:
-      if (this->MathTextIsSupported())
+      if (this->HasMathText)
         {
         vtkDebugMacro("Converting UTF16 to UTF8 for MathText rendering.");
-        if (this->MathTextUtilities->StringToPath(str.utf8_str(), path, tprop,
-                                                  dpi))
+        if (this->MathTextUtilities->StringToPath(str.utf8_str(), path, tprop))
           {
           return true;
           }
         }
       vtkDebugMacro("MathText unavailable. Falling back to FreeType.");
-      VTK_FALLTHROUGH;
     case FreeType:
       {
       vtkUnicodeString cleanString(str);
       this->CleanUpFreeTypeEscapes(cleanString);
-      return this->FreeTypeTools->StringToPath(tprop, str, dpi, path);
+      return this->FreeTypeTools->StringToPath(tprop, str, path);
       }
-    case Default:
-    case UserBackend:
     default:
       vtkDebugMacro("Unrecognized backend requested: " << backend);
       break;
@@ -647,6 +600,9 @@ vtkMathTextFreeTypeTextRenderer::vtkMathTextFreeTypeTextRenderer()
 {
   this->FreeTypeTools = vtkFreeTypeTools::GetInstance();
   this->MathTextUtilities = vtkMathTextUtilities::GetInstance();
+
+  this->HasFreeType = (this->FreeTypeTools != NULL);
+  this->HasMathText = (this->MathTextUtilities != NULL);
 }
 
 //------------------------------------------------------------------------------
diff --git a/Rendering/FreeType/vtkMathTextFreeTypeTextRenderer.h b/Rendering/FreeType/vtkMathTextFreeTypeTextRenderer.h
index 22a76e0..bab01f3 100644
--- a/Rendering/FreeType/vtkMathTextFreeTypeTextRenderer.h
+++ b/Rendering/FreeType/vtkMathTextFreeTypeTextRenderer.h
@@ -43,11 +43,6 @@ public:
 
   static vtkMathTextFreeTypeTextRenderer *New();
 
-  // Description:
-  // Test for availability of various backends
-  virtual bool FreeTypeIsSupported();
-  virtual bool MathTextIsSupported();
-
 protected:
   vtkMathTextFreeTypeTextRenderer();
   ~vtkMathTextFreeTypeTextRenderer();
@@ -78,9 +73,9 @@ protected:
                                      int targetWidth, int targetHeight, int dpi,
                                      int backend);
   bool StringToPathInternal(vtkTextProperty *tprop, const vtkStdString &str,
-                            vtkPath *path, int dpi, int backend);
+                            vtkPath *path, int backend);
   bool StringToPathInternal(vtkTextProperty *tprop, const vtkUnicodeString &str,
-                            vtkPath *path, int dpi, int backend);
+                            vtkPath *path, int backend);
   void SetScaleToPowerOfTwoInternal(bool scale);
 
 private:
diff --git a/Rendering/FreeType/vtkMathTextUtilities.cxx b/Rendering/FreeType/vtkMathTextUtilities.cxx
index c1b39e2..f441f39 100644
--- a/Rendering/FreeType/vtkMathTextUtilities.cxx
+++ b/Rendering/FreeType/vtkMathTextUtilities.cxx
@@ -95,7 +95,7 @@ int vtkMathTextUtilities::GetConstrainedFontSize(const char *str,
                                                  vtkTextProperty *tprop,
                                                  int targetWidth,
                                                  int targetHeight,
-                                                 int dpi)
+                                                 unsigned int dpi)
 {
   if (str == NULL || str[0] == '\0' || targetWidth == 0 || targetHeight == 0 ||
       tprop == NULL)
diff --git a/Rendering/FreeType/vtkMathTextUtilities.h b/Rendering/FreeType/vtkMathTextUtilities.h
index e3445f6..e2abc46 100644
--- a/Rendering/FreeType/vtkMathTextUtilities.h
+++ b/Rendering/FreeType/vtkMathTextUtilities.h
@@ -52,10 +52,6 @@ public:
   void PrintSelf(ostream& os, vtkIndent indent);
 
   // Description:
-  // Returns true if mathtext rendering is available.
-  virtual bool IsAvailable() { return false; } // Override in subclasses.
-
-  // Description:
   // This is a singleton pattern New. There will be only ONE reference
   // to a vtkMathTextUtilities object per process.  Clients that
   // call this method must use Delete() on the object so that reference
@@ -76,12 +72,13 @@ public:
   // Description:
   // Determine the dimensions of the image that RenderString will produce for
   // a given str, tprop, and dpi
-  virtual bool GetBoundingBox(vtkTextProperty *tprop, const char *str, int dpi,
-                              int bbox[4]) = 0;
+  virtual bool GetBoundingBox(vtkTextProperty *tprop, const char *str,
+                              unsigned int dpi, int bbox[4]) = 0;
 
   // Description:
   // Return the metrics for the rendered str, tprop, and dpi.
-  virtual bool GetMetrics(vtkTextProperty *tprop, const char *str, int dpi,
+  virtual bool GetMetrics(vtkTextProperty *tprop, const char *str,
+                          unsigned int dpi,
                           vtkTextRenderer::Metrics &metrics) = 0;
 
   // Description:
@@ -91,14 +88,14 @@ public:
   // set to true, and the image dimensions may not match the dimensions of the
   // rendered text.
  virtual bool RenderString(const char *str, vtkImageData *data,
-                           vtkTextProperty *tprop, int dpi,
-                           int textDims[2] = NULL) = 0;
+                           vtkTextProperty *tprop,
+                           unsigned int dpi, int textDims[2] = NULL) = 0;
 
   // Description:
   // Parse the MathText expression in str and fill path with a contour of the
   // glyphs.
   virtual bool StringToPath(const char *str, vtkPath *path,
-                            vtkTextProperty *tprop, int dpi) = 0;
+                            vtkTextProperty *tprop) = 0;
 
   // Description:
   // This function returns the font size (in points) required to fit the string
@@ -108,7 +105,7 @@ public:
   virtual int GetConstrainedFontSize(const char *str,
                                      vtkTextProperty *tprop,
                                      int targetWidth, int targetHeight,
-                                     int dpi);
+                                     unsigned int dpi);
 
   // Description:
   // Set to true if the graphics implmentation requires texture image dimensions
diff --git a/Rendering/FreeType/vtkTextRendererStringToImage.cxx b/Rendering/FreeType/vtkTextRendererStringToImage.cxx
index cdf91da..23808f9 100644
--- a/Rendering/FreeType/vtkTextRendererStringToImage.cxx
+++ b/Rendering/FreeType/vtkTextRendererStringToImage.cxx
@@ -50,7 +50,7 @@ vtkTextRendererStringToImage::~vtkTextRendererStringToImage()
 
 //-----------------------------------------------------------------------------
 vtkVector2i vtkTextRendererStringToImage::GetBounds(
-    vtkTextProperty *property, const vtkUnicodeString& string, int dpi)
+    vtkTextProperty *property, const vtkUnicodeString& string)
 {
   int tmp[4] = { 0, 0, 0, 0 };
   vtkVector2i recti(tmp);
@@ -59,8 +59,7 @@ vtkVector2i vtkTextRendererStringToImage::GetBounds(
     return recti;
     }
 
-  this->Implementation->TextRenderer->GetBoundingBox(property, string, tmp,
-                                                     dpi);
+  this->Implementation->TextRenderer->GetBoundingBox(property, string, tmp);
 
   recti.Set(tmp[1] - tmp[0],
             tmp[3] - tmp[2]);
@@ -70,8 +69,7 @@ vtkVector2i vtkTextRendererStringToImage::GetBounds(
 
 //-----------------------------------------------------------------------------
 vtkVector2i vtkTextRendererStringToImage::GetBounds(vtkTextProperty *property,
-                                                    const vtkStdString& string,
-                                                    int dpi)
+                                                    const vtkStdString& string)
 {
   vtkVector2i recti(0, 0);
   int tmp[4];
@@ -80,8 +78,7 @@ vtkVector2i vtkTextRendererStringToImage::GetBounds(vtkTextProperty *property,
     return recti;
     }
 
-  this->Implementation->TextRenderer->GetBoundingBox(property, string, tmp,
-                                                     dpi);
+  this->Implementation->TextRenderer->GetBoundingBox(property, string, tmp);
 
   recti.Set(tmp[1] - tmp[0],
             tmp[3] - tmp[2]);
@@ -91,20 +88,34 @@ vtkVector2i vtkTextRendererStringToImage::GetBounds(vtkTextProperty *property,
 
 //-----------------------------------------------------------------------------
 int vtkTextRendererStringToImage::RenderString(
-    vtkTextProperty *property, const vtkUnicodeString& string, int dpi,
+    vtkTextProperty *property, const vtkUnicodeString& string,
     vtkImageData *data, int textDims[2])
 {
+  // Get the required size, and initialize a new QImage to draw on.
+  vtkVector2i box = this->GetBounds(property, string);
+  if (box.GetX() == 0 || box.GetY() == 0)
+    {
+    return 0;
+    }
+
   return this->Implementation->TextRenderer->RenderString(property, string,
-                                                          data, textDims, dpi);
+                                                          data, textDims);
 }
 
 //-----------------------------------------------------------------------------
 int vtkTextRendererStringToImage::RenderString(vtkTextProperty *property,
-                                           const vtkStdString& string, int dpi,
+                                           const vtkStdString& string,
                                            vtkImageData *data, int textDims[2])
 {
+  // Get the required size, and initialize a new QImage to draw on.
+  vtkVector2i box = this->GetBounds(property, string);
+  if (box.GetX() == 0 || box.GetY() == 0)
+    {
+    return 0;
+    }
+
   return this->Implementation->TextRenderer->RenderString(property, string,
-                                                          data, textDims, dpi);
+                                                          data, textDims);
 }
 
 //-----------------------------------------------------------------------------
diff --git a/Rendering/FreeType/vtkTextRendererStringToImage.h b/Rendering/FreeType/vtkTextRendererStringToImage.h
index cd4f832..845b7a7 100644
--- a/Rendering/FreeType/vtkTextRendererStringToImage.h
+++ b/Rendering/FreeType/vtkTextRendererStringToImage.h
@@ -44,11 +44,9 @@ public:
   // is valid (it may not if GetBoundingBox() failed or if the string
   // was empty).
   virtual vtkVector2i GetBounds(vtkTextProperty *property,
-                                const vtkUnicodeString& string,
-                                int dpi);
+                                const vtkUnicodeString& string);
   virtual vtkVector2i GetBounds(vtkTextProperty *property,
-                                const vtkStdString& string,
-                                int dpi);
+                                const vtkStdString& string);
 
   // Description:
   // Given a text property and a string, this function initializes the
@@ -58,12 +56,10 @@ public:
   // not match the dimensions of the rendered text.
   virtual int RenderString(vtkTextProperty *property,
                            const vtkUnicodeString& string,
-                           int dpi,
                            vtkImageData *data,
                            int textDims[2] = NULL);
   virtual int RenderString(vtkTextProperty *property,
                            const vtkStdString& string,
-                           int dpi,
                            vtkImageData *data,
                            int textDims[2] = NULL);
 
diff --git a/Rendering/FreeType/vtkVectorText.cxx b/Rendering/FreeType/vtkVectorText.cxx
index 5d9036a..d25e69d 100644
--- a/Rendering/FreeType/vtkVectorText.cxx
+++ b/Rendering/FreeType/vtkVectorText.cxx
@@ -46,20 +46,20 @@ typedef struct {
 } VTK_VECTOR_TEXT_GLYPH;
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_33 [] = {
-{ 0.28000f,-0.07186f}, { 0.43164f,-0.07143f}, { 0.27689f, 0.07714f}, { 0.43472f, 0.07714f}, { 0.32000f, 0.20134f},
-{ 0.40000f, 0.20243f}, { 0.31429f, 0.20550f}, { 0.27277f, 0.76857f}, { 0.43848f, 0.76857f}, { 0.27693f, 1.02571f},
-{ 0.43429f, 1.02615f},
+{ 0.28000,-0.07186}, { 0.43164,-0.07143}, { 0.27689, 0.07714}, { 0.43472, 0.07714}, { 0.32000, 0.20134},
+{ 0.40000, 0.20243}, { 0.31429, 0.20550}, { 0.27277, 0.76857}, { 0.43848, 0.76857}, { 0.27693, 1.02571},
+{ 0.43429, 1.02615},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_33 [] = {
 { 2, 1, 3}, { 2, 0, 1}, { 7, 6, 5}, { 6, 4, 5}, { 8, 7, 5}, { 7, 8, 9}, {10, 9, 8},
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_34 [] = {
-{ 0.25714f, 0.63563f}, { 0.32571f, 0.63563f}, { 0.50286f, 0.63642f}, { 0.25143f, 0.63946f}, { 0.33143f, 0.63840f},
-{ 0.33462f, 0.64286f}, { 0.49673f, 0.64286f}, { 0.57714f, 0.63757f}, { 0.58093f, 0.64286f}, { 0.21335f, 0.84286f},
-{ 0.36680f, 0.84286f}, { 0.46177f, 0.84286f}, { 0.61522f, 0.84286f}, { 0.21295f, 1.02000f}, { 0.46134f, 1.02000f},
-{ 0.61563f, 1.02000f}, { 0.36571f, 1.02307f}, { 0.46550f, 1.02571f}, { 0.21714f, 1.02615f}, { 0.36000f, 1.02723f},
-{ 0.61143f, 1.02615f},
+{ 0.25714, 0.63563}, { 0.32571, 0.63563}, { 0.50286, 0.63642}, { 0.25143, 0.63946}, { 0.33143, 0.63840},
+{ 0.33462, 0.64286}, { 0.49673, 0.64286}, { 0.57714, 0.63757}, { 0.58093, 0.64286}, { 0.21335, 0.84286},
+{ 0.36680, 0.84286}, { 0.46177, 0.84286}, { 0.61522, 0.84286}, { 0.21295, 1.02000}, { 0.46134, 1.02000},
+{ 0.61563, 1.02000}, { 0.36571, 1.02307}, { 0.46550, 1.02571}, { 0.21714, 1.02615}, { 0.36000, 1.02723},
+{ 0.61143, 1.02615},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_34 [] = {
 { 3, 5, 9}, { 7, 6, 2}, { 4, 5, 1}, { 6, 8, 12}, { 0, 1, 5}, { 6,12,11}, { 3, 0, 5},
@@ -68,15 +68,15 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_34 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_35 [] = {
-{ 0.22286f,-0.09100f}, { 0.32571f,-0.09236f}, { 0.56832f,-0.08857f}, { 0.67429f,-0.09201f}, { 0.28193f, 0.22000f},
-{ 0.39470f, 0.22000f}, { 0.63009f, 0.22000f}, { 0.15385f, 0.23143f}, { 0.27429f, 0.22723f}, { 0.40571f, 0.22723f},
-{ 0.62286f, 0.22723f}, { 0.74857f, 0.22680f}, { 0.97454f, 0.23143f}, { 0.15385f, 0.33429f}, { 0.97454f, 0.33429f},
-{ 0.30344f, 0.34000f}, { 0.65201f, 0.34000f}, { 0.77084f, 0.34000f}, { 0.42286f, 0.34010f}, { 0.42034f, 0.34571f},
-{ 0.36041f, 0.60286f}, { 0.70748f, 0.60286f}, { 0.82034f, 0.60286f}, { 0.47429f, 0.60626f}, { 0.15385f, 0.61429f},
-{ 0.35429f, 0.61009f}, { 0.70286f, 0.60951f}, { 0.82857f, 0.61009f}, { 0.97454f, 0.61429f}, { 0.15385f, 0.71714f},
-{ 0.37714f, 0.72134f}, { 0.50286f, 0.72191f}, { 0.72571f, 0.72134f}, { 0.85143f, 0.72156f}, { 0.97143f, 0.72025f},
-{ 0.38605f, 0.72857f}, { 0.49823f, 0.72857f}, { 0.73335f, 0.72857f}, { 0.84613f, 0.72857f}, { 0.45143f, 1.04160f},
-{ 0.55735f, 1.04286f}, { 0.80000f, 1.04243f}, { 0.90521f, 1.04286f},
+{ 0.22286,-0.09100}, { 0.32571,-0.09236}, { 0.56832,-0.08857}, { 0.67429,-0.09201}, { 0.28193, 0.22000},
+{ 0.39470, 0.22000}, { 0.63009, 0.22000}, { 0.15385, 0.23143}, { 0.27429, 0.22723}, { 0.40571, 0.22723},
+{ 0.62286, 0.22723}, { 0.74857, 0.22680}, { 0.97454, 0.23143}, { 0.15385, 0.33429}, { 0.97454, 0.33429},
+{ 0.30344, 0.34000}, { 0.65201, 0.34000}, { 0.77084, 0.34000}, { 0.42286, 0.34010}, { 0.42034, 0.34571},
+{ 0.36041, 0.60286}, { 0.70748, 0.60286}, { 0.82034, 0.60286}, { 0.47429, 0.60626}, { 0.15385, 0.61429},
+{ 0.35429, 0.61009}, { 0.70286, 0.60951}, { 0.82857, 0.61009}, { 0.97454, 0.61429}, { 0.15385, 0.71714},
+{ 0.37714, 0.72134}, { 0.50286, 0.72191}, { 0.72571, 0.72134}, { 0.85143, 0.72156}, { 0.97143, 0.72025},
+{ 0.38605, 0.72857}, { 0.49823, 0.72857}, { 0.73335, 0.72857}, { 0.84613, 0.72857}, { 0.45143, 1.04160},
+{ 0.55735, 1.04286}, { 0.80000, 1.04243}, { 0.90521, 1.04286},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_35 [] = {
 { 6, 2, 3}, { 5, 0, 1}, { 0, 5, 4}, {18, 9,10}, {11, 6, 3}, { 4, 9, 8}, {13, 8,15},
@@ -89,21 +89,21 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_35 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_36 [] = {
-{ 0.52571f,-0.22882f}, { 0.59429f,-0.22991f}, { 0.52000f,-0.09942f}, { 0.60571f,-0.09385f}, { 0.40571f,-0.07057f},
-{ 0.72730f,-0.06571f}, { 0.33143f,-0.03465f}, { 0.80571f,-0.01813f}, { 0.51429f, 0.01891f}, { 0.52152f, 0.02571f},
-{ 0.60571f, 0.02014f}, { 0.84571f, 0.02168f}, { 0.25669f, 0.04286f}, { 0.66857f, 0.03800f}, { 0.44571f, 0.04535f},
-{ 0.70984f, 0.06571f}, { 0.74535f, 0.10571f}, { 0.74857f, 0.11079f}, { 0.74902f, 0.11143f}, { 0.37057f, 0.12857f},
-{ 0.90538f, 0.12857f}, { 0.20823f, 0.15143f}, { 0.35748f, 0.16286f}, { 0.77395f, 0.16857f}, { 0.35429f, 0.17310f},
-{ 0.35177f, 0.18000f}, { 0.78134f, 0.21429f}, { 0.92152f, 0.21429f}, { 0.19580f, 0.22571f}, { 0.33480f, 0.25429f},
-{ 0.77395f, 0.29429f}, { 0.91177f, 0.32286f}, { 0.76000f, 0.32921f}, { 0.72571f, 0.36972f}, { 0.89355f, 0.37429f},
-{ 0.64690f, 0.40857f}, { 0.65143f, 0.40706f}, { 0.64000f, 0.41109f}, { 0.60571f, 0.41986f}, { 0.52109f, 0.43714f},
-{ 0.85714f, 0.43270f}, { 0.38857f, 0.49216f}, { 0.79429f, 0.48902f}, { 0.72571f, 0.52437f}, { 0.30454f, 0.54571f},
-{ 0.60260f, 0.56286f}, { 0.52043f, 0.58571f}, { 0.26286f, 0.59570f}, { 0.46857f, 0.59800f}, { 0.39429f, 0.65095f},
-{ 0.22857f, 0.67295f}, { 0.36823f, 0.70000f}, { 0.75429f, 0.77624f}, { 0.21907f, 0.78571f}, { 0.35891f, 0.78571f},
-{ 0.89184f, 0.79714f}, { 0.37714f, 0.85001f}, { 0.72571f, 0.86144f}, { 0.87470f, 0.86571f}, { 0.24571f, 0.89016f},
-{ 0.68571f, 0.90956f}, { 0.44000f, 0.92036f}, { 0.60571f, 0.94469f}, { 0.83179f, 0.94571f}, { 0.28000f, 0.94629f},
-{ 0.51429f, 0.94891f}, { 0.34286f, 1.00607f}, { 0.75429f, 1.01579f}, { 0.38286f, 1.02784f}, { 0.52043f, 1.06571f},
-{ 0.60260f, 1.06571f}, { 0.52260f, 1.12286f}, { 0.60043f, 1.12286f},
+{ 0.52571,-0.22882}, { 0.59429,-0.22991}, { 0.52000,-0.09942}, { 0.60571,-0.09385}, { 0.40571,-0.07057},
+{ 0.72730,-0.06571}, { 0.33143,-0.03465}, { 0.80571,-0.01813}, { 0.51429, 0.01891}, { 0.52152, 0.02571},
+{ 0.60571, 0.02014}, { 0.84571, 0.02168}, { 0.25669, 0.04286}, { 0.66857, 0.03800}, { 0.44571, 0.04535},
+{ 0.70984, 0.06571}, { 0.74535, 0.10571}, { 0.74857, 0.11079}, { 0.74902, 0.11143}, { 0.37057, 0.12857},
+{ 0.90538, 0.12857}, { 0.20823, 0.15143}, { 0.35748, 0.16286}, { 0.77395, 0.16857}, { 0.35429, 0.17310},
+{ 0.35177, 0.18000}, { 0.78134, 0.21429}, { 0.92152, 0.21429}, { 0.19580, 0.22571}, { 0.33480, 0.25429},
+{ 0.77395, 0.29429}, { 0.91177, 0.32286}, { 0.76000, 0.32921}, { 0.72571, 0.36972}, { 0.89355, 0.37429},
+{ 0.64690, 0.40857}, { 0.65143, 0.40706}, { 0.64000, 0.41109}, { 0.60571, 0.41986}, { 0.52109, 0.43714},
+{ 0.85714, 0.43270}, { 0.38857, 0.49216}, { 0.79429, 0.48902}, { 0.72571, 0.52437}, { 0.30454, 0.54571},
+{ 0.60260, 0.56286}, { 0.52043, 0.58571}, { 0.26286, 0.59570}, { 0.46857, 0.59800}, { 0.39429, 0.65095},
+{ 0.22857, 0.67295}, { 0.36823, 0.70000}, { 0.75429, 0.77624}, { 0.21907, 0.78571}, { 0.35891, 0.78571},
+{ 0.89184, 0.79714}, { 0.37714, 0.85001}, { 0.72571, 0.86144}, { 0.87470, 0.86571}, { 0.24571, 0.89016},
+{ 0.68571, 0.90956}, { 0.44000, 0.92036}, { 0.60571, 0.94469}, { 0.83179, 0.94571}, { 0.28000, 0.94629},
+{ 0.51429, 0.94891}, { 0.34286, 1.00607}, { 0.75429, 1.01579}, { 0.38286, 1.02784}, { 0.52043, 1.06571},
+{ 0.60260, 1.06571}, { 0.52260, 1.12286}, { 0.60043, 1.12286},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_36 [] = {
 { 3, 8, 2}, { 2, 8, 4}, {19,12, 6}, {13,11,15}, { 9, 8,10}, { 3, 2, 1}, { 8, 3,10},
@@ -120,23 +120,23 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_36 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_37 [] = {
-{ 0.46713f,-0.11143f}, { 0.57143f,-0.11215f}, { 1.19429f,-0.11252f}, { 1.10286f,-0.10252f}, { 1.26444f,-0.09429f},
-{ 1.05143f,-0.07759f}, { 1.31429f,-0.06384f}, { 1.14857f,-0.01538f}, { 1.18857f,-0.01807f}, { 0.98857f,-0.01364f},
-{ 1.22286f,-0.00771f}, { 1.36784f,-0.00286f}, { 1.11302f, 0.00286f}, { 1.26436f, 0.03143f}, { 1.07787f, 0.04857f},
-{ 0.95748f, 0.05429f}, { 1.39681f, 0.06571f}, { 1.28680f, 0.09429f}, { 1.05866f, 0.14000f}, { 1.40991f, 0.14571f},
-{ 0.94134f, 0.15143f}, { 0.94134f, 0.21429f}, { 1.29295f, 0.21429f}, { 1.06134f, 0.23714f}, { 1.40723f, 0.23714f},
-{ 0.95748f, 0.30000f}, { 1.39387f, 0.30000f}, { 1.07787f, 0.30571f}, { 1.27429f, 0.30371f}, { 1.09561f, 0.33429f},
-{ 1.23429f, 0.35465f}, { 1.36616f, 0.36286f}, { 1.13143f, 0.36327f}, { 1.16571f, 0.37277f}, { 1.20571f, 0.36899f},
-{ 1.00045f, 0.38571f}, { 1.32000f, 0.41543f}, { 1.06857f, 0.44498f}, { 1.24571f, 0.45681f}, { 0.48000f, 0.46420f},
-{ 1.15429f, 0.46723f}, { 0.38857f, 0.47462f}, { 0.55016f, 0.48286f}, { 0.60000f, 0.51330f}, { 0.30286f, 0.52704f},
-{ 0.43429f, 0.56177f}, { 0.47429f, 0.55907f}, { 0.26857f, 0.57284f}, { 0.50857f, 0.56943f}, { 0.65355f, 0.57429f},
-{ 0.39873f, 0.58000f}, { 0.55007f, 0.60857f}, { 0.24530f, 0.62571f}, { 0.36359f, 0.62571f}, { 0.68252f, 0.64286f},
-{ 0.56680f, 0.64857f}, { 0.23050f, 0.69429f}, { 0.34437f, 0.71714f}, { 0.57866f, 0.72286f}, { 0.69563f, 0.72286f},
-{ 0.22705f, 0.79143f}, { 0.34705f, 0.81429f}, { 0.69295f, 0.81429f}, { 0.56891f, 0.85429f}, { 0.67959f, 0.87714f},
-{ 0.24530f, 0.88286f}, { 0.36359f, 0.88286f}, { 0.38132f, 0.91143f}, { 0.54286f, 0.90975f}, { 0.52000f, 0.93179f},
-{ 0.65465f, 0.93429f}, { 0.41714f, 0.94041f}, { 0.47429f, 0.94950f}, { 0.29143f, 0.96914f}, { 0.60571f, 0.99258f},
-{ 0.32000f, 0.99868f}, { 0.38286f, 1.03395f}, { 0.53714f, 1.03184f}, { 1.06857f, 1.04249f}, { 1.17287f, 1.04286f},
-{ 0.48000f, 1.04395f},
+{ 0.46713,-0.11143}, { 0.57143,-0.11215}, { 1.19429,-0.11252}, { 1.10286,-0.10252}, { 1.26444,-0.09429},
+{ 1.05143,-0.07759}, { 1.31429,-0.06384}, { 1.14857,-0.01538}, { 1.18857,-0.01807}, { 0.98857,-0.01364},
+{ 1.22286,-0.00771}, { 1.36784,-0.00286}, { 1.11302, 0.00286}, { 1.26436, 0.03143}, { 1.07787, 0.04857},
+{ 0.95748, 0.05429}, { 1.39681, 0.06571}, { 1.28680, 0.09429}, { 1.05866, 0.14000}, { 1.40991, 0.14571},
+{ 0.94134, 0.15143}, { 0.94134, 0.21429}, { 1.29295, 0.21429}, { 1.06134, 0.23714}, { 1.40723, 0.23714},
+{ 0.95748, 0.30000}, { 1.39387, 0.30000}, { 1.07787, 0.30571}, { 1.27429, 0.30371}, { 1.09561, 0.33429},
+{ 1.23429, 0.35465}, { 1.36616, 0.36286}, { 1.13143, 0.36327}, { 1.16571, 0.37277}, { 1.20571, 0.36899},
+{ 1.00045, 0.38571}, { 1.32000, 0.41543}, { 1.06857, 0.44498}, { 1.24571, 0.45681}, { 0.48000, 0.46420},
+{ 1.15429, 0.46723}, { 0.38857, 0.47462}, { 0.55016, 0.48286}, { 0.60000, 0.51330}, { 0.30286, 0.52704},
+{ 0.43429, 0.56177}, { 0.47429, 0.55907}, { 0.26857, 0.57284}, { 0.50857, 0.56943}, { 0.65355, 0.57429},
+{ 0.39873, 0.58000}, { 0.55007, 0.60857}, { 0.24530, 0.62571}, { 0.36359, 0.62571}, { 0.68252, 0.64286},
+{ 0.56680, 0.64857}, { 0.23050, 0.69429}, { 0.34437, 0.71714}, { 0.57866, 0.72286}, { 0.69563, 0.72286},
+{ 0.22705, 0.79143}, { 0.34705, 0.81429}, { 0.69295, 0.81429}, { 0.56891, 0.85429}, { 0.67959, 0.87714},
+{ 0.24530, 0.88286}, { 0.36359, 0.88286}, { 0.38132, 0.91143}, { 0.54286, 0.90975}, { 0.52000, 0.93179},
+{ 0.65465, 0.93429}, { 0.41714, 0.94041}, { 0.47429, 0.94950}, { 0.29143, 0.96914}, { 0.60571, 0.99258},
+{ 0.32000, 0.99868}, { 0.38286, 1.03395}, { 0.53714, 1.03184}, { 1.06857, 1.04249}, { 1.17287, 1.04286},
+{ 0.48000, 1.04395},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_37 [] = {
 { 0, 1,78}, {10, 4, 6}, { 2, 8, 3}, { 9,14,15}, { 4,10, 8}, { 3, 7, 5}, { 7, 3, 8},
@@ -154,22 +154,22 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_37 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_38 [] = {
-{ 0.58857f,-0.08966f}, { 1.03429f,-0.09235f}, { 0.48000f,-0.08395f}, { 0.66286f,-0.07673f}, { 0.40000f,-0.05914f},
-{ 0.72000f,-0.05641f}, { 0.98286f,-0.05473f}, { 0.35429f,-0.03393f}, { 0.78857f,-0.01678f}, { 1.12629f, 0.00857f},
-{ 0.29143f, 0.02168f}, { 0.52571f, 0.02991f}, { 0.57714f, 0.02764f}, { 0.62286f, 0.03756f}, { 0.46857f, 0.04645f},
-{ 0.87429f, 0.05495f}, { 0.69714f, 0.07393f}, { 0.42132f, 0.08286f}, { 1.04571f, 0.07868f}, { 0.24486f, 0.08857f},
-{ 0.75011f, 0.11714f}, { 0.22327f, 0.14000f}, { 0.37927f, 0.14571f}, { 0.78349f, 0.16286f}, { 0.96893f, 0.16286f},
-{ 0.96571f, 0.16717f}, { 0.96457f, 0.16857f}, { 0.95937f, 0.18000f}, { 0.35580f, 0.22571f}, { 0.20991f, 0.25429f},
-{ 0.36319f, 0.28857f}, { 0.86286f, 0.29600f}, { 1.02437f, 0.31143f}, { 0.22645f, 0.32857f}, { 0.40418f, 0.36286f},
-{ 0.40571f, 0.36454f}, { 0.41330f, 0.37429f}, { 1.05421f, 0.40857f}, { 0.28418f, 0.42571f}, { 0.92000f, 0.44119f},
-{ 0.53714f, 0.46770f}, { 0.37143f, 0.50250f}, { 0.66758f, 0.54000f}, { 0.46406f, 0.55714f}, { 0.78704f, 0.62571f},
-{ 0.59429f, 0.63146f}, { 0.37714f, 0.68444f}, { 0.69296f, 0.70000f}, { 0.85355f, 0.71714f}, { 0.35681f, 0.73429f},
-{ 0.50200f, 0.75143f}, { 0.49756f, 0.76286f}, { 0.49502f, 0.76857f}, { 0.72891f, 0.76857f}, { 0.86966f, 0.76857f},
-{ 0.34748f, 0.82000f}, { 0.73295f, 0.82000f}, { 0.48764f, 0.82571f}, { 0.87236f, 0.83143f}, { 0.49714f, 0.86089f},
-{ 0.35849f, 0.87143f}, { 0.71429f, 0.87650f}, { 0.52000f, 0.89555f}, { 0.69714f, 0.89846f}, { 0.37964f, 0.91714f},
-{ 0.84657f, 0.91714f}, { 0.55429f, 0.92073f}, { 0.65714f, 0.92498f}, { 0.60000f, 0.93277f}, { 0.81868f, 0.95714f},
-{ 0.42857f, 0.97582f}, { 0.76571f, 1.00436f}, { 0.51429f, 1.02723f}, { 0.72000f, 1.02723f}, { 0.59429f, 1.04437f},
-{ 0.64571f, 1.04395f},
+{ 0.58857,-0.08966}, { 1.03429,-0.09235}, { 0.48000,-0.08395}, { 0.66286,-0.07673}, { 0.40000,-0.05914},
+{ 0.72000,-0.05641}, { 0.98286,-0.05473}, { 0.35429,-0.03393}, { 0.78857,-0.01678}, { 1.12629, 0.00857},
+{ 0.29143, 0.02168}, { 0.52571, 0.02991}, { 0.57714, 0.02764}, { 0.62286, 0.03756}, { 0.46857, 0.04645},
+{ 0.87429, 0.05495}, { 0.69714, 0.07393}, { 0.42132, 0.08286}, { 1.04571, 0.07868}, { 0.24486, 0.08857},
+{ 0.75011, 0.11714}, { 0.22327, 0.14000}, { 0.37927, 0.14571}, { 0.78349, 0.16286}, { 0.96893, 0.16286},
+{ 0.96571, 0.16717}, { 0.96457, 0.16857}, { 0.95937, 0.18000}, { 0.35580, 0.22571}, { 0.20991, 0.25429},
+{ 0.36319, 0.28857}, { 0.86286, 0.29600}, { 1.02437, 0.31143}, { 0.22645, 0.32857}, { 0.40418, 0.36286},
+{ 0.40571, 0.36454}, { 0.41330, 0.37429}, { 1.05421, 0.40857}, { 0.28418, 0.42571}, { 0.92000, 0.44119},
+{ 0.53714, 0.46770}, { 0.37143, 0.50250}, { 0.66758, 0.54000}, { 0.46406, 0.55714}, { 0.78704, 0.62571},
+{ 0.59429, 0.63146}, { 0.37714, 0.68444}, { 0.69296, 0.70000}, { 0.85355, 0.71714}, { 0.35681, 0.73429},
+{ 0.50200, 0.75143}, { 0.49756, 0.76286}, { 0.49502, 0.76857}, { 0.72891, 0.76857}, { 0.86966, 0.76857},
+{ 0.34748, 0.82000}, { 0.73295, 0.82000}, { 0.48764, 0.82571}, { 0.87236, 0.83143}, { 0.49714, 0.86089},
+{ 0.35849, 0.87143}, { 0.71429, 0.87650}, { 0.52000, 0.89555}, { 0.69714, 0.89846}, { 0.37964, 0.91714},
+{ 0.84657, 0.91714}, { 0.55429, 0.92073}, { 0.65714, 0.92498}, { 0.60000, 0.93277}, { 0.81868, 0.95714},
+{ 0.42857, 0.97582}, { 0.76571, 1.00436}, { 0.51429, 1.02723}, { 0.72000, 1.02723}, { 0.59429, 1.04437},
+{ 0.64571, 1.04395},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_38 [] = {
 { 7,17,10}, { 3,13, 0}, { 2,14, 4}, { 6,18,15}, {17, 7, 4}, { 9,18, 6}, { 9, 6, 1},
@@ -187,8 +187,8 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_38 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_39 [] = {
-{ 0.25143f, 0.63563f}, { 0.24571f, 0.63946f}, { 0.32571f, 0.63757f}, { 0.32950f, 0.64286f}, { 0.21034f, 0.83714f},
-{ 0.36379f, 0.83714f}, { 0.20991f, 1.02000f}, { 0.36420f, 1.02000f}, { 0.21408f, 1.02571f}, { 0.36000f, 1.02615f},
+{ 0.25143, 0.63563}, { 0.24571, 0.63946}, { 0.32571, 0.63757}, { 0.32950, 0.64286}, { 0.21034, 0.83714},
+{ 0.36379, 0.83714}, { 0.20991, 1.02000}, { 0.36420, 1.02000}, { 0.21408, 1.02571}, { 0.36000, 1.02615},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_39 [] = {
 { 1, 0, 3}, { 2, 3, 0}, { 1, 3, 4}, { 7, 6, 4}, { 5, 4, 3}, { 7, 4, 5}, { 8, 6, 9},
@@ -196,10 +196,10 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_39 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_40 [] = {
-{ 0.50857f,-0.39522f}, { 0.59429f,-0.39447f}, { 0.44000f,-0.30784f}, { 0.51787f,-0.24857f}, { 0.32530f,-0.09429f},
-{ 0.43748f,-0.05429f}, { 0.26899f, 0.06571f}, { 0.38134f, 0.20286f}, { 0.23580f, 0.27714f}, { 0.37605f, 0.38000f},
-{ 0.23848f, 0.41429f}, { 0.39320f, 0.53429f}, { 0.27177f, 0.59714f}, { 0.43748f, 0.71143f}, { 0.47216f, 0.80286f},
-{ 0.36086f, 0.82000f}, { 0.45714f, 0.97936f}, { 0.59573f, 1.04286f}, { 0.50857f, 1.04395f},
+{ 0.50857,-0.39522}, { 0.59429,-0.39447}, { 0.44000,-0.30784}, { 0.51787,-0.24857}, { 0.32530,-0.09429},
+{ 0.43748,-0.05429}, { 0.26899, 0.06571}, { 0.38134, 0.20286}, { 0.23580, 0.27714}, { 0.37605, 0.38000},
+{ 0.23848, 0.41429}, { 0.39320, 0.53429}, { 0.27177, 0.59714}, { 0.43748, 0.71143}, { 0.47216, 0.80286},
+{ 0.36086, 0.82000}, { 0.45714, 0.97936}, { 0.59573, 1.04286}, { 0.50857, 1.04395},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_40 [] = {
 { 2, 3, 4}, { 0, 3, 2}, { 3, 0, 1}, { 6, 4, 5}, { 3, 5, 4}, { 6, 7, 8}, { 7, 6, 5},
@@ -208,10 +208,10 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_40 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_41 [] = {
-{ 0.24000f,-0.39447f}, { 0.33143f,-0.39258f}, { 0.40616f,-0.28857f}, { 0.31641f,-0.24857f}, { 0.48784f,-0.14000f},
-{ 0.39681f,-0.05429f}, { 0.55538f, 0.03143f}, { 0.45295f, 0.20286f}, { 0.59580f, 0.23714f}, { 0.59848f, 0.37429f},
-{ 0.45823f, 0.38000f}, { 0.44723f, 0.49429f}, { 0.56252f, 0.59714f}, { 0.41714f, 0.64134f}, { 0.47343f, 0.82000f},
-{ 0.34857f, 0.83301f}, { 0.37714f, 0.97936f}, { 0.23855f, 1.04286f}, { 0.32571f, 1.04395f},
+{ 0.24000,-0.39447}, { 0.33143,-0.39258}, { 0.40616,-0.28857}, { 0.31641,-0.24857}, { 0.48784,-0.14000},
+{ 0.39681,-0.05429}, { 0.55538, 0.03143}, { 0.45295, 0.20286}, { 0.59580, 0.23714}, { 0.59848, 0.37429},
+{ 0.45823, 0.38000}, { 0.44723, 0.49429}, { 0.56252, 0.59714}, { 0.41714, 0.64134}, { 0.47343, 0.82000},
+{ 0.34857, 0.83301}, { 0.37714, 0.97936}, { 0.23855, 1.04286}, { 0.32571, 1.04395},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_41 [] = {
 { 0, 1, 3}, { 2, 3, 1}, { 3, 4, 5}, { 3, 2, 4}, { 5, 6, 7}, { 6, 5, 4}, { 7, 8,10},
@@ -220,13 +220,13 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_41 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_42 [] = {
-{ 0.33143f, 0.58250f}, { 0.33714f, 0.58223f}, { 0.53714f, 0.58250f}, { 0.54286f, 0.58194f}, { 0.36213f, 0.61429f},
-{ 0.25587f, 0.63714f}, { 0.25266f, 0.64286f}, { 0.62655f, 0.64286f}, { 0.25393f, 0.64857f}, { 0.43429f, 0.73293f},
-{ 0.44000f, 0.73049f}, { 0.36715f, 0.78000f}, { 0.50714f, 0.78000f}, { 0.35429f, 0.78613f}, { 0.63429f, 0.80816f},
-{ 0.19309f, 0.82571f}, { 0.68389f, 0.82571f}, { 0.19177f, 0.83143f}, { 0.68530f, 0.83143f}, { 0.38857f, 0.86213f},
-{ 0.39523f, 0.86571f}, { 0.48000f, 0.86242f}, { 0.47660f, 0.86571f}, { 0.34657f, 0.88286f}, { 0.58857f, 0.90823f},
-{ 0.22286f, 0.92522f}, { 0.22857f, 0.92848f}, { 0.64571f, 0.92816f}, { 0.65143f, 0.92675f}, { 0.49295f, 1.02000f},
-{ 0.38134f, 1.03714f}, { 0.38550f, 1.04286f}, { 0.49143f, 1.04021f}, { 0.48571f, 1.04437f},
+{ 0.33143, 0.58250}, { 0.33714, 0.58223}, { 0.53714, 0.58250}, { 0.54286, 0.58194}, { 0.36213, 0.61429},
+{ 0.25587, 0.63714}, { 0.25266, 0.64286}, { 0.62655, 0.64286}, { 0.25393, 0.64857}, { 0.43429, 0.73293},
+{ 0.44000, 0.73049}, { 0.36715, 0.78000}, { 0.50714, 0.78000}, { 0.35429, 0.78613}, { 0.63429, 0.80816},
+{ 0.19309, 0.82571}, { 0.68389, 0.82571}, { 0.19177, 0.83143}, { 0.68530, 0.83143}, { 0.38857, 0.86213},
+{ 0.39523, 0.86571}, { 0.48000, 0.86242}, { 0.47660, 0.86571}, { 0.34657, 0.88286}, { 0.58857, 0.90823},
+{ 0.22286, 0.92522}, { 0.22857, 0.92848}, { 0.64571, 0.92816}, { 0.65143, 0.92675}, { 0.49295, 1.02000},
+{ 0.38134, 1.03714}, { 0.38550, 1.04286}, { 0.49143, 1.04021}, { 0.48571, 1.04437},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_42 [] = {
 { 2,12,10}, { 8, 4,11}, { 8, 5, 4}, { 8, 6, 5}, { 4, 0, 1}, { 2, 3,12}, { 0, 4, 5},
@@ -237,10 +237,10 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_42 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_43 [] = {
-{ 0.52836f, 0.10571f}, { 0.64878f, 0.10571f}, { 0.52420f, 0.11143f}, { 0.65295f, 0.11143f}, { 0.52420f, 0.39714f},
-{ 0.65295f, 0.39714f}, { 0.22857f, 0.40546f}, { 0.52000f, 0.40329f}, { 0.66286f, 0.40437f}, { 0.95168f, 0.40857f},
-{ 0.22437f, 0.52286f}, { 0.95277f, 0.52286f}, { 0.22857f, 0.52900f}, { 0.52311f, 0.53429f}, { 0.65403f, 0.53429f},
-{ 0.94857f, 0.52900f}, { 0.52528f, 0.82571f}, { 0.65186f, 0.82571f}, { 0.53143f, 0.82991f}, { 0.64571f, 0.82991f},
+{ 0.52836, 0.10571}, { 0.64878, 0.10571}, { 0.52420, 0.11143}, { 0.65295, 0.11143}, { 0.52420, 0.39714},
+{ 0.65295, 0.39714}, { 0.22857, 0.40546}, { 0.52000, 0.40329}, { 0.66286, 0.40437}, { 0.95168, 0.40857},
+{ 0.22437, 0.52286}, { 0.95277, 0.52286}, { 0.22857, 0.52900}, { 0.52311, 0.53429}, { 0.65403, 0.53429},
+{ 0.94857, 0.52900}, { 0.52528, 0.82571}, { 0.65186, 0.82571}, { 0.53143, 0.82991}, { 0.64571, 0.82991},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_43 [] = {
 { 1, 2, 0}, { 1, 3, 2}, { 4, 2, 3}, { 5, 4, 3}, {12, 6, 7}, {14, 4, 8}, { 9,15, 8},
@@ -249,11 +249,11 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_43 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_44 [] = {
-{ 0.30286f,-0.28607f}, { 0.30857f,-0.28726f}, { 0.33714f,-0.27355f}, { 0.36571f,-0.25275f}, { 0.27329f,-0.23714f},
-{ 0.38670f,-0.23143f}, { 0.30286f,-0.21582f}, { 0.39914f,-0.21429f}, { 0.32115f,-0.19714f}, { 0.41355f,-0.18571f},
-{ 0.33800f,-0.16857f}, { 0.42327f,-0.15714f}, { 0.34605f,-0.14571f}, { 0.43277f,-0.10000f}, { 0.35580f,-0.08286f},
-{ 0.35472f,-0.07714f}, { 0.28571f,-0.07295f}, { 0.34857f,-0.07295f}, { 0.28000f,-0.06878f}, { 0.27957f, 0.07714f},
-{ 0.43168f, 0.07714f}, { 0.28571f, 0.08134f}, { 0.42857f, 0.08025f},
+{ 0.30286,-0.28607}, { 0.30857,-0.28726}, { 0.33714,-0.27355}, { 0.36571,-0.25275}, { 0.27329,-0.23714},
+{ 0.38670,-0.23143}, { 0.30286,-0.21582}, { 0.39914,-0.21429}, { 0.32115,-0.19714}, { 0.41355,-0.18571},
+{ 0.33800,-0.16857}, { 0.42327,-0.15714}, { 0.34605,-0.14571}, { 0.43277,-0.10000}, { 0.35580,-0.08286},
+{ 0.35472,-0.07714}, { 0.28571,-0.07295}, { 0.34857,-0.07295}, { 0.28000,-0.06878}, { 0.27957, 0.07714},
+{ 0.43168, 0.07714}, { 0.28571, 0.08134}, { 0.42857, 0.08025},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_44 [] = {
 { 0, 6, 4}, { 0, 1, 2}, { 0, 2, 6}, { 3, 6, 2}, { 8, 5,10}, { 5, 7,10}, { 6, 5, 8},
@@ -262,17 +262,17 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_44 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_45 [] = {
-{ 0.19118f, 0.26000f}, { 0.19429f, 0.25689f}, { 0.60000f, 0.25580f}, { 0.60615f, 0.26000f}, { 0.19118f, 0.38571f},
-{ 0.60615f, 0.38571f}, { 0.19429f, 0.38882f}, { 0.60000f, 0.38991f},
+{ 0.19118, 0.26000}, { 0.19429, 0.25689}, { 0.60000, 0.25580}, { 0.60615, 0.26000}, { 0.19118, 0.38571},
+{ 0.60615, 0.38571}, { 0.19429, 0.38882}, { 0.60000, 0.38991},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_45 [] = {
 { 6, 1, 2}, { 6, 0, 1}, { 6, 2, 7}, { 6, 4, 0}, { 7, 2, 3}, { 5, 7, 3},
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_46 [] = {
-{ 0.28571f,-0.07295f}, { 0.42286f,-0.07295f}, { 0.42857f,-0.07186f}, { 0.27848f,-0.06571f}, { 0.28000f,-0.06878f},
-{ 0.43277f,-0.06571f}, { 0.27848f, 0.07143f}, { 0.43277f, 0.07143f}, { 0.27957f, 0.07714f}, { 0.43168f, 0.07714f},
-{ 0.28571f, 0.08134f}, { 0.42286f, 0.08134f}, { 0.42857f, 0.08025f},
+{ 0.28571,-0.07295}, { 0.42286,-0.07295}, { 0.42857,-0.07186}, { 0.27848,-0.06571}, { 0.28000,-0.06878},
+{ 0.43277,-0.06571}, { 0.27848, 0.07143}, { 0.43277, 0.07143}, { 0.27957, 0.07714}, { 0.43168, 0.07714},
+{ 0.28571, 0.08134}, { 0.42286, 0.08134}, { 0.42857, 0.08025},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_46 [] = {
 { 0, 3, 4}, { 3, 0, 1}, { 8, 6,10}, { 5, 1, 2}, { 3, 1, 5}, { 6, 3, 5}, { 6, 7,11},
@@ -280,24 +280,24 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_46 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_47 [] = {
-{ 0.14389f,-0.08857f}, { 0.14857f,-0.09256f}, { 0.25004f,-0.08857f}, { 0.56235f, 1.04286f}, { 0.46286f, 1.04358f},
+{ 0.14389,-0.08857}, { 0.14857,-0.09256}, { 0.25004,-0.08857}, { 0.56235, 1.04286}, { 0.46286, 1.04358},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_47 [] = {
 { 2, 0, 1}, { 4, 0, 2}, { 3, 4, 2},
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_48 [] = {
-{ 0.53714f,-0.09009f}, { 0.59429f,-0.09009f}, { 0.66857f,-0.07673f}, { 0.43429f,-0.06723f}, { 0.73143f,-0.05070f},
-{ 0.34286f,-0.00972f}, { 0.80571f, 0.01025f}, { 0.54857f, 0.02152f}, { 0.61714f, 0.02891f}, { 0.30241f, 0.03714f},
-{ 0.65714f, 0.04645f}, { 0.46857f, 0.05007f}, { 0.42473f, 0.08857f}, { 0.70286f, 0.08454f}, { 0.26645f, 0.10000f},
-{ 0.86943f, 0.11143f}, { 0.39955f, 0.12286f}, { 0.73800f, 0.13429f}, { 0.23748f, 0.18000f}, { 0.37034f, 0.19714f},
-{ 0.76252f, 0.20286f}, { 0.91236f, 0.26000f}, { 0.21866f, 0.26571f}, { 0.35621f, 0.26571f}, { 0.77823f, 0.28857f},
-{ 0.34437f, 0.40286f}, { 0.92680f, 0.40286f}, { 0.20420f, 0.40857f}, { 0.78705f, 0.54000f}, { 0.20723f, 0.58000f},
-{ 0.92420f, 0.58571f}, { 0.35277f, 0.64286f}, { 0.22177f, 0.69429f}, { 0.76571f, 0.72437f}, { 0.89966f, 0.74000f},
-{ 0.37756f, 0.76286f}, { 0.74498f, 0.79143f}, { 0.26073f, 0.82571f}, { 0.85927f, 0.84857f}, { 0.42473f, 0.85429f},
-{ 0.70439f, 0.85429f}, { 0.46286f, 0.88902f}, { 0.66286f, 0.89007f}, { 0.30241f, 0.90000f}, { 0.51009f, 0.91143f},
-{ 0.58286f, 0.91823f}, { 0.80725f, 0.92857f}, { 0.77714f, 0.95829f}, { 0.38350f, 0.98000f}, { 0.71429f, 0.99927f},
-{ 0.46286f, 1.01681f}, { 0.65714f, 1.01959f}, { 0.53714f, 1.02991f},
+{ 0.53714,-0.09009}, { 0.59429,-0.09009}, { 0.66857,-0.07673}, { 0.43429,-0.06723}, { 0.73143,-0.05070},
+{ 0.34286,-0.00972}, { 0.80571, 0.01025}, { 0.54857, 0.02152}, { 0.61714, 0.02891}, { 0.30241, 0.03714},
+{ 0.65714, 0.04645}, { 0.46857, 0.05007}, { 0.42473, 0.08857}, { 0.70286, 0.08454}, { 0.26645, 0.10000},
+{ 0.86943, 0.11143}, { 0.39955, 0.12286}, { 0.73800, 0.13429}, { 0.23748, 0.18000}, { 0.37034, 0.19714},
+{ 0.76252, 0.20286}, { 0.91236, 0.26000}, { 0.21866, 0.26571}, { 0.35621, 0.26571}, { 0.77823, 0.28857},
+{ 0.34437, 0.40286}, { 0.92680, 0.40286}, { 0.20420, 0.40857}, { 0.78705, 0.54000}, { 0.20723, 0.58000},
+{ 0.92420, 0.58571}, { 0.35277, 0.64286}, { 0.22177, 0.69429}, { 0.76571, 0.72437}, { 0.89966, 0.74000},
+{ 0.37756, 0.76286}, { 0.74498, 0.79143}, { 0.26073, 0.82571}, { 0.85927, 0.84857}, { 0.42473, 0.85429},
+{ 0.70439, 0.85429}, { 0.46286, 0.88902}, { 0.66286, 0.89007}, { 0.30241, 0.90000}, { 0.51009, 0.91143},
+{ 0.58286, 0.91823}, { 0.80725, 0.92857}, { 0.77714, 0.95829}, { 0.38350, 0.98000}, { 0.71429, 0.99927},
+{ 0.46286, 1.01681}, { 0.65714, 1.01959}, { 0.53714, 1.02991},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_48 [] = {
 { 2, 8, 1}, { 0, 7, 3}, { 5,16, 9}, { 2,10, 8}, { 0, 1, 8}, { 7, 0, 8}, {12,16, 5},
@@ -311,9 +311,9 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_48 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_49 [] = {
-{ 0.58286f,-0.07186f}, { 0.70857f,-0.07186f}, { 0.30857f, 0.62908f}, { 0.31429f, 0.62657f}, { 0.38286f, 0.65641f},
-{ 0.30785f, 0.75143f}, { 0.57714f, 0.77731f}, { 0.47429f, 0.85616f}, { 0.56384f, 0.94000f}, { 0.62857f, 1.02915f},
-{ 0.70857f, 1.02882f},
+{ 0.58286,-0.07186}, { 0.70857,-0.07186}, { 0.30857, 0.62908}, { 0.31429, 0.62657}, { 0.38286, 0.65641},
+{ 0.30785, 0.75143}, { 0.57714, 0.77731}, { 0.47429, 0.85616}, { 0.56384, 0.94000}, { 0.62857, 1.02915},
+{ 0.70857, 1.02882},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_49 [] = {
 { 6, 0, 1}, { 2, 4, 5}, { 7, 5, 4}, { 2, 3, 4}, { 6, 8, 7}, { 6, 7, 4}, {10, 8, 6},
@@ -321,15 +321,15 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_49 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_50 [] = {
-{ 0.18857f,-0.06878f}, { 0.91429f,-0.06878f}, { 0.18748f,-0.04286f}, { 0.19849f, 0.00857f}, { 0.91429f, 0.05164f},
-{ 0.38142f, 0.06000f}, { 0.22943f, 0.07714f}, { 0.46286f, 0.15868f}, { 0.30286f, 0.17832f}, { 0.38286f, 0.25813f},
-{ 0.58413f, 0.43143f}, { 0.78286f, 0.44454f}, { 0.67543f, 0.52286f}, { 0.85355f, 0.53429f}, { 0.72045f, 0.58000f},
-{ 0.89756f, 0.62571f}, { 0.75470f, 0.64286f}, { 0.35168f, 0.70000f}, { 0.91236f, 0.70000f}, { 0.77295f, 0.71143f},
-{ 0.21403f, 0.71714f}, { 0.77295f, 0.74571f}, { 0.22605f, 0.79143f}, { 0.37143f, 0.79804f}, { 0.90244f, 0.80857f},
-{ 0.75429f, 0.81228f}, { 0.38902f, 0.83143f}, { 0.24359f, 0.84286f}, { 0.73143f, 0.84689f}, { 0.42454f, 0.87143f},
-{ 0.86607f, 0.88857f}, { 0.68000f, 0.89070f}, { 0.28000f, 0.90629f}, { 0.49143f, 0.90823f}, { 0.58857f, 0.91866f},
-{ 0.82857f, 0.93555f}, { 0.31597f, 0.94571f}, { 0.37714f, 0.98784f}, { 0.76000f, 0.98657f}, { 0.44571f, 1.01470f},
-{ 0.69143f, 1.01470f}, { 0.53714f, 1.02991f}, { 0.62857f, 1.02723f},
+{ 0.18857,-0.06878}, { 0.91429,-0.06878}, { 0.18748,-0.04286}, { 0.19849, 0.00857}, { 0.91429, 0.05164},
+{ 0.38142, 0.06000}, { 0.22943, 0.07714}, { 0.46286, 0.15868}, { 0.30286, 0.17832}, { 0.38286, 0.25813},
+{ 0.58413, 0.43143}, { 0.78286, 0.44454}, { 0.67543, 0.52286}, { 0.85355, 0.53429}, { 0.72045, 0.58000},
+{ 0.89756, 0.62571}, { 0.75470, 0.64286}, { 0.35168, 0.70000}, { 0.91236, 0.70000}, { 0.77295, 0.71143},
+{ 0.21403, 0.71714}, { 0.77295, 0.74571}, { 0.22605, 0.79143}, { 0.37143, 0.79804}, { 0.90244, 0.80857},
+{ 0.75429, 0.81228}, { 0.38902, 0.83143}, { 0.24359, 0.84286}, { 0.73143, 0.84689}, { 0.42454, 0.87143},
+{ 0.86607, 0.88857}, { 0.68000, 0.89070}, { 0.28000, 0.90629}, { 0.49143, 0.90823}, { 0.58857, 0.91866},
+{ 0.82857, 0.93555}, { 0.31597, 0.94571}, { 0.37714, 0.98784}, { 0.76000, 0.98657}, { 0.44571, 1.01470},
+{ 0.69143, 1.01470}, { 0.53714, 1.02991}, { 0.62857, 1.02723},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_50 [] = {
 { 3, 2, 0}, { 3, 5, 6}, { 1, 5, 0}, { 5, 3, 0}, { 1, 4, 5}, { 6, 5, 8}, { 7, 8, 5},
@@ -341,20 +341,20 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_50 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_51 [] = {
-{ 0.52571f,-0.09009f}, { 0.63429f,-0.08395f}, { 0.45143f,-0.07756f}, { 0.37143f,-0.04498f}, { 0.74286f,-0.04771f},
-{ 0.30857f, 0.00132f}, { 0.81714f, 0.00439f}, { 0.54286f, 0.02152f}, { 0.60000f, 0.02420f}, { 0.64661f, 0.03714f},
-{ 0.27429f, 0.03952f}, { 0.46857f, 0.04073f}, { 0.42857f, 0.06759f}, { 0.70857f, 0.07561f}, { 0.88213f, 0.08286f},
-{ 0.23429f, 0.10772f}, { 0.38812f, 0.11714f}, { 0.74535f, 0.11714f}, { 0.91109f, 0.14571f}, { 0.77823f, 0.19143f},
-{ 0.20764f, 0.20857f}, { 0.92723f, 0.22571f}, { 0.34286f, 0.23215f}, { 0.78437f, 0.27143f}, { 0.92723f, 0.27714f},
-{ 0.75429f, 0.36430f}, { 0.89927f, 0.38571f}, { 0.72571f, 0.40132f}, { 0.86857f, 0.43270f}, { 0.67429f, 0.43927f},
-{ 0.48000f, 0.45284f}, { 0.48571f, 0.44966f}, { 0.54857f, 0.46152f}, { 0.60000f, 0.46109f}, { 0.83429f, 0.46686f},
-{ 0.72693f, 0.52286f}, { 0.49034f, 0.55714f}, { 0.49714f, 0.56395f}, { 0.78857f, 0.56473f}, { 0.58286f, 0.57109f},
-{ 0.82857f, 0.60921f}, { 0.67429f, 0.61616f}, { 0.70400f, 0.64857f}, { 0.85294f, 0.65429f}, { 0.72680f, 0.70571f},
-{ 0.87009f, 0.72286f}, { 0.35429f, 0.72298f}, { 0.22175f, 0.74571f}, { 0.72991f, 0.76286f}, { 0.72151f, 0.80286f},
-{ 0.86244f, 0.80857f}, { 0.38857f, 0.82064f}, { 0.69143f, 0.85832f}, { 0.84571f, 0.85587f}, { 0.26241f, 0.87143f},
-{ 0.43429f, 0.87829f}, { 0.64571f, 0.89641f}, { 0.48571f, 0.90723f}, { 0.29330f, 0.91714f}, { 0.60571f, 0.91252f},
-{ 0.53143f, 0.91823f}, { 0.80384f, 0.92286f}, { 0.36000f, 0.97750f}, { 0.73143f, 0.98213f}, { 0.44571f, 1.01681f},
-{ 0.65714f, 1.01470f}, { 0.52000f, 1.02991f}, { 0.60000f, 1.02723f},
+{ 0.52571,-0.09009}, { 0.63429,-0.08395}, { 0.45143,-0.07756}, { 0.37143,-0.04498}, { 0.74286,-0.04771},
+{ 0.30857, 0.00132}, { 0.81714, 0.00439}, { 0.54286, 0.02152}, { 0.60000, 0.02420}, { 0.64661, 0.03714},
+{ 0.27429, 0.03952}, { 0.46857, 0.04073}, { 0.42857, 0.06759}, { 0.70857, 0.07561}, { 0.88213, 0.08286},
+{ 0.23429, 0.10772}, { 0.38812, 0.11714}, { 0.74535, 0.11714}, { 0.91109, 0.14571}, { 0.77823, 0.19143},
+{ 0.20764, 0.20857}, { 0.92723, 0.22571}, { 0.34286, 0.23215}, { 0.78437, 0.27143}, { 0.92723, 0.27714},
+{ 0.75429, 0.36430}, { 0.89927, 0.38571}, { 0.72571, 0.40132}, { 0.86857, 0.43270}, { 0.67429, 0.43927},
+{ 0.48000, 0.45284}, { 0.48571, 0.44966}, { 0.54857, 0.46152}, { 0.60000, 0.46109}, { 0.83429, 0.46686},
+{ 0.72693, 0.52286}, { 0.49034, 0.55714}, { 0.49714, 0.56395}, { 0.78857, 0.56473}, { 0.58286, 0.57109},
+{ 0.82857, 0.60921}, { 0.67429, 0.61616}, { 0.70400, 0.64857}, { 0.85294, 0.65429}, { 0.72680, 0.70571},
+{ 0.87009, 0.72286}, { 0.35429, 0.72298}, { 0.22175, 0.74571}, { 0.72991, 0.76286}, { 0.72151, 0.80286},
+{ 0.86244, 0.80857}, { 0.38857, 0.82064}, { 0.69143, 0.85832}, { 0.84571, 0.85587}, { 0.26241, 0.87143},
+{ 0.43429, 0.87829}, { 0.64571, 0.89641}, { 0.48571, 0.90723}, { 0.29330, 0.91714}, { 0.60571, 0.91252},
+{ 0.53143, 0.91823}, { 0.80384, 0.92286}, { 0.36000, 0.97750}, { 0.73143, 0.98213}, { 0.44571, 1.01681},
+{ 0.65714, 1.01470}, { 0.52000, 1.02991}, { 0.60000, 1.02723},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_51 [] = {
 { 3,11, 5}, { 9, 8, 1}, { 1, 8, 0}, { 4, 9, 1}, { 9, 4,13}, { 7, 0, 8}, { 6,13, 4},
@@ -370,10 +370,10 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_51 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_52 [] = {
-{ 0.64571f,-0.07295f}, { 0.64000f,-0.06878f}, { 0.77143f,-0.06878f}, { 0.77403f, 0.18571f}, { 0.16265f, 0.19143f},
-{ 0.63429f, 0.18882f}, { 0.92000f, 0.19408f}, { 0.15891f, 0.31143f}, { 0.91735f, 0.31143f}, { 0.29653f, 0.31714f},
-{ 0.63740f, 0.31714f}, { 0.77714f, 0.31403f}, { 0.16571f, 0.32228f}, { 0.16616f, 0.32286f}, { 0.63429f, 0.79380f},
-{ 0.77186f, 1.02000f}, { 0.66857f, 1.02282f}, { 0.76571f, 1.02420f},
+{ 0.64571,-0.07295}, { 0.64000,-0.06878}, { 0.77143,-0.06878}, { 0.77403, 0.18571}, { 0.16265, 0.19143},
+{ 0.63429, 0.18882}, { 0.92000, 0.19408}, { 0.15891, 0.31143}, { 0.91735, 0.31143}, { 0.29653, 0.31714},
+{ 0.63740, 0.31714}, { 0.77714, 0.31403}, { 0.16571, 0.32228}, { 0.16616, 0.32286}, { 0.63429, 0.79380},
+{ 0.77186, 1.02000}, { 0.66857, 1.02282}, { 0.76571, 1.02420},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_52 [] = {
 { 2, 1, 0}, { 1, 3, 5}, { 1, 2, 3}, { 3,10, 5}, { 9, 4, 5}, { 4, 9, 7}, { 6,11, 3},
@@ -382,17 +382,17 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_52 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_53 [] = {
-{ 0.52571f,-0.09009f}, { 0.61714f,-0.08665f}, { 0.44571f,-0.07673f}, { 0.73143f,-0.05179f}, { 0.35429f,-0.03759f},
-{ 0.78914f,-0.01429f}, { 0.30286f, 0.00241f}, { 0.53714f, 0.02152f}, { 0.62857f, 0.03184f}, { 0.84115f, 0.03714f},
-{ 0.46857f, 0.03927f}, { 0.66286f, 0.04645f}, { 0.26286f, 0.04921f}, { 0.42286f, 0.06759f}, { 0.71429f, 0.08439f},
-{ 0.88045f, 0.09429f}, { 0.23343f, 0.10000f}, { 0.38812f, 0.10571f}, { 0.74535f, 0.12286f}, { 0.35748f, 0.16857f},
-{ 0.77294f, 0.18000f}, { 0.91681f, 0.18000f}, { 0.20420f, 0.20857f}, { 0.34286f, 0.22376f}, { 0.78705f, 0.23714f},
-{ 0.93295f, 0.27143f}, { 0.79009f, 0.31714f}, { 0.93252f, 0.33429f}, { 0.77714f, 0.38420f}, { 0.91681f, 0.42000f},
-{ 0.34857f, 0.43034f}, { 0.75641f, 0.43143f}, { 0.23088f, 0.44857f}, { 0.72000f, 0.47868f}, { 0.40000f, 0.48400f},
-{ 0.68000f, 0.50784f}, { 0.86902f, 0.51714f}, { 0.46857f, 0.52437f}, { 0.53143f, 0.53848f}, { 0.57714f, 0.53848f},
-{ 0.58857f, 0.53621f}, { 0.60000f, 0.53580f}, { 0.82286f, 0.56972f}, { 0.38494f, 0.59714f}, { 0.77714f, 0.60535f},
-{ 0.48571f, 0.64244f}, { 0.69714f, 0.64327f}, { 0.56571f, 0.65848f}, { 0.61714f, 0.65848f}, { 0.43891f, 0.87714f},
-{ 0.44571f, 0.88395f}, { 0.88043f, 0.88857f}, { 0.88043f, 1.00857f}, { 0.33714f, 1.01182f},
+{ 0.52571,-0.09009}, { 0.61714,-0.08665}, { 0.44571,-0.07673}, { 0.73143,-0.05179}, { 0.35429,-0.03759},
+{ 0.78914,-0.01429}, { 0.30286, 0.00241}, { 0.53714, 0.02152}, { 0.62857, 0.03184}, { 0.84115, 0.03714},
+{ 0.46857, 0.03927}, { 0.66286, 0.04645}, { 0.26286, 0.04921}, { 0.42286, 0.06759}, { 0.71429, 0.08439},
+{ 0.88045, 0.09429}, { 0.23343, 0.10000}, { 0.38812, 0.10571}, { 0.74535, 0.12286}, { 0.35748, 0.16857},
+{ 0.77294, 0.18000}, { 0.91681, 0.18000}, { 0.20420, 0.20857}, { 0.34286, 0.22376}, { 0.78705, 0.23714},
+{ 0.93295, 0.27143}, { 0.79009, 0.31714}, { 0.93252, 0.33429}, { 0.77714, 0.38420}, { 0.91681, 0.42000},
+{ 0.34857, 0.43034}, { 0.75641, 0.43143}, { 0.23088, 0.44857}, { 0.72000, 0.47868}, { 0.40000, 0.48400},
+{ 0.68000, 0.50784}, { 0.86902, 0.51714}, { 0.46857, 0.52437}, { 0.53143, 0.53848}, { 0.57714, 0.53848},
+{ 0.58857, 0.53621}, { 0.60000, 0.53580}, { 0.82286, 0.56972}, { 0.38494, 0.59714}, { 0.77714, 0.60535},
+{ 0.48571, 0.64244}, { 0.69714, 0.64327}, { 0.56571, 0.65848}, { 0.61714, 0.65848}, { 0.43891, 0.87714},
+{ 0.44571, 0.88395}, { 0.88043, 0.88857}, { 0.88043, 1.00857}, { 0.33714, 1.01182},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_53 [] = {
 { 7, 1, 8}, { 7, 0, 1}, { 7, 2, 0}, { 2,10, 4}, { 6,13,12}, { 3, 8, 1}, { 3,11, 8},
@@ -406,20 +406,20 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_53 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_54 [] = {
-{ 0.55429f,-0.09009f}, { 0.66857f,-0.08034f}, { 0.43429f,-0.06213f}, { 0.75429f,-0.04607f}, { 0.34857f,-0.00972f},
-{ 0.81143f,-0.00439f}, { 0.59429f, 0.02152f}, { 0.51339f, 0.03143f}, { 0.85188f, 0.04286f}, { 0.67429f, 0.04645f},
-{ 0.46286f, 0.05579f}, { 0.27384f, 0.07714f}, { 0.41714f, 0.09597f}, { 0.73143f, 0.09597f}, { 0.89355f, 0.11714f},
-{ 0.38771f, 0.14000f}, { 0.91177f, 0.16857f}, { 0.77294f, 0.17429f}, { 0.22816f, 0.18571f}, { 0.36530f, 0.19714f},
-{ 0.78705f, 0.24857f}, { 0.92680f, 0.25429f}, { 0.35320f, 0.26000f}, { 0.78665f, 0.30571f}, { 0.20420f, 0.31143f},
-{ 0.35320f, 0.31143f}, { 0.92723f, 0.31714f}, { 0.36657f, 0.37429f}, { 0.77395f, 0.37429f}, { 0.75429f, 0.41841f},
-{ 0.39179f, 0.42571f}, { 0.89756f, 0.44286f}, { 0.72000f, 0.46418f}, { 0.43429f, 0.47258f}, { 0.19891f, 0.50571f},
-{ 0.33714f, 0.50495f}, { 0.48000f, 0.50213f}, { 0.66857f, 0.50086f}, { 0.86241f, 0.50571f}, { 0.55429f, 0.52134f},
-{ 0.61143f, 0.51866f}, { 0.80403f, 0.56857f}, { 0.42286f, 0.58821f}, { 0.74286f, 0.60943f}, { 0.34134f, 0.63143f},
-{ 0.50857f, 0.62823f}, { 0.68000f, 0.63252f}, { 0.57714f, 0.64134f}, { 0.21563f, 0.66000f}, { 0.77714f, 0.74697f},
-{ 0.37502f, 0.75714f}, { 0.90966f, 0.76286f}, { 0.25673f, 0.80286f}, { 0.41901f, 0.83143f}, { 0.73143f, 0.85191f},
-{ 0.45143f, 0.86686f}, { 0.87343f, 0.87714f}, { 0.30036f, 0.88286f}, { 0.68000f, 0.89514f}, { 0.50286f, 0.90086f},
-{ 0.51429f, 0.90530f}, { 0.52000f, 0.90784f}, { 0.60571f, 0.91866f}, { 0.83846f, 0.92857f}, { 0.35429f, 0.94384f},
-{ 0.40571f, 0.98150f}, { 0.76000f, 0.99229f}, { 0.49143f, 1.01748f}, { 0.68571f, 1.02041f}, { 0.56571f, 1.02991f},
+{ 0.55429,-0.09009}, { 0.66857,-0.08034}, { 0.43429,-0.06213}, { 0.75429,-0.04607}, { 0.34857,-0.00972},
+{ 0.81143,-0.00439}, { 0.59429, 0.02152}, { 0.51339, 0.03143}, { 0.85188, 0.04286}, { 0.67429, 0.04645},
+{ 0.46286, 0.05579}, { 0.27384, 0.07714}, { 0.41714, 0.09597}, { 0.73143, 0.09597}, { 0.89355, 0.11714},
+{ 0.38771, 0.14000}, { 0.91177, 0.16857}, { 0.77294, 0.17429}, { 0.22816, 0.18571}, { 0.36530, 0.19714},
+{ 0.78705, 0.24857}, { 0.92680, 0.25429}, { 0.35320, 0.26000}, { 0.78665, 0.30571}, { 0.20420, 0.31143},
+{ 0.35320, 0.31143}, { 0.92723, 0.31714}, { 0.36657, 0.37429}, { 0.77395, 0.37429}, { 0.75429, 0.41841},
+{ 0.39179, 0.42571}, { 0.89756, 0.44286}, { 0.72000, 0.46418}, { 0.43429, 0.47258}, { 0.19891, 0.50571},
+{ 0.33714, 0.50495}, { 0.48000, 0.50213}, { 0.66857, 0.50086}, { 0.86241, 0.50571}, { 0.55429, 0.52134},
+{ 0.61143, 0.51866}, { 0.80403, 0.56857}, { 0.42286, 0.58821}, { 0.74286, 0.60943}, { 0.34134, 0.63143},
+{ 0.50857, 0.62823}, { 0.68000, 0.63252}, { 0.57714, 0.64134}, { 0.21563, 0.66000}, { 0.77714, 0.74697},
+{ 0.37502, 0.75714}, { 0.90966, 0.76286}, { 0.25673, 0.80286}, { 0.41901, 0.83143}, { 0.73143, 0.85191},
+{ 0.45143, 0.86686}, { 0.87343, 0.87714}, { 0.30036, 0.88286}, { 0.68000, 0.89514}, { 0.50286, 0.90086},
+{ 0.51429, 0.90530}, { 0.52000, 0.90784}, { 0.60571, 0.91866}, { 0.83846, 0.92857}, { 0.35429, 0.94384},
+{ 0.40571, 0.98150}, { 0.76000, 0.99229}, { 0.49143, 1.01748}, { 0.68571, 1.02041}, { 0.56571, 1.02991},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_54 [] = {
 { 2,10, 4}, { 6, 1, 9}, { 3, 5,13}, { 0, 7, 2}, { 3, 9, 1}, { 1, 6, 0}, { 9, 3,13},
@@ -435,10 +435,10 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_54 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_55 [] = {
-{ 0.37143f,-0.07186f}, { 0.50286f,-0.07186f}, { 0.36723f,-0.06571f}, { 0.37335f, 0.02000f}, { 0.52991f, 0.11143f},
-{ 0.40379f, 0.18571f}, { 0.59787f, 0.35143f}, { 0.47387f, 0.41429f}, { 0.66857f, 0.51873f}, { 0.53355f, 0.55143f},
-{ 0.63384f, 0.72857f}, { 0.80893f, 0.76286f}, { 0.74359f, 0.88286f}, { 0.21714f, 0.88546f}, { 0.92379f, 0.91143f},
-{ 0.21403f, 1.00857f}, { 0.92311f, 1.00857f},
+{ 0.37143,-0.07186}, { 0.50286,-0.07186}, { 0.36723,-0.06571}, { 0.37335, 0.02000}, { 0.52991, 0.11143},
+{ 0.40379, 0.18571}, { 0.59787, 0.35143}, { 0.47387, 0.41429}, { 0.66857, 0.51873}, { 0.53355, 0.55143},
+{ 0.63384, 0.72857}, { 0.80893, 0.76286}, { 0.74359, 0.88286}, { 0.21714, 0.88546}, { 0.92379, 0.91143},
+{ 0.21403, 1.00857}, { 0.92311, 1.00857},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_55 [] = {
 { 3, 0, 1}, { 2, 0, 3}, { 3, 4, 5}, { 4, 3, 1}, { 6, 7, 5}, { 6, 5, 4}, { 9, 7, 6},
@@ -447,23 +447,23 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_55 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_56 [] = {
-{ 0.53143f,-0.08966f}, { 0.62857f,-0.08665f}, { 0.45143f,-0.07605f}, { 0.73714f,-0.05641f}, { 0.38857f,-0.05343f},
-{ 0.34286f,-0.02616f}, { 0.79429f,-0.02250f}, { 0.28571f, 0.02445f}, { 0.58857f, 0.02152f}, { 0.50857f, 0.02823f},
-{ 0.85258f, 0.03143f}, { 0.66937f, 0.04286f}, { 0.45143f, 0.05070f}, { 0.71429f, 0.07296f}, { 0.41143f, 0.07868f},
-{ 0.24000f, 0.09016f}, { 0.89927f, 0.10571f}, { 0.37669f, 0.12286f}, { 0.76613f, 0.14000f}, { 0.21462f, 0.15714f},
-{ 0.35849f, 0.16286f}, { 0.92109f, 0.17429f}, { 0.78705f, 0.22000f}, { 0.34437f, 0.22571f}, { 0.20420f, 0.27143f},
-{ 0.92680f, 0.27143f}, { 0.78437f, 0.28286f}, { 0.34748f, 0.28857f}, { 0.77143f, 0.32947f}, { 0.91470f, 0.33429f},
-{ 0.21714f, 0.34118f}, { 0.37502f, 0.36286f}, { 0.73296f, 0.39143f}, { 0.89057f, 0.39143f}, { 0.24359f, 0.40286f},
-{ 0.41883f, 0.41429f}, { 0.69143f, 0.42722f}, { 0.27275f, 0.44286f}, { 0.85714f, 0.43841f}, { 0.46286f, 0.44371f},
-{ 0.50286f, 0.45748f}, { 0.63429f, 0.45470f}, { 0.58286f, 0.46420f}, { 0.80507f, 0.48286f}, { 0.33143f, 0.49007f},
-{ 0.40456f, 0.52286f}, { 0.72693f, 0.52286f}, { 0.32000f, 0.57616f}, { 0.54857f, 0.57580f}, { 0.62286f, 0.58319f},
-{ 0.82082f, 0.58571f}, { 0.49714f, 0.58657f}, { 0.66286f, 0.60073f}, { 0.28527f, 0.61429f}, { 0.44571f, 0.61582f},
-{ 0.70439f, 0.63714f}, { 0.85759f, 0.63714f}, { 0.25756f, 0.67143f}, { 0.72657f, 0.67143f}, { 0.39849f, 0.68286f},
-{ 0.87470f, 0.68286f}, { 0.74134f, 0.72857f}, { 0.38705f, 0.73429f}, { 0.88109f, 0.76857f}, { 0.24764f, 0.77429f},
-{ 0.73395f, 0.79714f}, { 0.39470f, 0.80286f}, { 0.87177f, 0.82000f}, { 0.71641f, 0.83714f}, { 0.27216f, 0.86571f},
-{ 0.44000f, 0.87296f}, { 0.84486f, 0.88286f}, { 0.66286f, 0.89179f}, { 0.48000f, 0.90086f}, { 0.61714f, 0.91184f},
-{ 0.54286f, 0.91823f}, { 0.31846f, 0.93429f}, { 0.80571f, 0.93555f}, { 0.38286f, 0.98616f}, { 0.72000f, 0.99800f},
-{ 0.43429f, 1.01008f}, { 0.53143f, 1.02991f}, { 0.61714f, 1.02723f},
+{ 0.53143,-0.08966}, { 0.62857,-0.08665}, { 0.45143,-0.07605}, { 0.73714,-0.05641}, { 0.38857,-0.05343},
+{ 0.34286,-0.02616}, { 0.79429,-0.02250}, { 0.28571, 0.02445}, { 0.58857, 0.02152}, { 0.50857, 0.02823},
+{ 0.85258, 0.03143}, { 0.66937, 0.04286}, { 0.45143, 0.05070}, { 0.71429, 0.07296}, { 0.41143, 0.07868},
+{ 0.24000, 0.09016}, { 0.89927, 0.10571}, { 0.37669, 0.12286}, { 0.76613, 0.14000}, { 0.21462, 0.15714},
+{ 0.35849, 0.16286}, { 0.92109, 0.17429}, { 0.78705, 0.22000}, { 0.34437, 0.22571}, { 0.20420, 0.27143},
+{ 0.92680, 0.27143}, { 0.78437, 0.28286}, { 0.34748, 0.28857}, { 0.77143, 0.32947}, { 0.91470, 0.33429},
+{ 0.21714, 0.34118}, { 0.37502, 0.36286}, { 0.73296, 0.39143}, { 0.89057, 0.39143}, { 0.24359, 0.40286},
+{ 0.41883, 0.41429}, { 0.69143, 0.42722}, { 0.27275, 0.44286}, { 0.85714, 0.43841}, { 0.46286, 0.44371},
+{ 0.50286, 0.45748}, { 0.63429, 0.45470}, { 0.58286, 0.46420}, { 0.80507, 0.48286}, { 0.33143, 0.49007},
+{ 0.40456, 0.52286}, { 0.72693, 0.52286}, { 0.32000, 0.57616}, { 0.54857, 0.57580}, { 0.62286, 0.58319},
+{ 0.82082, 0.58571}, { 0.49714, 0.58657}, { 0.66286, 0.60073}, { 0.28527, 0.61429}, { 0.44571, 0.61582},
+{ 0.70439, 0.63714}, { 0.85759, 0.63714}, { 0.25756, 0.67143}, { 0.72657, 0.67143}, { 0.39849, 0.68286},
+{ 0.87470, 0.68286}, { 0.74134, 0.72857}, { 0.38705, 0.73429}, { 0.88109, 0.76857}, { 0.24764, 0.77429},
+{ 0.73395, 0.79714}, { 0.39470, 0.80286}, { 0.87177, 0.82000}, { 0.71641, 0.83714}, { 0.27216, 0.86571},
+{ 0.44000, 0.87296}, { 0.84486, 0.88286}, { 0.66286, 0.89179}, { 0.48000, 0.90086}, { 0.61714, 0.91184},
+{ 0.54286, 0.91823}, { 0.31846, 0.93429}, { 0.80571, 0.93555}, { 0.38286, 0.98616}, { 0.72000, 0.99800},
+{ 0.43429, 1.01008}, { 0.53143, 1.02991}, { 0.61714, 1.02723},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_56 [] = {
 { 0, 9, 2}, {12, 4, 2}, { 1, 8, 0}, { 6,11, 3}, { 5,14, 7}, { 9, 0, 8}, { 8, 1,11},
@@ -482,21 +482,21 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_56 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_57 [] = {
-{ 0.50286f,-0.09009f}, { 0.56000f,-0.09009f}, { 0.42857f,-0.07673f}, { 0.64571f,-0.07395f}, { 0.36000f,-0.04771f},
-{ 0.74286f,-0.02616f}, { 0.28759f, 0.01429f}, { 0.51429f, 0.02152f}, { 0.57143f, 0.02420f}, { 0.80115f, 0.02571f},
-{ 0.47429f, 0.02891f}, { 0.42857f, 0.05007f}, { 0.64000f, 0.04943f}, { 0.24930f, 0.07714f}, { 0.39314f, 0.08286f},
-{ 0.85229f, 0.10000f}, { 0.70902f, 0.11143f}, { 0.37057f, 0.12286f}, { 0.22177f, 0.17429f}, { 0.34857f, 0.18947f},
-{ 0.75109f, 0.19714f}, { 0.89395f, 0.20286f}, { 0.75429f, 0.20739f}, { 0.75681f, 0.21429f}, { 0.90966f, 0.27143f},
-{ 0.50286f, 0.30152f}, { 0.42857f, 0.31605f}, { 0.61714f, 0.31462f}, { 0.37714f, 0.33787f}, { 0.70286f, 0.35759f},
-{ 0.78705f, 0.37429f}, { 0.32000f, 0.37846f}, { 0.58286f, 0.42152f}, { 0.50286f, 0.42891f}, { 0.63429f, 0.43184f},
-{ 0.78286f, 0.43630f}, { 0.92723f, 0.43714f}, { 0.26286f, 0.44350f}, { 0.45143f, 0.45107f}, { 0.68571f, 0.45750f},
-{ 0.41587f, 0.47714f}, { 0.23787f, 0.48857f}, { 0.74498f, 0.52286f}, { 0.36359f, 0.55143f}, { 0.21522f, 0.55714f},
-{ 0.92680f, 0.56286f}, { 0.76571f, 0.57009f}, { 0.34437f, 0.63143f}, { 0.77823f, 0.63714f}, { 0.20462f, 0.69429f},
-{ 0.77866f, 0.69429f}, { 0.91236f, 0.70000f}, { 0.35429f, 0.74118f}, { 0.76571f, 0.76404f}, { 0.21756f, 0.77429f},
-{ 0.38286f, 0.80921f}, { 0.87343f, 0.82571f}, { 0.40759f, 0.84286f}, { 0.72571f, 0.84118f}, { 0.24527f, 0.84857f},
-{ 0.69143f, 0.87527f}, { 0.84000f, 0.88221f}, { 0.47429f, 0.89641f}, { 0.28571f, 0.90975f}, { 0.63429f, 0.90784f},
-{ 0.54857f, 0.91866f}, { 0.33143f, 0.95527f}, { 0.76000f, 0.96331f}, { 0.39629f, 0.99714f}, { 0.68571f, 1.00437f},
-{ 0.49714f, 1.02723f}, { 0.57714f, 1.02991f},
+{ 0.50286,-0.09009}, { 0.56000,-0.09009}, { 0.42857,-0.07673}, { 0.64571,-0.07395}, { 0.36000,-0.04771},
+{ 0.74286,-0.02616}, { 0.28759, 0.01429}, { 0.51429, 0.02152}, { 0.57143, 0.02420}, { 0.80115, 0.02571},
+{ 0.47429, 0.02891}, { 0.42857, 0.05007}, { 0.64000, 0.04943}, { 0.24930, 0.07714}, { 0.39314, 0.08286},
+{ 0.85229, 0.10000}, { 0.70902, 0.11143}, { 0.37057, 0.12286}, { 0.22177, 0.17429}, { 0.34857, 0.18947},
+{ 0.75109, 0.19714}, { 0.89395, 0.20286}, { 0.75429, 0.20739}, { 0.75681, 0.21429}, { 0.90966, 0.27143},
+{ 0.50286, 0.30152}, { 0.42857, 0.31605}, { 0.61714, 0.31462}, { 0.37714, 0.33787}, { 0.70286, 0.35759},
+{ 0.78705, 0.37429}, { 0.32000, 0.37846}, { 0.58286, 0.42152}, { 0.50286, 0.42891}, { 0.63429, 0.43184},
+{ 0.78286, 0.43630}, { 0.92723, 0.43714}, { 0.26286, 0.44350}, { 0.45143, 0.45107}, { 0.68571, 0.45750},
+{ 0.41587, 0.47714}, { 0.23787, 0.48857}, { 0.74498, 0.52286}, { 0.36359, 0.55143}, { 0.21522, 0.55714},
+{ 0.92680, 0.56286}, { 0.76571, 0.57009}, { 0.34437, 0.63143}, { 0.77823, 0.63714}, { 0.20462, 0.69429},
+{ 0.77866, 0.69429}, { 0.91236, 0.70000}, { 0.35429, 0.74118}, { 0.76571, 0.76404}, { 0.21756, 0.77429},
+{ 0.38286, 0.80921}, { 0.87343, 0.82571}, { 0.40759, 0.84286}, { 0.72571, 0.84118}, { 0.24527, 0.84857},
+{ 0.69143, 0.87527}, { 0.84000, 0.88221}, { 0.47429, 0.89641}, { 0.28571, 0.90975}, { 0.63429, 0.90784},
+{ 0.54857, 0.91866}, { 0.33143, 0.95527}, { 0.76000, 0.96331}, { 0.39629, 0.99714}, { 0.68571, 1.00437},
+{ 0.49714, 1.02723}, { 0.57714, 1.02991},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_57 [] = {
 { 3, 8, 1}, { 2,11, 4}, { 0, 7, 2}, { 8, 3,12}, { 4,14, 6}, { 0, 1, 8}, { 6,17,13},
@@ -513,9 +513,9 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_57 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_58 [] = {
-{ 0.28571f,-0.07295f}, { 0.42857f,-0.07186f}, { 0.28000f,-0.06878f}, { 0.43277f,-0.06571f}, { 0.27957f, 0.07714f},
-{ 0.28571f, 0.08134f}, { 0.42857f, 0.08025f}, { 0.27957f, 0.57429f}, { 0.28571f, 0.57009f}, { 0.43168f, 0.57429f},
-{ 0.27848f, 0.71714f}, { 0.43277f, 0.71714f}, { 0.28265f, 0.72286f}, { 0.42857f, 0.72329f},
+{ 0.28571,-0.07295}, { 0.42857,-0.07186}, { 0.28000,-0.06878}, { 0.43277,-0.06571}, { 0.27957, 0.07714},
+{ 0.28571, 0.08134}, { 0.42857, 0.08025}, { 0.27957, 0.57429}, { 0.28571, 0.57009}, { 0.43168, 0.57429},
+{ 0.27848, 0.71714}, { 0.43277, 0.71714}, { 0.28265, 0.72286}, { 0.42857, 0.72329},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_58 [] = {
 { 2, 5, 4}, { 2, 0, 5}, { 0, 3, 5}, { 6, 5, 3}, { 0, 1, 3}, { 7, 8,10}, {10,11,13},
@@ -523,10 +523,10 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_58 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_59 [] = {
-{ 0.30857f,-0.28726f}, { 0.36571f,-0.25275f}, { 0.27323f,-0.23714f}, { 0.39543f,-0.22000f}, { 0.32384f,-0.19143f},
-{ 0.33756f,-0.16857f}, { 0.42327f,-0.15714f}, { 0.43277f,-0.10000f}, { 0.35472f,-0.07714f}, { 0.28571f,-0.07295f},
-{ 0.34857f,-0.07295f}, { 0.28000f,-0.06878f}, { 0.27957f, 0.07714f}, { 0.43168f, 0.07714f}, { 0.27957f, 0.57429f},
-{ 0.43168f, 0.57429f}, { 0.28265f, 0.72286f}, { 0.42857f, 0.72329f},
+{ 0.30857,-0.28726}, { 0.36571,-0.25275}, { 0.27323,-0.23714}, { 0.39543,-0.22000}, { 0.32384,-0.19143},
+{ 0.33756,-0.16857}, { 0.42327,-0.15714}, { 0.43277,-0.10000}, { 0.35472,-0.07714}, { 0.28571,-0.07295},
+{ 0.34857,-0.07295}, { 0.28000,-0.06878}, { 0.27957, 0.07714}, { 0.43168, 0.07714}, { 0.27957, 0.57429},
+{ 0.43168, 0.57429}, { 0.28265, 0.72286}, { 0.42857, 0.72329},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_59 [] = {
 { 2, 1, 4}, { 5, 4, 3}, { 0, 1, 2}, { 5, 6, 8}, { 3, 4, 1}, { 6, 5, 3}, { 6, 7, 8},
@@ -534,9 +534,9 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_59 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_60 [] = {
-{ 0.94857f, 0.09939f}, { 0.95269f, 0.10571f}, { 0.95236f, 0.22571f}, { 0.22894f, 0.40857f}, { 0.38919f, 0.46571f},
-{ 0.38919f, 0.47143f}, { 0.22748f, 0.52857f}, { 0.23192f, 0.53429f}, { 0.95098f, 0.70571f}, { 0.95216f, 0.83143f},
-{ 0.94857f, 0.83523f},
+{ 0.94857, 0.09939}, { 0.95269, 0.10571}, { 0.95236, 0.22571}, { 0.22894, 0.40857}, { 0.38919, 0.46571},
+{ 0.38919, 0.47143}, { 0.22748, 0.52857}, { 0.23192, 0.53429}, { 0.95098, 0.70571}, { 0.95216, 0.83143},
+{ 0.94857, 0.83523},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_60 [] = {
 { 4, 0, 2}, { 5, 7, 6}, { 4, 3, 0}, { 0, 1, 2}, { 7, 8,10}, { 4, 5, 3}, { 5, 6, 3},
@@ -544,9 +544,9 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_60 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_61 [] = {
-{ 0.22857f, 0.23975f}, { 0.94857f, 0.23975f}, { 0.22437f, 0.35714f}, { 0.95277f, 0.35714f}, { 0.22857f, 0.36329f},
-{ 0.94857f, 0.36329f}, { 0.22857f, 0.57385f}, { 0.94857f, 0.57385f}, { 0.22437f, 0.58000f}, { 0.95277f, 0.58000f},
-{ 0.22857f, 0.69740f}, { 0.94857f, 0.69740f},
+{ 0.22857, 0.23975}, { 0.94857, 0.23975}, { 0.22437, 0.35714}, { 0.95277, 0.35714}, { 0.22857, 0.36329},
+{ 0.94857, 0.36329}, { 0.22857, 0.57385}, { 0.94857, 0.57385}, { 0.22437, 0.58000}, { 0.95277, 0.58000},
+{ 0.22857, 0.69740}, { 0.94857, 0.69740},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_61 [] = {
 { 0, 4, 2}, { 0, 1, 5}, { 4, 0, 5}, { 3, 5, 1}, {11, 7, 9}, {10, 6, 7}, {10, 7,11},
@@ -554,9 +554,9 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_61 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_62 [] = {
-{ 0.23429f, 0.09914f}, { 0.22857f, 0.10169f}, { 0.22748f, 0.22571f}, { 0.23192f, 0.23143f}, { 0.95116f, 0.40857f},
-{ 0.79073f, 0.46571f}, { 0.79073f, 0.47143f}, { 0.95236f, 0.52857f}, { 0.22897f, 0.70571f}, { 0.22857f, 0.83287f},
-{ 0.23429f, 0.83563f},
+{ 0.23429, 0.09914}, { 0.22857, 0.10169}, { 0.22748, 0.22571}, { 0.23192, 0.23143}, { 0.95116, 0.40857},
+{ 0.79073, 0.46571}, { 0.79073, 0.47143}, { 0.95236, 0.52857}, { 0.22897, 0.70571}, { 0.22857, 0.83287},
+{ 0.23429, 0.83563},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_62 [] = {
 { 1, 0, 2}, { 3, 2, 0}, { 3, 0, 5}, { 4, 7, 5}, { 4, 5, 0}, { 6, 5, 7}, { 6,10, 8},
@@ -564,15 +564,15 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_62 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_63 [] = {
-{ 0.47429f,-0.07186f}, { 0.62021f,-0.07143f}, { 0.47118f, 0.07714f}, { 0.62329f, 0.07714f}, { 0.49979f, 0.19714f},
-{ 0.62021f, 0.19714f}, { 0.49563f, 0.20286f}, { 0.49563f, 0.27714f}, { 0.63681f, 0.31714f}, { 0.50816f, 0.34571f},
-{ 0.65714f, 0.36350f}, { 0.53669f, 0.41429f}, { 0.70857f, 0.42384f}, { 0.57868f, 0.47143f}, { 0.82857f, 0.53597f},
-{ 0.86902f, 0.58571f}, { 0.73258f, 0.62000f}, { 0.90437f, 0.65429f}, { 0.76086f, 0.66000f}, { 0.77522f, 0.70000f},
-{ 0.91580f, 0.70000f}, { 0.34857f, 0.71338f}, { 0.21034f, 0.73429f}, { 0.77866f, 0.75143f}, { 0.91807f, 0.76857f},
-{ 0.22605f, 0.80857f}, { 0.76571f, 0.80375f}, { 0.38286f, 0.82144f}, { 0.73714f, 0.85191f}, { 0.25098f, 0.87143f},
-{ 0.89143f, 0.86730f}, { 0.43597f, 0.88857f}, { 0.86812f, 0.90571f}, { 0.67429f, 0.90616f}, { 0.48571f, 0.91800f},
-{ 0.62857f, 0.92538f}, { 0.29296f, 0.93429f}, { 0.54857f, 0.93277f}, { 0.81143f, 0.96670f}, { 0.35429f, 0.98821f},
-{ 0.76571f, 0.99800f}, { 0.44571f, 1.02891f}, { 0.69714f, 1.02680f}, { 0.53143f, 1.04395f}, { 0.60000f, 1.04437f},
+{ 0.47429,-0.07186}, { 0.62021,-0.07143}, { 0.47118, 0.07714}, { 0.62329, 0.07714}, { 0.49979, 0.19714},
+{ 0.62021, 0.19714}, { 0.49563, 0.20286}, { 0.49563, 0.27714}, { 0.63681, 0.31714}, { 0.50816, 0.34571},
+{ 0.65714, 0.36350}, { 0.53669, 0.41429}, { 0.70857, 0.42384}, { 0.57868, 0.47143}, { 0.82857, 0.53597},
+{ 0.86902, 0.58571}, { 0.73258, 0.62000}, { 0.90437, 0.65429}, { 0.76086, 0.66000}, { 0.77522, 0.70000},
+{ 0.91580, 0.70000}, { 0.34857, 0.71338}, { 0.21034, 0.73429}, { 0.77866, 0.75143}, { 0.91807, 0.76857},
+{ 0.22605, 0.80857}, { 0.76571, 0.80375}, { 0.38286, 0.82144}, { 0.73714, 0.85191}, { 0.25098, 0.87143},
+{ 0.89143, 0.86730}, { 0.43597, 0.88857}, { 0.86812, 0.90571}, { 0.67429, 0.90616}, { 0.48571, 0.91800},
+{ 0.62857, 0.92538}, { 0.29296, 0.93429}, { 0.54857, 0.93277}, { 0.81143, 0.96670}, { 0.35429, 0.98821},
+{ 0.76571, 0.99800}, { 0.44571, 1.02891}, { 0.69714, 1.02680}, { 0.53143, 1.04395}, { 0.60000, 1.04437},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_63 [] = {
 { 2, 1, 3}, { 2, 0, 1}, { 7, 6, 4}, { 7, 4, 5}, { 8, 9, 7}, {11,10,13}, { 8, 7, 5},
@@ -584,29 +584,29 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_63 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_64 [] = {
-{ 0.92571f,-0.39563f}, { 1.16571f,-0.38109f}, { 0.74857f,-0.37236f}, { 0.65143f,-0.34613f}, { 1.33143f,-0.33070f},
-{ 0.54286f,-0.29914f}, { 0.86286f,-0.27866f}, { 1.06286f,-0.28134f}, { 1.45650f,-0.26000f}, { 0.73714f,-0.25387f},
-{ 1.21143f,-0.25387f}, { 0.43429f,-0.22384f}, { 0.62286f,-0.21216f}, { 1.32144f,-0.20857f}, { 1.55582f,-0.17429f},
-{ 0.53714f,-0.16099f}, { 0.52571f,-0.15258f}, { 0.53143f,-0.15669f}, { 0.33714f,-0.11650f}, { 1.45143f,-0.11561f},
-{ 0.46286f,-0.09260f}, { 0.80000f,-0.07295f}, { 1.20571f,-0.07252f}, { 1.09714f,-0.06891f}, { 0.71429f,-0.06252f},
-{ 1.49714f,-0.06187f}, { 1.63260f,-0.06000f}, { 0.29629f,-0.04857f}, { 1.29714f,-0.04498f}, { 0.90857f,-0.03629f},
-{ 1.03384f,-0.02571f}, { 0.62857f,-0.01582f}, { 0.40486f,-0.00857f}, { 0.59429f, 0.01873f}, { 1.41143f, 0.03296f},
-{ 0.82857f, 0.03907f}, { 0.77714f, 0.04327f}, { 1.01143f, 0.04414f}, { 1.20000f, 0.05050f}, { 1.16989f, 0.06571f},
-{ 1.25143f, 0.06086f}, { 0.90857f, 0.06821f}, { 0.72000f, 0.07561f}, { 0.54771f, 0.09429f}, { 1.15580f, 0.09429f},
-{ 0.24420f, 0.10000f}, { 0.35748f, 0.11143f}, { 0.96000f, 0.10725f}, { 0.68527f, 0.11714f}, { 1.33841f, 0.11714f},
-{ 1.51579f, 0.15714f}, { 0.66177f, 0.17429f}, { 1.41355f, 0.20286f}, { 1.03514f, 0.20857f}, { 0.65295f, 0.23143f},
-{ 0.22437f, 0.23714f}, { 0.51277f, 0.23714f}, { 0.33563f, 0.24857f}, { 1.45355f, 0.27714f}, { 1.07177f, 0.31143f},
-{ 1.58478f, 0.31143f}, { 0.65966f, 0.32857f}, { 1.48319f, 0.36857f}, { 0.53184f, 0.39714f}, { 0.23277f, 0.40286f},
-{ 0.34478f, 0.40857f}, { 1.60420f, 0.42571f}, { 1.08420f, 0.44286f}, { 0.71514f, 0.48857f}, { 0.25184f, 0.49429f},
-{ 1.49295f, 0.49429f}, { 0.57229f, 0.50000f}, { 1.60109f, 0.52857f}, { 1.05714f, 0.54144f}, { 0.75846f, 0.55143f},
-{ 0.38645f, 0.55714f}, { 1.47681f, 0.58571f}, { 1.01143f, 0.59527f}, { 0.81714f, 0.60331f}, { 1.58605f, 0.60857f},
-{ 1.12878f, 0.61429f}, { 0.65714f, 0.62418f}, { 0.86286f, 0.62319f}, { 0.96571f, 0.62151f}, { 0.92571f, 0.62991f},
-{ 0.42857f, 0.64350f}, { 1.44571f, 0.66730f}, { 0.32359f, 0.67714f}, { 1.06048f, 0.68286f}, { 0.74857f, 0.69641f},
-{ 1.15429f, 0.71588f}, { 1.28235f, 0.71714f}, { 1.00571f, 0.71800f}, { 0.82857f, 0.73109f}, { 0.92000f, 0.74152f},
-{ 1.52657f, 0.75143f}, { 0.51275f, 0.75714f}, { 0.37669f, 0.76286f}, { 1.38286f, 0.76132f}, { 0.59493f, 0.82571f},
-{ 1.30857f, 0.82821f}, { 1.45561f, 0.84857f}, { 0.47429f, 0.87296f}, { 0.73143f, 0.89681f}, { 1.18286f, 0.89580f},
-{ 1.08571f, 0.92395f}, { 1.37143f, 0.92400f}, { 0.92000f, 0.93580f}, { 0.58286f, 0.95188f}, { 1.30857f, 0.96371f},
-{ 0.71429f, 1.00899f}, { 1.18286f, 1.01470f}, { 0.92000f, 1.04437f}, { 1.01143f, 1.04395f},
+{ 0.92571,-0.39563}, { 1.16571,-0.38109}, { 0.74857,-0.37236}, { 0.65143,-0.34613}, { 1.33143,-0.33070},
+{ 0.54286,-0.29914}, { 0.86286,-0.27866}, { 1.06286,-0.28134}, { 1.45650,-0.26000}, { 0.73714,-0.25387},
+{ 1.21143,-0.25387}, { 0.43429,-0.22384}, { 0.62286,-0.21216}, { 1.32144,-0.20857}, { 1.55582,-0.17429},
+{ 0.53714,-0.16099}, { 0.52571,-0.15258}, { 0.53143,-0.15669}, { 0.33714,-0.11650}, { 1.45143,-0.11561},
+{ 0.46286,-0.09260}, { 0.80000,-0.07295}, { 1.20571,-0.07252}, { 1.09714,-0.06891}, { 0.71429,-0.06252},
+{ 1.49714,-0.06187}, { 1.63260,-0.06000}, { 0.29629,-0.04857}, { 1.29714,-0.04498}, { 0.90857,-0.03629},
+{ 1.03384,-0.02571}, { 0.62857,-0.01582}, { 0.40486,-0.00857}, { 0.59429, 0.01873}, { 1.41143, 0.03296},
+{ 0.82857, 0.03907}, { 0.77714, 0.04327}, { 1.01143, 0.04414}, { 1.20000, 0.05050}, { 1.16989, 0.06571},
+{ 1.25143, 0.06086}, { 0.90857, 0.06821}, { 0.72000, 0.07561}, { 0.54771, 0.09429}, { 1.15580, 0.09429},
+{ 0.24420, 0.10000}, { 0.35748, 0.11143}, { 0.96000, 0.10725}, { 0.68527, 0.11714}, { 1.33841, 0.11714},
+{ 1.51579, 0.15714}, { 0.66177, 0.17429}, { 1.41355, 0.20286}, { 1.03514, 0.20857}, { 0.65295, 0.23143},
+{ 0.22437, 0.23714}, { 0.51277, 0.23714}, { 0.33563, 0.24857}, { 1.45355, 0.27714}, { 1.07177, 0.31143},
+{ 1.58478, 0.31143}, { 0.65966, 0.32857}, { 1.48319, 0.36857}, { 0.53184, 0.39714}, { 0.23277, 0.40286},
+{ 0.34478, 0.40857}, { 1.60420, 0.42571}, { 1.08420, 0.44286}, { 0.71514, 0.48857}, { 0.25184, 0.49429},
+{ 1.49295, 0.49429}, { 0.57229, 0.50000}, { 1.60109, 0.52857}, { 1.05714, 0.54144}, { 0.75846, 0.55143},
+{ 0.38645, 0.55714}, { 1.47681, 0.58571}, { 1.01143, 0.59527}, { 0.81714, 0.60331}, { 1.58605, 0.60857},
+{ 1.12878, 0.61429}, { 0.65714, 0.62418}, { 0.86286, 0.62319}, { 0.96571, 0.62151}, { 0.92571, 0.62991},
+{ 0.42857, 0.64350}, { 1.44571, 0.66730}, { 0.32359, 0.67714}, { 1.06048, 0.68286}, { 0.74857, 0.69641},
+{ 1.15429, 0.71588}, { 1.28235, 0.71714}, { 1.00571, 0.71800}, { 0.82857, 0.73109}, { 0.92000, 0.74152},
+{ 1.52657, 0.75143}, { 0.51275, 0.75714}, { 0.37669, 0.76286}, { 1.38286, 0.76132}, { 0.59493, 0.82571},
+{ 1.30857, 0.82821}, { 1.45561, 0.84857}, { 0.47429, 0.87296}, { 0.73143, 0.89681}, { 1.18286, 0.89580},
+{ 1.08571, 0.92395}, { 1.37143, 0.92400}, { 0.92000, 0.93580}, { 0.58286, 0.95188}, { 1.30857, 0.96371},
+{ 0.71429, 1.00899}, { 1.18286, 1.01470}, { 0.92000, 1.04437}, { 1.01143, 1.04395},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_64 [] = {
 { 0, 6, 2}, { 1, 7, 0}, { 6, 0, 7}, { 7, 1,10}, { 2, 9, 3}, { 3,12, 5}, { 9, 2, 6},
@@ -629,9 +629,9 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_64 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_65 [] = {
-{ 0.14455f,-0.07143f}, { 1.00000f,-0.07252f}, { 1.15573f,-0.07143f}, { 0.29143f,-0.07103f}, { 0.40981f, 0.25429f},
-{ 0.86857f, 0.25754f}, { 0.45714f, 0.37713f}, { 0.82478f, 0.38000f}, { 0.45462f, 0.38571f}, { 0.58538f, 0.73429f},
-{ 0.63429f, 0.90068f}, { 0.56000f, 1.02454f}, { 0.71429f, 1.02644f},
+{ 0.14455,-0.07143}, { 1.00000,-0.07252}, { 1.15573,-0.07143}, { 0.29143,-0.07103}, { 0.40981, 0.25429},
+{ 0.86857, 0.25754}, { 0.45714, 0.37713}, { 0.82478, 0.38000}, { 0.45462, 0.38571}, { 0.58538, 0.73429},
+{ 0.63429, 0.90068}, { 0.56000, 1.02454}, { 0.71429, 1.02644},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_65 [] = {
 { 5, 1, 2}, { 0, 8,11}, { 6, 4, 5}, {12,10, 7}, { 0, 3, 4}, { 0, 4, 8}, { 6, 5, 7},
@@ -639,16 +639,16 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_65 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_66 [] = {
-{ 0.25714f,-0.07186f}, { 0.78286f,-0.06723f}, { 0.86857f,-0.04899f}, { 0.93714f,-0.02045f}, { 1.00725f, 0.03714f},
-{ 0.39957f, 0.06000f}, { 0.73143f, 0.05621f}, { 0.80571f, 0.06891f}, { 1.04213f, 0.08857f}, { 0.87555f, 0.10571f},
-{ 1.06437f, 0.14000f}, { 0.91070f, 0.15143f}, { 1.08109f, 0.22000f}, { 0.93295f, 0.22571f}, { 0.93252f, 0.26571f},
-{ 1.07177f, 0.32286f}, { 0.90857f, 0.34064f}, { 1.04616f, 0.38571f}, { 0.86857f, 0.38686f}, { 0.79429f, 0.42252f},
-{ 0.39957f, 0.43143f}, { 1.01296f, 0.43143f}, { 0.69714f, 0.43563f}, { 0.97143f, 0.46686f}, { 0.88197f, 0.51143f},
-{ 0.40571f, 0.56437f}, { 0.72000f, 0.56705f}, { 0.39848f, 0.57429f}, { 0.96956f, 0.58571f}, { 0.80571f, 0.58930f},
-{ 0.84686f, 0.62000f}, { 0.99641f, 0.62571f}, { 0.86943f, 0.65429f}, { 1.02437f, 0.70571f}, { 0.88420f, 0.71143f},
-{ 1.02665f, 0.76857f}, { 0.87429f, 0.79232f}, { 1.01673f, 0.82000f}, { 0.84000f, 0.84984f}, { 0.77714f, 0.88538f},
-{ 0.98607f, 0.88857f}, { 0.39957f, 0.89429f}, { 0.71429f, 0.89580f}, { 0.93143f, 0.95296f}, { 0.85714f, 0.99756f},
-{ 0.80000f, 1.01470f}, { 0.25714f, 1.02615f}, { 0.70857f, 1.02680f},
+{ 0.25714,-0.07186}, { 0.78286,-0.06723}, { 0.86857,-0.04899}, { 0.93714,-0.02045}, { 1.00725, 0.03714},
+{ 0.39957, 0.06000}, { 0.73143, 0.05621}, { 0.80571, 0.06891}, { 1.04213, 0.08857}, { 0.87555, 0.10571},
+{ 1.06437, 0.14000}, { 0.91070, 0.15143}, { 1.08109, 0.22000}, { 0.93295, 0.22571}, { 0.93252, 0.26571},
+{ 1.07177, 0.32286}, { 0.90857, 0.34064}, { 1.04616, 0.38571}, { 0.86857, 0.38686}, { 0.79429, 0.42252},
+{ 0.39957, 0.43143}, { 1.01296, 0.43143}, { 0.69714, 0.43563}, { 0.97143, 0.46686}, { 0.88197, 0.51143},
+{ 0.40571, 0.56437}, { 0.72000, 0.56705}, { 0.39848, 0.57429}, { 0.96956, 0.58571}, { 0.80571, 0.58930},
+{ 0.84686, 0.62000}, { 0.99641, 0.62571}, { 0.86943, 0.65429}, { 1.02437, 0.70571}, { 0.88420, 0.71143},
+{ 1.02665, 0.76857}, { 0.87429, 0.79232}, { 1.01673, 0.82000}, { 0.84000, 0.84984}, { 0.77714, 0.88538},
+{ 0.98607, 0.88857}, { 0.39957, 0.89429}, { 0.71429, 0.89580}, { 0.93143, 0.95296}, { 0.85714, 0.99756},
+{ 0.80000, 1.01470}, { 0.25714, 1.02615}, { 0.70857, 1.02680},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_66 [] = {
 { 1, 6, 0}, { 2, 7, 1}, { 0,20,46}, { 7, 2, 9}, { 1, 7, 6}, {20,27,46}, { 9, 4,11},
@@ -662,18 +662,18 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_66 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_67 [] = {
-{ 0.69143f,-0.08966f}, { 0.80000f,-0.08705f}, { 0.60000f,-0.07823f}, { 0.50857f,-0.05070f}, { 0.93143f,-0.05216f},
-{ 0.45714f,-0.02486f}, { 1.00000f,-0.01473f}, { 0.39597f, 0.02000f}, { 0.69714f, 0.03563f}, { 0.74857f, 0.03563f},
-{ 0.62286f, 0.04899f}, { 0.82286f, 0.04899f}, { 1.08000f, 0.05597f}, { 0.57143f, 0.06784f}, { 0.88000f, 0.07229f},
-{ 0.32571f, 0.10064f}, { 0.93143f, 0.10759f}, { 0.49143f, 0.11901f}, { 1.13800f, 0.14000f}, { 0.45600f, 0.15714f},
-{ 0.28930f, 0.16286f}, { 0.99641f, 0.18571f}, { 0.41502f, 0.22571f}, { 1.18605f, 0.27714f}, { 0.24319f, 0.28857f},
-{ 1.04571f, 0.31105f}, { 0.38244f, 0.32857f}, { 0.22748f, 0.36286f}, { 0.36723f, 0.44286f}, { 0.21866f, 0.52857f},
-{ 0.36991f, 0.55714f}, { 0.22705f, 0.60857f}, { 1.02857f, 0.69469f}, { 0.40657f, 0.71143f}, { 1.16694f, 0.72857f},
-{ 0.26286f, 0.74089f}, { 0.44187f, 0.78000f}, { 1.13927f, 0.80857f}, { 0.97143f, 0.80914f}, { 0.48000f, 0.82725f},
-{ 0.31750f, 0.84286f}, { 0.93714f, 0.85011f}, { 0.53143f, 0.86784f}, { 0.89143f, 0.88331f}, { 1.07582f, 0.90571f},
-{ 0.64000f, 0.91252f}, { 0.64571f, 0.91335f}, { 0.65714f, 0.91563f}, { 0.38286f, 0.91868f}, { 0.78857f, 0.91823f},
-{ 1.00571f, 0.96902f}, { 0.50286f, 0.99756f}, { 0.93143f, 1.01070f}, { 0.58286f, 1.02680f}, { 0.70286f, 1.04705f},
-{ 0.80000f, 1.04437f},
+{ 0.69143,-0.08966}, { 0.80000,-0.08705}, { 0.60000,-0.07823}, { 0.50857,-0.05070}, { 0.93143,-0.05216},
+{ 0.45714,-0.02486}, { 1.00000,-0.01473}, { 0.39597, 0.02000}, { 0.69714, 0.03563}, { 0.74857, 0.03563},
+{ 0.62286, 0.04899}, { 0.82286, 0.04899}, { 1.08000, 0.05597}, { 0.57143, 0.06784}, { 0.88000, 0.07229},
+{ 0.32571, 0.10064}, { 0.93143, 0.10759}, { 0.49143, 0.11901}, { 1.13800, 0.14000}, { 0.45600, 0.15714},
+{ 0.28930, 0.16286}, { 0.99641, 0.18571}, { 0.41502, 0.22571}, { 1.18605, 0.27714}, { 0.24319, 0.28857},
+{ 1.04571, 0.31105}, { 0.38244, 0.32857}, { 0.22748, 0.36286}, { 0.36723, 0.44286}, { 0.21866, 0.52857},
+{ 0.36991, 0.55714}, { 0.22705, 0.60857}, { 1.02857, 0.69469}, { 0.40657, 0.71143}, { 1.16694, 0.72857},
+{ 0.26286, 0.74089}, { 0.44187, 0.78000}, { 1.13927, 0.80857}, { 0.97143, 0.80914}, { 0.48000, 0.82725},
+{ 0.31750, 0.84286}, { 0.93714, 0.85011}, { 0.53143, 0.86784}, { 0.89143, 0.88331}, { 1.07582, 0.90571},
+{ 0.64000, 0.91252}, { 0.64571, 0.91335}, { 0.65714, 0.91563}, { 0.38286, 0.91868}, { 0.78857, 0.91823},
+{ 1.00571, 0.96902}, { 0.50286, 0.99756}, { 0.93143, 1.01070}, { 0.58286, 1.02680}, { 0.70286, 1.04705},
+{ 0.80000, 1.04437},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_67 [] = {
 { 1, 9, 0}, { 0, 8, 2}, {14, 6,16}, { 4,14,11}, {24,20,22}, { 7,17,15}, { 2,10, 3},
@@ -687,13 +687,13 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_67 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_68 [] = {
-{ 0.26286f,-0.07186f}, { 0.70286f,-0.07252f}, { 0.80000f,-0.06109f}, { 0.89714f,-0.03355f}, { 0.99555f, 0.02571f},
-{ 0.40528f, 0.06000f}, { 0.72571f, 0.05891f}, { 1.03582f, 0.06571f}, { 0.79547f, 0.07143f}, { 0.88000f, 0.10893f},
-{ 1.08150f, 0.12857f}, { 0.92115f, 0.14571f}, { 0.96657f, 0.21429f}, { 1.13966f, 0.26571f}, { 0.99470f, 0.28857f},
-{ 1.16420f, 0.39714f}, { 1.01823f, 0.43714f}, { 1.16723f, 0.52857f}, { 1.01823f, 0.53429f}, { 1.15277f, 0.64286f},
-{ 1.00000f, 0.65848f}, { 0.97714f, 0.72375f}, { 1.11216f, 0.77429f}, { 0.94286f, 0.78057f}, { 0.87429f, 0.84902f},
-{ 1.06607f, 0.85429f}, { 0.81714f, 0.87865f}, { 0.40528f, 0.89429f}, { 0.69143f, 0.89807f}, { 0.97714f, 0.94616f},
-{ 0.90857f, 0.98657f}, { 0.81143f, 1.01580f}, { 0.26286f, 1.02615f}, { 0.70286f, 1.02680f},
+{ 0.26286,-0.07186}, { 0.70286,-0.07252}, { 0.80000,-0.06109}, { 0.89714,-0.03355}, { 0.99555, 0.02571},
+{ 0.40528, 0.06000}, { 0.72571, 0.05891}, { 1.03582, 0.06571}, { 0.79547, 0.07143}, { 0.88000, 0.10893},
+{ 1.08150, 0.12857}, { 0.92115, 0.14571}, { 0.96657, 0.21429}, { 1.13966, 0.26571}, { 0.99470, 0.28857},
+{ 1.16420, 0.39714}, { 1.01823, 0.43714}, { 1.16723, 0.52857}, { 1.01823, 0.53429}, { 1.15277, 0.64286},
+{ 1.00000, 0.65848}, { 0.97714, 0.72375}, { 1.11216, 0.77429}, { 0.94286, 0.78057}, { 0.87429, 0.84902},
+{ 1.06607, 0.85429}, { 0.81714, 0.87865}, { 0.40528, 0.89429}, { 0.69143, 0.89807}, { 0.97714, 0.94616},
+{ 0.90857, 0.98657}, { 0.81143, 1.01580}, { 0.26286, 1.02615}, { 0.70286, 1.02680},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_68 [] = {
 { 2, 6, 1}, { 5, 0, 1}, { 8, 3, 9}, { 3, 8, 2}, { 0,27,32}, { 6, 2, 8}, { 5, 1, 6},
@@ -704,9 +704,9 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_68 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_69 [] = {
-{ 0.26857f,-0.07186f}, { 1.08000f,-0.06878f}, { 1.08000f, 0.05164f}, { 0.41100f, 0.06000f}, { 0.41100f, 0.42571f},
-{ 1.01143f, 0.43100f}, { 1.01563f, 0.55143f}, { 0.41714f, 0.55866f}, { 1.01143f, 0.55757f}, { 0.40991f, 0.56857f},
-{ 0.41100f, 0.89429f}, { 1.05143f, 0.89957f}, { 1.05563f, 1.02000f}, { 0.26857f, 1.02615f}, { 1.05143f, 1.02615f},
+{ 0.26857,-0.07186}, { 1.08000,-0.06878}, { 1.08000, 0.05164}, { 0.41100, 0.06000}, { 0.41100, 0.42571},
+{ 1.01143, 0.43100}, { 1.01563, 0.55143}, { 0.41714, 0.55866}, { 1.01143, 0.55757}, { 0.40991, 0.56857},
+{ 0.41100, 0.89429}, { 1.05143, 0.89957}, { 1.05563, 1.02000}, { 0.26857, 1.02615}, { 1.05143, 1.02615},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_69 [] = {
 { 0, 4,13}, { 1, 3, 0}, { 1, 2, 3}, { 0, 3, 4}, { 7, 5, 8}, { 5, 7, 4}, { 6, 8, 5},
@@ -714,9 +714,9 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_69 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_70 [] = {
-{ 0.26857f,-0.07186f}, { 0.40571f,-0.07186f}, { 0.40991f, 0.42000f}, { 0.41714f, 0.42723f}, { 0.92615f, 0.43143f},
-{ 0.92615f, 0.55143f}, { 0.41714f, 0.55563f}, { 0.40991f, 0.56286f}, { 0.41100f, 0.89429f}, { 1.00571f, 0.90265f},
-{ 1.00571f, 1.02307f}, { 0.26857f, 1.02615f},
+{ 0.26857,-0.07186}, { 0.40571,-0.07186}, { 0.40991, 0.42000}, { 0.41714, 0.42723}, { 0.92615, 0.43143},
+{ 0.92615, 0.55143}, { 0.41714, 0.55563}, { 0.40991, 0.56286}, { 0.41100, 0.89429}, { 1.00571, 0.90265},
+{ 1.00571, 1.02307}, { 0.26857, 1.02615},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_70 [] = {
 { 0, 2,11}, { 2, 7,11}, { 2, 0, 1}, { 6, 4, 5}, { 4, 6, 3}, { 3, 6, 2}, { 7, 2, 6},
@@ -724,18 +724,18 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_70 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_71 [] = {
-{ 0.82286f,-0.08966f}, { 0.65714f,-0.07866f}, { 0.93143f,-0.07335f}, { 0.56571f,-0.05387f}, { 1.05143f,-0.03355f},
-{ 0.48000f,-0.01514f}, { 1.12000f, 0.00073f}, { 0.74286f, 0.03866f}, { 0.83429f, 0.04177f}, { 0.38857f, 0.05044f},
-{ 0.65143f, 0.05470f}, { 0.92571f, 0.06319f}, { 1.23260f, 0.07714f}, { 0.34857f, 0.09302f}, { 0.54286f, 0.10150f},
-{ 1.03429f, 0.11229f}, { 0.50286f, 0.13044f}, { 1.09252f, 0.15714f}, { 0.44421f, 0.19714f}, { 0.27429f, 0.21629f},
-{ 0.24252f, 0.31143f}, { 0.39320f, 0.31143f}, { 0.77714f, 0.36243f}, { 1.09143f, 0.35773f}, { 0.22748f, 0.39714f},
-{ 0.37605f, 0.40286f}, { 0.77295f, 0.48286f}, { 0.77714f, 0.48900f}, { 1.23429f, 0.48900f}, { 0.22437f, 0.51143f},
-{ 0.37295f, 0.51714f}, { 0.23320f, 0.59143f}, { 0.39748f, 0.65429f}, { 1.09143f, 0.68617f}, { 1.08571f, 0.69099f},
-{ 0.42073f, 0.71714f}, { 1.21977f, 0.72286f}, { 0.27387f, 0.73429f}, { 1.06286f, 0.75301f}, { 0.30645f, 0.80286f},
-{ 0.47616f, 0.80286f}, { 1.02286f, 0.82127f}, { 1.18498f, 0.82571f}, { 0.54286f, 0.86150f}, { 0.34857f, 0.86629f},
-{ 0.94286f, 0.88371f}, { 1.14857f, 0.88793f}, { 0.61143f, 0.89580f}, { 0.86286f, 0.91184f}, { 0.40168f, 0.92286f},
-{ 0.70857f, 0.91866f}, { 0.80000f, 0.92134f}, { 1.09714f, 0.94384f}, { 0.45714f, 0.96436f}, { 0.53714f, 1.00498f},
-{ 1.00000f, 1.00371f}, { 0.93714f, 1.02613f}, { 0.62857f, 1.03252f}, { 0.73714f, 1.04705f}, { 0.84571f, 1.04395f},
+{ 0.82286,-0.08966}, { 0.65714,-0.07866}, { 0.93143,-0.07335}, { 0.56571,-0.05387}, { 1.05143,-0.03355},
+{ 0.48000,-0.01514}, { 1.12000, 0.00073}, { 0.74286, 0.03866}, { 0.83429, 0.04177}, { 0.38857, 0.05044},
+{ 0.65143, 0.05470}, { 0.92571, 0.06319}, { 1.23260, 0.07714}, { 0.34857, 0.09302}, { 0.54286, 0.10150},
+{ 1.03429, 0.11229}, { 0.50286, 0.13044}, { 1.09252, 0.15714}, { 0.44421, 0.19714}, { 0.27429, 0.21629},
+{ 0.24252, 0.31143}, { 0.39320, 0.31143}, { 0.77714, 0.36243}, { 1.09143, 0.35773}, { 0.22748, 0.39714},
+{ 0.37605, 0.40286}, { 0.77295, 0.48286}, { 0.77714, 0.48900}, { 1.23429, 0.48900}, { 0.22437, 0.51143},
+{ 0.37295, 0.51714}, { 0.23320, 0.59143}, { 0.39748, 0.65429}, { 1.09143, 0.68617}, { 1.08571, 0.69099},
+{ 0.42073, 0.71714}, { 1.21977, 0.72286}, { 0.27387, 0.73429}, { 1.06286, 0.75301}, { 0.30645, 0.80286},
+{ 0.47616, 0.80286}, { 1.02286, 0.82127}, { 1.18498, 0.82571}, { 0.54286, 0.86150}, { 0.34857, 0.86629},
+{ 0.94286, 0.88371}, { 1.14857, 0.88793}, { 0.61143, 0.89580}, { 0.86286, 0.91184}, { 0.40168, 0.92286},
+{ 0.70857, 0.91866}, { 0.80000, 0.92134}, { 1.09714, 0.94384}, { 0.45714, 0.96436}, { 0.53714, 1.00498},
+{ 1.00000, 1.00371}, { 0.93714, 1.02613}, { 0.62857, 1.03252}, { 0.73714, 1.04705}, { 0.84571, 1.04395},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_71 [] = {
 { 0, 7, 1}, {14, 5, 3}, { 5,14, 9}, { 2, 8, 0}, { 1,10, 3}, { 0, 8, 7}, { 8, 2,11},
@@ -750,10 +750,10 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_71 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_72 [] = {
-{ 0.26857f,-0.07186f}, { 0.40571f,-0.07186f}, { 0.98857f,-0.07295f}, { 0.98286f,-0.06878f}, { 1.12571f,-0.06878f},
-{ 0.40991f, 0.43714f}, { 0.41714f, 0.44437f}, { 0.97714f, 0.44329f}, { 0.41714f, 0.57277f}, { 0.97714f, 0.57385f},
-{ 0.40991f, 0.58000f}, { 0.98550f, 1.02571f}, { 1.12571f, 1.02307f}, { 0.26857f, 1.02615f}, { 0.40571f, 1.02615f},
-{ 1.12000f, 1.02723f},
+{ 0.26857,-0.07186}, { 0.40571,-0.07186}, { 0.98857,-0.07295}, { 0.98286,-0.06878}, { 1.12571,-0.06878},
+{ 0.40991, 0.43714}, { 0.41714, 0.44437}, { 0.97714, 0.44329}, { 0.41714, 0.57277}, { 0.97714, 0.57385},
+{ 0.40991, 0.58000}, { 0.98550, 1.02571}, { 1.12571, 1.02307}, { 0.26857, 1.02615}, { 0.40571, 1.02615},
+{ 1.12000, 1.02723},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_72 [] = {
 { 4, 9, 7}, { 0, 5,13}, { 5,10,13}, { 5, 0, 1}, { 8, 7, 9}, { 9, 4,11}, {10, 5, 8},
@@ -761,19 +761,19 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_72 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_73 [] = {
-{ 0.42592f,-0.07143f}, { 0.28571f,-0.06878f}, { 0.28836f, 1.02571f}, { 0.42857f, 1.02307f},
+{ 0.42592,-0.07143}, { 0.28571,-0.06878}, { 0.28836, 1.02571}, { 0.42857, 1.02307},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_73 [] = {
 { 1, 3, 2}, { 3, 1, 0},
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_74 [] = {
-{ 0.45143f,-0.09009f}, { 0.50857f,-0.09009f}, { 0.37714f,-0.07756f}, { 0.58404f,-0.07714f}, { 0.33143f,-0.06086f},
-{ 0.64000f,-0.05641f}, { 0.26489f,-0.01429f}, { 0.71429f,-0.00117f}, { 0.46286f, 0.03866f}, { 0.53714f, 0.04706f},
-{ 0.74902f, 0.04857f}, { 0.41714f, 0.04899f}, { 0.57772f, 0.06571f}, { 0.21143f, 0.06772f}, { 0.37016f, 0.07714f},
-{ 0.34498f, 0.11143f}, { 0.77252f, 0.11143f}, { 0.62371f, 0.11714f}, { 0.18705f, 0.16286f}, { 0.32462f, 0.17429f},
-{ 0.64420f, 0.22571f}, { 0.79009f, 0.23143f}, { 0.18546f, 0.23714f}, { 0.31472f, 0.25429f}, { 0.64836f, 1.02571f},
-{ 0.78857f, 1.02307f}, { 0.78286f, 1.02723f},
+{ 0.45143,-0.09009}, { 0.50857,-0.09009}, { 0.37714,-0.07756}, { 0.58404,-0.07714}, { 0.33143,-0.06086},
+{ 0.64000,-0.05641}, { 0.26489,-0.01429}, { 0.71429,-0.00117}, { 0.46286, 0.03866}, { 0.53714, 0.04706},
+{ 0.74902, 0.04857}, { 0.41714, 0.04899}, { 0.57772, 0.06571}, { 0.21143, 0.06772}, { 0.37016, 0.07714},
+{ 0.34498, 0.11143}, { 0.77252, 0.11143}, { 0.62371, 0.11714}, { 0.18705, 0.16286}, { 0.32462, 0.17429},
+{ 0.64420, 0.22571}, { 0.79009, 0.23143}, { 0.18546, 0.23714}, { 0.31472, 0.25429}, { 0.64836, 1.02571},
+{ 0.78857, 1.02307}, { 0.78286, 1.02723},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_74 [] = {
 {10,12, 7}, { 4, 2,11}, { 0, 1, 8}, { 3, 8, 1}, {11, 2, 8}, { 0, 8, 2}, { 8, 3, 9},
@@ -783,10 +783,10 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_74 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_75 [] = {
-{ 0.25714f,-0.07186f}, { 0.39429f,-0.07186f}, { 1.15502f,-0.07143f}, { 0.97143f,-0.07140f}, { 0.89527f, 0.28857f},
-{ 0.89143f, 0.29371f}, { 0.89098f, 0.29429f}, { 0.39848f, 0.30000f}, { 0.57714f, 0.47913f}, { 0.40000f, 0.49126f},
-{ 0.68956f, 0.56857f}, { 0.68571f, 0.57371f}, { 0.68527f, 0.57429f}, { 1.13216f, 1.02571f}, { 0.25714f, 1.02615f},
-{ 0.39429f, 1.02615f}, { 0.94857f, 1.02680f},
+{ 0.25714,-0.07186}, { 0.39429,-0.07186}, { 1.15502,-0.07143}, { 0.97143,-0.07140}, { 0.89527, 0.28857},
+{ 0.89143, 0.29371}, { 0.89098, 0.29429}, { 0.39848, 0.30000}, { 0.57714, 0.47913}, { 0.40000, 0.49126},
+{ 0.68956, 0.56857}, { 0.68571, 0.57371}, { 0.68527, 0.57429}, { 1.13216, 1.02571}, { 0.25714, 1.02615},
+{ 0.39429, 1.02615}, { 0.94857, 1.02680},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_75 [] = {
 { 0, 9,14}, { 0, 7, 9}, { 3,10, 8}, { 3, 6,10}, { 9, 8,16}, { 4, 5, 6}, { 7, 0, 1},
@@ -795,18 +795,18 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_75 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_76 [] = {
-{ 0.25714f,-0.07186f}, { 0.93714f,-0.07186f}, { 0.94134f, 0.04857f}, { 0.39957f, 0.06000f}, { 0.93714f, 0.05472f},
-{ 0.25714f, 1.02615f}, { 0.39429f, 1.02615f},
+{ 0.25714,-0.07186}, { 0.93714,-0.07186}, { 0.94134, 0.04857}, { 0.39957, 0.06000}, { 0.93714, 0.05472},
+{ 0.25714, 1.02615}, { 0.39429, 1.02615},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_76 [] = {
 { 3, 0, 1}, { 0, 3, 5}, { 2, 4, 1}, { 3, 1, 4}, { 6, 5, 3},
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_77 [] = {
-{ 0.39164f,-0.07143f}, { 0.71429f,-0.07186f}, { 1.17143f,-0.07295f}, { 0.25714f,-0.06878f}, { 0.84000f,-0.06947f},
-{ 1.16571f,-0.06878f}, { 1.30286f,-0.06878f}, { 0.78286f, 0.09751f}, { 0.78857f, 0.09751f}, { 1.16000f, 0.83018f},
-{ 0.40000f, 0.84467f}, { 0.52151f, 0.88286f}, { 0.52000f, 0.88739f}, { 0.51748f, 0.89429f}, { 0.47580f, 1.02000f},
-{ 0.25979f, 1.02571f}, { 1.11429f, 1.02285f}, { 1.30286f, 1.02307f}, { 0.46857f, 1.02680f},
+{ 0.39164,-0.07143}, { 0.71429,-0.07186}, { 1.17143,-0.07295}, { 0.25714,-0.06878}, { 0.84000,-0.06947},
+{ 1.16571,-0.06878}, { 1.30286,-0.06878}, { 0.78286, 0.09751}, { 0.78857, 0.09751}, { 1.16000, 0.83018},
+{ 0.40000, 0.84467}, { 0.52151, 0.88286}, { 0.52000, 0.88739}, { 0.51748, 0.89429}, { 0.47580, 1.02000},
+{ 0.25979, 1.02571}, { 1.11429, 1.02285}, { 1.30286, 1.02307}, { 0.46857, 1.02680},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_77 [] = {
 { 3,10,15}, { 5, 6, 9}, { 6, 5, 2}, { 1,11,10}, { 4, 8, 1}, { 1, 7,11}, { 9,16, 8},
@@ -815,9 +815,9 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_77 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_78 [] = {
-{ 0.26286f,-0.07186f}, { 0.39429f,-0.07186f}, { 0.98286f,-0.07295f}, { 1.12571f,-0.06878f}, { 0.98286f, 0.17231f},
-{ 0.72045f, 0.31143f}, { 0.71678f, 0.31714f}, { 0.72000f, 0.31207f}, { 0.40000f, 0.78092f}, { 0.99122f, 1.02571f},
-{ 1.12571f, 1.02307f}, { 0.26286f, 1.02615f}, { 0.40571f, 1.02644f}, { 1.12000f, 1.02723f},
+{ 0.26286,-0.07186}, { 0.39429,-0.07186}, { 0.98286,-0.07295}, { 1.12571,-0.06878}, { 0.98286, 0.17231},
+{ 0.72045, 0.31143}, { 0.71678, 0.31714}, { 0.72000, 0.31207}, { 0.40000, 0.78092}, { 0.99122, 1.02571},
+{ 1.12571, 1.02307}, { 0.26286, 1.02615}, { 0.40571, 1.02644}, { 1.12000, 1.02723},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_78 [] = {
 { 0, 8,11}, { 8, 0, 1}, { 4, 3, 9}, { 3, 4, 2}, { 4, 5, 2}, { 6, 7, 5}, {12, 6, 4},
@@ -825,19 +825,19 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_78 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_79 [] = {
-{ 0.70286f,-0.08966f}, { 0.77714f,-0.08966f}, { 0.61143f,-0.07605f}, { 0.89714f,-0.06823f}, { 0.97143f,-0.04073f},
-{ 0.49143f,-0.03229f}, { 1.05650f, 0.00857f}, { 0.42286f, 0.01107f}, { 0.70857f, 0.03605f}, { 0.77143f, 0.03605f},
-{ 0.63429f, 0.04899f}, { 0.84571f, 0.04899f}, { 1.12725f, 0.07143f}, { 0.35044f, 0.07714f}, { 0.92716f, 0.08286f},
-{ 0.54857f, 0.08535f}, { 0.49143f, 0.12704f}, { 1.17465f, 0.13429f}, { 1.01296f, 0.15143f}, { 0.28571f, 0.17016f},
-{ 0.43955f, 0.18571f}, { 1.21184f, 0.20286f}, { 0.40784f, 0.23714f}, { 1.08086f, 0.26000f}, { 1.24613f, 0.30000f},
-{ 0.23109f, 0.31143f}, { 1.10665f, 0.34571f}, { 0.36764f, 0.36857f}, { 0.21295f, 0.43143f}, { 1.11848f, 0.43714f},
-{ 1.26705f, 0.43714f}, { 0.36193f, 0.51143f}, { 1.11848f, 0.51714f}, { 0.21563f, 0.54571f}, { 0.36991f, 0.59143f},
-{ 1.25522f, 0.61429f}, { 1.09966f, 0.63714f}, { 0.23236f, 0.64857f}, { 1.23681f, 0.68857f}, { 1.07070f, 0.71714f},
-{ 0.41143f, 0.73016f}, { 0.26645f, 0.75143f}, { 1.20486f, 0.76857f}, { 0.45561f, 0.79714f}, { 1.02286f, 0.79270f},
-{ 0.98857f, 0.82956f}, { 0.31429f, 0.83650f}, { 1.16045f, 0.84286f}, { 0.53143f, 0.86150f}, { 0.92000f, 0.87800f},
-{ 0.35582f, 0.88857f}, { 0.63429f, 0.90764f}, { 0.85143f, 0.90613f}, { 1.10286f, 0.90956f}, { 0.71429f, 0.92134f},
-{ 0.79429f, 0.91866f}, { 0.43493f, 0.95714f}, { 1.04000f, 0.95964f}, { 0.52000f, 1.00498f}, { 0.96000f, 1.00327f},
-{ 0.89714f, 1.02613f}, { 0.63429f, 1.03866f}, { 0.77714f, 1.04705f},
+{ 0.70286,-0.08966}, { 0.77714,-0.08966}, { 0.61143,-0.07605}, { 0.89714,-0.06823}, { 0.97143,-0.04073},
+{ 0.49143,-0.03229}, { 1.05650, 0.00857}, { 0.42286, 0.01107}, { 0.70857, 0.03605}, { 0.77143, 0.03605},
+{ 0.63429, 0.04899}, { 0.84571, 0.04899}, { 1.12725, 0.07143}, { 0.35044, 0.07714}, { 0.92716, 0.08286},
+{ 0.54857, 0.08535}, { 0.49143, 0.12704}, { 1.17465, 0.13429}, { 1.01296, 0.15143}, { 0.28571, 0.17016},
+{ 0.43955, 0.18571}, { 1.21184, 0.20286}, { 0.40784, 0.23714}, { 1.08086, 0.26000}, { 1.24613, 0.30000},
+{ 0.23109, 0.31143}, { 1.10665, 0.34571}, { 0.36764, 0.36857}, { 0.21295, 0.43143}, { 1.11848, 0.43714},
+{ 1.26705, 0.43714}, { 0.36193, 0.51143}, { 1.11848, 0.51714}, { 0.21563, 0.54571}, { 0.36991, 0.59143},
+{ 1.25522, 0.61429}, { 1.09966, 0.63714}, { 0.23236, 0.64857}, { 1.23681, 0.68857}, { 1.07070, 0.71714},
+{ 0.41143, 0.73016}, { 0.26645, 0.75143}, { 1.20486, 0.76857}, { 0.45561, 0.79714}, { 1.02286, 0.79270},
+{ 0.98857, 0.82956}, { 0.31429, 0.83650}, { 1.16045, 0.84286}, { 0.53143, 0.86150}, { 0.92000, 0.87800},
+{ 0.35582, 0.88857}, { 0.63429, 0.90764}, { 0.85143, 0.90613}, { 1.10286, 0.90956}, { 0.71429, 0.92134},
+{ 0.79429, 0.91866}, { 0.43493, 0.95714}, { 1.04000, 0.95964}, { 0.52000, 1.00498}, { 0.96000, 1.00327},
+{ 0.89714, 1.02613}, { 0.63429, 1.03866}, { 0.77714, 1.04705},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_79 [] = {
 { 0, 8, 2}, { 1, 9, 0}, { 8,10, 2}, { 2,10, 5}, { 9, 1,11}, { 5,16, 7}, {11, 3,14},
@@ -852,13 +852,13 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_79 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_80 [] = {
-{ 0.26286f,-0.07186f}, { 0.40000f,-0.07186f}, { 0.40420f, 0.36857f}, { 0.41143f, 0.37580f}, { 0.73714f, 0.37621f},
-{ 0.88571f, 0.40034f}, { 0.98343f, 0.44857f}, { 0.41143f, 0.50420f}, { 0.72571f, 0.50420f}, { 0.40420f, 0.51143f},
-{ 1.04045f, 0.51143f}, { 0.82947f, 0.52286f}, { 0.88571f, 0.55296f}, { 0.91678f, 0.58571f}, { 1.08252f, 0.59714f},
-{ 0.93966f, 0.63143f}, { 1.09866f, 0.68286f}, { 0.94966f, 0.72857f}, { 0.93355f, 0.79143f}, { 1.08530f, 0.80857f},
-{ 0.90857f, 0.83270f}, { 0.86857f, 0.86893f}, { 1.05927f, 0.87143f}, { 0.40528f, 0.89429f}, { 0.82286f, 0.88899f},
-{ 0.74857f, 0.89807f}, { 1.02439f, 0.92286f}, { 0.96000f, 0.97641f}, { 0.89143f, 1.00538f}, { 0.26286f, 1.02615f},
-{ 0.74286f, 1.02680f},
+{ 0.26286,-0.07186}, { 0.40000,-0.07186}, { 0.40420, 0.36857}, { 0.41143, 0.37580}, { 0.73714, 0.37621},
+{ 0.88571, 0.40034}, { 0.98343, 0.44857}, { 0.41143, 0.50420}, { 0.72571, 0.50420}, { 0.40420, 0.51143},
+{ 1.04045, 0.51143}, { 0.82947, 0.52286}, { 0.88571, 0.55296}, { 0.91678, 0.58571}, { 1.08252, 0.59714},
+{ 0.93966, 0.63143}, { 1.09866, 0.68286}, { 0.94966, 0.72857}, { 0.93355, 0.79143}, { 1.08530, 0.80857},
+{ 0.90857, 0.83270}, { 0.86857, 0.86893}, { 1.05927, 0.87143}, { 0.40528, 0.89429}, { 0.82286, 0.88899},
+{ 0.74857, 0.89807}, { 1.02439, 0.92286}, { 0.96000, 0.97641}, { 0.89143, 1.00538}, { 0.26286, 1.02615},
+{ 0.74286, 1.02680},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_80 [] = {
 { 0, 9,29}, { 0, 2, 9}, { 2, 7, 9}, { 7, 3, 8}, {12,11, 5}, { 5,11, 4}, { 4, 8, 3},
@@ -869,20 +869,20 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_80 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_81 [] = {
-{ 1.23429f,-0.15444f}, { 1.13714f,-0.11188f}, { 0.76571f,-0.09009f}, { 0.64571f,-0.08437f}, { 0.84000f,-0.08034f},
-{ 0.58286f,-0.07034f}, { 1.27640f,-0.06000f}, { 0.93143f,-0.05470f}, { 0.46857f,-0.02322f}, { 1.00000f,-0.02293f},
-{ 0.38857f, 0.03330f}, { 0.76000f, 0.03563f}, { 0.68000f, 0.03866f}, { 0.83547f, 0.04857f}, { 1.09814f, 0.04857f},
-{ 0.61714f, 0.05177f}, { 0.87591f, 0.06571f}, { 0.55429f, 0.07800f}, { 0.80000f, 0.10784f}, { 0.49143f, 0.12132f},
-{ 0.30857f, 0.12350f}, { 0.74115f, 0.12857f}, { 0.98286f, 0.13189f}, { 1.17355f, 0.14571f}, { 0.42857f, 0.19207f},
-{ 0.86857f, 0.19927f}, { 0.26286f, 0.20486f}, { 1.05355f, 0.22000f}, { 0.77714f, 0.23134f}, { 0.39277f, 0.26000f},
-{ 1.23177f, 0.27714f}, { 0.23387f, 0.28286f}, { 1.08823f, 0.30571f}, { 0.36420f, 0.36286f}, { 0.20991f, 0.40286f},
-{ 0.35580f, 0.43714f}, { 1.25866f, 0.43714f}, { 1.11009f, 0.44286f}, { 0.20723f, 0.51714f}, { 1.25252f, 0.58000f},
-{ 0.36420f, 0.59714f}, { 1.09823f, 0.60857f}, { 0.23470f, 0.67714f}, { 0.38857f, 0.68947f}, { 1.21184f, 0.73429f},
-{ 1.05143f, 0.73841f}, { 0.42902f, 0.76857f}, { 0.28821f, 0.80286f}, { 1.00571f, 0.80413f}, { 1.17188f, 0.81429f},
-{ 0.96000f, 0.84670f}, { 0.51429f, 0.85473f}, { 0.34473f, 0.88286f}, { 1.12000f, 0.88413f}, { 0.57714f, 0.89070f},
-{ 0.88571f, 0.89070f}, { 0.64571f, 0.91252f}, { 0.76571f, 0.92093f}, { 0.42857f, 0.95759f}, { 1.03429f, 0.95864f},
-{ 0.50286f, 0.99927f}, { 0.96571f, 0.99800f}, { 0.60000f, 1.03252f}, { 0.86857f, 1.03184f}, { 0.69714f, 1.04705f},
-{ 0.77143f, 1.04665f},
+{ 1.23429,-0.15444}, { 1.13714,-0.11188}, { 0.76571,-0.09009}, { 0.64571,-0.08437}, { 0.84000,-0.08034},
+{ 0.58286,-0.07034}, { 1.27640,-0.06000}, { 0.93143,-0.05470}, { 0.46857,-0.02322}, { 1.00000,-0.02293},
+{ 0.38857, 0.03330}, { 0.76000, 0.03563}, { 0.68000, 0.03866}, { 0.83547, 0.04857}, { 1.09814, 0.04857},
+{ 0.61714, 0.05177}, { 0.87591, 0.06571}, { 0.55429, 0.07800}, { 0.80000, 0.10784}, { 0.49143, 0.12132},
+{ 0.30857, 0.12350}, { 0.74115, 0.12857}, { 0.98286, 0.13189}, { 1.17355, 0.14571}, { 0.42857, 0.19207},
+{ 0.86857, 0.19927}, { 0.26286, 0.20486}, { 1.05355, 0.22000}, { 0.77714, 0.23134}, { 0.39277, 0.26000},
+{ 1.23177, 0.27714}, { 0.23387, 0.28286}, { 1.08823, 0.30571}, { 0.36420, 0.36286}, { 0.20991, 0.40286},
+{ 0.35580, 0.43714}, { 1.25866, 0.43714}, { 1.11009, 0.44286}, { 0.20723, 0.51714}, { 1.25252, 0.58000},
+{ 0.36420, 0.59714}, { 1.09823, 0.60857}, { 0.23470, 0.67714}, { 0.38857, 0.68947}, { 1.21184, 0.73429},
+{ 1.05143, 0.73841}, { 0.42902, 0.76857}, { 0.28821, 0.80286}, { 1.00571, 0.80413}, { 1.17188, 0.81429},
+{ 0.96000, 0.84670}, { 0.51429, 0.85473}, { 0.34473, 0.88286}, { 1.12000, 0.88413}, { 0.57714, 0.89070},
+{ 0.88571, 0.89070}, { 0.64571, 0.91252}, { 0.76571, 0.92093}, { 0.42857, 0.95759}, { 1.03429, 0.95864},
+{ 0.50286, 0.99927}, { 0.96571, 0.99800}, { 0.60000, 1.03252}, { 0.86857, 1.03184}, { 0.69714, 1.04705},
+{ 0.77143, 1.04665},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_81 [] = {
 { 0, 6, 1}, {13, 7,16}, {14, 9, 1}, { 9,16, 7}, { 3,15, 5}, {16, 9,14}, {11, 4,13},
@@ -898,16 +898,16 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_81 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_82 [] = {
-{ 0.26857f,-0.07186f}, { 0.40571f,-0.07186f}, { 1.05143f,-0.07215f}, { 1.22359f,-0.07143f}, { 1.22535f,-0.06571f},
-{ 1.17465f, 0.01429f}, { 1.17143f, 0.01936f}, { 1.17098f, 0.02000f}, { 0.84571f, 0.24343f}, { 1.00571f, 0.27650f},
-{ 0.76571f, 0.34698f}, { 0.91832f, 0.37429f}, { 0.73143f, 0.37678f}, { 0.40991f, 0.40857f}, { 0.68000f, 0.40437f},
-{ 0.41714f, 0.41580f}, { 0.62286f, 0.41538f}, { 0.84226f, 0.42571f}, { 0.92571f, 0.44706f}, { 0.99429f, 0.47502f},
-{ 1.07582f, 0.54000f}, { 0.41714f, 0.54420f}, { 0.40991f, 0.55143f}, { 0.80000f, 0.54764f}, { 0.88000f, 0.56538f},
-{ 1.11641f, 0.60286f}, { 0.94286f, 0.60439f}, { 0.96784f, 0.63714f}, { 1.13823f, 0.67714f}, { 0.98966f, 0.69429f},
-{ 0.99277f, 0.74571f}, { 1.14134f, 0.75143f}, { 0.97143f, 0.81493f}, { 1.12823f, 0.82000f}, { 0.93143f, 0.86115f},
-{ 1.10498f, 0.87714f}, { 0.89143f, 0.88498f}, { 0.40991f, 0.90000f}, { 0.41714f, 0.90723f}, { 0.78857f, 0.90723f},
-{ 1.07011f, 0.92857f}, { 1.01714f, 0.97579f}, { 0.97143f, 0.99865f}, { 0.87429f, 1.02109f}, { 0.26857f, 1.02615f},
-{ 0.80571f, 1.02723f},
+{ 0.26857,-0.07186}, { 0.40571,-0.07186}, { 1.05143,-0.07215}, { 1.22359,-0.07143}, { 1.22535,-0.06571},
+{ 1.17465, 0.01429}, { 1.17143, 0.01936}, { 1.17098, 0.02000}, { 0.84571, 0.24343}, { 1.00571, 0.27650},
+{ 0.76571, 0.34698}, { 0.91832, 0.37429}, { 0.73143, 0.37678}, { 0.40991, 0.40857}, { 0.68000, 0.40437},
+{ 0.41714, 0.41580}, { 0.62286, 0.41538}, { 0.84226, 0.42571}, { 0.92571, 0.44706}, { 0.99429, 0.47502},
+{ 1.07582, 0.54000}, { 0.41714, 0.54420}, { 0.40991, 0.55143}, { 0.80000, 0.54764}, { 0.88000, 0.56538},
+{ 1.11641, 0.60286}, { 0.94286, 0.60439}, { 0.96784, 0.63714}, { 1.13823, 0.67714}, { 0.98966, 0.69429},
+{ 0.99277, 0.74571}, { 1.14134, 0.75143}, { 0.97143, 0.81493}, { 1.12823, 0.82000}, { 0.93143, 0.86115},
+{ 1.10498, 0.87714}, { 0.89143, 0.88498}, { 0.40991, 0.90000}, { 0.41714, 0.90723}, { 0.78857, 0.90723},
+{ 1.07011, 0.92857}, { 1.01714, 0.97579}, { 0.97143, 0.99865}, { 0.87429, 1.02109}, { 0.26857, 1.02615},
+{ 0.80571, 1.02723},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_82 [] = {
 { 2, 9, 8}, { 3, 5, 2}, { 0,37,44}, { 5, 7, 2}, { 5, 6, 7}, { 3, 4, 5}, { 2, 7, 9},
@@ -920,20 +920,20 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_82 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_83 [] = {
-{ 0.71429f,-0.08966f}, { 0.53714f,-0.07866f}, { 0.82286f,-0.07101f}, { 0.46286f,-0.05959f}, { 0.38857f,-0.02616f},
-{ 0.94286f,-0.01678f}, { 0.33714f, 0.01044f}, { 0.64000f, 0.03866f}, { 0.73143f, 0.04177f}, { 1.00571f, 0.03883f},
-{ 0.56000f, 0.05177f}, { 0.28527f, 0.06571f}, { 0.50857f, 0.06930f}, { 0.83587f, 0.07143f}, { 1.04086f, 0.08857f},
-{ 0.88127f, 0.10000f}, { 0.43429f, 0.11330f}, { 0.24486f, 0.13429f}, { 0.92613f, 0.15714f}, { 1.07177f, 0.16286f},
-{ 0.38771f, 0.16857f}, { 0.94134f, 0.21429f}, { 0.36319f, 0.22571f}, { 0.21563f, 0.23714f}, { 1.08109f, 0.26571f},
-{ 0.21403f, 0.27714f}, { 0.93294f, 0.27714f}, { 0.34857f, 0.28916f}, { 0.91011f, 0.31714f}, { 1.06816f, 0.32857f},
-{ 0.84000f, 0.36943f}, { 1.04486f, 0.38000f}, { 0.76571f, 0.39673f}, { 0.98286f, 0.45241f}, { 0.53143f, 0.45748f},
-{ 0.42857f, 0.49343f}, { 0.92571f, 0.49070f}, { 0.37143f, 0.52535f}, { 0.82857f, 0.53109f}, { 0.31044f, 0.58000f},
-{ 0.53143f, 0.60899f}, { 0.43429f, 0.65616f}, { 0.26244f, 0.67143f}, { 0.39891f, 0.71143f}, { 0.90857f, 0.71084f},
-{ 0.25295f, 0.72286f}, { 1.04615f, 0.72286f}, { 0.39320f, 0.76857f}, { 0.40359f, 0.80857f}, { 1.03109f, 0.81429f},
-{ 0.26327f, 0.82000f}, { 0.87429f, 0.81493f}, { 0.45143f, 0.86956f}, { 0.82286f, 0.87258f}, { 0.28930f, 0.88286f},
-{ 0.98812f, 0.90000f}, { 0.50857f, 0.90041f}, { 0.76571f, 0.90151f}, { 0.57714f, 0.91563f}, { 0.67429f, 0.91866f},
-{ 0.95443f, 0.94000f}, { 0.35429f, 0.96099f}, { 0.89143f, 0.98784f}, { 0.40000f, 0.99188f}, { 0.83429f, 1.01470f},
-{ 0.50286f, 1.03184f}, { 0.74857f, 1.03823f}, { 0.57143f, 1.04437f}, { 0.67429f, 1.04705f},
+{ 0.71429,-0.08966}, { 0.53714,-0.07866}, { 0.82286,-0.07101}, { 0.46286,-0.05959}, { 0.38857,-0.02616},
+{ 0.94286,-0.01678}, { 0.33714, 0.01044}, { 0.64000, 0.03866}, { 0.73143, 0.04177}, { 1.00571, 0.03883},
+{ 0.56000, 0.05177}, { 0.28527, 0.06571}, { 0.50857, 0.06930}, { 0.83587, 0.07143}, { 1.04086, 0.08857},
+{ 0.88127, 0.10000}, { 0.43429, 0.11330}, { 0.24486, 0.13429}, { 0.92613, 0.15714}, { 1.07177, 0.16286},
+{ 0.38771, 0.16857}, { 0.94134, 0.21429}, { 0.36319, 0.22571}, { 0.21563, 0.23714}, { 1.08109, 0.26571},
+{ 0.21403, 0.27714}, { 0.93294, 0.27714}, { 0.34857, 0.28916}, { 0.91011, 0.31714}, { 1.06816, 0.32857},
+{ 0.84000, 0.36943}, { 1.04486, 0.38000}, { 0.76571, 0.39673}, { 0.98286, 0.45241}, { 0.53143, 0.45748},
+{ 0.42857, 0.49343}, { 0.92571, 0.49070}, { 0.37143, 0.52535}, { 0.82857, 0.53109}, { 0.31044, 0.58000},
+{ 0.53143, 0.60899}, { 0.43429, 0.65616}, { 0.26244, 0.67143}, { 0.39891, 0.71143}, { 0.90857, 0.71084},
+{ 0.25295, 0.72286}, { 1.04615, 0.72286}, { 0.39320, 0.76857}, { 0.40359, 0.80857}, { 1.03109, 0.81429},
+{ 0.26327, 0.82000}, { 0.87429, 0.81493}, { 0.45143, 0.86956}, { 0.82286, 0.87258}, { 0.28930, 0.88286},
+{ 0.98812, 0.90000}, { 0.50857, 0.90041}, { 0.76571, 0.90151}, { 0.57714, 0.91563}, { 0.67429, 0.91866},
+{ 0.95443, 0.94000}, { 0.35429, 0.96099}, { 0.89143, 0.98784}, { 0.40000, 0.99188}, { 0.83429, 1.01470},
+{ 0.50286, 1.03184}, { 0.74857, 1.03823}, { 0.57143, 1.04437}, { 0.67429, 1.04705},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_83 [] = {
 { 2, 8, 0}, { 0, 7, 1}, { 6, 4,16}, { 6,16,11}, { 0, 8, 7}, { 7,10, 1}, { 8, 2,13},
@@ -949,21 +949,21 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_83 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_84 [] = {
-{ 0.54286f,-0.07186f}, { 0.68000f,-0.07186f}, { 0.53757f, 0.89429f}, { 0.68528f, 0.89429f}, { 0.17714f, 0.90265f},
-{ 1.04571f, 0.90265f}, { 0.17979f, 1.02571f}, { 1.04571f, 1.02307f},
+{ 0.54286,-0.07186}, { 0.68000,-0.07186}, { 0.53757, 0.89429}, { 0.68528, 0.89429}, { 0.17714, 0.90265},
+{ 1.04571, 0.90265}, { 0.17979, 1.02571}, { 1.04571, 1.02307},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_84 [] = {
 { 0, 3, 2}, { 3, 0, 1}, { 6, 4, 2}, { 6, 3, 7}, { 6, 2, 3}, { 3, 5, 7},
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_85 [] = {
-{ 0.65714f,-0.09009f}, { 0.77143f,-0.08705f}, { 0.53143f,-0.07034f}, { 0.85714f,-0.07101f}, { 0.47429f,-0.05070f},
-{ 0.94286f,-0.03629f}, { 0.38286f, 0.00704f}, { 1.02286f, 0.02445f}, { 0.65714f, 0.04437f}, { 0.78857f, 0.05320f},
-{ 0.33669f, 0.06000f}, { 0.58286f, 0.05748f}, { 0.84000f, 0.06823f}, { 0.52000f, 0.08535f}, { 1.07070f, 0.08857f},
-{ 0.89714f, 0.10154f}, { 0.46857f, 0.13025f}, { 1.09966f, 0.15714f}, { 0.29143f, 0.15866f}, { 0.94899f, 0.17429f},
-{ 0.43177f, 0.19714f}, { 0.27320f, 0.24286f}, { 0.97252f, 0.26000f}, { 1.12680f, 0.33429f}, { 0.26437f, 0.34000f},
-{ 0.40991f, 0.34000f}, { 0.98134f, 0.34571f}, { 0.98550f, 1.02571f}, { 1.12571f, 1.02307f}, { 0.26857f, 1.02615f},
-{ 0.40571f, 1.02615f}, { 1.12000f, 1.02723f},
+{ 0.65714,-0.09009}, { 0.77143,-0.08705}, { 0.53143,-0.07034}, { 0.85714,-0.07101}, { 0.47429,-0.05070},
+{ 0.94286,-0.03629}, { 0.38286, 0.00704}, { 1.02286, 0.02445}, { 0.65714, 0.04437}, { 0.78857, 0.05320},
+{ 0.33669, 0.06000}, { 0.58286, 0.05748}, { 0.84000, 0.06823}, { 0.52000, 0.08535}, { 1.07070, 0.08857},
+{ 0.89714, 0.10154}, { 0.46857, 0.13025}, { 1.09966, 0.15714}, { 0.29143, 0.15866}, { 0.94899, 0.17429},
+{ 0.43177, 0.19714}, { 0.27320, 0.24286}, { 0.97252, 0.26000}, { 1.12680, 0.33429}, { 0.26437, 0.34000},
+{ 0.40991, 0.34000}, { 0.98134, 0.34571}, { 0.98550, 1.02571}, { 1.12571, 1.02307}, { 0.26857, 1.02615},
+{ 0.40571, 1.02615}, { 1.12000, 1.02723},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_85 [] = {
 { 3, 9, 1}, {10,20,18}, { 8, 0, 1}, { 0,11, 2}, { 7,15, 5}, { 0, 8,11}, { 8, 1, 9},
@@ -974,17 +974,17 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_85 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_86 [] = {
-{ 0.57714f,-0.07025f}, { 0.72571f,-0.06947f}, { 0.64571f, 0.06079f}, { 0.65143f, 0.06062f}, { 0.15429f, 1.02560f},
-{ 0.30286f, 1.02531f}, { 1.00571f, 1.02531f}, { 1.14857f, 1.02560f},
+{ 0.57714,-0.07025}, { 0.72571,-0.06947}, { 0.64571, 0.06079}, { 0.65143, 0.06062}, { 0.15429, 1.02560},
+{ 0.30286, 1.02531}, { 1.00571, 1.02531}, { 1.14857, 1.02560},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_86 [] = {
 { 0, 2, 4}, { 3, 2, 0}, { 3, 7, 6}, { 1, 3, 0}, { 3, 1, 7}, { 2, 5, 4},
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_87 [] = {
-{ 0.45143f,-0.07186f}, { 0.60000f,-0.07017f}, { 1.13143f,-0.06912f}, { 1.27429f,-0.06912f}, { 0.52571f, 0.09707f},
-{ 1.20000f, 0.09787f}, { 1.13673f, 0.38000f}, { 0.86857f, 0.88103f}, { 0.16571f, 1.02562f}, { 0.78286f, 1.02446f},
-{ 1.42857f, 1.02446f}, { 1.56806f, 1.02571f}, { 0.30857f, 1.02615f}, { 0.95429f, 1.02615f},
+{ 0.45143,-0.07186}, { 0.60000,-0.07017}, { 1.13143,-0.06912}, { 1.27429,-0.06912}, { 0.52571, 0.09707},
+{ 1.20000, 0.09787}, { 1.13673, 0.38000}, { 0.86857, 0.88103}, { 0.16571, 1.02562}, { 0.78286, 1.02446},
+{ 1.42857, 1.02446}, { 1.56806, 1.02571}, { 0.30857, 1.02615}, { 0.95429, 1.02615},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_87 [] = {
 { 2, 6, 7}, { 6, 2, 5}, { 1, 4, 0}, { 7, 9, 4}, {11,10, 5}, { 3, 5, 2}, { 8, 0, 4},
@@ -992,9 +992,9 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_87 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_88 [] = {
-{ 0.15194f,-0.07143f}, { 1.14117f,-0.07143f}, { 0.32000f,-0.07106f}, { 0.97143f,-0.07140f}, { 0.65143f, 0.37795f},
-{ 0.74607f, 0.49429f}, { 0.56517f, 0.50000f}, { 0.74286f, 0.49909f}, { 0.74219f, 0.50000f}, { 0.65714f, 0.61727f},
-{ 0.20016f, 1.02571f}, { 0.96000f, 1.02568f}, { 1.11260f, 1.02571f}, { 0.36571f, 1.02644f},
+{ 0.15194,-0.07143}, { 1.14117,-0.07143}, { 0.32000,-0.07106}, { 0.97143,-0.07140}, { 0.65143, 0.37795},
+{ 0.74607, 0.49429}, { 0.56517, 0.50000}, { 0.74286, 0.49909}, { 0.74219, 0.50000}, { 0.65714, 0.61727},
+{ 0.20016, 1.02571}, { 0.96000, 1.02568}, { 1.11260, 1.02571}, { 0.36571, 1.02644},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_88 [] = {
 { 0, 2, 6}, { 3, 5, 4}, { 5, 6, 4}, { 5, 8, 6}, { 5, 3, 1}, { 5, 7, 8}, { 4, 6, 2},
@@ -1002,9 +1002,9 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_88 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_89 [] = {
-{ 0.71164f,-0.07143f}, { 0.57143f,-0.06878f}, { 0.56891f, 0.39143f}, { 0.71787f, 0.39714f}, { 0.65143f, 0.51441f},
-{ 0.43179f, 0.85429f}, { 0.42857f, 0.85936f}, { 0.42812f, 0.86000f}, { 0.15284f, 1.02571f}, { 0.32000f, 1.02535f},
-{ 0.98286f, 1.02464f}, { 1.14521f, 1.02571f},
+{ 0.71164,-0.07143}, { 0.57143,-0.06878}, { 0.56891, 0.39143}, { 0.71787, 0.39714}, { 0.65143, 0.51441},
+{ 0.43179, 0.85429}, { 0.42857, 0.85936}, { 0.42812, 0.86000}, { 0.15284, 1.02571}, { 0.32000, 1.02535},
+{ 0.98286, 1.02464}, { 1.14521, 1.02571},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_89 [] = {
 { 3, 2, 1}, { 3, 1, 0}, { 4, 2, 3}, { 2, 9, 8}, {11,10, 4}, { 5, 2, 4}, { 5, 6, 7},
@@ -1012,9 +1012,9 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_89 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_90 [] = {
-{ 0.17714f,-0.07186f}, { 1.04000f,-0.06878f}, { 1.04000f, 0.05164f}, { 0.17395f, 0.06000f}, { 0.34602f, 0.06000f},
-{ 0.84777f, 0.89429f}, { 0.24000f, 0.89957f}, { 1.02395f, 0.90000f}, { 0.23580f, 1.02000f}, { 1.02286f, 1.02307f},
-{ 0.24000f, 1.02615f},
+{ 0.17714,-0.07186}, { 1.04000,-0.06878}, { 1.04000, 0.05164}, { 0.17395, 0.06000}, { 0.34602, 0.06000},
+{ 0.84777, 0.89429}, { 0.24000, 0.89957}, { 1.02395, 0.90000}, { 0.23580, 1.02000}, { 1.02286, 1.02307},
+{ 0.24000, 1.02615},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_90 [] = {
 { 0, 4, 3}, { 1, 4, 0}, { 1, 2, 4}, { 3, 4, 5}, { 5, 7, 9}, { 4, 7, 5}, { 5,10, 6},
@@ -1022,32 +1022,32 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_90 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_91 [] = {
-{ 0.24528f,-0.37429f}, { 0.54025f,-0.37429f}, { 0.54025f,-0.27143f}, { 0.38227f,-0.26571f}, { 0.38286f, 0.91454f},
-{ 0.54134f, 0.92286f}, { 0.24836f, 1.02571f}, { 0.53714f, 1.02615f},
+{ 0.24528,-0.37429}, { 0.54025,-0.37429}, { 0.54025,-0.27143}, { 0.38227,-0.26571}, { 0.38286, 0.91454},
+{ 0.54134, 0.92286}, { 0.24836, 1.02571}, { 0.53714, 1.02615},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_91 [] = {
 { 0, 4, 6}, { 3, 1, 2}, { 1, 3, 0}, { 0, 3, 4}, { 5, 7, 4}, { 6, 4, 7},
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_92 [] = {
-{ 0.46286f,-0.09182f}, { 0.56000f,-0.09256f}, { 0.56469f,-0.08857f}, { 0.14713f, 1.04286f}, { 0.24571f, 1.04358f},
+{ 0.46286,-0.09182}, { 0.56000,-0.09256}, { 0.56469,-0.08857}, { 0.14713, 1.04286}, { 0.24571, 1.04358},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_92 [] = {
 { 0, 4, 3}, { 0, 2, 4}, { 0, 1, 2},
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_93 [] = {
-{ 0.17100f,-0.37429f}, { 0.46597f,-0.37429f}, { 0.17100f,-0.27143f}, { 0.32571f,-0.26723f}, { 0.33295f,-0.26000f},
-{ 0.33143f, 0.91201f}, { 0.17143f, 0.91979f}, { 0.16991f, 1.02000f}, { 0.46286f, 1.02615f},
+{ 0.17100,-0.37429}, { 0.46597,-0.37429}, { 0.17100,-0.27143}, { 0.32571,-0.26723}, { 0.33295,-0.26000},
+{ 0.33143, 0.91201}, { 0.17143, 0.91979}, { 0.16991, 1.02000}, { 0.46286, 1.02615},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_93 [] = {
 { 2, 0, 3}, { 1, 3, 0}, { 1, 4, 3}, { 5, 4, 1}, { 7, 6, 8}, { 5, 8, 6}, { 8, 5, 1},
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_94 [] = {
-{ 0.18389f, 0.44857f}, { 0.18857f, 0.44458f}, { 0.32000f, 0.44686f}, { 0.68571f, 0.44746f}, { 0.81143f, 0.44445f},
-{ 0.81700f, 0.44857f}, { 0.49714f, 0.88224f}, { 0.50286f, 0.88224f}, { 0.44571f, 1.04090f}, { 0.55429f, 1.04168f},
-{ 0.45143f, 1.04437f},
+{ 0.18389, 0.44857}, { 0.18857, 0.44458}, { 0.32000, 0.44686}, { 0.68571, 0.44746}, { 0.81143, 0.44445},
+{ 0.81700, 0.44857}, { 0.49714, 0.88224}, { 0.50286, 0.88224}, { 0.44571, 1.04090}, { 0.55429, 1.04168},
+{ 0.45143, 1.04437},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_94 [] = {
 { 0, 2, 6}, { 0, 6, 8}, { 7, 3, 5}, { 4, 5, 3}, { 2, 0, 1}, {10, 7, 9}, {10, 8, 6},
@@ -1055,16 +1055,16 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_94 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_95 [] = {
-{ 0.11957f,-0.37429f}, { 1.01186f,-0.37429f}, { 0.11957f,-0.28857f}, { 1.01186f,-0.28857f},
+{ 0.11957,-0.37429}, { 1.01186,-0.37429}, { 0.11957,-0.28857}, { 1.01186,-0.28857},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_95 [] = {
 { 2, 1, 3}, { 2, 0, 1},
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_96 [] = {
-{ 0.38857f, 0.82420f}, { 0.48000f, 0.82420f}, { 0.48403f, 0.82571f}, { 0.37714f, 0.82989f}, { 0.38286f, 0.82575f},
-{ 0.48657f, 0.83143f}, { 0.21296f, 1.02571f}, { 0.38771f, 1.02571f}, { 0.21412f, 1.03143f}, { 0.38286f, 1.03106f},
-{ 0.37714f, 1.03295f},
+{ 0.38857, 0.82420}, { 0.48000, 0.82420}, { 0.48403, 0.82571}, { 0.37714, 0.82989}, { 0.38286, 0.82575},
+{ 0.48657, 0.83143}, { 0.21296, 1.02571}, { 0.38771, 1.02571}, { 0.21412, 1.03143}, { 0.38286, 1.03106},
+{ 0.37714, 1.03295},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_96 [] = {
 { 5, 1, 2}, { 0, 3, 4}, { 3,10, 6}, { 0, 1, 5}, { 7, 3, 0}, { 8, 6,10}, { 7, 0, 5},
@@ -1072,20 +1072,20 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_96 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_97 [] = {
-{ 0.44000f,-0.09009f}, { 0.50286f,-0.08966f}, { 0.36571f,-0.07756f}, { 0.57143f,-0.07907f}, { 0.92716f,-0.07143f},
-{ 0.79429f,-0.07106f}, { 0.92930f,-0.06571f}, { 0.62857f,-0.06151f}, { 0.30857f,-0.05514f}, { 0.27429f,-0.03258f},
-{ 0.68000f,-0.03629f}, { 0.90748f,-0.00857f}, { 0.48000f, 0.01580f}, { 0.53143f, 0.01621f}, { 0.42768f, 0.02571f},
-{ 0.76571f, 0.02129f}, { 0.22073f, 0.03143f}, { 0.61804f, 0.03714f}, { 0.89866f, 0.03714f}, { 0.37130f, 0.06000f},
-{ 0.20613f, 0.06571f}, { 0.68000f, 0.07330f}, { 0.34538f, 0.10000f}, { 0.71429f, 0.10809f}, { 0.19580f, 0.11714f},
-{ 0.89295f, 0.13429f}, { 0.33907f, 0.15714f}, { 0.74538f, 0.16857f}, { 0.20319f, 0.19714f}, { 0.36000f, 0.20914f},
-{ 0.75580f, 0.22000f}, { 0.40000f, 0.24371f}, { 0.22812f, 0.25429f}, { 0.44571f, 0.26041f}, { 0.66286f, 0.29891f},
-{ 0.28000f, 0.31258f}, { 0.75848f, 0.31714f}, { 0.75429f, 0.32399f}, { 0.33714f, 0.34657f}, { 0.38857f, 0.36538f},
-{ 0.68571f, 0.41320f}, { 0.75772f, 0.43714f}, { 0.35289f, 0.48286f}, { 0.22093f, 0.50000f}, { 0.22857f, 0.49470f},
-{ 0.89252f, 0.50571f}, { 0.75580f, 0.51143f}, { 0.22857f, 0.53547f}, { 0.37800f, 0.54571f}, { 0.74286f, 0.55301f},
-{ 0.88680f, 0.56286f}, { 0.71429f, 0.58893f}, { 0.41714f, 0.59330f}, { 0.42228f, 0.59714f}, { 0.25800f, 0.60286f},
-{ 0.42286f, 0.59759f}, { 0.65143f, 0.61959f}, { 0.48000f, 0.62193f}, { 0.86498f, 0.62571f}, { 0.53143f, 0.62950f},
-{ 0.59429f, 0.62950f}, { 0.28187f, 0.63714f}, { 0.84571f, 0.65486f}, { 0.33714f, 0.68436f}, { 0.80571f, 0.69007f},
-{ 0.37915f, 0.70571f}, { 0.72571f, 0.72538f}, { 0.45714f, 0.72966f}, { 0.54286f, 0.74152f}, { 0.62286f, 0.74152f},
+{ 0.44000,-0.09009}, { 0.50286,-0.08966}, { 0.36571,-0.07756}, { 0.57143,-0.07907}, { 0.92716,-0.07143},
+{ 0.79429,-0.07106}, { 0.92930,-0.06571}, { 0.62857,-0.06151}, { 0.30857,-0.05514}, { 0.27429,-0.03258},
+{ 0.68000,-0.03629}, { 0.90748,-0.00857}, { 0.48000, 0.01580}, { 0.53143, 0.01621}, { 0.42768, 0.02571},
+{ 0.76571, 0.02129}, { 0.22073, 0.03143}, { 0.61804, 0.03714}, { 0.89866, 0.03714}, { 0.37130, 0.06000},
+{ 0.20613, 0.06571}, { 0.68000, 0.07330}, { 0.34538, 0.10000}, { 0.71429, 0.10809}, { 0.19580, 0.11714},
+{ 0.89295, 0.13429}, { 0.33907, 0.15714}, { 0.74538, 0.16857}, { 0.20319, 0.19714}, { 0.36000, 0.20914},
+{ 0.75580, 0.22000}, { 0.40000, 0.24371}, { 0.22812, 0.25429}, { 0.44571, 0.26041}, { 0.66286, 0.29891},
+{ 0.28000, 0.31258}, { 0.75848, 0.31714}, { 0.75429, 0.32399}, { 0.33714, 0.34657}, { 0.38857, 0.36538},
+{ 0.68571, 0.41320}, { 0.75772, 0.43714}, { 0.35289, 0.48286}, { 0.22093, 0.50000}, { 0.22857, 0.49470},
+{ 0.89252, 0.50571}, { 0.75580, 0.51143}, { 0.22857, 0.53547}, { 0.37800, 0.54571}, { 0.74286, 0.55301},
+{ 0.88680, 0.56286}, { 0.71429, 0.58893}, { 0.41714, 0.59330}, { 0.42228, 0.59714}, { 0.25800, 0.60286},
+{ 0.42286, 0.59759}, { 0.65143, 0.61959}, { 0.48000, 0.62193}, { 0.86498, 0.62571}, { 0.53143, 0.62950},
+{ 0.59429, 0.62950}, { 0.28187, 0.63714}, { 0.84571, 0.65486}, { 0.33714, 0.68436}, { 0.80571, 0.69007},
+{ 0.37915, 0.70571}, { 0.72571, 0.72538}, { 0.45714, 0.72966}, { 0.54286, 0.74152}, { 0.62286, 0.74152},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_97 [] = {
 { 3,13, 1}, { 5, 4,15}, { 4,11,15}, {19, 8, 2}, {13, 3, 7}, {13, 0, 1}, {14, 0,12},
@@ -1101,16 +1101,16 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_97 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_98 [] = {
-{ 0.61143f,-0.09009f}, { 0.50286f,-0.07823f}, { 0.36000f,-0.07186f}, { 0.24000f,-0.06878f}, { 0.72000f,-0.06213f},
-{ 0.45714f,-0.05914f}, { 0.77143f,-0.03188f}, { 0.36571f, 0.01806f}, { 0.59429f, 0.02193f}, { 0.83543f, 0.02571f},
-{ 0.52000f, 0.02823f}, { 0.66857f, 0.04645f}, { 0.46857f, 0.05179f}, { 0.42704f, 0.08857f}, { 0.72956f, 0.10000f},
-{ 0.88784f, 0.10571f}, { 0.39216f, 0.14000f}, { 0.75641f, 0.14000f}, { 0.91470f, 0.18000f}, { 0.37462f, 0.19143f},
-{ 0.78665f, 0.23714f}, { 0.36152f, 0.28857f}, { 0.93252f, 0.29429f}, { 0.79236f, 0.36857f}, { 0.93252f, 0.37429f},
-{ 0.36420f, 0.38000f}, { 0.77294f, 0.47714f}, { 0.39216f, 0.50000f}, { 0.90899f, 0.50000f}, { 0.42473f, 0.55143f},
-{ 0.73143f, 0.55546f}, { 0.88657f, 0.55714f}, { 0.45883f, 0.58571f}, { 0.67429f, 0.60498f}, { 0.50857f, 0.61641f},
-{ 0.63429f, 0.62252f}, { 0.56571f, 0.62991f}, { 0.37714f, 0.64118f}, { 0.83429f, 0.63841f}, { 0.37315f, 0.64857f},
-{ 0.80571f, 0.66686f}, { 0.74286f, 0.70784f}, { 0.46857f, 0.71355f}, { 0.68571f, 0.72899f}, { 0.56571f, 0.74109f},
-{ 0.61714f, 0.74152f}, { 0.24265f, 1.02571f}, { 0.37143f, 1.02307f}, { 0.36571f, 1.02723f},
+{ 0.61143,-0.09009}, { 0.50286,-0.07823}, { 0.36000,-0.07186}, { 0.24000,-0.06878}, { 0.72000,-0.06213},
+{ 0.45714,-0.05914}, { 0.77143,-0.03188}, { 0.36571, 0.01806}, { 0.59429, 0.02193}, { 0.83543, 0.02571},
+{ 0.52000, 0.02823}, { 0.66857, 0.04645}, { 0.46857, 0.05179}, { 0.42704, 0.08857}, { 0.72956, 0.10000},
+{ 0.88784, 0.10571}, { 0.39216, 0.14000}, { 0.75641, 0.14000}, { 0.91470, 0.18000}, { 0.37462, 0.19143},
+{ 0.78665, 0.23714}, { 0.36152, 0.28857}, { 0.93252, 0.29429}, { 0.79236, 0.36857}, { 0.93252, 0.37429},
+{ 0.36420, 0.38000}, { 0.77294, 0.47714}, { 0.39216, 0.50000}, { 0.90899, 0.50000}, { 0.42473, 0.55143},
+{ 0.73143, 0.55546}, { 0.88657, 0.55714}, { 0.45883, 0.58571}, { 0.67429, 0.60498}, { 0.50857, 0.61641},
+{ 0.63429, 0.62252}, { 0.56571, 0.62991}, { 0.37714, 0.64118}, { 0.83429, 0.63841}, { 0.37315, 0.64857},
+{ 0.80571, 0.66686}, { 0.74286, 0.70784}, { 0.46857, 0.71355}, { 0.68571, 0.72899}, { 0.56571, 0.74109},
+{ 0.61714, 0.74152}, { 0.24265, 1.02571}, { 0.37143, 1.02307}, { 0.36571, 1.02723},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_98 [] = {
 { 3,25,46}, { 5, 1,10}, { 5,12, 7}, { 8, 0, 4}, {11, 6,14}, {11, 4, 6}, { 0, 8, 1},
@@ -1123,18 +1123,18 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_98 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_99 [] = {
-{ 0.53143f,-0.08966f}, { 0.59429f,-0.08966f}, { 0.45714f,-0.07673f}, { 0.68000f,-0.07294f}, { 0.72571f,-0.05343f},
-{ 0.37714f,-0.04331f}, { 0.33714f,-0.01543f}, { 0.78857f,-0.01011f}, { 0.58286f, 0.02152f}, { 0.29143f, 0.03016f},
-{ 0.49625f, 0.03143f}, { 0.62857f, 0.03034f}, { 0.83107f, 0.03714f}, { 0.45714f, 0.04943f}, { 0.69270f, 0.06571f},
-{ 0.26241f, 0.07143f}, { 0.85714f, 0.07873f}, { 0.40457f, 0.09429f}, { 0.72722f, 0.10571f}, { 0.37629f, 0.14000f},
-{ 0.74437f, 0.14000f}, { 0.22899f, 0.14571f}, { 0.37184f, 0.15143f}, { 0.36930f, 0.15714f}, { 0.88571f, 0.15295f},
-{ 0.89406f, 0.19714f}, { 0.76571f, 0.21540f}, { 0.21034f, 0.22571f}, { 0.34705f, 0.25429f}, { 0.20420f, 0.36286f},
-{ 0.34478f, 0.36857f}, { 0.21673f, 0.45429f}, { 0.36252f, 0.47143f}, { 0.75429f, 0.47269f}, { 0.88058f, 0.48857f},
-{ 0.88319f, 0.49429f}, { 0.38371f, 0.52286f}, { 0.23849f, 0.52857f}, { 0.72000f, 0.55200f}, { 0.86437f, 0.55714f},
-{ 0.43025f, 0.58000f}, { 0.69714f, 0.58127f}, { 0.28527f, 0.61429f}, { 0.47429f, 0.60943f}, { 0.48571f, 0.61387f},
-{ 0.83473f, 0.61429f}, { 0.49143f, 0.61641f}, { 0.63429f, 0.62041f}, { 0.54857f, 0.62950f}, { 0.58857f, 0.62991f},
-{ 0.81296f, 0.64286f}, { 0.32168f, 0.65429f}, { 0.35429f, 0.67964f}, { 0.76571f, 0.68535f}, { 0.44571f, 0.72327f},
-{ 0.67429f, 0.72816f}, { 0.53714f, 0.74109f}, { 0.60000f, 0.74109f},
+{ 0.53143,-0.08966}, { 0.59429,-0.08966}, { 0.45714,-0.07673}, { 0.68000,-0.07294}, { 0.72571,-0.05343},
+{ 0.37714,-0.04331}, { 0.33714,-0.01543}, { 0.78857,-0.01011}, { 0.58286, 0.02152}, { 0.29143, 0.03016},
+{ 0.49625, 0.03143}, { 0.62857, 0.03034}, { 0.83107, 0.03714}, { 0.45714, 0.04943}, { 0.69270, 0.06571},
+{ 0.26241, 0.07143}, { 0.85714, 0.07873}, { 0.40457, 0.09429}, { 0.72722, 0.10571}, { 0.37629, 0.14000},
+{ 0.74437, 0.14000}, { 0.22899, 0.14571}, { 0.37184, 0.15143}, { 0.36930, 0.15714}, { 0.88571, 0.15295},
+{ 0.89406, 0.19714}, { 0.76571, 0.21540}, { 0.21034, 0.22571}, { 0.34705, 0.25429}, { 0.20420, 0.36286},
+{ 0.34478, 0.36857}, { 0.21673, 0.45429}, { 0.36252, 0.47143}, { 0.75429, 0.47269}, { 0.88058, 0.48857},
+{ 0.88319, 0.49429}, { 0.38371, 0.52286}, { 0.23849, 0.52857}, { 0.72000, 0.55200}, { 0.86437, 0.55714},
+{ 0.43025, 0.58000}, { 0.69714, 0.58127}, { 0.28527, 0.61429}, { 0.47429, 0.60943}, { 0.48571, 0.61387},
+{ 0.83473, 0.61429}, { 0.49143, 0.61641}, { 0.63429, 0.62041}, { 0.54857, 0.62950}, { 0.58857, 0.62991},
+{ 0.81296, 0.64286}, { 0.32168, 0.65429}, { 0.35429, 0.67964}, { 0.76571, 0.68535}, { 0.44571, 0.72327},
+{ 0.67429, 0.72816}, { 0.53714, 0.74109}, { 0.60000, 0.74109},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_99 [] = {
 { 2,13, 5}, { 0, 8, 2}, {11, 4,14}, { 1, 8, 0}, { 3,11, 1}, {15,23,21}, { 2,10,13},
@@ -1148,16 +1148,16 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_99 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_100 [] = {
-{ 0.51429f,-0.09009f}, { 0.56571f,-0.08966f}, { 0.62857f,-0.07673f}, { 0.76571f,-0.07186f}, { 0.88571f,-0.06878f},
-{ 0.41143f,-0.06486f}, { 0.67429f,-0.05641f}, { 0.36000f,-0.03669f}, { 0.30286f, 0.01025f}, { 0.76000f, 0.01806f},
-{ 0.53714f, 0.02152f}, { 0.49714f, 0.02891f}, { 0.60571f, 0.02891f}, { 0.68127f, 0.07143f}, { 0.41714f, 0.07561f},
-{ 0.23787f, 0.10571f}, { 0.71579f, 0.11143f}, { 0.38241f, 0.11714f}, { 0.74135f, 0.16286f}, { 0.21395f, 0.16857f},
-{ 0.74286f, 0.16739f}, { 0.74538f, 0.17429f}, { 0.34605f, 0.20286f}, { 0.76420f, 0.27714f}, { 0.19277f, 0.28857f},
-{ 0.33295f, 0.28857f}, { 0.19277f, 0.36286f}, { 0.76152f, 0.38571f}, { 0.33563f, 0.39714f}, { 0.73355f, 0.50000f},
-{ 0.22135f, 0.51143f}, { 0.36784f, 0.51714f}, { 0.69714f, 0.55841f}, { 0.42286f, 0.58686f}, { 0.26857f, 0.60793f},
-{ 0.63429f, 0.60943f}, { 0.48571f, 0.62151f}, { 0.56571f, 0.62950f}, { 0.74857f, 0.64048f}, { 0.75269f, 0.64857f},
-{ 0.30857f, 0.65582f}, { 0.65714f, 0.71355f}, { 0.40571f, 0.71756f}, { 0.50286f, 0.74109f}, { 0.55429f, 0.74152f},
-{ 0.75693f, 1.02571f}, { 0.88571f, 1.02307f}, { 0.88000f, 1.02723f},
+{ 0.51429,-0.09009}, { 0.56571,-0.08966}, { 0.62857,-0.07673}, { 0.76571,-0.07186}, { 0.88571,-0.06878},
+{ 0.41143,-0.06486}, { 0.67429,-0.05641}, { 0.36000,-0.03669}, { 0.30286, 0.01025}, { 0.76000, 0.01806},
+{ 0.53714, 0.02152}, { 0.49714, 0.02891}, { 0.60571, 0.02891}, { 0.68127, 0.07143}, { 0.41714, 0.07561},
+{ 0.23787, 0.10571}, { 0.71579, 0.11143}, { 0.38241, 0.11714}, { 0.74135, 0.16286}, { 0.21395, 0.16857},
+{ 0.74286, 0.16739}, { 0.74538, 0.17429}, { 0.34605, 0.20286}, { 0.76420, 0.27714}, { 0.19277, 0.28857},
+{ 0.33295, 0.28857}, { 0.19277, 0.36286}, { 0.76152, 0.38571}, { 0.33563, 0.39714}, { 0.73355, 0.50000},
+{ 0.22135, 0.51143}, { 0.36784, 0.51714}, { 0.69714, 0.55841}, { 0.42286, 0.58686}, { 0.26857, 0.60793},
+{ 0.63429, 0.60943}, { 0.48571, 0.62151}, { 0.56571, 0.62950}, { 0.74857, 0.64048}, { 0.75269, 0.64857},
+{ 0.30857, 0.65582}, { 0.65714, 0.71355}, { 0.40571, 0.71756}, { 0.50286, 0.74109}, { 0.55429, 0.74152},
+{ 0.75693, 1.02571}, { 0.88571, 1.02307}, { 0.88000, 1.02723},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_100 [] = {
 { 0,11, 5}, {12, 6,13}, { 1, 2,12}, { 7,14, 8}, {10, 0, 1}, {14, 7, 5}, {10, 1,12},
@@ -1170,19 +1170,19 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_100 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_101 [] = {
-{ 0.54857f,-0.09009f}, { 0.61143f,-0.09009f}, { 0.45714f,-0.07462f}, { 0.71429f,-0.07101f}, { 0.40571f,-0.05641f},
-{ 0.77714f,-0.04331f}, { 0.33714f,-0.01543f}, { 0.82857f,-0.00670f}, { 0.29714f, 0.02154f}, { 0.56000f, 0.02152f},
-{ 0.60571f, 0.02193f}, { 0.49714f, 0.03563f}, { 0.68159f, 0.04286f}, { 0.88150f, 0.05429f}, { 0.45714f, 0.05514f},
-{ 0.26286f, 0.06636f}, { 0.72000f, 0.06759f}, { 0.40457f, 0.10000f}, { 0.91216f, 0.11143f}, { 0.77229f, 0.13429f},
-{ 0.37057f, 0.15143f}, { 0.22034f, 0.15714f}, { 0.36613f, 0.16286f}, { 0.92834f, 0.16286f}, { 0.36359f, 0.16857f},
-{ 0.91429f, 0.16966f}, { 0.79429f, 0.18111f}, { 0.35177f, 0.20286f}, { 0.20462f, 0.22571f}, { 0.33866f, 0.28286f},
-{ 0.34286f, 0.28900f}, { 0.93454f, 0.29429f}, { 0.19848f, 0.35714f}, { 0.93295f, 0.39714f}, { 0.34857f, 0.40134f},
-{ 0.78857f, 0.40134f}, { 0.34134f, 0.40857f}, { 0.79580f, 0.40857f}, { 0.20462f, 0.41429f}, { 0.35429f, 0.47261f},
-{ 0.22327f, 0.49429f}, { 0.91429f, 0.48975f}, { 0.77143f, 0.50661f}, { 0.38857f, 0.54057f}, { 0.74857f, 0.54629f},
-{ 0.40725f, 0.56286f}, { 0.25714f, 0.57001f}, { 0.71429f, 0.58154f}, { 0.87070f, 0.58571f}, { 0.45143f, 0.59759f},
-{ 0.68000f, 0.60498f}, { 0.29296f, 0.62000f}, { 0.49143f, 0.61681f}, { 0.63429f, 0.62252f}, { 0.54857f, 0.62950f},
-{ 0.59429f, 0.62991f}, { 0.33311f, 0.66000f}, { 0.81143f, 0.65543f}, { 0.77143f, 0.68607f}, { 0.41143f, 0.70930f},
-{ 0.72000f, 0.71355f}, { 0.45714f, 0.72605f}, { 0.66857f, 0.73050f}, { 0.54286f, 0.74152f}, { 0.60000f, 0.74152f},
+{ 0.54857,-0.09009}, { 0.61143,-0.09009}, { 0.45714,-0.07462}, { 0.71429,-0.07101}, { 0.40571,-0.05641},
+{ 0.77714,-0.04331}, { 0.33714,-0.01543}, { 0.82857,-0.00670}, { 0.29714, 0.02154}, { 0.56000, 0.02152},
+{ 0.60571, 0.02193}, { 0.49714, 0.03563}, { 0.68159, 0.04286}, { 0.88150, 0.05429}, { 0.45714, 0.05514},
+{ 0.26286, 0.06636}, { 0.72000, 0.06759}, { 0.40457, 0.10000}, { 0.91216, 0.11143}, { 0.77229, 0.13429},
+{ 0.37057, 0.15143}, { 0.22034, 0.15714}, { 0.36613, 0.16286}, { 0.92834, 0.16286}, { 0.36359, 0.16857},
+{ 0.91429, 0.16966}, { 0.79429, 0.18111}, { 0.35177, 0.20286}, { 0.20462, 0.22571}, { 0.33866, 0.28286},
+{ 0.34286, 0.28900}, { 0.93454, 0.29429}, { 0.19848, 0.35714}, { 0.93295, 0.39714}, { 0.34857, 0.40134},
+{ 0.78857, 0.40134}, { 0.34134, 0.40857}, { 0.79580, 0.40857}, { 0.20462, 0.41429}, { 0.35429, 0.47261},
+{ 0.22327, 0.49429}, { 0.91429, 0.48975}, { 0.77143, 0.50661}, { 0.38857, 0.54057}, { 0.74857, 0.54629},
+{ 0.40725, 0.56286}, { 0.25714, 0.57001}, { 0.71429, 0.58154}, { 0.87070, 0.58571}, { 0.45143, 0.59759},
+{ 0.68000, 0.60498}, { 0.29296, 0.62000}, { 0.49143, 0.61681}, { 0.63429, 0.62252}, { 0.54857, 0.62950},
+{ 0.59429, 0.62991}, { 0.33311, 0.66000}, { 0.81143, 0.65543}, { 0.77143, 0.68607}, { 0.41143, 0.70930},
+{ 0.72000, 0.71355}, { 0.45714, 0.72605}, { 0.66857, 0.73050}, { 0.54286, 0.74152}, { 0.60000, 0.74152},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_101 [] = {
 { 0, 9,11}, {10, 1, 3}, {10, 3,12}, { 5,12, 3}, {17, 8, 6}, {10, 0, 1}, { 0,11, 2},
@@ -1198,11 +1198,11 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_101 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_102 [] = {
-{ 0.28000f,-0.07186f}, { 0.40571f,-0.07186f}, { 0.27472f, 0.61429f}, { 0.41100f, 0.61429f}, { 0.16571f, 0.61957f},
-{ 0.56000f, 0.61957f}, { 0.56420f, 0.71714f}, { 0.16571f, 0.72329f}, { 0.27472f, 0.72857f}, { 0.41100f, 0.72857f},
-{ 0.56000f, 0.72329f}, { 0.41034f, 0.83143f}, { 0.27580f, 0.86000f}, { 0.43429f, 0.89555f}, { 0.28613f, 0.91714f},
-{ 0.46286f, 0.91294f}, { 0.50286f, 0.92134f}, { 0.60000f, 0.91830f}, { 0.31107f, 0.96857f}, { 0.34286f, 1.00099f},
-{ 0.38857f, 1.02784f}, { 0.61714f, 1.03086f}, { 0.46286f, 1.04395f}, { 0.52571f, 1.04437f},
+{ 0.28000,-0.07186}, { 0.40571,-0.07186}, { 0.27472, 0.61429}, { 0.41100, 0.61429}, { 0.16571, 0.61957},
+{ 0.56000, 0.61957}, { 0.56420, 0.71714}, { 0.16571, 0.72329}, { 0.27472, 0.72857}, { 0.41100, 0.72857},
+{ 0.56000, 0.72329}, { 0.41034, 0.83143}, { 0.27580, 0.86000}, { 0.43429, 0.89555}, { 0.28613, 0.91714},
+{ 0.46286, 0.91294}, { 0.50286, 0.92134}, { 0.60000, 0.91830}, { 0.31107, 0.96857}, { 0.34286, 1.00099},
+{ 0.38857, 1.02784}, { 0.61714, 1.03086}, { 0.46286, 1.04395}, { 0.52571, 1.04437},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_102 [] = {
 { 0, 3, 2}, { 3, 0, 1}, { 4, 8, 7}, { 9, 3, 5}, { 2, 3, 8}, { 5, 6,10}, { 4, 2, 8},
@@ -1212,21 +1212,21 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_102 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_103 [] = {
-{ 0.46857f,-0.39295f}, { 0.56571f,-0.39563f}, { 0.66286f,-0.37959f}, { 0.35429f,-0.36200f}, { 0.74286f,-0.34616f},
-{ 0.28571f,-0.31868f}, { 0.80368f,-0.30000f}, { 0.50857f,-0.28437f}, { 0.62286f,-0.27395f}, { 0.44571f,-0.27101f},
-{ 0.23387f,-0.24286f}, { 0.84657f,-0.24286f}, { 0.69200f,-0.23714f}, { 0.38171f,-0.23143f}, { 0.72150f,-0.20286f},
-{ 0.87177f,-0.18000f}, { 0.34916f,-0.15714f}, { 0.74899f,-0.14000f}, { 0.22286f,-0.13957f}, { 0.50857f,-0.07295f},
-{ 0.56000f,-0.07295f}, { 0.43429f,-0.05959f}, { 0.65143f,-0.05070f}, { 0.37143f,-0.03355f}, { 0.69714f,-0.02527f},
-{ 0.89252f,-0.00857f}, { 0.74857f, 0.01873f}, { 0.75042f, 0.02000f}, { 0.75756f, 0.02000f}, { 0.75429f, 0.02333f},
-{ 0.29143f, 0.03381f}, { 0.53143f, 0.03866f}, { 0.57143f, 0.03907f}, { 0.47429f, 0.05216f}, { 0.64000f, 0.05787f},
-{ 0.41714f, 0.08704f}, { 0.68000f, 0.08439f}, { 0.23216f, 0.12857f}, { 0.38036f, 0.12857f}, { 0.72784f, 0.14000f},
-{ 0.35277f, 0.18571f}, { 0.20530f, 0.20857f}, { 0.75538f, 0.20857f}, { 0.19320f, 0.28286f}, { 0.33295f, 0.29429f},
-{ 0.76991f, 0.35714f}, { 0.19277f, 0.37429f}, { 0.33563f, 0.40857f}, { 0.75109f, 0.47143f}, { 0.35109f, 0.47714f},
-{ 0.21143f, 0.47832f}, { 0.72784f, 0.52286f}, { 0.23787f, 0.55143f}, { 0.39044f, 0.55143f}, { 0.69868f, 0.56286f},
-{ 0.66286f, 0.59393f}, { 0.27107f, 0.60857f}, { 0.45143f, 0.60498f}, { 0.48571f, 0.62041f}, { 0.56571f, 0.62991f},
-{ 0.57714f, 0.62764f}, { 0.58286f, 0.62723f}, { 0.76571f, 0.63477f}, { 0.32000f, 0.66384f}, { 0.68571f, 0.70213f},
-{ 0.39429f, 0.71229f}, { 0.77408f, 0.72286f}, { 0.88878f, 0.72286f}, { 0.62857f, 0.72816f}, { 0.46857f, 0.73580f},
-{ 0.56000f, 0.74152f},
+{ 0.46857,-0.39295}, { 0.56571,-0.39563}, { 0.66286,-0.37959}, { 0.35429,-0.36200}, { 0.74286,-0.34616},
+{ 0.28571,-0.31868}, { 0.80368,-0.30000}, { 0.50857,-0.28437}, { 0.62286,-0.27395}, { 0.44571,-0.27101},
+{ 0.23387,-0.24286}, { 0.84657,-0.24286}, { 0.69200,-0.23714}, { 0.38171,-0.23143}, { 0.72150,-0.20286},
+{ 0.87177,-0.18000}, { 0.34916,-0.15714}, { 0.74899,-0.14000}, { 0.22286,-0.13957}, { 0.50857,-0.07295},
+{ 0.56000,-0.07295}, { 0.43429,-0.05959}, { 0.65143,-0.05070}, { 0.37143,-0.03355}, { 0.69714,-0.02527},
+{ 0.89252,-0.00857}, { 0.74857, 0.01873}, { 0.75042, 0.02000}, { 0.75756, 0.02000}, { 0.75429, 0.02333},
+{ 0.29143, 0.03381}, { 0.53143, 0.03866}, { 0.57143, 0.03907}, { 0.47429, 0.05216}, { 0.64000, 0.05787},
+{ 0.41714, 0.08704}, { 0.68000, 0.08439}, { 0.23216, 0.12857}, { 0.38036, 0.12857}, { 0.72784, 0.14000},
+{ 0.35277, 0.18571}, { 0.20530, 0.20857}, { 0.75538, 0.20857}, { 0.19320, 0.28286}, { 0.33295, 0.29429},
+{ 0.76991, 0.35714}, { 0.19277, 0.37429}, { 0.33563, 0.40857}, { 0.75109, 0.47143}, { 0.35109, 0.47714},
+{ 0.21143, 0.47832}, { 0.72784, 0.52286}, { 0.23787, 0.55143}, { 0.39044, 0.55143}, { 0.69868, 0.56286},
+{ 0.66286, 0.59393}, { 0.27107, 0.60857}, { 0.45143, 0.60498}, { 0.48571, 0.62041}, { 0.56571, 0.62991},
+{ 0.57714, 0.62764}, { 0.58286, 0.62723}, { 0.76571, 0.63477}, { 0.32000, 0.66384}, { 0.68571, 0.70213},
+{ 0.39429, 0.71229}, { 0.77408, 0.72286}, { 0.88878, 0.72286}, { 0.62857, 0.72816}, { 0.46857, 0.73580},
+{ 0.56000, 0.74152},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_103 [] = {
 { 1, 7, 0}, { 8, 4,12}, { 2, 8, 1}, { 0, 9, 3}, { 7, 1, 8}, { 5,13,10}, { 9, 0, 7},
@@ -1243,12 +1243,12 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_103 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_104 [] = {
-{ 0.24571f,-0.07186f}, { 0.37143f,-0.07186f}, { 0.76000f,-0.07186f}, { 0.88571f,-0.07186f}, { 0.37605f, 0.40286f},
-{ 0.37756f, 0.40857f}, { 0.75538f, 0.46000f}, { 0.88950f, 0.47714f}, { 0.38899f, 0.48286f}, { 0.74538f, 0.51714f},
-{ 0.88152f, 0.54571f}, { 0.42439f, 0.55143f}, { 0.72000f, 0.56914f}, { 0.47429f, 0.59355f}, { 0.68000f, 0.60331f},
-{ 0.85996f, 0.61429f}, { 0.53143f, 0.61748f}, { 0.61143f, 0.62379f}, { 0.37714f, 0.63983f}, { 0.81714f, 0.67296f},
-{ 0.45714f, 0.70045f}, { 0.77714f, 0.70213f}, { 0.50857f, 0.72437f}, { 0.68571f, 0.73538f}, { 0.58857f, 0.74152f},
-{ 0.24571f, 1.02615f}, { 0.37143f, 1.02615f},
+{ 0.24571,-0.07186}, { 0.37143,-0.07186}, { 0.76000,-0.07186}, { 0.88571,-0.07186}, { 0.37605, 0.40286},
+{ 0.37756, 0.40857}, { 0.75538, 0.46000}, { 0.88950, 0.47714}, { 0.38899, 0.48286}, { 0.74538, 0.51714},
+{ 0.88152, 0.54571}, { 0.42439, 0.55143}, { 0.72000, 0.56914}, { 0.47429, 0.59355}, { 0.68000, 0.60331},
+{ 0.85996, 0.61429}, { 0.53143, 0.61748}, { 0.61143, 0.62379}, { 0.37714, 0.63983}, { 0.81714, 0.67296},
+{ 0.45714, 0.70045}, { 0.77714, 0.70213}, { 0.50857, 0.72437}, { 0.68571, 0.73538}, { 0.58857, 0.74152},
+{ 0.24571, 1.02615}, { 0.37143, 1.02615},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_104 [] = {
 { 0, 4,25}, { 4,18,25}, { 6, 2, 3}, { 9, 6, 7}, { 7, 6, 3}, {18, 8,11}, {18,11,13},
@@ -1258,18 +1258,18 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_104 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_105 [] = {
-{ 0.25143f,-0.07186f}, { 0.37714f,-0.07186f}, { 0.25143f, 0.72329f}, { 0.37714f, 0.72329f}, { 0.25143f, 0.87403f},
-{ 0.37714f, 0.87403f}, { 0.25143f, 1.02615f}, { 0.37714f, 1.02615f},
+{ 0.25143,-0.07186}, { 0.37714,-0.07186}, { 0.25143, 0.72329}, { 0.37714, 0.72329}, { 0.25143, 0.87403},
+{ 0.37714, 0.87403}, { 0.25143, 1.02615}, { 0.37714, 1.02615},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_105 [] = {
 { 3, 2, 0}, { 3, 0, 1}, { 4, 5, 6}, { 7, 6, 5},
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_106 [] = {
-{ 0.14857f,-0.39563f}, { 0.22286f,-0.39252f}, { 0.07383f,-0.38000f}, { 0.26857f,-0.37914f}, { 0.31429f,-0.34989f},
-{ 0.34036f,-0.31714f}, { 0.18857f,-0.27462f}, { 0.10286f,-0.26950f}, { 0.36109f,-0.26571f}, { 0.22331f,-0.24857f},
-{ 0.37563f,-0.16857f}, { 0.24152f,-0.16286f}, { 0.24571f, 0.72329f}, { 0.37143f, 0.72329f}, { 0.24571f, 0.87403f},
-{ 0.37143f, 0.87403f}, { 0.24571f, 1.02615f}, { 0.37143f, 1.02615f},
+{ 0.14857,-0.39563}, { 0.22286,-0.39252}, { 0.07383,-0.38000}, { 0.26857,-0.37914}, { 0.31429,-0.34989},
+{ 0.34036,-0.31714}, { 0.18857,-0.27462}, { 0.10286,-0.26950}, { 0.36109,-0.26571}, { 0.22331,-0.24857},
+{ 0.37563,-0.16857}, { 0.24152,-0.16286}, { 0.24571, 0.72329}, { 0.37143, 0.72329}, { 0.24571, 0.87403},
+{ 0.37143, 0.87403}, { 0.24571, 1.02615}, { 0.37143, 1.02615},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_106 [] = {
 { 1, 6, 0}, { 3, 6, 1}, { 4, 6, 3}, { 9,10,11}, { 7, 0, 6}, { 7, 2, 0}, { 9, 5, 8},
@@ -1277,9 +1277,9 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_106 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_107 [] = {
-{ 0.37450f,-0.07143f}, { 0.89788f,-0.07143f}, { 0.24571f,-0.06878f}, { 0.73714f,-0.07035f}, { 0.38004f, 0.24286f},
-{ 0.68421f, 0.25429f}, { 0.68045f, 0.26000f}, { 0.68000f, 0.26064f}, { 0.46857f, 0.32924f}, { 0.38286f, 0.40888f},
-{ 0.57152f, 0.42571f}, { 0.69714f, 0.72283f}, { 0.86359f, 0.72286f}, { 0.24836f, 1.02571f}, { 0.37714f, 1.02307f},
+{ 0.37450,-0.07143}, { 0.89788,-0.07143}, { 0.24571,-0.06878}, { 0.73714,-0.07035}, { 0.38004, 0.24286},
+{ 0.68421, 0.25429}, { 0.68045, 0.26000}, { 0.68000, 0.26064}, { 0.46857, 0.32924}, { 0.38286, 0.40888},
+{ 0.57152, 0.42571}, { 0.69714, 0.72283}, { 0.86359, 0.72286}, { 0.24836, 1.02571}, { 0.37714, 1.02307},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_107 [] = {
 { 2, 9,13}, { 4, 2, 0}, { 5, 8, 3}, { 5, 3, 1}, { 5, 6, 7}, { 9,14,13}, {11, 9,10},
@@ -1287,22 +1287,22 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_107 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_108 [] = {
-{ 0.36878f,-0.07143f}, { 0.24000f,-0.06878f}, { 0.24265f, 1.02571f}, { 0.37143f, 1.02307f},
+{ 0.36878,-0.07143}, { 0.24000,-0.06878}, { 0.24265, 1.02571}, { 0.37143, 1.02307},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_108 [] = {
 { 1, 3, 2}, { 3, 1, 0},
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_109 [] = {
-{ 0.24571f,-0.07186f}, { 0.37143f,-0.07186f}, { 0.72000f,-0.07295f}, { 1.18857f,-0.07186f}, { 1.31429f,-0.07186f},
-{ 0.71429f,-0.06878f}, { 0.84571f,-0.06878f}, { 0.37866f, 0.37429f}, { 0.84723f, 0.40286f}, { 0.85335f, 0.46000f},
-{ 0.39109f, 0.48286f}, { 0.71277f, 0.48286f}, { 1.18437f, 0.48286f}, { 1.31807f, 0.52286f}, { 0.87787f, 0.53429f},
-{ 0.41143f, 0.53493f}, { 1.17395f, 0.54000f}, { 0.43582f, 0.56857f}, { 0.68784f, 0.56857f}, { 1.14857f, 0.58403f},
-{ 0.93143f, 0.59188f}, { 0.66286f, 0.59829f}, { 0.82857f, 0.60801f}, { 0.51009f, 0.61429f}, { 0.36571f, 0.61924f},
-{ 0.63429f, 0.61470f}, { 1.09714f, 0.61580f}, { 1.29355f, 0.62000f}, { 0.56000f, 0.62420f}, { 1.00571f, 0.62152f},
-{ 1.06286f, 0.62379f}, { 0.41311f, 0.67143f}, { 0.78857f, 0.66975f}, { 1.25561f, 0.67714f}, { 0.90857f, 0.68902f},
-{ 0.74286f, 0.70784f}, { 1.20571f, 0.71355f}, { 0.35735f, 0.72286f}, { 0.24571f, 0.72329f}, { 0.50286f, 0.72498f},
-{ 0.99429f, 0.73109f}, { 1.16000f, 0.73109f}, { 0.67429f, 0.73470f}, { 0.57714f, 0.74109f}, { 1.05143f, 0.74152f},
+{ 0.24571,-0.07186}, { 0.37143,-0.07186}, { 0.72000,-0.07295}, { 1.18857,-0.07186}, { 1.31429,-0.07186},
+{ 0.71429,-0.06878}, { 0.84571,-0.06878}, { 0.37866, 0.37429}, { 0.84723, 0.40286}, { 0.85335, 0.46000},
+{ 0.39109, 0.48286}, { 0.71277, 0.48286}, { 1.18437, 0.48286}, { 1.31807, 0.52286}, { 0.87787, 0.53429},
+{ 0.41143, 0.53493}, { 1.17395, 0.54000}, { 0.43582, 0.56857}, { 0.68784, 0.56857}, { 1.14857, 0.58403},
+{ 0.93143, 0.59188}, { 0.66286, 0.59829}, { 0.82857, 0.60801}, { 0.51009, 0.61429}, { 0.36571, 0.61924},
+{ 0.63429, 0.61470}, { 1.09714, 0.61580}, { 1.29355, 0.62000}, { 0.56000, 0.62420}, { 1.00571, 0.62152},
+{ 1.06286, 0.62379}, { 0.41311, 0.67143}, { 0.78857, 0.66975}, { 1.25561, 0.67714}, { 0.90857, 0.68902},
+{ 0.74286, 0.70784}, { 1.20571, 0.71355}, { 0.35735, 0.72286}, { 0.24571, 0.72329}, { 0.50286, 0.72498},
+{ 0.99429, 0.73109}, { 1.16000, 0.73109}, { 0.67429, 0.73470}, { 0.57714, 0.74109}, { 1.05143, 0.74152},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_109 [] = {
 { 6, 5, 2}, { 0, 7,38}, { 8,11, 5}, { 7, 0, 1}, { 8, 5, 6}, {12, 3, 4}, {12,13,16},
@@ -1315,14 +1315,14 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_109 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_110 [] = {
-{ 0.24571f,-0.07186f}, { 0.37143f,-0.07186f}, { 0.75429f,-0.07186f}, { 0.88571f,-0.07186f}, { 0.24152f,-0.06571f},
-{ 0.37563f,-0.06571f}, { 0.75009f,-0.06571f}, { 0.88991f,-0.06571f}, { 0.37605f, 0.40286f}, { 0.37866f, 0.41429f},
-{ 0.38134f, 0.44857f}, { 0.74665f, 0.48286f}, { 0.88950f, 0.48286f}, { 0.39849f, 0.51143f}, { 0.73229f, 0.54000f},
-{ 0.88420f, 0.54000f}, { 0.43011f, 0.56286f}, { 0.46286f, 0.58893f}, { 0.69714f, 0.58725f}, { 0.87008f, 0.59143f},
-{ 0.51580f, 0.61429f}, { 0.65143f, 0.61343f}, { 0.36571f, 0.62031f}, { 0.56571f, 0.62420f}, { 0.60571f, 0.62379f},
-{ 0.61714f, 0.62152f}, { 0.62286f, 0.62109f}, { 0.83955f, 0.64857f}, { 0.40725f, 0.66571f}, { 0.79429f, 0.69179f},
-{ 0.45714f, 0.70213f}, { 0.24152f, 0.71714f}, { 0.75429f, 0.71355f}, { 0.35735f, 0.72286f}, { 0.24571f, 0.72329f},
-{ 0.52571f, 0.73050f}, { 0.68571f, 0.73538f}, { 0.58857f, 0.74152f},
+{ 0.24571,-0.07186}, { 0.37143,-0.07186}, { 0.75429,-0.07186}, { 0.88571,-0.07186}, { 0.24152,-0.06571},
+{ 0.37563,-0.06571}, { 0.75009,-0.06571}, { 0.88991,-0.06571}, { 0.37605, 0.40286}, { 0.37866, 0.41429},
+{ 0.38134, 0.44857}, { 0.74665, 0.48286}, { 0.88950, 0.48286}, { 0.39849, 0.51143}, { 0.73229, 0.54000},
+{ 0.88420, 0.54000}, { 0.43011, 0.56286}, { 0.46286, 0.58893}, { 0.69714, 0.58725}, { 0.87008, 0.59143},
+{ 0.51580, 0.61429}, { 0.65143, 0.61343}, { 0.36571, 0.62031}, { 0.56571, 0.62420}, { 0.60571, 0.62379},
+{ 0.61714, 0.62152}, { 0.62286, 0.62109}, { 0.83955, 0.64857}, { 0.40725, 0.66571}, { 0.79429, 0.69179},
+{ 0.45714, 0.70213}, { 0.24152, 0.71714}, { 0.75429, 0.71355}, { 0.35735, 0.72286}, { 0.24571, 0.72329},
+{ 0.52571, 0.73050}, { 0.68571, 0.73538}, { 0.58857, 0.74152},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_110 [] = {
 { 1, 4, 0}, { 3, 6, 2}, { 1, 5, 4}, { 3, 7, 6}, { 6,12,11}, {11,15,14}, { 6, 7,12},
@@ -1334,19 +1334,19 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_110 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_111 [] = {
-{ 0.53143f,-0.08966f}, { 0.59429f,-0.09009f}, { 0.69143f,-0.07101f}, { 0.41143f,-0.06213f}, { 0.76571f,-0.03759f},
-{ 0.34857f,-0.02821f}, { 0.81714f,-0.00099f}, { 0.29143f, 0.02154f}, { 0.54286f, 0.02193f}, { 0.60571f, 0.02420f},
-{ 0.50857f, 0.02823f}, { 0.64571f, 0.03563f}, { 0.86331f, 0.04857f}, { 0.45143f, 0.05216f}, { 0.25714f, 0.06636f},
-{ 0.70857f, 0.07330f}, { 0.89229f, 0.09429f}, { 0.40000f, 0.09597f}, { 0.22771f, 0.12286f}, { 0.38036f, 0.12286f},
-{ 0.37714f, 0.12793f}, { 0.37669f, 0.12857f}, { 0.75473f, 0.12857f}, { 0.76657f, 0.15143f}, { 0.77101f, 0.16286f},
-{ 0.77355f, 0.16857f}, { 0.92319f, 0.18000f}, { 0.20764f, 0.18571f}, { 0.34816f, 0.19714f}, { 0.78605f, 0.20857f},
-{ 0.33563f, 0.26000f}, { 0.19320f, 0.28286f}, { 0.93823f, 0.28857f}, { 0.79848f, 0.29429f}, { 0.33295f, 0.36286f},
-{ 0.93866f, 0.37429f}, { 0.19580f, 0.39714f}, { 0.79538f, 0.39714f}, { 0.35277f, 0.47143f}, { 0.92319f, 0.47143f},
-{ 0.21184f, 0.48286f}, { 0.77143f, 0.48947f}, { 0.23216f, 0.54000f}, { 0.38742f, 0.54000f}, { 0.89927f, 0.54000f},
-{ 0.74286f, 0.54057f}, { 0.71429f, 0.57275f}, { 0.42286f, 0.57813f}, { 0.87678f, 0.58000f}, { 0.27429f, 0.60984f},
-{ 0.48571f, 0.61580f}, { 0.64571f, 0.61580f}, { 0.54286f, 0.62950f}, { 0.58857f, 0.62950f}, { 0.60000f, 0.62723f},
-{ 0.60571f, 0.62680f}, { 0.83225f, 0.63714f}, { 0.31025f, 0.64857f}, { 0.34857f, 0.67864f}, { 0.75429f, 0.69641f},
-{ 0.40000f, 0.70784f}, { 0.45143f, 0.72605f}, { 0.68571f, 0.72538f}, { 0.53714f, 0.74152f}, { 0.60000f, 0.74109f},
+{ 0.53143,-0.08966}, { 0.59429,-0.09009}, { 0.69143,-0.07101}, { 0.41143,-0.06213}, { 0.76571,-0.03759},
+{ 0.34857,-0.02821}, { 0.81714,-0.00099}, { 0.29143, 0.02154}, { 0.54286, 0.02193}, { 0.60571, 0.02420},
+{ 0.50857, 0.02823}, { 0.64571, 0.03563}, { 0.86331, 0.04857}, { 0.45143, 0.05216}, { 0.25714, 0.06636},
+{ 0.70857, 0.07330}, { 0.89229, 0.09429}, { 0.40000, 0.09597}, { 0.22771, 0.12286}, { 0.38036, 0.12286},
+{ 0.37714, 0.12793}, { 0.37669, 0.12857}, { 0.75473, 0.12857}, { 0.76657, 0.15143}, { 0.77101, 0.16286},
+{ 0.77355, 0.16857}, { 0.92319, 0.18000}, { 0.20764, 0.18571}, { 0.34816, 0.19714}, { 0.78605, 0.20857},
+{ 0.33563, 0.26000}, { 0.19320, 0.28286}, { 0.93823, 0.28857}, { 0.79848, 0.29429}, { 0.33295, 0.36286},
+{ 0.93866, 0.37429}, { 0.19580, 0.39714}, { 0.79538, 0.39714}, { 0.35277, 0.47143}, { 0.92319, 0.47143},
+{ 0.21184, 0.48286}, { 0.77143, 0.48947}, { 0.23216, 0.54000}, { 0.38742, 0.54000}, { 0.89927, 0.54000},
+{ 0.74286, 0.54057}, { 0.71429, 0.57275}, { 0.42286, 0.57813}, { 0.87678, 0.58000}, { 0.27429, 0.60984},
+{ 0.48571, 0.61580}, { 0.64571, 0.61580}, { 0.54286, 0.62950}, { 0.58857, 0.62950}, { 0.60000, 0.62723},
+{ 0.60571, 0.62680}, { 0.83225, 0.63714}, { 0.31025, 0.64857}, { 0.34857, 0.67864}, { 0.75429, 0.69641},
+{ 0.40000, 0.70784}, { 0.45143, 0.72605}, { 0.68571, 0.72538}, { 0.53714, 0.74152}, { 0.60000, 0.74109},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_111 [] = {
 {11, 4,15}, { 8, 0, 1}, {17, 7, 5}, {11, 2, 4}, { 2, 9, 1}, { 8, 1, 9}, { 0, 8,10},
@@ -1362,16 +1362,16 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_111 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_112 [] = {
-{ 0.24571f,-0.37740f}, { 0.37454f,-0.37429f}, { 0.56000f,-0.08966f}, { 0.66857f,-0.07966f}, { 0.47429f,-0.06657f},
-{ 0.75429f,-0.04331f}, { 0.37584f,-0.00286f}, { 0.80571f,-0.00704f}, { 0.38286f, 0.00159f}, { 0.59429f, 0.02152f},
-{ 0.52000f, 0.02891f}, { 0.63429f, 0.02992f}, { 0.85964f, 0.05429f}, { 0.45143f, 0.06725f}, { 0.70857f, 0.07330f},
-{ 0.39787f, 0.13429f}, { 0.39514f, 0.14000f}, { 0.39216f, 0.14571f}, { 0.76213f, 0.14571f}, { 0.90538f, 0.14571f},
-{ 0.37462f, 0.19714f}, { 0.78327f, 0.20857f}, { 0.92680f, 0.22571f}, { 0.36379f, 0.27143f}, { 0.36152f, 0.28286f},
-{ 0.79580f, 0.29429f}, { 0.93563f, 0.30000f}, { 0.36379f, 0.36857f}, { 0.79580f, 0.36857f}, { 0.92680f, 0.43714f},
-{ 0.78286f, 0.45547f}, { 0.38286f, 0.47232f}, { 0.75429f, 0.52921f}, { 0.41714f, 0.54057f}, { 0.88571f, 0.56444f},
-{ 0.44571f, 0.57582f}, { 0.69143f, 0.59964f}, { 0.51429f, 0.62213f}, { 0.65143f, 0.62213f}, { 0.36571f, 0.63051f},
-{ 0.56571f, 0.63563f}, { 0.82704f, 0.64857f}, { 0.45714f, 0.70784f}, { 0.74857f, 0.70657f}, { 0.24571f, 0.72329f},
-{ 0.36000f, 0.72329f}, { 0.51429f, 0.73177f}, { 0.69143f, 0.72899f}, { 0.62286f, 0.74152f},
+{ 0.24571,-0.37740}, { 0.37454,-0.37429}, { 0.56000,-0.08966}, { 0.66857,-0.07966}, { 0.47429,-0.06657},
+{ 0.75429,-0.04331}, { 0.37584,-0.00286}, { 0.80571,-0.00704}, { 0.38286, 0.00159}, { 0.59429, 0.02152},
+{ 0.52000, 0.02891}, { 0.63429, 0.02992}, { 0.85964, 0.05429}, { 0.45143, 0.06725}, { 0.70857, 0.07330},
+{ 0.39787, 0.13429}, { 0.39514, 0.14000}, { 0.39216, 0.14571}, { 0.76213, 0.14571}, { 0.90538, 0.14571},
+{ 0.37462, 0.19714}, { 0.78327, 0.20857}, { 0.92680, 0.22571}, { 0.36379, 0.27143}, { 0.36152, 0.28286},
+{ 0.79580, 0.29429}, { 0.93563, 0.30000}, { 0.36379, 0.36857}, { 0.79580, 0.36857}, { 0.92680, 0.43714},
+{ 0.78286, 0.45547}, { 0.38286, 0.47232}, { 0.75429, 0.52921}, { 0.41714, 0.54057}, { 0.88571, 0.56444},
+{ 0.44571, 0.57582}, { 0.69143, 0.59964}, { 0.51429, 0.62213}, { 0.65143, 0.62213}, { 0.36571, 0.63051},
+{ 0.56571, 0.63563}, { 0.82704, 0.64857}, { 0.45714, 0.70784}, { 0.74857, 0.70657}, { 0.24571, 0.72329},
+{ 0.36000, 0.72329}, { 0.51429, 0.73177}, { 0.69143, 0.72899}, { 0.62286, 0.74152},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_112 [] = {
 { 0, 1, 6}, { 0,24,44}, { 3, 9, 2}, { 2,10, 4}, { 3,11, 9}, { 4,13, 8}, {10, 2, 9},
@@ -1384,17 +1384,17 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_112 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_113 [] = {
-{ 0.76000f,-0.37740f}, { 0.88571f,-0.37740f}, { 0.56571f,-0.09009f}, { 0.45143f,-0.07673f}, { 0.65143f,-0.06784f},
-{ 0.36000f,-0.03188f}, { 0.70857f,-0.03465f}, { 0.75580f,-0.00286f}, { 0.74857f, 0.00454f}, { 0.29714f, 0.02418f},
-{ 0.54286f, 0.02152f}, { 0.57714f, 0.02193f}, { 0.58857f, 0.02420f}, { 0.59429f, 0.02462f}, { 0.47429f, 0.03927f},
-{ 0.64571f, 0.04371f}, { 0.43302f, 0.06571f}, { 0.70670f, 0.09429f}, { 0.23914f, 0.11143f}, { 0.38607f, 0.11714f},
-{ 0.38286f, 0.12221f}, { 0.38241f, 0.12286f}, { 0.75008f, 0.17429f}, { 0.21101f, 0.19143f}, { 0.34748f, 0.20857f},
-{ 0.76723f, 0.25429f}, { 0.19848f, 0.26000f}, { 0.76723f, 0.27143f}, { 0.33605f, 0.28286f}, { 0.76991f, 0.28857f},
-{ 0.19580f, 0.37429f}, { 0.33866f, 0.40286f}, { 0.75429f, 0.45277f}, { 0.21101f, 0.47143f}, { 0.35429f, 0.47832f},
-{ 0.73143f, 0.51301f}, { 0.39846f, 0.56286f}, { 0.69296f, 0.56857f}, { 0.25669f, 0.58571f}, { 0.45143f, 0.60902f},
-{ 0.61714f, 0.62213f}, { 0.49143f, 0.62723f}, { 0.76571f, 0.62602f}, { 0.29330f, 0.63714f}, { 0.56571f, 0.63522f},
-{ 0.72403f, 0.67143f}, { 0.36571f, 0.69641f}, { 0.66286f, 0.71355f}, { 0.77408f, 0.72286f}, { 0.88571f, 0.72329f},
-{ 0.44571f, 0.72966f}, { 0.56000f, 0.74152f},
+{ 0.76000,-0.37740}, { 0.88571,-0.37740}, { 0.56571,-0.09009}, { 0.45143,-0.07673}, { 0.65143,-0.06784},
+{ 0.36000,-0.03188}, { 0.70857,-0.03465}, { 0.75580,-0.00286}, { 0.74857, 0.00454}, { 0.29714, 0.02418},
+{ 0.54286, 0.02152}, { 0.57714, 0.02193}, { 0.58857, 0.02420}, { 0.59429, 0.02462}, { 0.47429, 0.03927},
+{ 0.64571, 0.04371}, { 0.43302, 0.06571}, { 0.70670, 0.09429}, { 0.23914, 0.11143}, { 0.38607, 0.11714},
+{ 0.38286, 0.12221}, { 0.38241, 0.12286}, { 0.75008, 0.17429}, { 0.21101, 0.19143}, { 0.34748, 0.20857},
+{ 0.76723, 0.25429}, { 0.19848, 0.26000}, { 0.76723, 0.27143}, { 0.33605, 0.28286}, { 0.76991, 0.28857},
+{ 0.19580, 0.37429}, { 0.33866, 0.40286}, { 0.75429, 0.45277}, { 0.21101, 0.47143}, { 0.35429, 0.47832},
+{ 0.73143, 0.51301}, { 0.39846, 0.56286}, { 0.69296, 0.56857}, { 0.25669, 0.58571}, { 0.45143, 0.60902},
+{ 0.61714, 0.62213}, { 0.49143, 0.62723}, { 0.76571, 0.62602}, { 0.29330, 0.63714}, { 0.56571, 0.63522},
+{ 0.72403, 0.67143}, { 0.36571, 0.69641}, { 0.66286, 0.71355}, { 0.77408, 0.72286}, { 0.88571, 0.72329},
+{ 0.44571, 0.72966}, { 0.56000, 0.74152},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_113 [] = {
 {29,27,25}, {49,42,32}, {22, 7,25}, { 3,13,11}, { 2,13, 3}, { 4,13, 2}, { 6,15, 4},
@@ -1408,11 +1408,11 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_113 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_114 [] = {
-{ 0.24571f,-0.07186f}, { 0.37143f,-0.07186f}, { 0.24152f,-0.06571f}, { 0.37563f,-0.06571f}, { 0.37563f, 0.38000f},
-{ 0.39748f, 0.50000f}, { 0.41964f, 0.54571f}, { 0.44740f, 0.57429f}, { 0.61714f, 0.57787f}, { 0.62286f, 0.57880f},
-{ 0.48000f, 0.59294f}, { 0.57714f, 0.59395f}, { 0.51429f, 0.60134f}, { 0.36571f, 0.61385f}, { 0.41868f, 0.68857f},
-{ 0.66769f, 0.69429f}, { 0.66542f, 0.70000f}, { 0.24152f, 0.71714f}, { 0.35735f, 0.72286f}, { 0.24571f, 0.72329f},
-{ 0.46286f, 0.72436f}, { 0.60000f, 0.73109f}, { 0.51429f, 0.74109f}, { 0.55429f, 0.74109f},
+{ 0.24571,-0.07186}, { 0.37143,-0.07186}, { 0.24152,-0.06571}, { 0.37563,-0.06571}, { 0.37563, 0.38000},
+{ 0.39748, 0.50000}, { 0.41964, 0.54571}, { 0.44740, 0.57429}, { 0.61714, 0.57787}, { 0.62286, 0.57880},
+{ 0.48000, 0.59294}, { 0.57714, 0.59395}, { 0.51429, 0.60134}, { 0.36571, 0.61385}, { 0.41868, 0.68857},
+{ 0.66769, 0.69429}, { 0.66542, 0.70000}, { 0.24152, 0.71714}, { 0.35735, 0.72286}, { 0.24571, 0.72329},
+{ 0.46286, 0.72436}, { 0.60000, 0.73109}, { 0.51429, 0.74109}, { 0.55429, 0.74109},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_114 [] = {
 { 1, 2, 0}, { 1, 3, 2}, { 4, 2, 3}, { 5, 6,13}, { 5,13,17}, {21,11,15}, { 2, 4,17},
@@ -1422,19 +1422,19 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_114 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_115 [] = {
-{ 0.56000f,-0.09009f}, { 0.46286f,-0.08705f}, { 0.65143f,-0.07395f}, { 0.37143f,-0.06723f}, { 0.70444f,-0.05429f},
-{ 0.33143f,-0.04943f}, { 0.76057f,-0.02000f}, { 0.28571f,-0.01813f}, { 0.79582f, 0.01429f}, { 0.50286f, 0.02152f},
-{ 0.55429f, 0.02152f}, { 0.56571f, 0.02379f}, { 0.57714f, 0.02420f}, { 0.24571f, 0.02636f}, { 0.64000f, 0.04200f},
-{ 0.41714f, 0.04371f}, { 0.22200f, 0.06571f}, { 0.38286f, 0.06725f}, { 0.68384f, 0.07714f}, { 0.83580f, 0.08286f},
-{ 0.69927f, 0.10000f}, { 0.34200f, 0.12286f}, { 0.84950f, 0.14000f}, { 0.71009f, 0.15714f}, { 0.19109f, 0.16286f},
-{ 0.19370f, 0.16857f}, { 0.32000f, 0.18615f}, { 0.69864f, 0.19143f}, { 0.84723f, 0.20286f}, { 0.65714f, 0.22784f},
-{ 0.83641f, 0.24286f}, { 0.80956f, 0.28857f}, { 0.34286f, 0.32371f}, { 0.75429f, 0.33641f}, { 0.30286f, 0.34421f},
-{ 0.69143f, 0.36327f}, { 0.25714f, 0.38445f}, { 0.22645f, 0.43714f}, { 0.41143f, 0.44538f}, { 0.37587f, 0.46571f},
-{ 0.35885f, 0.48286f}, { 0.21295f, 0.49429f}, { 0.69143f, 0.50460f}, { 0.34478f, 0.51714f}, { 0.81977f, 0.52286f},
-{ 0.67514f, 0.55143f}, { 0.35216f, 0.56286f}, { 0.22034f, 0.56857f}, { 0.64000f, 0.59465f}, { 0.38286f, 0.59829f},
-{ 0.79429f, 0.61016f}, { 0.24000f, 0.61573f}, { 0.42857f, 0.62041f}, { 0.58286f, 0.62252f}, { 0.48571f, 0.62991f},
-{ 0.74689f, 0.67143f}, { 0.28571f, 0.67258f}, { 0.70286f, 0.70045f}, { 0.33714f, 0.70613f}, { 0.38857f, 0.72538f},
-{ 0.61714f, 0.73050f}, { 0.47429f, 0.74109f}, { 0.54286f, 0.74109f},
+{ 0.56000,-0.09009}, { 0.46286,-0.08705}, { 0.65143,-0.07395}, { 0.37143,-0.06723}, { 0.70444,-0.05429},
+{ 0.33143,-0.04943}, { 0.76057,-0.02000}, { 0.28571,-0.01813}, { 0.79582, 0.01429}, { 0.50286, 0.02152},
+{ 0.55429, 0.02152}, { 0.56571, 0.02379}, { 0.57714, 0.02420}, { 0.24571, 0.02636}, { 0.64000, 0.04200},
+{ 0.41714, 0.04371}, { 0.22200, 0.06571}, { 0.38286, 0.06725}, { 0.68384, 0.07714}, { 0.83580, 0.08286},
+{ 0.69927, 0.10000}, { 0.34200, 0.12286}, { 0.84950, 0.14000}, { 0.71009, 0.15714}, { 0.19109, 0.16286},
+{ 0.19370, 0.16857}, { 0.32000, 0.18615}, { 0.69864, 0.19143}, { 0.84723, 0.20286}, { 0.65714, 0.22784},
+{ 0.83641, 0.24286}, { 0.80956, 0.28857}, { 0.34286, 0.32371}, { 0.75429, 0.33641}, { 0.30286, 0.34421},
+{ 0.69143, 0.36327}, { 0.25714, 0.38445}, { 0.22645, 0.43714}, { 0.41143, 0.44538}, { 0.37587, 0.46571},
+{ 0.35885, 0.48286}, { 0.21295, 0.49429}, { 0.69143, 0.50460}, { 0.34478, 0.51714}, { 0.81977, 0.52286},
+{ 0.67514, 0.55143}, { 0.35216, 0.56286}, { 0.22034, 0.56857}, { 0.64000, 0.59465}, { 0.38286, 0.59829},
+{ 0.79429, 0.61016}, { 0.24000, 0.61573}, { 0.42857, 0.62041}, { 0.58286, 0.62252}, { 0.48571, 0.62991},
+{ 0.74689, 0.67143}, { 0.28571, 0.67258}, { 0.70286, 0.70045}, { 0.33714, 0.70613}, { 0.38857, 0.72538},
+{ 0.61714, 0.73050}, { 0.47429, 0.74109}, { 0.54286, 0.74109},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_115 [] = {
 { 2,12, 0}, {10, 1,12}, {12, 2,14}, {14, 4, 6}, { 7,17,13}, { 0,12, 1}, { 4,14, 2},
@@ -1449,11 +1449,11 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_115 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_116 [] = {
-{ 0.42286f,-0.08395f}, { 0.48000f,-0.08437f}, { 0.55197f,-0.07143f}, { 0.33714f,-0.05914f}, { 0.29901f,-0.02571f},
-{ 0.28041f, 0.00857f}, { 0.44571f, 0.04816f}, { 0.44453f, 0.04857f}, { 0.53714f, 0.04344f}, { 0.44000f, 0.05008f},
-{ 0.41057f, 0.07714f}, { 0.26748f, 0.10000f}, { 0.40152f, 0.11714f}, { 0.26597f, 0.61429f}, { 0.40260f, 0.61429f},
-{ 0.17143f, 0.61957f}, { 0.53450f, 0.62000f}, { 0.53866f, 0.71714f}, { 0.53450f, 0.72286f}, { 0.17143f, 0.72329f},
-{ 0.26597f, 0.72857f}, { 0.40260f, 0.72857f}, { 0.26748f, 0.91714f}, { 0.40000f, 0.99545f},
+{ 0.42286,-0.08395}, { 0.48000,-0.08437}, { 0.55197,-0.07143}, { 0.33714,-0.05914}, { 0.29901,-0.02571},
+{ 0.28041, 0.00857}, { 0.44571, 0.04816}, { 0.44453, 0.04857}, { 0.53714, 0.04344}, { 0.44000, 0.05008},
+{ 0.41057, 0.07714}, { 0.26748, 0.10000}, { 0.40152, 0.11714}, { 0.26597, 0.61429}, { 0.40260, 0.61429},
+{ 0.17143, 0.61957}, { 0.53450, 0.62000}, { 0.53866, 0.71714}, { 0.53450, 0.72286}, { 0.17143, 0.72329},
+{ 0.26597, 0.72857}, { 0.40260, 0.72857}, { 0.26748, 0.91714}, { 0.40000, 0.99545},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_116 [] = {
 {10, 5, 4}, { 6, 7, 9}, {10, 4, 3}, {10, 3, 9}, { 8, 6, 1}, { 6, 9, 1}, { 5,10,11},
@@ -1463,14 +1463,14 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_116 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_117 [] = {
-{ 0.48571f,-0.09009f}, { 0.53714f,-0.09009f}, { 0.41714f,-0.07673f}, { 0.77143f,-0.07295f}, { 0.88000f,-0.07186f},
-{ 0.63518f,-0.06571f}, { 0.76571f,-0.06878f}, { 0.88420f,-0.06571f}, { 0.34857f,-0.04771f}, { 0.70857f,-0.01846f},
-{ 0.29901f,-0.00857f}, { 0.27429f, 0.02730f}, { 0.52000f, 0.02723f}, { 0.56000f, 0.02764f}, { 0.47339f, 0.03714f},
-{ 0.76000f, 0.03684f}, { 0.61714f, 0.04135f}, { 0.43943f, 0.05429f}, { 0.65143f, 0.05787f}, { 0.41330f, 0.07714f},
-{ 0.25143f, 0.08437f}, { 0.69143f, 0.08704f}, { 0.39343f, 0.10571f}, { 0.38899f, 0.11714f}, { 0.71473f, 0.11714f},
-{ 0.38645f, 0.12286f}, { 0.73294f, 0.15714f}, { 0.23848f, 0.17429f}, { 0.37563f, 0.17429f}, { 0.75009f, 0.26000f},
-{ 0.23848f, 0.71714f}, { 0.37295f, 0.71714f}, { 0.75009f, 0.71714f}, { 0.88420f, 0.71714f}, { 0.24265f, 0.72286f},
-{ 0.36878f, 0.72286f}, { 0.75429f, 0.72329f}, { 0.88000f, 0.72329f},
+{ 0.48571,-0.09009}, { 0.53714,-0.09009}, { 0.41714,-0.07673}, { 0.77143,-0.07295}, { 0.88000,-0.07186},
+{ 0.63518,-0.06571}, { 0.76571,-0.06878}, { 0.88420,-0.06571}, { 0.34857,-0.04771}, { 0.70857,-0.01846},
+{ 0.29901,-0.00857}, { 0.27429, 0.02730}, { 0.52000, 0.02723}, { 0.56000, 0.02764}, { 0.47339, 0.03714},
+{ 0.76000, 0.03684}, { 0.61714, 0.04135}, { 0.43943, 0.05429}, { 0.65143, 0.05787}, { 0.41330, 0.07714},
+{ 0.25143, 0.08437}, { 0.69143, 0.08704}, { 0.39343, 0.10571}, { 0.38899, 0.11714}, { 0.71473, 0.11714},
+{ 0.38645, 0.12286}, { 0.73294, 0.15714}, { 0.23848, 0.17429}, { 0.37563, 0.17429}, { 0.75009, 0.26000},
+{ 0.23848, 0.71714}, { 0.37295, 0.71714}, { 0.75009, 0.71714}, { 0.88420, 0.71714}, { 0.24265, 0.72286},
+{ 0.36878, 0.72286}, { 0.75429, 0.72329}, { 0.88000, 0.72329},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_117 [] = {
 { 6, 3,15}, { 3, 7,15}, { 3, 4, 7}, { 8,17,10}, { 2,14,17}, { 2,17, 8}, { 5,13, 1},
@@ -1482,9 +1482,9 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_117 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_118 [] = {
-{ 0.45714f,-0.06947f}, { 0.58857f,-0.07103f}, { 0.52000f, 0.09808f}, { 0.52571f, 0.09808f}, { 0.47580f, 0.23714f},
-{ 0.16151f, 0.71714f}, { 0.88420f, 0.71714f}, { 0.16427f, 0.72286f}, { 0.30286f, 0.71951f}, { 0.74857f, 0.72090f},
-{ 0.88145f, 0.72286f}, { 0.29714f, 0.72395f},
+{ 0.45714,-0.06947}, { 0.58857,-0.07103}, { 0.52000, 0.09808}, { 0.52571, 0.09808}, { 0.47580, 0.23714},
+{ 0.16151, 0.71714}, { 0.88420, 0.71714}, { 0.16427, 0.72286}, { 0.30286, 0.71951}, { 0.74857, 0.72090},
+{ 0.88145, 0.72286}, { 0.29714, 0.72395},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_118 [] = {
 { 4, 0, 2}, { 0, 4, 5}, { 3, 2, 0}, { 1, 3, 0}, { 3, 6, 9}, { 8,11, 5}, { 9, 6,10},
@@ -1492,9 +1492,9 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_118 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_119 [] = {
-{ 0.39429f,-0.07215f}, { 0.52571f,-0.07215f}, { 0.97714f,-0.07252f}, { 0.84571f,-0.06947f}, { 0.45714f, 0.10650f},
-{ 0.46286f, 0.10650f}, { 0.92000f, 0.12073f}, { 0.69143f, 0.52785f}, { 0.15122f, 0.72286f}, { 0.28571f, 0.72090f},
-{ 0.62857f, 0.72243f}, { 0.76193f, 0.72286f}, { 1.23164f, 0.72286f}, { 1.10857f, 0.72329f},
+{ 0.39429,-0.07215}, { 0.52571,-0.07215}, { 0.97714,-0.07252}, { 0.84571,-0.06947}, { 0.45714, 0.10650},
+{ 0.46286, 0.10650}, { 0.92000, 0.12073}, { 0.69143, 0.52785}, { 0.15122, 0.72286}, { 0.28571, 0.72090},
+{ 0.62857, 0.72243}, { 0.76193, 0.72286}, { 1.23164, 0.72286}, { 1.10857, 0.72329},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_119 [] = {
 { 2, 6, 3}, { 0, 4, 8}, { 3, 6, 7}, { 5, 0, 1}, {12,13, 6}, { 5, 4, 0}, { 7,10, 5},
@@ -1502,10 +1502,10 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_119 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_120 [] = {
-{ 0.15697f,-0.07143f}, { 0.88073f,-0.07143f}, { 0.15473f,-0.06571f}, { 0.31429f,-0.07035f}, { 0.72571f,-0.07140f},
-{ 0.88250f,-0.06571f}, { 0.52000f, 0.22529f}, { 0.52571f, 0.22529f}, { 0.60332f, 0.33429f}, { 0.43534f, 0.34000f},
-{ 0.51429f, 0.45005f}, { 0.17188f, 0.71714f}, { 0.86812f, 0.71714f}, { 0.17412f, 0.72286f}, { 0.86588f, 0.72286f},
-{ 0.32571f, 0.72395f}, { 0.71429f, 0.72395f},
+{ 0.15697,-0.07143}, { 0.88073,-0.07143}, { 0.15473,-0.06571}, { 0.31429,-0.07035}, { 0.72571,-0.07140},
+{ 0.88250,-0.06571}, { 0.52000, 0.22529}, { 0.52571, 0.22529}, { 0.60332, 0.33429}, { 0.43534, 0.34000},
+{ 0.51429, 0.45005}, { 0.17188, 0.71714}, { 0.86812, 0.71714}, { 0.17412, 0.72286}, { 0.86588, 0.72286},
+{ 0.32571, 0.72395}, { 0.71429, 0.72395},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_120 [] = {
 { 1, 5, 4}, { 2, 6, 9}, { 8, 6, 7}, { 3, 2, 0}, { 4, 8, 7}, { 6, 2, 3}, { 4, 5, 8},
@@ -1514,10 +1514,10 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_120 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_121 [] = {
-{ 0.34286f,-0.39563f}, { 0.24000f,-0.38043f}, { 0.41714f,-0.37641f}, { 0.45714f,-0.34956f}, { 0.50436f,-0.29429f},
-{ 0.32000f,-0.26680f}, { 0.22286f,-0.25766f}, { 0.36652f,-0.25429f}, { 0.54371f,-0.22000f}, { 0.41293f,-0.21429f},
-{ 0.46848f,-0.07714f}, { 0.53714f, 0.09292f}, { 0.16998f, 0.72286f}, { 0.30857f, 0.71999f}, { 0.76000f, 0.72246f},
-{ 0.88806f, 0.72286f},
+{ 0.34286,-0.39563}, { 0.24000,-0.38043}, { 0.41714,-0.37641}, { 0.45714,-0.34956}, { 0.50436,-0.29429},
+{ 0.32000,-0.26680}, { 0.22286,-0.25766}, { 0.36652,-0.25429}, { 0.54371,-0.22000}, { 0.41293,-0.21429},
+{ 0.46848,-0.07714}, { 0.53714, 0.09292}, { 0.16998, 0.72286}, { 0.30857, 0.71999}, { 0.76000, 0.72246},
+{ 0.88806, 0.72286},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_121 [] = {
 { 2, 7, 0}, { 0, 5, 1}, { 5, 0, 7}, { 6, 1, 5}, { 3, 7, 2}, { 7, 3, 9}, { 3, 4, 9},
@@ -1525,10 +1525,10 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_121 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_122 [] = {
-{ 0.17714f,-0.07295f}, { 0.86857f,-0.07186f}, { 0.17143f,-0.06878f}, { 0.87277f,-0.06571f}, { 0.17146f, 0.03714f},
-{ 0.34212f, 0.03714f}, { 0.87277f, 0.03714f}, { 0.34132f, 0.04286f}, { 0.44000f, 0.04327f}, { 0.86857f, 0.04329f},
-{ 0.20571f, 0.61689f}, { 0.67062f, 0.62000f}, { 0.84991f, 0.64286f}, { 0.20152f, 0.71714f}, { 0.84991f, 0.71714f},
-{ 0.20571f, 0.72329f}, { 0.84571f, 0.72329f},
+{ 0.17714,-0.07295}, { 0.86857,-0.07186}, { 0.17143,-0.06878}, { 0.87277,-0.06571}, { 0.17146, 0.03714},
+{ 0.34212, 0.03714}, { 0.87277, 0.03714}, { 0.34132, 0.04286}, { 0.44000, 0.04327}, { 0.86857, 0.04329},
+{ 0.20571, 0.61689}, { 0.67062, 0.62000}, { 0.84991, 0.64286}, { 0.20152, 0.71714}, { 0.84991, 0.71714},
+{ 0.20571, 0.72329}, { 0.84571, 0.72329},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_122 [] = {
 { 2, 0, 4}, { 0, 1, 9}, { 0, 5, 4}, { 1, 3, 9}, { 5, 0, 8}, { 5, 7, 4}, { 0, 9, 8},
@@ -1537,14 +1537,14 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_122 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_123 [] = {
-{ 0.61143f,-0.39454f}, { 0.46857f,-0.38420f}, { 0.40000f,-0.34154f}, { 0.61143f,-0.27975f}, { 0.35748f,-0.27143f},
-{ 0.52000f,-0.26992f}, { 0.47787f,-0.23143f}, { 0.46748f,-0.19143f}, { 0.34134f,-0.18000f}, { 0.46395f, 0.04286f},
-{ 0.33563f, 0.05429f}, { 0.45184f, 0.14571f}, { 0.32109f, 0.16286f}, { 0.29143f, 0.21832f}, { 0.42286f, 0.22716f},
-{ 0.25143f, 0.24943f}, { 0.18857f, 0.26528f}, { 0.39429f, 0.26698f}, { 0.31413f, 0.32286f}, { 0.18857f, 0.38615f},
-{ 0.25143f, 0.40073f}, { 0.41188f, 0.40286f}, { 0.29143f, 0.42775f}, { 0.43514f, 0.44286f}, { 0.32823f, 0.49429f},
-{ 0.45866f, 0.52286f}, { 0.34134f, 0.60286f}, { 0.46705f, 0.80857f}, { 0.34478f, 0.84857f}, { 0.47748f, 0.87143f},
-{ 0.35748f, 0.91143f}, { 0.50286f, 0.90821f}, { 0.50793f, 0.91143f}, { 0.50857f, 0.91188f}, { 0.61143f, 0.92814f},
-{ 0.40571f, 0.99511f}, { 0.46857f, 1.03294f}, { 0.53143f, 1.04437f}, { 0.61143f, 1.04329f},
+{ 0.61143,-0.39454}, { 0.46857,-0.38420}, { 0.40000,-0.34154}, { 0.61143,-0.27975}, { 0.35748,-0.27143},
+{ 0.52000,-0.26992}, { 0.47787,-0.23143}, { 0.46748,-0.19143}, { 0.34134,-0.18000}, { 0.46395, 0.04286},
+{ 0.33563, 0.05429}, { 0.45184, 0.14571}, { 0.32109, 0.16286}, { 0.29143, 0.21832}, { 0.42286, 0.22716},
+{ 0.25143, 0.24943}, { 0.18857, 0.26528}, { 0.39429, 0.26698}, { 0.31413, 0.32286}, { 0.18857, 0.38615},
+{ 0.25143, 0.40073}, { 0.41188, 0.40286}, { 0.29143, 0.42775}, { 0.43514, 0.44286}, { 0.32823, 0.49429},
+{ 0.45866, 0.52286}, { 0.34134, 0.60286}, { 0.46705, 0.80857}, { 0.34478, 0.84857}, { 0.47748, 0.87143},
+{ 0.35748, 0.91143}, { 0.50286, 0.90821}, { 0.50793, 0.91143}, { 0.50857, 0.91188}, { 0.61143, 0.92814},
+{ 0.40571, 0.99511}, { 0.46857, 1.03294}, { 0.53143, 1.04437}, { 0.61143, 1.04329},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_123 [] = {
 { 0, 3, 5}, { 6, 2, 5}, { 2, 6, 4}, { 0, 5, 1}, { 2, 1, 5}, { 4, 7, 8}, { 7, 4, 6},
@@ -1556,20 +1556,20 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_123 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_124 [] = {
-{ 0.28571f,-0.39454f}, { 0.38857f,-0.39563f}, { 0.28571f, 1.04329f}, { 0.38857f, 1.04437f},
+{ 0.28571,-0.39454}, { 0.38857,-0.39563}, { 0.28571, 1.04329}, { 0.38857, 1.04437},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_124 [] = {
 { 3, 2, 0}, { 3, 0, 1},
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_125 [] = {
-{ 0.17714f,-0.39454f}, { 0.31429f,-0.38613f}, { 0.39429f,-0.33832f}, { 0.17714f,-0.27975f}, { 0.27429f,-0.26784f},
-{ 0.43681f,-0.26000f}, { 0.31070f,-0.23714f}, { 0.44950f,-0.19714f}, { 0.32723f,-0.15714f}, { 0.45295f, 0.04857f},
-{ 0.33295f, 0.11714f}, { 0.46857f, 0.16404f}, { 0.35387f, 0.19714f}, { 0.51429f, 0.23258f}, { 0.56000f, 0.25681f},
-{ 0.39429f, 0.26403f}, { 0.60630f, 0.26571f}, { 0.47702f, 0.32857f}, { 0.41714f, 0.36742f}, { 0.60571f, 0.38615f},
-{ 0.54857f, 0.39927f}, { 0.50171f, 0.43143f}, { 0.36086f, 0.43714f}, { 0.46748f, 0.50000f}, { 0.32991f, 0.56857f},
-{ 0.45252f, 0.78571f}, { 0.32723f, 0.80286f}, { 0.31748f, 0.87143f}, { 0.29143f, 0.90893f}, { 0.43470f, 0.91714f},
-{ 0.17714f, 0.92814f}, { 0.41629f, 0.95714f}, { 0.36571f, 1.01107f}, { 0.32000f, 1.03294f}, { 0.17714f, 1.04329f},
+{ 0.17714,-0.39454}, { 0.31429,-0.38613}, { 0.39429,-0.33832}, { 0.17714,-0.27975}, { 0.27429,-0.26784},
+{ 0.43681,-0.26000}, { 0.31070,-0.23714}, { 0.44950,-0.19714}, { 0.32723,-0.15714}, { 0.45295, 0.04857},
+{ 0.33295, 0.11714}, { 0.46857, 0.16404}, { 0.35387, 0.19714}, { 0.51429, 0.23258}, { 0.56000, 0.25681},
+{ 0.39429, 0.26403}, { 0.60630, 0.26571}, { 0.47702, 0.32857}, { 0.41714, 0.36742}, { 0.60571, 0.38615},
+{ 0.54857, 0.39927}, { 0.50171, 0.43143}, { 0.36086, 0.43714}, { 0.46748, 0.50000}, { 0.32991, 0.56857},
+{ 0.45252, 0.78571}, { 0.32723, 0.80286}, { 0.31748, 0.87143}, { 0.29143, 0.90893}, { 0.43470, 0.91714},
+{ 0.17714, 0.92814}, { 0.41629, 0.95714}, { 0.36571, 1.01107}, { 0.32000, 1.03294}, { 0.17714, 1.04329},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_125 [] = {
 { 4, 3, 0}, { 2, 4, 1}, { 6, 7, 8}, { 1, 4, 0}, { 2, 6, 4}, { 5, 6, 2}, { 6, 5, 7},
@@ -1580,11 +1580,11 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_125 [] = {
 };
 
 static const VTK_VECTOR_TEXT_POINT VTK_VECTOR_TEXT_POINTS_126 [] = {
-{ 0.73714f, 0.34462f}, { 0.20759f, 0.35143f}, { 0.21143f, 0.34662f}, { 0.81143f, 0.34723f}, { 0.66857f, 0.35756f},
-{ 0.86857f, 0.36135f}, { 0.25143f, 0.38115f}, { 0.90857f, 0.38086f}, { 0.52000f, 0.41580f}, { 0.32571f, 0.42723f},
-{ 0.97140f, 0.43143f}, { 0.37143f, 0.43866f}, { 0.42286f, 0.44093f}, { 0.79429f, 0.49009f}, { 0.21028f, 0.50000f},
-{ 0.72571f, 0.49681f}, { 0.86286f, 0.50930f}, { 0.25714f, 0.54115f}, { 0.92571f, 0.54759f}, { 0.32571f, 0.57470f},
-{ 0.50286f, 0.57621f}, { 0.96571f, 0.58154f}, { 0.97143f, 0.58073f}, { 0.38857f, 0.58680f}, { 0.44000f, 0.58723f},
+{ 0.73714, 0.34462}, { 0.20759, 0.35143}, { 0.21143, 0.34662}, { 0.81143, 0.34723}, { 0.66857, 0.35756},
+{ 0.86857, 0.36135}, { 0.25143, 0.38115}, { 0.90857, 0.38086}, { 0.52000, 0.41580}, { 0.32571, 0.42723},
+{ 0.97140, 0.43143}, { 0.37143, 0.43866}, { 0.42286, 0.44093}, { 0.79429, 0.49009}, { 0.21028, 0.50000},
+{ 0.72571, 0.49681}, { 0.86286, 0.50930}, { 0.25714, 0.54115}, { 0.92571, 0.54759}, { 0.32571, 0.57470},
+{ 0.50286, 0.57621}, { 0.96571, 0.58154}, { 0.97143, 0.58073}, { 0.38857, 0.58680}, { 0.44000, 0.58723},
 };
 static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_126 [] = {
 { 1,17,14}, { 8, 4,15}, {13, 5, 7}, { 6, 1, 2}, { 5,13, 3}, { 1, 6,17}, { 3,13, 0},
@@ -1594,100 +1594,100 @@ static const VTK_VECTOR_TEXT_TRIANGLE VTK_VECTOR_TEXT_TRIANGLES_126 [] = {
 };
 
 static const VTK_VECTOR_TEXT_GLYPH Letters[] = {
-{ 0.438482f,  VTK_VECTOR_TEXT_POINTS_33,  11,  VTK_VECTOR_TEXT_TRIANGLES_33,    7 },
-{ 0.615625f,  VTK_VECTOR_TEXT_POINTS_34,  21,  VTK_VECTOR_TEXT_TRIANGLES_34,   17 },
-{ 0.974539f,  VTK_VECTOR_TEXT_POINTS_35,  43,  VTK_VECTOR_TEXT_TRIANGLES_35,   43 },
-{ 0.921518f,  VTK_VECTOR_TEXT_POINTS_36,  73,  VTK_VECTOR_TEXT_TRIANGLES_36,   75 },
-{ 1.409911f,  VTK_VECTOR_TEXT_POINTS_37,  81,  VTK_VECTOR_TEXT_TRIANGLES_37,   79 },
-{ 1.126291f,  VTK_VECTOR_TEXT_POINTS_38,  76,  VTK_VECTOR_TEXT_TRIANGLES_38,   78 },
-{ 0.364197f,  VTK_VECTOR_TEXT_POINTS_39,  10,  VTK_VECTOR_TEXT_TRIANGLES_39,    8 },
-{ 0.595731f,  VTK_VECTOR_TEXT_POINTS_40,  19,  VTK_VECTOR_TEXT_TRIANGLES_40,   17 },
-{ 0.598482f,  VTK_VECTOR_TEXT_POINTS_41,  19,  VTK_VECTOR_TEXT_TRIANGLES_41,   17 },
-{ 0.685300f,  VTK_VECTOR_TEXT_POINTS_42,  34,  VTK_VECTOR_TEXT_TRIANGLES_42,   32 },
-{ 0.952768f,  VTK_VECTOR_TEXT_POINTS_43,  20,  VTK_VECTOR_TEXT_TRIANGLES_43,   18 },
-{ 0.432768f,  VTK_VECTOR_TEXT_POINTS_44,  23,  VTK_VECTOR_TEXT_TRIANGLES_44,   21 },
-{ 0.606146f,  VTK_VECTOR_TEXT_POINTS_45,   8,  VTK_VECTOR_TEXT_TRIANGLES_45,    6 },
-{ 0.432768f,  VTK_VECTOR_TEXT_POINTS_46,  13,  VTK_VECTOR_TEXT_TRIANGLES_46,   11 },
-{ 0.562348f,  VTK_VECTOR_TEXT_POINTS_47,   5,  VTK_VECTOR_TEXT_TRIANGLES_47,    3 },
-{ 0.926804f,  VTK_VECTOR_TEXT_POINTS_48,  53,  VTK_VECTOR_TEXT_TRIANGLES_48,   53 },
-{ 0.708571f,  VTK_VECTOR_TEXT_POINTS_49,  11,  VTK_VECTOR_TEXT_TRIANGLES_49,    9 },
-{ 0.914286f,  VTK_VECTOR_TEXT_POINTS_50,  43,  VTK_VECTOR_TEXT_TRIANGLES_50,   41 },
-{ 0.927232f,  VTK_VECTOR_TEXT_POINTS_51,  68,  VTK_VECTOR_TEXT_TRIANGLES_51,   66 },
-{ 0.920000f,  VTK_VECTOR_TEXT_POINTS_52,  18,  VTK_VECTOR_TEXT_TRIANGLES_52,   18 },
-{ 0.932946f,  VTK_VECTOR_TEXT_POINTS_53,  54,  VTK_VECTOR_TEXT_TRIANGLES_53,   52 },
-{ 0.927232f,  VTK_VECTOR_TEXT_POINTS_54,  70,  VTK_VECTOR_TEXT_TRIANGLES_54,   70 },
-{ 0.923788f,  VTK_VECTOR_TEXT_POINTS_55,  17,  VTK_VECTOR_TEXT_TRIANGLES_55,   15 },
-{ 0.926804f,  VTK_VECTOR_TEXT_POINTS_56,  83,  VTK_VECTOR_TEXT_TRIANGLES_56,   85 },
-{ 0.927232f,  VTK_VECTOR_TEXT_POINTS_57,  72,  VTK_VECTOR_TEXT_TRIANGLES_57,   72 },
-{ 0.432768f,  VTK_VECTOR_TEXT_POINTS_58,  14,  VTK_VECTOR_TEXT_TRIANGLES_58,   10 },
-{ 0.432768f,  VTK_VECTOR_TEXT_POINTS_59,  18,  VTK_VECTOR_TEXT_TRIANGLES_59,   14 },
-{ 0.952690f,  VTK_VECTOR_TEXT_POINTS_60,  11,  VTK_VECTOR_TEXT_TRIANGLES_60,    9 },
-{ 0.952768f,  VTK_VECTOR_TEXT_POINTS_61,  12,  VTK_VECTOR_TEXT_TRIANGLES_61,    8 },
-{ 0.952360f,  VTK_VECTOR_TEXT_POINTS_62,  11,  VTK_VECTOR_TEXT_TRIANGLES_62,    9 },
-{ 0.918074f,  VTK_VECTOR_TEXT_POINTS_63,  45,  VTK_VECTOR_TEXT_TRIANGLES_63,   41 },
-{ 1.632597f,  VTK_VECTOR_TEXT_POINTS_64, 114,  VTK_VECTOR_TEXT_TRIANGLES_64,  114 },
-{ 1.155731f,  VTK_VECTOR_TEXT_POINTS_65,  13,  VTK_VECTOR_TEXT_TRIANGLES_65,   13 },
-{ 1.081090f,  VTK_VECTOR_TEXT_POINTS_66,  48,  VTK_VECTOR_TEXT_TRIANGLES_66,   50 },
-{ 1.186046f,  VTK_VECTOR_TEXT_POINTS_67,  56,  VTK_VECTOR_TEXT_TRIANGLES_67,   54 },
-{ 1.167232f,  VTK_VECTOR_TEXT_POINTS_68,  34,  VTK_VECTOR_TEXT_TRIANGLES_68,   34 },
-{ 1.080000f,  VTK_VECTOR_TEXT_POINTS_69,  15,  VTK_VECTOR_TEXT_TRIANGLES_69,   13 },
-{ 1.005714f,  VTK_VECTOR_TEXT_POINTS_70,  12,  VTK_VECTOR_TEXT_TRIANGLES_70,   10 },
-{ 1.234286f,  VTK_VECTOR_TEXT_POINTS_71,  60,  VTK_VECTOR_TEXT_TRIANGLES_71,   58 },
-{ 1.125714f,  VTK_VECTOR_TEXT_POINTS_72,  16,  VTK_VECTOR_TEXT_TRIANGLES_72,   14 },
-{ 0.428571f,  VTK_VECTOR_TEXT_POINTS_73,   4,  VTK_VECTOR_TEXT_TRIANGLES_73,    2 },
-{ 0.790089f,  VTK_VECTOR_TEXT_POINTS_74,  27,  VTK_VECTOR_TEXT_TRIANGLES_74,   25 },
-{ 1.155019f,  VTK_VECTOR_TEXT_POINTS_75,  17,  VTK_VECTOR_TEXT_TRIANGLES_75,   15 },
-{ 0.941339f,  VTK_VECTOR_TEXT_POINTS_76,   7,  VTK_VECTOR_TEXT_TRIANGLES_76,    5 },
-{ 1.302857f,  VTK_VECTOR_TEXT_POINTS_77,  19,  VTK_VECTOR_TEXT_TRIANGLES_77,   17 },
-{ 1.125714f,  VTK_VECTOR_TEXT_POINTS_78,  14,  VTK_VECTOR_TEXT_TRIANGLES_78,   12 },
-{ 1.267054f,  VTK_VECTOR_TEXT_POINTS_79,  63,  VTK_VECTOR_TEXT_TRIANGLES_79,   63 },
-{ 1.098661f,  VTK_VECTOR_TEXT_POINTS_80,  31,  VTK_VECTOR_TEXT_TRIANGLES_80,   31 },
-{ 1.276398f,  VTK_VECTOR_TEXT_POINTS_81,  66,  VTK_VECTOR_TEXT_TRIANGLES_81,   66 },
-{ 1.225355f,  VTK_VECTOR_TEXT_POINTS_82,  46,  VTK_VECTOR_TEXT_TRIANGLES_82,   46 },
-{ 1.081090f,  VTK_VECTOR_TEXT_POINTS_83,  69,  VTK_VECTOR_TEXT_TRIANGLES_83,   67 },
-{ 1.045714f,  VTK_VECTOR_TEXT_POINTS_84,   8,  VTK_VECTOR_TEXT_TRIANGLES_84,    6 },
-{ 1.126804f,  VTK_VECTOR_TEXT_POINTS_85,  32,  VTK_VECTOR_TEXT_TRIANGLES_85,   30 },
-{ 1.148571f,  VTK_VECTOR_TEXT_POINTS_86,   8,  VTK_VECTOR_TEXT_TRIANGLES_86,    6 },
-{ 1.568063f,  VTK_VECTOR_TEXT_POINTS_87,  14,  VTK_VECTOR_TEXT_TRIANGLES_87,   12 },
-{ 1.141168f,  VTK_VECTOR_TEXT_POINTS_88,  14,  VTK_VECTOR_TEXT_TRIANGLES_88,   12 },
-{ 1.145205f,  VTK_VECTOR_TEXT_POINTS_89,  12,  VTK_VECTOR_TEXT_TRIANGLES_89,   10 },
-{ 1.040000f,  VTK_VECTOR_TEXT_POINTS_90,  11,  VTK_VECTOR_TEXT_TRIANGLES_90,    9 },
-{ 0.541339f,  VTK_VECTOR_TEXT_POINTS_91,   8,  VTK_VECTOR_TEXT_TRIANGLES_91,    6 },
-{ 0.564685f,  VTK_VECTOR_TEXT_POINTS_92,   5,  VTK_VECTOR_TEXT_TRIANGLES_92,    3 },
-{ 0.465968f,  VTK_VECTOR_TEXT_POINTS_93,   9,  VTK_VECTOR_TEXT_TRIANGLES_93,    7 },
-{ 0.817005f,  VTK_VECTOR_TEXT_POINTS_94,  11,  VTK_VECTOR_TEXT_TRIANGLES_94,    9 },
-{ 1.011860f,  VTK_VECTOR_TEXT_POINTS_95,   4,  VTK_VECTOR_TEXT_TRIANGLES_95,    2 },
-{ 0.486571f,  VTK_VECTOR_TEXT_POINTS_96,  11,  VTK_VECTOR_TEXT_TRIANGLES_96,    9 },
-{ 0.929303f,  VTK_VECTOR_TEXT_POINTS_97,  70,  VTK_VECTOR_TEXT_TRIANGLES_97,   70 },
-{ 0.932518f,  VTK_VECTOR_TEXT_POINTS_98,  49,  VTK_VECTOR_TEXT_TRIANGLES_98,   49 },
-{ 0.894057f,  VTK_VECTOR_TEXT_POINTS_99,  58,  VTK_VECTOR_TEXT_TRIANGLES_99,   56 },
-{ 0.885714f, VTK_VECTOR_TEXT_POINTS_100,  48, VTK_VECTOR_TEXT_TRIANGLES_100,   48 },
-{ 0.934539f, VTK_VECTOR_TEXT_POINTS_101,  65, VTK_VECTOR_TEXT_TRIANGLES_101,   65 },
-{ 0.617143f, VTK_VECTOR_TEXT_POINTS_102,  24, VTK_VECTOR_TEXT_TRIANGLES_102,   22 },
-{ 0.892518f, VTK_VECTOR_TEXT_POINTS_103,  71, VTK_VECTOR_TEXT_TRIANGLES_103,   71 },
-{ 0.889502f, VTK_VECTOR_TEXT_POINTS_104,  27, VTK_VECTOR_TEXT_TRIANGLES_104,   25 },
-{ 0.377143f, VTK_VECTOR_TEXT_POINTS_105,   8, VTK_VECTOR_TEXT_TRIANGLES_105,    4 },
-{ 0.375625f, VTK_VECTOR_TEXT_POINTS_106,  18, VTK_VECTOR_TEXT_TRIANGLES_106,   14 },
-{ 0.897876f, VTK_VECTOR_TEXT_POINTS_107,  15, VTK_VECTOR_TEXT_TRIANGLES_107,   13 },
-{ 0.371429f, VTK_VECTOR_TEXT_POINTS_108,   4, VTK_VECTOR_TEXT_TRIANGLES_108,    2 },
-{ 1.318074f, VTK_VECTOR_TEXT_POINTS_109,  45, VTK_VECTOR_TEXT_TRIANGLES_109,   43 },
-{ 0.889911f, VTK_VECTOR_TEXT_POINTS_110,  38, VTK_VECTOR_TEXT_TRIANGLES_110,   36 },
-{ 0.938661f, VTK_VECTOR_TEXT_POINTS_111,  65, VTK_VECTOR_TEXT_TRIANGLES_111,   65 },
-{ 0.935625f, VTK_VECTOR_TEXT_POINTS_112,  49, VTK_VECTOR_TEXT_TRIANGLES_112,   49 },
-{ 0.885714f, VTK_VECTOR_TEXT_POINTS_113,  52, VTK_VECTOR_TEXT_TRIANGLES_113,   52 },
-{ 0.667686f, VTK_VECTOR_TEXT_POINTS_114,  24, VTK_VECTOR_TEXT_TRIANGLES_114,   22 },
-{ 0.849502f, VTK_VECTOR_TEXT_POINTS_115,  63, VTK_VECTOR_TEXT_TRIANGLES_115,   61 },
-{ 0.551972f, VTK_VECTOR_TEXT_POINTS_116,  24, VTK_VECTOR_TEXT_TRIANGLES_116,   22 },
-{ 0.884197f, VTK_VECTOR_TEXT_POINTS_117,  38, VTK_VECTOR_TEXT_TRIANGLES_117,   36 },
-{ 0.884203f, VTK_VECTOR_TEXT_POINTS_118,  12, VTK_VECTOR_TEXT_TRIANGLES_118,   10 },
-{ 1.231638f, VTK_VECTOR_TEXT_POINTS_119,  14, VTK_VECTOR_TEXT_TRIANGLES_119,   12 },
-{ 0.882498f, VTK_VECTOR_TEXT_POINTS_120,  17, VTK_VECTOR_TEXT_TRIANGLES_120,   15 },
-{ 0.888063f, VTK_VECTOR_TEXT_POINTS_121,  16, VTK_VECTOR_TEXT_TRIANGLES_121,   14 },
-{ 0.872768f, VTK_VECTOR_TEXT_POINTS_122,  17, VTK_VECTOR_TEXT_TRIANGLES_122,   15 },
-{ 0.611429f, VTK_VECTOR_TEXT_POINTS_123,  39, VTK_VECTOR_TEXT_TRIANGLES_123,   37 },
-{ 0.388571f, VTK_VECTOR_TEXT_POINTS_124,   4, VTK_VECTOR_TEXT_TRIANGLES_124,    2 },
-{ 0.606299f, VTK_VECTOR_TEXT_POINTS_125,  35, VTK_VECTOR_TEXT_TRIANGLES_125,   33 },
-{ 0.971429f, VTK_VECTOR_TEXT_POINTS_126,  25, VTK_VECTOR_TEXT_TRIANGLES_126,   23 },
+{ 0.438482,  VTK_VECTOR_TEXT_POINTS_33,  11,  VTK_VECTOR_TEXT_TRIANGLES_33,    7 },
+{ 0.615625,  VTK_VECTOR_TEXT_POINTS_34,  21,  VTK_VECTOR_TEXT_TRIANGLES_34,   17 },
+{ 0.974539,  VTK_VECTOR_TEXT_POINTS_35,  43,  VTK_VECTOR_TEXT_TRIANGLES_35,   43 },
+{ 0.921518,  VTK_VECTOR_TEXT_POINTS_36,  73,  VTK_VECTOR_TEXT_TRIANGLES_36,   75 },
+{ 1.409911,  VTK_VECTOR_TEXT_POINTS_37,  81,  VTK_VECTOR_TEXT_TRIANGLES_37,   79 },
+{ 1.126291,  VTK_VECTOR_TEXT_POINTS_38,  76,  VTK_VECTOR_TEXT_TRIANGLES_38,   78 },
+{ 0.364197,  VTK_VECTOR_TEXT_POINTS_39,  10,  VTK_VECTOR_TEXT_TRIANGLES_39,    8 },
+{ 0.595731,  VTK_VECTOR_TEXT_POINTS_40,  19,  VTK_VECTOR_TEXT_TRIANGLES_40,   17 },
+{ 0.598482,  VTK_VECTOR_TEXT_POINTS_41,  19,  VTK_VECTOR_TEXT_TRIANGLES_41,   17 },
+{ 0.685300,  VTK_VECTOR_TEXT_POINTS_42,  34,  VTK_VECTOR_TEXT_TRIANGLES_42,   32 },
+{ 0.952768,  VTK_VECTOR_TEXT_POINTS_43,  20,  VTK_VECTOR_TEXT_TRIANGLES_43,   18 },
+{ 0.432768,  VTK_VECTOR_TEXT_POINTS_44,  23,  VTK_VECTOR_TEXT_TRIANGLES_44,   21 },
+{ 0.606146,  VTK_VECTOR_TEXT_POINTS_45,   8,  VTK_VECTOR_TEXT_TRIANGLES_45,    6 },
+{ 0.432768,  VTK_VECTOR_TEXT_POINTS_46,  13,  VTK_VECTOR_TEXT_TRIANGLES_46,   11 },
+{ 0.562348,  VTK_VECTOR_TEXT_POINTS_47,   5,  VTK_VECTOR_TEXT_TRIANGLES_47,    3 },
+{ 0.926804,  VTK_VECTOR_TEXT_POINTS_48,  53,  VTK_VECTOR_TEXT_TRIANGLES_48,   53 },
+{ 0.708571,  VTK_VECTOR_TEXT_POINTS_49,  11,  VTK_VECTOR_TEXT_TRIANGLES_49,    9 },
+{ 0.914286,  VTK_VECTOR_TEXT_POINTS_50,  43,  VTK_VECTOR_TEXT_TRIANGLES_50,   41 },
+{ 0.927232,  VTK_VECTOR_TEXT_POINTS_51,  68,  VTK_VECTOR_TEXT_TRIANGLES_51,   66 },
+{ 0.920000,  VTK_VECTOR_TEXT_POINTS_52,  18,  VTK_VECTOR_TEXT_TRIANGLES_52,   18 },
+{ 0.932946,  VTK_VECTOR_TEXT_POINTS_53,  54,  VTK_VECTOR_TEXT_TRIANGLES_53,   52 },
+{ 0.927232,  VTK_VECTOR_TEXT_POINTS_54,  70,  VTK_VECTOR_TEXT_TRIANGLES_54,   70 },
+{ 0.923788,  VTK_VECTOR_TEXT_POINTS_55,  17,  VTK_VECTOR_TEXT_TRIANGLES_55,   15 },
+{ 0.926804,  VTK_VECTOR_TEXT_POINTS_56,  83,  VTK_VECTOR_TEXT_TRIANGLES_56,   85 },
+{ 0.927232,  VTK_VECTOR_TEXT_POINTS_57,  72,  VTK_VECTOR_TEXT_TRIANGLES_57,   72 },
+{ 0.432768,  VTK_VECTOR_TEXT_POINTS_58,  14,  VTK_VECTOR_TEXT_TRIANGLES_58,   10 },
+{ 0.432768,  VTK_VECTOR_TEXT_POINTS_59,  18,  VTK_VECTOR_TEXT_TRIANGLES_59,   14 },
+{ 0.952690,  VTK_VECTOR_TEXT_POINTS_60,  11,  VTK_VECTOR_TEXT_TRIANGLES_60,    9 },
+{ 0.952768,  VTK_VECTOR_TEXT_POINTS_61,  12,  VTK_VECTOR_TEXT_TRIANGLES_61,    8 },
+{ 0.952360,  VTK_VECTOR_TEXT_POINTS_62,  11,  VTK_VECTOR_TEXT_TRIANGLES_62,    9 },
+{ 0.918074,  VTK_VECTOR_TEXT_POINTS_63,  45,  VTK_VECTOR_TEXT_TRIANGLES_63,   41 },
+{ 1.632597,  VTK_VECTOR_TEXT_POINTS_64, 114,  VTK_VECTOR_TEXT_TRIANGLES_64,  114 },
+{ 1.155731,  VTK_VECTOR_TEXT_POINTS_65,  13,  VTK_VECTOR_TEXT_TRIANGLES_65,   13 },
+{ 1.081090,  VTK_VECTOR_TEXT_POINTS_66,  48,  VTK_VECTOR_TEXT_TRIANGLES_66,   50 },
+{ 1.186046,  VTK_VECTOR_TEXT_POINTS_67,  56,  VTK_VECTOR_TEXT_TRIANGLES_67,   54 },
+{ 1.167232,  VTK_VECTOR_TEXT_POINTS_68,  34,  VTK_VECTOR_TEXT_TRIANGLES_68,   34 },
+{ 1.080000,  VTK_VECTOR_TEXT_POINTS_69,  15,  VTK_VECTOR_TEXT_TRIANGLES_69,   13 },
+{ 1.005714,  VTK_VECTOR_TEXT_POINTS_70,  12,  VTK_VECTOR_TEXT_TRIANGLES_70,   10 },
+{ 1.234286,  VTK_VECTOR_TEXT_POINTS_71,  60,  VTK_VECTOR_TEXT_TRIANGLES_71,   58 },
+{ 1.125714,  VTK_VECTOR_TEXT_POINTS_72,  16,  VTK_VECTOR_TEXT_TRIANGLES_72,   14 },
+{ 0.428571,  VTK_VECTOR_TEXT_POINTS_73,   4,  VTK_VECTOR_TEXT_TRIANGLES_73,    2 },
+{ 0.790089,  VTK_VECTOR_TEXT_POINTS_74,  27,  VTK_VECTOR_TEXT_TRIANGLES_74,   25 },
+{ 1.155019,  VTK_VECTOR_TEXT_POINTS_75,  17,  VTK_VECTOR_TEXT_TRIANGLES_75,   15 },
+{ 0.941339,  VTK_VECTOR_TEXT_POINTS_76,   7,  VTK_VECTOR_TEXT_TRIANGLES_76,    5 },
+{ 1.302857,  VTK_VECTOR_TEXT_POINTS_77,  19,  VTK_VECTOR_TEXT_TRIANGLES_77,   17 },
+{ 1.125714,  VTK_VECTOR_TEXT_POINTS_78,  14,  VTK_VECTOR_TEXT_TRIANGLES_78,   12 },
+{ 1.267054,  VTK_VECTOR_TEXT_POINTS_79,  63,  VTK_VECTOR_TEXT_TRIANGLES_79,   63 },
+{ 1.098661,  VTK_VECTOR_TEXT_POINTS_80,  31,  VTK_VECTOR_TEXT_TRIANGLES_80,   31 },
+{ 1.276398,  VTK_VECTOR_TEXT_POINTS_81,  66,  VTK_VECTOR_TEXT_TRIANGLES_81,   66 },
+{ 1.225355,  VTK_VECTOR_TEXT_POINTS_82,  46,  VTK_VECTOR_TEXT_TRIANGLES_82,   46 },
+{ 1.081090,  VTK_VECTOR_TEXT_POINTS_83,  69,  VTK_VECTOR_TEXT_TRIANGLES_83,   67 },
+{ 1.045714,  VTK_VECTOR_TEXT_POINTS_84,   8,  VTK_VECTOR_TEXT_TRIANGLES_84,    6 },
+{ 1.126804,  VTK_VECTOR_TEXT_POINTS_85,  32,  VTK_VECTOR_TEXT_TRIANGLES_85,   30 },
+{ 1.148571,  VTK_VECTOR_TEXT_POINTS_86,   8,  VTK_VECTOR_TEXT_TRIANGLES_86,    6 },
+{ 1.568063,  VTK_VECTOR_TEXT_POINTS_87,  14,  VTK_VECTOR_TEXT_TRIANGLES_87,   12 },
+{ 1.141168,  VTK_VECTOR_TEXT_POINTS_88,  14,  VTK_VECTOR_TEXT_TRIANGLES_88,   12 },
+{ 1.145205,  VTK_VECTOR_TEXT_POINTS_89,  12,  VTK_VECTOR_TEXT_TRIANGLES_89,   10 },
+{ 1.040000,  VTK_VECTOR_TEXT_POINTS_90,  11,  VTK_VECTOR_TEXT_TRIANGLES_90,    9 },
+{ 0.541339,  VTK_VECTOR_TEXT_POINTS_91,   8,  VTK_VECTOR_TEXT_TRIANGLES_91,    6 },
+{ 0.564685,  VTK_VECTOR_TEXT_POINTS_92,   5,  VTK_VECTOR_TEXT_TRIANGLES_92,    3 },
+{ 0.465968,  VTK_VECTOR_TEXT_POINTS_93,   9,  VTK_VECTOR_TEXT_TRIANGLES_93,    7 },
+{ 0.817005,  VTK_VECTOR_TEXT_POINTS_94,  11,  VTK_VECTOR_TEXT_TRIANGLES_94,    9 },
+{ 1.011860,  VTK_VECTOR_TEXT_POINTS_95,   4,  VTK_VECTOR_TEXT_TRIANGLES_95,    2 },
+{ 0.486571,  VTK_VECTOR_TEXT_POINTS_96,  11,  VTK_VECTOR_TEXT_TRIANGLES_96,    9 },
+{ 0.929303,  VTK_VECTOR_TEXT_POINTS_97,  70,  VTK_VECTOR_TEXT_TRIANGLES_97,   70 },
+{ 0.932518,  VTK_VECTOR_TEXT_POINTS_98,  49,  VTK_VECTOR_TEXT_TRIANGLES_98,   49 },
+{ 0.894057,  VTK_VECTOR_TEXT_POINTS_99,  58,  VTK_VECTOR_TEXT_TRIANGLES_99,   56 },
+{ 0.885714, VTK_VECTOR_TEXT_POINTS_100,  48, VTK_VECTOR_TEXT_TRIANGLES_100,   48 },
+{ 0.934539, VTK_VECTOR_TEXT_POINTS_101,  65, VTK_VECTOR_TEXT_TRIANGLES_101,   65 },
+{ 0.617143, VTK_VECTOR_TEXT_POINTS_102,  24, VTK_VECTOR_TEXT_TRIANGLES_102,   22 },
+{ 0.892518, VTK_VECTOR_TEXT_POINTS_103,  71, VTK_VECTOR_TEXT_TRIANGLES_103,   71 },
+{ 0.889502, VTK_VECTOR_TEXT_POINTS_104,  27, VTK_VECTOR_TEXT_TRIANGLES_104,   25 },
+{ 0.377143, VTK_VECTOR_TEXT_POINTS_105,   8, VTK_VECTOR_TEXT_TRIANGLES_105,    4 },
+{ 0.375625, VTK_VECTOR_TEXT_POINTS_106,  18, VTK_VECTOR_TEXT_TRIANGLES_106,   14 },
+{ 0.897876, VTK_VECTOR_TEXT_POINTS_107,  15, VTK_VECTOR_TEXT_TRIANGLES_107,   13 },
+{ 0.371429, VTK_VECTOR_TEXT_POINTS_108,   4, VTK_VECTOR_TEXT_TRIANGLES_108,    2 },
+{ 1.318074, VTK_VECTOR_TEXT_POINTS_109,  45, VTK_VECTOR_TEXT_TRIANGLES_109,   43 },
+{ 0.889911, VTK_VECTOR_TEXT_POINTS_110,  38, VTK_VECTOR_TEXT_TRIANGLES_110,   36 },
+{ 0.938661, VTK_VECTOR_TEXT_POINTS_111,  65, VTK_VECTOR_TEXT_TRIANGLES_111,   65 },
+{ 0.935625, VTK_VECTOR_TEXT_POINTS_112,  49, VTK_VECTOR_TEXT_TRIANGLES_112,   49 },
+{ 0.885714, VTK_VECTOR_TEXT_POINTS_113,  52, VTK_VECTOR_TEXT_TRIANGLES_113,   52 },
+{ 0.667686, VTK_VECTOR_TEXT_POINTS_114,  24, VTK_VECTOR_TEXT_TRIANGLES_114,   22 },
+{ 0.849502, VTK_VECTOR_TEXT_POINTS_115,  63, VTK_VECTOR_TEXT_TRIANGLES_115,   61 },
+{ 0.551972, VTK_VECTOR_TEXT_POINTS_116,  24, VTK_VECTOR_TEXT_TRIANGLES_116,   22 },
+{ 0.884197, VTK_VECTOR_TEXT_POINTS_117,  38, VTK_VECTOR_TEXT_TRIANGLES_117,   36 },
+{ 0.884203, VTK_VECTOR_TEXT_POINTS_118,  12, VTK_VECTOR_TEXT_TRIANGLES_118,   10 },
+{ 1.231638, VTK_VECTOR_TEXT_POINTS_119,  14, VTK_VECTOR_TEXT_TRIANGLES_119,   12 },
+{ 0.882498, VTK_VECTOR_TEXT_POINTS_120,  17, VTK_VECTOR_TEXT_TRIANGLES_120,   15 },
+{ 0.888063, VTK_VECTOR_TEXT_POINTS_121,  16, VTK_VECTOR_TEXT_TRIANGLES_121,   14 },
+{ 0.872768, VTK_VECTOR_TEXT_POINTS_122,  17, VTK_VECTOR_TEXT_TRIANGLES_122,   15 },
+{ 0.611429, VTK_VECTOR_TEXT_POINTS_123,  39, VTK_VECTOR_TEXT_TRIANGLES_123,   37 },
+{ 0.388571, VTK_VECTOR_TEXT_POINTS_124,   4, VTK_VECTOR_TEXT_TRIANGLES_124,    2 },
+{ 0.606299, VTK_VECTOR_TEXT_POINTS_125,  35, VTK_VECTOR_TEXT_TRIANGLES_125,   33 },
+{ 0.971429, VTK_VECTOR_TEXT_POINTS_126,  25, VTK_VECTOR_TEXT_TRIANGLES_126,   23 },
 };
 
 // Construct object with no string set and backing enabled.
@@ -1803,5 +1803,8 @@ void vtkVectorText::PrintSelf(ostream& os, vtkIndent indent)
 
 vtkVectorText::~vtkVectorText()
 {
-  delete [] this->Text;
+  if (this->Text)
+    {
+    delete [] this->Text;
+    }
 }
diff --git a/Rendering/FreeTypeFontConfig/Testing/Data/Baseline/TestSystemFontRendering_4.png.md5 b/Rendering/FreeTypeFontConfig/Testing/Data/Baseline/TestSystemFontRendering_4.png.md5
deleted file mode 100644
index bd1ebf3..0000000
--- a/Rendering/FreeTypeFontConfig/Testing/Data/Baseline/TestSystemFontRendering_4.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-60c03ff3f63698d1ad25a53dd451eca2
diff --git a/Rendering/FreeTypeOpenGL/CMakeLists.txt b/Rendering/FreeTypeOpenGL/CMakeLists.txt
new file mode 100644
index 0000000..a4caaf6
--- /dev/null
+++ b/Rendering/FreeTypeOpenGL/CMakeLists.txt
@@ -0,0 +1,15 @@
+include(vtkObjectFactory)
+
+set(Module_SRCS
+  vtkOpenGLFreeTypeTextMapper.cxx
+  )
+
+set(vtk_module_overrides "vtkTextMapper")
+set(vtk_module_vtkTextMapper_override "vtkOpenGLFreeTypeTextMapper")
+vtk_object_factory_configure("${vtk_module_overrides}")
+
+list(APPEND Module_SRCS
+  ${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.cxx)
+set_source_files_properties(${vtk-module}ObjectFactory.cxx WRAP_EXCLUDE)
+
+vtk_module_library(${vtk-module} ${Module_SRCS})
diff --git a/Rendering/FreeTypeOpenGL/module.cmake b/Rendering/FreeTypeOpenGL/module.cmake
new file mode 100644
index 0000000..3f66523
--- /dev/null
+++ b/Rendering/FreeTypeOpenGL/module.cmake
@@ -0,0 +1,15 @@
+vtk_module(vtkRenderingFreeTypeOpenGL
+  IMPLEMENTS
+    vtkRenderingCore
+  BACKEND
+    OpenGL
+  DEPENDS
+    vtkRenderingFreeType
+    vtkRenderingOpenGL
+  TEST_DEPENDS
+    vtkTestingCore
+    vtkTestingRendering
+    vtkInteractionStyle
+  KIT
+    vtkOpenGL
+  )
diff --git a/Rendering/FreeTypeOpenGL/vtkOpenGLFreeTypeTextMapper.cxx b/Rendering/FreeTypeOpenGL/vtkOpenGLFreeTypeTextMapper.cxx
new file mode 100644
index 0000000..6654692
--- /dev/null
+++ b/Rendering/FreeTypeOpenGL/vtkOpenGLFreeTypeTextMapper.cxx
@@ -0,0 +1,614 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+  Module:    vtkOpenGLFreeTypeTextMapper.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 "vtkOpenGLFreeTypeTextMapper.h"
+
+#include "vtkActor2D.h"
+#include "vtkObjectFactory.h"
+#include "vtkProperty2D.h"
+#include "vtkTextProperty.h"
+#include "vtkViewport.h"
+#include "vtkWindow.h"
+#include "vtkOpenGLError.h"
+
+#include "vtkFreeTypeUtilities.h"
+#include "vtkftglConfig.h"
+
+#include "vtkgluPickMatrix.h"
+
+#include "FTFont.h"
+
+#ifdef FTGL_USE_NAMESPACE
+using namespace ftgl;
+#endif
+
+namespace {
+inline int GetNumberOfLinesImpl(const char *str)
+{
+  if (str == NULL || *str == '\0')
+    {
+    return 0;
+    }
+
+  int result = 1;
+  while (str != NULL)
+    {
+    if ((str = strstr(str, "\n")) != NULL)
+      {
+      result++;
+      str++; // Skip '\n'
+      }
+    }
+  return result;
+}
+}
+
+//----------------------------------------------------------------------------
+// Print debug info
+
+#define VTK_FTTM_DEBUG 0
+
+//----------------------------------------------------------------------------
+// GL2PS related internal helper functions.
+
+//----------------------------------------------------------------------------
+vtkStandardNewMacro(vtkOpenGLFreeTypeTextMapper);
+
+//----------------------------------------------------------------------------
+vtkOpenGLFreeTypeTextMapper::vtkOpenGLFreeTypeTextMapper()
+{
+  this->LastSize[0] = 0;
+  this->LastSize[1] = 0;
+  this->TextLines = NULL;
+  this->NumberOfLines = 0;
+  this->NumberOfLinesAllocated = 0;
+}
+
+//----------------------------------------------------------------------------
+vtkOpenGLFreeTypeTextMapper::~vtkOpenGLFreeTypeTextMapper()
+{
+  if (this->TextLines != NULL)
+    {
+    for (int i=0; i < this->NumberOfLinesAllocated; i++)
+      {
+      this->TextLines[i]->Delete();
+      }
+    delete [] this->TextLines;
+    }
+
+  if (this->LastWindow)
+    {
+    this->ReleaseGraphicsResources(this->LastWindow);
+    }
+}
+
+//----------------------------------------------------------------------------
+char *vtkOpenGLFreeTypeTextMapper::NextLine(const char *input, int lineNum)
+{
+  const char *ptr, *ptrEnd;
+  int strLen;
+  char *line;
+
+  ptr = input;
+  for (int i=0; i != lineNum; i++)
+    {
+    ptr = strstr(ptr,"\n");
+    ptr++;
+    }
+  ptrEnd = strstr(ptr,"\n");
+  if ( ptrEnd == NULL )
+    {
+    ptrEnd = strchr(ptr, '\0');
+    }
+
+  strLen = ptrEnd - ptr;
+  line = new char[strLen+1];
+  strncpy(line, ptr, strLen);
+  line[strLen] = '\0';
+
+  return line;
+}
+
+//----------------------------------------------------------------------------
+void vtkOpenGLFreeTypeTextMapper::GetMultiLineSize(vtkViewport *viewport,
+                                                   int size[])
+{
+  int i;
+  int lineSize[2];
+
+  vtkTextProperty *tprop = this->GetTextProperty();
+  if (!tprop)
+    {
+    vtkErrorMacro(<<"Need text property to get multiline size of mapper");
+    size[0] = size[1] = 0;
+    return;
+    }
+
+  lineSize[0] = lineSize[1] = size[0] = size[1] = 0;
+  for ( i=0; i < this->NumberOfLines; i++ )
+    {
+    this->TextLines[i]->GetTextProperty()->ShallowCopy(tprop);
+    this->TextLines[i]->GetSize(viewport, lineSize);
+    size[0] = (lineSize[0] > size[0] ? lineSize[0] : size[0]);
+    size[1] = (lineSize[1] > size[1] ? lineSize[1] : size[1]);
+    }
+
+  // add in the line spacing
+  this->LineSize = size[1];
+  size[1] = static_cast<int>(
+    size[1] * (1.0 + (this->NumberOfLines - 1) * tprop->GetLineSpacing()));
+}
+
+//----------------------------------------------------------------------------
+void vtkOpenGLFreeTypeTextMapper::RenderOverlayMultipleLines(
+    vtkViewport *viewport, vtkActor2D *actor)
+{
+  float offset = 0.0f;
+  int size[2];
+  // make sure LineSize is up to date
+  this->GetMultiLineSize(viewport,size);
+
+  vtkTextProperty *tprop = this->GetTextProperty();
+  if (!tprop)
+    {
+    vtkErrorMacro(<<"Need text property to render multiple lines of mapper");
+    return;
+    }
+
+  switch (tprop->GetVerticalJustification())
+    {
+    case VTK_TEXT_TOP:
+      offset = 0.0f;
+      break;
+    case VTK_TEXT_CENTERED:
+      offset = (-this->NumberOfLines + 1.0f) / 2.0f;
+      break;
+    case VTK_TEXT_BOTTOM:
+      offset = -this->NumberOfLines + 1.0f;
+      break;
+    }
+
+  for (int lineNum=0; lineNum < this->NumberOfLines; lineNum++)
+    {
+    this->TextLines[lineNum]->GetTextProperty()->ShallowCopy(tprop);
+    this->TextLines[lineNum]->GetTextProperty()->SetLineOffset
+      (tprop->GetLineOffset() +
+       static_cast<int>(this->LineSize * (lineNum + offset)
+                        * tprop->GetLineSpacing()));
+    this->TextLines[lineNum]->RenderOverlay(viewport,actor);
+    }
+}
+
+//----------------------------------------------------------------------------
+void vtkOpenGLFreeTypeTextMapper::ReleaseGraphicsResources(vtkWindow *)
+{
+#if VTK_FTTM_DEBUG
+    printf("vtkOpenGLFreeTypeTextMapper::ReleaseGraphicsResources\n");
+#endif
+
+  this->LastWindow = NULL;
+
+  // Very important
+  // the release of graphics resources indicates that significant changes have
+  // occurred. Old fonts, cached sizes etc are all no longer valid, so we send
+  // ourselves a general modified message.
+
+  // this->Modified();
+}
+
+//----------------------------------------------------------------------------
+void vtkOpenGLFreeTypeTextMapper::GetSize(vtkViewport* viewport, int *size)
+{
+  // Check for multiline
+
+  if (this->NumberOfLines > 1)
+    {
+    this->GetMultiLineSize(viewport, size);
+    return;
+    }
+
+  // Check for input
+
+  if (this->Input == NULL || this->Input[0] == '\0')
+    {
+    size[0] = size[1] = 0;
+    return;
+    }
+
+  vtkTextProperty *tprop = this->GetTextProperty();
+  if (!tprop)
+    {
+    vtkErrorMacro(<< "Need a text property to get size");
+    size[0] = size[1] = 0;
+    return;
+    }
+
+  // Check to see whether we have to rebuild anything
+
+  if (this->GetMTime() < this->SizeBuildTime &&
+      tprop->GetMTime() < this->SizeBuildTime)
+    {
+#if VTK_FTTM_DEBUG
+  printf("vtkOpenGLFreeTypeTextMapper::GetSize: In cache!\n");
+#endif
+
+    size[0] = this->LastSize[0];
+    size[1] = this->LastSize[1];
+    return;
+    }
+
+  // Check for font and try to set the size
+
+  vtkFreeTypeUtilities::Entry *entry =
+    vtkFreeTypeUtilities::GetInstance()->GetFont(tprop);
+  FTFont *font = entry ? entry->Font : NULL;
+  if (!font)
+    {
+    vtkErrorMacro(<< "Render - No font");
+    size[0] = size[1] = 0;
+    return;
+    }
+
+  // The font global ascender and descender might just be too high
+  // for given a face. Let's get a compromise by computing these values
+  // from some usual ascii chars.
+
+  if (entry->LargestAscender < 0 || entry->LargestDescender < 0)
+    {
+    float llx, lly, llz, urx, ury, urz;
+    font->BBox("_/7Agfy", llx, lly, llz, urx, ury, urz);
+    entry->LargestAscender = ury;
+    entry->LargestDescender = lly;
+    }
+
+  this->LastSize[0] = size[0] = static_cast<int>(font->Advance(this->Input));
+  this->LastSize[1] = size[1] =
+    static_cast<int>(entry->LargestAscender - entry->LargestDescender);
+  this->LastLargestDescender = static_cast<int>(entry->LargestDescender);
+
+  this->SizeBuildTime.Modified();
+}
+
+//----------------------------------------------------------------------------
+void vtkOpenGLFreeTypeTextMapper::RenderOverlay(vtkViewport* viewport,
+                                                vtkActor2D* actor)
+{
+  vtkDebugMacro (<< "RenderOverlay");
+
+  // Check for input
+
+  if (this->Input == NULL || this->Input[0] == '\0')
+    {
+    return;
+    }
+
+  // Check for multi-lines
+
+  if (this->NumberOfLines > 1)
+    {
+    this->RenderOverlayMultipleLines(viewport, actor);
+    return;
+    }
+
+  // Get text property
+
+  vtkTextProperty *tprop = this->GetTextProperty();
+  if (!tprop)
+    {
+    vtkErrorMacro(<< "Need a text property to render mapper");
+    return;
+    }
+
+  vtkOpenGLClearErrorMacro();
+
+  // Get the window information for display
+
+  vtkWindow* window = viewport->GetVTKWindow();
+  if (this->LastWindow && this->LastWindow != window)
+    {
+    this->ReleaseGraphicsResources(this->LastWindow);
+    }
+  this->LastWindow = window;
+
+  // Get size of text
+
+  int size[2];
+  this->GetSize(viewport, size);
+
+  // Get the position of the text actor
+
+  int* actorPos;
+  actorPos =
+    actor->GetActualPositionCoordinate()->GetComputedViewportValue(viewport);
+
+  // Define bounding rectangle
+
+  int pos[2];
+  pos[0] = actorPos[0];
+  pos[1] = static_cast<int>(actorPos[1] - tprop->GetLineOffset());
+
+  switch (tprop->GetJustification())
+    {
+    case VTK_TEXT_LEFT:
+      break;
+    case VTK_TEXT_CENTERED:
+      pos[0] = pos[0] - size[0] / 2;
+      break;
+    case VTK_TEXT_RIGHT:
+      pos[0] = pos[0] - size[0];
+      break;
+    }
+
+  switch (tprop->GetVerticalJustification())
+    {
+    case VTK_TEXT_TOP:
+      pos[1] = pos[1] - size[1] - this->LastLargestDescender;
+      break;
+    case VTK_TEXT_CENTERED:
+      pos[1] = pos[1] - size[1] / 2 - this->LastLargestDescender / 2;
+      break;
+    case VTK_TEXT_BOTTOM:
+      break;
+    }
+
+  // Push a 2D matrix on the stack
+
+  int *vsize = viewport->GetSize();
+  double *vport = viewport->GetViewport();
+  double *tileViewport = viewport->GetVTKWindow()->GetTileViewport();
+  double visVP[4];
+
+  visVP[0] = (vport[0] >= tileViewport[0]) ? vport[0] : tileViewport[0];
+  visVP[1] = (vport[1] >= tileViewport[1]) ? vport[1] : tileViewport[1];
+  visVP[2] = (vport[2] <= tileViewport[2]) ? vport[2] : tileViewport[2];
+  visVP[3] = (vport[3] <= tileViewport[3]) ? vport[3] : tileViewport[3];
+
+  if (visVP[0] == visVP[2] || visVP[1] == visVP[3])
+    {
+    return;
+    }
+
+  glMatrixMode(GL_PROJECTION);
+  glPushMatrix();
+  glLoadIdentity();
+
+  if(viewport->GetIsPicking())
+    {
+    vtkgluPickMatrix(viewport->GetPickX(), viewport->GetPickY(),
+                     viewport->GetPickWidth(),
+                     viewport->GetPickHeight(),
+                     viewport->GetOrigin(), viewport->GetSize());
+    }
+
+  glMatrixMode(GL_MODELVIEW);
+  glPushMatrix();
+  glLoadIdentity();
+
+  // Store the state of the attributes we are about to change
+  GLboolean lightingEnabled = glIsEnabled(GL_LIGHTING);
+  GLint depthFunc;
+  glGetIntegerv(GL_DEPTH_FUNC, &depthFunc);
+  glDisable(GL_LIGHTING);
+  glDepthFunc(GL_ALWAYS);
+
+  if (actor->GetProperty()->GetDisplayLocation() == VTK_FOREGROUND_LOCATION)
+    {
+    glOrtho(0, vsize[0] - 1, 0, vsize[1] - 1, 0, 1);
+    }
+  else
+    {
+    glOrtho(0, vsize[0] - 1, 0, vsize[1] - 1, -1, 0);
+    }
+
+  int *winSize = viewport->GetVTKWindow()->GetSize();
+
+  int xoff = static_cast<int>(pos[0] - winSize[0] * (visVP[0] - vport[0]));
+  int yoff = static_cast<int>(pos[1] - winSize[1] * (visVP[1] - vport[1]));
+
+  // When picking draw the bounds of the text as a rectangle,
+  // as text only picks when the pick point is exactly on the
+  // origin of the text
+
+  if (viewport->GetIsPicking())
+    {
+    float x1 = (2.0 * actorPos[0]) / vsize[0] - 1.0;
+    float y1 = 2.0 * (actorPos[1] - tprop->GetLineOffset())/vsize[1] - 1.0;
+    float width = (2.0 * size[0]) / vsize[0];
+    float height = (2.0 * size[1]) / vsize[1];
+    glRectf(x1, y1, x1 + width, y1 + height);
+
+    // Clean up and return after drawing the rectangle
+    // Restore the original state
+    glMatrixMode(GL_PROJECTION);
+    glPopMatrix();
+    glMatrixMode(GL_MODELVIEW);
+    glPopMatrix();
+    if (lightingEnabled)
+      {
+      glEnable(GL_LIGHTING);
+      }
+    glDepthFunc(depthFunc);
+
+    return;
+    }
+
+  double* tprop_color = tprop->GetColor();
+  double tprop_opacity = tprop->GetOpacity();
+
+  // Get the font
+
+  vtkFreeTypeUtilities::Entry *entry =
+    vtkFreeTypeUtilities::GetInstance()->GetFont(tprop, tprop_color);
+  FTFont *font = entry ? entry->Font : NULL;
+  if (!font)
+    {
+    vtkErrorMacro(<< "Render - No font");
+    return;
+    }
+
+  struct FTGLRenderContext *ftgl_context = 0;
+
+  // Set up the shadow color
+
+  if (tprop->GetShadow())
+    {
+    double shadow_color[3], rgb;
+    rgb = ((tprop_color[0] + tprop_color[1] + tprop_color[2]) / 3.0 > 0.5)
+      ? 0.0 : 1.0;
+    shadow_color[0] = shadow_color[1] = shadow_color[2] = rgb;
+
+    // Get the shadow font
+
+    vtkFreeTypeUtilities::Entry *shadow_entry =
+      vtkFreeTypeUtilities::GetInstance()->GetFont(tprop, shadow_color);
+    FTFont *shadow_font = shadow_entry ? shadow_entry->Font : NULL;
+    if (!shadow_font)
+      {
+      vtkErrorMacro(<< "Render - No shadow font");
+      return;
+      }
+
+    // Set the color here since load/render glyphs is done
+    // on demand and this color has to be consistent for a given font entry.
+
+    glColor4ub(static_cast<unsigned char>(shadow_color[0] * 255.0),
+               static_cast<unsigned char>(shadow_color[1] * 255.0),
+               static_cast<unsigned char>(shadow_color[2] * 255.0),
+               static_cast<unsigned char>(tprop_opacity * 255.0));
+
+    // Required for clipping to work correctly
+
+    glRasterPos2i(0, 0);
+    glBitmap(0, 0, 0, 0,
+             xoff + tprop->GetShadowOffset()[0],
+             yoff + tprop->GetShadowOffset()[1], NULL);
+
+    // Draw the shadow text
+
+    shadow_font->render(this->Input, ftgl_context);
+
+    // Get the font again, Duh, since it may have been freed from the
+    // cache by the shadow font
+
+    font = vtkFreeTypeUtilities::GetInstance()->GetFont(
+      tprop, tprop_color)->Font;
+    if (!font)
+      {
+      vtkErrorMacro(<< "Render - No font");
+      return;
+      }
+    }
+
+  // Set the color here since load/render glyphs is done
+  // on demand and this color has to be consistent for a given font entry.
+
+  glColor4ub(static_cast<unsigned char>(tprop_color[0] * 255.0),
+             static_cast<unsigned char>(tprop_color[1] * 255.0),
+             static_cast<unsigned char>(tprop_color[2] * 255.0),
+             static_cast<unsigned char>(tprop_opacity * 255.0));
+
+  // Required for clipping to work correctly
+
+  glRasterPos2i(0, 0);
+  glBitmap(0, 0, 0, 0, xoff, yoff, NULL);
+
+  // Display a string
+
+  font->render(this->Input, ftgl_context);
+
+  glFlush();
+
+  // Restore the original GL state
+  glMatrixMode(GL_PROJECTION);
+  glPopMatrix();
+  glMatrixMode(GL_MODELVIEW);
+  glPopMatrix();
+  if (lightingEnabled)
+    {
+    glEnable(GL_LIGHTING);
+    }
+  glDepthFunc(depthFunc);
+
+  vtkOpenGLCheckErrorMacro("failed after RenderOverlay");
+}
+
+//----------------------------------------------------------------------------
+void vtkOpenGLFreeTypeTextMapper::PrintSelf(ostream& os, vtkIndent indent)
+{
+  this->Superclass::PrintSelf(os,indent);
+  os << indent << "NumberOfLines: " << this->NumberOfLines << "\n";
+}
+
+//----------------------------------------------------------------------------
+void vtkOpenGLFreeTypeTextMapper::SetInput(const char *input)
+{
+  if ( this->Input && input && (!strcmp(this->Input,input)))
+    {
+    return;
+    }
+  delete [] this->Input;
+  if (input)
+    {
+    this->Input = new char[strlen(input)+1];
+    strcpy(this->Input,input);
+    }
+  else
+    {
+    this->Input = NULL;
+    }
+  this->Modified();
+
+  int numLines = GetNumberOfLinesImpl(input);
+
+  if ( numLines <= 1) // a line with no "\n"
+    {
+    this->NumberOfLines = numLines;
+    }
+
+  else //multiple lines
+    {
+    char *line;
+    int i;
+
+    if ( numLines > this->NumberOfLinesAllocated )
+      {
+      // delete old stuff
+      if ( this->TextLines )
+        {
+        for (i=0; i < this->NumberOfLinesAllocated; i++)
+          {
+          this->TextLines[i]->Delete();
+          }
+        delete [] this->TextLines;
+        }
+
+      // allocate new text mappers
+      this->NumberOfLinesAllocated = numLines;
+      this->TextLines = new vtkTextMapper *[numLines];
+      for (i=0; i < numLines; i++)
+        {
+        this->TextLines[i] = vtkTextMapper::New();
+        }
+      } //if we need to reallocate
+
+    // set the input strings
+    this->NumberOfLines = numLines;
+    for (i=0; i < this->NumberOfLines; i++)
+      {
+      line = this->NextLine(input, i);
+      this->TextLines[i]->SetInput( line );
+      delete [] line;
+      }
+    }
+}
diff --git a/Rendering/FreeTypeOpenGL/vtkOpenGLFreeTypeTextMapper.h b/Rendering/FreeTypeOpenGL/vtkOpenGLFreeTypeTextMapper.h
new file mode 100644
index 0000000..e8e57cd
--- /dev/null
+++ b/Rendering/FreeTypeOpenGL/vtkOpenGLFreeTypeTextMapper.h
@@ -0,0 +1,78 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+  Module:    vtkOpenGLFreeTypeTextMapper.h
+
+  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.
+
+=========================================================================*/
+// .NAME vtkOpenGLFreeTypeTextMapper - 2D Text annotation support
+// .SECTION Description
+// vtkOpenGLFreeTypeTextMapper provides 2D text annotation support for VTK
+// using the FreeType and FTGL libraries. Normally the user should use
+// vtktextMapper which in turn will use this class.
+
+// .SECTION See Also
+// vtkTextMapper
+
+#ifndef vtkOpenGLFreeTypeTextMapper_h
+#define vtkOpenGLFreeTypeTextMapper_h
+
+#include "vtkRenderingFreeTypeOpenGLModule.h" // For export macro
+#include "vtkTextMapper.h"
+
+class VTKRENDERINGFREETYPEOPENGL_EXPORT vtkOpenGLFreeTypeTextMapper
+  : public vtkTextMapper
+{
+public:
+  vtkTypeMacro(vtkOpenGLFreeTypeTextMapper, vtkTextMapper);
+  static vtkOpenGLFreeTypeTextMapper *New();
+  virtual void PrintSelf(ostream& os, vtkIndent indent);
+
+  void SetInput(const char *inputString);
+
+  // Description:
+  // Actally draw the text.
+  void RenderOverlay(vtkViewport* viewport, vtkActor2D* actor);
+
+  // Description:
+  // Release any graphics resources that are being consumed by this actor.
+  // The parameter window could be used to determine which graphic
+  // resources to release.
+  virtual void ReleaseGraphicsResources(vtkWindow *);
+
+  // Description:
+  // Return the the size of the rectangle required to draw this
+  // mapper.
+  virtual void GetSize(vtkViewport* viewport, int size[2]);
+
+protected:
+  vtkOpenGLFreeTypeTextMapper();
+  ~vtkOpenGLFreeTypeTextMapper();
+
+  vtkTimeStamp  SizeBuildTime;
+  int LastSize[2];
+  int LastLargestDescender;
+  int LineSize;
+  int NumberOfLines;
+  int NumberOfLinesAllocated;
+  vtkTextMapper **TextLines;
+
+  // Description:
+  // These functions are used to parse, process, and render multiple lines
+  char *NextLine(const char *input, int lineNum);
+  void GetMultiLineSize(vtkViewport* viewport, int size[2]);
+  void RenderOverlayMultipleLines(vtkViewport *viewport, vtkActor2D *actor);
+
+private:
+  vtkOpenGLFreeTypeTextMapper(const vtkOpenGLFreeTypeTextMapper&);  // Not implemented.
+  void operator=(const vtkOpenGLFreeTypeTextMapper&);  // Not implemented.
+};
+
+#endif
diff --git a/Rendering/FreeTypeOpenGL2/CMakeLists.txt b/Rendering/FreeTypeOpenGL2/CMakeLists.txt
new file mode 100644
index 0000000..a4caaf6
--- /dev/null
+++ b/Rendering/FreeTypeOpenGL2/CMakeLists.txt
@@ -0,0 +1,15 @@
+include(vtkObjectFactory)
+
+set(Module_SRCS
+  vtkOpenGLFreeTypeTextMapper.cxx
+  )
+
+set(vtk_module_overrides "vtkTextMapper")
+set(vtk_module_vtkTextMapper_override "vtkOpenGLFreeTypeTextMapper")
+vtk_object_factory_configure("${vtk_module_overrides}")
+
+list(APPEND Module_SRCS
+  ${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.cxx)
+set_source_files_properties(${vtk-module}ObjectFactory.cxx WRAP_EXCLUDE)
+
+vtk_module_library(${vtk-module} ${Module_SRCS})
diff --git a/Rendering/FreeTypeOpenGL2/module.cmake b/Rendering/FreeTypeOpenGL2/module.cmake
new file mode 100644
index 0000000..3446c10
--- /dev/null
+++ b/Rendering/FreeTypeOpenGL2/module.cmake
@@ -0,0 +1,20 @@
+if (NOT ANDROID AND NOT APPLE_IOS)
+  set(include_in_backend BACKEND OpenGL2)
+endif()
+
+vtk_module(vtkRenderingFreeTypeOpenGL2
+  IMPLEMENTS
+    vtkRenderingCore
+  TCL_NAME
+    vtkRenderingFreeTypeOpenGLII
+  ${include_in_backend}
+  DEPENDS
+    vtkRenderingFreeType
+    vtkRenderingOpenGL2
+  TEST_DEPENDS
+    vtkTestingCore
+    vtkTestingRendering
+    vtkInteractionStyle
+  KIT
+    vtkOpenGL
+  )
diff --git a/Rendering/FreeTypeOpenGL2/vtkOpenGLFreeTypeTextMapper.cxx b/Rendering/FreeTypeOpenGL2/vtkOpenGLFreeTypeTextMapper.cxx
new file mode 100644
index 0000000..776cc19
--- /dev/null
+++ b/Rendering/FreeTypeOpenGL2/vtkOpenGLFreeTypeTextMapper.cxx
@@ -0,0 +1,609 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+  Module:    vtkOpenGLFreeTypeTextMapper.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 "vtkOpenGLFreeTypeTextMapper.h"
+
+#include "vtkActor2D.h"
+#include "vtkObjectFactory.h"
+#include "vtkProperty2D.h"
+#include "vtkTextProperty.h"
+#include "vtkViewport.h"
+#include "vtkWindow.h"
+#include "vtkOpenGLError.h"
+
+#include "vtkFreeTypeUtilities.h"
+#include "vtkftglConfig.h"
+
+#include "FTFont.h"
+
+#include "vtkOpenGLShaderCache.h"
+#include "vtkOpenGLRenderWindow.h"
+
+#ifdef FTGL_USE_NAMESPACE
+using namespace ftgl;
+#endif
+
+namespace {
+inline int GetNumberOfLinesImpl(const char *str)
+{
+  if (str == NULL || *str == '\0')
+    {
+    return 0;
+    }
+
+  int result = 1;
+  while (str != NULL)
+    {
+    if ((str = strstr(str, "\n")) != NULL)
+      {
+      result++;
+      str++; // Skip '\n'
+      }
+    }
+  return result;
+}
+}
+
+//----------------------------------------------------------------------------
+// Print debug info
+
+#define VTK_FTTM_DEBUG 0
+
+//----------------------------------------------------------------------------
+// GL2PS related internal helper functions.
+
+//----------------------------------------------------------------------------
+vtkStandardNewMacro(vtkOpenGLFreeTypeTextMapper);
+
+//----------------------------------------------------------------------------
+vtkOpenGLFreeTypeTextMapper::vtkOpenGLFreeTypeTextMapper()
+{
+  this->LastSize[0] = 0;
+  this->LastSize[1] = 0;
+  this->TextLines = NULL;
+  this->NumberOfLines = 0;
+  this->NumberOfLinesAllocated = 0;
+}
+
+//----------------------------------------------------------------------------
+vtkOpenGLFreeTypeTextMapper::~vtkOpenGLFreeTypeTextMapper()
+{
+  if (this->TextLines != NULL)
+    {
+    for (int i=0; i < this->NumberOfLinesAllocated; i++)
+      {
+      this->TextLines[i]->Delete();
+      }
+    delete [] this->TextLines;
+    }
+
+  if (this->LastWindow)
+    {
+    this->ReleaseGraphicsResources(this->LastWindow);
+    }
+}
+
+//----------------------------------------------------------------------------
+char *vtkOpenGLFreeTypeTextMapper::NextLine(const char *input, int lineNum)
+{
+  const char *ptr, *ptrEnd;
+  int strLen;
+  char *line;
+
+  ptr = input;
+  for (int i=0; i != lineNum; i++)
+    {
+    ptr = strstr(ptr,"\n");
+    ptr++;
+    }
+  ptrEnd = strstr(ptr,"\n");
+  if ( ptrEnd == NULL )
+    {
+    ptrEnd = strchr(ptr, '\0');
+    }
+
+  strLen = ptrEnd - ptr;
+  line = new char[strLen+1];
+  strncpy(line, ptr, strLen);
+  line[strLen] = '\0';
+
+  return line;
+}
+
+//----------------------------------------------------------------------------
+void vtkOpenGLFreeTypeTextMapper::GetMultiLineSize(vtkViewport *viewport,
+                                                   int size[])
+{
+  int i;
+  int lineSize[2];
+
+  vtkTextProperty *tprop = this->GetTextProperty();
+  if (!tprop)
+    {
+    vtkErrorMacro(<<"Need text property to get multiline size of mapper");
+    size[0] = size[1] = 0;
+    return;
+    }
+
+  lineSize[0] = lineSize[1] = size[0] = size[1] = 0;
+  for ( i=0; i < this->NumberOfLines; i++ )
+    {
+    this->TextLines[i]->GetTextProperty()->ShallowCopy(tprop);
+    this->TextLines[i]->GetSize(viewport, lineSize);
+    size[0] = (lineSize[0] > size[0] ? lineSize[0] : size[0]);
+    size[1] = (lineSize[1] > size[1] ? lineSize[1] : size[1]);
+    }
+
+  // add in the line spacing
+  this->LineSize = size[1];
+  size[1] = static_cast<int>(
+    size[1] * (1.0 + (this->NumberOfLines - 1) * tprop->GetLineSpacing()));
+}
+
+//----------------------------------------------------------------------------
+void vtkOpenGLFreeTypeTextMapper::RenderOverlayMultipleLines(
+    vtkViewport *viewport, vtkActor2D *actor)
+{
+  float offset = 0.0f;
+  int size[2];
+  // make sure LineSize is up to date
+  this->GetMultiLineSize(viewport,size);
+
+  vtkTextProperty *tprop = this->GetTextProperty();
+  if (!tprop)
+    {
+    vtkErrorMacro(<<"Need text property to render multiple lines of mapper");
+    return;
+    }
+
+  switch (tprop->GetVerticalJustification())
+    {
+    case VTK_TEXT_TOP:
+      offset = 0.0f;
+      break;
+    case VTK_TEXT_CENTERED:
+      offset = (-this->NumberOfLines + 1.0f) / 2.0f;
+      break;
+    case VTK_TEXT_BOTTOM:
+      offset = -this->NumberOfLines + 1.0f;
+      break;
+    }
+
+  for (int lineNum=0; lineNum < this->NumberOfLines; lineNum++)
+    {
+    this->TextLines[lineNum]->GetTextProperty()->ShallowCopy(tprop);
+    this->TextLines[lineNum]->GetTextProperty()->SetLineOffset
+      (tprop->GetLineOffset() +
+       static_cast<int>(this->LineSize * (lineNum + offset)
+                        * tprop->GetLineSpacing()));
+    this->TextLines[lineNum]->RenderOverlay(viewport,actor);
+    }
+}
+
+//----------------------------------------------------------------------------
+void vtkOpenGLFreeTypeTextMapper::ReleaseGraphicsResources(vtkWindow *)
+{
+#if VTK_FTTM_DEBUG
+    printf("vtkOpenGLFreeTypeTextMapper::ReleaseGraphicsResources\n");
+#endif
+
+  this->LastWindow = NULL;
+
+  // Very important
+  // the release of graphics resources indicates that significant changes have
+  // occurred. Old fonts, cached sizes etc are all no longer valid, so we send
+  // ourselves a general modified message.
+
+  // this->Modified();
+}
+
+//----------------------------------------------------------------------------
+void vtkOpenGLFreeTypeTextMapper::GetSize(vtkViewport* viewport, int *size)
+{
+  // Check for multiline
+
+  if (this->NumberOfLines > 1)
+    {
+    this->GetMultiLineSize(viewport, size);
+    return;
+    }
+
+  // Check for input
+
+  if (this->Input == NULL || this->Input[0] == '\0')
+    {
+    size[0] = size[1] = 0;
+    return;
+    }
+
+  vtkTextProperty *tprop = this->GetTextProperty();
+  if (!tprop)
+    {
+    vtkErrorMacro(<< "Need a text property to get size");
+    size[0] = size[1] = 0;
+    return;
+    }
+
+  // Check to see whether we have to rebuild anything
+
+  if (this->GetMTime() < this->SizeBuildTime &&
+      tprop->GetMTime() < this->SizeBuildTime)
+    {
+#if VTK_FTTM_DEBUG
+  printf("vtkOpenGLFreeTypeTextMapper::GetSize: In cache!\n");
+#endif
+
+    size[0] = this->LastSize[0];
+    size[1] = this->LastSize[1];
+    return;
+    }
+
+  // Check for font and try to set the size
+
+  vtkFreeTypeUtilities::Entry *entry =
+    vtkFreeTypeUtilities::GetInstance()->GetFont(tprop);
+  FTFont *font = entry ? entry->Font : NULL;
+  if (!font)
+    {
+    vtkErrorMacro(<< "Render - No font");
+    size[0] = size[1] = 0;
+    return;
+    }
+
+  // The font global ascender and descender might just be too high
+  // for given a face. Let's get a compromise by computing these values
+  // from some usual ascii chars.
+
+  if (entry->LargestAscender < 0 || entry->LargestDescender < 0)
+    {
+    float llx, lly, llz, urx, ury, urz;
+    font->BBox("_/7Agfy", llx, lly, llz, urx, ury, urz);
+    entry->LargestAscender = ury;
+    entry->LargestDescender = lly;
+    }
+
+  this->LastSize[0] = size[0] = static_cast<int>(font->Advance(this->Input));
+  this->LastSize[1] = size[1] =
+    static_cast<int>(entry->LargestAscender - entry->LargestDescender);
+  this->LastLargestDescender = static_cast<int>(entry->LargestDescender);
+
+  this->SizeBuildTime.Modified();
+}
+
+//----------------------------------------------------------------------------
+void vtkOpenGLFreeTypeTextMapper::RenderOverlay(vtkViewport* viewport,
+                                                vtkActor2D* actor)
+{
+  vtkDebugMacro (<< "RenderOverlay");
+
+  // Check for input
+
+  if (this->Input == NULL || this->Input[0] == '\0')
+    {
+    return;
+    }
+
+  // Check for multi-lines
+
+  if (this->NumberOfLines > 1)
+    {
+    this->RenderOverlayMultipleLines(viewport, actor);
+    return;
+    }
+
+  // Get text property
+
+  vtkTextProperty *tprop = this->GetTextProperty();
+  if (!tprop)
+    {
+    vtkErrorMacro(<< "Need a text property to render mapper");
+    return;
+    }
+
+  vtkOpenGLClearErrorMacro();
+
+  // Get the window information for display
+
+  vtkWindow* window = viewport->GetVTKWindow();
+  if (this->LastWindow && this->LastWindow != window)
+    {
+    this->ReleaseGraphicsResources(this->LastWindow);
+    }
+  this->LastWindow = window;
+
+  // Get size of text
+
+  int size[2];
+  this->GetSize(viewport, size);
+
+  // Get the position of the text actor
+
+  int* actorPos;
+  actorPos =
+    actor->GetActualPositionCoordinate()->GetComputedViewportValue(viewport);
+
+  // Define bounding rectangle
+
+  int pos[2];
+  pos[0] = actorPos[0];
+  pos[1] = static_cast<int>(actorPos[1] - tprop->GetLineOffset());
+
+  switch (tprop->GetJustification())
+    {
+    case VTK_TEXT_LEFT:
+      break;
+    case VTK_TEXT_CENTERED:
+      pos[0] = pos[0] - size[0] / 2;
+      break;
+    case VTK_TEXT_RIGHT:
+      pos[0] = pos[0] - size[0];
+      break;
+    }
+
+  switch (tprop->GetVerticalJustification())
+    {
+    case VTK_TEXT_TOP:
+      pos[1] = pos[1] - size[1] - this->LastLargestDescender;
+      break;
+    case VTK_TEXT_CENTERED:
+      pos[1] = pos[1] - size[1] / 2 - this->LastLargestDescender / 2;
+      break;
+    case VTK_TEXT_BOTTOM:
+      break;
+    }
+
+  // Push a 2D matrix on the stack
+
+  int *vsize = viewport->GetSize();
+  double *vport = viewport->GetViewport();
+  double *tileViewport = viewport->GetVTKWindow()->GetTileViewport();
+  double visVP[4];
+
+  visVP[0] = (vport[0] >= tileViewport[0]) ? vport[0] : tileViewport[0];
+  visVP[1] = (vport[1] >= tileViewport[1]) ? vport[1] : tileViewport[1];
+  visVP[2] = (vport[2] <= tileViewport[2]) ? vport[2] : tileViewport[2];
+  visVP[3] = (vport[3] <= tileViewport[3]) ? vport[3] : tileViewport[3];
+
+  if (visVP[0] == visVP[2] || visVP[1] == visVP[3])
+    {
+    return;
+    }
+
+  glMatrixMode(GL_PROJECTION);
+  glLoadIdentity();
+
+  if (viewport->GetIsPicking())
+    {
+/*    vtkgluPickMatrix(viewport->GetPickX(), viewport->GetPickY(),
+                     viewport->GetPickWidth(),
+                     viewport->GetPickHeight(),
+                     viewport->GetOrigin(), viewport->GetSize());
+*/    }
+
+  glMatrixMode(GL_MODELVIEW);
+  glLoadIdentity();
+
+  // Store the state of the attributes we are about to change
+  GLint depthFunc;
+  glGetIntegerv(GL_DEPTH_FUNC, &depthFunc);
+  glDepthFunc(GL_ALWAYS);
+
+  glDepthMask(GL_FALSE);
+  // glDisable(GL_DEPTH_TEST);
+  glDisable(GL_TEXTURE_2D);
+  glEnable (GL_ALPHA_TEST);
+  glEnable(GL_BLEND);
+  glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
+  // glPixelStorei( GL_UNPACK_ALIGNMENT, 1);
+  // glPixelStorei( GL_PACK_ALIGNMENT, 1 );
+
+  //- Make sure no shaders are loaded as freetype uses glDrawPixels which
+  // will use a fragment shader if one is loaded.
+  vtkOpenGLRenderWindow *renWin = static_cast<vtkOpenGLRenderWindow*>(viewport->GetVTKWindow());
+  renWin->GetShaderCache()->ReleaseCurrentShader();
+
+  if (actor->GetProperty()->GetDisplayLocation() == VTK_FOREGROUND_LOCATION)
+    {
+    glOrtho(0, vsize[0] - 1, 0, vsize[1] - 1, 0, 1);
+    }
+  else
+    {
+    glOrtho(0, vsize[0] - 1, 0, vsize[1] - 1, -1, 0);
+    }
+
+  int *winSize = viewport->GetVTKWindow()->GetSize();
+
+  int xoff = static_cast<int>(pos[0] - winSize[0] * (visVP[0] - vport[0]));
+  int yoff = static_cast<int>(pos[1] - winSize[1] * (visVP[1] - vport[1]));
+
+  // When picking draw the bounds of the text as a rectangle,
+  // as text only picks when the pick point is exactly on the
+  // origin of the text
+
+  if (viewport->GetIsPicking())
+    {
+    float x1 = (2.0 * actorPos[0]) / vsize[0] - 1.0;
+    float y1 = 2.0 * (actorPos[1] - tprop->GetLineOffset())/vsize[1] - 1.0;
+    float width = (2.0 * size[0]) / vsize[0];
+    float height = (2.0 * size[1]) / vsize[1];
+    glRectf(x1, y1, x1 + width, y1 + height);
+
+    // Clean up and return after drawing the rectangle
+    // Restore the original state
+    glDepthFunc(depthFunc);
+
+    return;
+    }
+
+  double* tprop_color = tprop->GetColor();
+  double tprop_opacity = tprop->GetOpacity();
+
+  // Get the font
+
+  vtkFreeTypeUtilities::Entry *entry =
+    vtkFreeTypeUtilities::GetInstance()->GetFont(tprop, tprop_color);
+  FTFont *font = entry ? entry->Font : NULL;
+  if (!font)
+    {
+    vtkErrorMacro(<< "Render - No font");
+    return;
+    }
+
+  struct FTGLRenderContext *ftgl_context = 0;
+
+  // Set up the shadow color
+
+  if (tprop->GetShadow())
+    {
+    double shadow_color[3], rgb;
+    rgb = ((tprop_color[0] + tprop_color[1] + tprop_color[2]) / 3.0 > 0.5)
+      ? 0.0 : 1.0;
+    shadow_color[0] = shadow_color[1] = shadow_color[2] = rgb;
+
+    // Get the shadow font
+
+    vtkFreeTypeUtilities::Entry *shadow_entry =
+      vtkFreeTypeUtilities::GetInstance()->GetFont(tprop, shadow_color);
+    FTFont *shadow_font = shadow_entry ? shadow_entry->Font : NULL;
+    if (!shadow_font)
+      {
+      vtkErrorMacro(<< "Render - No shadow font");
+      return;
+      }
+
+    // Set the color here since load/render glyphs is done
+    // on demand and this color has to be consistent for a given font entry.
+
+    glColor4ub(static_cast<unsigned char>(shadow_color[0] * 255.0),
+               static_cast<unsigned char>(shadow_color[1] * 255.0),
+               static_cast<unsigned char>(shadow_color[2] * 255.0),
+               static_cast<unsigned char>(tprop_opacity * 255.0));
+
+    // Required for clipping to work correctly
+
+    glRasterPos2i(0, 0);
+    glBitmap(0, 0, 0, 0,
+             xoff + tprop->GetShadowOffset()[0],
+             yoff + tprop->GetShadowOffset()[1], NULL);
+
+    // Draw the shadow text
+
+    shadow_font->render(this->Input, ftgl_context);
+
+    // Get the font again, Duh, since it may have been freed from the
+    // cache by the shadow font
+
+    font = vtkFreeTypeUtilities::GetInstance()->GetFont(
+      tprop, tprop_color)->Font;
+    if (!font)
+      {
+      vtkErrorMacro(<< "Render - No font");
+      return;
+      }
+    }
+
+  // Set the color here since load/render glyphs is done
+  // on demand and this color has to be consistent for a given font entry.
+
+  glColor4ub(static_cast<unsigned char>(tprop_color[0] * 255.0),
+             static_cast<unsigned char>(tprop_color[1] * 255.0),
+             static_cast<unsigned char>(tprop_color[2] * 255.0),
+             static_cast<unsigned char>(tprop_opacity * 255.0));
+
+  // Required for clipping to work correctly
+
+  glRasterPos2i(0, 0);
+  glBitmap(0, 0, 0, 0, xoff, yoff, NULL);
+
+  // Display a string
+
+  font->render(this->Input, ftgl_context);
+
+  glFlush();
+
+  // Restore the original GL state
+  glDepthFunc(depthFunc);
+
+  vtkOpenGLCheckErrorMacro("failed after RenderOverlay");
+}
+
+//----------------------------------------------------------------------------
+void vtkOpenGLFreeTypeTextMapper::PrintSelf(ostream& os, vtkIndent indent)
+{
+  this->Superclass::PrintSelf(os,indent);
+  os << indent << "NumberOfLines: " << this->NumberOfLines << "\n";
+}
+
+//----------------------------------------------------------------------------
+void vtkOpenGLFreeTypeTextMapper::SetInput(const char *input)
+{
+  if ( this->Input && input && (!strcmp(this->Input,input)))
+    {
+    return;
+    }
+  delete [] this->Input;
+  if (input)
+    {
+    this->Input = new char[strlen(input)+1];
+    strcpy(this->Input,input);
+    }
+  else
+    {
+    this->Input = NULL;
+    }
+  this->Modified();
+
+  int numLines = GetNumberOfLinesImpl(input);
+
+  if ( numLines <= 1) // a line with no "\n"
+    {
+    this->NumberOfLines = numLines;
+    }
+
+  else //multiple lines
+    {
+    char *line;
+    int i;
+
+    if ( numLines > this->NumberOfLinesAllocated )
+      {
+      // delete old stuff
+      if ( this->TextLines )
+        {
+        for (i=0; i < this->NumberOfLinesAllocated; i++)
+          {
+          this->TextLines[i]->Delete();
+          }
+        delete [] this->TextLines;
+        }
+
+      // allocate new text mappers
+      this->NumberOfLinesAllocated = numLines;
+      this->TextLines = new vtkTextMapper *[numLines];
+      for (i=0; i < numLines; i++)
+        {
+        this->TextLines[i] = vtkTextMapper::New();
+        }
+      } //if we need to reallocate
+
+    // set the input strings
+    this->NumberOfLines = numLines;
+    for (i=0; i < this->NumberOfLines; i++)
+      {
+      line = this->NextLine(input, i);
+      this->TextLines[i]->SetInput( line );
+      delete [] line;
+      }
+    }
+}
diff --git a/Rendering/FreeTypeOpenGL2/vtkOpenGLFreeTypeTextMapper.h b/Rendering/FreeTypeOpenGL2/vtkOpenGLFreeTypeTextMapper.h
new file mode 100644
index 0000000..06762d8
--- /dev/null
+++ b/Rendering/FreeTypeOpenGL2/vtkOpenGLFreeTypeTextMapper.h
@@ -0,0 +1,78 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+  Module:    vtkOpenGLFreeTypeTextMapper.h
+
+  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.
+
+=========================================================================*/
+// .NAME vtkOpenGLFreeTypeTextMapper - 2D Text annotation support
+// .SECTION Description
+// vtkOpenGLFreeTypeTextMapper provides 2D text annotation support for VTK
+// using the FreeType and FTGL libraries. Normally the user should use
+// vtktextMapper which in turn will use this class.
+
+// .SECTION See Also
+// vtkTextMapper
+
+#ifndef vtkOpenGLFreeTypeTextMapper_h
+#define vtkOpenGLFreeTypeTextMapper_h
+
+#include "vtkRenderingFreeTypeOpenGL2Module.h" // For export macro
+#include "vtkTextMapper.h"
+
+class VTKRENDERINGFREETYPEOPENGL2_EXPORT vtkOpenGLFreeTypeTextMapper
+  : public vtkTextMapper
+{
+public:
+  vtkTypeMacro(vtkOpenGLFreeTypeTextMapper, vtkTextMapper);
+  static vtkOpenGLFreeTypeTextMapper *New();
+  virtual void PrintSelf(ostream& os, vtkIndent indent);
+
+  void SetInput(const char *inputString);
+
+  // Description:
+  // Actally draw the text.
+  void RenderOverlay(vtkViewport* viewport, vtkActor2D* actor);
+
+  // Description:
+  // Release any graphics resources that are being consumed by this actor.
+  // The parameter window could be used to determine which graphic
+  // resources to release.
+  virtual void ReleaseGraphicsResources(vtkWindow *);
+
+  // Description:
+  // Return the the size of the rectangle required to draw this
+  // mapper.
+  virtual void GetSize(vtkViewport* viewport, int size[2]);
+
+protected:
+  vtkOpenGLFreeTypeTextMapper();
+  ~vtkOpenGLFreeTypeTextMapper();
+
+  vtkTimeStamp  SizeBuildTime;
+  int LastSize[2];
+  int LastLargestDescender;
+  int LineSize;
+  int NumberOfLines;
+  int NumberOfLinesAllocated;
+  vtkTextMapper **TextLines;
+
+  // Description:
+  // These functions are used to parse, process, and render multiple lines
+  char *NextLine(const char *input, int lineNum);
+  void GetMultiLineSize(vtkViewport* viewport, int size[2]);
+  void RenderOverlayMultipleLines(vtkViewport *viewport, vtkActor2D *actor);
+
+private:
+  vtkOpenGLFreeTypeTextMapper(const vtkOpenGLFreeTypeTextMapper&);  // Not implemented.
+  void operator=(const vtkOpenGLFreeTypeTextMapper&);  // Not implemented.
+};
+
+#endif
diff --git a/Rendering/GL2PS/vtkGL2PSContextDevice2D.cxx b/Rendering/GL2PS/vtkGL2PSContextDevice2D.cxx
index 4111130..0ea0b98 100644
--- a/Rendering/GL2PS/vtkGL2PSContextDevice2D.cxx
+++ b/Rendering/GL2PS/vtkGL2PSContextDevice2D.cxx
@@ -249,10 +249,11 @@ void vtkGL2PSContextDevice2D::DrawMathTextString(float apoint[],
 {
   vtkNew<vtkPath> path;
   bool ok;
-  if (vtkMathTextUtilities *mtu = vtkMathTextUtilities::GetInstance())
+  if (vtkMathTextUtilities::GetInstance())
     {
-    ok = mtu->StringToPath(string.c_str(), path.GetPointer(), this->TextProp,
-                           this->RenderWindow->GetDPI());
+    ok = vtkMathTextUtilities::GetInstance()->StringToPath(string.c_str(),
+                                                           path.GetPointer(),
+                                                           this->TextProp);
     }
   else
     {
@@ -350,7 +351,7 @@ void vtkGL2PSContextDevice2D::DrawCrossMarkers(bool highlight, float *points,
   for (int i = 0; i < n; ++i)
     {
     float *point = points + (i * 2);
-    if (colors)
+    if  (colors)
       {
       color[3] = 255;
       switch (nc_comps)
@@ -361,7 +362,6 @@ void vtkGL2PSContextDevice2D::DrawCrossMarkers(bool highlight, float *points,
           break;
         case 2:
           color[3] = colors[i * nc_comps + 1];
-          VTK_FALLTHROUGH;
         case 1:
           memset(color, colors[i * nc_comps], 3);
           break;
@@ -435,7 +435,6 @@ void vtkGL2PSContextDevice2D::DrawPlusMarkers(bool highlight, float *points,
           break;
         case 2:
           color[3] = colors[i * nc_comps + 1];
-          VTK_FALLTHROUGH;
         case 1:
           memset(color, colors[i * nc_comps], 3);
           break;
@@ -500,7 +499,6 @@ void vtkGL2PSContextDevice2D::DrawSquareMarkers(bool /*highlight*/,
           break;
         case 2:
           color[3] = colors[i * nc_comps + 1];
-          VTK_FALLTHROUGH;
         case 1:
           memset(color, colors[i * nc_comps], 3);
           break;
@@ -555,7 +553,6 @@ void vtkGL2PSContextDevice2D::DrawCircleMarkers(bool /*highlight*/,
           break;
         case 2:
           color[3] = colors[i * nc_comps + 1];
-          VTK_FALLTHROUGH;
         case 1:
           memset(color, colors[i * nc_comps], 3);
           break;
@@ -607,7 +604,6 @@ void vtkGL2PSContextDevice2D::DrawDiamondMarkers(bool /*highlight*/,
           break;
         case 2:
           color[3] = colors[i * nc_comps + 1];
-          VTK_FALLTHROUGH;
         case 1:
           memset(color, colors[i * nc_comps], 3);
           break;
diff --git a/Rendering/GL2PS/vtkGL2PSUtilities.cxx b/Rendering/GL2PS/vtkGL2PSUtilities.cxx
index 6b49e9c..73e15a0 100644
--- a/Rendering/GL2PS/vtkGL2PSUtilities.cxx
+++ b/Rendering/GL2PS/vtkGL2PSUtilities.cxx
@@ -59,13 +59,11 @@ void vtkGL2PSUtilities::DrawString(const char *str,
     return;
     }
 
-  int dpi = vtkGL2PSUtilities::RenderWindow->GetDPI();
-
   // Draw the background if needed:
   if (tprop->GetBackgroundOpacity() > 0.)
     {
     vtkTextRenderer::Metrics metrics;
-    if (tren->GetMetrics(tprop, str, metrics, dpi))
+    if (tren->GetMetrics(tprop, str, metrics))
       {
       double bgPos[3] = { pos[0], pos[1], backgroundDepth };
       vtkGL2PSUtilities::ProjectPoint(bgPos);
@@ -108,8 +106,7 @@ void vtkGL2PSUtilities::DrawString(const char *str,
 
     GLfloat angle = static_cast<GLfloat>(tprop->GetOrientation());
 
-    // GL2PS assumes 72 DPI, so we'll have to adjust the font size:
-    GLint fontSize = static_cast<GLint>(tprop->GetFontSize() * (dpi / 72.));
+    GLint fontSize = static_cast<GLint>(tprop->GetFontSize());
 
     GL2PSrgba rgba;
     double rgbad[3];
@@ -126,7 +123,7 @@ void vtkGL2PSUtilities::DrawString(const char *str,
     {
     // Render the string to a path and then draw it to GL2PS:
     vtkNew<vtkPath> path;
-    tren->StringToPath(tprop, str, path.GetPointer(), dpi);
+    tren->StringToPath(tprop, str, path.GetPointer());
     // Get color
     double rgbd[3];
     tprop->GetColor(rgbd[0], rgbd[1], rgbd[2]);
diff --git a/Rendering/LIC/Testing/Cxx/TestImageDataLIC2D.cxx b/Rendering/LIC/Testing/Cxx/TestImageDataLIC2D.cxx
index 0ad4a4a..7ae1537 100644
--- a/Rendering/LIC/Testing/Cxx/TestImageDataLIC2D.cxx
+++ b/Rendering/LIC/Testing/Cxx/TestImageDataLIC2D.cxx
@@ -295,10 +295,7 @@ int ImageDataLIC2D(int argc, char* argv[])
   filter->SetStepSize(0.8/magnification);
   filter->SetMagnification(magnification);
   filter->SetInputConnection(0, probe->GetOutputPort(0));
-  if ( noise )
-    {
-    filter->SetInputData(1, noise);
-    }
+  if ( noise ) filter->SetInputData(1, noise);
   filter->UpdateInformation();
   noise = NULL;
 
diff --git a/Rendering/LIC/Testing/Cxx/vtkSurfaceLICTestDriver.cxx b/Rendering/LIC/Testing/Cxx/vtkSurfaceLICTestDriver.cxx
index fbe27cc..32d1544 100644
--- a/Rendering/LIC/Testing/Cxx/vtkSurfaceLICTestDriver.cxx
+++ b/Rendering/LIC/Testing/Cxx/vtkSurfaceLICTestDriver.cxx
@@ -295,6 +295,7 @@ int vtkSurfaceLICTestDriver(
     mapper->SetScalarMode(VTK_SCALAR_MODE_USE_POINT_FIELD_DATA);
     lut->Delete();
     }
+  dataObj = NULL;
 
   // Pass parameters.
   painter->SetNumberOfSteps(num_steps);
diff --git a/Rendering/LIC/vtkImageDataLIC2D.cxx b/Rendering/LIC/vtkImageDataLIC2D.cxx
index fe899e3..c10de4e 100644
--- a/Rendering/LIC/vtkImageDataLIC2D.cxx
+++ b/Rendering/LIC/vtkImageDataLIC2D.cxx
@@ -19,7 +19,6 @@
 #include "vtkCellData.h"
 #include "vtkFloatArray.h"
 #include "vtkUnsignedCharArray.h"
-#include "vtkImageCast.h"
 #include "vtkImageData.h"
 #include "vtkImageNoiseSource.h"
 #include "vtkInformation.h"
@@ -49,7 +48,7 @@ using std::deque;
 
 #define vtkImageDataLIC2DDEBUG 0
 #if (vtkImageDataLIC2DDEBUG >= 1)
-#include "vtkTextureIO.h"
+#include "vtkTextureWriter.h"
 #endif
 
 #define PRINTEXTENT(ext) \
@@ -76,10 +75,6 @@ vtkImageDataLIC2D::vtkImageDataLIC2D()
   this->NoiseSource->SetMinimum(0.0);
   this->NoiseSource->SetMaximum(1.0);
 
-  this->ImageCast = vtkImageCast::New();
-  this->ImageCast->SetOutputScalarTypeToFloat();
-  this->ImageCast->SetInputConnection(this->NoiseSource->GetOutputPort(0));
-
   this->SetNumberOfInputPorts(2);
 
   // by default process active point vectors
@@ -96,12 +91,6 @@ vtkImageDataLIC2D::vtkImageDataLIC2D()
 vtkImageDataLIC2D::~vtkImageDataLIC2D()
 {
   this->NoiseSource->Delete();
-  this->ImageCast->Delete();
-  if (this->MagShader)
-    {
-    this->MagShader->Delete();
-    this->MagShader = NULL;
-    }
   this->SetContext(NULL);
 }
 
@@ -173,7 +162,6 @@ int vtkImageDataLIC2D::SetContext(vtkRenderWindow * renWin)
     if (prog->GetLastBuildStatus() != VTK_SHADER_PROGRAM2_LINK_SUCCEEDED)
       {
       vtkErrorMacro("failed to build the magnification fragment shader");
-      prog->Delete();
       return 0;
       }
     this->MagShader = prog;
@@ -401,8 +389,8 @@ int vtkImageDataLIC2D::RequestData(
 
   if ( !noise )
     {
-    this->ImageCast->Update();
-    noise = this->ImageCast->GetOutput();
+    this->NoiseSource->Update();
+    noise = this->NoiseSource->GetOutput();
     }
 
   int comp[3] = {0, 0, 0};
@@ -467,9 +455,9 @@ int vtkImageDataLIC2D::RequestData(
   vecPBO->Delete();
 
   #if (vtkImageDataLIC2DDEBUG >= 1)
-  vtkTextureIO::Write(
-              "idlic2d_vectors.vtk",
-              vectorTex, NULL, NULL);
+  vtkTextureWriter::WriteTexture(
+          "idlic2d_vectors.vtk",
+          vectorTex);
   #endif
 
   // magnify vectors
@@ -478,7 +466,7 @@ int vtkImageDataLIC2D::RequestData(
   magVectorExtent.Size(magVectorSize);
 
   vtkTextureObject *magVectorTex = vectorTex;
-  if (this->Magnification > 1 && this->MagShader)
+  if (this->Magnification > 1)
     {
     this->MagShader->UseProgram();
     this->MagShader->SetUniformi("texVectors", 0);
@@ -525,9 +513,9 @@ int vtkImageDataLIC2D::RequestData(
     }
 
   #if (vtkImageDataLIC2DDEBUG >= 1)
-  vtkTextureIO::Write(
-              "idlic2d_magvectors.vtk",
-              magVectorTex, NULL, NULL);
+  vtkTextureWriter::WriteTexture(
+          "idlic2d_magvectors.vtk",
+          magVectorTex);
   #endif
 
   // send noise data to a texture
@@ -537,23 +525,17 @@ int vtkImageDataLIC2D::RequestData(
 
   vtkPixelBufferObject *noisePBO = vtkPixelBufferObject::New();
   noisePBO->SetContext(this->Context);
-  int noiseComp = inNoise->GetNumberOfComponents();
-
-  if (inNoise->GetDataType() != VTK_FLOAT)
-    {
-    vtkErrorMacro("noise dataset was not float");
-    }
 
   vtkPixelTransfer::Blit(
         noiseExt,
-        noiseComp,
+        2,
         inNoise->GetDataType(),
         inNoise->GetVoidPointer(0),
         VTK_FLOAT,
         noisePBO->MapUnpackedBuffer(
         VTK_FLOAT,
         static_cast<unsigned int>(noiseExt.Size()),
-        noiseComp));
+        2));
 
   noisePBO->UnmapUnpackedBuffer();
 
@@ -562,15 +544,14 @@ int vtkImageDataLIC2D::RequestData(
 
   vtkTextureObject *noiseTex = vtkTextureObject::New();
   noiseTex->SetContext(this->Context);
-  noiseTex->Create2D(noiseTexSize[0], noiseTexSize[1],
-    noiseComp, noisePBO, false);
+  noiseTex->Create2D(noiseTexSize[0], noiseTexSize[1], 2, noisePBO, false);
 
   noisePBO->Delete();
 
   #if (vtkImageDataLIC2DDEBUG >= 1)
-  vtkTextureIO::Write(
+  vtkTextureWriter::WriteTexture(
           "idlic2d_noise.vtk",
-          noiseTex, NULL, NULL);
+          noiseTex);
   #endif
 
   // step size conversion to normalize image space
@@ -644,9 +625,9 @@ int vtkImageDataLIC2D::RequestData(
     }
 
   #if (vtkImageDataLIC2DDEBUG >= 1)
-  vtkTextureIO::Write(
+  vtkTextureWriter::WriteTexture(
           "idlic2d_lic.vtk",
-          licTex, NULL, NULL);
+          licTex);
   #endif
 
   // transfer lic from texture to vtk array
@@ -678,7 +659,7 @@ int vtkImageDataLIC2D::RequestData(
     {
     float lic = pLicOut[3*i];
     float mask = pLicOut[3*i+1];
-    if ( mask != 0.0f )
+    if ( mask )
       {
       pLicOut[3*i+1] = pLicOut[3*i+2] = pLicOut[3*i] = 0.0f;
       }
diff --git a/Rendering/LIC/vtkImageDataLIC2D.h b/Rendering/LIC/vtkImageDataLIC2D.h
index ff8701c..3981828 100644
--- a/Rendering/LIC/vtkImageDataLIC2D.h
+++ b/Rendering/LIC/vtkImageDataLIC2D.h
@@ -39,7 +39,6 @@
 
 class vtkRenderWindow;
 class vtkImageNoiseSource;
-class vtkImageCast;
 class vtkShaderProgram2;
 
 class VTKRENDERINGLIC_EXPORT vtkImageDataLIC2D : public vtkImageAlgorithm
@@ -126,7 +125,6 @@ protected:
   vtkShaderProgram2 *MagShader;
 
   vtkImageNoiseSource* NoiseSource;
-  vtkImageCast *ImageCast;
 
   int Steps;
   double StepSize;
diff --git a/Rendering/LIC/vtkLineIntegralConvolution2D.cxx b/Rendering/LIC/vtkLineIntegralConvolution2D.cxx
index d8a16ca..1e5a356 100644
--- a/Rendering/LIC/vtkLineIntegralConvolution2D.cxx
+++ b/Rendering/LIC/vtkLineIntegralConvolution2D.cxx
@@ -993,7 +993,11 @@ vtkLineIntegralConvolution2D::vtkLineIntegralConvolution2D()
 // ----------------------------------------------------------------------------
 vtkLineIntegralConvolution2D::~vtkLineIntegralConvolution2D()
 {
-  delete this->Comm;
+  if (this->Comm)
+    {
+    delete this->Comm;
+    this->Comm = NULL;
+    }
   this->SetContext(NULL);
   this->SetVTShader(NULL);
   this->SetLIC0Shader(NULL);
diff --git a/Rendering/LIC/vtkStructuredGridLIC2D.cxx b/Rendering/LIC/vtkStructuredGridLIC2D.cxx
index 4d0b96b..f516ae4 100644
--- a/Rendering/LIC/vtkStructuredGridLIC2D.cxx
+++ b/Rendering/LIC/vtkStructuredGridLIC2D.cxx
@@ -772,7 +772,7 @@ int vtkStructuredGridLIC2D::RequestData(
     {
     float lic = pLicOut[3*i];
     float mask = pLicOut[3*i+1];
-    if ( mask != 0.0f )
+    if ( mask )
       {
       pLicOut[3*i+1] = pLicOut[3*i+2] = pLicOut[3*i] = 0.0f;
       }
diff --git a/Rendering/LIC/vtkSurfaceLICPainter.cxx b/Rendering/LIC/vtkSurfaceLICPainter.cxx
index b04c4d6..ff5e640 100644
--- a/Rendering/LIC/vtkSurfaceLICPainter.cxx
+++ b/Rendering/LIC/vtkSurfaceLICPainter.cxx
@@ -493,6 +493,7 @@ float *RandomNoise2D::GenerateUniform(
   // with a uniform distribution and fixed number of levels
   nLevels = nLevels < 1 ? 1 : nLevels;
   int maxLevel = nLevels-1;
+  float delta = 1.0f/maxLevel;
   minNoiseVal = minNoiseVal < 0.0f ? 0.0f : minNoiseVal;
   maxNoiseVal = maxNoiseVal > 1.0f ? 1.0f : maxNoiseVal;
   float noiseRange = maxNoiseVal - minNoiseVal;
@@ -519,7 +520,7 @@ float *RandomNoise2D::GenerateUniform(
          {
          int l = static_cast<int>(this->ValueGen.GetRandomNumber()*nLevels);
          l = l > maxLevel ? maxLevel : l; // needed for 1.0
-         rvals[idx] = (nLevels == 1) ? maxNoiseVal : (minNoiseVal + (l*1.0f/maxLevel) * noiseRange);
+         rvals[idx] = nLevels == 1 ? maxNoiseVal : minNoiseVal + (l*delta) * noiseRange;
          }
        }
     }
@@ -621,6 +622,7 @@ float *RandomNoise2D::GenerateGaussian(
 
   nLevels = nLevels < 1 ? 1 : nLevels;
   int maxLevel = nLevels-1;
+  float delta = 1.0f/maxLevel;
   minNoiseVal = minNoiseVal < 0.0f ? 0.0f : minNoiseVal;
   maxNoiseVal = maxNoiseVal > 1.0f ? 1.0f : maxNoiseVal;
   float noiseRange = maxNoiseVal - minNoiseVal;
@@ -632,8 +634,8 @@ float *RandomNoise2D::GenerateGaussian(
     int l = static_cast<int>(val*nLevels);
     l = l > maxLevel ? maxLevel : l;
     rvals[i]
-       = (rvals[i] < minVal) ? impulseBgNoiseVal
-       : (nLevels == 1) ? maxNoiseVal : (minNoiseVal + (l*1.0f/maxLevel) * noiseRange);
+       = rvals[i] < minVal ? impulseBgNoiseVal
+       : nLevels == 1 ? maxNoiseVal : minNoiseVal + (l*delta) * noiseRange;
     }
 
   // map single pixel random values onto a patch of values of
@@ -936,7 +938,10 @@ public:
     this->LightingHelper = NULL;
     this->ColorMaterialHelper = NULL;
 
-    delete this->Communicator;
+    if (this->Communicator)
+      {
+      delete this->Communicator;
+      }
     }
 
   // Description:
@@ -1911,8 +1916,6 @@ void vtkSurfaceLICPainter::SetEnhanceContrast(int val)
           break;
         case ENHANCE_CONTRAST_COLOR:
           this->Internals->LICNeedsUpdate = true;
-          this->Internals->ColorNeedsUpdate = true;
-          break;
         case ENHANCE_CONTRAST_LIC:
           this->Internals->ColorNeedsUpdate = true;
           break;
@@ -2497,7 +2500,12 @@ void vtkSurfaceLICPainter::CreateCommunicator()
           this->Internals->DataSetExt,
           this->Internals->BlockExts);
 
-  delete this->Internals->Communicator;
+  if (this->Internals->Communicator)
+    {
+    delete this->Internals->Communicator;
+    this->Internals->Communicator = NULL;
+    }
+
   this->Internals->Communicator = this->CreateCommunicator(includeRank);
 
   #if vtkSurfaceLICPainterDEBUG >= 1
diff --git a/Rendering/LICOpenGL2/CMakeLists.txt b/Rendering/LICOpenGL2/CMakeLists.txt
deleted file mode 100644
index e251367..0000000
--- a/Rendering/LICOpenGL2/CMakeLists.txt
+++ /dev/null
@@ -1,62 +0,0 @@
-set(Module_SRCS
-  vtkImageDataLIC2D.cxx
-  vtkLineIntegralConvolution2D.cxx
-  vtkPixelTransfer.cxx
-  vtkStructuredGridLIC2D.cxx
-  vtkSurfaceLICComposite.cxx
-  vtkSurfaceLICMapper.cxx
-  vtkCompositeSurfaceLICMapper.cxx
-  vtkTextureIO.cxx
-  )
-
-set_source_files_properties(
-  vtkLineIntegralConvolution2D.cxx
-  vtkPixelTransfer.cxx
-  vtkSurfaceLICComposite.cxx
-  vtkTextureIO.cxx
-  WRAP_EXCLUDE
-  )
-
-if (VTK_RENDERINGPARALLELLIC_SURFACELICPAINTER_TIMER)
-  add_definitions("-DvtkSurfaceLICPainterTIME")
-endif()
-if (VTK_RENDERINGPARALLELLIC_LINEINTEGRALCONVLOLUTION2D_TIMER)
-  add_definitions("-DvtkLineIntegralConvolution2DTIME")
-endif()
-
-set(shader_files
-  vtkLineIntegralConvolution2D_VT.glsl
-  vtkLineIntegralConvolution2D_LIC0.glsl
-  vtkLineIntegralConvolution2D_LICI.glsl
-  vtkLineIntegralConvolution2D_LICN.glsl
-  vtkLineIntegralConvolution2D_EE.glsl
-  vtkLineIntegralConvolution2D_CE.glsl
-  vtkLineIntegralConvolution2D_AAH.glsl
-  vtkLineIntegralConvolution2D_AAV.glsl
-  vtkStructuredGridLIC2D_fs.glsl
-  vtkSurfaceLICMapper_SC.glsl
-  vtkSurfaceLICMapper_CE.glsl
-  vtkSurfaceLICMapper_DCpy.glsl
-  )
-unset(shader_h_files)
-foreach(file ${shader_files})
-  get_filename_component(file_we ${file} NAME_WE)
-  set(src  ${CMAKE_CURRENT_SOURCE_DIR}/${file})
-  set(res  ${CMAKE_CURRENT_BINARY_DIR}/${file_we}.cxx)
-  set(resh ${CMAKE_CURRENT_BINARY_DIR}/${file_we}.h)
-  list(APPEND shader_h_files ${resh})
-  add_custom_command(
-    OUTPUT ${res} ${resh}
-    DEPENDS ${src} vtkEncodeString
-    COMMAND vtkEncodeString
-    ARGS ${res} ${src} ${file_we}
-      --build-header VTKRENDERINGLICOPENGL2_EXPORT vtkRenderingLICOpenGL2Module.h
-    )
-  list(APPEND Module_SRCS ${res})
-  set_source_files_properties(${file_we} WRAP_EXCLUDE)
-endforeach()
-
-
-vtk_module_library(${vtk-module} ${Module_SRCS})
-
-include_directories(${OPENGL_INCLUDE_DIR})
diff --git a/Rendering/LICOpenGL2/Testing/Cxx/CMakeLists.txt b/Rendering/LICOpenGL2/Testing/Cxx/CMakeLists.txt
deleted file mode 100644
index bfd63e1..0000000
--- a/Rendering/LICOpenGL2/Testing/Cxx/CMakeLists.txt
+++ /dev/null
@@ -1,374 +0,0 @@
-# basic tests on the legacy filters
-# excercises line integral convolution 2d
-vtk_add_test_cxx(${vtk-module}CxxTests tests
-  TestImageDataLIC2D.cxx
-  TestStructuredGridLIC2DXSlice.cxx
-  TestStructuredGridLIC2DYSlice.cxx
-  TestStructuredGridLIC2DZSlice.cxx
-  )
-
-# surface lic painter tests
-# get decent coverage by calling
-# varying arguments to the following
-# test exec. to get unique test names
-# avoid vtk_add_test_cxx and add exec
-# and it's test cases manually
-list(APPEND tests
-  TestSurfaceLIC
-  )
-vtk_test_cxx_executable(${vtk-module}CxxTests tests
-  RENDERING_FACTORY
-  vtkStructuredGridLIC2DTestDriver.cxx
-  vtkSurfaceLICTestDriver.cxx
-  )
-
-# surface lic on a curved surface
-ExternalData_add_test(VTKData
-  NAME ${vtk-module}Cxx-SurfaceLICCurvedDefaults
-  COMMAND ${vtk-module}CxxTests TestSurfaceLIC
-    -D ${VTK_TEST_DATA_DIR}
-    -T ${VTK_TEST_OUTPUT_DIR}
-    -V "DATA{${${vtk-module}_SOURCE_DIR}/Testing/Data/Baseline/TestSurfaceLICCurvedDefaults.png,:}"
-    --step-size=0.4
-    --num-steps=40
-    --camera-config=1
-    --data=${VTK_TEST_DATA_DIR}/Data/disk_out_ref_surface.vtp
-    --vectors=V
-    )
-ExternalData_add_test(VTKData
-  NAME ${vtk-module}Cxx-SurfaceLICCurvedContrastEnhancedBlended
-  COMMAND ${vtk-module}CxxTests TestSurfaceLIC
-    -D ${VTK_TEST_DATA_DIR}
-    -T ${VTK_TEST_OUTPUT_DIR}
-    -V "DATA{${${vtk-module}_SOURCE_DIR}/Testing/Data/Baseline/TestSurfaceLICCurvedContrastEnhancedBlended.png,:}"
-    --step-size=0.4
-    --num-steps=40
-    --camera-config=1
-    --data=${VTK_TEST_DATA_DIR}/Data/disk_out_ref_surface.vtp
-    --vectors=V
-    --enhance-contrast=1
-    --lic-intensity=0.8
-    )
-ExternalData_add_test(VTKData
-  NAME ${vtk-module}Cxx-SurfaceLICCurvedContrastEnhancedMapped
-  COMMAND ${vtk-module}CxxTests TestSurfaceLIC
-    -D ${VTK_TEST_DATA_DIR}
-    -T ${VTK_TEST_OUTPUT_DIR}
-    -V "DATA{${${vtk-module}_SOURCE_DIR}/Testing/Data/Baseline/TestSurfaceLICCurvedContrastEnhancedMapped.png,:}"
-    --step-size=0.4
-    --num-steps=40
-    --camera-config=1
-    --data=${VTK_TEST_DATA_DIR}/Data/disk_out_ref_surface.vtp
-    --vectors=V
-    --enhance-contrast=4
-    --color-mode=1
-    )
-ExternalData_add_test(VTKData
-  NAME ${vtk-module}Cxx-SurfaceLICCurvedEnhancedVectorNormalizeOff
-  COMMAND ${vtk-module}CxxTests TestSurfaceLIC
-    -D ${VTK_TEST_DATA_DIR}
-    -T ${VTK_TEST_OUTPUT_DIR}
-    -V "DATA{${${vtk-module}_SOURCE_DIR}/Testing/Data/Baseline/TestSurfaceLICCurvedEnhancedVectorNormalizeOff.png,:}"
-    --data=${VTK_TEST_DATA_DIR}/Data/disk_out_ref_surface.vtp
-    --camera-config=1
-    --vectors=V
-    --normalize-vectors=0
-    --step-size=0.5
-    --num-steps=800
-    --enhance-contrast=1
-    --color-mode=1
-    )
-ExternalData_add_test(VTKData
-  NAME ${vtk-module}Cxx-SurfaceLICCurvedContrastEnhancedBlendedSmallGrain
-  COMMAND ${vtk-module}CxxTests TestSurfaceLIC
-    -D ${VTK_TEST_DATA_DIR}
-    -T ${VTK_TEST_OUTPUT_DIR}
-    -V "DATA{${${vtk-module}_SOURCE_DIR}/Testing/Data/Baseline/TestSurfaceLICCurvedContrastEnhancedBlendedSmallGrain.png,:}"
-    --camera-config=1
-    --data=${VTK_TEST_DATA_DIR}/Data/disk_out_ref_surface.vtp
-    --vectors=V
-    --step-size=0.4
-    --num-steps=40
-    --generate-noise-texture=1
-    --noise-texture-size=200
-    --noise-grain-size=1
-    --number-of-noise-levels=1024
-    --noise-gen-seed=1
-    --enhance-contrast=1
-    --lic-intensity=0.8
-    )
-ExternalData_add_test(VTKData
-  NAME ${vtk-module}Cxx-SurfaceLICCurvedContrastEnhancedMappedSmallGrain
-  COMMAND ${vtk-module}CxxTests TestSurfaceLIC
-    -D ${VTK_TEST_DATA_DIR}
-    -T ${VTK_TEST_OUTPUT_DIR}
-    -V "DATA{${${vtk-module}_SOURCE_DIR}/Testing/Data/Baseline/TestSurfaceLICCurvedContrastEnhancedMappedSmallGrain.png,:}"
-    --camera-config=1
-    --data=${VTK_TEST_DATA_DIR}/Data/disk_out_ref_surface.vtp
-    --vectors=V
-    --step-size=0.4
-    --num-steps=40
-    --generate-noise-texture=1
-    --noise-texture-size=200
-    --noise-grain-size=1
-    --number-of-noise-levels=1024
-    --enhance-contrast=4
-    --color-mode=1
-    )
-ExternalData_add_test(VTKData
-  NAME ${vtk-module}Cxx-SurfaceLICCurvedContrastEnhancedMappedSmallVectorNormalizeOff
-  COMMAND ${vtk-module}CxxTests TestSurfaceLIC
-    -D ${VTK_TEST_DATA_DIR}
-    -T ${VTK_TEST_OUTPUT_DIR}
-    -V "DATA{${${vtk-module}_SOURCE_DIR}/Testing/Data/Baseline/TestSurfaceLICCurvedContrastEnhancedMappedSmallVectorNormalizeOff.png,:}"
-    --data=${VTK_TEST_DATA_DIR}/Data/disk_out_ref_surface.vtp
-    --camera-config=1
-    --vectors=V
-    --normalize-vectors=0
-    --step-size=0.5
-    --num-steps=800
-    --generate-noise-texture=1
-    --noise-texture-size=200
-    --noise-grain-size=1
-    --number-of-noise-levels=1024
-    --enhance-contrast=1
-    --low-lic-contrast-enhancement-factor=0.05
-    --color-mode=1
-    )
-ExternalData_add_test(VTKData
-  NAME ${vtk-module}Cxx-SurfaceLICCurvedDefaultsColor
-  COMMAND ${vtk-module}CxxTests TestSurfaceLIC
-    -D ${VTK_TEST_DATA_DIR}
-    -T ${VTK_TEST_OUTPUT_DIR}
-    -V "DATA{${${vtk-module}_SOURCE_DIR}/Testing/Data/Baseline/TestSurfaceLICCurvedDefaultsColor.png,:}"
-    --step-size=0.4
-    --num-steps=40
-    --camera-config=1
-    --data=${VTK_TEST_DATA_DIR}/Data/disk_out_ref_surface.vtp
-    --vectors=V
-    --color-by-mag=1
-    )
-ExternalData_add_test(VTKData
-  NAME ${vtk-module}Cxx-SurfaceLICCurvedContrastEnhancedColorBlendedSmallGrain
-  COMMAND ${vtk-module}CxxTests TestSurfaceLIC
-    -D ${VTK_TEST_DATA_DIR}
-    -T ${VTK_TEST_OUTPUT_DIR}
-    -V "DATA{${${vtk-module}_SOURCE_DIR}/Testing/Data/Baseline/TestSurfaceLICCurvedContrastEnhancedColorBlendedSmallGrain.png,:}"
-    --camera-config=1
-    --data=${VTK_TEST_DATA_DIR}/Data/disk_out_ref_surface.vtp
-    --vectors=V
-    --step-size=0.4
-    --num-steps=40
-    --generate-noise-texture=1
-    --noise-texture-size=200
-    --noise-grain-size=1
-    --number-of-noise-levels=1024
-    --noise-gen-seed=1
-    --enhance-contrast=1
-    --color-by-mag=1
-    --lic-intensity=0.6
-    )
-ExternalData_add_test(VTKData
-  NAME ${vtk-module}Cxx-SurfaceLICCurvedContrastEnhancedColorMappedSmallGrain
-  COMMAND ${vtk-module}CxxTests TestSurfaceLIC
-    -D ${VTK_TEST_DATA_DIR}
-    -T ${VTK_TEST_OUTPUT_DIR}
-    -V "DATA{${${vtk-module}_SOURCE_DIR}/Testing/Data/Baseline/TestSurfaceLICCurvedContrastEnhancedColorMappedSmallGrain.png,:}"
-    --camera-config=1
-    --data=${VTK_TEST_DATA_DIR}/Data/disk_out_ref_surface.vtp
-    --vectors=V
-    --step-size=0.4
-    --num-steps=40
-    --generate-noise-texture=1
-    --noise-texture-size=200
-    --noise-grain-size=1
-    --number-of-noise-levels=1024
-    --enhance-contrast=4
-    --color-by-mag=1
-    --color-mode=1
-    )
-ExternalData_add_test(VTKData
-  NAME ${vtk-module}Cxx-SurfaceLICCurvedContrastEnhancedColorBlendedSmallGrainMask
-  COMMAND ${vtk-module}CxxTests TestSurfaceLIC
-    -D ${VTK_TEST_DATA_DIR}
-    -T ${VTK_TEST_OUTPUT_DIR}
-    -V "DATA{${${vtk-module}_SOURCE_DIR}/Testing/Data/Baseline/TestSurfaceLICCurvedContrastEnhancedColorBlendedSmallGrainMask.png,:}"
-    --camera-config=1
-    --data=${VTK_TEST_DATA_DIR}/Data/disk_out_ref_surface.vtp
-    --vectors=V
-    --step-size=0.4
-    --num-steps=40
-    --generate-noise-texture=1
-    --noise-texture-size=200
-    --noise-grain-size=1
-    --number-of-noise-levels=1024
-    --noise-gen-seed=1
-    --enhance-contrast=1
-    --color-by-mag=1
-    --lic-intensity=0.6
-    --mask-intensity=0.2
-    --mask-color 1.0 1.0 1.0
-    )
-ExternalData_add_test(VTKData
-  NAME ${vtk-module}Cxx-SurfaceLICCurvedContrastEnhancedColorMappedSmallGrainMask
-  COMMAND ${vtk-module}CxxTests TestSurfaceLIC
-    -D ${VTK_TEST_DATA_DIR}
-    -T ${VTK_TEST_OUTPUT_DIR}
-    -V "DATA{${${vtk-module}_SOURCE_DIR}/Testing/Data/Baseline/TestSurfaceLICCurvedContrastEnhancedColorMappedSmallGrainMask.png,:}"
-    --camera-config=1
-    --data=${VTK_TEST_DATA_DIR}/Data/disk_out_ref_surface.vtp
-    --vectors=V
-    --step-size=0.4
-    --num-steps=40
-    --generate-noise-texture=1
-    --noise-texture-size=200
-    --noise-grain-size=1
-    --number-of-noise-levels=1024
-    --enhance-contrast=1
-    --high-lic-contrast-enhancement-factor=0.1
-    --color-by-mag=1
-    --color-mode=1
-    --map-mode-bias=0.05
-    --mask-intensity=0.2
-    --mask-color 1.0 1.0 1.0
-    )
-ExternalData_add_test(VTKData
-  NAME ${vtk-module}Cxx-SurfaceLICCurvedContrastEnhancedSmallGrainMask
-  COMMAND ${vtk-module}CxxTests TestSurfaceLIC
-    -D ${VTK_TEST_DATA_DIR}
-    -T ${VTK_TEST_OUTPUT_DIR}
-    -V "DATA{${${vtk-module}_SOURCE_DIR}/Testing/Data/Baseline/TestSurfaceLICCurvedContrastEnhancedSmallGrainMask.png,:}"
-    --camera-config=1
-    --data=${VTK_TEST_DATA_DIR}/Data/disk_out_ref_surface.vtp
-    --vectors=V
-    --normalize-vectors=0
-    --step-size=0.5
-    --num-steps=800
-    --generate-noise-texture=1
-    --noise-texture-size=200
-    --noise-grain-size=1
-    --number-of-noise-levels=1024
-    --enhance-contrast=1
-    --low-lic-contrast-enhancement-factor=0.05
-    --color-mode=1
-    --map-mode-bias=0.05
-    --mask-intensity=0.2
-    )
-# surface lic on a slice
-ExternalData_add_test(VTKData
-  NAME ${vtk-module}Cxx-SurfaceLICPlanarDefaults
-  COMMAND ${vtk-module}CxxTests TestSurfaceLIC
-    -D ${VTK_TEST_DATA_DIR}
-    -T ${VTK_TEST_OUTPUT_DIR}
-    -V "DATA{${${vtk-module}_SOURCE_DIR}/Testing/Data/Baseline/TestSurfaceLICPlanarDefaults.png,:}"
-    --data=${VTK_TEST_DATA_DIR}/Data/SurfaceVectors.vtk
-    --camera-config=3
-    --vectors=V
-    --step-size=1
-    --num-steps=40
-    --lic-intensity=0.8
-    )
-ExternalData_add_test(VTKData
-  NAME ${vtk-module}Cxx-SurfaceLICPlanarContrastEnhanced
-  COMMAND ${vtk-module}CxxTests TestSurfaceLIC
-    -D ${VTK_TEST_DATA_DIR}
-    -T ${VTK_TEST_OUTPUT_DIR}
-    -V "DATA{${${vtk-module}_SOURCE_DIR}/Testing/Data/Baseline/TestSurfaceLICPlanarContrastEnhanced.png,:}"
-    --data=${VTK_TEST_DATA_DIR}/Data/SurfaceVectors.vtk
-    --camera-config=3
-    --vectors=V
-    --step-size=1
-    --num-steps=40
-    --enhance-contrast=1
-    --color-mode=1
-    )
-ExternalData_add_test(VTKData
-  NAME ${vtk-module}Cxx-SurfaceLICPlanarVectorNormalizeOff
-  COMMAND ${vtk-module}CxxTests TestSurfaceLIC
-    -D ${VTK_TEST_DATA_DIR}
-    -T ${VTK_TEST_OUTPUT_DIR}
-    -V "DATA{${${vtk-module}_SOURCE_DIR}/Testing/Data/Baseline/TestSurfaceLICPlanarVectorNormalizeOff.png,:}"
-    --data=${VTK_TEST_DATA_DIR}/Data/SurfaceVectors.vtk
-    --camera-config=3
-    --vectors=V
-    --normalize-vectors=0
-    --step-size=0.5
-    --num-steps=2000
-    --generate-noise-texture=1
-    --noise-texture-size=128
-    --noise-grain-size=2
-    --number-of-noise-levels=256
-    --noise-gen-seed=12367
-    --enhance-contrast=1
-    --color-by-mag=1
-    --color-mode=1
-    )
-ExternalData_add_test(VTKData
-  NAME ${vtk-module}Cxx-SurfaceLICPlanarVectorNormalizeOffMediumGrainUniform
-  COMMAND ${vtk-module}CxxTests TestSurfaceLIC
-    -D ${VTK_TEST_DATA_DIR}
-    -T ${VTK_TEST_OUTPUT_DIR}
-    -V "DATA{${${vtk-module}_SOURCE_DIR}/Testing/Data/Baseline/TestSurfaceLICPlanarVectorNormalizeOffMediumGrainUniform.png,:}"
-    --data=${VTK_TEST_DATA_DIR}/Data/SurfaceVectors.vtk
-    --camera-config=3
-    --vectors=V
-    --enhanced-lic=0
-    --step-size=0.25
-    --num-steps=40
-    --generate-noise-texture=1
-    --noise-type=1
-    --noise-texture-size=128
-    --noise-grain-size=2
-    --impulse-noise-prob=0.04
-    --enhance-contrast=4
-    --high-color-contrast-enhancement-factor=0.2
-    --color-by-mag=1
-    --color-mode=1
-    )
-ExternalData_add_test(VTKData
-  NAME ${vtk-module}Cxx-SurfaceLICPlanarVectorNormalizeOffMediumGrainPerlin
-  COMMAND ${vtk-module}CxxTests TestSurfaceLIC
-    -D ${VTK_TEST_DATA_DIR}
-    -T ${VTK_TEST_OUTPUT_DIR}
-    -V "DATA{${${vtk-module}_SOURCE_DIR}/Testing/Data/Baseline/TestSurfaceLICPlanarVectorNormalizeOffMediumGrainPerlin.png,:}"
-    --data=${VTK_TEST_DATA_DIR}/Data/SurfaceVectors.vtk
-    --camera-config=3
-    --vectors=V
-    --normalize-vectors=0
-    --step-size=2
-    --num-steps=400
-    --generate-noise-texture=1
-    --noise-type=2
-    --noise-texture-size=256
-    --noise-grain-size=8
-    --max-noise-value=0.8
-    --enhance-contrast=4
-    --color-by-mag=1
-    --color-mode=1
-    --anti-alias=1
-    )
-ExternalData_add_test(VTKData
-  NAME ${vtk-module}Cxx-SurfaceLICMultiBlockContrastEnhancedPerlin
-  COMMAND ${vtk-module}CxxTests TestSurfaceLIC
-    -D ${VTK_TEST_DATA_DIR}
-    -T ${VTK_TEST_OUTPUT_DIR}
-    -V "DATA{${${vtk-module}_SOURCE_DIR}/Testing/Data/Baseline/TestSurfaceLICMultiBlockContrastEnhancedPerlin.png,:}"
-    --data=${VTK_TEST_DATA_DIR}/Data/ex-blow_5.vtm
-    --camera-config=4
-    --vectors=DISPLACEMENT_
-    --step-size=0.1
-    --num-steps=50
-    --generate-noise-texture=1
-    --noise-type=2
-    --noise-texture-size=128
-    --noise-grain-size=2
-    --number-of-noise-levels=1024
-    --noise-gen-seed=1
-    --enhance-contrast=4
-    --color-by-mag=1
-    --color-mode=1
-    --map-mode-bias=0.1
-    --mask-on-surface=1
-    --mask-intensity=0.41
-    --mask-color 0 0 0
-    )
diff --git a/Rendering/LICOpenGL2/Testing/Cxx/TestImageDataLIC2D.cxx b/Rendering/LICOpenGL2/Testing/Cxx/TestImageDataLIC2D.cxx
deleted file mode 100644
index 0ad4a4a..0000000
--- a/Rendering/LICOpenGL2/Testing/Cxx/TestImageDataLIC2D.cxx
+++ /dev/null
@@ -1,404 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    TestImageDataLIC2D.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 "TestImageDataLIC2D.h"
-
-#include "vtkGenericDataObjectReader.h"
-#include "vtkImageDataLIC2D.h"
-#include "vtkPixelExtent.h"
-#include "vtkPixelTransfer.h"
-#include "vtkImageData.h"
-#include "vtkPointData.h"
-#include "vtkUnsignedCharArray.h"
-#include "vtkFloatArray.h"
-#include "vtkImageIterator.h"
-#include "vtkImagePermute.h"
-#include "vtkImageShiftScale.h"
-#include "vtkPNGReader.h"
-#include "vtkPNGWriter.h"
-#include "vtkDataSetWriter.h"
-#include "vtkProbeFilter.h"
-#include "vtkRenderWindow.h"
-#include "vtkSmartPointer.h"
-#include "vtkStreamingDemandDrivenPipeline.h"
-#include "vtkStructuredData.h"
-#include "vtkTimerLog.h"
-#include "vtkUnstructuredGrid.h"
-#include "vtkTestUtilities.h"
-#include "vtkRegressionTestImage.h"
-#include "vtkTesting.h"
-#include <vtksys/CommandLineArguments.hxx>
-#include "vtkImageMapToColors.h"
-#include "vtkLookupTable.h"
-#include "vtkTrivialProducer.h"
-#include <vtksys/SystemTools.hxx>
-#include <sstream>
-using std::ostringstream;
-
-//-----------------------------------------------------------------------------
-int TestImageDataLIC2D(int argc, char* argv[])
-{
-  char* fname =
-    vtkTestUtilities::ExpandDataFileName(argc, argv, "Data/SurfaceVectors.vtk");
-  std::string filename = fname;
-  filename = "--data=" + filename;
-  delete [] fname;
-
-  fname = vtkTestUtilities::ExpandDataFileName(argc, argv, "Data/noise.png");
-  std::string noise = fname;
-  noise = "--noise=" + noise;
-  delete [] fname;
-
-  char** new_argv = new char*[argc+10];
-  for (int cc=0; cc < argc; cc++)
-    {
-    new_argv[cc] = vtksys::SystemTools::DuplicateString(argv[cc]);
-    }
-  new_argv[argc++] = vtksys::SystemTools::DuplicateString(filename.c_str());
-  new_argv[argc++] = vtksys::SystemTools::DuplicateString(noise.c_str());
-  new_argv[argc++] = vtksys::SystemTools::DuplicateString("--mag=5");
-  new_argv[argc++] = vtksys::SystemTools::DuplicateString("--partitions=5");
-  int status = ImageDataLIC2D(argc, new_argv);
-  for (int kk=0; kk < argc; kk++)
-    {
-    delete [] new_argv[kk];
-    }
-  delete [] new_argv;
-  return status;
-}
-
-// Example demonstrating use of vtkImageDataLIC2D filter.
-// Typical usage:
-// ./bin/ImageDataLIC2D --data=<vtk file> --output=<png file>
-//-----------------------------------------------------------------------------
-int ImageDataLIC2D(int argc, char* argv[])
-{
-  std::string filename;
-  std::string noise_filename;
-  int resolution = 10;
-  int magnification = 1;
-  std::string outputpath;
-  int num_partitions = 1;
-  int num_steps = 40;
-
-  vtksys::CommandLineArguments arg;
-  arg.StoreUnusedArguments(1);
-  arg.Initialize(argc, argv);
-
-  typedef vtksys::CommandLineArguments argT;
-  arg.AddArgument("--data", argT::EQUAL_ARGUMENT, &filename,
-    "(required) Enter dataset to load (currently only *.vtk files are supported");
-  arg.AddArgument("--res", argT::EQUAL_ARGUMENT, &resolution,
-    "(optional: default 10) Number of sample per unit distance");
-  arg.AddArgument("--mag", argT::EQUAL_ARGUMENT, &magnification,
-    "(optional: default 1) Magnification");
-  arg.AddArgument("--output", argT::EQUAL_ARGUMENT, &outputpath,
-    "(optional) Output png image");
-  arg.AddArgument("--partitions", argT::EQUAL_ARGUMENT, &num_partitions,
-    "(optional: default 1) Number of partitions");
-  arg.AddArgument("--num-steps", argT::EQUAL_ARGUMENT, &num_steps,
-    "(optional: default 40) Number of steps in each direction");
-  arg.AddArgument("--noise", argT::EQUAL_ARGUMENT, &noise_filename,
-    "(optional) Specify the filename to a png image file to use as the noise texture.");
-
-  if (!arg.Parse() || filename=="")
-    {
-    cerr << "Problem parsing arguments." << endl;
-    cerr << arg.GetHelp() << endl;
-    return -1;
-    }
-
-  if (magnification < 1)
-    {
-    cerr << "WARNING: Magnification cannot be less than 1. Using 1" << endl;
-    magnification = 1;
-    }
-
-  if (num_steps < 0)
-    {
-    cerr << "WARNING: Number of steps cannot be less than 0. Forcing 0." << endl;
-    num_steps = 0;
-    }
-
-  // set up test helper
-  vtkSmartPointer<vtkTesting> tester
-    = vtkSmartPointer<vtkTesting>::New();
-
-  for (int cc=0; cc < argc; cc++)
-    {
-    tester->AddArgument(argv[cc]);
-    }
-  if (!tester->IsValidImageSpecified())
-    {
-    cerr << "ERROR: Valid image not specified." << endl;
-    return -2;
-    }
-
-  // load noise
-  vtkSmartPointer<vtkImageData> noise;
-  if (noise_filename != "")
-    {
-    vtkSmartPointer<vtkPNGReader> pngReader
-      = vtkSmartPointer<vtkPNGReader>::New();
-
-    pngReader->SetFileName(noise_filename.c_str());
-    pngReader->Update();
-
-    noise = pngReader->GetOutput();
-
-    vtkUnsignedCharArray *cVals
-      = vtkUnsignedCharArray::SafeDownCast(noise->GetPointData()->GetScalars());
-    if (!cVals)
-      {
-      cerr << "Error: expected unsigned chars, test fails" << endl;
-      return 1;
-      }
-
-    unsigned char *pCVals = cVals->GetPointer(0);
-    vtkIdType cTups = cVals->GetNumberOfTuples();
-
-    vtkFloatArray *fVals = vtkFloatArray::New();
-    fVals->SetNumberOfComponents(2);
-    fVals->SetNumberOfTuples(cTups);
-    fVals->SetName("noise");
-    float *pFVals = fVals->GetPointer(0);
-
-    size_t nVals = 2*cTups;
-    for (size_t i=0; i<nVals; ++i)
-      {
-      pFVals[i] = pCVals[i]/255.0;
-      }
-
-    noise->GetPointData()->RemoveArray(0);
-    noise->GetPointData()->SetScalars(fVals);
-    fVals->Delete();
-    }
-
-  // load vectors
-  vtkSmartPointer<vtkGenericDataObjectReader> reader
-    = vtkSmartPointer<vtkGenericDataObjectReader>::New();
-
-  reader->SetFileName(filename.c_str());
-  reader->Update();
-
-  vtkDataSet *dataset = vtkDataSet::SafeDownCast(reader->GetOutput());
-  if (!dataset)
-    {
-    cerr << "Error: expected dataset, test fails" << endl;
-    return 1;
-    }
-  double bounds[6];
-  dataset->GetBounds(bounds);
-
-  // If 3D use XY slice, otherwise use non-trivial slice.
-  int dataDesc = VTK_XY_PLANE;
-  if (bounds[0] == bounds[1])
-    {
-    dataDesc = VTK_YZ_PLANE;
-    }
-  else if (bounds[2] == bounds[3])
-    {
-    dataDesc = VTK_XZ_PLANE;
-    }
-  else if (bounds[4] == bounds[5])
-    {
-    dataDesc = VTK_XY_PLANE;
-    }
-
-  int comp[3] = {0,1,2};
-  switch (dataDesc)
-    {
-  case VTK_XY_PLANE:
-    comp[0] = 0;
-    comp[1] = 1;
-    comp[2] = 2;
-    break;
-
-  case VTK_YZ_PLANE:
-    comp[0] = 1;
-    comp[1] = 2;
-    comp[2] = 0;
-    break;
-
-  case VTK_XZ_PLANE:
-    comp[0] = 0;
-    comp[1] = 2;
-    comp[2] = 1;
-    break;
-    }
-
-  int  width  = static_cast<int>(ceil((bounds[2*comp[0]+1]-bounds[2*comp[0]]) * resolution));
-  int  height = static_cast<int>(ceil((bounds[2*comp[1]+1]-bounds[2*comp[1]]) * resolution));
-
-  int dims[3];
-  dims[comp[0]] = width;
-  dims[comp[1]] = height;
-  dims[comp[2]] = 1;
-
-  double spacing[3];
-  spacing[comp[0]] = (bounds[2*comp[0]+1]-bounds[2*comp[0]])/double(width);
-  spacing[comp[1]] = (bounds[2*comp[1]+1]-bounds[2*comp[1]])/double(height);
-  spacing[comp[2]] = 1.0;
-
-  double origin[3] = {bounds[0], bounds[2], bounds[4]};
-
-  int outWidth = magnification*width;
-  int outHeight = magnification*height;
-
-  double outSpacing[3];
-  outSpacing[0] = spacing[comp[0]]/magnification;
-  outSpacing[1] = spacing[comp[1]]/magnification;
-  outSpacing[2] = 1.0;
-
-  // convert input dataset to an image data
-  vtkSmartPointer<vtkImageData> probeData
-    = vtkSmartPointer<vtkImageData>::New();
-
-  probeData->SetOrigin(origin);
-  probeData->SetDimensions(dims);
-  probeData->SetSpacing(spacing);
-
-  vtkSmartPointer<vtkProbeFilter> probe
-    = vtkSmartPointer<vtkProbeFilter>::New();
-
-  probe->SetSourceConnection(reader->GetOutputPort());
-  probe->SetInputData(probeData);
-  probe->Update();
-  probeData = NULL;
-
-  // create and initialize a rendering context
-  vtkSmartPointer<vtkRenderWindow> renWin
-    = vtkSmartPointer<vtkRenderWindow>::New();
-  renWin->Render();
-
-  // create and initialize the image lic'er
-  vtkSmartPointer<vtkImageDataLIC2D> filter
-    = vtkSmartPointer<vtkImageDataLIC2D>::New();
-
-  if (filter->SetContext( renWin ) == 0)
-    {
-    cerr << "WARNING: Required OpenGL not supported, test passes." << endl;
-    return 0;
-    }
-  filter->SetSteps(num_steps);
-  filter->SetStepSize(0.8/magnification);
-  filter->SetMagnification(magnification);
-  filter->SetInputConnection(0, probe->GetOutputPort(0));
-  if ( noise )
-    {
-    filter->SetInputData(1, noise);
-    }
-  filter->UpdateInformation();
-  noise = NULL;
-
-  // array to hold the results
-  vtkPixelExtent licDataExt(outWidth, outHeight);
-
-  size_t licDataSize = licDataExt.Size();
-
-  vtkSmartPointer<vtkFloatArray> licData
-    = vtkSmartPointer<vtkFloatArray>::New();
-
-  licData->SetNumberOfComponents(3);
-  licData->SetNumberOfTuples(licDataSize);
-
-  // for each piece in the paritioned dataset compute lic and
-  // copy into the output.
-  for (int kk=0; kk < num_partitions; kk++)
-    {
-    filter->SetUpdateExtent(0, kk, num_partitions, 0);
-    filter->Update();
-
-    vtkImageData *licPieceDataSet = filter->GetOutput();
-    vtkDataArray *licPiece = licPieceDataSet->GetPointData()->GetScalars();
-
-    int tmp[6];
-    licPieceDataSet->GetExtent(tmp);
-
-    vtkPixelExtent licPieceExt(
-            tmp[2*comp[0]],
-            tmp[2*comp[0]+1],
-            tmp[2*comp[1]],
-            tmp[2*comp[1]+1]);
-
-    vtkPixelTransfer::Blit(
-            licPieceExt,
-            licPieceExt,
-            licDataExt,
-            licPieceExt,
-            licPiece->GetNumberOfComponents(),
-            licPiece->GetDataType(),
-            licPiece->GetVoidPointer(0),
-            licData->GetNumberOfComponents(),
-            licData->GetDataType(),
-            licData->GetVoidPointer(0));
-     }
-  probe = NULL;
-  filter = NULL;
-  renWin = NULL;
-
-  // convert from float to u char for png
-  vtkSmartPointer<vtkUnsignedCharArray> licPng
-    = vtkSmartPointer<vtkUnsignedCharArray>::New();
-
-  licPng->SetNumberOfComponents(3);
-  licPng->SetNumberOfTuples(licDataSize);
-  unsigned char *pPng = licPng->GetPointer(0);
-  float *pData = licData->GetPointer(0);
-  size_t n = 3*licDataSize;
-  for (size_t i=0; i<n; ++i)
-    {
-    pPng[i] = static_cast<unsigned char>(pData[i]*255.0f);
-    }
-  licData = NULL;
-
-  // wrap the result into an image data for the png writer
-  vtkSmartPointer<vtkImageData> pngDataSet
-    = vtkSmartPointer<vtkImageData>::New();
-
-  pngDataSet->SetDimensions(outWidth, outHeight, 1);
-  pngDataSet->SetSpacing(outSpacing);
-  pngDataSet->SetOrigin(origin);
-  pngDataSet->GetPointData()->SetScalars(licPng);
-  licPng = NULL;
-
-  // save a png
-  if (outputpath != "")
-    {
-    vtkSmartPointer<vtkPNGWriter> writer
-      = vtkSmartPointer<vtkPNGWriter>::New();
-
-    writer->SetFileName(outputpath.c_str());
-    writer->SetInputData(pngDataSet);
-    writer->Write();
-    writer = NULL;
-    }
-
-  // run the test
-  vtkSmartPointer<vtkTrivialProducer> tp
-    = vtkSmartPointer<vtkTrivialProducer>::New();
-
-  tp->SetOutput(pngDataSet);
-  int retVal =
-    (tester->RegressionTest(tp, 10) == vtkTesting::PASSED)? 0 : -4;
-  if (retVal)
-    {
-    cerr << "ERROR: test failed." << endl;
-    }
-
-  tp = NULL;
-  pngDataSet = NULL;
-
-  return retVal;
-}
diff --git a/Rendering/LICOpenGL2/Testing/Cxx/TestImageDataLIC2D.h b/Rendering/LICOpenGL2/Testing/Cxx/TestImageDataLIC2D.h
deleted file mode 100644
index 903aaa7..0000000
--- a/Rendering/LICOpenGL2/Testing/Cxx/TestImageDataLIC2D.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    TestImageDataLIC2D.h
-
-  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.
-
-=========================================================================*/
-
-#ifndef  __TestImageDataLIC2D_h
-#define  __TestImageDataLIC2D_h
-
-// Example demonstrating use of vtkImageDataLIC2D filter.
-// Typical usage:
-// ./bin/ImageDataLIC2D --data=<vtk file> --output=<png file>
-int ImageDataLIC2D(int argc, char* argv[]);
-
-#endif
diff --git a/Rendering/LICOpenGL2/Testing/Cxx/TestStructuredGridLIC2DXSlice.cxx b/Rendering/LICOpenGL2/Testing/Cxx/TestStructuredGridLIC2DXSlice.cxx
deleted file mode 100644
index dec1e9c..0000000
--- a/Rendering/LICOpenGL2/Testing/Cxx/TestStructuredGridLIC2DXSlice.cxx
+++ /dev/null
@@ -1,55 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    TestStructuredGridLIC2DXSlice.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 "vtkStructuredGridLIC2DTestDriver.h"
-#include "vtkTestUtilities.h"
-#include "vtksys/SystemTools.hxx"
-
-int TestStructuredGridLIC2DXSlice(int argc, char* argv[])
-{
-  char* fname =
-    vtkTestUtilities::ExpandDataFileName(argc, argv, "Data/timestep_0_15.vts");
-
-  std::string filename = fname;
-  filename = "--data=" + filename;
-  delete [] fname;
-
-  fname = vtkTestUtilities::ExpandDataFileName(argc, argv, "Data/noise.png");
-  std::string noise = fname;
-  noise = "--noise=" + noise;
-  delete [] fname;
-
-  char** new_argv = new char*[argc+12];
-  for (int cc=0; cc < argc; cc++)
-    {
-    new_argv[cc] = vtksys::SystemTools::DuplicateString(argv[cc]);
-    }
-  new_argv[argc++] = vtksys::SystemTools::DuplicateString(filename.c_str());
-  new_argv[argc++] = vtksys::SystemTools::DuplicateString(noise.c_str());
-  new_argv[argc++] = vtksys::SystemTools::DuplicateString("--mag=8");
-  new_argv[argc++] = vtksys::SystemTools::DuplicateString("--partitions=1");
-  new_argv[argc++] = vtksys::SystemTools::DuplicateString("--num-steps=100");
-  new_argv[argc++] = vtksys::SystemTools::DuplicateString("--slice-dir=0");
-  new_argv[argc++] = vtksys::SystemTools::DuplicateString("--slice=98");
-  new_argv[argc++] = vtksys::SystemTools::DuplicateString("--zoom-factor=3.0");
-  new_argv[argc++] = vtksys::SystemTools::DuplicateString("--test-mode=1");
-  int status = vtkStructuredGridLIC2DTestDriver(argc, new_argv);
-  for (int kk=0; kk < argc; kk++)
-    {
-    delete [] new_argv[kk];
-    }
-  delete [] new_argv;
-
-  return status;
-}
diff --git a/Rendering/LICOpenGL2/Testing/Cxx/TestStructuredGridLIC2DYSlice.cxx b/Rendering/LICOpenGL2/Testing/Cxx/TestStructuredGridLIC2DYSlice.cxx
deleted file mode 100644
index ab89d61..0000000
--- a/Rendering/LICOpenGL2/Testing/Cxx/TestStructuredGridLIC2DYSlice.cxx
+++ /dev/null
@@ -1,54 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    TestStructuredGridLIC2DYSlice.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 "vtkStructuredGridLIC2DTestDriver.h"
-#include "vtkTestUtilities.h"
-#include "vtksys/SystemTools.hxx"
-
-int TestStructuredGridLIC2DYSlice(int argc, char* argv[])
-{
-  char* fname =
-    vtkTestUtilities::ExpandDataFileName(argc, argv, "Data/timestep_0_15.vts");
-
-  std::string filename = fname;
-  filename = "--data=" + filename;
-  delete [] fname;
-
-  fname = vtkTestUtilities::ExpandDataFileName(argc, argv, "Data/noise.png");
-  std::string noise = fname;
-  noise = "--noise=" + noise;
-  delete [] fname;
-
-  char** new_argv = new char*[argc+12];
-  for (int cc=0; cc < argc; cc++)
-    {
-    new_argv[cc] = vtksys::SystemTools::DuplicateString(argv[cc]);
-    }
-  new_argv[argc++] = vtksys::SystemTools::DuplicateString(filename.c_str());
-  new_argv[argc++] = vtksys::SystemTools::DuplicateString(noise.c_str());
-  new_argv[argc++] = vtksys::SystemTools::DuplicateString("--mag=8");
-  new_argv[argc++] = vtksys::SystemTools::DuplicateString("--partitions=1");
-  new_argv[argc++] = vtksys::SystemTools::DuplicateString("--num-steps=100");
-  new_argv[argc++] = vtksys::SystemTools::DuplicateString("--slice-dir=1");
-  new_argv[argc++] = vtksys::SystemTools::DuplicateString("--slice=0");
-  new_argv[argc++] = vtksys::SystemTools::DuplicateString("--zoom-factor=3.0");
-  new_argv[argc++] = vtksys::SystemTools::DuplicateString("--test-mode=1");
-  int status = vtkStructuredGridLIC2DTestDriver(argc, new_argv);
-  for (int kk=0; kk < argc; kk++)
-    {
-    delete [] new_argv[kk];
-    }
-  delete [] new_argv;
-  return status;
-}
diff --git a/Rendering/LICOpenGL2/Testing/Cxx/TestStructuredGridLIC2DZSlice.cxx b/Rendering/LICOpenGL2/Testing/Cxx/TestStructuredGridLIC2DZSlice.cxx
deleted file mode 100644
index 98e9656..0000000
--- a/Rendering/LICOpenGL2/Testing/Cxx/TestStructuredGridLIC2DZSlice.cxx
+++ /dev/null
@@ -1,54 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    TestStructuredGridLIC2DZSlice.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 "vtkStructuredGridLIC2DTestDriver.h"
-#include "vtkTestUtilities.h"
-#include "vtksys/SystemTools.hxx"
-
-int TestStructuredGridLIC2DZSlice(int argc, char* argv[])
-{
-  char* fname =
-    vtkTestUtilities::ExpandDataFileName(argc, argv, "Data/timestep_0_15.vts");
-
-  std::string filename = fname;
-  filename = "--data=" + filename;
-  delete [] fname;
-
-  fname = vtkTestUtilities::ExpandDataFileName(argc, argv, "Data/noise.png");
-  std::string noise = fname;
-  noise = "--noise=" + noise;
-  delete [] fname;
-
-  char** new_argv = new char*[argc+12];
-  for (int cc=0; cc < argc; cc++)
-    {
-    new_argv[cc] = vtksys::SystemTools::DuplicateString(argv[cc]);
-    }
-  new_argv[argc++] = vtksys::SystemTools::DuplicateString(filename.c_str());
-  new_argv[argc++] = vtksys::SystemTools::DuplicateString(noise.c_str());
-  new_argv[argc++] = vtksys::SystemTools::DuplicateString("--mag=8");
-  new_argv[argc++] = vtksys::SystemTools::DuplicateString("--partitions=1");
-  new_argv[argc++] = vtksys::SystemTools::DuplicateString("--num-steps=100");
-  new_argv[argc++] = vtksys::SystemTools::DuplicateString("--slice-dir=2");
-  new_argv[argc++] = vtksys::SystemTools::DuplicateString("--slice=10");
-  new_argv[argc++] = vtksys::SystemTools::DuplicateString("--zoom-factor=3.8");
-  new_argv[argc++] = vtksys::SystemTools::DuplicateString("--test-mode=1");
-  int status = vtkStructuredGridLIC2DTestDriver(argc, new_argv);
-  for (int kk=0; kk < argc; kk++)
-    {
-    delete [] new_argv[kk];
-    }
-  delete [] new_argv;
-  return status;
-}
diff --git a/Rendering/LICOpenGL2/Testing/Cxx/TestSurfaceLIC.cxx b/Rendering/LICOpenGL2/Testing/Cxx/TestSurfaceLIC.cxx
deleted file mode 100644
index 9bbd069..0000000
--- a/Rendering/LICOpenGL2/Testing/Cxx/TestSurfaceLIC.cxx
+++ /dev/null
@@ -1,252 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    TestSurfaceLIC.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 "vtkObjectFactory.h"
-#include "vtkCellData.h"
-#include "vtkDataSetSurfaceFilter.h"
-#include "vtkPointData.h"
-#include "vtkPolyData.h"
-#include "vtkSmartPointer.h"
-#include "vtkXMLPolyDataReader.h"
-#include "vtkXMLMultiBlockDataReader.h"
-#include "vtkGenericDataObjectReader.h"
-#include "vtkCompositeDataPipeline.h"
-#include "vtkCompositeDataSet.h"
-#include "vtkSurfaceLICTestDriver.h"
-
-#include <vtksys/CommandLineArguments.hxx>
-#include <vtksys/SystemTools.hxx>
-#include <vector>
-#include <string>
-
-// Description:
-// Serial regression test, parse command line, build the
-// pipeline, call the driver.
-int TestSurfaceLIC(int argc, char* argv[])
-{
-  vtkCompositeDataPipeline* prototype = vtkCompositeDataPipeline::New();
-  vtkAlgorithm::SetDefaultExecutivePrototype(prototype);
-  prototype->Delete();
-
-  std::string filename;
-  int num_steps = 40;
-  double step_size = 0.4;
-  int enhanced_lic = 1;
-  int normalize_vectors = 1;
-  int camera_config = 1;
-  int generate_noise_texture = 0;
-  int noise_type = 1;
-  int noise_texture_size = 200;
-  int noise_grain_size = 2;
-  double min_noise_value = 0.0;
-  double max_noise_value = 1.0;
-  int number_of_noise_levels = 256;
-  double impulse_noise_prob = 1.0;
-  double impulse_noise_bg_value = 0.0;
-  int noise_gen_seed = 1;
-  int enhance_contrast = 0;
-  double low_lic_contrast_enhancement_factor = 0.0;
-  double high_lic_contrast_enhancement_factor = 0.0;
-  double low_color_contrast_enhancement_factor = 0.0;
-  double high_color_contrast_enhancement_factor = 0.0;
-  int anti_alias = 0;
-  int color_mode = 0;
-  double lic_intensity = 0.8;
-  double map_mode_bias = 0.0;
-  int color_by_mag = 0;
-  int mask_on_surface = 0;
-  double mask_threshold = 0.0;
-  double mask_intensity = 0.0;
-  std::vector<double> mask_color_rgb;
-  std::string vectors;
-
-  vtksys::CommandLineArguments arg;
-  arg.StoreUnusedArguments(1);
-  arg.Initialize(argc, argv);
-
-  // Fill up accepted arguments.
-  typedef vtksys::CommandLineArguments argT;
-
-  arg.AddArgument("--data", argT::EQUAL_ARGUMENT, &filename,
-    "(required) Enter dataset to load (currently only *.[vtk|vtp] files are supported");
-  arg.AddArgument("--num-steps", argT::EQUAL_ARGUMENT, &num_steps,
-    "(optional: default 40) Number of steps in each direction");
-  arg.AddArgument("--step-size", argT::EQUAL_ARGUMENT, &step_size,
-    "(optional: default 0.4) Step size in pixels");
-  arg.AddArgument("--enhanced-lic", argT::EQUAL_ARGUMENT, &enhanced_lic,
-    "(optional: default 1) Enable enhanced algoruthm");
-  arg.AddArgument("--color-by-mag", argT::EQUAL_ARGUMENT, &color_by_mag,
-    "(optional: default 0) when set compute the magnitude of the vector and color the lic by this");
-  arg.AddArgument("--vectors", argT::EQUAL_ARGUMENT, &vectors,
-    "(optional: default active point vectors) Name of the vector field array");
-  arg.AddArgument("--normalize-vectors", argT::EQUAL_ARGUMENT, &normalize_vectors,
-    "(optional: default 1) Normalize vectors during integration");
-  arg.AddArgument("--generate-noise-texture", argT::EQUAL_ARGUMENT, &generate_noise_texture,
-    "(optional: default 0) Generate noise texture (if not generate use pickeled 200x200 noise texture.");
-  arg.AddArgument("--noise-type", argT::EQUAL_ARGUMENT, &noise_type,
-    "(optional: default 1) statistical distribution for noise generator, 0=Uniform, 1=Gaussian. 2=perlin");
-  arg.AddArgument("--noise-texture-size", argT::EQUAL_ARGUMENT, &noise_texture_size,
-    "(optional: default 200) side of the square texture in pixels");
-  arg.AddArgument("--noise-grain-size", argT::EQUAL_ARGUMENT, &noise_grain_size,
-    "(optional: default 1) number of pixels each noise value occupies");
-  arg.AddArgument("--min-noise-value", argT::EQUAL_ARGUMENT, &min_noise_value,
-    "(optional: default 0) darkest color noise can contain");
-  arg.AddArgument("--max-noise-value", argT::EQUAL_ARGUMENT, &max_noise_value,
-    "(optional: default 1) lightest color noise can contain");
-  arg.AddArgument("--number-of-noise-levels", argT::EQUAL_ARGUMENT, &number_of_noise_levels,
-    "(optional: default 256) number of gray scale colors");
-  arg.AddArgument("--impulse-noise-prob", argT::EQUAL_ARGUMENT, &impulse_noise_prob,
-    "(optional: default 1.0) probabilty a pixel will conatin a noise value");
-  arg.AddArgument("--impulse-noise-bg-val", argT::EQUAL_ARGUMENT, &impulse_noise_bg_value,
-    "(optional: default 1.0) bg_valabilty a pixel will conatin a noise value");
-  arg.AddArgument("--noise-gen-seed", argT::EQUAL_ARGUMENT, &noise_gen_seed,
-    "(optional: default 1) set the seed to the random number generator");
-  arg.AddArgument("--enhance-contrast", argT::EQUAL_ARGUMENT, &enhance_contrast,
-    "(optional: default 0) Nomralize colors after each pass");
-  arg.AddArgument("--low-lic-contrast-enhancement-factor", argT::EQUAL_ARGUMENT, &low_lic_contrast_enhancement_factor,
-    "(optional: default 0) lower normalization factor 0 is the min");
-  arg.AddArgument("--high-lic-contrast-enhancement-factor", argT::EQUAL_ARGUMENT, &high_lic_contrast_enhancement_factor,
-    "(optional: default 1) upper normalization factor, 0 is the max");
-  arg.AddArgument("--low-color-contrast-enhancement-factor", argT::EQUAL_ARGUMENT, &low_color_contrast_enhancement_factor,
-    "(optional: default 0) lower normalization factor 0 is the min");
-  arg.AddArgument("--high-color-contrast-enhancement-factor", argT::EQUAL_ARGUMENT, &high_color_contrast_enhancement_factor,
-    "(optional: default 1) upper normalization factor, 0 is the max");
-  arg.AddArgument("--anti-alias", argT::EQUAL_ARGUMENT, &anti_alias,
-    "(optional: default 0) apply anti-aliasing pass after lic to remove jagged artifacts");
-  arg.AddArgument("--color-mode", argT::EQUAL_ARGUMENT, &color_mode,
-    "(optional: default 0) choose color blending algorithm 0==blending 1==mapping");
-  arg.AddArgument("--lic-intensity", argT::EQUAL_ARGUMENT, &lic_intensity,
-    "(optional: default 0.8) Contribution of LIC in the final image [1.0 == max contribution]");
-  arg.AddArgument("--map-mode-bias", argT::EQUAL_ARGUMENT, &map_mode_bias,
-    "(optional: default 0.8) Contribution of LIC in the final image [1.0 == max contribution]");
-  arg.AddArgument("--mask-on-surface", argT::EQUAL_ARGUMENT, &mask_on_surface,
-    "(optional: default 0) Mask criteria is computed on surface-projected vectors");
-  arg.AddArgument("--mask-threshold", argT::EQUAL_ARGUMENT, &mask_threshold,
-    "(optional: default 0.0) Mask fragment if |V| < threshold");
-  arg.AddArgument("--mask-intensity", argT::EQUAL_ARGUMENT, &mask_intensity,
-    "(optional: default 0.0) blending factor for masked fragments");
-  arg.AddArgument("--mask-color", argT::MULTI_ARGUMENT, &mask_color_rgb,
-    "(optional: default pink=1.0 0.0 0.84705) mask color");
-  arg.AddArgument("--camera-config", argT::EQUAL_ARGUMENT, &camera_config,
-    "(optional: default 1) use a preset camera configuration");
-
-  if (!arg.Parse() || filename == "")
-    {
-    cerr << "Usage: " << endl;
-    cerr << arg.GetHelp() << endl;
-    return 1;
-    }
-
-  if (mask_color_rgb.size() == 0)
-    {
-    // something bright for the default.
-    mask_color_rgb.resize(3);
-    mask_color_rgb[0] = 1.0;
-    mask_color_rgb[1] = 0.0;
-    mask_color_rgb[2] = 0.84705;
-    }
-
-  vtkSmartPointer<vtkDataObject> dataObj;
-  std::string ext = vtksys::SystemTools::GetFilenameExtension(filename);
-  if (ext == ".vtk")
-    {
-    vtkGenericDataObjectReader* reader = vtkGenericDataObjectReader::New();
-    reader->SetFileName(filename.c_str());
-
-    vtkDataSetSurfaceFilter* surface = vtkDataSetSurfaceFilter::New();
-    surface->SetInputConnection(reader->GetOutputPort());
-    surface->Update();
-
-    dataObj = surface->GetOutputDataObject(0);
-
-    reader->Delete();
-    surface->Delete();
-    }
-  else
-  if (ext == ".vtp")
-    {
-    vtkXMLPolyDataReader* reader = vtkXMLPolyDataReader::New();
-    reader->SetFileName(filename.c_str());
-    reader->Update();
-    dataObj = reader->GetOutputDataObject(0);
-    reader->Delete();
-    }
-  else
-  if (ext == ".vtm")
-    {
-    vtkXMLMultiBlockDataReader* reader = vtkXMLMultiBlockDataReader::New();
-    reader->SetFileName(filename.c_str());
-
-    vtkDataSetSurfaceFilter* surface = vtkDataSetSurfaceFilter::New();
-    surface->SetInputConnection(reader->GetOutputPort());
-    surface->Update();
-
-    dataObj = surface->GetOutputDataObject(0);
-
-    reader->Delete();
-    surface->Delete();
-    }
-  else
-    {
-    cerr << "Error: Unknown extension: '" << ext << "'"<< endl;
-    vtkAlgorithm::SetDefaultExecutivePrototype(NULL);
-    return 1;
-    }
-
-  if (!dataObj) // || dataObj->GetNumberOfElements(vtkDataObject::POINT) == 0)
-    {
-    cerr << "Error reading file: '" << filename.c_str() << "'" << endl;
-    vtkAlgorithm::SetDefaultExecutivePrototype(NULL);
-    return 1;
-    }
-
-  int status = vtkSurfaceLICTestDriver(
-        argc,
-        argv,
-        dataObj,
-        num_steps,
-        step_size,
-        enhanced_lic,
-        normalize_vectors,
-        camera_config,
-        generate_noise_texture,
-        noise_type,
-        noise_texture_size,
-        noise_grain_size,
-        min_noise_value,
-        max_noise_value,
-        number_of_noise_levels,
-        impulse_noise_prob,
-        impulse_noise_bg_value,
-        noise_gen_seed,
-        enhance_contrast,
-        low_lic_contrast_enhancement_factor,
-        high_lic_contrast_enhancement_factor,
-        low_color_contrast_enhancement_factor,
-        high_color_contrast_enhancement_factor,
-        anti_alias,
-        color_mode,
-        lic_intensity,
-        map_mode_bias,
-        color_by_mag,
-        mask_on_surface,
-        mask_threshold,
-        mask_intensity,
-        mask_color_rgb,
-        vectors);
-
-  vtkAlgorithm::SetDefaultExecutivePrototype(NULL);
-
-  return status;
-}
diff --git a/Rendering/LICOpenGL2/Testing/Cxx/TestSurfaceLIC.h b/Rendering/LICOpenGL2/Testing/Cxx/TestSurfaceLIC.h
deleted file mode 100644
index e16c6c2..0000000
--- a/Rendering/LICOpenGL2/Testing/Cxx/TestSurfaceLIC.h
+++ /dev/null
@@ -1,20 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    TestSurfaceLIC.h
-
-  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.
-
-=========================================================================*/
-#ifndef __TestSurfaceLIC_h
-#define __TestSurfaceLIC_h
-
-int TestSurfaceLIC(int argc, char* argv[]);
-
-#endif
diff --git a/Rendering/LICOpenGL2/Testing/Cxx/vtkStructuredGridLIC2DTestDriver.cxx b/Rendering/LICOpenGL2/Testing/Cxx/vtkStructuredGridLIC2DTestDriver.cxx
deleted file mode 100644
index fb632cf..0000000
--- a/Rendering/LICOpenGL2/Testing/Cxx/vtkStructuredGridLIC2DTestDriver.cxx
+++ /dev/null
@@ -1,335 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    TestStructuredGridLIC2DSlice.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 "vtkStructuredGridLIC2D.h"
-#include "vtkPNGReader.h"
-#include "vtkXMLStructuredGridReader.h"
-#include "vtkExtractGrid.h"
-#include "vtkRenderWindowInteractor.h"
-#include "vtkRenderWindow.h"
-#include "vtkRenderer.h"
-#include "vtkActor.h"
-#include "vtkTexture.h"
-#include "vtkDataSetMapper.h"
-#include "vtkTestUtilities.h"
-#include "vtkRegressionTestImage.h"
-#include "vtkPNGWriter.h"
-#include "vtkImageShiftScale.h"
-#include "vtkImageData.h"
-#include "vtkPointData.h"
-#include "vtkProperty.h"
-#include "vtkPolyDataMapper.h"
-#include "vtkDataSetSurfaceFilter.h"
-#include "vtkImageExtractComponents.h"
-#include "vtkTestUtilities.h"
-#include "vtkCamera.h"
-#include "vtkSmartPointer.h"
-#include "vtkStreamingDemandDrivenPipeline.h"
-#include "vtkTimerLog.h"
-#include <vtksys/CommandLineArguments.hxx>
-#include <string>
-
-// --------------------------------------------------------------------------
-static inline
-int CLAMP(int a, int low, int high)
-{
-  a = (a < low)? low : a;
-  a = (a > high)? high : a;
-  return a;
-}
-
-// --------------------------------------------------------------------------
-int vtkStructuredGridLIC2DTestDriver(int argc, char* argv[])
-{
-  std::string filename;
-  std::string noise_filename;
-  int resolution = 10;
-  int magnification = 1;
-  std::string outputpath;
-  int num_partitions = 1;
-  int num_steps = 40;
-  int slice_dir = 2; // 0 == X, 1 == Y, 2 == Z
-  int slice = 0;
-  int test_mode = 0;
-  double zoom_factor = 2.8;
-
-  vtksys::CommandLineArguments arg;
-  arg.StoreUnusedArguments(1);
-  arg.Initialize(argc, argv);
-
-  typedef vtksys::CommandLineArguments argT;
-  arg.AddArgument("--data", argT::EQUAL_ARGUMENT, &filename,
-    "(required) Enter dataset to load (currently only *.vts files are supported");
-  arg.AddArgument("--res", argT::EQUAL_ARGUMENT, &resolution,
-    "(optional: default 10) Number of sample per unit distance");
-  arg.AddArgument("--mag", argT::EQUAL_ARGUMENT, &magnification,
-    "(optional: default 1) Magnification");
-  arg.AddArgument("--output", argT::EQUAL_ARGUMENT, &outputpath,
-    "(optional) Output png image");
-  arg.AddArgument("--partitions", argT::EQUAL_ARGUMENT, &num_partitions,
-    "(optional: default 1) Number of partitions");
-  arg.AddArgument("--num-steps", argT::EQUAL_ARGUMENT, &num_steps,
-    "(optional: default 40) Number of steps in each direction");
-  arg.AddArgument("--noise", argT::EQUAL_ARGUMENT, &noise_filename,
-    "(optional) Specify the filename to a png image file to use as the noise texture");
-  arg.AddArgument("--slice", argT::EQUAL_ARGUMENT, &slice,
-    "(optional: default 0) The slice number in the direction specified by slice-dir. "
-    "This is ignored for 2D data.");
-  arg.AddArgument("--slice-dir", argT::EQUAL_ARGUMENT, &slice_dir,
-    "(optional: default 2 (Z slices)) The slice direction: 0 for X slices, 1 for Y slices and 2 for Z slices. "
-    "This is ignored for 2D data.");
-  arg.AddArgument("--test-mode", argT::EQUAL_ARGUMENT, &test_mode,
-    "(optional: default 0) run as ctest or demo");
-  arg.AddArgument("--zoom-factor", argT::EQUAL_ARGUMENT, &zoom_factor,
-    "(optional: default 2.8) set camera zoom");
-
-  if (!arg.Parse() || filename=="")
-    {
-    cerr << "Problem parsing arguments." << endl;
-    cerr << arg.GetHelp() << endl;
-    return 1;
-    }
-
-  if (magnification < 1)
-    {
-    cout << "WARNING: Magnification \'" << magnification  << "\' is invalid."
-      " Forcing a magnification of 1.";
-    magnification = 1;
-    }
-
-  if (num_steps < 1)
-    {
-    cout << "WARNING: Number of steps cannot be less than 1. Forcing 10.";
-    num_steps = 10;
-    }
-
-  if (slice_dir < 0 || slice_dir > 2)
-    {
-    cout << "WARNING: Invalid slice-dir (" <<slice_dir<<"). Forcing Z slices";
-    slice_dir = 2;
-    }
-
-  vtkSmartPointer<vtkXMLStructuredGridReader> reader
-    = vtkSmartPointer<vtkXMLStructuredGridReader>::New();
-
-  reader->SetFileName(filename.c_str());
-  reader->Update();
-
-  int dataDesc = VTK_XY_PLANE;
-  switch(slice_dir)
-    {
-  case 0:
-    dataDesc = VTK_YZ_PLANE;
-    break;
-  case 1:
-    dataDesc = VTK_XZ_PLANE;
-    break;
-  case 2:
-  default:
-    dataDesc = VTK_XY_PLANE;
-    }
-
-  int extent[6];
-  int voi[6];
-  reader->GetOutput()->GetExtent(extent);
-  memcpy(voi, extent, 6*sizeof(int));
-
-  // If data is 2D, then override the slice-dir
-  if (extent[0] == extent[1])
-    {
-    dataDesc = VTK_YZ_PLANE;
-    slice = 0;
-    }
-  else if (extent[2] == extent[3])
-    {
-    dataDesc = VTK_XZ_PLANE;
-    slice = 0;
-    }
-  else if (extent[4] == extent[5])
-    {
-    dataDesc = VTK_XY_PLANE;
-    slice = 0;
-    }
-  else
-    {
-    switch (dataDesc)
-      {
-    case VTK_XY_PLANE:
-      voi[4] = voi[5] = CLAMP(extent[4]+slice, extent[4], extent[5]);
-      break;
-
-    case VTK_YZ_PLANE:
-      voi[0] = voi[1] = CLAMP(extent[0]+slice, extent[0], extent[1]);
-      break;
-
-    case VTK_XZ_PLANE:
-      voi[2] = voi[3] = CLAMP(extent[2]+slice, extent[2], extent[3]);
-      break;
-      }
-    }
-
-  vtkSmartPointer<vtkExtractGrid> extractVOI
-    = vtkSmartPointer<vtkExtractGrid>::New();
-
-  extractVOI->SetInputConnection(reader->GetOutputPort());
-  extractVOI->SetVOI(voi);
-
-  vtkSmartPointer<vtkRenderWindow> renWin
-    = vtkSmartPointer<vtkRenderWindow>::New();
-
-  vtkSmartPointer<vtkRenderer> renderer
-    = vtkSmartPointer<vtkRenderer>::New();
-
-  vtkSmartPointer<vtkRenderWindowInteractor> iren
-    = vtkSmartPointer<vtkRenderWindowInteractor>::New();
-
-  renWin->AddRenderer(renderer);
-  iren->SetRenderWindow(renWin);
-
-  renWin->Render();
-
-  vtkSmartPointer<vtkStructuredGridLIC2D> filter
-    = vtkSmartPointer<vtkStructuredGridLIC2D>::New();
-
-  if (  filter->SetContext( renWin ) == 0  )
-    {
-    cout << "Required OpenGL extensions / GPU not supported." << endl;
-    return 0;
-    }
-
-  filter->SetInputConnection(extractVOI->GetOutputPort());
-
-  if (noise_filename != "")
-    {
-    vtkSmartPointer<vtkPNGReader> pngReader
-      = vtkSmartPointer<vtkPNGReader>::New();
-
-    pngReader->SetFileName(noise_filename.c_str());
-    filter->SetInputConnection(1, pngReader->GetOutputPort(0));
-    }
-
-  filter->SetSteps(num_steps);
-  filter->SetStepSize(0.01/magnification);
-  filter->SetMagnification(magnification);
-
-  for (int kk=0; kk < num_partitions; kk++)
-    {
-    filter->SetUpdateExtent(0, kk, num_partitions, 0);
-
-    cout << "*****************" << endl;
-    filter->Update();
-    if (  filter->GetFBOSuccess() == 0 ||
-          filter->GetLICSuccess() == 0  )
-      {
-      return 0;
-      }
-
-    vtkSmartPointer<vtkImageData> clone
-      = vtkSmartPointer<vtkImageData>::New();
-
-    clone->ShallowCopy(filter->GetOutputDataObject(1));
-
-    double range[2];
-    clone->GetPointData()->GetScalars()->GetRange(range);
-
-    vtkSmartPointer<vtkImageShiftScale> caster
-      = vtkSmartPointer<vtkImageShiftScale>::New();
-
-    caster->SetInputData(clone);
-    caster->SetOutputScalarTypeToUnsignedChar();
-    caster->SetShift(-range[0]);
-    caster->SetScale(255.0/(range[1]-range[0]));
-    caster->Update();
-
-    //vtkPNGWriter* writer = vtkPNGWriter::New();
-    //writer->SetFileName("/tmp/lic.png");
-    //writer->SetInputConnection(caster->GetOutputPort());
-    //writer->Write();
-    //writer->Delete();
-
-    vtkSmartPointer<vtkTexture> texture
-      = vtkSmartPointer<vtkTexture>::New();
-
-    texture->SetInputConnection(caster->GetOutputPort());
-
-    vtkSmartPointer<vtkStructuredGrid> clone2
-      = vtkSmartPointer<vtkStructuredGrid>::New();
-
-    clone2->ShallowCopy(filter->GetOutput(0));
-
-    vtkSmartPointer<vtkDataSetSurfaceFilter> surfaceFilter
-      = vtkSmartPointer<vtkDataSetSurfaceFilter>::New();
-
-    surfaceFilter->SetInputData(clone2);
-
-    vtkSmartPointer<vtkPolyDataMapper> mapper
-      = vtkSmartPointer<vtkPolyDataMapper>::New();
-
-    mapper->SetInputConnection(surfaceFilter->GetOutputPort());
-    mapper->SetScalarVisibility(0);
-
-
-    vtkSmartPointer<vtkActor> actor
-      = vtkSmartPointer<vtkActor>::New();
-
-    actor->SetMapper(mapper);
-    actor->SetTexture(texture);
-
-    renderer->AddActor(actor);
-    }
-
-  vtkSmartPointer<vtkTesting> tester
-    = vtkSmartPointer<vtkTesting>::New();
-
-  for (int cc=0; cc < argc; cc++)
-    {
-    tester->AddArgument(argv[cc]);
-    }
-  tester->SetRenderWindow(renWin);
-
-  renderer->SetBackground(0.2,0.1,0.2);
-  renderer->ResetCamera();
-  renderer->GetActiveCamera()->Zoom( zoom_factor );
-
-  if ( test_mode )
-    {
-    switch (dataDesc)
-      {
-      case VTK_YZ_PLANE:
-        renderer->GetActiveCamera()->Azimuth(90);
-        break;
-      case VTK_XZ_PLANE:
-        renderer->GetActiveCamera()->Elevation(90);
-        break;
-      }
-    }
-
- renWin->Render();
- int reply = (!tester->IsValidImageSpecified() ||
-   (tester->RegressionTest(10) == vtkTesting::PASSED))? /*success*/ 0 : /*failure*/ 1;
-
- if ( tester->IsInteractiveModeSpecified() || !test_mode )
-   {
-   iren->Start();
-   }
-
- return reply;
-}
-
-// --------------------------------------------------------------------------
-int StructuredGridLIC2DDemo(int argc, char* argv[])
-{
-  return vtkStructuredGridLIC2DTestDriver(argc, argv);
-}
diff --git a/Rendering/LICOpenGL2/Testing/Cxx/vtkStructuredGridLIC2DTestDriver.h b/Rendering/LICOpenGL2/Testing/Cxx/vtkStructuredGridLIC2DTestDriver.h
deleted file mode 100644
index 51a9ed1..0000000
--- a/Rendering/LICOpenGL2/Testing/Cxx/vtkStructuredGridLIC2DTestDriver.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    TestStructuredGridLIC2DSlice.h
-
-  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.
-
-=========================================================================*/
-#ifndef  vtkStructuredGridLIC2DTestDriver_h
-#define  vtkStructuredGridLIC2DTestDriver_h
-
-// Description:
-// For demo.
-int StructuredGridLIC2DDemo(int argc, char* argv[]);
-
-// Description:
-// For ctests
-int vtkStructuredGridLIC2DTestDriver(int argc, char* argv[]);
-
-#endif
diff --git a/Rendering/LICOpenGL2/Testing/Cxx/vtkSurfaceLICTestDriver.cxx b/Rendering/LICOpenGL2/Testing/Cxx/vtkSurfaceLICTestDriver.cxx
deleted file mode 100644
index 6593083..0000000
--- a/Rendering/LICOpenGL2/Testing/Cxx/vtkSurfaceLICTestDriver.cxx
+++ /dev/null
@@ -1,397 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    TestSurfaceLIC.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 "vtkObjectFactory.h"
-#include "vtkSmartPointer.h"
-#include "vtkPointData.h"
-#include "vtkCellData.h"
-#include "vtkPolyData.h"
-#include "vtkDataObject.h"
-#include "vtkDataSet.h"
-#include "vtkCompositeDataSet.h"
-#include "vtkCompositeDataIterator.h"
-#include "vtkTestUtilities.h"
-#include "vtkCamera.h"
-#include "vtkColorTransferFunction.h"
-#include "vtkRegressionTestImage.h"
-#include "vtkRenderer.h"
-#include "vtkRenderWindow.h"
-#include "vtkRenderWindowInteractor.h"
-#include "vtkCompositeDataPipeline.h"
-#include "vtkCompositePolyDataMapper2.h"
-
-#include "vtkCompositeSurfaceLICMapper.h"
-
-#include "vtk_glew.h"
-
-#include <vector>
-#include <string>
-
-#ifndef vtkFloatingPointTemplateMacro
-#define vtkFloatingPointTemplateMacro(call) \
-  vtkTemplateMacroCase(VTK_DOUBLE, double, call); \
-  vtkTemplateMacroCase(VTK_FLOAT, float, call);
-#endif
-
-// Helper to compute range
-static
-void Range(vtkDataArray *S, double *range)
-{
-  double Srange[2];
-  S->GetRange(Srange);
-  range[0] = Srange[0] < range[0] ? Srange[0] : range[0];
-  range[1] = Srange[1] > range[1] ? Srange[1] : range[1];
-}
-
-// helper to compute magnitude
-static
-vtkDataArray *Magnitude(vtkDataArray *V)
-{
-  vtkIdType nTups = V->GetNumberOfTuples();
-  vtkIdType nComps = V->GetNumberOfComponents();
-  vtkDataArray *magV = V->NewInstance();
-  magV->SetNumberOfTuples(nTups);
-  switch (V->GetDataType())
-    {
-    vtkFloatingPointTemplateMacro(
-      VTK_TT *pV = (VTK_TT*)V->GetVoidPointer(0);
-      VTK_TT *pMagV = (VTK_TT*)magV->GetVoidPointer(0);
-      for (vtkIdType i=0; i<nTups; ++i)
-        {
-        VTK_TT mag = VTK_TT(0);
-        for (vtkIdType j=0; j<nComps; ++j)
-          {
-          VTK_TT v = pV[i*nComps+j];
-          mag += v*v;
-          }
-        pMagV[i] = sqrt(mag);
-        }
-      );
-  default:
-    cerr << "ERROR: vectors must be float or double" << endl;
-    break;
-    }
-  return magV;
-}
-
-// Compute the magnitude of the named vector and add it to
-// dataset, return range.
-static
-vtkDataArray *Magnitude(vtkDataSet *ds, std::string &vectors)
-{
-  vtkDataArray *V = NULL;
-  V = ds->GetPointData()->GetArray(vectors.c_str());
-  if (V == NULL)
-    {
-    cerr << "ERROR: point vectors " << vectors << " not found" << endl;
-    return NULL;
-    }
-  vtkDataArray *magV = Magnitude(V);
-  std::string magVName = "mag"+vectors;
-  magV->SetName(magVName.c_str());
-  return magV;
-}
-
-// This example demonstrates the use of vtkSurfaceLICmapper for rendering
-// geometry with LIC on the surface.
-int vtkSurfaceLICTestDriver(
-      int argc,
-      char **argv,
-      vtkDataObject *dataObj,
-      int num_steps,
-      double step_size,
-      int enhanced_lic,
-      int normalize_vectors,
-      int camera_config,
-      int generate_noise_texture,
-      int noise_type,
-      int noise_texture_size,
-      int noise_grain_size,
-      double min_noise_value,
-      double max_noise_value,
-      int number_of_noise_levels,
-      double impulse_noise_prob,
-      double impulse_noise_bg_value,
-      int noise_gen_seed,
-      int enhance_contrast,
-      double low_lic_contrast_enhancement_factor,
-      double high_lic_contrast_enhancement_factor,
-      double low_color_contrast_enhancement_factor,
-      double high_color_contrast_enhancement_factor,
-      int anti_alias,
-      int color_mode,
-      double lic_intensity,
-      double map_mode_bias,
-      int color_by_mag,
-      int mask_on_surface,
-      double mask_threshold,
-      double mask_intensity,
-      std::vector<double> &mask_color_rgb,
-      std::string &vectors)
-{
-  // Set up the render window, renderer, interactor.
-  vtkSmartPointer<vtkRenderWindow> renWin
-    = vtkSmartPointer<vtkRenderWindow>::New();
-
-  vtkSmartPointer<vtkRenderer> renderer
-    = vtkSmartPointer<vtkRenderer>::New();
-
-  vtkSmartPointer<vtkRenderWindowInteractor> iren
-    = vtkSmartPointer<vtkRenderWindowInteractor>::New();
-
-  renWin->AddRenderer(renderer);
-  iren->SetRenderWindow(renWin);
-
-  if (camera_config == 1)
-    {
-    renWin->SetSize(300, 300);
-    }
-  else
-  if (camera_config == 2)
-    {
-    renWin->SetSize(300, 270);
-    }
-  else
-  if (camera_config == 3)
-    {
-    renWin->SetSize(400, 340);
-    }
-  else
-  if (camera_config == 4)
-    {
-    renWin->SetSize(364, 256);
-    }
-  renWin->Render();
-
-  if (!vtkSurfaceLICMapper::IsSupported(renWin))
-    {
-    cerr
-      << "WARNING: The rendering context does not support required extensions."
-      << endl;
-    dataObj = NULL;
-    renWin = NULL;
-    renderer = NULL;
-    iren = NULL;
-    vtkAlgorithm::SetDefaultExecutivePrototype(NULL);
-    return 0;
-    }
-
-  // Create a mapper and insert the vtkSurfaceLICmapper mapper into the
-  // mapper chain. This is essential since the entire logic of performin the
-  // LIC is present in the vtkSurfaceLICmapper.
-
-  vtkSmartPointer<vtkCompositeSurfaceLICMapper> mapper
-    = vtkSmartPointer<vtkCompositeSurfaceLICMapper>::New();
-
-  // print details of the test
-  // convenient for debugging failed
-  // tests on remote dashboards.
-  const char *vtkGLVersion = reinterpret_cast<const char*>(glGetString(GL_VERSION));
-  const char *vtkGLVendor = reinterpret_cast<const char*>(glGetString(GL_VENDOR));
-  const char *vtkGLRenderer = reinterpret_cast<const char*>(glGetString(GL_RENDERER));
-  const char *vtkLICClass = mapper->GetClassName();
-  std::string details
-    = std::string("\n\n====================================================================\n")
-    + std::string("VTK mapper:\n")
-    + std::string("    ") + std::string(vtkLICClass) + std::string("\n")
-    + std::string("OpenGL:\n")
-    + std::string("    ") + std::string(vtkGLVersion?vtkGLVersion:"unknown") + std::string("\n")
-    + std::string("    ") + std::string(vtkGLRenderer?vtkGLRenderer:"unknown") + std::string("\n")
-    + std::string("    ") + std::string(vtkGLVendor?vtkGLVendor:"unknown") + std::string("\n")
-    + std::string("====================================================================\n\n\n");
-  cerr << details << endl;
-
-  // If user chose a vector field, select it.
-  if (vectors != "")
-    {
-    mapper->SetInputArrayToProcess(0, 0, 0,
-      vtkDataObject::FIELD_ASSOCIATION_POINTS_THEN_CELLS,
-      vectors.c_str());
-    }
-  else
-    {
-    cerr << "ERROR: vectors must be set using --vectors." << endl;
-    return 1;
-    }
-
-  // Set the mapper input
-  mapper->SetInputDataObject(dataObj);
-
-  if (color_by_mag)
-    {
-    if ( vectors.empty() )
-      {
-      cerr << "ERROR: color by mag requires using --vectors." << endl;
-      vtkAlgorithm::SetDefaultExecutivePrototype(NULL);
-      return 1;
-      }
-
-    const char *magVName = NULL;
-    double range[2] = {VTK_FLOAT_MAX, -VTK_FLOAT_MAX};
-    vtkCompositeDataSet *cd = dynamic_cast<vtkCompositeDataSet*>(dataObj);
-    if (cd)
-      {
-      vtkCompositeDataIterator* iter = cd->NewIterator();
-      for (iter->InitTraversal(); !iter->IsDoneWithTraversal(); iter->GoToNextItem())
-        {
-        vtkDataSet* ds = dynamic_cast<vtkDataSet*>(iter->GetCurrentDataObject());
-        if (ds && ds->GetNumberOfCells())
-          {
-          vtkDataArray *magV = Magnitude(ds, vectors);
-          magVName = magV->GetName();
-          Range(magV, range);
-          ds->GetPointData()->SetScalars(magV);
-          magV->Delete();
-          }
-        }
-      iter->Delete();
-      }
-    vtkDataSet* ds = dynamic_cast<vtkDataSet*>(dataObj);
-    if (ds && ds->GetNumberOfCells())
-      {
-      vtkDataArray *magV = Magnitude(ds, vectors);
-      magVName = magV->GetName();
-      Range(magV, range);
-      ds->GetPointData()->SetScalars(magV);
-      magV->Delete();
-      }
-    if (!magVName)
-      {
-      cerr << "ERROR: color by mag could not generate magV." << endl;
-      vtkAlgorithm::SetDefaultExecutivePrototype(NULL);
-      return 1;
-      }
-    vtkColorTransferFunction *lut = vtkColorTransferFunction::New();
-    lut->SetColorSpaceToRGB();
-    lut->AddRGBPoint(range[0], 0.0, 0.0, 1.0);
-    lut->AddRGBPoint(range[1], 1.0, 0.0, 0.0);
-    lut->SetColorSpaceToDiverging();
-    lut->Build();
-    mapper->SetLookupTable(lut);
-    mapper->SetScalarModeToUsePointData();
-    mapper->SetScalarVisibility(1);
-    mapper->SelectColorArray(magVName);
-    mapper->SetUseLookupTableScalarRange(1);
-    mapper->SetScalarMode(VTK_SCALAR_MODE_USE_POINT_FIELD_DATA);
-    lut->Delete();
-    }
-
-  // Pass parameters.
-  mapper->SetNumberOfSteps(num_steps);
-  mapper->SetStepSize(step_size);
-  mapper->SetEnhancedLIC(enhanced_lic);
-  mapper->SetGenerateNoiseTexture(generate_noise_texture);
-  mapper->SetNoiseType(noise_type);
-  mapper->SetNormalizeVectors(normalize_vectors);
-  mapper->SetNoiseTextureSize(noise_texture_size);
-  mapper->SetNoiseGrainSize(noise_grain_size);
-  mapper->SetMinNoiseValue(min_noise_value);
-  mapper->SetMaxNoiseValue(max_noise_value);
-  mapper->SetNumberOfNoiseLevels(number_of_noise_levels);
-  mapper->SetImpulseNoiseProbability(impulse_noise_prob);
-  mapper->SetImpulseNoiseBackgroundValue(impulse_noise_bg_value);
-  mapper->SetNoiseGeneratorSeed(noise_gen_seed);
-  mapper->SetEnhanceContrast(enhance_contrast);
-  mapper->SetLowLICContrastEnhancementFactor(low_lic_contrast_enhancement_factor);
-  mapper->SetHighLICContrastEnhancementFactor(high_lic_contrast_enhancement_factor);
-  mapper->SetLowColorContrastEnhancementFactor(low_color_contrast_enhancement_factor);
-  mapper->SetHighColorContrastEnhancementFactor(high_color_contrast_enhancement_factor);
-  mapper->SetAntiAlias(anti_alias);
-  mapper->SetColorMode(color_mode);
-  mapper->SetLICIntensity(lic_intensity);
-  mapper->SetMapModeBias(map_mode_bias);
-  mapper->SetMaskOnSurface(mask_on_surface);
-  mapper->SetMaskThreshold(mask_threshold);
-  mapper->SetMaskIntensity(mask_intensity);
-  mapper->SetMaskColor(&mask_color_rgb[0]);
-
-  vtkSmartPointer<vtkActor> actor
-    = vtkSmartPointer<vtkActor>::New();
-
-  actor->SetMapper(mapper);
-  renderer->AddActor(actor);
-  renderer->SetBackground(0.3, 0.3, 0.3);
-  mapper = NULL;
-  actor = NULL;
-
-  vtkCamera *camera = renderer->GetActiveCamera();
-
-  if (camera_config == 1)
-    {
-    renWin->SetSize(300, 300);
-    renderer->SetBackground(0.3216, 0.3412, 0.4314);
-    renderer->SetBackground2(0.0, 0.0, 0.1647);
-    renderer->GradientBackgroundOn();
-    camera->SetFocalPoint(-1.88, -0.98, -1.04);
-    camera->SetPosition(13.64, 4.27, -31.59);
-    camera->SetViewAngle(30);
-    camera->SetViewUp(0.41, 0.83, 0.35);
-    renderer->ResetCamera();
-    }
-  else
-  if (camera_config == 2)
-    {
-    renWin->SetSize(300, 270);
-    camera->SetFocalPoint(0.0, 0.0, 0.0);
-    camera->SetPosition(1.0, 0.0, 0.0);
-    camera->SetViewAngle(30);
-    camera->SetViewUp(0.0, 0.0, 1.0);
-    renderer->ResetCamera();
-    camera->Zoom(1.2);
-    }
-  else
-  if (camera_config == 3)
-    {
-    renWin->SetSize(400, 340);
-    camera->SetFocalPoint(0.0, 0.0, 0.0);
-    camera->SetPosition(1.0, 0.0, 0.0);
-    camera->SetViewAngle(30);
-    camera->SetViewUp(0.0, 0.0, 1.0);
-    renderer->ResetCamera();
-    camera->Zoom(1.4);
-    }
-  else
-  if (camera_config == 4)
-    {
-    renWin->SetSize(364, 256);
-    renderer->SetBackground(0.3216, 0.3412, 0.4314);
-    renderer->SetBackground2(0.0, 0.0, 0.1647);
-    renderer->GradientBackgroundOn();
-    camera->SetFocalPoint(-30.3, 15.2, 7.0);
-    camera->SetPosition(64.7, 3.2, -14.0);
-    camera->SetViewAngle(30);
-    camera->SetViewUp(0.25, 0.5, 0.8);
-    //renderer->ResetCamera();
-    camera->Zoom(1.09);
-    }
-
-  int retVal = vtkTesting::Test(argc, argv, renWin, 75);
-  if (retVal == vtkRegressionTester::DO_INTERACTOR)
-    {
-    renWin->Render();
-    iren->Start();
-    }
-
-  renderer = NULL;
-  renWin = NULL;
-  iren = NULL;
-
-  if ((retVal == vtkTesting::PASSED) || (retVal == vtkTesting::DO_INTERACTOR))
-    {
-    return 0;
-    }
-  // test failed.
-  return 1;
-}
diff --git a/Rendering/LICOpenGL2/Testing/Cxx/vtkSurfaceLICTestDriver.h b/Rendering/LICOpenGL2/Testing/Cxx/vtkSurfaceLICTestDriver.h
deleted file mode 100644
index 9cf88f8..0000000
--- a/Rendering/LICOpenGL2/Testing/Cxx/vtkSurfaceLICTestDriver.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    TestSurfaceLIC.h
-
-  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.
-
-=========================================================================*/
-#ifndef vtkTestSurfaceLICDriver_h
-#define vtkTestSurfaceLICDriver_h
-
-#include "vtkSystemIncludes.h" // include it first
-#include <vector> // for vector
-#include <string> // for string
-class vtkDataObject;
-
-// Description:
-// Internal test driver. Used by serial and parallel
-// ctests.
-int vtkSurfaceLICTestDriver(
-      int argc,
-      char **argv,
-      vtkDataObject *dataObj,
-      int num_steps,
-      double step_size,
-      int enhanced_lic,
-      int normalize_vectors,
-      int camera_config,
-      int generate_noise_texture,
-      int noise_type,
-      int noise_texture_size,
-      int noise_grain_size,
-      double min_noise_value,
-      double max_noise_value,
-      int number_of_noise_levels,
-      double impulse_noise_prob,
-      double impulse_noise_bg_value,
-      int noise_gen_seed,
-      int enhance_contrast,
-      double low_lic_contrast_enhancement_factor,
-      double high_lic_contrast_enhancement_factor,
-      double low_color_contrast_enhancement_factor,
-      double high_color_contrast_enhancement_factor,
-      int anti_alias,
-      int color_mode,
-      double lic_intensity,
-      double map_mode_bias,
-      int color_by_mag,
-      int mask_on_surface,
-      double mask_threshold,
-      double mask_intensity,
-      std::vector<double> &mask_color_rgb,
-      std::string &vectors);
-
-#endif
diff --git a/Rendering/LICOpenGL2/Testing/Data/Baseline/TestImageDataLIC2D.png.md5 b/Rendering/LICOpenGL2/Testing/Data/Baseline/TestImageDataLIC2D.png.md5
deleted file mode 100644
index 3db4708..0000000
--- a/Rendering/LICOpenGL2/Testing/Data/Baseline/TestImageDataLIC2D.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-b5d78214f60aec7a0e059ed01a4e5a5c
diff --git a/Rendering/LICOpenGL2/Testing/Data/Baseline/TestImageDataLIC2D_1.png.md5 b/Rendering/LICOpenGL2/Testing/Data/Baseline/TestImageDataLIC2D_1.png.md5
deleted file mode 100644
index 435c78e..0000000
--- a/Rendering/LICOpenGL2/Testing/Data/Baseline/TestImageDataLIC2D_1.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-bee54a2489a7eed433e09f29c4261f9c
diff --git a/Rendering/LICOpenGL2/Testing/Data/Baseline/TestStructuredGridLIC2DXSlice.png.md5 b/Rendering/LICOpenGL2/Testing/Data/Baseline/TestStructuredGridLIC2DXSlice.png.md5
deleted file mode 100644
index ac24bb7..0000000
--- a/Rendering/LICOpenGL2/Testing/Data/Baseline/TestStructuredGridLIC2DXSlice.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-5ceb976e5743f95132389ca08a30e515
diff --git a/Rendering/LICOpenGL2/Testing/Data/Baseline/TestStructuredGridLIC2DXSlice_1.png.md5 b/Rendering/LICOpenGL2/Testing/Data/Baseline/TestStructuredGridLIC2DXSlice_1.png.md5
deleted file mode 100644
index d0be177..0000000
--- a/Rendering/LICOpenGL2/Testing/Data/Baseline/TestStructuredGridLIC2DXSlice_1.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-96be4970872f8595d7015602eb326bf0
diff --git a/Rendering/LICOpenGL2/Testing/Data/Baseline/TestStructuredGridLIC2DYSlice.png.md5 b/Rendering/LICOpenGL2/Testing/Data/Baseline/TestStructuredGridLIC2DYSlice.png.md5
deleted file mode 100644
index bc3a315..0000000
--- a/Rendering/LICOpenGL2/Testing/Data/Baseline/TestStructuredGridLIC2DYSlice.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-6ee6222ebd80b1db7a7bcc3bb3ef7bdd
diff --git a/Rendering/LICOpenGL2/Testing/Data/Baseline/TestStructuredGridLIC2DYSlice_1.png.md5 b/Rendering/LICOpenGL2/Testing/Data/Baseline/TestStructuredGridLIC2DYSlice_1.png.md5
deleted file mode 100644
index cbec01a..0000000
--- a/Rendering/LICOpenGL2/Testing/Data/Baseline/TestStructuredGridLIC2DYSlice_1.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-9057700a8a346aebd86fcd195a16a9a1
diff --git a/Rendering/LICOpenGL2/Testing/Data/Baseline/TestStructuredGridLIC2DZSlice.png.md5 b/Rendering/LICOpenGL2/Testing/Data/Baseline/TestStructuredGridLIC2DZSlice.png.md5
deleted file mode 100644
index 34a2bea..0000000
--- a/Rendering/LICOpenGL2/Testing/Data/Baseline/TestStructuredGridLIC2DZSlice.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-90414545b69a53daf2637b1b96e1d00d
diff --git a/Rendering/LICOpenGL2/Testing/Data/Baseline/TestStructuredGridLIC2DZSlice_1.png.md5 b/Rendering/LICOpenGL2/Testing/Data/Baseline/TestStructuredGridLIC2DZSlice_1.png.md5
deleted file mode 100644
index 8a755e5..0000000
--- a/Rendering/LICOpenGL2/Testing/Data/Baseline/TestStructuredGridLIC2DZSlice_1.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-8680abc81a0c377cb1120aa42e922904
diff --git a/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLIC.png.md5 b/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLIC.png.md5
deleted file mode 100644
index a0ef54e..0000000
--- a/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLIC.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-b695e5e37173ba0be139358cce86cc8c
diff --git a/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLICCurvedContrastEnhancedBlended.png.md5 b/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLICCurvedContrastEnhancedBlended.png.md5
deleted file mode 100644
index b914d12..0000000
--- a/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLICCurvedContrastEnhancedBlended.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-310ec71930a4f24c5549fa8e5358e60c
diff --git a/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLICCurvedContrastEnhancedBlendedSmallGrain.png.md5 b/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLICCurvedContrastEnhancedBlendedSmallGrain.png.md5
deleted file mode 100644
index 4aa371b..0000000
--- a/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLICCurvedContrastEnhancedBlendedSmallGrain.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-14553c1976a6c7e9a66e87a6a464bc4a
diff --git a/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLICCurvedContrastEnhancedColorBlendedSmallGrain.png.md5 b/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLICCurvedContrastEnhancedColorBlendedSmallGrain.png.md5
deleted file mode 100644
index d02ba67..0000000
--- a/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLICCurvedContrastEnhancedColorBlendedSmallGrain.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-3b671f3a6c61bf9c71a5d7ae1102c137
diff --git a/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLICCurvedContrastEnhancedColorBlendedSmallGrainMask.png.md5 b/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLICCurvedContrastEnhancedColorBlendedSmallGrainMask.png.md5
deleted file mode 100644
index 602bd9c..0000000
--- a/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLICCurvedContrastEnhancedColorBlendedSmallGrainMask.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-7bc97e0a1a700a70fad3f9850756635e
diff --git a/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLICCurvedContrastEnhancedColorMappedSmallGrain.png.md5 b/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLICCurvedContrastEnhancedColorMappedSmallGrain.png.md5
deleted file mode 100644
index 879563c..0000000
--- a/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLICCurvedContrastEnhancedColorMappedSmallGrain.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-c2cf1ae2a87068a6d26df666e1e919c4
diff --git a/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLICCurvedContrastEnhancedColorMappedSmallGrainMask.png.md5 b/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLICCurvedContrastEnhancedColorMappedSmallGrainMask.png.md5
deleted file mode 100644
index 36cd913..0000000
--- a/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLICCurvedContrastEnhancedColorMappedSmallGrainMask.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-799d172be203b70d9c6c0e0ad6bf110d
diff --git a/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLICCurvedContrastEnhancedMapped.png.md5 b/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLICCurvedContrastEnhancedMapped.png.md5
deleted file mode 100644
index ce37e7e..0000000
--- a/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLICCurvedContrastEnhancedMapped.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-86a47d000665ef0e7275b26f21eef5f9
diff --git a/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLICCurvedContrastEnhancedMappedSmallGrain.png.md5 b/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLICCurvedContrastEnhancedMappedSmallGrain.png.md5
deleted file mode 100644
index 878a1db..0000000
--- a/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLICCurvedContrastEnhancedMappedSmallGrain.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-b17c538e6c671f1e9cc9a9c565ba931b
diff --git a/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLICCurvedContrastEnhancedMappedSmallVectorNormalizeOff.png.md5 b/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLICCurvedContrastEnhancedMappedSmallVectorNormalizeOff.png.md5
deleted file mode 100644
index 754526f..0000000
--- a/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLICCurvedContrastEnhancedMappedSmallVectorNormalizeOff.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-b055348f2ae6b27d2d753b9aa555f49a
diff --git a/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLICCurvedContrastEnhancedSmallGrainMask.png.md5 b/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLICCurvedContrastEnhancedSmallGrainMask.png.md5
deleted file mode 100644
index 62b8903..0000000
--- a/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLICCurvedContrastEnhancedSmallGrainMask.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-3a770efafe36fec811c9b40b0c3eb048
diff --git a/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLICCurvedDefaults.png.md5 b/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLICCurvedDefaults.png.md5
deleted file mode 100644
index 9b2bb7a..0000000
--- a/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLICCurvedDefaults.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-3514b7e59d35f3939085b4f29fcdd7ae
diff --git a/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLICCurvedDefaultsColor.png.md5 b/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLICCurvedDefaultsColor.png.md5
deleted file mode 100644
index f5f7cc5..0000000
--- a/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLICCurvedDefaultsColor.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-29d06a9306e93df947830dc6d10d1ebf
diff --git a/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLICCurvedEnhancedVectorNormalizeOff.png.md5 b/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLICCurvedEnhancedVectorNormalizeOff.png.md5
deleted file mode 100644
index e8e410b..0000000
--- a/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLICCurvedEnhancedVectorNormalizeOff.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-1970b150e894caa03048cb0804e51dae
diff --git a/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLICMultiBlockContrastEnhancedPerlin.png.md5 b/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLICMultiBlockContrastEnhancedPerlin.png.md5
deleted file mode 100644
index 20ec37f..0000000
--- a/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLICMultiBlockContrastEnhancedPerlin.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-c342466c49bda926be580f61563aaec6
diff --git a/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLICPlanarContrastEnhanced.png.md5 b/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLICPlanarContrastEnhanced.png.md5
deleted file mode 100644
index 390431c..0000000
--- a/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLICPlanarContrastEnhanced.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-1a691893f8446d6244173fdfdd8032b8
diff --git a/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLICPlanarDefaults.png.md5 b/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLICPlanarDefaults.png.md5
deleted file mode 100644
index 4ca0bc3..0000000
--- a/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLICPlanarDefaults.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-4f7101a16563c5ce602b13087c3b55b4
diff --git a/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLICPlanarVectorNormalizeOff.png.md5 b/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLICPlanarVectorNormalizeOff.png.md5
deleted file mode 100644
index c5c2db9..0000000
--- a/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLICPlanarVectorNormalizeOff.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-3e3b4201043fb5a0bb35390666d78631
diff --git a/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLICPlanarVectorNormalizeOffMediumGrainPerlin.png.md5 b/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLICPlanarVectorNormalizeOffMediumGrainPerlin.png.md5
deleted file mode 100644
index d4fb4a6..0000000
--- a/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLICPlanarVectorNormalizeOffMediumGrainPerlin.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-af520199da81350d2d967138398cea39
diff --git a/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLICPlanarVectorNormalizeOffMediumGrainUniform.png.md5 b/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLICPlanarVectorNormalizeOffMediumGrainUniform.png.md5
deleted file mode 100644
index 2f36c7b..0000000
--- a/Rendering/LICOpenGL2/Testing/Data/Baseline/TestSurfaceLICPlanarVectorNormalizeOffMediumGrainUniform.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-df79f16867defc8db21c0ecfb545eaf3
diff --git a/Rendering/LICOpenGL2/module.cmake b/Rendering/LICOpenGL2/module.cmake
deleted file mode 100644
index fcf674b..0000000
--- a/Rendering/LICOpenGL2/module.cmake
+++ /dev/null
@@ -1,20 +0,0 @@
-vtk_module(vtkRenderingLICOpenGL2
-  TCL_NAME
-    vtkRenderingLICOpenGLII
-  BACKEND
-    OpenGL2
-  DEPENDS
-    vtkIOXML
-    vtkIOLegacy
-    vtkImagingSources
-    vtkRendering${VTK_RENDERING_BACKEND}
-  PRIVATE_DEPENDS
-    vtkglew
-    vtksys
-  TEST_DEPENDS
-    vtkTestingCore
-    vtkTestingRendering
-    vtkInteractionStyle
-  KIT
-    vtkOpenGL
-  )
diff --git a/Rendering/LICOpenGL2/vtkCompositeSurfaceLICMapper.cxx b/Rendering/LICOpenGL2/vtkCompositeSurfaceLICMapper.cxx
deleted file mode 100644
index 391817d..0000000
--- a/Rendering/LICOpenGL2/vtkCompositeSurfaceLICMapper.cxx
+++ /dev/null
@@ -1,553 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkCompositeSurfaceLICMapper.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 "vtkCompositeSurfaceLICMapper.h"
-#include "vtkSurfaceLICMapper.h"
-
-#include "vtkBoundingBox.h"
-#include "vtkCommand.h"
-#include "vtkCompositeDataIterator.h"
-#include "vtkCompositeDataPipeline.h"
-#include "vtkCompositeDataSet.h"
-#include "vtkCompositeDataDisplayAttributes.h"
-#include "vtkHardwareSelector.h"
-#include "vtkInformation.h"
-#include "vtkMath.h"
-#include "vtkObjectFactory.h"
-#include "vtkPolyData.h"
-#include "vtkProperty.h"
-#include "vtkRenderer.h"
-#include "vtkRenderWindow.h"
-#include "vtkScalarsToColors.h"
-#include "vtkShaderProgram.h"
-#include "vtkUnsignedCharArray.h"
-#include "vtkMultiBlockDataSet.h"
-#include "vtkMultiPieceDataSet.h"
-
-#include <algorithm>
-
-//===================================================================
-// We define a helper class that is a subclass of vtkOpenGLPolyDataMapper
-// We use this to get some performance improvements over the generic
-// mapper case.
-class vtkCompositeLICHelper : public vtkSurfaceLICMapper
-{
-public:
-  static vtkCompositeLICHelper* New();
-  vtkTypeMacro(vtkCompositeLICHelper, vtkSurfaceLICMapper);
-
-  vtkCompositeSurfaceLICMapper *Parent;
-
-protected:
-  vtkCompositeLICHelper() {};
-  ~vtkCompositeLICHelper() {};
-
-  // Description:
-  // Set the shader parameteres related to the property, called by UpdateShader
-  virtual void SetPropertyShaderParameters(vtkOpenGLHelper &cellBO, vtkRenderer *ren, vtkActor *act);
-
-private:
-  vtkCompositeLICHelper(const vtkCompositeLICHelper&); // Not implemented.
-  void operator=(const vtkCompositeLICHelper&); // Not implemented.
-};
-
-vtkStandardNewMacro(vtkCompositeLICHelper);
-
-void vtkCompositeLICHelper::SetPropertyShaderParameters(vtkOpenGLHelper &cellBO,
-                                                       vtkRenderer *ren, vtkActor *actor)
-{
-  this->Superclass::SetPropertyShaderParameters(cellBO, ren, actor);
-
-  vtkProperty *ppty = actor->GetProperty();
-
-  // override the opacity
-  cellBO.Program->SetUniformf("opacityUniform", this->Parent->BlockState.Opacity.top());
-  double aIntensity = this->DrawingEdges ? 1.0 : ppty->GetAmbient();  // ignoring renderer ambient
-  double dIntensity = this->DrawingEdges ? 0.0 : ppty->GetDiffuse();
-
-  vtkColor3d &aColor = this->Parent->BlockState.AmbientColor.top();
-  float ambientColor[3] = {static_cast<float>(aColor[0] * aIntensity),
-    static_cast<float>(aColor[1] * aIntensity),
-    static_cast<float>(aColor[2] * aIntensity)};
-  vtkColor3d &dColor = this->Parent->BlockState.DiffuseColor.top();
-  float diffuseColor[3] = {static_cast<float>(dColor[0] * dIntensity),
-    static_cast<float>(dColor[1] * dIntensity),
-    static_cast<float>(dColor[2] * dIntensity)};
-  cellBO.Program->SetUniform3f("ambientColorUniform", ambientColor);
-  cellBO.Program->SetUniform3f("diffuseColorUniform", diffuseColor);
-}
-
-//===================================================================
-// Now the main class methods
-
-vtkStandardNewMacro(vtkCompositeSurfaceLICMapper);
-//----------------------------------------------------------------------------
-vtkCompositeSurfaceLICMapper::vtkCompositeSurfaceLICMapper()
-{
-}
-
-//----------------------------------------------------------------------------
-vtkCompositeSurfaceLICMapper::~vtkCompositeSurfaceLICMapper()
-{
-  std::map<const vtkDataSet*, vtkCompositeLICHelper *>::iterator miter =
-    this->Helpers.begin();
-  for (;miter != this->Helpers.end(); miter++)
-    {
-    miter->second->Delete();
-    }
-  this->Helpers.clear();
-}
-
-//----------------------------------------------------------------------------
-int vtkCompositeSurfaceLICMapper::FillInputPortInformation(
-  int vtkNotUsed(port), vtkInformation* info)
-{
-  info->Set(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "vtkPolyData");
-  info->Append(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "vtkCompositeDataSet");
-  return 1;
-}
-
-//----------------------------------------------------------------------------
-vtkExecutive* vtkCompositeSurfaceLICMapper::CreateDefaultExecutive()
-{
-  return vtkCompositeDataPipeline::New();
-}
-
-//-----------------------------------------------------------------------------
-//Looks at each DataSet and finds the union of all the bounds
-void vtkCompositeSurfaceLICMapper::ComputeBounds()
-{
-  vtkMath::UninitializeBounds(this->Bounds);
-  vtkCompositeDataSet *input = vtkCompositeDataSet::SafeDownCast(
-    this->GetInputDataObject(0, 0));
-
-  // If we don't have hierarchical data, test to see if we have
-  // plain old polydata. In this case, the bounds are simply
-  // the bounds of the input polydata.
-  if (!input)
-    {
-    this->Superclass::ComputeBounds();
-    return;
-    }
-
-  vtkCompositeDataIterator* iter = input->NewIterator();
-  vtkBoundingBox bbox;
-  for (iter->InitTraversal(); !iter->IsDoneWithTraversal(); iter->GoToNextItem())
-    {
-    vtkPolyData *pd = vtkPolyData::SafeDownCast(iter->GetCurrentDataObject());
-    if (pd)
-      {
-      double bounds[6];
-      pd->GetBounds(bounds);
-      bbox.AddBounds(bounds);
-      }
-    }
-  iter->Delete();
-  bbox.GetBounds(this->Bounds);
-//  this->BoundsMTime.Modified();
-}
-
-//-----------------------------------------------------------------------------
-bool vtkCompositeSurfaceLICMapper::GetIsOpaque()
-{
-  vtkCompositeDataSet *input = vtkCompositeDataSet::SafeDownCast(
-    this->GetInputDataObject(0, 0));
-  unsigned long int lastMTime = std::max(input ? input->GetMTime() : 0, this->GetMTime());
-  if (lastMTime <= this->LastOpaqueCheckTime)
-    {
-    return this->LastOpaqueCheckValue;
-    }
-  this->LastOpaqueCheckTime = lastMTime;
-  if (this->ScalarVisibility && input &&
-      (this->ColorMode == VTK_COLOR_MODE_DEFAULT ||
-       this->ColorMode == VTK_COLOR_MODE_DIRECT_SCALARS))
-    {
-    vtkSmartPointer<vtkCompositeDataIterator> iter;
-    iter.TakeReference(input->NewIterator());
-    for (iter->InitTraversal(); !iter->IsDoneWithTraversal(); iter->GoToNextItem())
-      {
-      vtkPolyData *pd = vtkPolyData::SafeDownCast(iter->GetCurrentDataObject());
-      if (pd)
-        {
-        int cellFlag;
-        vtkDataArray* scalars = this->GetScalars(pd,
-          this->ScalarMode, this->ArrayAccessMode, this->ArrayId,
-          this->ArrayName, cellFlag);
-        if (scalars &&
-            (scalars->IsA("vtkUnsignedCharArray")  ||
-             this->ColorMode == VTK_COLOR_MODE_DIRECT_SCALARS) &&
-            (scalars->GetNumberOfComponents() ==  4 /*(RGBA)*/ ||
-             scalars->GetNumberOfComponents() == 2 /*(LuminanceAlpha)*/))
-          {
-          int opacityIndex = scalars->GetNumberOfComponents() - 1;
-          unsigned char opacity = 0;
-          switch (scalars->GetDataType())
-            {
-            vtkTemplateMacro(
-              vtkScalarsToColors::ColorToUChar(
-                static_cast<VTK_TT>(scalars->GetRange(opacityIndex)[0]),
-                &opacity));
-            }
-          if (opacity < 255)
-            {
-            // If the opacity is 255, despite the fact that the user specified
-            // RGBA, we know that the Alpha is 100% opaque. So treat as opaque.
-            this->LastOpaqueCheckValue = false;
-            return false;
-            }
-          }
-        }
-      }
-    }
-  else if(this->CompositeAttributes &&
-    this->CompositeAttributes->HasBlockOpacities())
-    {
-    this->LastOpaqueCheckValue = false;
-    return false;
-    }
-
-  this->LastOpaqueCheckValue = this->Superclass::GetIsOpaque();
-  return this->LastOpaqueCheckValue;
-}
-
-//----------------------------------------------------------------------------
-void vtkCompositeSurfaceLICMapper::SetBlockVisibility(unsigned int index, bool visible)
-{
-  if(this->CompositeAttributes)
-    {
-    this->CompositeAttributes->SetBlockVisibility(index, visible);
-    this->Modified();
-    }
-}
-
-//----------------------------------------------------------------------------
-bool vtkCompositeSurfaceLICMapper::GetBlockVisibility(unsigned int index) const
-{
-  if(this->CompositeAttributes)
-    {
-    return this->CompositeAttributes->GetBlockVisibility(index);
-    }
-  else
-    {
-    return true;
-    }
-}
-
-//----------------------------------------------------------------------------
-void vtkCompositeSurfaceLICMapper::RemoveBlockVisibility(unsigned int index)
-{
-  if(this->CompositeAttributes)
-    {
-    this->CompositeAttributes->RemoveBlockVisibility(index);
-    this->Modified();
-    }
-}
-
-//----------------------------------------------------------------------------
-void vtkCompositeSurfaceLICMapper::RemoveBlockVisibilites()
-{
-  if(this->CompositeAttributes)
-    {
-    this->CompositeAttributes->RemoveBlockVisibilites();
-    this->Modified();
-    }
-}
-
-//----------------------------------------------------------------------------
-void vtkCompositeSurfaceLICMapper::SetBlockColor(unsigned int index, double color[3])
-{
-  if(this->CompositeAttributes)
-    {
-    this->CompositeAttributes->SetBlockColor(index, color);
-    this->Modified();
-    }
-}
-
-//----------------------------------------------------------------------------
-double* vtkCompositeSurfaceLICMapper::GetBlockColor(unsigned int index)
-{
-  static double white[3] = {1.0,1.0,1.0};
-
-  if(this->CompositeAttributes)
-    {
-    this->CompositeAttributes->GetBlockColor(index, this->ColorResult);
-    return this->ColorResult;
-    }
-  else
-    {
-    return white;
-    }
-}
-
-//----------------------------------------------------------------------------
-void vtkCompositeSurfaceLICMapper::RemoveBlockColor(unsigned int index)
-{
-  if(this->CompositeAttributes)
-    {
-    this->CompositeAttributes->RemoveBlockColor(index);
-    this->Modified();
-    }
-}
-
-//----------------------------------------------------------------------------
-void vtkCompositeSurfaceLICMapper::RemoveBlockColors()
-{
-  if(this->CompositeAttributes)
-    {
-    this->CompositeAttributes->RemoveBlockColors();
-    this->Modified();
-    }
-}
-
-//----------------------------------------------------------------------------
-void vtkCompositeSurfaceLICMapper::SetBlockOpacity(unsigned int index, double opacity)
-{
-  if(this->CompositeAttributes)
-    {
-    this->CompositeAttributes->SetBlockOpacity(index, opacity);
-    this->Modified();
-    }
-}
-
-//----------------------------------------------------------------------------
-double vtkCompositeSurfaceLICMapper::GetBlockOpacity(unsigned int index)
-{
-  if(this->CompositeAttributes)
-    {
-    return this->CompositeAttributes->GetBlockOpacity(index);
-    }
-  return 1.;
-}
-
-//----------------------------------------------------------------------------
-void vtkCompositeSurfaceLICMapper::RemoveBlockOpacity(unsigned int index)
-{
-  if(this->CompositeAttributes)
-    {
-    this->CompositeAttributes->RemoveBlockOpacity(index);
-    this->Modified();
-    }
-}
-
-//----------------------------------------------------------------------------
-void vtkCompositeSurfaceLICMapper::RemoveBlockOpacities()
-{
-  if(this->CompositeAttributes)
-    {
-    this->CompositeAttributes->RemoveBlockOpacities();
-    this->Modified();
-    }
-}
-
-//----------------------------------------------------------------------------
-void vtkCompositeSurfaceLICMapper::SetCompositeDataDisplayAttributes(
-  vtkCompositeDataDisplayAttributes *attributes)
-{
-  if(this->CompositeAttributes != attributes)
-    {
-    this->CompositeAttributes = attributes;
-    this->Modified();
-    }
-}
-
-//----------------------------------------------------------------------------
-vtkCompositeDataDisplayAttributes*
-vtkCompositeSurfaceLICMapper::GetCompositeDataDisplayAttributes()
-{
-  return this->CompositeAttributes;
-}
-
-//----------------------------------------------------------------------------
-void vtkCompositeSurfaceLICMapper::PrintSelf(ostream& os, vtkIndent indent)
-{
-  this->Superclass::PrintSelf(os, indent);
-}
-
-//-----------------------------------------------------------------------------
-void vtkCompositeSurfaceLICMapper::RenderBlock(vtkRenderer *renderer,
-                                              vtkActor *actor,
-                                              vtkDataObject *dobj,
-                                              unsigned int &flat_index)
-{
-  vtkHardwareSelector *selector = renderer->GetSelector();
-  vtkCompositeDataDisplayAttributes* cda = this->GetCompositeDataDisplayAttributes();
-
-  vtkProperty *prop = actor->GetProperty();
-  vtkColor3d ecolor(prop->GetEdgeColor());
-
-  bool overrides_visibility = (cda && cda->HasBlockVisibility(flat_index));
-  if (overrides_visibility)
-    {
-    this->BlockState.Visibility.push(cda->GetBlockVisibility(flat_index));
-    }
-
-  bool overrides_opacity = (cda && cda->HasBlockOpacity(flat_index));
-  if (overrides_opacity)
-    {
-    this->BlockState.Opacity.push(cda->GetBlockOpacity(flat_index));
-    }
-
-  bool overrides_color = (cda && cda->HasBlockColor(flat_index));
-  if (overrides_color)
-    {
-    vtkColor3d color = cda->GetBlockColor(flat_index);
-    this->BlockState.AmbientColor.push(color);
-    this->BlockState.DiffuseColor.push(color);
-    this->BlockState.SpecularColor.push(color);
-    }
-
-  unsigned int my_flat_index = flat_index;
-  // Advance flat-index. After this point, flat_index no longer points to this
-  // block.
-  flat_index++;
-
-  vtkMultiBlockDataSet *mbds = vtkMultiBlockDataSet::SafeDownCast(dobj);
-  vtkMultiPieceDataSet *mpds = vtkMultiPieceDataSet::SafeDownCast(dobj);
-  if (mbds || mpds)
-    {
-    unsigned int numChildren = mbds? mbds->GetNumberOfBlocks() :
-      mpds->GetNumberOfPieces();
-    for (unsigned int cc=0 ; cc < numChildren; cc++)
-      {
-      vtkDataObject* child = mbds ? mbds->GetBlock(cc) : mpds->GetPiece(cc);
-      if (child == NULL)
-        {
-        // speeds things up when dealing with NULL blocks (which is common with
-        // AMRs).
-        flat_index++;
-        continue;
-        }
-      this->RenderBlock(renderer, actor, child, flat_index);
-      }
-    }
-  else if (dobj && this->BlockState.Visibility.top() == true && this->BlockState.Opacity.top() > 0.0)
-    {
-    // Implies that the block is a non-null leaf node.
-    // The top of the "stacks" have the state that this block must be rendered
-    // with.
-    if (selector)
-      {
-      selector->BeginRenderProp();
-      selector->RenderCompositeIndex(my_flat_index);
-      }
-
-    // do we have a entry for this dataset?
-    // make sure we have an entry for this dataset
-    vtkPolyData *ds = vtkPolyData::SafeDownCast(dobj);
-    if (ds)
-      {
-      this->CurrentFlatIndex = my_flat_index;
-      vtkCompositeLICHelper *helper;
-      typedef std::map<const vtkDataSet *,vtkCompositeLICHelper *>::iterator GVIter;
-      GVIter found = this->Helpers.find(ds);
-      if (found == this->Helpers.end())
-        {
-        helper = vtkCompositeLICHelper::New();
-        helper->Parent = this;
-        this->CopyMapperValuesToHelper(helper);
-        this->Helpers.insert(std::make_pair(ds, helper));
-        helper->SetInputData(ds);
-        }
-      else
-        {
-        helper = found->second;
-        }
-      if (ds && ds->GetPoints())
-        {
-        helper->RenderPiece(renderer,actor);
-        }
-      }
-
-    if (selector)
-      {
-      selector->EndRenderProp();
-      }
-    }
-
-  if (overrides_color)
-    {
-    this->BlockState.AmbientColor.pop();
-    this->BlockState.DiffuseColor.pop();
-    this->BlockState.SpecularColor.pop();
-    }
-  if (overrides_opacity)
-    {
-    this->BlockState.Opacity.pop();
-    }
-  if (overrides_visibility)
-    {
-    this->BlockState.Visibility.pop();
-    }
-}
-
-void vtkCompositeSurfaceLICMapper::CopyMapperValuesToHelper(vtkCompositeLICHelper *helper)
-{
-  helper->vtkSurfaceLICMapper::ShallowCopy(this);
-  helper->SetStatic(1);
-}
-
-// ---------------------------------------------------------------------------
-// Description:
-// Method initiates the mapping process. Generally sent by the actor
-// as each frame is rendered.
-void vtkCompositeSurfaceLICMapper::Render(vtkRenderer *ren, vtkActor *actor)
-{
-  vtkProperty* prop = actor->GetProperty();
-
-  // Push base-values on the state stack.
-  this->BlockState.Visibility.push(true);
-  this->BlockState.Opacity.push(prop->GetOpacity());
-  this->BlockState.AmbientColor.push(vtkColor3d(prop->GetAmbientColor()));
-  this->BlockState.DiffuseColor.push(vtkColor3d(prop->GetDiffuseColor()));
-  this->BlockState.SpecularColor.push(vtkColor3d(prop->GetSpecularColor()));
-
-  // if our input has changed then clear out our helpers
-  vtkDataObject* inputDO = this->GetInputDataObject(0, 0);
-  if (inputDO->GetMTime() > this->HelperMTime)
-    {
-    std::map<const vtkDataSet*, vtkCompositeLICHelper *>::iterator miter
-      = this->Helpers.begin();
-    for (;miter != this->Helpers.end(); miter++)
-      {
-      miter->second->Delete();
-      }
-    this->Helpers.clear();
-    this->HelperMTime.Modified();
-    }
-  else // otherwise just reinitialize the shaders
-    {
-    // if we have changed recopy our mapper settings to the helpers
-    if (this->GetMTime() > this->HelperMTime)
-      {
-      std::map<const vtkDataSet*, vtkCompositeLICHelper *>::iterator miter
-        = this->Helpers.begin();
-      for (;miter != this->Helpers.end(); miter++)
-        {
-        this->CopyMapperValuesToHelper(miter->second);
-        }
-      }
-    }
-
-  // render using the composite data attributes
-  unsigned int flat_index = 0;
-  this->RenderBlock(ren, actor, inputDO, flat_index);
-
-  this->BlockState.Visibility.pop();
-  this->BlockState.Opacity.pop();
-  this->BlockState.AmbientColor.pop();
-  this->BlockState.DiffuseColor.pop();
-  this->BlockState.SpecularColor.pop();
-
-  this->UpdateProgress(1.0);
-}
diff --git a/Rendering/LICOpenGL2/vtkCompositeSurfaceLICMapper.h b/Rendering/LICOpenGL2/vtkCompositeSurfaceLICMapper.h
deleted file mode 100644
index dd257b9..0000000
--- a/Rendering/LICOpenGL2/vtkCompositeSurfaceLICMapper.h
+++ /dev/null
@@ -1,152 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkCompositeSurfaceLICMapper.h
-
-  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.
-
-=========================================================================*/
-// .NAME vtkCompositeSurfaceLICMapper - mapper for composite dataset
-// .SECTION Description
-// vtkCompositeSurfaceLICMapper is similar to
-// vtkGenericCompositeSurfaceLICMapper but requires that its inputs all have the
-// same properties (normals, tcoord, scalars, etc) It will only draw
-// polys and it does not support edge flags. The advantage to using
-// this class is that it generally should be faster
-
-#ifndef vtkCompositeSurfaceLICMapper_h
-#define vtkCompositeSurfaceLICMapper_h
-
-#include "vtkRenderingLICOpenGL2Module.h" // For export macro
-#include "vtkSmartPointer.h" // for vtkSmartPointer
-#include "vtkSurfaceLICMapper.h"
-
-#include "vtkColor.h" // used for ivars
-#include <map> // use for ivars
-#include <stack> // used for ivars
-
-class vtkCompositeDataDisplayAttributes;
-class vtkCompositeLICHelper;
-
-class VTKRENDERINGLICOPENGL2_EXPORT vtkCompositeSurfaceLICMapper
-  : public vtkSurfaceLICMapper
-{
-public:
-  static vtkCompositeSurfaceLICMapper* New();
-  vtkTypeMacro(vtkCompositeSurfaceLICMapper, vtkSurfaceLICMapper);
-  void PrintSelf(ostream& os, vtkIndent indent);
-
-  // Description:
-  // This calls RenderPiece (in a for loop if streaming is necessary).
-  virtual void Render(vtkRenderer *ren, vtkActor *act);
-
-  // Description:
-  // Returns if the mapper does not expect to have translucent geometry. This
-  // may happen when using ScalarMode is set to not map scalars i.e. render the
-  // scalar array directly as colors and the scalar array has opacity i.e. alpha
-  // component. Note that even if this method returns true, an actor may treat
-  // the geometry as translucent since a constant translucency is set on the
-  // property, for example.
-  // Overridden to use the actual data and ScalarMode to determine if we have
-  // opaque geometry.
-  virtual bool GetIsOpaque();
-
-  // Description:
-  // Set/get the composite data set attributes.
-  void SetCompositeDataDisplayAttributes(vtkCompositeDataDisplayAttributes *attributes);
-  vtkCompositeDataDisplayAttributes* GetCompositeDataDisplayAttributes();
-
-  // Description:
-  // Set/get the visibility for a block given its flat index.
-  void SetBlockVisibility(unsigned int index, bool visible);
-  bool GetBlockVisibility(unsigned int index) const;
-  void RemoveBlockVisibility(unsigned int index);
-  void RemoveBlockVisibilites();
-
-  // Description:
-  // Set/get the color for a block given its flat index.
-  void SetBlockColor(unsigned int index, double color[3]);
-  void SetBlockColor(unsigned int index, double r, double g, double b)
-    {
-    double color[3] = {r, g, b};
-    this->SetBlockColor(index, color);
-    }
-  double* GetBlockColor(unsigned int index);
-  void RemoveBlockColor(unsigned int index);
-  void RemoveBlockColors();
-
-  // Description:
-  // Set/get the opacity for a block given its flat index.
-  void SetBlockOpacity(unsigned int index, double opacity);
-  double GetBlockOpacity(unsigned int index);
-  void RemoveBlockOpacity(unsigned int index);
-  void RemoveBlockOpacities();
-
-  // copy values to the helpers
-  void CopyMapperValuesToHelper(vtkCompositeLICHelper *helper);
-
-protected:
-  vtkCompositeSurfaceLICMapper();
-  ~vtkCompositeSurfaceLICMapper();
-
-  // Description:
-  // We need to override this method because the standard streaming
-  // demand driven pipeline is not what we want - we are expecting
-  // hierarchical data as input
-  vtkExecutive* CreateDefaultExecutive();
-
-  // Description:
-  // Need to define the type of data handled by this mapper.
-  virtual int FillInputPortInformation(int port, vtkInformation* info);
-
-  // Description:
-  // Need to loop over the hierarchy to compute bounds
-  virtual void ComputeBounds();
-
-  // Description:
-  // Time stamp for computation of bounds.
-  vtkTimeStamp BoundsMTime;
-
-  // what "index" are we currently rendering, -1 means none
-  int CurrentFlatIndex;
-
- class RenderBlockState
-    {
-    public:
-      std::stack<bool> Visibility;
-      std::stack<double> Opacity;
-      std::stack<vtkColor3d> AmbientColor;
-      std::stack<vtkColor3d> DiffuseColor;
-      std::stack<vtkColor3d> SpecularColor;
-    };
-
-  RenderBlockState BlockState;
-  void RenderBlock(vtkRenderer *renderer,
-                   vtkActor *actor,
-                   vtkDataObject *dobj,
-                   unsigned int &flat_index);
-
-  std::map<const vtkDataSet *, vtkCompositeLICHelper *> Helpers;
-  vtkTimeStamp HelperMTime;
-  friend class vtkCompositeLICHelper;
-
-  // Description:
-  // Composite data set attributes.
-  vtkSmartPointer<vtkCompositeDataDisplayAttributes> CompositeAttributes;
-
-private:
-  unsigned long int LastOpaqueCheckTime;
-  bool LastOpaqueCheckValue;
-  double ColorResult[3];
-  vtkCompositeSurfaceLICMapper(
-    const vtkCompositeSurfaceLICMapper&); // Not implemented.
-  void operator=(const vtkCompositeSurfaceLICMapper&); // Not implemented.
-};
-
-#endif
diff --git a/Rendering/LICOpenGL2/vtkImageDataLIC2D.cxx b/Rendering/LICOpenGL2/vtkImageDataLIC2D.cxx
deleted file mode 100644
index db8b417..0000000
--- a/Rendering/LICOpenGL2/vtkImageDataLIC2D.cxx
+++ /dev/null
@@ -1,686 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkImageDataLIC2D.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 "vtkImageDataLIC2D.h"
-
-#include "vtkStructuredData.h"
-#include "vtkPointData.h"
-#include "vtkCellData.h"
-#include "vtkFloatArray.h"
-#include "vtkUnsignedCharArray.h"
-#include "vtkImageCast.h"
-#include "vtkImageData.h"
-#include "vtkImageNoiseSource.h"
-#include "vtkInformation.h"
-#include "vtkInformationVector.h"
-#include "vtkStructuredExtent.h"
-#include "vtkObjectFactory.h"
-#include "vtkLineIntegralConvolution2D.h"
-#include "vtkFrameBufferObject2.h"
-#include "vtkRenderbuffer.h"
-#include "vtkPixelBufferObject.h"
-#include "vtkTextureObject.h"
-#include "vtkPixelExtent.h"
-#include "vtkPixelTransfer.h"
-#include "vtkStreamingDemandDrivenPipeline.h"
-#include "vtkSmartPointer.h"
-#include "vtkOpenGLRenderWindow.h"
-#include "vtkOpenGLError.h"
-#include "vtkOpenGLShaderCache.h"
-#include "vtkShaderProgram.h"
-
-#include <deque>
-using std::deque;
-
-#include "vtkOpenGLHelper.h"
-#include "vtkTextureObjectVS.h"
-
-#define vtkImageDataLIC2DDEBUG 0
-#if (vtkImageDataLIC2DDEBUG >= 1)
-#include "vtkTextureIO.h"
-#endif
-
-#define PRINTEXTENT(ext) \
-  ext[0] << ", " << ext[1] << ", " << ext[2] << ", " << ext[3] << ", " << ext[4] << ", " << ext[5]
-
-//----------------------------------------------------------------------------
-vtkStandardNewMacro(vtkImageDataLIC2D);
-
-//----------------------------------------------------------------------------
-vtkImageDataLIC2D::vtkImageDataLIC2D()
-{
-  this->Context = NULL;
-  this->OwnWindow = false;
-  this->OpenGLExtensionsSupported = 0;
-
-  this->Steps = 20;
-  this->StepSize = 1.0;
-  this->Magnification = 1;
-
-  this->NoiseSource = vtkImageNoiseSource::New();
-  this->NoiseSource->SetWholeExtent(0, 127, 0, 127, 0, 0);
-  this->NoiseSource->SetMinimum(0.0);
-  this->NoiseSource->SetMaximum(1.0);
-
-  this->ImageCast = vtkImageCast::New();
-  this->ImageCast->SetOutputScalarTypeToFloat();
-  this->ImageCast->SetInputConnection(this->NoiseSource->GetOutputPort(0));
-
-  this->SetNumberOfInputPorts(2);
-
-  // by default process active point vectors
-  this->SetInputArrayToProcess(
-        0,
-        0,
-        0,
-        vtkDataObject::FIELD_ASSOCIATION_POINTS,
-        vtkDataSetAttributes::VECTORS);
-
-}
-
-//----------------------------------------------------------------------------
-vtkImageDataLIC2D::~vtkImageDataLIC2D()
-{
-  this->NoiseSource->Delete();
-  this->ImageCast->Delete();
-  this->SetContext(NULL);
-}
-
-//----------------------------------------------------------------------------
-int vtkImageDataLIC2D::SetContext(vtkRenderWindow * renWin)
-{
-  vtkOpenGLRenderWindow *rw = vtkOpenGLRenderWindow::SafeDownCast(renWin);
-
-  if (this->Context == rw)
-    {
-    return this->OpenGLExtensionsSupported;
-    }
-
-  if (this->Context && this->OwnWindow)
-    {
-    this->Context->Delete();
-    }
-  this->Modified();
-  this->Context = NULL;
-  this->OwnWindow = false;
-  this->OpenGLExtensionsSupported = 0;
-
-  vtkOpenGLRenderWindow *context = vtkOpenGLRenderWindow::SafeDownCast(renWin);
-  if (context)
-    {
-    context->Render();
-    context->MakeCurrent();
-
-    bool featureSupport
-      = vtkLineIntegralConvolution2D::IsSupported(context)
-      && vtkPixelBufferObject::IsSupported(context)
-      && vtkFrameBufferObject2::IsSupported(context)
-      && vtkRenderbuffer::IsSupported(context)
-      && vtkTextureObject::IsSupported(context);
-
-    if (!featureSupport)
-      {
-      vtkErrorMacro("Required OpenGL extensions not supported.");
-      return 0;
-      }
-
-    this->OpenGLExtensionsSupported = 1;
-    this->Context = context;
-    }
-
-  return 1;
-}
-
-//----------------------------------------------------------------------------
-vtkRenderWindow* vtkImageDataLIC2D::GetContext()
-{
-  return this->Context;
-}
-
-//----------------------------------------------------------------------------
-int vtkImageDataLIC2D::FillInputPortInformation(int port, vtkInformation *info)
-{
-  if (!this->Superclass::FillInputPortInformation(port, info))
-    {
-    return 0;
-    }
-
-  if (port == 1)
-    {
-    info->Set(vtkAlgorithm::INPUT_IS_OPTIONAL(), 1);
-    }
-
-  return 1;
-}
-
-//----------------------------------------------------------------------------
-void vtkImageDataLIC2D::TranslateInputExtent(
-        const int* inExt,
-        const int* inWholeExt,
-        int *resultExt)
-{
-  int nPlanar = 0;
-  for (int q=0; q<3; ++q)
-    {
-    int qq = 2*q;
-    if (inWholeExt[qq] == inWholeExt[qq+1])
-      {
-      resultExt[qq] = inExt[qq];
-      resultExt[qq+1] = inExt[qq];
-      nPlanar += 1;
-      }
-    else
-      {
-      resultExt[qq] = inExt[qq] * this->Magnification;
-      resultExt[qq+1] = (inExt[qq+1] + 1) * this->Magnification - 1;
-      }
-    }
-  if (nPlanar != 1)
-    {
-    vtkErrorMacro("Non-planar dataset");
-    }
-}
-
-//----------------------------------------------------------------------------
-int vtkImageDataLIC2D::RequestInformation(
-      vtkInformation* vtkNotUsed(request),
-      vtkInformationVector** inputVector,
-      vtkInformationVector* outputVector)
-{
-  int ext[6];
-  int wholeExtent[6];
-  double spacing[3];
-
-  vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
-  vtkInformation *outInfo = outputVector->GetInformationObject(0);
-
-  inInfo->Get(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT(), wholeExtent);
-  inInfo->Get(vtkDataObject::SPACING(), spacing);
-  vtkDebugMacro( << "Input WHOLE_EXTENT: " << PRINTEXTENT( wholeExtent ) << endl );
-  this->TranslateInputExtent(wholeExtent, wholeExtent, ext);
-
-  for (int axis = 0; axis < 3; axis++)
-    {
-    // Change the data spacing
-    spacing[axis] /= this->Magnification;
-    }
-  vtkDebugMacro( << "WHOLE_EXTENT: " << PRINTEXTENT( ext ) << endl );
-
-  outInfo->Set(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT(), ext, 6);
-  outInfo->Set(vtkDataObject::SPACING(), spacing, 3);
-
-  return 1;
-}
-
-//----------------------------------------------------------------------------
-int vtkImageDataLIC2D::RequestUpdateExtent (
-      vtkInformation * vtkNotUsed(request),
-      vtkInformationVector **inputVector,
-      vtkInformationVector *outputVector)
-{
-  vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
-  vtkInformation *outInfo = outputVector->GetInformationObject(0);
-
-  // Tell the vector field input the extents that we need from it.
-  // The downstream request needs to be downsized based on the Magnification.
-  int ext[6];
-  outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_EXTENT(), ext);
-
-  vtkDebugMacro( << "Requested UPDATE_EXTENT: " <<  PRINTEXTENT( ext ) << endl );
-  for (int axis = 0; axis < 3; axis++)
-    {
-    int wholeMin = ext[axis*2];
-    int wholeMax = ext[axis*2+1];
-
-    // Scale the output extent
-    wholeMin = wholeMin / this->Magnification;
-    wholeMax = wholeMax / this->Magnification;
-
-    ext[axis*2] = wholeMin;
-    ext[axis*2+1] = wholeMax;
-    }
-  vtkDebugMacro( << "UPDATE_EXTENT: " <<  PRINTEXTENT( ext ) << endl );
-
-  inInfo->Set(vtkStreamingDemandDrivenPipeline::UPDATE_EXTENT(), ext, 6);
-
-  inInfo = inputVector[1]->GetInformationObject(0);
-  if (inInfo)
-    {
-    // always request the whole noise image.
-    inInfo->Set(
-        vtkStreamingDemandDrivenPipeline::UPDATE_EXTENT(),
-        inInfo->Get(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT()),
-        6);
-    }
-
-  return 1;
-}
-
-//----------------------------------------------------------------------------
-int vtkImageDataLIC2D::RequestData(
-      vtkInformation  *vtkNotUsed(request),
-      vtkInformationVector **inputVector,
-      vtkInformationVector *outputVector)
-{
-  vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
-
-  vtkImageData *input
-     = vtkImageData::SafeDownCast(inInfo->Get(vtkDataObject::DATA_OBJECT()));
-  if ( !input )
-    {
-    vtkErrorMacro("Empty input");
-    return 0;
-    }
-
-  int dims[3];
-  input->GetDimensions(dims);
-
-  int dataDescription = vtkStructuredData::GetDataDescription(dims);
-
-  if (  vtkStructuredData::GetDataDimension( dataDescription ) != 2  )
-    {
-    vtkErrorMacro( "Input is not a 2D image." );
-    return 0;
-    }
-
-  vtkIdType numPoints = input->GetNumberOfPoints();
-  vtkDataArray *inVectors = this->GetInputArrayToProcess(0, inputVector);
-  if ( !inVectors )
-    {
-    vtkErrorMacro("Vectors are required for line integral convolution.");
-    return 0;
-    }
-
-  if ( inVectors->GetNumberOfTuples() != numPoints )
-    {
-    vtkErrorMacro( "Only point vectors are supported." );
-    return 0;
-    }
-
-  if ( !this->Context )
-    {
-    vtkRenderWindow * renWin = vtkRenderWindow::New();
-    if ( this->SetContext(renWin) == 0 )
-      {
-      vtkErrorMacro("Missing required OpenGL extensions");
-      renWin->Delete();
-      return 0;
-      }
-    this->OwnWindow = true;
-    }
-
-  this->Context->MakeCurrent();
-  vtkOpenGLClearErrorMacro();
-
-  // Noise.
-  vtkInformation *noiseInfo = inputVector[1]->GetInformationObject(0);
-  vtkImageData *noise = NULL;
-  if ( noiseInfo )
-    {
-    noise
-      = vtkImageData::SafeDownCast(noiseInfo->Get(vtkDataObject::DATA_OBJECT()));
-    if ( !noise )
-      {
-      vtkErrorMacro(
-        "Invalid noise dataset on input "
-        "Default noise dataset is used");
-      }
-
-    if ( (noise->GetPointData()==0)
-      || (noise->GetPointData()->GetScalars()==0) )
-      {
-      vtkErrorMacro(
-        "Noise dataset missing point data scalars. "
-        "Default noise dataset is used");
-      noise = NULL;
-      }
-
-    double noiseRange[2];
-    vtkDataArray *inVals = noise->GetPointData()->GetScalars();
-    inVals->GetRange(noiseRange);
-    if ( (noiseRange[0] < 0.0) || (noiseRange[1] > 1.0) )
-      {
-      vtkErrorMacro(
-        "Noise dataset has values out of range 0.0 to 1.0."
-        "Default noise dataset is used");
-      noise = NULL;
-      }
-    }
-
-  if ( !noise )
-    {
-    this->ImageCast->Update();
-    noise = this->ImageCast->GetOutput();
-    }
-
-  int comp[3] = {0, 0, 0};
-  switch (dataDescription)
-    {
-  case VTK_XY_PLANE:
-    comp[0] = 0;
-    comp[1] = 1;
-    comp[2] = 2;
-    break;
-
-  case VTK_YZ_PLANE:
-    comp[0] = 1;
-    comp[1] = 2;
-    comp[2] = 0;
-    break;
-
-  case VTK_XZ_PLANE:
-    comp[0] = 0;
-    comp[1] = 2;
-    comp[2] = 1;
-    break;
-    }
-
-  // size of output
-  int magDims[3];
-  magDims[0] = this->Magnification*dims[0];
-  magDims[1] = this->Magnification*dims[1];
-  magDims[2] = this->Magnification*dims[2];
-
-  // send vector data to a texture
-  int inputExt[6];
-  input->GetExtent(inputExt);
-
-  vtkPixelExtent inVectorExtent(dims[comp[0]], dims[comp[1]]);
-
-  vtkPixelBufferObject *vecPBO = vtkPixelBufferObject::New();
-  vecPBO->SetContext(this->Context);
-
-  vtkPixelTransfer::Blit(
-        inVectorExtent,
-        inVectorExtent,
-        inVectorExtent,
-        inVectorExtent,
-        3,
-        inVectors->GetDataType(),
-        inVectors->GetVoidPointer(0),
-        4,
-        VTK_FLOAT,
-        vecPBO->MapUnpackedBuffer(
-        VTK_FLOAT,
-        static_cast<unsigned int>(inVectorExtent.Size()),
-        4));
-
-  vecPBO->UnmapUnpackedBuffer();
-
-  vtkTextureObject *vectorTex = vtkTextureObject::New();
-  vectorTex->SetContext(this->Context);
-  vectorTex->Create2D(dims[comp[0]], dims[comp[1]], 4, vecPBO, false);
-  vtkLineIntegralConvolution2D::SetVectorTexParameters(vectorTex);
-
-  vecPBO->Delete();
-
-  #if (vtkImageDataLIC2DDEBUG >= 1)
-  vtkTextureIO::Write(
-              "idlic2d_vectors.vtk",
-              vectorTex, NULL, NULL);
-  #endif
-
-  // magnify vectors
-  vtkPixelExtent magVectorExtent(magDims[comp[0]], magDims[comp[1]]);
-  int magVectorSize[2];
-  magVectorExtent.Size(magVectorSize);
-
-  vtkTextureObject *magVectorTex = vectorTex;
-  if (this->Magnification > 1)
-    {
-    magVectorTex = vtkTextureObject::New();
-    magVectorTex->SetContext(this->Context);
-    magVectorTex->Create2D(magVectorSize[0], magVectorSize[1], 4, VTK_FLOAT, false);
-    vtkLineIntegralConvolution2D::SetVectorTexParameters(magVectorTex);
-
-    vtkFrameBufferObject2 *drawFbo = vtkFrameBufferObject2::New();
-    drawFbo->SetContext(this->Context);
-    drawFbo->SaveCurrentBindings();
-    drawFbo->Bind(GL_FRAMEBUFFER);
-    drawFbo->AddColorAttachment(GL_FRAMEBUFFER, 0U, magVectorTex);
-    drawFbo->ActivateDrawBuffer(0U);
-    //drawFbo->AddColorAttachment(vtkgl::FRAMEBUFFER_EXT, 0U, vectorTex);
-    //drawFbo->ActivateReadBuffer(0U);
-    drawFbo->CheckFrameBufferStatus(GL_FRAMEBUFFER);
-    drawFbo->InitializeViewport(magVectorSize[0], magVectorSize[1]);
-
-    glClearColor(0.0, 0.0, 0.0, 0.0);
-    glClear(GL_COLOR_BUFFER_BIT);
-
-    float minXTexCoord=static_cast<float>(
-      static_cast<double>(0.5)/magVectorSize[0]);
-    float minYTexCoord=static_cast<float>(
-      static_cast<double>(0.5)/magVectorSize[1]);
-
-    float maxXTexCoord=static_cast<float>(
-      static_cast<double>(magVectorSize[0]-0.5)/magVectorSize[0]);
-    float maxYTexCoord=static_cast<float>(
-      static_cast<double>(magVectorSize[1]-0.5)/magVectorSize[1]);
-
-    float tcoords[] = {
-      minXTexCoord, minYTexCoord,
-      maxXTexCoord, minYTexCoord,
-      maxXTexCoord, maxYTexCoord,
-      minXTexCoord, maxYTexCoord};
-
-    float verts[] = {
-      -1.0f, -1.0f, 0.0f,
-      1.0f, -1.0f, 0.0f,
-      1.0f, 1.0f, 0.0f,
-      -1.0f, 1.0f, 0.0f};
-
-    vectorTex->CopyToFrameBuffer(tcoords, verts, NULL, NULL);
-
-    vectorTex->Delete();
-
-    drawFbo->UnBind(GL_FRAMEBUFFER);
-    drawFbo->Delete();
-    }
-
-  #if (vtkImageDataLIC2DDEBUG >= 1)
-  vtkTextureIO::Write(
-              "idlic2d_magvectors.vtk",
-              magVectorTex, NULL, NULL);
-  #endif
-
-  // send noise data to a texture
-  vtkDataArray * inNoise = noise->GetPointData()->GetScalars();
-
-  vtkPixelExtent noiseExt(noise->GetExtent());
-
-  vtkPixelBufferObject *noisePBO = vtkPixelBufferObject::New();
-  noisePBO->SetContext(this->Context);
-  int noiseComp = inNoise->GetNumberOfComponents();
-
-  if (inNoise->GetDataType() != VTK_FLOAT)
-    {
-    vtkErrorMacro("noise dataset was not float");
-    }
-
-  vtkPixelTransfer::Blit(
-        noiseExt,
-        noiseComp,
-        inNoise->GetDataType(),
-        inNoise->GetVoidPointer(0),
-        VTK_FLOAT,
-        noisePBO->MapUnpackedBuffer(
-        VTK_FLOAT,
-        static_cast<unsigned int>(noiseExt.Size()),
-        noiseComp));
-
-  noisePBO->UnmapUnpackedBuffer();
-
-  int noiseTexSize[2];
-  noiseExt.Size(noiseTexSize);
-
-  vtkTextureObject *noiseTex = vtkTextureObject::New();
-  noiseTex->SetContext(this->Context);
-  noiseTex->Create2D(noiseTexSize[0], noiseTexSize[1],
-    noiseComp, noisePBO, false);
-
-  noisePBO->Delete();
-
-  #if (vtkImageDataLIC2DDEBUG >= 1)
-  vtkTextureIO::Write(
-          "idlic2d_noise.vtk",
-          noiseTex, NULL, NULL);
-  #endif
-
-  // step size conversion to normalize image space
-  double *spacing = input->GetSpacing();
-  spacing[comp[0]] /= this->Magnification;
-  spacing[comp[1]] /= this->Magnification;
-
-  double cellLength
-    = sqrt(spacing[comp[0]]*spacing[comp[0]]+spacing[comp[1]]*spacing[comp[1]]);
-
-  double w = spacing[comp[0]]*dims[comp[0]];
-  double h = spacing[comp[1]]*dims[comp[1]];
-  double normalizationFactor = sqrt(w*w+h*h);
-  double stepSize = this->StepSize*cellLength/normalizationFactor;
-
-  // compute the LIC
-  int updateExt[6];
-  inInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_EXTENT(), updateExt);
-
-  int magUpdateExt[6];
-  magUpdateExt[2*comp[0]] = updateExt[2*comp[0]] * this->Magnification;
-  magUpdateExt[2*comp[1]] = updateExt[2*comp[1]] * this->Magnification;
-  magUpdateExt[2*comp[2]] = updateExt[comp[2]];
-  magUpdateExt[2*comp[0]+1] = (updateExt[2*comp[0]+1] + 1) * this->Magnification - 1;
-  magUpdateExt[2*comp[1]+1] = (updateExt[2*comp[1]+1] + 1) * this->Magnification - 1;
-  magUpdateExt[2*comp[2]+1] = updateExt[comp[2]];
-
-  vtkPixelExtent magLicExtent(
-        magUpdateExt[2*comp[0]],
-        magUpdateExt[2*comp[0]+1],
-        magUpdateExt[2*comp[1]],
-        magUpdateExt[2*comp[1]+1]);
-
-  // add ghosts
-  double rk4fac = 3.0;
-  int nGhosts = static_cast<int>(this->Steps*this->StepSize*rk4fac);
-  nGhosts = nGhosts < 1 ? 1 : nGhosts;
-  nGhosts *= 2; // for second ee lic pass
-
-  vtkPixelExtent magLicGuardExtent(magLicExtent);
-  magLicGuardExtent.Grow(nGhosts);
-  magLicGuardExtent &= magVectorExtent;
-
-  vtkLineIntegralConvolution2D *LICer = vtkLineIntegralConvolution2D::New();
-  LICer->SetContext(this->Context);
-  LICer->SetNumberOfSteps(this->Steps);
-  LICer->SetStepSize(stepSize);
-  LICer->SetComponentIds(comp[0], comp[1]);
-  //LICer->SetGridSpacings(spacing[comp[0]], spacing[comp[1]]);
-
-  deque<vtkPixelExtent> magLicExtents(1, magLicExtent);
-  deque<vtkPixelExtent> magLicGuardExtents(1, magLicGuardExtent);
-
-  vtkTextureObject *licTex
-     = LICer->Execute(
-            magVectorExtent,
-            magLicGuardExtents,
-            magLicExtents,
-            magVectorTex,
-            NULL,
-            noiseTex);
-
-  LICer->Delete();
-  noiseTex->Delete();
-  magVectorTex->Delete();
-
-  if ( !licTex )
-    {
-    vtkErrorMacro("Failed to compute LIC");
-    return 0;
-    }
-
-  #if (vtkImageDataLIC2DDEBUG >= 1)
-  vtkTextureIO::Write(
-          "idlic2d_lic.vtk",
-          licTex, NULL, NULL);
-  #endif
-
-  // transfer lic from texture to vtk array
-  vtkIdType nOutTups = magLicExtent.Size();
-  vtkFloatArray *licOut = vtkFloatArray::New();
-  licOut->SetNumberOfComponents(3);
-  licOut->SetNumberOfTuples(nOutTups);
-  licOut->SetName("LIC");
-
-  vtkPixelBufferObject *licPBO = licTex->Download();
-
-  vtkPixelTransfer::Blit<float, float>(
-        magVectorExtent,
-        magLicExtent,
-        magLicExtent,
-        magLicExtent,
-        4,
-        (float*)licPBO->MapPackedBuffer(),
-        3,
-        licOut->GetPointer(0));
-
-  licPBO->UnmapPackedBuffer();
-  licPBO->Delete();
-  licTex->Delete();
-
-  // mask and convert to gray scale 3 components
-  float *pLicOut = licOut->GetPointer(0);
-  for (vtkIdType i=0; i<nOutTups; ++i)
-    {
-    float lic = pLicOut[3*i];
-    float mask = pLicOut[3*i+1];
-    if ( mask )
-      {
-      pLicOut[3*i+1] = pLicOut[3*i+2] = pLicOut[3*i] = 0.0f;
-      }
-    else
-      {
-      pLicOut[3*i+1] = pLicOut[3*i+2] = lic;
-      }
-    }
-
-  // setup output
-  vtkInformation *outInfo = outputVector->GetInformationObject(0);
-  vtkImageData *output
-    = vtkImageData::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT()));
-  if (!output)
-    {
-    vtkErrorMacro("Empty output");
-    return 1;
-    }
-
-  output->SetExtent(magUpdateExt);
-  output->SetSpacing(spacing);
-  output->GetPointData()->SetScalars(licOut);
-  licOut->Delete();
-
-  // Ensures that the output extent is exactly same as what was asked for.
-  //output->Crop(outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_EXTENT()));
-
-  return 1;
-}
-
-//----------------------------------------------------------------------------
-void vtkImageDataLIC2D::PrintSelf( ostream & os, vtkIndent indent )
-{
-  this->Superclass::PrintSelf( os, indent );
-
-  os << indent << "Steps: "         << this->Steps          << "\n";
-  os << indent << "StepSize: "      << this->StepSize       << "\n";
-  os << indent << "Magnification: " << this->Magnification  << "\n";
-  os << indent << "OpenGLExtensionsSupported: "
-               << this->OpenGLExtensionsSupported << "\n";
-}
diff --git a/Rendering/LICOpenGL2/vtkImageDataLIC2D.h b/Rendering/LICOpenGL2/vtkImageDataLIC2D.h
deleted file mode 100644
index c467bf2..0000000
--- a/Rendering/LICOpenGL2/vtkImageDataLIC2D.h
+++ /dev/null
@@ -1,140 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkImageDataLIC2D.h
-
-  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.
-
-=========================================================================*/
-// .NAME vtkImageDataLIC2D
-//
-// .SECTION Description
-//  GPU implementation of a Line Integral Convolution, a technique for
-//  imaging  vector fields.
-//
-//  The input on port 0 is an vtkImageData with extents of a 2D image. It needs
-//  a vector field on point data. This filter only works on point vectors. One
-//  can use a vtkCellDataToPointData filter to convert cell vectors to point
-//  vectors.
-//
-//  Port 1 is a special port for customized noise input. It is an optional port.
-//  If noise input is not specified, then the filter using vtkImageNoiseSource to
-//  generate a 128x128 noise texture.
-//
-// .SECTION see also
-//  vtkSurfaceLICPainter vtkLineIntegralConvolution2D
-
-#ifndef vtkImageDataLIC2D_h
-#define vtkImageDataLIC2D_h
-
-#include "vtkRenderingLICOpenGL2Module.h" // For export macro
-#include "vtkImageAlgorithm.h"
-#include "vtkWeakPointer.h" // needed for vtkWeakPointer.
-
-class vtkRenderWindow;
-class vtkOpenGLRenderWindow;
-class vtkImageNoiseSource;
-class vtkImageCast;
-
-class VTKRENDERINGLICOPENGL2_EXPORT vtkImageDataLIC2D : public vtkImageAlgorithm
-{
-public:
-  static vtkImageDataLIC2D* New();
-  vtkTypeMacro(vtkImageDataLIC2D, vtkImageAlgorithm);
-  void PrintSelf(ostream& os, vtkIndent indent);
-
-  // Description:
-  // Get/Set the context. Context must be a vtkOpenGLRenderWindow.
-  // This does not increase the reference count of the
-  // context to avoid reference loops.
-  // SetContext() may raise an error is the OpenGL context does not support the
-  // required OpenGL extensions. Return 0 upon failure and 1 upon success.
-  int SetContext( vtkRenderWindow * context );
-  vtkRenderWindow * GetContext();
-
-  // Description:
-  // Number of steps. Initial value is 20.
-  // class invariant: Steps>0.
-  // In term of visual quality, the greater the better.
-  vtkSetMacro(Steps,int);
-  vtkGetMacro(Steps,int);
-
-  // Description:
-  // Step size.
-  // Specify the step size as a unit of the cell length of the input vector
-  // field. Cell lengthh is the length of the diagonal of a cell.
-  // Initial value is 1.0.
-  // class invariant: StepSize>0.0.
-  // In term of visual quality, the smaller the better.
-  // The type for the interface is double as VTK interface is double
-  // but GPU only supports float. This value will be converted to
-  // float in the execution of the algorithm.
-  vtkSetMacro(StepSize, double);
-  vtkGetMacro(StepSize, double);
-
-  // Description:
-  // The the magnification factor. Default is 1
-  vtkSetMacro(Magnification, int);
-  vtkGetMacro(Magnification, int);
-
-  // Description:
-  // Check if the required OpenGL extensions / GPU are supported.
-  vtkGetMacro(OpenGLExtensionsSupported, int);
-
-  void TranslateInputExtent(
-        const int* inExt,
-        const int* inWholeExtent,
-        int *outExt);
-
-//BTX
-protected:
-  vtkImageDataLIC2D();
-  ~vtkImageDataLIC2D();
-
-  virtual int RequestInformation(vtkInformation *,
-    vtkInformationVector **, vtkInformationVector *);
-
-  // Description:
-  // Fill the input port information objects for this algorithm.  This
-  // is invoked by the first call to GetInputPortInformation for each
-  // port so subclasses can specify what they can handle.
-  // Redefined from the superclass.
-  virtual int FillInputPortInformation(int port,
-                                       vtkInformation *info);
-
-  int RequestUpdateExtent (vtkInformation * vtkNotUsed(request),
-                           vtkInformationVector **inputVector,
-                           vtkInformationVector *vtkNotUsed( outputVector ));
-
-  // Description:
-  // This is called by the superclass.
-  // This is the method you should override.
-  virtual int RequestData(vtkInformation *request,
-                          vtkInformationVector **inputVector,
-                          vtkInformationVector *outputVector);
-
-  vtkWeakPointer<vtkOpenGLRenderWindow> Context;
-  bool OwnWindow;
-  int OpenGLExtensionsSupported;
-
-  vtkImageNoiseSource* NoiseSource;
-  vtkImageCast* ImageCast;
-
-  int Steps;
-  double StepSize;
-  int Magnification;
-
-
-private:
-  vtkImageDataLIC2D(const vtkImageDataLIC2D&); // Not implemented.
-  void operator=(const vtkImageDataLIC2D&); // Not implemented.
-//ETX
-};
-
-#endif
diff --git a/Rendering/LICOpenGL2/vtkLineIntegralConvolution2D.cxx b/Rendering/LICOpenGL2/vtkLineIntegralConvolution2D.cxx
deleted file mode 100644
index ebd7029..0000000
--- a/Rendering/LICOpenGL2/vtkLineIntegralConvolution2D.cxx
+++ /dev/null
@@ -1,2073 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkLineIntegralConvolution2D.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 "vtkLineIntegralConvolution2D.h"
-
-#include "vtk_glew.h"
-
-#include "vtkOpenGLHelper.h"
-
-
-#include "vtkFloatArray.h"
-#include "vtkFrameBufferObject2.h"
-#include "vtkMath.h"
-#include "vtkObjectFactory.h"
-#include "vtkOpenGLError.h"
-#include "vtkOpenGLRenderUtilities.h"
-#include "vtkOpenGLRenderWindow.h"
-#include "vtkOpenGLShaderCache.h"
-#include "vtkPainterCommunicator.h"
-#include "vtkPixelBufferObject.h"
-#include "vtkPixelExtent.h"
-#include "vtkShaderProgram.h"
-#include "vtkTextureObject.h"
-#include "vtkTextureObjectVS.h"
-#include "vtkTimerLog.h"
-
-#include <vector>
-#include <string>
-#include <algorithm>
-
-using std::deque;
-using std::vector;
-using std::string;
-
-// Enable stream min/max computations. Streaming is accomplished
-// via PBO+glReadPixels to read just the regions we are updating.
-// Without streaming PBO+glGetTexImage is used to uplaod the entire
-// screen sized texture, of which (in parallel) we are updating only
-// a small part of.
-#define STREAMING_MIN_MAX
-
-// if you don't explicitly bind to 0 before swapping on some
-// systems (intel hd4000) then things get whacky. nvidia devices
-// are fine without this.
-#define NOT_NVIDIA
-
-// here have to setup the activate textures *before* calling use
-// program looks like it's a bug in the intel driver.
-// Intel GL 4.0.0 - Build 9.17.10.2932 GLSL 4.00 - Build 9.17.10.2932
-#define INTEL_BUG
-
-// if defined write intermediate results to disk
-// for debugging. (1 results, 2 +steps, 3 +fbo status )
-#define vtkLineIntegralConvolution2DDEBUG 0
-#if (vtkLineIntegralConvolution2DDEBUG >= 1)
-#include "vtkTextureIO.h"
-#include <sstream>
-using std::ostringstream;
-//----------------------------------------------------------------------------
-static
-string mpifn(int rank, const char *fn)
-{
-  ostringstream oss;
-  oss << rank << "_" << fn;
-  return oss.str();
-}
-#endif
-#if vtkLineIntegralConvolution2DDEBUG >= 3
-#define vtkLICCheckFrameBufferStatusMacro(mode) vtkCheckFrameBufferStatusMacro(mode)
-#else
-#define vtkLICCheckFrameBufferStatusMacro(mode)
-#endif
-
-// shader sources
-#include "vtkLineIntegralConvolution2D_VT.h" // normalized image space transform
-#include "vtkLineIntegralConvolution2D_LIC0.h" // initialization for lic
-#include "vtkLineIntegralConvolution2D_LICI.h" // compute i'th lic step
-#include "vtkLineIntegralConvolution2D_LICN.h" // finalize lic
-#include "vtkLineIntegralConvolution2D_EE.h"   // Laplace edge-enhance
-#include "vtkLineIntegralConvolution2D_CE.h"   // contrast enhance
-#include "vtkLineIntegralConvolution2D_AAH.h"  // horizontal part of anti-alias filter
-#include "vtkLineIntegralConvolution2D_AAV.h"  // vertical part of anti-alias filter
-
-#if defined(NDEBUG) || (vtkLineIntegralConvolution2DDEBUG < 3)
-# define DEBUG3CheckFrameBufferStatusMacro(mode)
-#else
-# define DEBUG3CheckFrameBufferStatusMacro(mode) \
-    vtkStaticCheckFrameBufferStatusMacro(mode)
-#endif
-
-/// vtkLICPingPongBufferManager -- gpgpu buffer manager
-/**
-Helper that manages state for the ping-pong buffer strategy
-employed during LIC integration. This class encapsulates all
-of the knowledge of our use of the FBO and texture units. Care
-is taken to avoid feedback loops.
-*/
-class vtkLICPingPongBufferManager
-{
-public:
-  vtkLICPingPongBufferManager(
-      vtkFrameBufferObject2 *fbo,
-      unsigned int *bufSize,
-      vtkTextureObject *vectorTexture,
-      vtkTextureObject *maskVectorTexture,
-      vtkTextureObject *noiseTexture,
-      int doEEPass,
-      int doVTPass)
-    {
-    this->VectorTexture = vectorTexture;
-    this->MaskVectorTexture = maskVectorTexture;
-    this->NoiseTexture = noiseTexture;
-
-    this->ReadIndex = 0;
-
-    // allocate buffers
-    vtkOpenGLRenderWindow *context =
-      vtkOpenGLRenderWindow::SafeDownCast(fbo->GetContext());
-    this->LICTexture0 = this->AllocateLICBuffer(context, bufSize);
-    this->SeedTexture0 = this->AllocateLICBuffer(context, bufSize);
-    this->LICTexture1 = this->AllocateLICBuffer(context, bufSize);
-    this->SeedTexture1 = this->AllocateLICBuffer(context, bufSize);
-    this->EETexture = doEEPass ? this->AllocateNoiseBuffer(context, bufSize) : NULL;
-    this->ImageVectorTexture = doVTPass ? this->AllocateVectorBuffer(context, bufSize) : NULL;
-
-    // setup pairs for buffer ping-pong
-    this->PingTextures[0] = this->LICTexture0;
-    this->PingTextures[1] = this->SeedTexture0;
-
-    this->PongTextures[0] = this->LICTexture1;
-    this->PongTextures[1] = this->SeedTexture1;
-
-    this->Textures[0] = this->PingTextures;
-    this->Textures[1] = this->PongTextures;
-
-    this->DettachBuffers(fbo);
-
-    #if vtkLineIntegralConvolution2DDEBUG >= 3
-    this->Print(cerr);
-    #endif
-    }
-
-  ~vtkLICPingPongBufferManager()
-    {
-    // free buffers
-    this->LICTexture0->Delete();
-    this->SeedTexture0->Delete();
-    this->LICTexture1->Delete();
-    this->SeedTexture1->Delete();
-    if (this->EETexture)
-      {
-      this->EETexture->Delete();
-      }
-    if (this->ImageVectorTexture)
-      {
-      this->ImageVectorTexture->Delete();
-      }
-    }
-
-  // Description:
-  // Get the unit/unit id for the given texture
-  // Here is how we use tetxure units.
-  //   name         | unit
-  //   -------------+--------
-  //   vectors      | 0
-  //   mask vectors | 0/1
-  //   noise        | 2
-  //   lic          | 3
-  //   seeds        | 4
-  int GetVectorTextureUnit()
-  {
-    return this->VectorTexture->GetTextureUnit();
-  }
-  int GetImageVectorTextureUnit()
-  {
-    if (this->ImageVectorTexture)
-      {
-      this->ImageVectorTexture->Activate();
-      return this->ImageVectorTexture->GetTextureUnit();
-      }
-    this->VectorTexture->Activate();
-    return this->VectorTexture->GetTextureUnit();
-  }
-  int GetMaskVectorTextureUnit()
-  {
-    if (this->MaskVectorTexture)
-      {
-      this->MaskVectorTexture->Activate();
-      return this->MaskVectorTexture->GetTextureUnit();
-      }
-    return this->GetImageVectorTextureUnit();
-  }
-  int GetNoiseTextureUnit(int LICPassNum)
-  {
-    if (LICPassNum == 0)
-      {
-      this->NoiseTexture->Activate();
-      return this->NoiseTexture->GetTextureUnit();
-      }
-    this->EETexture->Activate();
-    return this->EETexture->GetTextureUnit();
-  }
-  int GetLICTextureUnit()
-  {
-    this->Textures[this->ReadIndex][0]->Activate();
-    return this->Textures[this->ReadIndex][0]->GetTextureUnit();
-  }
-  int GetSeedTextureUnit()
-  {
-    this->Textures[this->ReadIndex][1]->Activate();
-    return this->Textures[this->ReadIndex][1]->GetTextureUnit();
-  }
-
-  // Description:
-  // Switch input and output buffers
-  void Swap(){ this->ReadIndex = 1 - this->ReadIndex; }
-
-  // Description:
-  // Get the last output (assumes a swap has been done).
-  vtkTextureObject *GetLastLICBuffer()
-    {
-    return this->ReadIndex == 0 ? this->LICTexture0 : this->LICTexture1;
-    }
-
-  // Description:
-  // Get the last output (assumes a swap has been done).
-  vtkTextureObject *GetLastSeedBuffer()
-    {
-    return this->ReadIndex == 0 ? this->SeedTexture0 : this->SeedTexture1;
-    }
-
-  // Description:
-  // Get the last output (assumes a swap has been done).
-  vtkTextureObject *GetLICBuffer()
-    {
-    return 1-this->ReadIndex == 0 ? this->LICTexture0 : this->LICTexture1;
-    }
-
-  // Description:
-  // Get the last output (assumes a swap has been done).
-  vtkTextureObject *GetSeedBuffer()
-    {
-    return 1-this->ReadIndex == 0 ? this->SeedTexture0 : this->SeedTexture1;
-    }
-
-  // Description:
-  // Clear all the buffers used for writing.
-  void ClearBuffers(
-        vtkFrameBufferObject2 *fbo,
-        const vtkPixelExtent &viewExt,
-        const deque<vtkPixelExtent> &extents,
-        int clearEETex = 0)
-    {
-    //attach
-    fbo->AddColorAttachment(GL_DRAW_FRAMEBUFFER, 0U, this->LICTexture0);
-    fbo->AddColorAttachment(GL_DRAW_FRAMEBUFFER, 1U, this->SeedTexture0);
-    fbo->AddColorAttachment(GL_DRAW_FRAMEBUFFER, 2U, this->LICTexture1);
-    fbo->AddColorAttachment(GL_DRAW_FRAMEBUFFER, 3U, this->SeedTexture1);
-    unsigned int num = 4U;
-    if (clearEETex)
-      {
-      fbo->AddColorAttachment(GL_DRAW_FRAMEBUFFER, 4U, this->EETexture);
-      num = 5U;
-      }
-    fbo->ActivateDrawBuffers(num);
-    DEBUG3CheckFrameBufferStatusMacro(GL_DRAW_FRAMEBUFFER);
-
-    // clear the parts of the screen which we will modify
-    // initially mask all fragments
-    glClearColor(0.0, 1.0, 0.0, 0.0);
-    #if 0
-    glClear(GL_COLOR_BUFFER_BIT);
-    #else
-    glEnable(GL_SCISSOR_TEST);
-    size_t nBlocks = extents.size();
-    for (size_t e=0; e<nBlocks; ++e)
-      {
-      vtkPixelExtent ext = extents[e];
-      // add halo for linear filtering
-      // since at most linear filtering requires
-      // 4 pixels , clearing an extra 4 here
-      // ensures we never access uninitialized
-      // memory.
-      ext.Grow(4);
-      ext &= viewExt;
-
-      unsigned int extSize[2];
-      ext.Size(extSize);
-
-      glScissor(ext[0], ext[2], extSize[0], extSize[1]);
-      glClear(GL_COLOR_BUFFER_BIT);
-      }
-    glDisable(GL_SCISSOR_TEST);
-    #endif
-    // detach
-    // detach
-    fbo->RemoveTexColorAttachments(GL_DRAW_FRAMEBUFFER, num);
-    fbo->DeactivateDrawBuffers();
-    }
-
-  // Description:
-  // Clear the given buffer
-  void ClearBuffer(
-        vtkFrameBufferObject2 *fbo,
-        vtkTextureObject *tex,
-        const vtkPixelExtent &viewExt,
-        const deque<vtkPixelExtent> &extents)
-    {
-    //attach
-    fbo->AddColorAttachment(GL_DRAW_FRAMEBUFFER, 0U, tex);
-    fbo->ActivateDrawBuffers(1);
-    DEBUG3CheckFrameBufferStatusMacro(GL_DRAW_FRAMEBUFFER);
-
-    // clear the parts of the screen which we will modify
-    // initially mask all fragments
-    glClearColor(0.0, 1.0, 0.0, 0.0);
-    #if 0
-    glClear(GL_COLOR_BUFFER_BIT);
-    #else
-    glEnable(GL_SCISSOR_TEST);
-    size_t nBlocks = extents.size();
-    for (size_t e=0; e<nBlocks; ++e)
-      {
-      vtkPixelExtent ext = extents[e];
-      // add halo for linear filtering
-      // since at most linear filtering requires
-      // 4 pixels , clearing an extra 4 here
-      // ensures we never access uninitialized
-      // memory.
-      ext.Grow(4);
-      ext &= viewExt;
-
-      unsigned int extSize[2];
-      ext.Size(extSize);
-
-      glScissor(ext[0], ext[2], extSize[0], extSize[1]);
-      glClear(GL_COLOR_BUFFER_BIT);
-      }
-    glDisable(GL_SCISSOR_TEST);
-    #endif
-    // detach
-    fbo->RemoveTexColorAttachments(GL_DRAW_FRAMEBUFFER, 1);
-    fbo->DeactivateDrawBuffers();
-    }
-
-  // Description:
-  // Activates the input textures. These are read only.
-  void AttachVectorTextures()
-    {
-    // vector
-    if (this->ImageVectorTexture)
-      {
-      this->ImageVectorTexture->Activate();
-      }
-    else
-      {
-      this->VectorTexture->Activate();
-      }
-
-    // mask vectors (optional)
-    if (this->MaskVectorTexture)
-      {
-      this->MaskVectorTexture->Activate();
-      }
-    }
-
-  // Description:
-  // Deactivates the input noise textures.
-  void DettachVectorTextures()
-    {
-    if (this->ImageVectorTexture)
-      {
-      this->ImageVectorTexture->Deactivate();
-      }
-    else
-      {
-      this->VectorTexture->Deactivate();
-      }
-
-    // mask vectors (optional)
-    if (this->MaskVectorTexture)
-      {
-      this->MaskVectorTexture->Deactivate();
-      }
-    }
-
-  // Description:
-  // Activate the read only noise texture. It's active for
-  // the entirety of each LIC pass.
-  void AttachNoiseTexture(int LICPassNum = 0)
-    {
-    switch (LICPassNum)
-      {
-      case 0:
-        this->NoiseTexture->Activate();
-        break;
-      case 1:
-        this->EETexture->Activate();
-        break;
-      }
-    }
-
-  // Dsecription:
-  // Deactivate the inpyt noise tetxure.
-  void DettachNoiseTexture(int LICPassNum = 0)
-    {
-    switch (LICPassNum)
-      {
-      case 0:
-        this->NoiseTexture->Deactivate();
-        break;
-      case 1:
-        this->EETexture->Deactivate();
-        break;
-      }
-    }
-
-  // Description:
-  // Setup read/write from/to the active lic/seed buffer texture pair
-  // for LIC pass.
-  void AttachLICBuffers(vtkFrameBufferObject2 *vtkNotUsed(fbo))
-    {
-    // activate read textures
-    vtkTextureObject **readTex = this->Textures[this->ReadIndex];
-    readTex[0]->Activate();
-    readTex[1]->Activate();
-
-    // attach write textures
-    vtkTextureObject **writeTex = this->Textures[1-this->ReadIndex];
-
-    glFramebufferTexture2D(
-          GL_DRAW_FRAMEBUFFER,
-          GL_COLOR_ATTACHMENT0,
-          GL_TEXTURE_2D,
-          writeTex[0]->GetHandle(),
-          0);
-    vtkOpenGLStaticCheckErrorMacro("failed at glFramebuffereadTexture2D");
-
-    glFramebufferTexture2D(
-          GL_DRAW_FRAMEBUFFER,
-          GL_COLOR_ATTACHMENT1,
-          GL_TEXTURE_2D,
-          writeTex[1]->GetHandle(),
-          0);
-    vtkOpenGLStaticCheckErrorMacro("failed at glFramebuffereadTexture2D");
-
-    GLenum atts[2] = {
-          GL_COLOR_ATTACHMENT0,
-          GL_COLOR_ATTACHMENT1
-          };
-    glDrawBuffers(2, atts);
-    vtkOpenGLStaticCheckErrorMacro("failed at glDrawBuffers");
-    }
-
-  // Description:
-  // Remove input/output bufers used for computing the LIC.
-  void DettachLICBuffers(vtkFrameBufferObject2 *vtkNotUsed(fbo))
-    {
-    vtkOpenGLStaticCheckErrorMacro("failed at glDrawBuffers");
-    glFramebufferTexture2D(
-          GL_DRAW_FRAMEBUFFER,
-          GL_COLOR_ATTACHMENT0,
-          GL_TEXTURE_2D,
-          0U,
-          0);
-
-    vtkOpenGLStaticCheckErrorMacro("failed at glDrawBuffers");
-    glFramebufferTexture2D(
-          GL_DRAW_FRAMEBUFFER,
-          GL_COLOR_ATTACHMENT1,
-          GL_TEXTURE_2D,
-          0U,
-          0);
-
-    GLenum atts[1] = {GL_NONE};
-    glDrawBuffers(1, atts);
-    vtkOpenGLStaticCheckErrorMacro("failed at glDrawBuffers");
-
-    vtkTextureObject **readTex = this->Textures[this->ReadIndex];
-    readTex[0]->Deactivate();
-    readTex[1]->Deactivate();
-    }
-
-  // Description:
-  // Attach read/write buffers for transform pass.
-  void AttachImageVectorBuffer(vtkFrameBufferObject2 *vtkNotUsed(fbo))
-    {
-    this->VectorTexture->Activate();
-
-    glFramebufferTexture2D(
-          GL_DRAW_FRAMEBUFFER,
-          GL_COLOR_ATTACHMENT0,
-          GL_TEXTURE_2D,
-          this->ImageVectorTexture->GetHandle(),
-          0);
-    vtkOpenGLStaticCheckErrorMacro("failed at glFramebufferTexture2D");
-
-    GLenum atts[1] = {GL_COLOR_ATTACHMENT0};
-    glDrawBuffers(1, atts);
-    vtkOpenGLStaticCheckErrorMacro("failed at glDrawBuffers");
-    }
-
-  // Description:
-  // Attach read/write buffers for transform pass.
-  void DettachImageVectorBuffer(vtkFrameBufferObject2 *vtkNotUsed(fbo))
-    {
-    this->VectorTexture->Deactivate();
-
-    glFramebufferTexture2D(
-      GL_DRAW_FRAMEBUFFER,
-      GL_COLOR_ATTACHMENT0,
-      GL_TEXTURE_2D,
-      0U,
-      0);
-
-    GLenum atts[1] = {GL_NONE};
-    glDrawBuffers(1, atts);
-    vtkOpenGLStaticCheckErrorMacro("failed at glDrawBuffers");
-    }
-
-  // Description:
-  // Attach read/write buffers for EE pass.
-  void AttachEEBuffer(vtkFrameBufferObject2 *vtkNotUsed(fbo))
-    {
-    vtkTextureObject **readTex = this->Textures[this->ReadIndex];
-    readTex[0]->Activate();
-
-    glFramebufferTexture2D(
-          GL_DRAW_FRAMEBUFFER,
-          GL_COLOR_ATTACHMENT0,
-          GL_TEXTURE_2D,
-          this->EETexture->GetHandle(),
-          0);
-    vtkOpenGLStaticCheckErrorMacro("failed at glFramebufferTexture2D");
-
-    GLenum atts[1] = {GL_COLOR_ATTACHMENT0};
-    glDrawBuffers(1, atts);
-    vtkOpenGLStaticCheckErrorMacro("failed at glDrawBuffers");
-
-    DEBUG3CheckFrameBufferStatusMacro(GL_DRAW_FRAMEBUFFER);
-    }
-
-  // Description:
-  // Attach read/write buffers for EE pass.
-  void DettachEEBuffer(vtkFrameBufferObject2 *vtkNotUsed(fbo))
-    {
-    vtkTextureObject **readTex = this->Textures[this->ReadIndex];
-    readTex[0]->Deactivate();
-
-    glFramebufferTexture2D(
-          GL_DRAW_FRAMEBUFFER,
-          GL_COLOR_ATTACHMENT0,
-          GL_TEXTURE_2D,
-          0U,
-          0);
-
-    GLenum atts[1] = {GL_NONE};
-    glDrawBuffers(1, atts);
-    vtkOpenGLStaticCheckErrorMacro("failed at glDrawBuffers");
-    }
-
-  // Description:
-  // Deactivates and removes all read/write buffers that were in
-  // use during the run, restoring a pristine FBO/texture unit state.
-  void DettachBuffers(vtkFrameBufferObject2 *vtkNotUsed(fbo))
-    {
-    glFramebufferTexture2D(
-          GL_DRAW_FRAMEBUFFER,
-          GL_COLOR_ATTACHMENT0,
-          GL_TEXTURE_2D,
-          0U,
-          0);
-    vtkOpenGLStaticCheckErrorMacro("failed at glFramebufferTexture2D");
-
-    glFramebufferTexture2D(
-          GL_DRAW_FRAMEBUFFER,
-          GL_COLOR_ATTACHMENT1,
-          GL_TEXTURE_2D,
-          0U,
-          0);
-    vtkOpenGLStaticCheckErrorMacro("failed at glFramebufferTexture2D");
-
-    GLenum none = GL_NONE;
-    glDrawBuffers(1, &none);
-    vtkOpenGLStaticCheckErrorMacro("failed at glDrawBuffers");
-
-    // deactivate all textures?
-    vtkTextureObject **readTex = this->Textures[this->ReadIndex];
-    if (readTex[0]) { readTex[0]->Deactivate(); }
-    if (readTex[1]) { readTex[1]->Deactivate(); }
-    vtkTextureObject **writeTex = this->Textures[1-this->ReadIndex];
-    if (writeTex[0]) { writeTex[0]->Deactivate(); }
-    if (writeTex[1]) { writeTex[1]->Deactivate(); }
-    }
-
-  // Description:
-  // Get the read/write ids
-  int GetReadIndex(){ return this->ReadIndex; }
-  int GetWriteIndex(){ return 1 - this->ReadIndex; }
-
-  // Description:
-  // Allocate a texture of the given size.
-  // with parameters for LIC lookups
-  vtkTextureObject *AllocateLICBuffer(
-        vtkOpenGLRenderWindow *context,
-        unsigned int texSize[2])
-    {
-    float border[4] = {0.0f, 1.0f, 0.0f, 0.0f};
-    return this->AllocateBuffer(
-          context,
-          texSize,
-          vtkTextureObject::Nearest,
-          vtkTextureObject::ClampToBorder,
-          border);
-    }
-
-  // Description:
-  // Allocate a texture of the given size.
-  // with parameters for noise lookups
-  vtkTextureObject *AllocateNoiseBuffer(
-        vtkOpenGLRenderWindow *context,
-        unsigned int texSize[2])
-    {
-    float border[4] = {0.0f, 0.0f, 0.0f, 0.0f};
-    return this->AllocateBuffer(
-          context,
-          texSize,
-          vtkTextureObject::Nearest,
-          vtkTextureObject::ClampToEdge,
-          border);
-    }
-
-  // Description:
-  // Allocate a texture of the given size.
-  // with parameters for LIC
-  vtkTextureObject *AllocateVectorBuffer(
-        vtkOpenGLRenderWindow *context,
-        unsigned int texSize[2])
-    {
-    float border[4] = {0.0f, 0.0f, 0.0f, 0.0f};
-    return this->AllocateBuffer(
-          context,
-          texSize,
-          vtkTextureObject::Linear,
-          vtkTextureObject::ClampToBorder,
-          border);
-    }
-
-  // Description:
-  // Allocate a texture of the given size.
-  vtkTextureObject *AllocateBuffer(
-        vtkOpenGLRenderWindow *context,
-        unsigned int texSize[2],
-        int filter,
-        int wrapping,
-        float *borderColor)
-    {
-    vtkTextureObject *tex = vtkTextureObject::New();
-    tex->SetContext(context);
-    tex->SetBaseLevel(0);
-    tex->SetMaxLevel(0);
-    tex->SetBorderColor(borderColor);
-    tex->SetWrapS(wrapping);
-    tex->SetWrapT(wrapping);
-    tex->SetMinificationFilter(filter);  // no guard pixels
-    tex->SetMagnificationFilter(filter); // no guard pixels
-    tex->Create2D(texSize[0], texSize[1], 4, VTK_FLOAT, false);
-    tex->SetAutoParameters(0);
-    return tex;
-    }
-
-  // Description:
-  // Render screen aligned quad.
-  void RenderQuad(
-          float computeBoundsPt0[2],
-          float computeBoundsPt1[2],
-          vtkPixelExtent computeExtent,
-          vtkOpenGLHelper *cbo)
-    {
-    float computeBounds[4] = {
-          computeBoundsPt0[0], computeBoundsPt1[0],
-          computeBoundsPt0[1], computeBoundsPt1[1]
-          };
-     this->RenderQuad(computeBounds, computeExtent, cbo);
-    }
-
-  // Description:
-  // Render screen aligned quad.
-  void RenderQuad(
-          float computeBounds[4],
-          vtkPixelExtent computeExtent,
-          vtkOpenGLHelper *cbo)
-    {
-    float quadBounds[4];
-    computeExtent.CellToNode();
-    computeExtent.GetData(quadBounds);
-
-    float tcoords[] = {
-      computeBounds[0], computeBounds[2],
-      computeBounds[1], computeBounds[2],
-      computeBounds[1], computeBounds[3],
-      computeBounds[0], computeBounds[3]};
-
-    float verts[] = {
-      computeBounds[0]*2.0-1.0, computeBounds[2]*2.0-1.0, 0.0f,
-      computeBounds[1]*2.0-1.0, computeBounds[2]*2.0-1.0, 0.0f,
-      computeBounds[1]*2.0-1.0, computeBounds[3]*2.0-1.0, 0.0f,
-      computeBounds[0]*2.0-1.0, computeBounds[3]*2.0-1.0, 0.0f};
-
-    vtkOpenGLRenderUtilities::RenderQuad(verts, tcoords,
-      cbo->Program, cbo->VAO);
-    vtkOpenGLStaticCheckErrorMacro("failed at RenderQuad");
-    }
-
-  #if (vtkLineIntegralConvolution2DDEBUG >= 1)
-  // Description:
-  // Write the last output buffers to disk (assumes a swap has
-  // already been done)
-  void WriteBuffers(
-      int rank,
-      const char *licFileName,
-      const char *seedFileName,
-      const deque<vtkPixelExtent>& exts)
-    {
-    if (licFileName)
-      {
-      vtkTextureIO::Write(
-              mpifn(rank, licFileName),
-              this->GetLastLICBuffer(),
-              exts);
-      }
-    if (seedFileName)
-      {
-      vtkTextureIO::Write(
-              mpifn(rank, seedFileName),
-              this->GetLastSeedBuffer(),
-              exts);
-      }
-    }
-  void WriteEEBuffer(int rank, const deque<vtkPixelExtent> &exts)
-    {
-    vtkTextureIO::Write(
-          mpifn(rank,"lic2d_ee.vtm"),
-          this->EETexture,
-          exts);
-    }
-  void WriteImageVectorBuffer(int rank, const deque<vtkPixelExtent> &exts)
-    {
-    vtkTextureIO::Write(
-          mpifn(rank,"lic2d_ivec.vtm"),
-          this->ImageVectorTexture,
-          exts);
-    }
-  void WriteInputs(int rank, const deque<vtkPixelExtent>& exts)
-    {
-    vtkTextureIO::Write(
-              mpifn(rank,"lic2d_vec.vtm"),
-              this->VectorTexture,
-              exts);
-    if (this->MaskVectorTexture)
-      {
-      vtkTextureIO::Write(
-                mpifn(rank,"lic2d_mask.vtm"),
-                this->MaskVectorTexture,
-                exts);
-      }
-    vtkTextureIO::Write(
-              mpifn(rank,"lic2d_noise.vtk"),
-              this->NoiseTexture);
-    }
-
-  // Description:
-  // Print current state to the given stream
-  void Print(ostream &os)
-    {
-    os
-      << "Vectors = " << this->VectorTexture->GetHandle() << endl
-      << "ImageVectors = " << this->ImageVectorTexture->GetHandle() << endl
-      << "MaskVectors = " << (this->MaskVectorTexture ? this->MaskVectorTexture->GetHandle() : 0U) << endl
-      << "Noise = " << this->NoiseTexture->GetHandle() << endl
-      << "EE = " << (this->EETexture ? this->EETexture->GetHandle() : 0U) << endl
-      << "LIC0 = " << this->LICTexture0->GetHandle() << endl
-      << "Seed0 = " << this->SeedTexture0->GetHandle() << endl
-      << "LIC1 = " << this->LICTexture1->GetHandle() << endl
-      << "Seed1 = " << this->SeedTexture1->GetHandle() << endl
-      << "ReadIndex=" << this->ReadIndex << endl
-      << "PingTextures[0]=" << this->Textures[0][0] << ", " << this->Textures[0][1] << endl
-      << "PongTextures[1]=" << this->Textures[1][0] << ", " << this->Textures[1][1] << endl;
-    }
-  #endif
-
-private:
-  vtkTextureObject *VectorTexture;
-  vtkTextureObject *ImageVectorTexture;
-  vtkTextureObject *MaskVectorTexture;
-  vtkTextureObject *NoiseTexture;
-  vtkTextureObject *EETexture;
-  vtkTextureObject *LICTexture0;
-  vtkTextureObject *SeedTexture0;
-  vtkTextureObject *LICTexture1;
-  vtkTextureObject *SeedTexture1;
-
-  int  ReadIndex;
-  vtkTextureObject *PingTextures[2];
-  vtkTextureObject *PongTextures[2];
-  vtkTextureObject **Textures[2];
-};
-
-namespace vtkLineIntegralConvolution2DUtil
-{
-/**
-glsl shader code for selecting vector comps.
-*/
-string GetComponentSelectionProgram(int *compIds)
-{
-  // swizles at 45,46
-  string srcCode(".$$");
-  const char *compNames = "xyzw";
-  srcCode[1] = compNames[compIds[0]];
-  srcCode[2] = compNames[compIds[1]];
-  return srcCode;
-}
-
-/*
-Shader code for looking up vectors
-*/
-const char *GetVectorLookupProgram(int normalize)
-{
-  // lookup the vector and normalize
-  const char *getNormVecSrc = " \
-    vec2 getVector( vec2 vectc )\n \
-      {\n \
-      vec2 V = texture2D( texVectors, vectc ).xy;\n \
-      // normalize if |V| not 0\n \
-      float lenV = length( V );\n \
-      if ( lenV > 1.0e-8 )\n \
-        {\n \
-        return V/lenV;\n \
-        }\n \
-      else\n \
-        {\n \
-        return vec2( 0.0, 0.0 );\n \
-        }\n \
-      }\n \
-    ";
-
-   // lookup the vector
-   const char *getVecSrc = " \
-    vec2 getVector( vec2 vectc )\n \
-      {\n \
-      return texture2D( texVectors, vectc ).xy;\n \
-      }\n \
-    ";
-
-  if ( normalize )
-    {
-    return getNormVecSrc;
-    }
- return getVecSrc;
-}
-
-// Description
-// find min/max of unmasked fragments across all regions
-// download the entire screen then search each region
-void FindMinMax(
-      vtkTextureObject *tex,
-      const deque<vtkPixelExtent> &extents,
-      float &min,
-      float &max)
-{
-  // download entire screen
-  int size0 = tex->GetWidth();
-  vtkPixelBufferObject *colors = tex->Download();
-  float *pColors = static_cast<float*>(colors->MapPackedBuffer());
-  // search each region
-  size_t nExtents = extents.size();
-  for (size_t q=0; q<nExtents; ++q)
-    {
-    const vtkPixelExtent &extent = extents[q];
-    for (int j=extent[2]; j<=extent[3]; ++j)
-      {
-      for (int i=extent[0]; i<=extent[1]; ++i)
-        {
-        int id = 4*(j*size0+i);
-        bool masked = pColors[id+1] != 0.0f;
-        bool ceskip = pColors[id+2] != 0.0f;
-        if ( !masked && !ceskip )
-          {
-          float color = pColors[id];
-          min = min > color ? color : min;
-          max = max < color ? color : max;
-          }
-        }
-      }
-    }
-  colors->UnmapPackedBuffer();
-  colors->Delete();
-  #if  vtkLineIntegralConvolution2DDEBUG>=1
-  cerr << "min=" << min << " max=" << max << endl;
-  #endif
-}
-
-// Description
-// find min/max of unmasked fragments across all regions
-// download each search each region individually
-void StreamingFindMinMax(
-      vtkFrameBufferObject2 *fbo,
-      vtkTextureObject *tex,
-      const deque<vtkPixelExtent> &extents,
-      float &min,
-      float &max)
-{
-  size_t nExtents = extents.size();
-  // initiate download of each region
-  fbo->AddColorAttachment(GL_DRAW_FRAMEBUFFER, 0U, tex);
-  fbo->AddColorAttachment(GL_READ_FRAMEBUFFER, 0U, tex);
-  fbo->ActivateDrawBuffer(0U);
-  fbo->ActivateReadBuffer(0U);
-  fbo->CheckFrameBufferStatus(GL_FRAMEBUFFER);
-  vector<vtkPixelBufferObject*> pbos(nExtents, NULL);
-  for (size_t q=0; q<nExtents; ++q)
-    {
-    pbos[q] = fbo->Download(
-          const_cast<int*>(extents[q].GetData()),
-          VTK_FLOAT,
-          4,
-          GL_FLOAT,
-          GL_RGBA);
-    }
-  fbo->DeactivateDrawBuffers();
-  fbo->DeactivateReadBuffer();
-  fbo->RemoveTexColorAttachment(GL_DRAW_FRAMEBUFFER, 0U);
-  fbo->RemoveTexColorAttachment(GL_READ_FRAMEBUFFER, 0U);
-  // search each region
-  for (size_t q=0; q<nExtents; ++q)
-    {
-    vtkPixelBufferObject *&pbo = pbos[q];
-    float *pColors = (float*)pbo->MapPackedBuffer();
-
-    size_t n = extents[q].Size();
-    for (size_t i = 0; i<n; ++i)
-      {
-      bool masked = pColors[4*i+1] != 0.0f;
-      bool ceskip = pColors[4*i+2] != 0.0f;
-      if ( !masked && !ceskip )
-        {
-        float color = pColors[4*i];
-        min = min > color ? color : min;
-        max = max < color ? color : max;
-        }
-      }
-
-    pbo->UnmapPackedBuffer();
-    pbo->Delete();
-    pbo = NULL;
-    }
-  pbos.clear();
-  #if  vtkLineIntegralConvolution2DDEBUG >= 1
-  cerr << "min=" << min << " max=" << max << endl;
-  #endif
-}
-
-};
-using namespace vtkLineIntegralConvolution2DUtil;
-
-// ----------------------------------------------------------------------------
-vtkObjectFactoryNewMacro(vtkLineIntegralConvolution2D);
-
-// ----------------------------------------------------------------------------
-vtkLineIntegralConvolution2D::vtkLineIntegralConvolution2D()
-{
-  this->Comm = NULL;
-
-  this->Context = NULL;
-  this->FBO = vtkFrameBufferObject2::New();
-
-  this->ShadersNeedBuild = 1;
-  this->VTShader = NULL;
-  this->LIC0Shader = NULL;
-  this->LICIShader = NULL;
-  this->LICNShader = NULL;
-  this->EEShader = NULL;
-  this->CEShader = NULL;
-  this->AAHShader = NULL;
-  this->AAVShader = NULL;
-
-  this->StepSize = 0.01;
-  this->NumberOfSteps = 1;
-  this->NormalizeVectors = 1;
-  this->ComponentIds[0] = 0;
-  this->ComponentIds[1] = 1;
-
-  this->EnhancedLIC = 1;
-
-  this->EnhanceContrast = 0;
-  this->LowContrastEnhancementFactor = 0.0;
-  this->HighContrastEnhancementFactor = 0.0;
-  this->AntiAlias = 0;
-  this->MaskThreshold = 0.0;
-
-  this->TransformVectors = 1;
-}
-
-// ----------------------------------------------------------------------------
-vtkLineIntegralConvolution2D::~vtkLineIntegralConvolution2D()
-{
-  delete this->Comm;
-  this->SetContext(NULL);
-  this->SetVTShader(NULL);
-  this->SetLIC0Shader(NULL);
-  this->SetLICIShader(NULL);
-  this->SetLICNShader(NULL);
-  this->SetEEShader(NULL);
-  this->SetCEShader(NULL);
-  this->SetAAHShader(NULL);
-  this->SetAAVShader(NULL);
-
-  if (this->VTShader)
-    {
-    delete this->VTShader;
-    }
-  if (this->LIC0Shader)
-    {
-    delete this->LIC0Shader;
-    }
-  if (this->LICIShader)
-    {
-    delete this->LICIShader;
-    }
-  if (this->LICNShader)
-    {
-    delete this->LICNShader;
-    }
-  if (this->EEShader)
-    {
-    delete this->EEShader;
-    }
-  if (this->CEShader)
-    {
-    delete this->CEShader;
-    }
-  if (this->AAHShader)
-    {
-    delete this->AAHShader;
-    }
-  if (this->AAVShader)
-    {
-    delete this->AAVShader;
-    }
-
-  this->FBO->Delete();
-}
-
-// ----------------------------------------------------------------------------
-vtkOpenGLRenderWindow *vtkLineIntegralConvolution2D::GetContext()
-{
-  return this->Context;
-}
-
-// ----------------------------------------------------------------------------
-void vtkLineIntegralConvolution2D::SetContext(vtkOpenGLRenderWindow *renWin)
-{
-  if (this->Context == renWin)
-    {
-    return;
-    }
-
-  this->Context = renWin;
-  this->ShadersNeedBuild = 1;
-  this->FBO->SetContext(renWin);
-  this->Modified();
-
-  if (renWin && !this->IsSupported(renWin))
-    {
-    vtkErrorMacro("The required OpenGL extensions are not present");
-    }
-}
-
-// ----------------------------------------------------------------------------
-bool vtkLineIntegralConvolution2D::IsSupported(vtkRenderWindow *renWin)
-{
-  vtkOpenGLRenderWindow *context = vtkOpenGLRenderWindow::SafeDownCast(renWin);
-  if (!context)
-    {
-    return false;
-    }
-
-  return vtkTextureObject::IsSupported(context, true, false, false)
-     && vtkFrameBufferObject2::IsSupported(context)
-     && vtkPixelBufferObject::IsSupported(context);
-}
-
-// ----------------------------------------------------------------------------
-void vtkLineIntegralConvolution2D::SetNoiseTexParameters(vtkTextureObject * tex)
-{
-  tex->SetBaseLevel(0);
-  tex->SetMaxLevel(0);
-  tex->SetWrapS(vtkTextureObject::Repeat);
-  tex->SetWrapT(vtkTextureObject::Repeat);
-  tex->SetMinificationFilter(vtkTextureObject::Nearest);
-  tex->SetMagnificationFilter(vtkTextureObject::Nearest);
-  // note : as a side affect it sets the parameters
-  // that is needed here.
-  tex->Bind();
-  tex->UnBind();
-}
-
-// ----------------------------------------------------------------------------
-void vtkLineIntegralConvolution2D::SetVectorTexParameters(vtkTextureObject *tex)
-{
-  tex->SetBaseLevel(0);
-  tex->SetMaxLevel(0);
-  tex->SetWrapS(vtkTextureObject::ClampToBorder);
-  tex->SetWrapT(vtkTextureObject::ClampToBorder);
-  tex->SetBorderColor(0.0, 0.0, 0.0, 0.0);
-  tex->SetMinificationFilter(vtkTextureObject::Linear);
-  tex->SetMagnificationFilter(vtkTextureObject::Linear);
-  // note : as a side affect it sets the parameters
-  // that is needed here.
-  tex->Bind();
-  tex->UnBind();
-}
-
-// ----------------------------------------------------------------------------
-void vtkLineIntegralConvolution2D::SetComponentIds(int c0, int c1)
-{
-  if ((this->ComponentIds[0] == c0) && (this->ComponentIds[1] == c1))
-    {
-    return;
-    }
-  this->ComponentIds[0] = c0;
-  this->ComponentIds[1] = c1;
-  this->ShadersNeedBuild = 1;
-  this->Modified();
-}
-
-// ----------------------------------------------------------------------------
-void vtkLineIntegralConvolution2D::SetTransformVectors(int val)
-{
-  val = val < 0 ? 0 : val;
-  val = val > 1 ? 1 : val;
-  if (this->TransformVectors == val)
-    {
-    return;
-    }
-  this->TransformVectors = val;
-  this->ShadersNeedBuild = 1;
-  this->Modified();
-}
-
-// ----------------------------------------------------------------------------
-void vtkLineIntegralConvolution2D::SetNormalizeVectors(int val)
-{
-  val = val < 0 ? 0 : val;
-  val = val > 1 ? 1 : val;
-  if (this->NormalizeVectors == val)
-    {
-    return;
-    }
-  this->NormalizeVectors = val;
-  this->ShadersNeedBuild = 1;
-  this->Modified();
-}
-
-// ----------------------------------------------------------------------------
-void vtkLineIntegralConvolution2D::SetVTShader(vtkShaderProgram * prog)
-{
-  this->VTShader->Program = prog;
-}
-
-// ----------------------------------------------------------------------------
-void vtkLineIntegralConvolution2D::SetLIC0Shader(vtkShaderProgram * prog)
-{
-  this->LIC0Shader->Program = prog;
-}
-
-// ----------------------------------------------------------------------------
-void vtkLineIntegralConvolution2D::SetLICIShader(vtkShaderProgram * prog)
-{
-  this->LICIShader->Program = prog;
-}
-
-// ----------------------------------------------------------------------------
-void vtkLineIntegralConvolution2D::SetLICNShader(vtkShaderProgram * prog)
-{
-  this->LICNShader->Program = prog;
-}
-
-// ----------------------------------------------------------------------------
-void vtkLineIntegralConvolution2D::SetEEShader(vtkShaderProgram * prog)
-{
-  this->EEShader->Program = prog;
-}
-// ----------------------------------------------------------------------------
-void vtkLineIntegralConvolution2D::SetCEShader(vtkShaderProgram * prog)
-{
-  this->CEShader->Program = prog;
-}
-
-// ----------------------------------------------------------------------------
-void vtkLineIntegralConvolution2D::SetAAHShader(vtkShaderProgram * prog)
-{
-  this->AAHShader->Program = prog;
-}
-
-// ----------------------------------------------------------------------------
-void vtkLineIntegralConvolution2D::SetAAVShader(vtkShaderProgram * prog)
-{
-  this->AAVShader->Program = prog;
-}
-
-namespace {
-  void BuildAShader(vtkOpenGLRenderWindow *renWin,
-    vtkOpenGLHelper **cbor, const char *frag)
-  {
-  if (*cbor == NULL)
-    {
-    *cbor = new vtkOpenGLHelper;
-    std::string VSSource = vtkTextureObjectVS;
-    std::string GSSource;
-    (*cbor)->Program =
-        renWin->GetShaderCache()->ReadyShaderProgram(VSSource.c_str(),
-                                              frag,
-                                              GSSource.c_str());
-    }
-  else
-    {
-    renWin->GetShaderCache()->ReadyShaderProgram((*cbor)->Program);
-    }
-  }
-}
-
-// ----------------------------------------------------------------------------
-void vtkLineIntegralConvolution2D::BuildShaders()
-{
-  vtkOpenGLRenderWindow *renWin = this->Context;
-
-  std::string FSSource = vtkLineIntegralConvolution2D_VT;
-  vtkShaderProgram::Substitute(FSSource,"//VTK::LICComponentSelection::Impl",
-    "vec2 V = texture2D(texVectors, tcoordVC.st)" +
-    GetComponentSelectionProgram(this->ComponentIds) + ";"
-    );
-  BuildAShader(renWin, &this->VTShader,
-    FSSource.c_str());
-
-  BuildAShader(renWin, &this->LIC0Shader,
-    vtkLineIntegralConvolution2D_LIC0);
-
-  FSSource = vtkLineIntegralConvolution2D_LICI;
-  vtkShaderProgram::Substitute(FSSource,"//VTK::LICVectorLookup::Impl",
-    GetVectorLookupProgram(this->NormalizeVectors)
-    );
-  BuildAShader(renWin, &this->LICIShader,
-    FSSource.c_str());
-
-  BuildAShader(renWin, &this->LICNShader,
-    vtkLineIntegralConvolution2D_LICN);
-  BuildAShader(renWin, &this->EEShader,
-    vtkLineIntegralConvolution2D_EE);
-  BuildAShader(renWin, &this->CEShader,
-    vtkLineIntegralConvolution2D_CE);
-  BuildAShader(renWin, &this->AAHShader,
-    vtkLineIntegralConvolution2D_AAH);
-  BuildAShader(renWin, &this->AAVShader,
-    vtkLineIntegralConvolution2D_AAV);
-}
-
-// ----------------------------------------------------------------------------
-vtkPainterCommunicator *vtkLineIntegralConvolution2D::GetCommunicator()
-{
-  if (this->Comm == NULL)
-    {
-    this->Comm = new vtkPainterCommunicator;
-    }
-  return this->Comm;
-}
-
-// ----------------------------------------------------------------------------
-vtkTextureObject *vtkLineIntegralConvolution2D::Execute(
-        vtkTextureObject *vectorTex,
-        vtkTextureObject *noiseTex)
-{
-  // execute over the entire vector field, no guard pixels are present
-  // parallel results will be incorrect.
-
-  vtkPixelExtent vectorTexExtent(
-        vectorTex->GetWidth(),
-        vectorTex->GetHeight());
-
-  return this->Execute(
-        vectorTexExtent.GetData(),
-        vectorTex,
-        noiseTex);
-}
-
-// ----------------------------------------------------------------------------
-vtkTextureObject *vtkLineIntegralConvolution2D::Execute(
-      const int ext[4],
-      vtkTextureObject *vectorTex,
-      vtkTextureObject *noiseTex)
-{
-  // execute over a subset of the input texture, no guard pixels are present
-  // composite data and parallel results will be incorrect.
-
-  this->SetVectorTexParameters(vectorTex);
-  this->SetNoiseTexParameters(noiseTex);
-
-  vtkPixelExtent vectorTexExtent(vectorTex->GetWidth(), vectorTex->GetHeight());
-  vtkPixelExtent vectorExtent(ext);
-  vtkPixelExtent licExtent(ext);
-  vtkPixelExtent outputTexExtent(ext);
-  vtkPixelExtent outputExtent(ext);
-
-  deque<vtkPixelExtent> vectorExtents;
-  vectorExtents.push_back(vectorExtent);
-
-  deque<vtkPixelExtent> licExtents;
-  licExtents.push_back(licExtent);
-
-  unsigned int licSize[2];
-  licExtent.Size(licSize);
-
-  return this->Execute(
-        vectorTexExtent,
-        vectorExtents,
-        licExtents,
-        vectorTex,
-        NULL,
-        noiseTex);
-}
-
-// ----------------------------------------------------------------------------
-vtkTextureObject *vtkLineIntegralConvolution2D::Execute(
-      const vtkPixelExtent &inputTexExtent,              // screen space extent of the input texture
-      const deque<vtkPixelExtent> &vectorExtents,        // disjoint set describing vector extents
-      const deque<vtkPixelExtent> &licExtents,           // disjoint set describing desired lic extents
-      vtkTextureObject *vectorTex,
-      vtkTextureObject *maskVectorTex,
-      vtkTextureObject *noiseTex)
-{
-  // validate inputs, internal state, etc...
-  if (!this->Context)
-    {
-    vtkErrorMacro("invalid this->Context");
-    return NULL;
-    }
-  if (this->NumberOfSteps < 0)
-    {
-    vtkErrorMacro("Number of integration steps should be positive.");
-    return NULL;
-    }
-  if (this->StepSize < 0.0)
-    {
-    vtkErrorMacro("Streamline integration step size should be positive.");
-    return NULL;
-    }
-  if (vectorTex->GetComponents() < 2)
-    {
-    vtkErrorMacro("VectorField must have at least 2 components.");
-    return NULL;
-    }
-
-  #if defined(vtkLineIntegralConvolution2DTIME) && !defined(vtkSurfaceLICPainterTIME)
-  this->StartTimerEvent("vtkLineIntegralConvolution::Execute");
-  #elif defined(USE_VTK_TIMER)
-  vtkSmartPointer<vtkTimerLog> timer = vtkSmartPointer<vtkTimerLog>::New();
-  timer->StartTimer();
-  #endif
-
-  vtkOpenGLRenderWindow *renWin = this->Context;
-  // initialize shaders
-  if (this->ShadersNeedBuild)
-    {
-    this->BuildShaders();
-    this->ShadersNeedBuild = 0;
-    }
-
-  // input
-  unsigned int inputTexSize[2];
-  inputTexExtent.Size(inputTexSize);
-
-  float dx = 1.0f/((float)inputTexSize[0]);
-  float dy = 1.0f/((float)inputTexSize[1]);
-
-  // texture coordinates and bounds for compute regions
-  unsigned int computeTexSize[2];
-  inputTexExtent.Size(computeTexSize);
-
-  // at slight expense to the serial case
-  // compute LIC,EE, and AA over the entire vector
-  // extents (this is why it's critical that they
-  // are disjoint)this allows us to forgo expensive
-  // halo exchanges when running in parallel.
-  size_t nComputeExtents1 = vectorExtents.size();
-  const deque<vtkPixelExtent> &computeExtents1 = vectorExtents;
-
-  size_t nbds = 4*nComputeExtents1;
-  vector<float> computeBounds1(nbds, 0.0f);
-  for (size_t i=0; i<nComputeExtents1; ++i)
-    {
-    const vtkPixelExtent &computeExtent1 = computeExtents1[i];
-    float *bound = &computeBounds1[4*i];
-    bound[0] = ((float)computeExtent1[0])/((float)inputTexSize[0]);
-    bound[1] = ((float)computeExtent1[1]+1.0f)/((float)inputTexSize[0]);
-    bound[2] = ((float)computeExtent1[2])/((float)inputTexSize[1]);
-    bound[3] = ((float)computeExtent1[3]+1.0f)/((float)inputTexSize[1]);
-    }
-
-  // for CE only compute on valid extents
-  // because there is bleeding at the extent
-  // edges that will result in correct scaling
-  // if it's used.
-  size_t nComputeExtents2 = licExtents.size();
-  const deque<vtkPixelExtent> &computeExtents2 = licExtents;
-
-  nbds = 4*nComputeExtents2;
-  vector<float> computeBounds2(nbds, 0.0f);
-
-  for (size_t i=0; i<nComputeExtents2; ++i)
-    {
-    const vtkPixelExtent &computeExtent2 = computeExtents2[i];
-    float *bound = &computeBounds2[4*i];
-    bound[0] = ((float)computeExtent2[0])/((float)inputTexSize[0]);
-    bound[1] = ((float)computeExtent2[1]+1.0f)/((float)inputTexSize[0]);
-    bound[2] = ((float)computeExtent2[2])/((float)inputTexSize[1]);
-    bound[3] = ((float)computeExtent2[3]+1.0f)/((float)inputTexSize[1]);
-    }
-
-  // during integration texture coordinates for
-  // noise lookup is computed using the vector
-  // texture coordinate this ensures that on any
-  // rank we get the same noise value
-  unsigned int noiseTexSize[2] = {
-        noiseTex->GetWidth(),
-        noiseTex->GetHeight()
-        };
-
-  vtkPixelExtent noiseExtent(noiseTexSize[0], noiseTexSize[1]);
-
-  float noiseBoundsPt1[2];
-  noiseBoundsPt1[0] = ((float)noiseTexSize[0]+1.0f)/((float)inputTexSize[0]);
-  noiseBoundsPt1[1] = ((float)noiseTexSize[1]+1.0f)/((float)inputTexSize[1]);
-
-  // bind our fbo
-  this->FBO->SaveCurrentBindings();
-  this->FBO->Bind(GL_FRAMEBUFFER);
-  this->FBO->InitializeViewport(computeTexSize[0], computeTexSize[1]);
-
-  // initialize the buffer mananger. Textures are assigned
-  // and bound to individual units. These textures and units
-  // are active and bound for the remainder of this execution.
-  vtkLICPingPongBufferManager bufs(
-        this->FBO,
-        computeTexSize,
-        vectorTex,
-        maskVectorTex,
-        noiseTex,
-        this->EnhancedLIC,
-        this->TransformVectors);
-
-  #if  vtkLineIntegralConvolution2DDEBUG >= 1
-  int rank = this->GetCommunicator()->GetRank();
-  #endif
-  #if vtkLineIntegralConvolution2DDEBUG >= 3
-  bufs.WriteInputs(rank, vectorExtents);
-  #endif
-
-  if (this->TransformVectors)
-    {
-    // ------------------------------------------- begin normalized image space transform
-    #if defined(vtkLineIntegralConvolution2DTIME)
-    this->StartTimerEvent("vtkLineIntegralConvolution::TransformVectors");
-    #endif
-
-    renWin->GetShaderCache()->ReadyShaderProgram(this->VTShader->Program);
-    bufs.AttachImageVectorBuffer(this->FBO);
-
-    float fTexSize[2];
-    fTexSize[0] = inputTexSize[0];
-    fTexSize[1] = inputTexSize[1];
-    this->VTShader->Program->SetUniform2f("uTexSize", fTexSize);
-    this->VTShader->Program->SetUniformi("texVectors", bufs.GetVectorTextureUnit());
-    vtkOpenGLCheckErrorMacro("failed");
-    // essential to initialize the entire buffer
-    glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
-    vtkOpenGLCheckErrorMacro("failed");
-    glClear(GL_COLOR_BUFFER_BIT);
-    vtkOpenGLCheckErrorMacro("failed");
-    size_t nVectorExtents = vectorExtents.size();
-    for (size_t q=0; q<nVectorExtents; ++q)
-      {
-      bufs.RenderQuad(&computeBounds1[4*q], computeExtents1[q],
-        this->VTShader);
-    vtkOpenGLCheckErrorMacro("failed");
-      }
-    bufs.DettachImageVectorBuffer(this->FBO);
-    vtkOpenGLCheckErrorMacro("failed");
-
-    #if (vtkLineIntegralConvolution2DDEBUG >= 2)
-    bufs.WriteImageVectorBuffer(rank, vectorExtents);
-    #endif
-
-    #if defined(vtkLineIntegralConvolution2DTIME)
-    this->EndTimerEvent("vtkLineIntegralConvolution::TransformVectors");
-    #endif
-    // ------------------------------------------- end normalized image space transform
-    }
-
-  // --------------------------------------------- begin first-pass LIC
-  #if defined(vtkLineIntegralConvolution2DTIME)
-  this->StartTimerEvent("vtkLineIntegralConvolution::Integrate1");
-  #endif
-
-  //
-  // initialize convolution and seeds
-  //
-  bufs.ClearBuffers(this->FBO, inputTexExtent, vectorExtents, this->EnhancedLIC);
-  bufs.AttachVectorTextures();
-  bufs.AttachNoiseTexture(0);
-  bufs.AttachLICBuffers(this->FBO);
-
-  renWin->GetShaderCache()->ReadyShaderProgram(this->LIC0Shader->Program);
-  this->LIC0Shader->Program->SetUniformi("uStepNo", 0);
-  this->LIC0Shader->Program->SetUniformi("uPassNo", 0);
-  this->LIC0Shader->Program->SetUniformf("uMaskThreshold", this->MaskThreshold);
-  this->LIC0Shader->Program->SetUniform2f("uNoiseBoundsPt1", noiseBoundsPt1);
-    vtkOpenGLStaticCheckErrorMacro("failed at RenderQuad");
-  this->LIC0Shader->Program->SetUniformi("texMaskVectors", bufs.GetMaskVectorTextureUnit());
-    vtkOpenGLStaticCheckErrorMacro("failed at RenderQuad");
-  this->LIC0Shader->Program->SetUniformi("texNoise", bufs.GetNoiseTextureUnit(0));
-    vtkOpenGLStaticCheckErrorMacro("failed at RenderQuad");
-  this->LIC0Shader->Program->SetUniformi("texLIC", bufs.GetLICTextureUnit());
-    vtkOpenGLStaticCheckErrorMacro("failed at RenderQuad");
-
-  for (size_t q=0; q<nComputeExtents1; ++q)
-    {
-    bufs.RenderQuad(&computeBounds1[4*q], computeExtents1[q],
-      this->LIC0Shader);
-    }
-  bufs.DettachLICBuffers(this->FBO);
-  bufs.Swap();
-
-  #if (vtkLineIntegralConvolution2DDEBUG >= 2)
-  bufs.WriteBuffers(rank,"lic2d_lic0b_a.vtm","lic2d_lic0b_s.vtm",computeExtents1);
-  #endif
-
-  //
-  // backward LIC
-  //
-  renWin->GetShaderCache()->ReadyShaderProgram(this->LICIShader->Program);
-  this->LICIShader->Program->SetUniformi("uPassNo", 0);
-  this->LICIShader->Program->SetUniformf("uStepSize", -this->StepSize);
-  this->LICIShader->Program->SetUniform2f("uNoiseBoundsPt1", noiseBoundsPt1);
-  this->LICIShader->Program->SetUniformi("texVectors",
-    bufs.GetImageVectorTextureUnit());
-  this->LICIShader->Program->SetUniformi("texNoise", bufs.GetNoiseTextureUnit(0));
-
-  int stepNum = 0;
-  for (int stepIdx=0; stepIdx<this->NumberOfSteps; ++stepIdx, ++stepNum)
-    {
-    bufs.AttachLICBuffers(this->FBO);
-    this->LICIShader->Program->SetUniformi("texLIC", bufs.GetLICTextureUnit());
-    this->LICIShader->Program->SetUniformi("texSeedPts", bufs.GetSeedTextureUnit());
-    for (size_t q=0; q<nComputeExtents1; ++q)
-      {
-      bufs.RenderQuad(&computeBounds1[4*q], computeExtents1[q],
-        this->LICIShader);
-      }
-    bufs.DettachLICBuffers(this->FBO);
-    bufs.Swap();
-    }
-
-  #if (vtkLineIntegralConvolution2DDEBUG >= 2)
-  bufs.WriteBuffers(rank,"lic2d_licib_a.vtm", "lic2d_licib_s.vtm", computeExten ts1);
-  #endif
-
-  // initialize seeds
-  //
-  renWin->GetShaderCache()->ReadyShaderProgram(this->LIC0Shader->Program);
-  this->LIC0Shader->Program->SetUniformi("uStepNo", 1);
-
-  bufs.AttachLICBuffers(this->FBO);
-  for (size_t q=0; q<nComputeExtents1; ++q)
-    {
-    bufs.RenderQuad(&computeBounds1[4*q], computeExtents1[q],
-      this->LIC0Shader);
-    }
-  bufs.DettachLICBuffers(this->FBO);
-  bufs.Swap();
-
-  #if (vtkLineIntegralConvolution2DDEBUG >= 2)
-  bufs.WriteBuffers(rank,"lic2d_lic0f_a.vtm", "lic2d_lic0f_s.vtm", computeExtents1);
-  #endif
-
-  //
-  // forward LIC
-  //
-  renWin->GetShaderCache()->ReadyShaderProgram(this->LICIShader->Program);
-  this->LICIShader->Program->SetUniformf("uStepSize", this->StepSize);
-
-  for (int stepIdx=0; stepIdx<this->NumberOfSteps; ++stepIdx, ++stepNum)
-    {
-    bufs.AttachLICBuffers(this->FBO);
-    this->LICIShader->Program->SetUniformi("texLIC", bufs.GetLICTextureUnit());
-    this->LICIShader->Program->SetUniformi("texSeedPts", bufs.GetSeedTextureUnit());
-    for (size_t q=0; q<nComputeExtents1; ++q)
-      {
-      bufs.RenderQuad(&computeBounds1[4*q], computeExtents1[q],
-        this->LICIShader);
-      }
-    bufs.DettachLICBuffers(this->FBO);
-    bufs.Swap();
-    }
-
-  #if (vtkLineIntegralConvolution2DDEBUG >= 2)
-  bufs.WriteBuffers(rank,"lic2d_licif_a.vtm", "lic2d_licif_s.vtm", computeExtents1);
-  #endif
-
-  // finally done with Noise Texture 0
-  bufs.DettachNoiseTexture(0);
-  bufs.DettachVectorTextures();
-
-  //
-  // finalize LIC
-  //
-  renWin->GetShaderCache()->ReadyShaderProgram(this->LICNShader->Program);
-  this->LICNShader->Program->SetUniformi("texLIC", bufs.GetLICTextureUnit());
-
-  bufs.AttachLICBuffers(this->FBO);
-  this->LICNShader->Program->SetUniformi("texLIC", bufs.GetLICTextureUnit());
-  this->LICNShader->Program->SetUniformi("texSeedPts", bufs.GetSeedTextureUnit());
-  for (size_t q=0; q<nComputeExtents1; ++q)
-    {
-    bufs.RenderQuad(&computeBounds1[4*q], computeExtents1[q],
-      this->LICNShader);
-    }
-  bufs.DettachBuffers(this->FBO);
-  bufs.Swap();
-
-  #if (vtkLineIntegralConvolution2DDEBUG >= 1)
-  bufs.WriteBuffers(rank,"lic2d_licn_a.vtm", "lic2d_licn_s.vtm", computeExtents1);
-  #endif
-
-  #if defined(vtkLineIntegralConvolution2DTIME)
-  this->EndTimerEvent("vtkLineIntegralConvolution::Integrate1");
-  #endif
-
-  // ----------------------------------------------- end first-pass LIC
-  if (this->EnhancedLIC)
-    {
-    if (this->EnhanceContrast == ENHANCE_CONTRAST_ON)
-      {
-      // ------------------------------------------- begin contrast enhance
-      #if defined(vtkLineIntegralConvolution2DTIME) || defined(vtkSurfaceLICPainterTIME)
-      this->StartTimerEvent("vtkLineIntegralConvolution::ContrastEnhance1");
-      #endif
-
-      vtkPainterCommunicator *comm = this->GetCommunicator();
-
-      // find the min and max only on the valid extents
-      // because there will be bleeding at the edges.
-      float grayMin = VTK_FLOAT_MAX;
-      float grayMax = -VTK_FLOAT_MAX;
-      float grayMaxMinDiff = VTK_FLOAT_MAX;
-      vtkTextureObject *licTex = bufs.GetLastLICBuffer();
-      #ifdef STREAMING_MIN_MAX
-      StreamingFindMinMax(this->FBO, licTex, computeExtents2, grayMin, grayMax);
-      #else
-      FindMinMax(licTex, computeExtents2, grayMin, grayMax);
-      #endif
-
-      if ( computeExtents2.size()
-        && ((grayMax <= grayMin) || (grayMax > 1.0f) || (grayMin < 0.0f)) )
-        {
-        vtkErrorMacro(
-          << comm->GetRank()
-          << " : Invalid color range " << grayMin << ", " << grayMax
-          << ". Normlaization pass skipped");
-        grayMin = 0.0;
-        grayMax = 1.0;
-        }
-
-      // in parallel use a reduction to obtain the image
-      // wide min/max
-      this->GetGlobalMinMax(comm, grayMin, grayMax);
-
-      // its critical to update on the entire extent to
-      //ensure correct values in the guard pixles because
-      // we don't do a halo exchange
-      grayMaxMinDiff = grayMax-grayMin;
-
-      renWin->GetShaderCache()->ReadyShaderProgram(this->CEShader->Program);
-      this->CEShader->Program->SetUniformi("texLIC", bufs.GetLICTextureUnit());
-      this->CEShader->Program->SetUniformf("uMin", grayMin );
-      this->CEShader->Program->SetUniformf("uMaxMinDiff", grayMaxMinDiff);
-
-      bufs.AttachLICBuffers(this->FBO);
-      for (size_t q=0; q<nComputeExtents1; ++q)
-        {
-        bufs.RenderQuad(&computeBounds1[4*q], computeExtents1[q],
-          this->CEShader);
-        }
-      bufs.DettachLICBuffers(this->FBO);
-      bufs.Swap();
-
-      #if (vtkLineIntegralConvolution2DDEBUG >= 1)
-      bufs.WriteBuffers(rank,"lic2d_1ce.vtm", NULL, computeExtents1);
-      #endif
-
-      #if defined(vtkLineIntegralConvolution2DTIME) || defined(vtkSurfaceLICPainterTIME)
-      this->EndTimerEvent("vtkLineIntegralConvolution::ContrastEnhance1");
-      #endif
-      // --------------------------------------------- end contrast enhance
-      }
-
-    // --------------------------------------------- begin high-pass filtering
-    #if defined(vtkLineIntegralConvolution2DTIME)
-    this->StartTimerEvent("vtkLineIntegralConvolution::EdgeEnahnce");
-    #endif
-
-    #ifdef INTEL_BUG
-    bufs.AttachEEBuffer(this->FBO);
-    #endif
-
-    renWin->GetShaderCache()->ReadyShaderProgram(this->EEShader->Program);
-    this->EEShader->Program->SetUniformi("texLIC", bufs.GetLICTextureUnit());
-    this->EEShader->Program->SetUniformf("uDx", dx);
-    this->EEShader->Program->SetUniformf("uDy", dy);
-
-    #ifndef INTEL_BUG
-    bufs.AttachEEBuffer(this->FBO);
-    #endif
-    for (size_t q=0; q<nComputeExtents1; ++q)
-      {
-      bufs.RenderQuad(&computeBounds1[4*q], computeExtents1[q],
-        this->EEShader);
-      }
-    bufs.DettachEEBuffer(this->FBO);
-
-    #if (vtkLineIntegralConvolution2DDEBUG >= 1)
-    bufs.WriteEEBuffer(rank, computeExtents1);
-    #endif
-
-    #if defined(vtkLineIntegralConvolution2DTIME)
-    this->EndTimerEvent("vtkLineIntegralConvolution::EdgeEnahnce");
-    #endif
-    // --------------------------------------------- end high-pass filtering
-
-    // --------------------------------------------- begin second-pass LIC
-    #if defined(vtkLineIntegralConvolution2DTIME)
-    this->StartTimerEvent("vtkLineIntegralConvolution::Integrate2");
-    #endif
-
-    // in pass 2 lic is comuted by convolving edge-enhanced result of pass 1
-    // rather than noise. This gives the result a nice smooth look, since the
-    // input is fairly smooth fewer steps are needed.
-
-    // clear the buffers
-    bufs.DettachBuffers(this->FBO);
-    bufs.ClearBuffers(this->FBO, inputTexExtent, vectorExtents, /*clearEE=*/0);
-    bufs.AttachVectorTextures();
-    bufs.AttachNoiseTexture(1);
-
-    //
-    // initialize convolution and seeds
-    //
-    renWin->GetShaderCache()->ReadyShaderProgram(this->LIC0Shader->Program);
-    this->LIC0Shader->Program->SetUniformi("uStepNo", 0);
-    this->LIC0Shader->Program->SetUniformi("uPassNo", 1);
-
-    bufs.AttachLICBuffers(this->FBO);
-    this->LIC0Shader->Program->SetUniformi("texLIC", bufs.GetLICTextureUnit());
-    this->LIC0Shader->Program->SetUniformi("texSeedPts", bufs.GetSeedTextureUnit());
-    this->LIC0Shader->Program->SetUniformi("texNoise", bufs.GetNoiseTextureUnit(1));
-    for (size_t q=0; q<nComputeExtents1; ++q)
-      {
-      bufs.RenderQuad(&computeBounds1[4*q], computeExtents1[q],
-        this->LIC0Shader);
-      }
-    bufs.DettachLICBuffers(this->FBO);
-    bufs.Swap();
-
-    #if (vtkLineIntegralConvolution2DDEBUG >= 2)
-    bufs.WriteBuffers(rank,"lic2d_elic0b_a.vtm", "lic2d_elic0b_s.vtm", computeExtents1);
-    #endif
-
-    //
-    // backward LIC
-    //
-    renWin->GetShaderCache()->ReadyShaderProgram(this->LICIShader->Program);
-    this->LICIShader->Program->SetUniformi("uPassNo", 1);
-    this->LICIShader->Program->SetUniformf("uStepSize", -this->StepSize);
-    this->LICIShader->Program->SetUniformi("texNoise", bufs.GetNoiseTextureUnit(1));
-
-    int nSteps = this->NumberOfSteps/2;
-    stepNum = 0;
-    for (int stepIdx=0; stepIdx<nSteps; ++stepIdx, ++stepNum)
-      {
-      bufs.AttachLICBuffers(this->FBO);
-      this->LICIShader->Program->SetUniformi("texLIC", bufs.GetLICTextureUnit());
-      this->LICIShader->Program->SetUniformi("texSeedPts", bufs.GetSeedTextureUnit());
-      for (size_t q=0; q<nComputeExtents1; ++q)
-        {
-        bufs.RenderQuad(&computeBounds1[4*q], computeExtents1[q],
-          this->LICIShader);
-        }
-      bufs.DettachLICBuffers(this->FBO);
-      bufs.Swap();
-      }
-
-    #if (vtkLineIntegralConvolution2DDEBUG >=2 )
-    bufs.WriteBuffers(rank,"lic2d_elicib_a.vtm", "lic2d_elicib_s.vtm",computeExtents1);
-    #endif
-
-    //
-    // initialize seeds
-    //
-    renWin->GetShaderCache()->ReadyShaderProgram(this->LIC0Shader->Program);
-    this->LIC0Shader->Program->SetUniformi("uStepNo", 1);
-
-    bufs.AttachLICBuffers(this->FBO);
-    this->LIC0Shader->Program->SetUniformi("texLIC", bufs.GetLICTextureUnit());
-    this->LIC0Shader->Program->SetUniformi("texSeedPts", bufs.GetSeedTextureUnit());
-    for (size_t q=0; q<nComputeExtents1; ++q)
-      {
-      bufs.RenderQuad(&computeBounds1[4*q], computeExtents1[q],
-        this->LIC0Shader);
-      }
-    bufs.DettachLICBuffers(this->FBO);
-    bufs.Swap();
-
-    #if (vtkLineIntegralConvolution2DDEBUG >= 2)
-    bufs.WriteBuffers(rank,"lic2d_elic0f_a.vtm", "lic2d_elic0f_s.vtm",computeExtents1);
-    #endif
-
-    //
-    // forward LIC
-    //
-    renWin->GetShaderCache()->ReadyShaderProgram(this->LICIShader->Program);
-    this->LICIShader->Program->SetUniformf("uStepSize", this->StepSize);
-
-    for (int stepIdx=0; stepIdx<nSteps; ++stepIdx, ++stepNum)
-      {
-      bufs.AttachLICBuffers(this->FBO);
-      this->LICIShader->Program->SetUniformi("texLIC", bufs.GetLICTextureUnit());
-      this->LICIShader->Program->SetUniformi("texSeedPts", bufs.GetSeedTextureUnit());
-      for (size_t q=0; q<nComputeExtents1; ++q)
-        {
-        bufs.RenderQuad(&computeBounds1[4*q], computeExtents1[q],
-          this->LICIShader);
-        }
-      bufs.DettachLICBuffers(this->FBO);
-      bufs.Swap();
-      }
-
-    #if (vtkLineIntegralConvolution2DDEBUG >= 2)
-    bufs.WriteBuffers(rank,"lic2d_elicif_a.vtm", "lic2d_elicif_s.vtm",computeExtents1);
-    #endif
-
-    // finally done with noise tyexture 1
-    bufs.DettachNoiseTexture(1);
-    bufs.DettachVectorTextures();
-
-    //
-    // finalize LIC
-    //
-    renWin->GetShaderCache()->ReadyShaderProgram(this->LICNShader->Program);
-    this->LICNShader->Program->SetUniformi("texLIC", bufs.GetLICTextureUnit());
-
-    bufs.AttachLICBuffers(this->FBO);
-    this->LICNShader->Program->SetUniformi("texLIC", bufs.GetLICTextureUnit());
-    this->LICNShader->Program->SetUniformi("texSeedPts", bufs.GetSeedTextureUnit());
-    for (size_t q=0; q<nComputeExtents1; ++q)
-      {
-      bufs.RenderQuad(&computeBounds1[4*q], computeExtents1[q],
-        this->LICNShader);
-      }
-    bufs.DettachLICBuffers(this->FBO);
-    bufs.Swap();
-
-    #if (vtkLineIntegralConvolution2DDEBUG >= 1)
-    bufs.WriteBuffers(rank,"lic2d_elicn_a.vtm", "lic2d_elicn_s.vtm",computeExtents1);
-    #endif
-
-    #if defined(vtkLineIntegralConvolution2DTIME)
-    this->EndTimerEvent("vtkLineIntegralConvolution::Integrate2");
-    #endif
-    // --------------------------------------------- end second-pass LIC
-    }
-
-  if (this->AntiAlias)
-    {
-    // --------------------------------------------- begin anti-alias
-
-    #if defined(vtkLineIntegralConvolution2DTIME)
-    this->StartTimerEvent("vtkLineIntegralConvolution::AntiAlias");
-    #endif
-
-    renWin->GetShaderCache()->ReadyShaderProgram(this->AAHShader->Program);
-    this->AAHShader->Program->SetUniformi("texLIC", bufs.GetLICTextureUnit());
-    this->AAHShader->Program->SetUniformf("uDx", dx);
-
-    renWin->GetShaderCache()->ReadyShaderProgram(this->AAVShader->Program);
-    this->AAVShader->Program->SetUniformi("texLIC", bufs.GetLICTextureUnit());
-    this->AAVShader->Program->SetUniformf("uDy", dy);
-
-    // it's ok to compute over just the valid extent
-    // we don't care here if guard pixels are smoothed
-    // however computing over the entire extent avoids
-    // bleeding at the edges when multiple passes are
-    // requested.
-    for (int i=0; i<this->AntiAlias; ++i)
-      {
-      // horizontal pass
-      renWin->GetShaderCache()->ReadyShaderProgram(this->AAHShader->Program);
-      bufs.AttachLICBuffers(this->FBO);
-      this->AAHShader->Program->SetUniformi("texLIC", bufs.GetLICTextureUnit());
-      this->AAHShader->Program->SetUniformi("texSeedPts", bufs.GetSeedTextureUnit());
-      for (size_t q=0; q<nComputeExtents1; ++q)
-        {
-        bufs.RenderQuad(&computeBounds1[4*q], computeExtents1[q],
-          this->AAHShader);
-        }
-      bufs.DettachLICBuffers(this->FBO);
-      bufs.Swap();
-
-      // vertical pass
-      renWin->GetShaderCache()->ReadyShaderProgram(this->AAVShader->Program);
-      bufs.AttachLICBuffers(this->FBO);
-      this->AAVShader->Program->SetUniformi("texLIC", bufs.GetLICTextureUnit());
-      this->AAVShader->Program->SetUniformi("texSeedPts", bufs.GetSeedTextureUnit());
-      for (size_t q=0; q<nComputeExtents1; ++q)
-        {
-        bufs.RenderQuad(&computeBounds1[4*q], computeExtents1[q],
-          this->AAVShader);
-        }
-      bufs.DettachLICBuffers(this->FBO);
-      bufs.Swap();
-      }
-
-    #if (vtkLineIntegralConvolution2DDEBUG >= 1)
-    bufs.WriteBuffers(rank,"lic2d_aa.vtm", NULL, computeExtents1);
-    #endif
-
-    #if defined(vtkLineIntegralConvolution2DTIME)
-    this->EndTimerEvent("vtkLineIntegralConvolution::AntiAlias");
-    #endif
-    // --------------------------------------------- end anti-alias
-    }
-
-  if (this->EnhanceContrast)
-    {
-    // ------------------------------------------- begin contrast enhance
-    #if defined(vtkLineIntegralConvolution2DTIME) || defined(vtkSurfaceLICPainterTIME)
-    this->StartTimerEvent("vtkLineIntegralConvolution::ContrastEnhance2");
-    #endif
-
-    vtkPainterCommunicator *comm = this->GetCommunicator();
-
-    // the final contrast enhancement should
-    // be applied only to the valid extents
-    float grayMin = VTK_FLOAT_MAX;
-    float grayMax = -VTK_FLOAT_MAX;
-    float grayMaxMinDiff = 1.0f;
-
-    vtkTextureObject *licTex = bufs.GetLastLICBuffer();
-    #ifdef STREAMING_MIN_MAX
-    StreamingFindMinMax(this->FBO, licTex, computeExtents2, grayMin, grayMax);
-    #else
-    FindMinMax(licTex, computeExtents2, grayMin, grayMax);
-    #endif
-
-    if ( computeExtents2.size()
-      && ((grayMax <= grayMin) || (grayMax > 1.0f) || (grayMin < 0.0f)) )
-      {
-      vtkErrorMacro(
-        << comm->GetRank()
-        << " : Invalid intensity range " << grayMin << ", " << grayMax
-        << "for contrast ehancement");
-      grayMin = 0.0;
-      grayMax = 1.0;
-      }
-
-    // in parallel use a reduction to obtain the image
-    // wide min/max
-    //this->GetGlobalMinMax(comm, grayMin, grayMax);
-
-    // select M and m as a fraction of the range.
-    grayMaxMinDiff = grayMax-grayMin;
-    grayMin += grayMaxMinDiff*this->LowContrastEnhancementFactor;
-    grayMax -= grayMaxMinDiff*this->HighContrastEnhancementFactor;
-    grayMaxMinDiff = grayMax-grayMin;
-
-    renWin->GetShaderCache()->ReadyShaderProgram(this->CEShader->Program);
-    this->CEShader->Program->SetUniformi("texLIC", bufs.GetLICTextureUnit());
-    this->CEShader->Program->SetUniformf("uMin", grayMin );
-    this->CEShader->Program->SetUniformf("uMaxMinDiff", grayMaxMinDiff);
-
-    bufs.AttachLICBuffers(this->FBO);
-    for (size_t q=0; q<nComputeExtents2; ++q)
-      {
-      bufs.RenderQuad(&computeBounds2[4*q], computeExtents2[q],
-        this->CEShader);
-      }
-    bufs.DettachLICBuffers(this->FBO);
-    bufs.Swap();
-
-    #if (vtkLineIntegralConvolution2DDEBUG >= 1)
-    bufs.WriteBuffers(rank,"lic2d_2ce.vtm", NULL, computeExtents2);
-    #endif
-
-    #if defined(vtkLineIntegralConvolution2DTIME) || defined(vtkSurfaceLICPainterTIME)
-    this->EndTimerEvent("vtkLineIntegralConvolution::ContrastEnhance2");
-    #endif
-
-    // --------------------------------------------- end contrast enahnce
-    }
-
-  bufs.DettachBuffers(this->FBO);
-  this->FBO->UnBind(GL_FRAMEBUFFER);
-
-  vtkTextureObject *outputTex = bufs.GetLastLICBuffer();
-  outputTex->Register(0);
-
-  #if defined(vtkLineIntegralConvolution2DTIME) && !defined(vtkSurfaceLICPainterTIME)
-  this->EndTimerEvent("vtkLineIntegralConvolution::Execute");
-  #elif defined(USE_VTK_TIMER)
-  timer->StopTimer();
-  #endif
-
-  return outputTex;
-}
-
-//-----------------------------------------------------------------------------
-void vtkLineIntegralConvolution2D::PrintSelf(ostream & os, vtkIndent indent)
-{
-  this->Superclass::PrintSelf(os, indent);
-  os
-//    << indent << "Comm=" << this->Comm << endl
-    << indent << "Context=" << this->Context << endl
-    << indent << "FBO=" << this->FBO << endl
-    << indent << "ShadersNeedBuild=" << this->ShadersNeedBuild << endl
-    << indent << "VTShader=" << this->VTShader << endl
-    << indent << "LIC0Shader=" << this->LIC0Shader << endl
-    << indent << "LICIShader=" << this->LICIShader << endl
-    << indent << "LICNShader=" << this->LICNShader << endl
-    << indent << "EEShader=" << this->EEShader << endl
-    << indent << "CEShader=" << this->CEShader << endl
-    << indent << "AAHShader=" << this->AAHShader << endl
-    << indent << "AAVShader=" << this->AAVShader << endl
-    << indent << "NumberOfSteps=" << this->NumberOfSteps << endl
-    << indent << "StepSize=" << this->StepSize << endl
-    << indent << "EnhancedLIC=" << this->EnhancedLIC << endl
-    << indent << "EnhanceContrast=" << this->EnhanceContrast << endl
-    << indent << "LowContrastEnhancementFactor=" << this->LowContrastEnhancementFactor << endl
-    << indent << "HighContrastEnhancementFactor=" << this->HighContrastEnhancementFactor << endl
-    << indent << "AntiAlias=" << this->AntiAlias << endl
-    << indent << "MaskThreshold=" << this->MaskThreshold << endl
-    << indent << "TransformVectors=" << this->TransformVectors << endl
-    << indent << "NormalizeVectors=" << this->NormalizeVectors << endl
-    << indent << "ComponentIds=" << this->ComponentIds[0] << ", " << this->ComponentIds[1] << endl;
-}
diff --git a/Rendering/LICOpenGL2/vtkLineIntegralConvolution2D.h b/Rendering/LICOpenGL2/vtkLineIntegralConvolution2D.h
deleted file mode 100644
index ebf6aa8..0000000
--- a/Rendering/LICOpenGL2/vtkLineIntegralConvolution2D.h
+++ /dev/null
@@ -1,400 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkLineIntegralConvolution2D.h
-
-  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.
-
-=========================================================================*/
-// .NAME vtkLineIntegralConvolution2D - GPU-based implementation of Line
-//  Integral Convolution (LIC)
-//
-// .SECTION Description
-//  This class resorts to GLSL to implement GPU-based Line Integral Convolution
-//  (LIC) for visualizing a 2D vector field that may be obtained by projecting
-//  an original 3D vector field onto a surface (such that the resulting 2D
-//  vector at each grid point on the surface is tangential to the local normal,
-//  as done in vtkSurfaceLICPainter).
-//
-//  As an image-based technique, 2D LIC works by (1) integrating a bidirectional
-//  streamline from the center of each pixel (of the LIC output image), (2)
-//  locating the pixels along / hit by this streamline as the correlated pixels
-//  of the starting pixel (seed point / pixel), (3) indexing a (usually white)
-//  noise texture (another input to LIC, in addition to the 2D vector field,
-//  usually with the same size as that of the 2D vetor field) to determine the
-//  values (colors) of these pixels (the starting and the correlated pixels),
-//  typically through bi-linear interpolation, and (4) performing convolution
-//  (weighted averaging) on these values, by adopting a low-pass filter (such
-//  as box, ramp, and Hanning kernels), to obtain the result value (color) that
-//  is then assigned to the seed pixel.
-//
-//  The GLSL-based GPU implementation herein maps the aforementioned pipeline to
-//  fragment shaders and a box kernel is employed. Both the white noise and the
-//  vector field are provided to the GPU as texture objects (supported by the
-//  multi-texturing capability). In addition, there are four texture objects
-//  (color buffers) allocated to constitute two pairs that work in a ping-pong
-//  fashion, with one as the read buffers and the other as the write / render
-//  targets. Maintained by a frame buffer object (GL_EXT_framebuffer_object),
-//  each pair employs one buffer to store the current (dynamically updated)
-//  position (by means of the texture coordinate that keeps being warped by the
-//  underlying vector) of the (virtual) particle initially released from each
-//  fragment while using the bother buffer to store the current (dynamically
-//  updated too) accumulated texture value that each seed fragment (before the
-//  'mesh' is warped) collects. Given NumberOfSteps integration steps in each
-//  direction, there are a total of (2 * NumberOfSteps + 1) fragments (including
-//  the seed fragment) are convolved and each contributes 1 / (2 * NumberOfSteps
-//  + 1) of the associated texture value to fulfill the box filter.
-//
-//  One pass of LIC (basic LIC) tends to produce low-contrast / blurred images and
-//  vtkLineIntegralConvolution2D provides an option for creating enhanced LIC
-//  images. Enhanced LIC improves image quality by increasing inter-streamline
-//  contrast while suppressing artifacts. It performs two passes of LIC, with a
-//  3x3 Laplacian high-pass filter in between that processes the output of pass
-//  #1 LIC and forwards the result as the input 'noise' to pass #2 LIC.
-//
-//  vtkLineIntegralConvolution2D applies masking to zero-vector fragments so
-//  that un-filtered white noise areas are made totally transparent by class
-//  vtkSurfaceLICPainter to show the underlying geometry surface.
-//
-//  The convolution process tends to decrease both contrast and dynamic range,
-//  sometimes leading to dull dark images. In order to counteract this, optional
-//  contrast ehnancement stages have been added. These increase the dynamic range and
-//  contrast and sharpen streaking patterns that emerge from the LIC process.
-//
-//  Under some circumstances, typically depending on the contrast and dynamic
-//  range and graininess of the noise texture, jagged or pixelated patterns emerge
-//  in the LIC. These can be reduced by enabling the optional anti-aliasing pass.
-//
-//  The internal pipeline is as follows, with optional stages denoted by ()
-//  nested optional stages depend on their parent stage.
-//  <pre>
-//   noise texture
-//           |
-//           [ LIC ((CE) HPF LIC) (AA) (CE) ]
-//           |                              |
-//  vector field                       LIC'd image
-// </pre>
-//  where LIC is the LIC stage, HPF is the high-pass filter stage, CE is the
-//  contrast ehnacement stage, and AA is the antialias stage.
-//
-// .SECTION See Also
-//  vtkImageDataLIC2D vtkStructuredGridLIC2D
-
-#ifndef vtkLineIntegralConvolution2D_h
-#define vtkLineIntegralConvolution2D_h
-
-#include "vtkObject.h"
-#include "vtkWeakPointer.h" // for ren context
-#include "vtkRenderingLICOpenGL2Module.h" // for export macro
-#include <deque> // for deque
-
-class vtkFrameBufferObject2;
-class vtkOpenGLHelper;
-class vtkOpenGLRenderWindow;
-class vtkPainterCommunicator;
-class vtkPixelExtent;
-class vtkRenderWindow;
-class vtkShaderProgram;
-class vtkTextureObject;
-
-class VTKRENDERINGLICOPENGL2_EXPORT vtkLineIntegralConvolution2D : public vtkObject
-{
-public:
-  static vtkLineIntegralConvolution2D *New();
-  vtkTypeMacro(vtkLineIntegralConvolution2D, vtkObject);
-  void PrintSelf(ostream & os, vtkIndent indent);
-
-  // Description:
-  // Returns if the context supports the required extensions.
-  static bool IsSupported(vtkRenderWindow * renWin);
-
-  // Description:
-  // Set/Get the rendering context. A reference is not explicity held,
-  // thus refernce to the context must be held externally.
-  void SetContext(vtkOpenGLRenderWindow *context);
-  vtkOpenGLRenderWindow *GetContext();
-
-  // Description:
-  // EnhancedLIC mean compute the LIC twice with the second pass using
-  // the edge-enhanced result of the first pass as a noise texture. Edge
-  // enhancedment is made by a simple Laplace convolution.
-  vtkSetClampMacro(EnhancedLIC, int, 0, 1);
-  vtkGetMacro(EnhancedLIC, int);
-  vtkBooleanMacro(EnhancedLIC, int);
-
-  // Description:
-  // Enable/Disable contrast and dynamic range correction stages. Stage 1 is applied
-  // on the input to the high-pass filter when the high-pass filter is enabled and
-  // skipped otherwise. Stage 2, when enabled is the final stage in the internal
-  // pipeline. Both stages are implemented by a histogram stretching of the gray scale
-  // colors in the LIC'd image as follows:
-  //
-  //     c = (c-m)/(M-m)
-  //
-  // where, c is the fragment color, m is the color value to map to 0, M is the
-  // color value to map to 1. The default values of m and M are the min and max
-  // over all fragments.
-  //
-  // This increase the dynamic range and contrast in the LIC'd image, both of which
-  //  are natuarly attenuated by the LI conovlution proccess.
-  //
-  //  ENHANCE_CONTRAST_OFF  -- don't enhance contrast
-  //  ENHANCE_CONTRAST_ON   -- enhance high-pass input and final stage output
-  //
-  // This feature is disabled by default.
-  enum {
-    ENHANCE_CONTRAST_OFF=0,
-    ENHANCE_CONTRAST_ON=1};
-  vtkSetClampMacro(EnhanceContrast, int, 0, 2);
-  vtkGetMacro(EnhanceContrast, int);
-  vtkBooleanMacro(EnhanceContrast, int);
-
-  // Description:
-  // This feature is used to fine tune the contrast enhancement. Values are provided
-  // indicating the fraction of the range to adjust m and M by during contrast enahncement
-  // histogram stretching.  M and m are the intensity/lightness values that map to 1 and 0.
-  // (see EnhanceContrast for an explanation of the mapping procedure). m and M are computed
-  // using the factors as follows:
-  //
-  //     m = min(C) - mFactor * (max(C) - min(C))
-  //     M = max(C) - MFactor * (max(C) - min(C))
-  //
-  // the default values for mFactor and MFactor are 0 which result in
-  // m = min(C), M = max(C), where C is all of the colors in the image. Adjusting
-  // mFactor and MFactor above zero provide a means to control the saturation of
-  // normalization. These settings only affect the final normalization, the
-  // normalization that occurs on the input to the high-pass filter always uses
-  // the min and max.
-  vtkSetClampMacro(LowContrastEnhancementFactor, double, 0.0, 1.0);
-  vtkGetMacro(LowContrastEnhancementFactor, double);
-  vtkSetClampMacro(HighContrastEnhancementFactor, double, 0.0, 1.0);
-  vtkGetMacro(HighContrastEnhancementFactor, double);
-
-  // Description:
-  // Enable/Disable the anti-aliasing pass. This optional pass (disabled by
-  // default) can be enabled to reduce jagged patterns in the final LIC image.
-  // Values greater than 0 control the number of iterations, one is typically
-  // sufficient.
-  vtkSetClampMacro(AntiAlias, int, 0, VTK_INT_MAX);
-  vtkGetMacro(AntiAlias, int);
-  vtkBooleanMacro(AntiAlias, int);
-
-  // Description:
-  // Number of streamline integration steps (initial value is 1).
-  // In term of visual quality, the greater (within some range) the better.
-  vtkSetClampMacro(NumberOfSteps, int, 0, VTK_INT_MAX);
-  vtkGetMacro(NumberOfSteps, int);
-
-  // Description:
-  // Get/Set the streamline integration step size (0.01 by default). This is
-  // the length of each step in normalized image space i.e. in range [0, FLOAT_MAX].
-  // In term of visual quality, the smaller the better. The type for the
-  // interface is double as VTK interface is, but GPU only supports float.
-  // Thus it will be converted to float in the execution of the algorithm.
-  vtkSetClampMacro(StepSize, double, 0.0, VTK_FLOAT_MAX);
-  vtkGetMacro(StepSize, double);
-
-  // Description:
-  // If VectorField has >= 3 components, we must choose which 2 components
-  // form the (X, Y) components for the vector field. Must be in the range
-  // [0, 3].
-  void SetComponentIds(int c0, int c1);
-  void SetComponentIds(int c[2]){ this->SetComponentIds(c[0], c[1]); }
-  vtkGetVector2Macro(ComponentIds, int);
-
-  // Description:
-  // Set the max noise value for use during LIC integration normalization.
-  // The integration normalization factor is the max noise value times the
-  // number of steps taken. The default value is 1.
-  vtkSetClampMacro(MaxNoiseValue, double, 0.0, 1.0);
-  vtkGetMacro(MaxNoiseValue, double);
-
-  // Description:
-  // This class performs LIC in the normalized image space. Hence, by default
-  // it transforms the input vectors to the normalized image space (using the
-  // GridSpacings and input vector field dimensions). Set this to 0 to disable
-  // tranformation if the vectors are already transformed.
-  void SetTransformVectors(int val);
-  vtkGetMacro(TransformVectors, int);
-
-  // Description:
-  // Set/Get the spacing in each dimension of the plane on which the vector
-  // field is defined. This class performs LIC in the normalized image space
-  // and hence generally it needs to transform the input vector field (given
-  // in physical space) to the normalized image space. The Spacing is needed
-  // to determine the transform. Default is (1.0, 1.0). It is possible to
-  // disable vector transformation by setting TransformVectors to 0.
-  //vtkSetVector2Macro(GridSpacings, double);
-  //vtkGetVector2Macro(GridSpacings, double);
-
-  // Description:
-  // Normalize vectors during integration. When set(the default) the input vector field
-  // is normalized during integration, and each integration occurs over the same arclength.
-  // When not set each integration occurs over an arc length proportional to the field
-  // magnitude as is customary in traditional numerical methods. See, "Imaging Vector
-  // Fields Using Line Integral Convolution" for an axample where normalization is used.
-  // See, "Image Space Based Visualization of Unsteady Flow on Surfaces" for an example
-  // of where no normalization is used.
-  void SetNormalizeVectors(int val);
-  vtkGetMacro(NormalizeVectors, int);
-
-  // Description:
-  // The MaskThreshold controls blanking of the LIC texture. For fragments with
-  // |V|<threhold the LIC fragment is not rendered. The default value is 0.0.
-  //
-  // For surface LIC MaskThreshold units are in the original vector space. For image LIC
-  // be aware that while the vector field is transformed to image space while the mask
-  // threshold is not. Therefore the mask threshold must be specified in image space
-  // units.
-  vtkSetClampMacro(MaskThreshold, double, -1.0, VTK_FLOAT_MAX);
-  vtkGetMacro(MaskThreshold, double);
-
-
-  // Description:
-  // Compute the lic on the entire vector field texture.
-  vtkTextureObject *Execute(
-        vtkTextureObject *vectorTex,
-        vtkTextureObject *noiseTex);
-
-  // Description:
-  // Compute the lic on the indicated subset of the vector field
-  // texture.
-  vtkTextureObject *Execute(
-        const int extent[4],
-        vtkTextureObject *vectorTex,
-        vtkTextureObject *noiseTex);
-
-  //BTX
-  // Description:
-  // Compute LIC over the desired subset of the input texture. The
-  // result is copied into the desired subset of the provided output
-  // texture.
-  //
-  // inputTexExtent  : screen space extent of the input texture
-  // vectorExtent    : part of the inpute extent that has valid vectors
-  // licExtent       : part of the inpute extent to compute on
-  // outputTexExtent : screen space extent of the output texture
-  // outputExtent    : part of the output texture to store the result
-  //
-  vtkTextureObject *Execute(
-        const vtkPixelExtent &inputTexExtent,
-        const std::deque<vtkPixelExtent> &vectorExtent,
-        const std::deque<vtkPixelExtent> &licExtent,
-        vtkTextureObject *vectorTex,
-        vtkTextureObject *maskVectorTex,
-        vtkTextureObject *noiseTex);
-  //ETX
-
-  // Description:
-  // Convenience functions to ensure that the input textures are
-  // configured correctly.
-  static
-  void SetVectorTexParameters(vtkTextureObject *vectors);
-
-  static
-  void SetNoiseTexParameters(vtkTextureObject *noise);
-
-  //BTX
-  // Description:
-  // Set the communicator to use during parallel operation
-  // The communicator will not be duplicated or reference
-  // counted for performance reasons thus caller should
-  // hold/manage reference to the communicator during use
-  // of the LIC object.
-  virtual void SetCommunicator(vtkPainterCommunicator *){}
-  virtual vtkPainterCommunicator *GetCommunicator();
-
-  // Description:
-  // For parallel operation, find global min/max
-  // min/max are in/out.
- virtual void GetGlobalMinMax(
-       vtkPainterCommunicator*,
-       float&,
-       float&) {}
-  //ETX
-
-  // Description:
-  // Methods used for parallel benchmarks. Use cmake to define
-  // vtkLineIntegralConviolution2DTIME to enable benchmarks.
-  // During each update timing information is stored, it can
-  // be written to disk by calling WriteLog.
-  virtual void WriteTimerLog(const char *){}
-
-protected:
-  vtkLineIntegralConvolution2D();
-  virtual ~vtkLineIntegralConvolution2D();
-
-  vtkPainterCommunicator *Comm;
-
-  void SetVTShader(vtkShaderProgram *prog);
-  void SetLIC0Shader(vtkShaderProgram *prog);
-  void SetLICIShader(vtkShaderProgram *prog);
-  void SetLICNShader(vtkShaderProgram *prog);
-  void SetEEShader(vtkShaderProgram *prog);
-  void SetCEShader(vtkShaderProgram *prog);
-  void SetAAHShader(vtkShaderProgram *prog);
-  void SetAAVShader(vtkShaderProgram *prog);
-
-  void BuildShaders();
-
-  void RenderQuad(
-        float computeBounds[4],
-        vtkPixelExtent computeExtent);
-
-  vtkTextureObject *AllocateBuffer(unsigned int texSize[2]);
-
-  // Description:
-  // Convenience functions to ensure that the input textures are
-  // configured correctly.
-  void SetNoise2TexParameters(vtkTextureObject *noise);
-
-  // Description:
-  // Methods used for parallel benchmarks. Use cmake to define
-  // vtkSurfaceLICPainterTIME to enable benchmarks. During each
-  // update timing information is stored, it can be written to
-  // disk by calling WriteLog (defined in vtkSurfaceLICPainter).
-  virtual void StartTimerEvent(const char *){}
-  virtual void EndTimerEvent(const char *){}
-
-protected:
-  vtkWeakPointer<vtkOpenGLRenderWindow> Context;
-  vtkFrameBufferObject2 *FBO;
-
-  int ShadersNeedBuild;
-  vtkOpenGLHelper *FinalBlendProgram;
-  vtkOpenGLHelper *IntermediateBlendProgram;
-  vtkOpenGLHelper *VTShader;
-  vtkOpenGLHelper *LIC0Shader;
-  vtkOpenGLHelper *LICIShader;
-  vtkOpenGLHelper *LICNShader;
-  vtkOpenGLHelper *EEShader;
-  vtkOpenGLHelper *CEShader;
-  vtkOpenGLHelper *AAHShader;
-  vtkOpenGLHelper *AAVShader;
-
-  int     NumberOfSteps;
-  double  StepSize;
-  int     EnhancedLIC;
-  int     EnhanceContrast;
-  double  LowContrastEnhancementFactor;
-  double  HighContrastEnhancementFactor;
-  int     AntiAlias;
-  int     NoiseTextureLookupCompatibilityMode;
-  double  MaskThreshold;
-  int     TransformVectors;
-  int     NormalizeVectors;
-  int     ComponentIds[2];
-  double  MaxNoiseValue;
-
-private:
-  vtkLineIntegralConvolution2D(const vtkLineIntegralConvolution2D &); // Not implemented.
-  void operator = (const vtkLineIntegralConvolution2D &);             // Not implemented.
-};
-
-#endif
diff --git a/Rendering/LICOpenGL2/vtkLineIntegralConvolution2D_AA.glsl b/Rendering/LICOpenGL2/vtkLineIntegralConvolution2D_AA.glsl
deleted file mode 100644
index 5e1a0de..0000000
--- a/Rendering/LICOpenGL2/vtkLineIntegralConvolution2D_AA.glsl
+++ /dev/null
@@ -1,95 +0,0 @@
-//=========================================================================
-//
-//  Program:   Visualization Toolkit
-//  Module:    vtkLineIntegralConvolution2D_fs2.glsl
-//
-//  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.
-//
-//=========================================================================
-
-// Anti-alias stage in vtkLineIntegralConvolution2D
-
-// The following line handles system declarations such as
-// default precisions, or defining precisions to null
-//VTK::System::Dec
-
-// the output of this shader
-//VTK::Output::Dec
-
-uniform sampler2D texLIC;         // inout texture
-uniform vec2      uLICTexSize;    // input texture size
-uniform vec4      uComputeBounds; // valid region of texture
-
-varying vec2 tcoordVC;
-
-// fragment size
-float tcDx = 1.0 / uLICTexSize.x;
-float tcDy = 1.0 / uLICTexSize.y;
-
-// 3x3 Gaussian kernel
-float K[9] = float[9](
-  0.0191724, 0.100120, 0.0191724,
-  0.1001200, 0.522831, 0.1001200,
-  0.0191724, 0.100120, 0.0191724
-  );
-
-// tex lictc neighbor offsets
-vec2 fragDx[9] = vec2[9](
-  vec2(-tcDx,  tcDy),  vec2(0.0,  tcDy),  vec2(tcDx,  tcDy),
-  vec2(-tcDx,  0.0 ),  vec2(0.0,  0.0 ),  vec2(tcDx,  0.0 ),
-  vec2(-tcDx, -tcDy),  vec2(0.0, -tcDy),  vec2(tcDx, -tcDy)
-  );
-
-// valid domain (because no ghost fragments)
-vec2 validBox[2] = vec2[2](
-  vec2(      tcDx,       tcDy),
-  vec2(1.0 - tcDx, 1.0 - tcDy)
-  );
-
-// valid domain (because no ghost fragments)
-vec2 computeBounds0 = vec2(uComputeBounds[0] + tcDx, uComputeBounds[2] + tcDy);
-vec2 computeBounds1 = vec2(uComputeBounds[1] - tcDx, uComputeBounds[3] - tcDy);
-
-// determinie if fragment is outside the valid regions
-bool OutOfBounds( vec2 tc )
-{
-  return any(lessThan(tc, computeBounds0))
-   || any(greaterThan(tc, computeBounds1));
-}
-
-// determine if the fragment was masked
-bool Masked(float val)
-{
-  return val == 1.0;
-}
-
-
-
-void main( void )
-{
-  vec2 lictc = tcoordVC.st;
-  vec4 lic;
-  bool dontUse = false;
-  float conv = 0.0;
-  for (int i=0; i<9; ++i)
-    {
-    vec2 tc = lictc + fragDx[i];
-    lic = texture2D( texLIC, tc );
-    dontUse = dontUse || OutOfBounds(tc) || Masked(lic.g);
-    conv = conv + K[i] * lic.r;
-    }
-
-  lic = texture2D( texLIC, lictc );
-
-  conv
-    = ( 1.0 - float( dontUse ) ) * conv
-    + float( dontUse ) * lic.r;
-
-  gl_FragData[0] = vec4( conv, lic.g, 0.0, 1.0 );
-}
diff --git a/Rendering/LICOpenGL2/vtkLineIntegralConvolution2D_AAH.glsl b/Rendering/LICOpenGL2/vtkLineIntegralConvolution2D_AAH.glsl
deleted file mode 100644
index 8476211..0000000
--- a/Rendering/LICOpenGL2/vtkLineIntegralConvolution2D_AAH.glsl
+++ /dev/null
@@ -1,63 +0,0 @@
-//=========================================================================
-//
-//  Program:   Visualization Toolkit
-//  Module:    vtkLineIntegralConvolution2D_AAH.glsl
-//
-//  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.
-//
-//=========================================================================
-
-// Anti-alias stage in vtkLineIntegralConvolution2D
-// horizontal pass of a Gaussian convolution
-
-// The following line handles system declarations such as
-// default precisions, or defining precisions to null
-//VTK::System::Dec
-
-// the output of this shader
-//VTK::Output::Dec
-
-uniform sampler2D texLIC; // input texture
-uniform float     uDx;    // fragment size
-
-varying vec2 tcoordVC;
-
-// neighbor offsets
-vec2 fragDx[3] = vec2[3](vec2(-uDx,0.0), vec2(0.0,0.0), vec2(uDx,0.0));
-
-// factored 3x3 Gaussian kernel
-// K^T*K = G
-float K[3] = float[3](0.141421356, 0.707106781, 0.141421356);
-
-// determine if the fragment was masked
-bool Masked(float val){ return val != 0.0; }
-
-void main(void)
-{
-  vec2 lictc = tcoordVC.st;
-  vec4 lic[3];
-  bool dontUse = false;
-  float conv = 0.0;
-  for (int i=0; i<3; ++i)
-    {
-    vec2 tc = lictc + fragDx[i];
-    lic[i] = texture2D(texLIC, tc);
-    dontUse = dontUse || Masked(lic[i].g);
-    conv = conv + K[i] * lic[i].r;
-    }
-  // output is (conv, mask, skip, 1)
-  if (dontUse)
-    {
-    gl_FragData[0] = vec4(lic[1].rg, 1.0, 1.0);
-    }
-  else
-    {
-    gl_FragData[0] = vec4(conv, lic[1].gb, 1.0);
-    }
-}
diff --git a/Rendering/LICOpenGL2/vtkLineIntegralConvolution2D_AAV.glsl b/Rendering/LICOpenGL2/vtkLineIntegralConvolution2D_AAV.glsl
deleted file mode 100644
index 78a108e..0000000
--- a/Rendering/LICOpenGL2/vtkLineIntegralConvolution2D_AAV.glsl
+++ /dev/null
@@ -1,63 +0,0 @@
-//=========================================================================
-//
-//  Program:   Visualization Toolkit
-//  Module:    vtkLineIntegralConvolution2D_AAV.glsl
-//
-//  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.
-//
-//=========================================================================
-
-// Anti-alias stage in vtkLineIntegralConvolution2D
-// vertical pass of a Gaussian convolution
-
-// The following line handles system declarations such as
-// default precisions, or defining precisions to null
-//VTK::System::Dec
-
-// the output of this shader
-//VTK::Output::Dec
-
-uniform sampler2D texLIC; // input texture
-uniform float     uDy;    // fragment size
-
-varying vec2 tcoordVC;
-
-// neighbor offsets
-vec2 fragDy[3] = vec2[3](vec2(0.0,-uDy), vec2(0.0,0.0), vec2(0.0,uDy));
-
-// factored 3x3 Gaussian kernel
-// K^T*K = G
-float K[3] = float[3](0.141421356, 0.707106781, 0.141421356);
-
-// determine if the fragment was masked
-bool Masked(float val){ return val != 0.0; }
-
-void main(void)
-{
-  vec2 lictc = tcoordVC.st;
-  vec4 lic[3];
-  bool dontUse = false;
-  float conv = 0.0;
-  for (int i=0; i<3; ++i)
-    {
-    vec2 tc = lictc + fragDy[i];
-    lic[i] = texture2D(texLIC, tc);
-    dontUse = dontUse || Masked(lic[i].g);
-    conv = conv + K[i] * lic[i].r;
-    }
-  // output is (conv, mask, skip, 1)
-  if (dontUse)
-    {
-    gl_FragData[0] = vec4(lic[1].rg, 1.0, 1.0);
-    }
-  else
-    {
-    gl_FragData[0] = vec4(conv, lic[1].gb, 1.0);
-    }
-}
diff --git a/Rendering/LICOpenGL2/vtkLineIntegralConvolution2D_CE.glsl b/Rendering/LICOpenGL2/vtkLineIntegralConvolution2D_CE.glsl
deleted file mode 100644
index bd3dcbe..0000000
--- a/Rendering/LICOpenGL2/vtkLineIntegralConvolution2D_CE.glsl
+++ /dev/null
@@ -1,45 +0,0 @@
-//=========================================================================
-//
-//  Program:   Visualization Toolkit
-//  Module:    vtkLineIntegralConvolution2D_CE.glsl
-//
-//  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.
-//
-//=========================================================================
-
-// gray scale contrast enhance stage implemented via histogram stretching
-// if the min and max are tweaked it can generate out-of-range values
-// these will be clamped in 0 to 1
-
-// The following line handles system declarations such as
-// default precisions, or defining precisions to null
-//VTK::System::Dec
-
-// the output of this shader
-//VTK::Output::Dec
-
-uniform sampler2D texLIC;  // most recent lic pass
-uniform float uMin;        // min gray scale color value
-uniform float uMaxMinDiff; // max-min
-
-varying vec2 tcoordVC;
-
-void main( void )
-{
-  vec4 lic = texture2D(texLIC, tcoordVC.st);
-  if (lic.g!=0.0)
-    {
-    gl_FragData[0] = lic;
-    }
-  else
-    {
-    float CElic = clamp((lic.r - uMin)/uMaxMinDiff, 0.0, 1.0);
-    gl_FragData[0] = vec4(CElic, lic.gb, 1.0);
-    }
-}
diff --git a/Rendering/LICOpenGL2/vtkLineIntegralConvolution2D_EE.glsl b/Rendering/LICOpenGL2/vtkLineIntegralConvolution2D_EE.glsl
deleted file mode 100644
index c0a0119..0000000
--- a/Rendering/LICOpenGL2/vtkLineIntegralConvolution2D_EE.glsl
+++ /dev/null
@@ -1,80 +0,0 @@
-//=========================================================================
-//
-//  Program:   Visualization Toolkit
-//  Module:    vtkLineIntegralConvolution2D_fs2.glsl
-//
-//  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.
-//
-//=========================================================================
-
-// high-pass filter stage employed by vtkLineIntegralConvolution2D
-// between LIC pass 1 and LIC pass 2. filtered LIC pass 1, becomes
-// noise for pass2.
-
-// The following line handles system declarations such as
-// default precisions, or defining precisions to null
-//VTK::System::Dec
-
-// the output of this shader
-//VTK::Output::Dec
-
-uniform sampler2D texLIC; // most recent lic pass
-uniform float     uDx;    // fragment size
-uniform float     uDy;    // fragment size
-
-varying vec2 tcoordVC;
-
-// kernel for simple laplace edge enhancement.
-// p=Laplace(p)+p
-float K[9] = float[9](
-  -1.0, -1.0, -1.0,
-  -1.0,  9.0, -1.0,
-  -1.0, -1.0, -1.0
-  );
-
-// tex coord neighbor offsets
-vec2 fragDx[9] = vec2[9](
-  vec2(-uDx, uDy), vec2(0.0, uDy), vec2(uDx, uDy),
-  vec2(-uDx, 0.0), vec2(0.0, 0.0), vec2(uDx, 0.0),
-  vec2(-uDx,-uDy), vec2(0.0,-uDy), vec2(uDx,-uDy)
-  );
-
-// determine if the fragment was masked
-bool Masked(float val) { return val != 0.0; }
-
-void main(void)
-{
-  vec2 lictc = tcoordVC.st;
-
-  // compute the convolution but don't use convovled values if
-  // any masked fragments on the stencil. Fragments outside
-  // the valid domain are masked during initializaiton, and
-  // texture wrap parameters are clamp to border with border
-  // color that contains masked flag
-  float conv = 0.0;
-  bool dontUse = false;
-  for (int i=0; i<9; ++i)
-    {
-    vec2 tc = lictc + fragDx[i];
-    vec4 lic = texture2D(texLIC, tc);
-    dontUse = dontUse || Masked(lic.g);
-    conv = conv + K[i] * lic.r;
-    }
-
-  if (dontUse)
-    {
-    conv = texture2D(texLIC, lictc).r;
-    }
-  else
-    {
-    conv = clamp(conv, 0.0, 1.0);
-    }
-
-  gl_FragData[0] = vec4(conv, 0.0, 0.0, 1.0);
-}
diff --git a/Rendering/LICOpenGL2/vtkLineIntegralConvolution2D_LIC0.glsl b/Rendering/LICOpenGL2/vtkLineIntegralConvolution2D_LIC0.glsl
deleted file mode 100644
index ac5b597..0000000
--- a/Rendering/LICOpenGL2/vtkLineIntegralConvolution2D_LIC0.glsl
+++ /dev/null
@@ -1,96 +0,0 @@
-//=========================================================================
-//
-//  Program:   Visualization Toolkit
-//  Module:    vtkLineIntegralConvolution2D_LIC0.glsl
-//
-//  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.
-//
-//=========================================================================
-
-/**
-This shader initializes the convolution for the LIC computation.
-*/
-
-// The following line handles system declarations such as
-// default precisions, or defining precisions to null
-//VTK::System::Dec
-
-// the output of this shader
-//VTK::Output::Dec
-
-uniform sampler2D texMaskVectors;
-uniform sampler2D texNoise;
-uniform sampler2D texLIC;
-
-uniform int   uStepNo;         // in step 0 initialize lic and seeds, else just seeds
-uniform int   uPassNo;         // in pass 1 hpf of pass 0 is convolved.
-uniform float uMaskThreshold;  // if |V| < uMaskThreshold render transparent
-uniform vec2  uNoiseBoundsPt1; // tc of upper right pt of noise texture
-
-varying vec2 tcoordVC;
-
-// convert from vector coordinate space to noise coordinate space.
-// the noise texture is tiled across the *whole* domain
-vec2 VectorTCToNoiseTC(vec2 vectc)
-{
-  return vectc/uNoiseBoundsPt1;
-}
-
-// get the texture coordidnate to lookup noise value. this
-// depends on the pass number.
-vec2 getNoiseTC(vec2 vectc)
-{
-  // in pass 1 : convert from vector tc to noise tc
-  // in pass 2 : use vector tc
-  if (uPassNo == 0)
-    {
-    return VectorTCToNoiseTC(vectc);
-    }
-  else
-    {
-    return vectc;
-    }
-}
-
-// look up noise value at the given location. The location
-// is supplied in vector texture coordinates, hence the
-// need to convert to noise texture coordinates.
-float getNoise(vec2 vectc)
-{
-  return texture2D(texNoise, getNoiseTC(vectc)).r;
-}
-
-void main(void)
-{
-  vec2 vectc = tcoordVC.st;
-
-  // lic => (convolution, mask, 0, step count)
-  if (uStepNo == 0)
-    {
-    float maskCriteria = length(texture2D(texMaskVectors, vectc).xyz);
-    float maskFlag;
-    if (maskCriteria <= uMaskThreshold)
-      {
-      maskFlag = 1.0;
-      }
-    else
-      {
-      maskFlag = 0.0;
-      }
-    float noise = getNoise(vectc);
-    gl_FragData[0] = vec4(noise, maskFlag, 0.0, 1.0);
-    }
-  else
-    {
-    gl_FragData[0] = texture2D(texLIC, vectc);
-    }
-
-  // initial seed
-  gl_FragData[1] = vec4(vectc, 0.0, 1.0);
-}
diff --git a/Rendering/LICOpenGL2/vtkLineIntegralConvolution2D_LICI.glsl b/Rendering/LICOpenGL2/vtkLineIntegralConvolution2D_LICI.glsl
deleted file mode 100644
index 10600db..0000000
--- a/Rendering/LICOpenGL2/vtkLineIntegralConvolution2D_LICI.glsl
+++ /dev/null
@@ -1,128 +0,0 @@
-//=========================================================================
-//
-//  Program:   Visualization Toolkit
-//  Module:    vtkLineIntegralConvolution2D_fs1.glsl
-//
-//  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.
-//
-//=========================================================================
-
-// The following line handles system declarations such as
-// default precisions, or defining precisions to null
-//VTK::System::Dec
-
-// the output of this shader
-//VTK::Output::Dec
-
-uniform sampler2D  texVectors;
-uniform sampler2D  texNoise;
-uniform sampler2D  texLIC;
-uniform sampler2D  texSeedPts;
-
-uniform int   uPassNo;          // in pass 1 hpf of pass 0 is convolved.
-uniform float uStepSize;        // step size in parametric space
-
-uniform vec2  uNoiseBoundsPt1;  // tc of upper right pt of noise texture
-
-varying vec2 tcoordVC;
-
-//VTK::LICVectorLookup::Impl
-
-// convert from vector coordinate space to noise coordinate space.
-// the noise texture is tiled across the whole domain
-vec2 VectorTCToNoiseTC(vec2 vectc)
-{
-  return vectc/uNoiseBoundsPt1;
-}
-
-// get the texture coordidnate to lookup noise value.
-// in pass 1 repeatedly tile the noise texture across
-// the computational domain.
-vec2 getNoiseTC(vec2 tc)
-{
-  if (uPassNo == 0)
-    {
-    return VectorTCToNoiseTC(tc);
-    }
-  else
-    {
-    return tc;
-    }
-}
-
-// look up noise value at the given location. The location
-// is supplied in vector texture coordinates, hence the need
-// to convert to either noise or lic texture coordinates in
-// pass 1 and 2 respectively.
-float getNoise(vec2 vectc)
-{
-  return texture2D(texNoise, getNoiseTC(vectc)).r;
-}
-
-// fourth-order Runge-Kutta streamline integration
-// no bounds checks are made, therefor it's essential
-// to have the entire texture initialized to 0
-// and set clamp to border and have border color 0
-// an integer is set if the step was taken, keeping
-// an accurate step count is neccessary to prevent
-// boundary artifacts. Don't count the step if
-// all vector lookups are identically 0. This is
-// a proxy for "stepped outside valid domain"
-vec2 rk4(vec2 pt0, float dt, out bool count)
-{
-  count=true;
-  float dtHalf = dt * 0.5;
-  vec2 pt1;
-
-  vec2 v0 = getVector(pt0);
-  pt1 = pt0 + v0 * dtHalf;
-
-  vec2 v1 = getVector(pt1);
-  pt1 = pt0 + v1 * dtHalf;
-
-  vec2 v2 = getVector(pt1);
-  pt1 = pt0 + v2 * dt;
-
-  vec2 v3 = getVector(pt1);
-  vec2 vSum = v0 + v1 + v1 + v2 + v2 + v3;
-
-  if (vSum == vec2(0.0,0.0))
-    {
-    count = false;
-    }
-
-  pt1 = pt0 + (vSum) * (dt * (1.0/6.0));
-
- return pt1;
-}
-
-void main(void)
-{
-  vec2 lictc = tcoordVC.st;
-  vec4 lic = texture2D(texLIC, lictc);
-  vec2 pt0 = texture2D(texSeedPts, lictc).st;
-
-  bool count;
-  vec2 pt1 = rk4(pt0, uStepSize, count);
-
-  if (count)
-    {
-    // accumulate lic step
-    // (lic, mask, 0, step count)
-    float noise = getNoise(pt1);
-    gl_FragData[0] = vec4(lic.r + noise, lic.g, 0.0, lic.a + 1.0);
-    gl_FragData[1] = vec4(pt1, 0.0, 1.0);
-    }
-  else
-    {
-    // keep existing values
-    gl_FragData[0] = lic;
-    gl_FragData[1] = vec4(pt0, 0.0, 1.0);
-    }
-}
diff --git a/Rendering/LICOpenGL2/vtkLineIntegralConvolution2D_LICN.glsl b/Rendering/LICOpenGL2/vtkLineIntegralConvolution2D_LICN.glsl
deleted file mode 100644
index f479369..0000000
--- a/Rendering/LICOpenGL2/vtkLineIntegralConvolution2D_LICN.glsl
+++ /dev/null
@@ -1,39 +0,0 @@
-//=========================================================================
-//
-//  Program:   Visualization Toolkit
-//  Module:    vtkLineIntegralConvolution2D_LICN.glsl
-//
-//  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.
-//
-//=========================================================================
-
-// The following line handles system declarations such as
-// default precisions, or defining precisions to null
-//VTK::System::Dec
-
-// the output of this shader
-//VTK::Output::Dec
-
-/**
-This shader finalizes the convolution for the LIC computation
-applying the normalization. eg. if box kernel is used the this
-is the number of steps taken.
-*/
-
-uniform sampler2D texLIC;
-
-varying vec2 tcoordVC;
-
-void main(void)
-{
-  vec4 conv = texture2D(texLIC, tcoordVC.st);
-  conv.r = conv.r/conv.a;
-  // lic => (convolution, mask, 0, 1)
-  gl_FragData[0] = vec4(conv.rg , 0.0, 1.0);
-}
diff --git a/Rendering/LICOpenGL2/vtkLineIntegralConvolution2D_VT.glsl b/Rendering/LICOpenGL2/vtkLineIntegralConvolution2D_VT.glsl
deleted file mode 100644
index 9251355..0000000
--- a/Rendering/LICOpenGL2/vtkLineIntegralConvolution2D_VT.glsl
+++ /dev/null
@@ -1,38 +0,0 @@
-//=========================================================================
-//
-//  Program:   Visualization Toolkit
-//  Module:    vtkLineIntegralConvolution2D_VT.glsl
-//
-//  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.
-//
-//=========================================================================
-
-// move vector field to normalized image space
-// pre-procesing for vtkLineIntegralConvolution2D
-
-// The following line handles system declarations such as
-// default precisions, or defining precisions to null
-//VTK::System::Dec
-
-// the output of this shader
-//VTK::Output::Dec
-
-// Fragment shader used by the gaussian blur filter render pass.
-
-uniform sampler2D texVectors; // input texture
-uniform vec2      uTexSize;   // size of texture
-
-varying vec2 tcoordVC;
-
-void main(void)
-{
-  //VTK::LICComponentSelection::Impl
-  V = V/uTexSize;
-  gl_FragData[0] = vec4(V, 0.0, 1.0);
-}
diff --git a/Rendering/LICOpenGL2/vtkPainterCommunicator.h b/Rendering/LICOpenGL2/vtkPainterCommunicator.h
deleted file mode 100644
index 1437f9a..0000000
--- a/Rendering/LICOpenGL2/vtkPainterCommunicator.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkPainterCommunicator.h
-
-  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.
-
-=========================================================================*/
-// .NAME vtkPainterCommunicator -- A communicator containing only
-// ranks that will execute a painter chain.
-//
-// .SECTION Description
-// A communicator that can safely be used inside a painter.
-// A simple container holding a handle to an MPI communicator.
-// This API is sufficient to allow for control flow with/without
-// MPI. The parallel parts of the code should use the derived
-// class vtkPPainterCommunicator.
-#ifndef vtkPainterCommunicator_h
-#define vtkPainterCommunicator_h
-
-#include "vtkRenderingLICOpenGL2Module.h" // for export macro
-
-class VTKRENDERINGLICOPENGL2_EXPORT vtkPainterCommunicator
-{
-public:
-  vtkPainterCommunicator(){}
-  virtual ~vtkPainterCommunicator(){}
-
-  // Description:
-  // Copy and assignment operators. Both use Copy internally
-  // and do take ownership.
-  vtkPainterCommunicator(const vtkPainterCommunicator &other)
-    { this->Copy(&other, false); }
-
-  vtkPainterCommunicator &operator=(const vtkPainterCommunicator &other)
-    { this->Copy(&other, false); return *this; }
-
-  // Description:
-  // Copy the communicator, the flag indicates if ownership
-  // should be assumed. The owner is responsible for free'ing
-  // the communicator.
-  virtual void Copy(const vtkPainterCommunicator *, bool){}
-
-  // Description:
-  // Duplicate the communicator.
-  virtual void Duplicate(const vtkPainterCommunicator *){}
-
-  // Description:
-  // Querry MPI about the communicator.
-  virtual int GetRank(){ return 0; }
-  virtual int GetSize(){ return 1; }
-  virtual bool GetIsNull(){ return false; }
-
-  // Description:
-  // Querry MPI about the world communicator.
-  virtual int GetWorldRank(){ return 0; }
-  virtual int GetWorldSize(){ return 1; }
-
-  // Description:
-  // Querry MPI about its state.
-  virtual bool GetMPIInitialized(){ return false; }
-  virtual bool GetMPIFinalized(){ return true; }
-};
-
-#endif
-// VTK-HeaderTest-Exclude: vtkPainterCommunicator.h
diff --git a/Rendering/LICOpenGL2/vtkPixelTransfer.cxx b/Rendering/LICOpenGL2/vtkPixelTransfer.cxx
deleted file mode 100644
index d49e70d..0000000
--- a/Rendering/LICOpenGL2/vtkPixelTransfer.cxx
+++ /dev/null
@@ -1,32 +0,0 @@
-#include "vtkPixelTransfer.h"
-
-//-----------------------------------------------------------------------------
-int vtkPixelTransfer::Blit(
-       const vtkPixelExtent &srcWholeExt,
-       const vtkPixelExtent &srcExt,
-       const vtkPixelExtent &destWholeExt,
-       const vtkPixelExtent &destExt,
-       int nSrcComps,
-       int srcType,
-       void *srcData,
-       int nDestComps,
-       int destType,
-       void *destData)
-{
-  // first layer of dispatch
-  switch(srcType)
-    {
-    vtkTemplateMacro(
-        return vtkPixelTransfer::Blit(
-            srcWholeExt,
-            srcExt,
-            destWholeExt,
-            destExt,
-            nSrcComps,
-            (VTK_TT*)srcData,
-            nDestComps,
-            destType,
-            destData));
-    }
-  return 0;
-}
diff --git a/Rendering/LICOpenGL2/vtkPixelTransfer.h b/Rendering/LICOpenGL2/vtkPixelTransfer.h
deleted file mode 100644
index 8c1254e..0000000
--- a/Rendering/LICOpenGL2/vtkPixelTransfer.h
+++ /dev/null
@@ -1,233 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkPixelTransfer.h
-
-  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.
-
-=========================================================================*/
-// .NAME vtkPixelTransfer -- For movement of pixel data described by
-// pixel extents
-//
-// .SECTION Description
-// Class to handle non-contiguous data transfers of data described
-// by pixel extents within a process. For transfering data between
-// processes see vtkPPixelTransfer.
-//
-// .SECTION See also
-// vtkPixelExtent vtkPPixelTransfer
-
-#ifndef vtkPixelTransfer_h
-#define vtkPixelTransfer_h
-
-#include "vtkRenderingLICOpenGL2Module.h" // for export
-#include "vtkSetGet.h" // for macros
-#include "vtkPixelExtent.h" // for pixel extent
-#include <cstring> // for memcpy
-
-class VTKRENDERINGLICOPENGL2_EXPORT vtkPixelTransfer
-{
-public:
-  vtkPixelTransfer(){}
-  ~vtkPixelTransfer(){}
-
-  // Description:
-  // for  memory to memory transfers. Conveinience api for working
-  // with vtk type enum rather than c-data types and simple extents.
-  static
-  int Blit(
-         const vtkPixelExtent &ext,
-         int nComps,
-         int srcType,
-         void *srcData,
-         int destType,
-         void *destData);
-
-  // Description:
-  // for  memory to memory transfers. Conveinience api for working
-  // with vtk type enum rather than c-data types.
-  static
-  int Blit(
-         const vtkPixelExtent &srcWhole,
-         const vtkPixelExtent &srcSubset,
-         const vtkPixelExtent &destWhole,
-         const vtkPixelExtent &destSubset,
-         int nSrcComps,
-         int srcType,
-         void *srcData,
-         int nDestComps,
-         int destType,
-         void *destData);
-
-  // Description:
-  // for local memory to memory transfers
-  template<typename SOURCE_TYPE, typename DEST_TYPE>
-  static
-  int Blit(
-         const vtkPixelExtent &srcWhole,
-         const vtkPixelExtent &srcSubset,
-         const vtkPixelExtent &destWhole,
-         const vtkPixelExtent &destSubset,
-         int nSrcComps,
-         SOURCE_TYPE *srcData,
-         int nDestComps,
-         DEST_TYPE *destData);
-
-private:
-  // distpatch helper for vtk data type enum
-  template<typename SOURCE_TYPE>
-  static
-  int Blit(
-         const vtkPixelExtent &srcWhole,
-         const vtkPixelExtent &srcSubset,
-         const vtkPixelExtent &destWhole,
-         const vtkPixelExtent &destSubset,
-         int nSrcComps,
-         SOURCE_TYPE *srcData,
-         int nDestComps,
-         int destType,
-         void *destData);
-};
-
-//-----------------------------------------------------------------------------
-inline
-int vtkPixelTransfer::Blit(
-         const vtkPixelExtent &ext,
-         int nComps,
-         int srcType,
-         void *srcData,
-         int destType,
-         void *destData)
-{
-  return vtkPixelTransfer::Blit(
-        ext,
-        ext,
-        ext,
-        ext,
-        nComps,
-        srcType,
-        srcData,
-        nComps,
-        destType,
-        destData);
-}
-
-
-//-----------------------------------------------------------------------------
-template<typename SOURCE_TYPE>
-int vtkPixelTransfer::Blit(
-       const vtkPixelExtent &srcWholeExt,
-       const vtkPixelExtent &srcExt,
-       const vtkPixelExtent &destWholeExt,
-       const vtkPixelExtent &destExt,
-       int nSrcComps,
-       SOURCE_TYPE *srcData,
-       int nDestComps,
-       int destType,
-       void *destData)
-{
-  // second layer of dispatch
-  switch(destType)
-    {
-    vtkTemplateMacro(
-        return vtkPixelTransfer::Blit(
-            srcWholeExt,
-            srcExt,
-            destWholeExt,
-            destExt,
-            nSrcComps,
-            srcData,
-            nDestComps,
-            (VTK_TT*)destData););
-    }
-  return 0;
-}
-
-//-----------------------------------------------------------------------------
-template<typename SOURCE_TYPE, typename DEST_TYPE>
-int vtkPixelTransfer::Blit(
-       const vtkPixelExtent &srcWholeExt,
-       const vtkPixelExtent &srcSubset,
-       const vtkPixelExtent &destWholeExt,
-       const vtkPixelExtent &destSubset,
-       int nSrcComps,
-       SOURCE_TYPE *srcData,
-       int nDestComps,
-       DEST_TYPE *destData)
-{
-  if ( (srcData == NULL) || (destData == NULL) )
-    {
-    return -1;
-    }
-  if ( (srcWholeExt == srcSubset)
-    && (destWholeExt == destSubset)
-    && (nSrcComps == nDestComps) )
-    {
-    // buffers are contiguous
-    size_t n = srcWholeExt.Size()*nSrcComps;
-    for (size_t i=0; i<n; ++i)
-      {
-      destData[i] = static_cast<DEST_TYPE>(srcData[i]);
-      }
-    }
-  else
-    {
-    // buffers are not contiguous
-    int tmp[2];
-
-    // get the dimensions of the arrays
-    srcWholeExt.Size(tmp);
-    int swnx = tmp[0];
-
-    destWholeExt.Size(tmp);
-    int dwnx = tmp[0];
-
-    // move from logical extent to memory extent
-    vtkPixelExtent srcExt(srcSubset);
-    srcExt.Shift(srcWholeExt);
-
-    vtkPixelExtent destExt(destSubset);
-    destExt.Shift(destWholeExt);
-
-    // get size of sub-set to copy (it's the same in src and dest)
-    int nxny[2];
-    srcExt.Size(nxny);
-
-    // use smaller ncomps for loop index to avoid reading/writing
-    // invalid mem
-    int nCopyComps = nSrcComps < nDestComps ? nSrcComps : nDestComps;
-
-    for (int j=0; j<nxny[1]; ++j)
-      {
-      int sjj = swnx*(srcExt[2]+j)+srcExt[0];
-      int djj = dwnx*(destExt[2]+j)+destExt[0];
-      for (int i=0; i<nxny[0]; ++i)
-        {
-        int sidx = nSrcComps*(sjj+i);
-        int didx = nDestComps*(djj+i);
-        // copy values from source
-        for (int p=0; p<nCopyComps; ++p)
-          {
-          destData[didx+p] = static_cast<DEST_TYPE>(srcData[sidx+p]);
-          }
-        // ensure all dest comps are initialized
-        for (int p=nCopyComps; p<nDestComps; ++p)
-          {
-          destData[didx+p] = static_cast<DEST_TYPE>(0);
-          }
-        }
-      }
-    }
-  return 0;
-}
-
-ostream &operator<<(ostream &os, const vtkPixelTransfer &gt);
-
-#endif
-// VTK-HeaderTest-Exclude: vtkPixelTransfer.h
diff --git a/Rendering/LICOpenGL2/vtkStructuredGridLIC2D.cxx b/Rendering/LICOpenGL2/vtkStructuredGridLIC2D.cxx
deleted file mode 100644
index d50560d..0000000
--- a/Rendering/LICOpenGL2/vtkStructuredGridLIC2D.cxx
+++ /dev/null
@@ -1,780 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkStructuredGridLIC2D.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 "vtkStructuredGridLIC2D.h"
-
-#include "vtkOpenGLHelper.h"
-
-#include "vtkFloatArray.h"
-#include "vtkImageData.h"
-#include "vtkImageNoiseSource.h"
-#include "vtkInformation.h"
-#include "vtkInformationVector.h"
-#include "vtkDataTransferHelper.h"
-#include "vtkFrameBufferObject.h"
-#include "vtkLineIntegralConvolution2D.h"
-#include "vtkStructuredExtent.h"
-#include "vtkTextureObject.h"
-#include "vtkObjectFactory.h"
-#include "vtkOpenGLRenderWindow.h"
-#include "vtkPointData.h"
-#include "vtkStreamingDemandDrivenPipeline.h"
-#include "vtkOpenGLError.h"
-#include "vtkOpenGLShaderCache.h"
-#include "vtkShaderProgram.h"
-
-#include "vtkPixelExtent.h"
-#include "vtkPixelTransfer.h"
-#include "vtkPixelBufferObject.h"
-
-#include <cassert>
-
-#include "vtkTextureObjectVS.h"
-#include "vtkStructuredGridLIC2D_fs.h"
-
-#define PRINTEXTENT(ext) \
-  ext[0] << ", " << ext[1] << ", " << ext[2] << ", " << ext[3] << ", " << ext[4] << ", " << ext[5]
-
-vtkStandardNewMacro(vtkStructuredGridLIC2D);
-//----------------------------------------------------------------------------
-vtkStructuredGridLIC2D::vtkStructuredGridLIC2D()
-{
-  this->Context = 0;
-  this->Steps = 1;
-  this->StepSize = 1.0;
-  this->Magnification = 1;
-  this->SetNumberOfInputPorts(2);
-  this->SetNumberOfOutputPorts(2);
-  this->OwnWindow  = false;
-  this->FBOSuccess = 0;
-  this->LICSuccess = 0;
-
-  this->NoiseSource = vtkImageNoiseSource::New();
-  this->NoiseSource->SetWholeExtent(0, 127, 0, 127, 0, 0);
-  this->NoiseSource->SetMinimum(0.0);
-  this->NoiseSource->SetMaximum(1.0);
-
-  this->LICProgram = 0;
-}
-
-//----------------------------------------------------------------------------
-vtkStructuredGridLIC2D::~vtkStructuredGridLIC2D()
-{
-  this->NoiseSource->Delete();
-  this->SetContext( NULL );
-}
-
-//----------------------------------------------------------------------------
-vtkRenderWindow* vtkStructuredGridLIC2D::GetContext()
-{
-  return this->Context;
-}
-
-//----------------------------------------------------------------------------
-int vtkStructuredGridLIC2D::SetContext( vtkRenderWindow * context )
-{
-  if ( this->Context && this->OwnWindow )
-    {
-    this->Context->Delete();
-    this->Context = NULL;
-    }
-  this->OwnWindow = false;
-
-
-  vtkOpenGLRenderWindow * openGLRenWin =
-  vtkOpenGLRenderWindow::SafeDownCast( context );
-  this->Context = openGLRenWin;
-
-  this->Modified();
-  return 1;
-}
-
-//----------------------------------------------------------------------------
-// Description:
-// Fill the input port information objects for this algorithm.  This
-// is invoked by the first call to GetInputPortInformation for each
-// port so subclasses can specify what they can handle.
-// Redefined from the superclass.
-int vtkStructuredGridLIC2D::FillInputPortInformation
-  ( int port, vtkInformation * info )
-{
-  if ( port == 0 )
-    {
-    info->Set( vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "vtkStructuredGrid" );
-    info->Set( vtkAlgorithm::INPUT_IS_REPEATABLE(), 0 );
-    info->Set( vtkAlgorithm::INPUT_IS_OPTIONAL(),   0 );
-    }
-  else
-    {
-    info->Set( vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "vtkImageData" );
-    info->Set( vtkAlgorithm::INPUT_IS_REPEATABLE(), 0 );
-    info->Set( vtkAlgorithm::INPUT_IS_OPTIONAL(),   1 );
-    }
-
-  return 1;
-}
-
-// ----------------------------------------------------------------------------
-// Description:
-// Fill the output port information objects for this algorithm.
-// This is invoked by the first call to GetOutputPortInformation for
-// each port so subclasses can specify what they can handle.
-// Redefined from the superclass.
-int vtkStructuredGridLIC2D::FillOutputPortInformation
-  ( int port, vtkInformation * info )
-{
-  if ( port == 0 )
-    {
-    // input+texcoords
-    info->Set( vtkDataObject::DATA_TYPE_NAME(), "vtkStructuredGrid" );
-    }
-  else
-    {
-    // LIC texture
-    info->Set( vtkDataObject::DATA_TYPE_NAME(), "vtkImageData" );
-    }
-
-  return 1;
-}
-//----------------------------------------------------------------------------
-// We need to report output extent after taking into consideration the
-// magnification.
-int vtkStructuredGridLIC2D::RequestInformation(
-  vtkInformation        * vtkNotUsed(request),
-  vtkInformationVector ** inputVector,
-  vtkInformationVector  * outputVector )
-{
-  int ext[6];
-  double spacing[3];
-
-  vtkInformation * inInfo  = inputVector[0]->GetInformationObject( 0 );
-  vtkInformation * outInfo = outputVector->GetInformationObject( 1 );
-
-  inInfo->Get( vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT(), ext );
-
-  spacing[0] = 1.0;
-  spacing[1] = 1.0;
-  spacing[2] = 1.0;
-
-  for (int axis = 0; axis < 3; axis++)
-    {
-    int wholeMin = ext[axis*2];
-    int wholeMax = ext[axis*2+1];
-    int dimension = wholeMax - wholeMin + 1;
-
-    // Scale the output extent
-    wholeMin = static_cast<int>(  ceil( static_cast<double>
-                                        ( wholeMin * this->Magnification )
-                                      )
-                               );
-    wholeMax = ( dimension != 1 )
-               ? wholeMin + static_cast<int>
-                 (   floor(  static_cast<double>
-                             ( dimension * this->Magnification )
-                          )
-                 ) -1
-               : wholeMin;
-
-    ext[ axis * 2     ] = wholeMin;
-    ext[ axis * 2 + 1 ] = wholeMax;
-    }
-
-  vtkDebugMacro( << "request info whole ext = " << PRINTEXTENT( ext ) << endl );
-
-  outInfo->Set( vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT(), ext, 6 );
-  outInfo->Set( vtkDataObject::SPACING(), spacing, 3 );
-
-  return 1;
-}
-
-//----------------------------------------------------------------------------
-int vtkStructuredGridLIC2D::RequestUpdateExtent (
-  vtkInformation * vtkNotUsed(request),
-  vtkInformationVector **inputVector,
-  vtkInformationVector *outputVector)
-{
-  vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
-  vtkInformation *outInfo = outputVector->GetInformationObject(1);
-
-
-  // Tell the vector field input the extents that we need from it.
-  // The downstream request needs to be downsized based on the Magnification.
-  int ext[6];
-  outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_EXTENT(), ext);
-
-  vtkDebugMacro( << "request update extent, update ext = "
-                 << PRINTEXTENT( ext ) << endl );
-
-  for (int axis = 0; axis < 3; axis++)
-    {
-    int wholeMin = ext[axis*2];
-    int wholeMax = ext[axis*2+1];
-    int dimension = wholeMax - wholeMin + 1;
-
-    // Scale the output extent
-    wholeMin = static_cast<int>(ceil(static_cast<double>(wholeMin / this->Magnification)));
-    wholeMax = dimension != 1? wholeMin + static_cast<int>(floor(static_cast<double>(dimension / this->Magnification))) -1:
-
-    ext[axis*2] = wholeMin;
-    ext[axis*2+1] = wholeMax;
-    }
-  vtkDebugMacro( << "UPDATE_EXTENT: " << ext[0] << ", " << ext[1] << ", "
-                 << ext[2] << ", "    << ext[3] << ", " << ext[4] << ", "
-                 << ext[5] << endl );
-  inInfo->Set(vtkStreamingDemandDrivenPipeline::UPDATE_EXTENT(), ext, 6);
-
-  vtkDebugMacro( << "request update extent, update ext2 = "
-                 << PRINTEXTENT( ext ) << endl );
-
-
-  if(inputVector[1]!=0 && inputVector[1]->GetInformationObject(0) != NULL) // optional input
-    {
-    inInfo = inputVector[1]->GetInformationObject(0);
-    // always request the whole extent
-    inInfo->Set(vtkStreamingDemandDrivenPipeline::UPDATE_EXTENT(),
-                inInfo->Get(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT()),
-                6);
-    }
-
-  return 1;
-}
-
-//----------------------------------------------------------------------------
-// Stolen from vtkImageAlgorithm. Should be in vtkStructuredGridAlgorithm.
-void vtkStructuredGridLIC2D::AllocateOutputData(vtkDataObject *output,
-                                                vtkInformation *outInfo)
-{
-  // set the extent to be the update extent
-  vtkStructuredGrid *out = vtkStructuredGrid::SafeDownCast(output);
-  if (out)
-    {
-    out->SetExtent(outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_EXTENT()));
-    }
-  else
-    {
-    vtkImageData *out2 = vtkImageData::SafeDownCast(output);
-    if (out2)
-      {
-      out2->SetExtent(outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_EXTENT()));
-      }
-    }
-}
-
-//----------------------------------------------------------------------------
-// Stolen from vtkImageData. Should be in vtkStructuredGrid.
-void vtkStructuredGridLIC2D::AllocateScalars(vtkStructuredGrid *sg,
-                                             vtkInformation *outInfo)
-{
-  int newType = VTK_DOUBLE;
-  int newNumComp = 1;
-
-  vtkInformation *scalarInfo = vtkDataObject::GetActiveFieldInformation(
-    outInfo,
-    vtkDataObject::FIELD_ASSOCIATION_POINTS, vtkDataSetAttributes::SCALARS);
-  if (scalarInfo)
-    {
-    newType = scalarInfo->Get( vtkDataObject::FIELD_ARRAY_TYPE() );
-    if ( scalarInfo->Has(vtkDataObject::FIELD_NUMBER_OF_COMPONENTS()) )
-      {
-      newNumComp = scalarInfo->Get( vtkDataObject::FIELD_NUMBER_OF_COMPONENTS() );
-      }
-    }
-
-  vtkDataArray *scalars;
-
-  // if the scalar type has not been set then we have a problem
-  if (newType == VTK_VOID)
-    {
-    vtkErrorMacro("Attempt to allocate scalars before scalar type was set!.");
-    return;
-    }
-
-  const int* extent = sg->GetExtent();
-  // Use vtkIdType to avoid overflow on large images
-  vtkIdType dims[3];
-  dims[0] = extent[1] - extent[0] + 1;
-  dims[1] = extent[3] - extent[2] + 1;
-  dims[2] = extent[5] - extent[4] + 1;
-  vtkIdType imageSize = dims[0]*dims[1]*dims[2];
-
-  // if we currently have scalars then just adjust the size
-  scalars = sg->GetPointData()->GetScalars();
-  if (scalars && scalars->GetDataType() == newType
-      && scalars->GetReferenceCount() == 1)
-    {
-    scalars->SetNumberOfComponents(newNumComp);
-    scalars->SetNumberOfTuples(imageSize);
-    // Since the execute method will be modifying the scalars
-    // directly.
-    scalars->Modified();
-    return;
-    }
-
-  // allocate the new scalars
-  scalars = vtkDataArray::CreateDataArray(newType);
-  scalars->SetNumberOfComponents(newNumComp);
-
-  // allocate enough memory
-  scalars->SetNumberOfTuples(imageSize);
-
-  sg->GetPointData()->SetScalars(scalars);
-  scalars->Delete();
-}
-
-
-//----------------------------------------------------------------------------
-int vtkStructuredGridLIC2D::RequestData(
-  vtkInformation        * vtkNotUsed(request),
-  vtkInformationVector ** inputVector,
-  vtkInformationVector  * outputVector )
-{
-  // 3 passes:
-  // pass 1: render to compute the transformed vector field for the points.
-  // pass 2: perform LIC with the new vector field. This has to happen in a
-  // different pass than computation of the transformed vector.
-  // pass 3: Render structured slice quads with correct texture correct
-  // tcoords and apply the LIC texture to it.
-
-  vtkInformation    * inInfo = inputVector[0]->GetInformationObject(0);
-  vtkStructuredGrid * input  = vtkStructuredGrid::SafeDownCast
-                   (  inInfo->Get( vtkDataObject::DATA_OBJECT() )  );
-
-  int inputRequestedExtent[6];
-  inInfo->Get(
-        vtkStreamingDemandDrivenPipeline::UPDATE_EXTENT(),
-        inputRequestedExtent);
-
-  // Check if the input image is a 2D image (not 0D, not 1D, not 3D)
-  int dims[3];
-  vtkStructuredExtent::GetDimensions( inputRequestedExtent, dims );
-
-  vtkDebugMacro( << "dims = " << dims[0] << " "
-                 << dims[1] << " " << dims[2] << endl );
-  vtkDebugMacro( << "requested ext = " << inputRequestedExtent[0] << " "
-                 << inputRequestedExtent[1] << " " << inputRequestedExtent[2]
-                 << " " << inputRequestedExtent[3] << " "
-                 << inputRequestedExtent[4] << " "
-                 << inputRequestedExtent[5] << endl );
-
-  if(   !( (dims[0] == 1) && (dims[1] > 1) && (dims[2] > 1) )
-     && !( (dims[1] == 1) && (dims[0] > 1) && (dims[2] > 1) )
-     && !( (dims[2] == 1) && (dims[0] > 1) && (dims[1] > 1) )
-    )
-    {
-    vtkErrorMacro( << "input is not a 2D image." << endl );
-    input  = NULL;
-    inInfo = NULL;
-    return 0;
-    }
-  if( input->GetPointData() == 0 )
-    {
-    vtkErrorMacro( << "input does not have point data." );
-    input  = NULL;
-    inInfo = NULL;
-    return 0;
-    }
-  if( input->GetPointData()->GetVectors() == 0 )
-    {
-    vtkErrorMacro( << "input does not vectors on point data." );
-    input  = NULL;
-    inInfo = NULL;
-    return 0;
-    }
-
-  if ( !this->Context )
-    {
-    vtkRenderWindow * renWin = vtkRenderWindow::New();
-    if (  this->SetContext( renWin ) == 0  )
-      {
-      vtkErrorMacro("Invalid render window");
-      renWin->Delete();
-      renWin = NULL;
-      input  = NULL;
-      inInfo = NULL;
-      return 0;
-      }
-
-    renWin = NULL; // to be released via this->context
-    this->OwnWindow = true;
-    }
-
-  vtkInformation    * outInfo = outputVector->GetInformationObject(0);
-  vtkStructuredGrid * output  = vtkStructuredGrid::SafeDownCast(
-    outInfo->Get(vtkDataObject::DATA_OBJECT()));
-  this->AllocateOutputData(output, outInfo);
-  output->ShallowCopy(input);
-
-  vtkInformation * outInfoTexture = outputVector->GetInformationObject(1);
-  vtkImageData   * outputTexture  = vtkImageData::SafeDownCast(
-    outInfoTexture->Get(vtkDataObject::DATA_OBJECT()));
-  this->AllocateOutputData(outputTexture, outInfoTexture);
-
-  // Noise.
-  vtkInformation *noiseInfo = inputVector[1]->GetInformationObject(0);
-  vtkImageData *noise = 0;
-  if (noiseInfo == 0)
-    {
-    this->NoiseSource->Update();
-    noise = this->NoiseSource->GetOutput();
-    }
-  else
-    {
-    noise = vtkImageData::SafeDownCast(
-      noiseInfo->Get(vtkDataObject::DATA_OBJECT()));
-
-    if(noise->GetPointData()==0)
-      {
-      vtkErrorMacro(<<"provided noise does not have point data.");
-      return 0;
-      }
-    if(noise->GetPointData()->GetScalars()==0)
-      {
-      vtkErrorMacro(<<"provided noise does not have scalars on point data.");
-      return 0;
-      }
-    }
-
-  vtkOpenGLClearErrorMacro();
-
-  int width;
-  int height;
-  int firstComponent;
-  int secondComponent;
-  int slice;
-  if (dims[0] == 1)
-    {
-    vtkDebugMacro( << "x" << endl );
-    firstComponent = 1;
-    secondComponent = 2;
-    slice = 0;
-    }
-  else
-    {
-    if (dims[1] == 1)
-      {
-      vtkDebugMacro( << "y" << endl );
-      firstComponent = 0;
-      secondComponent = 2;
-      slice = 1;
-      }
-    else
-      {
-      vtkDebugMacro( << "z" << endl );
-      firstComponent = 0;
-      secondComponent = 1;
-      slice = 2;
-      }
-    }
-
-  width = dims[firstComponent];
-  height = dims[secondComponent];
-
-  vtkDebugMacro( << "w = " << width << " h = " << height << endl );
-
-  vtkDataTransferHelper * vectorFieldBus = vtkDataTransferHelper::New();
-  vectorFieldBus->SetContext(this->Context);
-  vectorFieldBus->SetCPUExtent(inputRequestedExtent); // input->GetExtent());
-  vectorFieldBus->SetGPUExtent(inputRequestedExtent); // input->GetExtent());
-  //  vectorFieldBus->SetTextureExtent(input->GetExtent());
-  vectorFieldBus->SetArray(input->GetPointData()->GetVectors());
-
-  vtkDataTransferHelper * pointBus = vtkDataTransferHelper::New();
-  pointBus->SetContext(this->Context);
-  pointBus->SetCPUExtent(inputRequestedExtent); // input->GetExtent());
-  pointBus->SetGPUExtent(inputRequestedExtent); // input->GetExtent());
-  //  pointBus->SetTextureExtent(input->GetExtent());
-  pointBus->SetArray(input->GetPoints()->GetData());
-
-  // Vector field in image space.
-  int magWidth = this->Magnification*width;
-  int magHeight = this->Magnification*height;
-
-  vtkOpenGLRenderWindow *renWin =
-    vtkOpenGLRenderWindow::SafeDownCast(this->Context);
-  vtkTextureObject * vector2 = vtkTextureObject::New();
-  vector2->SetContext(renWin);
-  vector2->Create2D(magWidth,magHeight,3,VTK_FLOAT,false);
-
-  vtkDebugMacro( << "Vector field in image space (target) textureId = "
-                 << vector2->GetHandle() << endl );
-
-  vtkFrameBufferObject *fbo = vtkFrameBufferObject::New();
-  fbo->SetContext(renWin);
-  fbo->SetColorBuffer(0,vector2);
-  fbo->SetNumberOfRenderTargets(1);
-  fbo->SetActiveBuffer(0);
-
-  // TODO --
-  // step size is incorrect here
-  // guard pixels are needed for parallel operations
-
-  if (  !fbo->Start( magWidth, magHeight, false )  )
-    {
-    fbo->Delete();
-    vector2->Delete();
-    pointBus->Delete();
-    vectorFieldBus->Delete();
-
-    fbo = NULL;
-    vector2  = NULL;
-    pointBus = NULL;
-    vectorFieldBus   = NULL;
-
-    noise   = NULL;
-    input   = NULL;
-    inInfo  = NULL;
-    output  = NULL;
-    outInfo = NULL;
-    noiseInfo = NULL;
-    outputTexture  = NULL;
-    outInfoTexture = NULL;
-
-    this->FBOSuccess = 0;
-    return 0;
-    }
-  this->FBOSuccess = 1;
-
-  // build the shader program
-  this->LICProgram = new vtkOpenGLHelper;
-  std::string VSSource = vtkTextureObjectVS;
-  std::string FSSource = vtkStructuredGridLIC2D_fs;
-  std::string GSSource;
-  this->LICProgram->Program =
-    renWin->GetShaderCache()->ReadyShaderProgram(
-      VSSource.c_str(),
-      FSSource.c_str(),
-      GSSource.c_str());
-  vtkShaderProgram *pgm = this->LICProgram->Program;
-
-  float fvalues[3];
-  fvalues[0] = static_cast<float>(dims[0]);
-  fvalues[1] = static_cast<float>(dims[1]);
-  fvalues[2] = static_cast<float>(dims[2]);
-  pgm->SetUniform3f("uDimensions",fvalues);
-  pgm->SetUniformi("uSlice",slice);
-
-  pointBus->Upload(0,0);
-  vtkTextureObject *points = pointBus->GetTexture();
-  points->SetWrapS(vtkTextureObject::ClampToEdge);
-  points->SetWrapT(vtkTextureObject::ClampToEdge);
-  points->SetWrapR(vtkTextureObject::ClampToEdge);
-
-  vectorFieldBus->Upload(0,0);
-  vtkTextureObject *vectorField = vectorFieldBus->GetTexture();
-  vectorField->SetWrapS(vtkTextureObject::ClampToEdge);
-  vectorField->SetWrapT(vtkTextureObject::ClampToEdge);
-  vectorField->SetWrapR(vtkTextureObject::ClampToEdge);
-
-  points->Activate();
-  pgm->SetUniformi("texPoints",points->GetTextureUnit());
-  vectorField->Activate();
-  pgm->SetUniformi("texVectorField",vectorField->GetTextureUnit());
-
-  vtkOpenGLCheckErrorMacro("failed during config");
-
-  vtkDebugMacro( << "glFinish before rendering quad" << endl );
-
-  fbo->RenderQuad(0, magWidth-1,0, magHeight-1,
-    pgm, this->LICProgram->VAO);
-  vtkOpenGLCheckErrorMacro("StructuredGridLIC2D projection fialed");
-
-  vtkDebugMacro( << "glFinish after rendering quad" << endl );
-
-  vtkLineIntegralConvolution2D *internal = vtkLineIntegralConvolution2D::New();
-  if (  !internal->IsSupported( this->Context )  )
-    {
-    this->LICProgram->ReleaseGraphicsResources(renWin);
-    delete this->LICProgram;
-    this->LICProgram = 0;
-
-    fbo->Delete();
-    vector2->Delete();
-    internal->Delete();
-    pointBus->Delete();
-    vectorFieldBus->Delete();
-
-    fbo = NULL;
-    vector2  = NULL;
-    internal = NULL;
-    pointBus = NULL;
-    vectorFieldBus = NULL;
-
-    noise   = NULL;
-    input   = NULL;
-    inInfo  = NULL;
-    points  = NULL;
-    output  = NULL;
-    outInfo = NULL;
-    noiseInfo   = NULL;
-    vectorField = NULL;
-    outputTexture  = NULL;
-    outInfoTexture = NULL;
-
-    this->LICSuccess = 0;
-    return 0;
-    }
-
-  internal->SetContext(renWin);
-  internal->SetNumberOfSteps(this->Steps);
-  internal->SetStepSize(this->StepSize);
-  internal->SetComponentIds(firstComponent,secondComponent);
-
-  vtkDataTransferHelper *noiseBus = vtkDataTransferHelper::New();
-  noiseBus->SetContext(this->Context);
-  noiseBus->SetCPUExtent(noise->GetExtent());
-  noiseBus->SetGPUExtent(noise->GetExtent());
-  //  noiseBus->SetTextureExtent(noise->GetExtent());
-  noiseBus->SetArray(noise->GetPointData()->GetScalars());
-  noiseBus->Upload(0,0);
-
-  vtkTextureObject *licTex = internal->Execute(vector2, noiseBus->GetTexture());
-  if (licTex == NULL)
-    {
-    this->LICProgram->ReleaseGraphicsResources(renWin);
-    delete this->LICProgram;
-    this->LICProgram = 0;
-
-    fbo->Delete();
-    vector2->Delete();
-    internal->Delete();
-    pointBus->Delete();
-    noiseBus->Delete();
-    vectorFieldBus->Delete();
-
-    fbo = NULL;
-    vector2 = NULL;
-    internal = NULL;
-    pointBus = NULL;
-    noiseBus = NULL;
-    vectorFieldBus = NULL;
-
-    noise = NULL;
-    input = NULL;
-    inInfo = NULL;
-    points = NULL;
-    output = NULL;
-    outInfo = NULL;
-    noiseInfo = NULL;
-    vectorField = NULL;
-    outputTexture = NULL;
-    outInfoTexture = NULL;
-
-    this->LICSuccess = 0;
-    return 0;
-    }
-  this->LICSuccess = 1;
-
-  // transfer lic from texture to vtk array
-  vtkPixelExtent magLicExtent(magWidth, magHeight);
-  vtkIdType nOutTups = magLicExtent.Size();
-
-  vtkFloatArray *licOut = vtkFloatArray::New();
-  licOut->SetNumberOfComponents(3);
-  licOut->SetNumberOfTuples(nOutTups);
-  licOut->SetName("LIC");
-
-  vtkPixelBufferObject *licPBO = licTex->Download();
-
-  vtkPixelTransfer::Blit<float,float>(
-        magLicExtent,
-        magLicExtent,
-        magLicExtent,
-        magLicExtent,
-        4,
-        (float*)licPBO->MapPackedBuffer(),
-        3,
-        licOut->GetPointer(0));
-
-  licPBO->UnmapPackedBuffer();
-  licPBO->Delete();
-  licTex->Delete();
-
-  // mask and convert to gray scale 3 components
-  float *pLicOut = licOut->GetPointer(0);
-  for (vtkIdType i=0; i<nOutTups; ++i)
-    {
-    float lic = pLicOut[3*i];
-    float mask = pLicOut[3*i+1];
-    if ( mask )
-      {
-      pLicOut[3*i+1] = pLicOut[3*i+2] = pLicOut[3*i] = 0.0f;
-      }
-    else
-      {
-      pLicOut[3*i+1] = pLicOut[3*i+2] = lic;
-      }
-    }
-
-  outputTexture->GetPointData()->SetScalars(licOut);
-  licOut->Delete();
-
-  // Pass three. Generate texture coordinates. Software.
-  vtkFloatArray *tcoords = vtkFloatArray::New();
-  tcoords->SetNumberOfComponents(2);
-  tcoords->SetNumberOfTuples(dims[0]*dims[1]*dims[2]);
-  output->GetPointData()->SetTCoords(tcoords);
-  tcoords->Delete();
-
-  double ddim[3];
-  ddim[0] = static_cast<double>(dims[0]-1);
-  ddim[1] = static_cast<double>(dims[1]-1);
-  ddim[2] = static_cast<double>(dims[2]-1);
-
-  int tz = 0;
-  while(tz < dims[slice])
-    {
-    int ty = 0;
-    while(ty < dims[secondComponent])
-      {
-      int tx = 0;
-      while(tx < dims[firstComponent])
-        {
-        tcoords->SetTuple2(
-              (tz*dims[secondComponent]+ty)*dims[firstComponent]+tx,
-              tx/ddim[firstComponent],
-              ty/ddim[secondComponent]);
-        ++tx;
-        }
-      ++ty;
-      }
-    ++tz;
-    }
-
-  internal->Delete();
-  noiseBus->Delete();
-  vectorFieldBus->Delete();
-  pointBus->Delete();
-  vector2->Delete();
-  fbo->Delete();
-
-  this->LICProgram->ReleaseGraphicsResources(renWin);
-  delete this->LICProgram;
-  this->LICProgram = 0;
-
-  vtkOpenGLCheckErrorMacro("failed after RequestData");
-
-  return 1;
-}
-
-//----------------------------------------------------------------------------
-void vtkStructuredGridLIC2D::PrintSelf( ostream & os, vtkIndent indent )
-{
-  this->Superclass::PrintSelf( os, indent );
-
-  os << indent << "Steps: " << this->Steps << "\n";
-  os << indent << "StepSize: " << this->StepSize << "\n";
-  os << indent << "FBOSuccess: " << this->FBOSuccess << "\n";
-  os << indent << "LICSuccess: " << this->LICSuccess << "\n";
-  os << indent << "Magnification: " << this->Magnification << "\n";
-}
diff --git a/Rendering/LICOpenGL2/vtkStructuredGridLIC2D.h b/Rendering/LICOpenGL2/vtkStructuredGridLIC2D.h
deleted file mode 100644
index 56200bd..0000000
--- a/Rendering/LICOpenGL2/vtkStructuredGridLIC2D.h
+++ /dev/null
@@ -1,163 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkStructuredGridLIC2D.h
-
-  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.
-
-=========================================================================*/
-// .NAME vtkStructuredGridLIC2D
-// .SECTION Description
-// GPU implementation of a Line Integral Convolution, a technique for
-// imaging  vector fields.
-//
-// The input on port 0 is an 2D vtkStructuredGrid. It needs
-// a vector field on point data.
-// Port 1 is a special port for customized noise input. It is an optional port.
-// If not present, noise is generated by the filter. Even if none-power-of-two
-// texture are supported, giving a power-of-two image may result in faster
-// execution on the GPU.
-//
-// Please refer to Forssell, L. K., “Visualizing flow over curvilinear grid
-// surfaces using line integral convolution”, Visualization 94 Conference
-// Proceedings, pages 240-247, IEEE Computer Society, 1994 for details of the
-// algorithm.
-//
-// .SECTION Required OpenGL Extensions
-// GL_ARB_texture_non_power_of_two
-// GL_VERSION_2_0
-// GL_ARB_texture_float
-// GL_ARB_draw_buffers
-// GL_EXT_framebuffer_object
-// GL_ARB_pixel_buffer_object
-#ifndef vtkStructuredGridLIC2D_h
-#define vtkStructuredGridLIC2D_h
-
-#include "vtkRenderingLICOpenGL2Module.h" // For export macro
-#include "vtkStructuredGridAlgorithm.h"
-#include "vtkWeakPointer.h" // needed for vtkWeakPointer.
-
-class vtkImageNoiseSource;
-class vtkOpenGLHelper;
-class vtkRenderWindow;
-
-class VTKRENDERINGLICOPENGL2_EXPORT vtkStructuredGridLIC2D
-  : public vtkStructuredGridAlgorithm
-{
-public:
-  static vtkStructuredGridLIC2D* New();
-  vtkTypeMacro(vtkStructuredGridLIC2D, vtkStructuredGridAlgorithm);
-  void PrintSelf(ostream& os, vtkIndent indent);
-
-  // Description:
-  // Get/Set the context. Context must be a vtkOpenGLRenderWindow.
-  // This does not increase the reference count of the
-  // context to avoid reference loops.
-  // SetContext() may raise an error is the OpenGL context does not support the
-  // required OpenGL extensions. Return 0 upon failure and 1 upon success.
-  int SetContext( vtkRenderWindow * context );
-  vtkRenderWindow * GetContext();
-
-  // Description:
-  // Number of steps. Initial value is 1.
-  // class invariant: Steps>0.
-  // In term of visual quality, the greater the better.
-  vtkSetMacro(Steps,int);
-  vtkGetMacro(Steps,int);
-
-  // Description:
-  // Step size.
-  // WE ARE NOT SURE YET about the space where we define the step.
-  // If the image data has different spacing in each dimension, it
-  // is an issue.
-  // Initial value is 1.0.
-  // class invariant: StepSize>0.0.
-  // In term of visual quality, the smaller the better.
-  // The type for the interface is double as VTK interface is double
-  // but GPU only supports float. This value will be converted to
-  // float in the execution of the algorithm.
-  vtkSetMacro(StepSize,double);
-  vtkGetMacro(StepSize,double);
-
-  // Description:
-  // The the magnification factor. Default is 1
-  vtkSetClampMacro(Magnification, int, 1, VTK_INT_MAX);
-  vtkGetMacro(Magnification, int);
-
-  // Description:
-  // Check if FBO is started properly.
-  int   GetFBOSuccess() { return this->FBOSuccess; }
-
-  // Description:
-  // Check if LIC runs properly.
-  int   GetLICSuccess() { return this->LICSuccess; }
-
-//BTX
-protected:
-  vtkStructuredGridLIC2D();
-  ~vtkStructuredGridLIC2D();
-
-  // Description:
-  // Fill the input port information objects for this algorithm.  This
-  // is invoked by the first call to GetInputPortInformation for each
-  // port so subclasses can specify what they can handle.
-  // Redefined from the superclass.
-  virtual int FillInputPortInformation(int port,
-                                       vtkInformation *info);
-
-  // Description:
-  // Fill the output port information objects for this algorithm.
-  // This is invoked by the first call to GetOutputPortInformation for
-  // each port so subclasses can specify what they can handle.
-  // Redefined from the superclass.
-  virtual int FillOutputPortInformation(int port,
-                                        vtkInformation *info);
-
-  virtual int RequestInformation(vtkInformation *request,
-         vtkInformationVector **inputVector,
-         vtkInformationVector *outputVector);
-
-  int RequestUpdateExtent (vtkInformation *request,
-                           vtkInformationVector **inputVector,
-                           vtkInformationVector *outputVector);
-
-  // Description:
-  // Stolen from vtkImageAlgorithm. Should be in vtkStructuredGridAlgorithm.
-  void AllocateOutputData(vtkDataObject *output,
-                          vtkInformation *outInfo);
-
-  // Description:
-  // Stolen from vtkImageData. Should be in vtkStructuredGrid.
-  void AllocateScalars(vtkStructuredGrid *sg, vtkInformation *outInfo);
-
-  // Description:
-  // This is called by the superclass.
-  // This is the method you should override.
-  virtual int RequestData(vtkInformation *request,
-                          vtkInformationVector **inputVector,
-                          vtkInformationVector *outputVector);
-
-  int    Steps;
-  double StepSize;
-  int    Magnification;
-  vtkWeakPointer<vtkRenderWindow> Context;
-
-  vtkImageNoiseSource* NoiseSource;
-  bool   OwnWindow;
-  int    FBOSuccess;
-  int    LICSuccess;
-  vtkOpenGLHelper *LICProgram;
-
-private:
-  vtkStructuredGridLIC2D(const vtkStructuredGridLIC2D&); // Not implemented.
-  void operator=(const vtkStructuredGridLIC2D&); // Not implemented.
-//ETX
-};
-
-#endif
diff --git a/Rendering/LICOpenGL2/vtkStructuredGridLIC2D_fs.glsl b/Rendering/LICOpenGL2/vtkStructuredGridLIC2D_fs.glsl
deleted file mode 100644
index f8c5623..0000000
--- a/Rendering/LICOpenGL2/vtkStructuredGridLIC2D_fs.glsl
+++ /dev/null
@@ -1,165 +0,0 @@
-//=========================================================================
-//
-//  Program:   Visualization Toolkit
-//  Module:    vtkStructuredGridLIC2D_fs.glsl
-//
-//  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.
-//
-//=========================================================================
-
-// Filename: vtkStructuredGridLIC2D_fs.glsl
-// Filename is useful when using gldb-gui
-
-// The following line handles system declarations such as
-// default precisions, or defining precisions to null
-//VTK::System::Dec
-
-// the output of this shader
-//VTK::Output::Dec
-
-varying vec2 tcoordVC;
-
-/*
-For an input structure grid, this computes the inverse jacobian for each point.
-*/
-
-uniform sampler2D texPoints;  // point coordinates
-uniform sampler2D texVectorField; // vector field.
-uniform vec3 uDimensions;     // structured dimensions; initially == (width, height, 1)
-
-uniform int uSlice; // 0,1,2
-
-ivec3 getIJK(vec3 ninjnk, vec3 dims)
-{
-  return ivec3(floor(ninjnk * (dims - 1.0) + vec3(0.5, 0.5, 0.5)));
-}
-
-vec3 getVector(ivec3 ijk, vec3 dims, sampler2D field)
-{
-  // ignoring k component for now since dims =  (width, height, 1)
-  // not any more.
-  vec3 rcoord = vec3(ijk) / max(vec3(1.0), dims - 1.0);
-  vec2 tcoord;
-
-  if(uSlice == 0)
-   {
-    tcoord.xy = rcoord.yz;
-   }
-  else
-  {
-   if(uSlice == 1)
-    {
-     tcoord.xy = rcoord.xz;
-    }
-    else
-    {
-     tcoord.xy = rcoord.xy;
-    }
-  }
-
-  return texture2D(field, tcoord).xyz;
-}
-
-float vtkDeterminant(mat3 m)
-{
-  // develop determinant along first row.
-  return m[0][0]*(m[2][2]*m[1][1] - m[2][1]*m[1][2])
-       - m[1][0]*(m[2][2]*m[0][1] - m[2][1]*m[0][2])
-       + m[2][0]*(m[1][2]*m[0][1] - m[1][1]*m[0][2]);
-}
-
-mat3 vtkInverse(mat3 mm, float det)
-{
-  mat3 m=transpose(mm);
-
-  mat3 adjM = mat3(
-    m[2][2]*m[1][1]-m[2][1]*m[1][2], -(m[2][2]*m[0][1]-m[2][1]*m[0][2]),  m[1][2]*m[0][1]-m[1][1]*m[0][2],
-  -(m[2][2]*m[1][0]-m[2][0]*m[1][2]),  m[2][2]*m[0][0]-m[2][0]*m[0][2], -(m[1][2]*m[0][0]-m[1][0]*m[0][2]),
-    m[2][1]*m[1][0]-m[2][0]*m[1][1], -(m[2][1]*m[0][0]-m[2][0]*m[0][1]),  m[1][1]*m[0][0]-m[1][0]*m[0][1]
-  );
-
-  return adjM / det;
-}
-
-mat3 vtkJacobian(ivec3 ijk, vec3 dims, sampler2D tex)
-{
-  // Jacobian is estimated with a central finite difference technique.
-  /*
-  | dx/di, dx/dj, dx/dk |
-  | dy/di, dy/dj, dy/dk |
-  | dz/di, dz/dj, dz/dk |
-  */
-
-  //(i-1, j, k), (i+1, j, k)
-  vec3 pts_IM1_J_K = getVector(ivec3(ijk.x-1, ijk.yz), dims, tex);
-  vec3 pts_I1_J_K = getVector(ivec3(ijk.x+1, ijk.yz), dims, tex);
-
-  //   (i, j-1, k), (i, j+1, k)
-  vec3 pts_I_JM1_K = getVector(ivec3(ijk.x, ijk.y-1, ijk.z), dims, tex);
-  vec3 pts_I_J1_K = getVector(ivec3(ijk.x, ijk.y+1, ijk.z), dims, tex);
-
-  // (i, j, k-1), (i, j, k+1).
-  vec3 pts_I_J_KM1 = getVector(ivec3(ijk.xy, ijk.z-1), dims, tex);
-  vec3 pts_I_J_K1 = getVector(ivec3(ijk.xy, ijk.z+1), dims, tex);
-
-  vec3 col1 = 0.5 * (pts_I1_J_K - pts_IM1_J_K);
-  vec3 col2 = 0.5 * (pts_I_J1_K - pts_I_JM1_K);
-  vec3 col3 = 0.5 * (pts_I_J_K1 - pts_I_J_KM1);
-
- if(uSlice == 0)
-  {
-    col1[0] = 1.0;
-  }
- else
-  {
-     if(uSlice == 1)
-      {
-      col2[1] = 1.0;
-      }
-     else
-      {
-      col3[2] = 1.0;
-      }
-  }
-
-  mat3 J = mat3(col1, col2, col3);
-  return J;
-}
-
-void main(void)
-{
-  // determine the structured coordinate for the current location.
-  vec3 tcoord;
-  if (uSlice == 0)
-  {
-   tcoord = vec3(0, tcoordVC.st);
-  }
-  else
-  {
-   if (uSlice == 1)
-    {
-     tcoord = vec3(tcoordVC.s, 0, tcoordVC.t);
-    }
-   else
-    {
-     tcoord = vec3(tcoordVC.st, 0);
-    }
-  }
-
-  ivec3 ijk = getIJK(tcoord, uDimensions);
-
-  // compute partial derivative for X.
-  mat3 J = vtkJacobian(ijk, uDimensions, texPoints);
-
-  // compute inverse of J.
-  vec3 vector = getVector(ijk, uDimensions, texVectorField);
-  float detJ = vtkDeterminant(J);
-  mat3 invJ = vtkInverse(J, detJ);
-  gl_FragData[0] = vec4(invJ * vector, 1.0);
-}
diff --git a/Rendering/LICOpenGL2/vtkSurfaceLICComposite.cxx b/Rendering/LICOpenGL2/vtkSurfaceLICComposite.cxx
deleted file mode 100644
index bd90b77..0000000
--- a/Rendering/LICOpenGL2/vtkSurfaceLICComposite.cxx
+++ /dev/null
@@ -1,425 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkSurfaceLICComposite.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 "vtkSurfaceLICComposite.h"
-
-#include "vtkObjectFactory.h"
-#include "vtkPixelExtent.h"
-#include "vtkPixelExtentIO.h"
-
-#include <algorithm>
-
-using std::deque;
-using std::vector;
-
-// Enable debug output
-// 0 -- off
-// 1 -- dump extents
-// 2 -- all
-#define vtkSurfaceLICCompositeDEBUG 0
-
-//-----------------------------------------------------------------------------
-vtkObjectFactoryNewMacro(vtkSurfaceLICComposite);
-
-// ----------------------------------------------------------------------------
-vtkSurfaceLICComposite::vtkSurfaceLICComposite()
-        :
-     Pass(0),
-     WindowExt(),
-     BlockExts(),
-     CompositeExt(),
-     GuardExt(),
-     DisjointGuardExt(),
-     Strategy(COMPOSITE_AUTO),
-     StepSize(0),
-     NumberOfSteps(0),
-     NormalizeVectors(1),
-     NumberOfGuardLevels(1)
-{}
-
-// ----------------------------------------------------------------------------
-vtkSurfaceLICComposite::~vtkSurfaceLICComposite()
-{}
-
-// ----------------------------------------------------------------------------
-void vtkSurfaceLICComposite::Initialize(
-        const vtkPixelExtent &winExt,
-        const deque<vtkPixelExtent> &blockExts,
-        int strategy,
-        double stepSize,
-        int nSteps,
-        int normalizeVectors,
-        int enhancedLIC,
-        int antialias)
-{
-  this->Pass = 0;
-  this->WindowExt = winExt;
-  this->BlockExts = blockExts;
-  this->CompositeExt.clear();
-  this->GuardExt.clear();
-  this->DisjointGuardExt.clear();
-  this->Strategy = strategy;
-  this->StepSize = stepSize;
-  this->NumberOfSteps = nSteps;
-  this->NormalizeVectors = normalizeVectors;
-  // TODO -- FIXME
-  // type of NumberOfGuardLevels should be float. The change is
-  // fairly involved and needs to be thoroughly tested. Note too
-  // few gaurd pixels and you get an incorrect result, too many
-  // and you destroy performance and scaling. while getting this
-  // right the following will quiets dashboard warnings and keeps
-  // the existing well tested behavior.
-  this->NumberOfGuardLevels = 1;
-  //this->NumberOfGuardLevels = enhancedLIC ? 1.5 : 1;
-  this->NumberOfEEGuardPixels = enhancedLIC ? 1 : 0;
-  this->NumberOfAAGuardPixels = 2*antialias;
-}
-
-// ----------------------------------------------------------------------------
-int vtkSurfaceLICComposite::VectorMax(
-    const deque<vtkPixelExtent> &exts,
-    float *vectors,
-    vector<float> &vMax)
-{
-  #if vtkSurfaceLICCompositeDEBUG >= 2
-  cerr << "=====vtkSurfaceLICComposite::VectorMax" << endl;
-  #endif
-
-  // find the max on each extent
-  size_t nBlocks = exts.size();
-  vector<float> tmpMax(nBlocks, 0.0f);
-  for (size_t b=0; b<nBlocks; ++b)
-    {
-    tmpMax[b] = this->VectorMax(exts[b], vectors);
-    }
-
-  // use larger of this extent and its neighbors
-  vMax.resize(nBlocks, 0.0f);
-  for (size_t a=0; a<nBlocks; ++a)
-    {
-    vtkPixelExtent extA = exts[a];
-    extA.Grow(1);
-    for (size_t b=0; b<nBlocks; ++b)
-      {
-      vtkPixelExtent extB = exts[b];
-      extB&=extA;
-
-      // it's a neighbor(or self) use the larger of ours and theirs
-      if (!extB.Empty())
-        {
-        vMax[a] = vMax[a] < tmpMax[b] ? tmpMax[b] : vMax[a];
-        }
-      }
-    }
-
-  return 0;
-}
-
-// ----------------------------------------------------------------------------
-float vtkSurfaceLICComposite::VectorMax(
-    const vtkPixelExtent &ext,
-    float *vectors)
-{
-  #if vtkSurfaceLICCompositeDEBUG >= 2
-  cerr << "=====vtkSurfaceLICComposite::VectorMax" << endl;
-  #endif
-
-  int nx[2];
-  this->WindowExt.Size(nx);
-
-  // find the max over this region
-  // scaling by 1/nx since that's what LIC'er does.
-  float eMax = 0.0;
-  for (int j=ext[2]; j<=ext[3]; ++j)
-    {
-    int idx = 4*(nx[0]*j+ext[0]);
-    for (int i=ext[0]; i<=ext[1]; ++i, idx+=4)
-      {
-      float eMag = 0.0;
-      for (int c=0; c<2; ++c)
-        {
-        float eVec = vectors[idx+c]/static_cast<float>(nx[c]);
-        eMag += eVec*eVec;
-        }
-      eMag = sqrt(eMag);
-      eMax = eMax < eMag ? eMag : eMax;
-      }
-    }
-
-  return eMax;
-}
-
-// ----------------------------------------------------------------------------
-int vtkSurfaceLICComposite::MakeDecompDisjoint(
-     const deque<vtkPixelExtent> &in,
-     deque<vtkPixelExtent> &out,
-     float *vectors)
-{
-  #if vtkSurfaceLICCompositeDEBUG >= 2
-  cerr << "=====vtkSurfaceLICComposite::MakeDecompDisjoint" << endl;
-  #endif
-
-  // serial implementation
-
-  // sort by size
-  deque<vtkPixelExtent> tmpIn(in);
-  sort(tmpIn.begin(), tmpIn.end());
-
-  // from largest to smallest, make it disjoint
-  // to others. This order has the best chance of
-  // leaving each rank with some data.
-  deque<vtkPixelExtent> tmpOut0;
-
-  this->MakeDecompDisjoint(tmpIn, tmpOut0);
-
-  // minimize and remove empty extents.
-  int nx[2];
-  this->WindowExt.Size(nx);
-  while(!tmpOut0.empty())
-    {
-    vtkPixelExtent outExt = tmpOut0.back();
-    tmpOut0.pop_back();
-
-    GetPixelBounds(vectors, nx[0], outExt);
-    if (!outExt.Empty())
-      {
-      out.push_back(outExt);
-      }
-    }
-
-  /*
-  // merge compatible extents
-  vtkPixelExtent::Merge(tmpOut0);
-  */
-
-  return 0;
-}
-
-// ----------------------------------------------------------------------------
-int vtkSurfaceLICComposite::MakeDecompDisjoint(
-     deque<vtkPixelExtent> &in,
-     deque<vtkPixelExtent> &out)
-{
-  while (!in.empty())
-    {
-    // for each element
-    deque<vtkPixelExtent> tmpOut(1, in.back());
-    in.pop_back();
-
-    // subtract other elements
-    // to make it disjoint
-    size_t ns = in.size();
-    for (size_t se=0; se<ns; ++se)
-      {
-      vtkPixelExtent &selem = in[se];
-      deque<vtkPixelExtent> tmpOut2;
-      size_t nl = tmpOut.size();
-      for (size_t le=0; le<nl; ++le)
-        {
-        vtkPixelExtent &lelem = tmpOut[le];
-        vtkPixelExtent::Subtract(lelem, selem, tmpOut2);
-        }
-      tmpOut = tmpOut2;
-      }
-
-    // append new disjoint elements
-    out.insert(out.end(), tmpOut.begin(), tmpOut.end());
-    }
-
-  return 0;
-}
-
-// TODO -- this is needed in part because our step size is incorrect
-// due to anisotropic (in aspect ratio) trasnsform to texture
-// space. see how we transform step size in surface lic painter.
-// also there is bleeding at the edges so you do need a bit extra
-// paddding.
-// ----------------------------------------------------------------------------
-float vtkSurfaceLICComposite::GetFudgeFactor(int nx[2])
-{
-  float aspect = float(nx[0])/float(nx[1]);
-  float fudge
-    = (aspect > 4.0f) ? 3.0f :
-      (aspect > 1.0f) ? (2.0f/3.0f)*aspect + (5.0f/6.0f) :
-      (aspect < 0.25) ? 3.0f :
-      (aspect < 1.0f) ? (-8.0f/3.0f)*aspect + (25.0f/6.0f) :
-      1.5f;
-  return fudge;
-}
-
-// ----------------------------------------------------------------------------
-int vtkSurfaceLICComposite::AddGuardPixels(
-      const deque<vtkPixelExtent> &exts,
-      deque<vtkPixelExtent> &guardExts,
-      deque<vtkPixelExtent> &disjointGuardExts,
-      float *vectors)
-{
-  #if vtkSurfaceLICCompositeDEBUG >= 2
-  cerr << "=====vtkSurfaceLICComposite::AddGuardPixles" << endl;
-  #endif
-
-  int nx[2];
-  this->WindowExt.Size(nx);
-  float fudge = this->GetFudgeFactor(nx);
-  float arc
-    = this->StepSize*this->NumberOfSteps*this->NumberOfGuardLevels*fudge;
-
-  if (this->NormalizeVectors)
-    {
-    // when normalizing velocity is always 1, all extents have the
-    // same number of gaurd cells.
-    int ng
-      = static_cast<int>(arc)
-      + this->NumberOfEEGuardPixels
-      + this->NumberOfAAGuardPixels;
-    ng = ng < 2 ? 2 : ng;
-    //cerr << "ng=" << ng << endl;
-    deque<vtkPixelExtent> tmpExts(exts);
-    size_t nExts = tmpExts.size();
-    // add guard pixels
-    for (size_t b=0; b<nExts; ++b)
-      {
-      tmpExts[b].Grow(ng);
-      tmpExts[b]&=this->DataSetExt;
-      }
-    guardExts=tmpExts;
-    // make sure it's disjoint
-    disjointGuardExts.clear();
-    this->MakeDecompDisjoint(tmpExts, disjointGuardExts);
-    }
-  else
-    {
-    // when not normailzing during integration we need max(V) on the LIC
-    // decomp. Each domain has the potential to require a unique number
-    // of gaurd cells.
-    vector<float> vectorMax;
-    this->VectorMax(
-            exts,
-            vectors,
-            vectorMax);
-    //cerr << "ng=";
-    deque<vtkPixelExtent> tmpExts(exts);
-    size_t nExts = tmpExts.size();
-    // add guard pixels
-    for (size_t b=0; b<nExts; ++b)
-      {
-      int ng
-        = static_cast<int>(vectorMax[b]*arc
-        + this->NumberOfEEGuardPixels
-        + this->NumberOfAAGuardPixels);
-      ng = ng<2 ? 2 : ng;
-      //cerr << " " << ng;
-      tmpExts[b].Grow(ng);
-      tmpExts[b]&=this->DataSetExt;
-      }
-    guardExts=tmpExts;
-    //cerr << endl;
-    // make sure it's disjoint
-    disjointGuardExts.clear();
-    this->MakeDecompDisjoint(tmpExts, disjointGuardExts);
-    }
-
-  return 0;
-}
-
-// ----------------------------------------------------------------------------
-void vtkSurfaceLICComposite::GetPixelBounds(
-      float *rgba,
-      int ni,
-      vtkPixelExtent &ext)
-{
-  vtkPixelExtent text;
-  for (int j=ext[2]; j<=ext[3]; ++j)
-    {
-    for (int i=ext[0]; i<=ext[1]; ++i)
-      {
-      if (rgba[4*(j*ni+i)+3] > 0.0f)
-        {
-        text[0] = text[0] > i ? i : text[0];
-        text[1] = text[1] < i ? i : text[1];
-        text[2] = text[2] > j ? j : text[2];
-        text[3] = text[3] < j ? j : text[3];
-        }
-      }
-    }
-  ext = text;
-}
-
-// ----------------------------------------------------------------------------
-int vtkSurfaceLICComposite::InitializeCompositeExtents(float *vectors)
-{
-  // determine screen bounds of all blocks
-  size_t nBlocks = this->BlockExts.size();
-  for (size_t b = 0; b<nBlocks; ++b)
-    {
-    this->DataSetExt |= this->BlockExts[b];
-    }
-
-  // Make all of the input block extents disjoint so that
-  // LIC is computed once per pixel.
-  this->MakeDecompDisjoint(this->BlockExts, this->CompositeExt, vectors);
-
-  // add gaurd cells to the new decomp that prevent artifacts
-  this->AddGuardPixels(
-        this->CompositeExt,
-        this->GuardExt,
-        this->DisjointGuardExt,
-        vectors);
-
-  #if vtkSurfaceLICCompositeDEBUG >= 1
-  vtkPixelExtentIO::Write(0, "SerViewExtent.vtk", this->WindowExt);
-  vtkPixelExtentIO::Write(0, "SerGeometryDecomp.vtk", this->BlockExts);
-  vtkPixelExtentIO::Write(0, "SerLICDecomp.vtk", this->CompositeExt);
-  vtkPixelExtentIO::Write(0, "SerLICDecompGuard.vtk", this->GuardExt);
-  vtkPixelExtentIO::Write(0, "SerLICDecompDisjointGuard.vtk", this->DisjointGuardExt);
-  #endif
-
-  return 0;
-}
-
-// ----------------------------------------------------------------------------
-void vtkSurfaceLICComposite::PrintSelf(ostream &os, vtkIndent indent)
-{
-  vtkObject::PrintSelf(os, indent);
-  os << *this << endl;
-}
-
-// ****************************************************************************
-ostream &operator<<(ostream &os, vtkSurfaceLICComposite &ss)
-{
-  os << "winExt=" << ss.WindowExt << endl;
-  os << "blockExts=" << endl;
-  size_t nExts = ss.BlockExts.size();
-  for (size_t i=0; i<nExts; ++i)
-    {
-    os << "  " << ss.BlockExts[i] << endl;
-    }
-  os << "compositeExts=" << endl;
-  nExts = ss.CompositeExt.size();
-  for (size_t i=0; i<nExts; ++i)
-    {
-    os << ss.CompositeExt[i] << endl;
-    }
-  os << "guardExts=" << endl;
-  for (size_t i=0; i<nExts; ++i)
-    {
-    os << ss.GuardExt[i] << endl;
-    }
-  os << "disjointGuardExts=" << endl;
-  for (size_t i=0; i<nExts; ++i)
-    {
-    os << ss.DisjointGuardExt[i] << endl;
-    }
-  return os;
-}
diff --git a/Rendering/LICOpenGL2/vtkSurfaceLICComposite.h b/Rendering/LICOpenGL2/vtkSurfaceLICComposite.h
deleted file mode 100644
index 4b204fb..0000000
--- a/Rendering/LICOpenGL2/vtkSurfaceLICComposite.h
+++ /dev/null
@@ -1,270 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkSurfaceLICComposite.h
-
-  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.
-
-=========================================================================*/
-// .NAME vtkSurfaceLICComposite -- To move data during parallel surface LIC
-// .SECTION Description
-// This class decomposes the image space and shuffles image space
-// data onto the new decomposition with the necessary guard cells
-// to prevent artifacts at the decomposition boundaries. After the
-// image LIC is computed on the new decomposition this class will
-// un-shuffle the computed LIC back onto the original decomposition
-
-#ifndef vtkSurfaceLICComposite_h
-#define vtkSurfaceLICComposite_h
-
-#include "vtkObject.h"
-#include "vtkRenderingLICOpenGL2Module.h" // for export macro
-#include "vtkPixelExtent.h" // for pixel extent
-#include <deque> // for deque
-#include <vector> // for vector
-
-class vtkFloatArray;
-class vtkOpenGLRenderWindow;
-class vtkTextureObject;
-class vtkPainterCommunicator;
-
-class VTKRENDERINGLICOPENGL2_EXPORT vtkSurfaceLICComposite : public vtkObject
-{
-public:
-  static vtkSurfaceLICComposite *New();
-  vtkTypeMacro(vtkSurfaceLICComposite, vtkObject);
-  virtual void PrintSelf(ostream &os, vtkIndent indent);
-
-  // Description:
-  // Initialize the object based on the following description of the
-  // blocks projected onto the render window. wholeExt describes the
-  // window size, originalExts describe each block's extent in window
-  // coords. stepSize is the window coordiniate integration step size.
-  // when inplace is true compositing happens on the original extent.
-  void Initialize(
-        const vtkPixelExtent &winExt,
-        const std::deque<vtkPixelExtent> &blockExts,
-        int strategy,
-        double stepSize,
-        int nSteps,
-        int normalizeVectors,
-        int enhancedLIC,
-        int anitalias);
-
-  // Description:
-  // Control the screen space decomposition. The available modes are:
-  //
-  // INPLACE
-  //   use the block decomp. This may result in LIC being computed
-  //   many times for the same pixels and an excessive amount of
-  //   IPC during compositing if any of the block extents cover
-  //   or intersect a number of block extents. The input data
-  //   needs to be shuffled but not unshuffled since for overlapping
-  //   regions LIC is computed by all proccesses that overlap.
-  //   If there is very little overlap between block extents
-  //   then this method is superior since no unshuffle is needed.
-  //
-  // INPLACE_DISJOINT
-  //   use a disjoint version of the block decomp. This will leave
-  //   non-overlapping data in place, reasigning overlaping regions
-  //   so that LIC is computed once for each pixel on the screen.
-  //   An unshuffle step to move data in overlapping region to all
-  //   processes that overlap.
-  //
-  // BALANCED
-  //   move to a new decomp where each rank gets an equal number
-  //   of pixels. This ensures the best load balancing during LIC
-  //   and that LIC is computed once for each pixel. In the worst
-  //   case each pixel will be shuffled and unshuffled.
-  //
-  // AUTO
-  //   Use a heuristic to select the mode.
-  enum {
-    COMPOSITE_INPLACE=0,
-    COMPOSITE_INPLACE_DISJOINT,
-    COMPOSITE_BALANCED,
-    COMPOSITE_AUTO
-    };
-  void SetStrategy(int val){ this->Strategy = val; }
-  int GetStrategy(){ return this->Strategy; }
-
-  // Description:
-  // Get the number of new extents assigned to this rank after
-  // the decomposition.
-  int GetNumberOfCompositeExtents() const
-    { return static_cast<int>(this->CompositeExt.size()); }
-
-  // Description:
-  // Get the extent of the domain over which to compute the LIC. This can
-  // be querried only after the Composite takes place.
-  const vtkPixelExtent &GetGuardExtent(int i=0) const
-    { return this->GuardExt[i]; }
-
-  const std::deque<vtkPixelExtent> &GetGuardExtents() const
-    { return this->GuardExt; }
-
-  // Description:
-  // Get the extent of the domain over which to compute the LIC. This can
-  // be querried only after the Composite takes place.
-  const vtkPixelExtent &GetDisjointGuardExtent(int i=0) const
-    { return this->DisjointGuardExt[i]; }
-
-  const std::deque<vtkPixelExtent> &GetDisjointGuardExtents() const
-    { return this->GuardExt; }
-
-  // Description:
-  // Get the extent of the domain over which to compute the LIC. This can
-  // be querried only after the Composite takes place.
-  const vtkPixelExtent &GetCompositeExtent(int i=0) const
-    { return this->CompositeExt[i]; }
-
-  const std::deque<vtkPixelExtent> &GetCompositeExtents() const
-    { return this->CompositeExt; }
-
-  // Description:
-  // Get the whole dataset extent (all blocks).
-  const vtkPixelExtent &GetDataSetExtent() const
-    { return this->DataSetExt; }
-
-  // Description:
-  // Get the whole window extent.
-  const vtkPixelExtent &GetWindowExtent() const
-    { return this->WindowExt; }
-
-  // Description:
-  // Set up for a serial run, makes the decomp disjoint and adds
-  // requisite guard pixles.
-  int InitializeCompositeExtents(float *vectors);
-
-  // Description:
-  // Set the rendering context. Must set prior to use. Reference is not
-  // held, so caller must ensure the renderer is not destroyed durring
-  // use.
-  virtual void SetContext(vtkOpenGLRenderWindow *){}
-  virtual vtkOpenGLRenderWindow *GetContext(){ return NULL; }
-
-  // Description:
-  // Set the communicator for parallel communication. A duplicate
-  // is not made. It is up to the caller to manage the life of
-  // the communicator such that it is around while this class
-  // needs it and is released after.
-  virtual void SetCommunicator(vtkPainterCommunicator*){}
-
-  // Description:
-  // Set the communicator to the default communicator
-  virtual void RestoreDefaultCommunicator(){}
-
-  // Description:
-  // Build programs to move data to the new decomp
-  // In parallel THIS IS A COLLECTIVE OPERATION
-  virtual int BuildProgram(float*){ return -1; }
-
-  // Description:
-  // Move a single buffer from the geometry decomp to the LIC decomp.
-  // THIS IS A COLLECTIVE OPERATION
-  virtual int Gather(void *, int, int, vtkTextureObject *&)
-    { return -1; }
-
-  // Description:
-  // Move a single buffer from the LIC decomp to the geometry decomp
-  // In parallel THIS IS A COLLECTIVE OPERATION
-  virtual int Scatter(void *, int, int, vtkTextureObject *&)
-    { return -1; }
-
-  // Description:
-  // Make a decomposition disjoint with respect to itself. Extents are
-  // removed from the input array and disjoint extents are appened onto
-  // the output array. This is a local operation.
-  static
-  int MakeDecompDisjoint(
-        std::deque<vtkPixelExtent> &in,
-        std::deque<vtkPixelExtent> &out);
-
-protected:
-  vtkSurfaceLICComposite();
-  ~vtkSurfaceLICComposite();
-
-  // Description:
-  // For serial run. Make a decomposition disjoint. Sorts extents and
-  // processes largest to smallest , repeatedly subtracting smaller
-  // remaining blocks from the largest remaining. Each extent in the
-  // new disjoint set is shrunk to tightly bound the vector data,
-  // extents with empty vectors are removed. This is a local operation
-  // since vector field is local.
-  int MakeDecompDisjoint(
-        const std::deque<vtkPixelExtent> &in,
-        std::deque<vtkPixelExtent> &out,
-        float *vectors);
-
-  // Description:
-  // Compute max(V) on the given extent.
-  float VectorMax(
-        const vtkPixelExtent &ext,
-        float *vectors);
-
-  // Description:
-  // Compute max(V) on a set of extents. Neighboring extents are
-  // including in the computation.
-  int VectorMax(
-        const std::deque<vtkPixelExtent> &exts,
-        float *vectors,
-        std::vector<float> &vMax);
-
-  // Description:
-  // Add guard pixels (Serial run)
-  int AddGuardPixels(
-      const std::deque<vtkPixelExtent> &exts,
-      std::deque<vtkPixelExtent> &guardExts,
-      std::deque<vtkPixelExtent> &disjointGuardExts,
-      float *vectors);
-
-  // Description:
-  // shrink pixel extent based on non-zero alpha channel values
-  void GetPixelBounds(
-      float *rgba,
-      int ni,
-      vtkPixelExtent &ext);
-
-  // Description:
-  // factor for determining extra padding for guard pixels.
-  // depends on window aspect ratio because of anisotropic
-  // transform to texture space. see note in implementation.
-  float GetFudgeFactor(int nx[2]);
-
-protected:
-  int Pass;                                    // id for mpi tagging
-
-  vtkPixelExtent WindowExt;                    // screen extent (screen size)
-  vtkPixelExtent DataSetExt;                   // screen extent of the dataset
-  std::deque<vtkPixelExtent> BlockExts;        // screen extents of blocks
-
-  std::deque<vtkPixelExtent> CompositeExt;     // screen extents after decomp
-  std::deque<vtkPixelExtent> GuardExt;         // screen extents w/ guard cells
-  std::deque<vtkPixelExtent> DisjointGuardExt; // screen extents w/ guard cells
-
-  int Strategy;                                // control for parallel composite
-
-  double StepSize;                             // window coordinates step size
-  int NumberOfSteps;                           // number of integration steps
-  int NormalizeVectors;                        // does integrator normailze
-  int NumberOfGuardLevels;                     // 1.5 if enhanced LIC 1 otherwise
-  int NumberOfEEGuardPixels;                   // 1 if enhanced LIC 0 otherwise
-  int NumberOfAAGuardPixels;                   // n antialias passes
-
-private:
-  vtkSurfaceLICComposite(const vtkSurfaceLICComposite&); // Not implemented
-  void operator=(const vtkSurfaceLICComposite&); // Not implemented
-
-  friend
-  ostream &operator<<(ostream &os, vtkSurfaceLICComposite &ss);
-};
-
-ostream &operator<<(ostream &os, vtkSurfaceLICComposite &ss);
-
-#endif
diff --git a/Rendering/LICOpenGL2/vtkSurfaceLICMapper.cxx b/Rendering/LICOpenGL2/vtkSurfaceLICMapper.cxx
deleted file mode 100644
index 06ab573..0000000
--- a/Rendering/LICOpenGL2/vtkSurfaceLICMapper.cxx
+++ /dev/null
@@ -1,3340 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkSurfaceLICMapper.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 "vtkSurfaceLICMapper.h"
-
-#include "vtkActor.h"
-#include "vtkBase64Utilities.h"
-#include "vtkBoundingBox.h"
-#include "vtkCellData.h"
-#include "vtkCompositeDataIterator.h"
-#include "vtkCompositeDataSet.h"
-#include "vtkFloatArray.h"
-#include "vtkFrameBufferObject2.h"
-#include "vtkGarbageCollector.h"
-#include "vtkGenericDataObjectReader.h"
-#include "vtkImageData.h"
-#include "vtkInformation.h"
-#include "vtkLineIntegralConvolution2D.h"
-#include "vtkMath.h"
-#include "vtkMatrix3x3.h"
-#include "vtkMatrix4x4.h"
-#include "vtkMinimalStandardRandomSequence.h"
-#include "vtkNew.h"
-#include "vtkNoise200x200.h"
-#include "vtkObjectFactory.h"
-#include "vtkOpenGLActor.h"
-#include "vtkOpenGLCamera.h"
-#include "vtkOpenGLError.h"
-#include "vtkOpenGLRenderUtilities.h"
-#include "vtkOpenGLRenderWindow.h"
-#include "vtkOpenGLShaderCache.h"
-#include "vtkPainterCommunicator.h"
-#include "vtkPixelBufferObject.h"
-#include "vtkPixelExtent.h"
-#include "vtkPointData.h"
-#include "vtkPolyData.h"
-#include "vtkProperty.h"
-#include "vtkRenderer.h"
-#include "vtkScalarsToColors.h"
-#include "vtkShaderProgram.h"
-#include "vtkSurfaceLICComposite.h"
-#include "vtkTextureObject.h"
-#include "vtkTextureObjectVS.h"
-
-
-
-#include <cassert>
-#include <cstring>
-#include <algorithm>
-#include <limits>
-#include <vector>
-#include <deque>
-#include <cstdlib>
-
-using std::vector;
-using std::deque;
-using std::string;
-
-typedef vtkLineIntegralConvolution2D vtkLIC2D;
-
-// use parallel timer for benchmarks and scaling
-// if not defined vtkTimerLOG is used.
-// #define vtkSurfaceLICMapperTIME
-#if !defined(vtkSurfaceLICMapperTIME)
-#include "vtkTimerLog.h"
-#endif
-
-// write intermediate results to disk for debugging
-#define vtkSurfaceLICMapperDEBUG 0
-#if vtkSurfaceLICMapperDEBUG >= 2
-#include "vtkTextureIO.h"
-#include <sstream>
-using std::ostringstream;
-//----------------------------------------------------------------------------
-static
-string mpifn(vtkPainterCommunicator *comm, const char *fn)
-{
-  ostringstream oss;
-  oss << comm->GetRank() << "_" << fn;
-  return oss.str();
-}
-#endif
-
-// Enable stream min/max computations. Streaming is accomplished
-// via PBO+glReadPixels to read just the regions we are updating.
-// Without streaming PBO+glGetTexImage is used to uplaod the entire
-// screen sized texture, of which (in parallel) we are updating only
-// a small part of.
-#define STREAMING_MIN_MAX
-
-// store depths in a texture. if not a renderbuffer object is used.
-// NOTE: this must be on because of a slight diffference in how
-// texture filtering is implemented by os mesa.
-#define USE_DEPTH_TEXTURE
-
-//#include "vtkSurfaceLICMapper_GeomFs.h"
-//#include "vtkSurfaceLICMapper_GeomVs.h"
-#include "vtkSurfaceLICMapper_SC.h"
-#include "vtkSurfaceLICMapper_CE.h"
-#include "vtkSurfaceLICMapper_DCpy.h"
-
-namespace vtkSurfaceLICMapperUtil
-{
-
-inline
-double vtkClamp(double val, const double& min, const double& max)
-{
-  val = (val < min)? min : val;
-  val = (val > max)? max : val;
-  return val;
-}
-
-// Description
-// find min/max of unmasked fragments across all regions
-// download the entire screen then search each region
-void FindMinMax(
-      vtkTextureObject *tex,
-      deque<vtkPixelExtent> &blockExts,
-      float &min,
-      float &max)
-{
-  // download entire screen
-  vtkPixelBufferObject *pbo = tex->Download();
-  float *pHSLColors = static_cast<float*>(pbo->MapPackedBuffer());
-  // search regions
-  int size0 = tex->GetWidth();
-  size_t nBlocks = blockExts.size();
-  for (size_t e=0; e<nBlocks; ++e)
-    {
-    const vtkPixelExtent &blockExt = blockExts[e];
-    for (int j=blockExt[2]; j<=blockExt[3]; ++j)
-      {
-      for (int i=blockExt[0]; i<=blockExt[1]; ++i)
-        {
-        size_t id = 4*(size0*j+i);
-        if (pHSLColors[id+3] != 0.0f)
-          {
-          float L = pHSLColors[id+2];
-          min = min > L ? L : min;
-          max = max < L ? L : max;
-          }
-        }
-      }
-    }
-  pbo->UnmapPackedBuffer();
-  pbo->Delete();
-  #if  vtkSurfaceLICMapperDEBUG >= 1
-  cerr << "min=" << min << " max=" << max << endl;
-  #endif
-}
-
-// Description
-// find min/max of unmasked fragments across all regions
-// download each search each region individually
-void StreamingFindMinMax(
-      vtkFrameBufferObject2 *fbo,
-      deque<vtkPixelExtent> &blockExts,
-      float &min,
-      float &max)
-{
-  size_t nBlocks = blockExts.size();
-  // initiate download
-  fbo->ActivateReadBuffer(1U);
-  vtkStaticCheckFrameBufferStatusMacro(GL_FRAMEBUFFER);
-  vector<vtkPixelBufferObject*> pbos(nBlocks, NULL);
-  for (size_t e=0; e<nBlocks; ++e)
-    {
-    pbos[e] = fbo->Download(
-          blockExts[e].GetData(),
-          VTK_FLOAT,
-          4,
-          GL_FLOAT,
-          GL_RGBA);
-    }
-  fbo->RemoveTexColorAttachment(GL_DRAW_FRAMEBUFFER, 0U);
-  fbo->RemoveTexColorAttachment(GL_DRAW_FRAMEBUFFER, 1U);
-  fbo->DeactivateDrawBuffers();
-  fbo->DeactivateReadBuffer();
-  // map search and release each region
-  for (size_t e=0; e<nBlocks; ++e)
-    {
-    vtkPixelBufferObject *&pbo = pbos[e];
-    float *pColors = (float*)pbo->MapPackedBuffer();
-
-    size_t n = blockExts[e].Size();
-    for (size_t i = 0; i<n; ++i)
-      {
-      if (pColors[4*i+3] != 0.0f)
-        {
-        float L = pColors[4*i+2];
-        min = min > L ? L : min;
-        max = max < L ? L : max;
-        }
-      }
-    pbo->UnmapPackedBuffer();
-    pbo->Delete();
-    pbo = NULL;
-    }
-  #if vtkSurfaceLICMapperDEBUG >= 1
-  cerr << "min=" << min << " max=" << max << endl;
-  #endif
-}
-
-/**
-integer log base 2
-*/
-int ilog2(unsigned int n)
-{
-  if (n == 0)
-    {
-    return -1;
-    }
-  unsigned int r = 0;
-  while ((n >>= 1))
-    {
-    r += 1;
-    }
-  return r;
-}
-
-/**
-An interface to a random number generator. We can't use
-c stdlib since we're not gauranteed to get consistent.
-sequences across platform or library version and that
-would prevent consistent output during regression tests.
-*/
-class RandomNumberGeneratorInterface
-{
-public:
-  RandomNumberGeneratorInterface()
-    {
-    this->RNG = vtkMinimalStandardRandomSequence::New();
-    }
-
-  ~RandomNumberGeneratorInterface()
-    {
-    this->RNG->Delete();
-    }
-
-  /**
-  Seed the random number generator
-  */
-  void SetSeed(int seedVal)
-    {
-    #if 0
-    srand(seedVal);
-    #else
-    this->RNG->SetSeed(seedVal);
-    #endif
-    }
-
-  /**
-  Get a random number in the range of 0 to 1.
-  */
-  double GetRandomNumber()
-  {
-    #if 0
-    double val = static_cast<double>(rand())/RAND_MAX;
-    #else
-    double val = this->RNG->GetValue();
-    this->RNG->Next();
-    #endif
-    return val;
-  }
-
-private:
-  void operator=(const RandomNumberGeneratorInterface &); // not implemented
-  RandomNumberGeneratorInterface(const RandomNumberGeneratorInterface &); // not implemented
-
-private:
-  vtkMinimalStandardRandomSequence *RNG;
-};
-
-/**
-2D Noise Generator. Generate arrays for use as noise texture
-in the LIC algorithm. Can generate noise with uniform or Gaussian
-distributions, with a desired number of noise levels, and a
-desired frequency (f < 1 is impulse noise).
-*/
-class RandomNoise2D
-{
-public:
-  RandomNoise2D(){}
-
-  // Description:
-  // Generate a patch of random gray scale values along with an
-  // alpha channel (in vtk array format). The data should be
-  // deleted by later calling DeleteValues. Grain size and sideLen
-  // may be modified to match the noise generator requirements,
-  // returned arrays will be sized accordingly.
-  //
-  // type              - UNIFORM=0, GAUSSIAN=1, PERLIN=2
-  // sideLen           - side length of square patch in pixels (in/out)
-  // grainSize         - grain size of noise values in pixels (in/out)
-  // nLevels           - number of noise intesity levels
-  // minNoiseVal       - set the min for noise pixels (position distribution)
-  // maxNoiseVal       - set the max for noise pixels (position distribution)
-  // impulseProb       - probability of impulse noise,1 touches every pixel
-  // impulseBgNoiseVal - set the background color for impulse noise
-  // seed              - seed for random number generator
-  enum {
-    UNIFORM = 0,
-    GAUSSIAN = 1,
-    PERLIN = 2
-    };
-  float *Generate(
-        int type,
-        int &sideLen,
-        int &grainLize,
-        float minNoiseVal,
-        float maxNoiseVal,
-        int nLevels,
-        double impulseProb,
-        float impulseBgNoiseVal,
-        int seed);
-
-  // Description
-  // Delete the passed in array of values.
-  void DeleteValues(unsigned char *vals){ free(vals); }
-
-private:
-  // Description:
-  // Generate noise with a uniform distribution.
-  float *GenerateUniform(
-        int sideLen,
-        int grainLize,
-        float minNoiseVal,
-        float maxNoiseVal,
-        int nLevels,
-        double impulseProb,
-        float impulseBgNoiseVal,
-        int seed);
-
-  // Description:
-  // Generate noise with a Gaussian distribution.
-  float *GenerateGaussian(
-        int sideLen,
-        int grainLize,
-        float minNoiseVal,
-        float maxNoiseVal,
-        int nLevels,
-        double impulseProb,
-        float impulseBgNoiseVal,
-        int seed);
-
-  // Description:
-  // Generate Perlin noise with a Gaussian distribution.
-  float *GeneratePerlin(
-        int sideLen,
-        int grainLize,
-        float minNoiseVal,
-        float maxNoiseVal,
-        int nLevels,
-        double impulseProb,
-        float impulseBgNoiseVal,
-        int seed);
-
-  // Description:
-  // A way of controling the probability (from 0.0 to 1.0) that you
-  // generate values. returns 1 if you should generate a value.
-  // for example this is used to control the frequency of impulse
-  // noise.
-  int ShouldGenerateValue(double prob);
-
-  // Description:
-  // Get a valid the length of the side of the patch and grains size in pixels
-  // given a desired patch side length and a grain size. This ensures that all
-  // grains are the same size.
-  void GetValidDimensionAndGrainSize(int type, int &dim, int &grainSize);
-
-private:
-  RandomNumberGeneratorInterface ValueGen;
-  RandomNumberGeneratorInterface ProbGen;
-};
-
-//-----------------------------------------------------------------------------
-void RandomNoise2D::GetValidDimensionAndGrainSize(int type, int &sideLen, int &grainSize)
-{
-  // perlin noise both side len and grain size need to be powers of 2
-  if (type == PERLIN)
-    {
-    sideLen = 1 << ilog2(sideLen);
-    grainSize = 1 << ilog2(grainSize);
-    }
-
-  // grains can't be larger than the patch
-  if (sideLen < grainSize)
-    {
-    sideLen = grainSize;
-    }
-
-  // generate noise with agiven grainSize size on the patch
-  if (sideLen % grainSize)
-    {
-    // grainSize is not an even divsior of sideLen, adjust sideLen to
-    // next larger even divisor
-    sideLen = grainSize * (sideLen/grainSize + 1);
-    }
-}
-
-//-----------------------------------------------------------------------------
-int RandomNoise2D::ShouldGenerateValue(double prob)
-{
-  if (this->ProbGen.GetRandomNumber() > (1.0 - prob))
-    {
-    return 1;
-    }
-  return 0;
-}
-
-//-----------------------------------------------------------------------------
-float *RandomNoise2D::Generate(
-      int type,
-      int &sideLen,
-      int &grainSize,
-      float minNoiseVal,
-      float maxNoiseVal,
-      int nLevels,
-      double impulseProb,
-      float impulseBgNoiseVal,
-      int seed)
-{
-  this->GetValidDimensionAndGrainSize(type, sideLen, grainSize);
-
-  switch (type)
-    {
-    case GAUSSIAN:
-      return this->GenerateGaussian(
-            sideLen,
-            grainSize,
-            minNoiseVal,
-            maxNoiseVal,
-            nLevels,
-            impulseProb,
-            impulseBgNoiseVal,
-            seed);
-
-    case UNIFORM:
-      return this->GenerateUniform(
-            sideLen,
-            grainSize,
-            minNoiseVal,
-            maxNoiseVal,
-            nLevels,
-            impulseProb,
-            impulseBgNoiseVal,
-            seed);
-
-    case PERLIN:
-      return this->GeneratePerlin(
-            sideLen,
-            grainSize,
-            minNoiseVal,
-            maxNoiseVal,
-            nLevels,
-            impulseProb,
-            impulseBgNoiseVal,
-            seed);
-    }
-  return NULL;
-}
-
-//-----------------------------------------------------------------------------
-float *RandomNoise2D::GenerateUniform(
-      int sideLen,
-      int grainSize,
-      float minNoiseVal,
-      float maxNoiseVal,
-      int nLevels,
-      double impulseProb,
-      float impulseBgNoiseVal,
-      int seed)
-{
-  // generate a patch of single pixel random values
-  // with a uniform distribution and fixed number of levels
-  nLevels = nLevels < 1 ? 1 : nLevels;
-  int maxLevel = nLevels-1;
-  float delta = maxLevel != 0 ? 1.0f/maxLevel : 0.0f;
-  minNoiseVal = minNoiseVal < 0.0f ? 0.0f : minNoiseVal;
-  maxNoiseVal = maxNoiseVal > 1.0f ? 1.0f : maxNoiseVal;
-  float noiseRange = maxNoiseVal - minNoiseVal;
-  impulseProb = impulseProb < 0.0 ? 0.0 : impulseProb;
-  impulseProb = impulseProb > 1.0 ? 1.0 : impulseProb;
-  impulseBgNoiseVal = impulseBgNoiseVal < 0.0f ? 0.0f : impulseBgNoiseVal;
-  impulseBgNoiseVal = impulseBgNoiseVal > 1.0f ? 1.0f : impulseBgNoiseVal;
-  this->ValueGen.SetSeed(seed);
-  this->ProbGen.SetSeed(seed);
-  const int sdim = sideLen/grainSize;
-  const int sdim2 = sdim*sdim;
-  float *rvals=(float*)malloc(sdim2*sizeof(float));
-  for (int i=0; i<sdim2; ++i)
-    {
-    rvals[i] = impulseBgNoiseVal;
-    }
-  for (int j=0; j<sdim; ++j)
-    {
-     for (int i=0; i<sdim; ++i)
-       {
-       int idx=j*sdim+i;
-
-       if ((impulseProb == 1.0) || this->ShouldGenerateValue(impulseProb))
-         {
-         int l = static_cast<int>(this->ValueGen.GetRandomNumber()*nLevels);
-         l = l > maxLevel ? maxLevel : l; // needed for 1.0
-         rvals[idx] = nLevels == 1 ? maxNoiseVal : minNoiseVal + (l*delta) * noiseRange;
-         }
-       }
-    }
-
-  // map single pixel random values onto a patch of values of
-  // the requested grain size
-  const int ncomp = 2;
-  const int dim2 = sideLen*sideLen;
-  const int ntup = ncomp*dim2;
-  float *noise = (float*)malloc(ntup*sizeof(float));
-  for (int j=0; j<sideLen; ++j)
-    {
-     for (int i=0; i<sideLen; ++i)
-       {
-       int idx=ncomp*(j*sideLen+i);
-
-       int ii = i/grainSize;
-       int jj = j/grainSize;
-       int iidx = jj*sdim+ii;
-
-       noise[idx] = rvals[iidx];
-       noise[idx+1] = 1.0f; // alpha
-       }
-    }
-  free(rvals);
-
-  return noise;
-}
-
-//-----------------------------------------------------------------------------
-float *RandomNoise2D::GenerateGaussian(
-      int sideLen,
-      int grainSize,
-      float minNoiseVal,
-      float maxNoiseVal,
-      int nLevels,
-      double impulseProb,
-      float impulseBgNoiseVal,
-      int seed)
-{
-  // the distribution becomes Gaussian as N goes to infinity
-  const int N = 2048;
-
-  // generate a patch of single pixel random values
-  // with a gaussian distribution
-  impulseProb = impulseProb < 0.0 ? 0.0 : impulseProb;
-  impulseProb = impulseProb > 1.0 ? 1.0 : impulseProb;
-  impulseBgNoiseVal = impulseBgNoiseVal < 0.0f ? 0.0f : impulseBgNoiseVal;
-  impulseBgNoiseVal = impulseBgNoiseVal > 1.0f ? 1.0f : impulseBgNoiseVal;
-  this->ValueGen.SetSeed(seed);
-  this->ProbGen.SetSeed(seed);
-  const int sdim = sideLen/grainSize;
-  const int sdim2 = sdim*sdim;
-  float *rvals = (float*)malloc(sdim2*sizeof(float));
-  for (int i=0; i<sdim2; ++i)
-    {
-    rvals[i] = 0.0f;
-    }
-  for (int j=0; j<sdim; ++j)
-    {
-    for (int i=0; i<sdim; ++i)
-      {
-      int idx = j*sdim+i;
-
-      if ((impulseProb == 1.0) || this->ShouldGenerateValue(impulseProb))
-        {
-        double val = 0.0;
-        for (int q=0; q<N; ++q)
-          {
-          val += this->ValueGen.GetRandomNumber();
-          }
-        rvals[idx] = static_cast<float>(val);
-        }
-      }
-    }
-
-  // normalize noise field from eps to nLevels onto 0 to 1
-  // and restrict to the requested number of levels
-  // min/max
-  float minVal = static_cast<float>(N+1);
-  float maxVal = 0.0f;
-  for (int i=0; i<sdim2; ++i)
-    {
-    // for impulseProb < 1 background is 0 but pixels that are touched
-    // have a much larger value, after normalization the gaussian
-    // distribution is compressed and localized near 1. We can fix this
-    // by ignoring zero values.
-    minVal = impulseProb == 1.0 ?
-            (rvals[i] < minVal ? rvals[i] : minVal) :
-            (rvals[i] < minVal && rvals[i] > 0.0f ? rvals[i] : minVal);
-
-    maxVal = rvals[i]>maxVal ? rvals[i] : maxVal;
-    }
-  float maxMinDiff = maxVal-minVal;
-  // because we ignore zero when impulseProb<1 we have to be careful
-  // here so that we can support one noise level.
-  minVal = maxMinDiff == 0.0f ? 0.0f : minVal;
-  maxMinDiff = maxMinDiff == 0.0f ? (maxVal == 0.0f ? 1.0f : maxVal) : maxMinDiff;
-
-  nLevels = nLevels < 1 ? 1 : nLevels;
-  int maxLevel = nLevels-1;
-  float delta = maxLevel != 0 ? 1.0f/maxLevel : 0.0f;
-  minNoiseVal = minNoiseVal < 0.0f ? 0.0f : minNoiseVal;
-  maxNoiseVal = maxNoiseVal > 1.0f ? 1.0f : maxNoiseVal;
-  float noiseRange = maxNoiseVal - minNoiseVal;
-  for (int i=0; i<sdim2; ++i)
-    {
-    // normalize
-    float val = rvals[i] < minVal ? rvals[i] : (rvals[i] - minVal)/maxMinDiff;
-    // restrict
-    int l = static_cast<int>(val*nLevels);
-    l = l > maxLevel ? maxLevel : l;
-    rvals[i]
-       = rvals[i] < minVal ? impulseBgNoiseVal
-       : nLevels == 1 ? maxNoiseVal : minNoiseVal + (l*delta) * noiseRange;
-    }
-
-  // map single pixel random values onto a patch of values of
-  // the requested grain size
-  const int ncomp = 2;
-  const int dim2 = sideLen*sideLen;
-  const int ntup = ncomp*dim2;
-  float *noise = (float*)malloc(ntup*sizeof(float));
-  for (int j=0; j<sideLen; ++j)
-    {
-     for (int i=0; i<sideLen; ++i)
-       {
-       int idx = ncomp*(j*sideLen+i);
-
-       int ii = i/grainSize;
-       int jj = j/grainSize;
-       int iidx = jj*sdim+ii;
-
-       noise[idx] = rvals[iidx];
-       noise[idx+1] = 1.0; // alpha
-       }
-    }
-  free(rvals);
-
-  return noise;
-}
-
-//-----------------------------------------------------------------------------
-float *RandomNoise2D::GeneratePerlin(
-      int sideLen,
-      int grainSize,
-      float minNoiseVal,
-      float maxNoiseVal,
-      int nLevels,
-      double impulseProb,
-      float impulseBgNoiseVal,
-      int seed)
-{
-  // note: requires power of 2 sideLen, and sideLen > grainSize
-  const int ncomp = 2;
-  const int dim2 = sideLen*sideLen;
-  const int ntup = ncomp*dim2;
-  float *noise = static_cast<float*>(malloc(ntup*sizeof(float)));
-  for (int i=0; i<ntup; i+=2)
-    {
-    noise[i  ] = 0.0f;
-    noise[i+1] = 1.0f; // alpha channel
-    }
-
-  impulseProb = impulseProb < 0.0 ? 0.0 : impulseProb;
-  impulseProb = impulseProb > 1.0 ? 1.0 : impulseProb;
-  impulseBgNoiseVal = impulseBgNoiseVal < 0.0f ? 0.0f : impulseBgNoiseVal;
-  impulseBgNoiseVal = impulseBgNoiseVal > 1.0f ? 1.0f : impulseBgNoiseVal;
-  minNoiseVal = minNoiseVal < 0.0f ? 0.0f : minNoiseVal;
-  maxNoiseVal = maxNoiseVal > 1.0f ? 1.0f : maxNoiseVal;
-
-  //int nIter = ilog2(static_cast<unsigned int>(sideLen-1<nLevels ? sideLen-1 : nLevels));
-  int nIter = ilog2(static_cast<unsigned int>(grainSize));
-  for (int w=0; w<nIter; ++w)
-    {
-    // reduce range with grain size
-    float levelNoiseMin = 0.0f;
-    float levelNoiseMax = 0.1f + 0.9f/static_cast<float>(1<<(nIter-1-w));
-    //float levelNoiseMax = 1.0f - levelNoiseMin;
-    // generate a level of noise
-    int levelGrainSize = 1<<w;
-    float *levelNoise = GenerateGaussian(
-          sideLen,
-          levelGrainSize,
-          levelNoiseMin,
-          levelNoiseMax,
-          nLevels,
-          impulseProb,
-          impulseBgNoiseVal,
-          seed);
-    /*// smooth
-    int nsp = w;
-    for (int k=0; k<nsp; ++k)
-      {
-      for (int j=0; j<sideLen; ++j)
-        {
-         for (int i=0; i<sideLen; ++i)
-           {
-           float K[9] = {
-             0.0191724, 0.100120, 0.0191724,
-             0.1001200, 0.522831, 0.1001200,
-             0.0191724, 0.100120, 0.0191724
-             };
-           float val=0.0;
-           for (int q=0; q<3; ++q)
-             {
-             for (int p=0; p<3; ++p)
-               {
-               int ii = i+p-1;
-               ii = ii < 0 ? i : ii;
-               ii = ii >= sideLen ? i : ii;
-               int jj = j+q-1;
-               jj = jj < 0 ? j : jj;
-               jj = jj >= sideLen ? j : jj;
-               int idx = 2*(sideLen*jj+ii);
-               val += levelNoise[idx]*K[q*3+p];
-               }
-             }
-           levelNoise[2*(sideLen*j+i)] = val;
-           }
-        }
-      }*/
-    // accumulate
-    for (int i=0; i<ntup; i+=2)
-      {
-      noise[i] += levelNoise[i];
-      }
-    free(levelNoise);
-    }
-  // normalize
-  float minVal = static_cast<float>(nIter+1);
-  float maxVal = 0.0f;
-  for (int i=0; i<ntup; i+=2)
-    {
-    float val = noise[i];
-    minVal = val<minVal ? val : minVal;
-    maxVal = val>maxVal ? val : maxVal;
-    }
-  float maxMinDiff = maxVal - minVal;
-  if ( maxMinDiff <= 0.0f )
-    {
-    maxMinDiff = 1.0f;
-    minVal = 0.0f;
-    }
-  for (int i=0; i<ntup; i+=2)
-    {
-    noise[i] = (noise[i] - minVal) / maxMinDiff;
-    }
-  return noise;
-}
-
-/**
-Load a predefiined texture that has been "pickled" in a string.
-This texture is 200x200 pixles, has a Gaussian distribution, and
-intensities ranging between 0 and 206. This is the texture that
-is used when GenerateNoiseTexture is disabled.
-*/
-vtkImageData *vtkGetNoiseResource()
-{
-  std::string base64string;
-  for (unsigned int cc=0; cc < file_noise200x200_vtk_nb_sections; cc++)
-    {
-    base64string += reinterpret_cast<const char*>(file_noise200x200_vtk_sections[cc]);
-    }
-
-  unsigned char* binaryInput
-     = new unsigned char[file_noise200x200_vtk_decoded_length + 10];
-
-  unsigned long binarylength = vtkBase64Utilities::Decode(
-        reinterpret_cast<const unsigned char*>(base64string.c_str()),
-        static_cast<unsigned long>(base64string.length()),
-        binaryInput);
-
-  assert("check valid_length"
-    && (binarylength == file_noise200x200_vtk_decoded_length));
-
-  vtkGenericDataObjectReader* reader = vtkGenericDataObjectReader::New();
-  reader->ReadFromInputStringOn();
-
-  reader->SetBinaryInputString(
-        reinterpret_cast<char*>(binaryInput),
-        static_cast<int>(binarylength));
-
-  reader->Update();
-  vtkImageData* data = vtkImageData::New();
-  data->ShallowCopy(reader->GetOutput());
-
-  delete [] binaryInput;
-  reader->Delete();
-  return data;
-}
-
-};
-using namespace vtkSurfaceLICMapperUtil;
-
-/**
-Internal data
-*/
-class vtkSurfaceLICMapper::vtkInternals
-{
-public:
-  vtkWeakPointer<vtkOpenGLRenderWindow> Context;
-  bool GLSupport;
-  int Viewsize[2];
-  long long LastInputDataSetMTime;
-  long long LastPropertyMTime;
-  long long LastLUTMTime;
-
-  deque<vtkPixelExtent> BlockExts;
-  vtkPixelExtent DataSetExt;
-
-  bool ContextNeedsUpdate;
-  bool OutputDataNeedsUpdate;
-  bool CommunicatorNeedsUpdate;
-  bool GeometryNeedsUpdate;
-  bool GatherNeedsUpdate;
-  bool LICNeedsUpdate;
-  bool ColorNeedsUpdate;
-
-  vtkPainterCommunicator *Communicator;
-
-  #ifdef USE_DEPTH_TEXTURE
-  vtkSmartPointer<vtkTextureObject> DepthImage;
-  #else
-  vtkSmartPointer<vtkRenderbuffer> DepthImage;
-  #endif
-  vtkSmartPointer<vtkTextureObject> GeometryImage;
-  vtkSmartPointer<vtkTextureObject> VectorImage;
-  vtkSmartPointer<vtkTextureObject> CompositeVectorImage;
-  vtkSmartPointer<vtkTextureObject> MaskVectorImage;
-  vtkSmartPointer<vtkTextureObject> CompositeMaskVectorImage;
-  vtkSmartPointer<vtkTextureObject> NoiseImage;
-  vtkSmartPointer<vtkTextureObject> LICImage;
-  vtkSmartPointer<vtkTextureObject> RGBColorImage;
-  vtkSmartPointer<vtkTextureObject> HSLColorImage;
-  vtkSmartPointer<vtkImageData> Noise;
-
-  vtkSmartPointer<vtkFrameBufferObject2> FBO;
-
-  vtkOpenGLHelper *ColorPass;
-  vtkOpenGLHelper *ColorEnhancePass;
-  vtkOpenGLHelper *CopyPass;
-
-  vtkSmartPointer<vtkSurfaceLICComposite> Compositor;
-  vtkSmartPointer<vtkLineIntegralConvolution2D> LICer;
-
-  int FieldAssociation;
-  int FieldAttributeType;
-  std::string FieldName;
-  bool FieldNameSet;
-  bool HasVectors;
-
-
-
-  // Description:
-  // Constructor
-  vtkInternals()
-    {
-    this->Viewsize[0] = this->Viewsize[1] = 0;
-    this->LastInputDataSetMTime = 0;
-    this->LastPropertyMTime = 0;
-    this->LastLUTMTime = 0;
-    this->GLSupport = false;
-
-    this->ContextNeedsUpdate = true;
-    this->OutputDataNeedsUpdate = true;
-    this->CommunicatorNeedsUpdate = true;
-    this->GeometryNeedsUpdate = true;
-    this->LICNeedsUpdate = true;
-    this->GatherNeedsUpdate = true;
-    this->ColorNeedsUpdate = true;
-
-    this->Communicator = new vtkPainterCommunicator;
-
-    this->HasVectors = false;
-    this->FieldNameSet = false;
-    this->FieldAttributeType = 0;
-    this->FieldAssociation = 0;
-
-    this->ColorPass = NULL;
-    this->ColorEnhancePass = NULL;
-    this->CopyPass = NULL;
-    }
-
-  // Description:
-  // Destructor
-  ~vtkInternals()
-    {
-    this->ClearGraphicsResources();
-
-    if (this->ColorPass)
-      {
-      delete this->ColorPass;
-      }
-    if (this->ColorEnhancePass)
-      {
-      delete this->ColorEnhancePass;
-      }
-    if (this->CopyPass)
-      {
-      delete this->CopyPass;
-      }
-    this->ColorPass = NULL;
-    this->ColorEnhancePass = NULL;
-    this->CopyPass = NULL;
-
-
-    delete this->Communicator;
-    }
-
-  // Description:
-  // Check for OpenGL support
-  static bool IsSupported(vtkOpenGLRenderWindow *context)
-    {
-    if (context == NULL)
-      {
-      vtkGenericWarningMacro("OpenGL render window required");
-      return false;
-      }
-
-    bool lic2d = vtkLineIntegralConvolution2D::IsSupported(context);
-
-    bool floatFormats
-      = vtkTextureObject::IsSupported(context, true, true, false);
-
-    bool renderbuffer = true;
-    #if !defined(USE_DEPTH_TEXTURE)
-    renderbuffer = vtkRenderbuffer::IsSupported(context);
-    #endif
-
-    bool support = lic2d && floatFormats && renderbuffer;
-
-    if (!support)
-      {
-      vtkGenericWarningMacro(
-        << "SurfaceLIC is not supported" << endl
-        << context->GetClassName() << endl
-        << "LIC support = " << lic2d << endl
-        << "floating point texture formats = " << floatFormats << endl
-        << "render buffers = " << renderbuffer);
-      return false;
-      }
-    return true;
-    }
-
-  // Description:
-  // Free textures and shader programs we're holding a reference to.
-  void ClearGraphicsResources()
-    {
-    this->ClearTextures();
-
-    this->Compositor = NULL;
-    this->LICer = NULL;
-    this->FBO = NULL;
-    }
-
-  // Description:
-  // Free textures we're holding a reference to.
-  void ClearTextures()
-    {
-    this->DepthImage = NULL;
-    this->GeometryImage = NULL;
-    this->VectorImage = NULL;
-    this->MaskVectorImage = NULL;
-    this->CompositeVectorImage = NULL;
-    this->CompositeMaskVectorImage = NULL;
-    this->NoiseImage = NULL;
-    this->LICImage = NULL;
-    this->RGBColorImage = NULL;
-    this->HSLColorImage = NULL;
-    }
-
-  // Description:
-  // Allocate textures.
-  void AllocateTextures(
-        vtkOpenGLRenderWindow *context,
-        int *viewsize)
-    {
-    this->AllocateDepthTexture(context, viewsize, this->DepthImage);
-    this->AllocateTexture(context, viewsize, this->GeometryImage, vtkTextureObject::Nearest);
-    this->AllocateTexture(context, viewsize, this->VectorImage, vtkTextureObject::Linear);
-    this->AllocateTexture(context, viewsize, this->MaskVectorImage, vtkTextureObject::Linear);
-    this->AllocateTexture(context, viewsize, this->CompositeVectorImage, vtkTextureObject::Linear);
-    this->AllocateTexture(context, viewsize, this->CompositeMaskVectorImage, vtkTextureObject::Linear);
-    this->AllocateTexture(context, viewsize, this->LICImage, vtkTextureObject::Nearest);
-    this->AllocateTexture(context, viewsize, this->RGBColorImage, vtkTextureObject::Nearest);
-    this->AllocateTexture(context, viewsize, this->HSLColorImage, vtkTextureObject::Nearest);
-    }
-
-  // Description:
-  // Allocate a size texture, store in the given smart pointer.
-  void AllocateTexture(
-        vtkOpenGLRenderWindow *context,
-        int *viewsize,
-        vtkSmartPointer<vtkTextureObject> &tex,
-        int filter = vtkTextureObject::Nearest)
-    {
-    if ( !tex )
-      {
-      vtkTextureObject * newTex = vtkTextureObject::New();
-      newTex->SetContext(context);
-      newTex->SetBaseLevel(0);
-      newTex->SetMaxLevel(0);
-      newTex->SetWrapS(vtkTextureObject::ClampToEdge);
-      newTex->SetWrapT(vtkTextureObject::ClampToEdge);
-      newTex->SetMinificationFilter(filter);
-      newTex->SetMagnificationFilter(filter);
-      newTex->SetBorderColor(0.0f, 0.0f, 0.0f, 0.0f);
-      newTex->Create2D(viewsize[0], viewsize[1], 4, VTK_FLOAT, false);
-      newTex->SetAutoParameters(0);
-      tex = newTex;
-      newTex->Delete();
-      }
-    }
-
-  // Description:
-  // Allocate a size texture, store in the given smart pointer.
-  #ifdef USE_DEPTH_TEXTURE
-  void AllocateDepthTexture(
-        vtkOpenGLRenderWindow *context,
-        int *viewsize,
-        vtkSmartPointer<vtkTextureObject> &tex)
-    {
-    if ( !tex )
-      {
-      vtkTextureObject * newTex = vtkTextureObject::New();
-      newTex->SetContext(context);
-      newTex->AllocateDepth(viewsize[0], viewsize[1], vtkTextureObject::Float32);
-      newTex->SetAutoParameters(0);
-      tex = newTex;
-      newTex->Delete();
-      }
-    }
-  #else
-  void AllocateDepthTexture(
-        vtkOpenGLRenderWindow *context,
-        int *viewsize,
-        vtkSmartPointer<vtkRenderbuffer> &buf)
-    {
-    if ( !buf )
-      {
-      vtkRenderbuffer * newBuf = vtkRenderbuffer::New();
-      newBuf->SetContext(context);
-      newBuf->CreateDepthAttachment(viewsize[0], viewsize[1]);
-      buf = newBuf;
-      newBuf->Delete();
-      }
-    }
-  #endif
-
-  // Description:
-  // After LIC has been computed reset/clean internal state
-  void Updated()
-    {
-    this->ContextNeedsUpdate = false;
-    this->OutputDataNeedsUpdate = false;
-    this->CommunicatorNeedsUpdate = false;
-    this->GeometryNeedsUpdate = false;
-    this->GatherNeedsUpdate = false;
-    this->LICNeedsUpdate = false;
-    this->ColorNeedsUpdate = false;
-    }
-
-  // Description:
-  // Force all stages to re-execute. Necessary if the
-  // context or communicator changes.
-  void UpdateAll()
-    {
-    this->ContextNeedsUpdate = true;
-    this->OutputDataNeedsUpdate= true;
-    this->CommunicatorNeedsUpdate= true;
-    this->GeometryNeedsUpdate= true;
-    this->GatherNeedsUpdate= true;
-    this->LICNeedsUpdate= true;
-    this->ColorNeedsUpdate= true;
-    }
-
-  // Description:
-  // Convert viewport to texture coordinates
-  void ViewportQuadTextureCoords(GLfloat *tcoords)
-    {
-    tcoords[0] = tcoords[2] = 0.0f;
-    tcoords[1] = tcoords[3] = 1.0f;
-    }
-
-  // Description:
-  // Convert a viewport to a bounding box and it's texture coordinates for a
-  // screen size texture.
-  void ViewportQuadPoints(const vtkPixelExtent &viewportExt, GLfloat *quadpts)
-    {
-    viewportExt.GetData(quadpts);
-    }
-
-  // Description:
-  // Convert a viewport to a bounding box and it's texture coordinates for a
-  // screen size texture.
-  void ViewportQuadTextureCoords(
-        const vtkPixelExtent &viewExt,
-        const vtkPixelExtent &viewportExt,
-        GLfloat *tcoords)
-    {
-    GLfloat viewsize[2];
-    viewExt.Size(viewsize);
-
-    // cell to node
-    vtkPixelExtent next(viewportExt);
-    next.CellToNode();
-    next.GetData(tcoords);
-
-    tcoords[0] = tcoords[0]/viewsize[0];
-    tcoords[1] = tcoords[1]/viewsize[0];
-    tcoords[2] = tcoords[2]/viewsize[1];
-    tcoords[3] = tcoords[3]/viewsize[1];
-    }
-
-  // Description:
-  // Convert the entire view to a bounding box and it's texture coordinates for
-  // a screen size texture.
-  void ViewQuadPoints(GLfloat *quadpts)
-    {
-    quadpts[0] = quadpts[2] = 0.0f;
-    quadpts[1] = quadpts[3] = 1.0f;
-    }
-
-  // Description:
-  // Convert the entire view to a bounding box and it's texture coordinates for
-  // a screen size texture.
-  void ViewQuadTextureCoords(GLfloat *tcoords)
-    {
-    tcoords[0] = tcoords[2] = 0.0f;
-    tcoords[1] = tcoords[3] = 1.0f;
-    }
-
-  // Description:
-  // Render a quad (to trigger a shader to run)
-  void RenderQuad(
-        const vtkPixelExtent &viewExt,
-        const vtkPixelExtent &viewportExt,
-        vtkOpenGLHelper *cbo)
-    {
-    // cell to node
-    vtkPixelExtent next(viewportExt);
-    next.CellToNode();
-
-    GLfloat quadPts[4];
-    next.GetData(quadPts);
-
-    GLfloat quadTCoords[4];
-    this->ViewportQuadTextureCoords(viewExt, viewportExt, quadTCoords);
-
-    float tcoords[] = {
-      quadTCoords[0], quadTCoords[2],
-      quadTCoords[1], quadTCoords[2],
-      quadTCoords[1], quadTCoords[3],
-      quadTCoords[0], quadTCoords[3]};
-
-    float verts[] = {
-      quadTCoords[0]*2.0-1.0, quadTCoords[2]*2.0-1.0, 0.0f,
-      quadTCoords[1]*2.0-1.0, quadTCoords[2]*2.0-1.0, 0.0f,
-      quadTCoords[1]*2.0-1.0, quadTCoords[3]*2.0-1.0, 0.0f,
-      quadTCoords[0]*2.0-1.0, quadTCoords[3]*2.0-1.0, 0.0f};
-
-    vtkOpenGLRenderUtilities::RenderQuad(verts, tcoords,
-      cbo->Program, cbo->VAO);
-    vtkOpenGLStaticCheckErrorMacro("failed at RenderQuad");
-  }
-
-  // always return true as these state monitors do not exist in the
-  // new backend
-  bool LightingChanged()
-    {
-    return true;
-    }
-  bool ViewChanged()
-    {
-    return true;
-    }
-  bool BackgroundChanged(vtkRenderer *)
-    {
-    return true;
-    }
-
-  // Description:
-  // Compute the index into the 4x4 OpenGL ordered matrix.
-  inline
-  int idx(int row, int col) { return 4*col+row; }
-
-  // Description:
-  // given a axes aligned bounding box in
-  // normalized device coordinates test for
-  // view frustum visibility.
-  // if all points are outside one of the
-  // view frustum planes then this box
-  // is not visible. we might have false
-  // positive where more than one clip
-  // plane intersects the box.
-  bool VisibilityTest(double ndcBBox[24])
-    {
-    // check all points in the direction d
-    // at the same time.
-    for (int d=0; d<3; ++d)
-      {
-      if (((ndcBBox[     d] < -1.0)
-        && (ndcBBox[3  + d] < -1.0)
-        && (ndcBBox[6  + d] < -1.0)
-        && (ndcBBox[9  + d] < -1.0)
-        && (ndcBBox[12 + d] < -1.0)
-        && (ndcBBox[15 + d] < -1.0)
-        && (ndcBBox[18 + d] < -1.0)
-        && (ndcBBox[21 + d] < -1.0))
-        ||((ndcBBox[     d] > 1.0)
-        && (ndcBBox[3  + d] > 1.0)
-        && (ndcBBox[6  + d] > 1.0)
-        && (ndcBBox[9  + d] > 1.0)
-        && (ndcBBox[12 + d] > 1.0)
-        && (ndcBBox[15 + d] > 1.0)
-        && (ndcBBox[18 + d] > 1.0)
-        && (ndcBBox[21 + d] > 1.0)) )
-        {
-        return false;
-        }
-      }
-    return true;
-    }
-
-  // Description:
-  // Given world space bounds,
-  // compute bounding boxes in clip and normalized device
-  // coordinates and perform view frustum visiblity test.
-  // return true if the bounds are visible. If so the passed
-  // in extent object is initialized with the corresponding
-  //screen space extents.
-  bool ProjectBounds(
-          double PMV[16],
-          int viewsize[2],
-          double bounds[6],
-          vtkPixelExtent &screenExt)
-    {
-    // this is how to get the 8 corners of a bounding
-    // box from the VTK bounds
-    int bbIds[24] = {
-          0,2,4,
-          1,2,4,
-          1,3,4,
-          0,3,4,
-          0,2,5,
-          1,2,5,
-          1,3,5,
-          0,3,5
-          };
-
-    // normalized device coordinate bounding box
-    double ndcBBox[24];
-    for (int q = 0; q<8; ++q)
-      {
-      int qq = 3*q;
-      // bounding box corner
-      double wx = bounds[bbIds[qq  ]];
-      double wy = bounds[bbIds[qq+1]];
-      double wz = bounds[bbIds[qq+2]];
-      // to clip coordinates
-      ndcBBox[qq  ] = wx * PMV[idx(0,0)] + wy * PMV[idx(0,1)] + wz * PMV[idx(0,2)] + PMV[idx(0,3)];
-      ndcBBox[qq+1] = wx * PMV[idx(1,0)] + wy * PMV[idx(1,1)] + wz * PMV[idx(1,2)] + PMV[idx(1,3)];
-      ndcBBox[qq+2] = wx * PMV[idx(2,0)] + wy * PMV[idx(2,1)] + wz * PMV[idx(2,2)] + PMV[idx(2,3)];
-      double ndcw   = wx * PMV[idx(3,0)] + wy * PMV[idx(3,1)] + wz * PMV[idx(3,2)] + PMV[idx(3,3)];
-
-      // TODO
-      // if the point is past the near clipping plane
-      // we need to do something more robust. this ensures
-      // the correct result but its inefficient
-      if (ndcw < 0.0)
-        {
-        screenExt = vtkPixelExtent(viewsize[0], viewsize[1]);
-        //cerr << "W<0!!!!!!!!!!!!!" << endl;
-        return true;
-        }
-
-      // to normalized device coordinates
-      ndcw = (ndcw == 0.0 ? 1.0 : 1.0/ndcw);
-      ndcBBox[qq  ] *= ndcw;
-      ndcBBox[qq+1] *= ndcw;
-      ndcBBox[qq+2] *= ndcw;
-      }
-
-    // compute screen extent only if the object
-    // is inside the view frustum.
-    if (VisibilityTest(ndcBBox))
-      {
-      // these bounds are visible. compute screen
-      // space exents
-      double vx  = viewsize[0] - 1.0;
-      double vy  = viewsize[1] - 1.0;
-      double vx2 = viewsize[0] * 0.5;
-      double vy2 = viewsize[1] * 0.5;
-      vtkBoundingBox box;
-      for (int q=0; q<8; ++q)
-        {
-        int qq = 3*q;
-        double sx = (ndcBBox[qq  ] + 1.0) * vx2;
-        double sy = (ndcBBox[qq+1] + 1.0) * vy2;
-        box.AddPoint(
-          vtkClamp(sx, 0.0, vx),
-          vtkClamp(sy, 0.0, vy),
-          0.0);
-        }
-      // to screen extent
-      const double *s0 = box.GetMinPoint();
-      const double *s1 = box.GetMaxPoint();
-      screenExt[0] = static_cast<int>(s0[0]);
-      screenExt[1] = static_cast<int>(s1[0]);
-      screenExt[2] = static_cast<int>(s0[1]);
-      screenExt[3] = static_cast<int>(s1[1]);
-      return true;
-      }
-
-    // these bounds aren't visible
-    return false;
-    }
-
-  // Description:
-  // Compute screen space extents for each block in the input
-  // dataset and for the entire dataset. Only visible blocks
-  // are used in the computations.
-  int ProjectBounds(
-        vtkRenderer *ren,
-        vtkActor *actor,
-        vtkDataObject *dobj,
-        int viewsize[2],
-        vtkPixelExtent &dataExt,
-        deque<vtkPixelExtent> &blockExts)
-    {
-    // get the modelview projection matrix
-    vtkNew<vtkMatrix4x4> tmpMatrix;
-
-    vtkOpenGLCamera *oglCam =
-      vtkOpenGLCamera::SafeDownCast(ren->GetActiveCamera());
-    vtkMatrix4x4 *wcdc;
-    vtkMatrix4x4 *wcvc;
-    vtkMatrix3x3 *norms;
-    vtkMatrix4x4 *vcdc;
-    oglCam->GetKeyMatrices(ren,wcvc,norms,vcdc,wcdc);
-
-    if (!actor->GetIsIdentity())
-      {
-      vtkMatrix4x4 *mcwc;
-      vtkMatrix3x3 *anorms;
-      ((vtkOpenGLActor *)actor)->GetKeyMatrices(mcwc,anorms);
-      vtkMatrix4x4::Multiply4x4(mcwc, wcdc, tmpMatrix.GetPointer());
-      }
-    else
-      {
-      tmpMatrix->DeepCopy(wcdc);
-      }
-/*
-    for ( int c = 0; c < 4; c ++ )
-      {
-      for ( int r = 0; r < 4; r ++ )
-        {
-        PMV[c*4+r]
-          = P[idx(r,0)] * MV[idx(0,c)]
-          + P[idx(r,1)] * MV[idx(1,c)]
-          + P[idx(r,2)] * MV[idx(2,c)]
-          + P[idx(r,3)] * MV[idx(3,c)];
-        }
-      }
-*/
-    // dataset case
-    vtkDataSet* ds = dynamic_cast<vtkDataSet*>(dobj);
-    if (ds && ds->GetNumberOfCells())
-      {
-      double bounds[6];
-      ds->GetBounds(bounds);
-      if ( vtkBoundingBox::IsValid(bounds)
-        && this->ProjectBounds(tmpMatrix->Element[0], viewsize, bounds, dataExt) )
-        {
-        // the dataset is visible
-        // add its extent
-        blockExts.push_back(dataExt);
-        return 1;
-        }
-      //cerr << "ds " << ds << " not visible " << endl;
-      return 0;
-      }
-    // composite dataset case
-    vtkCompositeDataSet* cd = dynamic_cast<vtkCompositeDataSet*>(dobj);
-    if (cd)
-      {
-      // process each block's bounds
-      vtkBoundingBox bbox;
-      vtkCompositeDataIterator* iter = cd->NewIterator();
-      for (iter->InitTraversal(); !iter->IsDoneWithTraversal(); iter->GoToNextItem())
-        {
-        ds = dynamic_cast<vtkDataSet*>(iter->GetCurrentDataObject());
-        if (ds && ds->GetNumberOfCells())
-          {
-          double bounds[6];
-          ds->GetBounds(bounds);
-          vtkPixelExtent screenExt;
-          if ( vtkBoundingBox::IsValid(bounds)
-            && this->ProjectBounds(tmpMatrix->Element[0], viewsize, bounds, screenExt) )
-            {
-            // this block is visible
-            // save it's screen extent
-            // and accumulate its bounds
-            blockExts.push_back(screenExt);
-            bbox.AddBounds(bounds);
-            }
-          //else { cerr << "leaf " << ds << " not visible " << endl << endl;}
-          }
-        }
-      iter->Delete();
-      // process accumulated dataset bounds
-      double bounds[6];
-      bbox.GetBounds(bounds);
-      if ( vtkBoundingBox::IsValid(bounds)
-        && this->ProjectBounds(tmpMatrix->Element[0], viewsize, bounds, dataExt) )
-        {
-        return 1;
-        }
-      return 0;
-      }
-    //cerr << "ds " << ds << " no cells " << endl;
-    return 0;
-    }
-
-  // Description:
-  // Shrink an extent to tightly bound non-zero values
-  void GetPixelBounds(float *rgba, int ni, vtkPixelExtent &ext)
-    {
-    vtkPixelExtent text;
-    for (int j=ext[2]; j<=ext[3]; ++j)
-      {
-      for (int i=ext[0]; i<=ext[1]; ++i)
-        {
-        if (rgba[4*(j*ni+i)+3] > 0.0f)
-          {
-          text[0] = text[0] > i ? i : text[0];
-          text[1] = text[1] < i ? i : text[1];
-          text[2] = text[2] > j ? j : text[2];
-          text[3] = text[3] < j ? j : text[3];
-          }
-        }
-      }
-    ext = text;
-    }
-
-  // Description:
-  // Shrink a set of extents to tightly bound non-zero values
-  // cull extent if it's empty
-  void GetPixelBounds(float *rgba, int ni, deque<vtkPixelExtent> &blockExts)
-    {
-    vector<vtkPixelExtent> tmpExts(blockExts.begin(),blockExts.end());
-    blockExts.clear();
-    size_t nBlocks = tmpExts.size();
-    for (size_t b=0; b<nBlocks; ++b)
-      {
-      vtkPixelExtent &tmpExt = tmpExts[b];
-      GetPixelBounds(rgba, ni, tmpExt);
-      if (!tmpExt.Empty())
-        {
-        blockExts.push_back(tmpExt);
-        }
-      }
-    }
-};
-
-//----------------------------------------------------------------------------
-vtkObjectFactoryNewMacro(vtkSurfaceLICMapper);
-
-//----------------------------------------------------------------------------
-vtkSurfaceLICMapper::vtkSurfaceLICMapper()
-{
-  this->Internals = new vtkInternals();
-  this->Output = 0;
-
-  this->Enable = 1;
-  this->AlwaysUpdate = 0;
-
-  this->StepSize = 1;
-  this->NumberOfSteps = 20;
-  this->NormalizeVectors = 1;
-
-  this->EnhancedLIC = 1;
-
-  this->EnhanceContrast = 0;
-  this->LowLICContrastEnhancementFactor = 0.0;
-  this->HighLICContrastEnhancementFactor = 0.0;
-  this->LowColorContrastEnhancementFactor = 0.0;
-  this->HighColorContrastEnhancementFactor = 0.0;
-  this->AntiAlias = 0;
-  this->ColorMode = COLOR_MODE_BLEND;
-  this->LICIntensity = 0.8;
-  this->MapModeBias = 0.0;
-
-  this->GenerateNoiseTexture = 0;
-  this->NoiseType = NOISE_TYPE_GAUSSIAN;
-  this->NoiseTextureSize = 200;
-  this->MinNoiseValue = 0.0;
-  this->MaxNoiseValue = 0.8;
-  this->NoiseGrainSize = 1;
-  this->NumberOfNoiseLevels = 256;
-  this->ImpulseNoiseProbability = 1.0;
-  this->ImpulseNoiseBackgroundValue = 0.0;
-  this->NoiseGeneratorSeed = 1;
-
-  this->MaskOnSurface = 0;
-  this->MaskThreshold = 0.0;
-  this->MaskIntensity = 0.0;
-  this->MaskColor[0] = 0.5;
-  this->MaskColor[1] = 0.5;
-  this->MaskColor[2] = 0.5;
-
-  this->CompositeStrategy = COMPOSITE_AUTO;
-
-  this->SetInputArrayToProcess(0,0,0,
-    vtkDataObject::FIELD_ASSOCIATION_POINTS_THEN_CELLS,
-    vtkDataSetAttributes::VECTORS);
-
-  // we always want texture coordinates
-  // they are the vector field we LIC on
-  this->ForceTextureCoordinates = true;
-}
-
-//----------------------------------------------------------------------------
-vtkSurfaceLICMapper::~vtkSurfaceLICMapper()
-{
-  #if vtkSurfaceLICMapperDEBUG >= 1
-  cerr << "=====vtkSurfaceLICMapper::~vtkSurfaceLICMapper" << endl;
-  #endif
-
-  this->ReleaseGraphicsResources(this->Internals->Context);
-  delete this->Internals;
-
-  if (this->Output)
-    {
-    this->Output->Delete();
-    this->Output = 0;
-    }
-}
-
-void vtkSurfaceLICMapper::ShallowCopy(vtkAbstractMapper *mapper)
-{
-  vtkSurfaceLICMapper *m = vtkSurfaceLICMapper::SafeDownCast(mapper);
-  if ( m != NULL )
-    {
-    this->SetScalarVisibility(m->GetScalarVisibility());
-
-    this->SetNumberOfSteps(m->GetNumberOfSteps());
-    this->SetStepSize(m->GetStepSize());
-    this->SetEnhancedLIC(m->GetEnhancedLIC());
-    this->SetGenerateNoiseTexture(m->GetGenerateNoiseTexture());
-    this->SetNoiseType(m->GetNoiseType());
-    this->SetNormalizeVectors(m->GetNormalizeVectors());
-    this->SetNoiseTextureSize(m->GetNoiseTextureSize());
-    this->SetNoiseGrainSize(m->GetNoiseGrainSize());
-    this->SetMinNoiseValue(m->GetMinNoiseValue());
-    this->SetMaxNoiseValue(m->GetMaxNoiseValue());
-    this->SetNumberOfNoiseLevels(m->GetNumberOfNoiseLevels());
-    this->SetImpulseNoiseProbability(m->GetImpulseNoiseProbability());
-    this->SetImpulseNoiseBackgroundValue(m->GetImpulseNoiseBackgroundValue());
-    this->SetNoiseGeneratorSeed(m->GetNoiseGeneratorSeed());
-    this->SetEnhanceContrast(m->GetEnhanceContrast());
-    this->SetLowLICContrastEnhancementFactor(
-      m->GetLowLICContrastEnhancementFactor());
-    this->SetHighLICContrastEnhancementFactor(
-      m->GetHighLICContrastEnhancementFactor());
-    this->SetLowColorContrastEnhancementFactor(
-      m->GetLowColorContrastEnhancementFactor());
-    this->SetHighColorContrastEnhancementFactor(
-      m->GetHighColorContrastEnhancementFactor());
-    this->SetAntiAlias(m->GetAntiAlias());
-    this->SetColorMode(m->GetColorMode());
-    this->SetLICIntensity(m->GetLICIntensity());
-    this->SetMapModeBias(m->GetMapModeBias());
-    this->SetMaskOnSurface(m->GetMaskOnSurface());
-    this->SetMaskThreshold(m->GetMaskThreshold());
-    this->SetMaskIntensity(m->GetMaskIntensity());
-    this->SetMaskColor(m->GetMaskColor());
-    this->SetInputArrayToProcess(0,
-      m->GetInputArrayInformation(0));
-    }
-
-  // Now do superclass
-  this->vtkOpenGLPolyDataMapper::ShallowCopy(mapper);
-}
-
-//----------------------------------------------------------------------------
-void vtkSurfaceLICMapper::ReleaseGraphicsResources(vtkWindow* win)
-{
-  this->Internals->ClearGraphicsResources();
-  this->Internals->Context = NULL;
-  if (this->Output)
-    {
-    this->Output->Delete();
-    this->Output = NULL;
-    }
-  this->Superclass::ReleaseGraphicsResources(win);
-}
-
-//----------------------------------------------------------------------------
-#define vtkSetMonitoredParameterMacro(_name, _type, _code)  \
-void vtkSurfaceLICMapper::Set##_name (_type val)           \
-{                                                           \
-  if (val == this->_name)                                   \
-    {                                                       \
-    return;                                                 \
-    }                                                       \
-  _code                                                     \
-  this->_name = val;                                        \
-  this->Modified();                                         \
-}
-// output dataset
-vtkSetMonitoredParameterMacro(
-      Enable,
-      int,
-      this->Internals->OutputDataNeedsUpdate = true;)
-// lic
-vtkSetMonitoredParameterMacro(
-      GenerateNoiseTexture,
-      int,
-      this->Internals->Noise = NULL;
-      this->Internals->NoiseImage = NULL;
-      this->Internals->LICNeedsUpdate = true;)
-
-vtkSetMonitoredParameterMacro(
-      NoiseType,
-      int,
-      this->Internals->Noise = NULL;
-      this->Internals->NoiseImage = NULL;
-      this->Internals->LICNeedsUpdate = true;)
-
-vtkSetMonitoredParameterMacro(
-      NoiseTextureSize,
-      int,
-      this->Internals->Noise = NULL;
-      this->Internals->NoiseImage = NULL;
-      this->Internals->LICNeedsUpdate = true;)
-
-vtkSetMonitoredParameterMacro(
-      NoiseGrainSize,
-      int,
-      this->Internals->Noise = NULL;
-      this->Internals->NoiseImage = NULL;
-      this->Internals->LICNeedsUpdate = true;)
-
-vtkSetMonitoredParameterMacro(
-      MinNoiseValue,
-      double,
-      val = val < 0.0 ? 0.0 : val;
-      val = val > 1.0 ? 1.0 : val;
-      this->Internals->Noise = NULL;
-      this->Internals->NoiseImage = NULL;
-      this->Internals->LICNeedsUpdate = true;)
-
-vtkSetMonitoredParameterMacro(
-      MaxNoiseValue,
-      double,
-      val = val < 0.0 ? 0.0 : val;
-      val = val > 1.0 ? 1.0 : val;
-      this->Internals->Noise = NULL;
-      this->Internals->NoiseImage = NULL;
-      this->Internals->LICNeedsUpdate = true;)
-
-vtkSetMonitoredParameterMacro(
-      NumberOfNoiseLevels,
-      int,
-      this->Internals->Noise = NULL;
-      this->Internals->NoiseImage = NULL;
-      this->Internals->LICNeedsUpdate = true;)
-
-vtkSetMonitoredParameterMacro(
-      ImpulseNoiseProbability,
-      double,
-      val = val < 0.0 ? 0.0 : val;
-      val = val > 1.0 ? 1.0 : val;
-      this->Internals->Noise = NULL;
-      this->Internals->NoiseImage = NULL;
-      this->Internals->LICNeedsUpdate = true;)
-
-vtkSetMonitoredParameterMacro(
-      ImpulseNoiseBackgroundValue,
-      double,
-      val = val < 0.0 ? 0.0 : val;
-      val = val > 1.0 ? 1.0 : val;
-      this->Internals->Noise = NULL;
-      this->Internals->NoiseImage = NULL;
-      this->Internals->LICNeedsUpdate = true;)
-
-vtkSetMonitoredParameterMacro(
-      NoiseGeneratorSeed,
-      int,
-      this->Internals->Noise = NULL;
-      this->Internals->NoiseImage = NULL;
-      this->Internals->LICNeedsUpdate = true;)
-
-// compositor
-vtkSetMonitoredParameterMacro(
-      CompositeStrategy,
-      int,
-      this->Internals->GatherNeedsUpdate = true;)
-
-// lic/compositor
-vtkSetMonitoredParameterMacro(
-      NumberOfSteps,
-      int,
-      this->Internals->GatherNeedsUpdate = true;
-      this->Internals->LICNeedsUpdate = true;)
-
-vtkSetMonitoredParameterMacro(
-      StepSize,
-      double,
-      this->Internals->GatherNeedsUpdate = true;
-      this->Internals->LICNeedsUpdate = true;)
-
-vtkSetMonitoredParameterMacro(
-      NormalizeVectors,
-      int,
-      val = val < 0 ? 0 : val;
-      val = val > 1 ? 1 : val;
-      this->Internals->GatherNeedsUpdate = true;
-      this->Internals->LICNeedsUpdate = true;)
-
-vtkSetMonitoredParameterMacro(
-      MaskThreshold,
-      double,
-      this->Internals->LICNeedsUpdate = true;)
-
-vtkSetMonitoredParameterMacro(
-      EnhancedLIC,
-      int,
-      this->Internals->GatherNeedsUpdate = true;
-      this->Internals->LICNeedsUpdate = true;)
-
-// lic
-vtkSetMonitoredParameterMacro(
-      LowLICContrastEnhancementFactor,
-      double,
-      val = val < 0.0 ? 0.0 : val;
-      val = val > 1.0 ? 1.0 : val;
-      this->Internals->LICNeedsUpdate = true;)
-
-vtkSetMonitoredParameterMacro(
-      HighLICContrastEnhancementFactor,
-      double,
-      val = val < 0.0 ? 0.0 : val;
-      val = val > 1.0 ? 1.0 : val;
-      this->Internals->LICNeedsUpdate = true;)
-
-vtkSetMonitoredParameterMacro(
-      AntiAlias,
-      int,
-      val = val < 0 ? 0 : val;
-      this->Internals->GatherNeedsUpdate = true;
-      this->Internals->LICNeedsUpdate = true;)
-
-// geometry
-vtkSetMonitoredParameterMacro(
-      MaskOnSurface,
-      int,
-      val = val < 0 ? 0 : val;
-      val = val > 1 ? 1 : val;
-      this->Internals->GeometryNeedsUpdate = true;)
-
-// colors
-vtkSetMonitoredParameterMacro(
-      ColorMode,
-      int,
-      this->Internals->ColorNeedsUpdate = true;)
-
-vtkSetMonitoredParameterMacro(
-      LICIntensity,
-      double,
-      val = val < 0.0 ? 0.0 : val;
-      val = val > 1.0 ? 1.0 : val;
-      this->Internals->ColorNeedsUpdate = true;)
-
-vtkSetMonitoredParameterMacro(
-      MaskIntensity,
-      double,
-      val = val < 0.0 ? 0.0 : val;
-      val = val > 1.0 ? 1.0 : val;
-      this->Internals->ColorNeedsUpdate = true;)
-
-vtkSetMonitoredParameterMacro(
-      MapModeBias,
-      double,
-      val = val <-1.0 ? -1.0 : val;
-      val = val > 1.0 ?  1.0 : val;
-      this->Internals->ColorNeedsUpdate = true;)
-
-vtkSetMonitoredParameterMacro(
-      LowColorContrastEnhancementFactor,
-      double,
-      val = val < 0.0 ? 0.0 : val;
-      val = val > 1.0 ? 1.0 : val;
-      this->Internals->ColorNeedsUpdate = true;)
-
-vtkSetMonitoredParameterMacro(
-      HighColorContrastEnhancementFactor,
-      double,
-      val = val < 0.0 ? 0.0 : val;
-      val = val > 1.0 ? 1.0 : val;
-      this->Internals->ColorNeedsUpdate = true;)
-
-//----------------------------------------------------------------------------
-void vtkSurfaceLICMapper::SetMaskColor(double *val)
-{
-  double rgb[3];
-  for (int q=0; q<3; ++q)
-    {
-    rgb[q] = val[q];
-    rgb[q] = rgb[q] < 0.0 ? 0.0 : rgb[q];
-    rgb[q] = rgb[q] > 1.0 ? 1.0 : rgb[q];
-    }
-  if ( (rgb[0] == this->MaskColor[0])
-    && (rgb[1] == this->MaskColor[1])
-    && (rgb[2] == this->MaskColor[2]) )
-    {
-    return;
-    }
-  for (int q=0; q<3; ++q)
-    {
-    this->MaskColor[q] = rgb[q];
-    }
-  this->Internals->ColorNeedsUpdate = true;
-  this->Modified();
-}
-
-//----------------------------------------------------------------------------
-void vtkSurfaceLICMapper::SetEnhanceContrast(int val)
-{
-  val = val < ENHANCE_CONTRAST_OFF ? ENHANCE_CONTRAST_OFF : val;
-  val = val > ENHANCE_CONTRAST_BOTH ? ENHANCE_CONTRAST_BOTH : val;
-  if (val == this->EnhanceContrast)
-    {
-    return;
-    }
-
-  switch ( this->EnhanceContrast )
-    {
-    case ENHANCE_CONTRAST_OFF:
-      switch ( val )
-        {
-        case ENHANCE_CONTRAST_LIC:
-        case ENHANCE_CONTRAST_BOTH:
-          this->Internals->LICNeedsUpdate = true;
-          break;
-        case ENHANCE_CONTRAST_COLOR:
-          this->Internals->ColorNeedsUpdate = true;
-          break;
-        }
-      break;
-
-    case ENHANCE_CONTRAST_LIC:
-      switch ( val )
-        {
-        case ENHANCE_CONTRAST_OFF:
-        case ENHANCE_CONTRAST_COLOR:
-          this->Internals->LICNeedsUpdate = true;
-          break;
-        case ENHANCE_CONTRAST_BOTH:
-          this->Internals->ColorNeedsUpdate = true;
-          break;
-        }
-      break;
-
-    case ENHANCE_CONTRAST_COLOR:
-      switch ( val )
-        {
-        case ENHANCE_CONTRAST_LIC:
-        case ENHANCE_CONTRAST_BOTH:
-          this->Internals->LICNeedsUpdate = true;
-          break;
-        case ENHANCE_CONTRAST_OFF:
-          this->Internals->ColorNeedsUpdate = true;
-          break;
-        }
-      break;
-
-    case ENHANCE_CONTRAST_BOTH:
-      switch ( val )
-        {
-        case ENHANCE_CONTRAST_OFF:
-          this->Internals->LICNeedsUpdate = true;
-          break;
-        case ENHANCE_CONTRAST_COLOR:
-          this->Internals->LICNeedsUpdate = true;
-        case ENHANCE_CONTRAST_LIC:
-          this->Internals->ColorNeedsUpdate = true;
-          break;
-        }
-      break;
-    }
-
-  this->EnhanceContrast = val;
-  this->Modified();
-}
-
-//----------------------------------------------------------------------------
-void vtkSurfaceLICMapper::SetNoiseDataSet(vtkImageData *data)
-{
-  if (data == this->Internals->Noise)
-    {
-    return;
-    }
-  this->Internals->Noise = data;
-  this->Internals->NoiseImage = NULL;
-  this->Modified();
-}
-
-//----------------------------------------------------------------------------
-vtkImageData *vtkSurfaceLICMapper::GetNoiseDataSet()
-{
-  if (this->Internals->Noise == NULL)
-    {
-    vtkImageData *noise = NULL;
-    if ( this->GenerateNoiseTexture )
-      {
-      // report potential issues
-      if ( this->NoiseGrainSize >= this->NoiseTextureSize )
-        {
-        vtkErrorMacro(
-          "NoiseGrainSize must be smaller than NoiseTextureSize");
-        }
-      if ( this->MinNoiseValue >= this->MaxNoiseValue )
-        {
-        vtkErrorMacro(
-          "MinNoiseValue must be smaller than MaxNoiseValue");
-        }
-      if ( (this->ImpulseNoiseProbability == 1.0)
-        && (this->NumberOfNoiseLevels < 2) )
-        {
-        vtkErrorMacro(
-          "NumberOfNoiseLevels must be greater than 1 "
-          "when not generating impulse noise");
-        }
-
-      // generate a custom noise texture based on the
-      // current settings.
-      int noiseTextureSize = this->NoiseTextureSize;
-      int noiseGrainSize = this->NoiseGrainSize;
-      RandomNoise2D noiseGen;
-      float *noiseValues = noiseGen.Generate(
-            this->NoiseType,
-            noiseTextureSize,
-            noiseGrainSize,
-            static_cast<float>(this->MinNoiseValue),
-            static_cast<float>(this->MaxNoiseValue),
-            this->NumberOfNoiseLevels,
-            this->ImpulseNoiseProbability,
-            static_cast<float>(this->ImpulseNoiseBackgroundValue),
-            this->NoiseGeneratorSeed);
-      if ( noiseValues == NULL )
-        {
-        vtkErrorMacro("Failed to generate noise.");
-        }
-
-      vtkFloatArray *noiseArray = vtkFloatArray::New();
-      noiseArray->SetNumberOfComponents(2);
-      noiseArray->SetName("noise");
-      vtkIdType arraySize = 2*noiseTextureSize*noiseTextureSize;
-      noiseArray->SetArray(noiseValues, arraySize, 0);
-
-      noise = vtkImageData::New();
-      noise->SetSpacing(1.0, 1.0, 1.0);
-      noise->SetOrigin(0.0, 0.0, 0.0);
-      noise->SetDimensions(noiseTextureSize, noiseTextureSize, 1);
-      noise->GetPointData()->SetScalars(noiseArray);
-
-      noiseArray->Delete();
-      }
-    else
-      {
-      // load a predefined noise texture.
-      noise = vtkGetNoiseResource();
-      }
-
-    this->Internals->Noise = noise;
-    this->Internals->NoiseImage = NULL;
-    noise->Delete();
-    noise = NULL;
-    }
-
-  return this->Internals->Noise;
-}
-
-//----------------------------------------------------------------------------
-void vtkSurfaceLICMapper::UpdateNoiseImage(vtkRenderWindow *renWin)
-{
-  vtkOpenGLRenderWindow *rw = vtkOpenGLRenderWindow::SafeDownCast(renWin);
-  vtkImageData *noiseDataSet = this->GetNoiseDataSet();
-
-  int ext[6];
-  noiseDataSet->GetExtent(ext);
-  unsigned int dataWidth = ext[1]-ext[0]+1;
-  unsigned int dataHeight = ext[3]-ext[2]+1;
-
-  vtkDataArray *noiseArray = noiseDataSet->GetPointData()->GetScalars();
-  int dataType = noiseArray->GetDataType();
-  void *data = noiseArray->GetVoidPointer(0);
-  int dataComps = noiseArray->GetNumberOfComponents();
-  unsigned int dataSize = noiseArray->GetNumberOfTuples()*dataComps;
-
-  vtkPixelBufferObject *pbo = vtkPixelBufferObject::New();
-  pbo->SetContext(renWin);
-  pbo->Upload1D(dataType, data, dataSize, 1, 0);
-
-  vtkTextureObject *tex = vtkTextureObject::New();
-  tex->SetContext(rw);
-  tex->SetBaseLevel(0);
-  tex->SetMaxLevel(0);
-  tex->SetWrapS(vtkTextureObject::Repeat);
-  tex->SetWrapT(vtkTextureObject::Repeat);
-  tex->SetMinificationFilter(vtkTextureObject::Nearest);
-  tex->SetMagnificationFilter(vtkTextureObject::Nearest);
-  tex->Create2D(dataWidth, dataHeight, dataComps, pbo, false);
-  tex->SetAutoParameters(0);
-  pbo->Delete();
-
-  this->Internals->NoiseImage = tex;
-  tex->Delete();
-}
-
-
-//----------------------------------------------------------------------------
-bool vtkSurfaceLICMapper::IsSupported(vtkRenderWindow *renWin)
-{
-  vtkOpenGLRenderWindow *context
-    = vtkOpenGLRenderWindow::SafeDownCast(renWin);
-
-  return vtkInternals::IsSupported(context);
-}
-
-//----------------------------------------------------------------------------
-bool vtkSurfaceLICMapper::CanRenderSurfaceLIC(vtkActor *actor)
-{
-  // check the render context for GL fetaure support
-  // note this also handles non-opengl render window
-  if ( this->Internals->ContextNeedsUpdate
-    && !vtkSurfaceLICMapper::IsSupported(this->Internals->Context) )
-    {
-    vtkErrorMacro("SurfaceLIC is not supported");
-    return false;
-    }
-
-  bool canRender = false;
-
-  int rep = actor->GetProperty()->GetRepresentation();
-
-  if ( this->Enable
-    && this->Internals->HasVectors
-    && (rep == VTK_SURFACE))
-    {
-    canRender = true;
-    }
-
-  #if vtkSurfaceLICMapperDEBUG >= 1
-  cerr
-    << this->Internals->Communicator->GetWorldRank()
-    << " CanRender " << canRender << endl;
-  #endif
-
-  return canRender;
-}
-
-namespace {
-  void BuildAShader(vtkOpenGLRenderWindow *renWin,
-    vtkOpenGLHelper **cbor, const char * vert,
-    const char *frag)
-  {
-  if (*cbor == NULL)
-    {
-    *cbor = new vtkOpenGLHelper;
-    std::string GSSource;
-    (*cbor)->Program =
-        renWin->GetShaderCache()->ReadyShaderProgram(vert,
-                                              frag,
-                                              GSSource.c_str());
-    }
-  else
-    {
-    renWin->GetShaderCache()->ReadyShaderProgram((*cbor)->Program);
-    }
-  }
-}
-
-//----------------------------------------------------------------------------
-void vtkSurfaceLICMapper::InitializeResources()
-{
-  bool initialized = true;
-
-  // noise image
-  if (!this->Internals->NoiseImage)
-    {
-    initialized = false;
-
-    this->UpdateNoiseImage(this->Internals->Context);
-    }
-
-  // compositer for parallel operation
-  if (!this->Internals->Compositor)
-    {
-    this->Internals->UpdateAll();
-    vtkSurfaceLICComposite *compositor = vtkSurfaceLICComposite::New();
-    compositor->SetContext(this->Internals->Context);
-    this->Internals->Compositor = compositor;
-    compositor->Delete();
-    }
-
-  // image LIC
-  if (!this->Internals->LICer)
-    {
-    initialized = false;
-
-    vtkLineIntegralConvolution2D *LICer = vtkLineIntegralConvolution2D::New();
-    LICer->SetContext(this->Internals->Context);
-    this->Internals->LICer = LICer;
-    LICer->Delete();
-    }
-
-  // frame buffers
-  if (!this->Internals->FBO)
-    {
-    initialized = false;
-
-    vtkFrameBufferObject2 * fbo = vtkFrameBufferObject2::New();
-    fbo->SetContext(this->Internals->Context);
-    this->Internals->FBO = fbo;
-    fbo->Delete();
-    }
-
-  // load shader codes
-  vtkOpenGLRenderWindow *renWin = this->Internals->Context;
-
-  if (!this->Internals->ColorPass)
-    {
-    initialized = false;
-    BuildAShader(renWin, &this->Internals->ColorPass,
-      vtkTextureObjectVS, vtkSurfaceLICMapper_SC);
-    }
-
-  if (!this->Internals->ColorEnhancePass)
-    {
-    initialized = false;
-    BuildAShader(renWin, &this->Internals->ColorEnhancePass,
-      vtkTextureObjectVS, vtkSurfaceLICMapper_CE);
-    }
-
-  if (!this->Internals->CopyPass)
-    {
-    initialized = false;
-    BuildAShader(renWin, &this->Internals->CopyPass,
-      vtkTextureObjectVS, vtkSurfaceLICMapper_DCpy);
-    }
-
-  // if any of the above were not already initialized
-  // then execute all stages
-  if (!initialized)
-    {
-    this->Internals->UpdateAll();
-    }
-}
-
-//----------------------------------------------------------------------------
-bool vtkSurfaceLICMapper::NeedToColorLIC()
-{
-  if ( this->Internals->ColorNeedsUpdate
-    || this->Internals->LICNeedsUpdate
-    || this->Internals->GatherNeedsUpdate
-    || this->Internals->GeometryNeedsUpdate
-    || this->Internals->CommunicatorNeedsUpdate
-    || this->Internals->OutputDataNeedsUpdate
-    || this->Internals->ContextNeedsUpdate
-    || this->AlwaysUpdate )
-    {
-    this->Internals->ColorNeedsUpdate = true;
-    }
-
-  #if vtkSurfaceLICMapperDEBUG >= 1
-  cerr
-    << this->Internals->Communicator->GetWorldRank()
-    << " NeedToColorLIC " << this->Internals->ColorNeedsUpdate << endl;
-  #endif
-  return this->Internals->ColorNeedsUpdate;
-}
-
-//----------------------------------------------------------------------------
-bool vtkSurfaceLICMapper::NeedToComputeLIC()
-{
-  if ( this->Internals->LICNeedsUpdate
-    || this->Internals->GatherNeedsUpdate
-    || this->Internals->GeometryNeedsUpdate
-    || this->Internals->CommunicatorNeedsUpdate
-    || this->Internals->OutputDataNeedsUpdate
-    || this->Internals->ContextNeedsUpdate
-    || this->AlwaysUpdate )
-    {
-    this->Internals->LICNeedsUpdate = true;
-    }
-
-  #if vtkSurfaceLICMapperDEBUG >= 1
-  cerr
-    << this->Internals->Communicator->GetWorldRank()
-    << " NeedToComputeLIC " << this->Internals->LICNeedsUpdate << endl;
-  #endif
-  return this->Internals->LICNeedsUpdate;
-}
-
-//----------------------------------------------------------------------------
-bool vtkSurfaceLICMapper::NeedToGatherVectors()
-{
-  if ( this->Internals->GatherNeedsUpdate
-    || this->Internals->GeometryNeedsUpdate
-    || this->Internals->OutputDataNeedsUpdate
-    || this->Internals->CommunicatorNeedsUpdate
-    || this->Internals->ContextNeedsUpdate
-    || this->AlwaysUpdate )
-    {
-    this->Internals->GatherNeedsUpdate = true;
-    }
-
-  #if vtkSurfaceLICMapperDEBUG >= 1
-  cerr
-    << this->Internals->Communicator->GetWorldRank()
-    << " NeedToGatherVectors "
-    << this->Internals->GatherNeedsUpdate << endl;
-  #endif
-  return this->Internals->GatherNeedsUpdate;
-}
-
-//----------------------------------------------------------------------------
-bool vtkSurfaceLICMapper::NeedToRenderGeometry(
-      vtkRenderer *renderer,
-      vtkActor *actor)
-{
-  // view changed or
-  // user modifiable parameters
-  if ( this->Internals->GeometryNeedsUpdate
-    || this->Internals->CommunicatorNeedsUpdate
-    || this->Internals->OutputDataNeedsUpdate
-    || this->Internals->ContextNeedsUpdate
-    || this->AlwaysUpdate )
-    {
-    this->Internals->GeometryNeedsUpdate = true;
-    }
-
-  // lights changed
-  if ( this->Internals->LightingChanged() )
-    {
-    this->Internals->GeometryNeedsUpdate = true;
-    }
-
-  // props changed
-  long long propMTime = actor->GetProperty()->GetMTime();
-  if ( this->Internals->LastPropertyMTime != propMTime )
-    {
-    this->Internals->LastPropertyMTime = propMTime;
-    this->Internals->GeometryNeedsUpdate = true;
-    }
-
-  // background colors changed
-  if (this->Internals->BackgroundChanged(renderer))
-    {
-    this->Internals->GeometryNeedsUpdate = true;
-    this->Internals->ColorNeedsUpdate = true;
-    }
-
-  #if vtkSurfaceLICMapperDEBUG >= 1
-  cerr
-    << this->Internals->Communicator->GetWorldRank()
-    << " NeedToUpdateGeometry "
-    << this->Internals->GeometryNeedsUpdate << endl;
-  #endif
-  return this->Internals->GeometryNeedsUpdate;
-}
-
-//----------------------------------------------------------------------------
-bool vtkSurfaceLICMapper::NeedToUpdateCommunicator()
-{
-  // no comm or externally modfied paramters
-  if ( this->Internals->CommunicatorNeedsUpdate
-    || this->Internals->ContextNeedsUpdate
-    || this->Internals->OutputDataNeedsUpdate
-    || !this->Internals->Communicator
-    || this->AlwaysUpdate )
-    {
-    this->Internals->CommunicatorNeedsUpdate = true;
-    this->Internals->UpdateAll();
-    }
-
-  #if vtkSurfaceLICMapperDEBUG >= 1
-  cerr
-    << this->Internals->Communicator->GetWorldRank()
-    << " NeedToUpdateCommunicator "
-    << this->Internals->CommunicatorNeedsUpdate << endl;
-  #endif
-
-  return this->Internals->CommunicatorNeedsUpdate;
-}
-
-//----------------------------------------------------------------------------
-bool vtkSurfaceLICMapper::NeedToUpdateOutputData()
-{
-  vtkDataObject *input = this->GetInput();
-  // input dataset changed
-  long long inputMTime = input->GetMTime();
-  if ( (this->Internals->LastInputDataSetMTime < inputMTime)
-    || !this->Output
-    || this->AlwaysUpdate)
-    {
-    this->Internals->LastInputDataSetMTime = inputMTime;
-    this->Internals->UpdateAll();
-    }
-
-  #if vtkSurfaceLICMapperDEBUG >= 1
-  cerr
-    << this->Internals->Communicator->GetWorldRank()
-    << " NeedToUpdateOutputData " << this->Internals->OutputDataNeedsUpdate << endl;
-  #endif
-  return this->Internals->OutputDataNeedsUpdate;
-}
-
-//----------------------------------------------------------------------------
-void vtkSurfaceLICMapper::ValidateContext(vtkRenderer *renderer)
-{
-  bool modified = false;
-
-  vtkOpenGLRenderWindow *context
-    = vtkOpenGLRenderWindow::SafeDownCast(renderer->GetRenderWindow());
-
-  // context changed
-  if (this->Internals->Context != context)
-    {
-    modified = true;
-    if (this->Internals->Context)
-      {
-      this->ReleaseGraphicsResources(this->Internals->Context);
-      }
-    this->Internals->Context = context;
-    }
-
-  // viewport size changed
-  int viewsize[2];
-  renderer->GetTiledSize(&viewsize[0], &viewsize[1]);
-  if ( this->Internals->Viewsize[0] != viewsize[0]
-    || this->Internals->Viewsize[1] != viewsize[1] )
-    {
-    modified = true;
-
-    // udpate view size
-    this->Internals->Viewsize[0] = viewsize[0];
-    this->Internals->Viewsize[1] = viewsize[1];
-
-    // resize textures
-    this->Internals->ClearTextures();
-    this->Internals->AllocateTextures(context, viewsize);
-    }
-
-  // view changed
-  if (this->Internals->ViewChanged())
-    {
-    modified = true;
-    }
-
-  // if anything changed execute all stages
-  if (modified)
-    {
-    this->Internals->UpdateAll();
-    }
-
-  #if vtkSurfaceLICMapperDEBUG >= 1
-  cerr
-    << this->Internals->Communicator->GetWorldRank()
-    << " NeedToUpdatContext " << modified << endl;
-  #endif
-}
-
-//----------------------------------------------------------------------------
-vtkPainterCommunicator *vtkSurfaceLICMapper::CreateCommunicator(int)
-{
-  return new vtkPainterCommunicator;
-}
-
-//----------------------------------------------------------------------------
-void vtkSurfaceLICMapper::CreateCommunicator(
-  vtkRenderer *ren,
-  vtkActor *act)
-{
-  // compute screen space pixel extent of local blocks and
-  // union of local blocks. only blocks that pass view frustum
-  // visibility test are used in the computation.
-
-  vtkDataObject *input = this->GetInput();
-
-
-  this->Internals->DataSetExt.Clear();
-  this->Internals->BlockExts.clear();
-
-  int includeRank = this->Internals->ProjectBounds(
-          ren, act, input,
-          this->Internals->Viewsize,
-          this->Internals->DataSetExt,
-          this->Internals->BlockExts);
-
-  delete this->Internals->Communicator;
-  this->Internals->Communicator = this->CreateCommunicator(includeRank);
-
-  #if vtkSurfaceLICMapperDEBUG >= 1
-  cerr
-    << this->Internals->Communicator->GetWorldRank()
-    << " is rendering " << includeRank << endl;
-  #endif
-}
-
-//-----------------------------------------------------------------------------
-void vtkSurfaceLICMapper::ProcessInformation(
-  vtkInformation* vtkNotUsed(info))
-{
-  #if vtkSurfaceLICMapperDEBUG >= 1
-  bool LUTNeedsUpdate = false;
-  #endif
-
-  // detect when the LUT has been modified
-  vtkScalarsToColors *lut = this->GetLookupTable();
-  long long lutMTime;
-  if (lut && ((lutMTime = lut->GetMTime()) > this->Internals->LastLUTMTime))
-    {
-    this->Internals->LastLUTMTime = lutMTime;
-    this->Internals->UpdateAll();
-    #if vtkSurfaceLICMapperDEBUG >= 1
-    LUTNeedsUpdate = true;
-    #endif
-    }
-
-  #if vtkSurfaceLICMapperDEBUG >= 1
-  cerr
-    << this->Internals->Communicator->GetWorldRank()
-    << " NeedToUpdateLUT " << LUTNeedsUpdate << endl;
-  #endif
-}
-
-//----------------------------------------------------------------------------
-void vtkSurfaceLICMapper::SetUpdateAll()
-{
-  this->Internals->UpdateAll();
-}
-
-void vtkSurfaceLICMapper::ReplaceShaderValues(
-    std::map<vtkShader::Type, vtkShader *> shaders,
-    vtkRenderer *ren, vtkActor *actor)
-{
-  std::string VSSource = shaders[vtkShader::Vertex]->GetSource();
-  std::string FSSource = shaders[vtkShader::Fragment]->GetSource();
-
-  // add some code to handle the LIC vectors and mask
-  vtkShaderProgram::Substitute(VSSource,
-    "//VTK::TCoord::Dec",
-    "attribute vec3 tcoordMC;\n"
-    "varying vec3 tcoordVCVSOutput;\n"
-    );
-
-  vtkShaderProgram::Substitute(VSSource, "//VTK::TCoord::Impl",
-    "tcoordVCVSOutput = tcoordMC;"
-    );
-
-  vtkShaderProgram::Substitute(FSSource,
-    "//VTK::TCoord::Dec",
-    // 0/1, when 1 V is projected to surface for |V| computation.
-    "uniform int uMaskOnSurface;\n"
-    "uniform mat3 normalMatrix;\n"
-    "varying vec3 tcoordVCVSOutput;"
-    );
-
-  vtkShaderProgram::Substitute(FSSource,
-    "//VTK::TCoord::Impl",
-    // projected vectors
-    "  vec3 tcoordLIC = normalMatrix * tcoordVCVSOutput;\n"
-    "  vec3 normN = normalize(normalVCVSOutput);\n"
-    "  float k = dot(tcoordLIC, normN);\n"
-    "  tcoordLIC = (tcoordLIC - k*normN);\n"
-    "  gl_FragData[1] = vec4(tcoordLIC.x, tcoordLIC.y, 0.0 , gl_FragCoord.z);\n"
- //   "  gl_FragData[1] = vec4(tcoordVC.xyz, gl_FragCoord.z);\n"
-    // vectors for fragment masking
-    "  if (uMaskOnSurface == 0)\n"
-    "    {\n"
-    "    gl_FragData[2] = vec4(tcoordVCVSOutput, gl_FragCoord.z);\n"
-    "    }\n"
-    "  else\n"
-    "    {\n"
-    "    gl_FragData[2] = vec4(tcoordLIC.x, tcoordLIC.y, 0.0 , gl_FragCoord.z);\n"
-    "    }\n"
- //   "  gl_FragData[2] = vec4(19.0, 19.0, tcoordVC.x, gl_FragCoord.z);\n"
-    , false);
-
-  this->ShaderVariablesUsed.push_back("normalMatrix");
-
-  shaders[vtkShader::Vertex]->SetSource(VSSource);
-  shaders[vtkShader::Fragment]->SetSource(FSSource);
-
-  this->Superclass::ReplaceShaderValues(shaders,ren,actor);
-}
-
-void vtkSurfaceLICMapper::SetMapperShaderParameters(
-  vtkOpenGLHelper &cellBO,
-  vtkRenderer* ren, vtkActor *actor)
-{
-  this->Superclass::SetMapperShaderParameters(cellBO, ren, actor);
-  cellBO.Program->SetUniformi("uMaskOnSurface", this->MaskOnSurface);
-}
-
-//----------------------------------------------------------------------------
-void vtkSurfaceLICMapper::RenderPiece(
-        vtkRenderer *renderer,
-        vtkActor *actor)
-{
-  #if vtkSurfaceLICMapperDEBUG >= 1
-  cerr
-    << this->Internals->Communicator->GetWorldRank()
-    << " ===== " << this->GetClassName() << "::RenderInternal" << endl;
-  #endif
-
-  #ifdef vtkSurfaceLICMapperTIME
-  this->StartTimerEvent("vtkSurfaceLICMapper::RenderInternal");
-  #else
-  vtkSmartPointer<vtkTimerLog> timer = vtkSmartPointer<vtkTimerLog>::New();
-  timer->StartTimer();
-  #endif
-
-  vtkOpenGLClearErrorMacro();
-
-  this->ValidateContext(renderer);
-  vtkOpenGLRenderWindow *renWin =
-    vtkOpenGLRenderWindow::SafeDownCast(renderer->GetVTKWindow());
-
-  if (this->NeedToUpdateOutputData())
-    {
-    // if the input data has changed we need to
-    // reload vector attributes and recompute
-    // all, but only if the output is valid.
-    this->PrepareOutput();
-    }
-
-  if (this->NeedToUpdateCommunicator())
-    {
-    #ifdef vtkSurfaceLICMapperTIME
-    this->StartTimerEvent("vtkSurfaceLICMapper::CreateCommunicator");
-    #endif
-    // create a communicator that contains only ranks
-    // that have visible data. In parallel this is a
-    // collective operation accross all ranks. In
-    // serial this is a no-op.
-    this->CreateCommunicator(renderer,actor);
-    #ifdef vtkSurfaceLICMapperTIME
-    this->EndTimerEvent("vtkSurfaceLICMapper::CreateCommunicator");
-    #endif
-    }
-  vtkPainterCommunicator *comm = this->Internals->Communicator;
-
-  if (comm->GetIsNull())
-    {
-    // other rank's may have some visible data but we
-    // have none and should not participate further
-    #ifdef vtkSurfaceLICMapperTIME
-    this->EndTimerEvent("vtkSurfaceLICMapper::RenderInternal");
-    #endif
-    return;
-    }
-
-  if (!this->CanRenderSurfaceLIC(actor))
-    {
-    // we've determined that there's no work for us, or that the
-    // requisite opengl extensions are not available. pass control on
-    // to delegate renderer and return.
-    this->Superclass::RenderPiece(renderer, actor);
-    #ifdef vtkSurfaceLICMapperTIME
-    this->EndTimerEvent("vtkSurfaceLICMapper::RenderInternal");
-    #endif
-    return;
-    }
-
-  // allocate rendering resources, initialize or update
-  // textures and shaders.
-  this->InitializeResources();
-
-  vtkPixelExtent viewExt(
-        this->Internals->Viewsize[0],
-        this->Internals->Viewsize[1]);
-
-  // save the active fbo and its draw buffer
-  int prevDrawBuf = 0;
-  glGetIntegerv(GL_DRAW_BUFFER, &prevDrawBuf);
-
-  int prevFbo = 0;
-  glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, &prevFbo);
-
-  // ------------------------------------------- render geometry, project vectors onto screen, etc
-  if (this->NeedToRenderGeometry(renderer, actor))
-    {
-    #ifdef vtkSurfaceLICMapperTIME
-    this->StartTimerEvent("vtkSurfaceLICMapper::RenderGeometry");
-    #endif
-
-    // setup our fbo
-    vtkFrameBufferObject2 *fbo = this->Internals->FBO;
-    fbo->SaveCurrentBindings();
-    fbo->Bind(GL_FRAMEBUFFER);
-    fbo->AddDepthAttachment(GL_DRAW_FRAMEBUFFER, this->Internals->DepthImage);
-    fbo->AddColorAttachment(GL_DRAW_FRAMEBUFFER, 0U, this->Internals->GeometryImage);
-    fbo->AddColorAttachment(GL_DRAW_FRAMEBUFFER, 1U, this->Internals->VectorImage);
-    fbo->AddColorAttachment(GL_DRAW_FRAMEBUFFER, 2U, this->Internals->MaskVectorImage);
-    fbo->ActivateDrawBuffers(3);
-    vtkCheckFrameBufferStatusMacro(GL_FRAMEBUFFER);
-
-    // clear internal color and depth buffers
-    // the LIC'er requires *all* fragments in the vector
-    // texture to be initialized to 0
-    glDisable(GL_BLEND);
-    glEnable(GL_DEPTH_TEST);
-    glDisable(GL_SCISSOR_TEST);
-    glClearColor(0.0, 0.0, 0.0, 0.0);
-    glClear(GL_DEPTH_BUFFER_BIT|GL_COLOR_BUFFER_BIT);
-
-    this->CurrentInput = vtkPolyData::SafeDownCast(this->Output);
-
-    this->RenderPieceStart(renderer, actor);
-    this->RenderPieceDraw(renderer, actor);
-    this->RenderEdges(renderer,actor);
-    this->RenderPieceFinish(renderer, actor);
-//    this->Superclass::RenderPiece(renderer, actor);
-
-    fbo->RemoveRenDepthAttachment(GL_DRAW_FRAMEBUFFER);
-    fbo->RemoveTexColorAttachment(GL_DRAW_FRAMEBUFFER, 0U);
-    fbo->RemoveTexColorAttachment(GL_DRAW_FRAMEBUFFER, 1U);
-    fbo->RemoveTexColorAttachment(GL_DRAW_FRAMEBUFFER, 2U);
-    fbo->DeactivateDrawBuffers();
-    fbo->UnBind(GL_FRAMEBUFFER);
-
-    #ifdef vtkSurfaceLICMapperTIME
-    this->EndTimerEvent("vtkSurfaceLICMapper::RenderGeometry");
-    #endif
-    #if vtkSurfaceLICMapperDEBUG >= 2
-    vtkTextureIO::Write(
-          mpifn(comm,"slicp_geometry_image.vtm"),
-          this->Internals->GeometryImage,
-          this->Internals->BlockExts);
-    vtkTextureIO::Write(
-          mpifn(comm,"slicp_vector_image.vtm"),
-          this->Internals->VectorImage,
-          this->Internals->BlockExts);
-    vtkTextureIO::Write(
-          mpifn(comm,"slicp_mask_vector_image.vtm"),
-          this->Internals->MaskVectorImage,
-          this->Internals->BlockExts);
-    #if defined(USE_DEPTH_TEXTURE)
-    vtkTextureIO::Write(
-          mpifn(comm,"slicp_depth_image.vtm"),
-          this->Internals->DepthImage,
-          this->Internals->BlockExts);
-    #endif
-    #endif
-    }
-
-  // --------------------------------------------- compoiste vectors for parallel LIC
-  if (this->NeedToGatherVectors())
-    {
-    #ifdef vtkSurfaceLICMapperTIME
-    this->StartTimerEvent("vtkSurfaceLICMapper::GatherVectors");
-    #endif
-
-    // get tight screen space bounds to reduce communication/computation
-    vtkPixelBufferObject *vecPBO = this->Internals->VectorImage->Download();
-    void *pVecPBO = vecPBO->MapPackedBuffer();
-
-    this->Internals->GetPixelBounds(
-            (float*)pVecPBO,
-            this->Internals->Viewsize[0],
-            this->Internals->BlockExts);
-
-    // initialize compositor
-    this->Internals->Compositor->Initialize(
-          viewExt,
-          this->Internals->BlockExts,
-          this->CompositeStrategy,
-          this->StepSize,
-          this->NumberOfSteps,
-          this->NormalizeVectors,
-          this->EnhancedLIC,
-          this->AntiAlias);
-
-    if (comm->GetMPIInitialized())
-      {
-      // parallel run
-      // need to use the communicator provided by the rendering engine
-      this->Internals->Compositor->SetCommunicator(comm);
-
-      // build compositing program and set up the screen space decomp
-      // with guard pixels
-      int iErr = 0;
-      iErr = this->Internals->Compositor->BuildProgram((float*)pVecPBO);
-      if (iErr)
-        {
-        vtkErrorMacro("Failed to construct program, reason " << iErr);
-        }
-
-      // composite vectors
-      vtkTextureObject *compositeVectors = this->Internals->CompositeVectorImage;
-      iErr = this->Internals->Compositor->Gather(
-              pVecPBO,
-              VTK_FLOAT,
-              4,
-              compositeVectors);
-      if (iErr)
-        {
-        vtkErrorMacro("Failed to composite vectors, reason  " << iErr);
-        }
-
-      // composite mask vectors
-      vtkTextureObject *compositeMaskVectors = this->Internals->CompositeMaskVectorImage;
-      vtkPixelBufferObject *maskVecPBO = this->Internals->MaskVectorImage->Download();
-      void *pMaskVecPBO = maskVecPBO->MapPackedBuffer();
-      iErr = this->Internals->Compositor->Gather(
-              pMaskVecPBO,
-              VTK_FLOAT,
-              4,
-              compositeMaskVectors);
-      if (iErr)
-        {
-        vtkErrorMacro("Failed to composite mask vectors, reason " << iErr);
-        }
-      maskVecPBO->UnmapPackedBuffer();
-      maskVecPBO->Delete();
-
-      // restore the default communicator
-      this->Internals->Compositor->RestoreDefaultCommunicator();
-
-      #if vtkSurfaceLICMapperDEBUG >= 2
-      vtkTextureIO::Write(
-             mpifn(comm,"slicp_new_vector_image.vtm"),
-             this->Internals->CompositeVectorImage,
-             this->Internals->Compositor->GetDisjointGuardExtents());
-
-      vtkTextureIO::Write(
-             mpifn(comm,"slicp_new_mask_vector_image.vtm"),
-             this->Internals->CompositeMaskVectorImage,
-             this->Internals->Compositor->GetDisjointGuardExtents());
-      #endif
-      }
-    else
-      {
-      // serial run
-      // make the decomposition disjoint and add guard pixels
-      this->Internals->Compositor->InitializeCompositeExtents((float*)pVecPBO);
-
-      // use the lic decomp from here on out, in serial we have this
-      // flexibility because we don't need to worry about ordered compositing
-      // or IceT's scissor boxes
-      this->Internals->BlockExts
-         = this->Internals->Compositor->GetCompositeExtents();
-
-      // pass through without compositing
-      this->Internals->CompositeVectorImage = this->Internals->VectorImage;
-      this->Internals->CompositeMaskVectorImage = this->Internals->MaskVectorImage;
-      }
-
-   vecPBO->UnmapPackedBuffer();
-   vecPBO->Delete();
-
-   #ifdef vtkSurfaceLICMapperTIME
-   this->EndTimerEvent("vtkSurfaceLICMapper::GatherVectors");
-   #endif
-   }
-
-  // ------------------------------------------- LIC on screen
-  if ( this->NeedToComputeLIC() )
-    {
-    #if vtkSurfaceLICMapperDEBUG >= 2
-    ostringstream oss;
-    if ( this->GenerateNoiseTexture )
-      {
-      const char *noiseType[3]={"unif","gauss","perl"};
-      oss
-       << "slicp_noise_"
-       << noiseType[this->NoiseType]
-       << "_size_" << this->NoiseTextureSize
-       << "_grain_" << this->NoiseGrainSize
-       << "_minval_" << this->MinNoiseValue
-       << "_maxval_" << this->MaxNoiseValue
-       << "_nlevels_" << this->NumberOfNoiseLevels
-       << "_impulseprob_" << this->ImpulseNoiseProbability
-       << "_impulseprob_" << this->ImpulseNoiseBackgroundValue
-       << ".vtk";
-      }
-    else
-      {
-      oss << "slicp_noise_default.vtk";
-      }
-    vtkTextureIO::Write(
-          mpifn(comm, oss.str().c_str()),
-          this->Internals->NoiseImage);
-    #endif
-    #ifdef vtkSurfaceLICMapperTIME
-    this->StartTimerEvent("vtkSurfaceLICMapper::ComputeLIC");
-    #endif
-
-    // TODO -- this means that the steps size is a function
-    // of aspect ratio which is pretty insane...
-    // convert from window units to texture units
-    // this isn't correct since there's no way to account
-    // for anisotropy in the trasnform to texture space
-    double tcScale[2] = {
-          1.0/this->Internals->Viewsize[0],
-          1.0/this->Internals->Viewsize[1]};
-
-    double stepSize
-      = this->StepSize*sqrt(tcScale[0]*tcScale[0]+tcScale[1]*tcScale[1]);
-
-    stepSize = stepSize <= 0.0 ? 1.0e-10 : stepSize;
-
-    // configure image lic
-    vtkLineIntegralConvolution2D *LICer = this->Internals->LICer;
-
-    LICer->SetStepSize(stepSize);
-    LICer->SetNumberOfSteps(this->NumberOfSteps);
-    LICer->SetEnhancedLIC(this->EnhancedLIC);
-    switch (this->EnhanceContrast)
-      {
-      case ENHANCE_CONTRAST_LIC:
-      case ENHANCE_CONTRAST_BOTH:
-        LICer->SetEnhanceContrast(vtkLIC2D::ENHANCE_CONTRAST_ON);
-        break;
-      default:
-        LICer->SetEnhanceContrast(vtkLIC2D::ENHANCE_CONTRAST_OFF);
-      }
-    LICer->SetLowContrastEnhancementFactor(this->LowLICContrastEnhancementFactor);
-    LICer->SetHighContrastEnhancementFactor(this->HighLICContrastEnhancementFactor);
-    LICer->SetAntiAlias(this->AntiAlias);
-    LICer->SetComponentIds(0, 1);
-    LICer->SetNormalizeVectors(this->NormalizeVectors);
-    LICer->SetMaskThreshold(this->MaskThreshold);
-    LICer->SetCommunicator(comm);
-
-    // loop over composited extents
-    const deque<vtkPixelExtent> &compositeExts
-      = this->Internals->Compositor->GetCompositeExtents();
-
-    const deque<vtkPixelExtent> &disjointGuardExts
-      = this->Internals->Compositor->GetDisjointGuardExtents();
-
-    this->Internals->LICImage.TakeReference(
-         LICer->Execute(
-              viewExt,            // screen extent
-              disjointGuardExts,  // disjoint extent of valid vectors
-              compositeExts,      // disjoint extent where lic is needed
-              this->Internals->CompositeVectorImage,
-              this->Internals->CompositeMaskVectorImage,
-              this->Internals->NoiseImage));
-
-    if (!this->Internals->LICImage)
-      {
-      vtkErrorMacro("Failed to compute image LIC");
-      return;
-      }
-
-    #ifdef vtkSurfaceLICMapperTIME
-    this->EndTimerEvent("vtkSurfaceLICMapper::ComputeLIC");
-    #endif
-    #if vtkSurfaceLICMapperDEBUG >= 2
-    vtkTextureIO::Write(
-          mpifn(comm,"slicp_lic.vtm"),
-          this->Internals->LICImage,
-          compositeExts);
-    #endif
-
-    // ------------------------------------------- move from LIC decomp back to geometry decomp
-    if ( comm->GetMPIInitialized()
-      && (this->Internals->Compositor->GetStrategy()!=COMPOSITE_INPLACE ) )
-      {
-      #ifdef vtkSurfaceLICMapperTIME
-      this->StartTimerEvent("vtkSurfaceLICMapper::ScatterLIC");
-      #endif
-
-      // parallel run
-      // need to use the communicator provided by the rendering engine
-      this->Internals->Compositor->SetCommunicator(comm);
-
-      vtkPixelBufferObject *licPBO = this->Internals->LICImage->Download();
-      void *pLicPBO = licPBO->MapPackedBuffer();
-      vtkTextureObject *newLicImage = NULL;
-      int iErr = this->Internals->Compositor->Scatter(pLicPBO, VTK_FLOAT, 4, newLicImage);
-      if (iErr)
-        {
-        vtkErrorMacro("Failed to scatter lic");
-        }
-      licPBO->UnmapPackedBuffer();
-      licPBO->Delete();
-      this->Internals->LICImage = NULL;
-      this->Internals->LICImage = newLicImage;
-      newLicImage->Delete();
-
-      // restore the default communicator
-      this->Internals->Compositor->RestoreDefaultCommunicator();
-
-      #ifdef vtkSurfaceLICMapperTIME
-      this->EndTimerEvent("vtkSurfaceLICMapper::ScatterLIC");
-      #endif
-      #if vtkSurfaceLICMapperDEBUG >= 2
-      vtkTextureIO::Write(
-            mpifn(comm,"slicp_new_lic.vtm"),
-            this->Internals->LICImage,
-            this->Internals->BlockExts);
-      #endif
-      }
-    }
-
-  // ------------------------------------------- combine scalar colors + LIC
-  if ( this->NeedToColorLIC() )
-    {
-    #ifdef vtkSurfaceLICMapperTIME
-    this->StartTimerEvent("vtkSurfaceLICMapper::ColorLIC");
-    #endif
-    vtkFrameBufferObject2 *fbo = this->Internals->FBO;
-    fbo->SaveCurrentBindings();
-    fbo->Bind(GL_FRAMEBUFFER);
-    fbo->InitializeViewport(this->Internals->Viewsize[0], this->Internals->Viewsize[1]);
-    fbo->AddColorAttachment(GL_DRAW_FRAMEBUFFER, 0U, this->Internals->RGBColorImage);
-    fbo->AddColorAttachment(GL_DRAW_FRAMEBUFFER, 1U, this->Internals->HSLColorImage);
-    fbo->ActivateDrawBuffers(2U);
-    vtkCheckFrameBufferStatusMacro(GL_FRAMEBUFFER);
-
-    #if 0
-    glDisable(GL_SCISSOR_TEST);
-    glClearColor(0.0, 0.0, 0.0, 0.0);
-    glClear(GL_COLOR_BUFFER_BIT);
-    #else
-    // clear the parts of the screen which we will modify
-    glEnable(GL_SCISSOR_TEST);
-    glClearColor(0.0, 0.0, 0.0, 0.0);
-    size_t nBlocks = this->Internals->BlockExts.size();
-    for (size_t e=0; e<nBlocks; ++e)
-      {
-      vtkPixelExtent ext = this->Internals->BlockExts[e];
-      ext.Grow(2); // halo for linear filtering
-      ext &= viewExt;
-
-      unsigned int extSize[2];
-      ext.Size(extSize);
-
-      glScissor(ext[0], ext[2], extSize[0], extSize[1]);
-      glClear(GL_COLOR_BUFFER_BIT);
-      }
-    glDisable(GL_SCISSOR_TEST);
-    #endif
-
-    this->Internals->VectorImage->Activate();
-    this->Internals->GeometryImage->Activate();
-    this->Internals->LICImage->Activate();
-
-    vtkShaderProgram *colorPass = this->Internals->ColorPass->Program;
-    renWin->GetShaderCache()->ReadyShaderProgram(colorPass);
-    colorPass->SetUniformi("texVectors",
-      this->Internals->VectorImage->GetTextureUnit());
-    colorPass->SetUniformi("texGeomColors",
-      this->Internals->GeometryImage->GetTextureUnit());
-    colorPass->SetUniformi("texLIC",
-      this->Internals->LICImage->GetTextureUnit());
-    colorPass->SetUniformi("uScalarColorMode", this->ColorMode);
-    colorPass->SetUniformf("uLICIntensity", this->LICIntensity);
-    colorPass->SetUniformf("uMapBias", this->MapModeBias);
-    colorPass->SetUniformf("uMaskIntensity", this->MaskIntensity);
-    float fMaskColor[3];
-    fMaskColor[0] = this->MaskColor[0];
-    fMaskColor[1] = this->MaskColor[1];
-    fMaskColor[2] = this->MaskColor[2];
-    colorPass->SetUniform3f("uMaskColor", fMaskColor);
-
-    for (size_t e=0; e<nBlocks; ++e)
-      {
-      this->Internals->RenderQuad(viewExt, this->Internals->BlockExts[e],
-        this->Internals->ColorPass);
-      }
-
-    this->Internals->VectorImage->Deactivate();
-    this->Internals->GeometryImage->Deactivate();
-    this->Internals->LICImage->Deactivate();
-
-    #ifdef vtkSurfaceLICMapperTIME
-    this->EndTimerEvent("vtkSurfaceLICMapper::ColorLIC");
-    #endif
-
-    // --------------------------------------------- color contrast enhance
-    if ( ( this->EnhanceContrast == ENHANCE_CONTRAST_COLOR )
-      || ( this->EnhanceContrast == ENHANCE_CONTRAST_BOTH ) )
-      {
-      #if vtkSurfaceLICMapperDEBUG >= 2
-      vtkTextureIO::Write(
-            mpifn(comm,"slic_color_rgb_in.vtm"),
-            this->Internals->RGBColorImage,
-            this->Internals->BlockExts);
-      vtkTextureIO::Write(
-            mpifn(comm,"slic_color_hsl_in.vtm"),
-            this->Internals->HSLColorImage,
-            this->Internals->BlockExts);
-      #endif
-      #ifdef vtkSurfaceLICMapperTIME
-      this->StartTimerEvent("vtkSurfaceLICMapper::ContrastEnhance");
-      #endif
-
-      // find min/max lighness value for color contrast enhancement.
-      float LMin = VTK_FLOAT_MAX;
-      float LMax = -VTK_FLOAT_MAX;
-      float LMaxMinDiff = VTK_FLOAT_MAX;
-
-      #ifdef STREAMING_MIN_MAX
-      StreamingFindMinMax(fbo, this->Internals->BlockExts, LMin, LMax);
-      #else
-      FindMinMax(
-            this->Internals->HSLColorImage,
-            this->Internals->BlockExts,
-            LMin,
-            LMax);
-      #endif
-
-      if ( this->Internals->BlockExts.size()
-        && ((LMax <= LMin) || (LMin < 0.0f) || (LMax > 1.0f)) )
-        {
-        vtkErrorMacro(
-          << comm->GetRank()
-          << ": Invalid  range " << LMin << ", " << LMax
-          << " for color contrast enhancement");
-        LMin = 0.0;
-        LMax = 1.0;
-        LMaxMinDiff = 1.0;
-        }
-
-      // global collective reduction for parallel operation
-      this->GetGlobalMinMax(comm, LMin, LMax);
-
-      // set M and m as a fraction of the range.
-      LMaxMinDiff = LMax-LMin;
-      LMin += LMaxMinDiff*this->LowColorContrastEnhancementFactor;
-      LMax -= LMaxMinDiff*this->HighColorContrastEnhancementFactor;
-      LMaxMinDiff = LMax-LMin;
-
-      // normalize shader
-      fbo->AddColorAttachment(GL_DRAW_FRAMEBUFFER, 0U, this->Internals->RGBColorImage);
-      fbo->ActivateDrawBuffer(0U);
-      vtkCheckFrameBufferStatusMacro(GL_DRAW_FRAMEBUFFER);
-
-      this->Internals->GeometryImage->Activate();
-      this->Internals->HSLColorImage->Activate();
-      this->Internals->LICImage->Activate();
-
-      vtkShaderProgram *colorEnhancePass =
-        this->Internals->ColorEnhancePass->Program;
-      renWin->GetShaderCache()->ReadyShaderProgram(colorEnhancePass);
-      colorEnhancePass->SetUniformi("texGeomColors",
-        this->Internals->GeometryImage->GetTextureUnit());
-      colorEnhancePass->SetUniformi("texHSLColors",
-        this->Internals->HSLColorImage->GetTextureUnit());
-      colorEnhancePass->SetUniformi("texLIC",
-        this->Internals->LICImage->GetTextureUnit());
-      colorEnhancePass->SetUniformf("uLMin", LMin);
-      colorEnhancePass->SetUniformf("uLMaxMinDiff", LMaxMinDiff);
-
-      for (size_t e=0; e<nBlocks; ++e)
-        {
-        this->Internals->RenderQuad(viewExt, this->Internals->BlockExts[e],
-          this->Internals->ColorEnhancePass);
-        }
-
-      this->Internals->GeometryImage->Deactivate();
-      this->Internals->HSLColorImage->Deactivate();
-      this->Internals->LICImage->Deactivate();
-
-      fbo->RemoveTexColorAttachment(GL_DRAW_FRAMEBUFFER, 0U);
-      fbo->DeactivateDrawBuffers();
-
-      #ifdef vtkSurfaceLICMapperTIME
-      this->EndTimerEvent("vtkSurfaceLICMapper::ContrastEnhance");
-      #endif
-      }
-    else
-      {
-      fbo->RemoveTexColorAttachment(GL_DRAW_FRAMEBUFFER, 0U);
-      fbo->RemoveTexColorAttachment(GL_DRAW_FRAMEBUFFER, 1U);
-      fbo->DeactivateDrawBuffers();
-      }
-
-    fbo->UnBind(GL_FRAMEBUFFER);
-
-    #if vtkSurfaceLICMapperDEBUG >= 2
-    vtkTextureIO::Write(
-           mpifn(comm,"slicp_new_rgb.vtm"),
-           this->Internals->RGBColorImage,
-           this->Internals->BlockExts);
-    #endif
-    }
-
-  // ----------------------------------------------- depth test and copy to screen
-  #ifdef vtkSurfaceLICMapperTIME
-  this->StartTimerEvent("vtkSurfaceLICMapper::DepthCopy");
-  #endif
-  glBindFramebuffer(GL_FRAMEBUFFER, prevFbo);
-  glDrawBuffer(prevDrawBuf);
-  vtkFrameBufferObject2::InitializeViewport(
-        this->Internals->Viewsize[0],
-        this->Internals->Viewsize[1]);
-  glEnable(GL_DEPTH_TEST);
-
-  this->Internals->DepthImage->Activate();
-  this->Internals->RGBColorImage->Activate();
-
-  vtkShaderProgram *copyPass =
-    this->Internals->CopyPass->Program;
-  renWin->GetShaderCache()->ReadyShaderProgram(copyPass);
-  copyPass->SetUniformi("texDepth",
-    this->Internals->DepthImage->GetTextureUnit());
-  copyPass->SetUniformi("texRGBColors",
-    this->Internals->RGBColorImage->GetTextureUnit());
-
-  size_t nBlocks = this->Internals->BlockExts.size();
-  for (size_t e=0; e<nBlocks; ++e)
-    {
-    this->Internals->RenderQuad(viewExt, this->Internals->BlockExts[e],
-      this->Internals->CopyPass);
-    }
-
-  this->Internals->DepthImage->Deactivate();
-  this->Internals->RGBColorImage->Deactivate();
-
-  #ifdef vtkSurfaceLICMapperTIME
-  this->EndTimerEvent("vtkSurfaceLICMapper::DepthCopy");
-  #endif
-
-  //
-  this->Internals->Updated();
-
-  // clear opengl error flags and be absolutely certain that nothing failed.
-  vtkOpenGLCheckErrorMacro("failed during surface lic painter");
-
-  #ifdef vtkSurfaceLICMapperTIME
-  this->EndTimerEvent("vtkSurfaceLICMapper::RenderInternal");
-  #else
-  timer->StopTimer();
-  #endif
-}
-
-//-----------------------------------------------------------------------------
-void vtkSurfaceLICMapper::ReportReferences(vtkGarbageCollector *collector)
-{
-  this->Superclass::ReportReferences(collector);
-
-  vtkGarbageCollectorReport(collector, this->Output, "Output PolyData");
-}
-
-//----------------------------------------------------------------------------
-vtkDataObject* vtkSurfaceLICMapper::GetOutput()
-{
-  #if vtkSurfaceLICMapperDEBUG >= 1
-  cerr << "=====vtkSurfaceLICMapper::GetOutput" << endl;
-  #endif
-
-  if (this->Enable && this->Output)
-    {
-    return this->Output;
-    }
-  return this->GetInput();
-}
-
-//----------------------------------------------------------------------------
-bool vtkSurfaceLICMapper::PrepareOutput()
-{
-  vtkDataObject* input = this->GetInput();
-  if ((input == NULL) || !this->Enable)
-    {
-    if (this->Output)
-      {
-      this->Output->Delete();
-      this->Output = NULL;
-      this->Internals->HasVectors = false;
-      }
-    return false;
-    }
-
-  if (this->Internals->OutputDataNeedsUpdate)
-    {
-    if (this->Output)
-      {
-      this->Output->Delete();
-      this->Output = NULL;
-      }
-
-    this->Output = input->NewInstance();
-    this->Output->ShallowCopy(input);
-    this->Internals->HasVectors = false;
-    }
-
-  if (!this->Internals->HasVectors)
-    {
-    this->Internals->HasVectors = this->VectorsToTCoords(this->Output);
-    }
-
-  return this->Internals->HasVectors;
-}
-
-//----------------------------------------------------------------------------
-bool vtkSurfaceLICMapper::VectorsToTCoords(vtkDataObject *dataObj)
-{
-  bool hasVectors = false;
-
-  vtkCompositeDataSet *cd = vtkCompositeDataSet::SafeDownCast(dataObj);
-  if (cd)
-    {
-    vtkCompositeDataIterator* iter = cd->NewIterator();
-    for (iter->InitTraversal(); !iter->IsDoneWithTraversal(); iter->GoToNextItem())
-      {
-      vtkDataSet* ds = vtkDataSet::SafeDownCast(iter->GetCurrentDataObject());
-      if (ds && ds->GetNumberOfCells())
-        {
-        this->ClearTCoords(ds);
-        hasVectors |= this->VectorsToTCoords(ds);
-        }
-      }
-    iter->Delete();
-    return hasVectors;
-    }
-
-  vtkDataSet* ds = vtkDataSet::SafeDownCast(dataObj);
-  if (ds && ds->GetNumberOfCells())
-    {
-    this->ClearTCoords(ds);
-    hasVectors |= this->VectorsToTCoords(ds);
-    }
-
-  if ( hasVectors )
-    {
-    // force downstream updates (display lists, etc)
-    this->Output->Modified();
-    }
-
-  return hasVectors;
-}
-
-//----------------------------------------------------------------------------
-bool vtkSurfaceLICMapper::VectorsToTCoords(vtkDataSet *data)
-{
-  // don't use SafeDownCast here for rendering performance
-  vtkDataArray *vectors = NULL;
-
-  vectors = this->GetInputArrayToProcess(0, data);
-
-  if ( vectors == NULL )
-    {
-    return false;
-    }
-
-  vtkDataSetAttributes *atts = NULL;
-  atts = data->GetPointData();
-  int nArrays = atts->GetNumberOfArrays();
-  for (int i=0; i<nArrays; ++i)
-    {
-    if ( atts->GetArray(i) == vectors )
-      {
-      atts->SetActiveAttribute(i, vtkDataSetAttributes::TCOORDS);
-      return true;
-      }
-    }
-
-  atts = data->GetCellData();
-  nArrays = atts->GetNumberOfArrays();
-  for (int i=0; i<nArrays; ++i)
-    {
-    if ( atts->GetArray(i) == vectors )
-      {
-      atts->SetActiveAttribute(i, vtkDataSetAttributes::TCOORDS);
-      return true;
-      }
-    }
-  return false;
-}
-
-//----------------------------------------------------------------------------
-void vtkSurfaceLICMapper::ClearTCoords(vtkDataSet *data)
-{
-  data->GetCellData()->SetActiveAttribute(-1, vtkDataSetAttributes::TCOORDS);
-  data->GetPointData()->SetActiveAttribute(-1, vtkDataSetAttributes::TCOORDS);
-}
-
-//----------------------------------------------------------------------------
-void vtkSurfaceLICMapper::PrintSelf(ostream & os, vtkIndent indent)
-{
-  this->Superclass::PrintSelf(os, indent);
-  os
-    << indent << "NumberOfSteps=" << this->NumberOfSteps << endl
-    << indent << "StepSize=" << this->StepSize << endl
-    << indent << "NormalizeVectors=" << this->NormalizeVectors << endl
-    << indent << "EnhancedLIC=" << this->EnhancedLIC << endl
-    << indent << "EnhanceContrast=" << this->EnhanceContrast << endl
-    << indent << "LowLICContrastEnhancementFactor=" << this->LowLICContrastEnhancementFactor << endl
-    << indent << "HighLICContrastEnhancementFactor=" << this->HighLICContrastEnhancementFactor << endl
-    << indent << "LowColorContrastEnhancementFactor=" << this->LowColorContrastEnhancementFactor << endl
-    << indent << "HighColorContrastEnhancementFactor=" << this->HighColorContrastEnhancementFactor << endl
-    << indent << "AntiAlias=" << this->AntiAlias << endl
-    << indent << "MaskOnSurface=" << this->MaskOnSurface << endl
-    << indent << "MaskThreshold=" << this->MaskThreshold << endl
-    << indent << "MaskIntensity=" << this->MaskIntensity << endl
-    << indent << "MaskColor=" << this->MaskColor[0] << ", " << this->MaskColor[1] << ", " << this->MaskColor[2] << endl
-    << indent << "ColorMode=" << this->ColorMode << endl
-    << indent << "LICIntensity=" << this->LICIntensity << endl
-    << indent << "MapModeBias=" << this->MapModeBias << endl
-    << indent << "GenerateNoiseTexture=" << this->GenerateNoiseTexture << endl
-    << indent << "NoiseType=" << this->NoiseType << endl
-    << indent << "NoiseTextureSize=" << this->NoiseTextureSize << endl
-    << indent << "NoiseGrainSize=" << this->NoiseGrainSize << endl
-    << indent << "MinNoiseValue=" << this->MinNoiseValue << endl
-    << indent << "MaxNoiseValue=" << this->MaxNoiseValue << endl
-    << indent << "NumberOfNoiseLevels=" << this->NumberOfNoiseLevels << endl
-    << indent << "ImpulseNoiseProbablity=" << this->ImpulseNoiseProbability << endl
-    << indent << "ImpulseNoiseBackgroundValue=" << this->ImpulseNoiseBackgroundValue << endl
-    << indent << "NoiseGeneratorSeed=" << this->NoiseGeneratorSeed << endl
-    << indent << "AlwaysUpdate=" << this->AlwaysUpdate << endl
-    << indent << "Enable=" << this->Enable << endl
-    << indent << "CompositeStrategy=" << this->CompositeStrategy << endl;
-}
diff --git a/Rendering/LICOpenGL2/vtkSurfaceLICMapper.h b/Rendering/LICOpenGL2/vtkSurfaceLICMapper.h
deleted file mode 100644
index 65b9892..0000000
--- a/Rendering/LICOpenGL2/vtkSurfaceLICMapper.h
+++ /dev/null
@@ -1,524 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkSurfaceLICMapper.h
-
-  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.
-
-=========================================================================*/
-// .NAME vtkSurfaceLICMapper - mapper that performs LIC on the surface of
-//  arbitrary geometry.
-//
-// .SECTION Description
-//  vtkSurfaceLICMapper performs LIC on the surface of arbitrary
-//  geometry. Point vectors are used as the vector field for generating the LIC.
-//  The implementation was originallu  based on "Image Space Based Visualization
-//  on Unsteady Flow on Surfaces" by Laramee, Jobard and Hauser appeared in
-//  proceedings of IEEE Visualization '03, pages 131-138.
-//
-//  Internal pipeline:
-// <pre>
-// noise
-//     |
-//     [ PROJ (GAT) (COMP) LIC2D (SCAT) SHADE (CCE) DEP]
-//     |                                               |
-// vectors                                         surface LIC
-// </pre>
-// PROj  - prject vectors onto surface
-// GAT   - gather data for compositing and guard pixel generation  (parallel only)
-// COMP  - composite gathered data
-// LIC2D - line intengral convolution, see vtkLineIntegralConvolution2D.
-// SCAT  - scatter result (parallel only, not all compositors use it)
-// SHADE - combine LIC and scalar colors
-// CCE   - color contrast enhancement (optional)
-// DEP   - depth test and copy to back buffer
-//
-// The result of each stage is cached in a texture so that during interaction
-// a stage may be skipped if the user has not modified its paramters or input
-// data.
-//
-// The parallel parts of algorithm are implemented in vtkPSurfaceLICMapper.
-// Note that for MPI enabled builds this class will be automatically created
-// by the object factory.
-//
-// .SECTION See also
-// vtkLineIntegralConvolution2D
-#ifndef vtkSurfaceLICMapper_h
-#define vtkSurfaceLICMapper_h
-
-#include "vtkRenderingLICOpenGL2Module.h" // For export macro
-#include "vtkOpenGLPolyDataMapper.h"
-
-class vtkRenderWindow;
-class vtkRenderer;
-class vtkActor;
-class vtkImageData;
-class vtkDataObject;
-class vtkDataArray;
-class vtkPainterCommunicator;
-
-class VTKRENDERINGLICOPENGL2_EXPORT vtkSurfaceLICMapper : public vtkOpenGLPolyDataMapper
-{
-public:
-  static vtkSurfaceLICMapper* New();
-  vtkTypeMacro(vtkSurfaceLICMapper, vtkOpenGLPolyDataMapper);
-  void PrintSelf(ostream& os, vtkIndent indent);
-
-  // Description:
-  // Release any graphics resources that are being consumed by this mapper.
-  // The parameter window could be used to determine which graphic
-  // resources to release. In this case, releases the display lists.
-  virtual void ReleaseGraphicsResources(vtkWindow * win);
-
-  // Description:
-  // Get the output data object from this painter.
-  // Overridden to pass the input points (or cells) vectors as the tcoords to
-  // the deletage painters. This is required by the internal GLSL shader
-  // programs used for generating LIC.
-  virtual vtkDataObject* GetOutput();
-
-  // Description:
-  // Enable/Disable this painter.
-  void SetEnable(int val);
-  vtkGetMacro(Enable, int);
-  void SetEnableOn(){ this->SetEnable(1); }
-  void SetEnableOff(){ this->SetEnable(0); }
-
-  // Description:
-  // Get/Set the number of integration steps in each direction.
-  void SetNumberOfSteps(int val);
-  vtkGetMacro(NumberOfSteps, int);
-
-  // Description:
-  // Get/Set the step size (in pixels).
-  void SetStepSize(double val);
-  vtkGetMacro(StepSize, double);
-
-  // Description:
-  // Normalize vectors during integration. When set(the default) the
-  // input vector field is normalized during integration, and each
-  // integration occurs over the same arclength. When not set each
-  // integration occurs over an arc length proportional to the field
-  // magnitude as is customary in traditional numerical methods. See,
-  // "Imaging Vector Fields Using Line Integral Convolution" for an
-  // axample where normalization is used. See, "Image Space Based
-  // Visualization of Unsteady Flow on Surfaces" for an example
-  // of where no normalization is used.
-  void SetNormalizeVectors(int val);
-  vtkBooleanMacro(NormalizeVectors, int);
-  vtkGetMacro(NormalizeVectors, int);
-
-  // Description:
-  // When set MaskOnSurface computes |V| for use in the fragment masking
-  // tests on the surface. When not set the original un-projected
-  // un-transformed |V| is used.
-  void SetMaskOnSurface(int val);
-  vtkBooleanMacro(MaskOnSurface, int);
-  vtkGetMacro(MaskOnSurface, int);
-
-  // Description:
-  // The MaskThreshold controls the rendering of fragments in stagnant
-  // regions of flow.  // In these regions LIC noise texture will be masked,
-  // where |V| < MaskThreshold is satisifed. The masking process blends a
-  // the MaskColor with the scalar color of the surface proportional to
-  // MaskIntesnsity. See MaskIntensity for more information on the blending
-  // algorithm. This blending allows one control over the masking process
-  // so that masked fragments may be: highlighted (by setting a unique
-  // mask color and mask intensity > 0), made invisible with and without
-  // passing the un-convolved noise texture (by setting mask intensity 0),
-  // made to blend into the LIC.
-  //
-  // MaskThreshold units are in the original vector space. Note that the
-  // threshold can be applied to the original vector field or to the surface
-  // projected vector field. See MaskOnSurface.
-  void SetMaskThreshold(double val);
-  vtkGetMacro(MaskThreshold, double);
-
-  // Description:
-  // The MaskColor is used on masked fragments. The default of (0.5, 0.5, 0.5)
-  // makes the masked fragments look similar to the LIC'd fragments. The mask
-  // color is applied only when MaskIntensity > 0.
-  void SetMaskColor(double *val);
-  void SetMaskColor(double r, double g, double b)
-    { double rgb[3]={r,g,b}; this->SetMaskColor(rgb); }
-  vtkGetVector3Macro(MaskColor, double);
-
-  // Description:
-  // The MaskIntensity controls the blending of the mask color and the geometry
-  // color. The color of masked fragments is given by:
-  //
-  //     c = maskColor * maskIntensity + geomColor * (1 - maskIntensity)
-  //
-  // The default value of 0.0 results in the geometry color being used.
-  void SetMaskIntensity(double val);
-  vtkGetMacro(MaskIntensity, double);
-
-  // Description:
-  // EnhancedLIC mean compute the LIC twice with the second pass using
-  // the edge-enhanced result of the first pass as a noise texture. Edge
-  // enhancedment is made by a simple Laplace convolution.
-  void SetEnhancedLIC(int val);
-  vtkGetMacro(EnhancedLIC, int);
-  vtkBooleanMacro(EnhancedLIC, int);
-
-  // Description:
-  // Enable/Disable contrast and dynamic range correction stages. Contrast
-  // enhancement can be enabled during LIC computations (See
-  // vtkLineINtegralComvolution2D) and after the scalar colors have been
-  // combined with the LIC.
-  //
-  // The best appraoch for using this feature is to enable LIC enhancement,
-  // and only if the image is to dark or dull enable COLOR enhancement.
-  //
-  // Both stages are implemented by a histogram stretching algorithm. During
-  // LIC stages the contrast enhancement is applied to gray scale LIC image.
-  // During the scalar coloring stage the contrast enhancement is applied to
-  // the lightness channel of the color image in HSL color space. The
-  // histogram stretching is implemented as follows:
-  //
-  //     L = (L-m)/(M-m)
-  //
-  // where, L is the fragment intensity/lightness, m is the intensity/lightness
-  // to map to 0, M is the intensity/lightness to map to 1. The default values
-  // of m and M are the min and max taken over all fragments.
-  //
-  // This increase the dynamic range and contrast in the LIC'd image, both of
-  // which are natuarly attenuated by the convolution proccess.
-  //
-  // Values
-  //
-  //   ENHANCE_CONTRAST_OFF   -- don't enhance LIC or scalar colors
-  //   ENHANCE_CONTRAST_LIC   -- enhance in LIC high-pass input and output
-  //   ENHANCE_CONTRAST_COLOR -- enhance after scalars are combined with LIC
-  //   ENHANCE_CONTRAST_BOTH  -- enhance in LIC stages and after scalar colors
-  //
-  // This feature is disabled by default.
-  enum {
-    ENHANCE_CONTRAST_OFF=0,
-    ENHANCE_CONTRAST_LIC=1,
-    ENHANCE_CONTRAST_COLOR=3,
-    ENHANCE_CONTRAST_BOTH=4
-    };
-  void SetEnhanceContrast(int val);
-  vtkGetMacro(EnhanceContrast, int);
-
-  // Description:
-  // This feature is used to fine tune the contrast enhancement. There are two
-  // modes AUTOMATIC and MANUAL.In AUTOMATIC mode values are provided indicating
-  // the fraction of the range to adjust M and m by, during contrast enahncement
-  // histogram stretching. M and m are the intensity/lightness values that map
-  // to 1 and 0. (see EnhanceContrast for an explanation of the mapping
-  // procedure). m and M are computed using the factors as follows:
-  //
-  //     m = min(C) + mFactor * (max(C) - min(C))
-  //     M = max(C) - MFactor * (max(C) - min(C))
-  //
-  // the default values for mFactor and MFactor are 0 which result in
-  // m = min(C), M = max(C), taken over the entire image. Modifying mFactor and
-  // MFactor above or below zero provide control over the saturation/
-  // de-saturation during contrast enhancement.
-  vtkGetMacro(LowLICContrastEnhancementFactor, double);
-  vtkGetMacro(HighLICContrastEnhancementFactor, double);
-  void SetLowLICContrastEnhancementFactor(double val);
-  void SetHighLICContrastEnhancementFactor(double val);
-  //
-  vtkGetMacro(LowColorContrastEnhancementFactor, double);
-  vtkGetMacro(HighColorContrastEnhancementFactor, double);
-  void SetLowColorContrastEnhancementFactor(double val);
-  void SetHighColorContrastEnhancementFactor(double val);
-
-  // Description:
-  // Enable/Disable the anti-aliasing pass. This optional pass (disabled by
-  // default) can be enabled to reduce jagged patterns in the final LIC image.
-  // Values greater than 0 control the number of iterations, 1 is typically
-  // sufficient.
-  void SetAntiAlias(int val);
-  vtkBooleanMacro(AntiAlias, int);
-  vtkGetMacro(AntiAlias, int);
-
-  // Description:
-  // Set/Get the color mode. The color mode controls how scalar colors are
-  // combined with the LIC in the final image. The BLEND mode combines scalar
-  // colors with LIC intensities with proportional blending controled by the
-  // LICIntensity parameter. The MAP mode combines scalar colors with LIC,
-  // by multiplication the HSL represntation of color's lightness.
-  //
-  // The default is COLOR_MODE_BLEND.
-  enum {
-    COLOR_MODE_BLEND=0,
-    COLOR_MODE_MAP
-  };
-  void SetColorMode(int val);
-  vtkGetMacro(ColorMode, int);
-
-  // Description:
-  // Factor used when blend mode is set to COLOR_MODE_BLEND. This controls the
-  // contribution of the LIC in the final output image as follows:
-  //
-  //   c = LIC * LICIntensity + scalar * (1 - LICIntensity);
-  //
-  // 0.0 produces same result as disabling LIC altogether, while 1.0 implies
-  // show LIC result alone.
-  void SetLICIntensity(double val);
-  vtkGetMacro(LICIntensity, double);
-
-  // Description:
-  // Factor used when blend mode is set to COLOR_MODE_MAP. This adds a bias to
-  // the LIC image. The purpose of this is to adjust the brightness when a
-  // brighter image is desired. The default of 0.0 results in no change. Values
-  // gretaer than 0.0 will brighten the image while values less than 0.0 darken
-  // the image.
-  void SetMapModeBias(double val);
-  vtkGetMacro(MapModeBias, double);
-
-  // Description:
-  // Set the data containing a noise array as active scalars. Active scalars
-  // array will be converted into a texture for use as noise in the LIC process.
-  // Noise datasets are expected to be gray scale.
-  void SetNoiseDataSet(vtkImageData *data);
-  vtkImageData *GetNoiseDataSet();
-
-  // Description:
-  // Set/Get the noise texture source. When not set the default 200x200 white
-  // noise texture is used (see VTKData/Data/Data/noise.png). When set a noise
-  // texture is generated based on the following parameters:
-  //
-  //    NoiseType               - select noise type. Gaussian, Uniform, etc
-  //    NoiseTextureSize        - number of pixels in square noise texture(side)
-  //    NoiseGrainSize          - number of pixels each noise value spans(side)
-  //    MinNoiseValue           - minimum noise color >=0 && < MaxNoiseValue
-  //    MaxNoiseValue           - maximum noise color <=1 ** > MinNoiseValue
-  //    NumberOfNoiseLevels     - number of discrete noise colors
-  //    ImpulseNoiseProbability - impulse noise is generated when < 1
-  //    ImpulseNoiseBackgroundValue  - the background color for untouched pixels
-  //    NoiseGeneratorSeed      - seed the random number generators
-  //
-  // Changing the noise texture gives one greater control over the look of the
-  // final image. The default is 0 which results in the use of a static 200x200
-  // Gaussian noise texture. See VTKData/Data/Data/noise.png.
-  void SetGenerateNoiseTexture(int shouldGenerate);
-  vtkGetMacro(GenerateNoiseTexture, int);
-
-  // Description:
-  // Select the statistical distribution of randomly generated noise values.
-  // With uniform noise there is greater control over the range of values
-  // in the noise texture. The Default is NOISE_TYPE_GAUSSIAN.
-  enum {
-    NOISE_TYPE_UNIFORM=0,
-    NOISE_TYPE_GAUSSIAN=1,
-    NOISE_TYPE_PERLIN=2
-    };
-  void SetNoiseType(int type);
-  vtkGetMacro(NoiseType, int);
-
-  // Description:
-  // Set/Get the side length in pixels of the noise texture. The texture will
-  // be length^2 pixels in area.
-  void SetNoiseTextureSize(int length);
-  vtkGetMacro(NoiseTextureSize, int);
-
-  // Description:
-  // Each noise value will be length^2 pixels in area.
-  void SetNoiseGrainSize(int val);
-  vtkGetMacro(NoiseGrainSize, int);
-
-  // Description:
-  // Set/Get the minimum and mximum  gray scale values that the generated noise
-  // can take on. The generated noise will be in the range of MinNoiseValue to
-  // MaxNoiseValue. Values are clamped within 0 to 1. MinNoiseValue must be
-  // less than MaxNoiseValue.
-  void SetMinNoiseValue(double val);
-  void SetMaxNoiseValue(double val);
-  vtkGetMacro(MinNoiseValue, double);
-  vtkGetMacro(MaxNoiseValue, double);
-
-  // Description:
-  // Set/Get the number of discrete values a noise pixel may take on. Default
-  // 1024.
-  void SetNumberOfNoiseLevels(int val);
-  vtkGetMacro(NumberOfNoiseLevels, int);
-
-  // Description:
-  // Control the density of of the noise. A value of 1.0 produces uniform random
-  // noise while values < 1.0 produce impulse noise with the given probabilty.
-  void SetImpulseNoiseProbability(double val);
-  vtkGetMacro(ImpulseNoiseProbability, double);
-
-  // Description:
-  // The color to use for untouched pixels when impulse noise probability < 1.
-  void SetImpulseNoiseBackgroundValue(double val);
-  vtkGetMacro(ImpulseNoiseBackgroundValue, double);
-
-  // Description:
-  // Set/Get the seed value used by the random number generator.
-  void SetNoiseGeneratorSeed(int val);
-  vtkGetMacro(NoiseGeneratorSeed, int);
-
-  // Description:
-  // Control the screen space decomposition where LIC is computed.
-  enum {
-    COMPOSITE_INPLACE=0,
-    COMPOSITE_INPLACE_DISJOINT=1,
-    COMPOSITE_BALANCED=2,
-    COMPOSITE_AUTO=3
-    };
-  void SetCompositeStrategy(int val);
-  vtkGetMacro(CompositeStrategy, int);
-
-  // Description:
-  // Returns true if the rendering context supports extensions needed by this
-  // painter.
-  static bool IsSupported(vtkRenderWindow *context);
-
-  // Description:
-  // Methods used for parallel benchmarks. Use cmake to define
-  // vtkSurfaceLICMapperTIME to enable benchmarks. During each
-  // update timing information is stored, it can be written to
-  // disk by calling WriteLog.
-  virtual void WriteTimerLog(const char *){}
-
-  // Description:
-  // Implemented by sub classes. Actual rendering is done here.
-  virtual void RenderPiece(vtkRenderer *ren, vtkActor *act);
-
-  // Description:
-  // Shallow copy of an actor.
-  void ShallowCopy(vtkAbstractMapper *);
-
-protected:
-  vtkSurfaceLICMapper();
-  ~vtkSurfaceLICMapper();
-
-  // Description:
-  // Called before RenderInternal() if the Information has been changed
-  // since the last time this method was called. We use this to detect
-  // when LUT has changed.
-  virtual void ProcessInformation(vtkInformation* info);
-
-  // Description:
-  // Get the min/max across all ranks. min/max are in/out.
-  // In serial operation this is a no-op, in parallel it
-  // is a global collective reduction.
-  virtual void GetGlobalMinMax(vtkPainterCommunicator*, float&, float&){}
-
-  // Description:
-  // Methods used for parallel benchmarks. Use cmake to define
-  // vtkSurfaceLICMapperTIME to enable benchmarks. During each
-  // update timing information is stored, it can be written to
-  // disk by calling WriteLog.
-  virtual void StartTimerEvent(const char *){}
-  virtual void EndTimerEvent(const char *){}
-
-  // Description:
-  // Creates a new communicator with/without the calling processes
-  // as indicated by the passed in flag, if not 0 the calling process
-  // is included in the new communicator. In parallel this call is mpi
-  // collective on the world communicator. In serial this is a no-op.
-  virtual vtkPainterCommunicator *CreateCommunicator(int);
-
-  // Description:
-  // Creates a new communicator for internal use based on this
-  // rank's visible data.
-  void CreateCommunicator(vtkRenderer *, vtkActor *);
-
-  // Description:
-  // Take part in garbage collection.
-  virtual void ReportReferences(vtkGarbageCollector *collector);
-
-  // Description:
-  // Updates the noise texture, downsampling by the requested sample rate.
-  void UpdateNoiseImage(vtkRenderWindow *renWin);
-
-  // Description:
-  // Look for changes that would trigger stage updates
-  void ValidateContext(vtkRenderer *renderer);
-
-  // Description:
-  // Return false if stage can be skipped
-  bool NeedToUpdateOutputData();
-  virtual bool NeedToUpdateCommunicator();
-  bool NeedToRenderGeometry(vtkRenderer *renderer, vtkActor *actor);
-  bool NeedToGatherVectors();
-  bool NeedToComputeLIC();
-  bool NeedToColorLIC();
-  void SetUpdateAll();
-
-  // Description:
-  // resoucre allocators
-  bool PrepareOutput();
-  void InitializeResources();
-
-  // Description:
-  // set tcoords with vectors
-  bool VectorsToTCoords(vtkDataObject *dataObj);
-  bool VectorsToTCoords(vtkDataSet *dataObj);
-  void ClearTCoords(vtkDataSet *data);
-
-  // Description:
-  // Returns true when rendering LIC is possible.
-  bool CanRenderSurfaceLIC(vtkActor *actor);
-
-protected:
-  // Unit is a pixel length.
-  int     NumberOfSteps;
-  double  StepSize;
-  int     NormalizeVectors;
-
-  int     EnhancedLIC;
-  int     EnhanceContrast;
-  double  LowLICContrastEnhancementFactor;
-  double  HighLICContrastEnhancementFactor;
-  double  LowColorContrastEnhancementFactor;
-  double  HighColorContrastEnhancementFactor;
-  int     AntiAlias;
-
-  int     MaskOnSurface;
-  double  MaskThreshold;
-  double  MaskIntensity;
-  double  MaskColor[3];
-
-  int     ColorMode;
-  double  LICIntensity;
-  double  MapModeBias;
-
-  int     GenerateNoiseTexture;
-  int     NoiseType;
-  int     NoiseTextureSize;
-  int     NoiseGrainSize;
-  double  MinNoiseValue;
-  double  MaxNoiseValue;
-  int     NumberOfNoiseLevels;
-  double  ImpulseNoiseProbability;
-  double  ImpulseNoiseBackgroundValue;
-  int     NoiseGeneratorSeed;
-
-  int     AlwaysUpdate;
-  int     Enable;
-  int     CompositeStrategy;
-
-  vtkDataObject* Output;
-  class vtkInternals;
-  vtkInternals* Internals;
-
-  // Description:
-  // Set the shader parameteres related to the mapper/input data, called by UpdateShader
-  virtual void SetMapperShaderParameters(vtkOpenGLHelper &cellBO, vtkRenderer *ren, vtkActor *act);
-
-  // Description:
-  // Perform string replacments on the shader templates
-  virtual void ReplaceShaderValues(
-    std::map<vtkShader::Type, vtkShader *> shaders,
-    vtkRenderer *ren, vtkActor *act);
-
-private:
-  vtkSurfaceLICMapper(const vtkSurfaceLICMapper&); // Not implemented.
-  void operator=(const vtkSurfaceLICMapper&); // Not implemented.
-};
-
-#endif
diff --git a/Rendering/LICOpenGL2/vtkSurfaceLICMapper_CE.glsl b/Rendering/LICOpenGL2/vtkSurfaceLICMapper_CE.glsl
deleted file mode 100644
index de03807..0000000
--- a/Rendering/LICOpenGL2/vtkSurfaceLICMapper_CE.glsl
+++ /dev/null
@@ -1,112 +0,0 @@
-//=========================================================================
-//
-//  Program:   Visualization Toolkit
-//  Module:    vtkSurfaceLICMapper_CE.glsl
-//
-//  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.
-//
-//=========================================================================
-
-// color contrast enhance stage implemented via histogram stretching
-// on lightness channel. if the min and max are tweaked it can generate
-// out-of-range values these will be clamped in 0 to 1
-
-// The following line handle system declarations such a
-// default precisions, or defining precisions to null
-//VTK::System::Dec
-
-// the output of this shader
-//VTK::Output::Dec
-
-uniform sampler2D texGeomColors; // scalars + lighting
-uniform sampler2D texLIC;        // image lic, mask
-uniform sampler2D texHSLColors;  // hsla colors
-
-uniform float     uLMin;         // min lightness over all fragments
-uniform float     uLMaxMinDiff;  // max - min lightness over all fragments
-
-varying vec2 tcoordVC;
-
-/**
-Helper for HSL to RGB conversion.
-*/
-float Util(float v1, float v2, float vH)
-{
-  if (vH < 0.0)
-    vH += 1.0;
-
-  if (vH > 1.0)
-     vH -= 1.0;
-
-  if ((6.0 * vH) < 1.0)
-    return (v1 + (v2 - v1) * 6.0 * vH);
-
-  if ((2.0 * vH) < 1.0)
-    return (v2);
-
-  if ((3.0 * vH) < 2.0)
-    return (v1 + (v2 - v1) * ((2.0 / 3.0) - vH) * 6.0);
-
-  return v1;
-}
-
-/**
-Convert from HSL space into RGB space.
-*/
-vec3 HSLToRGB(vec3 HSL)
-{
-  vec3 RGB;
-  if (HSL.y == 0.0)
-    {
-    // Gray
-    RGB.r = HSL.z;
-    RGB.g = HSL.z;
-    RGB.b = HSL.z;
-    }
-  else
-    {
-    // Chromatic
-    float v2;
-    if (HSL.z < 0.5)
-      v2 = HSL.z * (1.0 + HSL.y);
-    else
-      v2 = (HSL.z + HSL.y) - (HSL.y * HSL.z);
-
-    float v1 = 2.0 * HSL.z - v2;
-
-    RGB.r = Util(v1, v2, HSL.x + (1.0 / 3.0));
-    RGB.g = Util(v1, v2, HSL.x);
-    RGB.b = Util(v1, v2, HSL.x - (1.0 / 3.0));
-    }
-
-  return RGB.rgb;
-}
-
-void main()
-{
-  // lookup hsl color , mask
-  vec4 fragColor = texture2D(texHSLColors, tcoordVC.st);
-
-  // don't modify masked fragments (masked => lic.g==1)
-  vec4 lic = texture2D(texLIC, tcoordVC.st);
-  if (lic.g==0.0)
-    {
-    // normalize lightness channel
-    fragColor.z = clamp((fragColor.z - uLMin)/uLMaxMinDiff, 0.0, 1.0);
-    }
-
-  // back into rgb space
-  fragColor.rgb = HSLToRGB(fragColor.xyz);
-
-  // add alpha
-  vec4 geomColor = texture2D(texGeomColors, tcoordVC.st);
-  fragColor.a = geomColor.a;
-
-  gl_FragData[0] = fragColor;
-}
diff --git a/Rendering/LICOpenGL2/vtkSurfaceLICMapper_DCpy.glsl b/Rendering/LICOpenGL2/vtkSurfaceLICMapper_DCpy.glsl
deleted file mode 100644
index 428eb02..0000000
--- a/Rendering/LICOpenGL2/vtkSurfaceLICMapper_DCpy.glsl
+++ /dev/null
@@ -1,44 +0,0 @@
-//=========================================================================
-//
-//  Program:   Visualization Toolkit
-//  Module:    vtkSurfaceLICMapper_DCpy.glsl
-//
-//  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.
-//
-//=========================================================================
-
-// This shader copies fragments and depths to the output buffer
-
-// The following line handle system declarations such a
-// default precisions, or defining precisions to null
-//VTK::System::Dec
-
-// the output of this shader
-//VTK::Output::Dec
-
-uniform sampler2D texDepth;     // z values from vertex shader
-uniform sampler2D texRGBColors; // final rgb LIC colors
-
-varying vec2 tcoordVC;
-
-void main()
-{
-  gl_FragDepth = texture2D(texDepth, tcoordVC).x;
-  gl_FragData[0] = texture2D(texRGBColors, tcoordVC);
-
-  // since we render a screen aligned quad
-  // we're going to be writing fragments
-  // not touched by the original geometry
-  // it's critical not to modify those
-  // fragments.
-  if (gl_FragDepth == 1.0)
-    {
-    discard;
-    }
-}
diff --git a/Rendering/LICOpenGL2/vtkSurfaceLICMapper_SC.glsl b/Rendering/LICOpenGL2/vtkSurfaceLICMapper_SC.glsl
deleted file mode 100644
index 1f272ad..0000000
--- a/Rendering/LICOpenGL2/vtkSurfaceLICMapper_SC.glsl
+++ /dev/null
@@ -1,209 +0,0 @@
-//=========================================================================
-//
-//  Program:   Visualization Toolkit
-//  Module:    vtkSurfaceLICMapper_fs2.glsl
-//
-//  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.
-//
-//=========================================================================
-
-// This shader combines surface geometry, LIC, and  scalar colors.
-
-// The following line handle system declarations such a
-// default precisions, or defining precisions to null
-//VTK::System::Dec
-
-// the output of this shader
-//VTK::Output::Dec
-
-uniform sampler2D texVectors;       // vectors, depth
-uniform sampler2D texGeomColors;    // scalar colors + lighting
-uniform sampler2D texLIC;           // image lic
-uniform int       uScalarColorMode; // select between blend, and map shader
-uniform float     uLICIntensity;    // blend shader: blending factor for lic'd colors
-uniform float     uMapBias;         // map shader: adjust the brightness of the result
-uniform float     uMaskIntensity;   // blending factor for mask color
-uniform vec3      uMaskColor;       // color for the masked out fragments
-
-varying vec2 tcoordVC;
-
-/**
-Convert from RGB color space into HSL colorspace.
-*/
-vec3 RGBToHSL(vec3 RGB)
-{
-  vec3 HSL = vec3(0.0, 0.0, 0.0);
-
-  float RGBMin = min(min(RGB.r, RGB.g), RGB.b);
-  float RGBMax = max(max(RGB.r, RGB.g), RGB.b);
-  float RGBMaxMinDiff = RGBMax - RGBMin;
-
-  HSL.z = (RGBMax + RGBMin) / 2.0;
-
-  if (RGBMaxMinDiff == 0.0)
-    {
-    // Gray scale
-    HSL.x = 0.0;
-    HSL.y = 0.0;
-    }
-  else
-    {
-    // Color
-    if (HSL.z < 0.5)
-      HSL.y = RGBMaxMinDiff / (RGBMax + RGBMin);
-    else
-      HSL.y = RGBMaxMinDiff / (2.0 - RGBMax - RGBMin);
-
-    float dR
-      = (((RGBMax - RGB.r) / 6.0) + (RGBMaxMinDiff / 2.0)) / RGBMaxMinDiff;
-    float dG
-      = (((RGBMax - RGB.g) / 6.0) + (RGBMaxMinDiff / 2.0)) / RGBMaxMinDiff;
-    float dB
-      = (((RGBMax - RGB.b) / 6.0) + (RGBMaxMinDiff / 2.0)) / RGBMaxMinDiff;
-
-    if (RGB.r == RGBMax)
-      HSL.x = dB - dG;
-    else
-    if (RGB.g == RGBMax)
-      HSL.x = (1.0 / 3.0) + dR - dB;
-    else
-    if (RGB.b == RGBMax)
-      HSL.x = (2.0 / 3.0) + dG - dR;
-
-    if (HSL.x < 0.0)
-      HSL.x += 1.0;
-
-    if (HSL.x > 1.0)
-      HSL.x -= 1.0;
-    }
-
-  return HSL;
-}
-
-/**
-Helper for HSL to RGB conversion.
-*/
-float Util(float v1, float v2, float vH)
-{
-  if (vH < 0.0)
-    vH += 1.0;
-
-  if (vH > 1.0)
-     vH -= 1.0;
-
-  if ((6.0 * vH) < 1.0)
-    return (v1 + (v2 - v1) * 6.0 * vH);
-
-  if ((2.0 * vH) < 1.0)
-    return (v2);
-
-  if ((3.0 * vH) < 2.0)
-    return (v1 + (v2 - v1) * ((2.0 / 3.0) - vH) * 6.0);
-
-  return v1;
-}
-
-/**
-Convert from HSL space into RGB space.
-*/
-vec3 HSLToRGB(vec3 HSL)
-{
-  vec3 RGB;
-  if (HSL.y == 0.0)
-    {
-    // Gray
-    RGB.r = HSL.z;
-    RGB.g = HSL.z;
-    RGB.b = HSL.z;
-    }
-  else
-    {
-    // Chromatic
-    float v2;
-    if (HSL.z < 0.5)
-      v2 = HSL.z * (1.0 + HSL.y);
-    else
-      v2 = (HSL.z + HSL.y) - (HSL.y * HSL.z);
-
-    float v1 = 2.0 * HSL.z - v2;
-
-    RGB.r = Util(v1, v2, HSL.x + (1.0 / 3.0));
-    RGB.g = Util(v1, v2, HSL.x);
-    RGB.b = Util(v1, v2, HSL.x - (1.0 / 3.0));
-    }
-
-  return RGB.rgb;
-}
-
-void main()
-{
-  vec4 lic = texture2D(texLIC, tcoordVC.st);
-  vec4 geomColor = texture2D(texGeomColors, tcoordVC.st);
-
-  // depth is used to determine which fragment belong to us
-  // and we can change
-  float depth = texture2D(texVectors, tcoordVC.st).a;
-
-  vec3 fragColorRGB;
-  float valid;
-  if (depth > 1.0e-3)
-    {
-    // we own it
-    // shade LIC'ed geometry, or apply mask
-    if (lic.g!=0.0)
-      {
-      // it's masked
-      // apply fragment mask
-      fragColorRGB = uMaskIntensity * uMaskColor + (1.0 - uMaskIntensity) * geomColor.rgb;
-      valid = 0.0;
-      }
-    else
-      {
-      if (uScalarColorMode==0)
-        {
-        // blend with scalars
-        fragColorRGB = lic.rrr * uLICIntensity + geomColor.rgb * (1.0 - uLICIntensity);
-        }
-      else
-        {
-        // multiply with scalars
-        fragColorRGB = geomColor.rgb * clamp((uMapBias + lic.r), 0.0, 1.0);
-        }
-      if (lic.b != 0.0)
-        {
-        // didn't have the required guard pixels
-        // don't consider it in min max estimation
-        // for histpgram stretching
-        valid = 0.0;
-        }
-      else
-        {
-        // ok to use in min/max estimates for histogram
-        // stretching
-        valid = 1.0;
-        }
-      }
-    }
-  else
-    {
-    // we don't own it
-    // pass through scalars
-    fragColorRGB = geomColor.rgb;
-    valid = 0.0;
-    }
-
-  // if no further stages this texture is
-  // copied to the screen
-  gl_FragData[0] = vec4(fragColorRGB, geomColor.a);
-
-  // if further stages, move to hsl space for contrast
-  // enhancement. encoding valididty saves moving a texture to the cpu
-  vec3 fragColorHSL = RGBToHSL(fragColorRGB);
-  gl_FragData[1] = vec4(fragColorHSL, valid);
-}
diff --git a/Rendering/LICOpenGL2/vtkTextureIO.cxx b/Rendering/LICOpenGL2/vtkTextureIO.cxx
deleted file mode 100644
index 393f8d6..0000000
--- a/Rendering/LICOpenGL2/vtkTextureIO.cxx
+++ /dev/null
@@ -1,174 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkTextureIO.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 "vtkTextureIO.h"
-
-#include "vtkTextureObject.h"
-#include "vtkPixelBufferObject.h"
-#include "vtkMultiBlockDataSet.h"
-#include "vtkImageData.h"
-#include "vtkPointData.h"
-#include "vtkCellData.h"
-#include "vtkFloatArray.h"
-#include "vtkDataSetWriter.h"
-#include "vtkXMLMultiBlockDataWriter.h"
-#include "vtkPixelExtent.h"
-#include "vtkPixelTransfer.h"
-#include <cstddef>
-#include <deque>
-#include <sstream>
-
-using std::string;
-using std::deque;
-using std::ostringstream;
-
-//----------------------------------------------------------------------------
-static
-vtkFloatArray *DownloadTexture(
-        vtkTextureObject *texture,
-        const unsigned int *sub)
-{
-  int tt = texture->GetVTKDataType();
-  unsigned int tw = texture->GetWidth();
-  unsigned int th = texture->GetHeight();
-  unsigned int tnc = texture->GetComponents();
-
-  vtkPixelExtent texExt(0U, tw-1U, 0U, th-1U);
-  vtkPixelExtent subExt(texExt);
-  if (sub)
-    {
-    subExt.SetData(sub);
-    }
-
-  vtkFloatArray *ta = vtkFloatArray::New();
-  ta->SetNumberOfComponents(tnc);
-  ta->SetNumberOfTuples(subExt.Size());
-  ta->SetName("tex");
-  float *pTa = ta->GetPointer(0);
-
-  vtkPixelBufferObject *pbo = texture->Download();
-
-  vtkPixelTransfer::Blit(
-        texExt,
-        subExt,
-        subExt,
-        subExt,
-        tnc,
-        tt,
-        pbo->MapPackedBuffer(),
-        tnc,
-        VTK_FLOAT,
-        pTa);
-
-  pbo->UnmapPackedBuffer();
-  pbo->Delete();
-
-  return ta;
-}
-
-//----------------------------------------------------------------------------
-void vtkTextureIO::Write(
-        const char *filename,
-        vtkTextureObject *texture,
-        const unsigned int *subset,
-        const double *origin)
-{
-  unsigned int tw = texture->GetWidth();
-  unsigned int th = texture->GetHeight();
-
-  vtkPixelExtent subExt(0U, tw-1U, 0U, th-1U);
-  if (subset)
-    {
-    subExt.SetData(subset);
-    }
-
-  int dataExt[6]={0,0, 0,0, 0,0};
-  subExt.CellToNode();
-  subExt.GetData(dataExt);
-
-  double dataOrigin[6]={0,0, 0,0, 0,0};
-  if (origin)
-    {
-    dataOrigin[0] = origin[0];
-    dataOrigin[1] = origin[1];
-    }
-
-  vtkFloatArray *ta = DownloadTexture(texture, subset);
-
-  vtkImageData *id = vtkImageData::New();
-  id->SetExtent(dataExt);
-  id->SetOrigin(dataOrigin);
-  id->GetCellData()->AddArray(ta);
-  ta->Delete();
-
-  vtkDataSetWriter *w = vtkDataSetWriter::New();
-  cerr << "writing to: " << filename << endl;
-  w->SetFileName(filename);
-  w->SetInputData(id);
-  w->Write();
-
-  id->Delete();
-  w->Delete();
-}
-
-//----------------------------------------------------------------------------
-void vtkTextureIO::Write(
-        const char *filename,
-        vtkTextureObject *texture,
-        const deque<vtkPixelExtent> &exts,
-        const double *origin)
-{
-  int n = static_cast<int>(exts.size());
-  if (n == 0)
-    {
-    //vtkGenericWarningMacro("Empty extents nothing will be written");
-    return;
-    }
-  vtkMultiBlockDataSet *mb = vtkMultiBlockDataSet::New();
-  for (int i=0; i<n; ++i)
-    {
-    vtkPixelExtent ext = exts[i];
-    if (ext.Empty()) continue;
-
-    vtkFloatArray *ta = DownloadTexture(texture, ext.GetDataU());
-
-    int dataExt[6]={0,0,0,0,0,0};
-    ext.CellToNode();
-    ext.GetData(dataExt);
-
-    double dataOrigin[6]={0,0,0,0,0,0};
-    if (origin)
-      {
-      dataOrigin[0] = origin[0];
-      dataOrigin[1] = origin[1];
-      }
-
-    vtkImageData *id = vtkImageData::New();
-    id->SetExtent(dataExt);
-    id->SetOrigin(dataOrigin);
-    id->GetCellData()->AddArray(ta);
-    ta->Delete();
-
-    mb->SetBlock(i, id);
-    id->Delete();
-    }
-
-  vtkXMLMultiBlockDataWriter *w = vtkXMLMultiBlockDataWriter::New();
-  cerr << "writing to: " << filename << endl;
-  w->SetFileName(filename);
-  w->SetInputData(mb);
-  w->Write();
-  w->Delete();
-  mb->Delete();
-}
diff --git a/Rendering/LICOpenGL2/vtkTextureIO.h b/Rendering/LICOpenGL2/vtkTextureIO.h
deleted file mode 100644
index 2fc8653..0000000
--- a/Rendering/LICOpenGL2/vtkTextureIO.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkTextureIO.h
-
-  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.
-
-=========================================================================*/
-// .NAME vtkTextureIO -- I/O routines for vtkTextureObject
-// .SECTION Description
-// A small collection of I/O routines that write vtkTextureObject
-// to disk for debugging.
-#ifndef vtkTextureIO_h
-#define vtkTextureIO_h
-
-#include "vtkRenderingLICOpenGL2Module.h" // for export
-#include "vtkPixelExtent.h" // for pixel extent
-
-// included vtkSystemIncludes in vtkPixelExtent
-#include <cstddef> // for NULL
-#include <string> // for string
-#include <deque> // for deque
-
-class vtkTextureObject;
-
-class VTKRENDERINGLICOPENGL2_EXPORT vtkTextureIO
-{
-public:
-  // Description:
-  // Write to disk as image data with subset(optional) at dataset origin(optional)
-  static void Write(
-          const char *filename,
-          vtkTextureObject *texture,
-          const unsigned int *subset=NULL,
-          const double *origin=NULL);
-
-  // Description:
-  // Write to disk as image data with subset(optional) at dataset origin(optional)
-  static void Write(
-          std::string filename,
-          vtkTextureObject *texture,
-          const unsigned int *subset=NULL,
-          const double *origin=NULL)
-      {
-      Write(filename.c_str(), texture, subset, origin);
-      }
-
-  // Description:
-  // Write to disk as image data with subset(optional) at dataset origin(optional)
-  static void Write(
-          std::string filename,
-          vtkTextureObject *texture,
-          const vtkPixelExtent &subset,
-          const double *origin=NULL)
-      {
-      Write(filename.c_str(), texture, subset.GetDataU(), origin);
-      }
-
-  // Description:
-  // Write list of subsets to disk as multiblock image data at dataset origin(optional).
-  static void Write(
-          const char *filename,
-          vtkTextureObject *texture,
-          const std::deque<vtkPixelExtent> &exts,
-          const double *origin=NULL);
-
-  // Description:
-  // Write list of subsets to disk as multiblock image data at dataset origin(optional).
-  static void Write(
-          std::string filename,
-          vtkTextureObject *texture,
-          const std::deque<vtkPixelExtent> &exts,
-          const double *origin=NULL)
-      {
-      Write(filename.c_str(),texture,exts,origin);
-      }
-};
-
-#endif
-// VTK-HeaderTest-Exclude: vtkTextureIO.h
diff --git a/Rendering/Label/Testing/Data/Baseline/TestDynamic2DLabelMapper.png.md5 b/Rendering/Label/Testing/Data/Baseline/TestDynamic2DLabelMapper.png.md5
index 03852bf..b21242b 100644
--- a/Rendering/Label/Testing/Data/Baseline/TestDynamic2DLabelMapper.png.md5
+++ b/Rendering/Label/Testing/Data/Baseline/TestDynamic2DLabelMapper.png.md5
@@ -1 +1 @@
-55a100e2f8d461ef6a4411a03de5628e
+a70002d1dcab9f5203d8bb70b53d74dc
diff --git a/Rendering/Label/Testing/Data/Baseline/TestLabelPlacementMapper.png.md5 b/Rendering/Label/Testing/Data/Baseline/TestLabelPlacementMapper.png.md5
index 76898f8..c731055 100644
--- a/Rendering/Label/Testing/Data/Baseline/TestLabelPlacementMapper.png.md5
+++ b/Rendering/Label/Testing/Data/Baseline/TestLabelPlacementMapper.png.md5
@@ -1 +1 @@
-584b25e13933349af2c55c941e1e5ed0
+b15bd511937c9883c40cd294d562f711
diff --git a/Rendering/Label/Testing/Data/Baseline/TestLabelPlacementMapper2D.png.md5 b/Rendering/Label/Testing/Data/Baseline/TestLabelPlacementMapper2D.png.md5
index e2d8d7f..52a384b 100644
--- a/Rendering/Label/Testing/Data/Baseline/TestLabelPlacementMapper2D.png.md5
+++ b/Rendering/Label/Testing/Data/Baseline/TestLabelPlacementMapper2D.png.md5
@@ -1 +1 @@
-13ade8bb0f7cb7b0476f9612d82e848c
+66bfd9aad028454673fed6cecc8b60d9
diff --git a/Rendering/Label/Testing/Data/Baseline/TestLabelPlacementMapper2D_1.png.md5 b/Rendering/Label/Testing/Data/Baseline/TestLabelPlacementMapper2D_1.png.md5
index 040eaa5..5a310c6 100644
--- a/Rendering/Label/Testing/Data/Baseline/TestLabelPlacementMapper2D_1.png.md5
+++ b/Rendering/Label/Testing/Data/Baseline/TestLabelPlacementMapper2D_1.png.md5
@@ -1 +1 @@
-6d928f9ba3f409d39b417207b2e8aa4a
+2dbb2230b3e4bf4ba0f287353385aef4
diff --git a/Rendering/Label/Testing/Data/Baseline/TestLabelPlacementMapper2D_2.png.md5 b/Rendering/Label/Testing/Data/Baseline/TestLabelPlacementMapper2D_2.png.md5
new file mode 100644
index 0000000..7dde8b3
--- /dev/null
+++ b/Rendering/Label/Testing/Data/Baseline/TestLabelPlacementMapper2D_2.png.md5
@@ -0,0 +1 @@
+b696541bf7ca5d3dfe59925ed5b7c5dd
diff --git a/Rendering/Label/Testing/Data/Baseline/TestLabelPlacementMapperCoincidentPoints.png.md5 b/Rendering/Label/Testing/Data/Baseline/TestLabelPlacementMapperCoincidentPoints.png.md5
index 94cde45..1bc2157 100644
--- a/Rendering/Label/Testing/Data/Baseline/TestLabelPlacementMapperCoincidentPoints.png.md5
+++ b/Rendering/Label/Testing/Data/Baseline/TestLabelPlacementMapperCoincidentPoints.png.md5
@@ -1 +1 @@
-dfc823bf18d41d3185b19c7543b08d24
+c86e972d3a446440bc18ec40ccd8d90d
diff --git a/Rendering/Label/Testing/Data/Baseline/TestLabelPlacer.png.md5 b/Rendering/Label/Testing/Data/Baseline/TestLabelPlacer.png.md5
index a550f2b..c731055 100644
--- a/Rendering/Label/Testing/Data/Baseline/TestLabelPlacer.png.md5
+++ b/Rendering/Label/Testing/Data/Baseline/TestLabelPlacer.png.md5
@@ -1 +1 @@
-6ffe5ff5814929cec5ac89bccce67352
+b15bd511937c9883c40cd294d562f711
diff --git a/Rendering/Label/Testing/Data/Baseline/TestLabelPlacer2D.png.md5 b/Rendering/Label/Testing/Data/Baseline/TestLabelPlacer2D.png.md5
index adfffa4..0201db9 100644
--- a/Rendering/Label/Testing/Data/Baseline/TestLabelPlacer2D.png.md5
+++ b/Rendering/Label/Testing/Data/Baseline/TestLabelPlacer2D.png.md5
@@ -1 +1 @@
-95bc74d792d762d3fa4ba49b5fd89fe2
+621078c459e6e868e0fa9eb2a4d14e33
diff --git a/Rendering/Label/Testing/Data/Baseline/TestLabelPlacer2D_1.png.md5 b/Rendering/Label/Testing/Data/Baseline/TestLabelPlacer2D_1.png.md5
new file mode 100644
index 0000000..8c7292c
--- /dev/null
+++ b/Rendering/Label/Testing/Data/Baseline/TestLabelPlacer2D_1.png.md5
@@ -0,0 +1 @@
+e939fcca815a468e7de6fae39b7deae0
diff --git a/Rendering/Label/Testing/Data/Baseline/TestLabelPlacer2D_2.png.md5 b/Rendering/Label/Testing/Data/Baseline/TestLabelPlacer2D_2.png.md5
new file mode 100644
index 0000000..a127b34
--- /dev/null
+++ b/Rendering/Label/Testing/Data/Baseline/TestLabelPlacer2D_2.png.md5
@@ -0,0 +1 @@
+5420097ab3f139bc99ba5d018c4d1ac1
diff --git a/Rendering/Label/Testing/Data/Baseline/TestLabelPlacer2D_3.png.md5 b/Rendering/Label/Testing/Data/Baseline/TestLabelPlacer2D_3.png.md5
new file mode 100644
index 0000000..6254d54
--- /dev/null
+++ b/Rendering/Label/Testing/Data/Baseline/TestLabelPlacer2D_3.png.md5
@@ -0,0 +1 @@
+adf5268606c22f8664e9bcbfdb267eca
diff --git a/Rendering/Label/Testing/Data/Baseline/TestLabelPlacerCoincidentPoints.png.md5 b/Rendering/Label/Testing/Data/Baseline/TestLabelPlacerCoincidentPoints.png.md5
index 056d29e..1bc2157 100644
--- a/Rendering/Label/Testing/Data/Baseline/TestLabelPlacerCoincidentPoints.png.md5
+++ b/Rendering/Label/Testing/Data/Baseline/TestLabelPlacerCoincidentPoints.png.md5
@@ -1 +1 @@
-e80a35c9b63b52ce7ce7fde5313bccbb
+c86e972d3a446440bc18ec40ccd8d90d
diff --git a/Rendering/Label/Testing/Data/Baseline/labeledContours.png.md5 b/Rendering/Label/Testing/Data/Baseline/labeledContours.png.md5
index e845b57..de32b25 100644
--- a/Rendering/Label/Testing/Data/Baseline/labeledContours.png.md5
+++ b/Rendering/Label/Testing/Data/Baseline/labeledContours.png.md5
@@ -1 +1 @@
-5010d48b90ce8e879969b0a06336bf40
+8ff6bc1479ad9c62fcab0e7b2e419700
diff --git a/Rendering/Label/Testing/Data/Baseline/labeledContours_1.png.md5 b/Rendering/Label/Testing/Data/Baseline/labeledContours_1.png.md5
new file mode 100644
index 0000000..fbe8b0b
--- /dev/null
+++ b/Rendering/Label/Testing/Data/Baseline/labeledContours_1.png.md5
@@ -0,0 +1 @@
+29e09c177d842057b9c97b27d1831c84
diff --git a/Rendering/Label/Testing/Data/Baseline/labeledContours_2.png.md5 b/Rendering/Label/Testing/Data/Baseline/labeledContours_2.png.md5
new file mode 100644
index 0000000..5c842cd
--- /dev/null
+++ b/Rendering/Label/Testing/Data/Baseline/labeledContours_2.png.md5
@@ -0,0 +1 @@
+76299d6924fee495ec32ced46967addf
diff --git a/Rendering/Label/Testing/Data/Baseline/labeledContours_3.png.md5 b/Rendering/Label/Testing/Data/Baseline/labeledContours_3.png.md5
new file mode 100644
index 0000000..7d002bb
--- /dev/null
+++ b/Rendering/Label/Testing/Data/Baseline/labeledContours_3.png.md5
@@ -0,0 +1 @@
+14c5dee3dc8f2b9eac89f5d8e273d128
diff --git a/Rendering/Label/Testing/Data/Baseline/labeledMesh.png.md5 b/Rendering/Label/Testing/Data/Baseline/labeledMesh.png.md5
index 1a9cb24..927afdb 100644
--- a/Rendering/Label/Testing/Data/Baseline/labeledMesh.png.md5
+++ b/Rendering/Label/Testing/Data/Baseline/labeledMesh.png.md5
@@ -1 +1 @@
-48cec9399e765bb3973412cac3d71fad
+7341fffbf881c8d65d48f925106d6d59
diff --git a/Rendering/Label/Testing/Data/Baseline/labeledMesh_1.png.md5 b/Rendering/Label/Testing/Data/Baseline/labeledMesh_1.png.md5
new file mode 100644
index 0000000..b3c0593
--- /dev/null
+++ b/Rendering/Label/Testing/Data/Baseline/labeledMesh_1.png.md5
@@ -0,0 +1 @@
+0fe4cb4a42ccc7e6818914441ef722f4
diff --git a/Rendering/Label/module.cmake b/Rendering/Label/module.cmake
index 441e3d9..d4550a6 100644
--- a/Rendering/Label/module.cmake
+++ b/Rendering/Label/module.cmake
@@ -9,6 +9,7 @@ vtk_module(vtkRenderingLabel
     vtkIOXML
     vtkTestingCore
     vtkTestingRendering
+    vtkRenderingFreeType${VTK_RENDERING_BACKEND}
     vtkRendering${VTK_RENDERING_BACKEND}
     vtkInteractionStyle
   KIT
diff --git a/Rendering/Label/vtkDynamic2DLabelMapper.cxx b/Rendering/Label/vtkDynamic2DLabelMapper.cxx
index 0f2a302..a0b8236 100644
--- a/Rendering/Label/vtkDynamic2DLabelMapper.cxx
+++ b/Rendering/Label/vtkDynamic2DLabelMapper.cxx
@@ -89,9 +89,21 @@ vtkDynamic2DLabelMapper::vtkDynamic2DLabelMapper()
 //----------------------------------------------------------------------------
 vtkDynamic2DLabelMapper::~vtkDynamic2DLabelMapper()
 {
-  delete[] this->LabelWidth;
-  delete[] this->LabelHeight;
-  delete[] this->Cutoff;
+  if (this->LabelWidth)
+    {
+    delete[] this->LabelWidth;
+    this->LabelWidth = NULL;
+    }
+  if (this->LabelHeight)
+    {
+    delete[] this->LabelHeight;
+    this->LabelHeight = NULL;
+    }
+  if (this->Cutoff)
+    {
+    delete[] this->Cutoff;
+    this->Cutoff = NULL;
+    }
 }
 
 //----------------------------------------------------------------------------
@@ -477,7 +489,10 @@ void vtkDynamic2DLabelMapper::RenderOpaqueGeometry(vtkViewport *viewport,
       }
 
     // Calculate label widths / heights
-    delete[] this->LabelWidth;
+    if (this->LabelWidth != NULL)
+      {
+      delete[] this->LabelWidth;
+      }
     this->LabelWidth = new float[this->NumberOfLabels];
     for (i = 0; i < this->NumberOfLabels; i++)
       {
@@ -485,7 +500,10 @@ void vtkDynamic2DLabelMapper::RenderOpaqueGeometry(vtkViewport *viewport,
                             widthPadding;
       }
 
-    delete[] this->LabelHeight;
+    if (this->LabelHeight != NULL)
+      {
+      delete[] this->LabelHeight;
+      }
     this->LabelHeight = new float[this->NumberOfLabels];
     for (i = 0; i < this->NumberOfLabels; i++)
       {
@@ -494,7 +512,10 @@ void vtkDynamic2DLabelMapper::RenderOpaqueGeometry(vtkViewport *viewport,
       }
 
     // Determine cutoff scales of each point
-    delete[] this->Cutoff;
+    if (this->Cutoff != NULL)
+      {
+      delete[] this->Cutoff;
+      }
     this->Cutoff = new float[this->NumberOfLabels];
 
     vtkTimerLog* timer = vtkTimerLog::New();
diff --git a/Rendering/Label/vtkFreeTypeLabelRenderStrategy.cxx b/Rendering/Label/vtkFreeTypeLabelRenderStrategy.cxx
index 31e8ee4..49496dc 100644
--- a/Rendering/Label/vtkFreeTypeLabelRenderStrategy.cxx
+++ b/Rendering/Label/vtkFreeTypeLabelRenderStrategy.cxx
@@ -15,21 +15,20 @@
 #include "vtkFreeTypeLabelRenderStrategy.h"
 
 #include "vtkActor2D.h"
+#include "vtkFreeTypeUtilities.h"
 #include "vtkObjectFactory.h"
 #include "vtkRenderer.h"
 #include "vtkSmartPointer.h"
 #include "vtkTextMapper.h"
 #include "vtkTextProperty.h"
-#include "vtkTextRenderer.h"
 #include "vtkTimerLog.h"
-#include "vtkWindow.h"
 
 vtkStandardNewMacro(vtkFreeTypeLabelRenderStrategy);
 
 //----------------------------------------------------------------------------
 vtkFreeTypeLabelRenderStrategy::vtkFreeTypeLabelRenderStrategy()
 {
-  this->TextRenderer = vtkTextRenderer::GetInstance();
+  this->FreeTypeUtilities = vtkFreeTypeUtilities::New();
   this->Mapper = vtkTextMapper::New();
   this->Actor = vtkActor2D::New();
   this->Actor->SetMapper(this->Mapper);
@@ -38,6 +37,7 @@ vtkFreeTypeLabelRenderStrategy::vtkFreeTypeLabelRenderStrategy()
 //----------------------------------------------------------------------------
 vtkFreeTypeLabelRenderStrategy::~vtkFreeTypeLabelRenderStrategy()
 {
+  this->FreeTypeUtilities->Delete();
   this->Mapper->Delete();
   this->Actor->Delete();
 }
@@ -79,19 +79,8 @@ void vtkFreeTypeLabelRenderStrategy::ComputeLabelBounds(
     copy->ShallowCopy(tprop);
     copy->SetOrientation(0.0);
     }
-
-  int dpi = 72;
-  if (this->Renderer && this->Renderer->GetVTKWindow())
-    {
-    dpi = this->Renderer->GetVTKWindow()->GetDPI();
-    }
-  else
-    {
-    vtkWarningMacro(<<"No Renderer set. Assuming DPI of " << dpi << ".");
-    }
-
   int bbox[4];
-  this->TextRenderer->GetBoundingBox(copy, label.utf8_str(), bbox, dpi);
+  this->FreeTypeUtilities->GetBoundingBox(copy, label.utf8_str(), bbox);
 
   // Take line offset into account
   bds[0] = bbox[0];
diff --git a/Rendering/Label/vtkFreeTypeLabelRenderStrategy.h b/Rendering/Label/vtkFreeTypeLabelRenderStrategy.h
index 91364da..da02e27 100644
--- a/Rendering/Label/vtkFreeTypeLabelRenderStrategy.h
+++ b/Rendering/Label/vtkFreeTypeLabelRenderStrategy.h
@@ -25,7 +25,7 @@
 #include "vtkLabelRenderStrategy.h"
 
 class vtkActor2D;
-class vtkTextRenderer;
+class vtkFreeTypeUtilities;
 class vtkTextMapper;
 
 class VTKRENDERINGLABEL_EXPORT vtkFreeTypeLabelRenderStrategy : public vtkLabelRenderStrategy
@@ -72,7 +72,7 @@ protected:
   vtkFreeTypeLabelRenderStrategy();
   ~vtkFreeTypeLabelRenderStrategy();
 
-  vtkTextRenderer *TextRenderer;
+  vtkFreeTypeUtilities* FreeTypeUtilities;
   vtkTextMapper* Mapper;
   vtkActor2D* Actor;
 
diff --git a/Rendering/Label/vtkLabelHierarchy.cxx b/Rendering/Label/vtkLabelHierarchy.cxx
index 23033d2..fa19019 100644
--- a/Rendering/Label/vtkLabelHierarchy.cxx
+++ b/Rendering/Label/vtkLabelHierarchy.cxx
@@ -854,7 +854,6 @@ void vtkLabelHierarchyQuadtreeIterator::Prepare(
     this->BucketSize[i] = bucketSize[i];
     }
   this->SetRenderer( ren );
-#if 0
   if ( cam->GetParallelProjection() )
     { // Compute threshold for quadtree nodes too small to visit using parallel projection
     //cout << "SizeLimit ParallelProj ps: " << cam->GetParallelScale() << "\n";
@@ -875,11 +874,11 @@ void vtkLabelHierarchyQuadtreeIterator::Prepare(
       double vs = ren->GetSize()[1];
       vsr = this->BucketSize[1] ? ( vs / this->BucketSize[1] ) : VTK_DOUBLE_MAX;
       }
+    static_cast<void>(vsr); // fix for 'set but not used' warning for vsr
     //double fac = vsr ? ( 0.1 * tva / vsr ) : 0.;
     //cout << "SizeLimit  va: " << va << " tva: " << tva << " vsr: " << vsr << " fac: " << fac << " slim: " << fac * fac << "\n";
     //this->SizeLimit = fac * fac;
     }
-#endif
 }
 
 void vtkLabelHierarchyQuadtreeIterator::Begin( vtkIdTypeArray* vtkNotUsed(lastPlaced) )
@@ -1181,7 +1180,6 @@ void vtkLabelHierarchyOctreeQueueIterator::Prepare(
     this->BucketSize[i] = bucketSize[i];
     }
   this->SetRenderer( ren );
-#if 0
   if ( cam->GetParallelProjection() )
     { // Compute threshold for quadtree nodes too small to visit using parallel projection
     //cout << "SizeLimit ParallelProj ps: " << cam->GetParallelScale() << "\n";
@@ -1202,11 +1200,11 @@ void vtkLabelHierarchyOctreeQueueIterator::Prepare(
       double vs = ren->GetSize()[1];
       vsr = this->BucketSize[1] ? ( vs / this->BucketSize[1] ) : VTK_DOUBLE_MAX;
       }
+    static_cast<void>(vsr); // fix for 'set but not used' warning for vsr
     //double fac = vsr ? ( 0.1 * tva / vsr ) : 0.;
     //cout << "SizeLimit  va: " << va << " tva: " << tva << " vsr: " << vsr << " fac: " << fac << " slim: " << fac * fac << "\n";
     //this->SizeLimit = fac * fac;
     }
-#endif
 }
 
 void vtkLabelHierarchyOctreeQueueIterator::Begin( vtkIdTypeArray* lastPlaced )
@@ -1555,7 +1553,6 @@ void vtkLabelHierarchy3DepthFirstIterator::Prepare(
     this->BucketSize[i] = bucketSize[i];
     }
   this->SetRenderer( ren );
-#if 0
   if ( cam->GetParallelProjection() )
     { // Compute threshold for quadtree nodes too small to visit using parallel projection
     //cout << "SizeLimit ParallelProj ps: " << cam->GetParallelScale() << "\n";
@@ -1576,11 +1573,11 @@ void vtkLabelHierarchy3DepthFirstIterator::Prepare(
       double vs = ren->GetSize()[1];
       vsr = vs / this->BucketSize[1];
       }
+    static_cast<void>(vsr); // fix for 'set but not used' warning for vsr
     //double fac = 0.1 * tva / vsr;
     //cout << "SizeLimit  va: " << va << " tva: " << tva << " vsr: " << vsr << " fac: " << fac << " slim: " << fac * fac << "\n";
     //this->SizeLimit = fac * fac;
     }
-#endif
 }
 
 void vtkLabelHierarchy3DepthFirstIterator::Begin( vtkIdTypeArray* vtkNotUsed(lastPlaced) )
@@ -1961,8 +1958,14 @@ void vtkLabelHierarchyBuildCoincidenceMap(
 // in the highest possible level of octree which is not already full.
 void vtkLabelHierarchy::ComputeHierarchy()
 {
-  delete this->Impl->Hierarchy3;
-  delete this->Impl->Hierarchy2;
+  if ( this->Impl->Hierarchy3 )
+    {
+    delete this->Impl->Hierarchy3;
+    }
+  if ( this->Impl->Hierarchy2 )
+    {
+    delete this->Impl->Hierarchy2;
+    }
   this->Impl->ActualDepth = 0;
 
   double bounds[6];
diff --git a/Rendering/Label/vtkLabelHierarchyPrivate.h b/Rendering/Label/vtkLabelHierarchyPrivate.h
index 2ebc4f7..787194b 100644
--- a/Rendering/Label/vtkLabelHierarchyPrivate.h
+++ b/Rendering/Label/vtkLabelHierarchyPrivate.h
@@ -22,8 +22,15 @@ public:
 
   ~Implementation()
     {
-    delete this->Hierarchy2;
-    delete this->Hierarchy3;
+    if ( this->Hierarchy2 )
+      {
+      delete this->Hierarchy2;
+      }
+    if ( this->Hierarchy3 )
+      {
+      delete this->Hierarchy3;
+      }
+
     }
 
   bool ComparePriorities( vtkIdType a, vtkIdType b )
diff --git a/Rendering/Label/vtkLabelPlacementMapper.cxx b/Rendering/Label/vtkLabelPlacementMapper.cxx
index 33215e7..5fb4c44 100644
--- a/Rendering/Label/vtkLabelPlacementMapper.cxx
+++ b/Rendering/Label/vtkLabelPlacementMapper.cxx
@@ -493,7 +493,10 @@ vtkLabelPlacementMapper::vtkLabelPlacementMapper()
 vtkLabelPlacementMapper::~vtkLabelPlacementMapper()
 {
   this->AnchorTransform->Delete();
-  delete this->Buckets;
+  if ( this->Buckets )
+    {
+    delete this->Buckets;
+    }
   this->VisiblePoints->Delete();
   if ( this->RenderStrategy )
     {
@@ -882,7 +885,10 @@ void vtkLabelPlacementMapper::RenderOverlay(vtkViewport *viewport,
   vtkDebugMacro("Placed: " << placed);
   vtkDebugMacro("Labels Occluded: " << occluded);
 
-  delete [] zPtr;
+  if (zPtr)
+    {
+    delete [] zPtr;
+    }
 
   timer->StopTimer();
   vtkDebugMacro("Iteration time: " << timer->GetElapsedTime());
@@ -891,12 +897,6 @@ void vtkLabelPlacementMapper::RenderOverlay(vtkViewport *viewport,
 }
 
 //----------------------------------------------------------------------------
-void vtkLabelPlacementMapper::ReleaseGraphicsResources(vtkWindow *win)
-{
-  this->RenderStrategy->ReleaseGraphicsResources(win);
-}
-
-//----------------------------------------------------------------------------
 void vtkLabelPlacementMapper::PrintSelf( ostream& os, vtkIndent indent )
 {
   this->Superclass::PrintSelf( os, indent );
diff --git a/Rendering/Label/vtkLabelPlacementMapper.h b/Rendering/Label/vtkLabelPlacementMapper.h
index 973bd0b..5d18f49 100644
--- a/Rendering/Label/vtkLabelPlacementMapper.h
+++ b/Rendering/Label/vtkLabelPlacementMapper.h
@@ -167,12 +167,6 @@ public:
   // Get the transform for the anchor points.
   vtkGetObjectMacro(AnchorTransform,vtkCoordinate);
 
-  // Description:
-  // Release any graphics resources that are being consumed by this mapper.
-  // The parameter window could be used to determine which graphic
-  // resources to release.
-  virtual void ReleaseGraphicsResources(vtkWindow *);
-
 protected:
   vtkLabelPlacementMapper();
   ~vtkLabelPlacementMapper();
diff --git a/Rendering/Label/vtkLabelPlacer.cxx b/Rendering/Label/vtkLabelPlacer.cxx
index 249d142..41c2c95 100644
--- a/Rendering/Label/vtkLabelPlacer.cxx
+++ b/Rendering/Label/vtkLabelPlacer.cxx
@@ -234,7 +234,10 @@ vtkLabelPlacer::vtkLabelPlacer()
 vtkLabelPlacer::~vtkLabelPlacer()
 {
   this->AnchorTransform->Delete();
-  delete this->Buckets;
+  if ( this->Buckets )
+    {
+    delete this->Buckets;
+    }
   this->VisiblePoints->Delete();
 }
 
@@ -837,7 +840,10 @@ int vtkLabelPlacer::RequestData(
   //cout << "Labels Occluded: " << occluded << endl;
 
   inIter->Delete();
-  delete [] zPtr;
+  if (zPtr)
+    {
+    delete [] zPtr;
+    }
 
   timer->StopTimer();
   vtkDebugMacro("Iteration time: " << timer->GetElapsedTime());
diff --git a/Rendering/Label/vtkLabeledDataMapper.cxx b/Rendering/Label/vtkLabeledDataMapper.cxx
index ffb1044..574fb0e 100644
--- a/Rendering/Label/vtkLabeledDataMapper.cxx
+++ b/Rendering/Label/vtkLabeledDataMapper.cxx
@@ -102,7 +102,10 @@ vtkLabeledDataMapper::vtkLabeledDataMapper()
 //----------------------------------------------------------------------------
 vtkLabeledDataMapper::~vtkLabeledDataMapper()
 {
-  delete [] this->LabelFormat;
+  if (this->LabelFormat)
+    {
+    delete [] this->LabelFormat;
+    }
 
   delete [] this->LabelPositions;
   if (this->TextMappers != NULL )
@@ -751,8 +754,11 @@ void vtkLabeledDataMapper::PrintSelf(ostream& os, vtkIndent indent)
 void
 vtkLabeledDataMapper::SetFieldDataArray(int arrayIndex)
 {
-  delete [] this->FieldDataName;
-  this->FieldDataName = NULL;
+  if (this->FieldDataName)
+    {
+    delete [] this->FieldDataName;
+    this->FieldDataName = NULL;
+    }
 
   vtkDebugMacro(<< this->GetClassName() << " (" << this << "): setting FieldDataArray to " << arrayIndex );
 
diff --git a/Rendering/Label/vtkLabeledTreeMapDataMapper.cxx b/Rendering/Label/vtkLabeledTreeMapDataMapper.cxx
index 531ef41..5a36a60 100644
--- a/Rendering/Label/vtkLabeledTreeMapDataMapper.cxx
+++ b/Rendering/Label/vtkLabeledTreeMapDataMapper.cxx
@@ -731,11 +731,21 @@ int vtkLabeledTreeMapDataMapper::AnalyseLabel(char * string, int level,
   trueLevel =
     (trueLevel > this->MaxFontLevel) ? this->MaxFontLevel : trueLevel;
    fsize = this->GetStringSize(string, trueLevel);
-
-  // Horizontal label.
-  // (Vertical labels don't work due to issues with vtkTextActor.)
-  oDir = 0;
-  *tprop = this->HLabelProperties[trueLevel];
+  // Determine the orientation of the label
+  // Vertical Label - THIS DOESN'T WORK DUE TO ISSUES WITH vtkTextActor
+  // so always do the following - hence the 1 in the condition
+  if (1 || (sizes[0] >= sizes[1]))
+    {
+    // Horizontal label
+    oDir = 0;
+    *tprop = this->HLabelProperties[trueLevel];
+    }
+  else
+    {
+    // Vertical Label - THIS DOESN'T WORK DUE TO ISSUES WITH vtkTextActor
+    oDir = 1;
+    *tprop = this->VerticalLabelProperty;
+    }
 
   // Is this level dynamic or static?
   if (level >= this->DynamicLevel)
diff --git a/Rendering/Matplotlib/Testing/Cxx/CMakeLists.txt b/Rendering/Matplotlib/Testing/Cxx/CMakeLists.txt
index 0d6f38f..385b3ae 100644
--- a/Rendering/Matplotlib/Testing/Cxx/CMakeLists.txt
+++ b/Rendering/Matplotlib/Testing/Cxx/CMakeLists.txt
@@ -21,9 +21,7 @@ if(MATPLOTLIB_FOUND)
     )
 
   if(VTK_GHOSTSCRIPT_EXECUTABLE)
-    set(TestGL2PSFontDPIScaling_ARGS DATA{../Data/Fonts/DejaVuSans.ttf})
     vtk_add_test_cxx(${vtk-module}CxxTests GL2PSTests
-      TestGL2PSFontDPIScaling.cxx
       TestGL2PSMathTextActor.cxx
       TestGL2PSMathTextActor3D.cxx
       TestGL2PSMathTextOutput.cxx
diff --git a/Rendering/Matplotlib/Testing/Cxx/TestGL2PSFontDPIScaling.cxx b/Rendering/Matplotlib/Testing/Cxx/TestGL2PSFontDPIScaling.cxx
deleted file mode 100644
index 7b2e929..0000000
--- a/Rendering/Matplotlib/Testing/Cxx/TestGL2PSFontDPIScaling.cxx
+++ /dev/null
@@ -1,244 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    TestMathTextFreeTypeTextRenderer.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 "vtkTextRenderer.h"
-
-#include "vtkGL2PSExporter.h"
-#include "vtkNew.h"
-#include "vtkRenderer.h"
-#include "vtkRenderWindow.h"
-#include "vtkRenderWindowInteractor.h"
-#include "vtkStdString.h"
-#include "vtkTestingInteractor.h"
-#include "vtkTextActor.h"
-#include "vtkTextProperty.h"
-
-#include <iostream>
-#include <string>
-
-//----------------------------------------------------------------------------
-int TestGL2PSFontDPIScaling(int argc, char *argv[])
-{
-  if (argc < 2)
-    {
-    cerr << "Missing font filename." << endl;
-    return EXIT_FAILURE;
-    }
-
-  std::string uncodeFontFile(argv[1]);
-
-  vtkStdString str = "Sample multiline\ntext rendered\nusing FreeTypeTools.";
-
-  vtkNew<vtkTextActor> actor1;
-  actor1->GetTextProperty()->SetFontSize(20);
-  actor1->GetTextProperty()->SetColor(1.0, 0.0, 0.0);
-  actor1->GetTextProperty()->SetJustificationToLeft();
-  actor1->GetTextProperty()->SetVerticalJustificationToTop();
-  actor1->GetTextProperty()->SetFontFamilyToTimes();
-  actor1->SetInput(str.c_str());
-  actor1->SetPosition(10, 590);
-
-  vtkNew<vtkTextActor> actor2;
-  actor2->GetTextProperty()->SetFontSize(20);
-  actor2->GetTextProperty()->SetColor(0.0, 1.0, 0.0);
-  actor2->GetTextProperty()->SetJustificationToRight();
-  actor2->GetTextProperty()->SetVerticalJustificationToTop();
-  actor2->GetTextProperty()->SetFontFamilyToCourier();
-  actor2->SetInput(str.c_str());
-  actor2->SetPosition(590, 590);
-
-  vtkNew<vtkTextActor> actor3;
-  actor3->GetTextProperty()->SetFontSize(20);
-  actor3->GetTextProperty()->SetColor(0.0, 0.0, 1.0);
-  actor3->GetTextProperty()->SetJustificationToLeft();
-  actor3->GetTextProperty()->SetVerticalJustificationToBottom();
-  actor3->GetTextProperty()->SetItalic(1);
-  actor3->SetInput(str.c_str());
-  actor3->SetPosition(10, 10);
-
-  vtkNew<vtkTextActor> actor4;
-  actor4->GetTextProperty()->SetFontSize(20);
-  actor4->GetTextProperty()->SetColor(0.3, 0.4, 0.5);
-  actor4->GetTextProperty()->SetJustificationToRight();
-  actor4->GetTextProperty()->SetVerticalJustificationToBottom();
-  actor4->GetTextProperty()->SetBold(1);
-  actor4->GetTextProperty()->SetShadow(1);
-  actor4->GetTextProperty()->SetShadowOffset(-3, 2);
-  actor4->SetInput(str.c_str());
-  actor4->SetPosition(590, 10);
-
-  vtkNew<vtkTextActor> actor5;
-  actor5->GetTextProperty()->SetFontSize(20);
-  actor5->GetTextProperty()->SetColor(1.0, 1.0, 0.0);
-  actor5->GetTextProperty()->SetJustificationToCentered();
-  actor5->GetTextProperty()->SetVerticalJustificationToCentered();
-  actor5->GetTextProperty()->SetBold(1);
-  actor5->GetTextProperty()->SetItalic(1);
-  actor5->GetTextProperty()->SetShadow(1);
-  actor5->GetTextProperty()->SetShadowOffset(5, -8);
-  actor5->SetInput(str.c_str());
-  actor5->SetPosition(300, 300);
-
-  vtkNew<vtkTextActor> actor6;
-  actor6->GetTextProperty()->SetFontSize(16);
-  actor6->GetTextProperty()->SetColor(1.0, 0.5, 0.2);
-  actor6->GetTextProperty()->SetJustificationToCentered();
-  actor6->GetTextProperty()->SetVerticalJustificationToCentered();
-  actor6->GetTextProperty()->SetOrientation(45);
-  actor6->SetInput(str.c_str());
-  actor6->SetPosition(300, 450);
-
-  vtkNew<vtkTextActor> actor7;
-  actor7->GetTextProperty()->SetFontSize(16);
-  actor7->GetTextProperty()->SetColor(0.5, 0.2, 1.0);
-  actor7->GetTextProperty()->SetJustificationToLeft();
-  actor7->GetTextProperty()->SetVerticalJustificationToCentered();
-  actor7->GetTextProperty()->SetOrientation(45);
-  actor7->SetInput(str.c_str());
-  actor7->SetPosition(100, 156);
-
-  vtkNew<vtkTextActor> actor8;
-  actor8->GetTextProperty()->SetFontSize(16);
-  actor8->GetTextProperty()->SetColor(0.8, 1.0, 0.3);
-  actor8->GetTextProperty()->SetJustificationToRight();
-  actor8->GetTextProperty()->SetVerticalJustificationToCentered();
-  actor8->GetTextProperty()->SetOrientation(45);
-  actor8->SetInput(str.c_str());
-  actor8->SetPosition(500, 249);
-
-  // Mathtext tests
-
-  // Test that escaped "$" are passed through to freetype:
-  vtkNew<vtkTextActor> actor9;
-  actor9->GetTextProperty()->SetFontSize(12);
-  actor9->GetTextProperty()->SetColor(0.2, 0.5, 1.0);
-  actor9->SetInput("Escaped dollar signs:\n\\$10, \\$20");
-  actor9->SetPosition(100, 450);
-
-  vtkNew<vtkTextActor> actor10;
-  actor10->GetTextProperty()->SetFontSize(16);
-  actor10->GetTextProperty()->SetColor(0.5, 0.2, 1.0);
-  actor10->GetTextProperty()->SetJustificationToRight();
-  actor10->GetTextProperty()->SetOrientation(45);
-  actor10->SetInput("Test MathText $\\int_0^\\infty\\frac{2\\pi}"
-                    "{x - \\frac{z}{4}}\\,dx$");
-  actor10->SetPosition(588, 433);
-
-  // Invalid latex markup -- should fallback to freetype.
-  vtkNew<vtkTextActor> actor11;
-  actor11->GetTextProperty()->SetFontSize(15);
-  actor11->GetTextProperty()->SetColor(1.0, 0.5, 0.2);
-  actor11->SetInput("Test FreeType fallback:\n$\\asdf$");
-  actor11->SetPosition(10, 350);
-
-  // Both $...$ and \\$
-  vtkNew<vtkTextActor> actor12;
-  actor12->GetTextProperty()->SetFontSize(18);
-  actor12->GetTextProperty()->SetColor(0.0, 1.0, 0.7);
-  actor12->SetInput("Test MathText '\\$' $\\$\\sqrt[3]{8}$");
-  actor12->SetPosition(10, 300);
-
-  // $...$ without other text.
-  vtkNew<vtkTextActor> actor13;
-  actor13->GetTextProperty()->SetFontSize(18);
-  actor13->GetTextProperty()->SetColor(0.2, 1.0, 1.0);
-  actor13->SetInput("$A = \\pi r^2$");
-  actor13->SetPosition(10, 250);
-
-  // Numbers, using courier, Text that gets 'cut off'
-  vtkNew<vtkTextActor> actor14;
-  actor14->GetTextProperty()->SetFontSize(21);
-  actor14->GetTextProperty()->SetColor(1.0, 0.0, 0.0);
-  actor14->GetTextProperty()->SetJustificationToCentered();
-  actor14->GetTextProperty()->SetVerticalJustificationToCentered();
-  actor14->GetTextProperty()->SetBold(1);
-  actor14->GetTextProperty()->SetItalic(1);
-  actor14->GetTextProperty()->SetFontFamilyToCourier();
-  actor14->SetInput("4.0");
-  actor14->SetPosition(500, 400);
-
-  // UTF-8 freetype handling:
-  vtkNew<vtkTextActor> actor15;
-  actor15->GetTextProperty()->SetFontFamily(VTK_FONT_FILE);
-  actor15->GetTextProperty()->SetFontFile(uncodeFontFile.c_str());
-  actor15->GetTextProperty()->SetJustificationToCentered();
-  actor15->GetTextProperty()->SetVerticalJustificationToCentered();
-  actor15->GetTextProperty()->SetFontSize(18);
-  actor15->GetTextProperty()->SetColor(0.0, 1.0, 0.7);
-  // There is a known issue rendering some of these characters as paths --
-  // many are missing outline information in the font, and are thus absent in
-  // the produced vector graphics.
-  actor15->SetInput("UTF-8 FreeType: \xce\xa8\xd2\x94\xd2\x96\xd1\x84\xd2\xbe");
-  actor15->SetPosition(300, 110);
-
-  // Test for rotated kerning (PR#15301)
-  vtkNew<vtkTextActor> actor16;
-  actor16->GetTextProperty()->SetFontFile(uncodeFontFile.c_str());
-  actor16->GetTextProperty()->SetFontFamily(VTK_FONT_FILE);
-  actor16->GetTextProperty()->SetJustificationToCentered();
-  actor16->GetTextProperty()->SetVerticalJustificationToCentered();
-  actor16->GetTextProperty()->SetFontSize(18);
-  actor16->GetTextProperty()->SetOrientation(90);
-  actor16->GetTextProperty()->SetColor(0.0, 1.0, 0.7);
-  actor16->SetInput("oTeVaVoVAW");
-  actor16->SetPosition(300, 200);
-
-  vtkNew<vtkRenderer> ren;
-  ren->SetBackground(0.1, 0.1, 0.1);
-  vtkNew<vtkRenderWindow> win;
-  win->SetMultiSamples(0);
-  win->SetDPI(96);
-  win->SetSize(600, 600);
-  win->AddRenderer(ren.GetPointer());
-  vtkNew<vtkRenderWindowInteractor> iren;
-  iren->SetRenderWindow(win.GetPointer());
-
-  ren->AddActor(actor1.GetPointer());
-  ren->AddActor(actor2.GetPointer());
-  ren->AddActor(actor3.GetPointer());
-  ren->AddActor(actor4.GetPointer());
-  ren->AddActor(actor5.GetPointer());
-  ren->AddActor(actor6.GetPointer());
-  ren->AddActor(actor7.GetPointer());
-  ren->AddActor(actor8.GetPointer());
-  ren->AddActor(actor9.GetPointer());
-  ren->AddActor(actor10.GetPointer());
-  ren->AddActor(actor11.GetPointer());
-  ren->AddActor(actor12.GetPointer());
-  ren->AddActor(actor13.GetPointer());
-  ren->AddActor(actor14.GetPointer());
-  ren->AddActor(actor15.GetPointer());
-  ren->AddActor(actor16.GetPointer());
-  win->Render();
-
-  vtkNew<vtkGL2PSExporter> exp;
-  exp->SetRenderWindow(win.GetPointer());
-  exp->SetFileFormatToPS();
-  exp->CompressOff();
-  exp->SetSortToSimple();
-  exp->TextAsPathOn();
-  exp->DrawBackgroundOn();
-
-  std::string fileprefix = vtkTestingInteractor::TempDirectory +
-      std::string("/TestGL2PSFontDPIScaling");
-
-  exp->SetFilePrefix(fileprefix.c_str());
-  exp->Write();
-
-  win->GetInteractor()->Initialize();
-  win->GetInteractor()->Start();
-
-  return EXIT_SUCCESS;
-}
diff --git a/Rendering/Matplotlib/Testing/Cxx/TestGL2PSMathTextScaling.cxx b/Rendering/Matplotlib/Testing/Cxx/TestGL2PSMathTextScaling.cxx
index b11160b..2cfffde 100644
--- a/Rendering/Matplotlib/Testing/Cxx/TestGL2PSMathTextScaling.cxx
+++ b/Rendering/Matplotlib/Testing/Cxx/TestGL2PSMathTextScaling.cxx
@@ -47,7 +47,6 @@ int TestGL2PSMathTextScaling(int, char *[])
   vtkNew<vtkContextView> view;
   view->GetRenderer()->SetBackground(1.0, 1.0, 1.0);
   view->GetRenderWindow()->SetSize(400, 600);
-  view->GetRenderWindow()->SetDPI(120);
   vtkNew<GL2PSMathTextScalingTest> test;
   view->GetScene()->AddItem(test.GetPointer());
 
@@ -83,17 +82,14 @@ bool GL2PSMathTextScalingTest::Paint(vtkContext2D *painter)
   painter->GetBrush()->SetColor(50, 50, 128);
   painter->DrawRect(0, 0, 400, 600);
 
+  const char *str = "$\\mathrm{Text}\\/\\frac{\\pi}{\\sum_i^\\infty\\/i^{-1}}$";
   painter->GetTextProp()->SetColor(.7, .4, .5);
-  painter->GetTextProp()->SetJustificationToLeft();
-  painter->GetTextProp()->SetVerticalJustificationToBottom();
 
   for (int i = 0; i < 10; ++i)
     {
-    int fontSize = 5 + i * 3;
-    float y = 600 - ((pow(i, 1.2) + 1) * 40);
-    painter->GetTextProp()->SetFontSize(fontSize);
-    painter->DrawString(5, y, "Text");
-    painter->DrawMathTextString(120, y, "MathText");
+    painter->GetTextProp()->SetFontSize(5+i*1.5);
+    painter->DrawMathTextString(20, 600-((pow(i, 1.2)+1)*40), str);
+    painter->DrawString(5, 600-((pow(i, 1.2)+1)*40), "Text");
     }
 
   return true;
diff --git a/Rendering/Matplotlib/Testing/Cxx/TestScalarBarCombinatorics.cxx b/Rendering/Matplotlib/Testing/Cxx/TestScalarBarCombinatorics.cxx
index 1ae6f18..64cabd3 100644
--- a/Rendering/Matplotlib/Testing/Cxx/TestScalarBarCombinatorics.cxx
+++ b/Rendering/Matplotlib/Testing/Cxx/TestScalarBarCombinatorics.cxx
@@ -87,7 +87,7 @@ int TestScalarBarCombinatorics(int argc, char* argv[])
   double threshold = 10.;
   for (int cc = 1; cc < argc; ++cc)
     {
-    if ((cc < argc - 1) && (argv[cc][0] == '-') && (argv[cc][1] == 'E'))
+    if (argv[cc][0] == '-' && argv[cc][1] == 'E' && cc < argc - 1)
       {
       threshold = atof(argv[++cc]);
       continue;
diff --git a/Rendering/Matplotlib/Testing/Cxx/TestStringToPath.cxx b/Rendering/Matplotlib/Testing/Cxx/TestStringToPath.cxx
index de62ae9..876a690 100644
--- a/Rendering/Matplotlib/Testing/Cxx/TestStringToPath.cxx
+++ b/Rendering/Matplotlib/Testing/Cxx/TestStringToPath.cxx
@@ -59,8 +59,8 @@ int TestStringToPath(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
   vtkNew<vtkTextProperty> tprop;
 
   vtkMathTextUtilities::GetInstance()->StringToPath(
-        "$\\frac{-b\\pm\\sqrt{b^2-4ac}}{2a}$", path.GetPointer(),
-        tprop.GetPointer(), view->GetRenderWindow()->GetDPI());
+        "$\\frac{-b\\pm\\sqrt{b^2-4ac}}{2a}$",
+        path.GetPointer(), tprop.GetPointer());
 
   test->SetPath(path.GetPointer());
 
diff --git a/Rendering/Matplotlib/Testing/Data/Baseline/TestGL2PSFontDPIScaling-rasterRef.png.md5 b/Rendering/Matplotlib/Testing/Data/Baseline/TestGL2PSFontDPIScaling-rasterRef.png.md5
deleted file mode 100644
index 7bb5528..0000000
--- a/Rendering/Matplotlib/Testing/Data/Baseline/TestGL2PSFontDPIScaling-rasterRef.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-2f7c2bc81d8e68aa322e16e38d64a5c7
diff --git a/Rendering/Matplotlib/Testing/Data/Baseline/TestGL2PSFontDPIScaling.png.md5 b/Rendering/Matplotlib/Testing/Data/Baseline/TestGL2PSFontDPIScaling.png.md5
deleted file mode 100644
index cd90fc7..0000000
--- a/Rendering/Matplotlib/Testing/Data/Baseline/TestGL2PSFontDPIScaling.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-c275dc97cb149bf31f9974932250ca53
diff --git a/Rendering/Matplotlib/Testing/Data/Baseline/TestGL2PSMathTextOutput.png.md5 b/Rendering/Matplotlib/Testing/Data/Baseline/TestGL2PSMathTextOutput.png.md5
index 529f1a5..b57927d 100644
--- a/Rendering/Matplotlib/Testing/Data/Baseline/TestGL2PSMathTextOutput.png.md5
+++ b/Rendering/Matplotlib/Testing/Data/Baseline/TestGL2PSMathTextOutput.png.md5
@@ -1 +1 @@
-599fb5f7a8a64406c9d1e00aaf08646e
+e06b8945fd3f5915205b6db3143627a9
diff --git a/Rendering/Matplotlib/Testing/Data/Baseline/TestGL2PSMathTextOutput_1.png.md5 b/Rendering/Matplotlib/Testing/Data/Baseline/TestGL2PSMathTextOutput_1.png.md5
new file mode 100644
index 0000000..4ec84d3
--- /dev/null
+++ b/Rendering/Matplotlib/Testing/Data/Baseline/TestGL2PSMathTextOutput_1.png.md5
@@ -0,0 +1 @@
+6320b4ae772781779c1a6de6a0292119
diff --git a/Rendering/Matplotlib/Testing/Data/Baseline/TestGL2PSMathTextScaling-rasterRef.png.md5 b/Rendering/Matplotlib/Testing/Data/Baseline/TestGL2PSMathTextScaling-rasterRef.png.md5
index 87a7648..90de431 100644
--- a/Rendering/Matplotlib/Testing/Data/Baseline/TestGL2PSMathTextScaling-rasterRef.png.md5
+++ b/Rendering/Matplotlib/Testing/Data/Baseline/TestGL2PSMathTextScaling-rasterRef.png.md5
@@ -1 +1 @@
-d5babb58b36516b4898197f4cb1d2229
+13d6b649388b234678eecc99a5ee4efb
diff --git a/Rendering/Matplotlib/Testing/Data/Baseline/TestGL2PSMathTextScaling.png.md5 b/Rendering/Matplotlib/Testing/Data/Baseline/TestGL2PSMathTextScaling.png.md5
index 79bd694..e6613bb 100644
--- a/Rendering/Matplotlib/Testing/Data/Baseline/TestGL2PSMathTextScaling.png.md5
+++ b/Rendering/Matplotlib/Testing/Data/Baseline/TestGL2PSMathTextScaling.png.md5
@@ -1 +1 @@
-c2543db8af3ce95b27831f909d358e42
+b93bee603f5cfacd8d660d60caf827ce
diff --git a/Rendering/Matplotlib/Testing/Data/Baseline/TestGL2PSMathTextScaling_1.png.md5 b/Rendering/Matplotlib/Testing/Data/Baseline/TestGL2PSMathTextScaling_1.png.md5
new file mode 100644
index 0000000..4d11f14
--- /dev/null
+++ b/Rendering/Matplotlib/Testing/Data/Baseline/TestGL2PSMathTextScaling_1.png.md5
@@ -0,0 +1 @@
+1fe22de9a8ea880c55454272c2fed2c0
diff --git a/Rendering/Matplotlib/Testing/Data/Baseline/TestIndexedLookupScalarBar.png.md5 b/Rendering/Matplotlib/Testing/Data/Baseline/TestIndexedLookupScalarBar.png.md5
index 4bad205..5f7a636 100644
--- a/Rendering/Matplotlib/Testing/Data/Baseline/TestIndexedLookupScalarBar.png.md5
+++ b/Rendering/Matplotlib/Testing/Data/Baseline/TestIndexedLookupScalarBar.png.md5
@@ -1 +1 @@
-a24dc772e14eabbef5be49976a606aa7
+4c20a78acb1486fed731fd3db08806e7
diff --git a/Rendering/Matplotlib/Testing/Data/Baseline/TestScalarBarCombinatorics.png.md5 b/Rendering/Matplotlib/Testing/Data/Baseline/TestScalarBarCombinatorics.png.md5
index 9f33aa4..15f430e 100644
--- a/Rendering/Matplotlib/Testing/Data/Baseline/TestScalarBarCombinatorics.png.md5
+++ b/Rendering/Matplotlib/Testing/Data/Baseline/TestScalarBarCombinatorics.png.md5
@@ -1 +1 @@
-15e1214b638e4fe1f1fb10656bab29c1
+b7a48f5035aef8ed1efe34ba68381226
diff --git a/Rendering/Matplotlib/Testing/Data/Fonts/DejaVuSans.ttf.md5 b/Rendering/Matplotlib/Testing/Data/Fonts/DejaVuSans.ttf.md5
deleted file mode 100644
index 09b8dd3..0000000
--- a/Rendering/Matplotlib/Testing/Data/Fonts/DejaVuSans.ttf.md5
+++ /dev/null
@@ -1 +0,0 @@
-eccb7a74720fc377b60d6b2110530fd9
diff --git a/Rendering/Matplotlib/module.cmake b/Rendering/Matplotlib/module.cmake
index 65c9a91..c6cc9bc 100644
--- a/Rendering/Matplotlib/module.cmake
+++ b/Rendering/Matplotlib/module.cmake
@@ -12,10 +12,10 @@ vtk_module(vtkRenderingMatplotlib
     vtkInteractionImage
     vtkInteractionWidgets
     vtkIOGeometry
-    vtkIOParallel
     vtkTestingRendering
     vtkInteractionStyle
     vtkRendering${VTK_RENDERING_BACKEND}
+    vtkRenderingFreeType${VTK_RENDERING_BACKEND}
     vtkViewsContext2D
     vtkIOExport
     vtkRenderingGL2PS
diff --git a/Rendering/Matplotlib/vtkMatplotlibMathTextUtilities.cxx b/Rendering/Matplotlib/vtkMatplotlibMathTextUtilities.cxx
index ad03656..1945aa2 100644
--- a/Rendering/Matplotlib/vtkMatplotlibMathTextUtilities.cxx
+++ b/Rendering/Matplotlib/vtkMatplotlibMathTextUtilities.cxx
@@ -46,7 +46,7 @@ typedef Py_intptr_t     Py_ssize_t;
 #endif
 
 //----------------------------------------------------------------------------
-vtkMatplotlibMathTextUtilities::Availability
+vtkMatplotlibMathTextUtilities::Availablity
 vtkMatplotlibMathTextUtilities::MPLMathTextAvailable =
 vtkMatplotlibMathTextUtilities::NOT_TESTED;
 
@@ -55,16 +55,13 @@ vtkMatplotlibMathTextUtilities::NOT_TESTED;
 // work in release mode builds.
 #define vtkMplStartUpDebugMacro(x) if(debug){vtkGenericWarningMacro(x);}
 
-vtkObjectFactoryNewMacro(vtkMatplotlibMathTextUtilities)
-
 //----------------------------------------------------------------------------
-vtkMatplotlibMathTextUtilities::Availability
-vtkMatplotlibMathTextUtilities::CheckMPLAvailability()
+void vtkMatplotlibMathTextUtilities::CheckMPLAvailability()
 {
   if (vtkMatplotlibMathTextUtilities::MPLMathTextAvailable != NOT_TESTED)
     {
     // Already tested. Nothing to do now.
-    return vtkMatplotlibMathTextUtilities::MPLMathTextAvailable;
+    return;
     }
 
   // Enable startup debugging output. This will be set to true when
@@ -114,14 +111,35 @@ vtkMatplotlibMathTextUtilities::CheckMPLAvailability()
     vtkMplStartUpDebugMacro("Successfully imported matplotlib.");
     vtkMatplotlibMathTextUtilities::MPLMathTextAvailable = AVAILABLE;
     }
-
-  return vtkMatplotlibMathTextUtilities::MPLMathTextAvailable;
 }
 
 //----------------------------------------------------------------------------
-bool vtkMatplotlibMathTextUtilities::IsAvailable()
+vtkMatplotlibMathTextUtilities* vtkMatplotlibMathTextUtilities::New()
 {
-  return this->CheckMPLAvailability() == AVAILABLE;
+  vtkMatplotlibMathTextUtilities::CheckMPLAvailability();
+
+  // Attempt to import matplotlib to check for availability
+  switch (vtkMatplotlibMathTextUtilities::MPLMathTextAvailable)
+    {
+  case vtkMatplotlibMathTextUtilities::AVAILABLE:
+    break;
+
+  case vtkMatplotlibMathTextUtilities::NOT_TESTED:
+  case vtkMatplotlibMathTextUtilities::UNAVAILABLE:
+  default:
+    return NULL;
+    }
+
+  // Adapted from VTK_OBJECT_FACTORY_NEW_BODY to enable debugging output when
+  // requested.
+  vtkObject* ret =
+    vtkObjectFactory::CreateInstance("vtkMatplotlibMathTextUtilities");
+  if (ret)
+    {
+    return static_cast<vtkMatplotlibMathTextUtilities*>(ret);
+    }
+
+  return new vtkMatplotlibMathTextUtilities;
 }
 
 //----------------------------------------------------------------------------
@@ -295,12 +313,6 @@ bool vtkMatplotlibMathTextUtilities::CheckForError(PyObject *object)
 PyObject *
 vtkMatplotlibMathTextUtilities::GetFontProperties(vtkTextProperty *tprop)
 {
-  if (!this->IsAvailable())
-    {
-    vtkErrorMacro(<<"Matplotlib rendering is unavailable.");
-    return NULL;
-    }
-
   if (!this->FontPropertiesClass)
     {
     if (!this->InitializeFontPropertiesClass())
@@ -507,7 +519,7 @@ bool vtkMatplotlibMathTextUtilities::PrepareImageData(vtkImageData *data,
 
 //----------------------------------------------------------------------------
 bool vtkMatplotlibMathTextUtilities::GetBoundingBox(
-    vtkTextProperty *tprop, const char *str, int dpi, int bbox[4])
+    vtkTextProperty *tprop, const char *str, unsigned int dpi, int bbox[4])
 {
   vtkTextRenderer::Metrics metrics;
   if (!this->GetMetrics(tprop, str, dpi, metrics))
@@ -521,15 +533,9 @@ bool vtkMatplotlibMathTextUtilities::GetBoundingBox(
 
 //----------------------------------------------------------------------------
 bool vtkMatplotlibMathTextUtilities::GetMetrics(
-    vtkTextProperty *tprop, const char *str, int dpi,
+    vtkTextProperty *tprop, const char *str, unsigned int dpi,
     vtkTextRenderer::Metrics &metrics)
 {
-  if (!this->IsAvailable())
-    {
-    vtkErrorMacro(<<"Matplotlib rendering is unavailable.");
-    return false;
-    }
-
   if (!this->MaskParser)
     {
     if (!this->InitializeMaskParser())
@@ -543,13 +549,16 @@ bool vtkMatplotlibMathTextUtilities::GetMetrics(
 
   long int rows = 0;
   long int cols = 0;
+  // matplotlib.mathtext seems to mishandle the dpi, this conversion makes the
+  // text size match the images produced by vtkFreeTypeUtilities, as well as the
+  // paths generated by StringToPath
+  long int fontSize = tprop->GetFontSize() * 72.0 / static_cast<float>(dpi);
 
   vtkSmartPyObject resultTuple(PyObject_CallMethod(this->MaskParser,
                                                    const_cast<char*>("to_mask"),
                                                    const_cast<char*>("sii"),
                                                    const_cast<char*>(str),
-                                                   tprop->GetFontSize(),
-                                                   dpi));
+                                                   fontSize, dpi));
   if (this->CheckForError(resultTuple.GetPointer()))
     {
     return false;
@@ -611,15 +620,9 @@ bool vtkMatplotlibMathTextUtilities::GetMetrics(
 bool vtkMatplotlibMathTextUtilities::RenderString(const char *str,
                                                   vtkImageData *image,
                                                   vtkTextProperty *tprop,
-                                                  int dpi,
+                                                  unsigned int dpi,
                                                   int textDims[2])
 {
-  if (!this->IsAvailable())
-    {
-    vtkErrorMacro(<<"Matplotlib rendering is unavailable.");
-    return false;
-    }
-
   if (!this->MaskParser)
     {
     if (!this->InitializeMaskParser())
@@ -634,25 +637,29 @@ bool vtkMatplotlibMathTextUtilities::RenderString(const char *str,
   long int rows = 0;
   long int cols = 0;
   long int ind = 0;
+  //long int numPixels = 0;
+  // matplotlib.mathtext seems to mishandle the dpi, this conversion makes the
+  // text size match the images produced by vtkFreeTypeUtilities, as well as the
+  // paths generated by StringToPath
+  long int fontSize = tprop->GetFontSize() * 72.0 / static_cast<float>(dpi);
 
   double *fgColor = tprop->GetColor();
   unsigned char fgR = static_cast<unsigned char>(fgColor[0] * 255);
   unsigned char fgG = static_cast<unsigned char>(fgColor[1] * 255);
   unsigned char fgB = static_cast<unsigned char>(fgColor[2] * 255);
-  double fgA = tprop->GetOpacity();
+  double fgAlpha = tprop->GetOpacity();
 
   double *bgColor = tprop->GetBackgroundColor();
   unsigned char bgR = static_cast<unsigned char>(bgColor[0] * 255);
   unsigned char bgG = static_cast<unsigned char>(bgColor[1] * 255);
   unsigned char bgB = static_cast<unsigned char>(bgColor[2] * 255);
-  double bgA = tprop->GetBackgroundOpacity();
-  bool hasBackground = (static_cast<unsigned char>(bgA * 255) != 0);
+  double bgAlpha = tprop->GetBackgroundOpacity();
 
   vtkSmartPyObject resultTuple(PyObject_CallMethod(this->MaskParser,
-                                                   const_cast<char*>("to_mask"),
-                                                   const_cast<char*>("sii"),
-                                                   const_cast<char*>(str),
-                                                   tprop->GetFontSize(), dpi));
+                                                const_cast<char*>("to_mask"),
+                                                const_cast<char*>("sii"),
+                                                const_cast<char*>(str),
+                                                fontSize, dpi));
   if (this->CheckForError(resultTuple.GetPointer()))
     {
     return false;
@@ -722,7 +729,7 @@ bool vtkMatplotlibMathTextUtilities::RenderString(const char *str,
         {
         return false;
         }
-      const unsigned char val = static_cast<unsigned char>(PyInt_AsLong(item));
+      const float alpha = fgAlpha * (PyInt_AsLong(item) / 255.f);
       if (this->CheckForError())
         {
         return false;
@@ -730,23 +737,12 @@ bool vtkMatplotlibMathTextUtilities::RenderString(const char *str,
       unsigned char *ptr =
           static_cast<unsigned char*>(image->GetScalarPointer(col, row, 0));
 
-      if (hasBackground)
-        {
-        const float fg_blend = fgA * (val / 255.f);
-        const float bg_blend = 1.f - fg_blend;
+      const float s1mA = 1.f - alpha;
 
-        ptr[0] = static_cast<unsigned char>(bg_blend * bgR + fg_blend * fgR);
-        ptr[1] = static_cast<unsigned char>(bg_blend * bgG + fg_blend * fgG);
-        ptr[2] = static_cast<unsigned char>(bg_blend * bgB + fg_blend * fgB);
-        ptr[3] = static_cast<unsigned char>(255 * (fg_blend + bgA * bg_blend));
-        }
-      else
-        {
-        ptr[0] = fgR;
-        ptr[1] = fgG;
-        ptr[2] = fgB;
-        ptr[3] = static_cast<unsigned char>(val * fgA);
-        }
+      ptr[0] = static_cast<unsigned char>(s1mA * bgR + alpha * fgR);
+      ptr[1] = static_cast<unsigned char>(s1mA * bgG + alpha * fgG);
+      ptr[2] = static_cast<unsigned char>(s1mA * bgB + alpha * fgB);
+      ptr[3] = static_cast<unsigned char>(255 * (alpha + bgAlpha * s1mA));
       }
     }
 
@@ -819,15 +815,8 @@ bool vtkMatplotlibMathTextUtilities::RenderString(const char *str,
 //----------------------------------------------------------------------------
 bool vtkMatplotlibMathTextUtilities::StringToPath(const char *str,
                                                   vtkPath *path,
-                                                  vtkTextProperty *tprop,
-                                                  int dpi)
+                                                  vtkTextProperty *tprop)
 {
-  if (!this->IsAvailable())
-    {
-    vtkErrorMacro(<<"Matplotlib rendering is unavailable.");
-    return false;
-    }
-
   if (!this->PathParser)
     {
     if (!this->InitializePathParser())
@@ -861,10 +850,9 @@ bool vtkMatplotlibMathTextUtilities::StringToPath(const char *str,
   // Bounding box for all control points, used for justification
   float cbox[4] = {VTK_FLOAT_MAX, VTK_FLOAT_MAX, VTK_FLOAT_MIN, VTK_FLOAT_MIN};
 
-  // The path is always generated using a 100pt font @72 dpi. Use this factor to
+  // The path is always generated at a font size of 100. Use this factor to
   // recover the font.
-  const float fontScale = (tprop->GetFontSize() / 100.f) * (dpi / 72.f) ;
-
+  const float fontScale = ((tprop->GetFontSize()) / 100.);
   path->Reset();
 
   // Create the font property
@@ -1078,21 +1066,6 @@ void vtkMatplotlibMathTextUtilities::PrintSelf(ostream &os, vtkIndent indent)
 {
   this->Superclass::PrintSelf(os, indent);
 
-  os << indent << "MPLMathTextAvailable: ";
-  switch (this->MPLMathTextAvailable)
-    {
-    case vtkMatplotlibMathTextUtilities::NOT_TESTED:
-      os << "Not tested\n";
-      break;
-    case vtkMatplotlibMathTextUtilities::AVAILABLE:
-      os << "Available\n";
-      break;
-    default:
-    case vtkMatplotlibMathTextUtilities::UNAVAILABLE:
-      os << "Unavailable\n";
-      break;
-    }
-
   os << indent << "MaskParser: " << this->MaskParser << endl;
   os << indent << "PathParser: " << this->PathParser << endl;
   os << indent << "FontPropertiesClass: " << this->FontPropertiesClass << endl;
diff --git a/Rendering/Matplotlib/vtkMatplotlibMathTextUtilities.h b/Rendering/Matplotlib/vtkMatplotlibMathTextUtilities.h
index 3ca3aa8..c133e27 100644
--- a/Rendering/Matplotlib/vtkMatplotlibMathTextUtilities.h
+++ b/Rendering/Matplotlib/vtkMatplotlibMathTextUtilities.h
@@ -44,19 +44,17 @@ public:
 
   static vtkMatplotlibMathTextUtilities *New();
 
-  virtual bool IsAvailable();
-
   // Description:
   // Given a text property and a string, get the bounding box {xmin, xmax,
   // ymin, ymax} of the rendered string in pixels. The origin of the bounding
   // box is the anchor point described by the horizontal and vertical
   // justification text property variables.
   // Returns true on success, false otherwise.
-  bool GetBoundingBox(vtkTextProperty *tprop, const char *str, int dpi,
-                      int bbox[4]);
+  bool GetBoundingBox(vtkTextProperty *tprop, const char *str,
+                      unsigned int dpi, int bbox[4]);
 
-  bool GetMetrics(vtkTextProperty *tprop, const char *str, int dpi,
-                  vtkTextRenderer::Metrics &metrics);
+  bool GetMetrics(vtkTextProperty *tprop, const char *str,
+                  unsigned int dpi, vtkTextRenderer::Metrics &metrics);
 
   // Description:
   // Render the given string @a str into the vtkImageData @a data with a
@@ -68,15 +66,14 @@ public:
   // described by the text property's vertical and horizontal justification
   // options.
   bool RenderString(const char *str, vtkImageData *data, vtkTextProperty *tprop,
-                    int dpi, int textDims[2] = NULL);
+                    unsigned int dpi, int textDims[2] = NULL);
 
   // Description:
   // Parse the MathText expression in str and fill path with a contour of the
   // glyphs. The origin of the path coordinates is aligned with the anchor point
   // described by the text property's horizontal and vertical justification
   // options.
-  bool StringToPath(const char *str, vtkPath *path, vtkTextProperty *tprop,
-                    int dpi);
+  bool StringToPath(const char *str, vtkPath *path, vtkTextProperty *tprop);
 
   // Description:
   // Set to true if the graphics implmentation requires texture image dimensions
@@ -120,33 +117,28 @@ protected:
   static void RotateCorners(double angleDeg, double corners[4][2],
                             double bbox[4]);
 
-  bool ScaleToPowerOfTwo;
-  bool PrepareImageData(vtkImageData *data, int bbox[4]);
-
-private:
-  vtkMatplotlibMathTextUtilities(const vtkMatplotlibMathTextUtilities&); // Not implemented.
-  void operator=(const vtkMatplotlibMathTextUtilities&); // Not implemented.
-
   // Description:
   // Used for runtime checking of matplotlib's mathtext availability.
-  // @sa IsAvailable
-  enum Availability
+  enum Availablity
     {
     NOT_TESTED = 0,
     AVAILABLE,
     UNAVAILABLE
     };
 
-  // Description:
+  bool ScaleToPowerOfTwo;
+  bool PrepareImageData(vtkImageData *data, int bbox[4]);
+
   // Function used to check MPL availability and update MPLMathTextAvailable.
-  // This will do tests only the first time this method is called. This method
-  // is called internally when matplotlib rendering is first needed and is used
-  // to implement IsAvailable.
-  static Availability CheckMPLAvailability();
+  // This will do tests only the first time this method is called.
+  static void CheckMPLAvailability();
 
-  // Description:
-  // Cache the availability of matplotlib in the current python session.
-  static Availability MPLMathTextAvailable;
+private:
+  vtkMatplotlibMathTextUtilities(const vtkMatplotlibMathTextUtilities&); // Not implemented.
+  void operator=(const vtkMatplotlibMathTextUtilities&); // Not implemented.
+
+
+  static Availablity MPLMathTextAvailable;
 };
 
 #endif
diff --git a/Rendering/OpenGL/CMakeLists.txt b/Rendering/OpenGL/CMakeLists.txt
index 1cf4e91..be3d8c1 100644
--- a/Rendering/OpenGL/CMakeLists.txt
+++ b/Rendering/OpenGL/CMakeLists.txt
@@ -40,9 +40,6 @@ endif()
 # modular fashion, for now it must remain an option on vtkRenderingOpenGL.
 option(VTK_USE_TDX "Use TDx interaction devices" OFF)
 mark_as_advanced(VTK_USE_TDX)
-if (TDX_INCLUDE_DIR)
-  include_directories(${TDX_INCLUDE_DIR})
-endif()
 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/vtkTDxConfigure.h.in
   ${CMAKE_CURRENT_BINARY_DIR}/vtkTDxConfigure.h)
 
diff --git a/Rendering/OpenGL/Testing/Cxx/CMakeLists.txt b/Rendering/OpenGL/Testing/Cxx/CMakeLists.txt
index cc1afe2..7a646cc 100644
--- a/Rendering/OpenGL/Testing/Cxx/CMakeLists.txt
+++ b/Rendering/OpenGL/Testing/Cxx/CMakeLists.txt
@@ -90,6 +90,7 @@ foreach(exe
   add_executable(${exe} ${exe}.cxx)
   target_link_libraries(${exe}
     vtkRenderingOpenGL
+    vtkRenderingFreeTypeOpenGL
     vtkInteractionStyle
     vtkImagingSources
     vtkImagingGeneral
diff --git a/Rendering/OpenGL/Testing/Cxx/LoadOpenGLExtension.cxx b/Rendering/OpenGL/Testing/Cxx/LoadOpenGLExtension.cxx
index e79d291..bf200d8 100644
--- a/Rendering/OpenGL/Testing/Cxx/LoadOpenGLExtension.cxx
+++ b/Rendering/OpenGL/Testing/Cxx/LoadOpenGLExtension.cxx
@@ -44,9 +44,9 @@
 #include "vtkTextActor.h"
 #include "vtkTextProperty.h"
 
-static vtkUnsignedCharArray *image;
+vtkUnsignedCharArray *image;
 
-static GLfloat laplacian[3][3] = {
+GLfloat laplacian[3][3] = {
   { -0.125f, -0.125f, -0.125f },
   { -0.125f,  1.0f,   -0.125f },
   { -0.125f, -0.125f, -0.125f }
diff --git a/Rendering/OpenGL/Testing/Cxx/TestValuePasses.cxx b/Rendering/OpenGL/Testing/Cxx/TestValuePasses.cxx
index c0b752e..f006566 100644
--- a/Rendering/OpenGL/Testing/Cxx/TestValuePasses.cxx
+++ b/Rendering/OpenGL/Testing/Cxx/TestValuePasses.cxx
@@ -59,7 +59,7 @@
 #include "vtkRenderPassCollection.h"
 #include "vtkSequencePass.h"
 
-static vtkProp * prop = NULL;
+vtkProp * prop = NULL;
 
 const char TestValuePassesEventLog[] =
   "# StreamVersion 1\n"
diff --git a/Rendering/OpenGL/Testing/Cxx/TimeRenderer.cxx b/Rendering/OpenGL/Testing/Cxx/TimeRenderer.cxx
index 0339e02..3d5228f 100644
--- a/Rendering/OpenGL/Testing/Cxx/TimeRenderer.cxx
+++ b/Rendering/OpenGL/Testing/Cxx/TimeRenderer.cxx
@@ -229,8 +229,8 @@ int main( int argc, char *argv[] )
 
   // Clean up
   cube->Delete();
-  vtkGarbageCollector::SetGlobalDebugFlag(true);
-  vtkGarbageCollector::SetGlobalDebugFlag(false);
+  vtkGarbageCollector::SetGlobalDebugFlag(1);
+  vtkGarbageCollector::SetGlobalDebugFlag(0);
   prop->Delete();
   ren1->Delete();
   renWindow->Delete();
diff --git a/Rendering/OpenGL/Testing/Data/Baseline/TestFreetypeTextMapper.png.md5 b/Rendering/OpenGL/Testing/Data/Baseline/TestFreetypeTextMapper.png.md5
index b60c05b..495114e 100644
--- a/Rendering/OpenGL/Testing/Data/Baseline/TestFreetypeTextMapper.png.md5
+++ b/Rendering/OpenGL/Testing/Data/Baseline/TestFreetypeTextMapper.png.md5
@@ -1 +1 @@
-d73d96a5097360470a39798a34040e3d
+874303bb41f009f382912854c5751da7
diff --git a/Rendering/OpenGL/Testing/Data/Baseline/TestFreetypeTextMapperBigger.png.md5 b/Rendering/OpenGL/Testing/Data/Baseline/TestFreetypeTextMapperBigger.png.md5
index c5033af..b9cbb97 100644
--- a/Rendering/OpenGL/Testing/Data/Baseline/TestFreetypeTextMapperBigger.png.md5
+++ b/Rendering/OpenGL/Testing/Data/Baseline/TestFreetypeTextMapperBigger.png.md5
@@ -1 +1 @@
-9cc8c4ca0d38eaa9b079f47fa021bc51
+6f382afc015d037ad8f46d8381a48387
diff --git a/Rendering/OpenGL/Testing/Data/Baseline/TestFreetypeTextOverlay.png.md5 b/Rendering/OpenGL/Testing/Data/Baseline/TestFreetypeTextOverlay.png.md5
index d8537f2..0629d56 100644
--- a/Rendering/OpenGL/Testing/Data/Baseline/TestFreetypeTextOverlay.png.md5
+++ b/Rendering/OpenGL/Testing/Data/Baseline/TestFreetypeTextOverlay.png.md5
@@ -1 +1 @@
-1d93d37f48cdab800995389cad4c80a5
+11d717e53ba64c7079f01e9df304ca14
diff --git a/Rendering/OpenGL/Testing/Python/TestFreetypeTextMapper.py b/Rendering/OpenGL/Testing/Python/TestFreetypeTextMapper.py
index d09339f..b494d64 100755
--- a/Rendering/OpenGL/Testing/Python/TestFreetypeTextMapper.py
+++ b/Rendering/OpenGL/Testing/Python/TestFreetypeTextMapper.py
@@ -71,7 +71,7 @@ class TestFreetypeTextMapper(vtk.test.Testing.vtkTest):
                     txt = family + ": " + defaultText
 
                 idx = ''.join(map(str, [i, j]))
-                mapper.update({idx:vtk.vtkTextMapper()})
+                mapper.update({idx:vtk.vtkOpenGLFreeTypeTextMapper()})
                 mapper[idx].SetInput(txt)
 
                 tprop = mapper[idx].GetTextProperty()
diff --git a/Rendering/OpenGL/Testing/Python/TestFreetypeTextMapperBigger.py b/Rendering/OpenGL/Testing/Python/TestFreetypeTextMapperBigger.py
index 89a8f78..34ae2db 100755
--- a/Rendering/OpenGL/Testing/Python/TestFreetypeTextMapperBigger.py
+++ b/Rendering/OpenGL/Testing/Python/TestFreetypeTextMapperBigger.py
@@ -69,7 +69,7 @@ class TestFreetypeTextMapperBigger(vtk.test.Testing.vtkTest):
                     txt = family + ": " + defaultText
 
                 idx = ''.join(map(str, [i, j]))
-                mapper.update({idx:vtk.vtkTextMapper()})
+                mapper.update({idx:vtk.vtkOpenGLFreeTypeTextMapper()})
                 mapper[idx].SetInput(txt)
 
                 tprop = mapper[idx].GetTextProperty()
diff --git a/Rendering/OpenGL/Testing/Python/TestFreetypeTextOverlay.py b/Rendering/OpenGL/Testing/Python/TestFreetypeTextOverlay.py
index 58330e6..de0fddf 100755
--- a/Rendering/OpenGL/Testing/Python/TestFreetypeTextOverlay.py
+++ b/Rendering/OpenGL/Testing/Python/TestFreetypeTextOverlay.py
@@ -55,7 +55,7 @@ for (bold,italic,shadow) in ((0,0,0),(0,0,1),(1,0,0),(0,1,0),(1,1,0)):
     if attribs:
         face_name = face_name + " (" + ",".join(attribs) + ")"
 
-    mapper = vtk.vtkTextMapper()
+    mapper = vtk.vtkOpenGLFreeTypeTextMapper()
     mapper.SetInput(face_name + ": " + default_text)
 
     tprop = mapper.GetTextProperty()
diff --git a/Rendering/OpenGL/Testing/Tcl/TestFreetypeTextMapper.tcl b/Rendering/OpenGL/Testing/Tcl/TestFreetypeTextMapper.tcl
index bc4641d..a0845ef 100644
--- a/Rendering/OpenGL/Testing/Tcl/TestFreetypeTextMapper.tcl
+++ b/Rendering/OpenGL/Testing/Tcl/TestFreetypeTextMapper.tcl
@@ -50,7 +50,7 @@ foreach family {
             set face_name "$face_name ([join $attribs ,])"
         }
 
-        set mapper [vtkTextMapper mapper_${family}_${bold}_${italic}_${shadow}]
+        set mapper [vtkOpenGLFreeTypeTextMapper mapper_${family}_${bold}_${italic}_${shadow}]
         $mapper SetInput "$face_name: $default_text"
 
         set tprop [$mapper GetTextProperty]
diff --git a/Rendering/OpenGL/Testing/Tcl/TestFreetypeTextMapperBigger.tcl b/Rendering/OpenGL/Testing/Tcl/TestFreetypeTextMapperBigger.tcl
index 27d8a3c..c10f6ed 100644
--- a/Rendering/OpenGL/Testing/Tcl/TestFreetypeTextMapperBigger.tcl
+++ b/Rendering/OpenGL/Testing/Tcl/TestFreetypeTextMapperBigger.tcl
@@ -44,7 +44,7 @@ foreach family {
             set face_name "$face_name ([join $attribs ,])"
         }
 
-        set mapper [vtkTextMapper mapper_${family}_${bold}_${italic}]
+        set mapper [vtkOpenGLFreeTypeTextMapper mapper_${family}_${bold}_${italic}]
         $mapper SetInput "$face_name: $default_text"
 
         set tprop [$mapper GetTextProperty]
diff --git a/Rendering/OpenGL/Testing/Tcl/TestFreetypeTextOverlay.tcl b/Rendering/OpenGL/Testing/Tcl/TestFreetypeTextOverlay.tcl
index 6a2060a..e2a5356 100644
--- a/Rendering/OpenGL/Testing/Tcl/TestFreetypeTextOverlay.tcl
+++ b/Rendering/OpenGL/Testing/Tcl/TestFreetypeTextOverlay.tcl
@@ -63,7 +63,7 @@ foreach family {
             set face_name "$face_name ([join $attribs ,])"
         }
 
-        set mapper [vtkTextMapper mapper_${family}_${bold}_${italic}_${shadow}]
+        set mapper [vtkOpenGLFreeTypeTextMapper mapper_${family}_${bold}_${italic}_${shadow}]
         $mapper SetInput "$face_name: $default_text"
 
         set tprop [$mapper GetTextProperty]
diff --git a/Rendering/OpenGL/module.cmake b/Rendering/OpenGL/module.cmake
index db5a518..eadb581 100644
--- a/Rendering/OpenGL/module.cmake
+++ b/Rendering/OpenGL/module.cmake
@@ -16,6 +16,7 @@ vtk_module(vtkRenderingOpenGL
     vtkIOExport
     vtkIOLegacy
     vtkIOXML
+    vtkRenderingFreeTypeOpenGL
     vtkRenderingImage
     vtkRenderingLOD
     vtkImagingGeneral
diff --git a/Rendering/OpenGL/vtkCarbonRenderWindow.cxx b/Rendering/OpenGL/vtkCarbonRenderWindow.cxx
index 81e42da..6a8480e 100644
--- a/Rendering/OpenGL/vtkCarbonRenderWindow.cxx
+++ b/Rendering/OpenGL/vtkCarbonRenderWindow.cxx
@@ -802,6 +802,9 @@ void vtkCarbonRenderWindow::WindowInitialize()
     ren->SetRenderWindow(0);
     ren->SetRenderWindow(this);
     }
+
+  // set the DPI
+  this->SetDPI(72); // this may need to be more clever some day
 }
 
 //-----------------------------------------------------------------------------
diff --git a/Rendering/OpenGL/vtkCocoaGLView.h b/Rendering/OpenGL/vtkCocoaGLView.h
index 3d5933d..fb9e792 100644
--- a/Rendering/OpenGL/vtkCocoaGLView.h
+++ b/Rendering/OpenGL/vtkCocoaGLView.h
@@ -18,20 +18,18 @@
 // This class is a subclass of Cocoa's NSView; it uses Objective-C++.
 // This class overrides several NSView methods.
 // To provide the usual VTK keyboard user interface, it overrides the
-// following methods: acceptsFirstResponder, keyDown:,
+// following methods from NSResponder: acceptsFirstResponder, keyDown:,
 // keyUp:, and flagsChanged:
 // To provide the usual VTK mouse user interface, it overrides the
-// following methods: mouseMoved:, mouseEntered:,
+// following methods from NSResponder: mouseMoved:, mouseEntered:,
 // mouseExited: scrollWheel:, mouseDown:, rightMouseDown:,
 // otherMouseDown:, mouseDragged:, rightMouseDragged:, otherMouseDragged:,
-// and updateTrackingAreas.
-// To be able to render and draw onscreen, it overrides drawRect:.
+// and resetCursorRects.
+// To be able to render and draw onscreen, it overrides drawRect:
+// from NSView.
 
-// Compatibility notes:
-// - this class was previously a subclass of NSOpenGLView,
+// Note that this class was previously a subclass of NSOpenGLView,
 // but starting with VTK 5.0 is now a subclass of NSView.
-// - starting with VTK 6.3 this class overrides the more modern
-// updateTrackingAreas instead of resetCursorRects.
 //
 // .SECTION See Also
 // vtkCocoaRenderWindow vtkCocoaRenderWindowInteractor
@@ -61,7 +59,8 @@
 {
   @private
   vtkCocoaRenderWindowRef _myVTKRenderWindow;
-  NSTrackingArea* _rolloverTrackingArea;
+  NSTrackingRectTag _rolloverTrackingRectTag;
+  BOOL _rolloverTrackingRectSet;
 }
 
 - (vtkCocoaRenderWindowRef)getVTKRenderWindow;
diff --git a/Rendering/OpenGL/vtkCocoaGLView.mm b/Rendering/OpenGL/vtkCocoaGLView.mm
index 6170837..7db03c2 100644
--- a/Rendering/OpenGL/vtkCocoaGLView.mm
+++ b/Rendering/OpenGL/vtkCocoaGLView.mm
@@ -21,11 +21,6 @@
 #import "vtkCocoaRenderWindowInteractor.h"
 #import "vtkCommand.h"
 
-//----------------------------------------------------------------------------
-// Private
- at interface vtkCocoaGLView()
- at property(readwrite, retain, nonatomic) NSTrackingArea *rolloverTrackingArea;
- at end
 
 @implementation vtkCocoaGLView
 
@@ -37,9 +32,6 @@
 }
 
 //----------------------------------------------------------------------------
- at synthesize rolloverTrackingArea = _rolloverTrackingArea;
-
-//----------------------------------------------------------------------------
 // Overridden (from NSView).
 // designated initializer
 - (id)initWithFrame:(NSRect)frameRect
@@ -47,6 +39,9 @@
   self = [super initWithFrame:frameRect];
   if (self)
     {
+    // The tracking rect is not set yet.
+    _rolloverTrackingRectSet = NO;
+
     // Force Cocoa into "multi threaded mode" because VTK spawns pthreads.
     // Apple's docs say: "If you intend to use Cocoa calls, you must force
     // Cocoa into its multithreaded mode before detaching any POSIX threads.
@@ -101,32 +96,38 @@
 }
 
 //----------------------------------------------------------------------------
-// Overridden (from NSView).
-- (void)updateTrackingAreas
+// Private
+- (void)clearTrackingRect
 {
-  //clear out the old tracking area
-  NSTrackingArea *trackingArea = [self rolloverTrackingArea];
-  if (trackingArea)
+  // remove any tracking rect we have
+  if (_rolloverTrackingRectSet)
     {
-    [self removeTrackingArea:trackingArea];
+    [self removeTrackingRect:_rolloverTrackingRectTag];
+    _rolloverTrackingRectSet = NO;
     }
+}
 
-  //create a new tracking area
-  NSRect rect = [self visibleRect];
-  NSTrackingAreaOptions opts = (NSTrackingMouseEnteredAndExited |
-                                NSTrackingMouseMoved |
-                                NSTrackingActiveAlways);
-  trackingArea = [[NSTrackingArea alloc] initWithRect:rect
-                                              options:opts
-                                                owner:self
-                                             userInfo:nil];
-  [self addTrackingArea:trackingArea];
-  [self setRolloverTrackingArea:trackingArea];
-#if !VTK_OBJC_IS_ARC
-  [trackingArea release];
-#endif
-
-  [super updateTrackingAreas];
+//----------------------------------------------------------------------------
+// Private
+- (void)resetTrackingRect
+{
+  //clear out the old tracking rect
+  [self clearTrackingRect];
+
+  //create a new tracking rect
+  _rolloverTrackingRectTag = [self addTrackingRect:[self visibleRect]
+                                             owner:self
+                                          userData:NULL
+                                      assumeInside:NO];
+  _rolloverTrackingRectSet = YES;
+}
+
+//----------------------------------------------------------------------------
+// Overridden (from NSView).
+- (void)resetCursorRects
+{
+  [super resetCursorRects];
+  [self resetTrackingRect];
 }
 
 //----------------------------------------------------------------------------
@@ -158,7 +159,6 @@ static const char *vtkMacCharCodeToKeySymTable[128] = {
   "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", "Delete",
 };
 
-//----------------------------------------------------------------------------
 // For generating keysyms that are compatible with other VTK interactors
 static const char *vtkMacKeyCodeToKeySymTable[128] = {
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -422,7 +422,8 @@ static const char *vtkMacKeyCodeToKeySymTable[128] = {
 - (void)mouseEntered:(NSEvent *)theEvent
 {
   // Note: the mouseEntered/mouseExited events depend on the maintenance of
-  // the tracking area (updateTrackingAreas).
+  // the Tracking Rect, which is handled by the resetTrackingRect,
+  // clearTrackingRect and resetCursorRects methods above.
   [self invokeVTKMoveEvent:vtkCommand::EnterEvent
                 cocoaEvent:theEvent];
 }
diff --git a/Rendering/OpenGL/vtkCocoaRenderWindow.mm b/Rendering/OpenGL/vtkCocoaRenderWindow.mm
index 2a8acdc..e4fc975 100644
--- a/Rendering/OpenGL/vtkCocoaRenderWindow.mm
+++ b/Rendering/OpenGL/vtkCocoaRenderWindow.mm
@@ -829,7 +829,7 @@ void vtkCocoaRenderWindow::CreateAWindow()
       [parent addSubview:glView];
       this->SetWindowId(glView);
       this->ViewCreated = 1;
-#if !VTK_OBJC_IS_ARC
+#if VTK_OBJC_IS_MRR
       [glView release];
 #endif
       }
@@ -845,7 +845,7 @@ void vtkCocoaRenderWindow::CreateAWindow()
       this->SetWindowId(glView);
       this->ViewCreated = 1;
       [glView setVTKRenderWindow:this];
-#if !VTK_OBJC_IS_ARC
+#if VTK_OBJC_IS_MRR
       [glView release];
 #endif
       }
@@ -888,7 +888,7 @@ void vtkCocoaRenderWindow::CreateAWindow()
   vtkCocoaServer *server = [[vtkCocoaServer alloc] initWithRenderWindow:this];
   this->SetCocoaServer(reinterpret_cast<void *>(server));
   [server startObservations];
-#if !VTK_OBJC_IS_ARC
+#if VTK_OBJC_IS_MRR
   [server release];
 #endif
 }
@@ -961,7 +961,7 @@ void vtkCocoaRenderWindow::CreateGLContext()
   [pixelFormat self]; // prevent premature collection under GC.
   [context self]; // prevent premature collection under GC.
 
-#if !VTK_OBJC_IS_ARC
+#if VTK_OBJC_IS_MRR
   [pixelFormat release];
   [context release];
 #endif
diff --git a/Rendering/OpenGL/vtkCocoaRenderWindowInteractor.mm b/Rendering/OpenGL/vtkCocoaRenderWindowInteractor.mm
index 8f89cd4..857167a 100644
--- a/Rendering/OpenGL/vtkCocoaRenderWindowInteractor.mm
+++ b/Rendering/OpenGL/vtkCocoaRenderWindowInteractor.mm
@@ -152,7 +152,7 @@ static vtkEarlyCocoaSetup * gEarlyCocoaSetup = new vtkEarlyCocoaSetup();
                                  selector:@selector(timerFired:)
                                  userInfo:nil
                                   repeats:repeating];
-#if !VTK_OBJC_IS_ARC
+#if VTK_OBJC_IS_MRR
   [_timer retain];
 #endif
 
@@ -165,7 +165,7 @@ static vtkEarlyCocoaSetup * gEarlyCocoaSetup = new vtkEarlyCocoaSetup();
 - (void)stopTimer
 {
   [_timer invalidate];
-#if !VTK_OBJC_IS_ARC
+#if VTK_OBJC_IS_MRR
   [_timer release];
 #endif
   _timer = nil;
@@ -343,7 +343,7 @@ int vtkCocoaRenderWindowInteractor::InternalCreateTimer(int timerId,
   [timerDict setObject:cocoaTimer forKey:timerIdAsStr];
   [cocoaTimer startTimerWithInterval:((NSTimeInterval)duration/1000.0)
                            repeating:repeating];
-#if !VTK_OBJC_IS_ARC
+#if VTK_OBJC_IS_MRR
   [cocoaTimer release];
 #endif
 
diff --git a/Rendering/OpenGL/vtkDataTransferHelper.h b/Rendering/OpenGL/vtkDataTransferHelper.h
index e932810..3244cf0 100644
--- a/Rendering/OpenGL/vtkDataTransferHelper.h
+++ b/Rendering/OpenGL/vtkDataTransferHelper.h
@@ -109,7 +109,7 @@ public:
   // A texture extent can have a given dimension 0D (one value), 1D, 2D or 3D.
   // By default 0D and 1D are translated into a 1D texture, 2D is translated
   // into a 2D texture, 3D is translated into a 3D texture. To make life easier
-  // when writing GLSL code and use only one type of sampler (ex: sampler2d),
+  // when writting GLSL code and use only one type of sampler (ex: sampler2d),
   // the default behavior can be changed by forcing a type of texture with
   // this ivar.
   // 1: default behavior. Initial value.
diff --git a/Rendering/OpenGL/vtkOSOpenGLRenderWindow.cxx b/Rendering/OpenGL/vtkOSOpenGLRenderWindow.cxx
index 99a4978..11f2938 100644
--- a/Rendering/OpenGL/vtkOSOpenGLRenderWindow.cxx
+++ b/Rendering/OpenGL/vtkOSOpenGLRenderWindow.cxx
@@ -159,8 +159,11 @@ void vtkOSOpenGLRenderWindow::DestroyWindow()
     }
 
 
-  delete[] this->Capabilities;
-  this->Capabilities = 0;
+  if (this->Capabilities)
+    {
+    delete[] this->Capabilities;
+    this->Capabilities = 0;
+    }
 
   this->DestroyOffScreenWindow();
 
diff --git a/Rendering/OpenGL/vtkOpenGLGlyph3DMapper.cxx b/Rendering/OpenGL/vtkOpenGLGlyph3DMapper.cxx
index a26a152..fb66fb4 100644
--- a/Rendering/OpenGL/vtkOpenGLGlyph3DMapper.cxx
+++ b/Rendering/OpenGL/vtkOpenGLGlyph3DMapper.cxx
@@ -240,8 +240,15 @@ void vtkOpenGLGlyph3DMapper::Render(vtkRenderer *ren, vtkActor *actor)
       {
       this->SourceMappers = new vtkOpenGLGlyph3DMapperArray();
       }
-    this->SourceMappers->Mappers.resize(
-      static_cast<size_t>(numberOfSources));
+    if (/*indexArray*/ true)
+      {
+      this->SourceMappers->Mappers.resize(
+        static_cast<size_t>(numberOfSources));
+      }
+    else
+      {
+      this->SourceMappers->Mappers.resize(1);
+      }
     for (size_t cc = 0; cc < this->SourceMappers->Mappers.size(); cc++)
       {
       vtkPolyData *s = this->GetSource(static_cast<int>(cc));
diff --git a/Rendering/OpenGL/vtkOpenGLImageMapper.cxx b/Rendering/OpenGL/vtkOpenGLImageMapper.cxx
index ed3e9d3..7d09baa 100644
--- a/Rendering/OpenGL/vtkOpenGLImageMapper.cxx
+++ b/Rendering/OpenGL/vtkOpenGLImageMapper.cxx
@@ -27,7 +27,6 @@
 #include "vtkOpenGL.h"
 #include "vtkOpenGLError.h"
 #include <climits>
-#include <cassert>
 
 vtkStandardNewMacro(vtkOpenGLImageMapper);
 
@@ -257,13 +256,11 @@ void vtkOpenGLImageMapperRenderShort(vtkOpenGLImageMapper *self, vtkImageData *d
   int bitShift = 0;
   double absScale = ((scale < 0) ? -scale : scale);
 
-  while ((1UL << bitShift)*absScale*2.0*USHRT_MAX < INT_MAX*1.0)
+  while ((static_cast<long>(1 << bitShift)*absScale)*2.0*USHRT_MAX < INT_MAX*1.0)
     {
     bitShift++;
     }
   bitShift--;
-  assert(bitShift >= 0);
-  assert(bitShift <= 30);
 
   long sscale = static_cast<long>(scale*(1 << bitShift));
   long sshift = static_cast<long>(sscale*shift);
diff --git a/Rendering/OpenGL/vtkOpenGLLabeledContourMapper.h b/Rendering/OpenGL/vtkOpenGLLabeledContourMapper.h
index 025c94b..331c4ac 100644
--- a/Rendering/OpenGL/vtkOpenGLLabeledContourMapper.h
+++ b/Rendering/OpenGL/vtkOpenGLLabeledContourMapper.h
@@ -17,8 +17,8 @@
 // vtkOpenGLLabeledContourMapper is an override for vtkLabeledContourMapper
 // that implements stenciling using the OpenGL API.
 
-#ifndef vtkOpenGLLabelContourMapper_h
-#define vtkOpenGLLabelContourMapper_h
+#ifndef __vtkOpenGLLabelContourMapper_h
+#define __vtkOpenGLLabelContourMapper_h
 
 #include "vtkRenderingOpenGLModule.h" // For export macro
 #include "vtkLabeledContourMapper.h"
@@ -40,6 +40,8 @@ protected:
 private:
   vtkOpenGLLabeledContourMapper(const vtkOpenGLLabeledContourMapper&);  // Not implemented.
   void operator=(const vtkOpenGLLabeledContourMapper&);  // Not implemented.
+
+  void DrawFullScreenQuad(vtkRenderer *ren);
 };
 
 #endif
diff --git a/Rendering/OpenGL/vtkOpenGLPainterDeviceAdapter.cxx b/Rendering/OpenGL/vtkOpenGLPainterDeviceAdapter.cxx
index 9407550..855b7c8 100644
--- a/Rendering/OpenGL/vtkOpenGLPainterDeviceAdapter.cxx
+++ b/Rendering/OpenGL/vtkOpenGLPainterDeviceAdapter.cxx
@@ -28,6 +28,9 @@
 #include "vtkObjectFactory.h"
 #include "vtkOpenGLGL2PSHelper.h"
 #include "vtkOpenGLRenderWindow.h"
+#ifndef VTK_LEGACY_REMOVE
+#include "vtkOpenGLExtensionManager.h"
+#endif
 #include "vtkRenderer.h"
 #include "vtkgl.h"
 
@@ -853,9 +856,102 @@ int vtkOpenGLPainterDeviceAdapter::Compatible(vtkRenderer *renderer)
     {
     return false;
     }
+#ifndef VTK_LEGACY_REMOVE
+  vtkOpenGLExtensionManager *manager = context->GetExtensionManager();
+  if (!manager->ExtensionSupported("GL_ARB_multisample"))
+    {
+    return false;
+    }
+#endif
   return true;
 }
 
+#ifndef VTK_LEGACY_REMOVE
+//-----------------------------------------------------------------------------
+void vtkOpenGLPainterDeviceAdapter::MakeLighting(int mode)
+{
+  VTK_LEGACY_BODY(vtkOpenGLPainterDeviceAdapter::MakeLighting, "VTK 6.1");
+  if (mode)
+    {
+    glEnable(GL_LIGHTING);
+    }
+  else
+    {
+    glDisable(GL_LIGHTING);
+    }
+}
+
+//-----------------------------------------------------------------------------
+int vtkOpenGLPainterDeviceAdapter::QueryLighting()
+{
+  VTK_LEGACY_BODY(vtkOpenGLPainterDeviceAdapter::QueryLighting, "VTK 6.1");
+  if (glIsEnabled(GL_LIGHTING))
+    {
+    return 1;
+    }
+  else
+    {
+    return 0;
+    }
+}
+
+//-----------------------------------------------------------------------------
+void vtkOpenGLPainterDeviceAdapter::MakeMultisampling(int mode)
+{
+  VTK_LEGACY_BODY(vtkOpenGLPainterDeviceAdapter::MakeMultisampling, "VTK 6.1");
+  if (mode)
+    {
+    glEnable(vtkgl::MULTISAMPLE);
+    }
+  else
+    {
+    glDisable(vtkgl::MULTISAMPLE);
+    }
+}
+
+//-----------------------------------------------------------------------------
+int vtkOpenGLPainterDeviceAdapter::QueryMultisampling()
+{
+  VTK_LEGACY_BODY(vtkOpenGLPainterDeviceAdapter::QueryMultisampling, "VTK 6.1");
+  if (glIsEnabled(vtkgl::MULTISAMPLE))
+    {
+    return 1;
+    }
+  else
+    {
+    return 0;
+    }
+}
+
+//-----------------------------------------------------------------------------
+void vtkOpenGLPainterDeviceAdapter::MakeBlending(int mode)
+{
+  VTK_LEGACY_BODY(vtkOpenGLPainterDeviceAdapter::MakeBlending, "VTK 6.1");
+  if (mode)
+    {
+    glEnable(GL_BLEND);
+    }
+  else
+    {
+    glDisable(GL_BLEND);
+    }
+}
+
+//-----------------------------------------------------------------------------
+int vtkOpenGLPainterDeviceAdapter::QueryBlending()
+{
+  VTK_LEGACY_BODY(vtkOpenGLPainterDeviceAdapter::QueryBlending, "VTK 6.1");
+  if (glIsEnabled(GL_BLEND))
+    {
+    return 1;
+    }
+  else
+    {
+    return 0;
+    }
+}
+#endif
+
 //-----------------------------------------------------------------------------
 void vtkOpenGLPainterDeviceAdapter::MakeVertexEmphasis(bool mode)
 {
diff --git a/Rendering/OpenGL/vtkOpenGLPainterDeviceAdapter.h b/Rendering/OpenGL/vtkOpenGLPainterDeviceAdapter.h
index 55782c3..989162f 100644
--- a/Rendering/OpenGL/vtkOpenGLPainterDeviceAdapter.h
+++ b/Rendering/OpenGL/vtkOpenGLPainterDeviceAdapter.h
@@ -105,6 +105,42 @@ public:
   virtual int Compatible(vtkRenderer *renderer);
 
   // Description:
+  // @deprecated code that needs access directly to OpenGL state should
+  // manage it locally.
+  // Turns lighting on and off.
+  VTK_LEGACY(virtual void MakeLighting(int mode));
+
+  // Description:
+  // @deprecated code that needs access directly to OpenGL state should
+  // manage it locally.
+  // Returns current lighting setting.
+  VTK_LEGACY(virtual int QueryLighting());
+
+  // Description:
+  // @deprecated code that needs access directly to OpenGL state should
+  // manage it locally.
+  // Turns antialiasing on and off.
+  VTK_LEGACY(virtual void MakeMultisampling(int mode));
+
+  // Description:
+  // @deprecated code that needs access directly to OpenGL state should
+  // manage it locally.
+  // Returns current antialiasing setting.
+  VTK_LEGACY(virtual int QueryMultisampling());
+
+  // Description:
+  // @deprecated code that needs access directly to OpenGL state should
+  // manage it locally.
+  // Turns blending on and off.
+  VTK_LEGACY(virtual void MakeBlending(int mode));
+
+  // Description:
+  // @deprecated code that needs access directly to OpenGL state should
+  // manage it locally.
+  // Returns current blending setting.
+  VTK_LEGACY(virtual int QueryBlending());
+
+  // Description:
   // Turns emphasis of vertices on or off for vertex selection.
   // When emphasized verts are drawn nearer to the camera and are drawn
   // larger than normal to make selection of them more reliable.
diff --git a/Rendering/OpenGL/vtkOpenGLRenderWindow.cxx b/Rendering/OpenGL/vtkOpenGLRenderWindow.cxx
index eeee06e..b82047e 100644
--- a/Rendering/OpenGL/vtkOpenGLRenderWindow.cxx
+++ b/Rendering/OpenGL/vtkOpenGLRenderWindow.cxx
@@ -83,6 +83,10 @@ vtkOpenGLRenderWindow::vtkOpenGLRenderWindow()
   this->BackBuffer=static_cast<unsigned int>(GL_BACK);
   this->FrontBuffer=static_cast<unsigned int>(GL_FRONT);
 
+#ifndef VTK_LEGACY_REMOVE
+  this->LastGraphicError=static_cast<unsigned int>(GL_NO_ERROR);
+#endif
+
   this->OwnContext=1;
 }
 
@@ -1600,15 +1604,6 @@ int vtkOpenGLRenderWindow::CreateHardwareOffScreenWindow(int width, int height)
   assert("pre: positive_height" && height>0);
   assert("pre: not_initialized" && !this->OffScreenUseFrameBuffer);
 
-  // This implementation currently ignores multisampling configurations:
-  if (this->MultiSamples > 1)
-    {
-    vtkDebugMacro(<<"Multisampling is not currently supported by the "
-                  "accelerated offscreen rendering backend. Falling back to "
-                  "a platform-specific offscreen solution...");
-    return 0;
-    }
-
   // 1. create a regular OpenGLcontext (ie create a window)
   this->CreateAWindow();
   this->MakeCurrent();
@@ -1895,6 +1890,69 @@ void vtkOpenGLRenderWindow::DestroyHardwareOffScreenWindow()
   assert("post: destroyed" && !this->OffScreenUseFrameBuffer);
 }
 
+#ifndef VTK_LEGACY_REMOVE
+//----------------------------------------------------------------------------
+void vtkOpenGLRenderWindow::CheckGraphicError()
+{
+  VTK_LEGACY_BODY(vtkRenderWindow::CheckGraphicError, "VTK 6.1");
+  this->LastGraphicError=static_cast<unsigned int>(glGetError());
+}
+
+//----------------------------------------------------------------------------
+int vtkOpenGLRenderWindow::HasGraphicError()
+{
+  VTK_LEGACY_BODY(vtkRenderWindow::HasGraphics, "VTK 6.1");
+  return static_cast<GLenum>(this->LastGraphicError)!=GL_NO_ERROR;
+}
+
+//----------------------------------------------------------------------------
+const char *vtkOpenGLRenderWindow::GetLastGraphicErrorString()
+{
+  VTK_LEGACY_BODY(vtkRenderWindow::GetLastGraphicErrorString, "VTK 6.1");
+  const char *result;
+  switch(static_cast<GLenum>(this->LastGraphicError))
+    {
+    case GL_NO_ERROR:
+      result="No error";
+      break;
+    case GL_INVALID_ENUM:
+      result="Invalid enum";
+      break;
+    case GL_INVALID_VALUE:
+      result="Invalid value";
+      break;
+    case GL_INVALID_OPERATION:
+      result="Invalid operation";
+      break;
+    case GL_STACK_OVERFLOW:
+      result="Stack overflow";
+      break;
+    case GL_STACK_UNDERFLOW:
+      result="Stack underflow";
+      break;
+    case GL_OUT_OF_MEMORY:
+      result="Out of memory";
+      break;
+    case vtkgl::TABLE_TOO_LARGE:
+      // GL_ARB_imaging
+      result="Table too large";
+      break;
+    case vtkgl::INVALID_FRAMEBUFFER_OPERATION_EXT:
+      // GL_EXT_framebuffer_object
+      result="Invalid framebuffer operation";
+      break;
+    case vtkgl::TEXTURE_TOO_LARGE_EXT:
+      // GL_EXT_texture
+      result="Texture too large";
+      break;
+    default:
+      result="Unknown error";
+      break;
+    }
+  return result;
+}
+#endif
+
 // ----------------------------------------------------------------------------
 // Description:
 // Returns the extension manager. A new one will be created if one hasn't
diff --git a/Rendering/OpenGL/vtkOpenGLRenderWindow.h b/Rendering/OpenGL/vtkOpenGLRenderWindow.h
index 57c242a..968af84 100644
--- a/Rendering/OpenGL/vtkOpenGLRenderWindow.h
+++ b/Rendering/OpenGL/vtkOpenGLRenderWindow.h
@@ -160,6 +160,13 @@ public:
   unsigned int GetFrontBuffer();
 
   // Description:
+  // @deprecated Replaced by
+  // vtkOpenGLCheckErrorMacro
+  VTK_LEGACY(virtual void CheckGraphicError());
+  VTK_LEGACY(virtual int HasGraphicError());
+  VTK_LEGACY(virtual const char *GetLastGraphicErrorString());
+
+  // Description:
   // Get the time when the OpenGL context was created.
   virtual unsigned long GetContextCreationTime();
 
@@ -243,6 +250,13 @@ protected:
   unsigned int FrontBuffer;
   unsigned int BackBuffer;
 
+#ifndef VTK_LEGACY_REMOVE
+  // Description:
+  // @deprecated Replaced by
+  // vtkOpenGLCheckErrorMacro
+  unsigned int LastGraphicError;
+#endif
+
   // Description:
   // Flag telling if the context has been created here or was inherited.
   int OwnContext;
diff --git a/Rendering/OpenGL/vtkOpenGLRenderer.cxx b/Rendering/OpenGL/vtkOpenGLRenderer.cxx
index 47463cc..6075928 100644
--- a/Rendering/OpenGL/vtkOpenGLRenderer.cxx
+++ b/Rendering/OpenGL/vtkOpenGLRenderer.cxx
@@ -1214,7 +1214,11 @@ void vtkOpenGLRenderer::StartPick(unsigned int pickFromSize)
   // a MakeCurrent was called.
   this->RenderWindow->MakeCurrent();
   this->RenderWindow->IsPickingOn();
-  delete [] this->PickInfo->PickBuffer;
+  if (this->PickInfo->PickBuffer)
+    {
+    delete [] this->PickInfo->PickBuffer;
+    this->PickInfo->PickBuffer = 0;
+    }
   this->PickInfo->PickBuffer = new GLuint[bufferSize];
   glSelectBuffer(bufferSize, this->PickInfo->PickBuffer);
   // change to selection mode
@@ -1338,8 +1342,11 @@ unsigned int vtkOpenGLRenderer::GetPickedId()
 
 vtkOpenGLRenderer::~vtkOpenGLRenderer()
 {
-  delete [] this->PickInfo->PickBuffer;
-  this->PickInfo->PickBuffer = 0;
+  if (this->PickInfo->PickBuffer)
+    {
+    delete [] this->PickInfo->PickBuffer;
+    this->PickInfo->PickBuffer = 0;
+    }
   delete this->PickInfo;
 
   if(this->ShaderProgram!=0)
diff --git a/Rendering/OpenGL/vtkOpenGLState.cxx b/Rendering/OpenGL/vtkOpenGLState.cxx
index 8cc63d1..1921dbc 100644
--- a/Rendering/OpenGL/vtkOpenGLState.cxx
+++ b/Rendering/OpenGL/vtkOpenGLState.cxx
@@ -268,9 +268,16 @@ void vtkOpenGLState::Update()
   // framebuffer control
   glGetIntegerv(vtkgl::MAX_DRAW_BUFFERS, &this->MaxDrawBuffers);
 
-  delete this->DrawBuffers;
-  this->DrawBuffers = new std::vector<GLint>(
-    static_cast<size_t>(this->MaxDrawBuffers));
+  if (this->DrawBuffers !=0)
+    {
+    delete this->DrawBuffers;
+    this->DrawBuffers = 0;
+    }
+  if (this->DrawBuffers == 0)
+    {
+    this->DrawBuffers = new std::vector<GLint>(
+      static_cast<size_t>(this->MaxDrawBuffers));
+    }
   i = 0;
   while (i < static_cast<size_t>(this->MaxDrawBuffers))
     {
@@ -431,8 +438,11 @@ void vtkOpenGLState::UpdateCurrentProgram()
 {
   GLint ivalues[4];
 
-  delete this->CurrentProgramState;
-  this->CurrentProgramState=0;
+  if (this->CurrentProgramState!=0)
+    {
+    delete this->CurrentProgramState;
+    this->CurrentProgramState=0;
+    }
 
   glGetIntegerv(vtkgl::CURRENT_PROGRAM, ivalues);
   this->CurrentProgram=static_cast<GLuint>(ivalues[0]);
diff --git a/Rendering/OpenGL/vtkShadowMapBakerPass.cxx b/Rendering/OpenGL/vtkShadowMapBakerPass.cxx
index e5e846c..c9672b8 100644
--- a/Rendering/OpenGL/vtkShadowMapBakerPass.cxx
+++ b/Rendering/OpenGL/vtkShadowMapBakerPass.cxx
@@ -395,8 +395,10 @@ void vtkShadowMapBakerPass::Render(const vtkRenderState *s)
           }
         }
 #endif
-      delete[] propArray;
-
+      if(propArray!=0)
+        {
+        delete[] propArray;
+        }
       // Nothing to bake.
       return;
       }
@@ -776,9 +778,15 @@ void vtkShadowMapBakerPass::ReleaseGraphicsResources(vtkWindow *w)
     this->FrameBufferObject=0;
     }
 
-  delete this->ShadowMaps;
-  this->ShadowMaps=0;
+  if(this->ShadowMaps!=0)
+    {
+    delete this->ShadowMaps;
+    this->ShadowMaps=0;
+    }
 
-  delete this->LightCameras;
-  this->LightCameras=0;
+  if(this->LightCameras!=0)
+    {
+    delete this->LightCameras;
+    this->LightCameras=0;
+    }
 }
diff --git a/Rendering/OpenGL/vtkTDxMacDevice.cxx b/Rendering/OpenGL/vtkTDxMacDevice.cxx
index e4b0c0d..6d56b9a 100644
--- a/Rendering/OpenGL/vtkTDxMacDevice.cxx
+++ b/Rendering/OpenGL/vtkTDxMacDevice.cxx
@@ -84,7 +84,7 @@ void vtkTDxMacDevice::Initialize()
   assert("pre: not_yet_initialized" && !this->GetInitialized());
   assert("pre: valid_name" && this->GetClientApplicationName()!=0);
 
-  if(vtkClientIDToDeviceObject.empty())
+  if(vtkClientIDToDeviceObject.size()==0)
     {
     OSErr result=InstallConnexionHandlers(vtkTDxMacDeviceMessageHandler,0L,0L);
     this->Initialized=result==noErr; // 0
@@ -141,7 +141,7 @@ void vtkTDxMacDevice::Close()
     }
 
   // only if the map is empty.
-  if(vtkClientIDToDeviceObject.empty())
+  if(vtkClientIDToDeviceObject.size()==0)
     {
     CleanupConnexionHandlers();
     }
diff --git a/Rendering/OpenGL/vtkTDxWinDevice.cxx b/Rendering/OpenGL/vtkTDxWinDevice.cxx
index 293c439..ac98555 100644
--- a/Rendering/OpenGL/vtkTDxWinDevice.cxx
+++ b/Rendering/OpenGL/vtkTDxWinDevice.cxx
@@ -205,7 +205,7 @@ void vtkTDxWinDevice::Initialize()
   HRESULT hr=0;
   CComPtr<IUnknown> device;
 
-  bool alreadyConnected=!vtkWindowHandleToDeviceObjectConnection.empty();
+  bool alreadyConnected=vtkWindowHandleToDeviceObjectConnection.size()!=0;
 
   if(alreadyConnected)
     {
@@ -305,10 +305,8 @@ void vtkTDxWinDevice::StopListening()
   assert("pre: initialized" && this->GetInitialized());
   assert("pre: is_listening" && this->GetIsListening());
 
-  const UINT_PTR uIDEvent = this->WindowHandle != 0 ?
-    VTK_IDT_TDX_TIMER : this->Private->TimerId;
   // Kill the timer used to poll the sensor and keyboard
-  ::KillTimer(this->WindowHandle, uIDEvent);
+  ::KillTimer(this->WindowHandle,VTK_IDT_TDX_TIMER);
   this->Private->TimerId=0;
   this->IsListening=false;
 
@@ -356,7 +354,7 @@ void vtkTDxWinDevice::Close()
     vtkWindowHandleToDeviceObjectConnection.erase(it);
     }
 
-  if(vtkWindowHandleToDeviceObjectConnection.empty())
+  if(vtkWindowHandleToDeviceObjectConnection.size()==0)
     {
       // Release the sensor and keyboard interfaces
       vtkTDxWinDevicePrivate *o=this->Private;
diff --git a/Rendering/OpenGL/vtkUniformVariables.cxx b/Rendering/OpenGL/vtkUniformVariables.cxx
index 2e21dd0..75b8f42 100644
--- a/Rendering/OpenGL/vtkUniformVariables.cxx
+++ b/Rendering/OpenGL/vtkUniformVariables.cxx
@@ -73,7 +73,10 @@ public:
         {
         return;
         }
-      delete[] this->Name;
+      if(this->Name!=0)
+        {
+        delete[] this->Name;
+        }
       if(n!=0) // copy
         {
          size_t l=strlen(n)+1;
@@ -88,7 +91,10 @@ public:
 
   virtual ~vtkUniform()
     {
-      delete[] Name;
+      if(this->Name!=0)
+        {
+        delete[] Name;
+        }
     }
 
   virtual void Send(int location)=0;
@@ -682,7 +688,10 @@ public:
       while(i!=e)
         {
         vtkUniform *u=(*i).second;
-        delete u;
+        if(u!=0)
+          {
+          delete u;
+          }
         ++i;
         }
     }
diff --git a/Rendering/OpenGL/vtkValuePainter.cxx b/Rendering/OpenGL/vtkValuePainter.cxx
index e9096bf..8a4e031 100644
--- a/Rendering/OpenGL/vtkValuePainter.cxx
+++ b/Rendering/OpenGL/vtkValuePainter.cxx
@@ -309,7 +309,6 @@ void vtkValuePainter::RenderInternal(
   int oldBlend = glIsEnabled(GL_BLEND);
   glDisable(GL_LIGHTING);
   glDisable(GL_BLEND);
-  glColor4f(1,1,1,1);
 
   vtkPolyData* pd = this->GetInputAsPolyData();
 
diff --git a/Rendering/OpenGL/vtkWin32OpenGLRenderWindow.cxx b/Rendering/OpenGL/vtkWin32OpenGLRenderWindow.cxx
index 74e63b3..aebfa2b 100644
--- a/Rendering/OpenGL/vtkWin32OpenGLRenderWindow.cxx
+++ b/Rendering/OpenGL/vtkWin32OpenGLRenderWindow.cxx
@@ -1097,6 +1097,9 @@ void vtkWin32OpenGLRenderWindow::WindowInitialize()
     this->MakeCurrent();
     this->OpenGLInit();
     }
+
+  // set the DPI
+  this->SetDPI(GetDeviceCaps(this->DeviceContext, LOGPIXELSY));
 }
 
 // Initialize the rendering window.
@@ -1736,10 +1739,3 @@ void vtkWin32OpenGLRenderWindow::SetCurrentCursor(int shape)
     SetCursor((HCURSOR)cursor);
     }
 }
-
-//----------------------------------------------------------------------------
-bool vtkWin32OpenGLRenderWindow::DetectDPI()
-{
-  this->SetDPI(GetDeviceCaps(this->DeviceContext, LOGPIXELSY));
-  return true;
-}
diff --git a/Rendering/OpenGL/vtkWin32OpenGLRenderWindow.h b/Rendering/OpenGL/vtkWin32OpenGLRenderWindow.h
index 5186fad..6bb24fd 100644
--- a/Rendering/OpenGL/vtkWin32OpenGLRenderWindow.h
+++ b/Rendering/OpenGL/vtkWin32OpenGLRenderWindow.h
@@ -222,8 +222,6 @@ public:
   // Change the shape of the cursor
   virtual void SetCurrentCursor(int);
 
-  virtual bool DetectDPI();
-
   // Description:
   // Override the default implementation so that we can actively switch between
   // on and off screen rendering.
diff --git a/Rendering/OpenGL/vtkXOpenGLRenderWindow.cxx b/Rendering/OpenGL/vtkXOpenGLRenderWindow.cxx
index 6ce14b2..7bd9f0e 100644
--- a/Rendering/OpenGL/vtkXOpenGLRenderWindow.cxx
+++ b/Rendering/OpenGL/vtkXOpenGLRenderWindow.cxx
@@ -26,15 +26,7 @@
 
 // Define GLX_GLXEXT_LEGACY to prevent glx.h from including the glxext.h
 // provided by the system.
-//#define GLX_GLXEXT_LEGACY
-
-// New Workaround:
-// The GLX_GLXEXT_LEGACY definition was added to work around system glxext.h
-// files that used the GLintptr and GLsizeiptr types, but did not define them.
-// However, this broke multisampling (See PR#15433). Instead of using that
-// define, we're just defining the missing typedefs here.
-typedef ptrdiff_t GLintptr;
-typedef ptrdiff_t GLsizeiptr;
+#define GLX_GLXEXT_LEGACY
 #include "GL/glx.h"
 
 #include "vtkgl.h"
@@ -164,7 +156,6 @@ vtkglX::GLXFBConfig* vtkXOpenGLRenderWindowTryForFBConfig(Display *DisplayId,
   if (doublebuff)
     {
     attributes[index++] = GLX_DOUBLEBUFFER;
-    attributes[index++] = True;
     }
   if (stencil)
     {
@@ -175,7 +166,6 @@ vtkglX::GLXFBConfig* vtkXOpenGLRenderWindowTryForFBConfig(Display *DisplayId,
     {
     // also try for STEREO
     attributes[index++] = GLX_STEREO;
-    attributes[index++] = True;
     }
   if (multisamples)
     {
@@ -223,7 +213,6 @@ XVisualInfo *vtkXOpenGLRenderWindowTryForVisual(Display *DisplayId,
   if (doublebuff)
     {
     attributes[index++] = GLX_DOUBLEBUFFER;
-    attributes[index++] = True;
     }
   if (stencil)
     {
@@ -234,7 +223,6 @@ XVisualInfo *vtkXOpenGLRenderWindowTryForVisual(Display *DisplayId,
     {
     // also try for STEREO
     attributes[index++] = GLX_STEREO;
-    attributes[index++] = True;
     }
   if (multisamples)
     {
@@ -798,8 +786,11 @@ void vtkXOpenGLRenderWindow::DestroyWindow()
     this->DisplayId = NULL;
     }
 
-  delete[] this->Capabilities;
-  this->Capabilities = 0;
+  if (this->Capabilities)
+    {
+    delete[] this->Capabilities;
+    this->Capabilities = 0;
+    }
 
   // make sure all other code knows we're not mapped anymore
   this->Mapped = 0;
diff --git a/Rendering/OpenGL/vtkXRenderWindowTclInteractor.cxx b/Rendering/OpenGL/vtkXRenderWindowTclInteractor.cxx
index 7c07729..7a4538d 100644
--- a/Rendering/OpenGL/vtkXRenderWindowTclInteractor.cxx
+++ b/Rendering/OpenGL/vtkXRenderWindowTclInteractor.cxx
@@ -244,7 +244,7 @@ void vtkXRenderWindowTclInteractor::Enable()
                ButtonPressMask | ButtonReleaseMask |
                ExposureMask | StructureNotifyMask |
                EnterWindowMask | LeaveWindowMask |
-               PointerMotionMask);
+               PointerMotionMask | PointerMotionMask);
 
   // Setup for capturing the window deletion
   this->KillAtom = XInternAtom(this->DisplayId,"WM_DELETE_WINDOW",False);
diff --git a/Rendering/OpenGL2/CMakeLists.txt b/Rendering/OpenGL2/CMakeLists.txt
index 5cde4f9..12ba644 100644
--- a/Rendering/OpenGL2/CMakeLists.txt
+++ b/Rendering/OpenGL2/CMakeLists.txt
@@ -27,38 +27,30 @@ set(Module_SRCS
   vtkDepthPeelingPass.cxx
   vtkGaussianBlurPass.cxx
   vtkGenericCompositePolyDataMapper2.cxx
-  vtkGenericOpenGLRenderWindow.cxx
   vtkImageProcessingPass.cxx
   vtkLightsPass.cxx
   vtkOpaquePass.cxx
   vtkOpenGLActor.cxx
-  vtkOpenGLBufferObject.cxx
   vtkOpenGLCamera.cxx
   vtkOpenGLGlyph3DHelper.cxx
   vtkOpenGLGlyph3DMapper.cxx
   vtkOpenGLHardwareSelector.cxx
-  vtkOpenGLHelper.cxx
   vtkOpenGLImageMapper.cxx
   vtkOpenGLImageSliceMapper.cxx
-  vtkOpenGLIndexBufferObject.cxx
-  vtkOpenGLLabeledContourMapper.cxx
   vtkOpenGLLight.cxx
   vtkOpenGLPointGaussianMapper.cxx
   vtkOpenGLPolyDataMapper.cxx
   vtkOpenGLPolyDataMapper2D.cxx
   vtkOpenGLProperty.cxx
   vtkOpenGLRenderWindow.cxx
-  vtkOpenGLRenderUtilities.cxx
   vtkOpenGLRenderer.cxx
   vtkOpenGLShaderCache.cxx
   vtkOpenGLTexture.cxx
-  vtkOpenGLVertexArrayObject.cxx
-  vtkOpenGLVertexBufferObject.cxx
   vtkOverlayPass.cxx
   vtkRenderPass.cxx
+  vtkRenderStepsPass.cxx
   vtkRenderPassCollection.cxx
   vtkRenderState.cxx
-  vtkRenderStepsPass.cxx
   vtkSequencePass.cxx
   vtkShader.cxx
   vtkShaderProgram.cxx
@@ -67,22 +59,20 @@ set(Module_SRCS
   vtkTextureUnitManager.cxx
   vtkTranslucentPass.cxx
   vtkVolumetricPass.cxx
+  vtkglBufferObject.cxx
+  vtkglVBOHelper.cxx
+  vtkglVertexArrayObject.cxx
   )
 
 if (NOT DEFINED OPENGL_ES_VERSION)
   set(Module_SRCS ${Module_SRCS}
-    vtkDataTransferHelper.cxx
     vtkFrameBufferObject.cxx
-    vtkFrameBufferObject2.cxx
     vtkPixelBufferObject.cxx
-    vtkRenderbuffer.cxx
     )
 else()
   if (${OPENGL_ES_VERSION} MATCHES 3.0)
     set(Module_SRCS ${Module_SRCS}
       vtkFrameBufferObject.cxx
-      vtkFrameBufferObject2.cxx
-      vtkRenderbuffer.cxx
       )
   endif()
 endif()
@@ -95,21 +85,19 @@ set(${vtk-module}_HDRS
   )
 
 set_source_files_properties(
-  ${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.cxx
+  vtkglBufferObject
+  vtkglVBOHelper
+  vtkglVertexArrayObject
   vtkFrameBufferObject
-  vtkOpenGLBufferObject
   vtkOpenGLGlyph3DHelper
   vtkOpenGLGlyph3DMapper
-  vtkOpenGLHelper
-  vtkOpenGLIndexBufferObject
   vtkOpenGLShaderCache
-  vtkOpenGLVertexArrayObject
-  vtkOpenGLVertexBufferObject
   vtkPixelBufferObject
-  vtkRenderState
   vtkRenderbuffer
+  vtkRenderState
   vtkTextureObject
   vtkTextureUnitManager
+  ${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.cxx
   WRAP_EXCLUDE)
 
 set_source_files_properties(
@@ -129,12 +117,15 @@ set(shader_files
   glsl/vtkPointGaussianVS.glsl
   glsl/vtkTextureObjectFS.glsl
   glsl/vtkTextureObjectVS.glsl
-  glsl/vtkGlyph3DVS.glsl
-  glsl/vtkPolyData2DFS.glsl
-  glsl/vtkPolyData2DVS.glsl
-  glsl/vtkPolyDataFS.glsl
-  glsl/vtkPolyDataWideLineGS.glsl
-  glsl/vtkPolyDataVS.glsl
+  glsl/vtkglGlyph3DVSFragmentLit.glsl
+  glsl/vtkglPolyData2DFS.glsl
+  glsl/vtkglPolyData2DVS.glsl
+  glsl/vtkglPolyDataFSHeadlight.glsl
+  glsl/vtkglPolyDataFSLightKit.glsl
+  glsl/vtkglPolyDataFSNoLighting.glsl
+  glsl/vtkglPolyDataFSPositionalLights.glsl
+  glsl/vtkglPolyDataVSFragmentLit.glsl
+  glsl/vtkglPolyDataVSNoLighting.glsl
   )
 unset(shader_h_files)
 foreach(file ${shader_files})
@@ -179,7 +170,6 @@ endif()
 set(opengl_overrides
   Actor
   Camera
-  LabeledContourMapper
   HardwareSelector
   ImageMapper
   ImageSliceMapper
@@ -211,11 +201,11 @@ if(VTK_USE_X)
   include_directories(${X11_INCLUDE_DIR} ${X11_Xt_INCLUDE_PATH})
   # Add some custom overrides
   list(APPEND vtk_module_overrides "vtkRenderWindowInteractor")
-  set(vtk_module_vtkRenderWindowInteractor_override "vtkXRenderWindowInteractor")
+  set(vtk_module_vtkRenderWindowInteractor_override "vtkXOpenGLRenderWindowInteractor")
   list(APPEND vtk_module_overrides "vtkRenderWindow")
   set(vtk_module_vtkRenderWindow_override "vtkXOpenGLRenderWindow")
   list(APPEND Module_SRCS
-    vtkXRenderWindowInteractor.cxx
+    vtkXOpenGLRenderWindowInteractor.cxx
     vtkXOpenGLRenderWindow.cxx
     )
 elseif(VTK_USE_OSMESA)
@@ -231,11 +221,11 @@ elseif(VTK_USE_OSMESA)
 elseif(WIN32)
   # Add some custom overrides
   list(APPEND vtk_module_overrides "vtkRenderWindowInteractor")
-  set(vtk_module_vtkRenderWindowInteractor_override "vtkWin32RenderWindowInteractor")
+  set(vtk_module_vtkRenderWindowInteractor_override "vtkWin32OpenGLRenderWindowInteractor")
   list(APPEND vtk_module_overrides "vtkRenderWindow")
   set(vtk_module_vtkRenderWindow_override "vtkWin32OpenGLRenderWindow")
   list(APPEND Module_SRCS
-    vtkWin32RenderWindowInteractor.cxx
+    vtkWin32OpenGLRenderWindowInteractor.cxx
     vtkWin32OpenGLRenderWindow.cxx
     )
 elseif(VTK_USE_COCOA)
@@ -307,10 +297,7 @@ vtk_object_factory_configure("${vtk_module_overrides}")
 # Detect and clear OpenGL errors. If not then other classes/user code
 # may detect VTK's OpenGL errors and vice-versa.
 set(VTK_REPORT_OPENGL_ERRORS ON CACHE BOOL "Enable OpenGL error check and report")
-cmake_dependent_option(VTK_REPORT_OPENGL_ERRORS_IN_RELEASE_BUILDS
-  "Enable OpenGL error check and reporting in non-debug builds." OFF
-  VTK_REPORT_OPENGL_ERRORS OFF)
-mark_as_advanced(VTK_REPORT_OPENGL_ERRORS VTK_REPORT_OPENGL_ERRORS_IN_RELEASE_BUILDS)
+mark_as_advanced(VTK_REPORT_OPENGL_ERRORS)
 configure_file(
     ${CMAKE_CURRENT_SOURCE_DIR}/vtkOpenGLError.h.in
     ${CMAKE_CURRENT_BINARY_DIR}/vtkOpenGLError.h)
diff --git a/Rendering/OpenGL2/Testing/Cxx/TestPointGaussianMapper.cxx b/Rendering/OpenGL2/Testing/Cxx/TestPointGaussianMapper.cxx
index b30dbaf..530f7db 100644
--- a/Rendering/OpenGL2/Testing/Cxx/TestPointGaussianMapper.cxx
+++ b/Rendering/OpenGL2/Testing/Cxx/TestPointGaussianMapper.cxx
@@ -30,6 +30,7 @@
 
 
 #include "vtkActor.h"
+#include "vtkBrownianPoints.h"
 #include "vtkCamera.h"
 #include "vtkProperty.h"
 #include "vtkPointGaussianMapper.h"
@@ -49,72 +50,28 @@
 #include "vtkTestUtilities.h"
 #include "vtkRegressionTestImage.h"
 
-#include "vtkPolyDataReader.h"
-
-//#define TestPoints
-//#define TestFile
-#define TestSplats
-
 int TestPointGaussianMapper(int argc, char *argv[])
 {
   int desiredPoints = 1.0e4;
 
   vtkNew<vtkPointSource> points;
   points->SetNumberOfPoints(desiredPoints);
-  points->SetRadius(pow(desiredPoints,0.33)*20.0);
-  points->Update();
-
-  vtkNew<vtkRandomAttributeGenerator> randomAttr;
-  randomAttr->SetInputConnection(points->GetOutputPort());
-
-  vtkNew<vtkPointGaussianMapper> mapper;
-
-  vtkNew<vtkRenderer> renderer;
-  renderer->SetBackground(0.0, 0.0, 0.0);
-  vtkNew<vtkRenderWindow> renderWindow;
-  renderWindow->SetSize(300, 300);
-  renderWindow->SetMultiSamples(0);
-  renderWindow->AddRenderer(renderer.Get());
-  vtkNew<vtkRenderWindowInteractor>  iren;
-  iren->SetRenderWindow(renderWindow.Get());
-
-  vtkNew<vtkActor> actor;
-  actor->SetMapper(mapper.Get());
-  renderer->AddActor(actor.Get());
-
-#ifdef TestPoints
-  randomAttr->SetDataTypeToUnsignedChar();
-  randomAttr->GeneratePointVectorsOn();
-  randomAttr->SetMinimumComponentValue(0);
-  randomAttr->SetMaximumComponentValue(255);
-  randomAttr->Update();
-  mapper->SetInputConnection(randomAttr->GetOutputPort());
-  mapper->SelectColorArray("RandomPointVectors");
-  mapper->SetScalarModeToUsePointFieldData();
-  mapper->SetDefaultRadius(0.0);
-  mapper->EmissiveOff();
-#endif
-
-#ifdef TestFile
-  vtkNew<vtkPolyDataReader> reader;
-  reader->SetFileName("filename");
-  reader->Update();
-
-  mapper->SetInputConnection(reader->GetOutputPort());
-  mapper->SelectColorArray("Color");
-  mapper->SetScalarModeToUsePointFieldData();
-  mapper->SetDefaultRadius(0.0);
-  mapper->EmissiveOff();
+  points->SetRadius(pow(desiredPoints,0.33)*5.0);
 
-  //actor->GetProperty()->SetPointSize(3.0);
-#endif
+  vtkNew<vtkBrownianPoints> randomVector;
+  randomVector->SetMinimumSpeed(0);
+  randomVector->SetMaximumSpeed(1);
+  randomVector->SetInputConnection(points->GetOutputPort());
 
-#ifdef TestSplats
+  vtkNew<vtkRandomAttributeGenerator> randomAttr;
   randomAttr->SetDataTypeToFloat();
   randomAttr->GeneratePointScalarsOn();
   randomAttr->GeneratePointVectorsOn();
+  randomAttr->SetInputConnection(randomVector->GetOutputPort());
+
   randomAttr->Update();
 
+  vtkNew<vtkPointGaussianMapper> mapper;
   mapper->SetInputConnection(randomAttr->GetOutputPort());
   mapper->SetColorModeToMapScalars();
   mapper->SetScalarModeToUsePointFieldData();
@@ -124,10 +81,22 @@ int TestPointGaussianMapper(int argc, char *argv[])
 
   vtkNew<vtkColorTransferFunction> ctf;
   ctf->AddHSVPoint(0.0,0.1,1.0,0.8);
+ // ctf->AddHSVPoint(0.2,0.2,0.0,1.0);
+ // ctf->AddHSVPoint(0.7,0.6,0.0,1.0);
   ctf->AddHSVPoint(1.0,0.2,0.5,1.0);
   ctf->SetColorSpaceToRGB();
   mapper->SetLookupTable(ctf.Get());
-#endif
+
+  vtkNew<vtkActor> actor;
+  actor->SetMapper(mapper.Get());
+  vtkNew<vtkRenderer> renderer;
+  renderer->SetBackground(0.0, 0.0, 0.0);
+  vtkNew<vtkRenderWindow> renderWindow;
+  renderWindow->SetSize(900, 900);
+  renderWindow->AddRenderer(renderer.Get());
+  renderer->AddActor(actor.Get());
+  vtkNew<vtkRenderWindowInteractor>  iren;
+  iren->SetRenderWindow(renderWindow.Get());
 
   vtkNew<vtkTimerLog> timer;
   timer->StartTimer();
@@ -146,18 +115,16 @@ int TestPointGaussianMapper(int argc, char *argv[])
     }
   timer->StopTimer();
   double elapsed = timer->GetElapsedTime();
-
-  int numPts = mapper->GetInput()->GetPoints()->GetNumberOfPoints();
   cerr << "interactive render time: " << elapsed / numRenders << endl;
-  cerr << "number of points: " <<  numPts << endl;
-  cerr << "points per second: " <<  numPts*(numRenders/elapsed) << endl;
+  cerr << "number of points: " <<  desiredPoints << endl;
+  cerr << "points per second: " <<  desiredPoints*(numRenders/elapsed) << endl;
 
   renderer->GetActiveCamera()->SetPosition(0,0,1);
   renderer->GetActiveCamera()->SetFocalPoint(0,0,0);
   renderer->GetActiveCamera()->SetViewUp(0,1,0);
   renderer->ResetCamera();
-  //  renderer->GetActiveCamera()->Print(cerr);
 
+  renderWindow->SetSize(300, 300);
   renderer->GetActiveCamera()->Zoom(10.0);
   renderWindow->Render();
 
@@ -167,5 +134,5 @@ int TestPointGaussianMapper(int argc, char *argv[])
     iren->Start();
     }
 
-  return !retVal;
+  return EXIT_SUCCESS;
 }
diff --git a/Rendering/OpenGL2/Testing/Cxx/TestVBOPLYMapper.cxx b/Rendering/OpenGL2/Testing/Cxx/TestVBOPLYMapper.cxx
index f7520ba..39c2fc3 100644
--- a/Rendering/OpenGL2/Testing/Cxx/TestVBOPLYMapper.cxx
+++ b/Rendering/OpenGL2/Testing/Cxx/TestVBOPLYMapper.cxx
@@ -80,11 +80,11 @@ int TestVBOPLYMapper(int argc, char *argv[])
   cerr << "first render time: " << firstRender << endl;
 
   timer->StartTimer();
-  int numRenders = 8;
+  int numRenders = 85;
   for (int i = 0; i < numRenders; ++i)
     {
-    renderer->GetActiveCamera()->Azimuth(10);
-    renderer->GetActiveCamera()->Elevation(10);
+    renderer->GetActiveCamera()->Azimuth(1);
+    renderer->GetActiveCamera()->Elevation(1);
     renderWindow->Render();
     }
   timer->StopTimer();
diff --git a/Rendering/OpenGL2/Testing/Data/Baseline/TestPointGaussianMapper.png.md5 b/Rendering/OpenGL2/Testing/Data/Baseline/TestPointGaussianMapper.png.md5
index a779a65..ef501da 100644
--- a/Rendering/OpenGL2/Testing/Data/Baseline/TestPointGaussianMapper.png.md5
+++ b/Rendering/OpenGL2/Testing/Data/Baseline/TestPointGaussianMapper.png.md5
@@ -1 +1 @@
-7289527bd2b777a40b853cdfdf8bc826
+71f5af0ed95b703b72ea17c2a471a962
diff --git a/Rendering/OpenGL2/glsl/readme.txt b/Rendering/OpenGL2/glsl/readme.txt
deleted file mode 100644
index 89c4098..0000000
--- a/Rendering/OpenGL2/glsl/readme.txt
+++ /dev/null
@@ -1,49 +0,0 @@
-VTK uses shaders to perform its OpenGL rendering.  VTK supports many different
-options when it comes to rendering, resulting in potentially thousands of
-possible combinations. While we could make one giant shader that uses defines or
-uniforms to switch between all these possibilities it would be limiting. Instead
-we build up the shader using string replacements on the fly, and then cache the
-results for performance.
-
-When writing your own shaders you can use any approach you want. In the end they
-are just strings of code. For vtkOpenGLPolyDataMapper we make use of heavy
-string replacments.  In other classes we do very little processing as the shader
-has far fewer options. Regardless there are a few conventions you should be
-aware of.
-
-For shader replacements we tend to use a form of
-
-//VTK::SomeConcept::SomeAction
-
-For example
-
-//VTK::Normal::Dec  - declaration any uniforms/varying needed for normals
-//VTK::Normal::Impl - Implementation of shader code for handling normals
-
-All shaders should start with the folowing line
-
-//VTK::System::Dec
-
-Which vtkOpenGLShaderCache will replace with a #version and some other values to
-match the system and OpenGL Context it has. The other line you need (only in
-your fragment shader) is
-
-//VTK::Output::Dec
-
-which VTK uses to map shader outputs to the framebufer.
-
-All vertex shaders should name their outputs with a postfix of VSOutput All
-geometry shaders should name their outputs with a postfix of GSOutput All
-fragment shaders shoudl name their inputs with a postfix of VSOutput.  Put
-another way fragment shaders should assuming their input is coming from the
-vertex shader.  If a geometry shader is present VTK will rename the fragment
-shader inputs from VSOutput to GSOuput automatically.
-
-All variables that represent positions or directions usually have a suffix
-indicating the coordinate system they are in. The possible values are
-
-MC  - Model Coordinates
-WC  - WC world coordinates
-VC  - View Coordinates
-DC  - Display Coordinates
-NVC - NormalizeViewCoordinates
diff --git a/Rendering/OpenGL2/glsl/vtkDepthPeelingPassFinalFS.glsl b/Rendering/OpenGL2/glsl/vtkDepthPeelingPassFinalFS.glsl
index 2ef2114..efec7c4 100644
--- a/Rendering/OpenGL2/glsl/vtkDepthPeelingPassFinalFS.glsl
+++ b/Rendering/OpenGL2/glsl/vtkDepthPeelingPassFinalFS.glsl
@@ -22,13 +22,10 @@ varying vec2 tcoordVC;
 uniform sampler2D translucentRGBATexture;
 uniform sampler2D opaqueRGBATexture;
 
-// the output of this shader
-//VTK::Output::Dec
-
 void main()
 {
   vec4 t1Color = texture2D(translucentRGBATexture, tcoordVC);
   vec4 t2Color = texture2D(opaqueRGBATexture, tcoordVC);
-  gl_FragData[0].a = 1.0;
-  gl_FragData[0].rgb = (t1Color.rgb*t1Color.a + t2Color.rgb*(1.0-t1Color.a));
+  gl_FragColor.a = 1.0;
+  gl_FragColor.rgb = (t1Color.rgb*t1Color.a + t2Color.rgb*(1.0-t1Color.a));
 }
diff --git a/Rendering/OpenGL2/glsl/vtkDepthPeelingPassIntermediateFS.glsl b/Rendering/OpenGL2/glsl/vtkDepthPeelingPassIntermediateFS.glsl
index 4d5adff..b74ff6e 100644
--- a/Rendering/OpenGL2/glsl/vtkDepthPeelingPassIntermediateFS.glsl
+++ b/Rendering/OpenGL2/glsl/vtkDepthPeelingPassIntermediateFS.glsl
@@ -21,32 +21,17 @@ varying vec2 tcoordVC;
 uniform sampler2D translucentRGBATexture;
 uniform sampler2D currentRGBATexture;
 
-uniform int lastpass;
-
-// the output of this shader
-//VTK::Output::Dec
-
 void main()
 {
-  // current is what is most recently rendered
-  // translucent is what is in FRONT of it
-  // we render front to back
   vec4 t1Color = texture2D(translucentRGBATexture, tcoordVC);
   vec4 t2Color = texture2D(currentRGBATexture, tcoordVC);
-  gl_FragData[0].a = t1Color.a + t2Color.a * (1.0-t1Color.a);
-  if (gl_FragData[0].a > 0.0)
+  gl_FragColor.a = t1Color.a + t2Color.a * (1.0-t1Color.a);
+  if (gl_FragColor.a > 0.0)
     {
-    if (lastpass == 1)
-      {
-      gl_FragData[0].rgb = (t1Color.rgb*t1Color.a + t2Color.rgb*(1.0-t1Color.a))/gl_FragData[0].a;
-      }
-    else
-      {
-      gl_FragData[0].rgb = (t1Color.rgb*t1Color.a + t2Color.rgb*t2Color.a*(1.0-t1Color.a))/gl_FragData[0].a;
-      }
+    gl_FragColor.rgb = (t1Color.rgb*t1Color.a + t2Color.rgb*t2Color.a*(1.0-t1Color.a))/gl_FragColor.a;
     }
   else
     {
-    gl_FragData[0].rgb = vec3(0.0,0.0,0.0);
+    gl_FragColor.rgb = vec3(0.0,0.0,0.0);
     }
 }
diff --git a/Rendering/OpenGL2/glsl/vtkGaussianBlurPassFS.glsl b/Rendering/OpenGL2/glsl/vtkGaussianBlurPassFS.glsl
index afdd458..ccabc5d 100644
--- a/Rendering/OpenGL2/glsl/vtkGaussianBlurPassFS.glsl
+++ b/Rendering/OpenGL2/glsl/vtkGaussianBlurPassFS.glsl
@@ -26,14 +26,11 @@ uniform float coef[3];
 uniform float offsetx;
 uniform float offsety;
 
-// the output of this shader
-//VTK::Output::Dec
-
 void main(void)
 {
   vec2 offset=vec2(offsetx,offsety);
 
-  gl_FragData[0] = coef[0]*texture2D(source,tcoordVC-offset)
+  gl_FragColor = coef[0]*texture2D(source,tcoordVC-offset)
     +coef[1]*texture2D(source,tcoordVC)
     +coef[2]*texture2D(source,tcoordVC+offset);
 }
diff --git a/Rendering/OpenGL2/glsl/vtkGlyph3DVS.glsl b/Rendering/OpenGL2/glsl/vtkGlyph3DVS.glsl
deleted file mode 100644
index a1a3234..0000000
--- a/Rendering/OpenGL2/glsl/vtkGlyph3DVS.glsl
+++ /dev/null
@@ -1,65 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkGlyph3DVS.glsl
-
-  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.
-
-=========================================================================*/
-// this shader is used to implement lighting in the fragment shader
-// it handles setting up the basic varying variables for the fragment shader
-
-// The following line handle system declarations such a
-// default precisions, or defining precisions to null
-//VTK::System::Dec
-
-// all variables that represent positions or directions have a suffix
-// indicating the coordinate system they are in. The possible values are
-// MC - Model Coordinates
-// WC - WC world coordinates
-// VC - View Coordinates
-// DC - Display Coordinates
-
-attribute vec4 vertexMC;
-
-// frag position in VC
-//VTK::PositionVC::Dec
-
-// optional normal declaration
-//VTK::Normal::Dec
-
-// Texture coordinates
-//VTK::TCoord::Dec
-
-// material property values
-//VTK::Color::Dec
-
-// camera and actor matrix values
-//VTK::Camera::Dec
-
-//VTK::Glyph::Dec
-
-// clipping plane vars
-//VTK::Clip::Dec
-
-void main()
-{
-  //VTK::Glyph::Impl
-
-  //VTK::Clip::Impl
-
-  //VTK::Color::Impl
-
-  //VTK::Normal::Impl
-
-  //VTK::TCoord::Impl
-
-  // frag position in VC
-  //VTK::PositionVC::Impl
-}
diff --git a/Rendering/OpenGL2/glsl/vtkPointGaussianVS.glsl b/Rendering/OpenGL2/glsl/vtkPointGaussianVS.glsl
index 4dbb1e6..19535a9 100644
--- a/Rendering/OpenGL2/glsl/vtkPointGaussianVS.glsl
+++ b/Rendering/OpenGL2/glsl/vtkPointGaussianVS.glsl
@@ -18,8 +18,16 @@
 // default precisions, or defining precisions to null
 //VTK::System::Dec
 
+// all variables that represent positions or directions have a suffix
+// indicating the coordinate system they are in. The possible values are
+// MC - Model Coordinates
+// WC - WC world coordinates
+// VC - View Coordinates
+// DC - Display Coordinates
+
 attribute vec4 vertexMC;
 attribute vec2 offsetMC;
+//attribute float radiusMC;
 
 // optional normal declaration
 //VTK::Normal::Dec
@@ -36,7 +44,7 @@ attribute vec2 offsetMC;
 // camera and actor matrix values
 //VTK::Camera::Dec
 
-varying vec2 offsetVCVSOutput;
+varying vec2 offsetVC;
 uniform int cameraParallel;
 
 void main()
@@ -51,12 +59,7 @@ void main()
 
   // compute the projected vertex position
   vec4 vertexVC = MCVCMatrix * vertexMC;
-
-  // the offsets sent down are positioned
-  // at 2.0*radius*3.0 from the center of the
-  // gaussian.  This has to be consistent
-  // with the offsets we build into the VBO
-  float radius = sqrt(dot(offsetMC,offsetMC))/6.0;
+  float radius2 = dot(offsetMC,offsetMC)*0.25;
 
   // make the triangle face the camera
   if (cameraParallel == 0)
@@ -72,6 +75,6 @@ void main()
     vertexVC.xy = vertexVC.xy + offsetMC;
     }
 
-  offsetVCVSOutput = offsetMC/radius;
+  offsetVC = offsetMC/sqrt(radius2);
   gl_Position = VCDCMatrix * vertexVC;
 }
diff --git a/Rendering/OpenGL2/glsl/vtkPolyData2DFS.glsl b/Rendering/OpenGL2/glsl/vtkPolyData2DFS.glsl
deleted file mode 100644
index f6c7f15..0000000
--- a/Rendering/OpenGL2/glsl/vtkPolyData2DFS.glsl
+++ /dev/null
@@ -1,45 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkPolyData2DFS.glsl
-
-  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.
-
-=========================================================================*/
-
-// The following line handle system declarations such a
-// default precisions, or defining precisions to null
-//VTK::System::Dec
-
-uniform int PrimitiveIDOffset;
-
-// Texture coordinates
-//VTK::TCoord::Dec
-
-// Scalar coloring
-//VTK::Color::Dec
-
-// Depth Peeling
-//VTK::DepthPeeling::Dec
-
-// the output of this shader
-//VTK::Output::Dec
-
-// Apple Bug
-//VTK::PrimID::Dec
-
-void main()
-{
-  // Apple Bug
-  //VTK::PrimID::Impl
-
-  //VTK::Color::Impl
-  //VTK::TCoord::Impl
-  //VTK::DepthPeeling::Impl
-}
diff --git a/Rendering/OpenGL2/glsl/vtkPolyData2DVS.glsl b/Rendering/OpenGL2/glsl/vtkPolyData2DVS.glsl
deleted file mode 100644
index 599ee46..0000000
--- a/Rendering/OpenGL2/glsl/vtkPolyData2DVS.glsl
+++ /dev/null
@@ -1,48 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkPolyData2DVS.glsl
-
-  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.
-
-=========================================================================*/
-
-// The following line handle system declarations such a
-// default precisions, or defining precisions to null
-//VTK::System::Dec
-
-// all variables that represent positions or directions have a suffix
-// indicating the coordinate system they are in. The possible values are
-// MC - Model Coordinates
-// WC - WC world coordinates
-// VC - View Coordinates
-// DC - Display Coordinates
-
-attribute vec4 vertexWC;
-
-// material property values
-//VTK::Color::Dec
-
-// Texture coordinates
-//VTK::TCoord::Dec
-
-// Apple Bug
-//VTK::PrimID::Dec
-
-uniform mat4 WCVCMatrix;  // World to view matrix
-
-void main()
-{
-  // Apple Bug
-  //VTK::PrimID::Impl
-
-  gl_Position = WCVCMatrix*vertexWC;
-  //VTK::TCoord::Impl
-  //VTK::Color::Impl
-}
diff --git a/Rendering/OpenGL2/glsl/vtkPolyDataFS.glsl b/Rendering/OpenGL2/glsl/vtkPolyDataFS.glsl
deleted file mode 100644
index 04e52c1..0000000
--- a/Rendering/OpenGL2/glsl/vtkPolyDataFS.glsl
+++ /dev/null
@@ -1,78 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkPolyDataFS.glsl
-
-  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.
-
-=========================================================================*/
-// Template for the polydata mappers fragment shader
-
-// The following line handle system declarations such a
-// default precisions, or defining precisions to null
-//VTK::System::Dec
-
-uniform int PrimitiveIDOffset;
-
-// VC position of this fragment
-//VTK::PositionVC::Dec
-
-// optional color passed in from the vertex shader, vertexColor
-//VTK::Color::Dec
-
-// optional surface normal declaration
-//VTK::Normal::Dec
-
-// extra lighting parameters
-//VTK::Light::Dec
-
-// Texture coordinates
-//VTK::TCoord::Dec
-
-// picking support
-//VTK::Picking::Dec
-
-// Depth Peeling Support
-//VTK::DepthPeeling::Dec
-
-// clipping plane vars
-//VTK::Clip::Dec
-
-// the output of this shader
-//VTK::Output::Dec
-
-// Apple Bug
-//VTK::PrimID::Dec
-
-void main()
-{
-  // Apple Bug
-  //VTK::PrimID::Impl
-
-  //VTK::Clip::Impl
-
-  //VTK::Color::Impl
-
-  // Generate the normal if we are not passed in one
-  //VTK::Normal::Impl
-
-  //VTK::Light::Impl
-
-  //VTK::TCoord::Impl
-
-  if (gl_FragData[0].a <= 0.0)
-    {
-    discard;
-    }
-
-  //VTK::DepthPeeling::Impl
-
-  //VTK::Picking::Impl
-
-}
diff --git a/Rendering/OpenGL2/glsl/vtkPolyDataVS.glsl b/Rendering/OpenGL2/glsl/vtkPolyDataVS.glsl
deleted file mode 100644
index e04171a..0000000
--- a/Rendering/OpenGL2/glsl/vtkPolyDataVS.glsl
+++ /dev/null
@@ -1,58 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkPolyDataVS.glsl
-
-  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.
-
-=========================================================================*/
-// this shader is used to implement lighting in the fragment shader
-// it handles setting up the basic varying variables for the fragment shader
-
-// The following line handle system declarations such a
-// default precisions, or defining precisions to null
-//VTK::System::Dec
-
-attribute vec4 vertexMC;
-
-// frag position in VC
-//VTK::PositionVC::Dec
-
-// optional normal declaration
-//VTK::Normal::Dec
-
-// Texture coordinates
-//VTK::TCoord::Dec
-
-// material property values
-//VTK::Color::Dec
-
-// clipping plane vars
-//VTK::Clip::Dec
-
-// camera and actor matrix values
-//VTK::Camera::Dec
-
-// Apple Bug
-//VTK::PrimID::Dec
-
-void main()
-{
-  //VTK::Color::Impl
-
-  //VTK::Normal::Impl
-
-  //VTK::TCoord::Impl
-
-  //VTK::Clip::Impl
-
-  //VTK::PrimID::Impl
-
-  //VTK::PositionVC::Impl
-}
diff --git a/Rendering/OpenGL2/glsl/vtkPolyDataWideLineGS.glsl b/Rendering/OpenGL2/glsl/vtkPolyDataWideLineGS.glsl
deleted file mode 100644
index a69feaa..0000000
--- a/Rendering/OpenGL2/glsl/vtkPolyDataWideLineGS.glsl
+++ /dev/null
@@ -1,96 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkPolyDataWideLineGS.glsl
-
-  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.
-
-=========================================================================*/
-// Template for the polydata mappers geometry shader
-
-// The following line handle system declarations such a
-// default precisions, or defining precisions to null
-//VTK::System::Dec
-
-// VC position of this fragment
-//VTK::PositionVC::Dec
-
-// primitiveID
-//VTK::PrimID::Dec
-
-// optional color passed in from the vertex shader, vertexColor
-//VTK::Color::Dec
-
-// optional surface normal declaration
-//VTK::Normal::Dec
-
-// extra lighting parameters
-//VTK::Light::Dec
-
-// Texture coordinates
-//VTK::TCoord::Dec
-
-// picking support
-//VTK::Picking::Dec
-
-// Depth Peeling Support
-//VTK::DepthPeeling::Dec
-
-// clipping plane vars
-//VTK::Clip::Dec
-
-// the output of this shader
-//VTK::Output::Dec
-
-uniform vec2 lineWidthNVC;
-
-layout(lines) in;
-layout(triangle_strip, max_vertices = 4) out;
-
-void main()
-{
-  // compute the lines direction
-  vec2 normal = normalize(
-    gl_in[1].gl_Position.xy/gl_in[1].gl_Position.w -
-    gl_in[0].gl_Position.xy/gl_in[0].gl_Position.w);
-
-  // rotate 90 degrees
-  normal = vec2(-1.0*normal.y,normal.x);
-
-  for (int j = 0; j < 4; j++)
-    {
-    int i = j/2;
-
-    //VTK::PrimID::Impl
-
-    //VTK::Clip::Impl
-
-    //VTK::Color::Impl
-
-    //VTK::Normal::Impl
-
-    //VTK::Light::Impl
-
-    //VTK::TCoord::Impl
-
-    //VTK::DepthPeeling::Impl
-
-    //VTK::Picking::Impl
-
-    // VC position of this fragment
-    //VTK::PositionVC::Impl
-
-    gl_Position = vec4(
-      gl_in[i].gl_Position.xy + (lineWidthNVC*normal)*((j+1)%2 - 0.5)*gl_in[i].gl_Position.w,
-      gl_in[i].gl_Position.z,
-      gl_in[i].gl_Position.w);
-    EmitVertex();
-    }
-  EndPrimitive();
-}
diff --git a/Rendering/OpenGL2/glsl/vtkSobelGradientMagnitudePass1FS.glsl b/Rendering/OpenGL2/glsl/vtkSobelGradientMagnitudePass1FS.glsl
index 9b1fc76..063f2c2 100644
--- a/Rendering/OpenGL2/glsl/vtkSobelGradientMagnitudePass1FS.glsl
+++ b/Rendering/OpenGL2/glsl/vtkSobelGradientMagnitudePass1FS.glsl
@@ -23,9 +23,6 @@ varying vec2 tcoordVC;
 uniform sampler2D source;
 uniform float stepSize; // 1/W
 
-// the output of this shader
-//VTK::Output::Dec
-
 void main(void)
 {
   vec2 offset=vec2(stepSize,0.0);
diff --git a/Rendering/OpenGL2/glsl/vtkSobelGradientMagnitudePass2FS.glsl b/Rendering/OpenGL2/glsl/vtkSobelGradientMagnitudePass2FS.glsl
index e28aa07..409a61f 100644
--- a/Rendering/OpenGL2/glsl/vtkSobelGradientMagnitudePass2FS.glsl
+++ b/Rendering/OpenGL2/glsl/vtkSobelGradientMagnitudePass2FS.glsl
@@ -25,9 +25,6 @@ uniform sampler2D gx1;
 uniform sampler2D gy1;
 uniform float stepSize; // 1/H
 
-// the output of this shader
-//VTK::Output::Dec
-
 void main(void)
 {
   vec2 offset=vec2(0.0,stepSize);
@@ -54,7 +51,7 @@ void main(void)
 
   // the maximum gradient magnitude is sqrt(2.0) when for example gx=1 and
   // gy=1
-//  gl_FragData[0]=sqrt((gx*gx+gy*gy)/2.0);
-  gl_FragData[0].rgb=sqrt((gx.rgb*gx.rgb+gy.rgb*gy.rgb)/2.0);
-  gl_FragData[0].a=1.0; // arbitrary choice.
+//  gl_FragColor=sqrt((gx*gx+gy*gy)/2.0);
+  gl_FragColor.rgb=sqrt((gx.rgb*gx.rgb+gy.rgb*gy.rgb)/2.0);
+  gl_FragColor.a=1.0; // arbitrary choice.
 }
diff --git a/Rendering/OpenGL2/glsl/vtkTextureObjectFS.glsl b/Rendering/OpenGL2/glsl/vtkTextureObjectFS.glsl
index 2f2f48a..8fe010e 100644
--- a/Rendering/OpenGL2/glsl/vtkTextureObjectFS.glsl
+++ b/Rendering/OpenGL2/glsl/vtkTextureObjectFS.glsl
@@ -22,10 +22,7 @@
 varying vec2 tcoordVC;
 uniform sampler2D source;
 
-// the output of this shader
-//VTK::Output::Dec
-
 void main(void)
 {
-  gl_FragData[0] = texture2D(source,tcoordVC);
+  gl_FragColor = texture2D(source,tcoordVC);
 }
diff --git a/Rendering/OpenGL2/glsl/vtkglGlyph3DVSFragmentLit.glsl b/Rendering/OpenGL2/glsl/vtkglGlyph3DVSFragmentLit.glsl
new file mode 100644
index 0000000..58f50c0
--- /dev/null
+++ b/Rendering/OpenGL2/glsl/vtkglGlyph3DVSFragmentLit.glsl
@@ -0,0 +1,65 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+  Module:    vtkglPolyDataVSFragmentLit.glsl
+
+  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.
+
+=========================================================================*/
+// this shader is used to implement lighting in the fragment shader
+// it handles setting up the basic varying variables for the fragment shader
+
+// The following line handle system declarations such a
+// default precisions, or defining precisions to null
+//VTK::System::Dec
+
+// all variables that represent positions or directions have a suffix
+// indicating the coordinate system they are in. The possible values are
+// MC - Model Coordinates
+// WC - WC world coordinates
+// VC - View Coordinates
+// DC - Display Coordinates
+
+attribute vec4 vertexMC;
+
+// frag position in VC
+//VTK::PositionVC::Dec
+
+// optional normal declaration
+//VTK::Normal::Dec
+
+// Texture coordinates
+//VTK::TCoord::Dec
+
+// material property values
+//VTK::Color::Dec
+
+// camera and actor matrix values
+//VTK::Camera::Dec
+
+//VTK::Glyph::Dec
+
+// clipping plane vars
+//VTK::Clip::Dec
+
+void main()
+{
+  //VTK::Glyph::Impl
+
+  //VTK::Clip::Impl
+
+  //VTK::Color::Impl
+
+  //VTK::Normal::Impl
+
+  //VTK::TCoord::Impl
+
+  // frag position in VC
+  //VTK::PositionVC::Impl
+}
diff --git a/Rendering/OpenGL2/glsl/vtkglPolyData2DFS.glsl b/Rendering/OpenGL2/glsl/vtkglPolyData2DFS.glsl
new file mode 100644
index 0000000..eed30f3
--- /dev/null
+++ b/Rendering/OpenGL2/glsl/vtkglPolyData2DFS.glsl
@@ -0,0 +1,33 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+  Module:    vtkglPolyData2DFS.glsl
+
+  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.
+
+=========================================================================*/
+
+// The following line handle system declarations such a
+// default precisions, or defining precisions to null
+//VTK::System::Dec
+
+// Texture coordinates
+//VTK::TCoord::Dec
+
+varying vec4 fcolor;
+
+// Depth Peeling
+//VTK::DepthPeeling::Dec
+
+void main()
+{
+  gl_FragColor = fcolor;
+  //VTK::TCoord::Impl
+  //VTK::DepthPeeling::Impl
+}
diff --git a/Rendering/OpenGL2/glsl/vtkglPolyData2DVS.glsl b/Rendering/OpenGL2/glsl/vtkglPolyData2DVS.glsl
new file mode 100644
index 0000000..2e2cc02
--- /dev/null
+++ b/Rendering/OpenGL2/glsl/vtkglPolyData2DVS.glsl
@@ -0,0 +1,46 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+  Module:    vtkglPolyData2DVS.glsl
+
+  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.
+
+=========================================================================*/
+
+// The following line handle system declarations such a
+// default precisions, or defining precisions to null
+//VTK::System::Dec
+
+// all variables that represent positions or directions have a suffix
+// indicating the coordinate system they are in. The possible values are
+// MC - Model Coordinates
+// WC - WC world coordinates
+// VC - View Coordinates
+// DC - Display Coordinates
+
+attribute vec4 vertexWC;
+
+// material property values
+//VTK::Color::Dec
+uniform vec3 ambientColor; // intensity weighted color
+
+// Texture coordinates
+//VTK::TCoord::Dec
+
+uniform mat4 WCVCMatrix;  // World to view matrix
+
+varying vec4 fcolor;
+
+void main()
+{
+  gl_Position = WCVCMatrix*vertexWC;
+  //VTK::TCoord::Impl
+  fcolor = vec4(ambientColor + diffuseColor.rgb, diffuseColor.a);
+}
+
diff --git a/Rendering/OpenGL2/glsl/vtkglPolyDataFSHeadlight.glsl b/Rendering/OpenGL2/glsl/vtkglPolyDataFSHeadlight.glsl
new file mode 100644
index 0000000..523b2d2
--- /dev/null
+++ b/Rendering/OpenGL2/glsl/vtkglPolyDataFSHeadlight.glsl
@@ -0,0 +1,80 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+  Module:    vtkglPolyDataFSHeadight.glsl
+
+  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.
+
+=========================================================================*/
+// the lighting model for this shader is a Headlight
+
+// The following line handle system declarations such a
+// default precisions, or defining precisions to null
+//VTK::System::Dec
+
+// all variables that represent positions or directions have a suffix
+// indicating the coordinate system they are in. The possible values are
+// MC - Model Coordinates
+// WC - WC world coordinates
+// VC - View Coordinates
+// DC - Display Coordinates
+
+// VC positon of this fragment
+//VTK::PositionVC::Dec
+
+// optional color passed in from the vertex shader, vertexColor
+//VTK::Color::Dec
+
+// optional normal declaration
+//VTK::Normal::Dec
+
+// Texture coordinates
+//VTK::TCoord::Dec
+
+// picking support
+//VTK::Picking::Dec
+
+// Depth Peeling Support
+//VTK::DepthPeeling::Dec
+
+// clipping plane vars
+//VTK::Clip::Dec
+
+void main()
+{
+  //VTK::Clip::Impl
+
+  //VTK::Color::Impl
+
+  // Generate the normal if we are not passed in one
+  //VTK::Normal::Impl
+
+  // diffuse and specular lighting
+  float df = max(0.0, normalVC.z);
+  float sf = pow(df, specularPower);
+
+  vec3 diffuse = df * diffuseColor;
+  vec3 specular = sf * specularColor;
+
+  gl_FragColor = vec4(ambientColor + diffuse + specular, opacity);
+  //VTK::TCoord::Impl
+
+  if (gl_FragColor.a <= 0.0)
+    {
+    discard;
+    }
+
+  //VTK::DepthPeeling::Impl
+
+  //VTK::Picking::Impl
+
+}
+
+
+
diff --git a/Rendering/OpenGL2/glsl/vtkglPolyDataFSLightKit.glsl b/Rendering/OpenGL2/glsl/vtkglPolyDataFSLightKit.glsl
new file mode 100644
index 0000000..4bdb1ff
--- /dev/null
+++ b/Rendering/OpenGL2/glsl/vtkglPolyDataFSLightKit.glsl
@@ -0,0 +1,100 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+  Module:    vtkglPolyDataFSHeadight.glsl
+
+  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.
+
+=========================================================================*/
+// the lighting model for this shader is the LightKit
+
+// The following line handle system declarations such a
+// default precisions, or defining precisions to null
+//VTK::System::Dec
+
+// all variables that represent positions or directions have a suffix
+// indicating the coordinate system they are in. The possible values are
+// MC - Model Coordinates
+// WC - WC world coordinates
+// VC - View Coordinates
+// DC - Display Coordinates
+
+// camera and actor matrix values
+//VTK::Camera::Dec
+
+uniform int numberOfLights; // only allow for up to 6 active lights
+uniform vec3 lightColor[6]; // intensity weighted color
+uniform vec3 lightDirectionVC[6]; // normalized
+uniform vec3 lightHalfAngleVC[6]; // normalized
+
+// VC positon of this fragment
+//VTK::PositionVC::Dec
+
+// optional color passed in from the vertex shader, vertexColor
+//VTK::Color::Dec
+
+// optional normal declaration
+//VTK::Normal::Dec
+
+// Texture coordinates
+//VTK::TCoord::Dec
+
+// picking support
+//VTK::Picking::Dec
+
+// Depth Peeling Support
+//VTK::DepthPeeling::Dec
+
+// clipping plane vars
+//VTK::Clip::Dec
+
+void main()
+{
+  //VTK::Clip::Impl
+
+  //VTK::Color::Impl
+  // Note that the above will always define vec3 ambientColor, vec3 diffuseColor and float opacity
+
+  // Generate the normal if we are not passed in one
+  //VTK::Normal::Impl
+
+  // now compute the vertex color
+  vec3 diffuse = vec3(0,0,0);
+  vec3 specular = vec3(0,0,0);
+  for (int lightNum = 0; lightNum < numberOfLights; lightNum++)
+    {
+    // diffuse and specular lighting
+    float df = max(0.0, dot(normalVC, -lightDirectionVC[lightNum]));
+    diffuse += (df * lightColor[lightNum]);
+
+    if (dot(normalVC, lightDirectionVC[lightNum]) < 0.0)
+      {
+      float sf = pow( max(0.0, dot(lightHalfAngleVC[lightNum],normalVC)), specularPower);
+      specular += (sf * lightColor[lightNum]);
+      }
+    }
+
+  diffuse = diffuse * diffuseColor;
+  specular = specular * specularColor;
+
+  gl_FragColor = vec4(ambientColor + diffuse + specular, opacity);
+  //VTK::TCoord::Impl
+
+  if (gl_FragColor.a <= 0.0)
+    {
+    discard;
+    }
+
+  //VTK::DepthPeeling::Impl
+
+  //VTK::Picking::Impl
+}
+
+
+
diff --git a/Rendering/OpenGL2/glsl/vtkglPolyDataFSNoLighting.glsl b/Rendering/OpenGL2/glsl/vtkglPolyDataFSNoLighting.glsl
new file mode 100644
index 0000000..faf5792
--- /dev/null
+++ b/Rendering/OpenGL2/glsl/vtkglPolyDataFSNoLighting.glsl
@@ -0,0 +1,58 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+  Module:    vtkglPolyDataFSNoLighting.glsl
+
+  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.
+
+=========================================================================*/
+
+// The following line handle system declarations such a
+// default precisions, or defining precisions to null
+//VTK::System::Dec
+
+// VC positon of this fragment
+//VTK::PositionVC::Dec
+
+varying vec4 fcolor;
+
+// Texture coordinates
+//VTK::TCoord::Dec
+
+//VTK::Color::Dec
+
+// picking support
+//VTK::Picking::Dec
+
+// Depth Peeling Support
+//VTK::DepthPeeling::Dec
+
+// clipping plane vars
+//VTK::Clip::Dec
+
+void main()
+{
+  //VTK::Clip::Impl
+
+  //VTK::Color::Impl
+  // Note that the above will always define vec3 ambientColor, vec3 diffuseColor and float opacity
+
+  gl_FragColor =  vec4(ambientColor + diffuseColor, opacity);
+  //VTK::TCoord::Impl
+
+  if (gl_FragColor.a <= 0.0)
+    {
+    discard;
+    }
+
+  //VTK::DepthPeeling::Impl
+
+  //VTK::Picking::Impl
+
+}
diff --git a/Rendering/OpenGL2/glsl/vtkglPolyDataFSPositionalLights.glsl b/Rendering/OpenGL2/glsl/vtkglPolyDataFSPositionalLights.glsl
new file mode 100644
index 0000000..cf9f53e
--- /dev/null
+++ b/Rendering/OpenGL2/glsl/vtkglPolyDataFSPositionalLights.glsl
@@ -0,0 +1,139 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+  Module:    vtkglPolyDataFSPositionalLights.glsl
+
+  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.
+
+=========================================================================*/
+// the lighting model for this shader is complex
+// and supports the full VTK light API
+
+// The following line handle system declarations such a
+// default precisions, or defining precisions to null
+//VTK::System::Dec
+
+// all variables that represent positions or directions have a suffix
+// indicating the coordinate system they are in. The possible values are
+// MC - Model Coordinates
+// WC - WC world coordinates
+// VC - View Coordinates
+// DC - Display Coordinates
+
+// camera and actor matrix values
+//VTK::Camera::Dec
+
+uniform int numberOfLights; // only allow for up to 6 active lights
+uniform vec3 lightColor[6]; // intensity weighted color
+uniform vec3 lightDirectionVC[6]; // normalized
+uniform vec3 lightHalfAngleVC[6]; // normalized
+uniform vec3 lightPositionVC[6];
+uniform vec3 lightAttenuation[6];
+uniform float lightConeAngle[6];
+uniform float lightExponent[6];
+uniform int lightPositional[6];
+
+// VC positon of this fragment
+//VTK::PositionVC::Dec
+
+// optional color passed in from the vertex shader, vertexColor
+//VTK::Color::Dec
+
+// optional normal declaration
+//VTK::Normal::Dec
+
+// Texture coordinates
+//VTK::TCoord::Dec
+
+// picking support
+//VTK::Picking::Dec
+
+// Depth Peeling Support
+//VTK::DepthPeeling::Dec
+
+// clipping plane vars
+//VTK::Clip::Dec
+
+void main()
+{
+  //VTK::Clip::Impl
+
+  //VTK::Color::Impl
+  // Note that the above will always define vec3 ambientColor, vec3 diffuseColor and float opacity
+
+  // Generate the normal if we are not passed in one
+  //VTK::Normal::Impl
+
+  vec3 diffuse = vec3(0,0,0);
+  vec3 specular = vec3(0,0,0);
+  vec3 vertLightDirectionVC;
+
+  for (int lightNum = 0; lightNum < numberOfLights; lightNum++)
+    {
+    float attenuation = 1.0;
+
+    // directional
+    if (lightPositional[lightNum] == 0)
+      {
+      vertLightDirectionVC = lightDirectionVC[lightNum];
+      }
+    else
+      {
+      vertLightDirectionVC = vertexVC.xyz - lightPositionVC[lightNum];
+      float distanceVC = length(vertLightDirectionVC);
+      vertLightDirectionVC = normalize(vertLightDirectionVC);
+      attenuation = 1.0 /
+        (lightAttenuation[lightNum].x
+         + lightAttenuation[lightNum].y * distanceVC
+         + lightAttenuation[lightNum].z * distanceVC * distanceVC);
+      // per OpenGL standard cone angle is 90 or less for a spot light
+      if (lightConeAngle[lightNum] <= 90.0)
+        {
+        float coneDot = dot(vertLightDirectionVC, lightDirectionVC[lightNum]);
+        // if inside the cone
+        if (coneDot >= cos(radians(lightConeAngle[lightNum])))
+          {
+          attenuation = attenuation * pow(coneDot, lightExponent[lightNum]);
+          }
+        else
+          {
+          attenuation = 0.0;
+          }
+        }
+      }
+
+    // diffuse and specular lighting
+    float df = max(0.0, attenuation*dot(normalVC, -vertLightDirectionVC));
+    diffuse += (df * lightColor[lightNum]);
+
+    if (dot(normalVC, vertLightDirectionVC) < 0.0)
+      {
+      float sf = attenuation*pow( max(0.0, dot(lightHalfAngleVC[lightNum],normalVC)), specularPower);
+      specular += (sf * lightColor[lightNum]);
+      }
+    }
+
+  diffuse = diffuse * diffuseColor;
+  specular = specular * specularColor;
+
+  gl_FragColor = vec4(ambientColor + diffuse + specular, opacity);
+  //VTK::TCoord::Impl
+
+  if (gl_FragColor.a <= 0.0)
+    {
+    discard;
+    }
+
+  //VTK::DepthPeeling::Impl
+
+  //VTK::Picking::Impl
+}
+
+
+
diff --git a/Rendering/OpenGL2/glsl/vtkglPolyDataVSFragmentLit.glsl b/Rendering/OpenGL2/glsl/vtkglPolyDataVSFragmentLit.glsl
new file mode 100644
index 0000000..2043392
--- /dev/null
+++ b/Rendering/OpenGL2/glsl/vtkglPolyDataVSFragmentLit.glsl
@@ -0,0 +1,63 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+  Module:    vtkglPolyDataVSFragmentLit.glsl
+
+  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.
+
+=========================================================================*/
+// this shader is used to implement lighting in the fragment shader
+// it handles setting up the basic varying variables for the fragment shader
+
+// The following line handle system declarations such a
+// default precisions, or defining precisions to null
+//VTK::System::Dec
+
+// all variables that represent positions or directions have a suffix
+// indicating the coordinate system they are in. The possible values are
+// MC - Model Coordinates
+// WC - WC world coordinates
+// VC - View Coordinates
+// DC - Display Coordinates
+
+attribute vec4 vertexMC;
+
+// frag position in VC
+//VTK::PositionVC::Dec
+
+// optional normal declaration
+//VTK::Normal::Dec
+
+// Texture coordinates
+//VTK::TCoord::Dec
+
+// material property values
+//VTK::Color::Dec
+
+// clipping plane vars
+//VTK::Clip::Dec
+
+// camera and actor matrix values
+//VTK::Camera::Dec
+
+void main()
+{
+  //VTK::Color::Impl
+
+  //VTK::Normal::Impl
+
+  //VTK::TCoord::Impl
+
+  //VTK::Clip::Impl
+
+  //VTK::PositionVC::Impl
+}
+
+
+
diff --git a/Rendering/OpenGL2/glsl/vtkglPolyDataVSNoLighting.glsl b/Rendering/OpenGL2/glsl/vtkglPolyDataVSNoLighting.glsl
new file mode 100644
index 0000000..4ab9e1f
--- /dev/null
+++ b/Rendering/OpenGL2/glsl/vtkglPolyDataVSNoLighting.glsl
@@ -0,0 +1,51 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+  Module:    vtkglPolyDataVSNoLighting.glsl
+
+  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.
+
+=========================================================================*/
+// The following line handle system declarations such a
+// default precisions, or defining precisions to null
+//VTK::System::Dec
+
+// all variables that represent positions or directions have a suffix
+// indicating the coordinate system they are in. The possible values are
+// MC - Model Coordinates
+// WC - WC world coordinates
+// VC - View Coordinates
+// DC - Display Coordinates
+attribute vec4 vertexMC;
+
+// frag position in VC
+//VTK::PositionVC::Dec
+
+// material property values
+//VTK::Color::Dec
+
+// camera and actor matrix values
+//VTK::Camera::Dec
+
+// Texture coordinates
+//VTK::TCoord::Dec
+
+// clipping plane vars
+//VTK::Clip::Dec
+
+void main()
+{
+  //VTK::Color::Impl
+
+  //VTK::TCoord::Impl
+
+  //VTK::Clip::Impl
+
+  //VTK::PositionVC::Impl
+}
diff --git a/Rendering/OpenGL2/vtkCameraPass.cxx b/Rendering/OpenGL2/vtkCameraPass.cxx
index e88bbe9..c672906 100644
--- a/Rendering/OpenGL2/vtkCameraPass.cxx
+++ b/Rendering/OpenGL2/vtkCameraPass.cxx
@@ -106,11 +106,10 @@ void vtkCameraPass::Render(const vtkRenderState *s)
   int vsize;
   vtkFrameBufferObject *fbo=s->GetFrameBuffer();
 
-  vtkOpenGLRenderWindow *win=vtkOpenGLRenderWindow::SafeDownCast(ren->GetRenderWindow());
-  win->MakeCurrent();
-
   if(fbo==0)
     {
+    vtkOpenGLRenderWindow *win=vtkOpenGLRenderWindow::SafeDownCast(ren->GetRenderWindow());
+
     // find out if we should stereo render
     bool stereo = win->GetStereoRender()==1;
     this->GetTiledSizeAndOrigin(s, &usize,&vsize,lowerLeft,lowerLeft+1);
diff --git a/Rendering/OpenGL2/vtkCocoaGLView.h b/Rendering/OpenGL2/vtkCocoaGLView.h
index 3d5933d..fb9e792 100644
--- a/Rendering/OpenGL2/vtkCocoaGLView.h
+++ b/Rendering/OpenGL2/vtkCocoaGLView.h
@@ -18,20 +18,18 @@
 // This class is a subclass of Cocoa's NSView; it uses Objective-C++.
 // This class overrides several NSView methods.
 // To provide the usual VTK keyboard user interface, it overrides the
-// following methods: acceptsFirstResponder, keyDown:,
+// following methods from NSResponder: acceptsFirstResponder, keyDown:,
 // keyUp:, and flagsChanged:
 // To provide the usual VTK mouse user interface, it overrides the
-// following methods: mouseMoved:, mouseEntered:,
+// following methods from NSResponder: mouseMoved:, mouseEntered:,
 // mouseExited: scrollWheel:, mouseDown:, rightMouseDown:,
 // otherMouseDown:, mouseDragged:, rightMouseDragged:, otherMouseDragged:,
-// and updateTrackingAreas.
-// To be able to render and draw onscreen, it overrides drawRect:.
+// and resetCursorRects.
+// To be able to render and draw onscreen, it overrides drawRect:
+// from NSView.
 
-// Compatibility notes:
-// - this class was previously a subclass of NSOpenGLView,
+// Note that this class was previously a subclass of NSOpenGLView,
 // but starting with VTK 5.0 is now a subclass of NSView.
-// - starting with VTK 6.3 this class overrides the more modern
-// updateTrackingAreas instead of resetCursorRects.
 //
 // .SECTION See Also
 // vtkCocoaRenderWindow vtkCocoaRenderWindowInteractor
@@ -61,7 +59,8 @@
 {
   @private
   vtkCocoaRenderWindowRef _myVTKRenderWindow;
-  NSTrackingArea* _rolloverTrackingArea;
+  NSTrackingRectTag _rolloverTrackingRectTag;
+  BOOL _rolloverTrackingRectSet;
 }
 
 - (vtkCocoaRenderWindowRef)getVTKRenderWindow;
diff --git a/Rendering/OpenGL2/vtkCocoaGLView.mm b/Rendering/OpenGL2/vtkCocoaGLView.mm
index 4e6a094..1d31316 100644
--- a/Rendering/OpenGL2/vtkCocoaGLView.mm
+++ b/Rendering/OpenGL2/vtkCocoaGLView.mm
@@ -22,11 +22,6 @@
 #import "vtkCocoaRenderWindowInteractor.h"
 #import "vtkCommand.h"
 
-//----------------------------------------------------------------------------
-// Private
- at interface vtkCocoaGLView()
- at property(readwrite, retain, nonatomic) NSTrackingArea *rolloverTrackingArea;
- at end
 
 @implementation vtkCocoaGLView
 
@@ -38,9 +33,6 @@
 }
 
 //----------------------------------------------------------------------------
- at synthesize rolloverTrackingArea = _rolloverTrackingArea;
-
-//----------------------------------------------------------------------------
 // Overridden (from NSView).
 // designated initializer
 - (id)initWithFrame:(NSRect)frameRect
@@ -48,6 +40,9 @@
   self = [super initWithFrame:frameRect];
   if (self)
     {
+    // The tracking rect is not set yet.
+    _rolloverTrackingRectSet = NO;
+
     // Force Cocoa into "multi threaded mode" because VTK spawns pthreads.
     // Apple's docs say: "If you intend to use Cocoa calls, you must force
     // Cocoa into its multithreaded mode before detaching any POSIX threads.
@@ -102,32 +97,38 @@
 }
 
 //----------------------------------------------------------------------------
-// Overridden (from NSView).
-- (void)updateTrackingAreas
+// Private
+- (void)clearTrackingRect
 {
-  //clear out the old tracking area
-  NSTrackingArea *trackingArea = [self rolloverTrackingArea];
-  if (trackingArea)
+  // remove any tracking rect we have
+  if (_rolloverTrackingRectSet)
     {
-    [self removeTrackingArea:trackingArea];
+    [self removeTrackingRect:_rolloverTrackingRectTag];
+    _rolloverTrackingRectSet = NO;
     }
+}
 
-  //create a new tracking area
-  NSRect rect = [self visibleRect];
-  NSTrackingAreaOptions opts = (NSTrackingMouseEnteredAndExited |
-                                NSTrackingMouseMoved |
-                                NSTrackingActiveAlways);
-  trackingArea = [[NSTrackingArea alloc] initWithRect:rect
-                                              options:opts
-                                                owner:self
-                                             userInfo:nil];
-  [self addTrackingArea:trackingArea];
-  [self setRolloverTrackingArea:trackingArea];
-#if !VTK_OBJC_IS_ARC
-  [trackingArea release];
-#endif
-
-  [super updateTrackingAreas];
+//----------------------------------------------------------------------------
+// Private
+- (void)resetTrackingRect
+{
+  //clear out the old tracking rect
+  [self clearTrackingRect];
+
+  //create a new tracking rect
+  _rolloverTrackingRectTag = [self addTrackingRect:[self visibleRect]
+                                             owner:self
+                                          userData:NULL
+                                      assumeInside:NO];
+  _rolloverTrackingRectSet = YES;
+}
+
+//----------------------------------------------------------------------------
+// Overridden (from NSView).
+- (void)resetCursorRects
+{
+  [super resetCursorRects];
+  [self resetTrackingRect];
 }
 
 //----------------------------------------------------------------------------
@@ -159,7 +160,6 @@ static const char *vtkMacCharCodeToKeySymTable[128] = {
   "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", "Delete",
 };
 
-//----------------------------------------------------------------------------
 // For generating keysyms that are compatible with other VTK interactors
 static const char *vtkMacKeyCodeToKeySymTable[128] = {
   0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -423,7 +423,8 @@ static const char *vtkMacKeyCodeToKeySymTable[128] = {
 - (void)mouseEntered:(NSEvent *)theEvent
 {
   // Note: the mouseEntered/mouseExited events depend on the maintenance of
-  // the tracking area (updateTrackingAreas).
+  // the Tracking Rect, which is handled by the resetTrackingRect,
+  // clearTrackingRect and resetCursorRects methods above.
   [self invokeVTKMoveEvent:vtkCommand::EnterEvent
                 cocoaEvent:theEvent];
 }
diff --git a/Rendering/OpenGL2/vtkCocoaRenderWindow.mm b/Rendering/OpenGL2/vtkCocoaRenderWindow.mm
index be70807..a4ffcb3 100644
--- a/Rendering/OpenGL2/vtkCocoaRenderWindow.mm
+++ b/Rendering/OpenGL2/vtkCocoaRenderWindow.mm
@@ -17,7 +17,6 @@ PURPOSE.  See the above copyright notice for more information.
 #import <Cocoa/Cocoa.h>
 #import "vtkCocoaMacOSXSDKCompatibility.h" // Needed to support old SDKs
 
-#import "vtkOpenGL.h"
 #import "vtkCocoaRenderWindow.h"
 #import "vtkRenderWindowInteractor.h"
 #import "vtkCommand.h"
@@ -813,7 +812,7 @@ void vtkCocoaRenderWindow::CreateAWindow()
       [parent addSubview:glView];
       this->SetWindowId(glView);
       this->ViewCreated = 1;
-#if !VTK_OBJC_IS_ARC
+#if VTK_OBJC_IS_MRR
       [glView release];
 #endif
       }
@@ -829,7 +828,7 @@ void vtkCocoaRenderWindow::CreateAWindow()
       this->SetWindowId(glView);
       this->ViewCreated = 1;
       [glView setVTKRenderWindow:this];
-#if !VTK_OBJC_IS_ARC
+#if VTK_OBJC_IS_MRR
       [glView release];
 #endif
       }
@@ -872,7 +871,7 @@ void vtkCocoaRenderWindow::CreateAWindow()
   vtkCocoaServer *server = [[vtkCocoaServer alloc] initWithRenderWindow:this];
   this->SetCocoaServer(reinterpret_cast<void *>(server));
   [server startObservations];
-#if !VTK_OBJC_IS_ARC
+#if VTK_OBJC_IS_MRR
   [server release];
 #endif
 }
@@ -887,10 +886,7 @@ void vtkCocoaRenderWindow::CreateGLContext()
     int i = 0;
     NSOpenGLPixelFormatAttribute attribs[20];
 
-    attribs[i++] = NSOpenGLPFAOpenGLProfile;
-    attribs[i++] = NSOpenGLProfileVersion3_2Core;
-  //  OSX always preferrs an accelerated context
-  //    attribs[i++] = NSOpenGLPFAAccelerated;
+    attribs[i++] = NSOpenGLPFAAccelerated;
     attribs[i++] = NSOpenGLPFADepthSize;
     attribs[i++] = (NSOpenGLPixelFormatAttribute)32;
 
@@ -932,10 +928,6 @@ void vtkCocoaRenderWindow::CreateGLContext()
         this->MultiSamples /= 2;
         }
       }
-    else
-      {
-      this->SetContextSupportsOpenGL32(true);
-      }
     }
 
   NSOpenGLContext *context = [[NSOpenGLContext alloc]
@@ -952,7 +944,7 @@ void vtkCocoaRenderWindow::CreateGLContext()
   [pixelFormat self]; // prevent premature collection under GC.
   [context self]; // prevent premature collection under GC.
 
-#if !VTK_OBJC_IS_ARC
+#if VTK_OBJC_IS_MRR
   [pixelFormat release];
   [context release];
 #endif
diff --git a/Rendering/OpenGL2/vtkCocoaRenderWindowInteractor.mm b/Rendering/OpenGL2/vtkCocoaRenderWindowInteractor.mm
index 875289f..6cb2376 100644
--- a/Rendering/OpenGL2/vtkCocoaRenderWindowInteractor.mm
+++ b/Rendering/OpenGL2/vtkCocoaRenderWindowInteractor.mm
@@ -152,7 +152,7 @@ static vtkEarlyCocoaSetup * gEarlyCocoaSetup = new vtkEarlyCocoaSetup();
                                  selector:@selector(timerFired:)
                                  userInfo:nil
                                   repeats:repeating];
-#if !VTK_OBJC_IS_ARC
+#if VTK_OBJC_IS_MRR
   [_timer retain];
 #endif
 
@@ -165,7 +165,7 @@ static vtkEarlyCocoaSetup * gEarlyCocoaSetup = new vtkEarlyCocoaSetup();
 - (void)stopTimer
 {
   [_timer invalidate];
-#if !VTK_OBJC_IS_ARC
+#if VTK_OBJC_IS_MRR
   [_timer release];
 #endif
   _timer = nil;
@@ -343,7 +343,7 @@ int vtkCocoaRenderWindowInteractor::InternalCreateTimer(int timerId,
   [timerDict setObject:cocoaTimer forKey:timerIdAsStr];
   [cocoaTimer startTimerWithInterval:((NSTimeInterval)duration/1000.0)
                            repeating:repeating];
-#if !VTK_OBJC_IS_ARC
+#if VTK_OBJC_IS_MRR
   [cocoaTimer release];
 #endif
 
diff --git a/Rendering/OpenGL2/vtkCompositePolyDataMapper2.cxx b/Rendering/OpenGL2/vtkCompositePolyDataMapper2.cxx
index 43bb2f2..9e22825 100644
--- a/Rendering/OpenGL2/vtkCompositePolyDataMapper2.cxx
+++ b/Rendering/OpenGL2/vtkCompositePolyDataMapper2.cxx
@@ -12,8 +12,6 @@
      PURPOSE.  See the above copyright notice for more information.
 
 =========================================================================*/
-#include "vtk_glew.h"
-
 #include "vtkCompositePolyDataMapper2.h"
 
 #include "vtkCellArray.h"
@@ -27,19 +25,13 @@
 #include "vtkMultiBlockDataSet.h"
 #include "vtkMultiPieceDataSet.h"
 #include "vtkObjectFactory.h"
-#include "vtkOpenGLBufferObject.h"
-#include "vtkOpenGLIndexBufferObject.h"
-#include "vtkOpenGLRenderWindow.h"
 #include "vtkOpenGLTexture.h"
-#include "vtkOpenGLVertexBufferObject.h"
 #include "vtkPointData.h"
 #include "vtkPolyData.h"
 #include "vtkProperty.h"
 #include "vtkRenderer.h"
 #include "vtkRenderWindow.h"
-#include "vtkLookupTable.h"
 #include "vtkShaderProgram.h"
-#include "vtkTextureObject.h"
 
 vtkStandardNewMacro(vtkCompositePolyDataMapper2);
 
@@ -70,28 +62,6 @@ void vtkCompositePolyDataMapper2::FreeStructures()
   this->RenderValues.resize(0);
 }
 
-void vtkCompositePolyDataMapper2::ReplaceShaderColor(
-  std::map<vtkShader::Type, vtkShader *> shaders,
-  vtkRenderer *ren, vtkActor *actor)
-{
-  std::string FSSource = shaders[vtkShader::Fragment]->GetSource();
-
-  vtkShaderProgram::Substitute(FSSource,"//VTK::Color::Dec",
-    "uniform bool OverridesColor;\n"
-    "//VTK::Color::Dec",false);
-
-  vtkShaderProgram::Substitute(FSSource,"//VTK::Color::Impl",
-    "//VTK::Color::Impl\n"
-    "  if (OverridesColor) {\n"
-    "    ambientColor = ambientColorUniform;\n"
-    "    diffuseColor = diffuseColorUniform; }\n",
-    false);
-
-  shaders[vtkShader::Fragment]->SetSource(FSSource);
-
-  this->Superclass::ReplaceShaderColor(shaders,ren,actor);
-}
-
 // ---------------------------------------------------------------------------
 // Description:
 // Method initiates the mapping process. Generally sent by the actor
@@ -136,19 +106,6 @@ void vtkCompositePolyDataMapper2::Render(
         }
       }
 
-    // check if this system is subject to the apple primID bug
-    // if so don't even try using the fast path, just go slow
-
-#ifdef __APPLE__
-    std::string vendor = (const char *)glGetString(GL_VENDOR);
-    if (vendor.find("ATI") != std::string::npos ||
-        vendor.find("AMD") != std::string::npos ||
-        vendor.find("amd") != std::string::npos)
-      {
-      this->UseGeneric = true;
-      }
-#endif
-
     // clear old structures if the render method changed
     if (lastUseGeneric != this->UseGeneric)
       {
@@ -198,11 +155,8 @@ void vtkCompositePolyDataMapper2::Render(
         }
       }
 
-     if (this->CurrentInput)
-      {
-      // render using the composite data attributes
-      this->RenderPiece(ren, actor);
-      }
+    // render using the composite data attributes
+    this->RenderPiece(ren, actor);
 
     this->BlockState.Visibility.pop();
     this->BlockState.Opacity.pop();
@@ -312,7 +266,6 @@ void vtkCompositePolyDataMapper2::BuildRenderValues(
       rv.Visibility = vis;
       rv.Color = color;
       rv.PickId = my_flat_index;
-      rv.OverridesColor = (this->BlockState.AmbientColor.size() > 1);
       this->RenderValues.push_back(rv);
       }
 
@@ -335,7 +288,6 @@ void vtkCompositePolyDataMapper2::BuildRenderValues(
       rv.Visibility = vis;
       rv.Color = color;
       rv.PickId = my_flat_index;
-      rv.OverridesColor = (this->BlockState.AmbientColor.size() > 1);
       this->RenderValues.push_back(rv);
       }
     lastVertex = this->VertexOffsets[my_flat_index];
@@ -370,15 +322,17 @@ void vtkCompositePolyDataMapper2::RenderPieceDraw(
   vtkHardwareSelector* selector = ren->GetSelector();
   if (selector && this->PopulateSelectionSettings &&
       selector->GetFieldAssociation() == vtkDataObject::FIELD_ASSOCIATION_POINTS &&
-      selector->GetCurrentPass() >= vtkHardwareSelector::ID_LOW24)
+      selector->GetCurrentPass() > vtkHardwareSelector::ACTOR_PASS)
     {
     representation = VTK_POINTS;
     }
 
+  bool picking = (ren->GetIsPicking() || selector != NULL);
+
   // rebuild the render values if needed
   if (this->RenderValuesBuildTime < this->GetMTime() ||
       this->RenderValuesBuildTime < this->VBOBuildTime ||
-      this->RenderValuesBuildTime < this->SelectionStateChanged)
+      this->LastSelectionState || picking)
     {
     vtkCompositeDataSet *input = vtkCompositeDataSet::SafeDownCast(
       this->GetInputDataObject(0, 0));
@@ -397,15 +351,13 @@ void vtkCompositePolyDataMapper2::RenderPieceDraw(
     }
 
   // draw polygons
-  if (this->Tris.IBO->IndexCount)
+  if (this->Tris.indexCount)
     {
     // First we do the triangles, update the shader, set uniforms, etc.
-    this->UpdateShaders(this->Tris, ren, actor);
-    this->Tris.IBO->Bind();
+    this->UpdateShader(this->Tris, ren, actor);
+    this->Tris.ibo.Bind();
     GLenum mode = (representation == VTK_POINTS) ? GL_POINTS :
       (representation == VTK_WIREFRAME) ? GL_LINES : GL_TRIANGLES;
-    unsigned int modeDenom = (representation == VTK_POINTS) ? 1 :
-      (representation == VTK_WIREFRAME) ? 2 : 3;
 
     vtkProperty *ppty = actor->GetProperty();
     double aIntensity = this->DrawingEdges ? 1.0 : ppty->GetAmbient();
@@ -414,18 +366,14 @@ void vtkCompositePolyDataMapper2::RenderPieceDraw(
 
     std::vector<
       vtkCompositePolyDataMapper2::RenderValue>::iterator it;
-    // reset the offset so each composite starts at 0
-    this->PrimitiveIDOffset = 0;
     for (it = this->RenderValues.begin(); it != this->RenderValues.end(); it++)
       {
       if (it->Visibility)
         {
-        if (selector &&
-            selector->GetCurrentPass() ==
-              vtkHardwareSelector::COMPOSITE_INDEX_PASS)
+        if (selector)
           {
+          selector->BeginRenderProp();
           selector->RenderCompositeIndex(it->PickId);
-          prog->SetUniform3f("mapperIndex", selector->GetPropColorValue());
           }
         // override the opacity and color
         prog->SetUniformf("opacityUniform", it->Opacity);
@@ -439,21 +387,20 @@ void vtkCompositePolyDataMapper2::RenderPieceDraw(
           static_cast<float>(dColor[2] * dIntensity)};
         prog->SetUniform3f("ambientColorUniform", ambientColor);
         prog->SetUniform3f("diffuseColorUniform", diffuseColor);
-        prog->SetUniformi("PrimitiveIDOffset",
-          this->PrimitiveIDOffset);
-        prog->SetUniformi("OverridesColor", it->OverridesColor);
         glDrawRangeElements(mode,
           static_cast<GLuint>(it->StartVertex),
           static_cast<GLuint>(it->EndVertex),
           static_cast<GLsizei>(it->EndIndex - it->StartIndex + 1),
           GL_UNSIGNED_INT,
           reinterpret_cast<const GLvoid *>(it->StartIndex*sizeof(GLuint)));
+        if (selector)
+          {
+          selector->EndRenderProp();
+          }
         }
-      this->PrimitiveIDOffset +=
-        ((it->EndIndex - it->StartIndex + 1)/modeDenom);
       }
-
-    this->Tris.IBO->Release();
+    this->Tris.ibo.Release();
+    this->pickingAttributeIDOffset += (int)this->Tris.indexCount;
     }
 
 }
@@ -473,11 +420,11 @@ void vtkCompositePolyDataMapper2::RenderEdges(
   this->DrawingEdges = true;
 
   // draw polygons
-  if (this->TrisEdges.IBO->IndexCount)
+  if (this->TrisEdges.indexCount)
     {
     // First we do the triangles, update the shader, set uniforms, etc.
-    this->UpdateShaders(this->TrisEdges, ren, actor);
-    this->TrisEdges.IBO->Bind();
+    this->UpdateShader(this->TrisEdges, ren, actor);
+    this->TrisEdges.ibo.Bind();
     std::vector<
       vtkCompositePolyDataMapper2::RenderValue>::iterator it;
     for (it = this->RenderValues.begin(); it != this->RenderValues.end(); it++)
@@ -492,7 +439,7 @@ void vtkCompositePolyDataMapper2::RenderEdges(
           reinterpret_cast<const GLvoid *>(it->StartEdgeIndex*sizeof(GLuint)));
         }
       }
-    this->TrisEdges.IBO->Release();
+    this->TrisEdges.ibo.Release();
     }
 
   this->DrawingEdges = false;
@@ -507,89 +454,6 @@ void vtkCompositePolyDataMapper2::RenderEdges(
     */
 }
 
-//-----------------------------------------------------------------------------
-// Returns if we can use texture maps for scalar coloring. Note this doesn't say
-// we "will" use scalar coloring. It says, if we do use scalar coloring, we will
-// use a texture.
-// When rendering multiblock datasets, if any 2 blocks provide different
-// lookup tables for the scalars, then also we cannot use textures. This case can
-// be handled if required.
-int vtkCompositePolyDataMapper2::CanUseTextureMapForColoring(vtkDataObject*)
-{
-  if (!this->InterpolateScalarsBeforeMapping)
-    {
-    return 0; // user doesn't want us to use texture maps at all.
-    }
-
-  if (this->CanUseTextureMapForColoringSet)
-    {
-    return this->CanUseTextureMapForColoringValue;
-    }
-
-  vtkCompositeDataSet *cdInput = vtkCompositeDataSet::SafeDownCast(
-    this->GetInputDataObject(0, 0));
-
-  vtkSmartPointer<vtkDataObjectTreeIterator> iter =
-    vtkSmartPointer<vtkDataObjectTreeIterator>::New();
-  iter->SetDataSet(cdInput);
-  iter->SkipEmptyNodesOn();
-  iter->VisitOnlyLeavesOn();
-  int cellFlag=0;
-  this->CanUseTextureMapForColoringValue = 1;
-  vtkScalarsToColors *scalarsLookupTable = 0;
-  for (iter->InitTraversal();
-       !iter->IsDoneWithTraversal() &&
-          this->CanUseTextureMapForColoringValue == 1;
-       iter->GoToNextItem())
-    {
-    vtkDataObject *dso = iter->GetCurrentDataObject();
-    vtkPolyData *pd = vtkPolyData::SafeDownCast(dso);
-    vtkDataArray* scalars = vtkAbstractMapper::GetScalars(pd,
-      this->ScalarMode, this->ArrayAccessMode, this->ArrayId,
-      this->ArrayName, cellFlag);
-
-    if (scalars)
-      {
-      if (cellFlag)
-        {
-        this->CanUseTextureMapForColoringValue = 0;
-        }
-      if ((this->ColorMode == VTK_COLOR_MODE_DEFAULT &&
-           vtkUnsignedCharArray::SafeDownCast(scalars)) ||
-          this->ColorMode == VTK_COLOR_MODE_DIRECT_SCALARS)
-        {
-        // Don't use texture is direct coloring using RGB unsigned chars is
-        // requested.
-        this->CanUseTextureMapForColoringValue = 0;
-        }
-
-      if (scalarsLookupTable && scalars->GetLookupTable() &&
-          (scalarsLookupTable != scalars->GetLookupTable()))
-        {
-        // Two datasets are requesting different lookup tables to color with.
-        // We don't handle this case right now for composite datasets.
-        this->CanUseTextureMapForColoringValue = 0;
-        }
-      if (scalars->GetLookupTable())
-        {
-        scalarsLookupTable = scalars->GetLookupTable();
-        }
-      }
-    }
-
-  if ((scalarsLookupTable &&
-       scalarsLookupTable->GetIndexedLookup()) ||
-      (!scalarsLookupTable &&
-       this->LookupTable &&
-       this->LookupTable->GetIndexedLookup()))
-      {
-      this->CanUseTextureMapForColoringValue = 0;
-      }
-
-  this->CanUseTextureMapForColoringSet = true;
-  return this->CanUseTextureMapForColoringValue;
-}
-
 //-------------------------------------------------------------------------
 void vtkCompositePolyDataMapper2::BuildBufferObjects(
   vtkRenderer *ren,
@@ -599,7 +463,7 @@ void vtkCompositePolyDataMapper2::BuildBufferObjects(
     this->GetInputDataObject(0, 0));
 
   // render using the composite data attributes
-  this->VBO->VertexCount = 0;
+  this->Layout.VertexCount = 0;
 
   // compute the MaximumFlatIndex
   this->MaximumFlatIndex = 0;
@@ -615,11 +479,6 @@ void vtkCompositePolyDataMapper2::BuildBufferObjects(
   this->VertexOffsets.resize(this->MaximumFlatIndex+1);
   this->IndexOffsets.resize(this->MaximumFlatIndex+1);
   this->EdgeIndexOffsets.resize(this->MaximumFlatIndex+1);
-  this->CanUseTextureMapForColoringSet = false;
-
-  // create the cell scalar array adjusted for ogl Cells
-  std::vector<unsigned char> newColors;
-  std::vector<float> newNorms;
 
   unsigned int voffset = 0;
   for (iter->InitTraversal(); !iter->IsDoneWithTraversal(); iter->GoToNextItem())
@@ -627,62 +486,29 @@ void vtkCompositePolyDataMapper2::BuildBufferObjects(
     unsigned int fidx = iter->GetCurrentFlatIndex();
     vtkDataObject *dso = iter->GetCurrentDataObject();
     vtkPolyData *pd = vtkPolyData::SafeDownCast(dso);
-    this->AppendOneBufferObject(ren, act, pd, voffset, newColors, newNorms);
+    this->AppendOneBufferObject(ren, act, pd, voffset);
     this->VertexOffsets[fidx] =
-      static_cast<unsigned int>(this->VBO->VertexCount);
-    voffset = static_cast<unsigned int>(this->VBO->VertexCount);
+      static_cast<unsigned int>(this->Layout.VertexCount);
+    voffset = static_cast<unsigned int>(this->Layout.VertexCount);
     this->IndexOffsets[fidx] =
       static_cast<unsigned int>(this->IndexArray.size());
     this->EdgeIndexOffsets[fidx] =
       static_cast<unsigned int>(this->EdgeIndexArray.size());
     }
 
-  this->VBO->Upload(this->VBO->PackedVBO, vtkOpenGLBufferObject::ArrayBuffer);
-  this->VBO->PackedVBO.resize(0);
-  this->Tris.IBO->Upload(this->IndexArray,
-    vtkOpenGLBufferObject::ElementArrayBuffer);
-  this->Tris.IBO->IndexCount = this->IndexArray.size();
+  this->VBO.Upload(this->Layout.PackedVBO, vtkgl::BufferObject::ArrayBuffer);
+  this->Layout.PackedVBO.resize(0);
+  this->Tris.ibo.Upload(this->IndexArray,
+    vtkgl::BufferObject::ElementArrayBuffer);
+  this->Tris.indexCount = this->IndexArray.size();
   this->IndexArray.resize(0);
-  this->TrisEdges.IBO->Upload(this->EdgeIndexArray,
-    vtkOpenGLBufferObject::ElementArrayBuffer);
-  this->TrisEdges.IBO->IndexCount = this->EdgeIndexArray.size();
+  this->TrisEdges.ibo.Upload(this->EdgeIndexArray,
+    vtkgl::BufferObject::ElementArrayBuffer);
+  this->TrisEdges.indexCount = this->EdgeIndexArray.size();
   this->EdgeIndexArray.resize(0);
-
-  // allocate as needed
-  if (this->HaveCellScalars || this->HavePickScalars)
-    {
-    if (!this->CellScalarTexture)
-      {
-      this->CellScalarTexture = vtkTextureObject::New();
-      this->CellScalarBuffer = vtkOpenGLBufferObject::New();
-      }
-    this->CellScalarTexture->SetContext(
-      static_cast<vtkOpenGLRenderWindow*>(ren->GetVTKWindow()));
-    this->CellScalarBuffer->Upload(newColors,
-      vtkOpenGLBufferObject::TextureBuffer);
-    this->CellScalarTexture->CreateTextureBuffer(
-      static_cast<unsigned int>(newColors.size()/4),
-      4,
-      VTK_UNSIGNED_CHAR,
-      this->CellScalarBuffer);
-    }
-
-  if (this->HaveCellNormals)
-    {
-    if (!this->CellNormalTexture)
-      {
-      this->CellNormalTexture = vtkTextureObject::New();
-      this->CellNormalBuffer = vtkOpenGLBufferObject::New();
-      }
-    this->CellNormalTexture->SetContext(
-      static_cast<vtkOpenGLRenderWindow*>(ren->GetVTKWindow()));
-    this->CellNormalBuffer->Upload(newNorms,
-      vtkOpenGLBufferObject::TextureBuffer);
-    this->CellNormalTexture->CreateTextureBuffer(
-      static_cast<unsigned int>(newNorms.size()/4),
-      4, VTK_FLOAT,
-      this->CellNormalBuffer);
-    }
+  this->Points.indexCount = 0;
+  this->Lines.indexCount = 0;
+  this->TriStrips.indexCount = 0;
 }
 
 //-------------------------------------------------------------------------
@@ -690,17 +516,8 @@ void vtkCompositePolyDataMapper2::AppendOneBufferObject(
   vtkRenderer *ren,
   vtkActor *act,
   vtkPolyData *poly,
-  unsigned int voffset,
-  std::vector<unsigned char> &newColors,
-  std::vector<float> &newNorms
-  )
+  unsigned int voffset)
 {
-  // if there are no cells then skip this piece
-  if (poly->GetPolys()->GetNumberOfCells() == 0)
-    {
-    return;
-    }
-
   // Get rid of old texture color coordinates if any
   if ( this->ColorCoordinates )
     {
@@ -733,8 +550,7 @@ void vtkCompositePolyDataMapper2::AppendOneBufferObject(
     this->InternalColorTexture->SetInputData(this->ColorTextureMap);
     }
 
-  this->HaveCellScalars = false;
-  vtkDataArray *c = this->Colors;
+  bool cellScalars = false;
   if (this->ScalarVisibility)
     {
     // We must figure out how the scalars should be mapped to the polydata.
@@ -745,19 +561,18 @@ void vtkCompositePolyDataMapper2::AppendOneBufferObject(
          && this->ScalarMode != VTK_SCALAR_MODE_USE_POINT_FIELD_DATA
          && this->Colors)
       {
-      this->HaveCellScalars = true;
-      c = NULL;
+      cellScalars = true;
       }
     }
 
-  this->HaveCellNormals = false;
+  bool cellNormals = false;
   // Do we have cell normals?
   vtkDataArray *n =
     (act->GetProperty()->GetInterpolation() != VTK_FLAT) ? poly->GetPointData()->GetNormals() : NULL;
   if (n == NULL && poly->GetCellData()->GetNormals())
     {
-    this->HaveCellNormals = true;
-    n = NULL;
+    cellNormals = true;
+    n = poly->GetCellData()->GetNormals();
     }
 
   // if we have cell scalars then we have to
@@ -767,19 +582,13 @@ void vtkCompositePolyDataMapper2::AppendOneBufferObject(
   prims[1] =  poly->GetLines();
   prims[2] =  poly->GetPolys();
   prims[3] =  poly->GetStrips();
-
-  int representation = act->GetProperty()->GetRepresentation();
-  vtkHardwareSelector* selector = ren->GetSelector();
-  if (selector && this->PopulateSelectionSettings &&
-      selector->GetFieldAssociation() == vtkDataObject::FIELD_ASSOCIATION_POINTS &&
-      selector->GetCurrentPass() >= vtkHardwareSelector::ID_LOW24)
+  std::vector<unsigned int> cellPointMap;
+  std::vector<unsigned int> pointCellMap;
+  if (cellScalars || cellNormals)
     {
-    representation = VTK_POINTS;
+    vtkgl::CreateCellSupportArrays(poly, prims, cellPointMap, pointCellMap);
     }
 
-  this->AppendCellTextures(ren, act, prims, representation,
-    newColors, newNorms, poly);
-
   // do we have texture maps?
   bool haveTextures = (this->ColorTextureMap || act->GetTexture() || act->GetProperty()->GetNumberOfTextures());
 
@@ -800,30 +609,44 @@ void vtkCompositePolyDataMapper2::AppendOneBufferObject(
     }
 
   // Build the VBO
-  this->VBO->AppendVBO(poly->GetPoints(),
-            poly->GetPoints()->GetNumberOfPoints(),
+  AppendVBO(this->Layout, poly->GetPoints(),
+            cellPointMap.size() > 0 ? (unsigned int)cellPointMap.size()
+              : poly->GetPoints()->GetNumberOfPoints(),
             n, tcoords,
-            c ? (unsigned char *)c->GetVoidPointer(0) : NULL,
-            c ? c->GetNumberOfComponents() : 0);
+            this->Colors ? (unsigned char *)this->Colors->GetVoidPointer(0) : NULL,
+            this->Colors ? this->Colors->GetNumberOfComponents() : 0,
+            cellPointMap.size() > 0 ? &cellPointMap.front() : NULL,
+            pointCellMap.size() > 0 ? &pointCellMap.front() : NULL,
+            cellScalars, cellNormals);
 
   // now create the IBOs
+  int representation = act->GetProperty()->GetRepresentation();
+
+  vtkHardwareSelector* selector = ren->GetSelector();
+  if (selector && this->PopulateSelectionSettings &&
+      selector->GetFieldAssociation() == vtkDataObject::FIELD_ASSOCIATION_POINTS &&
+      selector->GetCurrentPass() > vtkHardwareSelector::ACTOR_PASS)
+    {
+    representation = VTK_POINTS;
+    }
+
   if (representation == VTK_POINTS)
     {
-    vtkOpenGLIndexBufferObject::AppendPointIndexBuffer(
-      this->IndexArray, prims[2], voffset);
+    vtkgl::AppendPointIndexBuffer(this->IndexArray, prims[2], voffset);
     }
   else // WIREFRAME OR SURFACE
     {
     if (representation == VTK_WIREFRAME)
       {
-      vtkOpenGLIndexBufferObject::AppendTriangleLineIndexBuffer(
+      vtkgl::AppendTriangleLineIndexBuffer(
         this->IndexArray, prims[2], voffset);
       }
    else // SURFACE
       {
-      vtkOpenGLIndexBufferObject::AppendTriangleIndexBuffer(this->IndexArray,
+      vtkgl::AppendTriangleIndexBuffer(this->IndexArray,
         prims[2],
         poly->GetPoints(),
+        cellPointMap,
         voffset);
       }
     }
@@ -834,8 +657,16 @@ void vtkCompositePolyDataMapper2::AppendOneBufferObject(
     (prop->GetEdgeVisibility() && prop->GetRepresentation() == VTK_SURFACE);
   if (draw_surface_with_edges)
     {
-    vtkOpenGLIndexBufferObject::AppendTriangleLineIndexBuffer(
+    vtkgl::AppendTriangleLineIndexBuffer(
       this->EdgeIndexArray, prims[2], voffset);
     }
 
+  // free up new cell arrays
+  if (cellScalars || cellNormals)
+    {
+    for (int primType = 0; primType < 4; primType++)
+      {
+      prims[primType]->UnRegister(this);
+      }
+    }
 }
diff --git a/Rendering/OpenGL2/vtkCompositePolyDataMapper2.h b/Rendering/OpenGL2/vtkCompositePolyDataMapper2.h
index a4b908a..933107d 100644
--- a/Rendering/OpenGL2/vtkCompositePolyDataMapper2.h
+++ b/Rendering/OpenGL2/vtkCompositePolyDataMapper2.h
@@ -26,6 +26,8 @@
 #include "vtkRenderingOpenGL2Module.h" // For export macro
 #include "vtkGenericCompositePolyDataMapper2.h"
 
+class vtkCompositePolyDataMapper2Internal;
+
 class VTKRENDERINGOPENGL2_EXPORT vtkCompositePolyDataMapper2 : public vtkGenericCompositePolyDataMapper2
 {
 public:
@@ -46,19 +48,10 @@ protected:
   ~vtkCompositePolyDataMapper2();
 
   // Description:
-  // Perform string replacments on the shader templates, called from
-  // ReplaceShaderValues
-  virtual void ReplaceShaderColor(
-    std::map<vtkShader::Type, vtkShader *> shaders,
-    vtkRenderer *ren, vtkActor *act);
-
-  // Description:
   // Build the VBO/IBO, called by UpdateBufferObjects
   virtual void BuildBufferObjects(vtkRenderer *ren, vtkActor *act);
   virtual void AppendOneBufferObject(vtkRenderer *ren,
-    vtkActor *act, vtkPolyData *pd, unsigned int flat_index,
-    std::vector<unsigned char> &colors,
-    std::vector<float> &norms);
+    vtkActor *act, vtkPolyData *pd, unsigned int flat_index);
 
   std::vector<unsigned int> VertexOffsets;
   std::vector<unsigned int> IndexOffsets;
@@ -77,7 +70,6 @@ protected:
       unsigned int EndIndex;
       unsigned int EndEdgeIndex;
       double Opacity;
-      bool OverridesColor;
       bool Visibility;
       vtkColor3d Color;
       unsigned int PickId;
@@ -100,17 +92,6 @@ protected:
     unsigned int &lastIndex,
     unsigned int &lastEdgeIndex);
 
-  // Description:
-  // Returns if we can use texture maps for scalar coloring. Note this doesn't
-  // say we "will" use scalar coloring. It says, if we do use scalar coloring,
-  // we will use a texture.
-  // When rendering multiblock datasets, if any 2 blocks provide different
-  // lookup tables for the scalars, then also we cannot use textures. This case
-  // can be handled if required.
-  virtual int CanUseTextureMapForColoring(vtkDataObject* input);
-  bool CanUseTextureMapForColoringSet;
-  int CanUseTextureMapForColoringValue;
-
 private:
   vtkCompositePolyDataMapper2(
     const vtkCompositePolyDataMapper2&); // Not implemented.
diff --git a/Rendering/OpenGL2/vtkDataTransferHelper.cxx b/Rendering/OpenGL2/vtkDataTransferHelper.cxx
deleted file mode 100644
index 7c9c0ae..0000000
--- a/Rendering/OpenGL2/vtkDataTransferHelper.cxx
+++ /dev/null
@@ -1,588 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkDataTransferHelper.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 "vtkDataTransferHelper.h"
-
-#include "vtkDataArray.h"
-#include "vtkImageData.h"
-#include "vtkPixelBufferObject.h"
-#include "vtkTextureObject.h"
-#include "vtkObjectFactory.h"
-#include "vtkOpenGLRenderWindow.h"
-#include "vtkSmartPointer.h"
-#include "vtkStructuredData.h"
-#include <cassert>
-
-static void vtkGetDimensions(int extents[6], int dims[3])
-{
-  dims[0] = extents[1]-extents[0]+1;
-  dims[1] = extents[3]-extents[2]+1;
-  dims[2] = extents[5]-extents[4]+1;
-}
-
-vtkStandardNewMacro(vtkDataTransferHelper);
-vtkCxxSetObjectMacro(vtkDataTransferHelper, Texture, vtkTextureObject);
-vtkCxxSetObjectMacro(vtkDataTransferHelper, Array, vtkDataArray);
-//----------------------------------------------------------------------------
-vtkDataTransferHelper::vtkDataTransferHelper()
-{
-  this->Texture = 0;
-  this->Context = 0;
-  this->Array = 0;
-  this->ShaderSupportsTextureInt=false;
-  this->GPUExtent[0] = this->GPUExtent[1] =
-    this->GPUExtent[2] = this->GPUExtent[3] =
-    this->GPUExtent[4] = this->GPUExtent[5] = 0;
-  this->CPUExtent[0] = this->CPUExtent[1] =
-    this->CPUExtent[2] = this->CPUExtent[3] =
-    this->CPUExtent[4] = this->CPUExtent[5] = 0;
-
-  // invalid extent.
-  this->TextureExtent[0] = 0;
-  this->TextureExtent[1] = -1;
-  this->TextureExtent[2] = 0;
-  this->TextureExtent[3] = -1;
-  this->TextureExtent[4] = 0;
-  this->TextureExtent[5] = -1;
-
-  this->MinTextureDimension=1;
-}
-
-//----------------------------------------------------------------------------
-vtkDataTransferHelper::~vtkDataTransferHelper()
-{
-  this->SetTexture(0);
-  this->SetArray(0);
-  this->SetContext(0);
-}
-
-//----------------------------------------------------------------------------
-// Description:
-// Tells if the given extent (6 int) is valid. True if min
-// extent<=max extent.
-// \pre extent_exists: extent!=0
-bool vtkDataTransferHelper::GetExtentIsValid(int *extent)
-{
-  assert("pre extent_exists:" && extent!=0);
-  return extent[0] <= extent[1] && extent[2]<= extent[3]
-    && extent[4]<= extent[5];
-}
-
-//----------------------------------------------------------------------------
-// Description:
-// Tells if CPUExtent is valid. True if min extent<=max extent.
-bool vtkDataTransferHelper::GetCPUExtentIsValid()
-{
-  return this->GetExtentIsValid(this->CPUExtent);
-}
-
-//----------------------------------------------------------------------------
-// Description:
-// Tells if GPUExtent is valid. True if min extent<=max extent.
-bool vtkDataTransferHelper::GetGPUExtentIsValid()
-{
-  return this->GetExtentIsValid(this->GPUExtent);
-}
-
-//----------------------------------------------------------------------------
-// Description:
-// Tells if TextureExtent is valid. True if min extent<=max extent.
-bool vtkDataTransferHelper::GetTextureExtentIsValid()
-{
-  return this->GetExtentIsValid(this->TextureExtent);
-}
-
-//----------------------------------------------------------------------------
-// Description:
-// Returns if the context supports the required extensions.
-bool vtkDataTransferHelper::IsSupported(vtkRenderWindow* renWin)
-{
-  vtkOpenGLRenderWindow *rw = vtkOpenGLRenderWindow::SafeDownCast(renWin);
-  return (vtkPixelBufferObject::IsSupported(renWin) &&
-    vtkTextureObject::IsSupported(rw));
-}
-
-//----------------------------------------------------------------------------
-vtkRenderWindow* vtkDataTransferHelper::GetContext()
-{
-  return this->Context;
-}
-
-//----------------------------------------------------------------------------
-void vtkDataTransferHelper::SetContext(vtkRenderWindow* renWin)
-{
-  if (renWin == this->Context)
-    {
-    return;
-    }
-
-  if (this->Texture && this->Texture->GetContext() != renWin)
-    {
-    this->SetTexture(0);
-    }
-
-  vtkOpenGLRenderWindow* openGLRenWin = vtkOpenGLRenderWindow::SafeDownCast(renWin);
-  this->Context = openGLRenWin;
-  // release the old PBO.
-  this->PBO = 0;
-  this->Modified();
-}
-
-//----------------------------------------------------------------------------
-// Description:
-// Upload GPUExtent from CPU vtkDataArray to GPU texture.
-// It is possible to send a subset of the components or to specify and
-// order of components or both. If components=0, componentList is ignored
-// and all components are passed, a texture cannot have more than 4
-// components.
-// \pre array_exists: array!=0
-// \pre array_not_empty: array->GetNumberOfTuples()>0
-// \pre valid_cpu_extent: this->GetCPUExtentIsValid()
-// \pre valid_cpu_extent_size: (CPUExtent[1]-CPUExtent[0]+1)*(CPUExtent[3]-CPUExtent[2]+1)*(CPUExtent[5]-CPUExtent[4]+1)==array->GetNumberOfTuples()
-  // \pre valid_gpu_extent: this->GetGPUExtentIsValid()
-  // \pre gpu_extent_in_cpu_extent: CPUExtent[0]<=GPUExtent[0] && GPUExtent[1]<=CPUExtent[1] && CPUExtent[2]<=GPUExtent[2] && GPUExtent[3]<=CPUExtent[3] && CPUExtent[4]<=GPUExtent[4] && GPUExtent[5]<=CPUExtent[5]
-  // \pre gpu_texture_size: !this->GetTextureExtentIsValid() || (GPUExtent[1]-GPUExtent[0]+1)*(GPUExtent[3]-GPUExtent[2]+1)*(GPUExtent[5]-GPUExtent[4]+1)==(TextureExtent[1]-TextureExtent[0]+1)*(TextureExtent[3]-TextureExtent[2]+1)*(TextureExtent[5]-TextureExtent[4]+1)
-  // \pre texture_can_exist_or_not: texture==0 || texture!=0
-  // \pre valid_components: (components==0 && componentList==0 && array->GetNumberOfComponents()<=4) || (components>=1 && components<=array->GetNumberOfComponents() && components<=4 && componentList!=0)
-bool vtkDataTransferHelper::Upload(int components,
-                                      int *componentList)
-{
-  assert("pre: array_exists" && this->Array!=0);
-  assert("pre: array_not_empty" && this->Array->GetNumberOfTuples()>0);
-  assert("pre: valid_cpu_extent" &&  this->GetCPUExtentIsValid());
-  assert("pre: valid_cpu_extent_size" &&
-         ((this->CPUExtent[1]-this->CPUExtent[0]+1)*
-          (this->CPUExtent[3]-this->CPUExtent[2]+1)*
-          (this->CPUExtent[5]-this->CPUExtent[4]+1)
-          ==this->Array->GetNumberOfTuples()));
-  assert("pre: valid_gpu_extent" && this->GetGPUExtentIsValid());
-  assert("pre: gpu_extent_in_cpu_extent" &&
-         (this->CPUExtent[0]<=this->GPUExtent[0] &&
-          this->GPUExtent[1]<=this->CPUExtent[1] &&
-          this->CPUExtent[2]<=this->GPUExtent[2] &&
-          this->GPUExtent[3]<=this->CPUExtent[3] &&
-          this->CPUExtent[4]<=this->GPUExtent[4] &&
-          this->GPUExtent[5]<=this->CPUExtent[5]));
-  assert("pre: gpu_texture_size" &&
-         (!this->GetTextureExtentIsValid() ||
-          ((this->GPUExtent[1]-this->GPUExtent[0]+1)*
-           (this->GPUExtent[3]-this->GPUExtent[2]+1)*
-           (this->GPUExtent[5]-this->GPUExtent[4]+1)==
-           (this->TextureExtent[1]-this->TextureExtent[0]+1)*
-           (this->TextureExtent[3]-this->TextureExtent[2]+1)*
-           (this->TextureExtent[5]-this->TextureExtent[4]+1))));
-  assert("pre: texture_can_exist_or_not" && (this->Texture==0 ||
-                                             this->Texture!=0));
-  assert("pre: valid_components" &&
-         ((components==0 && componentList==0 &&
-           this->Array->GetNumberOfComponents()<=4) ||
-          (components>=1 && components<=this->Array->GetNumberOfComponents()
-           && components<=4 && componentList!=0)));
-
-  if (!this->Context)
-    {
-    vtkErrorMacro("Cannot upload to GPU without context.");
-    return false;
-    }
-
-  int cpudims[3];
-  int gpudims[3];
-  int texturedims[3];
-  vtkGetDimensions(this->CPUExtent, cpudims);
-  vtkGetDimensions(this->GPUExtent, gpudims);
-  vtkDebugMacro( << "CPUDims: " << cpudims[0] << ", " << cpudims[1]
-                 << ", " << cpudims[2] << endl );
-  vtkDebugMacro( << "GPUDims: " << gpudims[0] << ", " << gpudims[1]
-                 << ", " << gpudims[2] << endl );
-  if(!this->GetTextureExtentIsValid())
-    {
-      // use GPU extent.
-      texturedims[0]=gpudims[0];
-      texturedims[1]=gpudims[1];
-      texturedims[2]=gpudims[2];
-    }
-  else
-    {
-      vtkGetDimensions(this->TextureExtent, texturedims);
-    }
-
-  int numComps = this->Array->GetNumberOfComponents();
-
-  // * Upload data to vtkPixelBufferObject.
-  vtkSmartPointer<vtkPixelBufferObject> pbo = this->GetPBO();
-
-  // We need to get the ContinuousIncrements as computed by the vtkImageData.
-  // For that we create a dummy image data object,
-  vtkSmartPointer<vtkImageData> tempImg = vtkSmartPointer<vtkImageData>::New();
-  tempImg->SetDimensions(1, 1, 1);
-  // scalars are needed for ComputeIncrements().
-  tempImg->AllocateScalars(VTK_DOUBLE, 1);
-  tempImg->SetExtent(this->CPUExtent);
-
-  vtkIdType continuousInc[3];
-  tempImg->GetContinuousIncrements(this->GPUExtent,
-    continuousInc[0], continuousInc[1], continuousInc[2]);
-  tempImg=0;
-
-  int pt[3] = {this->GPUExtent[0]-this->CPUExtent[0],
-    this->GPUExtent[2]-this->CPUExtent[2],
-    this->GPUExtent[4]-this->CPUExtent[4]};
-
-  vtkIdType ptId = vtkStructuredData::ComputePointId(cpudims, pt);
-  if (!pbo->Upload3D(
-    this->Array->GetDataType(), this->Array->GetVoidPointer(ptId*numComps),
-    reinterpret_cast<unsigned int*>(gpudims), numComps, continuousInc,
-    components,componentList))
-    {
-    vtkErrorMacro("Failed to load data to pixel buffer.");
-    return false;
-    }
-
-  // * Now, we need to create a Texture for the uploaded data.
-  if (!this->Texture)
-    {
-    vtkTextureObject* tex = vtkTextureObject::New();
-    tex->SetContext(vtkOpenGLRenderWindow::SafeDownCast(this->Context));
-    this->SetTexture(tex);
-    tex->Delete();
-    }
-
-  int tempdims[3] = {0, 0, 0};
-  int dataDescription = vtkStructuredData::SetDimensions(texturedims, tempdims);
-  int dimension = vtkStructuredData::GetDataDimension(dataDescription);
-
-
-  bool uploaded = false;
-  switch (dimension)
-    {
-    case 0: // 1 pixel image
-    case 1:
-      {
-        unsigned int length=0;
-        switch (dataDescription)
-          {
-          case VTK_SINGLE_POINT:
-            length=1;
-            break;
-          case VTK_X_LINE:
-            length = static_cast<unsigned int>(texturedims[0]);
-            break;
-          case VTK_Y_LINE:
-            length = static_cast<unsigned int>(texturedims[1]);
-            break;
-          case VTK_Z_LINE:
-            length = static_cast<unsigned int>(texturedims[2]);
-            break;
-          }
-        switch(this->MinTextureDimension)
-          {
-          case 1:
-            uploaded = this->Texture->Create1D(numComps, pbo,
-                                               this->ShaderSupportsTextureInt);
-            break;
-          case 2:
-            uploaded = this->Texture->Create2D(length,1,numComps, pbo,
-                                               this->ShaderSupportsTextureInt);
-            break;
-          case 3:
-            uploaded = this->Texture->Create3D(length, 1, 1, numComps,
-                                               pbo,
-                                               this->ShaderSupportsTextureInt);
-            break;
-          default:
-            assert("check: impossible case" && 0);
-            break;
-          }
-      }
-      break;
-
-    case 2:
-      {
-        unsigned int width=0;
-        unsigned int height=0;
-#if 0
-        switch (dataDescription)
-          {
-          case VTK_XY_PLANE:
-            width = gpudims[0];
-            height = gpudims[1];
-            break;
-
-          case VTK_YZ_PLANE:
-            width = gpudims[1];
-            height = gpudims[2];
-            break;
-
-          case VTK_XZ_PLANE:
-            width = gpudims[0];
-            height = gpudims[2];
-            break;
-          }
-#else
-#if 1
-        switch (dataDescription)
-          {
-          case VTK_XY_PLANE:
-            width = static_cast<unsigned int>(texturedims[0]);
-            height = static_cast<unsigned int>(texturedims[1]);
-            break;
-
-          case VTK_YZ_PLANE:
-            width = static_cast<unsigned int>(texturedims[1]);
-            height = static_cast<unsigned int>(texturedims[2]);
-            break;
-
-          case VTK_XZ_PLANE:
-            width = static_cast<unsigned int>(texturedims[0]);
-            height = static_cast<unsigned int>(texturedims[2]);
-            break;
-          }
-#else
-        width = texturedims[0];
-        height = texturedims[1];
-#endif
-#endif
-        switch(this->MinTextureDimension)
-          {
-          case 1:
-          case 2:
-            uploaded =this->Texture->Create2D(width, height, numComps, pbo,
-                                              this->ShaderSupportsTextureInt);
-            break;
-          case 3:
-            uploaded =this->Texture->Create3D(width, height, 1, numComps, pbo,
-                                              this->ShaderSupportsTextureInt);
-            break;
-          default:
-            assert("check: impossible case" && 0);
-            break;
-          }
-      }
-      break;
-
-    case 3:
-      uploaded = this->Texture->Create3D(
-        static_cast<unsigned int>(texturedims[0]),
-        static_cast<unsigned int>(texturedims[1]),
-        static_cast<unsigned int>(texturedims[2]),
-        numComps, pbo,
-        this->ShaderSupportsTextureInt);
-      break;
-    }
-
-  pbo->ReleaseMemory();
-  if (!uploaded)
-    {
-    vtkErrorMacro("Failed to upload data to texture.");
-    return false;
-    }
-  return true;
-}
-
-//----------------------------------------------------------------------------
-// Description:
-// new comment:
-// Download GPUExtent from GPU texture to CPU vtkDataArray.
-// If Array is not provided, it will be created with the size of CPUExtent.
-// But only the tuples covered by GPUExtent will be download. In this case,
-// if GPUExtent does not cover all GPUExtent, some of the vtkDataArray will
-// be uninitialized.
-// Reminder: A=>B <=> !A||B
-// \pre texture_exists: texture!=0
-// \pre array_not_empty: array==0 || array->GetNumberOfTuples()>0
-// \pre valid_cpu_extent: this->GetCPUExtentIsValid()
-// \pre valid_cpu_extent_size: array==0 || (CPUExtent[1]-CPUExtent[0]+1)*(CPUExtent[3]-CPUExtent[2]+1)*(CPUExtent[5]-CPUExtent[4]+1)==array->GetNumberOfTuples()
-// \pre valid_gpu_extent: this->GetGPUExtentIsValid()
-// \pre gpu_extent_in_cpu_extent: CPUExtent[0]<=GPUExtent[0] && GPUExtent[1]<=CPUExtent[1] && CPUExtent[2]<=GPUExtent[2] && GPUExtent[3]<=CPUExtent[3] && CPUExtent[4]<=GPUExtent[4] && GPUExtent[5]<=CPUExtent[5]
-// \pre gpu_texture_size: !this->GetTextureExtentIsValid() || (GPUExtent[1]-GPUExtent[0]+1)*(GPUExtent[3]-GPUExtent[2]+1)*(GPUExtent[5]-GPUExtent[4]+1)==(TextureExtent[1]-TextureExtent[0]+1)*(TextureExtent[3]-TextureExtent[2]+1)*(TextureExtent[5]-TextureExtent[4]+1)
-// \pre valid_components: array==0 || array->GetNumberOfComponents()<=4
-// \pre components_match: array==0 || (texture->GetComponents()==array->GetNumberOfComponents())
-bool vtkDataTransferHelper::Download()
-{
-  return (this->DownloadAsync1() && this->DownloadAsync2());
-}
-
-//----------------------------------------------------------------------------
-bool vtkDataTransferHelper::DownloadAsync1()
-{
-  if (!this->Context)
-    {
-    vtkErrorMacro("Cannot download from GPU without context.");
-    return false;
-    }
-
-  assert("pre: texture_exists" && this->Texture!=0);
-  assert("pre: array_not_empty" && (this->Array==0 ||
-      this->Array->GetNumberOfTuples()>0));
-  assert("pre: valid_cpu_extent" && this->GetCPUExtentIsValid());
-  assert("pre: valid_cpu_extent_size" &&
-    (this->Array==0 ||
-     ((this->CPUExtent[1]-this->CPUExtent[0]+1)*
-      (this->CPUExtent[3]-this->CPUExtent[2]+1)*
-      (this->CPUExtent[5]-this->CPUExtent[4]+1)==
-      this->Array->GetNumberOfTuples())));
-  assert("pre: valid_gpu_extent" && this->GetGPUExtentIsValid());
-  assert("pre: gpu_extent_in_cpu_extent" &&
-    (this->CPUExtent[0]<=this->GPUExtent[0] &&
-     this->GPUExtent[1]<=this->CPUExtent[1] &&
-     this->CPUExtent[2]<=this->GPUExtent[2] &&
-     this->GPUExtent[3]<=this->CPUExtent[3] &&
-     this->CPUExtent[4]<=this->GPUExtent[4] &&
-     this->GPUExtent[5]<=this->CPUExtent[5]));
-  assert("pre: gpu_texture_size" &&
-    (!this->GetTextureExtentIsValid() ||
-     ((this->GPUExtent[1]-this->GPUExtent[0]+1)*
-      (this->GPUExtent[3]-this->GPUExtent[2]+1)*
-      (this->GPUExtent[5]-this->GPUExtent[4]+1)==
-      (this->TextureExtent[1]-this->TextureExtent[0]+1)*
-      (this->TextureExtent[3]-this->TextureExtent[2]+1)*
-      (this->TextureExtent[5]-this->TextureExtent[4]+1))));
-  assert("pre: texture_can_exist_or_not" && (this->Texture==0 ||
-      this->Texture!=0));
-  assert("pre: valid_components" && (this->Array==0 ||
-      this->Array->GetNumberOfComponents()<=4));
-  assert("pre: components_match" && (this->Array==0 ||
-      (this->Texture->GetComponents()==
-       this->Array->GetNumberOfComponents())));
-
-  int numComps = this->Texture->GetComponents();
-  int cpudims[3];
-  int gpudims[3];
-  vtkGetDimensions(this->CPUExtent, cpudims);
-  vtkGetDimensions(this->GPUExtent, gpudims);
-
-  // * Download data to vtkPixelBufferObject.
-  vtkSmartPointer<vtkPixelBufferObject> pbo;
-  pbo.TakeReference(this->Texture->Download());
-
-  if (!pbo.GetPointer())
-    {
-    vtkErrorMacro("Failed to download texture to a Pixel Buffer object.");
-    return false;
-    }
-
-  if (pbo->GetSize() <
-    static_cast<unsigned int>(gpudims[0]*gpudims[1]*gpudims[2]*numComps))
-    {
-    vtkErrorMacro("GPU data size is smaller than GPUExtent.");
-    return false;
-    }
-
-  this->AsyncDownloadPBO = pbo;
-  return true;
-}
-
-//----------------------------------------------------------------------------
-bool vtkDataTransferHelper::DownloadAsync2()
-{
-  if (!this->AsyncDownloadPBO)
-    {
-    vtkErrorMacro("DownloadAsync1() must be called successfully "
-      "before calling DownloadAsync2().");
-    return false;
-    }
-
-  int numComps = this->Texture->GetComponents();
-  int cpudims[3];
-  int gpudims[3];
-  vtkGetDimensions(this->CPUExtent, cpudims);
-  vtkGetDimensions(this->GPUExtent, gpudims);
-
-  if (!this->Array)
-    {
-    vtkDataArray* array = vtkDataArray::CreateDataArray(
-      this->Texture->GetVTKDataType());
-    this->SetArray(array);
-    array->Delete();
-    this->Array->SetNumberOfComponents(numComps);
-    this->Array->SetNumberOfTuples(cpudims[0]*cpudims[1]*cpudims[2]);
-    }
-
-  // We need to get the ContinuousIncrements as computed by the vtkImageData.
-  // For that we create a dummy image data object,
-  vtkSmartPointer<vtkImageData> tempImg = vtkSmartPointer<vtkImageData>::New();
-  tempImg->SetDimensions(1, 1, 1);
-  // scalars are needed for ComputeIncrements().
-  tempImg->AllocateScalars(VTK_DOUBLE, 1);
-  tempImg->SetExtent(this->CPUExtent);
-
-  vtkIdType continuousInc[3];
-  tempImg->GetContinuousIncrements(this->GPUExtent,
-    continuousInc[0], continuousInc[1], continuousInc[2]);
-  tempImg=0;
-
-  int pt[3] = {this->GPUExtent[0]-this->CPUExtent[0],
-    this->GPUExtent[2]-this->CPUExtent[2],
-    this->GPUExtent[4]-this->CPUExtent[4]};
-
-  vtkIdType ptId = vtkStructuredData::ComputePointId(cpudims, pt);
-  bool reply = this->AsyncDownloadPBO->Download3D(this->Array->GetDataType(),
-    this->Array->GetVoidPointer(ptId*numComps),
-    reinterpret_cast<unsigned int*>(gpudims), numComps,
-    continuousInc);
-  this->AsyncDownloadPBO = 0;
-  return reply;
-}
-
-//----------------------------------------------------------------------------
-bool vtkDataTransferHelper::GetShaderSupportsTextureInt()
-{
-  return this->ShaderSupportsTextureInt;
-}
-
-//----------------------------------------------------------------------------
-void vtkDataTransferHelper::SetShaderSupportsTextureInt(bool value)
-{
-  this->ShaderSupportsTextureInt = value;
-}
-
-//----------------------------------------------------------------------------
-vtkPixelBufferObject* vtkDataTransferHelper::GetPBO()
-{
-  if (!this->PBO.GetPointer())
-    {
-    this->PBO = vtkSmartPointer<vtkPixelBufferObject>::New();
-    this->PBO->SetContext(this->Context);
-    }
-
-  return this->PBO;
-}
-
-//----------------------------------------------------------------------------
-void vtkDataTransferHelper::PrintSelf( ostream & os, vtkIndent indent )
-{
-  this->Superclass::PrintSelf( os, indent );
-
-  os << indent << "Array: "               << this->Array               << endl;
-  os << indent << "Texture: "             << this->Texture             << endl;
-  os << indent << "MinTextureDimension: " << this->MinTextureDimension << endl;
-  os << indent << "CPUExtent: ("     << this->CPUExtent[0] << ", "
-                                     << this->CPUExtent[1] << ", "
-                                     << this->CPUExtent[2] << ", "
-                                     << this->CPUExtent[3] << ", "
-                                     << this->CPUExtent[4] << ", "
-                                     << this->CPUExtent[5] << ")"  << endl;
-  os << indent << "GPUExtent: ("     << this->GPUExtent[0] << ", "
-                                     << this->GPUExtent[1] << ", "
-                                     << this->GPUExtent[2] << ", "
-                                     << this->GPUExtent[3] << ", "
-                                     << this->GPUExtent[4] << ", "
-                                     << this->GPUExtent[5] << ")"  << endl;
-  os << indent << "TextureExtent: (" << this->TextureExtent[0] << ", "
-                                     << this->TextureExtent[1] << ", "
-                                     << this->TextureExtent[2] << ", "
-                                     << this->TextureExtent[3] << ", "
-                                     << this->TextureExtent[4] << ", "
-                                     << this->TextureExtent[5] << ")"  << endl;
-}
diff --git a/Rendering/OpenGL2/vtkDataTransferHelper.h b/Rendering/OpenGL2/vtkDataTransferHelper.h
deleted file mode 100644
index e0c4c9a..0000000
--- a/Rendering/OpenGL2/vtkDataTransferHelper.h
+++ /dev/null
@@ -1,216 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkDataTransferHelper.h
-
-  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.
-
-=========================================================================*/
-// .NAME vtkDataTransferHelper - is a helper class that aids in transferring
-//  data between CPU memory and GPU memory.
-//
-// .SECTION Description
-//  vtkDataTransferHelper is a helper class that aids in transferring data
-//  between the CPU memory and the GPU memory. The data in GPU memory is
-//  stored as textures which that in CPU memory is stored as vtkDataArray.
-//  vtkDataTransferHelper provides API to transfer only a sub-extent of CPU
-//  structured data to/from the GPU.
-//
-// .SECTION see also
-//  vtkPixelBufferObject vtkTextureObject vtkOpenGLExtensionManager
-
-#ifndef vtkDataTransferHelper_h
-#define vtkDataTransferHelper_h
-
-#include "vtkRenderingOpenGL2Module.h" // For export macro
-#include "vtkObject.h"
-#include "vtkWeakPointer.h" // needed for vtkWeakPointer.
-#include "vtkSmartPointer.h" // needed for vtkSmartPointer.
-
-class vtkDataArray;
-class vtkPixelBufferObject;
-class vtkTextureObject;
-class vtkRenderWindow;
-
-class VTKRENDERINGOPENGL2_EXPORT vtkDataTransferHelper : public vtkObject
-{
-public:
-  static vtkDataTransferHelper* New();
-  vtkTypeMacro(vtkDataTransferHelper, vtkObject);
-  void PrintSelf(ostream& os, vtkIndent indent);
-
-  // Description:
-  // Get/Set the context. Context must be a vtkOpenGLRenderWindow.
-  // This does not increase the reference count of the
-  // context to avoid reference loops.
-  // SetContext() may raise an error is the OpenGL context does not support the
-  // required OpenGL extensions.
-  void SetContext(vtkRenderWindow* context);
-  vtkRenderWindow* GetContext();
-
-  // Description:
-  // Set the CPU data extent. The extent matches the vtkDataArray size.
-  // If the vtkDataArray comes from an vtkImageData and it is part of the
-  // point data, it is usually the vtkImageData extent.
-  // It can be on cell data too, but in this case it does not match the
-  // vtkImageData extent.
-  // If the vtkDataArray comes from a vtkDataSet, just
-  // set it to a one-dimenstional extent equal to the number of tuples.
-  // Initial value is (0,0,0,0,0,0), a valid one tuple array.
-  vtkSetVector6Macro(CPUExtent, int);
-  vtkGetVector6Macro(CPUExtent, int);
-
-  // Description:
-  // Set the GPU data extent. This is the sub-extent to copy from or to the GPU.
-  // This extent matches the size of the data to transfer.
-  // GPUExtent and TextureExtent don't have to match (GPUExtent can be 1D
-  // whereas TextureExtent is 2D) but the number of elements have to match.
-  // Initial value is (0,0,0,0,0,0), a valid one tuple array.
-  vtkSetVector6Macro(GPUExtent, int);
-  vtkGetVector6Macro(GPUExtent, int);
-
-  // Description:
-  // Set the texture data extent. This is the extent of the texture image that
-  // will receive the data. This extent matches the size of the data to
-  // transfer. If it is set to an invalid extent, GPUExtent is used.
-  // See more comment on GPUExtent.
-  // Initial value is an invalid extent.
-  vtkSetVector6Macro(TextureExtent, int);
-  vtkGetVector6Macro(TextureExtent, int);
-
-  // Description:
-  // Tells if the given extent (6 int) is valid. True if min
-  // extent<=max extent.
-  // \pre extent_exists: extent!=0
-  bool GetExtentIsValid(int *extent);
-
-  // Description:
-  // Tells if CPUExtent is valid. True if min extent<=max extent.
-  bool GetCPUExtentIsValid();
-
-  // Description:
-  // Tells if GPUExtent is valid. True if min extent<=max extent.
-  bool GetGPUExtentIsValid();
-
-  // Description:
-  // Tells if TextureExtent is valid. True if min extent<=max extent.
-  bool GetTextureExtentIsValid();
-
-  // Description:
-  // Define the minimal dimension of the texture regardless of the dimensions
-  // of the TextureExtent. Initial value is 1.
-  // A texture extent can have a given dimension 0D (one value), 1D, 2D or 3D.
-  // By default 0D and 1D are translated into a 1D texture, 2D is translated
-  // into a 2D texture, 3D is translated into a 3D texture. To make life easier
-  // when writing GLSL code and use only one type of sampler (ex: sampler2d),
-  // the default behavior can be changed by forcing a type of texture with
-  // this ivar.
-  // 1: default behavior. Initial value.
-  // 2: force 0D and 1D to be in a 2D texture
-  // 3: force 0D, 1D and 2D texture to be in a 3D texture.
-  vtkSetMacro(MinTextureDimension,int);
-  vtkGetMacro(MinTextureDimension,int);
-
-  // Description:
-  // Get/Set the CPU data buffer. Initial value is 0.
-  vtkGetObjectMacro(Array, vtkDataArray);
-  void SetArray(vtkDataArray* array);
-
-  // Description:
-  // Get/Set the GPU data buffer. Initial value is 0.
-  vtkGetObjectMacro(Texture, vtkTextureObject);
-  void SetTexture(vtkTextureObject* texture);
-
-  // Description:
-  // Old comment.
-  // Upload Extent from CPU data buffer to GPU.
-  // The WholeExtent must match the Array size.
-  // New comment.
-  // Upload GPUExtent from CPU vtkDataArray to GPU texture.
-  // It is possible to send a subset of the components or to specify and
-  // order of components or both. If components=0, componentList is ignored
-  // and all components are passed, a texture cannot have more than 4
-  // components.
-  // \pre array_exists: array!=0
-  // \pre array_not_empty: array->GetNumberOfTuples()>0
-  // \pre valid_cpu_extent: this->GetCPUExtentIsValid()
-  // \pre valid_cpu_extent_size: (CPUExtent[1]-CPUExtent[0]+1)*(CPUExtent[3]-CPUExtent[2]+1)*(CPUExtent[5]-CPUExtent[4]+1)==array->GetNumberOfTuples()
-  // \pre valid_gpu_extent: this->GetGPUExtentIsValid()
-  // \pre gpu_extent_in_cpu_extent: CPUExtent[0]<=GPUExtent[0] && GPUExtent[1]<=CPUExtent[1] && CPUExtent[2]<=GPUExtent[2] && GPUExtent[3]<=CPUExtent[3] && CPUExtent[4]<=GPUExtent[4] && GPUExtent[5]<=CPUExtent[5]
-  // \pre gpu_texture_size: !this->GetTextureExtentIsValid() || (GPUExtent[1]-GPUExtent[0]+1)*(GPUExtent[3]-GPUExtent[2]+1)*(GPUExtent[5]-GPUExtent[4]+1)==(TextureExtent[1]-TextureExtent[0]+1)*(TextureExtent[3]-TextureExtent[2]+1)*(TextureExtent[5]-TextureExtent[4]+1)
-  // \pre texture_can_exist_or_not: texture==0 || texture!=0
-  // \pre valid_components: (components==0 && componentList==0 && array->GetNumberOfComponents()<=4) || (components>=1 && components<=array->GetNumberOfComponents() && components<=4 && componentList!=0)
-  bool Upload(int components=0,
-              int *componentList=NULL);
-
-  // Description:
-  // old comment:
-  // Download Extent from GPU data buffer to CPU.
-  // GPU data size must exactly match Extent.
-  // CPU data buffer will be resized to match WholeExtent in which only the
-  // Extent will be filled with the GPU data.
-  // new comment:
-  // Download GPUExtent from GPU texture to CPU vtkDataArray.
-  // If Array is not provided, it will be created with the size of CPUExtent.
-  // But only the tuples covered by GPUExtent will be download. In this case,
-  // if GPUExtent does not cover all GPUExtent, some of the vtkDataArray will
-  // be uninitialized.
-  // Reminder: A=>B <=> !A||B
-  // \pre texture_exists: texture!=0
-  // \pre array_not_empty: array==0 || array->GetNumberOfTuples()>0
-  // \pre valid_cpu_extent: this->GetCPUExtentIsValid()
-  // \pre valid_cpu_extent_size: array==0 || (CPUExtent[1]-CPUExtent[0]+1)*(CPUExtent[3]-CPUExtent[2]+1)*(CPUExtent[5]-CPUExtent[4]+1)==array->GetNumberOfTuples()
-  // \pre valid_gpu_extent: this->GetGPUExtentIsValid()
-  // \pre gpu_extent_in_cpu_extent: CPUExtent[0]<=GPUExtent[0] && GPUExtent[1]<=CPUExtent[1] && CPUExtent[2]<=GPUExtent[2] && GPUExtent[3]<=CPUExtent[3] && CPUExtent[4]<=GPUExtent[4] && GPUExtent[5]<=CPUExtent[5]
-  // \pre gpu_texture_size: !this->GetTextureExtentIsValid() || (GPUExtent[1]-GPUExtent[0]+1)*(GPUExtent[3]-GPUExtent[2]+1)*(GPUExtent[5]-GPUExtent[4]+1)==(TextureExtent[1]-TextureExtent[0]+1)*(TextureExtent[3]-TextureExtent[2]+1)*(TextureExtent[5]-TextureExtent[4]+1)
-  // \pre valid_components: array==0 || array->GetNumberOfComponents()<=4
-  // \pre components_match: array==0 || (texture->GetComponents()==array->GetNumberOfComponents())
-  bool Download();
-
-  // Description:
-  // Splits the download in two operations
-  // * Asynchronously download from texture memory to PBO (DownloadAsync1()).
-  // * Copy from pbo to user array (DownloadAsync2()).
-  bool DownloadAsync1();
-  bool DownloadAsync2();
-
-  bool GetShaderSupportsTextureInt();
-  void SetShaderSupportsTextureInt(bool value);
-
-  // Description:
-  // Returns if the context supports the required extensions.
-  static bool IsSupported(vtkRenderWindow* renWin);
-//BTX
-protected:
-  vtkDataTransferHelper();
-  ~vtkDataTransferHelper();
-
-  int CPUExtent[6];
-  int GPUExtent[6];
-  int TextureExtent[6];
-
-  vtkWeakPointer<vtkRenderWindow> Context;
-  vtkTextureObject* Texture;
-  vtkDataArray* Array;
-  bool ShaderSupportsTextureInt;
-  int MinTextureDimension;
-
-  vtkSmartPointer<vtkPixelBufferObject> AsyncDownloadPBO;
-
-  vtkPixelBufferObject* GetPBO();
-
-  // We try to reuse the PBO if possible.
-  vtkSmartPointer<vtkPixelBufferObject> PBO;
-private:
-  vtkDataTransferHelper(const vtkDataTransferHelper&); // Not implemented.
-  void operator=(const vtkDataTransferHelper&); // Not implemented.
-//ETX
-};
-
-#endif
diff --git a/Rendering/OpenGL2/vtkDepthPeelingPass.cxx b/Rendering/OpenGL2/vtkDepthPeelingPass.cxx
index 400ac23..63b1bc2 100644
--- a/Rendering/OpenGL2/vtkDepthPeelingPass.cxx
+++ b/Rendering/OpenGL2/vtkDepthPeelingPass.cxx
@@ -30,7 +30,7 @@ PURPOSE.  See the above copyright notice for more information.
 #include <cassert>
 #include <list>
 
-#include "vtkOpenGLHelper.h"
+#include "vtkglVBOHelper.h"
 
 // the 2D blending shaders we use
 #include "vtkDepthPeelingPassIntermediateFS.h"
@@ -73,7 +73,11 @@ vtkDepthPeelingPass::~vtkDepthPeelingPass()
     {
     this->TranslucentPass->Delete();
     }
-  delete this->DepthZData;
+  if (this->DepthZData)
+    {
+    delete this->DepthZData;
+    this->DepthZData = 0;
+    }
   if (this->OpaqueZTexture)
     {
     this->OpaqueZTexture->UnRegister(this);
@@ -124,25 +128,10 @@ void vtkDepthPeelingPass::ReleaseGraphicsResources(vtkWindow *w)
     {
     this->TranslucentPass->ReleaseGraphicsResources(w);
     }
-  if (this->OpaqueZTexture)
-    {
-    this->OpaqueZTexture->ReleaseGraphicsResources(w);
-    }
-  if (this->TranslucentZTexture)
-    {
-    this->TranslucentZTexture->ReleaseGraphicsResources(w);
-    }
-  if (this->OpaqueRGBATexture)
-    {
-    this->OpaqueRGBATexture->ReleaseGraphicsResources(w);
-    }
-  if (this->TranslucentRGBATexture)
-    {
-    this->TranslucentRGBATexture->ReleaseGraphicsResources(w);
-    }
-  if (this->CurrentRGBATexture)
+
+  if(this->TranslucentPass)
     {
-    this->CurrentRGBATexture->ReleaseGraphicsResources(w);
+    this->TranslucentPass->ReleaseGraphicsResources(w);
     }
 }
 
@@ -209,9 +198,7 @@ vtkTextureObject *vtkDepthPeelingPassCreateTextureObject(
   return result;
 }
 
-void vtkDepthPeelingPass::BlendIntermediatePeels(
-  vtkOpenGLRenderWindow *renWin,
-  bool done)
+void vtkDepthPeelingPass::BlendIntermediatePeels(vtkOpenGLRenderWindow *renWin)
 {
   this->CurrentRGBATexture->CopyFromFrameBuffer(this->ViewportX, this->ViewportY,
     this->ViewportX, this->ViewportY,
@@ -220,34 +207,30 @@ void vtkDepthPeelingPass::BlendIntermediatePeels(
   // take the TranslucentRGBA texture and blend it with the current frame buffer
   if (!this->IntermediateBlendProgram)
     {
-    this->IntermediateBlendProgram = new vtkOpenGLHelper;
+    this->IntermediateBlendProgram = new vtkgl::CellBO;
     std::string VSSource = vtkTextureObjectVS;
     std::string FSSource = vtkDepthPeelingPassIntermediateFS;
     std::string GSSource;
     this->IntermediateBlendProgram->Program =
-      renWin->GetShaderCache()->ReadyShaderProgram(
-        VSSource.c_str(),
-        FSSource.c_str(),
-        GSSource.c_str());
+        renWin->GetShaderCache()->ReadyShader(VSSource.c_str(),
+                                              FSSource.c_str(),
+                                              GSSource.c_str());
     }
   else
     {
-    renWin->GetShaderCache()->ReadyShaderProgram(
-      this->IntermediateBlendProgram->Program);
+    renWin->GetShaderCache()->ReadyShader(this->IntermediateBlendProgram->Program);
     }
   this->IntermediateBlendProgram->Program->SetUniformi(
     "translucentRGBATexture", this->TranslucentRGBATexture->GetTextureUnit());
   this->IntermediateBlendProgram->Program->SetUniformi(
     "currentRGBATexture", this->CurrentRGBATexture->GetTextureUnit());
-  this->IntermediateBlendProgram->Program->SetUniformi(
-    "lastpass", done ? 1 : 0);
 
   glDisable(GL_DEPTH_TEST);
   this->CurrentRGBATexture->CopyToFrameBuffer(0, 0,
          this->ViewportWidth-1, this->ViewportHeight-1,
          0, 0, this->ViewportWidth, this->ViewportHeight,
          this->IntermediateBlendProgram->Program,
-         this->IntermediateBlendProgram->VAO);
+         &this->IntermediateBlendProgram->vao);
 }
 
 
@@ -255,20 +238,18 @@ void vtkDepthPeelingPass::BlendFinalPeel(vtkOpenGLRenderWindow *renWin)
 {
   if (!this->FinalBlendProgram)
     {
-    this->FinalBlendProgram = new vtkOpenGLHelper;
+    this->FinalBlendProgram = new vtkgl::CellBO;
     std::string VSSource = vtkTextureObjectVS;
     std::string FSSource = vtkDepthPeelingPassFinalFS;
     std::string GSSource;
     this->FinalBlendProgram->Program =
-      renWin->GetShaderCache()->ReadyShaderProgram(
-        VSSource.c_str(),
-        FSSource.c_str(),
-        GSSource.c_str());
+        renWin->GetShaderCache()->ReadyShader(VSSource.c_str(),
+                                              FSSource.c_str(),
+                                              GSSource.c_str());
     }
   else
     {
-    renWin->GetShaderCache()->ReadyShaderProgram(
-      this->FinalBlendProgram->Program);
+    renWin->GetShaderCache()->ReadyShader(this->FinalBlendProgram->Program);
     }
 
   this->FinalBlendProgram->Program->SetUniformi(
@@ -284,7 +265,7 @@ void vtkDepthPeelingPass::BlendFinalPeel(vtkOpenGLRenderWindow *renWin)
          this->ViewportWidth-1, this->ViewportHeight-1,
          0, 0, this->ViewportWidth, this->ViewportHeight,
          this->FinalBlendProgram->Program,
-         this->FinalBlendProgram->VAO);
+         &this->FinalBlendProgram->vao);
 }
 
 
@@ -319,21 +300,20 @@ void vtkDepthPeelingPass::Render(const vtkRenderState *s)
     return; // nothing to render.
     }
 
-  // check driver support
-  vtkOpenGLRenderWindow *renWin
-    = vtkOpenGLRenderWindow::SafeDownCast(s->GetRenderer()->GetRenderWindow());
-
   // we need alpha planes
-  int rgba[4];
-  renWin->GetColorBufferSizes(rgba);
-
-  if (rgba[3] < 8)
+  GLint alphaBits;
+  glGetIntegerv(GL_ALPHA_BITS, &alphaBits);
+  if (alphaBits < 8)
     {
     // just use alpha blending
     this->TranslucentPass->Render(s);
     return;
     }
 
+  // check driver support
+  vtkOpenGLRenderWindow *renWin
+    = vtkOpenGLRenderWindow::SafeDownCast(s->GetRenderer()->GetRenderWindow());
+
   // Depth peeling.
   vtkRenderer *r=s->GetRenderer();
 
@@ -398,10 +378,9 @@ void vtkDepthPeelingPass::Render(const vtkRenderState *s)
   this->SetLastRenderingUsedDepthPeeling(s->GetRenderer(), true);
 
   glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
-  glClearColor(0.0,0.0,0.0,0.0); // always clear to black
+//  glClearColor(0.0,0.0,0.0,0.0); // always clear to black
  // glClearDepth(static_cast<GLclampf>(1.0));
 #ifdef GL_MULTISAMPLE
-  GLboolean multiSampleStatus = glIsEnabled(GL_MULTISAMPLE);
   glDisable(GL_MULTISAMPLE);
 #endif
   glDisable(GL_BLEND);
@@ -451,7 +430,7 @@ void vtkDepthPeelingPass::Render(const vtkRenderState *s)
 #endif
 
   bool done = false;
-  GLuint nbPixels = threshold + 1;
+  GLuint nbPixels = 0;
   int peelCount = 0;
   while(!done)
     {
@@ -466,60 +445,38 @@ void vtkDepthPeelingPass::Render(const vtkRenderState *s)
     glBeginQuery(GL_SAMPLES_PASSED,queryId);
 #endif
 
-    // check if we are going to exceed the max number of peels or if we
-    // exceeded the pixel threshold last time
-    peelCount++;
-    if ((this->MaximumNumberOfPeels && peelCount >= this->MaximumNumberOfPeels) ||
-       nbPixels <= threshold)
-      {
-      done = true;
-      // if so we do this last render using alpha blending for all
-      // the stuff that is left
-      glEnable(GL_BLEND);
-      glDepthFunc( GL_ALWAYS );
-      }
     this->TranslucentPass->Render(s);
-    glDepthFunc( GL_LEQUAL );
-    glDisable(GL_BLEND);
+
+    // update translucentZ
+    this->TranslucentZTexture->CopyFromFrameBuffer(this->ViewportX, this->ViewportY,
+        this->ViewportX, this->ViewportY,
+        this->ViewportWidth, this->ViewportHeight);
 
 #if GL_ES_VERSION_2_0 != 1
     glEndQuery(GL_SAMPLES_PASSED);
     glGetQueryObjectuiv(queryId,GL_QUERY_RESULT,&nbPixels);
-#endif
-    // cerr << "Pass " << peelCount << " pixels Drawn " << nbPixels << "\n";
-
-    // if something was drawn, blend it in
-    if (nbPixels > 0)
+    if (nbPixels <= threshold)
       {
-      // update translucentZ
-      this->TranslucentZTexture->CopyFromFrameBuffer(this->ViewportX, this->ViewportY,
-          this->ViewportX, this->ViewportY,
-          this->ViewportWidth, this->ViewportHeight);
-
-
-      // blend the last two peels together
-      if (peelCount > 1)
-        {
-        this->BlendIntermediatePeels(renWin,done);
-        }
-
-      // update translucent RGBA
-      this->TranslucentRGBATexture->CopyFromFrameBuffer(this->ViewportX, this->ViewportY,
-        this->ViewportX, this->ViewportY,
-        this->ViewportWidth, this->ViewportHeight);
+      done = true;
       }
-    else // if we drew nothing we are done
+#endif
+    peelCount++;
+    if(this->MaximumNumberOfPeels && peelCount >= this->MaximumNumberOfPeels)
       {
-      // if we drew nothing on the very first frame we still
-      // need a valid texture to blend with so copy it
-      if (peelCount == 1)
-        {
-        this->TranslucentRGBATexture->CopyFromFrameBuffer(this->ViewportX, this->ViewportY,
-          this->ViewportX, this->ViewportY,
-          this->ViewportWidth, this->ViewportHeight);
-        }
       done = true;
       }
+    //cerr << "Pass " << peelCount << " pixels Drawn " << nbPixels << "\n";
+
+    // blend the last two peels together
+    if (peelCount > 1)
+      {
+      this->BlendIntermediatePeels(renWin);
+      }
+
+    // update translucent RGBA
+    this->TranslucentRGBATexture->CopyFromFrameBuffer(this->ViewportX, this->ViewportY,
+      this->ViewportX, this->ViewportY,
+      this->ViewportWidth, this->ViewportHeight);
     }
 
   // unload the textures we are done with
@@ -531,13 +488,6 @@ void vtkDepthPeelingPass::Render(const vtkRenderState *s)
   // do the final blend
   this->BlendFinalPeel(renWin);
 
-#ifdef GL_MULTISAMPLE
-   if(multiSampleStatus)
-      {
-      glEnable(GL_MULTISAMPLE);
-      }
-#endif
-
   // unload the last two textures
   this->TranslucentRGBATexture->Deactivate();
   this->OpaqueRGBATexture->Deactivate();
@@ -545,16 +495,6 @@ void vtkDepthPeelingPass::Render(const vtkRenderState *s)
   // restore blending
   glEnable(GL_BLEND);
 
-  c = s->GetPropArrayCount();
-  for (i = 0; i < c; i++)
-    {
-    vtkProp *p=s->GetPropArray()[i];
-    vtkInformation *info = p->GetPropertyKeys();
-    info->Remove(vtkDepthPeelingPass::OpaqueZTextureUnit());
-    info->Remove(vtkDepthPeelingPass::TranslucentZTextureUnit());
-    info->Remove(vtkDepthPeelingPass::DestinationSize());
-    }
-
   this->NumberOfRenderedProps = this->TranslucentPass->GetNumberOfRenderedProps();
 
   vtkOpenGLCheckErrorMacro("failed after Render");
diff --git a/Rendering/OpenGL2/vtkDepthPeelingPass.h b/Rendering/OpenGL2/vtkDepthPeelingPass.h
index c0d5c54..1ccae0c 100644
--- a/Rendering/OpenGL2/vtkDepthPeelingPass.h
+++ b/Rendering/OpenGL2/vtkDepthPeelingPass.h
@@ -44,7 +44,10 @@ class vtkTextureObject;
 class vtkOpenGLRenderWindow;
 class vtkInformationIntegerKey;
 class vtkInformationIntegerVectorKey;
-class vtkOpenGLHelper;
+namespace vtkgl
+{
+  class CellBO;
+}
 
 class VTKRENDERINGOPENGL2_EXPORT vtkDepthPeelingPass : public vtkRenderPass
 {
@@ -165,8 +168,8 @@ public:
   // (Used by vtkOpenGLProperty or vtkOpenGLTexture)
   int DepthPeelingHigherLayer;
 
-  vtkOpenGLHelper *FinalBlendProgram;
-  vtkOpenGLHelper *IntermediateBlendProgram;
+  vtkgl::CellBO *FinalBlendProgram;
+  vtkgl::CellBO *IntermediateBlendProgram;
 
   vtkTextureObject *OpaqueZTexture;
   vtkTextureObject *OpaqueRGBATexture;
@@ -175,7 +178,7 @@ public:
   vtkTextureObject *CurrentRGBATexture;
   std::vector<float> *DepthZData;
 
-  void BlendIntermediatePeels(vtkOpenGLRenderWindow *renWin, bool);
+  void BlendIntermediatePeels(vtkOpenGLRenderWindow *renWin);
   void BlendFinalPeel(vtkOpenGLRenderWindow *renWin);
 
  private:
diff --git a/Rendering/OpenGL2/vtkEGLRenderWindow.cxx b/Rendering/OpenGL2/vtkEGLRenderWindow.cxx
index 0dc1bba..5d86e7e 100644
--- a/Rendering/OpenGL2/vtkEGLRenderWindow.cxx
+++ b/Rendering/OpenGL2/vtkEGLRenderWindow.cxx
@@ -32,8 +32,6 @@
 
 #include <vtksys/ios/sstream>
 
-#include "vtk_glew.h"
-
 vtkStandardNewMacro(vtkEGLRenderWindow);
 
 vtkEGLRenderWindow::vtkEGLRenderWindow()
diff --git a/Rendering/OpenGL2/vtkFrameBufferObject.cxx b/Rendering/OpenGL2/vtkFrameBufferObject.cxx
index 141ebaa..bcc531b 100644
--- a/Rendering/OpenGL2/vtkFrameBufferObject.cxx
+++ b/Rendering/OpenGL2/vtkFrameBufferObject.cxx
@@ -17,13 +17,13 @@
 #include "vtk_glew.h"
 
 #include "vtkObjectFactory.h"
-#include "vtkOpenGLRenderUtilities.h"
 #include "vtkOpenGLRenderWindow.h"
 #include "vtkTextureObject.h"
 #include "vtkPixelBufferObject.h"
-#include "vtkOpenGLBufferObject.h"
 #include "vtkOpenGLError.h"
 
+#include "vtkglBufferObject.h"
+
 #include <cassert>
 #include <vector>
 using std::vector;
@@ -84,11 +84,6 @@ void vtkFrameBufferObject::DestroyFBO()
 //----------------------------------------------------------------------------
 bool vtkFrameBufferObject::IsSupported(vtkOpenGLRenderWindow *)
 {
-  if (vtkOpenGLRenderWindow::GetContextSupportsOpenGL32())
-    {
-    return true;
-    }
-
 #if GL_ES_VERSION_3_0 == 1
   bool fbo = true;
   bool fboBlit = true;
@@ -101,13 +96,8 @@ bool vtkFrameBufferObject::IsSupported(vtkOpenGLRenderWindow *)
 }
 
 //----------------------------------------------------------------------------
-bool vtkFrameBufferObject::LoadRequiredExtensions(vtkOpenGLRenderWindow *)
+bool vtkFrameBufferObject::LoadRequiredExtensions(vtkOpenGLRenderWindow *vtkNotUsed(win))
 {
-   if (vtkOpenGLRenderWindow::GetContextSupportsOpenGL32())
-    {
-    return true;
-    }
-
 #if GL_ES_VERSION_3_0 == 1
   bool fbo = true;
   bool fboBlit = true;
@@ -846,7 +836,7 @@ void vtkFrameBufferObject::DisplayBuffer(int value)
 // a program must be bound
 // a VAO must be bound
 void vtkFrameBufferObject::RenderQuad(int minX, int maxX, int minY, int maxY,
-        vtkShaderProgram *program, vtkOpenGLVertexArrayObject *vao)
+        vtkShaderProgram *program, vtkgl::VertexArrayObject *vao)
 {
   assert("pre positive_minX" && minX>=0);
   assert("pre increasing_x" && minX<=maxX);
@@ -891,7 +881,7 @@ void vtkFrameBufferObject::RenderQuad(int minX, int maxX, int minY, int maxY,
     1.0, 0,
     1.0, maxYTexCoord,
     0, maxYTexCoord};
-  vtkOpenGLRenderUtilities::RenderQuad(verts, tcoords, program, vao);
+  vtkOpenGLRenderWindow::RenderQuad(verts, tcoords, program, vao);
 
   vtkOpenGLCheckErrorMacro("failed after Render");
 
@@ -923,6 +913,10 @@ void vtkFrameBufferObject::PrintSelf(ostream& os, vtkIndent indent)
      << endl;
 }
 
+// Description:
+// Common switch for parsing fbo status return.
+#define vtkFBOStrErrorMacro(status, str, ok) \
+
 // ----------------------------------------------------------------------------
 int vtkFrameBufferObject::CheckFrameBufferStatus(unsigned int mode)
 {
diff --git a/Rendering/OpenGL2/vtkFrameBufferObject.h b/Rendering/OpenGL2/vtkFrameBufferObject.h
index de1e42b..1526ea9 100644
--- a/Rendering/OpenGL2/vtkFrameBufferObject.h
+++ b/Rendering/OpenGL2/vtkFrameBufferObject.h
@@ -37,7 +37,11 @@ class vtkTextureObject;
 class vtkPixelBufferObject;
 class vtkOpenGLRenderWindow;
 class vtkShaderProgram;
-class vtkOpenGLVertexArrayObject;
+namespace vtkgl
+{
+class VertexArrayObject;
+}
+
 
 class VTKRENDERINGOPENGL2_EXPORT vtkFrameBufferObject : public vtkObject
 {
@@ -76,7 +80,7 @@ public:
   // \pre increasing_y: minY<=maxY
   // \pre valid_maxY: maxY<LastSize[1]
   void RenderQuad(int minX, int maxX, int minY, int maxY,
-    vtkShaderProgram *program, vtkOpenGLVertexArrayObject *vao);
+    vtkShaderProgram *program, vtkgl::VertexArrayObject *vao);
 
   // Description:
   // Make the draw frame buffer active (uses FRAMEBUFFER).
diff --git a/Rendering/OpenGL2/vtkFrameBufferObject2.cxx b/Rendering/OpenGL2/vtkFrameBufferObject2.cxx
deleted file mode 100644
index 98aeed4..0000000
--- a/Rendering/OpenGL2/vtkFrameBufferObject2.cxx
+++ /dev/null
@@ -1,731 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkFrameBufferObject2.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 "vtkFrameBufferObject2.h"
-
-#include "vtk_glew.h"
-
-#include "vtkObjectFactory.h"
-#include "vtkOpenGLRenderWindow.h"
-#include "vtkTextureObject.h"
-#include "vtkRenderbuffer.h"
-#include "vtkPixelBufferObject.h"
-#include "vtkOpenGLError.h"
-
-
-#include <cassert>
-#include <vector>
-using std::vector;
-
-//----------------------------------------------------------------------------
-vtkStandardNewMacro(vtkFrameBufferObject2);
-
-//----------------------------------------------------------------------------
-vtkFrameBufferObject2::vtkFrameBufferObject2()
-{
-  this->FBOIndex = 0;
-  this->PreviousDrawFBO = 0;
-  this->PreviousReadFBO = 0;
-  this->PreviousDrawBuffer = GL_NONE;
-  this->PreviousReadBuffer = GL_NONE;
-}
-
-//----------------------------------------------------------------------------
-vtkFrameBufferObject2::~vtkFrameBufferObject2()
-{
-  this->DestroyFBO();
-}
-
-//----------------------------------------------------------------------------
-void vtkFrameBufferObject2::CreateFBO()
-{
-  this->FBOIndex=0;
-  GLuint temp;
-  glGenFramebuffers(1,&temp);
-  vtkOpenGLCheckErrorMacro("failed at glGenFramebuffers");
-  this->FBOIndex=temp;
-}
-
-//----------------------------------------------------------------------------
-void vtkFrameBufferObject2::DestroyFBO()
-{
-  // because we don't hold a reference to the render
-  // context we don't have any control on when it is
-  // destroyed. In fact it may be destroyed before
-  // we are(eg smart pointers), in which case we should
-  // do nothing.
-  if (this->Context && (this->FBOIndex!=0))
-    {
-    GLuint fbo=static_cast<GLuint>(this->FBOIndex);
-    glDeleteFramebuffers(1,&fbo);
-    vtkOpenGLCheckErrorMacro("failed at glDeleteFramebuffers");
-    this->FBOIndex=0;
-    }
-}
-
-//----------------------------------------------------------------------------
-bool vtkFrameBufferObject2::IsSupported(vtkRenderWindow *win)
-{
-  vtkOpenGLRenderWindow *renWin=vtkOpenGLRenderWindow::SafeDownCast(win);
-  if(renWin!=0)
-    {
-    return true;
-    }
-  return false;
-}
-
-//----------------------------------------------------------------------------
-bool vtkFrameBufferObject2::LoadRequiredExtensions(
-  vtkRenderWindow *vtkNotUsed(win))
-{
-  return true;
-}
-
-//----------------------------------------------------------------------------
-void vtkFrameBufferObject2::SetContext(vtkRenderWindow *renWin)
-{
-  // avoid pointless re-assignment
-  if (this->Context==renWin)
-    {
-    return;
-    }
-  // free previous resources
-  this->DestroyFBO();
-  this->Context = NULL;
-  this->Modified();
-  // all done if assigned null
-  if (!renWin)
-    {
-    return;
-    }
-  // check for support
-  vtkOpenGLRenderWindow *context
-    = dynamic_cast<vtkOpenGLRenderWindow*>(renWin);
-  if ( !context
-    || !this->LoadRequiredExtensions(renWin))
-    {
-    vtkErrorMacro("Context does not support the required extensions");
-    return;
-    }
-  // intialize
-  this->Context=renWin;
-  this->Context->MakeCurrent();
-  this->CreateFBO();
-}
-
-//----------------------------------------------------------------------------
-vtkRenderWindow *vtkFrameBufferObject2::GetContext()
-{
-  return this->Context;
-}
-
-//----------------------------------------------------------------------------
-void vtkFrameBufferObject2::SaveCurrentBindings()
-{
-  glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, (int*)&this->PreviousDrawFBO);
-  glGetIntegerv(GL_READ_FRAMEBUFFER_BINDING, (int*)&this->PreviousReadFBO);
-}
-
-//----------------------------------------------------------------------------
-void vtkFrameBufferObject2::SaveCurrentBuffers()
-{
-#ifdef GL_DRAW_BUFFER
-  glGetIntegerv(GL_DRAW_BUFFER, (int*)&this->PreviousDrawBuffer);
-#endif
-  glGetIntegerv(GL_READ_BUFFER, (int*)&this->PreviousReadBuffer);
-}
-
-//----------------------------------------------------------------------------
-void vtkFrameBufferObject2::RestorePreviousBuffers(unsigned int mode)
-{
-  switch((GLenum)mode)
-    {
-    case GL_FRAMEBUFFER:
-      glDrawBuffer((GLenum)this->PreviousDrawBuffer);
-      vtkOpenGLCheckErrorMacro("failed at glDrawBuffer");
-
-      glReadBuffer((GLenum)this->PreviousReadBuffer);
-      vtkOpenGLCheckErrorMacro("failed at glReadBuffer");
-      break;
-
-    case GL_DRAW_FRAMEBUFFER:
-      glDrawBuffer((GLenum)this->PreviousDrawBuffer);
-      vtkOpenGLCheckErrorMacro("failed at glDrawBuffer");
-      break;
-
-    case GL_READ_FRAMEBUFFER:
-      glReadBuffer((GLenum)this->PreviousReadBuffer);
-      vtkOpenGLCheckErrorMacro("failed at glReadBuffer");
-      break;
-    }
-}
-
-//----------------------------------------------------------------------------
-void vtkFrameBufferObject2::Bind(unsigned int mode)
-{
-  assert(this->FBOIndex!=0); // need to call glGenFramebuffers first
-
-  // need to ensure that binding is esxtablished *every* time because
-  // if other code binds over us then all of our subsequent calls
-  // will affect that fbo not ours.
-  glBindFramebuffer((GLenum)mode, this->FBOIndex);
-  vtkOpenGLCheckErrorMacro("failed at glBindFramebuffer");
-}
-
-//----------------------------------------------------------------------------
-void vtkFrameBufferObject2::UnBind(unsigned int mode)
-{
-  assert(this->FBOIndex!=0); // need to GenFramebuffers first
-
-  bool drawing
-    =  ((GLenum)mode)==GL_DRAW_FRAMEBUFFER
-    || ((GLenum)mode)==GL_FRAMEBUFFER;
-
-  GLuint prevFbo
-    = (drawing ? this->PreviousDrawFBO : this->PreviousReadFBO);
-
-  glBindFramebuffer((GLenum)mode, prevFbo);
-  vtkOpenGLCheckErrorMacro("failed at glBindFramebuffer");
-}
-
-//----------------------------------------------------------------------------
-void vtkFrameBufferObject2::ActivateDrawBuffers(unsigned int *ids, int num)
-{
-  assert(num<17); // a practical limit, increase if needed
-  GLenum colorAtts[16];
-  for (int i=0; i<num; ++i)
-    {
-    colorAtts[i] = GL_COLOR_ATTACHMENT0 + ids[i];
-    }
-  glDrawBuffers(num, &colorAtts[0]);
-  vtkOpenGLCheckErrorMacro("failed at glDrawBuffers");
-}
-
-//----------------------------------------------------------------------------
-void vtkFrameBufferObject2::ActivateDrawBuffers(unsigned int num)
-{
-  assert(num<17); // a practical limit, increase if needed
-  GLenum colorAtts[16];
-  for (unsigned int i=0; i<num; ++i)
-    {
-    colorAtts[i] = GL_COLOR_ATTACHMENT0 + i;
-    }
-  glDrawBuffers(num, &colorAtts[0]);
-  vtkOpenGLCheckErrorMacro("failed at glDrawBuffers");
-}
-
-//----------------------------------------------------------------------------
-void vtkFrameBufferObject2::DeactivateDrawBuffers()
-{
-  GLenum att = GL_NONE;
-  glDrawBuffers(1, &att);
-  vtkOpenGLCheckErrorMacro("failed at glDrawBuffers(GL_NONE)");
-}
-
-//----------------------------------------------------------------------------
-void vtkFrameBufferObject2::ActivateDrawBuffer(
-      unsigned int colorAtt)
-{
-  colorAtt += GL_COLOR_ATTACHMENT0;
-  glDrawBuffers(1, &colorAtt);
-  vtkOpenGLCheckErrorMacro("failed at glDrawBuffers");
-}
-
-//----------------------------------------------------------------------------
-void vtkFrameBufferObject2::ActivateReadBuffer(
-      unsigned int colorAtt)
-{
-  colorAtt += GL_COLOR_ATTACHMENT0;
-  glReadBuffer((GLenum)colorAtt);
-  vtkOpenGLCheckErrorMacro("failed at glReadBuffer");
-}
-
-//----------------------------------------------------------------------------
-void vtkFrameBufferObject2::DeactivateReadBuffer()
-{
-  glReadBuffer(GL_NONE);
-  vtkOpenGLCheckErrorMacro("failed at glReadBuffer(GL_NONE)");
-}
-
-//----------------------------------------------------------------------------
-void vtkFrameBufferObject2::AddTexColorAttachment(
-        unsigned int mode,
-        unsigned int i,
-        unsigned int handle)
-{
-  glFramebufferTexture2D(
-        (GLenum)mode,
-        GL_COLOR_ATTACHMENT0+i,
-        GL_TEXTURE_2D,
-        handle,
-        0);
-  vtkOpenGLCheckErrorMacro("failed at glFramebufferTexture2D");
-}
-
-//----------------------------------------------------------------------------
-void vtkFrameBufferObject2::RemoveTexColorAttachments(
-      unsigned int mode,
-      unsigned int num)
-{
-  for (unsigned int i=0; i<num; ++i)
-    {
-    this->AddTexColorAttachment(mode, i, 0U);
-    }
-}
-
-//----------------------------------------------------------------------------
-void vtkFrameBufferObject2::AddColorAttachment(
-        unsigned int mode,
-        unsigned int i,
-        vtkTextureObject* tex)
-{
-  unsigned int handle = (tex==NULL) ? 0 : tex->GetHandle();
-  this->AddTexColorAttachment(mode,i,handle);
-}
-
-//----------------------------------------------------------------------------
-void vtkFrameBufferObject2::AddRenColorAttachment(
-        unsigned int mode,
-        unsigned int i,
-        unsigned int handle)
-{
-  glFramebufferRenderbuffer(
-        (GLenum)mode,
-        GL_COLOR_ATTACHMENT0+i,
-        GL_RENDERBUFFER,
-        handle);
-  vtkOpenGLCheckErrorMacro("failed at glFramebufferRenderbuffer");
-}
-
-//----------------------------------------------------------------------------
-void vtkFrameBufferObject2::AddColorAttachment(
-        unsigned int mode,
-        unsigned int i,
-        vtkRenderbuffer* renbuf)
-{
-  unsigned int handle = (renbuf==NULL) ? 0 : renbuf->GetHandle();
-  this->AddRenColorAttachment(mode, i, handle);
-}
-
-//----------------------------------------------------------------------------
-void vtkFrameBufferObject2::RemoveRenColorAttachments(
-      unsigned int mode,
-      unsigned int num)
-{
-  for (unsigned int i=0; i<num; ++i)
-    {
-    this->AddRenColorAttachment(mode, i, 0U);
-    }
-}
-
-//----------------------------------------------------------------------------
-void vtkFrameBufferObject2::AddTexDepthAttachment(
-        unsigned int mode,
-        unsigned int handle)
-{
-  glFramebufferTexture2D(
-        (GLenum)mode,
-        GL_DEPTH_ATTACHMENT,
-        GL_TEXTURE_2D,
-        handle,
-        0);
-  vtkOpenGLCheckErrorMacro("failed at glFramebufferTexture2D");
-}
-
-//----------------------------------------------------------------------------
-void vtkFrameBufferObject2::AddDepthAttachment(
-        unsigned int mode,
-        vtkTextureObject* tex)
-{
-  unsigned int handle = (tex==NULL) ? 0 : tex->GetHandle();
-  this->AddTexDepthAttachment(mode,handle);
-}
-
-//----------------------------------------------------------------------------
-void vtkFrameBufferObject2::AddRenDepthAttachment(
-        unsigned int mode,
-        unsigned int handle)
-{
-  glFramebufferRenderbuffer(
-        (GLenum)mode,
-        GL_DEPTH_ATTACHMENT,
-        GL_RENDERBUFFER,
-        handle);
-  vtkOpenGLCheckErrorMacro("failed at glFramebufferRenderbuffer");
-}
-
-//----------------------------------------------------------------------------
-void vtkFrameBufferObject2::AddDepthAttachment(
-        unsigned int mode,
-        vtkRenderbuffer* renbuf)
-{
-  unsigned int handle = (renbuf==NULL) ? 0 : renbuf->GetHandle();
-  this->AddRenDepthAttachment(mode, handle);
-}
-
-//----------------------------------------------------------------------------
-void vtkFrameBufferObject2::InitializeViewport(int width, int height)
-{
-  glDisable(GL_BLEND);
-  glDisable(GL_DEPTH_TEST);
-  glDisable(GL_SCISSOR_TEST);
-
-  // Viewport transformation for 1:1 'pixel=texel=data' mapping.
-  // Note this is not enough for 1:1 mapping, because depending on the
-  // primitive displayed (point,line,polygon), the rasterization rules
-  // are different.
-  glViewport(0, 0, width, height);
-
-  vtkOpenGLStaticCheckErrorMacro("failed after InitializeViewport");
-}
-
-//----------------------------------------------------------------------------
-int vtkFrameBufferObject2::Blit(
-        int srcExt[4],
-        int destExt[4],
-        unsigned int bits,
-        unsigned int mapping)
-{
-  glBlitFramebuffer(
-        (GLint)srcExt[0],
-        (GLint)srcExt[2],
-        (GLint)srcExt[1],
-        (GLint)srcExt[3],
-        (GLint)destExt[0],
-        (GLint)destExt[2],
-        (GLint)destExt[1],
-        (GLint)destExt[3],
-        (GLbitfield)bits,
-        (GLenum)mapping);
-
-  vtkOpenGLStaticCheckErrorMacro("failed at glBlitFramebuffer");
-
-  return 1;
-}
-
-//-----------------------------------------------------------------------------
-vtkPixelBufferObject *vtkFrameBufferObject2::DownloadDepth(
-      int extent[4],
-      int vtkType)
-{
-  assert(this->Context);
-
-  return this->Download(
-      extent,
-      vtkType,
-      1,
-      this->GetOpenGLType(vtkType),
-      GL_DEPTH_COMPONENT);
-}
-
-//-----------------------------------------------------------------------------
-vtkPixelBufferObject *vtkFrameBufferObject2::DownloadColor4(
-      int extent[4],
-      int vtkType)
-{
-  assert(this->Context);
-
-  return this->Download(
-      extent,
-      vtkType,
-      4,
-      this->GetOpenGLType(vtkType),
-      GL_RGBA);
-}
-
-//-----------------------------------------------------------------------------
-vtkPixelBufferObject *vtkFrameBufferObject2::DownloadColor3(
-      int extent[4],
-      int vtkType)
-{
-  assert(this->Context);
-
-  return this->Download(
-      extent,
-      vtkType,
-      3,
-      this->GetOpenGLType(vtkType),
-      GL_RGB);
-}
-
-//-----------------------------------------------------------------------------
-vtkPixelBufferObject *vtkFrameBufferObject2::DownloadColor1(
-      int extent[4],
-      int vtkType,
-      int channel)
-{
-  assert(this->Context);
-  GLenum oglChannel = 0;
-  switch (channel)
-    {
-    case 0:
-      oglChannel = GL_RED;
-      break;
-    case 1:
-      oglChannel = GL_GREEN;
-      break;
-    case 2:
-      oglChannel = GL_BLUE;
-      break;
-    default:
-      vtkErrorMacro("Inavlid channel");
-      return NULL;
-    }
-
-  return this->Download(
-      extent,
-      vtkType,
-      1,
-      this->GetOpenGLType(vtkType),
-      oglChannel);
-}
-
-//-----------------------------------------------------------------------------
-vtkPixelBufferObject *vtkFrameBufferObject2::Download(
-      int extent[4],
-      int vtkType,
-      int nComps,
-      int oglType,
-      int oglFormat)
-{
-  vtkPixelBufferObject *pbo = vtkPixelBufferObject::New();
-  pbo->SetContext(this->Context);
-
-  this->Download(
-        extent,
-        vtkType,
-        nComps,
-        oglType,
-        oglFormat,
-        pbo);
-
-  return pbo;
-}
-//-----------------------------------------------------------------------------
-void vtkFrameBufferObject2::Download(
-      int extent[4],
-      int vtkType,
-      int nComps,
-      int oglType,
-      int oglFormat,
-      vtkPixelBufferObject *pbo)
-{
-  unsigned int extentSize[2] = {
-        static_cast<unsigned int>(extent[1] - extent[0] + 1),
-        static_cast<unsigned int>(extent[3] - extent[2] + 1)
-        };
-
-  unsigned int nTups = extentSize[0]*extentSize[1];
-
-  pbo->Allocate(
-        vtkType,
-        nTups,
-        nComps,
-        vtkPixelBufferObject::PACKED_BUFFER);
-
-  pbo->Bind(vtkPixelBufferObject::PACKED_BUFFER);
-
-  glPixelStorei(GL_PACK_ALIGNMENT, 1);
-  glReadPixels(
-        extent[0],
-        extent[2],
-        extentSize[0],
-        extentSize[1],
-        oglFormat,
-        oglType,
-        NULL);
-
-  vtkOpenGLStaticCheckErrorMacro("failed at glReadPixels");
-
-  pbo->UnBind();
-}
-
-//-----------------------------------------------------------------------------
-int vtkFrameBufferObject2::GetOpenGLType(int vtkType)
-{
-  // convert vtk type to open gl type
-  int oglType = 0;
-  switch (vtkType)
-    {
-    case VTK_FLOAT:
-      oglType = GL_FLOAT;
-      break;
-    case VTK_INT:
-      oglType = GL_INT;
-      break;
-    case VTK_UNSIGNED_INT:
-      oglType = GL_UNSIGNED_INT;
-      break;
-    case VTK_CHAR:
-      oglType = GL_BYTE;
-      break;
-    case VTK_UNSIGNED_CHAR:
-      oglType = GL_UNSIGNED_BYTE;
-      break;
-    default:
-      vtkErrorMacro("Unsupported type");
-      return 0;
-    }
-  return oglType;
-}
-
-// Description:
-// Common switch for parsing fbo status return.
-#define vtkFBOStrErrorMacro(status, str, ok) \
-  ok = false; \
-  switch(status) \
-    { \
-    case GL_FRAMEBUFFER_COMPLETE: \
-      str = "FBO complete"; \
-      ok = true; \
-      break; \
-    case GL_FRAMEBUFFER_UNSUPPORTED: \
-      str = "FRAMEBUFFER_UNSUPPORTED"; \
-      break; \
-    case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT: \
-      str = "FRAMEBUFFER_INCOMPLETE_ATTACHMENT"; \
-      break; \
-    case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT: \
-      str = "FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT"; \
-      break; \
-    case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER: \
-      str = "FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER"; \
-      break; \
-    case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER: \
-      str = "FRAMEBUFFER_INCOMPLETE_READ_BUFFER"; \
-      break; \
-    default: \
-      str = "Unknown status"; \
-    }
-
-// ----------------------------------------------------------------------------
-bool vtkFrameBufferObject2::GetFrameBufferStatus(
-      unsigned int mode,
-      const char *&desc)
-{
-  bool ok = false;
-  desc = "error";
-  GLenum status = glCheckFramebufferStatus((GLenum)mode);
-  switch(status)
-    {
-    case GL_FRAMEBUFFER_COMPLETE:
-      desc = "FBO complete";
-      ok = true;
-      break;
-    case GL_FRAMEBUFFER_UNSUPPORTED:
-      desc = "FRAMEBUFFER_UNSUPPORTED";
-      break;
-    case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT:
-      desc = "FRAMEBUFFER_INCOMPLETE_ATTACHMENT";
-      break;
-    case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:
-      desc = "FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT";
-      break;
-#ifdef GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS
-    case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS:
-      desc = "FRAMEBUFFER_INCOMPLETE_DIMENSIONS";
-      break;
-#endif
-#ifdef GL_FRAMEBUFFER_INCOMPLETE_FORMATS
-    case GL_FRAMEBUFFER_INCOMPLETE_FORMATS:
-      desc = "FRAMEBUFFER_INCOMPLETE_FORMATS";
-      break;
-#endif
-#ifdef GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER
-    case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER:
-      desc = "FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER";
-      break;
-#endif
-#ifdef GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER
-    case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER:
-      desc = "FRAMEBUFFER_INCOMPLETE_READ_BUFFER";
-      break;
-#endif
-    default:
-      desc = "Unknown status";
-    }
-  if (!ok)
-    {
-    return false;
-    }
-  return true;
-}
-
-// ----------------------------------------------------------------------------
-int vtkFrameBufferObject2::CheckFrameBufferStatus(unsigned int mode)
-{
-  bool ok = false;
-  const char *str = "error";
-  GLenum status = glCheckFramebufferStatus((GLenum)mode);
-  vtkOpenGLCheckErrorMacro("failed at glCheckFramebufferStatus");
-  switch(status)
-    {
-    case GL_FRAMEBUFFER_COMPLETE:
-      str = "FBO complete";
-      ok = true;
-      break;
-    case GL_FRAMEBUFFER_UNSUPPORTED:
-      str = "FRAMEBUFFER_UNSUPPORTED";
-      break;
-    case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT:
-      str = "FRAMEBUFFER_INCOMPLETE_ATTACHMENT";
-      break;
-    case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:
-      str = "FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT";
-      break;
-#ifdef GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS
-    case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS:
-      str = "FRAMEBUFFER_INCOMPLETE_DIMENSIONS";
-      break;
-#endif
-#ifdef GL_FRAMEBUFFER_INCOMPLETE_FORMATS
-    case GL_FRAMEBUFFER_INCOMPLETE_FORMATS:
-      str = "FRAMEBUFFER_INCOMPLETE_FORMATS";
-      break;
-#endif
-#ifdef GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER
-    case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER:
-      str = "FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER";
-      break;
-#endif
-#ifdef GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER
-    case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER:
-      str = "FRAMEBUFFER_INCOMPLETE_READ_BUFFER";
-      break;
-#endif
-    default:
-      str = "Unknown status";
-    }
-  if (!ok)
-    {
-    vtkErrorMacro("The framebuffer is incomplete : " << str);
-    return 0;
-    }
-  return 1;
-}
-
-// ----------------------------------------------------------------------------
-void vtkFrameBufferObject2::PrintSelf(ostream& os, vtkIndent indent)
-{
-  this->Superclass::PrintSelf(os, indent);
-
-  os
-    << indent << "Context=" << this->Context << endl
-    << indent << "FBOIndex=" << this->FBOIndex << endl
-    << indent << "PreviousDrawFBO=" << this->PreviousDrawFBO << endl
-    << indent << "PreviousReadFBO=" << this->PreviousReadFBO << endl
-    << indent << "PreviousDrawBuffer=" << this->PreviousDrawBuffer << endl
-    << indent << "PreviousReadBuffer=" << this->PreviousReadBuffer << endl
-    << endl;
-}
diff --git a/Rendering/OpenGL2/vtkFrameBufferObject2.h b/Rendering/OpenGL2/vtkFrameBufferObject2.h
deleted file mode 100644
index 4c3d366..0000000
--- a/Rendering/OpenGL2/vtkFrameBufferObject2.h
+++ /dev/null
@@ -1,315 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkFrameBufferObject2.h
-
-  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.
-
-=========================================================================*/
-// .NAME vtkFrameBufferObject2 - Interface to OpenGL framebuffer object.
-// .SECTION Description
-// A light and efficient interface to an OpenGL Frame Buffer Object.
-// Use is very simillalry to directly calling OpenGL, but as vtkObject
-// it may safely stored, shared, or passed around. It supports FBO Blit
-// and transfer to Pixel Buffer Object.
-//
-// Typical use case:
-//\code{.cpp}
-// vtkFrameBufferObject2 *fbo = this->Internals->FBO;
-// fbo->SaveCurrentBindings();
-// fbo->Bind(vtkgl::FRAMEBUFFER_EXT);
-// fbo->AddDepthAttachment(vtkgl::DRAW_FRAMEBUFFER_EXT, depthBuffer);
-// fbo->AddColorAttachment(vtkgl::DRAW_FRAMEBUFFER_EXT, 0U, colorTex1);
-// fbo->AddColorAttachment(vtkgl::DRAW_FRAMEBUFFER_EXT, 1U, colorTex2);
-// fbo->AddColorAttachment(vtkgl::DRAW_FRAMEBUFFER_EXT, 2U, colorTex3);
-// fbo->ActivateDrawBuffers(3);
-// vtkCheckFrameBufferStatusMacro(vtkgl::FRAMEBUFFER_EXT);
-//
-// ...
-//
-// fbo->UnBind(vtkgl::FRAMEBUFFER_EXT);
-//\endcode
-//
-// .SECTION See Also
-// vtkRenderbuffer, vtkPixelBufferObject
-
-#ifndef vtkFrameBufferObject2_h
-#define vtkFrameBufferObject2_h
-
-#include "vtkObject.h"
-#include "vtkRenderingOpenGL2Module.h" // For export macro
-#include "vtkSmartPointer.h" // needed for vtkSmartPointer.
-#include "vtkWeakPointer.h" // needed for vtkWeakPointer.
-
-// Description:
-// A variant of vtkErrorMacro that is used to verify framebuffer
-// object completeness. It's provided so that reporting may include
-// the file and line number of the offending code. In release mode
-// the macro does nothing.
-#ifdef NDEBUG
-# define vtkCheckFrameBufferStatusMacro(mode)
-# define vtkStaticCheckFrameBufferStatusMacro(mode)
-#else
-# define vtkCheckFrameBufferStatusMacroImpl(macro, mode)           \
-{                                                                  \
-const char *eStr;                                                  \
-bool ok = vtkFrameBufferObject2::GetFrameBufferStatus(mode, eStr); \
-if (!ok)                                                           \
-  {                                                                \
-  macro(                                                           \
-    << "OpenGL ERROR. The FBO is incomplete : " << eStr);          \
-  }                                                                \
- }
-# define vtkCheckFrameBufferStatusMacro(mode) \
-    vtkCheckFrameBufferStatusMacroImpl(vtkErrorMacro, mode)
-# define vtkStaticCheckFrameBufferStatusMacro(mode) \
-    vtkCheckFrameBufferStatusMacroImpl(vtkGenericWarningMacro, mode)
-#endif
-
-class vtkRenderWindow;
-class vtkTextureObject;
-class vtkRenderbuffer;
-class vtkPixelBufferObject;
-class vtkOpenGLRenderWindow;
-
-class VTKRENDERINGOPENGL2_EXPORT vtkFrameBufferObject2 : public vtkObject
-{
-public:
-  static vtkFrameBufferObject2* New();
-  vtkTypeMacro(vtkFrameBufferObject2, vtkObject);
-  void PrintSelf(ostream& os, vtkIndent indent);
-
-  // Description:
-  // Get/Set the context. Context must be a vtkOpenGLRenderWindow.
-  // This does not increase the reference count of the
-  // context to avoid reference loops.
-  // SetContext() may raise an error is the OpenGL context does not support the
-  // required OpenGL extensions.
-  void SetContext(vtkRenderWindow *context);
-  vtkRenderWindow *GetContext();
-
-  // Description:
-  // Returns if the context supports the required extensions.
-  // Extension will be loaded when the conetxt is set.
-  static bool IsSupported(vtkRenderWindow *renWin);
-
-  // Description:
-  // Bind FBO to FRAMEBUFFER,  DRAW_FRAMEBUFFER or READ_FRAMEBUFFER
-  // The current binding is not saved, nor restored. (see glBindFramebuffer)
-  // This method can be used to prepare for FBO Blit or buffer ping-pong.
-  // Low level api.
-  void Bind(unsigned int mode);
-
-  // Description:
-  // Bind saved FBO (see SaveCurrentBindings) for DRAW or READ (see glBindFramebuffer)
-  // If no bindings were saved bind to default FBO.
-  // Low level api.
-  void UnBind(unsigned int mode);
-
-  // Description:
-  // Store the current framebuffer bindings. If this method
-  // is called then UnBind will restore the saved value accoring
-  // to its mode (DRAW_FRAMEBUFFER,READ_FRAMEBUFFER,FRAMEBUFFER)
-  // Restoration occurs in UnBind.
-  // Low level api
-  void SaveCurrentBindings();
-
-  // Description:
-  // Store the current draw and read buffers. When restored
-  // only the buffers matching mode are modified.
-  // DRAW_FRAMEBUFFER -> glDrawBuffer
-  // READ_FRAMEBUFFER -> glReadBuffer
-  // FRAMEBUFFER -> both
-  void SaveCurrentBuffers();
-  void RestorePreviousBuffers(unsigned int mode);
-
-  // Description:
-  // Directly assign/remove a texture to color attachments.
-  void AddColorAttachment(
-        unsigned int mode,
-        unsigned int attId,
-        vtkTextureObject* tex);
-
-  void AddTexColorAttachment(
-        unsigned int mode,
-        unsigned int attId,
-        unsigned int handle);
-
-  void RemoveTexColorAttachments(unsigned int mode, unsigned int num);
-  void RemoveTexColorAttachment(unsigned int mode, unsigned int attId)
-    { this->AddTexColorAttachment(mode, attId, 0U); }
-
-  // Description:
-  // Directly assign/remove a renderbuffer to color attachments.
-  void AddColorAttachment(
-        unsigned int mode,
-        unsigned int attId,
-        vtkRenderbuffer* tex);
-
-  void AddRenColorAttachment(
-        unsigned int mode,
-        unsigned int attId,
-        unsigned int handle);
-
-  void RemoveRenColorAttachments(unsigned int mode, unsigned int num);
-  void RemoveRenColorAttachment(unsigned int mode, unsigned int attId)
-    { this->AddRenColorAttachment(mode, attId, 0U); }
-
-  // Description:
-  // Directly assign/remove a texture/renderbuffer to depth attachments.
-  void AddDepthAttachment(unsigned int mode, vtkTextureObject* tex);
-  void AddTexDepthAttachment(unsigned int mode, unsigned int handle);
-  void RemoveTexDepthAttachment(unsigned int mode)
-    { this->AddTexDepthAttachment(mode, 0U); }
-
-  // Description:
-  // Directly assign/remove a renderbuffer to depth attachments.
-  void AddDepthAttachment(unsigned int mode, vtkRenderbuffer* tex);
-  void AddRenDepthAttachment(unsigned int mode, unsigned int handle);
-  void RemoveRenDepthAttachment(unsigned int mode)
-    { this->AddRenDepthAttachment(mode, 0U); }
-
-  // Description:
-  // Select a single specific draw or read buffer (zero based)
-  void ActivateDrawBuffer(unsigned int id);
-  void ActivateReadBuffer(unsigned int id);
-  void DeactivateReadBuffer();
-
-  // Description:
-  // Select n consecutive write attachments.
-  // Low level api.
-  void ActivateDrawBuffers(unsigned int n);
-  void ActivateDrawBuffers(unsigned int *ids, int n);
-  void DeactivateDrawBuffers();
-
-  // Description:
-  // Set up ortho viewport with scissor, lighting, blend, and depth
-  // disabled. The method affects the current bound FBO. The method is
-  // static so that it may be used on the default FBO without an instance.
-  // Low level api.
-  static
-  void InitializeViewport(int width, int height);
-
-  // Description:
-  // Validate the current FBO configuration (attachments, formats, etc)
-  // prints detected errors to vtkErrorMacro.
-  // Low level api.
-  int CheckFrameBufferStatus(unsigned int mode);
-
-  // Description:
-  // Validate the current FBO configuration (attachments, formats, etc)
-  // return false if the FBO is incomplete. Assigns description a literal
-  // containing a description of the status.
-  // Low level api.
-  static
-  bool GetFrameBufferStatus(
-        unsigned int mode,
-        const char *&desc);
-
-  // Description:
-  // Copy from the currently bound READ FBO to the currently
-  // bound DRAW FBO. The method is static so that one doesn't
-  // need to ccreate an instance when transfering between attachments
-  // in the default FBO.
-  static
-  int Blit(
-        int srcExt[4],
-        int destExt[4],
-        unsigned int bits,
-        unsigned int mapping);
-
-  // Description:
-  // Download data from the read color attachment of the currently
-  // bound FBO into the retruned PBO. The PBO must be free'd when
-  // you are finished with it. The number of components in the
-  // PBO is the same as in the name of the specific  download fucntion.
-  // When downloading a single color channel, the channel must be
-  // identified by index, 1->red, 2->green, 3-> blue.
-  vtkPixelBufferObject *DownloadColor1(
-        int extent[4],
-        int vtkType,
-        int channel);
-
-  vtkPixelBufferObject *DownloadColor3(
-        int extent[4],
-        int vtkType);
-
-  vtkPixelBufferObject *DownloadColor4(
-        int extent[4],
-        int vtkType);
-
-  // Description:
-  // Download data from the depth attachment of the currently
-  // bound FBO. The returned PBO must be Delete'd by the caller.
-  // The retruned PBO has one component.
-  vtkPixelBufferObject *DownloadDepth(
-        int extent[4],
-        int vtkType);
-
-  // Description:
-  // Download data from the read buffer of the current FBO. These
-  // are low level meothds. In the static variant a PBO must be
-  // passed in since we don't have access to a context. The static
-  // method is provided so that one may download from the default
-  // FBO.
-  vtkPixelBufferObject *Download(
-        int extent[4],
-        int vtkType,
-        int nComps,
-        int oglType,
-        int oglFormat);
-
-  static
-  void Download(
-        int extent[4],
-        int vtkType,
-        int nComps,
-        int oglType,
-        int oglFormat,
-        vtkPixelBufferObject *pbo);
-
-//BTX
-protected:
-  // Description:
-  // Load all necessary extensions.
-  static
-  bool LoadRequiredExtensions(vtkRenderWindow *renWin);
-
-  // gen buffer (occurs when context is set)
-  void CreateFBO();
-
-  // delete buffer (occurs during destruction or context swicth)
-  void DestroyFBO();
-
-
-  // Description:
-  // Given a vtk type get a compatible open gl type.
-  int GetOpenGLType(int vtkType);
-
-  vtkFrameBufferObject2();
-  ~vtkFrameBufferObject2();
-
-  vtkWeakPointer<vtkRenderWindow> Context;
-
-  unsigned int FBOIndex;
-  unsigned int PreviousDrawFBO;
-  unsigned int PreviousReadFBO;
-  unsigned int DepthBuffer;
-  unsigned int PreviousDrawBuffer;
-  unsigned int PreviousReadBuffer;
-
-private:
-  vtkFrameBufferObject2(const vtkFrameBufferObject2&); // Not implemented.
-  void operator=(const vtkFrameBufferObject2&); // Not implemented.
-
-  friend class vtkRenderbuffer; // needs access to LoadRequiredExtentsions
-//ETX
-};
-
-#endif
diff --git a/Rendering/OpenGL2/vtkGaussianBlurPass.cxx b/Rendering/OpenGL2/vtkGaussianBlurPass.cxx
index fefb074..8c33693 100644
--- a/Rendering/OpenGL2/vtkGaussianBlurPass.cxx
+++ b/Rendering/OpenGL2/vtkGaussianBlurPass.cxx
@@ -21,13 +21,13 @@
 #include "vtkFrameBufferObject.h"
 #include "vtkTextureObject.h"
 #include "vtkOpenGLRenderWindow.h"
+#include "vtkTextureUnitManager.h"
 #include "vtkOpenGLError.h"
 #include "vtkShaderProgram.h"
 #include "vtkOpenGLShaderCache.h"
 #include "vtkOpenGLRenderWindow.h"
-#include "vtkOpenGLVertexArrayObject.h"
 
-#include "vtkOpenGLHelper.h"
+#include "vtkglVBOHelper.h"
 
 // to be able to dump intermediate passes into png files for debugging.
 // only for vtkGaussianBlurPass developers.
@@ -270,7 +270,7 @@ void vtkGaussianBlurPass::Render(const vtkRenderState *s)
     // has something changed that would require us to recreate the shader?
     if (!this->BlurProgram)
       {
-      this->BlurProgram = new vtkOpenGLHelper;
+      this->BlurProgram = new vtkgl::CellBO;
       // build the shader source code
       std::string VSSource = vtkGaussianBlurPassVS;
       std::string FSSource = vtkGaussianBlurPassFS;
@@ -278,23 +278,22 @@ void vtkGaussianBlurPass::Render(const vtkRenderState *s)
 
       // compile and bind it if needed
       vtkShaderProgram *newShader =
-        renWin->GetShaderCache()->ReadyShaderProgram(
-          VSSource.c_str(),
-          FSSource.c_str(),
-          GSSource.c_str());
+        renWin->GetShaderCache()->ReadyShader(VSSource.c_str(),
+                                              FSSource.c_str(),
+                                              GSSource.c_str());
 
       // if the shader changed reinitialize the VAO
       if (newShader != this->BlurProgram->Program)
         {
         this->BlurProgram->Program = newShader;
-        this->BlurProgram->VAO->ShaderProgramChanged(); // reset the VAO as the shader has changed
+        this->BlurProgram->vao.ShaderProgramChanged(); // reset the VAO as the shader has changed
         }
 
       this->BlurProgram->ShaderSourceTime.Modified();
       }
     else
       {
-      renWin->GetShaderCache()->ReadyShaderProgram(this->BlurProgram->Program);
+      renWin->GetShaderCache()->ReadyShader(this->BlurProgram->Program);
       }
 
     if(this->BlurProgram->Program->GetCompiled() != true)
@@ -350,7 +349,7 @@ void vtkGaussianBlurPass::Render(const vtkRenderState *s)
     glDisable(GL_DEPTH_TEST);
 
     this->FrameBufferObject->RenderQuad(0,w-1,0,h-1,
-      this->BlurProgram->Program, this->BlurProgram->VAO);
+      this->BlurProgram->Program, &this->BlurProgram->vao);
 
 #ifdef VTK_GAUSSIAN_BLUR_PASS_DEBUG
     cout << "gauss finish3" << endl;
@@ -420,8 +419,7 @@ void vtkGaussianBlurPass::Render(const vtkRenderState *s)
     this->Pass2->CopyToFrameBuffer(extraPixels, extraPixels,
                                   w-1-extraPixels,h-1-extraPixels,
                                   0,0, width, height,
-                                  this->BlurProgram->Program,
-                                  this->BlurProgram->VAO);
+                                  this->BlurProgram->Program, &this->BlurProgram->vao);
 
     this->Pass2->Deactivate();
 
diff --git a/Rendering/OpenGL2/vtkGaussianBlurPass.h b/Rendering/OpenGL2/vtkGaussianBlurPass.h
index 1636557..7b5f36e 100644
--- a/Rendering/OpenGL2/vtkGaussianBlurPass.h
+++ b/Rendering/OpenGL2/vtkGaussianBlurPass.h
@@ -49,11 +49,14 @@
 #include "vtkRenderingOpenGL2Module.h" // For export macro
 #include "vtkImageProcessingPass.h"
 
+class vtkOpenGLRenderWindow;
 class vtkDepthPeelingPassLayerList; // Pimpl
 class vtkFrameBufferObject;
-class vtkOpenGLHelper;
-class vtkOpenGLRenderWindow;
 class vtkTextureObject;
+namespace vtkgl
+{
+class CellBO;
+}
 
 class VTKRENDERINGOPENGL2_EXPORT vtkGaussianBlurPass : public vtkImageProcessingPass
 {
@@ -91,7 +94,7 @@ public:
   vtkTextureObject *Pass2; // render target for the horizontal pass
 
   // Structures for the various cell types we render.
-  vtkOpenGLHelper *BlurProgram;
+  vtkgl::CellBO *BlurProgram;
 
   bool Supported;
   bool SupportProbed;
diff --git a/Rendering/OpenGL2/vtkGenericCompositePolyDataMapper2.cxx b/Rendering/OpenGL2/vtkGenericCompositePolyDataMapper2.cxx
index 45965b4..556febe 100644
--- a/Rendering/OpenGL2/vtkGenericCompositePolyDataMapper2.cxx
+++ b/Rendering/OpenGL2/vtkGenericCompositePolyDataMapper2.cxx
@@ -24,7 +24,6 @@
 #include "vtkInformation.h"
 #include "vtkMath.h"
 #include "vtkObjectFactory.h"
-#include "vtkOpenGLVertexBufferObject.h"
 #include "vtkPolyData.h"
 #include "vtkProperty.h"
 #include "vtkRenderer.h"
@@ -58,36 +57,24 @@ protected:
 
   // Description:
   // Set the shader parameteres related to the property, called by UpdateShader
-  virtual void SetPropertyShaderParameters(
-    vtkOpenGLHelper &cellBO, vtkRenderer *ren, vtkActor *act);
+  virtual void SetPropertyShaderParameters(vtkgl::CellBO &cellBO, vtkRenderer *ren, vtkActor *act);
 
   // Description:
   // Set the shader parameteres related to lighting, called by UpdateShader
-  virtual void SetLightingShaderParameters(
-    vtkOpenGLHelper &cellBO, vtkRenderer *ren, vtkActor *act);
+  virtual void SetLightingShaderParameters(vtkgl::CellBO &cellBO, vtkRenderer *ren, vtkActor *act);
 
   // Description:
   // Set the shader parameteres related to the Camera, called by UpdateShader
-  virtual void SetCameraShaderParameters(
-    vtkOpenGLHelper &cellBO, vtkRenderer *ren, vtkActor *act);
+  virtual void SetCameraShaderParameters(vtkgl::CellBO &cellBO, vtkRenderer *ren, vtkActor *act);
 
   // Description:
   // Does the shader source need to be recomputed
-  virtual bool GetNeedToRebuildShaders(
-    vtkOpenGLHelper &cellBO, vtkRenderer *ren, vtkActor *act);
+  virtual bool GetNeedToRebuildShader(vtkgl::CellBO &cellBO, vtkRenderer *ren, vtkActor *act);
 
   // Description:
   // Make sure an appropriate shader is defined, compiled and bound.  This method
   // orchistrates the process, much of the work is done in other methods
-  virtual void UpdateShaders(
-    vtkOpenGLHelper &cellBO, vtkRenderer *ren, vtkActor *act);
-
-  // Description:
-  // Perform string replacments on the shader templates, called from
-  // ReplaceShaderValues
-  virtual void ReplaceShaderColor(
-    std::map<vtkShader::Type, vtkShader *> shaders,
-    vtkRenderer *ren, vtkActor *act);
+  virtual void UpdateShader(vtkgl::CellBO &cellBO, vtkRenderer *ren, vtkActor *act);
 
 private:
   vtkCompositeMapperHelper(const vtkCompositeMapperHelper&); // Not implemented.
@@ -96,7 +83,7 @@ private:
 
 vtkStandardNewMacro(vtkCompositeMapperHelper);
 
-void vtkCompositeMapperHelper::SetCameraShaderParameters(vtkOpenGLHelper &cellBO,
+void vtkCompositeMapperHelper::SetCameraShaderParameters(vtkgl::CellBO &cellBO,
                                                        vtkRenderer *ren, vtkActor *actor)
 {
   if (!this->Parent->GetShaderInitialized(cellBO.Program))
@@ -105,7 +92,7 @@ void vtkCompositeMapperHelper::SetCameraShaderParameters(vtkOpenGLHelper &cellBO
     }
 }
 
-void vtkCompositeMapperHelper::SetLightingShaderParameters(vtkOpenGLHelper &cellBO,
+void vtkCompositeMapperHelper::SetLightingShaderParameters(vtkgl::CellBO &cellBO,
                                                        vtkRenderer *ren, vtkActor *actor)
 {
   if (!this->Parent->GetShaderInitialized(cellBO.Program))
@@ -114,7 +101,7 @@ void vtkCompositeMapperHelper::SetLightingShaderParameters(vtkOpenGLHelper &cell
     }
 }
 
-void vtkCompositeMapperHelper::SetPropertyShaderParameters(vtkOpenGLHelper &cellBO,
+void vtkCompositeMapperHelper::SetPropertyShaderParameters(vtkgl::CellBO &cellBO,
                                                        vtkRenderer *ren, vtkActor *actor)
 {
   if (!this->Parent->GetShaderInitialized(cellBO.Program))
@@ -124,10 +111,6 @@ void vtkCompositeMapperHelper::SetPropertyShaderParameters(vtkOpenGLHelper &cell
 
   vtkProperty *ppty = actor->GetProperty();
 
-  // block colors, if set override scalar coloring
-  cellBO.Program->SetUniformi("OverridesColor",
-    this->Parent->BlockState.AmbientColor.size() > 1);
-
   // override the opacity
   cellBO.Program->SetUniformf("opacityUniform", this->Parent->BlockState.Opacity.top());
   double aIntensity = this->DrawingEdges ? 1.0 : ppty->GetAmbient();  // ignoring renderer ambient
@@ -145,59 +128,32 @@ void vtkCompositeMapperHelper::SetPropertyShaderParameters(vtkOpenGLHelper &cell
   cellBO.Program->SetUniform3f("diffuseColorUniform", diffuseColor);
 }
 
-void vtkCompositeMapperHelper::ReplaceShaderColor(
-  std::map<vtkShader::Type, vtkShader *> shaders,
-  vtkRenderer *ren, vtkActor *actor)
-{
-  std::string FSSource = shaders[vtkShader::Fragment]->GetSource();
-
-  vtkShaderProgram::Substitute(FSSource,"//VTK::Color::Dec",
-    "uniform bool OverridesColor;\n"
-    "//VTK::Color::Dec",false);
-
-  vtkShaderProgram::Substitute(FSSource,"//VTK::Color::Impl",
-    "//VTK::Color::Impl\n"
-    "  if (OverridesColor) {\n"
-    "    ambientColor = ambientColorUniform;\n"
-    "    diffuseColor = diffuseColorUniform; }\n",
-    false);
-
-  shaders[vtkShader::Fragment]->SetSource(FSSource);
-
-  this->Superclass::ReplaceShaderColor(shaders,ren,actor);
-}
-
-
 //-----------------------------------------------------------------------------
-void vtkCompositeMapperHelper::UpdateShaders(
-  vtkOpenGLHelper &cellBO,
-  vtkRenderer* ren, vtkActor *actor)
+void vtkCompositeMapperHelper::UpdateShader(vtkgl::CellBO &cellBO, vtkRenderer* ren, vtkActor *actor)
 {
   // invoke superclass
-  this->Superclass::UpdateShaders(cellBO, ren, actor);
+  this->Superclass::UpdateShader(cellBO, ren, actor);
   // mark this shader as initialized
   this->Parent->SetShaderInitialized(cellBO.Program, true);
 }
 
 //-----------------------------------------------------------------------------
 // smarter version that knows actor/property/camera/lights are not changing
-bool vtkCompositeMapperHelper::GetNeedToRebuildShaders(
-  vtkOpenGLHelper &cellBO, vtkRenderer* ren, vtkActor *actor)
+bool vtkCompositeMapperHelper::GetNeedToRebuildShader(vtkgl::CellBO &cellBO, vtkRenderer* ren, vtkActor *actor)
 {
   if (!cellBO.Program ||  !this->Parent->GetShaderInitialized(cellBO.Program))
     {
-    bool result =
-      this->Superclass::GetNeedToRebuildShaders(cellBO, ren, actor);
-    this->LastColorCoordinates = this->VBO->ColorComponents;
-    this->LastNormalsOffset = this->VBO->NormalOffset;
-    this->LastTCoordComponents = this->VBO->TCoordComponents;
+    bool result = this->Superclass::GetNeedToRebuildShader(cellBO, ren, actor);
+    this->LastColorCoordinates = this->Layout.ColorComponents;
+    this->LastNormalsOffset = this->Layout.NormalOffset;
+    this->LastTCoordComponents = this->Layout.TCoordComponents;
     return result;
     }
 
   // after the first datasedt we only look for changes in pointdata
-  if (this->LastColorCoordinates != this->VBO->ColorComponents ||
-      this->LastNormalsOffset != this->VBO->NormalOffset ||
-      this->LastTCoordComponents != this->VBO->TCoordComponents)
+  if (this->LastColorCoordinates != this->Layout.ColorComponents ||
+      this->LastNormalsOffset != this->Layout.NormalOffset ||
+      this->LastTCoordComponents != this->Layout.TCoordComponents)
     {
     return true;
     }
@@ -652,7 +608,6 @@ void vtkGenericCompositePolyDataMapper2::CopyMapperValuesToHelper(vtkCompositeMa
 {
   helper->vtkMapper::ShallowCopy(this);
   helper->SetStatic(1);
-  helper->SetPopulateSelectionSettings(0);
 }
 
 void vtkGenericCompositePolyDataMapper2::FreeGenericStructures()
@@ -666,13 +621,6 @@ void vtkGenericCompositePolyDataMapper2::FreeGenericStructures()
   this->ShadersInitialized.clear();
 }
 
-//-----------------------------------------------------------------------------
-void vtkGenericCompositePolyDataMapper2::ReleaseGraphicsResources(vtkWindow* win)
-{
-  this->FreeGenericStructures();
-  this->Superclass::ReleaseGraphicsResources(win);
-}
-
 // ---------------------------------------------------------------------------
 // Description:
 // Method initiates the mapping process. Generally sent by the actor
diff --git a/Rendering/OpenGL2/vtkGenericCompositePolyDataMapper2.h b/Rendering/OpenGL2/vtkGenericCompositePolyDataMapper2.h
index b49b359..436d996 100644
--- a/Rendering/OpenGL2/vtkGenericCompositePolyDataMapper2.h
+++ b/Rendering/OpenGL2/vtkGenericCompositePolyDataMapper2.h
@@ -82,12 +82,6 @@ public:
   void RemoveBlockOpacity(unsigned int index);
   void RemoveBlockOpacities();
 
-  // Description:
-  // Release any graphics resources that are being consumed by this mapper.
-  // The parameter window could be used to determine which graphic
-  // resources to release.
-  void ReleaseGraphicsResources(vtkWindow *);
-
 //BTX
 protected:
   vtkGenericCompositePolyDataMapper2();
@@ -129,12 +123,12 @@ protected:
 
   class RenderBlockState
     {
-    public:
-      std::stack<bool> Visibility;
-      std::stack<double> Opacity;
-      std::stack<vtkColor3d> AmbientColor;
-      std::stack<vtkColor3d> DiffuseColor;
-      std::stack<vtkColor3d> SpecularColor;
+  public:
+    std::stack<bool> Visibility;
+    std::stack<double> Opacity;
+    std::stack<vtkColor3d> AmbientColor;
+    std::stack<vtkColor3d> DiffuseColor;
+    std::stack<vtkColor3d> SpecularColor;
     };
 
   RenderBlockState BlockState;
diff --git a/Rendering/OpenGL2/vtkGenericOpenGLRenderWindow.cxx b/Rendering/OpenGL2/vtkGenericOpenGLRenderWindow.cxx
deleted file mode 100644
index 0bc8969..0000000
--- a/Rendering/OpenGL2/vtkGenericOpenGLRenderWindow.cxx
+++ /dev/null
@@ -1,230 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkGenericRenderWindowInteractor.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 "vtkGenericOpenGLRenderWindow.h"
-#include "vtkObjectFactory.h"
-#include "vtkRendererCollection.h"
-#include "vtkOpenGLRenderer.h"
-#include "vtkOpenGLRenderWindow.h"
-#include "vtkCommand.h"
-#include "vtkOpenGLError.h"
-
-vtkStandardNewMacro(vtkGenericOpenGLRenderWindow);
-
-vtkGenericOpenGLRenderWindow::vtkGenericOpenGLRenderWindow()
-{
-  this->DirectStatus = 0;
-  this->CurrentStatus = false;
-  this->SupportsOpenGLStatus = 0;
-}
-
-vtkGenericOpenGLRenderWindow::~vtkGenericOpenGLRenderWindow()
-{
-  this->Finalize();
-
-  vtkRenderer *ren;
-  vtkCollectionSimpleIterator rit;
-  this->Renderers->InitTraversal(rit);
-  while ( (ren = this->Renderers->GetNextRenderer(rit)) )
-    {
-    ren->SetRenderWindow(NULL);
-    }
-}
-
-void vtkGenericOpenGLRenderWindow::PrintSelf(ostream& os, vtkIndent indent)
-{
-  this->Superclass::PrintSelf(os, indent);
-}
-
-void vtkGenericOpenGLRenderWindow::SetFrontBuffer(unsigned int b)
-{
-  this->FrontBuffer = b;
-}
-
-void vtkGenericOpenGLRenderWindow::SetFrontLeftBuffer(unsigned int b)
-{
-  this->FrontLeftBuffer = b;
-}
-
-void vtkGenericOpenGLRenderWindow::SetFrontRightBuffer(unsigned int b)
-{
-  this->FrontRightBuffer = b;
-}
-
-void vtkGenericOpenGLRenderWindow::SetBackBuffer(unsigned int b)
-{
-  this->BackBuffer = b;
-}
-
-void vtkGenericOpenGLRenderWindow::SetBackLeftBuffer(unsigned int b)
-{
-  this->BackLeftBuffer = b;
-}
-
-void vtkGenericOpenGLRenderWindow::SetBackRightBuffer(unsigned int b)
-{
-  this->BackRightBuffer = b;
-}
-
-void vtkGenericOpenGLRenderWindow::Finalize()
-{
-  // tell each of the renderers that this render window/graphics context
-  // is being removed (the RendererCollection is removed by vtkRenderWindow's
-  // destructor)
-  vtkRenderer* ren;
-  this->Renderers->InitTraversal();
-  for ( ren = vtkOpenGLRenderer::SafeDownCast(this->Renderers->GetNextItemAsObject());
-    ren != NULL;
-    ren = vtkOpenGLRenderer::SafeDownCast(this->Renderers->GetNextItemAsObject())  )
-    {
-    ren->SetRenderWindow(NULL);
-    ren->SetRenderWindow(this);
-    }
-}
-
-void vtkGenericOpenGLRenderWindow::Frame()
-{
-  this->InvokeEvent(vtkCommand::WindowFrameEvent, NULL);
-}
-
-void vtkGenericOpenGLRenderWindow::MakeCurrent()
-{
-  this->InvokeEvent(vtkCommand::WindowMakeCurrentEvent, NULL);
-}
-
-bool vtkGenericOpenGLRenderWindow::IsCurrent()
-{
-  this->InvokeEvent(vtkCommand::WindowIsCurrentEvent, &this->CurrentStatus);
-  return this->CurrentStatus;
-}
-
-int vtkGenericOpenGLRenderWindow::SupportsOpenGL()
-{
-  this->InvokeEvent(vtkCommand::WindowSupportsOpenGLEvent, &this->SupportsOpenGLStatus);
-  return this->SupportsOpenGLStatus;
-}
-
-int vtkGenericOpenGLRenderWindow::IsDirect()
-{
-  this->InvokeEvent(vtkCommand::WindowIsDirectEvent, &this->DirectStatus);
-  return this->DirectStatus;
-}
-
-void vtkGenericOpenGLRenderWindow::SetWindowId(void*)
-{
-}
-
-void* vtkGenericOpenGLRenderWindow::GetGenericWindowId()
-{
-  return NULL;
-}
-
-
-void vtkGenericOpenGLRenderWindow::SetDisplayId(void*)
-{
-}
-
-void vtkGenericOpenGLRenderWindow::SetParentId(void*)
-{
-}
-
-void* vtkGenericOpenGLRenderWindow::GetGenericDisplayId()
-{
-  return NULL;
-}
-
-void* vtkGenericOpenGLRenderWindow::GetGenericParentId()
-{
-  return NULL;
-}
-
-void* vtkGenericOpenGLRenderWindow::GetGenericContext()
-{
-  return NULL;
-}
-
-void* vtkGenericOpenGLRenderWindow::GetGenericDrawable()
-{
-  return NULL;
-}
-
-void vtkGenericOpenGLRenderWindow::SetWindowInfo(char*)
-{
-}
-
-void vtkGenericOpenGLRenderWindow::SetParentInfo(char*)
-{
-}
-
-int* vtkGenericOpenGLRenderWindow::GetScreenSize()
-{
-  return NULL;
-}
-
-void vtkGenericOpenGLRenderWindow::Start()
-{
-}
-
-void vtkGenericOpenGLRenderWindow::HideCursor()
-{
-}
-
-void vtkGenericOpenGLRenderWindow::ShowCursor()
-{
-}
-
-void vtkGenericOpenGLRenderWindow::SetFullScreen(int)
-{
-}
-
-void vtkGenericOpenGLRenderWindow::WindowRemap()
-{
-}
-
-int vtkGenericOpenGLRenderWindow::GetEventPending()
-{
-  return 0;
-}
-
-void vtkGenericOpenGLRenderWindow::SetNextWindowId(void*)
-{
-}
-
-void vtkGenericOpenGLRenderWindow::SetNextWindowInfo(char*)
-{
-}
-
-void vtkGenericOpenGLRenderWindow::CreateAWindow()
-{
-}
-
-void vtkGenericOpenGLRenderWindow::DestroyWindow()
-{
-}
-
-void vtkGenericOpenGLRenderWindow::SetIsDirect(int newValue)
-{
-  this->DirectStatus = newValue;
-}
-
-void vtkGenericOpenGLRenderWindow::SetSupportsOpenGL(int newValue)
-{
-  this->SupportsOpenGLStatus = newValue;
-}
-
-void vtkGenericOpenGLRenderWindow::SetIsCurrent(bool newValue)
-{
-  this->CurrentStatus = newValue;
-}
diff --git a/Rendering/OpenGL2/vtkGenericOpenGLRenderWindow.h b/Rendering/OpenGL2/vtkGenericOpenGLRenderWindow.h
deleted file mode 100644
index e4dee7e..0000000
--- a/Rendering/OpenGL2/vtkGenericOpenGLRenderWindow.h
+++ /dev/null
@@ -1,126 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkRenderWindow.h
-
-  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.
-
-=========================================================================*/
-// .NAME vtkGenericOpenGLRenderWindow - platform independent render window
-
-// .SECTION Description
-// vtkGenericOpenGLRenderWindow provides a skeleton for implementing a render window
-// using one's own OpenGL context and drawable.
-// To be effective, one must register an observer for WindowMakeCurrentEvent,
-// WindowIsCurrentEvent and WindowFrameEvent.  When this class sends a WindowIsCurrentEvent,
-// the call data is an bool* which one can use to return whether the context is current.
-
-#ifndef vtkGenericOpenGLRenderWindow_hpp
-#define vtkGenericOpenGLRenderWindow_hpp
-
-#include "vtkRenderingOpenGL2Module.h" // For export macro
-#include "vtkOpenGLRenderWindow.h"
-
-class VTKRENDERINGOPENGL2_EXPORT vtkGenericOpenGLRenderWindow :
-  public vtkOpenGLRenderWindow
-{
-public:
-  static vtkGenericOpenGLRenderWindow* New();
-  vtkTypeMacro(vtkGenericOpenGLRenderWindow, vtkOpenGLRenderWindow);
-  void PrintSelf(ostream& os, vtkIndent indent);
-protected:
-  vtkGenericOpenGLRenderWindow();
-  ~vtkGenericOpenGLRenderWindow();
-
-public:
-
-  //! Cleans up graphics resources allocated in the context for this VTK scene.
-  void Finalize();
-
-  //! flush the pending drawing operations
-  //! Class user may to watch for WindowFrameEvent and act on it
-  void Frame();
-
-  //! Makes the context current.  It is the class user's
-  //! responsibility to watch for WindowMakeCurrentEvent and set it current.
-  void MakeCurrent();
-
-  //! Returns if the context is current.  It is the class user's
-  //! responsibility to watch for WindowIsCurrentEvent and set the bool* flag
-  //! passed through the call data parameter.
-  bool IsCurrent();
-
-  //! Returns if OpenGL is supported.  It is the class user's
-  //! responsibility to watch for WindowSupportsOpenGLEvent and set the int* flag
-  //! passed through the call data parameter.
-  int SupportsOpenGL();
-
-  //! Returns if the context is direct.  It is the class user's
-  //! responsibility to watch for WindowIsDirectEvent and set the int* flag
-  //! passed through the call data parameter.
-  int IsDirect();
-
-  // {@
-  //! set the drawing buffers to use
-  void SetFrontBuffer(unsigned int);
-  void SetFrontLeftBuffer(unsigned int);
-  void SetFrontRightBuffer(unsigned int);
-  void SetBackBuffer(unsigned int);
-  void SetBackLeftBuffer(unsigned int);
-  void SetBackRightBuffer(unsigned int);
-  // }@
-
-  //! no-op (for API compat with OpenGL1).
-  void PushState() {}
-  //! no-op (for API compat with OpenGL1).
-  void PopState() {}
-
-  // {@
-  //! does nothing
-  void SetWindowId(void*);
-  void* GetGenericWindowId();
-  void SetDisplayId(void*);
-  void SetParentId(void*);
-  void* GetGenericDisplayId();
-  void* GetGenericParentId();
-  void* GetGenericContext();
-  void* GetGenericDrawable();
-  void SetWindowInfo(char*);
-  void SetParentInfo(char*);
-  int* GetScreenSize();
-  void Start();
-  void HideCursor();
-  void ShowCursor();
-  void SetFullScreen(int);
-  void WindowRemap();
-  int  GetEventPending();
-  void SetNextWindowId(void*);
-  void SetNextWindowInfo(char*);
-  void CreateAWindow();
-  void DestroyWindow();
-  // }@
-
-  // Description:
-  // Allow to update state within observer callback without changing
-  // data argument and MTime.
-  void SetIsDirect(int newValue);
-  void SetSupportsOpenGL(int newValue);
-  void SetIsCurrent(bool newValue);
-
-protected:
-  int DirectStatus;
-  int SupportsOpenGLStatus;
-  bool CurrentStatus;
-
-private:
-  vtkGenericOpenGLRenderWindow(const vtkGenericOpenGLRenderWindow&);  // Not implemented.
-  void operator=(const vtkGenericOpenGLRenderWindow&);  // Not implemented.
-};
-
-#endif
diff --git a/Rendering/OpenGL2/vtkIOSGLView.h b/Rendering/OpenGL2/vtkIOSGLView.h
new file mode 100644
index 0000000..af7682c
--- /dev/null
+++ b/Rendering/OpenGL2/vtkIOSGLView.h
@@ -0,0 +1,70 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+  Module:    vtkIOSGLView.h
+
+  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.
+
+=========================================================================*/
+// .NAME vtkIOSGLView - IOS OpenGL rendering context
+//
+// .SECTION Description
+// This class is a subclass of IOS's UIView; it uses Objective-C++.
+// This class overrides several UIView methods.
+// To provide the usual VTK keyboard user interface, it overrides the
+// following methods from NSResponder: acceptsFirstResponder, keyDown:,
+// keyUp:, and flagsChanged:
+// To provide the usual VTK mouse user interface, it overrides the
+// following methods from NSResponder: mouseMoved:, mouseEntered:,
+// mouseExited: scrollWheel:, mouseDown:, rightMouseDown:,
+// otherMouseDown:, and resetCursorRects.
+// To be able to render and draw onscreen, it overrides drawRect:
+// from UIView.
+
+// .SECTION See Also
+// vtkIOSRenderWindow
+
+#ifndef vtkIOSGLView_h
+#define vtkIOSGLView_h
+
+#import <UIKit/UIKit.h>
+
+// Note: This file should be includable by both pure Objective-C and Objective-C++ source files.
+// To achieve this, we use the neat technique below:
+#ifdef __cplusplus
+  // Forward declarations
+  class vtkIOSRenderWindow;
+  class vtkIOSRenderWindowInteractor;
+
+  // Type declarations
+  typedef vtkIOSRenderWindow *vtkIOSRenderWindowRef;
+  typedef vtkIOSRenderWindowInteractor *vtkIOSRenderWindowInteractorRef;
+#else
+  // Type declarations
+  typedef void *vtkIOSRenderWindowRef;
+  typedef void *vtkIOSRenderWindowInteractorRef;
+#endif
+
+ at interface vtkIOSGLView : UIView
+{
+  @private
+  vtkIOSRenderWindowRef _myVTKRenderWindow;
+}
+
+- (vtkIOSRenderWindowRef)getVTKRenderWindow;
+- (void)setVTKRenderWindow:(vtkIOSRenderWindowRef)theVTKRenderWindow;
+
+- (vtkIOSRenderWindowInteractorRef)getInteractor;
+
+- (void)setupPipeline;
+
+ at end
+
+#endif /* vtkIOSGLView_h */
+// VTK-HeaderTest-Exclude: vtkIOSGLView.h
diff --git a/Rendering/OpenGL2/vtkIOSGLView.mm b/Rendering/OpenGL2/vtkIOSGLView.mm
new file mode 100644
index 0000000..8bb49ee
--- /dev/null
+++ b/Rendering/OpenGL2/vtkIOSGLView.mm
@@ -0,0 +1,431 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+  Module:    vtkIOSGLView.mm
+
+  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 "vtkOpenGLRenderWindow.h"
+
+#import "vtkIOSGLView.h"
+#import "vtkIOSRenderWindow.h"
+#import "vtkIOSRenderWindowInteractor.h"
+#import "vtkCommand.h"
+
+#include "vtkRenderingOpenGL2ObjectFactory.h"
+
+
+ at interface vtkIOSGLView()
+{
+  // The pixel dimensions of the backbuffer
+  GLint backingWidth;
+  GLint backingHeight;
+
+  EAGLContext *context;
+
+  // OpenGL names for the renderbuffer and framebuffers used to render to this view
+  GLuint viewRenderbuffer, viewFramebuffer;
+
+  // OpenGL name for the depth buffer that is attached to viewFramebuffer, if it exists (0 if it does not exist)
+  GLuint depthRenderbuffer;
+
+  BOOL initialized;
+}
+
+ at end
+
+
+ at implementation vtkIOSGLView
+
+//----------------------------------------------------------------------------
+// Private
+- (void)emptyMethod:(id)sender
+{
+  (void)sender;
+}
+
+//----------------------------------------------------------------------------
+- (vtkIOSRenderWindow *)getVTKRenderWindow
+{
+  return _myVTKRenderWindow;
+}
+
+//----------------------------------------------------------------------------
+- (void)setVTKRenderWindow:(vtkIOSRenderWindow *)theVTKRenderWindow
+{
+  _myVTKRenderWindow = theVTKRenderWindow;
+}
+
+//----------------------------------------------------------------------------
+- (vtkIOSRenderWindowInteractor *)getInteractor
+{
+  if (_myVTKRenderWindow)
+    {
+    return (vtkIOSRenderWindowInteractor *)_myVTKRenderWindow->GetInteractor();
+    }
+  else
+    {
+    return NULL;
+    }
+}
+
+// Implement this to override the default layer class (which is [CALayer class]).
+// We do this so that our view will be backed by a layer that is capable of OpenGL ES rendering.
++ (Class)layerClass
+{
+  return [CAEAGLLayer class];
+}
+
+// The GL view is stored in the nib file. When it's unarchived it's sent -initWithCoder:
+- (id)initWithCoder:(NSCoder*)coder {
+
+    if ((self = [super initWithCoder:coder])) {
+    CAEAGLLayer *eaglLayer = (CAEAGLLayer *)self.layer;
+
+    eaglLayer.opaque = YES;
+    // In this application, we want to retain the EAGLDrawable contents after a call to presentRenderbuffer.
+    eaglLayer.drawableProperties =
+      [NSDictionary dictionaryWithObjectsAndKeys:
+        [NSNumber numberWithBool:YES],
+          kEAGLDrawablePropertyRetainedBacking,
+          kEAGLColorFormatRGBA8,
+          kEAGLDrawablePropertyColorFormat,
+          nil];
+
+    context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2];
+
+    if (!context || ![EAGLContext setCurrentContext:context])
+      {
+      return nil;
+      }
+
+    // Set the view's scale factor as you wish
+    self.contentScaleFactor = [[UIScreen mainScreen] scale];
+
+    self.multipleTouchEnabled = YES;
+  }
+
+  return self;
+}
+
+// If our view is resized, we'll be asked to layout subviews.
+// This is the perfect opportunity to also update the framebuffer so that it is
+// the same size as our display area.
+-(void)layoutSubviews
+{
+  [EAGLContext setCurrentContext:context];
+
+  if (!initialized)
+    {
+    initialized = [self initGL];
+    }
+  else
+    {
+    [self resizeFromLayer:(CAEAGLLayer*)self.layer];
+    }
+}
+
+- (BOOL)initGL
+{
+  // Generate IDs for a framebuffer object and a color renderbuffer
+  glGenFramebuffers(1, &viewFramebuffer);
+  glGenRenderbuffers(1, &viewRenderbuffer);
+
+  glBindFramebuffer(GL_FRAMEBUFFER, viewFramebuffer);
+  glBindRenderbuffer(GL_RENDERBUFFER, viewRenderbuffer);
+  // This call associates the storage for the current render buffer with the EAGLDrawable (our CAEAGLLayer)
+  // allowing us to draw into a buffer that will later be rendered to screen wherever the layer is (which corresponds with our view).
+  [context renderbufferStorage:GL_RENDERBUFFER fromDrawable:(id<EAGLDrawable>)self.layer];
+  glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, viewRenderbuffer);
+
+  glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, &backingWidth);
+  glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_HEIGHT, &backingHeight);
+
+  // For this sample, we do not need a depth buffer. If you do, this is how you can create one and attach it to the framebuffer:
+  glGenRenderbuffers(1, &depthRenderbuffer);
+  glBindRenderbuffer(GL_RENDERBUFFER, depthRenderbuffer);
+  glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, backingWidth, backingHeight);
+  glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, depthRenderbuffer);
+
+  if(glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE)
+    {
+    NSLog(@"failed to make complete framebuffer object %x", glCheckFramebufferStatus(GL_FRAMEBUFFER));
+    return NO;
+    }
+
+  // setup the vis pipeline
+  [self setupPipeline];
+
+  [self getVTKRenderWindow]->SetSize(backingWidth, backingHeight);
+
+  [self getVTKRenderWindow]->Render();
+  glBindRenderbuffer(GL_RENDERBUFFER, viewRenderbuffer);
+  [context presentRenderbuffer:GL_RENDERBUFFER];
+
+  return YES;
+}
+
+- (void)setupPipeline
+{
+  vtkRenderingOpenGL2ObjectFactory *of = vtkRenderingOpenGL2ObjectFactory::New();
+  vtkObjectFactory::RegisterFactory(of);
+
+  vtkIOSRenderWindow *renWin = vtkIOSRenderWindow::New();
+  //renWin->DebugOn();
+  [self setVTKRenderWindow:renWin];
+
+  vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();
+  iren->SetRenderWindow(renWin);
+}
+
+- (BOOL)resizeFromLayer:(CAEAGLLayer *)layer
+{
+  // Allocate color buffer backing based on the current layer size
+  glBindRenderbuffer(GL_RENDERBUFFER, viewRenderbuffer);
+  [context renderbufferStorage:GL_RENDERBUFFER fromDrawable:layer];
+  glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, &backingWidth);
+  glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_HEIGHT, &backingHeight);
+
+  // For this sample, we do not need a depth buffer. If you do, this is how you can allocate depth buffer backing:
+  glBindRenderbuffer(GL_RENDERBUFFER, depthRenderbuffer);
+  glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, backingWidth, backingHeight);
+  glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, depthRenderbuffer);
+
+  if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE)
+    {
+    NSLog(@"Failed to make complete framebuffer object %x", glCheckFramebufferStatus(GL_FRAMEBUFFER));
+    return NO;
+    }
+
+  [self getVTKRenderWindow]->SetSize(backingWidth, backingHeight);
+
+  [self getVTKRenderWindow]->Render();
+  glBindRenderbuffer(GL_RENDERBUFFER, viewRenderbuffer);
+  [context presentRenderbuffer:GL_RENDERBUFFER];
+
+  return YES;
+}
+
+// Releases resources when they are not longer needed.
+- (void)dealloc
+{
+    // Destroy framebuffers and renderbuffers
+  if (viewFramebuffer)
+    {
+    glDeleteFramebuffers(1, &viewFramebuffer);
+    viewFramebuffer = 0;
+    }
+  if (viewRenderbuffer)
+    {
+    glDeleteRenderbuffers(1, &viewRenderbuffer);
+    viewRenderbuffer = 0;
+    }
+  if (depthRenderbuffer)
+    {
+    glDeleteRenderbuffers(1, &depthRenderbuffer);
+    depthRenderbuffer = 0;
+   }
+
+  // tear down context
+  if ([EAGLContext currentContext] == context)
+    {
+    [EAGLContext setCurrentContext:nil];
+    }
+
+  [super dealloc];
+}
+
+// Handles the start of a touch
+- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
+{
+  vtkIOSRenderWindowInteractor *interactor = [self getInteractor];
+  if (!interactor)
+    {
+    return;
+    }
+
+  vtkIOSRenderWindow *renWin = [self getVTKRenderWindow];
+  if (!renWin)
+    {
+    return;
+    }
+
+  CGRect bounds = [self bounds];
+
+  // set the position for all contacts
+  NSSet *myTouches = [event touchesForView:self];
+  for (UITouch *touch in myTouches)
+    {
+    // Convert touch point from UIView referential to OpenGL one (upside-down flip)
+    CGPoint location = [touch locationInView:self];
+    location.y = bounds.size.height - location.y;
+
+    int index = interactor->GetContactIndex((void *)touch);
+    if (index < VTKI_MAX_POINTERS)
+      {
+      interactor->SetEventInformation((int)round(location.x),
+                                  (int)round(location.y),
+                                  0, 0,
+                                  0, 0, 0, index);
+      }
+    }
+
+  // handle begin events
+  for (UITouch *touch in touches)
+    {
+    int index = interactor->GetContactIndex((void *)touch);
+    interactor->SetPointerIndex(index);
+    interactor->InvokeEvent(vtkCommand::LeftButtonPressEvent,NULL);
+    NSLog(@"Starting left mouse");
+    }
+
+  // Display the buffer
+  glBindRenderbuffer(GL_RENDERBUFFER, viewRenderbuffer);
+  [context presentRenderbuffer:GL_RENDERBUFFER];
+}
+
+// Handles the continuation of a touch.
+- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
+{
+  vtkIOSRenderWindowInteractor *interactor = [self getInteractor];
+  if (!interactor)
+    {
+    return;
+    }
+
+  vtkIOSRenderWindow *renWin = [self getVTKRenderWindow];
+  if (!renWin)
+    {
+    return;
+    }
+
+  CGRect        bounds = [self bounds];
+
+  // set the position for all contacts
+  int index;
+  NSSet *myTouches = [event touchesForView:self];
+  for (UITouch *touch in myTouches)
+    {
+    // Convert touch point from UIView referential to OpenGL one (upside-down flip)
+    CGPoint location = [touch locationInView:self];
+    location.y = bounds.size.height - location.y;
+
+    index = interactor->GetContactIndex((void *)touch);
+    if (index < VTKI_MAX_POINTERS)
+      {
+      interactor->SetEventInformation((int)round(location.x),
+                                  (int)round(location.y),
+                                  0, 0,
+                                  0, 0, 0, index);
+      }
+    }
+
+  // fire move event on last index
+  interactor->SetPointerIndex(index);
+  interactor->InvokeEvent(vtkCommand::MouseMoveEvent,NULL);
+  //  NSLog(@"Moved left mouse");
+
+  // Display the buffer
+  glBindRenderbuffer(GL_RENDERBUFFER, viewRenderbuffer);
+  [context presentRenderbuffer:GL_RENDERBUFFER];
+}
+
+// Handles the end of a touch event when the touch is a tap.
+- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
+{
+  vtkIOSRenderWindowInteractor *interactor = [self getInteractor];
+  if (!interactor)
+    {
+    return;
+    }
+
+  vtkIOSRenderWindow *renWin = [self getVTKRenderWindow];
+  if (!renWin)
+    {
+    return;
+    }
+
+  CGRect        bounds = [self bounds];
+  // set the position for all contacts
+  NSSet *myTouches = [event touchesForView:self];
+  for (UITouch *touch in myTouches)
+    {
+    // Convert touch point from UIView referential to OpenGL one (upside-down flip)
+    CGPoint location = [touch locationInView:self];
+    location.y = bounds.size.height - location.y;
+
+    int index = interactor->GetContactIndex((void *)touch);
+    if (index < VTKI_MAX_POINTERS)
+      {
+      interactor->SetEventInformation((int)round(location.x),
+                                  (int)round(location.y),
+                                  0, 0,
+                                  0, 0, 0, index);
+      }
+    }
+
+  // handle begin events
+  for (UITouch *touch in touches)
+    {
+    int index = interactor->GetContactIndex((void *)touch);
+    interactor->SetPointerIndex(index);
+    interactor->InvokeEvent(vtkCommand::LeftButtonReleaseEvent,NULL);
+    interactor->ClearContactIndex((void *)touch);
+    NSLog(@"lifting left mouse");
+    }
+
+  // Display the buffer
+  glBindRenderbuffer(GL_RENDERBUFFER, viewRenderbuffer);
+  [context presentRenderbuffer:GL_RENDERBUFFER];
+}
+
+// Handles the end of a touch event.
+- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event
+{
+  vtkIOSRenderWindowInteractor *interactor = [self getInteractor];
+  if (!interactor)
+    {
+    return;
+    }
+
+  vtkIOSRenderWindow *renWin = [self getVTKRenderWindow];
+  if (!renWin)
+    {
+    return;
+    }
+
+  CGRect        bounds = [self bounds];
+  UITouch*            touch = [[event touchesForView:self] anyObject];
+  // Convert touch point from UIView referential to OpenGL one (upside-down flip)
+  CGPoint location = [touch locationInView:self];
+  location.y = bounds.size.height - location.y;
+
+  interactor->SetEventInformation((int)round(location.x),
+                                  (int)round(location.y),
+                                  0, 0,
+                                  0, 0);
+  interactor->InvokeEvent(vtkCommand::LeftButtonReleaseEvent,NULL);
+ // NSLog(@"Ended left mouse");
+
+  // Display the buffer
+  //[self getVTKRenderWindow]->Render();
+  glBindRenderbuffer(GL_RENDERBUFFER, viewRenderbuffer);
+  [context presentRenderbuffer:GL_RENDERBUFFER];
+}
+
+- (BOOL)canBecomeFirstResponder
+{
+    return YES;
+}
+
+
+ at end
diff --git a/Rendering/OpenGL2/vtkIOSRenderWindow.mm b/Rendering/OpenGL2/vtkIOSRenderWindow.mm
index a91a146..d094504 100644
--- a/Rendering/OpenGL2/vtkIOSRenderWindow.mm
+++ b/Rendering/OpenGL2/vtkIOSRenderWindow.mm
@@ -21,11 +21,10 @@ PURPOSE.  See the above copyright notice for more information.
 #import "vtkIdList.h"
 #import "vtkObjectFactory.h"
 #import "vtkRendererCollection.h"
+#import "vtkIOSGLView.h"
 
 #import <vtksys/ios/sstream>
 
-#include "vtk_glew.h"
-
 vtkStandardNewMacro(vtkIOSRenderWindow);
 
 
diff --git a/Rendering/OpenGL2/vtkImageProcessingPass.cxx b/Rendering/OpenGL2/vtkImageProcessingPass.cxx
index ac5954d..f0e347e 100644
--- a/Rendering/OpenGL2/vtkImageProcessingPass.cxx
+++ b/Rendering/OpenGL2/vtkImageProcessingPass.cxx
@@ -13,8 +13,6 @@
 
 =========================================================================*/
 
-#include "vtk_glew.h"
-
 #include "vtkImageProcessingPass.h"
 #include "vtkObjectFactory.h"
 #include <cassert>
@@ -23,6 +21,7 @@
 #include "vtkFrameBufferObject.h"
 #include "vtkTextureObject.h"
 #include "vtkOpenGLRenderWindow.h"
+#include "vtkTextureUnitManager.h"
 
 // to be able to dump intermediate passes into png files for debugging.
 // only for vtkImageProcessingPass developers.
diff --git a/Rendering/OpenGL2/vtkOSOpenGLRenderWindow.cxx b/Rendering/OpenGL2/vtkOSOpenGLRenderWindow.cxx
index 57d9f1f..3865b48 100644
--- a/Rendering/OpenGL2/vtkOSOpenGLRenderWindow.cxx
+++ b/Rendering/OpenGL2/vtkOSOpenGLRenderWindow.cxx
@@ -168,8 +168,11 @@ void vtkOSOpenGLRenderWindow::DestroyWindow()
     }
 
 
-  delete[] this->Capabilities;
-  this->Capabilities = 0;
+  if (this->Capabilities)
+    {
+    delete[] this->Capabilities;
+    this->Capabilities = 0;
+    }
 
   this->DestroyOffScreenWindow();
 
diff --git a/Rendering/OpenGL2/vtkOpenGLActor.cxx b/Rendering/OpenGL2/vtkOpenGLActor.cxx
index f34dbb6..9399a73 100644
--- a/Rendering/OpenGL2/vtkOpenGLActor.cxx
+++ b/Rendering/OpenGL2/vtkOpenGLActor.cxx
@@ -50,8 +50,8 @@ void vtkOpenGLActor::Render(vtkRenderer *ren, vtkMapper *mapper)
   vtkOpenGLClearErrorMacro();
 
   // get opacity
-  bool opaque = (this->GetIsOpaque() != 0);
-  if (opaque)
+  double opacity = this->GetProperty()->GetOpacity();
+  if (opacity == 1.0)
     {
     glDepthMask(GL_TRUE);
     }
@@ -79,7 +79,7 @@ void vtkOpenGLActor::Render(vtkRenderer *ren, vtkMapper *mapper)
   // send a render to the mapper; update pipeline
   mapper->Render(ren, this);
 
-  if (!opaque)
+  if (opacity != 1.0)
     {
     glDepthMask(GL_TRUE);
     }
@@ -125,3 +125,13 @@ void vtkOpenGLActor::GetKeyMatrices(vtkMatrix4x4 *&mcwc, vtkMatrix3x3 *&normMat)
   mcwc = this->MCWCMatrix;
   normMat = this->NormalMatrix;
 }
+
+vtkIdType vtkOpenGLActor::GetConvertedPickValue(vtkIdType idIn, int fieldassociation)
+{
+  vtkOpenGLPolyDataMapper *pdm = vtkOpenGLPolyDataMapper::SafeDownCast(this->GetMapper());
+  if (pdm)
+    {
+    return pdm->GetConvertedPickValue(idIn, fieldassociation,this);
+    }
+  return idIn;
+}
diff --git a/Rendering/OpenGL2/vtkOpenGLActor.h b/Rendering/OpenGL2/vtkOpenGLActor.h
index 556babf..f920989 100644
--- a/Rendering/OpenGL2/vtkOpenGLActor.h
+++ b/Rendering/OpenGL2/vtkOpenGLActor.h
@@ -40,6 +40,13 @@ public:
 
   void GetKeyMatrices(vtkMatrix4x4 *&WCVCMatrix, vtkMatrix3x3 *&normalMatrix);
 
+  // Description:
+  // Props may provide a mapping from picked value to actual value
+  // This is useful for hardware based pickers where
+  // there is a mapping between the color in the buffer
+  // and the actual pick value
+  virtual vtkIdType GetConvertedPickValue(vtkIdType idIn, int fieldassociation);
+
 protected:
   vtkOpenGLActor();
   ~vtkOpenGLActor();
diff --git a/Rendering/OpenGL2/vtkOpenGLBufferObject.cxx b/Rendering/OpenGL2/vtkOpenGLBufferObject.cxx
deleted file mode 100644
index 5c44a3a..0000000
--- a/Rendering/OpenGL2/vtkOpenGLBufferObject.cxx
+++ /dev/null
@@ -1,151 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-
-  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 "vtkOpenGLBufferObject.h"
-#include "vtkObjectFactory.h"
-
-#include "vtk_glew.h"
-
-vtkStandardNewMacro(vtkOpenGLBufferObject)
-
-namespace {
-inline GLenum convertType(vtkOpenGLBufferObject::ObjectType type)
-{
-  switch (type)
-    {
-    case vtkOpenGLBufferObject::ElementArrayBuffer:
-      return GL_ELEMENT_ARRAY_BUFFER;
-    case vtkOpenGLBufferObject::TextureBuffer:
-#if defined (GL_TEXTURE_BUFFER)
-      return GL_TEXTURE_BUFFER;
-      // intentional fall through when not defined
-#endif
-    default:
-    case vtkOpenGLBufferObject::ArrayBuffer:
-      return GL_ARRAY_BUFFER;
-    }
-}
-}
-
-struct vtkOpenGLBufferObject::Private
-{
-  Private()
-    {
-    this->Handle = 0;
-    }
-  GLenum Type;
-  GLuint Handle;
-};
-
-vtkOpenGLBufferObject::vtkOpenGLBufferObject()
-{
-  this->Dirty = true;
-  this->Internal = new Private;
-  this->Internal->Type = convertType(vtkOpenGLBufferObject::ArrayBuffer);
-}
-
-vtkOpenGLBufferObject::~vtkOpenGLBufferObject()
-{
-  if (this->Internal->Handle != 0)
-    {
-    glDeleteBuffers(1, &this->Internal->Handle);
-    }
-  delete this->Internal;
-}
-
-void vtkOpenGLBufferObject::ReleaseGraphicsResources()
-{
-  if (this->Internal->Handle != 0)
-    {
-    glBindBuffer(this->Internal->Type, 0);
-    glDeleteBuffers(1, &this->Internal->Handle);
-    this->Internal->Handle = 0;
-    }
-}
-
-void vtkOpenGLBufferObject::SetType(vtkOpenGLBufferObject::ObjectType value)
-{
-  this->Internal->Type = convertType(value);
-}
-
-vtkOpenGLBufferObject::ObjectType vtkOpenGLBufferObject::GetType() const
-{
-  if (this->Internal->Type == GL_ARRAY_BUFFER)
-    {
-    return vtkOpenGLBufferObject::ArrayBuffer;
-    }
-  if (this->Internal->Type == GL_ELEMENT_ARRAY_BUFFER)
-    {
-    return vtkOpenGLBufferObject::ElementArrayBuffer;
-    }
-  else
-    {
-    return vtkOpenGLBufferObject::TextureBuffer;
-    }
-}
-
-int vtkOpenGLBufferObject::GetHandle() const
-{
-  return static_cast<int>(this->Internal->Handle);
-}
-
-bool vtkOpenGLBufferObject::Bind()
-{
-  if (!this->Internal->Handle)
-    {
-    return false;
-    }
-
-  glBindBuffer(this->Internal->Type, this->Internal->Handle);
-  return true;
-}
-
-bool vtkOpenGLBufferObject::Release()
-{
-  if (!this->Internal->Handle)
-    {
-    return false;
-    }
-
-  glBindBuffer(this->Internal->Type, 0);
-  return true;
-}
-
-bool vtkOpenGLBufferObject::UploadInternal(
-  const void *buffer, size_t size,
-  vtkOpenGLBufferObject::ObjectType objectType)
-{
-  GLenum objectTypeGL = convertType(objectType);
-  if (this->Internal->Handle == 0)
-    {
-    glGenBuffers(1, &this->Internal->Handle);
-    this->Internal->Type = objectTypeGL;
-    }
-  else if (this->Internal->Type != objectTypeGL)
-    {
-    this->Error = "Trying to upload array buffer to incompatible buffer.";
-    return false;
-    }
-  glBindBuffer(this->Internal->Type, this->Internal->Handle);
-  glBufferData(this->Internal->Type, size, static_cast<const GLvoid *>(buffer),
-               GL_STATIC_DRAW);
-  this->Dirty = false;
-  return true;
-}
-
-
-//-----------------------------------------------------------------------------
-void vtkOpenGLBufferObject::PrintSelf(ostream& os, vtkIndent indent)
-{
-  this->Superclass::PrintSelf(os, indent);
-}
diff --git a/Rendering/OpenGL2/vtkOpenGLBufferObject.h b/Rendering/OpenGL2/vtkOpenGLBufferObject.h
deleted file mode 100644
index ecbc4ae..0000000
--- a/Rendering/OpenGL2/vtkOpenGLBufferObject.h
+++ /dev/null
@@ -1,142 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-
-  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.
-
-=========================================================================*/
-#ifndef vtkOpenGLBufferObject_h
-#define vtkOpenGLBufferObject_h
-
-#include "vtkRenderingOpenGL2Module.h" // for export macro
-#include "vtkObject.h"
-#include <vector> // used for method args
-
-class vtkCellArray;
-class vtkDataArray;
-class vtkPoints;
-
-/**
- * @brief OpenGL buffer object
- *
- * OpenGL buffer object to store index, geometry and/or attribute data on the
- * GPU.
- */
-
-class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLBufferObject : public vtkObject
-{
-public:
-  static vtkOpenGLBufferObject *New();
-  vtkTypeMacro(vtkOpenGLBufferObject, vtkObject);
-  void PrintSelf(ostream& os, vtkIndent indent);
-
-  enum ObjectType
-    {
-    ArrayBuffer,
-    ElementArrayBuffer,
-    TextureBuffer
-    };
-
-  /** Get the type of the buffer object. */
-  ObjectType GetType() const;
-
-  /** Set the type of the buffer object. */
-  void SetType(ObjectType value);
-
-  /** Get the handle of the buffer object. */
-  int GetHandle() const;
-
-  /** Determine if the buffer object is ready to be used. */
-  bool IsReady() const { return this->Dirty == false; }
-
-  /**
-   * Upload data to the buffer object. The BufferObject::type() must match
-   * @a type or be uninitialized.
-   *
-   * The T type must have tightly packed values of T::value_type accessible by
-   * reference via T::operator[]. Additionally, the standard size() and empty()
-   * methods must be implemented. The std::vector class is an example of such a
-   * supported containers.
-   */
-  template <class T>
-  bool Upload(const T &array, ObjectType type);
-
-  // non vector version
-  template <class T>
-  bool Upload(const T *array, size_t numElements, ObjectType type);
-
-  /**
-   * Bind the buffer object ready for rendering.
-   * @note Only one ARRAY_BUFFER and one ELEMENT_ARRAY_BUFFER may be bound at
-   * any time.
-   */
-  bool Bind();
-
-  /**
-   * Release the buffer. This should be done after rendering is complete.
-   */
-  bool Release();
-
-
-  // Description:
-  // Release any graphics resources that are being consumed by this class.
-  void ReleaseGraphicsResources();
-
-  /**
-   * Return a string describing errors.
-   */
-  std::string GetError() const { return Error; }
-
-protected:
-  vtkOpenGLBufferObject();
-  ~vtkOpenGLBufferObject();
-  bool  Dirty;
-  std::string Error;
-
-  bool UploadInternal(const void *buffer, size_t size, ObjectType objectType);
-
-private:
-  vtkOpenGLBufferObject(const vtkOpenGLBufferObject&); // Not implemented
-  void operator=(const vtkOpenGLBufferObject&); // Not implemented
-  struct Private;
-  Private *Internal;
-};
-
-template <class T>
-inline bool vtkOpenGLBufferObject::Upload(
-  const T &array,
-  vtkOpenGLBufferObject::ObjectType objectType)
-{
-  if (array.empty())
-    {
-    this->Error = "Refusing to upload empty array.";
-    return false;
-    }
-
-  return this->UploadInternal(&array[0],
-            array.size() * sizeof(typename T::value_type),
-            objectType);
-}
-
-template <class T>
-inline bool vtkOpenGLBufferObject::Upload(
-  const T *array, size_t numElements,
-  vtkOpenGLBufferObject::ObjectType objectType)
-{
-  if (!array)
-    {
-    this->Error = "Refusing to upload empty array.";
-    return false;
-    }
-  return this->UploadInternal(array,
-                              numElements * sizeof(T),
-                              objectType);
-}
-
-#endif
diff --git a/Rendering/OpenGL2/vtkOpenGLCamera.cxx b/Rendering/OpenGL2/vtkOpenGLCamera.cxx
index 29df024..ad05dcc 100644
--- a/Rendering/OpenGL2/vtkOpenGLCamera.cxx
+++ b/Rendering/OpenGL2/vtkOpenGLCamera.cxx
@@ -207,4 +207,4 @@ void vtkOpenGLCamera::GetKeyMatrices(vtkRenderer *ren, vtkMatrix4x4 *&wcvc,
   normMat = this->NormalMatrix;
   vcdc = this->VCDCMatrix;
   wcdc = this->WCDCMatrix;
-}
+}
\ No newline at end of file
diff --git a/Rendering/OpenGL2/vtkOpenGLError.h.in b/Rendering/OpenGL2/vtkOpenGLError.h.in
index 339bd40..7ce4c03 100644
--- a/Rendering/OpenGL2/vtkOpenGLError.h.in
+++ b/Rendering/OpenGL2/vtkOpenGLError.h.in
@@ -18,16 +18,7 @@
 #include "vtkSetGet.h"
 #include "vtk_glew.h"
 
-#ifndef NDEBUG
-// debug build.
 #cmakedefine VTK_REPORT_OPENGL_ERRORS
-#else // NDEBUG
-// release build
-#cmakedefine VTK_REPORT_OPENGL_ERRORS_IN_RELEASE_BUILDS
-#if defined(VTK_REPORT_OPENGL_ERRORS_IN_RELEASE_BUILDS)
-#cmakedefine VTK_REPORT_OPENGL_ERRORS
-#endif // defined(VTK_REPORT_OPENGL_ERRORS_IN_RELEASE_BUILDS)
-#endif // NDEBUG
 
 // Description:
 // The following functions can be used to detect and report, and/or
diff --git a/Rendering/OpenGL2/vtkOpenGLGlyph3DHelper.cxx b/Rendering/OpenGL2/vtkOpenGLGlyph3DHelper.cxx
index 9d21e88..62be5f3 100644
--- a/Rendering/OpenGL2/vtkOpenGLGlyph3DHelper.cxx
+++ b/Rendering/OpenGL2/vtkOpenGLGlyph3DHelper.cxx
@@ -13,7 +13,7 @@
 =========================================================================*/
 #include "vtkOpenGLGlyph3DHelper.h"
 
-#include "vtkOpenGLHelper.h"
+#include "vtkglVBOHelper.h"
 
 #include "vtkBitArray.h"
 #include "vtkCamera.h"
@@ -24,20 +24,19 @@
 #include "vtkMatrix4x4.h"
 #include "vtkNew.h"
 #include "vtkObjectFactory.h"
-#include "vtkOpenGLBufferObject.h"
 #include "vtkOpenGLError.h"
-#include "vtkOpenGLIndexBufferObject.h"
 #include "vtkOpenGLRenderWindow.h"
 #include "vtkOpenGLRenderer.h"
 #include "vtkOpenGLShaderCache.h"
-#include "vtkOpenGLVertexArrayObject.h"
-#include "vtkOpenGLVertexBufferObject.h"
 #include "vtkProperty.h"
 #include "vtkShader.h"
 #include "vtkShaderProgram.h"
 #include "vtkTransform.h"
 
-#include "vtkGlyph3DVS.h"
+
+#include "vtkglGlyph3DVSFragmentLit.h"
+
+using vtkgl::substitute;
 
 //-----------------------------------------------------------------------------
 vtkStandardNewMacro(vtkOpenGLGlyph3DHelper)
@@ -45,99 +44,62 @@ vtkStandardNewMacro(vtkOpenGLGlyph3DHelper)
 //-----------------------------------------------------------------------------
 vtkOpenGLGlyph3DHelper::vtkOpenGLGlyph3DHelper()
 {
-  this->NormalMatrixBuffer = vtkOpenGLBufferObject::New();
-  this->MatrixBuffer = vtkOpenGLBufferObject::New();
-  this->ColorBuffer = vtkOpenGLBufferObject::New();
   this->ModelTransformMatrix = NULL;
   this->ModelNormalMatrix = NULL;
   this->ModelColor = NULL;
   this->UseFastPath = false;
   this->UsingInstancing = false;
-}
-
-//-----------------------------------------------------------------------------
-vtkOpenGLGlyph3DHelper::~vtkOpenGLGlyph3DHelper()
-{
-  this->NormalMatrixBuffer->Delete();
-  this->NormalMatrixBuffer = 0;
-  this->MatrixBuffer->Delete();
-  this->MatrixBuffer = 0;
-  this->ColorBuffer->Delete();
-  this->ColorBuffer = 0;
-}
-
 
-// ---------------------------------------------------------------------------
-// Description:
-// Release any graphics resources that are being consumed by this mapper.
-void vtkOpenGLGlyph3DHelper::ReleaseGraphicsResources(vtkWindow *window)
-{
-  this->NormalMatrixBuffer->ReleaseGraphicsResources();
-  this->MatrixBuffer->ReleaseGraphicsResources();
-  this->ColorBuffer->ReleaseGraphicsResources();
-  this->Superclass::ReleaseGraphicsResources(window);
+  // we always tell our triangle VAO to emulate to be safe
+  // this is because it seems that GLEW_ARB_vertex_array_object
+  // does not always handle the attributes for GLEW_ARB_instanced_arrays
+  this->Tris.vao.SetForceEmulation(true);
 }
 
 //-----------------------------------------------------------------------------
-void vtkOpenGLGlyph3DHelper::GetShaderTemplate(
-    std::map<vtkShader::Type, vtkShader *> shaders,
-    vtkRenderer *ren, vtkActor *actor)
+void vtkOpenGLGlyph3DHelper::GetShaderTemplate(std::string &VSSource,
+                                          std::string &FSSource,
+                                          std::string &GSSource,
+                                          int lightComplexity, vtkRenderer* ren, vtkActor *actor)
 {
-  this->Superclass::GetShaderTemplate(shaders,ren,actor);
+  this->Superclass::GetShaderTemplate(VSSource,FSSource,GSSource,lightComplexity,ren,actor);
 
-  shaders[vtkShader::Vertex]->SetSource(vtkGlyph3DVS);
+  VSSource = vtkglGlyph3DVSFragmentLit;
 }
 
-void vtkOpenGLGlyph3DHelper::ReplaceShaderPositionVC(
-  std::map<vtkShader::Type, vtkShader *> shaders,
-  vtkRenderer *ren, vtkActor *actor)
+void vtkOpenGLGlyph3DHelper::ReplaceShaderValues(std::string &VSSource,
+                                                 std::string &FSSource,
+                                                 std::string &GSSource,
+                                                 int lightComplexity,
+                                                 vtkRenderer* ren,
+                                                 vtkActor *actor)
 {
-  std::string VSSource = shaders[vtkShader::Vertex]->GetSource();
-
-  if (this->LastLightComplexity > 0)
+  if (lightComplexity > 0)
     {
     // we use vertex instead of vertexMC
-    vtkShaderProgram::Substitute(VSSource,
+    substitute(VSSource,
       "//VTK::PositionVC::Impl",
-      "vertexVCVSOutput = MCVCMatrix * vertex;\n"
+      "vertexVC = MCVCMatrix * vertex;\n"
       "  gl_Position = MCDCMatrix * vertex;\n");
     }
-  else
-    {
-    vtkShaderProgram::Substitute(VSSource,
-      "//VTK::PositionVC::Impl",
-      "gl_Position = MCDCMatrix * vertex;\n");
-    }
-
-  shaders[vtkShader::Vertex]->SetSource(VSSource);
-
-  this->Superclass::ReplaceShaderPositionVC(shaders,ren,actor);
-}
-
-void vtkOpenGLGlyph3DHelper::ReplaceShaderColor(
-  std::map<vtkShader::Type, vtkShader *> shaders,
-  vtkRenderer *ren, vtkActor *actor)
-{
-  std::string VSSource = shaders[vtkShader::Vertex]->GetSource();
-  std::string FSSource = shaders[vtkShader::Fragment]->GetSource();
 
   // deal with color
   if (this->UsingInstancing)
     {
-    vtkShaderProgram::Substitute(VSSource,
-      "//VTK::Color::Dec",
-      "attribute vec4 glyphColor;\n"
-      "varying vec4 vertexColorVSOutput;");
+    substitute(VSSource,"//VTK::Color::Dec",
+                        "attribute vec4 glyphColor;\n"
+                        "varying vec4 vertexColor;");
     }
   else
     {
-    vtkShaderProgram::Substitute(VSSource,
-      "//VTK::Color::Dec",
-      "uniform vec4 glyphColor;\n"
-      "varying vec4 vertexColorVSOutput;");
+    substitute(VSSource,
+               "//VTK::Color::Dec",
+               "uniform vec4 glyphColor;\n"
+               "varying vec4 vertexColor;");
     }
-  vtkShaderProgram::Substitute(VSSource,"//VTK::Color::Impl",
-    "vertexColorVSOutput =  glyphColor;");
+  substitute(VSSource,"//VTK::Color::Impl",
+                      "vertexColor =  glyphColor;");
+
 
   // crate the material/color property declarations, and VS implementation
   // these are always defined
@@ -154,7 +116,7 @@ void vtkOpenGLGlyph3DHelper::ReplaceShaderColor(
       "uniform vec3 diffuseColorUniformBF; // intensity weighted color\n";
     }
   // add more for specular
-  if (this->LastLightComplexity)
+  if (lightComplexity)
     {
     colorDec +=
       "uniform vec3 specularColorUniform; // intensity weighted color\n"
@@ -166,8 +128,8 @@ void vtkOpenGLGlyph3DHelper::ReplaceShaderColor(
         "uniform float specularPowerUniformBF;\n";
       }
     }
-  colorDec += "varying vec4 vertexColorVSOutput;\n";
-  vtkShaderProgram::Substitute(FSSource,"//VTK::Color::Dec", colorDec);
+  colorDec += "varying vec4 vertexColor;\n";
+  substitute(FSSource,"//VTK::Color::Dec", colorDec);
 
   // now handle the more complex fragment shader implementation
   // the following are always defined variables.  We start
@@ -176,7 +138,7 @@ void vtkOpenGLGlyph3DHelper::ReplaceShaderColor(
     "vec3 ambientColor;\n"
     "  vec3 diffuseColor;\n"
     "  float opacity;\n";
-  if (this->LastLightComplexity)
+  if (lightComplexity)
     {
     colorImpl +=
       "  vec3 specularColor;\n"
@@ -184,7 +146,7 @@ void vtkOpenGLGlyph3DHelper::ReplaceShaderColor(
     }
   if (actor->GetBackfaceProperty())
     {
-    if (this->LastLightComplexity)
+    if (lightComplexity)
       {
       colorImpl +=
         "  if (int(gl_FrontFacing) == 0) {\n"
@@ -219,7 +181,7 @@ void vtkOpenGLGlyph3DHelper::ReplaceShaderColor(
       "    ambientColor = ambientColorUniform;\n"
       "    diffuseColor = diffuseColorUniform;\n"
       "    opacity = opacityUniform;\n";
-    if (this->LastLightComplexity)
+    if (lightComplexity)
       {
       colorImpl +=
         "    specularColor = specularColorUniform;\n"
@@ -232,97 +194,68 @@ void vtkOpenGLGlyph3DHelper::ReplaceShaderColor(
         (this->ScalarMaterialMode == VTK_MATERIALMODE_DEFAULT &&
          actor->GetProperty()->GetAmbient() > actor->GetProperty()->GetDiffuse()))
     {
-    vtkShaderProgram::Substitute(FSSource,"//VTK::Color::Impl",
-      colorImpl +
-      "  ambientColor = vertexColorVSOutput.rgb;\n"
-      "  opacity = vertexColorVSOutput.a;");
+    substitute(FSSource,"//VTK::Color::Impl", colorImpl +
+                        "  ambientColor = vertexColor.rgb;\n"
+                        "  opacity = vertexColor.a;");
     }
   else if (this->ScalarMaterialMode == VTK_MATERIALMODE_DIFFUSE ||
         (this->ScalarMaterialMode == VTK_MATERIALMODE_DEFAULT &&
          actor->GetProperty()->GetAmbient() <= actor->GetProperty()->GetDiffuse()))
     {
-    vtkShaderProgram::Substitute(FSSource,"//VTK::Color::Impl",
-      colorImpl +
-      "  diffuseColor = vertexColorVSOutput.rgb;\n"
-      "  opacity = vertexColorVSOutput.a;");
+    substitute(FSSource,"//VTK::Color::Impl", colorImpl +
+                        "  diffuseColor = vertexColor.rgb;\n"
+                        "  opacity = vertexColor.a;");
     }
   else
     {
-    vtkShaderProgram::Substitute(FSSource,"//VTK::Color::Impl",
-      colorImpl +
-      "  diffuseColor = vertexColorVSOutput.rgb;\n"
-      "  ambientColor = vertexColorVSOutput.rgb;\n"
-      "  opacity = vertexColorVSOutput.a;");
+    substitute(FSSource,"//VTK::Color::Impl", colorImpl +
+                        "  diffuseColor = vertexColor.rgb;\n"
+                        "  ambientColor = vertexColor.rgb;\n"
+                        "  opacity = vertexColor.a;");
     }
 
   if (this->UsingInstancing)
     {
-    vtkShaderProgram::Substitute(VSSource,
-       "//VTK::Glyph::Dec",
-       "attribute mat4 GCMCMatrix;");
+    substitute(VSSource,
+                       "//VTK::Glyph::Dec",
+                       "attribute mat4 GCMCMatrix;");
     }
   else
     {
-    vtkShaderProgram::Substitute(VSSource,
-      "//VTK::Glyph::Dec",
-      "uniform mat4 GCMCMatrix;");
+    substitute(VSSource,
+                       "//VTK::Glyph::Dec",
+                       "uniform mat4 GCMCMatrix;");
     }
-  vtkShaderProgram::Substitute(VSSource,
-    "//VTK::Glyph::Impl",
-    "vec4 vertex = GCMCMatrix * vertexMC;\n");
-
-  shaders[vtkShader::Vertex]->SetSource(VSSource);
-  shaders[vtkShader::Fragment]->SetSource(FSSource);
-
-  this->Superclass::ReplaceShaderColor(shaders,ren,actor);
-}
-
-void vtkOpenGLGlyph3DHelper::ReplaceShaderNormal(
-  std::map<vtkShader::Type, vtkShader *> shaders,
-  vtkRenderer *ren, vtkActor *actor)
-{
-  std::string VSSource = shaders[vtkShader::Vertex]->GetSource();
-  std::string FSSource = shaders[vtkShader::Fragment]->GetSource();
+  substitute(VSSource,
+                     "//VTK::Glyph::Impl",
+                     "vec4 vertex = GCMCMatrix * vertexMC;\n");
 
   // new code for normal matrix if we have normals
-  if (this->VBO->NormalOffset)
+  if (this->Layout.NormalOffset)
     {
     if (this->UsingInstancing)
       {
-      vtkShaderProgram::Substitute(VSSource,
-         "//VTK::Normal::Dec",
-         "uniform mat3 normalMatrix;\n"
-         "attribute vec3 normalMC;\n"
-         "attribute mat3 glyphNormalMatrix;\n"
-         "varying vec3 normalVCVSOutput;");
+      substitute(VSSource,
+                         "//VTK::Normal::Dec",
+                         "uniform mat3 normalMatrix;\n"
+                         "attribute vec3 normalMC;\n"
+                         "attribute mat3 glyphNormalMatrix;\n"
+                         "varying vec3 normalVCVarying;");
       }
     else
       {
-      vtkShaderProgram::Substitute(VSSource,
-         "//VTK::Normal::Dec",
-         "uniform mat3 normalMatrix;\n"
-         "attribute vec3 normalMC;\n"
-         "uniform mat3 glyphNormalMatrix;\n"
-         "varying vec3 normalVCVSOutput;");
+      substitute(VSSource,
+                         "//VTK::Normal::Dec",
+                         "uniform mat3 normalMatrix;\n"
+                         "attribute vec3 normalMC;\n"
+                         "uniform mat3 glyphNormalMatrix;\n"
+                         "varying vec3 normalVCVarying;");
       }
-    vtkShaderProgram::Substitute(VSSource, "//VTK::Normal::Impl",
-      "normalVCVSOutput = normalMatrix * glyphNormalMatrix * normalMC;");
+    substitute(VSSource, "//VTK::Normal::Impl",
+      "normalVCVarying = normalMatrix * glyphNormalMatrix * normalMC;");
     this->ShaderVariablesUsed.push_back("normalMatrix");
     }
 
-  shaders[vtkShader::Vertex]->SetSource(VSSource);
-  shaders[vtkShader::Fragment]->SetSource(FSSource);
-
-  this->Superclass::ReplaceShaderNormal(shaders,ren,actor);
-}
-
-
-void vtkOpenGLGlyph3DHelper::ReplaceShaderClip(
-  std::map<vtkShader::Type, vtkShader *> shaders,
-  vtkRenderer *ren, vtkActor *actor)
-{
-  std::string VSSource = shaders[vtkShader::Vertex]->GetSource();
-
   // override one part of the clipping code
   if (this->GetNumberOfClippingPlanes())
     {
@@ -334,7 +267,7 @@ void vtkOpenGLGlyph3DHelper::ReplaceShaderClip(
       numClipPlanes = 6;
       }
 
-    vtkShaderProgram::Substitute(VSSource,
+    substitute(VSSource,
        "//VTK::Clip::Impl",
        "for (int planeNum = 0; planeNum < numClipPlanes; planeNum++)\n"
        "    {\n"
@@ -342,28 +275,21 @@ void vtkOpenGLGlyph3DHelper::ReplaceShaderClip(
        "    }\n");
     }
 
-  shaders[vtkShader::Vertex]->SetSource(VSSource);
 
-  this->Superclass::ReplaceShaderClip(shaders,ren,actor);
+  this->Superclass::ReplaceShaderValues(VSSource,FSSource,GSSource,
+                                        lightComplexity,ren,actor);
 }
 
-void vtkOpenGLGlyph3DHelper::GlyphRender(
-  vtkRenderer* ren,
-  vtkActor* actor,
-  vtkIdType numPts,
-  std::vector<unsigned char> &colors,
-  std::vector<float> &matrices,
-  std::vector<float> &normalMatrices,
-  std::vector<vtkIdType> &pickIds,
-  unsigned long pointMTime)
+//-----------------------------------------------------------------------------
+vtkOpenGLGlyph3DHelper::~vtkOpenGLGlyph3DHelper()
 {
-  // we always tell our triangle VAO to emulate unless we
-  // have opngl 3.2 to be safe
-  // this is because it seems that GLEW_ARB_vertex_array_object
-  // does not always handle the attributes for GLEW_ARB_instanced_arrays
-  this->Tris.VAO->SetForceEmulation(
-    !vtkOpenGLRenderWindow::GetContextSupportsOpenGL32());
+}
 
+void vtkOpenGLGlyph3DHelper::GlyphRender(vtkRenderer* ren, vtkActor* actor, vtkIdType numPts,
+      std::vector<unsigned char> &colors, std::vector<float> &matrices,
+      std::vector<float> &normalMatrices, std::vector<vtkIdType> &pickIds,
+      unsigned long pointMTime)
+{
   this->CurrentInput = this->GetInput();
   this->UsingInstancing = false;
 
@@ -373,7 +299,9 @@ void vtkOpenGLGlyph3DHelper::GlyphRender(
 
 #if GL_ES_VERSION_2_0 != 1 || GL_ES_VERSION_3_0 == 1
   if (actor->GetProperty()->GetRepresentation() == VTK_SURFACE &&
-      !selector && GLEW_ARB_instanced_arrays)
+      !selector &&
+      (vtkOpenGLRenderWindow::GetContextSupportsOpenGL32() ||
+        GLEW_ARB_instanced_arrays))
     {
     this->GlyphRenderInstances(ren, actor, numPts,
       colors, matrices, normalMatrices, pointMTime);
@@ -392,19 +320,20 @@ void vtkOpenGLGlyph3DHelper::GlyphRender(
     if (!primed)
       {
       this->RenderPieceStart(ren,actor);
-      this->UpdateShaders(this->Tris, ren, actor);
-      this->Tris.IBO->Bind();
+      this->UpdateShader(this->Tris, ren, actor);
+      this->Tris.ibo.Bind();
       primed = true;
       }
 
     // handle the middle
     vtkShaderProgram *program = this->Tris.Program;
+    vtkgl::VBOLayout &layout = this->Layout;
 
     // Apply the extra transform
     program->SetUniformMatrix4x4("GCMCMatrix", &(matrices[inPtId*16]));
 
     // for lit shaders set normal matrix
-    if (this->LastLightComplexity > 0 && this->VBO->NormalOffset &&
+    if (this->LastLightComplexity > 0 && this->Layout.NormalOffset &&
         !this->UsingInstancing)
       {
       program->SetUniformMatrix3x3("glyphNormalMatrix", &(normalMatrices[inPtId*9]));
@@ -421,8 +350,8 @@ void vtkOpenGLGlyph3DHelper::GlyphRender(
     if (actor->GetProperty()->GetRepresentation() == VTK_POINTS)
       {
       glDrawRangeElements(GL_POINTS, 0,
-                          static_cast<GLuint>(this->VBO->VertexCount - 1),
-                          static_cast<GLsizei>(this->Tris.IBO->IndexCount),
+                          static_cast<GLuint>(layout.VertexCount - 1),
+                          static_cast<GLsizei>(this->Tris.indexCount),
                           GL_UNSIGNED_INT,
                           reinterpret_cast<const GLvoid *>(NULL));
       }
@@ -431,30 +360,30 @@ void vtkOpenGLGlyph3DHelper::GlyphRender(
       // TODO wireframe of triangles is not lit properly right now
       // you either have to generate normals and send them down
       // or use a geometry shader.
-      glDrawRangeElements(GL_LINES, 0,
-                          static_cast<GLuint>(this->VBO->VertexCount - 1),
-                          static_cast<GLsizei>(this->Tris.IBO->IndexCount),
-                          GL_UNSIGNED_INT,
-                          reinterpret_cast<const GLvoid *>(NULL));
+      glMultiDrawElements(GL_LINE_LOOP,
+                        (GLsizei *)(&this->Tris.elementsArray[0]),
+                        GL_UNSIGNED_INT,
+                        reinterpret_cast<const GLvoid **>(&(this->Tris.offsetArray[0])),
+                        (GLsizei)this->Tris.offsetArray.size());
       }
     if (actor->GetProperty()->GetRepresentation() == VTK_SURFACE)
       {
       glDrawRangeElements(GL_TRIANGLES, 0,
-                          static_cast<GLuint>(this->VBO->VertexCount - 1),
-                          static_cast<GLsizei>(this->Tris.IBO->IndexCount),
+                          static_cast<GLuint>(layout.VertexCount - 1),
+                          static_cast<GLsizei>(this->Tris.indexCount),
                           GL_UNSIGNED_INT,
                           reinterpret_cast<const GLvoid *>(NULL));
       }
     }
   if (primed)
     {
-    this->Tris.IBO->Release();
+    this->Tris.ibo.Release();
     this->RenderPieceFinish(ren,actor);
     }
 }
 
 //-----------------------------------------------------------------------------
-void vtkOpenGLGlyph3DHelper::SetCameraShaderParameters(vtkOpenGLHelper &cellBO,
+void vtkOpenGLGlyph3DHelper::SetCameraShaderParameters(vtkgl::CellBO &cellBO,
                                                     vtkRenderer* ren, vtkActor *actor)
 {
   // do the superclass and then reset a couple values
@@ -470,14 +399,14 @@ void vtkOpenGLGlyph3DHelper::SetCameraShaderParameters(vtkOpenGLHelper &cellBO,
 
   // for lit shaders set normal matrix
   if (this->LastLightComplexity > 0 && this->ModelNormalMatrix &&
-     this->VBO->NormalOffset && !this->UsingInstancing)
+     this->Layout.NormalOffset && !this->UsingInstancing)
     {
     program->SetUniformMatrix3x3("glyphNormalMatrix", this->ModelNormalMatrix);
     }
 }
 
 //-----------------------------------------------------------------------------
-void vtkOpenGLGlyph3DHelper::SetPropertyShaderParameters(vtkOpenGLHelper &cellBO,
+void vtkOpenGLGlyph3DHelper::SetPropertyShaderParameters(vtkgl::CellBO &cellBO,
                                                          vtkRenderer *ren, vtkActor *actor)
 {
   // do the superclass and then reset a couple values
@@ -492,7 +421,7 @@ void vtkOpenGLGlyph3DHelper::SetPropertyShaderParameters(vtkOpenGLHelper &cellBO
 }
 
 //-----------------------------------------------------------------------------
-void vtkOpenGLGlyph3DHelper::SetMapperShaderParameters(vtkOpenGLHelper &cellBO,
+void vtkOpenGLGlyph3DHelper::SetMapperShaderParameters(vtkgl::CellBO &cellBO,
                                                          vtkRenderer *ren, vtkActor *actor)
 {
   this->Superclass::SetMapperShaderParameters(cellBO,ren,actor);
@@ -513,64 +442,69 @@ void vtkOpenGLGlyph3DHelper::GlyphRenderInstances(
 {
   this->UsingInstancing = true;
   this->RenderPieceStart(ren,actor);
-  this->UpdateShaders(this->Tris, ren, actor);
+  this->UpdateShader(this->Tris, ren, actor);
 
   // do the superclass and then reset a couple values
-  if (this->Tris.IBO->IndexCount &&   // we have points and one of
+  if (this->Tris.indexCount &&   // we have points and one of
       (this->VBOBuildTime > this->InstanceBuffersLoadTime ||
       this->Tris.ShaderSourceTime > this->InstanceBuffersLoadTime ||
       pointMTime > this->InstanceBuffersLoadTime.GetMTime()))
     {
-    this->Tris.VAO->Bind();
+    this->Tris.vao.Bind();
     // add 3 new BOs?
-    this->MatrixBuffer->Bind();
-    this->MatrixBuffer->Upload(matrices, vtkOpenGLBufferObject::ArrayBuffer);
-    if (!this->Tris.VAO->AddAttributeMatrixWithDivisor(this->Tris.Program, this->MatrixBuffer,
+    this->MatrixBuffer.Bind();
+    this->MatrixBuffer.Upload(matrices, vtkgl::BufferObject::ArrayBuffer);
+    if (!this->Tris.vao.AddAttributeMatrixWithDivisor(this->Tris.Program, this->MatrixBuffer,
         "GCMCMatrix", 0, 16*sizeof(float), VTK_FLOAT, 4, false, 1))
       {
       vtkErrorMacro(<< "Error setting 'GCMCMatrix' in shader VAO.");
       }
-    this->MatrixBuffer->Release();
+    this->MatrixBuffer.Release();
 
-    if (this->VBO->NormalOffset && this->LastLightComplexity > 0)
+    if (this->Layout.NormalOffset && this->LastLightComplexity > 0)
       {
-      this->NormalMatrixBuffer->Bind();
-      this->NormalMatrixBuffer->Upload(
-        normalMatrices, vtkOpenGLBufferObject::ArrayBuffer);
-      if (!this->Tris.VAO->AddAttributeMatrixWithDivisor(
-            this->Tris.Program, this->NormalMatrixBuffer,
+      this->NormalMatrixBuffer.Bind();
+      this->NormalMatrixBuffer.Upload(normalMatrices, vtkgl::BufferObject::ArrayBuffer);
+      if (!this->Tris.vao.AddAttributeMatrixWithDivisor(this->Tris.Program, this->NormalMatrixBuffer,
             "glyphNormalMatrix", 0, 9*sizeof(float), VTK_FLOAT, 3, false, 1))
         {
         vtkErrorMacro(<< "Error setting 'glyphNormalMatrix' in shader VAO.");
         }
-      this->NormalMatrixBuffer->Release();
+      this->NormalMatrixBuffer.Release();
       }
 
-    this->ColorBuffer->Bind();
-    this->ColorBuffer->Upload(colors, vtkOpenGLBufferObject::ArrayBuffer);
-    if (!this->Tris.VAO->AddAttributeArrayWithDivisor(
-          this->Tris.Program, this->ColorBuffer,
+    this->ColorBuffer.Bind();
+    this->ColorBuffer.Upload(colors, vtkgl::BufferObject::ArrayBuffer);
+    if (!this->Tris.vao.AddAttributeArrayWithDivisor(this->Tris.Program, this->ColorBuffer,
           "glyphColor", 0, 4*sizeof(unsigned char), VTK_UNSIGNED_CHAR, 4, true, 1, false))
       {
       vtkErrorMacro(<< "Error setting 'diffuse color' in shader VAO.");
       }
-    this->ColorBuffer->Release();
+    this->ColorBuffer.Release();
 
     this->InstanceBuffersLoadTime.Modified();
     }
 
-  this->Tris.IBO->Bind();
+  this->Tris.ibo.Bind();
 #if GL_ES_VERSION_3_0 == 1
   glDrawElementsInstanced(GL_TRIANGLES,
-                        static_cast<GLsizei>(this->Tris.IBO->IndexCount),
+                        static_cast<GLsizei>(this->Tris.indexCount),
                         GL_UNSIGNED_INT,
                         reinterpret_cast<const GLvoid *>(NULL),
                         numPts);
 #else
-  if (GLEW_ARB_instanced_arrays)
+  if (vtkOpenGLRenderWindow::GetContextSupportsOpenGL32())
+    {
+    glDrawElementsInstanced(GL_TRIANGLES,
+                          static_cast<GLsizei>(this->Tris.indexCount),
+                          GL_UNSIGNED_INT,
+                          reinterpret_cast<const GLvoid *>(NULL),
+                          numPts);
+    }
+  else if (GLEW_ARB_instanced_arrays)
     {
     glDrawElementsInstancedARB(GL_TRIANGLES,
-                          static_cast<GLsizei>(this->Tris.IBO->IndexCount),
+                          static_cast<GLsizei>(this->Tris.indexCount),
                           GL_UNSIGNED_INT,
                           reinterpret_cast<const GLvoid *>(NULL),
                           numPts);
@@ -578,7 +512,7 @@ void vtkOpenGLGlyph3DHelper::GlyphRenderInstances(
 #endif
   vtkOpenGLCheckErrorMacro("failed after Render");
 
-  this->Tris.IBO->Release();
+  this->Tris.ibo.Release();
   this->RenderPieceFinish(ren, actor);
 }
 #endif
diff --git a/Rendering/OpenGL2/vtkOpenGLGlyph3DHelper.h b/Rendering/OpenGL2/vtkOpenGLGlyph3DHelper.h
index b457eec..0d023c8 100644
--- a/Rendering/OpenGL2/vtkOpenGLGlyph3DHelper.h
+++ b/Rendering/OpenGL2/vtkOpenGLGlyph3DHelper.h
@@ -58,12 +58,6 @@ public:
       std::vector<float> &normalMatrices, std::vector<vtkIdType> &pickIds,
       unsigned long pointMTime);
 
-  // Description:
-  // Release any graphics resources that are being consumed by this mapper.
-  // The parameter window could be used to determine which graphic
-  // resources to release.
-  virtual void ReleaseGraphicsResources(vtkWindow *window);
-
 protected:
   vtkOpenGLGlyph3DHelper();
   ~vtkOpenGLGlyph3DHelper();
@@ -78,39 +72,31 @@ protected:
 
   // Description:
   // Create the basic shaders before replacement
-  virtual void GetShaderTemplate(
-    std::map<vtkShader::Type, vtkShader *> shaders,
-    vtkRenderer *ren, vtkActor *act);
+  virtual void GetShaderTemplate(std::string &VertexCode,
+                           std::string &fragmentCode,
+                           std::string &geometryCode,
+                           int lightComplexity,
+                           vtkRenderer *ren, vtkActor *act);
 
   // Description:
   // Perform string replacments on the shader templates
-  virtual void ReplaceShaderColor(
-    std::map<vtkShader::Type, vtkShader *> shaders,
-    vtkRenderer *ren, vtkActor *act);
-  virtual void ReplaceShaderNormal(
-    std::map<vtkShader::Type, vtkShader *> shaders,
-    vtkRenderer *ren, vtkActor *act);
-  virtual void ReplaceShaderClip(
-    std::map<vtkShader::Type, vtkShader *> shaders,
-    vtkRenderer *ren, vtkActor *act);
-  virtual void ReplaceShaderPositionVC(
-    std::map<vtkShader::Type, vtkShader *> shaders,
-    vtkRenderer *ren, vtkActor *act);
+  virtual void ReplaceShaderValues(std::string &VertexCode,
+                           std::string &fragmentCode,
+                           std::string &geometryCode,
+                           int lightComplexity,
+                           vtkRenderer *ren, vtkActor *act);
 
   // Description:
   // Set the shader parameteres related to the Camera
-  virtual void SetCameraShaderParameters(
-    vtkOpenGLHelper &cellBO, vtkRenderer *ren, vtkActor *act);
+  virtual void SetCameraShaderParameters(vtkgl::CellBO &cellBO, vtkRenderer *ren, vtkActor *act);
 
   // Description:
   // Set the shader parameteres related to the property
-  virtual void SetPropertyShaderParameters(
-    vtkOpenGLHelper &cellBO, vtkRenderer *ren, vtkActor *act);
+  virtual void SetPropertyShaderParameters(vtkgl::CellBO &cellBO, vtkRenderer *ren, vtkActor *act);
 
   // Description:
   // Set the shader parameteres related to the actor/mapper
-  virtual void SetMapperShaderParameters(
-    vtkOpenGLHelper &cellBO, vtkRenderer *ren, vtkActor *act);
+  virtual void SetMapperShaderParameters(vtkgl::CellBO &cellBO, vtkRenderer *ren, vtkActor *act);
 
   bool UseFastPath;
   bool UsingInstancing;
@@ -119,9 +105,9 @@ protected:
   float* ModelNormalMatrix;
   unsigned char* ModelColor;
 
-  vtkOpenGLBufferObject *NormalMatrixBuffer;
-  vtkOpenGLBufferObject *MatrixBuffer;
-  vtkOpenGLBufferObject *ColorBuffer;
+  vtkgl::BufferObject NormalMatrixBuffer;
+  vtkgl::BufferObject MatrixBuffer;
+  vtkgl::BufferObject ColorBuffer;
   vtkTimeStamp InstanceBuffersLoadTime;
 
 
diff --git a/Rendering/OpenGL2/vtkOpenGLGlyph3DMapper.cxx b/Rendering/OpenGL2/vtkOpenGLGlyph3DMapper.cxx
index 9d85042..0ea79c1 100644
--- a/Rendering/OpenGL2/vtkOpenGLGlyph3DMapper.cxx
+++ b/Rendering/OpenGL2/vtkOpenGLGlyph3DMapper.cxx
@@ -128,8 +128,11 @@ vtkOpenGLGlyph3DMapper::vtkOpenGLGlyph3DMapper()
 vtkOpenGLGlyph3DMapper::~vtkOpenGLGlyph3DMapper()
 {
   this->ColorMapper->Delete();
-
-  delete this->GlyphValues;
+  if (this->GlyphValues)
+    {
+    delete this->GlyphValues;
+    this->GlyphValues = NULL;
+    }
 
   if (this->LastWindow)
     {
diff --git a/Rendering/OpenGL2/vtkOpenGLHardwareSelector.cxx b/Rendering/OpenGL2/vtkOpenGLHardwareSelector.cxx
index e71aaf8..50485dc 100644
--- a/Rendering/OpenGL2/vtkOpenGLHardwareSelector.cxx
+++ b/Rendering/OpenGL2/vtkOpenGLHardwareSelector.cxx
@@ -23,13 +23,6 @@
 
 #include "vtkOpenGLError.h"
 
-//#define vtkOpenGLHardwareSelectorDEBUG
-#ifdef vtkOpenGLHardwareSelectorDEBUG
-#include "vtkPNMWriter.h"
-#include "vtkImageImport.h"
-#include "vtkNew.h"
-#endif
-
 #define ID_OFFSET 1
 
 // Description:
@@ -148,30 +141,6 @@ vtkOpenGLHardwareSelector::~vtkOpenGLHardwareSelector()
 }
 
 //----------------------------------------------------------------------------
-// just add debug output if compiled with vtkOpenGLHardwareSelectorDEBUG
-void vtkOpenGLHardwareSelector::SavePixelBuffer(int passNo)
-{
-  this->Superclass::SavePixelBuffer(passNo);
-
-#ifdef vtkOpenGLHardwareSelectorDEBUG
-
-  vtkNew<vtkImageImport> ii;
-  ii->SetImportVoidPointer(this->PixBuffer[passNo],1);
-  ii->SetDataScalarTypeToUnsignedChar();
-  ii->SetNumberOfScalarComponents(3);
-  ii->SetDataExtent(this->Area[0], this->Area[2], this->Area[1], this->Area[3], 0, 0);
-
-  std::string fname = "pickbuffer_";
-  fname += ('0'+passNo);
-  fname += ".pnm";
-  vtkNew<vtkPNMWriter> pw;
-  pw->SetInputConnection(ii->GetOutputPort());
-  pw->SetFileName(fname.c_str());
-  pw->Write();
-#endif
-}
-
-//----------------------------------------------------------------------------
 void vtkOpenGLHardwareSelector::BeginRenderProp(vtkRenderWindow *context)
 {
   #ifdef vtkOpenGLHardwareSelectorDEBUG
diff --git a/Rendering/OpenGL2/vtkOpenGLHardwareSelector.h b/Rendering/OpenGL2/vtkOpenGLHardwareSelector.h
index 53619e3..54759d2 100644
--- a/Rendering/OpenGL2/vtkOpenGLHardwareSelector.h
+++ b/Rendering/OpenGL2/vtkOpenGLHardwareSelector.h
@@ -64,8 +64,6 @@ protected:
   virtual void BeginRenderProp(vtkRenderWindow *);
   virtual void EndRenderProp(vtkRenderWindow *);
 
-  virtual void SavePixelBuffer(int passNo);
-
   // for internal state
   class vtkInternals;
   vtkInternals* Internals;
diff --git a/Rendering/OpenGL2/vtkOpenGLHelper.cxx b/Rendering/OpenGL2/vtkOpenGLHelper.cxx
deleted file mode 100644
index 2f88dbb..0000000
--- a/Rendering/OpenGL2/vtkOpenGLHelper.cxx
+++ /dev/null
@@ -1,43 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-
-  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 "vtkOpenGLHelper.h"
-
-#include "vtkOpenGLIndexBufferObject.h"
-#include "vtkOpenGLVertexArrayObject.h"
-#include "vtkShaderProgram.h"
-
-vtkOpenGLHelper::vtkOpenGLHelper()
-{
-  this->Program = NULL;
-  this->IBO = vtkOpenGLIndexBufferObject::New();
-  this->VAO = vtkOpenGLVertexArrayObject::New();
-}
-
-vtkOpenGLHelper::~vtkOpenGLHelper()
-{
-  this->IBO->Delete();
-  this->VAO->Delete();
-}
-
-void vtkOpenGLHelper::ReleaseGraphicsResources(vtkWindow * vtkNotUsed(win))
-{
-  if (this->Program)
-    {
-    // Let ShaderCache release the graphics resources as it is
-    // responsible for creation and deletion.
-    this->Program = 0;
-    }
-  this->IBO->ReleaseGraphicsResources();
-  this->VAO->ReleaseGraphicsResources();
-}
diff --git a/Rendering/OpenGL2/vtkOpenGLHelper.h b/Rendering/OpenGL2/vtkOpenGLHelper.h
deleted file mode 100644
index a534ee0..0000000
--- a/Rendering/OpenGL2/vtkOpenGLHelper.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-
-  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.
-
-=========================================================================*/
-
-#ifndef vtkOpenGLHelpher_h
-#define vtkOpenGLHelpher_h
-
-#include "vtkRenderingOpenGL2Module.h" // for export macro
-#include "vtkTimeStamp.h"
-
-class vtkOpenGLIndexBufferObject;
-class vtkOpenGLShaderCache;
-class vtkOpenGLVertexArrayObject;
-class vtkShaderProgram;
-class vtkWindow;
-
-// Store the shaders, program, and ibo in a common place
-// as they are used together frequently.  This is just
-// a convenience class.
-class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLHelper
-{
-public:
-  vtkShaderProgram *Program;
-  vtkTimeStamp ShaderSourceTime;
-  vtkOpenGLVertexArrayObject *VAO;
-  vtkTimeStamp AttributeUpdateTime;
-
-  vtkOpenGLIndexBufferObject *IBO;
-
-  vtkOpenGLHelper();
-  ~vtkOpenGLHelper();
-  void ReleaseGraphicsResources(vtkWindow *win);
-};
-
-#endif // vtkOpenGLHelpher_h
-
-// VTK-HeaderTest-Exclude: vtkOpenGLHelper.h
diff --git a/Rendering/OpenGL2/vtkOpenGLImageMapper.cxx b/Rendering/OpenGL2/vtkOpenGLImageMapper.cxx
index a4a34f5..d721b7d 100644
--- a/Rendering/OpenGL2/vtkOpenGLImageMapper.cxx
+++ b/Rendering/OpenGL2/vtkOpenGLImageMapper.cxx
@@ -84,14 +84,6 @@ vtkOpenGLImageMapper::~vtkOpenGLImageMapper()
   this->Actor->UnRegister(this);
 }
 
-//----------------------------------------------------------------------------
-// Release the graphics resources used by this texture.
-void vtkOpenGLImageMapper::ReleaseGraphicsResources(vtkWindow *renWin)
-{
-  this->Actor->ReleaseGraphicsResources(renWin);
-}
-
-
 
 //----------------------------------------------------------------------------
 // I know #define can be evil, but this macro absolutely ensures
diff --git a/Rendering/OpenGL2/vtkOpenGLImageMapper.h b/Rendering/OpenGL2/vtkOpenGLImageMapper.h
index 20af1f6..81cd793 100644
--- a/Rendering/OpenGL2/vtkOpenGLImageMapper.h
+++ b/Rendering/OpenGL2/vtkOpenGLImageMapper.h
@@ -56,11 +56,6 @@ public:
   // used internally by the templated functions
   void DrawPixels(vtkViewport *vp, int width, int height, int numComponents, void *data);
 
-  // Description:
-  // Release any graphics resources that are being consumed by this
-  // mapper, the image texture in particular.
-  void ReleaseGraphicsResources(vtkWindow *);
-
 protected:
   vtkOpenGLImageMapper();
   ~vtkOpenGLImageMapper();
diff --git a/Rendering/OpenGL2/vtkOpenGLImageSliceMapper.cxx b/Rendering/OpenGL2/vtkOpenGLImageSliceMapper.cxx
index b293484..240d5f5 100644
--- a/Rendering/OpenGL2/vtkOpenGLImageSliceMapper.cxx
+++ b/Rendering/OpenGL2/vtkOpenGLImageSliceMapper.cxx
@@ -131,6 +131,7 @@ vtkOpenGLImageSliceMapper::vtkOpenGLImageSliceMapper()
   this->LoadCount = 0;
 
   this->UseClampToEdge = false;
+  this->UsePowerOfTwoTextures = true;
 
   // Use GL_ARB_fragment_program, which is an extension to OpenGL 1.3
   // that is compatible with very old drivers and hardware, and is still
@@ -627,8 +628,19 @@ void vtkOpenGLImageSliceMapper::ComputeTextureSize(
   imageSize[0] = (extent[xdim*2+1] - extent[xdim*2] + 1);
   imageSize[1] = (extent[ydim*2+1] - extent[ydim*2] + 1);
 
-  textureSize[0] = imageSize[0];
-  textureSize[1] = imageSize[1];
+  if (this->UsePowerOfTwoTextures)
+    {
+    // find the target size of the power-of-two texture
+    for (int i = 0; i < 2; i++)
+      {
+      textureSize[i] = vtkMath::NearestPowerOfTwo(imageSize[i]);
+      }
+    }
+  else
+    {
+    textureSize[0] = imageSize[0];
+    textureSize[1] = imageSize[1];
+    }
 }
 
 //----------------------------------------------------------------------------
@@ -694,10 +706,14 @@ void vtkOpenGLImageSliceMapper::Render(vtkRenderer *ren, vtkImageSlice *prop)
   //  glDisable(GL_COLOR_MATERIAL);
 
   // do an offset to avoid depth buffer issues
-  this->PolyDataActor->GetMapper()->
-    SetResolveCoincidentTopology(VTK_RESOLVE_POLYGON_OFFSET);
-  this->PolyDataActor->GetMapper()->
-    SetResolveCoincidentTopologyPolygonOffsetParameters(1.0,100);
+  if (vtkMapper::GetResolveCoincidentTopology() !=
+      VTK_RESOLVE_SHIFT_ZBUFFER )
+    {
+    double f, u;
+    glEnable(GL_POLYGON_OFFSET_FILL);
+    vtkMapper::GetResolveCoincidentTopologyPolygonOffsetParameters(f,u);
+    glPolygonOffset(f,u);
+    }
 
   // Add all the clipping planes  TODO: really in the mapper
   //int numClipPlanes = this->GetNumberOfClippingPlanes();
@@ -773,7 +789,8 @@ void vtkOpenGLImageSliceMapper::Render(vtkRenderer *ren, vtkImageSlice *prop)
 void vtkOpenGLImageSliceMapper::CheckOpenGLCapabilities(vtkOpenGLRenderWindow*)
 {
   this->UseClampToEdge = true;
-  this->UseFragmentProgram = false;
+  this->UsePowerOfTwoTextures = true;
+  this->UseFragmentProgram = true;
 }
 
 //----------------------------------------------------------------------------
diff --git a/Rendering/OpenGL2/vtkOpenGLImageSliceMapper.h b/Rendering/OpenGL2/vtkOpenGLImageSliceMapper.h
index 5598ef5..caf6a7c 100644
--- a/Rendering/OpenGL2/vtkOpenGLImageSliceMapper.h
+++ b/Rendering/OpenGL2/vtkOpenGLImageSliceMapper.h
@@ -119,6 +119,7 @@ protected:
   vtkTimeStamp LoadTime;
   int LoadCount;
 
+  bool UsePowerOfTwoTextures;
   bool UseClampToEdge;
   bool UseFragmentProgram;
 
diff --git a/Rendering/OpenGL2/vtkOpenGLIndexBufferObject.cxx b/Rendering/OpenGL2/vtkOpenGLIndexBufferObject.cxx
deleted file mode 100644
index 3efc522..0000000
--- a/Rendering/OpenGL2/vtkOpenGLIndexBufferObject.cxx
+++ /dev/null
@@ -1,526 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-
-  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 "vtkOpenGLIndexBufferObject.h"
-#include "vtkObjectFactory.h"
-
-#include "vtkCellArray.h"
-#include "vtkPoints.h"
-#include "vtkPolygon.h"
-#include "vtkProperty.h"
-#include "vtkUnsignedCharArray.h"
-
-#include "vtk_glew.h"
-
-vtkStandardNewMacro(vtkOpenGLIndexBufferObject)
-
-vtkOpenGLIndexBufferObject::vtkOpenGLIndexBufferObject()
-{
-  this->IndexCount = 0;
-  this->SetType(vtkOpenGLIndexBufferObject::ElementArrayBuffer);
-}
-
-vtkOpenGLIndexBufferObject::~vtkOpenGLIndexBufferObject()
-{
-}
-
-// used to create an IBO for triangle primatives
-void vtkOpenGLIndexBufferObject::AppendTriangleIndexBuffer(
-  std::vector<unsigned int> &indexArray,
-  vtkCellArray *cells,
-  vtkPoints *points,
-  vtkIdType vOffset)
-{
-  vtkIdType* indices(NULL);
-  vtkIdType npts(0);
-
-  if (cells->GetNumberOfConnectivityEntries() >
-      cells->GetNumberOfCells()*3)
-    {
-    size_t targetSize = indexArray.size() +
-      (cells->GetNumberOfConnectivityEntries() -
-       cells->GetNumberOfCells()*3)*3;
-    if (targetSize > indexArray.capacity())
-      {
-      if (targetSize < indexArray.capacity()*1.5)
-        {
-        targetSize = indexArray.capacity()*1.5;
-        }
-      indexArray.reserve(targetSize);
-      }
-    }
-
-  // the folowing are only used if we have to triangulate a polygon
-  // otherwise they just sit at NULL
-  vtkPolygon *polygon = NULL;
-  vtkIdList *tris = NULL;
-  vtkPoints *triPoints = NULL;
-
-  for (cells->InitTraversal(); cells->GetNextCell(npts, indices); )
-    {
-    // ignore degenerate triangles
-    if (npts < 3)
-      {
-      continue;
-      }
-
-    // triangulate needed
-    if (npts > 3)
-      {
-      // special case for quads, penta, hex which are common
-      if (npts == 4)
-        {
-        indexArray.push_back(static_cast<unsigned int>(indices[0]+vOffset));
-        indexArray.push_back(static_cast<unsigned int>(indices[1]+vOffset));
-        indexArray.push_back(static_cast<unsigned int>(indices[2]+vOffset));
-        indexArray.push_back(static_cast<unsigned int>(indices[0]+vOffset));
-        indexArray.push_back(static_cast<unsigned int>(indices[2]+vOffset));
-        indexArray.push_back(static_cast<unsigned int>(indices[3]+vOffset));
-        }
-      else if (npts == 5)
-        {
-        indexArray.push_back(static_cast<unsigned int>(indices[0]+vOffset));
-        indexArray.push_back(static_cast<unsigned int>(indices[1]+vOffset));
-        indexArray.push_back(static_cast<unsigned int>(indices[2]+vOffset));
-        indexArray.push_back(static_cast<unsigned int>(indices[0]+vOffset));
-        indexArray.push_back(static_cast<unsigned int>(indices[2]+vOffset));
-        indexArray.push_back(static_cast<unsigned int>(indices[3]+vOffset));
-        indexArray.push_back(static_cast<unsigned int>(indices[0]+vOffset));
-        indexArray.push_back(static_cast<unsigned int>(indices[3]+vOffset));
-        indexArray.push_back(static_cast<unsigned int>(indices[4]+vOffset));
-        }
-      else if (npts == 6)
-        {
-        indexArray.push_back(static_cast<unsigned int>(indices[0]+vOffset));
-        indexArray.push_back(static_cast<unsigned int>(indices[1]+vOffset));
-        indexArray.push_back(static_cast<unsigned int>(indices[2]+vOffset));
-        indexArray.push_back(static_cast<unsigned int>(indices[0]+vOffset));
-        indexArray.push_back(static_cast<unsigned int>(indices[2]+vOffset));
-        indexArray.push_back(static_cast<unsigned int>(indices[3]+vOffset));
-        indexArray.push_back(static_cast<unsigned int>(indices[0]+vOffset));
-        indexArray.push_back(static_cast<unsigned int>(indices[3]+vOffset));
-        indexArray.push_back(static_cast<unsigned int>(indices[5]+vOffset));
-        indexArray.push_back(static_cast<unsigned int>(indices[3]+vOffset));
-        indexArray.push_back(static_cast<unsigned int>(indices[4]+vOffset));
-        indexArray.push_back(static_cast<unsigned int>(indices[5]+vOffset));
-        }
-      else // 7 sided polygon or higher, do a full smart triangulation
-        {
-        if (!polygon)
-          {
-          polygon = vtkPolygon::New();
-          tris = vtkIdList::New();
-          triPoints = vtkPoints::New();
-          }
-
-        vtkIdType *triIndices = new vtkIdType[npts];
-        triPoints->SetNumberOfPoints(npts);
-        for (int i = 0; i < npts; ++i)
-          {
-          int idx = indices[i];
-          triPoints->SetPoint(i,points->GetPoint(idx));
-          triIndices[i] = i;
-          }
-        polygon->Initialize(npts, triIndices, triPoints);
-        polygon->Triangulate(tris);
-        for (int j = 0; j < tris->GetNumberOfIds(); ++j)
-          {
-          indexArray.push_back(static_cast<unsigned int>(
-            indices[tris->GetId(j)]+vOffset));
-          }
-        delete [] triIndices;
-        }
-      }
-    else
-      {
-      indexArray.push_back(static_cast<unsigned int>(*(indices++)+vOffset));
-      indexArray.push_back(static_cast<unsigned int>(*(indices++)+vOffset));
-      indexArray.push_back(static_cast<unsigned int>(*(indices++)+vOffset));
-      }
-    }
-  if (polygon)
-    {
-    polygon->Delete();
-    tris->Delete();
-    triPoints->Delete();
-    }
-}
-
-// used to create an IBO for triangle primatives
-size_t vtkOpenGLIndexBufferObject::CreateTriangleIndexBuffer(
-  vtkCellArray *cells,
-  vtkPoints *points)
-{
-  if (!cells->GetNumberOfCells())
-    {
-    return 0;
-    }
-  std::vector<unsigned int> indexArray;
-  AppendTriangleIndexBuffer(indexArray, cells, points, 0);
-  this->Upload(indexArray, vtkOpenGLIndexBufferObject::ElementArrayBuffer);
-  this->IndexCount = indexArray.size();
-  return indexArray.size();
-}
-
-// used to create an IBO for point primatives
-void vtkOpenGLIndexBufferObject::AppendPointIndexBuffer(
-  std::vector<unsigned int> &indexArray,
-  vtkCellArray *cells,
-  vtkIdType vOffset)
-{
-  vtkIdType* indices(NULL);
-  vtkIdType npts(0);
-  size_t targetSize = indexArray.size() +
-    cells->GetNumberOfConnectivityEntries() -
-    cells->GetNumberOfCells();
-  if (targetSize > indexArray.capacity())
-    {
-    if (targetSize < indexArray.capacity()*1.5)
-      {
-      targetSize = indexArray.capacity()*1.5;
-      }
-    indexArray.reserve(targetSize);
-    }
-
-  for (cells->InitTraversal(); cells->GetNextCell(npts, indices); )
-    {
-    for (int i = 0; i < npts; ++i)
-      {
-      indexArray.push_back(static_cast<unsigned int>(*(indices++)+vOffset));
-      }
-    }
-}
-
-// used to create an IBO for triangle primatives
-size_t vtkOpenGLIndexBufferObject::CreatePointIndexBuffer(vtkCellArray *cells)
-{
-  if (!cells->GetNumberOfCells())
-    {
-    return 0;
-    }
-  std::vector<unsigned int> indexArray;
-  AppendPointIndexBuffer(indexArray, cells, 0);
-  this->Upload(indexArray, vtkOpenGLIndexBufferObject::ElementArrayBuffer);
-  this->IndexCount = indexArray.size();
-  return indexArray.size();
-}
-
-
-// used to create an IBO for primatives as lines.  This method treats each line segment
-// as independent.  So for a triangle mesh you would get 6 verts per triangle
-// 3 edges * 2 verts each.  With a line loop you only get 3 verts so half the storage.
-// but... line loops are slower than line segments.
-void vtkOpenGLIndexBufferObject::AppendTriangleLineIndexBuffer(
-  std::vector<unsigned int> &indexArray,
-  vtkCellArray *cells,
-  vtkIdType vOffset)
-{
-  vtkIdType* indices(NULL);
-  vtkIdType npts(0);
-  size_t targetSize = indexArray.size() + 2*(
-    cells->GetNumberOfConnectivityEntries() -
-    cells->GetNumberOfCells());
-  if (targetSize > indexArray.capacity())
-    {
-    if (targetSize < indexArray.capacity()*1.5)
-      {
-      targetSize = indexArray.capacity()*1.5;
-      }
-    indexArray.reserve(targetSize);
-    }
-
-  for (cells->InitTraversal(); cells->GetNextCell(npts, indices); )
-    {
-    for (int i = 0; i < npts; ++i)
-      {
-      indexArray.push_back(static_cast<unsigned int>(indices[i]+vOffset));
-      indexArray.push_back(static_cast<unsigned int>(
-        indices[i < npts-1 ? i+1 : 0] + vOffset));
-      }
-    }
-}
-
-// used to create an IBO for primatives as lines.  This method treats each line segment
-// as independent.  So for a triangle mesh you would get 6 verts per triangle
-// 3 edges * 2 verts each.  With a line loop you only get 3 verts so half the storage.
-// but... line loops are slower than line segments.
-size_t vtkOpenGLIndexBufferObject::CreateTriangleLineIndexBuffer(
-  vtkCellArray *cells)
-{
-  if (!cells->GetNumberOfCells())
-    {
-    return 0;
-    }
-  std::vector<unsigned int> indexArray;
-  AppendTriangleLineIndexBuffer(indexArray, cells, 0);
-  this->Upload(indexArray, vtkOpenGLIndexBufferObject::ElementArrayBuffer);
-  this->IndexCount = indexArray.size();
-  return indexArray.size();
-}
-
-// used to create an IBO for primatives as lines.  This method treats each
-// line segment as independent.  So for a line strip you would get multiple
-// line segments out
-void vtkOpenGLIndexBufferObject::AppendLineIndexBuffer(
-  std::vector<unsigned int> &indexArray,
-  vtkCellArray *cells,
-  vtkIdType vOffset)
-{
-  vtkIdType* indices(NULL);
-  vtkIdType npts(0);
-
-  // possibly adjust size
-  if (cells->GetNumberOfConnectivityEntries() >
-      2*cells->GetNumberOfCells())
-    {
-    size_t targetSize = indexArray.size() + 2*(
-      cells->GetNumberOfConnectivityEntries()
-      - 2*cells->GetNumberOfCells());
-    if (targetSize > indexArray.capacity())
-      {
-      if (targetSize < indexArray.capacity()*1.5)
-        {
-        targetSize = indexArray.capacity()*1.5;
-        }
-      indexArray.reserve(targetSize);
-      }
-    }
-  for (cells->InitTraversal(); cells->GetNextCell(npts, indices); )
-    {
-    for (int i = 0; i < npts-1; ++i)
-      {
-      indexArray.push_back(static_cast<unsigned int>(indices[i]+vOffset));
-      indexArray.push_back(static_cast<unsigned int>(indices[i+1] + vOffset));
-      }
-    }
-}
-
-// used to create an IBO for primatives as lines.  This method treats each
-// line segment as independent.  So for a line strip you would get multiple
-// line segments out
-size_t vtkOpenGLIndexBufferObject::CreateLineIndexBuffer(vtkCellArray *cells)
-{
-  if (!cells->GetNumberOfCells())
-    {
-    return 0;
-    }
-  std::vector<unsigned int> indexArray;
-  AppendLineIndexBuffer(indexArray, cells, 0);
-  this->Upload(indexArray, vtkOpenGLIndexBufferObject::ElementArrayBuffer);
-  this->IndexCount = indexArray.size();
-  return indexArray.size();
-}
-
-// used to create an IBO for triangle strips
-size_t vtkOpenGLIndexBufferObject::CreateStripIndexBuffer(
-  vtkCellArray *cells,
-  bool wireframeTriStrips)
-{
-  if (!cells->GetNumberOfCells())
-    {
-    return 0;
-    }
-  vtkIdType      *pts = 0;
-  vtkIdType      npts = 0;
-  std::vector<unsigned int> indexArray;
-
-  size_t triCount = cells->GetNumberOfConnectivityEntries()
-    - 3*cells->GetNumberOfCells();
-  size_t targetSize = wireframeTriStrips ? 2*(triCount*2+1)
-   : triCount*3;
-  indexArray.reserve(targetSize);
-
-  if (wireframeTriStrips)
-    {
-    for (cells->InitTraversal(); cells->GetNextCell(npts,pts); )
-      {
-      indexArray.push_back(static_cast<unsigned int>(pts[0]));
-      indexArray.push_back(static_cast<unsigned int>(pts[1]));
-      for (int j = 0; j < npts-2; ++j)
-        {
-        indexArray.push_back(static_cast<unsigned int>(pts[j]));
-        indexArray.push_back(static_cast<unsigned int>(pts[j+2]));
-        indexArray.push_back(static_cast<unsigned int>(pts[j+1]));
-        indexArray.push_back(static_cast<unsigned int>(pts[j+2]));
-        }
-      }
-    }
-  else
-    {
-    for (cells->InitTraversal(); cells->GetNextCell(npts,pts); )
-      {
-      for (int j = 0; j < npts-2; ++j)
-        {
-        indexArray.push_back(static_cast<unsigned int>(pts[j]));
-        indexArray.push_back(static_cast<unsigned int>(pts[j+1+j%2]));
-        indexArray.push_back(static_cast<unsigned int>(pts[j+1+(j+1)%2]));
-        }
-      }
-    }
-  this->Upload(indexArray, vtkOpenGLIndexBufferObject::ElementArrayBuffer);
-  this->IndexCount = indexArray.size();
-  return indexArray.size();
-}
-
-// Create supporting arays that are needed when rendering cell data
-// Some VTK cells have to be broken into smaller cells for OpenGL
-// When we have cell data we have to map cell attributes from the VTK
-// cell number to the actual OpenGL cell
-// The following code fills in
-//
-//   cellCellMap which maps a openGL cell id to the VTK cell it came from
-//
-void vtkOpenGLIndexBufferObject::CreateCellSupportArrays(
-  vtkCellArray *prims[4],
-  std::vector<unsigned int> &cellCellMap,
-  int representation)
-{
-  // need an array to track what points to orig points
-  size_t minSize = prims[0]->GetNumberOfCells() +
-                   prims[1]->GetNumberOfCells() +
-                   prims[2]->GetNumberOfCells() +
-                   prims[3]->GetNumberOfCells();
-  vtkIdType* indices(NULL);
-  vtkIdType npts(0);
-
-  // make sure we have at least minSize
-  cellCellMap.reserve(minSize);
-  unsigned int vtkCellCount = 0;
-
-  // points
-  for (prims[0]->InitTraversal(); prims[0]->GetNextCell(npts, indices); )
-    {
-    for (int i=0; i < npts; ++i)
-      {
-      cellCellMap.push_back(vtkCellCount);
-      }
-    vtkCellCount++;
-    } // for cell
-
-  if (representation == VTK_POINTS)
-    {
-    for (int j = 1; j < 4; j++)
-      {
-      for (prims[j]->InitTraversal(); prims[j]->GetNextCell(npts, indices); )
-        {
-        for (int i=0; i < npts; ++i)
-          {
-          cellCellMap.push_back(vtkCellCount);
-          }
-        vtkCellCount++;
-        } // for cell
-      }
-    }
-  else // lines or surfaces
-    {
-    // lines
-    for (prims[1]->InitTraversal(); prims[1]->GetNextCell(npts, indices); )
-      {
-      for (int i = 0; i < npts-1; ++i)
-        {
-        cellCellMap.push_back(vtkCellCount);
-        }
-      vtkCellCount++;
-      } // for cell
-
-    if (representation == VTK_WIREFRAME)
-      {
-      // polys
-      for (prims[2]->InitTraversal(); prims[2]->GetNextCell(npts, indices); )
-        {
-        for (int i = 0; i < npts; ++i)
-          {
-          cellCellMap.push_back(vtkCellCount);
-          }
-        vtkCellCount++;
-        } // for cell
-
-      // strips
-      for (prims[3]->InitTraversal(); prims[3]->GetNextCell(npts, indices); )
-        {
-        cellCellMap.push_back(vtkCellCount);
-        for (int i = 2; i < npts; ++i)
-          {
-          cellCellMap.push_back(vtkCellCount);
-          cellCellMap.push_back(vtkCellCount);
-          }
-        vtkCellCount++;
-        } // for cell
-      }
-    else
-      {
-      // polys
-      for (prims[2]->InitTraversal(); prims[2]->GetNextCell(npts, indices); )
-        {
-        if (npts > 2)
-          {
-          for (int i = 2; i < npts; ++i)
-            {
-            cellCellMap.push_back(vtkCellCount);
-            }
-          }
-        vtkCellCount++;
-        } // for cell
-
-      // strips
-      for (prims[3]->InitTraversal(); prims[3]->GetNextCell(npts, indices); )
-        {
-        for (int i = 2; i < npts; ++i)
-          {
-          cellCellMap.push_back(vtkCellCount);
-          }
-        vtkCellCount++;
-        } // for cell
-      }
-    }
-
-}
-
-// used to create an IBO for polys in wireframe with edge flags
-size_t vtkOpenGLIndexBufferObject::CreateEdgeFlagIndexBuffer(
-  vtkCellArray *cells,
-  vtkDataArray *ef)
-{
-  if (!cells->GetNumberOfCells())
-    {
-    return 0;
-    }
-  vtkIdType      *pts = 0;
-  vtkIdType      npts = 0;
-  std::vector<unsigned int> indexArray;
-  unsigned char *ucef = NULL;
-  ucef = vtkUnsignedCharArray::SafeDownCast(ef)->GetPointer(0);
-  indexArray.reserve(cells->GetData()->GetSize()*2);
-  for (cells->InitTraversal(); cells->GetNextCell(npts,pts); )
-    {
-    for (int j = 0; j < npts; ++j)
-      {
-      if (ucef[pts[j]] && npts > 1) // draw this edge and poly is not degenerate
-        {
-        // determine the ending vertex
-        vtkIdType nextVert = (j == npts-1) ? pts[0] : pts[j+1];
-        indexArray.push_back(static_cast<unsigned int>(pts[j]));
-        indexArray.push_back(static_cast<unsigned int>(nextVert));
-        }
-      }
-    }
-  this->Upload(indexArray, vtkOpenGLIndexBufferObject::ElementArrayBuffer);
-  this->IndexCount = indexArray.size();
-  return indexArray.size();
-}
-
-//-----------------------------------------------------------------------------
-void vtkOpenGLIndexBufferObject::PrintSelf(ostream& os, vtkIndent indent)
-{
-  this->Superclass::PrintSelf(os, indent);
-}
diff --git a/Rendering/OpenGL2/vtkOpenGLIndexBufferObject.h b/Rendering/OpenGL2/vtkOpenGLIndexBufferObject.h
deleted file mode 100644
index caf0d32..0000000
--- a/Rendering/OpenGL2/vtkOpenGLIndexBufferObject.h
+++ /dev/null
@@ -1,117 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-
-  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.
-
-=========================================================================*/
-#ifndef vtkOpenGLIndexBufferObject_h
-#define vtkOpenGLIndexBufferObject_h
-
-#include "vtkRenderingOpenGL2Module.h" // for export macro
-#include "vtkOpenGLBufferObject.h"
-
-
-/**
- * @brief OpenGL vertex buffer object
- *
- * OpenGL buffer object to store geometry and/or attribute data on the
- * GPU.
- */
-
-class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLIndexBufferObject :
-  public vtkOpenGLBufferObject
-{
-public:
-  static vtkOpenGLIndexBufferObject *New();
-  vtkTypeMacro(vtkOpenGLIndexBufferObject, vtkOpenGLBufferObject);
-  void PrintSelf(ostream& os, vtkIndent indent);
-
-  // Sizes/offsets are all in bytes as OpenGL API expects them.
-  size_t IndexCount; // Number of indices in the VBO
-
-  // Description:
-  // used to create an IBO for triangle primatives
-  size_t CreateTriangleIndexBuffer(vtkCellArray *cells,
-     vtkPoints *points);
-
-  // Description:
-  // used to create an IBO for triangle primatives
-  static void AppendTriangleIndexBuffer(
-    std::vector<unsigned int> &indexArray,
-    vtkCellArray *cells,
-    vtkPoints *points,
-    vtkIdType vertexOffset);
-
-  // Description:
-  // create a IBO for wireframe polys/tris
-  size_t CreateTriangleLineIndexBuffer(vtkCellArray *cells);
-
-  // Description:
-  // used to create an IBO for line primatives
-  static void AppendLineIndexBuffer(
-    std::vector<unsigned int> &indexArray,
-    vtkCellArray *cells,
-    vtkIdType vertexOffset);
-
-  // Description:
-  // create a IBO for wireframe polys/tris
-  size_t CreateLineIndexBuffer(vtkCellArray *cells);
-
-  // Description:
-  // create a IBO for wireframe polys/tris
-  static void AppendTriangleLineIndexBuffer(
-    std::vector<unsigned int> &indexArray,
-    vtkCellArray *cells,
-    vtkIdType vertexOffset);
-
-  // Description:
-  // used to create an IBO for primatives as points
-  size_t CreatePointIndexBuffer(vtkCellArray *cells);
-
-  // Description:
-  // used to create an IBO for primatives as points
-  static void AppendPointIndexBuffer(
-    std::vector<unsigned int> &indexArray,
-    vtkCellArray *cells,
-    vtkIdType vertexOffset);
-
-  // Description:
-  // used to create an IBO for line strips and triangle strips
-  size_t CreateStripIndexBuffer(
-    vtkCellArray *cells, bool wireframeTriStrips);
-
-  // Description:
-  // special index buffer for polys wireframe with edge visibilityflags
-  size_t CreateEdgeFlagIndexBuffer(
-    vtkCellArray *cells, vtkDataArray *edgeflags);
-
-  // Create supporting arays that are needed when rendering cell data
-  // Some VTK cells have to be broken into smaller cells for OpenGL
-  // When we have cell data we have to map cell attributes from the VTK
-  // cell number to the actual OpenGL cell
-  // The following code fills in
-  //
-  //   cellCellMap which maps a openGL cell id to the VTK cell it came from
-  //
-  static void CreateCellSupportArrays(
-    vtkCellArray *[4],
-    std::vector<unsigned int> &cellCellMap,
-    int representation);
-
-protected:
-  vtkOpenGLIndexBufferObject();
-  ~vtkOpenGLIndexBufferObject();
-
-private:
-  vtkOpenGLIndexBufferObject(const vtkOpenGLIndexBufferObject&); // Not implemented
-  void operator=(const vtkOpenGLIndexBufferObject&); // Not implemented
-};
-
-#endif
diff --git a/Rendering/OpenGL2/vtkOpenGLLabeledContourMapper.cxx b/Rendering/OpenGL2/vtkOpenGLLabeledContourMapper.cxx
deleted file mode 100644
index 9c3a69b..0000000
--- a/Rendering/OpenGL2/vtkOpenGLLabeledContourMapper.cxx
+++ /dev/null
@@ -1,174 +0,0 @@
-/*==============================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkOpenGLLabeledContourMapper.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 "vtkOpenGLLabeledContourMapper.h"
-
-#include "vtkActor.h"
-#include "vtkMatrix4x4.h"
-#include "vtkObjectFactory.h"
-#include "vtkOpenGLActor.h"
-#include "vtkOpenGLCamera.h"
-#include "vtkOpenGLError.h"
-#include "vtkOpenGLRenderUtilities.h"
-#include "vtkOpenGLRenderWindow.h"
-#include "vtkOpenGLShaderCache.h"
-#include "vtkOpenGLTexture.h"
-#include "vtkRenderer.h"
-#include "vtkShaderProgram.h"
-#include "vtkTextActor3D.h"
-#include "vtkOpenGLHelper.h"
-
-
-
-//------------------------------------------------------------------------------
-vtkStandardNewMacro(vtkOpenGLLabeledContourMapper)
-
-//------------------------------------------------------------------------------
-vtkOpenGLLabeledContourMapper::vtkOpenGLLabeledContourMapper()
-{
-  this->StencilBO =  new vtkOpenGLHelper;
-  this->TempMatrix4 = vtkMatrix4x4::New();
-}
-
-//------------------------------------------------------------------------------
-vtkOpenGLLabeledContourMapper::~vtkOpenGLLabeledContourMapper()
-{
-  delete this->StencilBO;
-  this->StencilBO = 0;
-  this->TempMatrix4->Delete();
-}
-
-//------------------------------------------------------------------------------
-bool vtkOpenGLLabeledContourMapper::CreateLabels(vtkActor *actor)
-{
-  if (!this->Superclass::CreateLabels(actor))
-    {
-    return false;
-    }
-
-  if (vtkMatrix4x4 *actorMatrix = actor->GetMatrix())
-    {
-    for (vtkIdType i = 0; i < this->NumberOfUsedTextActors; ++i)
-      {
-      vtkMatrix4x4 *labelMatrix = this->TextActors[i]->GetUserMatrix();
-      vtkMatrix4x4::Multiply4x4(actorMatrix, labelMatrix, labelMatrix);
-      this->TextActors[i]->SetUserMatrix(labelMatrix);
-      }
-    }
-
-  return true;
-}
-
-//------------------------------------------------------------------------------
-void vtkOpenGLLabeledContourMapper::ReleaseGraphicsResources(vtkWindow *win)
-{
-  this->Superclass::ReleaseGraphicsResources(win);
-  this->StencilBO->ReleaseGraphicsResources(win);
-}
-
-//------------------------------------------------------------------------------
-bool vtkOpenGLLabeledContourMapper::ApplyStencil(vtkRenderer *ren,
-                                                 vtkActor *act)
-{
-  // Save some state:
-  GLboolean colorMask[4];
-  glGetBooleanv(GL_COLOR_WRITEMASK, colorMask);
-  GLboolean depthMask;
-  glGetBooleanv(GL_DEPTH_WRITEMASK, &depthMask);
-
-  // Enable rendering into the stencil buffer:
-  glEnable(GL_STENCIL_TEST);
-  glStencilMask(0xFF);
-  glClearStencil(0);
-  glClear(GL_STENCIL_BUFFER_BIT);
-  glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);
-  glDepthMask(GL_FALSE);
-  glStencilFunc(GL_ALWAYS, 1, 0xFF);
-  glStencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE);
-
-  // Draw stencil quads into stencil buffer:
-  // compile and bind it if needed
-  vtkOpenGLRenderWindow *renWin =
-    vtkOpenGLRenderWindow::SafeDownCast(ren->GetVTKWindow());
-
-  if (!this->StencilBO->Program)
-    {
-    this->StencilBO->Program  =
-        renWin->GetShaderCache()->ReadyShaderProgram(
-        // vertex shader
-        "//VTK::System::Dec\n"
-        "attribute vec4 vertexMC;\n"
-        "uniform mat4 MCDCMatrix;\n"
-        "void main() { gl_Position = MCDCMatrix*vertexMC; }\n",
-        // fragment shader
-        "//VTK::System::Dec\n"
-        "//VTK::Output::Dec\n"
-        "void main() { gl_FragData[0] = vec4(1.0,1.0,1.0,1.0); }",
-        // geometry shader
-        "");
-    }
-  else
-    {
-    renWin->GetShaderCache()->ReadyShaderProgram(this->StencilBO->Program);
-    }
-
-  vtkOpenGLCamera *cam = (vtkOpenGLCamera *)(ren->GetActiveCamera());
-  vtkMatrix4x4 *wcdc;
-  vtkMatrix4x4 *wcvc;
-  vtkMatrix3x3 *norms;
-  vtkMatrix4x4 *vcdc;
-  cam->GetKeyMatrices(ren,wcvc,norms,vcdc,wcdc);
-  if (!act->GetIsIdentity())
-    {
-    vtkMatrix4x4 *mcwc;
-    vtkMatrix3x3 *anorms;
-    ((vtkOpenGLActor *)act)->GetKeyMatrices(mcwc,anorms);
-    vtkMatrix4x4::Multiply4x4(mcwc, wcdc, this->TempMatrix4);
-    this->StencilBO->Program->SetUniformMatrix("MCDCMatrix", this->TempMatrix4);
-    }
-  else
-    {
-    this->StencilBO->Program->SetUniformMatrix("MCDCMatrix", wcdc);
-    }
-
-  vtkOpenGLRenderUtilities::RenderTriangles(
-    this->StencilQuads,
-    this->StencilQuadsSize/3,
-    this->StencilQuadIndices,
-    this->StencilQuadIndicesSize,
-    NULL,
-    this->StencilBO->Program,
-    this->StencilBO->VAO);
-
-  // Restore state:
-  glColorMask(colorMask[0], colorMask[1], colorMask[2], colorMask[3]);
-  glDepthMask(depthMask);
-
-  // Setup GL to only draw in unstenciled regions:
-  glStencilMask(0x00);
-  glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
-  glStencilFunc(GL_EQUAL, 0, 0xFF);
-
-  vtkOpenGLCheckErrorMacro("failed after ApplyStencil()");
-
-  return this->Superclass::ApplyStencil(ren, act);
-}
-
-//------------------------------------------------------------------------------
-bool vtkOpenGLLabeledContourMapper::RemoveStencil()
-{
-  glDisable(GL_STENCIL_TEST);
-  vtkOpenGLCheckErrorMacro("failed after RemoveStencil()");
-  return this->Superclass::RemoveStencil();
-}
diff --git a/Rendering/OpenGL2/vtkOpenGLLabeledContourMapper.h b/Rendering/OpenGL2/vtkOpenGLLabeledContourMapper.h
deleted file mode 100644
index 8e8c736..0000000
--- a/Rendering/OpenGL2/vtkOpenGLLabeledContourMapper.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkOpenGLLabeledContourMapper.h
-
-  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.
-
-=========================================================================*/
-// .NAME vtkOpenGLLabeledContourMapper
-// .SECTION Description
-// vtkOpenGLLabeledContourMapper is an override for vtkLabeledContourMapper
-// that implements stenciling using the OpenGL2 API.
-
-#ifndef vtkOpenGLLabelContourMapper_h
-#define vtkOpenGLLabelContourMapper_h
-
-#include "vtkRenderingOpenGL2Module.h" // For export macro
-#include "vtkLabeledContourMapper.h"
-
-class vtkMatrix4x4;
-class vtkOpenGLHelper;
-
-class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLLabeledContourMapper
-    : public vtkLabeledContourMapper
-{
-public:
-  static vtkOpenGLLabeledContourMapper *New();
-  vtkTypeMacro(vtkOpenGLLabeledContourMapper, vtkLabeledContourMapper)
-
-  // Description:
-  // Release graphics resources
-  void ReleaseGraphicsResources(vtkWindow *win);
-
-protected:
-  vtkOpenGLLabeledContourMapper();
-  ~vtkOpenGLLabeledContourMapper();
-
-  // We override this for compatibilty with the OpenGL backend:
-  // The old backend pushes actor matrices onto the matrix stack, so the text
-  // actors already accounted for any transformations on this mapper's actor.
-  // The new backend passes each actor's matrix to the shader individually, and
-  // this mapper's actor matrix doesn't affect the label rendering.
-  bool CreateLabels(vtkActor *actor);
-
-  bool ApplyStencil(vtkRenderer *ren, vtkActor *act);
-  bool RemoveStencil();
-
-  vtkOpenGLHelper *StencilBO;
-  vtkMatrix4x4 *TempMatrix4;
-
-
-private:
-  vtkOpenGLLabeledContourMapper(const vtkOpenGLLabeledContourMapper&);  // Not implemented.
-  void operator=(const vtkOpenGLLabeledContourMapper&);  // Not implemented.
-};
-
-#endif
diff --git a/Rendering/OpenGL2/vtkOpenGLPointGaussianMapper.cxx b/Rendering/OpenGL2/vtkOpenGLPointGaussianMapper.cxx
index 06964bd..a6b1341 100644
--- a/Rendering/OpenGL2/vtkOpenGLPointGaussianMapper.cxx
+++ b/Rendering/OpenGL2/vtkOpenGLPointGaussianMapper.cxx
@@ -13,18 +13,14 @@
 =========================================================================*/
 #include "vtkOpenGLPointGaussianMapper.h"
 
-#include "vtkOpenGLHelper.h"
+#include "vtkglVBOHelper.h"
 
-#include "vtkHardwareSelector.h"
 #include "vtkMath.h"
 #include "vtkObjectFactory.h"
 #include "vtkMatrix4x4.h"
 #include "vtkOpenGLActor.h"
 #include "vtkOpenGLCamera.h"
-#include "vtkOpenGLIndexBufferObject.h"
 #include "vtkOpenGLPolyDataMapper.h"
-#include "vtkOpenGLVertexArrayObject.h"
-#include "vtkOpenGLVertexBufferObject.h"
 #include "vtkPointData.h"
 #include "vtkPolyData.h"
 #include "vtkProperty.h"
@@ -32,11 +28,9 @@
 #include "vtkShaderProgram.h"
 
 #include "vtkPointGaussianVS.h"
-#include "vtkPolyDataFS.h"
-
-#include "vtk_glew.h"
-
+#include "vtkglPolyDataFSNoLighting.h"
 
+using vtkgl::substitute;
 
 class vtkOpenGLPointGaussianMapperHelper : public vtkOpenGLPolyDataMapper
 {
@@ -52,26 +46,27 @@ protected:
 
   // Description:
   // Create the basic shaders before replacement
-  virtual void GetShaderTemplate(
-    std::map<vtkShader::Type, vtkShader *> shaders,
-    vtkRenderer *, vtkActor *);
+  virtual void GetShaderTemplate(std::string &VertexCode,
+                           std::string &fragmentCode,
+                           std::string &geometryCode,
+                           int lightComplexity,
+                           vtkRenderer *ren, vtkActor *act);
 
   // Description:
   // Perform string replacments on the shader templates
-  virtual void ReplaceShaderColor(
-    std::map<vtkShader::Type, vtkShader *> shaders,
-    vtkRenderer *, vtkActor *);
-  virtual void ReplaceShaderPositionVC(
-    std::map<vtkShader::Type, vtkShader *> shaders,
-    vtkRenderer *, vtkActor *);
+  virtual void ReplaceShaderValues(std::string &VertexCode,
+                           std::string &fragmentCode,
+                           std::string &geometryCode,
+                           int lightComplexity,
+                           vtkRenderer *ren, vtkActor *act);
 
   // Description:
   // Set the shader parameters related to the Camera
-  virtual void SetCameraShaderParameters(vtkOpenGLHelper &cellBO, vtkRenderer *ren, vtkActor *act);
+  virtual void SetCameraShaderParameters(vtkgl::CellBO &cellBO, vtkRenderer *ren, vtkActor *act);
 
   // Description:
   // Set the shader parameters related to the actor/mapper
-  virtual void SetMapperShaderParameters(vtkOpenGLHelper &cellBO, vtkRenderer *ren, vtkActor *act);
+  virtual void SetMapperShaderParameters(vtkgl::CellBO &cellBO, vtkRenderer *ren, vtkActor *act);
 
   // Description:
   // Does the VBO/IBO need to be rebuilt
@@ -83,13 +78,6 @@ protected:
 
   virtual void RenderPieceDraw(vtkRenderer *ren, vtkActor *act);
 
-  // Description:
-  // Does the shader source need to be recomputed
-  virtual bool GetNeedToRebuildShaders(vtkOpenGLHelper &cellBO,
-    vtkRenderer *ren, vtkActor *act);
-
-  bool UsingPoints;
-
 private:
   vtkOpenGLPointGaussianMapperHelper(const vtkOpenGLPointGaussianMapperHelper&); // Not implemented.
   void operator=(const vtkOpenGLPointGaussianMapperHelper&); // Not implemented.
@@ -106,111 +94,45 @@ vtkOpenGLPointGaussianMapperHelper::vtkOpenGLPointGaussianMapperHelper()
 
 
 //-----------------------------------------------------------------------------
-void vtkOpenGLPointGaussianMapperHelper::GetShaderTemplate(
-  std::map<vtkShader::Type, vtkShader *> shaders,
-  vtkRenderer *ren, vtkActor *actor)
+void vtkOpenGLPointGaussianMapperHelper::GetShaderTemplate(std::string &VSSource,
+                                          std::string &FSSource,
+                                          std::string &GSSource,
+                                          int vtkNotUsed(lightComplexity),
+                                          vtkRenderer* vtkNotUsed(ren),
+                                          vtkActor *vtkNotUsed(actor))
 {
-  this->Superclass::GetShaderTemplate(shaders,ren,actor);
-
-  vtkPolyData *poly = this->CurrentInput;
-  bool hasScaleArray = this->Owner->GetScaleArray() != NULL &&
-                       poly->GetPointData()->HasArray(this->Owner->GetScaleArray());
-  if (!hasScaleArray && this->Owner->GetDefaultRadius() == 0.0)
-    {
-    this->UsingPoints = true;
-    }
-  else
-    {
-    this->UsingPoints = false;
-    // for splats use a special shader than handles the offsets
-    shaders[vtkShader::Vertex]->SetSource(vtkPointGaussianVS);
-    }
-
+  VSSource = vtkPointGaussianVS;
+  FSSource = vtkglPolyDataFSNoLighting;
+  GSSource = "";
 }
 
-void vtkOpenGLPointGaussianMapperHelper::ReplaceShaderPositionVC(
-  std::map<vtkShader::Type, vtkShader *> shaders,
-  vtkRenderer *ren, vtkActor *actor)
+void vtkOpenGLPointGaussianMapperHelper::ReplaceShaderValues(std::string &VSSource,
+                                                 std::string &FSSource,
+                                                 std::string &GSSource,
+                                                 int lightComplexity,
+                                                 vtkRenderer* ren,
+                                                 vtkActor *actor)
 {
-  if (!this->UsingPoints)
-    {
-    std::string VSSource = shaders[vtkShader::Vertex]->GetSource();
-    std::string FSSource = shaders[vtkShader::Fragment]->GetSource();
-
-    vtkShaderProgram::Substitute(FSSource,
-      "//VTK::PositionVC::Dec",
-      "varying vec2 offsetVCVSOutput;");
-
-    vtkShaderProgram::Substitute(VSSource,
-      "//VTK::Camera::Dec",
-      "uniform mat4 VCDCMatrix;\n"
-      "uniform mat4 MCVCMatrix;");
-
-    shaders[vtkShader::Vertex]->SetSource(VSSource);
-    shaders[vtkShader::Fragment]->SetSource(FSSource);
-    }
-
-  this->Superclass::ReplaceShaderPositionVC(shaders,ren,actor);
-}
-
-void vtkOpenGLPointGaussianMapperHelper::ReplaceShaderColor(
-  std::map<vtkShader::Type, vtkShader *> shaders,
-  vtkRenderer *ren, vtkActor *actor)
-{
-  if (!this->UsingPoints)
-    {
-    std::string VSSource = shaders[vtkShader::Vertex]->GetSource();
-    std::string FSSource = shaders[vtkShader::Fragment]->GetSource();
-
-    vtkShaderProgram::Substitute(FSSource,"//VTK::Color::Impl",
-      // compute the eye position and unit direction
-      "//VTK::Color::Impl\n"
-      "  float dist2 = dot(offsetVCVSOutput.xy,offsetVCVSOutput.xy);\n"
-      "  if (dist2 > 9.0) { discard; }\n"
-      "  float gaussian = exp(-0.5*dist2);\n"
-      "  opacity = opacity*gaussian;"
-      //  "  opacity = opacity*0.5;"
-      , false);
-
-    shaders[vtkShader::Vertex]->SetSource(VSSource);
-    shaders[vtkShader::Fragment]->SetSource(FSSource);
-    }
-
-  this->Superclass::ReplaceShaderColor(shaders,ren,actor);
-  //cerr << shaders[vtkShader::Fragment]->GetSource() << endl;
-}
-
-//-----------------------------------------------------------------------------
-bool vtkOpenGLPointGaussianMapperHelper::GetNeedToRebuildShaders(
-  vtkOpenGLHelper &cellBO, vtkRenderer* ren, vtkActor *actor)
-{
-  this->LastLightComplexity = 0;
-
-  vtkHardwareSelector* selector = ren->GetSelector();
-  int picking = selector ? selector->GetCurrentPass() : -1;
-  if (this->LastSelectionState != picking)
-    {
-    this->SelectionStateChanged.Modified();
-    this->LastSelectionState = picking;
-    }
-
-  // has something changed that would require us to recreate the shader?
-  // candidates are
-  // property modified (representation interpolation and lighting)
-  // input modified
-  // light complexity changed
-  if (cellBO.Program == 0 ||
-      cellBO.ShaderSourceTime < this->GetMTime() ||
-      cellBO.ShaderSourceTime < actor->GetMTime() ||
-      cellBO.ShaderSourceTime < this->CurrentInput->GetMTime() ||
-      cellBO.ShaderSourceTime < this->SelectionStateChanged ||
-      cellBO.ShaderSourceTime < this->DepthPeelingChanged ||
-      cellBO.ShaderSourceTime < this->LightComplexityChanged)
-    {
-    return true;
-    }
-
-  return false;
+  substitute(FSSource,
+    "//VTK::PositionVC::Dec",
+    "varying vec2 offsetVC;");
+
+  substitute(VSSource,
+    "//VTK::Camera::Dec",
+    "uniform mat4 VCDCMatrix;\n"
+    "uniform mat4 MCVCMatrix;");
+
+  substitute(FSSource,"//VTK::Color::Impl",
+    // compute the eye position and unit direction
+    "//VTK::Color::Impl\n"
+    "  float dist2 = dot(offsetVC.xy,offsetVC.xy);\n"
+    "  float gaussian = exp(-0.5*16.0*dist2);\n"
+//    "  diffuseColor = vertexColor.rgb;\n"
+//    "  ambientColor = vertexColor.rgb;\n"
+    "  opacity = opacity*gaussian;"
+    , false);
+
+  this->Superclass::ReplaceShaderValues(VSSource,FSSource,GSSource,lightComplexity,ren,actor);
 }
 
 //-----------------------------------------------------------------------------
@@ -219,60 +141,52 @@ vtkOpenGLPointGaussianMapperHelper::~vtkOpenGLPointGaussianMapperHelper()
 }
 
 //-----------------------------------------------------------------------------
-void vtkOpenGLPointGaussianMapperHelper::SetCameraShaderParameters(vtkOpenGLHelper &cellBO,
+void vtkOpenGLPointGaussianMapperHelper::SetCameraShaderParameters(vtkgl::CellBO &cellBO,
                                                     vtkRenderer* ren, vtkActor *actor)
 {
-  if (this->UsingPoints)
+  vtkShaderProgram *program = cellBO.Program;
+
+  vtkOpenGLCamera *cam = (vtkOpenGLCamera *)(ren->GetActiveCamera());
+
+  vtkMatrix4x4 *wcdc;
+  vtkMatrix4x4 *wcvc;
+  vtkMatrix3x3 *norms;
+  vtkMatrix4x4 *vcdc;
+  cam->GetKeyMatrices(ren,wcvc,norms,vcdc,wcdc);
+  program->SetUniformMatrix("VCDCMatrix", vcdc);
+
+  if (!actor->GetIsIdentity())
     {
-    this->Superclass::SetCameraShaderParameters(cellBO,ren,actor);
+    vtkMatrix4x4 *mcwc;
+    vtkMatrix3x3 *anorms;
+    ((vtkOpenGLActor *)actor)->GetKeyMatrices(mcwc,anorms);
+    vtkMatrix4x4::Multiply4x4(mcwc, wcvc, this->TempMatrix4);
+    program->SetUniformMatrix("MCVCMatrix", this->TempMatrix4);
     }
   else
     {
-    vtkShaderProgram *program = cellBO.Program;
-
-    vtkOpenGLCamera *cam = (vtkOpenGLCamera *)(ren->GetActiveCamera());
-
-    vtkMatrix4x4 *wcdc;
-    vtkMatrix4x4 *wcvc;
-    vtkMatrix3x3 *norms;
-    vtkMatrix4x4 *vcdc;
-    cam->GetKeyMatrices(ren,wcvc,norms,vcdc,wcdc);
-    program->SetUniformMatrix("VCDCMatrix", vcdc);
-
-    if (!actor->GetIsIdentity())
-      {
-      vtkMatrix4x4 *mcwc;
-      vtkMatrix3x3 *anorms;
-      ((vtkOpenGLActor *)actor)->GetKeyMatrices(mcwc,anorms);
-      vtkMatrix4x4::Multiply4x4(mcwc, wcvc, this->TempMatrix4);
-      program->SetUniformMatrix("MCVCMatrix", this->TempMatrix4);
-      }
-    else
-      {
-      program->SetUniformMatrix("MCVCMatrix", wcvc);
-      }
-
-    // add in uniforms for parallel and distance
-    cellBO.Program->SetUniformi("cameraParallel", cam->GetParallelProjection());
+    program->SetUniformMatrix("MCVCMatrix", wcvc);
     }
+
+  // add in uniforms for parallel and distance
+  cellBO.Program->SetUniformi("cameraParallel", cam->GetParallelProjection());
 }
 
+
 //-----------------------------------------------------------------------------
-void vtkOpenGLPointGaussianMapperHelper::SetMapperShaderParameters(vtkOpenGLHelper &cellBO,
+void vtkOpenGLPointGaussianMapperHelper::SetMapperShaderParameters(vtkgl::CellBO &cellBO,
                                                          vtkRenderer *ren, vtkActor *actor)
 {
-  if (!this->UsingPoints)
+  if (cellBO.indexCount && (this->VBOBuildTime > cellBO.attributeUpdateTime ||
+      cellBO.ShaderSourceTime > cellBO.attributeUpdateTime))
     {
-    if (cellBO.IBO->IndexCount && (this->VBOBuildTime > cellBO.AttributeUpdateTime ||
-        cellBO.ShaderSourceTime > cellBO.AttributeUpdateTime))
+    vtkgl::VBOLayout &layout = this->Layout;
+    cellBO.vao.Bind();
+    if (!cellBO.vao.AddAttributeArray(cellBO.Program, this->VBO,
+                                    "offsetMC", layout.ColorOffset+sizeof(float),
+                                    layout.Stride, VTK_FLOAT, 2, false))
       {
-      cellBO.VAO->Bind();
-      if (!cellBO.VAO->AddAttributeArray(cellBO.Program, this->VBO,
-                                      "offsetMC", this->VBO->ColorOffset+sizeof(float),
-                                      this->VBO->Stride, VTK_FLOAT, 2, false))
-        {
-        vtkErrorMacro(<< "Error setting 'offsetMC' in shader VAO.");
-        }
+      vtkErrorMacro(<< "Error setting 'offsetMC' in shader VAO.");
       }
     }
 
@@ -283,169 +197,94 @@ void vtkOpenGLPointGaussianMapperHelper::SetMapperShaderParameters(vtkOpenGLHelp
 namespace
 {
 // internal function called by CreateVBO
-template< typename PointDataType, typename SizeDataType >
-void vtkOpenGLPointGaussianMapperHelperPackVBOTemplate2(
-              std::vector< float >::iterator& it,
-              PointDataType* points, vtkIdType numPts,
+vtkgl::VBOLayout vtkOpenGLPointGaussianMapperHelperCreateVBO(float * points, vtkIdType numPts,
               unsigned char *colors, int colorComponents,
-              SizeDataType* sizes, float defaultSize)
+              float *sizes, float defaultSize,
+              vtkgl::BufferObject &vertexBuffer)
 {
-  PointDataType *pointPtr;
-  unsigned char *colorPtr;
+  vtkgl::VBOLayout layout;
+  // Figure out how big each block will be, currently 6 floats.
+  int blockSize = 3;  // x y z
+  layout.VertexOffset = 0;
+  layout.NormalOffset = 0;
+  layout.TCoordOffset = 0;
+  layout.TCoordComponents = 0;
+  layout.ColorComponents = colorComponents;
+  layout.ColorOffset = sizeof(float) * blockSize;
+  ++blockSize; // color
 
-  // if there are no per point sizes and the default size is zero
-  // then just render points, saving memory and speed
-  if (!sizes && defaultSize == 0.0)
-    {
-    unsigned char white[4] = {255, 255, 255, 255};
+  // two more floats
+  blockSize += 2;  // offset
+  layout.Stride = sizeof(float) * blockSize;
 
-    for (vtkIdType i = 0; i < numPts; ++i)
-      {
-      pointPtr = points + i*3;
-      colorPtr = colors ? (colors + i*colorComponents) : white;
-
-      // Vertices
-      *(it++) = pointPtr[0];
-      *(it++) = pointPtr[1];
-      *(it++) = pointPtr[2];
-      *(it++) = *reinterpret_cast<float *>(colorPtr);
-      }
-    }
-  else // otherwise splats
-    {
-    float cos30 = cos(vtkMath::RadiansFromDegrees(30.0));
+  // Create a buffer, and copy the data over.
+  std::vector<float> packedVBO;
+  packedVBO.resize(blockSize * numPts*3);
+  std::vector<float>::iterator it = packedVBO.begin();
 
-    unsigned char white[4] = {255, 255, 255, 255};
+  float *pointPtr;
+  unsigned char *colorPtr;
 
-    for (vtkIdType i = 0; i < numPts; ++i)
-      {
-      pointPtr = points + i*3;
-      colorPtr = colors ? (colors + i*colorComponents) : white;
-      float radius = sizes ? sizes[i] : defaultSize;
-      radius *= 3.0;
-
-      // Vertices
-      *(it++) = pointPtr[0];
-      *(it++) = pointPtr[1];
-      *(it++) = pointPtr[2];
-      *(it++) = *reinterpret_cast<float *>(colorPtr);
-      *(it++) = -2.0f*radius*cos30;
-      *(it++) = -radius;
-
-      *(it++) = pointPtr[0];
-      *(it++) = pointPtr[1];
-      *(it++) = pointPtr[2];
-      *(it++) = *reinterpret_cast<float *>(colorPtr);
-      *(it++) = 2.0f*radius*cos30;
-      *(it++) = -radius;
-
-      *(it++) = pointPtr[0];
-      *(it++) = pointPtr[1];
-      *(it++) = pointPtr[2];
-      *(it++) = *reinterpret_cast<float *>(colorPtr);
-      *(it++) = 0.0f;
-      *(it++) = 2.0f*radius;
-      }
-    }
-}
+  float cos30 = cos(vtkMath::RadiansFromDegrees(30.0));
 
-template< typename PointDataType >
-void vtkOpenGLPointGaussianMapperHelperPackVBOTemplate(
-    std::vector< float >::iterator& it,
-    PointDataType* points, vtkIdType numPts,
-    unsigned char *colors, int colorComponents,
-    vtkDataArray* sizes, float defaultSize)
-{
-  if (sizes)
-    {
-    switch (sizes->GetDataType())
-      {
-    vtkTemplateMacro(
-          vtkOpenGLPointGaussianMapperHelperPackVBOTemplate2(
-            it, points, numPts, colors, colorComponents,
-            static_cast<VTK_TT*>(sizes->GetVoidPointer(0)),
-            defaultSize)
-          );
-      }
-    }
-  else
+  unsigned char white[4] = {255, 255, 255, 255};
+
+  for (vtkIdType i = 0; i < numPts; ++i)
     {
-    vtkOpenGLPointGaussianMapperHelperPackVBOTemplate2(
-          it, points, numPts, colors, colorComponents,
-          static_cast<float*>(NULL), defaultSize);
+    pointPtr = points + i*3;
+    colorPtr = colors ? (colors + i*colorComponents) : white;
+    float radius = sizes ? sizes[i] : defaultSize;
+
+    // Vertices
+    *(it++) = pointPtr[0];
+    *(it++) = pointPtr[1];
+    *(it++) = pointPtr[2];
+    *(it++) = *reinterpret_cast<float *>(colorPtr);
+    *(it++) = -2.0f*radius*cos30;
+    *(it++) = -radius;
+
+    *(it++) = pointPtr[0];
+    *(it++) = pointPtr[1];
+    *(it++) = pointPtr[2];
+    *(it++) = *reinterpret_cast<float *>(colorPtr);
+    *(it++) = 2.0f*radius*cos30;
+    *(it++) = -radius;
+
+    *(it++) = pointPtr[0];
+    *(it++) = pointPtr[1];
+    *(it++) = pointPtr[2];
+    *(it++) = *reinterpret_cast<float *>(colorPtr);
+    *(it++) = 0.0f;
+    *(it++) = 2.0f*radius;
     }
+  vertexBuffer.Upload(packedVBO, vtkgl::BufferObject::ArrayBuffer);
+  layout.VertexCount = numPts*3;
+  return layout;
+}
 }
 
-void vtkOpenGLPointGaussianMapperHelperCreateVBO(
-    vtkPoints* points, unsigned char* colors, int colorComponents,
-    vtkDataArray* sizes, float defaultSize,
-    vtkOpenGLVertexBufferObject *VBO,
-    bool usingPoints)
+size_t vtkOpenGLPointGaussianMapperHelperCreateTriangleIndexBuffer(
+  vtkgl::BufferObject &indexBuffer,
+  int numPts)
 {
-  // Figure out how big each block will be, currently 6 floats.
-  int blockSize = 3;  // x y z
-  VBO->VertexOffset = 0;
-  VBO->NormalOffset = 0;
-  VBO->TCoordOffset = 0;
-  VBO->TCoordComponents = 0;
-  VBO->ColorComponents = colorComponents;
-  VBO->ColorOffset = sizeof(float) * blockSize;
-  ++blockSize; // color
+  std::vector<unsigned int> indexArray;
+  indexArray.reserve(numPts * 3);
 
-  if (usingPoints)
+  for (int i = 0; i < numPts*3; i++)
     {
-    VBO->Stride = sizeof(float) * blockSize;
-
-    // Create a buffer, and copy the data over.
-    VBO->PackedVBO.resize(blockSize * points->GetNumberOfPoints());
-    std::vector<float>::iterator it = VBO->PackedVBO.begin();
-
-    switch(points->GetDataType())
-      {
-      vtkTemplateMacro(
-            vtkOpenGLPointGaussianMapperHelperPackVBOTemplate(
-              it, static_cast<VTK_TT*>(points->GetVoidPointer(0)),
-              points->GetNumberOfPoints(),colors,colorComponents,
-              sizes,defaultSize));
-      }
-    VBO->Upload(VBO->PackedVBO, vtkOpenGLBufferObject::ArrayBuffer);
-    VBO->VertexCount = points->GetNumberOfPoints();
+    indexArray.push_back(i);
     }
-  else
-    {
-    // two more floats
-    blockSize += 2;  // offset
-    VBO->Stride = sizeof(float) * blockSize;
-
-    // Create a buffer, and copy the data over.
-    VBO->PackedVBO.resize(blockSize * points->GetNumberOfPoints() * 3);
-    std::vector<float>::iterator it = VBO->PackedVBO.begin();
-
-    switch(points->GetDataType())
-      {
-      vtkTemplateMacro(
-            vtkOpenGLPointGaussianMapperHelperPackVBOTemplate(
-              it, static_cast<VTK_TT*>(points->GetVoidPointer(0)),
-              points->GetNumberOfPoints(),colors,colorComponents,
-              sizes,defaultSize));
-      }
-    VBO->Upload(VBO->PackedVBO, vtkOpenGLBufferObject::ArrayBuffer);
-    VBO->VertexCount = points->GetNumberOfPoints() * 3;
-    }
-  return;
-}
+  indexBuffer.Upload(indexArray, vtkgl::BufferObject::ElementArrayBuffer);
+  return indexArray.size();
 }
 
 //-------------------------------------------------------------------------
-bool vtkOpenGLPointGaussianMapperHelper::GetNeedToRebuildBufferObjects(
-  vtkRenderer *vtkNotUsed(ren),
-  vtkActor *act)
+bool vtkOpenGLPointGaussianMapperHelper::GetNeedToRebuildBufferObjects(vtkRenderer *vtkNotUsed(ren), vtkActor *act)
 {
   // picking state does not require a rebuild, unlike our parent
   if (this->VBOBuildTime < this->GetMTime() ||
       this->VBOBuildTime < act->GetMTime() ||
-      this->VBOBuildTime < this->CurrentInput->GetMTime() ||
-      this->VBOBuildTime < this->Owner->GetMTime())
+      this->VBOBuildTime < this->CurrentInput->GetMTime())
     {
     return true;
     }
@@ -463,17 +302,6 @@ void vtkOpenGLPointGaussianMapperHelper::BuildBufferObjects(
     return;
     }
 
-  bool hasScaleArray = this->Owner->GetScaleArray() != NULL &&
-                       poly->GetPointData()->HasArray(this->Owner->GetScaleArray());
-  if (!hasScaleArray && this->Owner->GetDefaultRadius() == 0.0)
-    {
-    this->UsingPoints = true;
-    }
-  else
-    {
-    this->UsingPoints = false;
-    }
-
   // For vertex coloring, this sets this->Colors as side effect.
   // For texture map coloring, this sets ColorCoordinates
   // and ColorTextureMap as a side effect.
@@ -482,46 +310,41 @@ void vtkOpenGLPointGaussianMapperHelper::BuildBufferObjects(
   // then the scalars do not have to be regenerted.
   this->MapScalars(1.0);
 
+  bool hasScaleArray = this->Owner->GetScaleArray() != NULL &&
+                       poly->GetPointData()->HasArray(this->Owner->GetScaleArray());
+
   // Iterate through all of the different types in the polydata, building OpenGLs
   // and IBOs as appropriate for each type.
-  vtkOpenGLPointGaussianMapperHelperCreateVBO(
-      poly->GetPoints(),
-      this->Colors ? (unsigned char *)this->Colors->GetVoidPointer(0) : (unsigned char*)NULL,
-      this->Colors ? this->Colors->GetNumberOfComponents() : 0,
-      hasScaleArray ? poly->GetPointData()->GetArray(
-        this->Owner->GetScaleArray()) : (vtkDataArray*)NULL,
-      this->Owner->GetDefaultRadius(),
-      this->VBO, this->UsingPoints);
+  this->Layout =
+    vtkOpenGLPointGaussianMapperHelperCreateVBO(static_cast<float *>(poly->GetPoints()->GetVoidPointer(0)),
+              poly->GetPoints()->GetNumberOfPoints(),
+              this->Colors ? (unsigned char *)this->Colors->GetVoidPointer(0) : NULL,
+              this->Colors ? this->Colors->GetNumberOfComponents() : 0,
+              hasScaleArray ? static_cast<float *>(poly->GetPointData()->GetArray(
+                this->Owner->GetScaleArray())->GetVoidPointer(0)) : NULL,
+              this->Owner->GetDefaultRadius(),
+              this->VBO);
 
   // we use no IBO
-  this->Points.IBO->IndexCount = 0;
-  this->Lines.IBO->IndexCount = 0;
-  this->TriStrips.IBO->IndexCount = 0;
-  this->Tris.IBO->IndexCount = this->VBO->VertexCount;
+  this->Points.indexCount = 0;
+  this->Lines.indexCount = 0;
+  this->TriStrips.indexCount = 0;
+  this->Tris.indexCount = this->Layout.VertexCount;
 }
 
 //-----------------------------------------------------------------------------
 void vtkOpenGLPointGaussianMapperHelper::RenderPieceDraw(vtkRenderer* ren, vtkActor *actor)
 {
+  vtkgl::VBOLayout &layout = this->Layout;
+
   // draw polygons
-  if (this->Owner->GetEmissive() != 0)
-    {
-    glBlendFunc( GL_SRC_ALPHA, GL_ONE);  // additive for emissive sources
-    }
-  if (this->VBO->VertexCount)
+  glDepthMask(GL_FALSE);
+  glBlendFunc( GL_SRC_ALPHA, GL_ONE);  // additive for emissive sources
+  if (layout.VertexCount)
     {
-    // First we do the triangles or points, update the shader, set uniforms, etc.
-    this->UpdateShaders(this->Tris, ren, actor);
-    if (this->UsingPoints)
-      {
-      glDrawArrays(GL_POINTS, 0,
-        static_cast<GLuint>(this->VBO->VertexCount));
-      }
-    else
-      {
-      glDrawArrays(GL_TRIANGLES, 0,
-        static_cast<GLuint>(this->VBO->VertexCount));
-      }
+    // First we do the triangles, update the shader, set uniforms, etc.
+    this->UpdateShader(this->Tris, ren, actor);
+    glDrawArrays(GL_TRIANGLES, 0, static_cast<GLuint>(layout.VertexCount));
     }
 }
 
@@ -561,16 +384,6 @@ void vtkOpenGLPointGaussianMapper::ReleaseGraphicsResources(vtkWindow* win)
 }
 
 //-----------------------------------------------------------------------------
-bool vtkOpenGLPointGaussianMapper::GetIsOpaque()
-{
-  if (this->Emissive)
-    {
-    return false;
-    }
-  return this->Superclass::GetIsOpaque();
-}
-
-//-----------------------------------------------------------------------------
 void vtkOpenGLPointGaussianMapper::PrintSelf(ostream& os, vtkIndent indent)
 {
   this->Superclass::PrintSelf(os, indent);
diff --git a/Rendering/OpenGL2/vtkOpenGLPointGaussianMapper.h b/Rendering/OpenGL2/vtkOpenGLPointGaussianMapper.h
index 61046d1..b8299c8 100644
--- a/Rendering/OpenGL2/vtkOpenGLPointGaussianMapper.h
+++ b/Rendering/OpenGL2/vtkOpenGLPointGaussianMapper.h
@@ -16,8 +16,8 @@
 // An OpenGL mapper that uses imposters to draw PointGaussians. Supports
 // transparency and picking as well.
 
-#ifndef vtkOpenGLPointGaussianMapper_h
-#define vtkOpenGLPointGaussianMapper_h
+#ifndef __vtkOpenGLPointGaussianMapper_h
+#define __vtkOpenGLPointGaussianMapper_h
 
 #include "vtkRenderingOpenGL2Module.h" // For export macro
 #include "vtkPointGaussianMapper.h"
@@ -37,10 +37,6 @@ public:
   // resources to release.
   void ReleaseGraphicsResources(vtkWindow *);
 
-  // Description:
-  // Is this mapper opqaue? currently always false.
-  virtual bool GetIsOpaque();
-
 protected:
   vtkOpenGLPointGaussianMapper();
   ~vtkOpenGLPointGaussianMapper();
diff --git a/Rendering/OpenGL2/vtkOpenGLPolyDataMapper.cxx b/Rendering/OpenGL2/vtkOpenGLPolyDataMapper.cxx
index 1c5c00c..ea3f114 100644
--- a/Rendering/OpenGL2/vtkOpenGLPolyDataMapper.cxx
+++ b/Rendering/OpenGL2/vtkOpenGLPolyDataMapper.cxx
@@ -13,6 +13,8 @@
 =========================================================================*/
 #include "vtkOpenGLPolyDataMapper.h"
 
+#include "vtkglVBOHelper.h"
+
 #include "vtkCamera.h"
 #include "vtkCellArray.h"
 #include "vtkCellData.h"
@@ -30,34 +32,34 @@
 #include "vtkNew.h"
 #include "vtkObjectFactory.h"
 #include "vtkOpenGLActor.h"
-#include "vtkOpenGLBufferObject.h"
 #include "vtkOpenGLCamera.h"
-#include "vtkOpenGLError.h"
-#include "vtkOpenGLHelper.h"
-#include "vtkOpenGLIndexBufferObject.h"
-#include "vtkOpenGLRenderWindow.h"
 #include "vtkOpenGLRenderer.h"
+#include "vtkOpenGLRenderWindow.h"
 #include "vtkOpenGLShaderCache.h"
 #include "vtkOpenGLTexture.h"
-#include "vtkOpenGLVertexArrayObject.h"
-#include "vtkOpenGLVertexBufferObject.h"
 #include "vtkPointData.h"
 #include "vtkPolyData.h"
 #include "vtkProperty.h"
 #include "vtkScalarsToColors.h"
+#include "vtkShader.h"
 #include "vtkShaderProgram.h"
-#include "vtkTextureObject.h"
 #include "vtkTransform.h"
-#include "vtkUnsignedIntArray.h"
+
+#include "vtkOpenGLError.h"
 
 // Bring in our fragment lit shader symbols.
-#include "vtkPolyDataVS.h"
-#include "vtkPolyDataFS.h"
-#include "vtkPolyDataWideLineGS.h"
+#include "vtkglPolyDataVSFragmentLit.h"
+#include "vtkglPolyDataFSHeadlight.h"
+#include "vtkglPolyDataFSLightKit.h"
+#include "vtkglPolyDataFSPositionalLights.h"
 
-#include <algorithm>
+// bring in vertex lit shader symbols
+#include "vtkglPolyDataVSNoLighting.h"
+#include "vtkglPolyDataFSNoLighting.h"
 
+#include <algorithm>
 
+using vtkgl::substitute;
 
 //-----------------------------------------------------------------------------
 vtkStandardNewMacro(vtkOpenGLPolyDataMapper)
@@ -69,32 +71,12 @@ vtkOpenGLPolyDataMapper::vtkOpenGLPolyDataMapper()
   this->InternalColorTexture = 0;
   this->PopulateSelectionSettings = 1;
   this->LastLightComplexity = -1;
-  this->LastSelectionState = vtkHardwareSelector::MIN_KNOWN_PASS - 1;
+  this->LastSelectionState = false;
   this->LastDepthPeeling = 0;
   this->CurrentInput = 0;
   this->TempMatrix4 = vtkMatrix4x4::New();
   this->TempMatrix3 = vtkMatrix3x3::New();
   this->DrawingEdges = false;
-  this->ForceTextureCoordinates = false;
-
-  this->CellScalarTexture = NULL;
-  this->CellScalarBuffer = NULL;
-  this->CellNormalTexture = NULL;
-  this->CellNormalBuffer = NULL;
-
-  this->HavePickScalars = false;
-  this->HaveCellScalars = false;
-  this->HaveCellNormals = false;
-
-  this->PointIdArrayName = NULL;
-  this->CellIdArrayName = NULL;
-  this->ProcessIdArrayName = NULL;
-  this->CompositeIdArrayName = NULL;
-  this->VBO = vtkOpenGLVertexBufferObject::New();
-
-  this->AppleBugPrimIDBuffer = 0;
-  this->HaveAppleBug = false;
-  this->LastBoundBO = NULL;
 }
 
 
@@ -108,77 +90,21 @@ vtkOpenGLPolyDataMapper::~vtkOpenGLPolyDataMapper()
     }
   this->TempMatrix3->Delete();
   this->TempMatrix4->Delete();
-
-  if (this->CellScalarTexture)
-    { // Resources released previously.
-    this->CellScalarTexture->Delete();
-    this->CellScalarTexture = 0;
-    }
-  if (this->CellScalarBuffer)
-    { // Resources released previously.
-    this->CellScalarBuffer->Delete();
-    this->CellScalarBuffer = 0;
-    }
-
-  if (this->CellNormalTexture)
-    { // Resources released previously.
-    this->CellNormalTexture->Delete();
-    this->CellNormalTexture = 0;
-    }
-  if (this->CellNormalBuffer)
-    { // Resources released previously.
-    this->CellNormalBuffer->Delete();
-    this->CellNormalBuffer = 0;
-    }
-
-  this->SetPointIdArrayName(NULL);
-  this->SetCellIdArrayName(NULL);
-  this->SetProcessIdArrayName(NULL);
-  this->SetCompositeIdArrayName(NULL);
-  this->VBO->Delete();
-  this->VBO = 0;
-
-  if (this->AppleBugPrimIDBuffer)
-    {
-    this->AppleBugPrimIDBuffer->Delete();
-    }
 }
 
 //-----------------------------------------------------------------------------
 void vtkOpenGLPolyDataMapper::ReleaseGraphicsResources(vtkWindow* win)
 {
-  this->VBO->ReleaseGraphicsResources();
+  this->VBO.ReleaseGraphicsResources();
   this->Points.ReleaseGraphicsResources(win);
   this->Lines.ReleaseGraphicsResources(win);
   this->Tris.ReleaseGraphicsResources(win);
   this->TriStrips.ReleaseGraphicsResources(win);
-  this->TrisEdges.ReleaseGraphicsResources(win);
-  this->TriStripsEdges.ReleaseGraphicsResources(win);
 
   if (this->InternalColorTexture)
     {
     this->InternalColorTexture->ReleaseGraphicsResources(win);
     }
-  if (this->CellScalarTexture)
-    {
-    this->CellScalarTexture->ReleaseGraphicsResources(win);
-    }
-  if (this->CellScalarBuffer)
-    {
-    this->CellScalarBuffer->ReleaseGraphicsResources();
-    }
-  if (this->CellNormalTexture)
-    {
-    this->CellNormalTexture->ReleaseGraphicsResources(win);
-    }
-  if (this->CellNormalBuffer)
-    {
-    this->CellNormalBuffer->ReleaseGraphicsResources();
-    }
-  if (this->AppleBugPrimIDBuffer)
-    {
-    this->AppleBugPrimIDBuffer->ReleaseGraphicsResources();
-    }
   this->Modified();
 }
 
@@ -189,64 +115,51 @@ bool vtkOpenGLPolyDataMapper::IsShaderVariableUsed(const char *name)
 }
 
 //-----------------------------------------------------------------------------
-void vtkOpenGLPolyDataMapper::BuildShaders(
-    std::map<vtkShader::Type, vtkShader *> shaders,
-    vtkRenderer *ren, vtkActor *actor)
+void vtkOpenGLPolyDataMapper::BuildShader(std::string &VSSource,
+                                          std::string &FSSource,
+                                          std::string &GSSource,
+                                          int lightComplexity, vtkRenderer* ren, vtkActor *actor)
 {
   this->ShaderVariablesUsed.clear();
-  this->GetShaderTemplate(shaders, ren, actor);
-  this->ReplaceShaderValues(shaders, ren, actor);
+  this->GetShaderTemplate(VSSource,FSSource,GSSource,lightComplexity, ren, actor);
+  this->ReplaceShaderValues(VSSource,FSSource,GSSource,lightComplexity, ren, actor);
   std::sort(this->ShaderVariablesUsed.begin(),this->ShaderVariablesUsed.end());
 }
 
-bool vtkOpenGLPolyDataMapper::HaveWideLines(
-  vtkRenderer *ren,
-  vtkActor *actor)
-{
-  if ((this->LastBoundBO == &this->Lines ||
-       this->LastBoundBO == &this->TrisEdges ||
-       this->LastBoundBO == &TriStripsEdges ||
-       (actor->GetProperty()->GetRepresentation() == VTK_WIREFRAME &&
-          (this->LastBoundBO == &this->Tris ||
-            this->LastBoundBO == &this->TriStrips)))
-      && actor->GetProperty()->GetLineWidth() > 1.0
-      && vtkOpenGLRenderWindow::GetContextSupportsOpenGL32())
-    {
-    // we have wide lines, but the OpenGL implementation may
-    // actually support them, check the range to see if we
-      // really need have to implement our own wide lines
-    vtkOpenGLRenderWindow *renWin = vtkOpenGLRenderWindow::SafeDownCast(ren->GetRenderWindow());
-    return !(renWin &&
-      renWin->GetMaximumHardwareLineWidth() >= actor->GetProperty()->GetLineWidth());
-    }
-  return false;
-}
-
 //-----------------------------------------------------------------------------
-void vtkOpenGLPolyDataMapper::GetShaderTemplate(
-    std::map<vtkShader::Type, vtkShader *> shaders,
-    vtkRenderer *ren, vtkActor *actor)
+void vtkOpenGLPolyDataMapper::GetShaderTemplate(std::string &VSSource,
+                                          std::string &FSSource,
+                                          std::string &GSSource,
+                                          int lightComplexity, vtkRenderer*, vtkActor *)
 {
-  shaders[vtkShader::Vertex]->SetSource(vtkPolyDataVS);
-  shaders[vtkShader::Fragment]->SetSource(vtkPolyDataFS);
-  if (this->HaveWideLines(ren, actor))
-    {
-    shaders[vtkShader::Geometry]->SetSource(vtkPolyDataWideLineGS);
-    }
-  else
+  switch (lightComplexity)
     {
-    shaders[vtkShader::Geometry]->SetSource("");
+    case 0:
+        VSSource = vtkglPolyDataVSNoLighting;
+        FSSource = vtkglPolyDataFSNoLighting;
+      break;
+    case 1:
+        VSSource = vtkglPolyDataVSFragmentLit;
+        FSSource = vtkglPolyDataFSHeadlight;
+      break;
+    case 2:
+        VSSource = vtkglPolyDataVSFragmentLit;
+        FSSource = vtkglPolyDataFSLightKit;
+      break;
+    case 3:
+        VSSource = vtkglPolyDataVSFragmentLit;
+        FSSource = vtkglPolyDataFSPositionalLights;
+      break;
     }
+  GSSource.clear();
 }
 
-void vtkOpenGLPolyDataMapper::ReplaceShaderColor(
-  std::map<vtkShader::Type, vtkShader *> shaders,
-  vtkRenderer *, vtkActor *actor)
+void vtkOpenGLPolyDataMapper::ReplaceShaderColorMaterialValues(std::string &VSSource,
+                                                  std::string &FSSource,
+                                                  std::string &vtkNotUsed(GSSource),
+                                                  int lightComplexity,
+                                                  vtkRenderer* vtkNotUsed(ren), vtkActor *actor)
 {
-  std::string VSSource = shaders[vtkShader::Vertex]->GetSource();
-  std::string GSSource = shaders[vtkShader::Geometry]->GetSource();
-  std::string FSSource = shaders[vtkShader::Fragment]->GetSource();
-
   // crate the material/color property declarations, and VS implementation
   // these are always defined
   std::string colorDec =
@@ -262,7 +175,7 @@ void vtkOpenGLPolyDataMapper::ReplaceShaderColor(
       "uniform vec3 diffuseColorUniformBF; // intensity weighted color\n";
     }
   // add more for specular
-  if (this->LastLightComplexity)
+  if (lightComplexity)
     {
     colorDec +=
       "uniform vec3 specularColorUniform; // intensity weighted color\n"
@@ -275,28 +188,16 @@ void vtkOpenGLPolyDataMapper::ReplaceShaderColor(
       }
     }
   // add scalar vertex coloring
-  if (this->VBO->ColorComponents != 0)
+  if (this->Layout.ColorComponents != 0)
     {
-    colorDec += "varying vec4 vertexColorVSOutput;\n";
-    vtkShaderProgram::Substitute(VSSource,"//VTK::Color::Dec",
+    colorDec += "varying vec4 vertexColor;\n";
+    substitute(VSSource,"//VTK::Color::Dec",
                         "attribute vec4 scalarColor;\n"
-                        "varying vec4 vertexColorVSOutput;");
-    vtkShaderProgram::Substitute(VSSource,"//VTK::Color::Impl",
-                        "vertexColorVSOutput =  scalarColor;");
-    vtkShaderProgram::Substitute(GSSource,
-      "//VTK::Color::Dec",
-      "in vec4 vertexColorVSOutput[];\n"
-      "out vec4 vertexColorGSOutput;");
-    vtkShaderProgram::Substitute(GSSource,
-      "//VTK::Color::Impl",
-      "vertexColorGSOutput = vertexColorVSOutput[i];");
-    }
-  if (this->HaveCellScalars && !this->HavePickScalars)
-    {
-    colorDec += "uniform samplerBuffer textureC;\n";
+                        "varying vec4 vertexColor;");
+    substitute(VSSource,"//VTK::Color::Impl",
+                        "vertexColor =  scalarColor;");
     }
-
-  vtkShaderProgram::Substitute(FSSource,"//VTK::Color::Dec", colorDec);
+  substitute(FSSource,"//VTK::Color::Dec", colorDec);
 
   // now handle the more complex fragment shader implementation
   // the following are always defined variables.  We start
@@ -305,7 +206,7 @@ void vtkOpenGLPolyDataMapper::ReplaceShaderColor(
     "vec3 ambientColor;\n"
     "  vec3 diffuseColor;\n"
     "  float opacity;\n";
-  if (this->LastLightComplexity)
+  if (lightComplexity)
     {
     colorImpl +=
       "  vec3 specularColor;\n"
@@ -313,7 +214,7 @@ void vtkOpenGLPolyDataMapper::ReplaceShaderColor(
     }
   if (actor->GetBackfaceProperty())
     {
-    if (this->LastLightComplexity)
+    if (lightComplexity)
       {
       colorImpl +=
         "  if (int(gl_FrontFacing) == 0) {\n"
@@ -348,7 +249,7 @@ void vtkOpenGLPolyDataMapper::ReplaceShaderColor(
       "  ambientColor = ambientColorUniform;\n"
       "  diffuseColor = diffuseColorUniform;\n"
       "  opacity = opacityUniform;\n";
-    if (this->LastLightComplexity)
+    if (lightComplexity)
       {
       colorImpl +=
         "  specularColor = specularColorUniform;\n"
@@ -357,29 +258,28 @@ void vtkOpenGLPolyDataMapper::ReplaceShaderColor(
     }
 
   // now handle scalar coloring
-  if (this->VBO->ColorComponents != 0)
+  if (this->Layout.ColorComponents != 0)
     {
     if (this->ScalarMaterialMode == VTK_MATERIALMODE_AMBIENT ||
           (this->ScalarMaterialMode == VTK_MATERIALMODE_DEFAULT && actor->GetProperty()->GetAmbient() > actor->GetProperty()->GetDiffuse()))
       {
-      vtkShaderProgram::Substitute(FSSource,"//VTK::Color::Impl",
-        colorImpl +
-        "  ambientColor = vertexColorVSOutput.rgb;\n"
-        "  opacity = opacity*vertexColorVSOutput.a;");
+      substitute(FSSource,"//VTK::Color::Impl", colorImpl +
+                          "  ambientColor = vertexColor.rgb;\n"
+                          "  opacity = opacity*vertexColor.a;");
       }
     else if (this->ScalarMaterialMode == VTK_MATERIALMODE_DIFFUSE ||
           (this->ScalarMaterialMode == VTK_MATERIALMODE_DEFAULT && actor->GetProperty()->GetAmbient() <= actor->GetProperty()->GetDiffuse()))
       {
-      vtkShaderProgram::Substitute(FSSource,"//VTK::Color::Impl", colorImpl +
-        "  diffuseColor = vertexColorVSOutput.rgb;\n"
-        "  opacity = opacity*vertexColorVSOutput.a;");
+      substitute(FSSource,"//VTK::Color::Impl", colorImpl +
+                          "  diffuseColor = vertexColor.rgb;\n"
+                          "  opacity = opacity*vertexColor.a;");
       }
     else
       {
-      vtkShaderProgram::Substitute(FSSource,"//VTK::Color::Impl", colorImpl +
-        "  diffuseColor = vertexColorVSOutput.rgb;\n"
-        "  ambientColor = vertexColorVSOutput.rgb;\n"
-        "  opacity = opacity*vertexColorVSOutput.a;");
+      substitute(FSSource,"//VTK::Color::Impl", colorImpl +
+                          "  diffuseColor = vertexColor.rgb;\n"
+                          "  ambientColor = vertexColor.rgb;\n"
+                          "  opacity = opacity*vertexColor.a;");
       }
     }
   else
@@ -391,405 +291,245 @@ void vtkOpenGLPolyDataMapper::ReplaceShaderColor(
           (this->ScalarMaterialMode == VTK_MATERIALMODE_DEFAULT &&
             actor->GetProperty()->GetAmbient() > actor->GetProperty()->GetDiffuse()))
         {
-        vtkShaderProgram::Substitute(FSSource,
-          "//VTK::Color::Impl", colorImpl +
-          "  vec4 texColor = texture2D(texture1, tcoordVCVSOutput.st);\n"
-          "  ambientColor = texColor.rgb;\n"
-          "  opacity = opacity*texColor.a;");
+        substitute(FSSource,
+                    "//VTK::Color::Impl", colorImpl +
+                    "  vec4 texColor = texture2D(texture1, tcoordVC.st);\n"
+                    "  ambientColor = texColor.rgb;\n"
+                    "  opacity = opacity*texColor.a;");
         }
       else if (this->ScalarMaterialMode == VTK_MATERIALMODE_DIFFUSE ||
           (this->ScalarMaterialMode == VTK_MATERIALMODE_DEFAULT &&
            actor->GetProperty()->GetAmbient() <= actor->GetProperty()->GetDiffuse()))
         {
-        vtkShaderProgram::Substitute(FSSource,
-          "//VTK::Color::Impl", colorImpl +
-          "  vec4 texColor = texture2D(texture1, tcoordVCVSOutput.st);\n"
-          "  diffuseColor = texColor.rgb;\n"
-          "  opacity = opacity*texColor.a;");
+        substitute(FSSource,
+                    "//VTK::Color::Impl", colorImpl +
+                    "  vec4 texColor = texture2D(texture1, tcoordVC.st);\n"
+                    "  diffuseColor = texColor.rgb;\n"
+                    "  opacity = opacity*texColor.a;");
         }
       else
         {
-        vtkShaderProgram::Substitute(FSSource,
-          "//VTK::Color::Impl", colorImpl +
-          "vec4 texColor = texture2D(texture1, tcoordVCVSOutput.st);\n"
-          "  ambientColor = texColor.rgb;\n"
-          "  diffuseColor = texColor.rgb;\n"
-          "  opacity = opacity*texColor.a;");
+        substitute(FSSource,
+                    "//VTK::Color::Impl", colorImpl +
+                    "vec4 texColor = texture2D(texture1, tcoordVC.st);\n"
+                    "  ambientColor = texColor.rgb;\n"
+                    "  diffuseColor = texColor.rgb;\n"
+                    "  opacity = opacity*texColor.a;");
         }
       }
     else
       {
-      if (this->HaveCellScalars)
-        {
-        if (this->ScalarMaterialMode == VTK_MATERIALMODE_AMBIENT ||
-            (this->ScalarMaterialMode == VTK_MATERIALMODE_DEFAULT &&
-              actor->GetProperty()->GetAmbient() > actor->GetProperty()->GetDiffuse()))
-          {
-          vtkShaderProgram::Substitute(FSSource,
-            "//VTK::Color::Impl", colorImpl +
-            "  vec4 texColor = texelFetchBuffer(textureC, gl_PrimitiveID + PrimitiveIDOffset);\n"
-            "  ambientColor = texColor.rgb;\n"
-            "  opacity = opacity*texColor.a;"
-            );
-          }
-        else if (this->ScalarMaterialMode == VTK_MATERIALMODE_DIFFUSE ||
-            (this->ScalarMaterialMode == VTK_MATERIALMODE_DEFAULT &&
-             actor->GetProperty()->GetAmbient() <= actor->GetProperty()->GetDiffuse()))
-          {
-          vtkShaderProgram::Substitute(FSSource,
-            "//VTK::Color::Impl", colorImpl +
-           "  vec4 texColor = texelFetchBuffer(textureC, gl_PrimitiveID + PrimitiveIDOffset);\n"
-            "  diffuseColor = texColor.rgb;\n"
-            "  opacity = opacity*texColor.a;"
-            //  "  diffuseColor = vec3((gl_PrimitiveID%256)/255.0,((gl_PrimitiveID/256)%256)/255.0,1.0);\n"
-            );
-          }
-        else
-          {
-          vtkShaderProgram::Substitute(FSSource,
-            "//VTK::Color::Impl", colorImpl +
-            "vec4 texColor = texelFetchBuffer(textureC, gl_PrimitiveID + PrimitiveIDOffset);\n"
-            "  ambientColor = texColor.rgb;\n"
-            "  diffuseColor = texColor.rgb;\n"
-            "  opacity = opacity*texColor.a;"
-            );
-          }
-        }
-      vtkShaderProgram::Substitute(FSSource,"//VTK::Color::Impl", colorImpl);
+      substitute(FSSource,"//VTK::Color::Impl", colorImpl);
       }
     }
-
-  shaders[vtkShader::Vertex]->SetSource(VSSource);
-  shaders[vtkShader::Geometry]->SetSource(GSSource);
-  shaders[vtkShader::Fragment]->SetSource(FSSource);
 }
 
-void vtkOpenGLPolyDataMapper::ReplaceShaderLight(
-  std::map<vtkShader::Type, vtkShader *> shaders,
-  vtkRenderer *, vtkActor *)
+
+void vtkOpenGLPolyDataMapper::ReplaceShaderValues(std::string &VSSource,
+                                                  std::string &FSSource,
+                                                  std::string &GSSource,
+                                                  int lightComplexity, vtkRenderer* ren, vtkActor *actor)
 {
-  std::string FSSource = shaders[vtkShader::Fragment]->GetSource();
+  // handle colors / materials
+  this->ReplaceShaderColorMaterialValues(VSSource, FSSource, GSSource, lightComplexity, ren, actor);
 
-  switch (this->LastLightComplexity)
+  // do we need the vertex in the shader in View Coordinates
+  if (lightComplexity > 0)
     {
-    case 0: // no lighting
-      vtkShaderProgram::Substitute(FSSource,"//VTK::Light::Impl",
-        "gl_FragData[0] =  vec4(ambientColor + diffuseColor, opacity);"
-        );
-      break;
-
-    case 1:  // headlight
-      vtkShaderProgram::Substitute(FSSource,"//VTK::Light::Impl",
-        "float df = max(0.0, normalVCVSOutput.z);\n"
-        "  float sf = pow(df, specularPower);\n"
-        "  vec3 diffuse = df * diffuseColor;\n"
-        "  vec3 specular = sf * specularColor;\n"
-        "  gl_FragData[0] = vec4(ambientColor + diffuse + specular, opacity);"
-        );
-      break;
-
-    case 2: // light kit
-      vtkShaderProgram::Substitute(FSSource,"//VTK::Light::Dec",
-        // only allow for up to 6 active lights
-        "uniform int numberOfLights;\n"
-        // intensity weighted color
-        "uniform vec3 lightColor[6];\n"
-        "uniform vec3 lightDirectionVC[6]; // normalized\n"
-        "uniform vec3 lightHalfAngleVC[6]; // normalized"
-        );
-      vtkShaderProgram::Substitute(FSSource,"//VTK::Light::Impl",
-        "vec3 diffuse = vec3(0,0,0);\n"
-        "  vec3 specular = vec3(0,0,0);\n"
-        "  for (int lightNum = 0; lightNum < numberOfLights; lightNum++)\n"
-        "    {\n"
-        "    float df = max(0.0, dot(normalVCVSOutput, -lightDirectionVC[lightNum]));\n"
-        "    diffuse += (df * lightColor[lightNum]);\n"
-        "    if (dot(normalVCVSOutput, lightDirectionVC[lightNum]) < 0.0)\n"
-        "      {\n"
-        "      float sf = pow( max(0.0, dot(lightHalfAngleVC[lightNum],normalVCVSOutput)), specularPower);\n"
-        "      specular += (sf * lightColor[lightNum]);\n"
-        "      }\n"
-        "    }\n"
-        "  diffuse = diffuse * diffuseColor;\n"
-        "  specular = specular * specularColor;\n"
-        "  gl_FragData[0] = vec4(ambientColor + diffuse + specular, opacity);\n"
-        );
-      break;
+    substitute(VSSource,
+      "//VTK::PositionVC::Dec",
+      "varying vec4 vertexVC;");
+    substitute(VSSource,
+      "//VTK::PositionVC::Impl",
+      "vertexVC = MCVCMatrix * vertexMC;\n"
+      "  gl_Position = MCDCMatrix * vertexMC;\n");
+    if (substitute(VSSource,
+        "//VTK::Camera::Dec",
+        "uniform mat4 MCDCMatrix;\n"
+        "uniform mat4 MCVCMatrix;"))
+      {
+      this->ShaderVariablesUsed.push_back("MCVCMatrix");
+      }
+    substitute(FSSource,
+      "//VTK::PositionVC::Dec",
+      "varying vec4 vertexVC;");
+    }
+  else
+    {
+    substitute(VSSource,
+      "//VTK::Camera::Dec",
+      "uniform mat4 MCDCMatrix;");
+    substitute(VSSource,
+      "//VTK::PositionVC::Impl",
+      "  gl_Position = MCDCMatrix * vertexMC;\n");
+    }
 
-    case 3: // positional
-      vtkShaderProgram::Substitute(FSSource,"//VTK::Light::Dec",
-        // only allow for up to 6 active lights
-        "uniform int numberOfLights;\n"
-        // intensity weighted color
-        "uniform vec3 lightColor[6];\n"
-        "uniform vec3 lightDirectionVC[6]; // normalized\n"
-        "uniform vec3 lightHalfAngleVC[6]; // normalized\n"
-        "uniform vec3 lightPositionVC[6];\n"
-        "uniform vec3 lightAttenuation[6];\n"
-        "uniform float lightConeAngle[6];\n"
-        "uniform float lightExponent[6];\n"
-        "uniform int lightPositional[6];"
+  // normals?
+  if (this->Layout.NormalOffset)
+    {
+    if (substitute(VSSource,
+      "//VTK::Normal::Dec",
+      "attribute vec3 normalMC;\n"
+      "uniform mat3 normalMatrix;\n"
+      "varying vec3 normalVCVarying;"))
+      {
+      this->ShaderVariablesUsed.push_back("normalMatrix");
+      }
+    substitute(VSSource,
+      "//VTK::Normal::Impl",
+      "normalVCVarying = normalMatrix * normalMC;");
+    substitute(FSSource,
+      "//VTK::Normal::Dec",
+      "varying vec3 normalVCVarying;");
+    substitute(FSSource,
+      "//VTK::Normal::Impl",
+      "vec3 normalVC = normalize(normalVCVarying);\n"
+      //  if (!gl_FrontFacing) does not work in intel hd4000 mac
+      //  if (int(gl_FrontFacing) == 0) does not work on mesa
+      "  if (gl_FrontFacing == false) { normalVC = -normalVC; }\n"
+      //"normalVC = normalVCVarying;"
+      );
+    }
+  else
+    {
+    substitute(FSSource,"//VTK::System::Dec",
+      "#ifdef GL_ES\n"
+      "#extension GL_OES_standard_derivatives : enable\n"
+      "#endif\n"
+      "//VTK::System::Dec\n",
+      false);
+    if (actor->GetProperty()->GetRepresentation() == VTK_WIREFRAME)
+      {
+      // generate a normal for lines, it will be perpendicular to the line
+      // and maximally aligned with the camera view direction
+      // no clue if this is the best way to do this.
+      // the code below has been optimized a bit so what follows is
+      // an explanation of the basic approach. Compute the gradient of the line
+      // with respect to x and y, the the larger of the two
+      // cross that with the camera view direction. That gives a vector
+      // orthogonal to the camera view and the line. Note that the line and the camera
+      // view are probably not orthogonal. Which is why when we cross result that with
+      // the line gradient again we get a reasonable normal. It will be othogonal to
+      // the line (which is a plane but maximally aligned with the camera view.
+      substitute(FSSource,"//VTK::Normal::Impl",
+        "vec3 normalVC;\n"
+        "  vec3 fdx = normalize(vec3(dFdx(vertexVC.x),dFdx(vertexVC.y),dFdx(vertexVC.z)));\n"
+        "  vec3 fdy = normalize(vec3(dFdy(vertexVC.x),dFdy(vertexVC.y),dFdy(vertexVC.z)));\n"
+        "  if (abs(fdx.x) > 0.0)\n"
+        "    { normalVC = normalize(cross(vec3(fdx.y, -fdx.x, 0.0), fdx)); }\n"
+        "  else { normalVC = normalize(cross(vec3(fdy.y, -fdy.x, 0.0), fdy));}"
         );
-      vtkShaderProgram::Substitute(FSSource,"//VTK::Light::Impl",
-        "  vec3 diffuse = vec3(0,0,0);\n"
-        "  vec3 specular = vec3(0,0,0);\n"
-        "  vec3 vertLightDirectionVC;\n"
-        "  for (int lightNum = 0; lightNum < numberOfLights; lightNum++)\n"
-        "    {\n"
-        "    float attenuation = 1.0;\n"
-        "    if (lightPositional[lightNum] == 0)\n"
-        "      {\n"
-        "      vertLightDirectionVC = lightDirectionVC[lightNum];\n"
-        "      }\n"
-        "    else\n"
-        "      {\n"
-        "      vertLightDirectionVC = vertexVCVSOutput.xyz - lightPositionVC[lightNum];\n"
-        "      float distanceVC = length(vertLightDirectionVC);\n"
-        "      vertLightDirectionVC = normalize(vertLightDirectionVC);\n"
-        "      attenuation = 1.0 /\n"
-        "        (lightAttenuation[lightNum].x\n"
-        "         + lightAttenuation[lightNum].y * distanceVC\n"
-        "         + lightAttenuation[lightNum].z * distanceVC * distanceVC);\n"
-        "      // per OpenGL standard cone angle is 90 or less for a spot light\n"
-        "      if (lightConeAngle[lightNum] <= 90.0)\n"
-        "        {\n"
-        "        float coneDot = dot(vertLightDirectionVC, lightDirectionVC[lightNum]);\n"
-        "        // if inside the cone\n"
-        "        if (coneDot >= cos(radians(lightConeAngle[lightNum])))\n"
-        "          {\n"
-        "          attenuation = attenuation * pow(coneDot, lightExponent[lightNum]);\n"
-        "          }\n"
-        "        else\n"
-        "          {\n"
-        "          attenuation = 0.0;\n"
-        "          }\n"
-        "        }\n"
-        "      }\n"
-        "    float df = max(0.0, attenuation*dot(normalVCVSOutput, -vertLightDirectionVC));\n"
-        "    diffuse += (df * lightColor[lightNum]);\n"
-        "    if (dot(normalVCVSOutput, vertLightDirectionVC) < 0.0)\n"
-        "      {\n"
-        "      float sf = attenuation*pow( max(0.0, dot(lightHalfAngleVC[lightNum],normalVCVSOutput)), specularPower);\n"
-        "      specular += (sf * lightColor[lightNum]);\n"
-        "      }\n"
-        "    }\n"
-        "  diffuse = diffuse * diffuseColor;\n"
-        "  specular = specular * specularColor;\n"
-        "  gl_FragData[0] = vec4(ambientColor + diffuse + specular, opacity);"
+      }
+    else
+      {
+      substitute(FSSource,"//VTK::Normal::Impl",
+        "vec3 fdx = normalize(vec3(dFdx(vertexVC.x),dFdx(vertexVC.y),dFdx(vertexVC.z)));\n"
+        "  vec3 fdy = normalize(vec3(dFdy(vertexVC.x),dFdy(vertexVC.y),dFdy(vertexVC.z)));\n"
+        "  vec3 normalVC = normalize(cross(fdx,fdy));\n"
+        // the code below is faster, but does not work on some devices
+        //"vec3 normalVC = normalize(cross(dFdx(vertexVC.xyz), dFdy(vertexVC.xyz)));\n"
+        "  if (normalVC.z < 0.0) { normalVC = -1.0*normalVC; }"
         );
-      break;
+      }
     }
-
-  shaders[vtkShader::Fragment]->SetSource(FSSource);
-}
-
-void vtkOpenGLPolyDataMapper::ReplaceShaderTCoord(
-  std::map<vtkShader::Type, vtkShader *> shaders,
-  vtkRenderer *, vtkActor *actor)
-{
-  std::string VSSource = shaders[vtkShader::Vertex]->GetSource();
-  std::string GSSource = shaders[vtkShader::Geometry]->GetSource();
-  std::string FSSource = shaders[vtkShader::Fragment]->GetSource();
-
-  if (this->VBO->TCoordComponents)
+  if (this->Layout.TCoordComponents)
     {
     vtkInformation *info = actor->GetPropertyKeys();
     if (info && info->Has(vtkProp::GeneralTextureTransform()))
       {
-      vtkShaderProgram::Substitute(VSSource, "//VTK::TCoord::Dec",
+      substitute(VSSource, "//VTK::TCoord::Dec",
         "//VTK::TCoord::Dec\n"
         "uniform mat4 tcMatrix;",
         false);
-      if (this->VBO->TCoordComponents == 1)
+      if (this->Layout.TCoordComponents == 1)
         {
-        vtkShaderProgram::Substitute(VSSource, "//VTK::TCoord::Impl",
+        substitute(VSSource, "//VTK::TCoord::Impl",
           "vec4 tcoordTmp = tcMatrix*vec4(tcoordMC,0.0,0.0,1.0);\n"
-          "tcoordVCVSOutput = tcoordTmp.x/tcoordTmp.w;");
+          "tcoordVC = tcoordTmp.x/tcoordTmp.w;");
         }
       else
         {
-        vtkShaderProgram::Substitute(VSSource, "//VTK::TCoord::Impl",
+        substitute(VSSource, "//VTK::TCoord::Impl",
           "vec4 tcoordTmp = tcMatrix*vec4(tcoordMC,0.0,1.0);\n"
-          "tcoordVCVSOutput = tcoordTmp.xy/tcoordTmp.w;");
+          "tcoordVC = tcoordTmp.xy/tcoordTmp.w;");
         }
       }
     else
       {
-      vtkShaderProgram::Substitute(VSSource, "//VTK::TCoord::Impl",
-        "tcoordVCVSOutput = tcoordMC;");
-      }
-
-    int tNumComp = 4;
-    vtkTexture *texture = actor->GetTexture();
-    if (this->ColorTextureMap)
-      {
-      texture = this->InternalColorTexture;
-      }
-    if (!texture && actor->GetProperty()->GetNumberOfTextures())
-      {
-      texture = actor->GetProperty()->GetTexture(0);
-      }
-    if (texture)
-      {
-      tNumComp =
-        vtkOpenGLTexture::SafeDownCast(texture)->
-          GetTextureObject()->GetComponents();
+      substitute(VSSource, "//VTK::TCoord::Impl",
+        "tcoordVC = tcoordMC;");
       }
 
-    if (this->VBO->TCoordComponents == 1)
+    if (this->Layout.TCoordComponents == 1)
       {
-      vtkShaderProgram::Substitute(VSSource, "//VTK::TCoord::Dec",
-        "attribute float tcoordMC; varying float tcoordVCVSOutput;");
-      vtkShaderProgram::Substitute(GSSource,
-        "//VTK::TCoord::Dec",
-        "in float tcoordVCVSOutput[];\n"
-        "out float tcoordVCGSOutput;");
-      vtkShaderProgram::Substitute(GSSource,
-        "//VTK::TCoord::Impl",
-        "tcoordVCGSOutput = tcoordVCVSOutput[i];");
-      vtkShaderProgram::Substitute(FSSource, "//VTK::TCoord::Dec",
-        "varying float tcoordVCVSOutput;\n"
-        "uniform sampler2D texture1;");
-      switch (tNumComp)
-        {
-        case 1:
-          vtkShaderProgram::Substitute(FSSource, "//VTK::TCoord::Impl",
-            "vec4 tcolor = texture2D(texture1, vec2(tcoordVCVSOutput,0.0));\n"
-            "gl_FragData[0] = clamp(gl_FragData[0],0.0,1.0)*\n"
-            "  vec4(tcolor.r,tcolor.r,tcolor.r,1.0);");
-          break;
-        case 2:
-          vtkShaderProgram::Substitute(FSSource, "//VTK::TCoord::Impl",
-            "vec4 tcolor = texture2D(texture1, vec2(tcoordVCVSOutput,0.0));\n"
-            "gl_FragData[0] = clamp(gl_FragData[0],0.0,1.0)*\n"
-            "  vec4(tcolor.r,tcolor.r,tcolor.r,tcolor.g);");
-          break;
-        default:
-          vtkShaderProgram::Substitute(FSSource, "//VTK::TCoord::Impl",
-            "gl_FragData[0] = clamp(gl_FragData[0],0.0,1.0)*texture2D(texture1, vec2(tcoordVCVSOutput,0.0));");
-        }
-      }
+      substitute(VSSource, "//VTK::TCoord::Dec",
+        "attribute float tcoordMC; varying float tcoordVC;");
+      substitute(FSSource, "//VTK::TCoord::Dec",
+        "varying float tcoordVC; uniform sampler2D texture1;");
+      substitute(FSSource, "//VTK::TCoord::Impl",
+        "gl_FragColor = clamp(gl_FragColor,0.0,1.0)*texture2D(texture1, vec2(tcoordVC,0.0));");
+    }
     else
       {
-      vtkShaderProgram::Substitute(VSSource, "//VTK::TCoord::Dec",
-        "attribute vec2 tcoordMC; varying vec2 tcoordVCVSOutput;");
-      vtkShaderProgram::Substitute(GSSource,
-        "//VTK::TCoord::Dec",
-        "in vec2 tcoordVCVSOutput[];\n"
-        "out vec2 tcoordVCGSOutput;");
-      vtkShaderProgram::Substitute(GSSource,
-        "//VTK::TCoord::Impl",
-        "tcoordVCGSOutput = tcoordVCVSOutput[i];");
-      vtkShaderProgram::Substitute(FSSource, "//VTK::TCoord::Dec",
-        "varying vec2 tcoordVCVSOutput; uniform sampler2D texture1;");
+      substitute(VSSource, "//VTK::TCoord::Dec",
+        "attribute vec2 tcoordMC; varying vec2 tcoordVC;");
+      substitute(FSSource, "//VTK::TCoord::Dec",
+        "varying vec2 tcoordVC; uniform sampler2D texture1;");
       // do texture mapping except for scalar coloring case which is
       // handled above
       if (!this->InterpolateScalarsBeforeMapping || !this->ColorCoordinates)
         {
-        switch (tNumComp)
-          {
-          case 1:
-            vtkShaderProgram::Substitute(FSSource, "//VTK::TCoord::Impl",
-              "vec4 tcolor = texture2D(texture1, tcoordVCVSOutput);\n"
-              "gl_FragData[0] = clamp(gl_FragData[0],0.0,1.0)*\n"
-              "  vec4(tcolor.r,tcolor.r,tcolor.r,1.0);");
-            break;
-          case 2:
-            vtkShaderProgram::Substitute(FSSource, "//VTK::TCoord::Impl",
-              "vec4 tcolor = texture2D(texture1, tcoordVCVSOutput);\n"
-              "gl_FragData[0] = clamp(gl_FragData[0],0.0,1.0)*\n"
-              "  vec4(tcolor.r,tcolor.r,tcolor.r,tcolor.g);");
-            break;
-          default:
-            vtkShaderProgram::Substitute(FSSource, "//VTK::TCoord::Impl",
-              "gl_FragData[0] = clamp(gl_FragData[0],0.0,1.0)*texture2D(texture1, tcoordVCVSOutput.st);");
-          }
+        substitute(FSSource, "//VTK::TCoord::Impl",
+          "gl_FragColor = clamp(gl_FragColor,0.0,1.0)*texture2D(texture1, tcoordVC.st);");
         }
       }
     }
 
-  shaders[vtkShader::Vertex]->SetSource(VSSource);
-  shaders[vtkShader::Geometry]->SetSource(GSSource);
-  shaders[vtkShader::Fragment]->SetSource(FSSource);
-}
-
-void vtkOpenGLPolyDataMapper::ReplaceShaderPicking(
-  std::map<vtkShader::Type, vtkShader *> shaders,
-  vtkRenderer *, vtkActor *)
-{
-  std::string FSSource = shaders[vtkShader::Fragment]->GetSource();
 
-  if (this->LastSelectionState >= vtkHardwareSelector::MIN_KNOWN_PASS)
+  vtkHardwareSelector* selector = ren->GetSelector();
+  bool picking = (ren->GetRenderWindow()->GetIsPicking() || selector != NULL);
+  if (picking)
     {
-    if (this->HavePickScalars)
-      {
-      vtkShaderProgram::Substitute(FSSource,
-        "//VTK::Picking::Dec",
+    // technically with OpenGL 2.1 you need an extension to make use of gl_PrimitiveId
+    // so we request the shader4 extension.  This is particularly useful for apple
+    // systems that do not provide gl_PrimitiveId otherwise.
+    // we put this before the System Declarations
+    substitute(FSSource,"//VTK::System::Dec",
+      "#extension GL_EXT_gpu_shader4 : enable\n"
+      "//VTK::System::Dec\n",
+      false);
+    if (substitute(FSSource, "//VTK::Picking::Dec",
         "uniform vec3 mapperIndex;\n"
-        "uniform samplerBuffer textureC;");
-      vtkShaderProgram::Substitute(FSSource, "//VTK::Picking::Impl",
-        "  gl_FragData[0] = texelFetchBuffer(textureC, gl_PrimitiveID + PrimitiveIDOffset);\n"
-        );
-      }
-    else
+        "uniform int pickingAttributeIDOffset;"))
       {
-      vtkShaderProgram::Substitute(FSSource, "//VTK::Picking::Dec",
-          "uniform vec3 mapperIndex;");
-      vtkShaderProgram::Substitute(FSSource, "//VTK::Picking::Impl",
-        "if (mapperIndex == vec3(0.0,0.0,0.0))\n"
-        "    {\n"
-        "    int idx = gl_PrimitiveID + 1 + PrimitiveIDOffset;\n"
-        "    gl_FragData[0] = vec4(float(idx%256)/255.0, float((idx/256)%256)/255.0, float(idx/65536)/255.0, 1.0);\n"
-        "    }\n"
-        "  else\n"
-        "    {\n"
-        "    gl_FragData[0] = vec4(mapperIndex,1.0);\n"
-        "    }");
-      }
-    }
-  shaders[vtkShader::Fragment]->SetSource(FSSource);
-}
-
-void vtkOpenGLPolyDataMapper::ReplaceShaderDepthPeeling(
-  std::map<vtkShader::Type, vtkShader *> shaders,
-  vtkRenderer *ren, vtkActor *)
-{
-  std::string FSSource = shaders[vtkShader::Fragment]->GetSource();
+      this->ShaderVariablesUsed.push_back("pickingAttributeIDOffset");
+      }
+    substitute(FSSource, "//VTK::Picking::Impl",
+      "if (mapperIndex == vec3(0.0,0.0,0.0))\n"
+      "    {\n"
+      "    int idx = gl_PrimitiveID + 1 + pickingAttributeIDOffset;\n"
+      "    gl_FragColor = vec4(float(idx%256)/255.0, float((idx/256)%256)/255.0, float(idx/65536)/255.0, 1.0);\n"
+      "    }\n"
+      "  else\n"
+      "    {\n"
+      "    gl_FragColor = vec4(mapperIndex,1.0);\n"
+      "    }");
+    }
 
   if (ren->GetLastRenderingUsedDepthPeeling())
     {
-    vtkShaderProgram::Substitute(FSSource, "//VTK::DepthPeeling::Dec",
+    substitute(FSSource, "//VTK::DepthPeeling::Dec",
       "uniform vec2 screenSize;\n"
       "uniform sampler2D opaqueZTexture;\n"
       "uniform sampler2D translucentZTexture;\n");
-    // the .0000001 below is an epsilon.  It turns out that
-    // graphics cards can render the same polygon two times
-    // in a row with different z values. I suspect it has to
-    // do with how rasterization of the polygon is broken up.
-    // A different breakup across fragment shaders can result in
-    // very slightly different z values for some of the pixels.
-    // The end result is that with depth peeling, you can end up
-    // counting/accumulating pixels of the same surface twice
-    // simply due to this randomness in z values. So we introduce
-    // an epsilon into the transparent test to require some
-    // minimal z seperation between pixels
-    vtkShaderProgram::Substitute(FSSource, "//VTK::DepthPeeling::Impl",
+    substitute(FSSource, "//VTK::DepthPeeling::Impl",
       "float odepth = texture2D(opaqueZTexture, gl_FragCoord.xy/screenSize).r;\n"
       "  if (gl_FragCoord.z >= odepth) { discard; }\n"
       "  float tdepth = texture2D(translucentZTexture, gl_FragCoord.xy/screenSize).r;\n"
-      "  if (gl_FragCoord.z <= tdepth + .0000001) { discard; }\n"
-      //  "gl_FragData[0] = vec4(odepth*odepth,tdepth*tdepth,gl_FragCoord.z*gl_FragCoord.z,1.0);"
+      "  if (gl_FragCoord.z <= tdepth) { discard; }\n"
+      //  "gl_FragColor = vec4(odepth*odepth,tdepth*tdepth,gl_FragCoord.z*gl_FragCoord.z,1.0);"
       );
     }
-  shaders[vtkShader::Fragment]->SetSource(FSSource);
-}
-
-void vtkOpenGLPolyDataMapper::ReplaceShaderClip(
-  std::map<vtkShader::Type, vtkShader *> shaders,
-  vtkRenderer *, vtkActor *)
-{
-  std::string VSSource = shaders[vtkShader::Vertex]->GetSource();
-  std::string FSSource = shaders[vtkShader::Fragment]->GetSource();
 
   if (this->GetNumberOfClippingPlanes())
     {
@@ -801,261 +541,31 @@ void vtkOpenGLPolyDataMapper::ReplaceShaderClip(
       numClipPlanes = 6;
       }
 
-    vtkShaderProgram::Substitute(VSSource, "//VTK::Clip::Dec",
+    substitute(VSSource, "//VTK::Clip::Dec",
       "uniform int numClipPlanes;\n"
       "uniform vec4 clipPlanes[6];\n"
-      "varying float clipDistancesVSOutput[6];");
-    vtkShaderProgram::Substitute(VSSource, "//VTK::Clip::Impl",
+      "varying float clipDistances[6];");
+    substitute(VSSource, "//VTK::Clip::Impl",
       "for (int planeNum = 0; planeNum < numClipPlanes; planeNum++)\n"
       "    {\n"
-      "    clipDistancesVSOutput[planeNum] = dot(clipPlanes[planeNum], vertexMC);\n"
+      "    clipDistances[planeNum] = dot(clipPlanes[planeNum], vertexMC);\n"
       "    }\n");
-    vtkShaderProgram::Substitute(FSSource, "//VTK::Clip::Dec",
+    substitute(FSSource, "//VTK::Clip::Dec",
       "uniform int numClipPlanes;\n"
-      "varying float clipDistancesVSOutput[6];");
-    vtkShaderProgram::Substitute(FSSource, "//VTK::Clip::Impl",
+      "varying float clipDistances[6];");
+    substitute(FSSource, "//VTK::Clip::Impl",
       "for (int planeNum = 0; planeNum < numClipPlanes; planeNum++)\n"
       "    {\n"
-      "    if (clipDistancesVSOutput[planeNum] < 0.0) discard;\n"
+      "    if (clipDistances[planeNum] < 0.0) discard;\n"
       "    }\n");
     }
-  shaders[vtkShader::Vertex]->SetSource(VSSource);
-  shaders[vtkShader::Fragment]->SetSource(FSSource);
-}
-
-void vtkOpenGLPolyDataMapper::ReplaceShaderNormal(
-  std::map<vtkShader::Type, vtkShader *> shaders,
-  vtkRenderer *, vtkActor *actor)
-{
-  if (this->LastLightComplexity > 0)
-    {
-    std::string VSSource = shaders[vtkShader::Vertex]->GetSource();
-    std::string GSSource = shaders[vtkShader::Geometry]->GetSource();
-    std::string FSSource = shaders[vtkShader::Fragment]->GetSource();
-
-    if (this->VBO->NormalOffset)
-      {
-      if (vtkShaderProgram::Substitute(VSSource,
-        "//VTK::Normal::Dec",
-        "attribute vec3 normalMC;\n"
-        "uniform mat3 normalMatrix;\n"
-        "varying vec3 normalVCVSOutput;"))
-        {
-        this->ShaderVariablesUsed.push_back("normalMatrix");
-        }
-      vtkShaderProgram::Substitute(VSSource,
-        "//VTK::Normal::Impl",
-        "normalVCVSOutput = normalMatrix * normalMC;");
-      vtkShaderProgram::Substitute(GSSource,
-        "//VTK::Normal::Dec",
-        "in vec3 normalVCVSOutput[];\n"
-        "out vec3 normalVCGSOutput;");
-      vtkShaderProgram::Substitute(GSSource,
-        "//VTK::Normal::Impl",
-        "normalVCGSOutput = normalVCVSOutput[i];");
-      vtkShaderProgram::Substitute(FSSource,
-        "//VTK::Normal::Dec",
-        "varying vec3 normalVCVSOutput;");
-      vtkShaderProgram::Substitute(FSSource,
-        "//VTK::Normal::Impl",
-        "vec3 normalVCVSOutput = normalize(normalVCVSOutput);\n"
-        //  if (!gl_FrontFacing) does not work in intel hd4000 mac
-        //  if (int(gl_FrontFacing) == 0) does not work on mesa
-        "  if (gl_FrontFacing == false) { normalVCVSOutput = -normalVCVSOutput; }\n"
-        //"normalVC = normalVCVarying;"
-        );
-      }
-    else
-      {
-      if (this->HaveCellNormals)
-        {
-        if (vtkShaderProgram::Substitute(FSSource,
-            "//VTK::Normal::Dec",
-            "uniform mat3 normalMatrix;\n"
-            "uniform samplerBuffer textureN;\n"))
-          {
-          this->ShaderVariablesUsed.push_back("normalMatrix");
-          }
-        vtkShaderProgram::Substitute(FSSource,
-          "//VTK::Normal::Impl",
-          "vec3 normalVCVSOutput = normalize(normalMatrix *\n"
-          "    texelFetchBuffer(textureN, gl_PrimitiveID + PrimitiveIDOffset).xyz);\n"
-          "  if (gl_FrontFacing == false) { normalVCVSOutput = -normalVCVSOutput; }\n"
-          );
-        }
-      else
-        {
-        if (!vtkOpenGLRenderWindow::GetContextSupportsOpenGL32())
-          {
-          vtkShaderProgram::Substitute(FSSource,"//VTK::System::Dec",
-            "//VTK::System::Dec\n"
-            "#ifdef GL_ES\n"
-            "#extension GL_OES_standard_derivatives : enable\n"
-            "#endif\n",
-            false);
-          }
-        if (actor->GetProperty()->GetRepresentation() == VTK_WIREFRAME)
-          {
-          // generate a normal for lines, it will be perpendicular to the line
-          // and maximally aligned with the camera view direction
-          // no clue if this is the best way to do this.
-          // the code below has been optimized a bit so what follows is
-          // an explanation of the basic approach. Compute the gradient of the line
-          // with respect to x and y, the the larger of the two
-          // cross that with the camera view direction. That gives a vector
-          // orthogonal to the camera view and the line. Note that the line and the camera
-          // view are probably not orthogonal. Which is why when we cross result that with
-          // the line gradient again we get a reasonable normal. It will be othogonal to
-          // the line (which is a plane but maximally aligned with the camera view.
-          vtkShaderProgram::Substitute(FSSource,"//VTK::Normal::Impl",
-            "vec3 normalVCVSOutput;\n"
-            "  vec3 fdx = normalize(vec3(dFdx(vertexVCVSOutput.x),dFdx(vertexVCVSOutput.y),dFdx(vertexVCVSOutput.z)));\n"
-            "  vec3 fdy = normalize(vec3(dFdy(vertexVCVSOutput.x),dFdy(vertexVCVSOutput.y),dFdy(vertexVCVSOutput.z)));\n"
-            "  if (abs(fdx.x) > 0.0)\n"
-            "    { normalVCVSOutput = normalize(cross(vec3(fdx.y, -fdx.x, 0.0), fdx)); }\n"
-            "  else { normalVCVSOutput = normalize(cross(vec3(fdy.y, -fdy.x, 0.0), fdy));}"
-            );
-          }
-        else
-          {
-          vtkShaderProgram::Substitute(FSSource,
-            "//VTK::Normal::Dec",
-            "uniform int cameraParallel;");
-          this->ShaderVariablesUsed.push_back("cameraParallel");
-
-          vtkShaderProgram::Substitute(FSSource,"//VTK::Normal::Impl",
-            "vec3 fdx = normalize(vec3(dFdx(vertexVCVSOutput.x),dFdx(vertexVCVSOutput.y),dFdx(vertexVCVSOutput.z)));\n"
-            "  vec3 fdy = normalize(vec3(dFdy(vertexVCVSOutput.x),dFdy(vertexVCVSOutput.y),dFdy(vertexVCVSOutput.z)));\n"
-            "  vec3 normalVCVSOutput = normalize(cross(fdx,fdy));\n"
-            // the code below is faster, but does not work on some devices
-            //"vec3 normalVC = normalize(cross(dFdx(vertexVCVSOutput.xyz), dFdy(vertexVCVSOutput.xyz)));\n"
-            "  if (cameraParallel == 1 && normalVCVSOutput.z < 0.0) { normalVCVSOutput = -1.0*normalVCVSOutput; }\n"
-            "  if (cameraParallel == 0 && dot(normalVCVSOutput,vertexVCVSOutput.xyz) > 0.0) { normalVCVSOutput = -1.0*normalVCVSOutput; }"
-            );
-          }
-        }
-      }
-    shaders[vtkShader::Vertex]->SetSource(VSSource);
-    shaders[vtkShader::Geometry]->SetSource(GSSource);
-    shaders[vtkShader::Fragment]->SetSource(FSSource);
-    }
-
-}
-
-void vtkOpenGLPolyDataMapper::ReplaceShaderPositionVC(
-  std::map<vtkShader::Type, vtkShader *> shaders,
-  vtkRenderer *, vtkActor *)
-{
-  std::string VSSource = shaders[vtkShader::Vertex]->GetSource();
-  std::string GSSource = shaders[vtkShader::Geometry]->GetSource();
-  std::string FSSource = shaders[vtkShader::Fragment]->GetSource();
-
- // do we need the vertex in the shader in View Coordinates
-  if (this->LastLightComplexity > 0)
-    {
-    vtkShaderProgram::Substitute(VSSource,
-      "//VTK::PositionVC::Dec",
-      "varying vec4 vertexVCVSOutput;");
-    vtkShaderProgram::Substitute(VSSource,
-      "//VTK::PositionVC::Impl",
-      "vertexVCVSOutput = MCVCMatrix * vertexMC;\n"
-      "  gl_Position = MCDCMatrix * vertexMC;\n");
-    if (vtkShaderProgram::Substitute(VSSource,
-        "//VTK::Camera::Dec",
-        "uniform mat4 MCDCMatrix;\n"
-        "uniform mat4 MCVCMatrix;"))
-      {
-      this->ShaderVariablesUsed.push_back("MCVCMatrix");
-      }
-    vtkShaderProgram::Substitute(GSSource,
-      "//VTK::PositionVC::Dec",
-      "in vec4 vertexVCVSOutput[];\n"
-      "out vec4 vertexVCGSOutput;");
-    vtkShaderProgram::Substitute(GSSource,
-      "//VTK::PositionVC::Impl",
-      "vertexVCGSOutput = vertexVCVSOutput[i];");
-    vtkShaderProgram::Substitute(FSSource,
-      "//VTK::PositionVC::Dec",
-      "varying vec4 vertexVCVSOutput;");
-    }
-  else
-    {
-    vtkShaderProgram::Substitute(VSSource,
-      "//VTK::Camera::Dec",
-      "uniform mat4 MCDCMatrix;");
-    vtkShaderProgram::Substitute(VSSource,
-      "//VTK::PositionVC::Impl",
-      "  gl_Position = MCDCMatrix * vertexMC;\n");
-    }
-  shaders[vtkShader::Vertex]->SetSource(VSSource);
-  shaders[vtkShader::Geometry]->SetSource(GSSource);
-  shaders[vtkShader::Fragment]->SetSource(FSSource);
-}
-
-void vtkOpenGLPolyDataMapper::ReplaceShaderPrimID(
-  std::map<vtkShader::Type, vtkShader *> shaders,
-  vtkRenderer *, vtkActor *)
-{
-  std::string VSSource = shaders[vtkShader::Vertex]->GetSource();
-  std::string GSSource = shaders[vtkShader::Geometry]->GetSource();
-  std::string FSSource = shaders[vtkShader::Fragment]->GetSource();
-
-  // are we handling the apple bug?
-  if (this->AppleBugPrimIDs.size())
-    {
-    vtkShaderProgram::Substitute(VSSource,"//VTK::PrimID::Dec",
-      "attribute vec4 appleBugPrimID;\n"
-      "varying vec4 applePrimIDVSOutput;");
-    vtkShaderProgram::Substitute(VSSource,"//VTK::PrimID::Impl",
-      "applePrimIDVSOutput = appleBugPrimID;");
-    vtkShaderProgram::Substitute(GSSource,
-      "//VTK::PrimID::Dec",
-      "in  vec4 applePrimIDVSOutput[];\n"
-      "out vec4 applePrimIDGSOutput;");
-    vtkShaderProgram::Substitute(GSSource,
-      "//VTK::PrimID::Impl",
-      "applePrimIDGSOutput = applePrimIDVSOutput[i];");
-    vtkShaderProgram::Substitute(FSSource,"//VTK::PrimID::Dec",
-      "varying vec4 applePrimIDVSOutput;");
-     vtkShaderProgram::Substitute(FSSource,"//VTK::PrimID::Impl",
-       "int vtkPrimID = int(applePrimIDVSOutput[0]*255.1) + int(applePrimIDVSOutput[1]*255.1)*256 + int(applePrimIDVSOutput[2]*255.1)*65536;");
-    vtkShaderProgram::Substitute(FSSource,"gl_PrimitiveID","vtkPrimID");
-    }
-  else
-    {
-    if (this->HaveCellNormals || this->HaveCellScalars || this->HavePickScalars)
-      {
-      vtkShaderProgram::Substitute(GSSource,
-        "//VTK::PrimID::Impl",
-        "gl_PrimitiveID = gl_PrimitiveIDIn;");
-      }
-    }
-  shaders[vtkShader::Vertex]->SetSource(VSSource);
-  shaders[vtkShader::Geometry]->SetSource(GSSource);
-  shaders[vtkShader::Fragment]->SetSource(FSSource);
-}
-
-void vtkOpenGLPolyDataMapper::ReplaceShaderValues(
-  std::map<vtkShader::Type, vtkShader *> shaders,
-  vtkRenderer *ren, vtkActor *actor)
-{
-  this->ReplaceShaderColor(shaders, ren, actor);
-  this->ReplaceShaderNormal(shaders, ren, actor);
-  this->ReplaceShaderLight(shaders, ren, actor);
-  this->ReplaceShaderTCoord(shaders, ren, actor);
-  this->ReplaceShaderPicking(shaders, ren, actor);
-  this->ReplaceShaderDepthPeeling(shaders, ren, actor);
-  this->ReplaceShaderClip(shaders, ren, actor);
-  this->ReplaceShaderPrimID(shaders, ren, actor);
-  this->ReplaceShaderPositionVC(shaders, ren, actor);
 
   //cout << "VS: " << VSSource << endl;
   //cout << "FS: " << FSSource << endl;
 }
 
 //-----------------------------------------------------------------------------
-bool vtkOpenGLPolyDataMapper::GetNeedToRebuildShaders(
-  vtkOpenGLHelper &cellBO, vtkRenderer* ren, vtkActor *actor)
+bool vtkOpenGLPolyDataMapper::GetNeedToRebuildShader(vtkgl::CellBO &cellBO, vtkRenderer* ren, vtkActor *actor)
 {
   int lightComplexity = 0;
 
@@ -1105,13 +615,13 @@ bool vtkOpenGLPolyDataMapper::GetNeedToRebuildShaders(
             || light->GetIntensity() != 1.0
             || light->GetLightType() != VTK_LIGHT_TYPE_HEADLIGHT))
         {
-        lightComplexity = 2;
+          lightComplexity = 2;
         }
       if (lightComplexity < 3
           && (light->GetPositional()))
         {
-        lightComplexity = 3;
-        break;
+          lightComplexity = 3;
+          break;
         }
       }
     }
@@ -1129,6 +639,14 @@ bool vtkOpenGLPolyDataMapper::GetNeedToRebuildShaders(
     this->LastDepthPeeling = ren->GetLastRenderingUsedDepthPeeling();
     }
 
+  vtkHardwareSelector* selector = ren->GetSelector();
+  bool picking = (ren->GetIsPicking() || selector != NULL);
+  if (this->LastSelectionState != picking)
+    {
+    this->SelectionStateChanged.Modified();
+    this->LastSelectionState = picking;
+    }
+
   // has something changed that would require us to recreate the shader?
   // candidates are
   // property modified (representation interpolation and lighting)
@@ -1149,121 +667,96 @@ bool vtkOpenGLPolyDataMapper::GetNeedToRebuildShaders(
 }
 
 //-----------------------------------------------------------------------------
-void vtkOpenGLPolyDataMapper::UpdateShaders(
-  vtkOpenGLHelper &cellBO, vtkRenderer* ren, vtkActor *actor)
+void vtkOpenGLPolyDataMapper::UpdateShader(vtkgl::CellBO &cellBO, vtkRenderer* ren, vtkActor *actor)
 {
   vtkOpenGLRenderWindow *renWin = vtkOpenGLRenderWindow::SafeDownCast(ren->GetRenderWindow());
 
-  cellBO.VAO->Bind();
-  this->LastBoundBO = &cellBO;
-
   // has something changed that would require us to recreate the shader?
-  if (this->GetNeedToRebuildShaders(cellBO, ren, actor))
+  if (this->GetNeedToRebuildShader(cellBO, ren, actor))
     {
     // build the shader source code
-    std::map<vtkShader::Type,vtkShader *> shaders;
-    vtkShader *vss = vtkShader::New();
-    vss->SetType(vtkShader::Vertex);
-    shaders[vtkShader::Vertex] = vss;
-    vtkShader *gss = vtkShader::New();
-    gss->SetType(vtkShader::Geometry);
-    shaders[vtkShader::Geometry] = gss;
-    vtkShader *fss = vtkShader::New();
-    fss->SetType(vtkShader::Fragment);
-    shaders[vtkShader::Fragment] = fss;
-
-    this->BuildShaders(shaders, ren, actor);
-
-    // compile and bind the program if needed
-    vtkShaderProgram *newShader =
-      renWin->GetShaderCache()->ReadyShaderProgram(shaders);
+    std::string VSSource;
+    std::string FSSource;
+    std::string GSSource;
+    this->BuildShader(VSSource,FSSource,GSSource,this->LastLightComplexity,ren,actor);
 
-    vss->Delete();
-    fss->Delete();
-    gss->Delete();
+    // compile and bind it if needed
+    vtkShaderProgram *newShader =
+      renWin->GetShaderCache()->ReadyShader(VSSource.c_str(),
+                                            FSSource.c_str(),
+                                            GSSource.c_str());
 
     // if the shader changed reinitialize the VAO
     if (newShader != cellBO.Program)
       {
       cellBO.Program = newShader;
-      // reset the VAO as the shader has changed
-      cellBO.VAO->ReleaseGraphicsResources();
+      cellBO.vao.ShaderProgramChanged(); // reset the VAO as the shader has changed
       }
 
     cellBO.ShaderSourceTime.Modified();
     }
   else
     {
-    renWin->GetShaderCache()->ReadyShaderProgram(cellBO.Program);
+    renWin->GetShaderCache()->ReadyShader(cellBO.Program);
     }
 
   this->SetMapperShaderParameters(cellBO, ren, actor);
   this->SetPropertyShaderParameters(cellBO, ren, actor);
   this->SetCameraShaderParameters(cellBO, ren, actor);
   this->SetLightingShaderParameters(cellBO, ren, actor);
+  cellBO.vao.Bind();
 
-  vtkOpenGLCheckErrorMacro("failed after UpdateShader");
+  this->LastBoundBO = &cellBO;
 }
 
-void vtkOpenGLPolyDataMapper::SetMapperShaderParameters(vtkOpenGLHelper &cellBO,
+void vtkOpenGLPolyDataMapper::SetMapperShaderParameters(vtkgl::CellBO &cellBO,
                                                       vtkRenderer* ren, vtkActor *actor)
 {
   // Now to update the VAO too, if necessary.
-  cellBO.Program->SetUniformi("PrimitiveIDOffset",
-    this->PrimitiveIDOffset);
+  vtkgl::VBOLayout &layout = this->Layout;
 
-  if (cellBO.IBO->IndexCount && (this->VBOBuildTime > cellBO.AttributeUpdateTime ||
-      cellBO.ShaderSourceTime > cellBO.AttributeUpdateTime))
+  if (cellBO.indexCount && (this->VBOBuildTime > cellBO.attributeUpdateTime ||
+      cellBO.ShaderSourceTime > cellBO.attributeUpdateTime))
     {
-    cellBO.VAO->Bind();
-    if (!cellBO.VAO->AddAttributeArray(cellBO.Program, this->VBO,
-                                    "vertexMC", this->VBO->VertexOffset,
-                                    this->VBO->Stride, VTK_FLOAT, 3, false))
+    cellBO.vao.Bind();
+    if (!cellBO.vao.AddAttributeArray(cellBO.Program, this->VBO,
+                                    "vertexMC", layout.VertexOffset,
+                                    layout.Stride, VTK_FLOAT, 3, false))
       {
       vtkErrorMacro(<< "Error setting 'vertexMC' in shader VAO.");
       }
-    if (this->VBO->NormalOffset && this->LastLightComplexity > 0)
+    if (layout.NormalOffset && this->LastLightComplexity > 0)
       {
-      if (!cellBO.VAO->AddAttributeArray(cellBO.Program, this->VBO,
-                                      "normalMC", this->VBO->NormalOffset,
-                                      this->VBO->Stride, VTK_FLOAT, 3, false))
+      if (!cellBO.vao.AddAttributeArray(cellBO.Program, this->VBO,
+                                      "normalMC", layout.NormalOffset,
+                                      layout.Stride, VTK_FLOAT, 3, false))
         {
         vtkErrorMacro(<< "Error setting 'normalMC' in shader VAO.");
         }
       }
-    if (this->VBO->TCoordComponents)
+    if (layout.TCoordComponents)
       {
-      if (!cellBO.VAO->AddAttributeArray(cellBO.Program, this->VBO,
-                                      "tcoordMC", this->VBO->TCoordOffset,
-                                      this->VBO->Stride, VTK_FLOAT, this->VBO->TCoordComponents, false))
+      if (!cellBO.vao.AddAttributeArray(cellBO.Program, this->VBO,
+                                      "tcoordMC", layout.TCoordOffset,
+                                      layout.Stride, VTK_FLOAT, layout.TCoordComponents, false))
         {
         vtkErrorMacro(<< "Error setting 'tcoordMC' in shader VAO.");
         }
       }
-    if (this->VBO->ColorComponents != 0)
+    if (layout.ColorComponents != 0)
       {
-      if (!cellBO.VAO->AddAttributeArray(cellBO.Program, this->VBO,
-                                      "scalarColor", this->VBO->ColorOffset,
-                                      this->VBO->Stride, VTK_UNSIGNED_CHAR,
-                                      this->VBO->ColorComponents, true))
+      if (!cellBO.vao.AddAttributeArray(cellBO.Program, this->VBO,
+                                      "scalarColor", layout.ColorOffset,
+                                      layout.Stride, VTK_UNSIGNED_CHAR,
+                                      layout.ColorComponents, true))
         {
         vtkErrorMacro(<< "Error setting 'scalarColor' in shader VAO.");
         }
       }
-    if (this->AppleBugPrimIDs.size())
-      {
-      if (!cellBO.VAO->AddAttributeArray(cellBO.Program,
-          this->AppleBugPrimIDBuffer,
-          "appleBugPrimID",
-           0, sizeof(float), VTK_UNSIGNED_CHAR, 4, true))
-        {
-        vtkErrorMacro(<< "Error setting 'appleBugPrimID' in shader VAO.");
-        }
-      }
-    cellBO.AttributeUpdateTime.Modified();
+    cellBO.attributeUpdateTime.Modified();
     }
 
-  if (this->VBO->TCoordComponents)
+  if (layout.TCoordComponents)
     {
     vtkTexture *texture = actor->GetTexture();
     if (this->ColorTextureMap)
@@ -1274,11 +767,9 @@ void vtkOpenGLPolyDataMapper::SetMapperShaderParameters(vtkOpenGLHelper &cellBO,
       {
       texture = actor->GetProperty()->GetTexture(0);
       }
-    if (texture)
-      {
-      int tunit = vtkOpenGLTexture::SafeDownCast(texture)->GetTextureUnit();
-      cellBO.Program->SetUniformi("texture1", tunit);
-      }
+    int tunit = vtkOpenGLTexture::SafeDownCast(texture)->GetTextureUnit();
+    cellBO.Program->SetUniformi("texture1", tunit);
+
     // check for tcoord transform matrix
     vtkInformation *info = actor->GetPropertyKeys();
     vtkOpenGLCheckErrorMacro("failed after Render");
@@ -1298,18 +789,6 @@ void vtkOpenGLPolyDataMapper::SetMapperShaderParameters(vtkOpenGLHelper &cellBO,
       }
     }
 
-  if (this->HaveCellScalars || this->HavePickScalars)
-    {
-    int tunit = this->CellScalarTexture->GetTextureUnit();
-    cellBO.Program->SetUniformi("textureC", tunit);
-    }
-
-  if (this->HaveCellNormals)
-    {
-    int tunit = this->CellNormalTexture->GetTextureUnit();
-    cellBO.Program->SetUniformi("textureN", tunit);
-    }
-
   // if depth peeling set the required uniforms
   if (ren->GetLastRenderingUsedDepthPeeling())
     {
@@ -1335,6 +814,11 @@ void vtkOpenGLPolyDataMapper::SetMapperShaderParameters(vtkOpenGLHelper &cellBO,
   bool picking = (ren->GetRenderWindow()->GetIsPicking() || selector != NULL);
   if (picking)
     {
+    if (this->IsShaderVariableUsed("pickingAttributeIDOffset"))
+      {
+      cellBO.Program->SetUniformi("pickingAttributeIDOffset",
+        this->pickingAttributeIDOffset);
+      }
     if (selector)
       {
       if (selector->GetCurrentPass() == vtkHardwareSelector::ID_LOW24)
@@ -1379,21 +863,10 @@ void vtkOpenGLPolyDataMapper::SetMapperShaderParameters(vtkOpenGLHelper &cellBO,
     cellBO.Program->SetUniformi("numClipPlanes", numClipPlanes);
     cellBO.Program->SetUniform4fv("clipPlanes", 6, planeEquations);
     }
-
-  // handle wide lines
-  if (this->HaveWideLines(ren, actor))
-    {
-      int vp[4];
-      glGetIntegerv(GL_VIEWPORT, vp);
-      float lineWidth[2];
-      lineWidth[0] = 2.0*actor->GetProperty()->GetLineWidth()/vp[2];
-      lineWidth[1] = 2.0*actor->GetProperty()->GetLineWidth()/vp[3];
-      cellBO.Program->SetUniform2f("lineWidthNVC",lineWidth);
-    }
 }
 
 //-----------------------------------------------------------------------------
-void vtkOpenGLPolyDataMapper::SetLightingShaderParameters(vtkOpenGLHelper &cellBO,
+void vtkOpenGLPolyDataMapper::SetLightingShaderParameters(vtkgl::CellBO &cellBO,
                                                       vtkRenderer* ren, vtkActor *vtkNotUsed(actor))
 {
   // for unlit and headlight there are no lighting parameters
@@ -1496,7 +969,7 @@ void vtkOpenGLPolyDataMapper::SetLightingShaderParameters(vtkOpenGLHelper &cellB
 }
 
 //-----------------------------------------------------------------------------
-void vtkOpenGLPolyDataMapper::SetCameraShaderParameters(vtkOpenGLHelper &cellBO,
+void vtkOpenGLPolyDataMapper::SetCameraShaderParameters(vtkgl::CellBO &cellBO,
                                                     vtkRenderer* ren, vtkActor *actor)
 {
   vtkShaderProgram *program = cellBO.Program;
@@ -1539,15 +1012,10 @@ void vtkOpenGLPolyDataMapper::SetCameraShaderParameters(vtkOpenGLHelper &cellBO,
       program->SetUniformMatrix("normalMatrix", norms);
       }
     }
-
-  if (this->IsShaderVariableUsed("cameraParallel"))
-    {
-    program->SetUniformi("cameraParallel", cam->GetParallelProjection());
-    }
 }
 
 //-----------------------------------------------------------------------------
-void vtkOpenGLPolyDataMapper::SetPropertyShaderParameters(vtkOpenGLHelper &cellBO,
+void vtkOpenGLPolyDataMapper::SetPropertyShaderParameters(vtkgl::CellBO &cellBO,
                                                        vtkRenderer*, vtkActor *actor)
 {
   vtkShaderProgram *program = cellBO.Program;
@@ -1631,26 +1099,15 @@ void vtkOpenGLPolyDataMapper::RenderPieceStart(vtkRenderer* ren, vtkActor *actor
 #if GL_ES_VERSION_2_0 != 1
   glPointSize(actor->GetProperty()->GetPointSize()); // not on ES2
 #endif
-  if (!this->HaveWideLines(ren,actor))
-    {
-    glLineWidth(actor->GetProperty()->GetLineWidth());
-    }
+  glLineWidth(actor->GetProperty()->GetLineWidth()); // supported by all OpenGL versions
 
   vtkHardwareSelector* selector = ren->GetSelector();
-  int picking = selector ? selector->GetCurrentPass() :
-     vtkHardwareSelector::MIN_KNOWN_PASS - 1;
-  if (this->LastSelectionState != picking)
-    {
-    this->SelectionStateChanged.Modified();
-    this->LastSelectionState = picking;
-    }
-
   if (selector && this->PopulateSelectionSettings)
     {
     selector->BeginRenderProp();
     // render points for point picking in a special way
     if (selector->GetFieldAssociation() == vtkDataObject::FIELD_ASSOCIATION_POINTS &&
-        selector->GetCurrentPass() >= vtkHardwareSelector::ID_LOW24)
+        selector->GetCurrentPass() > vtkHardwareSelector::ACTOR_PASS)
       {
 #if GL_ES_VERSION_2_0 != 1
       glPointSize(4.0); //make verts large enough to be sure to overlap cell
@@ -1672,49 +1129,67 @@ void vtkOpenGLPolyDataMapper::RenderPieceStart(vtkRenderer* ren, vtkActor *actor
     }
 
   this->TimeToDraw = 0.0;
-  this->PrimitiveIDOffset = 0;
+  this->pickingAttributeIDOffset = 0;
 
   // make sure the BOs are up to date
   this->UpdateBufferObjects(ren, actor);
 
-  if (this->HaveCellScalars || this->HavePickScalars)
-    {
-    this->CellScalarTexture->Activate();
-    }
-  if (this->HaveCellNormals)
-    {
-    this->CellNormalTexture->Activate();
-    }
-
   // If we are coloring by texture, then load the texture map.
   // Use Map as indicator, because texture hangs around.
-  if (this->ColorTextureMap)
+  if (this->InternalColorTexture)
     {
     this->InternalColorTexture->Load(ren);
     }
 
   // Bind the OpenGL, this is shared between the different primitive/cell types.
-  this->VBO->Bind();
+  this->VBO.Bind();
+
   this->LastBoundBO = NULL;
 
+  vtkProperty *prop = actor->GetProperty();
+  bool draw_surface_with_edges =
+    (prop->GetEdgeVisibility() && prop->GetRepresentation() == VTK_SURFACE);
+
+  if ( this->GetResolveCoincidentTopology() || draw_surface_with_edges)
+    {
+    glEnable(GL_POLYGON_OFFSET_FILL);
+    if ( this->GetResolveCoincidentTopology() == VTK_RESOLVE_SHIFT_ZBUFFER )
+      {
+      // do something rough is better than nothing
+      double zRes = this->GetResolveCoincidentTopologyZShift(); // 0 is no shift 1 is big shift
+      double f = zRes*4.0;
+      glPolygonOffset(f + (draw_surface_with_edges ? 1.0 : 0.0),
+        draw_surface_with_edges ? 1.0 : 0.0);  // supported on ES2/3/etc
+      }
+    else
+      {
+      double f, u;
+      this->GetResolveCoincidentTopologyPolygonOffsetParameters(f,u);
+      glPolygonOffset(f + (draw_surface_with_edges ? 1.0 : 0.0),
+        u + (draw_surface_with_edges ? 1.0 : 0.0));  // supported on ES2/3/etc
+      }
+    }
+
 }
 
 //-----------------------------------------------------------------------------
 void vtkOpenGLPolyDataMapper::RenderPieceDraw(vtkRenderer* ren, vtkActor *actor)
 {
+  vtkgl::VBOLayout &layout = this->Layout;
+
   // draw points
-  if (this->Points.IBO->IndexCount)
+  if (this->Points.indexCount)
     {
     // Update/build/etc the shader.
-    this->UpdateShaders(this->Points, ren, actor);
-    this->Points.IBO->Bind();
+    this->UpdateShader(this->Points, ren, actor);
+    this->Points.ibo.Bind();
     glDrawRangeElements(GL_POINTS, 0,
-                        static_cast<GLuint>(this->VBO->VertexCount - 1),
-                        static_cast<GLsizei>(this->Points.IBO->IndexCount),
+                        static_cast<GLuint>(layout.VertexCount - 1),
+                        static_cast<GLsizei>(this->Points.indexCount),
                         GL_UNSIGNED_INT,
                         reinterpret_cast<const GLvoid *>(NULL));
-    this->Points.IBO->Release();
-    this->PrimitiveIDOffset += (int)this->Points.IBO->IndexCount;
+    this->Points.ibo.Release();
+    this->pickingAttributeIDOffset += (int)this->Points.indexCount;
     }
 
   int representation = actor->GetProperty()->GetRepresentation();
@@ -1724,109 +1199,84 @@ void vtkOpenGLPolyDataMapper::RenderPieceDraw(vtkRenderer* ren, vtkActor *actor)
   vtkHardwareSelector* selector = ren->GetSelector();
   if (selector && this->PopulateSelectionSettings &&
       selector->GetFieldAssociation() == vtkDataObject::FIELD_ASSOCIATION_POINTS &&
-      selector->GetCurrentPass() >= vtkHardwareSelector::ID_LOW24)
+      selector->GetCurrentPass() > vtkHardwareSelector::ACTOR_PASS)
     {
     representation = VTK_POINTS;
     }
 
   // draw lines
-  if (this->Lines.IBO->IndexCount)
+  if (this->Lines.indexCount)
     {
-    this->UpdateShaders(this->Lines, ren, actor);
-    this->Lines.IBO->Bind();
+    this->UpdateShader(this->Lines, ren, actor);
+    this->Lines.ibo.Bind();
     if (representation == VTK_POINTS)
       {
       glDrawRangeElements(GL_POINTS, 0,
-                          static_cast<GLuint>(this->VBO->VertexCount - 1),
-                          static_cast<GLsizei>(this->Lines.IBO->IndexCount),
+                          static_cast<GLuint>(layout.VertexCount - 1),
+                          static_cast<GLsizei>(this->Lines.indexCount),
                           GL_UNSIGNED_INT,
                           reinterpret_cast<const GLvoid *>(NULL));
       }
     else
       {
-      glDrawRangeElements(GL_LINES, 0,
-                          static_cast<GLuint>(this->VBO->VertexCount - 1),
-                          static_cast<GLsizei>(this->Lines.IBO->IndexCount),
-                          GL_UNSIGNED_INT,
-                          reinterpret_cast<const GLvoid *>(NULL));
-      }
-    this->Lines.IBO->Release();
-    this->PrimitiveIDOffset += (int)this->Lines.IBO->IndexCount/2;
-    }
-
-  vtkProperty *prop = actor->GetProperty();
-  bool surface_offset =
-    (this->GetResolveCoincidentTopology() || prop->GetEdgeVisibility())
-    && prop->GetRepresentation() == VTK_SURFACE;
-
-  if (surface_offset)
-    {
-    glEnable(GL_POLYGON_OFFSET_FILL);
-    if ( this->GetResolveCoincidentTopology() == VTK_RESOLVE_SHIFT_ZBUFFER )
-      {
-      // do something rough is better than nothing
-      double zRes = this->GetResolveCoincidentTopologyZShift(); // 0 is no shift 1 is big shift
-      double f = zRes*4.0;
-      glPolygonOffset(f + (prop->GetEdgeVisibility() ? 1.0 : 0.0),
-        prop->GetEdgeVisibility() ? 1.0 : 0.0);  // supported on ES2/3/etc
-      }
-    else
-      {
-      double f, u;
-      this->GetResolveCoincidentTopologyPolygonOffsetParameters(f,u);
-      glPolygonOffset(f + (prop->GetEdgeVisibility() ? 1.0 : 0.0),
-        u + (prop->GetEdgeVisibility() ? 1.0 : 0.0));  // supported on ES2/3/etc
+      glMultiDrawElements(GL_LINE_STRIP,
+                        (GLsizei *)(&this->Lines.elementsArray[0]),
+                        GL_UNSIGNED_INT,
+                        reinterpret_cast<const GLvoid **>(&(this->Lines.offsetArray[0])),
+                        (GLsizei)this->Lines.offsetArray.size());
       }
+    this->Lines.ibo.Release();
+    this->pickingAttributeIDOffset += (int)this->Lines.indexCount;
     }
 
   // draw polygons
-  if (this->Tris.IBO->IndexCount)
+  if (this->Tris.indexCount)
     {
     // First we do the triangles, update the shader, set uniforms, etc.
-    this->UpdateShaders(this->Tris, ren, actor);
-    this->Tris.IBO->Bind();
+    this->UpdateShader(this->Tris, ren, actor);
+    this->Tris.ibo.Bind();
     GLenum mode = (representation == VTK_POINTS) ? GL_POINTS :
       (representation == VTK_WIREFRAME) ? GL_LINES : GL_TRIANGLES;
     glDrawRangeElements(mode, 0,
-                      static_cast<GLuint>(this->VBO->VertexCount - 1),
-                      static_cast<GLsizei>(this->Tris.IBO->IndexCount),
+                      static_cast<GLuint>(layout.VertexCount - 1),
+                      static_cast<GLsizei>(this->Tris.indexCount),
                       GL_UNSIGNED_INT,
                       reinterpret_cast<const GLvoid *>(NULL));
-    this->Tris.IBO->Release();
-    this->PrimitiveIDOffset += (int)this->Tris.IBO->IndexCount/3;
+    this->Tris.ibo.Release();
+    this->pickingAttributeIDOffset += (int)this->Tris.indexCount;
     }
 
   // draw strips
-  if (this->TriStrips.IBO->IndexCount)
+  if (this->TriStrips.indexCount)
     {
     // Use the tris shader program/VAO, but triStrips ibo.
-    this->UpdateShaders(this->TriStrips, ren, actor);
-    this->TriStrips.IBO->Bind();
+    this->UpdateShader(this->TriStrips, ren, actor);
+    this->TriStrips.ibo.Bind();
     if (representation == VTK_POINTS)
       {
       glDrawRangeElements(GL_POINTS, 0,
-                          static_cast<GLuint>(this->VBO->VertexCount - 1),
-                          static_cast<GLsizei>(this->TriStrips.IBO->IndexCount),
+                          static_cast<GLuint>(layout.VertexCount - 1),
+                          static_cast<GLsizei>(this->TriStrips.indexCount),
                           GL_UNSIGNED_INT,
                           reinterpret_cast<const GLvoid *>(NULL));
       }
     if (representation == VTK_WIREFRAME)
       {
-      glDrawRangeElements(GL_LINES, 0,
-                          static_cast<GLuint>(this->VBO->VertexCount - 1),
-                          static_cast<GLsizei>(this->TriStrips.IBO->IndexCount),
-                          GL_UNSIGNED_INT,
-                          reinterpret_cast<const GLvoid *>(NULL));
+      glMultiDrawElements(GL_LINE_STRIP,
+                        (GLsizei *)(&this->TriStrips.elementsArray[0]),
+                        GL_UNSIGNED_INT,
+                        reinterpret_cast<const GLvoid **>(&(this->TriStrips.offsetArray[0])),
+                        (GLsizei)this->TriStrips.offsetArray.size());
       }
     if (representation == VTK_SURFACE)
       {
-      glDrawRangeElements(GL_TRIANGLES, 0,
-                          static_cast<GLuint>(this->VBO->VertexCount - 1),
-                          static_cast<GLsizei>(this->TriStrips.IBO->IndexCount),
-                          GL_UNSIGNED_INT,
-                          reinterpret_cast<const GLvoid *>(NULL));
+      glMultiDrawElements(GL_TRIANGLE_STRIP,
+                        (GLsizei *)(&this->TriStrips.elementsArray[0]),
+                        GL_UNSIGNED_INT,
+                        reinterpret_cast<const GLvoid **>(&(this->TriStrips.offsetArray[0])),
+                        (GLsizei)this->TriStrips.offsetArray.size());
       }
-    this->TriStrips.IBO->Release();
+    this->TriStrips.ibo.Release();
     }
 }
 
@@ -1838,7 +1288,7 @@ void vtkOpenGLPolyDataMapper::RenderPieceFinish(vtkRenderer* ren, vtkActor *vtkN
     {
     // render points for point picking in a special way
     if (selector->GetFieldAssociation() == vtkDataObject::FIELD_ASSOCIATION_POINTS &&
-        selector->GetCurrentPass() >= vtkHardwareSelector::ID_LOW24)
+        selector->GetCurrentPass() > vtkHardwareSelector::ACTOR_PASS)
       {
       glDepthMask(GL_TRUE);
       glDisable(GL_POLYGON_OFFSET_FILL);
@@ -1848,17 +1298,17 @@ void vtkOpenGLPolyDataMapper::RenderPieceFinish(vtkRenderer* ren, vtkActor *vtkN
 
   if (this->LastBoundBO)
     {
-    this->LastBoundBO->VAO->Release();
+    this->LastBoundBO->vao.Release();
     }
 
-  this->VBO->Release();
+  this->VBO.Release();
 
   if ( this->GetResolveCoincidentTopology() )
     {
     glDisable(GL_POLYGON_OFFSET_FILL);
     }
 
-  if (this->ColorTextureMap)
+  if (this->InternalColorTexture)
     {
     this->InternalColorTexture->PostRender(ren);
     }
@@ -1870,15 +1320,6 @@ void vtkOpenGLPolyDataMapper::RenderPieceFinish(vtkRenderer* ren, vtkActor *vtkN
     this->TimeToDraw = 0.0001;
     }
 
-  if (this->HaveCellScalars || this->HavePickScalars)
-    {
-    this->CellScalarTexture->Deactivate();
-    }
-  if (this->HaveCellNormals)
-    {
-    this->CellNormalTexture->Deactivate();
-    }
-
   this->UpdateProgress(1.0);
 }
 
@@ -1929,34 +1370,35 @@ void vtkOpenGLPolyDataMapper::RenderEdges(vtkRenderer* ren, vtkActor *actor)
     return;
     }
 
+  vtkgl::VBOLayout &layout = this->Layout;
   this->DrawingEdges = true;
 
   // draw polygons
-  if (this->TrisEdges.IBO->IndexCount)
+  if (this->TrisEdges.indexCount)
     {
     // First we do the triangles, update the shader, set uniforms, etc.
-    this->UpdateShaders(this->TrisEdges, ren, actor);
-    this->TrisEdges.IBO->Bind();
+    this->UpdateShader(this->TrisEdges, ren, actor);
+    this->TrisEdges.ibo.Bind();
     glDrawRangeElements(GL_LINES, 0,
-                        static_cast<GLuint>(this->VBO->VertexCount - 1),
-                        static_cast<GLsizei>(this->TrisEdges.IBO->IndexCount),
+                        static_cast<GLuint>(layout.VertexCount - 1),
+                        static_cast<GLsizei>(this->TrisEdges.indexCount),
                         GL_UNSIGNED_INT,
                         reinterpret_cast<const GLvoid *>(NULL));
-    this->TrisEdges.IBO->Release();
+    this->TrisEdges.ibo.Release();
     }
 
   // draw strips
-  if (this->TriStripsEdges.IBO->IndexCount)
+  if (this->TriStripsEdges.indexCount)
     {
     // Use the tris shader program/VAO, but triStrips ibo.
-    this->UpdateShaders(this->TriStripsEdges, ren, actor);
-    this->TriStripsEdges.IBO->Bind();
-    glDrawRangeElements(GL_LINES, 0,
-                        static_cast<GLuint>(this->VBO->VertexCount - 1),
-                        static_cast<GLsizei>(this->TriStripsEdges.IBO->IndexCount),
-                        GL_UNSIGNED_INT,
-                        reinterpret_cast<const GLvoid *>(NULL));
-    this->TriStripsEdges.IBO->Release();
+    this->UpdateShader(this->TriStripsEdges, ren, actor);
+    this->TriStripsEdges.ibo.Bind();
+    glMultiDrawElements(GL_LINE_STRIP,
+                      (GLsizei *)(&this->TriStripsEdges.elementsArray[0]),
+                      GL_UNSIGNED_INT,
+                      reinterpret_cast<const GLvoid **>(&(this->TriStripsEdges.offsetArray[0])),
+                      (GLsizei)this->TriStripsEdges.offsetArray.size());
+    this->TriStripsEdges.ibo.Release();
     }
 
   this->DrawingEdges = false;
@@ -1994,346 +1436,25 @@ void vtkOpenGLPolyDataMapper::UpdateBufferObjects(vtkRenderer *ren, vtkActor *ac
 }
 
 //-------------------------------------------------------------------------
-bool vtkOpenGLPolyDataMapper::GetNeedToRebuildBufferObjects(
-  vtkRenderer *vtkNotUsed(ren), vtkActor *act)
+bool vtkOpenGLPolyDataMapper::GetNeedToRebuildBufferObjects(vtkRenderer *ren, vtkActor *act)
 {
   if (this->VBOBuildTime < this->GetMTime() ||
       this->VBOBuildTime < act->GetMTime() ||
-      this->VBOBuildTime < this->CurrentInput->GetMTime() ||
-      this->VBOBuildTime < this->SelectionStateChanged)
+      this->VBOBuildTime < this->CurrentInput->GetMTime())
     {
     return true;
     }
-  return false;
-}
-
-// create the cell scalar array adjusted for ogl Cells
-
-
-void vtkOpenGLPolyDataMapper::AppendCellTextures(
-  vtkRenderer *ren,
-  vtkActor *,
-  vtkCellArray *prims[4],
-  int representation,
-  std::vector<unsigned char> &newColors,
-  std::vector<float> &newNorms,
-  vtkPolyData *poly)
-{
-  // deal with optional pick mapping arrays
-  vtkHardwareSelector* selector = ren->GetSelector();
-  vtkUnsignedIntArray* mapArray = NULL;
-  vtkIdTypeArray* mapArrayId = NULL;
-  vtkPointData *pd = poly->GetPointData();
-  vtkCellData *cd = poly->GetCellData();
-  if (selector)
-    {
-    switch (selector->GetCurrentPass())
-      {
-      // point data is used for process_pass which seems odd
-      case vtkHardwareSelector::PROCESS_PASS:
-        mapArray = this->ProcessIdArrayName ?
-          vtkUnsignedIntArray::SafeDownCast(
-            pd->GetArray(this->ProcessIdArrayName)) : NULL;
-        break;
-      case vtkHardwareSelector::COMPOSITE_INDEX_PASS:
-        mapArray = this->CompositeIdArrayName ?
-          vtkUnsignedIntArray::SafeDownCast(
-            cd->GetArray(this->CompositeIdArrayName)) : NULL;
-        break;
-      case vtkHardwareSelector::ID_LOW24:
-        if (selector->GetFieldAssociation() ==
-          vtkDataObject::FIELD_ASSOCIATION_POINTS)
-          {
-          mapArrayId = this->PointIdArrayName ?
-            vtkIdTypeArray::SafeDownCast(
-              pd->GetArray(this->PointIdArrayName)) : NULL;
-          }
-        else
-          {
-          mapArrayId = this->CellIdArrayName ?
-            vtkIdTypeArray::SafeDownCast(
-              cd->GetArray(this->CellIdArrayName)) : NULL;
-          }
-        break;
-      }
-    }
-
-  this->HavePickScalars = false;
-  if (selector && this->PopulateSelectionSettings &&
-      (mapArray ||
-        selector->GetCurrentPass() >= vtkHardwareSelector::ID_LOW24))
-    {
-    this->HavePickScalars = true;
-    }
-
-  // handle point picking, all is drawn as points
-  if (this->HavePickScalars &&
-      selector->GetCurrentPass() >= vtkHardwareSelector::ID_LOW24 &&
-      selector->GetFieldAssociation() == vtkDataObject::FIELD_ASSOCIATION_POINTS)
-    {
-    vtkIdType* indices(NULL);
-    vtkIdType npts(0);
-
-    for (int j = 0; j < 4; j++)
-      {
-      for (prims[j]->InitTraversal(); prims[j]->GetNextCell(npts, indices); )
-        {
-        for (int i=0; i < npts; ++i)
-          {
-          unsigned int value = indices[i];
-          if (mapArrayId)
-            {
-            value = mapArrayId->GetValue(indices[i]);
-            }
-          value++;
-          newColors.push_back(value & 0xff);
-          newColors.push_back((value & 0xff00) >> 8);
-          newColors.push_back((value & 0xff0000) >> 16);
-          newColors.push_back(0xff);
-          }
-        } // for cell
-      }
-    return;
-    }
-
-  // handle process_id picking
-  if (this->HavePickScalars &&
-      selector->GetCurrentPass() == vtkHardwareSelector::PROCESS_PASS)
-    {
-    vtkIdType* indices(NULL);
-    vtkIdType npts(0);
-
-    for (int j = 0; j < 4; j++)
-      {
-      // for each cell, lookup the process value for it's first vertex
-      // and use that as cell data
-      for (prims[j]->InitTraversal(); prims[j]->GetNextCell(npts, indices); )
-        {
-        unsigned int value = indices[0];
-        value = mapArray->GetValue(value) + 1;
-        newColors.push_back(value & 0xff);
-        newColors.push_back((value & 0xff00) >> 8);
-        newColors.push_back((value & 0xff0000) >> 16);
-        newColors.push_back(0xff);
-        } // for cell
-      }
-    return;
-    }
-
-  // handle cell based picking
-  if (this->HaveCellScalars || this->HaveCellNormals || this->HavePickScalars)
-    {
-    std::vector<unsigned int> cellCellMap;
-    if (this->HaveAppleBug)
-      {
-      unsigned int numCells = poly->GetNumberOfCells();
-      for (unsigned int i = 0; i < numCells; i++)
-        {
-        cellCellMap.push_back(i);
-        }
-      }
-    else
-      {
-      vtkOpenGLIndexBufferObject::CreateCellSupportArrays(
-        prims, cellCellMap, representation);
-      }
-
-    if (this->HaveCellScalars || this->HavePickScalars)
-      {
-      int numComp = 4;
-
-      if (this->HavePickScalars)
-        {
-        for (unsigned int i = 0; i < cellCellMap.size(); i++)
-          {
-          unsigned int value = cellCellMap[i];
-          if (mapArray)
-            {
-            value = mapArray->GetValue(value);
-            }
-          if (mapArrayId)
-            {
-            value = mapArrayId->GetValue(value);
-            }
-          value++; // see vtkHardwareSelector.cxx ID_OFFSET
-          newColors.push_back(value & 0xff);
-          newColors.push_back((value & 0xff00) >> 8);
-          newColors.push_back((value & 0xff0000) >> 16);
-          newColors.push_back(0xff);
-          }
-        }
-      else
-        {
-        numComp = this->Colors->GetNumberOfComponents();
-        unsigned char *colorPtr = this->Colors->GetPointer(0);
-        assert(numComp == 4);
-        // use a single color value?
-        if (this->FieldDataTupleId > -1 &&
-            this->ScalarMode == VTK_SCALAR_MODE_USE_FIELD_DATA)
-          {
-          for (unsigned int i = 0; i < cellCellMap.size(); i++)
-            {
-            for (int j = 0; j < numComp; j++)
-              {
-              newColors.push_back(colorPtr[this->FieldDataTupleId*numComp + j]);
-              }
-            }
-          }
-        else
-          {
-          for (unsigned int i = 0; i < cellCellMap.size(); i++)
-            {
-            for (int j = 0; j < numComp; j++)
-              {
-              newColors.push_back(colorPtr[cellCellMap[i]*numComp + j]);
-              }
-            }
-          }
-        }
-      }
-
-    if (this->HaveCellNormals)
-      {
-      // create the cell scalar array adjusted for ogl Cells
-      vtkDataArray *n = this->CurrentInput->GetCellData()->GetNormals();
-      for (unsigned int i = 0; i < cellCellMap.size(); i++)
-        {
-        // RGB32F requires a later version of OpenGL than 3.2
-        // with 3.2 we know we have RGBA32F hence the extra value
-        double *norms = n->GetTuple(cellCellMap[i]);
-        newNorms.push_back(norms[0]);
-        newNorms.push_back(norms[1]);
-        newNorms.push_back(norms[2]);
-        newNorms.push_back(1.0);
-        }
-      }
-    }
-}
-
-void vtkOpenGLPolyDataMapper::BuildCellTextures(
-  vtkRenderer *ren,
-  vtkActor *actor,
-  vtkCellArray *prims[4],
-  int representation)
-{
-  // create the cell scalar array adjusted for ogl Cells
-  std::vector<unsigned char> newColors;
-  std::vector<float> newNorms;
-  this->AppendCellTextures(ren, actor, prims, representation,
-    newColors, newNorms, this->CurrentInput);
-
-  // allocate as needed
-  if (this->HaveCellScalars || this->HavePickScalars)
-    {
-    if (!this->CellScalarTexture)
-      {
-      this->CellScalarTexture = vtkTextureObject::New();
-      this->CellScalarBuffer = vtkOpenGLBufferObject::New();
-      this->CellScalarBuffer->SetType(vtkOpenGLBufferObject::TextureBuffer);
-      }
-    this->CellScalarTexture->SetContext(
-      static_cast<vtkOpenGLRenderWindow*>(ren->GetVTKWindow()));
-    this->CellScalarBuffer->Upload(newColors,
-      vtkOpenGLBufferObject::TextureBuffer);
-    this->CellScalarTexture->CreateTextureBuffer(
-      static_cast<unsigned int>(newColors.size()/4),
-      4,
-      VTK_UNSIGNED_CHAR,
-      this->CellScalarBuffer);
-    }
-
-  if (this->HaveCellNormals)
-    {
-    if (!this->CellNormalTexture)
-      {
-      this->CellNormalTexture = vtkTextureObject::New();
-      this->CellNormalBuffer = vtkOpenGLBufferObject::New();
-      this->CellNormalBuffer->SetType(vtkOpenGLBufferObject::TextureBuffer);
-      }
-    this->CellNormalTexture->SetContext(
-      static_cast<vtkOpenGLRenderWindow*>(ren->GetVTKWindow()));
-    this->CellNormalBuffer->Upload(newNorms,
-      vtkOpenGLBufferObject::TextureBuffer);
-    this->CellNormalTexture->CreateTextureBuffer(
-      static_cast<unsigned int>(newNorms.size()/4),
-      4, VTK_FLOAT,
-      this->CellNormalBuffer);
-    }
-}
-
-// on some apple systems gl_PrimitiveID does not work
-// correctly.  So we have to make sure there are no
-// shared vertices and build an aray that maps verts
-// to their cell id
-vtkPolyData *vtkOpenGLPolyDataMapper::HandleAppleBug(
-  vtkPolyData *poly,
-  std::vector<float> &buffData
-  )
-{
-  vtkIdType* indices = NULL;
-  vtkIdType npts = 0;
-
-  vtkPolyData *newPD = vtkPolyData::New();
-  newPD->GetCellData()->PassData(poly->GetCellData());
-  vtkPoints *points = poly->GetPoints();
-  vtkPoints *newPoints = vtkPoints::New();
-  newPD->SetPoints(newPoints);
-  vtkPointData *pointData = poly->GetPointData();
-  vtkPointData *newPointData = newPD->GetPointData();
-  newPointData->CopyStructure(pointData);
-  newPointData->CopyAllocate(pointData);
-
-  vtkCellArray *prims[4];
-  prims[0] =  poly->GetVerts();
-  prims[1] =  poly->GetLines();
-  prims[2] =  poly->GetPolys();
-  prims[3] =  poly->GetStrips();
-
-  // build a new PolyData with no shared cells
-
-  // for each prim type
-  unsigned int newPointCount = 0;
-  buffData.reserve(points->GetNumberOfPoints());
-  for (int j = 0; j < 4; j++)
+  else
     {
-    unsigned int newCellCount = 0;
-    if (prims[j]->GetNumberOfCells())
+    vtkHardwareSelector* selector = ren->GetSelector();
+    bool picking = (ren->GetIsPicking() || selector != NULL);
+    if ((this->LastSelectionState || picking) && selector &&
+          selector->GetFieldAssociation() == vtkDataObject::FIELD_ASSOCIATION_POINTS)
       {
-      vtkCellArray *ca = vtkCellArray::New();
-      switch (j)
-        {
-        case 0: newPD->SetVerts(ca); break;
-        case 1: newPD->SetLines(ca); break;
-        case 2: newPD->SetPolys(ca); break;
-        case 3: newPD->SetStrips(ca); break;
-        }
-
-      // foreach cell
-      for (prims[j]->InitTraversal(); prims[j]->GetNextCell(npts, indices); )
-        {
-        ca->InsertNextCell(npts);
-        vtkucfloat c;
-        c.c[0] = newCellCount&0xff;
-        c.c[1] = (newCellCount >> 8)&0xff;
-        c.c[2] = (newCellCount >> 16)&0xff;
-        c.c[3] =  0;
-        for (int i=0; i < npts; ++i)
-          {
-          // insert point data
-          newPoints->InsertNextPoint(points->GetPoint(indices[i]));
-          ca->InsertCellPoint(newPointCount);
-          newPointData->CopyData(pointData,indices[i],newPointCount);
-          buffData.push_back(c.f);
-          newPointCount++;
-          }
-        newCellCount++;
-        }
-      ca->Delete();
+      return true;
       }
     }
-
-  newPoints->Delete();
-  return newPD;
+  return false;
 }
 
 //-------------------------------------------------------------------------
@@ -2365,8 +1486,7 @@ void vtkOpenGLPolyDataMapper::BuildBufferObjects(vtkRenderer *ren, vtkActor *act
     this->InternalColorTexture->SetInputData(this->ColorTextureMap);
     }
 
-  this->HaveCellScalars = false;
-  vtkDataArray *c = this->Colors;
+  bool cellScalars = false;
   if (this->ScalarVisibility)
     {
     // We must figure out how the scalars should be mapped to the polydata.
@@ -2377,186 +1497,95 @@ void vtkOpenGLPolyDataMapper::BuildBufferObjects(vtkRenderer *ren, vtkActor *act
          && this->ScalarMode != VTK_SCALAR_MODE_USE_POINT_FIELD_DATA
          && this->Colors)
       {
-      this->HaveCellScalars = true;
-      c = NULL;
+      cellScalars = true;
       }
     }
 
-  this->HaveCellNormals = false;
+  bool cellNormals = false;
   // Do we have cell normals?
   vtkDataArray *n =
     (act->GetProperty()->GetInterpolation() != VTK_FLAT) ? poly->GetPointData()->GetNormals() : NULL;
   if (n == NULL && poly->GetCellData()->GetNormals())
     {
-    this->HaveCellNormals = true;
+    cellNormals = true;
+    n = poly->GetCellData()->GetNormals();
     }
 
-  int representation = act->GetProperty()->GetRepresentation();
-  vtkHardwareSelector* selector = ren->GetSelector();
-  bool pointPicking = false;
-  if (selector && this->PopulateSelectionSettings &&
-      selector->GetFieldAssociation() == vtkDataObject::FIELD_ASSOCIATION_POINTS &&
-      selector->GetCurrentPass() >= vtkHardwareSelector::ID_LOW24)
-    {
-    representation = VTK_POINTS;
-    pointPicking = true;
-    }
-
-  // check if this system is subject to the apple primID bug
-  this->HaveAppleBug = false;
-
-#ifdef __APPLE__
-  std::string vendor = (const char *)glGetString(GL_VENDOR);
-  if (vendor.find("ATI") != std::string::npos ||
-      vendor.find("AMD") != std::string::npos ||
-      vendor.find("amd") != std::string::npos)
-    {
-    this->HaveAppleBug = true;
-    }
-#endif
-
   // if we have cell scalars then we have to
+  // explode the data
   vtkCellArray *prims[4];
   prims[0] =  poly->GetVerts();
   prims[1] =  poly->GetLines();
   prims[2] =  poly->GetPolys();
   prims[3] =  poly->GetStrips();
-
-  // only rebuild what we need to
-  // if the data or mapper or selection state changed
-  // then rebuild the cell arrays
-  if (this->VBOBuildTime < this->GetMTime() ||
-      this->VBOBuildTime < this->CurrentInput->GetMTime() ||
-      this->VBOBuildTime < this->SelectionStateChanged)
+  std::vector<unsigned int> cellPointMap;
+  std::vector<unsigned int> pointCellMap;
+  if (cellScalars || cellNormals)
     {
-    this->BuildCellTextures(ren, act, prims, representation);
+    vtkgl::CreateCellSupportArrays(poly, prims, cellPointMap, pointCellMap);
     }
 
-  // on apple with the AMD PrimID bug we use a slow
-  // painful approach to work around it
-  this->AppleBugPrimIDs.resize(0);
-  if (this->HaveAppleBug &&
-      !pointPicking &&
-      (this->HaveCellNormals || this->HaveCellScalars || this->HavePickScalars))
-    {
-    if (!this->AppleBugPrimIDBuffer)
-      {
-      this->AppleBugPrimIDBuffer = vtkOpenGLBufferObject::New();
-      }
-    poly = this->HandleAppleBug(poly, this->AppleBugPrimIDs);
-    this->AppleBugPrimIDBuffer->Bind();
-    this->AppleBugPrimIDBuffer->Upload(
-     this->AppleBugPrimIDs, vtkOpenGLBufferObject::ArrayBuffer);
-    this->AppleBugPrimIDBuffer->Release();
+  // do we have texture maps?
+  bool haveTextures = (this->ColorTextureMap || act->GetTexture() || act->GetProperty()->GetNumberOfTextures());
 
-    vtkWarningMacro("VTK is working around a bug in Apple-AMD hardware related to gl_PrimitiveID.  This may cause significant memory and performance impacts. Your hardware has been identified as vendor "
-      << (const char *)glGetString(GL_VENDOR) << " with renderer of "
-      << (const char *)glGetString(GL_RENDERER));
-    if (n)
+  // Set the texture if we are going to use texture
+  // for coloring with a point attribute.
+  // fixme ... make the existence of the coordinate array the signal.
+  vtkDataArray *tcoords = NULL;
+  if (haveTextures)
+    {
+    if (this->InterpolateScalarsBeforeMapping && this->ColorCoordinates)
       {
-      n = (act->GetProperty()->GetInterpolation() != VTK_FLAT) ?
-            poly->GetPointData()->GetNormals() : NULL;
+      tcoords = this->ColorCoordinates;
       }
-    if (c)
+    else
       {
-      this->Colors->Delete();
-      this->Colors = 0;
-      this->MapScalars(poly,1.0);
-      c = this->Colors;
+      tcoords = poly->GetPointData()->GetTCoords();
       }
     }
 
-  // rebuild the VBO if the data has changed
-  if (this->VBOBuildTime < this->SelectionStateChanged ||
-      this->VBOBuildTime < this->GetMTime() ||
-      this->VBOBuildTime < act->GetMTime() ||
-      (c && this->VBOBuildTime < c->GetMTime()) ||
-      this->VBOBuildTime < this->CurrentInput->GetMTime())
-    {
-    // do we have texture maps?
-    bool haveTextures = (this->ColorTextureMap || act->GetTexture() ||
-      act->GetProperty()->GetNumberOfTextures() ||
-      this->ForceTextureCoordinates);
-
-    // Set the texture if we are going to use texture
-    // for coloring with a point attribute.
-    // fixme ... make the existence of the coordinate array the signal.
-    vtkDataArray *tcoords = NULL;
-    this->TextureComponents = 4;
-    if (haveTextures)
-      {
-      if (this->InterpolateScalarsBeforeMapping && this->ColorCoordinates)
-        {
-        tcoords = this->ColorCoordinates;
-        }
-      else
-        {
-        tcoords = poly->GetPointData()->GetTCoords();
-        }
-      }
-
-    // Build the VBO
-    this->VBO->CreateVBO(poly->GetPoints(),
-        poly->GetPoints()->GetNumberOfPoints(),
-        n, tcoords,
-        c ? (unsigned char *)c->GetVoidPointer(0) : NULL,
-        c ? c->GetNumberOfComponents() : 0);
-    }
-
+  // Build the VBO
+  this->Layout =
+    CreateVBO(poly->GetPoints(),
+              cellPointMap.size() > 0 ? (unsigned int)cellPointMap.size() : poly->GetPoints()->GetNumberOfPoints(),
+              n, tcoords,
+              this->Colors ? (unsigned char *)this->Colors->GetVoidPointer(0) : NULL,
+              this->Colors ? this->Colors->GetNumberOfComponents() : 0,
+              this->VBO,
+              cellPointMap.size() > 0 ? &cellPointMap.front() : NULL,
+              pointCellMap.size() > 0 ? &pointCellMap.front() : NULL,
+              cellScalars, cellNormals);
 
   // now create the IBOs
-  vtkProperty *prop = act->GetProperty();
-  if (
-      this->VBOBuildTime < this->GetMTime() ||
-      this->VBOBuildTime < this->CurrentInput->GetMTime() ||
-      this->VBOBuildTime < prop->GetMTime() ||
-      this->VBOBuildTime < this->SelectionStateChanged)
-    {
-    this->BuildIBO(ren, act, poly);
-    }
-
-  // free up polydata if allocated due to apple bug
-  if (poly != this->CurrentInput)
-    {
-    poly->Delete();
-    }
+  this->Points.indexCount = CreatePointIndexBuffer(prims[0],
+                                                   this->Points.ibo);
 
-  vtkOpenGLCheckErrorMacro("failed after BuildBufferObjects");
-}
-
-//-------------------------------------------------------------------------
-void vtkOpenGLPolyDataMapper::BuildIBO(
-  vtkRenderer *ren,
-  vtkActor *act,
-  vtkPolyData *poly)
-{
-  vtkCellArray *prims[4];
-  prims[0] =  poly->GetVerts();
-  prims[1] =  poly->GetLines();
-  prims[2] =  poly->GetPolys();
-  prims[3] =  poly->GetStrips();
   int representation = act->GetProperty()->GetRepresentation();
 
   vtkHardwareSelector* selector = ren->GetSelector();
-
-  this->Points.IBO->CreatePointIndexBuffer(prims[0]);
-
   if (selector && this->PopulateSelectionSettings &&
       selector->GetFieldAssociation() == vtkDataObject::FIELD_ASSOCIATION_POINTS &&
-      selector->GetCurrentPass() >= vtkHardwareSelector::ID_LOW24)
+      selector->GetCurrentPass() > vtkHardwareSelector::ACTOR_PASS)
     {
     representation = VTK_POINTS;
     }
 
   if (representation == VTK_POINTS)
     {
-    this->Lines.IBO->CreatePointIndexBuffer(prims[1]);
-    this->Tris.IBO->CreatePointIndexBuffer(prims[2]);
-    this->TriStrips.IBO->CreatePointIndexBuffer(prims[3]);
+    this->Lines.indexCount = CreatePointIndexBuffer(prims[1],
+                         this->Lines.ibo);
+
+    this->Tris.indexCount = CreatePointIndexBuffer(prims[2],
+                                                this->Tris.ibo);
+    this->TriStrips.indexCount = CreatePointIndexBuffer(prims[3],
+                         this->TriStrips.ibo);
     }
   else // WIREFRAME OR SURFACE
     {
-    this->Lines.IBO->CreateLineIndexBuffer(prims[1]);
+    this->Lines.indexCount = CreateMultiIndexBuffer(prims[1],
+                           this->Lines.ibo,
+                           this->Lines.offsetArray,
+                           this->Lines.elementsArray, false);
 
     if (representation == VTK_WIREFRAME)
       {
@@ -2577,18 +1606,29 @@ void vtkOpenGLPolyDataMapper::BuildIBO(
         }
       if (ef)
         {
-        this->Tris.IBO->CreateEdgeFlagIndexBuffer(prims[2], ef);
+        this->Tris.indexCount = CreateEdgeFlagIndexBuffer(prims[2],
+                                             this->Tris.ibo, ef);
         }
       else
         {
-        this->Tris.IBO->CreateTriangleLineIndexBuffer(prims[2]);
+        this->Tris.indexCount = CreateTriangleLineIndexBuffer(prims[2],
+                                           this->Tris.ibo);
         }
-      this->TriStrips.IBO->CreateStripIndexBuffer(prims[3], true);
+      this->TriStrips.indexCount = CreateMultiIndexBuffer(prims[3],
+                           this->TriStrips.ibo,
+                           this->TriStrips.offsetArray,
+                           this->TriStrips.elementsArray, true);
       }
    else // SURFACE
       {
-      this->Tris.IBO->CreateTriangleIndexBuffer(prims[2], poly->GetPoints());
-      this->TriStrips.IBO->CreateStripIndexBuffer(prims[3], false);
+      this->Tris.indexCount = CreateTriangleIndexBuffer(prims[2],
+                                                this->Tris.ibo,
+                                                poly->GetPoints(),
+                                                cellPointMap);
+      this->TriStrips.indexCount = CreateMultiIndexBuffer(prims[3],
+                           this->TriStrips.ibo,
+                           this->TriStrips.offsetArray,
+                           this->TriStrips.elementsArray, false);
       }
     }
 
@@ -2615,15 +1655,30 @@ void vtkOpenGLPolyDataMapper::BuildIBO(
       }
     if (ef)
       {
-      this->TrisEdges.IBO->CreateEdgeFlagIndexBuffer(prims[2], ef);
+      this->TrisEdges.indexCount = CreateEdgeFlagIndexBuffer(prims[2],
+                                           this->TrisEdges.ibo, ef);
       }
     else
       {
-      this->TrisEdges.IBO->CreateTriangleLineIndexBuffer(prims[2]);
+      this->TrisEdges.indexCount = CreateTriangleLineIndexBuffer(prims[2],
+                                           this->TrisEdges.ibo);
+      }
+    this->TriStripsEdges.indexCount = CreateMultiIndexBuffer(prims[3],
+                         this->TriStripsEdges.ibo,
+                         this->TriStripsEdges.offsetArray,
+                         this->TriStripsEdges.elementsArray, true);
+    }
+
+  // free up new cell arrays
+  if (cellScalars || cellNormals)
+    {
+    for (int primType = 0; primType < 4; primType++)
+      {
+      prims[primType]->UnRegister(this);
       }
-    this->TriStripsEdges.IBO->CreateStripIndexBuffer(prims[3], true);
     }
 }
+
 //-----------------------------------------------------------------------------
 bool vtkOpenGLPolyDataMapper::GetIsOpaque()
 {
@@ -2667,6 +1722,149 @@ bool vtkOpenGLPolyDataMapper::GetIsOpaque()
   return this->Superclass::GetIsOpaque();
 }
 
+vtkIdType vtkOpenGLPolyDataMapper::GetConvertedPickValue(vtkIdType idIn, int fieldassociation, vtkActor *act)
+{
+  vtkPolyData *poly = this->CurrentInput;
+  vtkCellArray *prims[4];
+  prims[0] =  poly->GetVerts();
+  prims[1] =  poly->GetLines();
+  prims[2] =  poly->GetPolys();
+  prims[3] =  poly->GetStrips();
+
+  vtkIdType* indices(NULL);
+  vtkIdType npts(0);
+  vtkIdType localId = idIn;
+
+  // handle cell picking
+  if (fieldassociation == vtkDataObject::FIELD_ASSOCIATION_CELLS)
+    {
+    // for points the cell is the cell, easy peasy
+    if (static_cast<size_t>(localId) < this->Points.indexCount)
+      {
+      return localId;
+      }
+    localId -= this->Points.indexCount;
+    vtkIdType offset = 0;  // adjustment between OpenGL cells and VTK cells
+
+    int representation = act->GetProperty()->GetRepresentation();
+
+    // for lines the cell has to be computed because we do not
+    // know how many line segments are in the polyline
+    if (this->Lines.indexCount > 0)
+      {
+      // compute the location in the cell array
+      vtkIdType cellCount = 0;
+      for (prims[1]->InitTraversal(); prims[1]->GetNextCell(npts, indices); )
+        {
+        vtkIdType numCells = (representation == VTK_POINTS) ? npts : (npts - 1);
+        if (localId < cellCount + numCells)
+          {
+          return idIn + offset + cellCount - localId;
+          }
+        offset = offset + 1 - numCells;
+        cellCount += numCells;
+        }
+      localId -= (this->Lines.indexCount/2);
+      }
+
+    // for polys the cell has to be computed because we do not
+    // know how many triangles are in the poly
+    if (this->Tris.indexCount > 0)
+      {
+      // compute the location in the cell array
+      vtkIdType cellCount = 0;
+      for (prims[2]->InitTraversal(); prims[2]->GetNextCell(npts, indices); )
+        {
+        vtkIdType numCells = (representation == VTK_POINTS) ? npts :
+          (representation == VTK_WIREFRAME) ? npts : (npts - 2);
+        if (localId < cellCount + numCells)
+          {
+          return idIn + offset + cellCount - localId;
+          }
+        offset = offset + 1 - numCells;
+        cellCount += numCells;
+        }
+      localId -= (this->Tris.indexCount/3);
+      }
+
+    // for strips the cell maps exactly, easy peasy
+    if (static_cast<size_t>(localId) < this->TriStrips.indexCount)
+      {
+      return idIn + offset;
+      }
+    return 0;
+    }
+
+  // if we got here, then it is point based picking
+  // is it a point?
+   if (static_cast<size_t>(localId) < this->Points.indexCount)
+    {
+    prims[0]->GetCell(localId,npts,indices);
+    return indices[0];
+    }
+  localId -= this->Points.indexCount;
+
+  // when picking in point mode, we render all primitives as
+  // points.  The graphics hardware tells us what point was
+  // picked.  e.g. the 11th point. We have to convert that into
+  // a point ID. This can be done by traversing the cell
+  // arrays to find the 11th point rendered. But that operation
+  // can be expensive for the more complex cell arrays.
+  // You could speed this up significantly by building a
+  // monotonically increasing array of indexes that are
+  // not points in the cells array.  Then a binary search
+  // would let you index quickly into the right array location.
+
+  // is it a line?
+  if (static_cast<size_t>(localId) <  this->Lines.indexCount)
+    {
+    // compute the location in the cell array
+    vtkIdType pointCount = 0;
+    for (prims[1]->InitTraversal(); prims[1]->GetNextCell(npts, indices); )
+      {
+      if (localId < pointCount + npts)
+        {
+        return indices[localId - pointCount];
+        }
+      pointCount += npts;
+      }
+    }
+  localId -= this->Lines.indexCount;
+
+  // is it a poly
+  if (static_cast<size_t>(localId) <  this->Tris.indexCount)
+    {
+    // compute the location in the cell array
+    vtkIdType pointCount = 0;
+    for (prims[2]->InitTraversal(); prims[2]->GetNextCell(npts, indices); )
+      {
+      if (localId < pointCount + npts)
+        {
+        return indices[localId - pointCount];
+        }
+      pointCount += npts;
+      }
+    }
+  localId -= this->Tris.indexCount;
+
+  // is it a strip?
+  if (static_cast<size_t>(localId) <  this->TriStrips.indexCount)
+    {
+    // compute the location in the cell array
+    vtkIdType pointCount = 0;
+    for (prims[3]->InitTraversal(); prims[3]->GetNextCell(npts, indices); )
+      {
+      if (localId < pointCount + npts)
+        {
+        return indices[localId - pointCount];
+        }
+      pointCount += npts;
+      }
+    }
+
+  return idIn;
+}
+
 //-----------------------------------------------------------------------------
 void vtkOpenGLPolyDataMapper::PrintSelf(ostream& os, vtkIndent indent)
 {
diff --git a/Rendering/OpenGL2/vtkOpenGLPolyDataMapper.h b/Rendering/OpenGL2/vtkOpenGLPolyDataMapper.h
index e6fed86..7367463 100644
--- a/Rendering/OpenGL2/vtkOpenGLPolyDataMapper.h
+++ b/Rendering/OpenGL2/vtkOpenGLPolyDataMapper.h
@@ -20,18 +20,11 @@
 
 #include "vtkRenderingOpenGL2Module.h" // For export macro
 #include "vtkPolyDataMapper.h"
-#include "vtkShader.h" // for methods
-#include "vtkOpenGLHelper.h" // used for ivars
-#include <vector> //for ivars
-#include <map> //for methods
+#include "vtkglVBOHelper.h" // used for ivars
 
-class vtkCellArray;
+class vtkOpenGLTexture;
 class vtkMatrix4x4;
 class vtkMatrix3x3;
-class vtkOpenGLTexture;
-class vtkOpenGLBufferObject;
-class vtkOpenGLVertexBufferObject;
-class vtkTextureObject;
 
 class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLPolyDataMapper : public vtkPolyDataMapper
 {
@@ -84,53 +77,16 @@ public:
   vtkPolyData *CurrentInput;
 
   // Description:
-  // By default, this painters uses the dataset's point and cell ids during
-  // rendering. However, one can override those by specifying cell and point
-  // data arrays to use instead. Currently, only vtkIdType array is supported.
-  // Set to NULL string (default) to use the point ids instead.
-  vtkSetStringMacro(PointIdArrayName);
-  vtkGetStringMacro(PointIdArrayName);
-  vtkSetStringMacro(CellIdArrayName);
-  vtkGetStringMacro(CellIdArrayName);
-
-  // Description:
-  // If the painter should override the process id using a data-array,
-  // set this variable to the name of the array to use. It must be a
-  // point-array.
-  vtkSetStringMacro(ProcessIdArrayName);
-  vtkGetStringMacro(ProcessIdArrayName);
-
-  // Description:
-  // Generally, vtkCompositePainter can render the composite id when iterating
-  // over composite datasets. However in some cases (as in AMR), the rendered
-  // structure may not correspond to the input data, in which case we need
-  // to provide a cell array that can be used to render in the composite id in
-  // selection passes. Set to NULL (default) to not override the composite id
-  // color set by vtkCompositePainter if any.
-  // The array *MUST* be a cell array and of type vtkUnsignedIntArray.
-  vtkSetStringMacro(CompositeIdArrayName);
-  vtkGetStringMacro(CompositeIdArrayName);
-
-  // the following is all extra stuff to work around the
-  // fact that gl_PrimitiveID does not work correctly on
-  // Apple devices with AMD graphics hardware. See apple
-  // bug ID 20747550
-  static vtkPolyData *HandleAppleBug(
-    vtkPolyData *poly,
-    std::vector<float> &buffData);
+  // Props may provide a mapping from picked value to actual value
+  // This is useful for hardware based pickers where
+  // there is a mapping between the color in the buffer
+  // and the actual pick value
+  virtual vtkIdType GetConvertedPickValue(vtkIdType idIn, int fieldassociation, vtkActor *act);
 
 protected:
   vtkOpenGLPolyDataMapper();
   ~vtkOpenGLPolyDataMapper();
 
-  // the following is all extra stuff to work around the
-  // fact that gl_PrimitiveID does not work correctly on
-  // Apple devices with AMD graphics hardware. See apple
-  // bug ID 20747550
-  bool HaveAppleBug;
-  std::vector<float> AppleBugPrimIDs;
-  vtkOpenGLBufferObject *AppleBugPrimIDBuffer;
-
   // Description:
   // Called in GetBounds(). When this method is called, the consider the input
   // to be updated depending on whether this->Static is set or not. This method
@@ -138,80 +94,62 @@ protected:
   virtual void ComputeBounds();
 
   // Description:
-  // Make sure appropriate shaders are defined, compiled and bound.  This method
+  // Make sure an appropriate shader is defined, compiled and bound.  This method
   // orchistrates the process, much of the work is done in other methods
-  virtual void UpdateShaders(
-    vtkOpenGLHelper &cellBO, vtkRenderer *ren, vtkActor *act);
+  virtual void UpdateShader(vtkgl::CellBO &cellBO, vtkRenderer *ren, vtkActor *act);
 
   // Description:
   // Does the shader source need to be recomputed
-  virtual bool GetNeedToRebuildShaders(
-    vtkOpenGLHelper &cellBO, vtkRenderer *ren, vtkActor *act);
+  virtual bool GetNeedToRebuildShader(vtkgl::CellBO &cellBO, vtkRenderer *ren, vtkActor *act);
 
   // Description:
   // Build the shader source code, called by UpdateShader
-  virtual void BuildShaders(
-    std::map<vtkShader::Type, vtkShader *> shaders,
-    vtkRenderer *ren, vtkActor *act);
+  virtual void BuildShader(std::string &VertexCode,
+                           std::string &fragmentCode,
+                           std::string &geometryCode,
+                           int lightComplexity,
+                           vtkRenderer *ren, vtkActor *act);
 
   // Description:
   // Create the basic shaders before replacement
-  virtual void GetShaderTemplate(
-    std::map<vtkShader::Type, vtkShader *> shaders,
-    vtkRenderer *ren, vtkActor *act);
+  virtual void GetShaderTemplate(std::string &VertexCode,
+                           std::string &fragmentCode,
+                           std::string &geometryCode,
+                           int lightComplexity,
+                           vtkRenderer *ren, vtkActor *act);
 
   // Description:
   // Perform string replacments on the shader templates
-  virtual void ReplaceShaderValues(
-    std::map<vtkShader::Type, vtkShader *> shaders,
-    vtkRenderer *ren, vtkActor *act);
+  virtual void ReplaceShaderValues(std::string &VertexCode,
+                           std::string &fragmentCode,
+                           std::string &geometryCode,
+                           int lightComplexity,
+                           vtkRenderer *ren, vtkActor *act);
 
   // Description:
   // Perform string replacments on the shader templates, called from
   // ReplaceShaderValues
-  virtual void ReplaceShaderColor(
-    std::map<vtkShader::Type, vtkShader *> shaders,
-    vtkRenderer *ren, vtkActor *act);
-  virtual void ReplaceShaderLight(
-    std::map<vtkShader::Type, vtkShader *> shaders,
-    vtkRenderer *ren, vtkActor *act);
-  virtual void ReplaceShaderTCoord(
-    std::map<vtkShader::Type, vtkShader *> shaders,
-    vtkRenderer *ren, vtkActor *act);
-  virtual void ReplaceShaderPicking(
-    std::map<vtkShader::Type, vtkShader *> shaders,
-    vtkRenderer *ren, vtkActor *act);
-  virtual void ReplaceShaderDepthPeeling(
-    std::map<vtkShader::Type, vtkShader *> shaders,
-    vtkRenderer *ren, vtkActor *act);
-  virtual void ReplaceShaderPrimID(
-    std::map<vtkShader::Type, vtkShader *> shaders,
-    vtkRenderer *ren, vtkActor *act);
-  virtual void ReplaceShaderNormal(
-    std::map<vtkShader::Type, vtkShader *> shaders,
-    vtkRenderer *ren, vtkActor *act);
-  virtual void ReplaceShaderClip(
-    std::map<vtkShader::Type, vtkShader *> shaders,
-    vtkRenderer *ren, vtkActor *act);
-  virtual void ReplaceShaderPositionVC(
-    std::map<vtkShader::Type, vtkShader *> shaders,
-    vtkRenderer *ren, vtkActor *act);
+  virtual void ReplaceShaderColorMaterialValues(std::string &VertexCode,
+                           std::string &fragmentCode,
+                           std::string &geometryCode,
+                           int lightComplexity,
+                           vtkRenderer *ren, vtkActor *act);
 
   // Description:
   // Set the shader parameteres related to the mapper/input data, called by UpdateShader
-  virtual void SetMapperShaderParameters(vtkOpenGLHelper &cellBO, vtkRenderer *ren, vtkActor *act);
+  virtual void SetMapperShaderParameters(vtkgl::CellBO &cellBO, vtkRenderer *ren, vtkActor *act);
 
   // Description:
   // Set the shader parameteres related to lighting, called by UpdateShader
-  virtual void SetLightingShaderParameters(vtkOpenGLHelper &cellBO, vtkRenderer *ren, vtkActor *act);
+  virtual void SetLightingShaderParameters(vtkgl::CellBO &cellBO, vtkRenderer *ren, vtkActor *act);
 
   // Description:
   // Set the shader parameteres related to the Camera, called by UpdateShader
-  virtual void SetCameraShaderParameters(vtkOpenGLHelper &cellBO, vtkRenderer *ren, vtkActor *act);
+  virtual void SetCameraShaderParameters(vtkgl::CellBO &cellBO, vtkRenderer *ren, vtkActor *act);
 
   // Description:
   // Set the shader parameteres related to the property, called by UpdateShader
-  virtual void SetPropertyShaderParameters(vtkOpenGLHelper &cellBO, vtkRenderer *ren, vtkActor *act);
+  virtual void SetPropertyShaderParameters(vtkgl::CellBO &cellBO, vtkRenderer *ren, vtkActor *act);
 
   // Description:
   // Update the VBO/IBO to be current
@@ -225,31 +163,25 @@ protected:
   // Build the VBO/IBO, called by UpdateBufferObjects
   virtual void BuildBufferObjects(vtkRenderer *ren, vtkActor *act);
 
-  // Description:
-  // Build the IBO, called by BuildBufferObjects
-  virtual void BuildIBO(vtkRenderer *ren, vtkActor *act, vtkPolyData *poly);
-
   // The VBO and its layout.
-  vtkOpenGLVertexBufferObject *VBO;
+  vtkgl::BufferObject VBO;
+  vtkgl::VBOLayout Layout;
 
   // Structures for the various cell types we render.
-  vtkOpenGLHelper Points;
-  vtkOpenGLHelper Lines;
-  vtkOpenGLHelper Tris;
-  vtkOpenGLHelper TriStrips;
-  vtkOpenGLHelper TrisEdges;
-  vtkOpenGLHelper TriStripsEdges;
-  vtkOpenGLHelper *LastBoundBO;
+  vtkgl::CellBO Points;
+  vtkgl::CellBO Lines;
+  vtkgl::CellBO Tris;
+  vtkgl::CellBO TriStrips;
+  vtkgl::CellBO TrisEdges;
+  vtkgl::CellBO TriStripsEdges;
+  vtkgl::CellBO *LastBoundBO;
   bool DrawingEdges;
 
-  // do we have wide lines that require special handling
-  virtual bool HaveWideLines(vtkRenderer *, vtkActor *);
-
   // values we use to determine if we need to rebuild
   int LastLightComplexity;
   vtkTimeStamp LightComplexityChanged;
 
-  int LastSelectionState;
+  bool LastSelectionState;
   vtkTimeStamp SelectionStateChanged;
 
   int LastDepthPeeling;
@@ -260,7 +192,7 @@ protected:
   vtkOpenGLTexture* InternalColorTexture;
 
   int PopulateSelectionSettings;
-  int PrimitiveIDOffset;
+  int pickingAttributeIDOffset;
 
   vtkMatrix4x4 *TempMatrix4;
   vtkMatrix3x3 *TempMatrix3;
@@ -278,43 +210,6 @@ protected:
   // are currently populated.
   bool IsShaderVariableUsed(const char *);
 
-  // if set to true, tcoords will be passed to the
-  // VBO even if the mapper knows of no texture maps
-  // normally tcoords are only added to the VBO if the
-  // mapper has indentified a texture map as well.
-  bool ForceTextureCoordinates;
-
-  void BuildCellTextures(
-    vtkRenderer *ren,
-    vtkActor *,
-    vtkCellArray *prims[4],
-    int representation);
-
-  void AppendCellTextures(
-    vtkRenderer *ren,
-    vtkActor *,
-    vtkCellArray *prims[4],
-    int representation,
-    std::vector<unsigned char> &colors,
-    std::vector<float> &normals,
-    vtkPolyData *pd);
-
-  bool HavePickScalars;
-  vtkTextureObject *CellScalarTexture;
-  vtkOpenGLBufferObject *CellScalarBuffer;
-  bool HaveCellScalars;
-  vtkTextureObject *CellNormalTexture;
-  vtkOpenGLBufferObject *CellNormalBuffer;
-  bool HaveCellNormals;
-
-  // aditional picking indirection
-  char* PointIdArrayName;
-  char* CellIdArrayName;
-  char* ProcessIdArrayName;
-  char* CompositeIdArrayName;
-
-  int TextureComponents;
-
 private:
   vtkOpenGLPolyDataMapper(const vtkOpenGLPolyDataMapper&); // Not implemented.
   void operator=(const vtkOpenGLPolyDataMapper&); // Not implemented.
diff --git a/Rendering/OpenGL2/vtkOpenGLPolyDataMapper2D.cxx b/Rendering/OpenGL2/vtkOpenGLPolyDataMapper2D.cxx
index a079c68..c705411 100644
--- a/Rendering/OpenGL2/vtkOpenGLPolyDataMapper2D.cxx
+++ b/Rendering/OpenGL2/vtkOpenGLPolyDataMapper2D.cxx
@@ -14,7 +14,7 @@
 =========================================================================*/
 #include "vtkOpenGLPolyDataMapper2D.h"
 
-#include "vtkOpenGLHelper.h"
+#include "vtkglVBOHelper.h"
 
 #include "vtkActor2D.h"
 #include "vtkCellArray.h"
@@ -22,29 +22,23 @@
 #include "vtkMath.h"
 #include "vtkMatrix4x4.h"
 #include "vtkObjectFactory.h"
-#include "vtkOpenGLBufferObject.h"
 #include "vtkOpenGLError.h"
-#include "vtkOpenGLIndexBufferObject.h"
-#include "vtkOpenGLPolyDataMapper.h"
 #include "vtkOpenGLRenderer.h"
 #include "vtkOpenGLRenderWindow.h"
 #include "vtkOpenGLShaderCache.h"
 #include "vtkOpenGLTexture.h"
-#include "vtkOpenGLVertexArrayObject.h"
-#include "vtkOpenGLVertexBufferObject.h"
 #include "vtkPointData.h"
 #include "vtkPolyData.h"
 #include "vtkProperty2D.h"
-#include "vtkProperty.h"
+#include "vtkShader.h"
 #include "vtkShaderProgram.h"
-#include "vtkTextureObject.h"
 #include "vtkUnsignedCharArray.h"
 #include "vtkViewport.h"
 
 // Bring in our shader symbols.
-#include "vtkPolyData2DVS.h"
-#include "vtkPolyData2DFS.h"
-#include "vtkPolyDataWideLineGS.h"
+#include "vtkglPolyData2DVS.h"
+#include "vtkglPolyData2DFS.h"
+
 
 vtkStandardNewMacro(vtkOpenGLPolyDataMapper2D);
 
@@ -52,10 +46,6 @@ vtkStandardNewMacro(vtkOpenGLPolyDataMapper2D);
 vtkOpenGLPolyDataMapper2D::vtkOpenGLPolyDataMapper2D()
 {
   this->TransformedPoints = NULL;
-  this->CellScalarTexture = NULL;
-  this->CellScalarBuffer = NULL;
-  this->VBO = vtkOpenGLVertexBufferObject::New();
-  this->AppleBugPrimIDBuffer = 0;
 }
 
 //-----------------------------------------------------------------------------
@@ -65,54 +55,22 @@ vtkOpenGLPolyDataMapper2D::~vtkOpenGLPolyDataMapper2D()
     {
     this->TransformedPoints->UnRegister(this);
     }
-  if (this->CellScalarTexture)
-    { // Resources released previously.
-    this->CellScalarTexture->Delete();
-    this->CellScalarTexture = 0;
-    }
-  if (this->CellScalarBuffer)
-    { // Resources released previously.
-    this->CellScalarBuffer->Delete();
-    this->CellScalarBuffer = 0;
-    }
-  this->HaveCellScalars = false;
-  this->VBO->Delete();
-  this->VBO = 0;
-  if (this->AppleBugPrimIDBuffer)
-    {
-    this->AppleBugPrimIDBuffer->Delete();
-    }
-
 }
 
 //-----------------------------------------------------------------------------
 void vtkOpenGLPolyDataMapper2D::ReleaseGraphicsResources(vtkWindow* win)
 {
-  this->VBO->ReleaseGraphicsResources();
+  this->VBO.ReleaseGraphicsResources();
   this->Points.ReleaseGraphicsResources(win);
   this->Lines.ReleaseGraphicsResources(win);
   this->Tris.ReleaseGraphicsResources(win);
   this->TriStrips.ReleaseGraphicsResources(win);
- if (this->CellScalarTexture)
-    {
-    this->CellScalarTexture->ReleaseGraphicsResources(win);
-    }
-  if (this->CellScalarBuffer)
-    {
-    this->CellScalarBuffer->ReleaseGraphicsResources();
-    }
-  if (this->AppleBugPrimIDBuffer)
-    {
-    this->AppleBugPrimIDBuffer->ReleaseGraphicsResources();
-    }
-
   this->Modified();
 }
 
 //-----------------------------------------------------------------------------
-bool vtkOpenGLPolyDataMapper2D::GetNeedToRebuildShaders(
-  vtkOpenGLHelper &cellBO,
-  vtkViewport* vtkNotUsed(viewport), vtkActor2D *actor)
+bool vtkOpenGLPolyDataMapper2D::GetNeedToRebuildShader(vtkgl::CellBO &cellBO,
+      vtkViewport* vtkNotUsed(viewport), vtkActor2D *actor)
 {
   // has something changed that would require us to recreate the shader?
   // candidates are
@@ -131,244 +89,138 @@ bool vtkOpenGLPolyDataMapper2D::GetNeedToRebuildShaders(
 }
 
 //-----------------------------------------------------------------------------
-void vtkOpenGLPolyDataMapper2D::BuildShaders(
+void vtkOpenGLPolyDataMapper2D::BuildShader(
   std::string &VSSource, std::string &FSSource, std::string &GSSource,
-  vtkViewport* viewport, vtkActor2D *actor)
+  vtkViewport* vtkNotUsed(viewport), vtkActor2D *vtkNotUsed(actor))
 {
-  VSSource = vtkPolyData2DVS;
-  FSSource = vtkPolyData2DFS;
-  if (this->HaveWideLines(viewport, actor))
-    {
-    GSSource = vtkPolyDataWideLineGS;
-    }
-  else
-    {
-    GSSource.clear();
-    }
+  VSSource = vtkglPolyData2DVS;
+  FSSource = vtkglPolyData2DFS;
+  GSSource.clear();
 
   // Build our shader if necessary.
-  if (this->HaveCellScalars)
+  if (this->Colors && this->Colors->GetNumberOfComponents())
     {
-    vtkShaderProgram::Substitute(FSSource,
-        "//VTK::Color::Dec",
-        "uniform samplerBuffer textureC;");
-    vtkShaderProgram::Substitute(FSSource,
-        "//VTK::Color::Impl",
-        "gl_FragData[0] = texelFetchBuffer(textureC, gl_PrimitiveID + PrimitiveIDOffset);");
+    VSSource = vtkgl::replace(VSSource,
+                                 "//VTK::Color::Dec",
+                                 "attribute vec4 diffuseColor;");
     }
   else
     {
-    if (this->Colors &&
-        this->Colors->GetNumberOfComponents())
-      {
-      vtkShaderProgram::Substitute(VSSource,
-         "//VTK::Color::Dec",
-         "attribute vec4 diffuseColor;\n"
-         "varying vec4 fcolorVSOutput;");
-      vtkShaderProgram::Substitute(VSSource,
-          "//VTK::Color::Impl",
-          "fcolorVSOutput = diffuseColor;");
-      vtkShaderProgram::Substitute(GSSource,
-        "//VTK::Color::Dec",
-        "in vec4 fcolorVSOutput[];\n"
-        "out vec4 fcolorGSOutput;");
-      vtkShaderProgram::Substitute(GSSource,
-        "//VTK::Color::Impl",
-        "fcolorGSOutput = fcolorVSOutput[i];");
-      vtkShaderProgram::Substitute(FSSource,
-          "//VTK::Color::Dec",
-          "varying vec4 fcolorVSOutput;");
-      vtkShaderProgram::Substitute(FSSource,
-          "//VTK::Color::Impl",
-          "gl_FragData[0] = fcolorVSOutput;");
-      }
-    else
-      {
-      vtkShaderProgram::Substitute(FSSource,
-          "//VTK::Color::Dec",
-          "uniform vec4 diffuseColor;");
-      vtkShaderProgram::Substitute(FSSource,
-          "//VTK::Color::Impl",
-          "gl_FragData[0] = diffuseColor;");
-      }
+    VSSource = vtkgl::replace(VSSource,
+                                 "//VTK::Color::Dec",
+                                 "uniform vec4 diffuseColor;");
     }
-
-  if (this->VBO->TCoordComponents)
+  if (this->Layout.TCoordComponents)
     {
-    if (this->VBO->TCoordComponents == 1)
+    if (this->Layout.TCoordComponents == 1)
       {
-      vtkShaderProgram::Substitute(VSSource,
-        "//VTK::TCoord::Dec",
-        "attribute float tcoordMC; varying float tcoordVCVSOutput;");
-      vtkShaderProgram::Substitute(VSSource,
-        "//VTK::TCoord::Impl",
-        "tcoordVCVSOutput = tcoordMC;");
-      vtkShaderProgram::Substitute(GSSource,
-        "//VTK::TCoord::Dec",
-        "in float tcoordVCVSOutput[];\n"
-        "out float tcoordVCGSOutput;");
-      vtkShaderProgram::Substitute(GSSource,
-        "//VTK::TCoord::Impl",
-        "tcoordVCGSOutput = tcoordVCVSOutput[i];");
-      vtkShaderProgram::Substitute(FSSource,
-        "//VTK::TCoord::Dec",
-        "varying float tcoordVCVSOutput; uniform sampler2D texture1;");
-      vtkShaderProgram::Substitute(FSSource,
-        "//VTK::TCoord::Impl",
-        "gl_FragData[0] = gl_FragData[0]*texture2D(texture1, vec2(tcoordVCVSOutput,0));");
+      VSSource = vtkgl::replace(VSSource,
+                                   "//VTK::TCoord::Dec",
+                                   "attribute float tcoordMC; varying float tcoordVC;");
+      VSSource = vtkgl::replace(VSSource,
+                                   "//VTK::TCoord::Impl",
+                                   "tcoordVC = tcoordMC;");
+      FSSource = vtkgl::replace(FSSource,
+                                   "//VTK::TCoord::Dec",
+                                   "varying float tcoordVC; uniform sampler2D texture1;");
+      FSSource = vtkgl::replace(FSSource,
+                                   "//VTK::TCoord::Impl",
+                                   "gl_FragColor = gl_FragColor*texture2D(texture1, vec2(tcoordVC,0));");
       }
     else
       {
-      vtkShaderProgram::Substitute(VSSource,
-        "//VTK::TCoord::Dec",
-        "attribute vec2 tcoordMC; varying vec2 tcoordVCVSOutput;");
-      vtkShaderProgram::Substitute(VSSource,
-        "//VTK::TCoord::Impl",
-        "tcoordVCVSOutput = tcoordMC;");
-      vtkShaderProgram::Substitute(GSSource,
-        "//VTK::TCoord::Dec",
-        "in vec2 tcoordVCVSOutput[];\n"
-        "out vec2 tcoordVCGSOutput;");
-      vtkShaderProgram::Substitute(GSSource,
-        "//VTK::TCoord::Impl",
-        "tcoordVCGSOutput = tcoordVCVSOutput[i];");
-      vtkShaderProgram::Substitute(FSSource,
-        "//VTK::TCoord::Dec",
-        "varying vec2 tcoordVCVSOutput; uniform sampler2D texture1;");
-      vtkShaderProgram::Substitute(FSSource,
-        "//VTK::TCoord::Impl",
-        "gl_FragData[0] = gl_FragData[0]*texture2D(texture1, tcoordVCVSOutput.st);");
-      }
-    }
-
-  // are we handling the apple bug?
-  if (this->AppleBugPrimIDs.size())
-    {
-    vtkShaderProgram::Substitute(VSSource,"//VTK::PrimID::Dec",
-      "attribute vec4 appleBugPrimID;\n"
-      "varying vec4 applePrimIDVSOutput;");
-    vtkShaderProgram::Substitute(VSSource,"//VTK::PrimID::Impl",
-      "applePrimIDVSOutput = appleBugPrimID;");
-    vtkShaderProgram::Substitute(GSSource,
-      "//VTK::PrimID::Dec",
-      "in  vec4 applePrimIDVSOutput[];\n"
-      "out vec4 applePrimIDGSOutput;");
-    vtkShaderProgram::Substitute(GSSource,
-      "//VTK::PrimID::Impl",
-      "applePrimIDGSOutput = applePrimIDVSOutput[i];");
-    vtkShaderProgram::Substitute(FSSource,"//VTK::PrimID::Dec",
-      "varying vec4 applePrimIDVSOutput;");
-     vtkShaderProgram::Substitute(FSSource,"//VTK::PrimID::Impl",
-       "int vtkPrimID = int(applePrimIDVSOutput[0]*255.1) + int(applePrimIDVSOutput[1]*255.1)*256 + int(applePrimIDVSOutput[2]*255.1)*65536;");
-    vtkShaderProgram::Substitute(FSSource,"gl_PrimitiveID","vtkPrimID");
-    }
-  else
-    {
-    if (this->HaveCellScalars)
-      {
-      vtkShaderProgram::Substitute(GSSource,
-        "//VTK::PrimID::Impl",
-        "gl_PrimitiveID = gl_PrimitiveIDIn;");
+      VSSource = vtkgl::replace(VSSource,
+                                   "//VTK::TCoord::Dec",
+                                   "attribute vec2 tcoordMC; varying vec2 tcoordVC;");
+      VSSource = vtkgl::replace(VSSource,
+                                   "//VTK::TCoord::Impl",
+                                   "tcoordVC = tcoordMC;");
+      FSSource = vtkgl::replace(FSSource,
+                                   "//VTK::TCoord::Dec",
+                                   "varying vec2 tcoordVC; uniform sampler2D texture1;");
+      FSSource = vtkgl::replace(FSSource,
+                                   "//VTK::TCoord::Impl",
+                                   "gl_FragColor = gl_FragColor*texture2D(texture1, tcoordVC.st);");
       }
     }
 }
 
 //-----------------------------------------------------------------------------
-void vtkOpenGLPolyDataMapper2D::UpdateShaders(vtkOpenGLHelper &cellBO,
+void vtkOpenGLPolyDataMapper2D::UpdateShader(vtkgl::CellBO &cellBO,
     vtkViewport* viewport, vtkActor2D *actor)
 {
   vtkOpenGLRenderWindow *renWin = vtkOpenGLRenderWindow::SafeDownCast(viewport->GetVTKWindow());
 
-  cellBO.VAO->Bind();
-  this->LastBoundBO = &cellBO;
-
-  if (this->GetNeedToRebuildShaders(cellBO, viewport, actor))
+  if (this->GetNeedToRebuildShader(cellBO, viewport, actor))
     {
     std::string VSSource;
     std::string FSSource;
     std::string GSSource;
-    this->BuildShaders(VSSource,FSSource,GSSource,viewport,actor);
+    this->BuildShader(VSSource,FSSource,GSSource,viewport,actor);
     vtkShaderProgram *newShader =
-      renWin->GetShaderCache()->ReadyShaderProgram(
-        VSSource.c_str(),
-        FSSource.c_str(),
-        GSSource.c_str());
+      renWin->GetShaderCache()->ReadyShader(VSSource.c_str(),
+                                            FSSource.c_str(),
+                                            GSSource.c_str());
     cellBO.ShaderSourceTime.Modified();
     // if the shader changed reinitialize the VAO
     if (newShader != cellBO.Program)
       {
       cellBO.Program = newShader;
-      cellBO.VAO->ShaderProgramChanged(); // reset the VAO as the shader has changed
+      cellBO.vao.ShaderProgramChanged(); // reset the VAO as the shader has changed
       }
     }
   else
     {
-    renWin->GetShaderCache()->ReadyShaderProgram(cellBO.Program);
+    renWin->GetShaderCache()->ReadyShader(cellBO.Program);
     }
 
+
   this->SetMapperShaderParameters(cellBO, viewport, actor);
   this->SetPropertyShaderParameters(cellBO, viewport, actor);
   this->SetCameraShaderParameters(cellBO, viewport, actor);
+  cellBO.vao.Bind();
 }
 
 
 //-----------------------------------------------------------------------------
 void vtkOpenGLPolyDataMapper2D::SetMapperShaderParameters(
-  vtkOpenGLHelper &cellBO, vtkViewport *viewport, vtkActor2D *actor)
+  vtkgl::CellBO &cellBO, vtkViewport *vtkNotUsed(viewport), vtkActor2D *actor)
 {
   // Now to update the VAO too, if necessary.
-  if (this->VBOUpdateTime > cellBO.AttributeUpdateTime ||
-      cellBO.ShaderSourceTime > cellBO.AttributeUpdateTime)
-    {
-    cellBO.VAO->Bind();
-    if (!cellBO.VAO->AddAttributeArray(cellBO.Program, this->VBO,
-                                    "vertexWC", this->VBO->VertexOffset,
-                                    this->VBO->Stride, VTK_FLOAT, 3, false))
+  vtkgl::VBOLayout &layout = this->Layout;
+  if (this->VBOUpdateTime > cellBO.attributeUpdateTime ||
+      cellBO.ShaderSourceTime > cellBO.attributeUpdateTime)
+    {
+    cellBO.vao.Bind();
+    if (!cellBO.vao.AddAttributeArray(cellBO.Program, this->VBO,
+                                    "vertexWC", layout.VertexOffset,
+                                    layout.Stride, VTK_FLOAT, 3, false))
       {
       vtkErrorMacro(<< "Error setting 'vertexWC' in shader program.");
       }
-    if (this->VBO->TCoordComponents)
+    if (layout.TCoordComponents)
       {
-      if (!cellBO.VAO->AddAttributeArray(cellBO.Program, this->VBO,
-                                      "tcoordMC", this->VBO->TCoordOffset,
-                                      this->VBO->Stride, VTK_FLOAT, this->VBO->TCoordComponents, false))
+      if (!cellBO.vao.AddAttributeArray(cellBO.Program, this->VBO,
+                                      "tcoordMC", layout.TCoordOffset,
+                                      layout.Stride, VTK_FLOAT, layout.TCoordComponents, false))
         {
         vtkErrorMacro(<< "Error setting 'tcoordMC' in shader VAO.");
         }
       }
-    if (this->VBO->ColorComponents != 0)
+    if (layout.ColorComponents != 0)
       {
-      if (!cellBO.VAO->AddAttributeArray(cellBO.Program, this->VBO,
-                                      "diffuseColor", this->VBO->ColorOffset,
-                                      this->VBO->Stride, VTK_UNSIGNED_CHAR,
-                                      this->VBO->ColorComponents, true))
+      if (!cellBO.vao.AddAttributeArray(cellBO.Program, this->VBO,
+                                      "diffuseColor", layout.ColorOffset,
+                                      layout.Stride, VTK_UNSIGNED_CHAR,
+                                      layout.ColorComponents, true))
         {
         vtkErrorMacro(<< "Error setting 'diffuseColor' in shader program.");
         }
       }
-    if (this->AppleBugPrimIDs.size())
-      {
-      this->AppleBugPrimIDBuffer->Bind();
-      if (!cellBO.VAO->AddAttributeArray(cellBO.Program,
-          this->AppleBugPrimIDBuffer,
-          "appleBugPrimID",
-           0, sizeof(float), VTK_UNSIGNED_CHAR, 4, true))
-        {
-        vtkErrorMacro(<< "Error setting 'appleBugPrimID' in shader VAO.");
-        }
-      this->AppleBugPrimIDBuffer->Release();
-      }
-
-    cellBO.AttributeUpdateTime.Modified();
+    cellBO.attributeUpdateTime.Modified();
     }
 
-  if (this->HaveCellScalars)
-    {
-    int tunit = this->CellScalarTexture->GetTextureUnit();
-    cellBO.Program->SetUniformi("textureC", tunit);
-    }
-
-  if (this->VBO->TCoordComponents)
+  if (layout.TCoordComponents)
     {
     vtkInformation *info = actor->GetPropertyKeys();
     if (info && info->Has(vtkProp::GeneralTextureUnit()))
@@ -377,22 +229,11 @@ void vtkOpenGLPolyDataMapper2D::SetMapperShaderParameters(
       cellBO.Program->SetUniformi("texture1", tunit);
       }
     }
-
-  // handle wide lines
-  if (this->HaveWideLines(viewport,actor))
-    {
-      int vp[4];
-      glGetIntegerv(GL_VIEWPORT, vp);
-      float lineWidth[2];
-      lineWidth[0] = 2.0*actor->GetProperty()->GetLineWidth()/vp[2];
-      lineWidth[1] = 2.0*actor->GetProperty()->GetLineWidth()/vp[3];
-      cellBO.Program->SetUniform2f("lineWidthNVC",lineWidth);
-    }
 }
 
 //-----------------------------------------------------------------------------
 void vtkOpenGLPolyDataMapper2D::SetPropertyShaderParameters(
-  vtkOpenGLHelper &cellBO, vtkViewport*, vtkActor2D *actor)
+  vtkgl::CellBO &cellBO, vtkViewport*, vtkActor2D *actor)
 {
   if (!this->Colors || !this->Colors->GetNumberOfComponents())
     {
@@ -412,7 +253,7 @@ void vtkOpenGLPolyDataMapper2D::SetPropertyShaderParameters(
 
 //-----------------------------------------------------------------------------
 void vtkOpenGLPolyDataMapper2D::SetCameraShaderParameters(
-  vtkOpenGLHelper &cellBO, vtkViewport* viewport, vtkActor2D *actor)
+  vtkgl::CellBO &cellBO, vtkViewport* viewport, vtkActor2D *actor)
 {
   vtkShaderProgram *program = cellBO.Program;
 
@@ -509,20 +350,7 @@ void vtkOpenGLPolyDataMapper2D::UpdateVBO(vtkActor2D *act, vtkViewport *viewport
     return;
     }
 
-  // check if this system is subject to the apple primID bug
-  this->HaveAppleBug = false;
-
-#ifdef __APPLE__
-  std::string vendor = (const char *)glGetString(GL_VENDOR);
-  if (vendor.find("ATI") != std::string::npos ||
-      vendor.find("AMD") != std::string::npos ||
-      vendor.find("amd") != std::string::npos)
-    {
-    this->HaveAppleBug = true;
-    }
-#endif
-
-  this->HaveCellScalars = false;
+  bool cellScalars = false;
   if (this->ScalarVisibility)
     {
     // We must figure out how the scalars should be mapped to the polydata.
@@ -534,84 +362,22 @@ void vtkOpenGLPolyDataMapper2D::UpdateVBO(vtkActor2D *act, vtkViewport *viewport
          && this->ScalarMode != VTK_SCALAR_MODE_USE_POINT_FIELD_DATA
          && this->Colors)
       {
-      this->HaveCellScalars = true;
-      }
-    }
-
-  // on apple with the AMD PrimID bug we use a slow
-  // painful approach to work around it
-  this->AppleBugPrimIDs.resize(0);
-  if (this->HaveAppleBug && this->HaveCellScalars)
-    {
-    if (!this->AppleBugPrimIDBuffer)
-      {
-      this->AppleBugPrimIDBuffer = vtkOpenGLBufferObject::New();
+      cellScalars = true;
       }
-    poly = vtkOpenGLPolyDataMapper::HandleAppleBug(poly,
-      this->AppleBugPrimIDs);
-    this->AppleBugPrimIDBuffer->Bind();
-    this->AppleBugPrimIDBuffer->Upload(
-     this->AppleBugPrimIDs, vtkOpenGLBufferObject::ArrayBuffer);
-    this->AppleBugPrimIDBuffer->Release();
-
-    vtkWarningMacro("VTK is working around a bug in Apple-AMD hardware related to gl_PrimitiveID.  This may cause significant memory and performance impacts. Your hardware has been identified as vendor "
-      << (const char *)glGetString(GL_VENDOR) << " with renderer of "
-      << (const char *)glGetString(GL_RENDERER));
     }
 
   // if we have cell scalars then we have to
-  // build the texture
+  // explode the data
   vtkCellArray *prims[4];
   prims[0] =  poly->GetVerts();
   prims[1] =  poly->GetLines();
   prims[2] =  poly->GetPolys();
   prims[3] =  poly->GetStrips();
-  std::vector<unsigned int> cellCellMap;
-  vtkDataArray *c = this->Colors;
-  if (this->HaveCellScalars)
+  std::vector<unsigned int> cellPointMap;
+  std::vector<unsigned int> pointCellMap;
+  if (cellScalars)
     {
-    if (this->HaveAppleBug)
-      {
-      unsigned int numCells = poly->GetNumberOfCells();
-      for (unsigned int i = 0; i < numCells; i++)
-        {
-        cellCellMap.push_back(i);
-        }
-      }
-    else
-      {
-      vtkOpenGLIndexBufferObject::CreateCellSupportArrays(
-        prims, cellCellMap, VTK_SURFACE);
-      }
-
-    if (!this->CellScalarTexture)
-      {
-      this->CellScalarTexture = vtkTextureObject::New();
-      this->CellScalarBuffer = vtkOpenGLBufferObject::New();
-      this->CellScalarBuffer->SetType(vtkOpenGLBufferObject::TextureBuffer);
-      }
-    this->CellScalarTexture->SetContext(
-      static_cast<vtkOpenGLRenderWindow*>(viewport->GetVTKWindow()));
-    // create the cell scalar array adjusted for ogl Cells
-    std::vector<unsigned char> newColors;
-    unsigned char *colorPtr = this->Colors->GetPointer(0);
-    int numComp = this->Colors->GetNumberOfComponents();
-    assert(numComp == 4);
-    for (unsigned int i = 0; i < cellCellMap.size(); i++)
-      {
-      for (j = 0; j < numComp; j++)
-        {
-        newColors.push_back(colorPtr[cellCellMap[i]*numComp + j]);
-        }
-      }
-    this->CellScalarBuffer->Upload(newColors,
-      vtkOpenGLBufferObject::ArrayBuffer);
-    this->CellScalarTexture->CreateTextureBuffer(
-      static_cast<unsigned int>(cellCellMap.size()),
-      numComp,
-      VTK_UNSIGNED_CHAR,
-      this->CellScalarBuffer);
-    c = NULL;
+    vtkgl::CreateCellSupportArrays(poly, prims, cellPointMap, pointCellMap);
     }
 
   // do we have texture maps?
@@ -651,47 +417,44 @@ void vtkOpenGLPolyDataMapper2D::UpdateVBO(vtkActor2D *act, vtkViewport *viewport
 
   // Iterate through all of the different types in the polydata, building VBOs
   // and IBOs as appropriate for each type.
-  this->VBO->CreateVBO(p,
-    poly->GetPoints()->GetNumberOfPoints(),
-    NULL,
-    haveTextures ? poly->GetPointData()->GetTCoords() : NULL,
-    c ? (unsigned char *) c->GetVoidPointer(0) : NULL,
-    c ? c->GetNumberOfComponents() : 0);
-
-  this->Points.IBO->IndexCount =
-    this->Points.IBO->CreatePointIndexBuffer(prims[0]);
-  this->Lines.IBO->IndexCount =
-    this->Lines.IBO->CreateLineIndexBuffer(prims[1]);
-  this->Tris.IBO->IndexCount =
-    this->Tris.IBO->CreateTriangleIndexBuffer(prims[2], poly->GetPoints());
-  this->TriStrips.IBO->IndexCount =
-    this->TriStrips.IBO->CreateStripIndexBuffer(prims[3], false);
-
-  // free up polydata if allocated due to apple bug
-  if (poly != this->GetInput())
-    {
-    poly->Delete();
+  this->Layout =
+    CreateVBO(p,
+              cellPointMap.size() > 0 ? (unsigned int)cellPointMap.size() : poly->GetPoints()->GetNumberOfPoints(),
+              NULL,
+              haveTextures ? poly->GetPointData()->GetTCoords() : NULL,
+              this->Colors ? (unsigned char *)this->Colors->GetVoidPointer(0) : NULL,
+              this->Colors ? this->Colors->GetNumberOfComponents() : 0,
+              this->VBO,
+              cellPointMap.size() > 0 ? &cellPointMap.front() : NULL,
+              pointCellMap.size() > 0 ? &pointCellMap.front() : NULL,
+              cellScalars, false);
+
+
+  this->Points.indexCount = CreatePointIndexBuffer(prims[0],
+                                                    this->Points.ibo);
+  this->Lines.indexCount = CreateMultiIndexBuffer(prims[1],
+                         this->Lines.ibo,
+                         this->Lines.offsetArray,
+                         this->Lines.elementsArray, false);
+  this->Tris.indexCount = CreateTriangleIndexBuffer(prims[2],
+                                                    this->Tris.ibo,
+                                                    poly->GetPoints(),
+                                                    cellPointMap);
+  this->TriStrips.indexCount = CreateMultiIndexBuffer(prims[3],
+                         this->TriStrips.ibo,
+                         this->TriStrips.offsetArray,
+                         this->TriStrips.elementsArray, false);
+
+  // free up new cell arrays
+  if (cellScalars)
+    {
+    for (int primType = 0; primType < 4; primType++)
+      {
+      prims[primType]->UnRegister(this);
+      }
     }
 }
 
-bool vtkOpenGLPolyDataMapper2D::HaveWideLines(
-  vtkViewport *ren,
-  vtkActor2D *actor)
-{
-  if (this->LastBoundBO == &this->Lines
-      && actor->GetProperty()->GetLineWidth() > 1.0
-      && vtkOpenGLRenderWindow::GetContextSupportsOpenGL32())
-    {
-    // we have wide lines, but the OpenGL implementation may
-    // actually support them, check the range to see if we
-      // really need have to implement our own wide lines
-    vtkOpenGLRenderWindow *renWin =
-      vtkOpenGLRenderWindow::SafeDownCast(ren->GetVTKWindow());
-    return !(renWin &&
-      renWin->GetMaximumHardwareLineWidth() >= actor->GetProperty()->GetLineWidth());
-    }
-  return false;
-}
 
 void vtkOpenGLPolyDataMapper2D::RenderOverlay(vtkViewport* viewport,
                                               vtkActor2D* actor)
@@ -737,96 +500,65 @@ void vtkOpenGLPolyDataMapper2D::RenderOverlay(vtkViewport* viewport,
     this->VBOUpdateTime.Modified();
     }
 
-  this->VBO->Bind();
-  this->LastBoundBO = NULL;
-
-  if (this->HaveCellScalars)
-    {
-    this->CellScalarTexture->Activate();
-    }
+  this->VBO.Bind();
+  vtkgl::VBOLayout &layout = this->Layout;
 
   // Figure out and build the appropriate shader for the mapped geometry.
-  this->PrimitiveIDOffset = 0;
+  this->UpdateShader(this->Points, viewport, actor);
 
-  if (this->Points.IBO->IndexCount)
+  if (this->Points.indexCount)
     {
-    this->UpdateShaders(this->Points, viewport, actor);
-    this->Points.Program->SetUniformi("PrimitiveIDOffset",
-      this->PrimitiveIDOffset);
     // Set the PointSize
 #if GL_ES_VERSION_2_0 != 1
     glPointSize(actor->GetProperty()->GetPointSize()); // not on ES2
 #endif
-    this->Points.IBO->Bind();
+    this->Points.ibo.Bind();
     glDrawRangeElements(GL_POINTS, 0,
-                        static_cast<GLuint>(this->VBO->VertexCount - 1),
-                        static_cast<GLsizei>(this->Points.IBO->IndexCount),
+                        static_cast<GLuint>(layout.VertexCount - 1),
+                        static_cast<GLsizei>(this->Points.indexCount),
                         GL_UNSIGNED_INT,
                         reinterpret_cast<const GLvoid *>(NULL));
-    this->Points.IBO->Release();
-    this->PrimitiveIDOffset += (int)this->Points.IBO->IndexCount;
+    this->Points.ibo.Release();
     }
 
-  if (this->Lines.IBO->IndexCount)
+  if (this->Lines.indexCount)
     {
     // Set the LineWidth
-    this->UpdateShaders(this->Lines, viewport, actor);
-    this->Lines.Program->SetUniformi("PrimitiveIDOffset",
-      this->PrimitiveIDOffset);
-    if (!this->HaveWideLines(viewport,actor))
-      {
-      glLineWidth(actor->GetProperty()->GetLineWidth());
-      }
-    this->Lines.IBO->Bind();
-    glDrawRangeElements(GL_LINES, 0,
-                        static_cast<GLuint>(this->VBO->VertexCount - 1),
-                        static_cast<GLsizei>(this->Lines.IBO->IndexCount),
-                        GL_UNSIGNED_INT,
-                        reinterpret_cast<const GLvoid *>(NULL));
-    this->Lines.IBO->Release();
-    this->PrimitiveIDOffset += (int)this->Lines.IBO->IndexCount/2;
+    glLineWidth(actor->GetProperty()->GetLineWidth()); // supported by all OpenGL versions
+    this->Lines.ibo.Bind();
+    glMultiDrawElements(GL_LINE_STRIP,
+                      (GLsizei *)(&this->Lines.elementsArray[0]),
+                      GL_UNSIGNED_INT,
+                      reinterpret_cast<const GLvoid **>(&(this->Lines.offsetArray[0])),
+                      (GLsizei)this->Lines.offsetArray.size());
+    this->Lines.ibo.Release();
     }
 
   // now handle lit primatives
-  if (this->Tris.IBO->IndexCount)
+  if (this->Tris.indexCount)
     {
-    this->UpdateShaders(this->Points, viewport, actor);
-    this->Points.Program->SetUniformi("PrimitiveIDOffset",
-      this->PrimitiveIDOffset);
-    this->Tris.IBO->Bind();
+    this->Tris.ibo.Bind();
     glDrawRangeElements(GL_TRIANGLES, 0,
-                        static_cast<GLuint>(this->VBO->VertexCount - 1),
-                        static_cast<GLsizei>(this->Tris.IBO->IndexCount),
+                        static_cast<GLuint>(layout.VertexCount - 1),
+                        static_cast<GLsizei>(this->Tris.indexCount),
                         GL_UNSIGNED_INT,
                         reinterpret_cast<const GLvoid *>(NULL));
-    this->Tris.IBO->Release();
-    this->PrimitiveIDOffset += (int)this->Tris.IBO->IndexCount/3;
+    this->Tris.ibo.Release();
     }
 
-  if (this->TriStrips.IBO->IndexCount)
+  if (this->TriStrips.indexCount)
     {
-    this->UpdateShaders(this->Points, viewport, actor);
-    this->Points.Program->SetUniformi("PrimitiveIDOffset",
-      this->PrimitiveIDOffset);
-    this->TriStrips.IBO->Bind();
-    glDrawRangeElements(GL_TRIANGLES, 0,
-                        static_cast<GLuint>(this->VBO->VertexCount - 1),
-                        static_cast<GLsizei>(this->TriStrips.IBO->IndexCount),
-                        GL_UNSIGNED_INT,
-                        reinterpret_cast<const GLvoid *>(NULL));
-    this->TriStrips.IBO->Release();
+    this->TriStrips.ibo.Bind();
+    glMultiDrawElements(GL_TRIANGLE_STRIP,
+                      (GLsizei *)(&this->TriStrips.elementsArray[0]),
+                      GL_UNSIGNED_INT,
+                      reinterpret_cast<const GLvoid **>(&(this->TriStrips.offsetArray[0])),
+                      (GLsizei)this->TriStrips.offsetArray.size());
+    this->TriStrips.ibo.Release();
     }
 
-  if (this->HaveCellScalars)
-    {
-    this->CellScalarTexture->Deactivate();
-    }
-
-  if (this->LastBoundBO)
-    {
-    this->LastBoundBO->VAO->Release();
-    }
-  this->VBO->Release();
+  this->Points.vao.Release();
+  this->VBO.Release();
 
   vtkOpenGLCheckErrorMacro("failed after RenderOverlay");
 }
diff --git a/Rendering/OpenGL2/vtkOpenGLPolyDataMapper2D.h b/Rendering/OpenGL2/vtkOpenGLPolyDataMapper2D.h
index 2e62fd8..1b13811 100644
--- a/Rendering/OpenGL2/vtkOpenGLPolyDataMapper2D.h
+++ b/Rendering/OpenGL2/vtkOpenGLPolyDataMapper2D.h
@@ -26,16 +26,12 @@
 
 #include "vtkRenderingOpenGL2Module.h" // For export macro
 #include "vtkPolyDataMapper2D.h"
-#include "vtkOpenGLHelper.h" // used for ivars
-#include <string> // For API.
-#include <vector> //for ivars
+#include "vtkglVBOHelper.h" // used for ivars
 
-class vtkOpenGLBufferObject;
-class vtkOpenGLHelper;
-class vtkOpenGLVertexBufferObject;
-class vtkPoints;
 class vtkRenderer;
-class vtkTextureObject;
+class vtkPoints;
+
+namespace vtkgl {class CellBO; }
 
 class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLPolyDataMapper2D : public vtkPolyDataMapper2D
 {
@@ -58,69 +54,51 @@ protected:
   vtkOpenGLPolyDataMapper2D();
   ~vtkOpenGLPolyDataMapper2D();
 
-  // the following is all extra stuff to work around the
-  // fact that gl_PrimitiveID does not work correctly on
-  // Apple devices with AMD graphics hardware. See apple
-  // bug ID 20747550
-  bool HaveAppleBug;
-  std::vector<float> AppleBugPrimIDs;
-  vtkOpenGLBufferObject *AppleBugPrimIDBuffer;
-
   // Description:
   // Does the shader source need to be recomputed
-  virtual bool GetNeedToRebuildShaders(
-    vtkOpenGLHelper &cellBO, vtkViewport *ren, vtkActor2D *act);
+  virtual bool GetNeedToRebuildShader(vtkgl::CellBO &cellBO, vtkViewport *ren, vtkActor2D *act);
 
   // Description:
   // Build the shader source code
-  virtual void BuildShaders(std::string &VertexCode,
+  virtual void BuildShader(std::string &VertexCode,
                            std::string &fragmentCode,
                            std::string &geometryCode,
                            vtkViewport *ren, vtkActor2D *act);
 
   // Description:
   // Determine what shader to use and compile/link it
-  virtual void UpdateShaders(vtkOpenGLHelper &cellBO,
-    vtkViewport *viewport, vtkActor2D *act);
+  virtual void UpdateShader(vtkgl::CellBO &cellBO, vtkViewport *viewport, vtkActor2D *act);
 
   // Description:
   // Set the shader parameteres related to the mapper/input data, called by UpdateShader
-  virtual void SetMapperShaderParameters(vtkOpenGLHelper &cellBO, vtkViewport *ren, vtkActor2D *act);
+  virtual void SetMapperShaderParameters(vtkgl::CellBO &cellBO, vtkViewport *ren, vtkActor2D *act);
 
 
     // Description:
   // Set the shader parameteres related to the Camera
-  void SetCameraShaderParameters(vtkOpenGLHelper &cellBO, vtkViewport *viewport, vtkActor2D *act);
+  void SetCameraShaderParameters(vtkgl::CellBO &cellBO, vtkViewport *viewport, vtkActor2D *act);
 
   // Description:
   // Set the shader parameteres related to the property
-  void SetPropertyShaderParameters(vtkOpenGLHelper &cellBO, vtkViewport *viewport, vtkActor2D *act);
+  void SetPropertyShaderParameters(vtkgl::CellBO &cellBO, vtkViewport *viewport, vtkActor2D *act);
 
   // Description:
   // Update the scene when necessary.
   void UpdateVBO(vtkActor2D *act, vtkViewport *viewport);
 
   // The VBO and its layout.
-  vtkOpenGLVertexBufferObject *VBO;
+  vtkgl::BufferObject VBO;
+  vtkgl::VBOLayout Layout;
 
   // Structures for the various cell types we render.
-  vtkOpenGLHelper Points;
-  vtkOpenGLHelper Lines;
-  vtkOpenGLHelper Tris;
-  vtkOpenGLHelper TriStrips;
-  vtkOpenGLHelper *LastBoundBO;
-
-  vtkTextureObject *CellScalarTexture;
-  vtkOpenGLBufferObject *CellScalarBuffer;
-  bool HaveCellScalars;
-  int PrimitiveIDOffset;
+  vtkgl::CellBO Points;
+  vtkgl::CellBO Lines;
+  vtkgl::CellBO Tris;
+  vtkgl::CellBO TriStrips;
 
   vtkTimeStamp VBOUpdateTime; // When was the VBO updated?
   vtkPoints *TransformedPoints;
 
-  // do we have wide lines that require special handling
-  virtual bool HaveWideLines(vtkViewport *, vtkActor2D *);
-
 private:
   vtkOpenGLPolyDataMapper2D(const vtkOpenGLPolyDataMapper2D&);  // Not implemented.
   void operator=(const vtkOpenGLPolyDataMapper2D&);  // Not implemented.
diff --git a/Rendering/OpenGL2/vtkOpenGLProperty.cxx b/Rendering/OpenGL2/vtkOpenGLProperty.cxx
index 76da4dd..d8f2b36 100644
--- a/Rendering/OpenGL2/vtkOpenGLProperty.cxx
+++ b/Rendering/OpenGL2/vtkOpenGLProperty.cxx
@@ -15,7 +15,7 @@
 #include "vtkOpenGLRenderer.h"
 #include "vtkOpenGLProperty.h"
 
-#include "vtkOpenGLHelper.h"
+#include "vtkglVBOHelper.h"
 
 #include "vtkObjectFactory.h"
 #include "vtkOpenGLTexture.h"
diff --git a/Rendering/OpenGL2/vtkOpenGLRenderUtilities.cxx b/Rendering/OpenGL2/vtkOpenGLRenderUtilities.cxx
deleted file mode 100644
index feccf21..0000000
--- a/Rendering/OpenGL2/vtkOpenGLRenderUtilities.cxx
+++ /dev/null
@@ -1,100 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkOpenGLRenderUtilities.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 "vtk_glew.h"
-#include "vtkOpenGLRenderUtilities.h"
-
-#include "vtkNew.h"
-#include "vtkOpenGLBufferObject.h"
-#include "vtkOpenGLVertexArrayObject.h"
-
-// ----------------------------------------------------------------------------
-vtkOpenGLRenderUtilities::vtkOpenGLRenderUtilities()
-{
-}
-
-// ----------------------------------------------------------------------------
-vtkOpenGLRenderUtilities::~vtkOpenGLRenderUtilities()
-{
-}
-
-void vtkOpenGLRenderUtilities::PrintSelf(ostream& os, vtkIndent indent)
-{
-  this->Superclass::PrintSelf(os,indent);
-}
-
-// ---------------------------------------------------------------------------
-// a program must be bound
-// a VAO must be bound
-void vtkOpenGLRenderUtilities::RenderQuad(
-  float *verts,
-  float *tcoords,
-  vtkShaderProgram *program, vtkOpenGLVertexArrayObject *vao)
-{
-  GLuint iboData[] = {0, 1, 2, 0, 2, 3};
-  vtkOpenGLRenderUtilities::RenderTriangles(verts, 4,
-    iboData, 6,
-    tcoords,
-    program, vao);
-}
-
-// ---------------------------------------------------------------------------
-// a program must be bound
-// a VAO must be bound
-void vtkOpenGLRenderUtilities::RenderTriangles(
-  float *verts, unsigned int numVerts,
-  GLuint *iboData, unsigned int numIndices,
-  float *tcoords,
-  vtkShaderProgram *program, vtkOpenGLVertexArrayObject *vao)
-{
-  if (!program || !vao || !verts)
-    {
-    vtkGenericWarningMacro(<< "Error must have verts, program and vao");
-    }
-
-  vtkNew<vtkOpenGLBufferObject> vbo;
-  vbo->Upload(verts, numVerts*3, vtkOpenGLBufferObject::ArrayBuffer);
-  vao->Bind();
-  if (!vao->AddAttributeArray(program, vbo.Get(), "vertexMC", 0,
-      sizeof(float)*3, VTK_FLOAT, 3, false))
-    {
-    vtkGenericWarningMacro(<< "Error setting 'vertexMC' in shader VAO.");
-    }
-
-  vtkNew<vtkOpenGLBufferObject> tvbo;
-  if (tcoords)
-    {
-    tvbo->Upload(tcoords, numVerts*2, vtkOpenGLBufferObject::ArrayBuffer);
-    if (!vao->AddAttributeArray(program, tvbo.Get(), "tcoordMC", 0,
-        sizeof(float)*2, VTK_FLOAT, 2, false))
-      {
-      vtkGenericWarningMacro(<< "Error setting 'tcoordMC' in shader VAO.");
-      }
-    }
-
-  vtkNew<vtkOpenGLBufferObject> ibo;
-  vao->Bind();
-  ibo->Upload(iboData, numIndices, vtkOpenGLBufferObject::ElementArrayBuffer);
-  glDrawElements(GL_TRIANGLES, numIndices, GL_UNSIGNED_INT,
-    reinterpret_cast<const GLvoid *>(NULL));
-  ibo->Release();
-  vao->RemoveAttributeArray("vertexMC");
-  vao->RemoveAttributeArray("tcoordMC");
-  vao->Release();
-  vbo->Release();
-  if (tcoords)
-    {
-    tvbo->Release();
-    }
-}
diff --git a/Rendering/OpenGL2/vtkOpenGLRenderUtilities.h b/Rendering/OpenGL2/vtkOpenGLRenderUtilities.h
deleted file mode 100644
index 9af4690..0000000
--- a/Rendering/OpenGL2/vtkOpenGLRenderUtilities.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkOpenGLRenderUtilities.h
-
-  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.
-
-=========================================================================*/
-// .NAME vtkOpenGLRenderUtilities - OpenGL rendering utility functions
-// .SECTION Description
-// vtkOpenGLRenderUtilities provides functions to help render primitives.
-
-#ifndef vtkOpenGLRenderUtilities_h
-#define vtkOpenGLRenderUtilities_h
-
-#include "vtkRenderingOpenGL2Module.h" // For export macro
-#include "vtkObject.h"
-
-#include "vtk_glew.h" // Needed for GLuint.
-
-class vtkOpenGLVertexArrayObject;
-class vtkShaderProgram;
-
-class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLRenderUtilities : public vtkObject
-{
-public:
-  vtkTypeMacro(vtkOpenGLRenderUtilities, vtkObject);
-  void PrintSelf(ostream& os, vtkIndent indent);
-
-  // Description:
-  // Helper function that draws a quad on the screen
-  // at the specified vertex coordinates and if
-  // tcoords are not NULL with the specified
-  // texture coordinates.
-  static void RenderQuad(
-    float *verts, float *tcoords,
-    vtkShaderProgram *program, vtkOpenGLVertexArrayObject *vao);
-  static void RenderTriangles(
-    float *verts, unsigned int numVerts,
-    GLuint *indices, unsigned int numIndices,
-    float *tcoords,
-    vtkShaderProgram *program, vtkOpenGLVertexArrayObject *vao);
-
-protected:
-  vtkOpenGLRenderUtilities();
-  ~vtkOpenGLRenderUtilities();
-
-private:
-  vtkOpenGLRenderUtilities(const vtkOpenGLRenderUtilities&);  // Not implemented.
-  void operator=(const vtkOpenGLRenderUtilities&);  // Not implemented.
-};
-
-#endif
diff --git a/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx b/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx
index 5f0bd94..c255f55 100644
--- a/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx
+++ b/Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx
@@ -15,27 +15,24 @@
 #include "vtk_glew.h"
 #include "vtkOpenGLRenderWindow.h"
 
-#include "vtkOpenGLHelper.h"
+#include "vtkglVBOHelper.h"
 
 #include <cassert>
-
 #include "vtkFloatArray.h"
 #include "vtkNew.h"
 #include "vtkObjectFactory.h"
 #include "vtkOpenGLActor.h"
-#include "vtkOpenGLBufferObject.h"
 #include "vtkOpenGLCamera.h"
-#include "vtkOpenGLError.h"
 #include "vtkOpenGLLight.h"
 #include "vtkOpenGLProperty.h"
 #include "vtkOpenGLRenderer.h"
+#include "vtkOpenGLError.h"
+#include "vtkUnsignedCharArray.h"
 #include "vtkOpenGLShaderCache.h"
-#include "vtkOpenGLVertexArrayObject.h"
-#include "vtkRendererCollection.h"
 #include "vtkStdString.h"
 #include "vtkTextureObject.h"
 #include "vtkTextureUnitManager.h"
-#include "vtkUnsignedCharArray.h"
+#include "vtkRendererCollection.h"
 
 #include <sstream>
 using std::ostringstream;
@@ -92,30 +89,29 @@ vtkOpenGLRenderWindow::vtkOpenGLRenderWindow()
 
   this->ShaderCache = vtkOpenGLShaderCache::New();
 
-  this->TextureUnitManager = 0;
+  this->TextureUnitManager=0;
 
   this->MultiSamples = vtkOpenGLRenderWindowGlobalMaximumNumberOfMultiSamples;
   delete [] this->WindowName;
   this->WindowName = new char[strlen("Visualization Toolkit - OpenGL")+1];
   strcpy( this->WindowName, "Visualization Toolkit - OpenGL" );
 
-  this->OffScreenUseFrameBuffer = 0;
+  this->OffScreenUseFrameBuffer=0;
 
-  this->BackLeftBuffer = static_cast<unsigned int>(GL_BACK_LEFT);
-  this->BackRightBuffer = static_cast<unsigned int>(GL_BACK_RIGHT);
-  this->FrontLeftBuffer = static_cast<unsigned int>(GL_FRONT_LEFT);
-  this->FrontRightBuffer = static_cast<unsigned int>(GL_FRONT_RIGHT);
-  this->BackBuffer = static_cast<unsigned int>(GL_BACK);
-  this->FrontBuffer = static_cast<unsigned int>(GL_FRONT);
+  this->BackLeftBuffer=static_cast<unsigned int>(GL_BACK_LEFT);
+  this->BackRightBuffer=static_cast<unsigned int>(GL_BACK_RIGHT);
+  this->FrontLeftBuffer=static_cast<unsigned int>(GL_FRONT_LEFT);
+  this->FrontRightBuffer=static_cast<unsigned int>(GL_FRONT_RIGHT);
+  this->BackBuffer=static_cast<unsigned int>(GL_BACK);
+  this->FrontBuffer=static_cast<unsigned int>(GL_FRONT);
 
   #ifndef VTK_LEGACY_REMOVE
-  this->LastGraphicError = static_cast<unsigned int>(GL_NO_ERROR);
+  this->LastGraphicError=static_cast<unsigned int>(GL_NO_ERROR);
   #endif
 
   this->DrawPixelsTextureObject = NULL;
 
-  this->OwnContext = 1;
-  this->MaximumHardwareLineWidth = 1.0;
+  this->OwnContext=1;
 }
 
 // free up memory & close the window
@@ -134,13 +130,9 @@ vtkOpenGLRenderWindow::~vtkOpenGLRenderWindow()
     }
 
   this->SetTextureUnitManager(0);
-
-  this->GLStateIntegers.clear();
-
   this->ShaderCache->UnRegister(this);
 }
 
-// ----------------------------------------------------------------------------
 void vtkOpenGLRenderWindow::ReleaseGraphicsResources()
 {
   vtkCollectionSimpleIterator rsit;
@@ -171,9 +163,9 @@ void vtkOpenGLRenderWindow::ReleaseGraphicsResources()
       vtkErrorMacro("Leaked for texture object: " << const_cast<vtkTextureObject *>(found->first));
       }
     }
-  this->Initialized = false;
 }
 
+
 // ----------------------------------------------------------------------------
 unsigned long vtkOpenGLRenderWindow::GetContextCreationTime()
 {
@@ -350,10 +342,30 @@ void vtkOpenGLRenderWindow::OpenGLInitState()
   glEnable( GL_DEPTH_TEST );
 
   // initialize blending for transparency
-  glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA,
-                      GL_ONE,GL_ONE_MINUS_SRC_ALPHA);
+  if(glBlendFuncSeparate != 0)
+    {
+    glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA,
+                             GL_ONE,GL_ONE_MINUS_SRC_ALPHA);
+    }
+  else
+    {
+    glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
+    }
   glEnable(GL_BLEND);
 
+  if (this->PointSmoothing)
+    {
+#ifdef GL_POINT_SMOOTH
+    glEnable(GL_POINT_SMOOTH);
+#endif
+    }
+  else
+    {
+#ifdef GL_POINT_SMOOTH
+    glDisable(GL_POINT_SMOOTH);
+#endif
+    }
+
   if (this->LineSmoothing)
     {
 #ifdef GL_LINE_SMOOTH
@@ -413,50 +425,14 @@ void vtkOpenGLRenderWindow::OpenGLInitContext()
       return;
       }
 
-    if (!GLEW_VERSION_3_2)
-      {
-      if (!GLEW_VERSION_2_1)
-        {
-        vtkErrorMacro("GL version 2.1 is not supported by your graphics driver.");
-        //m_valid = false;
-        return;
-        }
-      vtkWarningMacro(
-        "VTK is designed to work with OpenGL version 3.2 but it appears "
-        "it has been given a context that does not support 3.2. VTK will "
-        "run in a compatibility mode designed to work with OpenGL 2.1 but "
-        "some features may not work.");
-      }
-    else
+    if (!GLEW_VERSION_2_1)
       {
-      this->SetContextSupportsOpenGL32(true);
+      vtkErrorMacro("GL version 2.1 is not supported by your graphics driver.");
+      //m_valid = false;
+      return;
       }
 #endif
     this->Initialized = true;
-
-    // get this system's supported maximum line width
-    // we do it here and store it to avoid repeated glGet
-    // calls when the result should not change
-    GLfloat lineWidthRange[2];
-    this->MaximumHardwareLineWidth = 1.0;
-#if defined(GL_SMOOTH_LINE_WIDTH_RANGE) && defined(GL_ALIASED_LINE_WIDTH_RANGE)
-    if (this->LineSmoothing)
-      {
-      glGetFloatv(GL_SMOOTH_LINE_WIDTH_RANGE,lineWidthRange);
-      if (glGetError() == GL_NO_ERROR)
-        {
-        this->MaximumHardwareLineWidth = lineWidthRange[1];
-        }
-      }
-    else
-      {
-      glGetFloatv(GL_ALIASED_LINE_WIDTH_RANGE,lineWidthRange);
-      if (glGetError() == GL_NO_ERROR)
-        {
-        this->MaximumHardwareLineWidth = lineWidthRange[1];
-        }
-      }
-#endif
     }
 }
 
@@ -465,17 +441,6 @@ void vtkOpenGLRenderWindow::PrintSelf(ostream& os, vtkIndent indent)
   this->Superclass::PrintSelf(os,indent);
 }
 
-void vtkOpenGLRenderWindow::Render()
-{
-  // Query current GL state and store them
-  this->SaveGLState();
-
-  this->Superclass::Render();
-
-  // Restore state to previous known value
-  this->RestoreGLState();
-}
-
 int vtkOpenGLRenderWindow::GetDepthBufferSize()
 {
   GLint size;
@@ -484,18 +449,7 @@ int vtkOpenGLRenderWindow::GetDepthBufferSize()
     {
     this->MakeCurrent();
     size = 0;
-#if GL_ES_VERSION_2_0 != 1 || GL_ES_VERSION_3_0 == 1
-    if (vtkOpenGLRenderWindow::GetContextSupportsOpenGL32())
-      {
-      glGetFramebufferAttachmentParameteriv(GL_DRAW_FRAMEBUFFER,
-        GL_DEPTH,
-        GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE, &size);
-      }
-    else
-#endif
-      {
-      glGetIntegerv( GL_DEPTH_BITS, &size );
-      }
+    glGetIntegerv( GL_DEPTH_BITS, &size );
     return static_cast<int>(size);
     }
   else
@@ -521,68 +475,14 @@ int vtkOpenGLRenderWindow::GetColorBufferSizes(int *rgba)
   if ( this->Mapped)
     {
     this->MakeCurrent();
-#if GL_ES_VERSION_2_0 != 1 || GL_ES_VERSION_3_0 == 1
-    if (vtkOpenGLRenderWindow::GetContextSupportsOpenGL32())
-      {
-      GLint fboBind = 0;
-      glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, &fboBind);
-      GLint attachment = GL_BACK_LEFT;
-#ifdef GL_DRAW_BUFFER
-      glGetIntegerv(GL_DRAW_BUFFER, &attachment);
-#endif
-      // GL seems odd with its handling of left/right.
-      // if it says we are using GL_FRONT or GL_BACK
-      // then convert those to GL_FRONT_LEFT and
-      // GL_BACK_LEFT.
-      if (attachment == GL_FRONT)
-        {
-        attachment = GL_FRONT_LEFT;
-        }
-      if (attachment == GL_BACK)
-        {
-        attachment = GL_BACK_LEFT;
-        }
-      glGetFramebufferAttachmentParameteriv(GL_DRAW_FRAMEBUFFER,
-        attachment,
-        GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE, &size);
-      if (glGetError() == GL_NO_ERROR)
-        {
-        rgba[0] = static_cast<int>(size);
-        }
-      glGetFramebufferAttachmentParameteriv(GL_DRAW_FRAMEBUFFER,
-        attachment,
-        GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE, &size);
-      if (glGetError() == GL_NO_ERROR)
-        {
-        rgba[1] = static_cast<int>(size);
-        }
-      glGetFramebufferAttachmentParameteriv(GL_DRAW_FRAMEBUFFER,
-        attachment,
-        GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE, &size);
-      if (glGetError() == GL_NO_ERROR)
-        {
-        rgba[2] = static_cast<int>(size);
-        }
-      glGetFramebufferAttachmentParameteriv(GL_DRAW_FRAMEBUFFER,
-        attachment,
-        GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE, &size);
-      if (glGetError() == GL_NO_ERROR)
-        {
-        rgba[3] = static_cast<int>(size);
-        }
-      }
-    else
-#endif
-      {
-      glGetIntegerv( GL_RED_BITS, &size );
-      rgba[0] = static_cast<int>(size);
-      glGetIntegerv( GL_GREEN_BITS, &size  );
-      rgba[1] = static_cast<int>(size);
-      glGetIntegerv( GL_BLUE_BITS, &size );
-      rgba[2] = static_cast<int>(size);
-      glGetIntegerv( GL_ALPHA_BITS, &size );
-      rgba[3] = static_cast<int>(size);
-      }
+    glGetIntegerv( GL_RED_BITS, &size );
+    rgba[0] = static_cast<int>(size);
+    glGetIntegerv( GL_GREEN_BITS, &size  );
+    rgba[1] = static_cast<int>(size);
+    glGetIntegerv( GL_BLUE_BITS, &size );
+    rgba[2] = static_cast<int>(size);
+    glGetIntegerv( GL_ALPHA_BITS, &size );
+    rgba[3] = static_cast<int>(size);
     return rgba[0]+rgba[1]+rgba[2]+rgba[3];
     }
   else
@@ -783,20 +683,64 @@ int vtkOpenGLRenderWindow::SetPixelData(int x1, int y1, int x2, int y2,
 }
 
 
+// ---------------------------------------------------------------------------
+// a program must be bound
+// a VAO must be bound
+void vtkOpenGLRenderWindow::RenderQuad(
+  float *verts,
+  float *tcoords,
+  vtkShaderProgram *program, vtkgl::VertexArrayObject *vao)
+{
+  if (!program || !vao || !verts)
+    {
+    vtkGenericWarningMacro(<< "Error must have verts, program and vao");
+    }
+
+  vtkgl::BufferObject vbo;
+  vbo.Upload(verts, 12, vtkgl::BufferObject::ArrayBuffer);
+  vao->Bind();
+  if (!vao->AddAttributeArray(program, vbo, "vertexMC", 0, sizeof(float)*3, VTK_FLOAT, 3, false))
+    {
+    vtkGenericWarningMacro(<< "Error setting 'vertexMC' in shader VAO.");
+    }
+
+  vtkgl::BufferObject tvbo;
+  if (tcoords)
+    {
+    tvbo.Upload(tcoords, 8, vtkgl::BufferObject::ArrayBuffer);
+    if (!vao->AddAttributeArray(program, tvbo, "tcoordMC", 0, sizeof(float)*2, VTK_FLOAT, 2, false))
+      {
+      vtkGenericWarningMacro(<< "Error setting 'tcoordMC' in shader VAO.");
+      }
+    }
+
+  GLuint iboData[] = {0, 1, 2, 0, 2, 3};
+  vtkgl::BufferObject ibo;
+  vao->Bind();
+  ibo.Upload(iboData, 6, vtkgl::BufferObject::ElementArrayBuffer);
+  glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_INT,
+    reinterpret_cast<const GLvoid *>(NULL));
+  ibo.Release();
+  vao->Release();
+  vao->RemoveAttributeArray("vertexMC");
+  vao->RemoveAttributeArray("tcoordMC");
+  vbo.Release();
+  if (tcoords)
+    {
+    tvbo.Release();
+    }
+}
+
+
 // draw (and stretch as needed) the data to the current viewport
 void vtkOpenGLRenderWindow::DrawPixels(
   int srcWidth, int srcHeight, int numComponents, int dataType, void *data)
 {
   glDisable( GL_SCISSOR_TEST );
-  glDisable(GL_DEPTH_TEST);
   if (!this->DrawPixelsTextureObject)
     {
     this->DrawPixelsTextureObject = vtkTextureObject::New();
     }
-  else
-    {
-    this->DrawPixelsTextureObject->ReleaseGraphicsResources(this);
-    }
   this->DrawPixelsTextureObject->SetContext(this);
   this->DrawPixelsTextureObject->Create2DFromRaw(srcWidth, srcHeight,
         numComponents, dataType, data);
@@ -813,20 +757,15 @@ void vtkOpenGLRenderWindow::DrawPixels(
   int srcWidth, int srcHeight, int numComponents, int dataType, void *data)
 {
   glDisable( GL_SCISSOR_TEST );
-  glDisable(GL_DEPTH_TEST);
   if (!this->DrawPixelsTextureObject)
     {
     this->DrawPixelsTextureObject = vtkTextureObject::New();
     }
-  else
-    {
-    this->DrawPixelsTextureObject->ReleaseGraphicsResources(this);
-    }
   this->DrawPixelsTextureObject->SetContext(this);
   this->DrawPixelsTextureObject->Create2DFromRaw(srcWidth, srcHeight,
         numComponents, dataType, data);
   this->DrawPixelsTextureObject->CopyToFrameBuffer(
-      srcXmin, srcYmin, srcXmax, srcYmax,
+      srcXmin, srcYmin, srcXmax, srcYmax-1,
       dstXmin, dstYmin, dstXmax, dstYmax,
       this->GetSize()[0], this->GetSize()[1],
       NULL, NULL);
@@ -1607,16 +1546,6 @@ int vtkOpenGLRenderWindow::CreateHardwareOffScreenWindow(int width, int height)
   assert("pre: positive_height" && height>0);
   assert("pre: not_initialized" && !this->OffScreenUseFrameBuffer);
 
-  // This implementation currently ignores multisampling configurations:
-  // the following code causes tests to fail, commenting it out
-  // if (this->MultiSamples > 1)
-  //   {
-  //   vtkDebugMacro(<<"Multisampling is not currently supported by the "
-  //                 "accelerated offscreen rendering backend. Falling back to "
-  //                 "a platform-specific offscreen solution...");
-  //   return 0;
-  //   }
-
   // 1. create a regular OpenGLcontext (ie create a window)
   this->CreateAWindow();
   this->MakeCurrent();
@@ -1853,37 +1782,3 @@ void vtkOpenGLRenderWindow::WaitForCompletion()
 {
   glFinish();
 }
-
-// ----------------------------------------------------------------------------
-void vtkOpenGLRenderWindow::SaveGLState()
-{
-  // For now just query the active texture unit
-  if (this->Initialized)
-    {
-    this->MakeCurrent();
-    glGetIntegerv(GL_ACTIVE_TEXTURE, &this->GLStateIntegers["GL_ACTIVE_TEXTURE"]);
-
-    // GetTextureUnitManager() will create a new texture unit
-    // manager if one does not exist
-    if (this->GLStateIntegers["GL_ACTIVE_TEXTURE"] < 0 ||
-        this->GLStateIntegers["GL_ACTIVE_TEXTURE"] >
-        this->GetTextureUnitManager()->GetNumberOfTextureUnits())
-      {
-      this->GLStateIntegers["GL_ACTIVE_TEXTURE"] = 0;
-      }
-    }
-}
-
-// ----------------------------------------------------------------------------
-void vtkOpenGLRenderWindow::RestoreGLState()
-{
-  // Prevent making GL calls unless we have a valid context
-  if (this->Initialized)
-    {
-    // For now just re-store the texture unit
-    glActiveTexture(GL_TEXTURE0 + this->GLStateIntegers["GL_ACTIVE_TEXTURE"]);
-
-    // Unuse active shader program
-    this->GetShaderCache()->ReleaseCurrentShader();
-    }
-}
diff --git a/Rendering/OpenGL2/vtkOpenGLRenderWindow.h b/Rendering/OpenGL2/vtkOpenGLRenderWindow.h
index 6cde2bc..0789b93 100644
--- a/Rendering/OpenGL2/vtkOpenGLRenderWindow.h
+++ b/Rendering/OpenGL2/vtkOpenGLRenderWindow.h
@@ -26,15 +26,21 @@
 #include "vtkRenderWindow.h"
 #include <map> // for ivar
 
+#include "vtk_glew.h" // Needed for GLuint.
+
 class vtkIdList;
 class vtkOpenGLHardwareSupport;
+class vtkTextureUnitManager;
 class vtkOpenGLShaderCache;
-class vtkOpenGLVertexArrayObject;
-class vtkShaderProgram;
 class vtkStdString;
 class vtkTexture;
 class vtkTextureObject;
-class vtkTextureUnitManager;
+class vtkShaderProgram;
+
+namespace vtkgl
+{
+class VertexArrayObject;
+}
 
 class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLRenderWindow : public vtkRenderWindow
 {
@@ -43,11 +49,6 @@ public:
   void PrintSelf(ostream& os, vtkIndent indent);
 
   // Description:
-  // Overridden to release resources that would interfere with an external
-  // application's rendering.
-  void Render();
-
-  // Description:
   // Set/Get the maximum number of multisamples
   static void SetGlobalMaximumNumberOfMultiSamples(int val);
   static int  GetGlobalMaximumNumberOfMultiSamples();
@@ -208,6 +209,15 @@ public:
   virtual void WaitForCompletion();
 
   // Description:
+  // Helper function that draws a quad on the screen
+  // at the specified vertex coordinates and if
+  // tcoords are not NULL with the specified
+  // texture coordinates.
+  static void RenderQuad(
+    float *verts, float *tcoords,
+    vtkShaderProgram *program, vtkgl::VertexArrayObject *vao);
+
+  // Description:
   // Replacement for the old glDrawPixels function
   virtual void DrawPixels(int x1, int y1, int x2, int y2,
               int numComponents, int dataType, void *data);
@@ -226,11 +236,6 @@ public:
   virtual void DrawPixels(
     int srcWidth, int srcHeight, int numComponents, int dataType, void *data);
 
-  // Description:
-  // Return the largest line width supported by the hardware
-  virtual float GetMaximumHardwareLineWidth() {
-    return this->MaximumHardwareLineWidth; };
-
 protected:
   vtkOpenGLRenderWindow();
   ~vtkOpenGLRenderWindow();
@@ -289,17 +294,6 @@ protected:
   // Set the texture unit manager.
   void SetTextureUnitManager(vtkTextureUnitManager *textureUnitManager);
 
-
-  // Description:
-  // Query and save OpenGL state
-  void SaveGLState();
-
-  // Description:
-  // Restore OpenGL state at end of the rendering
-  void RestoreGLState();
-
-  std::map<std::string, int> GLStateIntegers;
-
   unsigned int BackLeftBuffer;
   unsigned int BackRightBuffer;
   unsigned int FrontLeftBuffer;
@@ -326,8 +320,6 @@ protected:
 
   bool Initialized; // ensure glewinit has been called
 
-  float MaximumHardwareLineWidth;
-
 private:
   vtkOpenGLRenderWindow(const vtkOpenGLRenderWindow&);  // Not implemented.
   void operator=(const vtkOpenGLRenderWindow&);  // Not implemented.
diff --git a/Rendering/OpenGL2/vtkOpenGLRenderer.cxx b/Rendering/OpenGL2/vtkOpenGLRenderer.cxx
index db140c5..8bafb4e 100644
--- a/Rendering/OpenGL2/vtkOpenGLRenderer.cxx
+++ b/Rendering/OpenGL2/vtkOpenGLRenderer.cxx
@@ -14,7 +14,7 @@ PURPOSE.  See the above copyright notice for more information.
 =========================================================================*/
 #include "vtkOpenGLRenderer.h"
 
-#include "vtkOpenGLHelper.h"
+#include "vtkglVBOHelper.h"
 
 #include "vtkCellArray.h"
 #include "vtkDepthPeelingPass.h"
@@ -249,11 +249,7 @@ void vtkOpenGLRenderer::Clear(void)
 
   if (!this->GetPreserveDepthBuffer())
     {
-#if GL_ES_VERSION_2_0 == 1
-    glClearDepthf(static_cast<GLclampf>(1.0));
-#else
-    glClearDepth(static_cast<GLclampf>(1.0));
-#endif
+    //glClearDepth(static_cast<GLclampf>(1.0));
     clear_mask |= GL_DEPTH_BUFFER_BIT;
     glDepthMask(GL_TRUE);
     }
diff --git a/Rendering/OpenGL2/vtkOpenGLShaderCache.cxx b/Rendering/OpenGL2/vtkOpenGLShaderCache.cxx
index c166f46..797447e 100644
--- a/Rendering/OpenGL2/vtkOpenGLShaderCache.cxx
+++ b/Rendering/OpenGL2/vtkOpenGLShaderCache.cxx
@@ -15,20 +15,21 @@
 #include "vtkOpenGLShaderCache.h"
 #include "vtk_glew.h"
 
-#include "vtkObjectFactory.h"
-#include "vtkOpenGLError.h"
 #include "vtkOpenGLRenderWindow.h"
-#include "vtkShader.h"
-#include "vtkShaderProgram.h"
-#include "vtkOpenGLHelper.h"
+#include "vtkOpenGLError.h"
 
 #include <math.h>
-#include <sstream>
 
+#include "vtkObjectFactory.h"
 
+#include "vtkglVBOHelper.h"
+#include "vtkShader.h"
+#include "vtkShaderProgram.h"
 
 #include "vtksys/MD5.h"
 
+using vtkgl::replace;
+
 class vtkOpenGLShaderCache::Private
 {
 public:
@@ -92,152 +93,44 @@ vtkOpenGLShaderCache::~vtkOpenGLShaderCache()
   delete this->Internal;
 }
 
-// perform System and Output replacments
-unsigned int vtkOpenGLShaderCache::ReplaceShaderValues(
-  std::string &VSSource,
-  std::string &FSSource,
-  std::string &GSSource)
-{
-  // first handle renaming any Fragment shader inputs
-  // if we have a geometry shader. By deafult fragment shaders
-  // assume their inputs come from a Vertex Shader. When we
-  // have a Geometry shader we rename the frament shader inputs
-  // to come from the geometry shader
-  if (GSSource.size() > 0)
-    {
-    vtkShaderProgram::Substitute(FSSource,"VSOut","GSOut");
-    }
-
-#if GL_ES_VERSION_2_0 != 1
-  unsigned int count = 0;
-  if (vtkOpenGLRenderWindow::GetContextSupportsOpenGL32())
-    {
-    vtkShaderProgram::Substitute(VSSource,"//VTK::System::Dec",
-      "#version 150\n"
-      "#define attribute in\n"
-      "#define varying out\n"
-      "#define highp\n"
-      "#define mediump\n"
-      "#define lowp");
-    vtkShaderProgram::Substitute(FSSource,"//VTK::System::Dec",
-      "#version 150\n"
-      "#define varying in\n"
-      "#define highp\n"
-      "#define mediump\n"
-      "#define lowp\n"
-      "#define texelFetchBuffer texelFetch\n"
-      "#define texture1D texture\n"
-      "#define texture2D texture\n"
-      "#define texture3D texture\n"
-      );
-    vtkShaderProgram::Substitute(GSSource,"//VTK::System::Dec",
-      "#version 150\n"
-      "#define highp\n"
-      "#define mediump\n"
-      "#define lowp"
-      );
-    std::string fragDecls;
-    bool done = false;
-    while (!done)
-      {
-      std::ostringstream src;
-      std::ostringstream dst;
-      src << "gl_FragData[" << count << "]";
-      // this naming has to match the bindings
-      // in vtkOpenGLShaderProgram.cxx
-      dst << "fragOutput" << count;
-      done = !vtkShaderProgram::Substitute(FSSource, src.str(),dst.str());
-      if (!done)
-        {
-        fragDecls += "out vec4 " + dst.str() + ";\n";
-        count++;
-        }
-      }
-    vtkShaderProgram::Substitute(FSSource,"//VTK::Output::Dec",fragDecls);
-    vtkShaderProgram::Substitute(GSSource,"//VTK::System::Dec",
-      "#version 150\n"
-      "#define highp\n"
-      "#define mediump\n"
-      "#define lowp");
-    }
-  else
-    {
-    vtkShaderProgram::Substitute(VSSource,"//VTK::System::Dec",
-      "#version 120\n"
-      "#define highp\n"
-      "#define mediump\n"
-      "#define lowp");
-    vtkShaderProgram::Substitute(FSSource,"//VTK::System::Dec",
-      "#version 120\n"
-      "#extension GL_EXT_gpu_shader4 : require\n"
-      "#define highp\n"
-      "#define mediump\n"
-      "#define lowp");
-    vtkShaderProgram::Substitute(GSSource,"//VTK::System::Dec",
-      "#version 120\n"
-      "#define highp\n"
-      "#define mediump\n"
-      "#define lowp");
-    }
-  return count;
-#else
-  vtkShaderProgram::Substitute(FSSource,"//VTK::System::Dec",
-     "#ifdef GL_ES\n"
-     "#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
-     "precision highp float;\n"
-     "#else\n"
-     "precision mediump float;\n"
-     "#endif\n"
-     "#endif\n");
-  return 0;
-#endif
-}
-
-vtkShaderProgram *vtkOpenGLShaderCache::ReadyShaderProgram(
-  std::map<vtkShader::Type,vtkShader *> shaders)
-{
-  std::string VSSource = shaders[vtkShader::Vertex]->GetSource();
-  std::string FSSource = shaders[vtkShader::Fragment]->GetSource();
-  std::string GSSource = shaders[vtkShader::Geometry]->GetSource();
-
-  unsigned int count =
-    this->ReplaceShaderValues(VSSource,FSSource,GSSource);
-  shaders[vtkShader::Vertex]->SetSource(VSSource);
-  shaders[vtkShader::Fragment]->SetSource(FSSource);
-  shaders[vtkShader::Geometry]->SetSource(GSSource);
-
-  vtkShaderProgram *shader = this->GetShaderProgram(shaders);
-  shader->SetNumberOfOutputs(count);
-
-  return this->ReadyShaderProgram(shader);
-}
-
 // return NULL if there is an issue
-vtkShaderProgram *vtkOpenGLShaderCache::ReadyShaderProgram(
+vtkShaderProgram *vtkOpenGLShaderCache::ReadyShader(
   const char *vertexCode,
   const char *fragmentCode,
   const char *geometryCode)
 {
   // perform system wide shader replacements
   // desktops to not use percision statements
+#if GL_ES_VERSION_2_0 != 1
   std::string VSSource = vertexCode;
+  VSSource = replace(VSSource,"//VTK::System::Dec",
+                              "#define highp\n"
+                              "#define mediump\n"
+                              "#define lowp");
   std::string FSSource = fragmentCode;
+  FSSource = replace(FSSource,"//VTK::System::Dec",
+                              "#define highp\n"
+                              "#define mediump\n"
+                              "#define lowp");
   std::string GSSource = geometryCode;
+  GSSource = replace(GSSource,"//VTK::System::Dec",
+                              "#define highp\n"
+                              "#define mediump\n"
+                              "#define lowp");
+  vtkShaderProgram *shader = this->GetShader(VSSource.c_str(), FSSource.c_str(), GSSource.c_str());
+#else
+  std::string FSSource = fragmentCode;
+  FSSource = replace(FSSource,"//VTK::System::Dec",
+                               "#ifdef GL_ES\n"
+                               "#ifdef GL_FRAGMENT_PRECISION_HIGH\n"
+                               "precision highp float;\n"
+                               "#else\n"
+                               "precision mediump float;\n"
+                               "#endif\n"
+                               "#endif\n");
+  vtkShaderProgram *shader = this->GetShader(vertexCode, FSSource.c_str(), geometryCode);
+#endif
 
-  unsigned int count =
-    this->ReplaceShaderValues(VSSource,FSSource,GSSource);
-  vtkShaderProgram *shader =
-    this->GetShaderProgram(
-      VSSource.c_str(), FSSource.c_str(), GSSource.c_str());
-  shader->SetNumberOfOutputs(count);
-
-  return this->ReadyShaderProgram(shader);
-}
-
-// return NULL if there is an issue
-vtkShaderProgram *vtkOpenGLShaderCache::ReadyShaderProgram(
-    vtkShaderProgram *shader)
-{
   if (!shader)
     {
     return NULL;
@@ -258,37 +151,26 @@ vtkShaderProgram *vtkOpenGLShaderCache::ReadyShaderProgram(
   return shader;
 }
 
-vtkShaderProgram *vtkOpenGLShaderCache::GetShaderProgram(
-  std::map<vtkShader::Type,vtkShader *> shaders)
+// return NULL if there is an issue
+vtkShaderProgram *vtkOpenGLShaderCache::ReadyShader(
+    vtkShaderProgram *shader)
 {
-  // compute the MD5 and the check the map
-  std::string result;
-  this->Internal->ComputeMD5(
-    shaders[vtkShader::Vertex]->GetSource().c_str(),
-    shaders[vtkShader::Fragment]->GetSource().c_str(),
-    shaders[vtkShader::Geometry]->GetSource().c_str(), result);
-
-  // does it already exist?
-  typedef std::map<std::string,vtkShaderProgram*>::const_iterator SMapIter;
-  SMapIter found = this->Internal->ShaderPrograms.find(result);
-  if (found == this->Internal->ShaderPrograms.end())
+  // compile if needed
+  if (!shader->GetCompiled() && !shader->CompileShader())
     {
-    // create one
-    vtkShaderProgram *sps = vtkShaderProgram::New();
-    sps->SetVertexShader(shaders[vtkShader::Vertex]);
-    sps->SetFragmentShader(shaders[vtkShader::Fragment]);
-    sps->SetGeometryShader(shaders[vtkShader::Geometry]);
-    sps->SetMD5Hash(result); // needed?
-    this->Internal->ShaderPrograms.insert(std::make_pair(result, sps));
-    return sps;
+    return NULL;
     }
-  else
+
+  // bind if needed
+  if (!this->BindShader(shader))
     {
-    return found->second;
+    return NULL;
     }
+
+  return shader;
 }
 
-vtkShaderProgram *vtkOpenGLShaderCache::GetShaderProgram(
+vtkShaderProgram *vtkOpenGLShaderCache::GetShader(
   const char *vertexCode,
   const char *fragmentCode,
   const char *geometryCode)
diff --git a/Rendering/OpenGL2/vtkOpenGLShaderCache.h b/Rendering/OpenGL2/vtkOpenGLShaderCache.h
index 6df070a..beec35f 100644
--- a/Rendering/OpenGL2/vtkOpenGLShaderCache.h
+++ b/Rendering/OpenGL2/vtkOpenGLShaderCache.h
@@ -21,9 +21,8 @@
 
 #include "vtkRenderingOpenGL2Module.h" // For export macro
 #include "vtkObject.h"
-#include "vtkShader.h" // for vtkShader::Type
-#include <map> // for methods
 
+class vtkShader;
 class vtkShaderProgram;
 class vtkWindow;
 
@@ -34,20 +33,11 @@ public:
   vtkTypeMacro(vtkOpenGLShaderCache, vtkObject);
   virtual void PrintSelf(ostream& os, vtkIndent indent);
 
-  // make sure the specified shaders are compiled, linked, and bound
-  virtual vtkShaderProgram *ReadyShaderProgram(
-    const char *vertexCode,
-    const char *fragmentCode,
-    const char *geometryCode);
-
-  // make sure the specified shaders are compiled, linked, and bound
-  // will increment the reference count on the shaders if it
-  // needs to keep them around
-  virtual vtkShaderProgram *ReadyShaderProgram(
-    std::map<vtkShader::Type,vtkShader *> shaders);
-
-  // make sure the specified shaders are compiled, linked, and bound
-  virtual vtkShaderProgram *ReadyShaderProgram(vtkShaderProgram *shader);
+  // make sure the specified shader is compiled, linked, and bound
+  virtual vtkShaderProgram *ReadyShader(const char *vertexCode,
+                                           const char *fragmentCode,
+                                           const char *geometryCode);
+  virtual vtkShaderProgram *ReadyShader(vtkShaderProgram *shader);
 
   // Description:
   // Release the current shader.  Basically go back to
@@ -69,18 +59,9 @@ protected:
   vtkOpenGLShaderCache();
   ~vtkOpenGLShaderCache();
 
-  // perform System and Output replacments in place. Returns
-  // the number of outputs
-  virtual unsigned int ReplaceShaderValues(
-    std::string &VSSource,
-    std::string &FSSource,
-    std::string &GSSource);
-
-  virtual vtkShaderProgram* GetShaderProgram(const char *vertexCode,
+  virtual vtkShaderProgram* GetShader(const char *vertexCode,
                                       const char *fragmentCode,
                                       const char *geometryCode);
-  virtual vtkShaderProgram* GetShaderProgram(
-    std::map<vtkShader::Type,vtkShader *> shaders);
   virtual int BindShader(vtkShaderProgram* shader);
 
   class Private;
diff --git a/Rendering/OpenGL2/vtkOpenGLTexture.cxx b/Rendering/OpenGL2/vtkOpenGLTexture.cxx
index 6b0d47f..5fe1acf 100644
--- a/Rendering/OpenGL2/vtkOpenGLTexture.cxx
+++ b/Rendering/OpenGL2/vtkOpenGLTexture.cxx
@@ -15,7 +15,7 @@
 #include "vtkOpenGLTexture.h"
 #include "vtkTextureObject.h"
 
-#include "vtkOpenGLHelper.h"
+#include "vtkglVBOHelper.h"
 
 #include "vtkHomogeneousTransform.h"
 
@@ -67,6 +67,7 @@ void vtkOpenGLTexture::ReleaseGraphicsResources(vtkWindow *win)
   if (this->TextureObject && win)
     {
     this->TextureObject->ReleaseGraphicsResources(win);
+    vtkOpenGLCheckErrorMacro("failed after ReleaseGraphicsResources");
     }
 
   this->RenderWindow = NULL;
diff --git a/Rendering/OpenGL2/vtkOpenGLVertexArrayObject.cxx b/Rendering/OpenGL2/vtkOpenGLVertexArrayObject.cxx
deleted file mode 100644
index 5fc4441..0000000
--- a/Rendering/OpenGL2/vtkOpenGLVertexArrayObject.cxx
+++ /dev/null
@@ -1,446 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-
-  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 "vtkOpenGLVertexArrayObject.h"
-#include "vtkObjectFactory.h"
-
-#include "vtkOpenGLRenderWindow.h"
-#include "vtkOpenGLBufferObject.h"
-#include "vtkShaderProgram.h"
-
-#include <map>
-#include <vector>
-
-#include "vtk_glew.h"
-
-vtkStandardNewMacro(vtkOpenGLVertexArrayObject)
-
-namespace
-{
-// Copied from vtkglShaderProgram, time to move into a common header?
-inline GLenum convertTypeToGL(int type)
-{
-  switch (type)
-    {
-    case VTK_CHAR:
-      return GL_BYTE;
-    case VTK_UNSIGNED_CHAR:
-      return GL_UNSIGNED_BYTE;
-    case VTK_SHORT:
-      return GL_SHORT;
-    case VTK_UNSIGNED_SHORT:
-      return GL_UNSIGNED_SHORT;
-    case VTK_INT:
-      return GL_INT;
-    case VTK_UNSIGNED_INT:
-      return GL_UNSIGNED_INT;
-    case VTK_FLOAT:
-      return GL_FLOAT;
-    case VTK_DOUBLE:
-#ifdef GL_DOUBLE
-      return GL_DOUBLE;
-#else
-      vtkGenericWarningMacro(<< "Attempt to use GL_DOUBLE when not supported");
-      return 0;
-#endif
-    default:
-      return 0;
-    }
-}
-
-struct VertexAttributes
-{
-  GLint Index;
-  GLint  Size;
-  GLenum Type;
-  GLboolean Normalize;
-  GLsizei Stride;
-  GLuint Offset;
-  int Divisor;
-  bool IsMatrix;
-};
-
-} // end anonymous
-
-
-class vtkOpenGLVertexArrayObject::Private
-{
-public:
-  Private()
-  {
-    this->HandleVAO = 0;
-    this->HandleProgram = 0;
-    this->Supported = true;
-    this->ForceEmulation = false;
-  }
-  ~Private()
-  {
-    if (this->HandleVAO)
-      {
-      glDeleteVertexArrays(1, &this->HandleVAO);
-      }
-  }
-
-  void Initialize()
-  {
-    if (!this->ForceEmulation &&
-        (GLEW_ARB_vertex_array_object ||
-            vtkOpenGLRenderWindow::GetContextSupportsOpenGL32()))
-      {
-      this->Supported = true;
-      glGenVertexArrays(1, &this->HandleVAO);
-      }
-    else
-      {
-      this->Supported = false;
-      }
-  }
-
-  bool IsReady() const
-  {
-    // We either probed and allocated a VAO, or are falling back as the current
-    // hardware does not support VAOs.
-    return (this->HandleVAO != 0 || this->Supported == false);
-  }
-
-  void ReleaseGraphicsResources()
-  {
-    if (this->HandleVAO)
-      {
-      glDeleteVertexArrays(1, &this->HandleVAO);
-      }
-    this->HandleVAO = 0;
-    this->Supported = true;
-    this->HandleProgram = 0;
-  }
-
-  GLuint HandleVAO;
-  GLuint HandleProgram;
-  bool Supported;
-  bool ForceEmulation;
-
-  typedef std::map< GLuint, std::vector<VertexAttributes> > AttributeMap;
-  AttributeMap Attributes;
-};
-
-#define BUFFER_OFFSET(i) ((char *)NULL + (i))
-
-vtkOpenGLVertexArrayObject::vtkOpenGLVertexArrayObject()
-{
-  this->Internal = new vtkOpenGLVertexArrayObject::Private;
-}
-
-vtkOpenGLVertexArrayObject::~vtkOpenGLVertexArrayObject()
-{
-  delete this->Internal;
-}
-
-void vtkOpenGLVertexArrayObject::SetForceEmulation(bool val)
-{
-  this->Internal->ForceEmulation = val;
-}
-
-void vtkOpenGLVertexArrayObject::Bind()
-{
-  // Either simply bind the VAO, or emulate behavior by binding all attributes.
-  if (!this->Internal->IsReady())
-    {
-    this->Internal->Initialize();
-    }
-  if (this->Internal->IsReady() && this->Internal->Supported)
-    {
-    glBindVertexArray(this->Internal->HandleVAO);
-    }
-  else if (this->Internal->IsReady())
-    {
-    Private::AttributeMap::const_iterator it;
-    for (it = this->Internal->Attributes.begin(); it != this->Internal->Attributes.end();
-         ++it)
-      {
-      std::vector<VertexAttributes>::const_iterator attrIt;
-      glBindBuffer(GL_ARRAY_BUFFER, it->first);
-      for (attrIt = it->second.begin(); attrIt != it->second.end(); ++attrIt)
-        {
-        int matrixCount = attrIt->IsMatrix ? attrIt->Size : 1;
-        for (int i = 0; i < matrixCount; ++i)
-          {
-          glEnableVertexAttribArray(attrIt->Index+i);
-          glVertexAttribPointer(attrIt->Index+i, attrIt->Size, attrIt->Type,
-                                attrIt->Normalize, attrIt->Stride,
-                                BUFFER_OFFSET(attrIt->Offset + attrIt->Stride*i/attrIt->Size));
-          if (attrIt->Divisor > 0)
-            {
-#if GL_ES_VERSION_2_0 != 1 || GL_ES_VERSION_3_0 == 1
-#if GL_ES_VERSION_3_0 == 1
-            glVertexAttribDivisor(attrIt->Index+i, 1);
-#else
-            if (GLEW_ARB_instanced_arrays)
-              {
-              glVertexAttribDivisorARB(attrIt->Index+i, 1);
-              }
-#endif
-#endif
-            }
-          }
-        }
-      glBindBuffer(GL_ARRAY_BUFFER, 0);
-      }
-    }
-}
-
-void vtkOpenGLVertexArrayObject::Release()
-{
-  if (this->Internal->IsReady() && this->Internal->Supported)
-    {
-    glBindVertexArray(0);
-    }
-  else if (this->Internal->IsReady())
-    {
-    Private::AttributeMap::const_iterator it;
-    for (it = this->Internal->Attributes.begin(); it != this->Internal->Attributes.end();
-         ++it)
-      {
-      std::vector<VertexAttributes>::const_iterator attrIt;
-      for (attrIt = it->second.begin(); attrIt != it->second.end(); ++attrIt)
-        {
-        int matrixCount = attrIt->IsMatrix ? attrIt->Size : 1;
-        for (int i = 0; i < matrixCount; ++i)
-          {
-          if (attrIt->Divisor > 0)
-            {
-#if GL_ES_VERSION_2_0 != 1 || GL_ES_VERSION_3_0 == 1
-#if GL_ES_VERSION_3_0 == 1
-            glVertexAttribDivisor(attrIt->Index+i, 0);
-#else
-            if (GLEW_ARB_instanced_arrays)
-              {
-              glVertexAttribDivisorARB(attrIt->Index+i, 0);
-              }
-#endif
-#endif
-            }
-          glDisableVertexAttribArray(attrIt->Index+i);
-          }
-        }
-      }
-    }
-}
-
-void vtkOpenGLVertexArrayObject::ShaderProgramChanged()
-{
-  this->Release();
-
-  Private::AttributeMap::iterator it;
-  for (it = this->Internal->Attributes.begin(); it != this->Internal->Attributes.end();
-       ++it)
-    {
-    it->second.clear();
-    }
-  this->Internal->Attributes.clear();
-
-  this->Internal->HandleProgram = 0;
-}
-
-void vtkOpenGLVertexArrayObject::ReleaseGraphicsResources()
-{
-  this->ShaderProgramChanged();
-  this->Internal->ReleaseGraphicsResources();
-}
-
-bool vtkOpenGLVertexArrayObject::AddAttributeArrayWithDivisor(vtkShaderProgram *program,
-                                          vtkOpenGLBufferObject *buffer,
-                                          const std::string &name,
-                                          int offset, size_t stride,
-                                          int elementType, int elementTupleSize,
-                                          bool normalize,
-                                          int divisor, bool isMatrix)
-{
-  // Check the program is bound, and the buffer is valid.
-  if (!program->isBound() || buffer->GetHandle() == 0 ||
-      buffer->GetType() != vtkOpenGLBufferObject::ArrayBuffer)
-    {
-    return false;
-    }
-
-  // Perform initalization if necessary, ensure program matches VAOs.
-  if (this->Internal->HandleProgram == 0)
-    {
-    this->Internal->HandleProgram = static_cast<GLuint>(program->GetHandle());
-    }
-  if (!this->Internal->IsReady() ||
-      this->Internal->HandleProgram != static_cast<GLuint>(program->GetHandle()))
-    {
-    return false;
-    }
-
-  const GLchar *namePtr = static_cast<const GLchar *>(name.c_str());
-  VertexAttributes attribs;
-  attribs.Index = glGetAttribLocation(this->Internal->HandleProgram, namePtr);
-  attribs.Offset = offset;
-  attribs.Stride = static_cast<GLsizei>(stride);
-  attribs.Type = convertTypeToGL(elementType);
-  attribs.Size = elementTupleSize;
-  attribs.Normalize = normalize;
-  attribs.IsMatrix = isMatrix;
-  attribs.Divisor = divisor;
-
-  if (attribs.Index == -1)
-    {
-    return false;
-    }
-
-  // Always make the call as even the first use wants the attrib pointer setting
-  // up when we are emulating.
-  buffer->Bind();
-  glEnableVertexAttribArray(attribs.Index);
-  glVertexAttribPointer(attribs.Index, attribs.Size, attribs.Type,
-                        attribs.Normalize, attribs.Stride,
-                        BUFFER_OFFSET(attribs.Offset));
-
-
-  if (divisor > 0)
-    {
-#if GL_ES_VERSION_2_0 != 1 || GL_ES_VERSION_3_0 == 1
-#if GL_ES_VERSION_3_0 == 1
-    glVertexAttribDivisor(attribs.Index, 1);
-#else
-    if (GLEW_ARB_instanced_arrays)
-      {
-      glVertexAttribDivisorARB(attribs.Index, 1);
-      }
-#endif
-#endif
-    }
-
-  // If vertex array objects are not supported then build up our list.
-  if (!this->Internal->Supported)
-    {
-    GLuint handleBuffer = buffer->GetHandle();
-    Private::AttributeMap::iterator it = this->Internal->Attributes.find(handleBuffer);
-    if (it != this->Internal->Attributes.end())
-      {
-      std::vector<VertexAttributes> &attribsVector = it->second;
-      std::vector<VertexAttributes>::iterator it2;
-      for (it2 = attribsVector.begin(); it2 != attribsVector.end(); ++it2)
-        {
-        if (it2->Index == attribs.Index)
-          {
-          *it2 = attribs;
-          return true;
-          }
-        }
-      // Attribute not found, add it.
-      attribsVector.push_back(attribs);
-      }
-    else
-      {
-      // a single handle can have multiple attribs
-      std::vector<VertexAttributes> attribsVector;
-      attribsVector.push_back(attribs);
-      this->Internal->Attributes[handleBuffer] = attribsVector;
-      }
-    }
-
-  return true;
-}
-
-bool vtkOpenGLVertexArrayObject::AddAttributeMatrixWithDivisor(
-  vtkShaderProgram *program,
-  vtkOpenGLBufferObject *buffer,
-  const std::string &name,
-  int offset, size_t stride,
-  int elementType, int elementTupleSize,
-  bool normalize,
-  int divisor)
-{
-  // bind the first row of values
-  bool result =
-    this->AddAttributeArrayWithDivisor(program, buffer, name,
-      offset, stride, elementType, elementTupleSize, normalize, divisor, true);
-
-  if (!result)
-    {
-    return result;
-    }
-
-  const GLchar *namePtr = static_cast<const GLchar *>(name.c_str());
-  VertexAttributes attribs;
-  attribs.Index = glGetAttribLocation(this->Internal->HandleProgram, namePtr);
-
-  for (int i = 1; i < elementTupleSize; i++)
-    {
-    glEnableVertexAttribArray(attribs.Index+i);
-    glVertexAttribPointer(attribs.Index + i, elementTupleSize, convertTypeToGL(elementType),
-                          normalize, static_cast<GLsizei>(stride),
-                          BUFFER_OFFSET(offset + stride*i/elementTupleSize));
-    if (divisor > 0)
-      {
-#if GL_ES_VERSION_2_0 != 1 || GL_ES_VERSION_3_0 == 1
-#if GL_ES_VERSION_3_0 == 1
-      glVertexAttribDivisor(attribs.Index+i, 1);
-#else
-      if (GLEW_ARB_instanced_arrays)
-        {
-        glVertexAttribDivisorARB(attribs.Index+i, 1);
-        }
-#endif
-#endif
-      }
-    }
-
-  return true;
-}
-
-bool vtkOpenGLVertexArrayObject::RemoveAttributeArray(const std::string &name)
-{
-  if (!this->Internal->IsReady() || this->Internal->HandleProgram == 0)
-    {
-    return false;
-    }
-
-  const GLchar *namePtr = static_cast<const GLchar *>(name.c_str());
-  GLint location = glGetAttribLocation(this->Internal->HandleProgram, namePtr);
-  if (location == -1)
-    {
-    return false;
-    }
-
-  glDisableVertexAttribArray(location);
-  // If we don't have real VAOs find the entry and remove it too.
-  if (!this->Internal->Supported)
-    {
-    Private::AttributeMap::iterator it;
-    for (it = this->Internal->Attributes.begin(); it != this->Internal->Attributes.end();
-         ++it)
-      {
-      std::vector<VertexAttributes>::iterator attrIt;
-      for (attrIt = it->second.begin(); attrIt != it->second.end(); ++attrIt)
-        {
-        if (attrIt->Index == location)
-          {
-          it->second.erase(attrIt);
-          return true;
-          }
-        }
-      }
-    }
-
-  return true;
-}
-
-//-----------------------------------------------------------------------------
-void vtkOpenGLVertexArrayObject::PrintSelf(ostream& os, vtkIndent indent)
-{
-  this->Superclass::PrintSelf(os, indent);
-}
diff --git a/Rendering/OpenGL2/vtkOpenGLVertexArrayObject.h b/Rendering/OpenGL2/vtkOpenGLVertexArrayObject.h
deleted file mode 100644
index 542e698..0000000
--- a/Rendering/OpenGL2/vtkOpenGLVertexArrayObject.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-
-  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.
-
-=========================================================================*/
-#ifndef vtkOpenGLVertexArrayObject_h
-#define vtkOpenGLVertexArrayObject_h
-
-#include "vtkRenderingOpenGL2Module.h" // for export macro
-#include "vtkObject.h"
-#include <string> // For API.
-
-class vtkShaderProgram;
-class vtkOpenGLBufferObject;
-
-/**
- * @brief The VertexArrayObject class uses, or emulates, vertex array objects.
- * These are extremely useful for setup/tear down of vertex attributes, and can
- * offer significant performance benefits when the hardware supports them.
- *
- * It should be noted that this object is very lightweight, and it assumes the
- * objects being used are correctly set up. Even without support for VAOs this
- * class caches the array locations, types, etc and avoids repeated look ups. It
- * it bound to a single ShaderProgram object.
- */
-
-class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLVertexArrayObject : public vtkObject
-{
-public:
-  static vtkOpenGLVertexArrayObject* New();
-  vtkTypeMacro(vtkOpenGLVertexArrayObject, vtkObject)
-  void PrintSelf(ostream& os, vtkIndent indent);
-
-  void Bind();
-
-  void Release();
-
-  void ReleaseGraphicsResources();
-
-  void ShaderProgramChanged();
-
-  bool AddAttributeArray(vtkShaderProgram *program,
-                         vtkOpenGLBufferObject *buffer,
-                         const std::string &name, int offset, size_t stride,
-                         int elementType, int elementTupleSize, bool normalize)
-    {
-    return this->AddAttributeArrayWithDivisor(program, buffer, name,
-      offset,stride,elementType, elementTupleSize, normalize, 0, false);
-    }
-
-  bool AddAttributeArrayWithDivisor(vtkShaderProgram *program,
-                         vtkOpenGLBufferObject *buffer,
-                         const std::string &name, int offset, size_t stride,
-                         int elementType, int elementTupleSize, bool normalize,
-                         int divisor, bool isMatrix);
-
-  bool AddAttributeMatrixWithDivisor(vtkShaderProgram *program,
-                         vtkOpenGLBufferObject *buffer,
-                         const std::string &name, int offset, size_t stride,
-                         int elementType, int elementTupleSize, bool normalize,
-                         int divisor);
-
-  bool RemoveAttributeArray(const std::string &name);
-
-  // Force this VAO to emulate a vertex aray object even if
-  // the system supports VAOs. This can be useful in cases where
-  // the vertex array object does not handle all extensions.
-  void SetForceEmulation(bool val);
-
-protected:
-  vtkOpenGLVertexArrayObject();
-  ~vtkOpenGLVertexArrayObject();
-
-private:
-  vtkOpenGLVertexArrayObject(
-    const vtkOpenGLVertexArrayObject&); // Not implemented
-  void operator=(const vtkOpenGLVertexArrayObject&); // Not implemented
-  class Private;
-  Private *Internal;
-};
-
-#endif // vtkOpenGLVertexArrayObject_h
diff --git a/Rendering/OpenGL2/vtkOpenGLVertexBufferObject.cxx b/Rendering/OpenGL2/vtkOpenGLVertexBufferObject.cxx
deleted file mode 100644
index 7d79792..0000000
--- a/Rendering/OpenGL2/vtkOpenGLVertexBufferObject.cxx
+++ /dev/null
@@ -1,246 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-
-  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 "vtkOpenGLVertexBufferObject.h"
-#include "vtkObjectFactory.h"
-
-#include "vtkPoints.h"
-
-#include "vtk_glew.h"
-
-vtkStandardNewMacro(vtkOpenGLVertexBufferObject)
-
-vtkOpenGLVertexBufferObject::vtkOpenGLVertexBufferObject()
-{
-  this->VertexCount = 0;
-  this->Stride = 0;       // The size of a complete vertex + attributes
-  this->VertexOffset = 0; // Offset of the vertex
-  this->NormalOffset = 0; // Offset of the normal
-  this->TCoordOffset = 0; // Offset of the texture coordinates
-  this->TCoordComponents = 0; // Number of texture dimensions
-  this->ColorOffset = 0;  // Offset of the color
-  this->ColorComponents = 0; // Number of color components
-  this->SetType(vtkOpenGLBufferObject::ArrayBuffer);
-}
-
-vtkOpenGLVertexBufferObject::~vtkOpenGLVertexBufferObject()
-{
-}
-
-// we only instantiate some cases to avoid template explosion
-#define vtkFloatDoubleTemplateMacro(call)  \
-  vtkTemplateMacroCase(VTK_DOUBLE, double, call); \
-  vtkTemplateMacroCase(VTK_FLOAT, float, call);
-
-namespace {
-
-// internal function called by AppendVBO
-template<typename T, typename T2, typename T3>
-void TemplatedAppendVBO3(vtkOpenGLVertexBufferObject *self,
-  T* points, T2* normals, vtkIdType numPts,
-  T3* tcoords, int textureComponents,
-  unsigned char *colors, int colorComponents)
-{
-  // Figure out how big each block will be, currently 6 or 7 floats.
-  int blockSize = 3;
-  self->VertexOffset = 0;
-  self->NormalOffset = 0;
-  self->TCoordOffset = 0;
-  self->TCoordComponents = 0;
-  self->ColorComponents = 0;
-  self->ColorOffset = 0;
-  if (normals)
-    {
-    self->NormalOffset = sizeof(float) * blockSize;
-    blockSize += 3;
-    }
-  if (tcoords)
-    {
-    self->TCoordOffset = sizeof(float) * blockSize;
-    self->TCoordComponents = textureComponents;
-    blockSize += textureComponents;
-    }
-  if (colors)
-    {
-    self->ColorComponents = colorComponents;
-    self->ColorOffset = sizeof(float) * blockSize;
-    ++blockSize;
-    }
-  self->Stride = sizeof(float) * blockSize;
-
-  // Create a buffer, and copy the data over.
-  self->PackedVBO.resize(blockSize * (numPts + self->VertexCount));
-  std::vector<float>::iterator it = self->PackedVBO.begin()
-    + (self->VertexCount*self->Stride/sizeof(float));
-
-  T *pointPtr;
-  T2 *normalPtr;
-  T3 *tcoordPtr;
-  unsigned char *colorPtr;
-
-  // TODO: optimize this somehow, lots of if statements in here
-  for (vtkIdType i = 0; i < numPts; ++i)
-    {
-    pointPtr = points + i*3;
-    normalPtr = normals + i*3;
-    tcoordPtr = tcoords + i*textureComponents;
-    colorPtr = colors + i*colorComponents;
-
-    // Vertices
-    *(it++) = *(pointPtr++);
-    *(it++) = *(pointPtr++);
-    *(it++) = *(pointPtr++);
-    if (normals)
-      {
-      *(it++) = *(normalPtr++);
-      *(it++) = *(normalPtr++);
-      *(it++) = *(normalPtr++);
-      }
-    if (tcoords)
-      {
-      for (int j = 0; j < textureComponents; ++j)
-        {
-        *(it++) = *(tcoordPtr++);
-        }
-      }
-    if (colors)
-      {
-      if (colorComponents == 4)
-        {
-        *(it++) = *reinterpret_cast<float *>(colorPtr);
-        }
-      else
-        {
-        vtkucfloat c;
-        c.c[0] = *(colorPtr++);
-        c.c[1] = *(colorPtr++);
-        c.c[2] = *(colorPtr);
-        c.c[3] =  255;
-        *(it++) = c.f;
-        }
-      }
-    }
-  self->VertexCount += numPts;
-}
-
-//----------------------------------------------------------------------------
-template<typename T, typename T2>
-void TemplatedAppendVBO2(vtkOpenGLVertexBufferObject *self,
-  T* points, T2 *normals, vtkIdType numPts,
-  vtkDataArray *tcoords,
-  unsigned char *colors, int colorComponents)
-{
-  if (tcoords)
-    {
-    switch(tcoords->GetDataType())
-      {
-      vtkFloatDoubleTemplateMacro(
-        TemplatedAppendVBO3(self, points, normals,
-                  numPts,
-                  static_cast<VTK_TT*>(tcoords->GetVoidPointer(0)),
-                  tcoords->GetNumberOfComponents(),
-                  colors, colorComponents));
-      }
-    }
-  else
-    {
-    TemplatedAppendVBO3(self, points, normals,
-                        numPts, (float *)NULL, 0,
-                        colors, colorComponents);
-    }
-}
-
-//----------------------------------------------------------------------------
-template<typename T>
-void TemplatedAppendVBO(vtkOpenGLVertexBufferObject *self,
-  T* points, vtkDataArray *normals, vtkIdType numPts,
-  vtkDataArray *tcoords,
-  unsigned char *colors, int colorComponents)
-{
-  if (normals)
-    {
-    switch(normals->GetDataType())
-      {
-      vtkFloatDoubleTemplateMacro(
-        TemplatedAppendVBO2(self, points,
-                  static_cast<VTK_TT*>(normals->GetVoidPointer(0)),
-                  numPts, tcoords, colors, colorComponents));
-      }
-    }
-  else
-    {
-    TemplatedAppendVBO2(self, points,
-                        (float *)NULL,
-                        numPts, tcoords, colors, colorComponents);
-    }
-}
-
-} // end anonymous namespace
-
-
-// Take the points, and pack them into the VBO object supplied. This currently
-// takes whatever the input type might be and packs them into a VBO using
-// floats for the vertices and normals, and unsigned char for the colors (if
-// the array is non-null).
-void vtkOpenGLVertexBufferObject::AppendVBO(
-  vtkPoints *points, unsigned int numPts,
-  vtkDataArray *normals,
-  vtkDataArray *tcoords,
-  unsigned char *colors, int colorComponents)
-{
-  switch(points->GetDataType())
-    {
-    vtkTemplateMacro(
-      TemplatedAppendVBO(this, static_cast<VTK_TT*>(points->GetVoidPointer(0)),
-                normals, numPts, tcoords, colors, colorComponents));
-    }
-}
-
-// create a VBO, append the data to it, then upload it
-void vtkOpenGLVertexBufferObject::CreateVBO(
-  vtkPoints *points, unsigned int numPts,
-  vtkDataArray *normals,
-  vtkDataArray *tcoords,
-  unsigned char *colors, int colorComponents)
-{
-  // fast path
-  if (!tcoords && !normals && !colors && points->GetDataType() == VTK_FLOAT)
-    {
-    int blockSize = 3;
-    this->VertexOffset = 0;
-    this->NormalOffset = 0;
-    this->TCoordOffset = 0;
-    this->TCoordComponents = 0;
-    this->ColorComponents = 0;
-    this->ColorOffset = 0;
-    this->Stride = sizeof(float) * blockSize;
-    this->VertexCount = numPts;
-    this->Upload((float *)(points->GetVoidPointer(0)), numPts*3,
-      vtkOpenGLBufferObject::ArrayBuffer);
-    return;
-    }
-
-  // slower path
-  this->VertexCount = 0;
-  this->AppendVBO(points,numPts,normals,tcoords,colors,colorComponents);
-  this->Upload(this->PackedVBO, vtkOpenGLBufferObject::ArrayBuffer);
-  this->PackedVBO.resize(0);
-  return;
-}
-
-
-//-----------------------------------------------------------------------------
-void vtkOpenGLVertexBufferObject::PrintSelf(ostream& os, vtkIndent indent)
-{
-  this->Superclass::PrintSelf(os, indent);
-}
diff --git a/Rendering/OpenGL2/vtkOpenGLVertexBufferObject.h b/Rendering/OpenGL2/vtkOpenGLVertexBufferObject.h
deleted file mode 100644
index 7558eae..0000000
--- a/Rendering/OpenGL2/vtkOpenGLVertexBufferObject.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-
-  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.
-
-=========================================================================*/
-#ifndef vtkOpenGLVertexBufferObject_h
-#define vtkOpenGLVertexBufferObject_h
-
-#include "vtkRenderingOpenGL2Module.h" // for export macro
-#include "vtkOpenGLBufferObject.h"
-
-
-/**
- * @brief OpenGL vertex buffer object
- *
- * OpenGL buffer object to store geometry and/or attribute data on the
- * GPU.
- */
-
-
-// useful union for stuffing colors into a float
-union vtkucfloat
-{
-  unsigned char c[4];
-  float f;
-};
-
-class VTKRENDERINGOPENGL2_EXPORT vtkOpenGLVertexBufferObject :
-  public vtkOpenGLBufferObject
-{
-public:
-  static vtkOpenGLVertexBufferObject *New();
-  vtkTypeMacro(vtkOpenGLVertexBufferObject, vtkOpenGLBufferObject);
-  void PrintSelf(ostream& os, vtkIndent indent);
-
-  // Take the points, and pack them into this VBO. This currently
-  // takes whatever the input type might be and packs them into a VBO using
-  // floats for the vertices and normals, and unsigned char for the colors (if
-  // the array is non-null).
-  void CreateVBO(vtkPoints *points, unsigned int numPoints,
-      vtkDataArray *normals,
-      vtkDataArray *tcoords,
-      unsigned char *colors, int colorComponents);
-
-  void AppendVBO(vtkPoints *points, unsigned int numPoints,
-      vtkDataArray *normals,
-      vtkDataArray *tcoords,
-      unsigned char *colors, int colorComponents);
-
-  // Sizes/offsets are all in bytes as OpenGL API expects them.
-  size_t VertexCount; // Number of vertices in the VBO
-  int Stride;       // The size of a complete vertex + attributes
-  int VertexOffset; // Offset of the vertex
-  int NormalOffset; // Offset of the normal
-  int TCoordOffset; // Offset of the texture coordinates
-  int TCoordComponents; // Number of texture dimensions
-  int ColorOffset;  // Offset of the color
-  int ColorComponents; // Number of color components
-  std::vector<float> PackedVBO; // the data
-
-protected:
-  vtkOpenGLVertexBufferObject();
-  ~vtkOpenGLVertexBufferObject();
-
-private:
-  vtkOpenGLVertexBufferObject(const vtkOpenGLVertexBufferObject&); // Not implemented
-  void operator=(const vtkOpenGLVertexBufferObject&); // Not implemented
-};
-
-#endif
diff --git a/Rendering/OpenGL2/vtkRenderbuffer.cxx b/Rendering/OpenGL2/vtkRenderbuffer.cxx
index 50649fe..53883e4 100644
--- a/Rendering/OpenGL2/vtkRenderbuffer.cxx
+++ b/Rendering/OpenGL2/vtkRenderbuffer.cxx
@@ -46,19 +46,8 @@ bool vtkRenderbuffer::IsSupported(vtkRenderWindow *win)
   vtkOpenGLRenderWindow *glwin = dynamic_cast<vtkOpenGLRenderWindow*>(win);
   if (glwin)
     {
-#if GL_ES_VERSION_2_0 != 1
-    bool floatTex = (glewIsSupported("GL_ARB_texture_float") != 0);
-    bool floatDepth = (glewIsSupported("GL_ARB_depth_buffer_float") != 0);
-#else
-  // some of these may have extensions etc for ES 2.0
-  // setting to false right now as I do not know
-  bool floatTex = false;
-  bool floatDepth = false;
-#if GL_ES_VERSION_3_0 == 1
-  floatTex = true;
-  floatDepth = true;
-#endif
-#endif
+    bool floatTex = glewIsSupported("GL_ARB_texture_float");
+    bool floatDepth = glewIsSupported("GL_ARB_depth_buffer_float");
     bool fbo = true;
 
     supported = floatTex && floatDepth && fbo;
@@ -75,22 +64,19 @@ bool vtkRenderbuffer::LoadRequiredExtensions(vtkRenderWindow *win)
   vtkOpenGLRenderWindow *glwin = dynamic_cast<vtkOpenGLRenderWindow*>(win);
   if (glwin)
     {
-    bool fbo = true;
 
-#if GL_ES_VERSION_2_0 != 1
-    bool floatTex = (glewIsSupported("GL_ARB_texture_float") != 0);
-    this->DepthBufferFloat =
-      (glewIsSupported("GL_ARB_depth_buffer_float") != 0);
-#else
-    bool floatTex = false;
-    this->DepthBufferFloat = false;
-#if GL_ES_VERSION_3_0 == 1
-    floatTex = false;
-    this->DepthBufferFloat = true;
-#endif
-#endif
+    bool floatTex = glewIsSupported("GL_ARB_texture_float");
+    bool fbo = true;
 
     supported = floatTex && fbo;
+
+    if (supported)
+      {
+      // no functions to load for floatTex
+
+      // We'll use floating point depth buffers if they are available.
+      this->DepthBufferFloat = glewIsSupported("GL_ARB_depth_buffer_float");
+      }
     }
 
   return supported;
@@ -99,7 +85,7 @@ bool vtkRenderbuffer::LoadRequiredExtensions(vtkRenderWindow *win)
 //----------------------------------------------------------------------------
 void vtkRenderbuffer::Alloc()
 {
-  glGenRenderbuffers(1, &this->Handle);
+  glGenRenderbuffersEXT(1, &this->Handle);
   vtkOpenGLCheckErrorMacro("failed at glGenRenderbuffers");
 }
 
@@ -113,7 +99,7 @@ void vtkRenderbuffer::Free()
   // do nothing.
   if (this->Context && this->Handle)
     {
-    glDeleteRenderbuffers(1, &this->Handle);
+    glDeleteRenderbuffersEXT(1, &this->Handle);
     vtkOpenGLCheckErrorMacro("failed at glDeleteRenderBuffers");
     }
 }
@@ -192,10 +178,10 @@ int vtkRenderbuffer::Create(
 {
   assert(this->Context);
 
-  glBindRenderbuffer(GL_RENDERBUFFER, (GLuint)this->Handle);
+  glBindRenderbufferEXT(GL_RENDERBUFFER, (GLuint)this->Handle);
   vtkOpenGLCheckErrorMacro("failed at glBindRenderBuffer");
 
-  glRenderbufferStorage(GL_RENDERBUFFER, (GLenum)format, width, height);
+  glRenderbufferStorageEXT(GL_RENDERBUFFER, (GLenum)format, width, height);
   vtkOpenGLCheckErrorMacro("failed at glRenderbufferStorage");
 
   return 1;
diff --git a/Rendering/OpenGL2/vtkShader.cxx b/Rendering/OpenGL2/vtkShader.cxx
index 45de831..6d8dad2 100644
--- a/Rendering/OpenGL2/vtkShader.cxx
+++ b/Rendering/OpenGL2/vtkShader.cxx
@@ -50,28 +50,14 @@ bool vtkShader::Compile()
     }
 
   // Ensure we delete the previous shader if necessary.
-  if (this->Handle != 0)
+  if (Handle != 0)
     {
-    glDeleteShader(static_cast<GLuint>(this->Handle));
-    this->Handle = 0;
+    glDeleteShader(static_cast<GLuint>(Handle));
+    Handle = 0;
     }
 
-  GLenum type = GL_VERTEX_SHADER;
-  switch (this->ShaderType)
-    {
-#ifdef GL_GEOMETRY_SHADER
-    case vtkShader::Geometry:
-      type = GL_GEOMETRY_SHADER;
-      break;
-#endif
-    case vtkShader::Fragment:
-      type = GL_FRAGMENT_SHADER;
-      break;
-    case vtkShader::Vertex:
-    default:
-      type = GL_VERTEX_SHADER;
-      break;
-    }
+  GLenum type = ShaderType == Vertex ? GL_VERTEX_SHADER : GL_FRAGMENT_SHADER;
+  // TODO: handle geometry shaders if supported
 
   GLuint handle = glCreateShader(type);
   const GLchar *source = static_cast<const GLchar *>(this->Source.c_str());
diff --git a/Rendering/OpenGL2/vtkShader.h b/Rendering/OpenGL2/vtkShader.h
index cf6c4e2..6a9af8e 100644
--- a/Rendering/OpenGL2/vtkShader.h
+++ b/Rendering/OpenGL2/vtkShader.h
@@ -21,7 +21,6 @@
 #include "vtkObject.h"
 
 #include <string> // For member variables.
-#include <vector> // For member variables.
 
 /**
  * @brief Vertex or Fragment shader, combined into a ShaderProgram.
@@ -50,19 +49,19 @@ public:
   void SetType(Type type);
 
   /** Get the shader type, typically Vertex or Fragment. */
-  Type GetType() const { return this->ShaderType; }
+  Type GetType() const { return ShaderType; }
 
   /** Set the shader source to the supplied string. */
   void SetSource(const std::string &source);
 
   /** Get the source for the shader. */
-  std::string GetSource() const { return this->Source; }
+  std::string GetSource() const { return Source; }
 
   /** Get the error message (empty if none) for the shader. */
-  std::string GetError() const { return this->Error; }
+  std::string GetError() const { return Error; }
 
   /** Get the handle of the shader. */
-  int GetHandle() const { return this->Handle; }
+  int GetHandle() const { return Handle; }
 
   /** Compile the shader.
    * @note A valid context must to current in order to compile the shader.
diff --git a/Rendering/OpenGL2/vtkShaderProgram.cxx b/Rendering/OpenGL2/vtkShaderProgram.cxx
index 3e9924e..8c3c34b 100644
--- a/Rendering/OpenGL2/vtkShaderProgram.cxx
+++ b/Rendering/OpenGL2/vtkShaderProgram.cxx
@@ -60,27 +60,17 @@ inline GLenum convertTypeToGL(int type)
 
 vtkStandardNewMacro(vtkShaderProgram)
 
-vtkCxxSetObjectMacro(vtkShaderProgram,VertexShader,vtkShader)
-vtkCxxSetObjectMacro(vtkShaderProgram,FragmentShader,vtkShader)
-vtkCxxSetObjectMacro(vtkShaderProgram,GeometryShader,vtkShader)
-
-vtkShaderProgram::vtkShaderProgram()
-{
-  this->VertexShader = vtkShader::New();
-  this->VertexShader->SetType(vtkShader::Vertex);
-  this->FragmentShader = vtkShader::New();
-  this->FragmentShader->SetType(vtkShader::Fragment);
-  this->GeometryShader = vtkShader::New();
-  this->GeometryShader->SetType(vtkShader::Geometry);
-
-  this->Compiled = false;
-  this->NumberOfOutputs = 0;
-  this->Handle = 0;
-  this->VertexShaderHandle = 0;
-  this->FragmentShaderHandle = 0;
-  this->GeometryShaderHandle = 0;
-  this->Linked = false;
-  this->Bound = false;
+vtkShaderProgram::vtkShaderProgram() : Handle(0), VertexShaderHandle(0),
+  FragmentShaderHandle(0), Linked(false), Bound(false)
+{
+    this->VertexShader = vtkShader::New();
+    this->VertexShader->SetType(vtkShader::Vertex);
+    this->FragmentShader = vtkShader::New();
+    this->FragmentShader->SetType(vtkShader::Fragment);
+    this->GeometryShader = vtkShader::New();
+    this->GeometryShader->SetType(vtkShader::Geometry);
+
+    this->Compiled = false;
 }
 
 vtkShaderProgram::~vtkShaderProgram()
@@ -102,27 +92,6 @@ vtkShaderProgram::~vtkShaderProgram()
     }
 }
 
-// Process the string, and return a version with replacements.
-bool vtkShaderProgram::Substitute(std::string &source, const std::string &search,
-             const std::string replace, bool all)
-{
-  std::string::size_type pos = 0;
-  bool replaced = false;
-  while ((pos = source.find(search, 0)) != std::string::npos)
-    {
-    source.replace(pos, search.length(), replace);
-    if (!all)
-      {
-      return true;
-      }
-    pos += search.length();
-    replaced = true;
-    }
-  return replaced;
-}
-
-
-
 template <class T> bool vtkShaderProgram::SetAttributeArray(const char *name,
                                                 const T &array, int tupleSize,
                                                 NormalizeOption normalize)
@@ -164,34 +133,22 @@ bool vtkShaderProgram::AttachShader(const vtkShader *shader)
 
   if (shader->GetType() == vtkShader::Vertex)
     {
-    if (this->VertexShaderHandle != 0)
+    if (VertexShaderHandle != 0)
       {
-      glDetachShader(static_cast<GLuint>(this->Handle),
-                     static_cast<GLuint>(this->VertexShaderHandle));
+      glDetachShader(static_cast<GLuint>(Handle),
+                     static_cast<GLuint>(VertexShaderHandle));
       }
     this->VertexShaderHandle = shader->GetHandle();
     }
   else if (shader->GetType() == vtkShader::Fragment)
     {
-    if (this->FragmentShaderHandle != 0)
+    if (FragmentShaderHandle != 0)
       {
-      glDetachShader(static_cast<GLuint>(this->Handle),
-                     static_cast<GLuint>(this->FragmentShaderHandle));
+      glDetachShader(static_cast<GLuint>(Handle),
+                     static_cast<GLuint>(FragmentShaderHandle));
       }
     this->FragmentShaderHandle = shader->GetHandle();
     }
-  else if (shader->GetType() == vtkShader::Geometry)
-    {
-    if (this->GeometryShaderHandle != 0)
-      {
-      glDetachShader(static_cast<GLuint>(this->Handle),
-                     static_cast<GLuint>(this->GeometryShaderHandle));
-      }
-// only use GS if supported
-#ifdef GL_GEOMETRY_SHADER
-    this->GeometryShaderHandle = shader->GetHandle();
-#endif
-    }
   else
     {
     this->Error = "Unknown shader type encountered - this should not happen.";
@@ -251,22 +208,6 @@ bool vtkShaderProgram::DetachShader(const vtkShader *shader)
         this->Linked = false;
         return true;
         }
-#ifdef GL_GEOMETRY_SHADER
-    case vtkShader::Geometry:
-      if (this->GeometryShaderHandle != shader->GetHandle())
-        {
-        this->Error = "The supplied shader was not attached to this program.";
-        return false;
-        }
-      else
-        {
-        glDetachShader(static_cast<GLuint>(this->Handle),
-                       static_cast<GLuint>(shader->GetHandle()));
-        this->GeometryShaderHandle = 0;
-        this->Linked = false;
-        return true;
-        }
-#endif
     default:
       return false;
     }
@@ -285,22 +226,6 @@ bool vtkShaderProgram::Link()
     return false;
     }
 
-#if GL_ES_VERSION_2_0 != 1
-  // bind the outputs if specified
-  if (this->NumberOfOutputs)
-    {
-    for (unsigned int i = 0; i < this->NumberOfOutputs; i++)
-      {
-      // this naming has to match the bindings
-      // in vtkOpenGLShaderCache.cxx
-      std::ostringstream dst;
-      dst << "fragOutput" << i;
-      glBindFragDataLocation(static_cast<GLuint>(this->Handle), i,
-        dst.str().c_str());
-      }
-    }
-#endif
-
   GLint isCompiled;
   glLinkProgram(static_cast<GLuint>(this->Handle));
   glGetProgramiv(static_cast<GLuint>(this->Handle), GL_LINK_STATUS, &isCompiled);
@@ -367,30 +292,6 @@ int vtkShaderProgram::CompileShader()
     vtkErrorMacro(<< this->GetFragmentShader()->GetError());
     return 0;
     }
-#ifdef GL_GEOMETRY_SHADER
-  if (this->GetGeometryShader()->GetSource().size() > 0 &&
-      !this->GetGeometryShader()->Compile())
-    {
-    int lineNum = 1;
-    std::istringstream stream(this->GetGeometryShader()->GetSource());
-    std::stringstream sstm;
-    std::string aline;
-    while (std::getline(stream, aline))
-      {
-      sstm << lineNum << ": " << aline << "\n";
-      lineNum++;
-      }
-    vtkErrorMacro(<< sstm.str());
-    vtkErrorMacro(<< this->GetGeometryShader()->GetError());
-    return 0;
-    }
-  if (this->GetGeometryShader()->GetSource().size() > 0 &&
-      !this->AttachShader(this->GetGeometryShader()))
-    {
-    vtkErrorMacro(<< this->GetError());
-    return 0;
-    }
-#endif
   if (!this->AttachShader(this->GetVertexShader()))
     {
     vtkErrorMacro(<< this->GetError());
@@ -411,6 +312,8 @@ int vtkShaderProgram::CompileShader()
   return 1;
 }
 
+
+
 void vtkShaderProgram::Release()
 {
   glUseProgram(0);
@@ -425,10 +328,8 @@ void vtkShaderProgram::ReleaseGraphicsResources(vtkWindow *win)
     {
     this->DetachShader(this->VertexShader);
     this->DetachShader(this->FragmentShader);
-    this->DetachShader(this->GeometryShader);
     this->VertexShader->Cleanup();
     this->FragmentShader->Cleanup();
-    this->GeometryShader->Cleanup();
     this->Compiled = false;
     }
 
diff --git a/Rendering/OpenGL2/vtkShaderProgram.h b/Rendering/OpenGL2/vtkShaderProgram.h
index 75c9cbd..a5e4169 100644
--- a/Rendering/OpenGL2/vtkShaderProgram.h
+++ b/Rendering/OpenGL2/vtkShaderProgram.h
@@ -46,17 +46,14 @@ public:
   // Description:
   // Get the vertex shader for this program
   vtkGetObjectMacro(VertexShader, vtkShader);
-  void SetVertexShader(vtkShader*);
 
   // Description:
   // Get the fragment shader for this program
   vtkGetObjectMacro(FragmentShader, vtkShader);
-  void SetFragmentShader(vtkShader*);
 
   // Description:
   // Get the geometry shader for this program
   vtkGetObjectMacro(GeometryShader, vtkShader);
-  void SetGeometryShader(vtkShader*);
 
   // Description:
   // Set/Get flag for if this program is compiled
@@ -175,23 +172,6 @@ public:
   bool SetUniform3fv(const char *name, const int count, const float (*f)[3]);
   bool SetUniform4fv(const char *name, const int count, const float (*f)[4]);
 
-  // How many outputs does this program produce
-  // only valid for OpenGL 3.2 or later
-  vtkSetMacro(NumberOfOutputs,unsigned int);
-
-//BTX
-  // Description:
-  // perform in place string substitutions, indicate if a substitution was done
-  // this is useful for building up shader strings which typically involve
-  // lots of string substitutions. Return true if a substitution was done.
-  static bool Substitute(
-    std::string &source,
-    const std::string &search,
-    const std::string replace,
-    bool all = true);
-
-
-
 protected:
   vtkShaderProgram();
   ~vtkShaderProgram();
@@ -254,18 +234,11 @@ protected:
   int Handle;
   int VertexShaderHandle;
   int FragmentShaderHandle;
-  int GeometryShaderHandle;
 
   bool Linked;
   bool Bound;
   bool Compiled;
 
-  // for glsl 1.5 or later, how many outputs
-  // does this shader create
-  // they will be bound in order to
-  // fragOutput0 fragOutput1 etc...
-  unsigned int NumberOfOutputs;
-
   std::string Error;
 
   std::map<std::string, int> Attributes;
@@ -278,7 +251,6 @@ private:
 
   vtkShaderProgram(const vtkShaderProgram&);  // Not implemented.
   void operator=(const vtkShaderProgram&);  // Not implemented.
-//ETX
 };
 
 
diff --git a/Rendering/OpenGL2/vtkSobelGradientMagnitudePass.cxx b/Rendering/OpenGL2/vtkSobelGradientMagnitudePass.cxx
index 3ac1d9f..ba313bc 100644
--- a/Rendering/OpenGL2/vtkSobelGradientMagnitudePass.cxx
+++ b/Rendering/OpenGL2/vtkSobelGradientMagnitudePass.cxx
@@ -16,7 +16,6 @@
 #include "vtkSobelGradientMagnitudePass.h"
 #include "vtkObjectFactory.h"
 #include <cassert>
-
 #include "vtkRenderState.h"
 #include "vtkRenderer.h"
 #include "vtkFrameBufferObject.h"
@@ -24,10 +23,9 @@
 #include "vtkOpenGLRenderWindow.h"
 #include "vtkOpenGLShaderCache.h"
 #include "vtkOpenGLError.h"
-#include "vtkOpenGLVertexArrayObject.h"
 #include "vtkShaderProgram.h"
 
-#include "vtkOpenGLHelper.h"
+#include "vtkglVBOHelper.h"
 
 // to be able to dump intermediate passes into png files for debugging.
 // only for vtkSobelGradientMagnitudePass developers.
@@ -246,7 +244,7 @@ void vtkSobelGradientMagnitudePass::Render(const vtkRenderState *s)
     // has something changed that would require us to recreate the shaders?
     if (!this->Program1)
       {
-      this->Program1 = new vtkOpenGLHelper;
+      this->Program1 = new vtkgl::CellBO;
 
       // build the shader source code
       std::string VSSource = vtkTextureObjectVS;
@@ -255,23 +253,22 @@ void vtkSobelGradientMagnitudePass::Render(const vtkRenderState *s)
 
       // compile and bind it if needed
       vtkShaderProgram *newShader =
-        context->GetShaderCache()->ReadyShaderProgram(
-          VSSource.c_str(),
-          FSSource.c_str(),
-          GSSource.c_str());
+        context->GetShaderCache()->ReadyShader(VSSource.c_str(),
+                                              FSSource.c_str(),
+                                              GSSource.c_str());
 
       // if the shader changed reinitialize the VAO
       if (newShader != this->Program1->Program)
         {
         this->Program1->Program = newShader;
-        this->Program1->VAO->ShaderProgramChanged(); // reset the VAO as the shader has changed
+        this->Program1->vao.ShaderProgramChanged(); // reset the VAO as the shader has changed
         }
 
       this->Program1->ShaderSourceTime.Modified();
       }
     else
       {
-      context->GetShaderCache()->ReadyShaderProgram(this->Program1->Program);
+      context->GetShaderCache()->ReadyShader(this->Program1->Program);
       }
 
 #ifdef VTK_SOBEL_PASS_DEBUG
@@ -306,7 +303,7 @@ void vtkSobelGradientMagnitudePass::Render(const vtkRenderState *s)
 #endif
 
     this->FrameBufferObject->RenderQuad(0,w-1,0,h-1,
-      this->Program1->Program, this->Program1->VAO);
+      this->Program1->Program, &this->Program1->vao);
 
 #ifdef VTK_SOBEL_PASS_DEBUG
     cout << "sobel finish3" << endl;
@@ -381,7 +378,7 @@ void vtkSobelGradientMagnitudePass::Render(const vtkRenderState *s)
     // has something changed that would require us to recreate the shaders?
     if (!this->Program2)
       {
-      this->Program2 = new vtkOpenGLHelper;
+      this->Program2 = new vtkgl::CellBO;
 
       // build the shader source code
       std::string VSSource = vtkTextureObjectVS;
@@ -390,23 +387,22 @@ void vtkSobelGradientMagnitudePass::Render(const vtkRenderState *s)
 
       // compile and bind it if needed
       vtkShaderProgram *newShader =
-        context->GetShaderCache()->ReadyShaderProgram(
-          VSSource.c_str(),
-          FSSource.c_str(),
-          GSSource.c_str());
+        context->GetShaderCache()->ReadyShader(VSSource.c_str(),
+                                              FSSource.c_str(),
+                                              GSSource.c_str());
 
       // if the shader changed reinitialize the VAO
       if (newShader != this->Program2->Program)
         {
         this->Program2->Program = newShader;
-        this->Program2->VAO->ShaderProgramChanged(); // reset the VAO as the shader has changed
+        this->Program2->vao.ShaderProgramChanged(); // reset the VAO as the shader has changed
         }
 
       this->Program2->ShaderSourceTime.Modified();
       }
     else
       {
-      context->GetShaderCache()->ReadyShaderProgram(this->Program2->Program);
+      context->GetShaderCache()->ReadyShader(this->Program2->Program);
       }
 
 #ifdef VTK_SOBEL_PASS_DEBUG
@@ -464,8 +460,7 @@ void vtkSobelGradientMagnitudePass::Render(const vtkRenderState *s)
     this->Gy1->CopyToFrameBuffer(extraPixels, extraPixels,
                                   w-1-extraPixels,h-1-extraPixels,
                                   0, 0, width, height,
-                                  this->Program2->Program,
-                                  this->Program2->VAO);
+                                  this->Program2->Program, &this->Program2->vao);
 
     this->Gy1->Deactivate();
     this->Gx1->Deactivate();
diff --git a/Rendering/OpenGL2/vtkSobelGradientMagnitudePass.h b/Rendering/OpenGL2/vtkSobelGradientMagnitudePass.h
index f648552..6030505 100644
--- a/Rendering/OpenGL2/vtkSobelGradientMagnitudePass.h
+++ b/Rendering/OpenGL2/vtkSobelGradientMagnitudePass.h
@@ -59,11 +59,14 @@
 #include "vtkRenderingOpenGL2Module.h" // For export macro
 #include "vtkImageProcessingPass.h"
 
+class vtkOpenGLRenderWindow;
 class vtkDepthPeelingPassLayerList; // Pimpl
 class vtkFrameBufferObject;
-class vtkOpenGLHelper;
-class vtkOpenGLRenderWindow;
 class vtkTextureObject;
+namespace vtkgl
+{
+class CellBO;
+}
 
 
 class VTKRENDERINGOPENGL2_EXPORT vtkSobelGradientMagnitudePass : public vtkImageProcessingPass
@@ -103,8 +106,8 @@ public:
   vtkTextureObject *Gy1; // render target 1 for the first shader
 
   // Structures for the various cell types we render.
-  vtkOpenGLHelper *Program1; // shader to compute Gx1 and Gy1
-  vtkOpenGLHelper *Program2; // shader to compute |G| from Gx1 and Gy1
+  vtkgl::CellBO *Program1; // shader to compute Gx1 and Gy1
+  vtkgl::CellBO *Program2; // shader to compute |G| from Gx1 and Gy1
 
  private:
   vtkSobelGradientMagnitudePass(const vtkSobelGradientMagnitudePass&);  // Not implemented.
diff --git a/Rendering/OpenGL2/vtkTextureObject.cxx b/Rendering/OpenGL2/vtkTextureObject.cxx
index 930c7ed..fc6c8d3 100644
--- a/Rendering/OpenGL2/vtkTextureObject.cxx
+++ b/Rendering/OpenGL2/vtkTextureObject.cxx
@@ -24,17 +24,14 @@
 #endif
 
 #include "vtkNew.h"
-#include "vtkOpenGLBufferObject.h"
 #include "vtkOpenGLError.h"
-#include "vtkOpenGLRenderUtilities.h"
 #include "vtkOpenGLRenderWindow.h"
 #include "vtkOpenGLShaderCache.h"
 #include "vtkOpenGLTexture.h"
-#include "vtkOpenGLVertexArrayObject.h"
 #include "vtkRenderer.h"
 #include "vtkShaderProgram.h"
 
-#include "vtkOpenGLHelper.h"
+#include "vtkglVBOHelper.h"
 
 #include <cassert>
 
@@ -100,11 +97,11 @@ static const char *DepthTextureCompareFunctionAsString[8]=
   //----------------------------------------------------------------------------
   static GLenum OpenGLAlphaInternalFormat[5]=
   {
-    GL_R8,
-    GL_R8,
-    GL_R16,
-    GL_R16F,
-    GL_R32F
+    GL_ALPHA,
+    GL_ALPHA4,
+    GL_ALPHA8,
+    GL_ALPHA12,
+    GL_ALPHA16
   };
 
 #else
@@ -125,14 +122,13 @@ static const char *DepthTextureCompareFunctionAsString[8]=
   };
 
   //----------------------------------------------------------------------------
-  // Should be GL_RED but that requires an extension for ES 2.0
   static GLenum OpenGLAlphaInternalFormat[5]=
   {
-    GL_LUMINANCE,
-    GL_LUMINANCE,
-    GL_LUMINANCE,
-    GL_LUMINANCE,
-    GL_LUMINANCE
+    GL_ALPHA,
+    GL_ALPHA,
+    GL_ALPHA,
+    GL_ALPHA,
+    GL_ALPHA
   };
 
 #endif
@@ -254,7 +250,6 @@ vtkTextureObject::vtkTextureObject()
   this->BorderColor[1] = 0.0f;
   this->BorderColor[2] = 0.0f;
   this->BorderColor[3] = 0.0f;
-  this->BufferObject = 0;
 
   this->ResetFormatAndType();
 }
@@ -263,11 +258,6 @@ vtkTextureObject::vtkTextureObject()
 vtkTextureObject::~vtkTextureObject()
 {
   this->DestroyTexture();
-  if (this->ShaderProgram)
-    {
-    delete this->ShaderProgram;
-    this->ShaderProgram = NULL;
-    }
 }
 
 //----------------------------------------------------------------------------
@@ -277,15 +267,10 @@ bool vtkTextureObject::IsSupported(vtkOpenGLRenderWindow* vtkNotUsed(win),
       bool requireTexInt)
 {
 #if GL_ES_VERSION_2_0 != 1
-  if (vtkOpenGLRenderWindow::GetContextSupportsOpenGL32())
-    {
-    return true;
-    }
   bool texFloat = true;
   if (requireTexFloat)
     {
-    texFloat = (glewIsSupported("GL_ARB_texture_float") != 0
-     && glewIsSupported("GL_ARB_texture_rg") != 0);
+    texFloat = (glewIsSupported("GL_ARB_texture_float") != 0);
     }
 
   bool depthFloat = true;
@@ -318,24 +303,14 @@ bool vtkTextureObject::IsSupported(vtkOpenGLRenderWindow* vtkNotUsed(win),
 bool vtkTextureObject::LoadRequiredExtensions(vtkOpenGLRenderWindow *renWin)
 {
 #if GL_ES_VERSION_2_0 != 1
-  if (vtkOpenGLRenderWindow::GetContextSupportsOpenGL32())
-    {
-    this->SupportsTextureInteger = true;
-    this->SupportsTextureFloat = true;
-    this->SupportsDepthBufferFloat = true;
-    }
-  else
-    {
-    this->SupportsTextureInteger =
-      (glewIsSupported("GL_EXT_texture_integer") != 0);
+  this->SupportsTextureInteger =
+    (glewIsSupported("GL_EXT_texture_integer") != 0);
 
-    this->SupportsTextureFloat =
-      (glewIsSupported("GL_ARB_texture_float") != 0 &&
-       glewIsSupported("GL_ARB_texture_rg") != 0);
+  this->SupportsTextureFloat =
+    (glewIsSupported("GL_ARB_texture_float") != 0);
 
-    this->SupportsDepthBufferFloat =
-      (glewIsSupported("GL_ARB_depth_buffer_float") != 0);
-    }
+  this->SupportsDepthBufferFloat =
+    (glewIsSupported("GL_ARB_depth_buffer_float") != 0);
 #else
   // some of these may have extensions etc for ES 2.0
   // setting to false right now as I do not know
@@ -427,11 +402,7 @@ void vtkTextureObject::CreateTexture()
     vtkOpenGLCheckErrorMacro("failed at glGenTextures");
     this->Handle=tex;
 
-#if defined(GL_TEXTURE_BUFFER)
-    if (this->Target && this->Target != GL_TEXTURE_BUFFER)
-#else
     if (this->Target)
-#endif
       {
       glBindTexture(this->Target, this->Handle);
       vtkOpenGLCheckErrorMacro("failed at glBindTexture");
@@ -505,10 +476,11 @@ void vtkTextureObject::ReleaseGraphicsResources(vtkWindow *win)
   vtkOpenGLRenderWindow *rwin =
    vtkOpenGLRenderWindow::SafeDownCast(win);
 
-  if (rwin && this->Handle)
+  // It is almost guarenteed that in case of valid handle, we will have
+  // value other than zero. A check like this may be required at other
+  // places as well.
+  if (this->Handle && rwin)
     {
-    rwin->MakeCurrent();
-
     rwin->ActivateTexture(this);
     this->UnBind();
     rwin->DeactivateTexture(this);
@@ -517,7 +489,6 @@ void vtkTextureObject::ReleaseGraphicsResources(vtkWindow *win)
     this->Handle = 0;
     this->NumberOfDimensions = 0;
     this->Target =0;
-    this->InternalFormat = 0;
     this->Format = 0;
     this->Type = 0;
     this->Components = 0;
@@ -578,11 +549,6 @@ bool vtkTextureObject::IsBound()
         target=GL_TEXTURE_BINDING_3D;
         break;
 #endif
-#if defined(GL_TEXTURE_BUFFER) && defined(GL_TEXTURE_BINDING_BUFFER)
-      case GL_TEXTURE_BUFFER:
-        target=GL_TEXTURE_BINDING_BUFFER;
-        break;
-#endif
       default:
         assert("check: impossible case" && 0);
         break;
@@ -599,13 +565,6 @@ void vtkTextureObject::SendParameters()
 {
   assert("pre: is_bound" && this->IsBound());
 
-#if defined(GL_TEXTURE_BUFFER)
-  if (this->Target == GL_TEXTURE_BUFFER)
-    {
-    return;
-    }
-#endif
-
   glTexParameteri(this->Target,GL_TEXTURE_WRAP_S, OpenGLWrap[this->WrapS]);
   glTexParameteri(this->Target,GL_TEXTURE_WRAP_T, OpenGLWrap[this->WrapT]);
 
@@ -673,6 +632,15 @@ unsigned int vtkTextureObject::GetInternalFormat(int vtktype, int numComps,
     return this->InternalFormat;
     }
 
+  // 1 or 2 components not supported as render target in FBO on GeForce<8
+  // force internal format component to be 3 or 4, even if client format is 1
+  // or 2 components.
+  // see spec 2.1 page 137 (pdf page 151) in section 3.6.4 Rasterization of
+  // Pixel Rectangles: "Conversion to RGB": this step is applied only if
+  // the format is LUMINANCE or LUMINANCE_ALPHA:
+  // L: R=L, G=L, B=L
+  // LA: R=L, G=L, B=L, A=A
+
   // pre-condition
   if(vtktype==VTK_VOID && numComps != 1)
     {
@@ -681,7 +649,12 @@ unsigned int vtkTextureObject::GetInternalFormat(int vtktype, int numComps,
     this->InternalFormat = 0;
     return this->InternalFormat;
     }
+  const bool oldGeForce=!this->SupportsTextureInteger;
 
+  if(oldGeForce && numComps<3)
+    {
+    numComps+=2;
+    }
   // DON'T DEAL WITH VTK_CHAR as this is platform dependent.
   switch (vtktype)
     {
@@ -695,10 +668,10 @@ unsigned int vtkTextureObject::GetInternalFormat(int vtktype, int numComps,
         switch (numComps)
           {
           case 1:
-            this->InternalFormat = GL_R8I;
+            this->InternalFormat = GL_LUMINANCE8I_EXT;
             break;
           case 2:
-            this->InternalFormat = GL_RG8I;
+            this->InternalFormat = GL_LUMINANCE_ALPHA8I_EXT;
             break;
           case 3:
             this->InternalFormat = GL_RGB8I_EXT;
@@ -713,10 +686,10 @@ unsigned int vtkTextureObject::GetInternalFormat(int vtktype, int numComps,
         switch (numComps)
           {
           case 1:
-            this->InternalFormat = GL_R8;
+            this->InternalFormat = GL_LUMINANCE8;
             break;
           case 2:
-            this->InternalFormat = GL_RG8;
+            this->InternalFormat = GL_LUMINANCE8_ALPHA8;
             break;
           case 3:
             this->InternalFormat = GL_RGB8;
@@ -733,10 +706,10 @@ unsigned int vtkTextureObject::GetInternalFormat(int vtktype, int numComps,
         switch (numComps)
           {
           case 1:
-            this->InternalFormat = GL_R8UI;
+            this->InternalFormat = GL_LUMINANCE8UI_EXT;
             break;
           case 2:
-            this->InternalFormat = GL_RG8UI;
+            this->InternalFormat = GL_LUMINANCE_ALPHA8UI_EXT;
             break;
           case 3:
             this->InternalFormat = GL_RGB8UI_EXT;
@@ -751,10 +724,10 @@ unsigned int vtkTextureObject::GetInternalFormat(int vtktype, int numComps,
         switch (numComps)
           {
           case 1:
-            this->InternalFormat = GL_R8;
+            this->InternalFormat = GL_LUMINANCE8;
             break;
           case 2:
-            this->InternalFormat = GL_RG8;
+            this->InternalFormat = GL_LUMINANCE8_ALPHA8;
             break;
           case 3:
             this->InternalFormat = GL_RGB8;
@@ -771,10 +744,10 @@ unsigned int vtkTextureObject::GetInternalFormat(int vtktype, int numComps,
         switch (numComps)
           {
           case 1:
-            this->InternalFormat = GL_R16I;
+            this->InternalFormat = GL_LUMINANCE16I_EXT;
             break;
           case 2:
-            this->InternalFormat = GL_RG16I;
+            this->InternalFormat = GL_LUMINANCE_ALPHA16I_EXT;
             break;
           case 3:
             this->InternalFormat = GL_RGB16I_EXT;
@@ -791,8 +764,9 @@ unsigned int vtkTextureObject::GetInternalFormat(int vtktype, int numComps,
           case 1:
             if(this->SupportsTextureFloat)
               {
-              this->InternalFormat = GL_R32F;
+              this->InternalFormat = GL_LUMINANCE32F_ARB;
               break;
+  //            this->InternalFormat = GL_LUMINANCE16; // not supported as a render target
               }
             else
               {
@@ -803,8 +777,9 @@ unsigned int vtkTextureObject::GetInternalFormat(int vtktype, int numComps,
           case 2:
             if(this->SupportsTextureFloat)
               {
-              this->InternalFormat = GL_RG32F;
+              this->InternalFormat = GL_LUMINANCE_ALPHA32F_ARB;
               break;
+              //            this->InternalFormat = GL_LUMINANCE16_ALPHA16; // not supported as a render target
               }
             else
               {
@@ -827,10 +802,10 @@ unsigned int vtkTextureObject::GetInternalFormat(int vtktype, int numComps,
         switch (numComps)
           {
           case 1:
-            this->InternalFormat = GL_R16UI;
+            this->InternalFormat = GL_LUMINANCE16UI_EXT;
             break;
           case 2:
-            this->InternalFormat = GL_RG16UI;
+            this->InternalFormat = GL_LUMINANCE_ALPHA16UI_EXT;
             break;
           case 3:
             this->InternalFormat = GL_RGB16UI_EXT;
@@ -847,8 +822,9 @@ unsigned int vtkTextureObject::GetInternalFormat(int vtktype, int numComps,
           case 1:
             if(this->SupportsTextureFloat)
               {
-              this->InternalFormat = GL_R32F;
+              this->InternalFormat = GL_LUMINANCE32F_ARB;
               break;
+  //      this->InternalFormat = GL_LUMINANCE16; // not supported as a render target
               }
             else
               {
@@ -859,8 +835,9 @@ unsigned int vtkTextureObject::GetInternalFormat(int vtktype, int numComps,
           case 2:
             if(this->SupportsTextureFloat)
               {
-              this->InternalFormat = GL_RG32F;
+              this->InternalFormat = GL_LUMINANCE_ALPHA32F_ARB;
               break;
+  //      this->InternalFormat = GL_LUMINANCE16_ALPHA16; // not supported as a render target
               }
             else
               {
@@ -883,10 +860,10 @@ unsigned int vtkTextureObject::GetInternalFormat(int vtktype, int numComps,
         switch (numComps)
           {
           case 1:
-            this->InternalFormat = GL_R32I;
+            this->InternalFormat = GL_LUMINANCE32I_EXT;
             break;
           case 2:
-            this->InternalFormat = GL_RG32I;
+            this->InternalFormat = GL_LUMINANCE_ALPHA32I_EXT;
             break;
           case 3:
             this->InternalFormat = GL_RGB32I_EXT;
@@ -903,10 +880,10 @@ unsigned int vtkTextureObject::GetInternalFormat(int vtktype, int numComps,
           switch (numComps)
             {
             case 1:
-              this->InternalFormat = GL_R32F;
+              this->InternalFormat = GL_LUMINANCE32F_ARB;
               break;
             case 2:
-              this->InternalFormat = GL_RG32F;
+              this->InternalFormat = GL_LUMINANCE_ALPHA32F_ARB;
               break;
             case 3:
               this->InternalFormat = GL_RGB32F_ARB;
@@ -929,10 +906,10 @@ unsigned int vtkTextureObject::GetInternalFormat(int vtktype, int numComps,
         switch (numComps)
           {
           case 1:
-            this->InternalFormat = GL_R32UI;
+            this->InternalFormat = GL_LUMINANCE32UI_EXT;
             break;
           case 2:
-            this->InternalFormat = GL_RG32UI;
+            this->InternalFormat = GL_LUMINANCE_ALPHA32UI_EXT;
             break;
           case 3:
             this->InternalFormat = GL_RGB32UI_EXT;
@@ -949,10 +926,10 @@ unsigned int vtkTextureObject::GetInternalFormat(int vtktype, int numComps,
           switch (numComps)
             {
             case 1:
-              this->InternalFormat = GL_R32F;
+              this->InternalFormat = GL_LUMINANCE32F_ARB;
               break;
             case 2:
-              this->InternalFormat = GL_RG32F;
+              this->InternalFormat = GL_LUMINANCE_ALPHA32F_ARB;
               break;
             case 3:
               this->InternalFormat = GL_RGB32F_ARB;
@@ -975,10 +952,10 @@ unsigned int vtkTextureObject::GetInternalFormat(int vtktype, int numComps,
         switch (numComps)
           {
           case 1:
-            this->InternalFormat = GL_R32F;
+            this->InternalFormat = GL_LUMINANCE32F_ARB;
             break;
           case 2:
-            this->InternalFormat = GL_RG32F;
+            this->InternalFormat = GL_LUMINANCE_ALPHA32F_ARB;
             break;
           case 3:
             this->InternalFormat = GL_RGB32F_ARB;
@@ -1032,10 +1009,10 @@ unsigned int vtkTextureObject::GetInternalFormat(int vtktype, int numComps,
       switch (numComps)
         {
         case 1:
-          this->InternalFormat = GL_LUMINANCE; // GL_RED
+          this->InternalFormat = GL_LUMINANCE;
           break;
         case 2:
-          this->InternalFormat = GL_LUMINANCE_ALPHA; // GL_RG
+          this->InternalFormat = GL_LUMINANCE_ALPHA;
           break;
         case 3:
           this->InternalFormat = GL_RGB;
@@ -1092,10 +1069,10 @@ unsigned int vtkTextureObject::GetFormat(int vtktype, int numComps,
     switch (numComps)
       {
       case 1:
-        this->Format = GL_RED_INTEGER;
+        this->Format = GL_LUMINANCE_INTEGER_EXT;
         break;
       case 2:
-        this->Format = GL_RG_INTEGER;
+        this->Format = GL_LUMINANCE_ALPHA_INTEGER_EXT;
         break;
       case 3:
         this->Format = GL_RGB_INTEGER_EXT;
@@ -1106,23 +1083,7 @@ unsigned int vtkTextureObject::GetFormat(int vtktype, int numComps,
       }
     }
   else
-    {
-    switch (numComps)
-      {
-      case 1:
-        this->Format = GL_RED;
-        break;
-      case 2:
-        this->Format = GL_RG;
-        break;
-      case 3:
-        this->Format = GL_RGB;
-        break;
-      case 4:
-        this->Format = GL_RGBA;
-        break;
-      }
-#else
+#endif
     {
     switch (numComps)
       {
@@ -1139,7 +1100,6 @@ unsigned int vtkTextureObject::GetFormat(int vtktype, int numComps,
         this->Format = GL_RGBA;
         break;
       }
-#endif
     }
   return this->Format;
 }
@@ -1225,12 +1185,6 @@ static int vtkGetVTKType(GLenum gltype)
 }
 
 //----------------------------------------------------------------------------
-int vtkTextureObject::GetVTKDataType()
-{
-  return ::vtkGetVTKType(this->Type);
-}
-
-//----------------------------------------------------------------------------
 int vtkTextureObject::GetDataType(int vtk_scalar_type)
 {
   if (!this->Type)
@@ -1353,7 +1307,7 @@ bool vtkTextureObject::Create1D(int numComps,
 
   this->Target = target;
   this->CreateTexture();
-  this->Activate();
+  this->Bind();
 
   pbo->Bind(vtkPixelBufferObject::UNPACKED_BUFFER);
 
@@ -1366,7 +1320,7 @@ bool vtkTextureObject::Create1D(int numComps,
                type, BUFFER_OFFSET(0));
   vtkOpenGLCheckErrorMacro("failed at glTexImage1D");
   pbo->UnBind();
-  this->Deactivate();
+  this->UnBind();
 
   this->Target = target;
   this->Format = format;
@@ -1404,7 +1358,7 @@ bool vtkTextureObject::Create1DFromRaw(unsigned int width, int numComps,
   this->Depth = 1;
   this->NumberOfDimensions = 1;
   this->CreateTexture();
-  this->Activate();
+  this->Bind();
 
   glTexImage1D(this->Target,
                0,
@@ -1417,7 +1371,7 @@ bool vtkTextureObject::Create1DFromRaw(unsigned int width, int numComps,
 
   vtkOpenGLCheckErrorMacro("failed at glTexImage1D");
 
-  this->Deactivate();
+  this->UnBind();
   return true;
 }
 
@@ -1452,7 +1406,7 @@ bool vtkTextureObject::CreateAlphaFromRaw(unsigned int width,
     }
 
   this->Target = GL_TEXTURE_1D;
-  this->Format = GL_RED;
+  this->Format = GL_ALPHA;
   this->Width = width;
   this->Height = 1;
   this->Depth = 1;
@@ -1460,74 +1414,17 @@ bool vtkTextureObject::CreateAlphaFromRaw(unsigned int width,
   this->Components = 1;
 
   this->CreateTexture();
-  this->Activate();
+  this->Bind();
 
   glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
   glTexImage1D(this->Target, 0, static_cast<GLint>(this->InternalFormat),
                static_cast<GLsizei>(this->Width), 0,
                this->Format, this->Type, raw);
   vtkOpenGLCheckErrorMacro("failed at glTexImage1D");
-  this->Deactivate();
-  return true;
-}
-
-// Description:
-// Create a texture buffer basically a 1D texture that can be
-// very large for passing data into the fragment shader
-bool vtkTextureObject::CreateTextureBuffer(unsigned int numValues, int numComps,
-                         int dataType, vtkOpenGLBufferObject *bo)
-{
-  assert(this->Context);
-
-  // Now, detemine texture parameters using the arguments.
-  this->GetDataType(dataType);
-  this->GetInternalFormat(dataType, numComps, false);
-  this->GetFormat(dataType, numComps, false);
-
-  if (!this->InternalFormat || !this->Format || !this->Type)
-    {
-    vtkErrorMacro("Failed to detemine texture parameters.");
-    return false;
-    }
-
-  this->Target = GL_TEXTURE_BUFFER;
-  this->Components = numComps;
-  this->Width = numValues;
-  this->Height = 1;
-  this->Depth = 1;
-  this->NumberOfDimensions = 1;
-  this->BufferObject = bo;
-
-  this->CreateTexture();
-  this->Activate();
-
-  // Source texture data from the PBO.
-  glTexBuffer(
-      this->Target,
-      this->InternalFormat,
-      this->BufferObject->GetHandle());
-
-  vtkOpenGLCheckErrorMacro("failed at glTexBuffer");
-
-  this->Deactivate();
-
+  this->UnBind();
   return true;
 }
 
-#else
-
-// Description:
-// Create a texture buffer basically a 1D texture that can be
-// very large for passing data into the fragment shader
-bool vtkTextureObject::CreateTextureBuffer(unsigned int numValues, int numComps,
-                         int dataType, vtkOpenGLBufferObject *bo)
-{
-  assert(this->Context);
-  vtkErrorMacro("TextureBuffers not supported in OPenGL ES");
-  // TODO: implement 1D and Texture buffers using 2D textures
-  return false;
-}
-
 #endif // not ES 2.0 or 3.0
 
 #if GL_ES_VERSION_2_0 != 1 || GL_ES_VERSION_3_0 == 1
@@ -1569,7 +1466,7 @@ bool vtkTextureObject::Create2D(unsigned int width, unsigned int height,
   GLenum target = GL_TEXTURE_2D;
   this->Target = target;
   this->CreateTexture();
-  this->Activate();
+  this->Bind();
 
   // Source texture data from the PBO.
   pbo->Bind(vtkPixelBufferObject::UNPACKED_BUFFER);
@@ -1589,7 +1486,7 @@ bool vtkTextureObject::Create2D(unsigned int width, unsigned int height,
   vtkOpenGLCheckErrorMacro("failed at glTexImage2D");
 
   pbo->UnBind();
-  this->Deactivate();
+  this->UnBind();
 
   this->Target = target;
   this->Format = format;
@@ -1631,7 +1528,7 @@ bool vtkTextureObject::CreateDepth(unsigned int width,
   this->Components=1;
 
   this->CreateTexture();
-  this->Activate();
+  this->Bind();
 
   pbo->Bind(vtkPixelBufferObject::UNPACKED_BUFFER);
 
@@ -1642,7 +1539,7 @@ bool vtkTextureObject::CreateDepth(unsigned int width,
                this->Format, this->Type, BUFFER_OFFSET(0));
   vtkOpenGLCheckErrorMacro("failed at glTexImage2D");
   pbo->UnBind();
-  this->Deactivate();
+  this->UnBind();
   return true;
 }
 
@@ -1685,7 +1582,7 @@ bool vtkTextureObject::Create3D(unsigned int width, unsigned int height,
 
   this->Target = target;
   this->CreateTexture();
-  this->Activate();
+  this->Bind();
 
   pbo->Bind(vtkPixelBufferObject::UNPACKED_BUFFER);
 
@@ -1698,7 +1595,7 @@ bool vtkTextureObject::Create3D(unsigned int width, unsigned int height,
   vtkOpenGLCheckErrorMacro("failed at glTexImage3D");
 
   pbo->UnBind();
-  this->Deactivate();
+  this->UnBind();
 
   this->Target = target;
   this->Format = format;
@@ -1753,7 +1650,7 @@ vtkPixelBufferObject* vtkTextureObject::Download()
 #endif
 
   vtkOpenGLCheckErrorMacro("failed at glGetTexImage");
-  this->Deactivate();
+  this->UnBind();
   pbo->UnBind();
 
   pbo->SetComponents(this->Components);
@@ -1787,7 +1684,7 @@ bool vtkTextureObject::Create3DFromRaw(unsigned int width, unsigned int height,
   this->NumberOfDimensions = 3;
 
   this->CreateTexture();
-  this->Activate();
+  this->Bind();
 
   // Source texture data from the PBO.
   glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
@@ -1806,7 +1703,7 @@ bool vtkTextureObject::Create3DFromRaw(unsigned int width, unsigned int height,
 
   vtkOpenGLCheckErrorMacro("failed at glTexImage2D");
 
-  this->Deactivate();
+  this->UnBind();
 
   return true;
 }
@@ -1839,7 +1736,7 @@ bool vtkTextureObject::Create2DFromRaw(unsigned int width, unsigned int height,
   this->Depth = 1;
   this->NumberOfDimensions = 2;
   this->CreateTexture();
-  this->Activate();
+  this->Bind();
 
   // Source texture data from the PBO.
   glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
@@ -1857,7 +1754,7 @@ bool vtkTextureObject::Create2DFromRaw(unsigned int width, unsigned int height,
 
   vtkOpenGLCheckErrorMacro("failed at glTexImage2D");
 
-  this->Deactivate();
+  this->UnBind();
   return true;
 }
 
@@ -1901,7 +1798,7 @@ bool vtkTextureObject::CreateDepthFromRaw(unsigned int width,
   this->Components = 1;
 
   this->CreateTexture();
-  this->Activate();
+  this->Bind();
 
   glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
   glTexImage2D(this->Target, 0, static_cast<GLint>(this->InternalFormat),
@@ -1909,7 +1806,7 @@ bool vtkTextureObject::CreateDepthFromRaw(unsigned int width,
                static_cast<GLsizei>(this->Height), 0,
                this->Format, this->Type,raw);
   vtkOpenGLCheckErrorMacro("failed at glTexImage2D");
-  this->Deactivate();
+  this->UnBind();
   return true;
 }
 
@@ -1942,7 +1839,7 @@ bool vtkTextureObject::AllocateDepth(unsigned int width, unsigned int height,
   this->Components = 1;
 
   this->CreateTexture();
-  this->Activate();
+  this->Bind();
 
   glTexImage2D(
           this->Target,
@@ -1957,7 +1854,7 @@ bool vtkTextureObject::AllocateDepth(unsigned int width, unsigned int height,
 
   vtkOpenGLCheckErrorMacro("failed at glTexImage2D");
 
-  this->Deactivate();
+  this->UnBind();
   return true;
 }
 
@@ -1981,12 +1878,12 @@ bool vtkTextureObject::Allocate1D(unsigned int width, int numComps,
   this->NumberOfDimensions = 1;
 
   this->CreateTexture();
-  this->Activate();
+  this->Bind();
   glTexImage1D(this->Target, 0, static_cast<GLint>(this->InternalFormat),
                static_cast<GLsizei>(this->Width), 0, this->Format,
                this->Type,0);
   vtkOpenGLCheckErrorMacro("failed at glTexImage1D");
-  this->Deactivate();
+  this->UnBind();
   return true;
 #else
   return false;
@@ -2015,13 +1912,13 @@ bool vtkTextureObject::Allocate2D(unsigned int width,unsigned int height,
   this->NumberOfDimensions=2;
 
   this->CreateTexture();
-  this->Activate();
+  this->Bind();
   glTexImage2D(this->Target, 0, static_cast<GLint>(this->InternalFormat),
                static_cast<GLsizei>(this->Width),
                static_cast<GLsizei>(this->Height),
                0, this->Format, this->Type, 0);
   vtkOpenGLCheckErrorMacro("failed at glTexImage2D");
-  this->Deactivate();
+  this->UnBind();
   return true;
 }
 
@@ -2053,7 +1950,7 @@ bool vtkTextureObject::Allocate3D(unsigned int width,unsigned int height,
   this->NumberOfDimensions = 3;
 
   this->CreateTexture();
-  this->Activate();
+  this->Bind();
   glTexImage3D(this->Target, 0,
                static_cast<GLint>(this->InternalFormat),
                static_cast<GLsizei>(this->Width),
@@ -2061,7 +1958,7 @@ bool vtkTextureObject::Allocate3D(unsigned int width,unsigned int height,
                static_cast<GLsizei>(this->Depth), 0,
                this->Format, this->Type, 0);
   vtkOpenGLCheckErrorMacro("failed at glTexImage3D");
-  this->Deactivate();
+  this->UnBind();
   return true;
 #else
   return false;
@@ -2097,7 +1994,7 @@ bool vtkTextureObject::Create2D(unsigned int width, unsigned int height,
   this->NumberOfDimensions = 2;
 
   this->CreateTexture();
-  this->Activate();
+  this->Bind();
 
   // Allocate space for texture, don't upload any data.
   glTexImage2D(target, 0,
@@ -2106,7 +2003,7 @@ bool vtkTextureObject::Create2D(unsigned int width, unsigned int height,
                static_cast<GLsizei>(this->Height),
                0, this->Format, this->Type, NULL);
   vtkOpenGLCheckErrorMacro("failed at glTexImage2D");
-  this->Deactivate();
+  this->UnBind();
   return true;
 }
 
@@ -2139,7 +2036,7 @@ bool vtkTextureObject::Create3D(unsigned int width, unsigned int height,
   this->Depth = depth;
   this->NumberOfDimensions = 3;
   this->CreateTexture();
-  this->Activate();
+  this->Bind();
 
   // Allocate space for texture, don't upload any data.
   glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
@@ -2150,7 +2047,7 @@ bool vtkTextureObject::Create3D(unsigned int width, unsigned int height,
                static_cast<GLsizei>(this->Depth), 0,
                this->Format, this->Type, NULL);
   vtkOpenGLCheckErrorMacro("falied at glTexImage3D");
-  this->Deactivate();
+  this->UnBind();
 
   return true;
 #else
@@ -2160,10 +2057,8 @@ bool vtkTextureObject::Create3D(unsigned int width, unsigned int height,
 
 // ----------------------------------------------------------------------------
 void vtkTextureObject::CopyToFrameBuffer(
-  vtkShaderProgram *program, vtkOpenGLVertexArrayObject *vao)
+  vtkShaderProgram *program, vtkgl::VertexArrayObject *vao)
 {
-  // the following math really only works when texture
-  // and viewport are of the same dimensions
   float minXTexCoord=static_cast<float>(
     static_cast<double>(0.5)/this->Width);
   float minYTexCoord=static_cast<float>(
@@ -2196,7 +2091,7 @@ void vtkTextureObject::CopyToFrameBuffer(
   int srcXmax, int srcYmax,
   int dstXmin, int dstYmin,
   int dstSizeX, int dstSizeY,
-  vtkShaderProgram *program, vtkOpenGLVertexArrayObject *vao)
+  vtkShaderProgram *program, vtkgl::VertexArrayObject *vao)
 {
   float dstXmax = static_cast<float>(dstXmin+srcXmax-srcXmin);
   float dstYmax = static_cast<float>(dstYmin+srcYmax-srcYmin);
@@ -2213,7 +2108,7 @@ void vtkTextureObject::CopyToFrameBuffer(
   int dstXmin, int dstYmin,
   int dstXmax, int dstYmax,
   int dstSizeX, int dstSizeY,
-  vtkShaderProgram *program, vtkOpenGLVertexArrayObject *vao)
+  vtkShaderProgram *program, vtkgl::VertexArrayObject *vao)
 {
   assert("pre: positive_srcXmin" && srcXmin>=0);
   assert("pre: max_srcXmax" &&
@@ -2236,9 +2131,10 @@ void vtkTextureObject::CopyToFrameBuffer(
   float maxYTexCoord=static_cast<float>(
     static_cast<double>(srcYmax+0.5)/this->Height);
 
-  GLint saved_viewport[4];
-  glGetIntegerv(GL_VIEWPORT, saved_viewport);
+#if GL_ES_VERSION_2_0 != 1
+  glPushAttrib(GL_VIEWPORT_BIT);
   glViewport(0,0,dstSizeX,dstSizeY);
+#endif
 
   float tcoords[] = {
     minXTexCoord, minYTexCoord,
@@ -2254,12 +2150,13 @@ void vtkTextureObject::CopyToFrameBuffer(
 
     this->CopyToFrameBuffer(tcoords, verts, program, vao);
 
-    glViewport(saved_viewport[0], saved_viewport[1], saved_viewport[2],
-      saved_viewport[3]);
+#if GL_ES_VERSION_2_0 != 1
+    glPopAttrib();
+#endif
   }
 
 void vtkTextureObject::CopyToFrameBuffer(float *tcoords, float *verts,
-  vtkShaderProgram *program, vtkOpenGLVertexArrayObject *vao)
+  vtkShaderProgram *program, vtkgl::VertexArrayObject *vao)
 {
   vtkOpenGLClearErrorMacro();
 
@@ -2270,7 +2167,7 @@ void vtkTextureObject::CopyToFrameBuffer(float *tcoords, float *verts,
     {
     if (!this->ShaderProgram)
       {
-      this->ShaderProgram = new vtkOpenGLHelper;
+      this->ShaderProgram = new vtkgl::CellBO;
 
       // build the shader source code
       std::string VSSource = vtkTextureObjectVS;
@@ -2279,37 +2176,35 @@ void vtkTextureObject::CopyToFrameBuffer(float *tcoords, float *verts,
 
       // compile and bind it if needed
       vtkShaderProgram *newShader =
-        this->Context->GetShaderCache()->ReadyShaderProgram(
-          VSSource.c_str(),
-          FSSource.c_str(),
-          GSSource.c_str());
+        this->Context->GetShaderCache()->ReadyShader(VSSource.c_str(),
+                                           FSSource.c_str(),
+                                           GSSource.c_str());
 
       // if the shader changed reinitialize the VAO
       if (newShader != this->ShaderProgram->Program)
         {
         this->ShaderProgram->Program = newShader;
-        this->ShaderProgram->VAO->ShaderProgramChanged(); // reset the VAO as the shader has changed
+        this->ShaderProgram->vao.ShaderProgramChanged(); // reset the VAO as the shader has changed
         }
 
       this->ShaderProgram->ShaderSourceTime.Modified();
       }
     else
       {
-      this->Context->GetShaderCache()->ReadyShaderProgram(
-        this->ShaderProgram->Program);
+      this->Context->GetShaderCache()->ReadyShader(this->ShaderProgram->Program);
       }
 
     // bind and activate this texture
     this->Activate();
     int sourceId = this->GetTextureUnit();
     this->ShaderProgram->Program->SetUniformi("source",sourceId);
-    vtkOpenGLRenderUtilities::RenderQuad(verts, tcoords, this->ShaderProgram->Program,
-      this->ShaderProgram->VAO);
+    vtkOpenGLRenderWindow::RenderQuad(verts, tcoords, this->ShaderProgram->Program,
+      &this->ShaderProgram->vao);
     this->Deactivate();
     }
   else
     {
-    vtkOpenGLRenderUtilities::RenderQuad(verts, tcoords, program, vao);
+    vtkOpenGLRenderWindow::RenderQuad(verts, tcoords, program, vao);
     }
 
   vtkOpenGLCheckErrorMacro("failed after CopyToFrameBuffer")
diff --git a/Rendering/OpenGL2/vtkTextureObject.h b/Rendering/OpenGL2/vtkTextureObject.h
index 9735e81..faf2724 100644
--- a/Rendering/OpenGL2/vtkTextureObject.h
+++ b/Rendering/OpenGL2/vtkTextureObject.h
@@ -24,12 +24,14 @@
 #include "vtkObject.h"
 #include "vtkWeakPointer.h" // for render context
 
-class vtkOpenGLBufferObject;
-class vtkOpenGLHelper;
-class vtkOpenGLRenderWindow;
-class vtkOpenGLVertexArrayObject;
-class vtkShaderProgram;
 class vtkWindow;
+class vtkShaderProgram;
+class vtkOpenGLRenderWindow;
+namespace vtkgl
+{
+class VertexArrayObject;
+class CellBO;
+}
 
 #if GL_ES_VERSION_2_0 != 1 || GL_ES_VERSION_3_0 == 1
 class vtkPixelBufferObject;
@@ -101,10 +103,10 @@ public:
   enum
   {
     alpha=0,
+    alpha4,
     alpha8,
+    alpha12,
     alpha16,
-    alpha16f,
-    alpha32f,
     NumberOfAlphaFormats
   };
 
@@ -202,12 +204,6 @@ public:
                           int internalFormat, int rawType,
                           void *raw);
 
-  // Description:
-  // Create a texture buffer basically a 1D texture that can be
-  // very large for passing data into the fragment shader
-  bool CreateTextureBuffer(unsigned int numValues, int numComps,
-                           int dataType, vtkOpenGLBufferObject *bo);
-
 // 1D  textures are not supported in ES 2.0 or 3.0
 #if GL_ES_VERSION_2_0 != 1
 
@@ -314,10 +310,6 @@ public:
                 int numComps, int vtktype, bool shaderSupportsTextureInt);
 
   // Description:
-  // Get the data type for the texture as a vtk type int i.e. VTK_INT etc.
-  int GetVTKDataType();
-
-  // Description:
   // Get the data type for the texture as GLenum type.
   int GetDataType(int vtk_scalar_type);
   void SetDataType(unsigned int glType);
@@ -544,7 +536,7 @@ public:
   // signatures based on what you want to do
   // Copy the entire texture to the entire current viewport
   void CopyToFrameBuffer(vtkShaderProgram *program,
-                         vtkOpenGLVertexArrayObject *vao);
+                         vtkgl::VertexArrayObject *vao);
   // part of a texture to part of a viewport, scaling as needed
   void CopyToFrameBuffer(int srcXmin, int srcYmin,
                          int srcXmax, int srcYmax,
@@ -552,7 +544,7 @@ public:
                          int dstXmax, int dstYmax,
                          int dstSizeX, int dstSizeY,
                          vtkShaderProgram *program,
-                         vtkOpenGLVertexArrayObject *vao
+                         vtkgl::VertexArrayObject *vao
                          );
   // copy part of a texure to part of a viewport, no scalaing
   void CopyToFrameBuffer(int srcXmin, int srcYmin,
@@ -560,12 +552,12 @@ public:
                          int dstXmin, int dstYmin,
                          int dstSizeX, int dstSizeY,
                          vtkShaderProgram *program,
-                         vtkOpenGLVertexArrayObject *vao
+                         vtkgl::VertexArrayObject *vao
                          );
   // copy a texture to a quad using the provided tcoords and verts
   void CopyToFrameBuffer(float *tcoords, float *verts,
                          vtkShaderProgram *program,
-                         vtkOpenGLVertexArrayObject *vao
+                         vtkgl::VertexArrayObject *vao
                          );
 
 
@@ -646,10 +638,7 @@ protected:
   vtkTimeStamp SendParametersTime;
 
   // used for copying to framebuffer
-  vtkOpenGLHelper *ShaderProgram;
-
-  // for texturebuffers we hold on to the Buffer
-  vtkOpenGLBufferObject *BufferObject;
+  vtkgl::CellBO *ShaderProgram;
 
 private:
   vtkTextureObject(const vtkTextureObject&); // Not implemented.
diff --git a/Rendering/OpenGL2/vtkTextureUnitManager.cxx b/Rendering/OpenGL2/vtkTextureUnitManager.cxx
index 63eeaa8..4586467 100644
--- a/Rendering/OpenGL2/vtkTextureUnitManager.cxx
+++ b/Rendering/OpenGL2/vtkTextureUnitManager.cxx
@@ -50,7 +50,7 @@ void vtkTextureUnitManager::DeleteTable()
     bool valid=true;
     while(valid && i<c)
       {
-      valid = !this->TextureUnits[i];
+      valid = this->TextureUnits[i] > 0 ? false : true;
       ++i;
       }
     if(!valid)
@@ -78,12 +78,12 @@ void vtkTextureUnitManager::SetContext(vtkOpenGLRenderWindow *context)
       glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &this->NumberOfTextureUnits);
       if(this->NumberOfTextureUnits > 0)
         {
-        this->TextureUnits = new bool [this->NumberOfTextureUnits];
+        this->TextureUnits = new unsigned int[this->NumberOfTextureUnits];
         size_t i=0;
         size_t c=this->NumberOfTextureUnits;
         while(i<c)
           {
-          this->TextureUnits[i]=false;
+          this->TextureUnits[i]=0;
           ++i;
           }
         }
@@ -114,7 +114,7 @@ int vtkTextureUnitManager::Allocate()
   size_t c=this->NumberOfTextureUnits;
   while(!found && i<c)
     {
-    found = !this->TextureUnits[i];
+    found = (this->TextureUnits[i] > 0 ? false : true);
     ++i;
     }
 
@@ -122,11 +122,20 @@ int vtkTextureUnitManager::Allocate()
   if(found)
     {
     result=static_cast<int>(i-1);
-    this->TextureUnits[result] = true;
+    this->TextureUnits[result] += 1;
     }
   else
     {
-    result = -1;
+    int leastUsed = 0;
+    for (int j = 0; j < this->NumberOfTextureUnits; ++j)
+      {
+      if (this->TextureUnits[j] < this->TextureUnits[leastUsed])
+        {
+        leastUsed = j;
+        }
+      }
+    this->TextureUnits[leastUsed] += 1;
+    result = leastUsed;
     }
 
   assert("post: valid_result" && (result==-1 || (result>=0 && result<this->GetNumberOfTextureUnits())));
@@ -134,18 +143,6 @@ int vtkTextureUnitManager::Allocate()
   return result;
 }
 
-int vtkTextureUnitManager::Allocate(int unit)
-{
-  if (this->IsAllocated(unit))
-    {
-    return -1;
-    }
-
-  this->TextureUnits[unit] = true;
-
-  return unit;
-}
-
 // ----------------------------------------------------------------------------
 // Description:
 // Tell if texture unit `textureUnitId' is already allocated.
@@ -153,7 +150,7 @@ int vtkTextureUnitManager::Allocate(int unit)
 bool vtkTextureUnitManager::IsAllocated(int textureUnitId)
 {
   assert("pre: valid_textureUnitId_range" && textureUnitId>=0 && textureUnitId<this->GetNumberOfTextureUnits());
-  return (this->TextureUnits[textureUnitId] ? true : false);
+  return (this->TextureUnits[textureUnitId] > 0 ? true : false);
 }
 
 // ----------------------------------------------------------------------------
@@ -166,7 +163,14 @@ void vtkTextureUnitManager::Free(int textureUnitId)
   assert("pre: valid_textureUnitId" && (textureUnitId>=0 && textureUnitId<this->GetNumberOfTextureUnits()));
 //  assert("pre: allocated_textureUnitId" && this->IsAllocated(textureUnitId));
 
-  this->TextureUnits[textureUnitId] = false;
+  if (this->TextureUnits[textureUnitId] >= 1)
+    {
+    this->TextureUnits[textureUnitId] -= 1;
+    }
+  else
+    {
+    this->TextureUnits[textureUnitId] = 0;
+    }
 }
 
 // ----------------------------------------------------------------------------
diff --git a/Rendering/OpenGL2/vtkTextureUnitManager.h b/Rendering/OpenGL2/vtkTextureUnitManager.h
index c9f5606..3811745 100644
--- a/Rendering/OpenGL2/vtkTextureUnitManager.h
+++ b/Rendering/OpenGL2/vtkTextureUnitManager.h
@@ -62,18 +62,6 @@ public:
   virtual int Allocate();
 
   // Description:
-  // Reserve a specific texture unit if not already in use.
-  // This method should only be used when interacting with 3rd
-  // party code that is allocating and using textures. It allows
-  // someone to reserve a texture unit for that code and later release
-  // it. VTK will not use that texture unit until it is released.
-  // It returns -1 if the allocation failed (because there are no more
-  // texture units left).
-  // \post valid_result: result==-1 || result>=0 && result<this->GetNumberOfTextureUnits())
-  // \post allocated: result==-1 || this->IsAllocated(result)
-  virtual int Allocate(int unit);
-
-  // Description:
   // Tell if texture unit `textureUnitId' is already allocated.
   // \pre valid_textureUnitId_range : textureUnitId>=0 && textureUnitId<this->GetNumberOfTextureUnits()
   bool IsAllocated(int textureUnitId);
@@ -101,7 +89,7 @@ protected:
   vtkOpenGLRenderWindow *Context;
 
   int NumberOfTextureUnits;
-  bool *TextureUnits;
+  unsigned int *TextureUnits;
 
 private:
   vtkTextureUnitManager(const vtkTextureUnitManager&);  // Not implemented.
diff --git a/Rendering/OpenGL2/vtkWin32OpenGLRenderWindow.cxx b/Rendering/OpenGL2/vtkWin32OpenGLRenderWindow.cxx
index a1951da..8c95c15 100644
--- a/Rendering/OpenGL2/vtkWin32OpenGLRenderWindow.cxx
+++ b/Rendering/OpenGL2/vtkWin32OpenGLRenderWindow.cxx
@@ -21,7 +21,7 @@ PURPOSE.  See the above copyright notice for more information.
 #include "vtkOpenGLRenderWindow.h"
 #include "vtkOpenGLError.h"
 #include "vtkRendererCollection.h"
-#include "vtkWin32RenderWindowInteractor.h"
+#include "vtkWin32OpenGLRenderWindowInteractor.h"
 
 #include <math.h>
 #include <vtksys/ios/sstream>
@@ -435,19 +435,13 @@ const char* vtkWin32OpenGLRenderWindow::ReportCapabilities()
   const char *glVendor = (const char *) glGetString(GL_VENDOR);
   const char *glRenderer = (const char *) glGetString(GL_RENDERER);
   const char *glVersion = (const char *) glGetString(GL_VERSION);
+  const char *glExtensions = (const char *) glGetString(GL_EXTENSIONS);
 
   vtksys_ios::ostringstream strm;
   strm << "OpenGL vendor string:  " << glVendor << endl;
   strm << "OpenGL renderer string:  " << glRenderer << endl;
   strm << "OpenGL version string:  " << glVersion << endl;
-  strm << "OpenGL extensions:  " << endl;
-  GLint n, i;
-  glGetIntegerv(GL_NUM_EXTENSIONS, &n);
-  for (i = 0; i < n; i++)
-    {
-    const char *ext = (const char *)glGetStringi(GL_EXTENSIONS, i);
-    strm << "  " << ext << endl;
-    }
+  strm << "OpenGL extensions:  " << glExtensions << endl;
   strm << "PixelFormat Descriptor:" << endl;
   strm << "depth:  " << static_cast<int>(pfd.cDepthBits) << endl;
   if (pfd.cColorBits <= 8)
@@ -500,6 +494,55 @@ const char* vtkWin32OpenGLRenderWindow::ReportCapabilities()
 
 typedef bool (APIENTRY *wglChoosePixelFormatARBType)(HDC, const int*, const float*, unsigned int, int*, unsigned int*);
 
+bool WGLisExtensionSupported(const char *extension)
+{
+  const size_t extlen = strlen(extension);
+  const char *supported = NULL;
+
+  // Try To Use wglGetExtensionStringARB On Current DC, If Possible
+  PROC wglGetExtString = wglGetProcAddress("wglGetExtensionsStringARB");
+
+  if (wglGetExtString)
+    {
+    supported = ((char*(__stdcall*)(HDC))wglGetExtString)(wglGetCurrentDC());
+    }
+
+  // If That Failed, Try Standard Opengl Extensions String
+  if (supported == NULL)
+    {
+    supported = (char*)glGetString(GL_EXTENSIONS);
+    }
+
+  // If That Failed Too, Must Be No Extensions Supported
+  if (supported == NULL)
+    {
+    return false;
+    }
+
+  // Begin Examination At Start Of String, Increment By 1 On False Match
+  for (const char* p = supported; ; p++)
+    {
+    // Advance p Up To The Next Possible Match
+    p = strstr(p, extension);
+
+    if (p == NULL)
+      {
+      return false; // No Match
+      }
+
+    // Make Sure That Match Is At The Start Of The String Or That
+    // The Previous Char Is A Space, Or Else We Could Accidentally
+    // Match "wglFunkywglExtension" With "wglExtension"
+
+    // Also, Make Sure That The Following Character Is Space Or NULL
+    // Or Else "wglExtensionTwo" Might Match "wglExtension"
+    if ((p==supported || p[-1]==' ') && (p[extlen]=='\0' || p[extlen]==' '))
+      {
+      return true; // Match
+      }
+    }
+}
+
 void vtkWin32OpenGLRenderWindow::SetupPixelFormatPaletteAndContext(
   HDC hDC, DWORD dwFlags,
   int debug, int bpp,
@@ -528,7 +571,6 @@ void vtkWin32OpenGLRenderWindow::SetupPixelFormatPaletteAndContext(
 
   // First we try to use the newer wglChoosePixelFormatARB which enables
   // features like multisamples.
-  PIXELFORMATDESCRIPTOR pfd;
   int pixelFormat = 0;
   wglChoosePixelFormatARBType wglChoosePixelFormatARB =
     reinterpret_cast<wglChoosePixelFormatARBType>(wglGetProcAddress("wglChoosePixelFormatARB"));
@@ -563,8 +605,7 @@ void vtkWin32OpenGLRenderWindow::SetupPixelFormatPaletteAndContext(
       n += 2;
       }
     unsigned int multiSampleAttributeIndex = 0;
-    if (this->MultiSamples > 1 &&
-        wglewIsSupported("WGL_ARB_multisample"))
+    if (this->MultiSamples > 1 && WGLisExtensionSupported("WGL_ARB_multisample"))
       {
       attrib[n] = WGL_SAMPLE_BUFFERS_ARB;
       attrib[n+1] = 1;
@@ -588,20 +629,12 @@ void vtkWin32OpenGLRenderWindow::SetupPixelFormatPaletteAndContext(
           }
         }
       }
-
+    PIXELFORMATDESCRIPTOR pfd;
     DescribePixelFormat(hDC, pixelFormat, sizeof(pfd), &pfd);
     if (!SetPixelFormat(hDC, pixelFormat, &pfd))
       {
       pixelFormat = 0;
       }
-    else
-      {
-      if (debug && (dwFlags & PFD_STEREO) && !(pfd.dwFlags & PFD_STEREO))
-        {
-        vtkGenericWarningMacro("No Stereo Available!");
-        this->StereoCapableWindow = 0;
-        }
-      }
     }
 
   // If we got a valid pixel format in the process, we are done.
@@ -611,34 +644,31 @@ void vtkWin32OpenGLRenderWindow::SetupPixelFormatPaletteAndContext(
     this->SetupPalette(hDC);
 
     // create a context
-#define USE_32_CONTEXT
-#ifdef USE_32_CONTEXT
-    PFNWGLCREATECONTEXTATTRIBSARBPROC wglCreateContextAttribsARB =
-      reinterpret_cast<PFNWGLCREATECONTEXTATTRIBSARBPROC>(wglGetProcAddress("wglCreateContextAttribsARB"));
-    if (wglCreateContextAttribsARB)
-      {
-      int iContextAttribs[] =
-        {
-        WGL_CONTEXT_MAJOR_VERSION_ARB, 3,
-        WGL_CONTEXT_MINOR_VERSION_ARB, 2,
-        WGL_CONTEXT_FLAGS_ARB, 0,
-  //      WGL_CONTEXT_PROFILE_MASK_ARB,
-  //    WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB,
-        // WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB,
-        0 // End of attributes list
-        };
-
-      this->ContextId = wglCreateContextAttribsARB(hDC, 0, iContextAttribs);
-      }
-    if (this->ContextId)
-      {
-      this->SetContextSupportsOpenGL32(true);
-      }
-    else
-#endif
-      {
+    // PFNWGLCREATECONTEXTATTRIBSARBPROC wglCreateContextAttribsARB =
+    //   reinterpret_cast<PFNWGLCREATECONTEXTATTRIBSARBPROC>(wglGetProcAddress("wglCreateContextAttribsARB"));
+    // if (wglCreateContextAttribsARB)
+    //   {
+    //   int iContextAttribs[] =
+    //     {
+    //     WGL_CONTEXT_MAJOR_VERSION_ARB, 3,
+    //     WGL_CONTEXT_MINOR_VERSION_ARB, 2,
+    //     WGL_CONTEXT_FLAGS_ARB, 0,
+    //     WGL_CONTEXT_PROFILE_MASK_ARB,
+    //       WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB,
+    //     // WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB,
+    //     0 // End of attributes list
+    //     };
+
+    //   this->ContextId = wglCreateContextAttribsARB(hDC, 0, iContextAttribs);
+    //   }
+    // if (this->ContextId)
+    //   {
+    //   this->SetContextSupportsOpenGL32(true);
+    //   }
+    // else
+    //   {
       this->ContextId = wglCreateContext(hDC);
-      }
+//     }
     if (this->ContextId == NULL)
       {
       vtkErrorMacro("wglCreateContext failed in CreateAWindow(), error: " << GetLastError());
@@ -658,21 +688,19 @@ void vtkWin32OpenGLRenderWindow::SetupPixelFormatPaletteAndContext(
     return;
     }
 
-  BYTE bpp_byte = static_cast<BYTE>(bpp);
-  BYTE zbpp_byte = static_cast<BYTE>(zbpp);
-  PIXELFORMATDESCRIPTOR pfd2 = {
+  PIXELFORMATDESCRIPTOR pfd = {
     sizeof(PIXELFORMATDESCRIPTOR),  /* size */
     1,                              /* version */
-    dwFlags,                        /* support double-buffering */
+    dwFlags         ,               /* support double-buffering */
     PFD_TYPE_RGBA,                  /* color type */
-    bpp_byte,                       /* preferred color depth */
+    bpp,                             /* preferred color depth */
     0, 0, 0, 0, 0, 0,               /* color bits (ignored) */
-    static_cast<BYTE>(this->AlphaBitPlanes ? bpp/4 : 0), /* no alpha buffer */
+    this->AlphaBitPlanes ? bpp/4 : 0, /* no alpha buffer */
     0,                              /* alpha bits (ignored) */
     0,                              /* no accumulation buffer */
     0, 0, 0, 0,                     /* accum bits (ignored) */
-    zbpp_byte,                      /* depth buffer */
-    static_cast<BYTE>(this->StencilCapable), /* stencil buffer */
+    zbpp,                           /* depth buffer */
+    this->StencilCapable,           /* stencil buffer */
     0,                              /* no auxiliary buffers */
     PFD_MAIN_PLANE,                 /* main layer */
     0,                              /* reserved */
@@ -684,8 +712,8 @@ void vtkWin32OpenGLRenderWindow::SetupPixelFormatPaletteAndContext(
   // supports OpenGL
   if (currentPixelFormat != 0)
     {
-    DescribePixelFormat(hDC, currentPixelFormat,sizeof(pfd2), &pfd2);
-    if (!(pfd2.dwFlags & PFD_SUPPORT_OPENGL))
+    DescribePixelFormat(hDC, currentPixelFormat,sizeof(pfd), &pfd);
+    if (!(pfd.dwFlags & PFD_SUPPORT_OPENGL))
       {
 #ifdef UNICODE
       MessageBox(WindowFromDC(hDC),
@@ -712,7 +740,7 @@ void vtkWin32OpenGLRenderWindow::SetupPixelFormatPaletteAndContext(
   else
     {
     // hDC has no current PixelFormat, so
-    pixelFormat = ChoosePixelFormat(hDC, &pfd2);
+    pixelFormat = ChoosePixelFormat(hDC, &pfd);
     if (pixelFormat == 0)
       {
 #ifdef UNICODE
@@ -732,8 +760,8 @@ void vtkWin32OpenGLRenderWindow::SetupPixelFormatPaletteAndContext(
         exit(1);
         }
       }
-    DescribePixelFormat(hDC, pixelFormat,sizeof(pfd2), &pfd2);
-    if (SetPixelFormat(hDC, pixelFormat, &pfd2) != TRUE)
+    DescribePixelFormat(hDC, pixelFormat,sizeof(pfd), &pfd);
+    if (SetPixelFormat(hDC, pixelFormat, &pfd) != TRUE)
       {
       // int err = GetLastError();
 #ifdef UNICODE
@@ -754,7 +782,7 @@ void vtkWin32OpenGLRenderWindow::SetupPixelFormatPaletteAndContext(
         }
       }
     }
-  if (debug && (dwFlags & PFD_STEREO) && !(pfd2.dwFlags & PFD_STEREO))
+  if (debug && (dwFlags & PFD_STEREO) && !(pfd.dwFlags & PFD_STEREO))
     {
     vtkGenericWarningMacro("No Stereo Available!");
     this->StereoCapableWindow = 0;
@@ -1092,6 +1120,9 @@ void vtkWin32OpenGLRenderWindow::WindowInitialize()
     this->MakeCurrent(); // hsr
     this->OpenGLInit();
     }
+
+  // set the DPI
+  this->SetDPI(GetDeviceCaps(this->DeviceContext, LOGPIXELSY));
 }
 
 // Initialize the rendering window.
@@ -1745,10 +1776,3 @@ void vtkWin32OpenGLRenderWindow::SetCurrentCursor(int shape)
     SetCursor((HCURSOR)cursor);
     }
 }
-
-//----------------------------------------------------------------------------
-bool vtkWin32OpenGLRenderWindow::DetectDPI()
-{
-  this->SetDPI(GetDeviceCaps(this->DeviceContext, LOGPIXELSY));
-  return true;
-}
diff --git a/Rendering/OpenGL2/vtkWin32OpenGLRenderWindow.h b/Rendering/OpenGL2/vtkWin32OpenGLRenderWindow.h
index bad5f3d..043196c 100644
--- a/Rendering/OpenGL2/vtkWin32OpenGLRenderWindow.h
+++ b/Rendering/OpenGL2/vtkWin32OpenGLRenderWindow.h
@@ -217,8 +217,6 @@ public:
   // Change the shape of the cursor
   virtual void SetCurrentCursor(int);
 
-  virtual bool DetectDPI();
-
   // Description:
   // Override the default implementation so that we can actively switch between
   // on and off screen rendering.
diff --git a/Rendering/OpenGL2/vtkWin32OpenGLRenderWindowInteractor.cxx b/Rendering/OpenGL2/vtkWin32OpenGLRenderWindowInteractor.cxx
new file mode 100644
index 0000000..7da2d82
--- /dev/null
+++ b/Rendering/OpenGL2/vtkWin32OpenGLRenderWindowInteractor.cxx
@@ -0,0 +1,1068 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+  Module:    vtkWin32OpenGLRenderWindowInteractor.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 <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+
+
+#ifndef _WIN32_WINNT
+#define _WIN32_WINNT 0x0501  // for trackmouseevent support, 0x0501 means target Windows XP or later
+//#define _WIN32_WINNT 0x0601  // for touch support, 0x0601 means target Windows 7 or later
+#endif
+
+#include "vtkWin32OpenGLRenderWindow.h"
+
+// Mouse wheel support
+// In an ideal world we would just have to include <zmouse.h>, but it is not
+// always available with all compilers/headers
+#ifndef WM_MOUSEWHEEL
+#  define WM_MOUSEWHEEL                   0x020A
+#endif  //WM_MOUSEWHEEL
+#ifndef GET_WHEEL_DELTA_WPARAM
+#  define GET_WHEEL_DELTA_WPARAM(wparam) ((short)HIWORD (wparam))
+#endif  //GET_WHEEL_DELTA_WPARAM
+
+// MSVC does the right thing without the forward declaration when it
+// sees it in the friend decl in vtkWin32OpenGLRenderWindowInteractor, but
+// GCC needs to see the declaration beforehand. It has to do with the
+// CALLBACK attribute.
+VTKRENDERINGOPENGL2_EXPORT LRESULT CALLBACK vtkHandleMessage(HWND,UINT,WPARAM,LPARAM);
+VTKRENDERINGOPENGL2_EXPORT LRESULT CALLBACK vtkHandleMessage2(HWND,UINT,WPARAM,LPARAM,class vtkWin32OpenGLRenderWindowInteractor*);
+
+#include "vtkWin32OpenGLRenderWindowInteractor.h"
+#include "vtkActor.h"
+#include "vtkObjectFactory.h"
+#include "vtkCommand.h"
+
+#ifdef VTK_USE_TDX
+#include "vtkTDxWinDevice.h"
+#endif
+
+// we hard define the touch structures we use since we cannot take them
+// from the header without requiring windows 7 (stupid stupid stupid!)
+// so we define them and then do a runtime checks and function pointers
+// to avoid a link requirement on Windows 7
+#define MOUSEEVENTF_FROMTOUCH 0xFF515700
+#define WM_TOUCH              0x0240
+#define TOUCH_COORD_TO_PIXEL(l)  ((l) / 100)
+typedef struct _TOUCHINPUT {
+  LONG      x;
+  LONG      y;
+  HANDLE    hSource;
+  DWORD     dwID;
+  DWORD     dwFlags;
+  DWORD     dwMask;
+  DWORD     dwTime;
+  ULONG_PTR dwExtraInfo;
+  DWORD     cxContact;
+  DWORD     cyContact;
+} TOUCHINPUT, *PTOUCHINPUT;
+DECLARE_HANDLE(HTOUCHINPUT);
+//#define HTOUCHINPUT ULONG
+#define TOUCHEVENTF_MOVE  0x0001
+#define TOUCHEVENTF_DOWN  0x0002
+#define TOUCHEVENTF_UP  0x0004
+typedef bool (WINAPI *RegisterTouchWindowType)(HWND,ULONG);
+typedef bool (WINAPI *GetTouchInputInfoType)(HTOUCHINPUT,UINT,PTOUCHINPUT,int);
+typedef bool (WINAPI *CloseTouchInputHandleType)(HTOUCHINPUT);
+
+vtkStandardNewMacro(vtkWin32OpenGLRenderWindowInteractor);
+
+void (*vtkWin32OpenGLRenderWindowInteractor::ClassExitMethod)(void *) = (void (*)(void *))NULL;
+void *vtkWin32OpenGLRenderWindowInteractor::ClassExitMethodArg = (void *)NULL;
+void (*vtkWin32OpenGLRenderWindowInteractor::ClassExitMethodArgDelete)(void *) = (void (*)(void *))NULL;
+
+//----------------------------------------------------------------------------
+// Construct object so that light follows camera motion.
+vtkWin32OpenGLRenderWindowInteractor::vtkWin32OpenGLRenderWindowInteractor()
+{
+  this->WindowId           = 0;
+  this->InstallMessageProc = 1;
+  this->MouseInWindow = 0;
+  this->StartedMessageLoop = 0;
+
+  for (int i=0; i < VTKI_MAX_POINTERS; i++)
+    {
+    this->IDLookup[i] = -1;
+    }
+
+#ifdef VTK_USE_TDX
+  this->Device=vtkTDxWinDevice::New();
+#endif
+}
+
+//----------------------------------------------------------------------------
+vtkWin32OpenGLRenderWindowInteractor::~vtkWin32OpenGLRenderWindowInteractor()
+{
+  vtkWin32OpenGLRenderWindow *tmp;
+
+  // we need to release any hold we have on a windows event loop
+  if (this->WindowId && this->Enabled && this->InstallMessageProc)
+    {
+    vtkWin32OpenGLRenderWindow *ren;
+    ren = static_cast<vtkWin32OpenGLRenderWindow *>(this->RenderWindow);
+    tmp = (vtkWin32OpenGLRenderWindow *)(vtkGetWindowLong(this->WindowId,sizeof(vtkLONG)));
+    // watch for odd conditions
+    if ((tmp != ren) && (ren != NULL))
+      {
+      // OK someone else has a hold on our event handler
+      // so lets have them handle this stuff
+      // well send a USER message to the other
+      // event handler so that it can properly
+      // call this event handler if required
+      CallWindowProc(this->OldProc,this->WindowId,WM_USER+14,28,(intptr_t)this->OldProc);
+      }
+    else
+      {
+      vtkSetWindowLong(this->WindowId,vtkGWL_WNDPROC,(intptr_t)this->OldProc);
+      }
+    this->Enabled = 0;
+    }
+#ifdef VTK_USE_TDX
+  this->Device->Delete();
+#endif
+}
+
+//----------------------------------------------------------------------------
+void vtkWin32OpenGLRenderWindowInteractor::StartEventLoop()
+{
+  // No need to do anything if this is a 'mapped' interactor
+  if (!this->Enabled || !this->InstallMessageProc)
+    {
+    return;
+    }
+
+  this->StartedMessageLoop = 1;
+
+  MSG msg;
+  while (GetMessage(&msg, NULL, 0, 0))
+    {
+    TranslateMessage(&msg);
+    DispatchMessage(&msg);
+    }
+}
+
+//----------------------------------------------------------------------------
+// Begin processing keyboard strokes.
+void vtkWin32OpenGLRenderWindowInteractor::Initialize()
+{
+  vtkWin32OpenGLRenderWindow *ren;
+  int *size;
+
+  // make sure we have a RenderWindow and camera
+  if ( ! this->RenderWindow)
+    {
+    vtkErrorMacro(<<"No renderer defined!");
+    return;
+    }
+  if (this->Initialized)
+    {
+    return;
+    }
+  this->Initialized = 1;
+  // get the info we need from the RenderingWindow
+  ren = (vtkWin32OpenGLRenderWindow *)(this->RenderWindow);
+  ren->Start();
+  size    = ren->GetSize();
+  ren->GetPosition();
+  this->WindowId = ren->GetWindowId();
+  this->Enable();
+  this->Size[0] = size[0];
+  this->Size[1] = size[1];
+}
+
+//----------------------------------------------------------------------------
+void vtkWin32OpenGLRenderWindowInteractor::Enable()
+{
+  vtkWin32OpenGLRenderWindow *ren;
+  vtkWin32OpenGLRenderWindow *tmp;
+  if (this->Enabled)
+    {
+    return;
+    }
+  if (this->InstallMessageProc)
+    {
+    // add our callback
+    ren = (vtkWin32OpenGLRenderWindow *)(this->RenderWindow);
+    this->OldProc = (WNDPROC)vtkGetWindowLong(this->WindowId,vtkGWL_WNDPROC);
+    tmp=(vtkWin32OpenGLRenderWindow *)vtkGetWindowLong(this->WindowId,sizeof(vtkLONG));
+    // watch for odd conditions
+    if (tmp != ren)
+      {
+      // OK someone else has a hold on our event handler
+      // so lets have them handle this stuff
+      // well send a USER message to the other
+      // event handler so that it can properly
+      // call this event handler if required
+      CallWindowProc(this->OldProc,this->WindowId,WM_USER+12,24,(intptr_t)vtkHandleMessage);
+      }
+    else
+      {
+      vtkSetWindowLong(this->WindowId,vtkGWL_WNDPROC,(intptr_t)vtkHandleMessage);
+      }
+
+    // Check for windows multitouch support at runtime
+    RegisterTouchWindowType RTW =
+      (RegisterTouchWindowType)GetProcAddress(GetModuleHandle(TEXT("user32")), "RegisterTouchWindow");
+    if(RTW != NULL)
+      {
+      RTW(this->WindowId, 0);
+      }
+
+#ifdef VTK_USE_TDX
+    if(this->UseTDx)
+      {
+      this->Device->SetInteractor(this);
+      this->Device->Initialize();
+      this->Device->StartListening();
+      }
+#endif
+
+    // in case the size of the window has changed while we were away
+    int *size;
+    size = ren->GetSize();
+    this->Size[0] = size[0];
+    this->Size[1] = size[1];
+    }
+  this->Enabled = 1;
+  this->Modified();
+}
+
+
+//----------------------------------------------------------------------------
+void vtkWin32OpenGLRenderWindowInteractor::Disable()
+{
+  vtkWin32OpenGLRenderWindow *tmp;
+  if (!this->Enabled)
+    {
+    return;
+    }
+
+  if (this->InstallMessageProc && this->Enabled && this->WindowId)
+    {
+    // we need to release any hold we have on a windows event loop
+    vtkWin32OpenGLRenderWindow *ren;
+    ren = (vtkWin32OpenGLRenderWindow *)(this->RenderWindow);
+    tmp = (vtkWin32OpenGLRenderWindow *)vtkGetWindowLong(this->WindowId,sizeof(vtkLONG));
+    // watch for odd conditions
+    if ((tmp != ren) && (ren != NULL))
+      {
+      // OK someone else has a hold on our event handler
+      // so lets have them handle this stuff
+      // well send a USER message to the other
+      // event handler so that it can properly
+      // call this event handler if required
+      CallWindowProc(this->OldProc,this->WindowId,WM_USER+14,28,(intptr_t)this->OldProc);
+      }
+    else
+      {
+      vtkSetWindowLong(this->WindowId,vtkGWL_WNDPROC,(intptr_t)this->OldProc);
+      }
+#ifdef VTK_USE_TDX
+    if(this->Device->GetInitialized())
+      {
+      this->Device->Close();
+      }
+#endif
+    }
+  this->Enabled = 0;
+  this->Modified();
+}
+
+//----------------------------------------------------------------------------
+void vtkWin32OpenGLRenderWindowInteractor::TerminateApp(void)
+{
+  // Only post a quit message if Start was called...
+  //
+  if (this->StartedMessageLoop)
+    {
+    PostQuitMessage(0);
+    }
+}
+
+//----------------------------------------------------------------------------
+int vtkWin32OpenGLRenderWindowInteractor::InternalCreateTimer(int timerId, int vtkNotUsed(timerType),
+                                                        unsigned long duration)
+{
+  // Win32 always creates repeating timers
+  SetTimer(this->WindowId,timerId,duration,NULL);
+  return timerId;
+}
+
+//----------------------------------------------------------------------------
+int vtkWin32OpenGLRenderWindowInteractor::InternalDestroyTimer(int platformTimerId)
+{
+  return KillTimer(this->WindowId,platformTimerId);
+}
+
+//-------------------------------------------------------------
+// Virtual Key Code to Unix KeySym Conversion
+//-------------------------------------------------------------
+
+// this ascii code to keysym table is meant to mimic Tk
+
+static const char *AsciiToKeySymTable[] = {
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+  "space", "exclam", "quotedbl", "numbersign",
+  "dollar", "percent", "ampersand", "quoteright",
+  "parenleft", "parenright", "asterisk", "plus",
+  "comma", "minus", "period", "slash",
+  "0", "1", "2", "3", "4", "5", "6", "7",
+  "8", "9", "colon", "semicolon", "less", "equal", "greater", "question",
+  "at", "A", "B", "C", "D", "E", "F", "G",
+  "H", "I", "J", "K", "L", "M", "N", "O",
+  "P", "Q", "R", "S", "T", "U", "V", "W",
+  "X", "Y", "Z", "bracketleft",
+  "backslash", "bracketright", "asciicircum", "underscore",
+  "quoteleft", "a", "b", "c", "d", "e", "f", "g",
+  "h", "i", "j", "k", "l", "m", "n", "o",
+  "p", "q", "r", "s", "t", "u", "v", "w",
+  "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", "Delete",
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+
+// this virtual key code to keysym table is meant to mimic Tk
+
+static const char *VKeyCodeToKeySymTable[] = {
+  0, 0, 0, "Cancel", 0, 0, 0, 0,
+  "BackSpace", "Tab", 0, 0, "Clear", "Return", 0, 0,
+  "Shift_L", "Control_L", "Alt_L", "Pause", "Caps_Lock", 0,0,0,
+  0, 0, 0, "Escape", 0, 0, 0, 0,
+  "space", "Prior", "Next", "End", "Home", "Left", "Up", "Right",
+  "Down", "Select", 0, "Execute", "Snapshot", "Insert", "Delete", "Help",
+  "0", "1", "2", "3", "4", "5", "6", "7",
+  "8", "9", 0, 0, 0, 0, 0, 0,
+  0, "a", "b", "c", "d", "e", "f", "g",
+  "h", "i", "j", "k", "l", "m", "n", "o",
+  "p", "q", "r", "s", "t", "u", "v", "w",
+  "x", "y", "z", "Win_L", "Win_R", "App", 0, 0,
+  "KP_0", "KP_1", "KP_2", "KP_3", "KP_4", "KP_5", "KP_6", "KP_7",
+  "KP_8", "KP_9", "asterisk", "plus", "bar", "minus", "period", "slash",
+  "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8",
+  "F9", "F10", "F11", "F12", "F13", "F14", "F15", "F16",
+  "F17", "F18", "F19", "F20", "F21", "F22", "F23", "F24",
+  0, 0, 0, 0, 0, 0, 0, 0,
+  "Num_Lock", "Scroll_Lock", 0, 0, 0, 0, 0, 0,
+  0, 0, 0, 0, 0, 0, 0, 0,
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+
+//-------------------------------------------------------------
+// Event loop handlers
+//-------------------------------------------------------------
+void vtkWin32OpenGLRenderWindowInteractor::OnMouseMove(HWND hWnd, UINT nFlags,
+                                                 int X, int Y)
+{
+  if (!this->Enabled)
+    {
+    return;
+    }
+
+  // touch events handled by WM_TOUCH
+  if ((GetMessageExtraInfo() & MOUSEEVENTF_FROMTOUCH) == MOUSEEVENTF_FROMTOUCH)
+    {
+    return;
+    }
+
+  this->SetEventInformationFlipY(X,
+                                 Y,
+                                 nFlags & MK_CONTROL,
+                                 nFlags & MK_SHIFT);
+  this->SetAltKey(GetKeyState(VK_MENU) & (~1));
+  if (!this->MouseInWindow &&
+      (X >= 0 && X < this->Size[0] && Y >= 0 && Y < this->Size[1]))
+    {
+    this->InvokeEvent(vtkCommand::EnterEvent, NULL);
+    this->MouseInWindow = 1;
+    // request WM_MOUSELEAVE generation
+    TRACKMOUSEEVENT tme;
+    tme.cbSize = sizeof(TRACKMOUSEEVENT);
+    tme.dwFlags = TME_LEAVE;
+    tme.hwndTrack = hWnd;
+    TrackMouseEvent(&tme);
+    }
+
+  this->InvokeEvent(vtkCommand::MouseMoveEvent, NULL);
+}
+
+//----------------------------------------------------------------------------
+void vtkWin32OpenGLRenderWindowInteractor::OnNCMouseMove(HWND, UINT nFlags,
+                                                   int X, int Y)
+{
+  if (!this->Enabled)
+    {
+    return;
+    }
+
+  int *pos = this->RenderWindow->GetPosition();
+  if (this->MouseInWindow)
+    {
+    this->SetEventInformationFlipY(X - pos[0],
+                                   Y - pos[1],
+                                   nFlags & MK_CONTROL,
+                                   nFlags & MK_SHIFT);
+    this->SetAltKey(GetKeyState(VK_MENU) & (~1));
+    this->InvokeEvent(vtkCommand::LeaveEvent, NULL);
+    this->MouseInWindow = 0;
+    }
+}
+
+//----------------------------------------------------------------------------
+void vtkWin32OpenGLRenderWindowInteractor::OnMouseWheelForward(HWND,UINT nFlags,
+                                                   int X, int Y)
+{
+  if (!this->Enabled)
+    {
+    return;
+    }
+  this->SetEventInformationFlipY(X,
+                                 Y,
+                                 nFlags & MK_CONTROL,
+                                 nFlags & MK_SHIFT);
+  this->SetAltKey(GetKeyState(VK_MENU) & (~1));
+  this->InvokeEvent(vtkCommand::MouseWheelForwardEvent,NULL);
+}
+
+//----------------------------------------------------------------------------
+void vtkWin32OpenGLRenderWindowInteractor::OnMouseWheelBackward(HWND,UINT nFlags,
+                                                   int X, int Y)
+{
+  if (!this->Enabled)
+    {
+    return;
+    }
+  this->SetEventInformationFlipY(X,
+                                 Y,
+                                 nFlags & MK_CONTROL,
+                                 nFlags & MK_SHIFT);
+  this->SetAltKey(GetKeyState(VK_MENU) & (~1));
+  this->InvokeEvent(vtkCommand::MouseWheelBackwardEvent,NULL);
+}
+
+//----------------------------------------------------------------------------
+void vtkWin32OpenGLRenderWindowInteractor::OnLButtonDown(HWND wnd,UINT nFlags,
+                                                   int X, int Y, int repeat)
+{
+  if (!this->Enabled)
+    {
+    return;
+    }
+
+  // touch events handled by WM_TOUCH
+  if ((GetMessageExtraInfo() & MOUSEEVENTF_FROMTOUCH) == MOUSEEVENTF_FROMTOUCH)
+    {
+    return;
+    }
+
+  SetFocus(wnd);
+  SetCapture(wnd);
+  this->SetEventInformationFlipY(X,
+                                 Y,
+                                 nFlags & MK_CONTROL,
+                                 nFlags & MK_SHIFT,
+                                 0, repeat);
+  this->SetAltKey(GetKeyState(VK_MENU) & (~1));
+  this->InvokeEvent(vtkCommand::LeftButtonPressEvent,NULL);
+}
+
+//----------------------------------------------------------------------------
+void vtkWin32OpenGLRenderWindowInteractor::OnLButtonUp(HWND,UINT nFlags,
+                                                 int X, int Y)
+{
+  if (!this->Enabled)
+    {
+    return;
+    }
+  // touch events handled by WM_TOUCH
+  if ((GetMessageExtraInfo() & MOUSEEVENTF_FROMTOUCH) == MOUSEEVENTF_FROMTOUCH)
+    {
+    return;
+    }
+  this->SetEventInformationFlipY(X,
+                                 Y,
+                                 nFlags & MK_CONTROL,
+                                 nFlags & MK_SHIFT);
+  this->SetAltKey(GetKeyState(VK_MENU) & (~1));
+  this->InvokeEvent(vtkCommand::LeftButtonReleaseEvent,NULL);
+  ReleaseCapture( );
+}
+
+//----------------------------------------------------------------------------
+void vtkWin32OpenGLRenderWindowInteractor::OnMButtonDown(HWND wnd,UINT nFlags,
+                                                   int X, int Y, int repeat)
+{
+  if (!this->Enabled)
+    {
+    return;
+    }
+  SetFocus(wnd);
+  SetCapture(wnd);
+  this->SetEventInformationFlipY(X,
+                                 Y,
+                                 nFlags & MK_CONTROL,
+                                 nFlags & MK_SHIFT,
+                                 0, repeat);
+  this->SetAltKey(GetKeyState(VK_MENU) & (~1));
+  this->InvokeEvent(vtkCommand::MiddleButtonPressEvent,NULL);
+}
+
+//----------------------------------------------------------------------------
+void vtkWin32OpenGLRenderWindowInteractor::OnMButtonUp(HWND,UINT nFlags,
+                                                 int X, int Y)
+{
+  if (!this->Enabled)
+    {
+    return;
+    }
+  this->SetEventInformationFlipY(X,
+                                 Y,
+                                 nFlags & MK_CONTROL,
+                                 nFlags & MK_SHIFT);
+  this->SetAltKey(GetKeyState(VK_MENU) & (~1));
+  this->InvokeEvent(vtkCommand::MiddleButtonReleaseEvent,NULL);
+  ReleaseCapture( );
+}
+
+//----------------------------------------------------------------------------
+void vtkWin32OpenGLRenderWindowInteractor::OnRButtonDown(HWND wnd,UINT nFlags,
+                                                   int X, int Y, int repeat)
+{
+  if (!this->Enabled)
+    {
+    return;
+    }
+  SetFocus(wnd);
+  SetCapture(wnd);
+  this->SetEventInformationFlipY(X,
+                                 Y,
+                                 nFlags & MK_CONTROL,
+                                 nFlags & MK_SHIFT,
+                                 0, repeat);
+  this->SetAltKey(GetKeyState(VK_MENU) & (~1));
+  this->InvokeEvent(vtkCommand::RightButtonPressEvent,NULL);
+}
+
+//----------------------------------------------------------------------------
+void vtkWin32OpenGLRenderWindowInteractor::OnRButtonUp(HWND,UINT nFlags,
+                                                 int X, int Y)
+{
+  if (!this->Enabled)
+    {
+    return;
+    }
+  this->SetEventInformationFlipY(X,
+                                 Y,
+                                 nFlags & MK_CONTROL,
+                                 nFlags & MK_SHIFT);
+  this->SetAltKey(GetKeyState(VK_MENU) & (~1));
+  this->InvokeEvent(vtkCommand::RightButtonReleaseEvent,NULL);
+  ReleaseCapture( );
+}
+
+//----------------------------------------------------------------------------
+void vtkWin32OpenGLRenderWindowInteractor::OnSize(HWND,UINT, int X, int Y) {
+  this->UpdateSize(X,Y);
+  if (this->Enabled)
+    {
+    this->InvokeEvent(vtkCommand::ConfigureEvent,NULL);
+    }
+}
+
+//----------------------------------------------------------------------------
+void vtkWin32OpenGLRenderWindowInteractor::OnTimer(HWND,UINT timerId)
+{
+  if (!this->Enabled)
+    {
+    return;
+    }
+  int tid = static_cast<int>(timerId);
+  this->InvokeEvent(vtkCommand::TimerEvent,(void*)&tid);
+
+  // Here we deal with one-shot versus repeating timers
+  if ( this->IsOneShotTimer(tid) )
+    {
+    KillTimer(this->WindowId,tid); //'cause windows timers are always repeating
+    }
+}
+
+//----------------------------------------------------------------------------
+void vtkWin32OpenGLRenderWindowInteractor::OnKeyDown(HWND, UINT vCode, UINT nRepCnt, UINT nFlags)
+{
+  if (!this->Enabled)
+    {
+    return;
+    }
+  int ctrl  = GetKeyState(VK_CONTROL) & (~1);
+  int shift = GetKeyState(VK_SHIFT) & (~1);
+  int alt = GetKeyState(VK_MENU) & (~1);
+  WORD nChar = 0;
+  {
+#ifndef _WIN32_WCE
+    BYTE keyState[256];
+    GetKeyboardState(keyState);
+    if (ToAscii(vCode,nFlags & 0xff,keyState,&nChar,0) == 0)
+      {
+      nChar = 0;
+      }
+#endif
+  }
+  const char *keysym = AsciiToKeySymTable[(unsigned char)nChar];
+  if (keysym == 0)
+    {
+    keysym = VKeyCodeToKeySymTable[(unsigned char)vCode];
+    }
+  if (keysym == 0)
+    {
+    keysym = "None";
+    }
+  this->SetKeyEventInformation(ctrl,
+                               shift,
+                               nChar,
+                               nRepCnt,
+                               keysym);
+  this->SetAltKey(alt);
+  this->InvokeEvent(vtkCommand::KeyPressEvent, NULL);
+}
+
+//----------------------------------------------------------------------------
+void vtkWin32OpenGLRenderWindowInteractor::OnKeyUp(HWND, UINT vCode, UINT nRepCnt, UINT nFlags)
+{
+  if (!this->Enabled)
+    {
+    return;
+    }
+  int ctrl  = GetKeyState(VK_CONTROL) & (~1);
+  int shift = GetKeyState(VK_SHIFT) & (~1);
+  int alt = GetKeyState(VK_MENU) & (~1);
+  WORD nChar = 0;
+  {
+    BYTE keyState[256];
+#ifndef _WIN32_WCE
+    GetKeyboardState(keyState);
+    if (ToAscii(vCode,nFlags & 0xff,keyState,&nChar,0) == 0)
+      {
+      nChar = 0;
+      }
+#endif
+  }
+  const char *keysym = AsciiToKeySymTable[(unsigned char)nChar];
+  if (keysym == 0)
+    {
+    keysym = VKeyCodeToKeySymTable[(unsigned char)vCode];
+    }
+  if (keysym == 0)
+    {
+    keysym = "None";
+    }
+  this->SetKeyEventInformation(ctrl,
+                               shift,
+                               nChar,
+                               nRepCnt,
+                               keysym);
+  this->SetAltKey(alt);
+  this->InvokeEvent(vtkCommand::KeyReleaseEvent, NULL);
+}
+
+//----------------------------------------------------------------------------
+void vtkWin32OpenGLRenderWindowInteractor::OnChar(HWND,UINT nChar,
+                                            UINT nRepCnt, UINT)
+{
+  if (!this->Enabled)
+    {
+    return;
+    }
+  int ctrl  = GetKeyState(VK_CONTROL) & (~1);
+  int shift = GetKeyState(VK_SHIFT) & (~1);
+  int alt = GetKeyState(VK_MENU) & (~1);
+  this->SetKeyEventInformation(ctrl,
+                               shift,
+                               nChar,
+                               nRepCnt);
+  this->SetAltKey(alt);
+  this->InvokeEvent(vtkCommand::CharEvent, NULL);
+}
+
+//----------------------------------------------------------------------------
+void vtkWin32OpenGLRenderWindowInteractor::OnFocus(HWND,UINT)
+{
+  if (!this->Enabled)
+    {
+    return;
+    }
+
+#ifdef VTK_USE_TDX
+  if(this->Device->GetInitialized() && !this->Device->GetIsListening())
+    {
+    this->Device->StartListening();
+    }
+#endif
+}
+
+//----------------------------------------------------------------------------
+void vtkWin32OpenGLRenderWindowInteractor::OnKillFocus(HWND,UINT)
+{
+  if (!this->Enabled)
+    {
+    return;
+    }
+#ifdef VTK_USE_TDX
+  if(this->Device->GetInitialized() && this->Device->GetIsListening())
+    {
+    this->Device->StopListening();
+    }
+#endif
+}
+
+// This function is used to return an index given an ID
+int vtkWin32OpenGLRenderWindowInteractor::GetContactIndex(int dwID)
+{
+  for (int i=0; i < VTKI_MAX_POINTERS; i++)
+    {
+    if (this->IDLookup[i] == dwID)
+      {
+      return i;
+      }
+    }
+
+  for (int i=0; i < VTKI_MAX_POINTERS; i++)
+    {
+    if (this->IDLookup[i] == -1)
+      {
+      this->IDLookup[i] = dwID;
+      return i;
+      }
+    }
+
+  // Out of contacts
+  return -1;
+}
+
+//----------------------------------------------------------------------------
+void vtkWin32OpenGLRenderWindowInteractor::OnTouch(HWND hWnd, UINT wParam, UINT lParam)
+{
+  if (!this->Enabled)
+    {
+    return;
+    }
+
+  UINT cInputs = LOWORD(wParam);
+  PTOUCHINPUT pInputs = new TOUCHINPUT[cInputs];
+  if (pInputs)
+    {
+    int ctrl  = GetKeyState(VK_CONTROL) & (~1);
+    int shift = GetKeyState(VK_SHIFT) & (~1);
+    this->SetAltKey(GetKeyState(VK_MENU) & (~1));
+    GetTouchInputInfoType GTII =
+      (GetTouchInputInfoType)GetProcAddress(GetModuleHandle(TEXT("user32")), "GetTouchInputInfo");
+    if (GTII((HTOUCHINPUT)lParam, cInputs, pInputs, sizeof(TOUCHINPUT)))
+      {
+      POINT ptInput;
+      for (UINT i=0; i < cInputs; i++)
+        {
+        TOUCHINPUT ti = pInputs[i];
+        int index = this->GetContactIndex(ti.dwID);
+        if (ti.dwID != 0 && index < VTKI_MAX_POINTERS)
+          {
+            // Do something with your touch input handle
+            ptInput.x = TOUCH_COORD_TO_PIXEL(ti.x);
+            ptInput.y = TOUCH_COORD_TO_PIXEL(ti.y);
+            ScreenToClient(hWnd, &ptInput);
+            this->SetEventInformationFlipY(ptInput.x,
+                                           ptInput.y,
+                                           ctrl,
+                                           shift,
+                                           0,0,0,
+                                           index);
+          }
+        }
+      bool didUpOrDown = false;
+      for (UINT i=0; i < cInputs; i++)
+        {
+        TOUCHINPUT ti = pInputs[i];
+        int index = this->GetContactIndex(ti.dwID);
+        if (ti.dwID != 0 && index < VTKI_MAX_POINTERS)
+          {
+          if (ti.dwFlags & TOUCHEVENTF_UP)
+            {
+            this->SetPointerIndex(index);
+            didUpOrDown = true;
+            this->InvokeEvent(vtkCommand::LeftButtonReleaseEvent,NULL);
+            this->IDLookup[index] = -1;
+            }
+          if (ti.dwFlags & TOUCHEVENTF_DOWN)
+            {
+            this->SetPointerIndex(index);
+            didUpOrDown = true;
+            this->InvokeEvent(vtkCommand::LeftButtonPressEvent,NULL);
+            }
+          this->SetPointerIndex(index);
+          }
+        }
+      if (!didUpOrDown)
+        {
+        this->InvokeEvent(vtkCommand::MouseMoveEvent, NULL);
+        }
+      }
+    CloseTouchInputHandleType CTIH =
+      (CloseTouchInputHandleType)GetProcAddress(GetModuleHandle(TEXT("user32")), "CloseTouchInputHandle");
+    CTIH((HTOUCHINPUT)lParam);
+    delete [] pInputs;
+    }
+}
+
+//----------------------------------------------------------------------------
+// This is only called when InstallMessageProc is true
+LRESULT CALLBACK vtkHandleMessage(HWND hWnd,UINT uMsg, WPARAM wParam,
+                                  LPARAM lParam)
+{
+  LRESULT res = 0;
+  vtkWin32OpenGLRenderWindow *ren;
+  vtkWin32OpenGLRenderWindowInteractor *me = 0;
+
+  ren = (vtkWin32OpenGLRenderWindow *)vtkGetWindowLong(hWnd,sizeof(vtkLONG));
+
+  if (ren)
+    {
+    me = (vtkWin32OpenGLRenderWindowInteractor *)ren->GetInteractor();
+    }
+
+  if (me && me->GetReferenceCount()>0)
+    {
+    me->Register(me);
+    res = vtkHandleMessage2(hWnd,uMsg,wParam,lParam,me);
+    me->UnRegister(me);
+    }
+
+  return res;
+}
+
+#ifndef MAKEPOINTS
+#define MAKEPOINTS(l)   (*((POINTS FAR *) & (l)))
+#endif
+
+//----------------------------------------------------------------------------
+LRESULT CALLBACK vtkHandleMessage2(HWND hWnd,UINT uMsg, WPARAM wParam,
+                                   LPARAM lParam,
+                                   vtkWin32OpenGLRenderWindowInteractor *me)
+{
+  if ((uMsg == WM_USER+13)&&(wParam == 26))
+    {
+    // someone is telling us to set our OldProc
+    me->OldProc = (WNDPROC)lParam;
+    return 1;
+    }
+
+  switch (uMsg)
+    {
+    case WM_PAINT:
+      me->Render();
+      return CallWindowProc(me->OldProc,hWnd,uMsg,wParam,lParam);
+
+    case WM_SIZE:
+      me->OnSize(hWnd,wParam,LOWORD(lParam),HIWORD(lParam));
+      return CallWindowProc(me->OldProc,hWnd,uMsg,wParam,lParam);
+
+    case WM_LBUTTONDBLCLK:
+      me->OnLButtonDown(hWnd,wParam,MAKEPOINTS(lParam).x,MAKEPOINTS(lParam).y, 1);
+      break;
+
+    case WM_LBUTTONDOWN:
+      me->OnLButtonDown(hWnd,wParam,MAKEPOINTS(lParam).x,MAKEPOINTS(lParam).y, 0);
+      break;
+
+    case WM_LBUTTONUP:
+      me->OnLButtonUp(hWnd,wParam,MAKEPOINTS(lParam).x,MAKEPOINTS(lParam).y);
+      break;
+
+    case WM_MBUTTONDBLCLK:
+      me->OnMButtonDown(hWnd,wParam,MAKEPOINTS(lParam).x,MAKEPOINTS(lParam).y, 1);
+      break;
+
+    case WM_MBUTTONDOWN:
+      me->OnMButtonDown(hWnd,wParam,MAKEPOINTS(lParam).x,MAKEPOINTS(lParam).y, 0);
+      break;
+
+    case WM_MBUTTONUP:
+      me->OnMButtonUp(hWnd,wParam,MAKEPOINTS(lParam).x,MAKEPOINTS(lParam).y);
+      break;
+
+    case WM_RBUTTONDBLCLK:
+      me->OnRButtonDown(hWnd,wParam,MAKEPOINTS(lParam).x,MAKEPOINTS(lParam).y, 1);
+      break;
+
+    case WM_RBUTTONDOWN:
+      me->OnRButtonDown(hWnd,wParam,MAKEPOINTS(lParam).x,MAKEPOINTS(lParam).y, 0);
+      break;
+
+    case WM_RBUTTONUP:
+      me->OnRButtonUp(hWnd,wParam,MAKEPOINTS(lParam).x,MAKEPOINTS(lParam).y);
+      break;
+
+    case WM_MOUSELEAVE:
+      me->InvokeEvent(vtkCommand::LeaveEvent, NULL);
+      me->MouseInWindow = 0;
+      break;
+
+    case WM_MOUSEMOVE:
+      me->OnMouseMove(hWnd,wParam,MAKEPOINTS(lParam).x,MAKEPOINTS(lParam).y);
+      break;
+
+    case WM_MOUSEWHEEL:
+      {
+      POINT pt;
+      pt.x = MAKEPOINTS(lParam).x;
+      pt.y = MAKEPOINTS(lParam).y;
+      ::ScreenToClient(hWnd, &pt);
+      if( GET_WHEEL_DELTA_WPARAM(wParam) > 0)
+        me->OnMouseWheelForward(hWnd,wParam,pt.x,pt.y);
+      else
+        me->OnMouseWheelBackward(hWnd,wParam,pt.x,pt.y);
+      }
+      break;
+
+#ifdef WM_MCVMOUSEMOVE
+    case WM_NCMOUSEMOVE:
+      me->OnNCMouseMove(hWnd,wParam,MAKEPOINTS(lParam).x,MAKEPOINTS(lParam).y);
+      break;
+#endif
+
+    case WM_CLOSE:
+      me->ExitCallback();
+      break;
+
+    case WM_CHAR:
+      me->OnChar(hWnd,wParam,LOWORD(lParam),HIWORD(lParam));
+      break;
+
+    case WM_KEYDOWN:
+    case WM_SYSKEYDOWN:
+      me->OnKeyDown(hWnd,wParam,LOWORD(lParam),HIWORD(lParam));
+      break;
+
+    case WM_KEYUP:
+    case WM_SYSKEYUP:
+      me->OnKeyUp(hWnd,wParam,LOWORD(lParam),HIWORD(lParam));
+      break;
+
+    case WM_TIMER:
+      me->OnTimer(hWnd,wParam);
+      break;
+
+    case WM_ACTIVATE:
+      if(wParam==WA_INACTIVE)
+        {
+        me->OnKillFocus(hWnd,wParam);
+        }
+      else
+        {
+        me->OnFocus(hWnd,wParam);
+        }
+      break;
+
+    case WM_SETFOCUS:
+      // occurs when SetFocus() is called on the current window
+      me->OnFocus(hWnd,wParam);
+      break;
+
+    case WM_KILLFOCUS:
+      // occurs when the focus was on the current window and SetFocus() is
+      // called on another window.
+      me->OnKillFocus(hWnd,wParam);
+      break;
+
+    case WM_TOUCH:
+      me->OnTouch(hWnd,wParam,lParam);
+      break;
+
+    default:
+      if (me)
+        {
+        return CallWindowProc(me->OldProc,hWnd,uMsg,wParam,lParam);
+        }
+    };
+
+  return 0;
+}
+
+//----------------------------------------------------------------------------
+// Specify the default function to be called when an interactor needs to exit.
+// This callback is overridden by an instance ExitMethod that is defined.
+void
+vtkWin32OpenGLRenderWindowInteractor::SetClassExitMethod(void (*f)(void *),void *arg)
+{
+  if ( f != vtkWin32OpenGLRenderWindowInteractor::ClassExitMethod
+       || arg != vtkWin32OpenGLRenderWindowInteractor::ClassExitMethodArg)
+    {
+    // delete the current arg if there is a delete method
+    if ((vtkWin32OpenGLRenderWindowInteractor::ClassExitMethodArg)
+        && (vtkWin32OpenGLRenderWindowInteractor::ClassExitMethodArgDelete))
+      {
+      (*vtkWin32OpenGLRenderWindowInteractor::ClassExitMethodArgDelete)
+        (vtkWin32OpenGLRenderWindowInteractor::ClassExitMethodArg);
+      }
+    vtkWin32OpenGLRenderWindowInteractor::ClassExitMethod = f;
+    vtkWin32OpenGLRenderWindowInteractor::ClassExitMethodArg = arg;
+
+    // no call to this->Modified() since this is a class member function
+    }
+}
+
+//----------------------------------------------------------------------------
+// Set the arg delete method.  This is used to free user memory.
+void
+vtkWin32OpenGLRenderWindowInteractor::SetClassExitMethodArgDelete(void (*f)(void *))
+{
+  if (f != vtkWin32OpenGLRenderWindowInteractor::ClassExitMethodArgDelete)
+    {
+    vtkWin32OpenGLRenderWindowInteractor::ClassExitMethodArgDelete = f;
+
+    // no call to this->Modified() since this is a class member function
+    }
+}
+
+//----------------------------------------------------------------------------
+void vtkWin32OpenGLRenderWindowInteractor::PrintSelf(ostream& os, vtkIndent indent)
+{
+  this->Superclass::PrintSelf(os,indent);
+  os << indent << "InstallMessageProc: " << this->InstallMessageProc << endl;
+  os << indent << "StartedMessageLoop: " << this->StartedMessageLoop << endl;
+}
+
+//----------------------------------------------------------------------------
+void vtkWin32OpenGLRenderWindowInteractor::ExitCallback()
+{
+  if (this->HasObserver(vtkCommand::ExitEvent))
+    {
+    this->InvokeEvent(vtkCommand::ExitEvent,NULL);
+    }
+  else if (this->ClassExitMethod)
+    {
+    (*this->ClassExitMethod)(this->ClassExitMethodArg);
+    }
+
+  this->TerminateApp();
+}
diff --git a/Rendering/OpenGL2/vtkWin32OpenGLRenderWindowInteractor.h b/Rendering/OpenGL2/vtkWin32OpenGLRenderWindowInteractor.h
new file mode 100644
index 0000000..383f5ce
--- /dev/null
+++ b/Rendering/OpenGL2/vtkWin32OpenGLRenderWindowInteractor.h
@@ -0,0 +1,158 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+  Module:    vtkWin32OpenGLRenderWindowInteractor.h
+
+  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.
+
+=========================================================================*/
+// .NAME vtkWin32OpenGLRenderWindowInteractor - implements Win32 specific functions
+// required by vtkRenderWindowInteractor.
+//
+// .SECTION Description
+// By default the interactor installs a MessageProc callback which
+// intercepts windows' messages to the window and controls interactions by
+// routing them to the InteractoStyle classes.
+// MFC or BCB programs can prevent this and instead directly route any mouse/key
+// messages into the event bindings by setting InstallMessageProc to false.
+// This provides a minimal "Mapped" mode of interaction
+//
+#ifndef vtkWin32OpenGLRenderWindowInteractor_h
+#define vtkWin32OpenGLRenderWindowInteractor_h
+
+#include "vtkRenderingOpenGL2Module.h" // For export macro
+#include "vtkRenderWindowInteractor.h"
+#include "vtkWindows.h" // For windows API.
+
+#include "vtkTDxConfigure.h" // defines VTK_USE_TDX
+#ifdef VTK_USE_TDX
+class vtkTDxWinDevice;
+#endif
+
+class VTKRENDERINGOPENGL2_EXPORT vtkWin32OpenGLRenderWindowInteractor : public vtkRenderWindowInteractor
+{
+public:
+  // Description:
+  // Construct object so that light follows camera motion.
+  static vtkWin32OpenGLRenderWindowInteractor *New();
+
+  vtkTypeMacro(vtkWin32OpenGLRenderWindowInteractor,vtkRenderWindowInteractor);
+  void PrintSelf(ostream& os, vtkIndent indent);
+
+  // Description:
+  // Initialize the event handler
+  virtual void Initialize();
+
+  // Description:
+  // Enable/Disable interactions.  By default interactors are enabled when
+  // initialized.  Initialize() must be called prior to enabling/disabling
+  // interaction. These methods are used when a window/widget is being
+  // shared by multiple renderers and interactors.  This allows a "modal"
+  // display where one interactor is active when its data is to be displayed
+  // and all other interactors associated with the widget are disabled
+  // when their data is not displayed.
+  virtual void Enable();
+  virtual void Disable();
+
+  // Description:
+  // By default the interactor installs a MessageProc callback which
+  // intercepts windows messages to the window and controls interactions.
+  // MFC or BCB programs can prevent this and instead directly route any mouse/key
+  // messages into the event bindings by setting InstallMessgeProc to false.
+  vtkSetMacro(InstallMessageProc,int);
+  vtkGetMacro(InstallMessageProc,int);
+  vtkBooleanMacro(InstallMessageProc,int);
+
+  // Description:
+  // Win32 specific application terminate, calls ClassExitMethod then
+  // calls PostQuitMessage(0) to terminate the application. An application can Specify
+  // ExitMethod for alternative behavior (i.e. suppression of keyboard exit)
+  void TerminateApp(void);
+
+  friend VTKRENDERINGOPENGL2_EXPORT LRESULT CALLBACK vtkHandleMessage(HWND hwnd,UINT uMsg, WPARAM w, LPARAM l);
+  friend VTKRENDERINGOPENGL2_EXPORT LRESULT CALLBACK vtkHandleMessage2(HWND hwnd,UINT uMsg, WPARAM w, LPARAM l, vtkWin32OpenGLRenderWindowInteractor *me);
+
+  // Description:
+  // Various methods that a Win32 window can redirect to this class to be
+  // handled.
+  virtual void OnMouseMove  (HWND wnd, UINT nFlags, int X, int Y);
+  virtual void OnNCMouseMove(HWND wnd, UINT nFlags, int X, int Y);
+  virtual void OnRButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat=0);
+  virtual void OnRButtonUp  (HWND wnd, UINT nFlags, int X, int Y);
+  virtual void OnMButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat=0);
+  virtual void OnMButtonUp  (HWND wnd, UINT nFlags, int X, int Y);
+  virtual void OnLButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat=0);
+  virtual void OnLButtonUp  (HWND wnd, UINT nFlags, int X, int Y);
+  virtual void OnSize       (HWND wnd, UINT nType,  int X, int Y);
+  virtual void OnTimer      (HWND wnd, UINT nIDEvent);
+  virtual void OnKeyDown    (HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags);
+  virtual void OnKeyUp      (HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags);
+  virtual void OnChar       (HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags);
+  virtual void OnMouseWheelForward (HWND wnd, UINT nFlags, int X, int Y);
+  virtual void OnMouseWheelBackward(HWND wnd, UINT nFlags, int X, int Y);
+  virtual void OnFocus(HWND wnd, UINT nFlags);
+  virtual void OnKillFocus(HWND wnd, UINT nFlags);
+  virtual void OnTouch(HWND wnd, UINT wParam, UINT lParam);
+
+  // Description:
+  // Methods to set the default exit method for the class. This method is
+  // only used if no instance level ExitMethod has been defined.  It is
+  // provided as a means to control how an interactor is exited given
+  // the various language bindings (tcl, Win32, etc.).
+  static void SetClassExitMethod(void (*f)(void *), void *arg);
+  static void SetClassExitMethodArgDelete(void (*f)(void *));
+
+  // Description:
+  // These methods correspond to the the Exit, User and Pick
+  // callbacks. They allow for the Style to invoke them.
+  virtual void ExitCallback();
+
+protected:
+  vtkWin32OpenGLRenderWindowInteractor();
+  ~vtkWin32OpenGLRenderWindowInteractor();
+
+  HWND    WindowId;
+  WNDPROC OldProc;
+  int     InstallMessageProc;
+  int     MouseInWindow;
+  int     StartedMessageLoop;
+
+  // Description:
+  // Class variables so an exit method can be defined for this class
+  // (used to set different exit methods for various language bindings,
+  // i.e. tcl, java, Win32)
+  static void (*ClassExitMethod)(void *);
+  static void (*ClassExitMethodArgDelete)(void *);
+  static void *ClassExitMethodArg;
+
+  // Description:
+  // Win32-specific internal timer methods. See the superclass for detailed
+  // documentation.
+  virtual int InternalCreateTimer(int timerId, int timerType, unsigned long duration);
+  virtual int InternalDestroyTimer(int platformTimerId);
+
+  // Description:
+  // This will start up the event loop and never return. If you
+  // call this method it will loop processing events until the
+  // application is exited.
+  virtual void StartEventLoop();
+
+  int GetContactIndex(int id);
+  int IDLookup[VTKI_MAX_POINTERS];
+
+#ifdef VTK_USE_TDX
+  vtkTDxWinDevice *Device;
+#endif
+
+private:
+  vtkWin32OpenGLRenderWindowInteractor(const vtkWin32OpenGLRenderWindowInteractor&);  // Not implemented.
+  void operator=(const vtkWin32OpenGLRenderWindowInteractor&);  // Not implemented.
+};
+
+#endif
diff --git a/Rendering/OpenGL2/vtkWin32RenderWindowInteractor.cxx b/Rendering/OpenGL2/vtkWin32RenderWindowInteractor.cxx
deleted file mode 100644
index fc4ced9..0000000
--- a/Rendering/OpenGL2/vtkWin32RenderWindowInteractor.cxx
+++ /dev/null
@@ -1,1068 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkWin32RenderWindowInteractor.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 <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-
-
-#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x0501  // for trackmouseevent support, 0x0501 means target Windows XP or later
-//#define _WIN32_WINNT 0x0601  // for touch support, 0x0601 means target Windows 7 or later
-#endif
-
-#include "vtkWin32OpenGLRenderWindow.h"
-
-// Mouse wheel support
-// In an ideal world we would just have to include <zmouse.h>, but it is not
-// always available with all compilers/headers
-#ifndef WM_MOUSEWHEEL
-#  define WM_MOUSEWHEEL                   0x020A
-#endif  //WM_MOUSEWHEEL
-#ifndef GET_WHEEL_DELTA_WPARAM
-#  define GET_WHEEL_DELTA_WPARAM(wparam) ((short)HIWORD (wparam))
-#endif  //GET_WHEEL_DELTA_WPARAM
-
-// MSVC does the right thing without the forward declaration when it
-// sees it in the friend decl in vtkWin32RenderWindowInteractor, but
-// GCC needs to see the declaration beforehand. It has to do with the
-// CALLBACK attribute.
-VTKRENDERINGOPENGL2_EXPORT LRESULT CALLBACK vtkHandleMessage(HWND,UINT,WPARAM,LPARAM);
-VTKRENDERINGOPENGL2_EXPORT LRESULT CALLBACK vtkHandleMessage2(HWND,UINT,WPARAM,LPARAM,class vtkWin32RenderWindowInteractor*);
-
-#include "vtkWin32RenderWindowInteractor.h"
-#include "vtkActor.h"
-#include "vtkObjectFactory.h"
-#include "vtkCommand.h"
-
-#ifdef VTK_USE_TDX
-#include "vtkTDxWinDevice.h"
-#endif
-
-// we hard define the touch structures we use since we cannot take them
-// from the header without requiring windows 7 (stupid stupid stupid!)
-// so we define them and then do a runtime checks and function pointers
-// to avoid a link requirement on Windows 7
-#define MOUSEEVENTF_FROMTOUCH 0xFF515700
-#define WM_TOUCH              0x0240
-#define TOUCH_COORD_TO_PIXEL(l)  ((l) / 100)
-typedef struct _TOUCHINPUT {
-  LONG      x;
-  LONG      y;
-  HANDLE    hSource;
-  DWORD     dwID;
-  DWORD     dwFlags;
-  DWORD     dwMask;
-  DWORD     dwTime;
-  ULONG_PTR dwExtraInfo;
-  DWORD     cxContact;
-  DWORD     cyContact;
-} TOUCHINPUT, *PTOUCHINPUT;
-DECLARE_HANDLE(HTOUCHINPUT);
-//#define HTOUCHINPUT ULONG
-#define TOUCHEVENTF_MOVE  0x0001
-#define TOUCHEVENTF_DOWN  0x0002
-#define TOUCHEVENTF_UP  0x0004
-typedef bool (WINAPI *RegisterTouchWindowType)(HWND,ULONG);
-typedef bool (WINAPI *GetTouchInputInfoType)(HTOUCHINPUT,UINT,PTOUCHINPUT,int);
-typedef bool (WINAPI *CloseTouchInputHandleType)(HTOUCHINPUT);
-
-vtkStandardNewMacro(vtkWin32RenderWindowInteractor);
-
-void (*vtkWin32RenderWindowInteractor::ClassExitMethod)(void *) = (void (*)(void *))NULL;
-void *vtkWin32RenderWindowInteractor::ClassExitMethodArg = (void *)NULL;
-void (*vtkWin32RenderWindowInteractor::ClassExitMethodArgDelete)(void *) = (void (*)(void *))NULL;
-
-//----------------------------------------------------------------------------
-// Construct object so that light follows camera motion.
-vtkWin32RenderWindowInteractor::vtkWin32RenderWindowInteractor()
-{
-  this->WindowId           = 0;
-  this->InstallMessageProc = 1;
-  this->MouseInWindow = 0;
-  this->StartedMessageLoop = 0;
-
-  for (int i=0; i < VTKI_MAX_POINTERS; i++)
-    {
-    this->IDLookup[i] = -1;
-    }
-
-#ifdef VTK_USE_TDX
-  this->Device=vtkTDxWinDevice::New();
-#endif
-}
-
-//----------------------------------------------------------------------------
-vtkWin32RenderWindowInteractor::~vtkWin32RenderWindowInteractor()
-{
-  vtkWin32OpenGLRenderWindow *tmp;
-
-  // we need to release any hold we have on a windows event loop
-  if (this->WindowId && this->Enabled && this->InstallMessageProc)
-    {
-    vtkWin32OpenGLRenderWindow *ren;
-    ren = static_cast<vtkWin32OpenGLRenderWindow *>(this->RenderWindow);
-    tmp = (vtkWin32OpenGLRenderWindow *)(vtkGetWindowLong(this->WindowId,sizeof(vtkLONG)));
-    // watch for odd conditions
-    if ((tmp != ren) && (ren != NULL))
-      {
-      // OK someone else has a hold on our event handler
-      // so lets have them handle this stuff
-      // well send a USER message to the other
-      // event handler so that it can properly
-      // call this event handler if required
-      CallWindowProc(this->OldProc,this->WindowId,WM_USER+14,28,(intptr_t)this->OldProc);
-      }
-    else
-      {
-      vtkSetWindowLong(this->WindowId,vtkGWL_WNDPROC,(intptr_t)this->OldProc);
-      }
-    this->Enabled = 0;
-    }
-#ifdef VTK_USE_TDX
-  this->Device->Delete();
-#endif
-}
-
-//----------------------------------------------------------------------------
-void vtkWin32RenderWindowInteractor::StartEventLoop()
-{
-  // No need to do anything if this is a 'mapped' interactor
-  if (!this->Enabled || !this->InstallMessageProc)
-    {
-    return;
-    }
-
-  this->StartedMessageLoop = 1;
-
-  MSG msg;
-  while (GetMessage(&msg, NULL, 0, 0))
-    {
-    TranslateMessage(&msg);
-    DispatchMessage(&msg);
-    }
-}
-
-//----------------------------------------------------------------------------
-// Begin processing keyboard strokes.
-void vtkWin32RenderWindowInteractor::Initialize()
-{
-  vtkWin32OpenGLRenderWindow *ren;
-  int *size;
-
-  // make sure we have a RenderWindow and camera
-  if ( ! this->RenderWindow)
-    {
-    vtkErrorMacro(<<"No renderer defined!");
-    return;
-    }
-  if (this->Initialized)
-    {
-    return;
-    }
-  this->Initialized = 1;
-  // get the info we need from the RenderingWindow
-  ren = (vtkWin32OpenGLRenderWindow *)(this->RenderWindow);
-  ren->Start();
-  size    = ren->GetSize();
-  ren->GetPosition();
-  this->WindowId = ren->GetWindowId();
-  this->Enable();
-  this->Size[0] = size[0];
-  this->Size[1] = size[1];
-}
-
-//----------------------------------------------------------------------------
-void vtkWin32RenderWindowInteractor::Enable()
-{
-  vtkWin32OpenGLRenderWindow *ren;
-  vtkWin32OpenGLRenderWindow *tmp;
-  if (this->Enabled)
-    {
-    return;
-    }
-  if (this->InstallMessageProc)
-    {
-    // add our callback
-    ren = (vtkWin32OpenGLRenderWindow *)(this->RenderWindow);
-    this->OldProc = (WNDPROC)vtkGetWindowLong(this->WindowId,vtkGWL_WNDPROC);
-    tmp=(vtkWin32OpenGLRenderWindow *)vtkGetWindowLong(this->WindowId,sizeof(vtkLONG));
-    // watch for odd conditions
-    if (tmp != ren)
-      {
-      // OK someone else has a hold on our event handler
-      // so lets have them handle this stuff
-      // well send a USER message to the other
-      // event handler so that it can properly
-      // call this event handler if required
-      CallWindowProc(this->OldProc,this->WindowId,WM_USER+12,24,(intptr_t)vtkHandleMessage);
-      }
-    else
-      {
-      vtkSetWindowLong(this->WindowId,vtkGWL_WNDPROC,(intptr_t)vtkHandleMessage);
-      }
-
-    // Check for windows multitouch support at runtime
-    RegisterTouchWindowType RTW =
-      (RegisterTouchWindowType)GetProcAddress(GetModuleHandle(TEXT("user32")), "RegisterTouchWindow");
-    if(RTW != NULL)
-      {
-      RTW(this->WindowId, 0);
-      }
-
-#ifdef VTK_USE_TDX
-    if(this->UseTDx)
-      {
-      this->Device->SetInteractor(this);
-      this->Device->Initialize();
-      this->Device->StartListening();
-      }
-#endif
-
-    // in case the size of the window has changed while we were away
-    int *size;
-    size = ren->GetSize();
-    this->Size[0] = size[0];
-    this->Size[1] = size[1];
-    }
-  this->Enabled = 1;
-  this->Modified();
-}
-
-
-//----------------------------------------------------------------------------
-void vtkWin32RenderWindowInteractor::Disable()
-{
-  vtkWin32OpenGLRenderWindow *tmp;
-  if (!this->Enabled)
-    {
-    return;
-    }
-
-  if (this->InstallMessageProc && this->Enabled && this->WindowId)
-    {
-    // we need to release any hold we have on a windows event loop
-    vtkWin32OpenGLRenderWindow *ren;
-    ren = (vtkWin32OpenGLRenderWindow *)(this->RenderWindow);
-    tmp = (vtkWin32OpenGLRenderWindow *)vtkGetWindowLong(this->WindowId,sizeof(vtkLONG));
-    // watch for odd conditions
-    if ((tmp != ren) && (ren != NULL))
-      {
-      // OK someone else has a hold on our event handler
-      // so lets have them handle this stuff
-      // well send a USER message to the other
-      // event handler so that it can properly
-      // call this event handler if required
-      CallWindowProc(this->OldProc,this->WindowId,WM_USER+14,28,(intptr_t)this->OldProc);
-      }
-    else
-      {
-      vtkSetWindowLong(this->WindowId,vtkGWL_WNDPROC,(intptr_t)this->OldProc);
-      }
-#ifdef VTK_USE_TDX
-    if(this->Device->GetInitialized())
-      {
-      this->Device->Close();
-      }
-#endif
-    }
-  this->Enabled = 0;
-  this->Modified();
-}
-
-//----------------------------------------------------------------------------
-void vtkWin32RenderWindowInteractor::TerminateApp(void)
-{
-  // Only post a quit message if Start was called...
-  //
-  if (this->StartedMessageLoop)
-    {
-    PostQuitMessage(0);
-    }
-}
-
-//----------------------------------------------------------------------------
-int vtkWin32RenderWindowInteractor::InternalCreateTimer(int timerId, int vtkNotUsed(timerType),
-                                                        unsigned long duration)
-{
-  // Win32 always creates repeating timers
-  SetTimer(this->WindowId,timerId,duration,NULL);
-  return timerId;
-}
-
-//----------------------------------------------------------------------------
-int vtkWin32RenderWindowInteractor::InternalDestroyTimer(int platformTimerId)
-{
-  return KillTimer(this->WindowId,platformTimerId);
-}
-
-//-------------------------------------------------------------
-// Virtual Key Code to Unix KeySym Conversion
-//-------------------------------------------------------------
-
-// this ascii code to keysym table is meant to mimic Tk
-
-static const char *AsciiToKeySymTable[] = {
-  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-  "space", "exclam", "quotedbl", "numbersign",
-  "dollar", "percent", "ampersand", "quoteright",
-  "parenleft", "parenright", "asterisk", "plus",
-  "comma", "minus", "period", "slash",
-  "0", "1", "2", "3", "4", "5", "6", "7",
-  "8", "9", "colon", "semicolon", "less", "equal", "greater", "question",
-  "at", "A", "B", "C", "D", "E", "F", "G",
-  "H", "I", "J", "K", "L", "M", "N", "O",
-  "P", "Q", "R", "S", "T", "U", "V", "W",
-  "X", "Y", "Z", "bracketleft",
-  "backslash", "bracketright", "asciicircum", "underscore",
-  "quoteleft", "a", "b", "c", "d", "e", "f", "g",
-  "h", "i", "j", "k", "l", "m", "n", "o",
-  "p", "q", "r", "s", "t", "u", "v", "w",
-  "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", "Delete",
-  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-
-// this virtual key code to keysym table is meant to mimic Tk
-
-static const char *VKeyCodeToKeySymTable[] = {
-  0, 0, 0, "Cancel", 0, 0, 0, 0,
-  "BackSpace", "Tab", 0, 0, "Clear", "Return", 0, 0,
-  "Shift_L", "Control_L", "Alt_L", "Pause", "Caps_Lock", 0,0,0,
-  0, 0, 0, "Escape", 0, 0, 0, 0,
-  "space", "Prior", "Next", "End", "Home", "Left", "Up", "Right",
-  "Down", "Select", 0, "Execute", "Snapshot", "Insert", "Delete", "Help",
-  "0", "1", "2", "3", "4", "5", "6", "7",
-  "8", "9", 0, 0, 0, 0, 0, 0,
-  0, "a", "b", "c", "d", "e", "f", "g",
-  "h", "i", "j", "k", "l", "m", "n", "o",
-  "p", "q", "r", "s", "t", "u", "v", "w",
-  "x", "y", "z", "Win_L", "Win_R", "App", 0, 0,
-  "KP_0", "KP_1", "KP_2", "KP_3", "KP_4", "KP_5", "KP_6", "KP_7",
-  "KP_8", "KP_9", "asterisk", "plus", "bar", "minus", "period", "slash",
-  "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8",
-  "F9", "F10", "F11", "F12", "F13", "F14", "F15", "F16",
-  "F17", "F18", "F19", "F20", "F21", "F22", "F23", "F24",
-  0, 0, 0, 0, 0, 0, 0, 0,
-  "Num_Lock", "Scroll_Lock", 0, 0, 0, 0, 0, 0,
-  0, 0, 0, 0, 0, 0, 0, 0,
-  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-
-//-------------------------------------------------------------
-// Event loop handlers
-//-------------------------------------------------------------
-void vtkWin32RenderWindowInteractor::OnMouseMove(HWND hWnd, UINT nFlags,
-                                                 int X, int Y)
-{
-  if (!this->Enabled)
-    {
-    return;
-    }
-
-  // touch events handled by WM_TOUCH
-  if ((GetMessageExtraInfo() & MOUSEEVENTF_FROMTOUCH) == MOUSEEVENTF_FROMTOUCH)
-    {
-    return;
-    }
-
-  this->SetEventInformationFlipY(X,
-                                 Y,
-                                 nFlags & MK_CONTROL,
-                                 nFlags & MK_SHIFT);
-  this->SetAltKey(GetKeyState(VK_MENU) & (~1));
-  if (!this->MouseInWindow &&
-      (X >= 0 && X < this->Size[0] && Y >= 0 && Y < this->Size[1]))
-    {
-    this->InvokeEvent(vtkCommand::EnterEvent, NULL);
-    this->MouseInWindow = 1;
-    // request WM_MOUSELEAVE generation
-    TRACKMOUSEEVENT tme;
-    tme.cbSize = sizeof(TRACKMOUSEEVENT);
-    tme.dwFlags = TME_LEAVE;
-    tme.hwndTrack = hWnd;
-    TrackMouseEvent(&tme);
-    }
-
-  this->InvokeEvent(vtkCommand::MouseMoveEvent, NULL);
-}
-
-//----------------------------------------------------------------------------
-void vtkWin32RenderWindowInteractor::OnNCMouseMove(HWND, UINT nFlags,
-                                                   int X, int Y)
-{
-  if (!this->Enabled)
-    {
-    return;
-    }
-
-  int *pos = this->RenderWindow->GetPosition();
-  if (this->MouseInWindow)
-    {
-    this->SetEventInformationFlipY(X - pos[0],
-                                   Y - pos[1],
-                                   nFlags & MK_CONTROL,
-                                   nFlags & MK_SHIFT);
-    this->SetAltKey(GetKeyState(VK_MENU) & (~1));
-    this->InvokeEvent(vtkCommand::LeaveEvent, NULL);
-    this->MouseInWindow = 0;
-    }
-}
-
-//----------------------------------------------------------------------------
-void vtkWin32RenderWindowInteractor::OnMouseWheelForward(HWND,UINT nFlags,
-                                                   int X, int Y)
-{
-  if (!this->Enabled)
-    {
-    return;
-    }
-  this->SetEventInformationFlipY(X,
-                                 Y,
-                                 nFlags & MK_CONTROL,
-                                 nFlags & MK_SHIFT);
-  this->SetAltKey(GetKeyState(VK_MENU) & (~1));
-  this->InvokeEvent(vtkCommand::MouseWheelForwardEvent,NULL);
-}
-
-//----------------------------------------------------------------------------
-void vtkWin32RenderWindowInteractor::OnMouseWheelBackward(HWND,UINT nFlags,
-                                                   int X, int Y)
-{
-  if (!this->Enabled)
-    {
-    return;
-    }
-  this->SetEventInformationFlipY(X,
-                                 Y,
-                                 nFlags & MK_CONTROL,
-                                 nFlags & MK_SHIFT);
-  this->SetAltKey(GetKeyState(VK_MENU) & (~1));
-  this->InvokeEvent(vtkCommand::MouseWheelBackwardEvent,NULL);
-}
-
-//----------------------------------------------------------------------------
-void vtkWin32RenderWindowInteractor::OnLButtonDown(HWND wnd,UINT nFlags,
-                                                   int X, int Y, int repeat)
-{
-  if (!this->Enabled)
-    {
-    return;
-    }
-
-  // touch events handled by WM_TOUCH
-  if ((GetMessageExtraInfo() & MOUSEEVENTF_FROMTOUCH) == MOUSEEVENTF_FROMTOUCH)
-    {
-    return;
-    }
-
-  SetFocus(wnd);
-  SetCapture(wnd);
-  this->SetEventInformationFlipY(X,
-                                 Y,
-                                 nFlags & MK_CONTROL,
-                                 nFlags & MK_SHIFT,
-                                 0, repeat);
-  this->SetAltKey(GetKeyState(VK_MENU) & (~1));
-  this->InvokeEvent(vtkCommand::LeftButtonPressEvent,NULL);
-}
-
-//----------------------------------------------------------------------------
-void vtkWin32RenderWindowInteractor::OnLButtonUp(HWND,UINT nFlags,
-                                                 int X, int Y)
-{
-  if (!this->Enabled)
-    {
-    return;
-    }
-  // touch events handled by WM_TOUCH
-  if ((GetMessageExtraInfo() & MOUSEEVENTF_FROMTOUCH) == MOUSEEVENTF_FROMTOUCH)
-    {
-    return;
-    }
-  this->SetEventInformationFlipY(X,
-                                 Y,
-                                 nFlags & MK_CONTROL,
-                                 nFlags & MK_SHIFT);
-  this->SetAltKey(GetKeyState(VK_MENU) & (~1));
-  this->InvokeEvent(vtkCommand::LeftButtonReleaseEvent,NULL);
-  ReleaseCapture( );
-}
-
-//----------------------------------------------------------------------------
-void vtkWin32RenderWindowInteractor::OnMButtonDown(HWND wnd,UINT nFlags,
-                                                   int X, int Y, int repeat)
-{
-  if (!this->Enabled)
-    {
-    return;
-    }
-  SetFocus(wnd);
-  SetCapture(wnd);
-  this->SetEventInformationFlipY(X,
-                                 Y,
-                                 nFlags & MK_CONTROL,
-                                 nFlags & MK_SHIFT,
-                                 0, repeat);
-  this->SetAltKey(GetKeyState(VK_MENU) & (~1));
-  this->InvokeEvent(vtkCommand::MiddleButtonPressEvent,NULL);
-}
-
-//----------------------------------------------------------------------------
-void vtkWin32RenderWindowInteractor::OnMButtonUp(HWND,UINT nFlags,
-                                                 int X, int Y)
-{
-  if (!this->Enabled)
-    {
-    return;
-    }
-  this->SetEventInformationFlipY(X,
-                                 Y,
-                                 nFlags & MK_CONTROL,
-                                 nFlags & MK_SHIFT);
-  this->SetAltKey(GetKeyState(VK_MENU) & (~1));
-  this->InvokeEvent(vtkCommand::MiddleButtonReleaseEvent,NULL);
-  ReleaseCapture( );
-}
-
-//----------------------------------------------------------------------------
-void vtkWin32RenderWindowInteractor::OnRButtonDown(HWND wnd,UINT nFlags,
-                                                   int X, int Y, int repeat)
-{
-  if (!this->Enabled)
-    {
-    return;
-    }
-  SetFocus(wnd);
-  SetCapture(wnd);
-  this->SetEventInformationFlipY(X,
-                                 Y,
-                                 nFlags & MK_CONTROL,
-                                 nFlags & MK_SHIFT,
-                                 0, repeat);
-  this->SetAltKey(GetKeyState(VK_MENU) & (~1));
-  this->InvokeEvent(vtkCommand::RightButtonPressEvent,NULL);
-}
-
-//----------------------------------------------------------------------------
-void vtkWin32RenderWindowInteractor::OnRButtonUp(HWND,UINT nFlags,
-                                                 int X, int Y)
-{
-  if (!this->Enabled)
-    {
-    return;
-    }
-  this->SetEventInformationFlipY(X,
-                                 Y,
-                                 nFlags & MK_CONTROL,
-                                 nFlags & MK_SHIFT);
-  this->SetAltKey(GetKeyState(VK_MENU) & (~1));
-  this->InvokeEvent(vtkCommand::RightButtonReleaseEvent,NULL);
-  ReleaseCapture( );
-}
-
-//----------------------------------------------------------------------------
-void vtkWin32RenderWindowInteractor::OnSize(HWND,UINT, int X, int Y) {
-  this->UpdateSize(X,Y);
-  if (this->Enabled)
-    {
-    this->InvokeEvent(vtkCommand::ConfigureEvent,NULL);
-    }
-}
-
-//----------------------------------------------------------------------------
-void vtkWin32RenderWindowInteractor::OnTimer(HWND,UINT timerId)
-{
-  if (!this->Enabled)
-    {
-    return;
-    }
-  int tid = static_cast<int>(timerId);
-  this->InvokeEvent(vtkCommand::TimerEvent,(void*)&tid);
-
-  // Here we deal with one-shot versus repeating timers
-  if ( this->IsOneShotTimer(tid) )
-    {
-    KillTimer(this->WindowId,tid); //'cause windows timers are always repeating
-    }
-}
-
-//----------------------------------------------------------------------------
-void vtkWin32RenderWindowInteractor::OnKeyDown(HWND, UINT vCode, UINT nRepCnt, UINT nFlags)
-{
-  if (!this->Enabled)
-    {
-    return;
-    }
-  int ctrl  = GetKeyState(VK_CONTROL) & (~1);
-  int shift = GetKeyState(VK_SHIFT) & (~1);
-  int alt = GetKeyState(VK_MENU) & (~1);
-  WORD nChar = 0;
-  {
-#ifndef _WIN32_WCE
-    BYTE keyState[256];
-    GetKeyboardState(keyState);
-    if (ToAscii(vCode,nFlags & 0xff,keyState,&nChar,0) == 0)
-      {
-      nChar = 0;
-      }
-#endif
-  }
-  const char *keysym = AsciiToKeySymTable[(unsigned char)nChar];
-  if (keysym == 0)
-    {
-    keysym = VKeyCodeToKeySymTable[(unsigned char)vCode];
-    }
-  if (keysym == 0)
-    {
-    keysym = "None";
-    }
-  this->SetKeyEventInformation(ctrl,
-                               shift,
-                               nChar,
-                               nRepCnt,
-                               keysym);
-  this->SetAltKey(alt);
-  this->InvokeEvent(vtkCommand::KeyPressEvent, NULL);
-}
-
-//----------------------------------------------------------------------------
-void vtkWin32RenderWindowInteractor::OnKeyUp(HWND, UINT vCode, UINT nRepCnt, UINT nFlags)
-{
-  if (!this->Enabled)
-    {
-    return;
-    }
-  int ctrl  = GetKeyState(VK_CONTROL) & (~1);
-  int shift = GetKeyState(VK_SHIFT) & (~1);
-  int alt = GetKeyState(VK_MENU) & (~1);
-  WORD nChar = 0;
-  {
-    BYTE keyState[256];
-#ifndef _WIN32_WCE
-    GetKeyboardState(keyState);
-    if (ToAscii(vCode,nFlags & 0xff,keyState,&nChar,0) == 0)
-      {
-      nChar = 0;
-      }
-#endif
-  }
-  const char *keysym = AsciiToKeySymTable[(unsigned char)nChar];
-  if (keysym == 0)
-    {
-    keysym = VKeyCodeToKeySymTable[(unsigned char)vCode];
-    }
-  if (keysym == 0)
-    {
-    keysym = "None";
-    }
-  this->SetKeyEventInformation(ctrl,
-                               shift,
-                               nChar,
-                               nRepCnt,
-                               keysym);
-  this->SetAltKey(alt);
-  this->InvokeEvent(vtkCommand::KeyReleaseEvent, NULL);
-}
-
-//----------------------------------------------------------------------------
-void vtkWin32RenderWindowInteractor::OnChar(HWND,UINT nChar,
-                                            UINT nRepCnt, UINT)
-{
-  if (!this->Enabled)
-    {
-    return;
-    }
-  int ctrl  = GetKeyState(VK_CONTROL) & (~1);
-  int shift = GetKeyState(VK_SHIFT) & (~1);
-  int alt = GetKeyState(VK_MENU) & (~1);
-  this->SetKeyEventInformation(ctrl,
-                               shift,
-                               nChar,
-                               nRepCnt);
-  this->SetAltKey(alt);
-  this->InvokeEvent(vtkCommand::CharEvent, NULL);
-}
-
-//----------------------------------------------------------------------------
-void vtkWin32RenderWindowInteractor::OnFocus(HWND,UINT)
-{
-  if (!this->Enabled)
-    {
-    return;
-    }
-
-#ifdef VTK_USE_TDX
-  if(this->Device->GetInitialized() && !this->Device->GetIsListening())
-    {
-    this->Device->StartListening();
-    }
-#endif
-}
-
-//----------------------------------------------------------------------------
-void vtkWin32RenderWindowInteractor::OnKillFocus(HWND,UINT)
-{
-  if (!this->Enabled)
-    {
-    return;
-    }
-#ifdef VTK_USE_TDX
-  if(this->Device->GetInitialized() && this->Device->GetIsListening())
-    {
-    this->Device->StopListening();
-    }
-#endif
-}
-
-// This function is used to return an index given an ID
-int vtkWin32RenderWindowInteractor::GetContactIndex(int dwID)
-{
-  for (int i=0; i < VTKI_MAX_POINTERS; i++)
-    {
-    if (this->IDLookup[i] == dwID)
-      {
-      return i;
-      }
-    }
-
-  for (int i=0; i < VTKI_MAX_POINTERS; i++)
-    {
-    if (this->IDLookup[i] == -1)
-      {
-      this->IDLookup[i] = dwID;
-      return i;
-      }
-    }
-
-  // Out of contacts
-  return -1;
-}
-
-//----------------------------------------------------------------------------
-void vtkWin32RenderWindowInteractor::OnTouch(HWND hWnd, UINT wParam, UINT lParam)
-{
-  if (!this->Enabled)
-    {
-    return;
-    }
-
-  UINT cInputs = LOWORD(wParam);
-  PTOUCHINPUT pInputs = new TOUCHINPUT[cInputs];
-  if (pInputs)
-    {
-    int ctrl  = GetKeyState(VK_CONTROL) & (~1);
-    int shift = GetKeyState(VK_SHIFT) & (~1);
-    this->SetAltKey(GetKeyState(VK_MENU) & (~1));
-    GetTouchInputInfoType GTII =
-      (GetTouchInputInfoType)GetProcAddress(GetModuleHandle(TEXT("user32")), "GetTouchInputInfo");
-    if (GTII((HTOUCHINPUT)lParam, cInputs, pInputs, sizeof(TOUCHINPUT)))
-      {
-      POINT ptInput;
-      for (UINT i=0; i < cInputs; i++)
-        {
-        TOUCHINPUT ti = pInputs[i];
-        int index = this->GetContactIndex(ti.dwID);
-        if (ti.dwID != 0 && index < VTKI_MAX_POINTERS)
-          {
-            // Do something with your touch input handle
-            ptInput.x = TOUCH_COORD_TO_PIXEL(ti.x);
-            ptInput.y = TOUCH_COORD_TO_PIXEL(ti.y);
-            ScreenToClient(hWnd, &ptInput);
-            this->SetEventInformationFlipY(ptInput.x,
-                                           ptInput.y,
-                                           ctrl,
-                                           shift,
-                                           0,0,0,
-                                           index);
-          }
-        }
-      bool didUpOrDown = false;
-      for (UINT i=0; i < cInputs; i++)
-        {
-        TOUCHINPUT ti = pInputs[i];
-        int index = this->GetContactIndex(ti.dwID);
-        if (ti.dwID != 0 && index < VTKI_MAX_POINTERS)
-          {
-          if (ti.dwFlags & TOUCHEVENTF_UP)
-            {
-            this->SetPointerIndex(index);
-            didUpOrDown = true;
-            this->InvokeEvent(vtkCommand::LeftButtonReleaseEvent,NULL);
-            this->IDLookup[index] = -1;
-            }
-          if (ti.dwFlags & TOUCHEVENTF_DOWN)
-            {
-            this->SetPointerIndex(index);
-            didUpOrDown = true;
-            this->InvokeEvent(vtkCommand::LeftButtonPressEvent,NULL);
-            }
-          this->SetPointerIndex(index);
-          }
-        }
-      if (!didUpOrDown)
-        {
-        this->InvokeEvent(vtkCommand::MouseMoveEvent, NULL);
-        }
-      }
-    CloseTouchInputHandleType CTIH =
-      (CloseTouchInputHandleType)GetProcAddress(GetModuleHandle(TEXT("user32")), "CloseTouchInputHandle");
-    CTIH((HTOUCHINPUT)lParam);
-    delete [] pInputs;
-    }
-}
-
-//----------------------------------------------------------------------------
-// This is only called when InstallMessageProc is true
-LRESULT CALLBACK vtkHandleMessage(HWND hWnd,UINT uMsg, WPARAM wParam,
-                                  LPARAM lParam)
-{
-  LRESULT res = 0;
-  vtkWin32OpenGLRenderWindow *ren;
-  vtkWin32RenderWindowInteractor *me = 0;
-
-  ren = (vtkWin32OpenGLRenderWindow *)vtkGetWindowLong(hWnd,sizeof(vtkLONG));
-
-  if (ren)
-    {
-    me = (vtkWin32RenderWindowInteractor *)ren->GetInteractor();
-    }
-
-  if (me && me->GetReferenceCount()>0)
-    {
-    me->Register(me);
-    res = vtkHandleMessage2(hWnd,uMsg,wParam,lParam,me);
-    me->UnRegister(me);
-    }
-
-  return res;
-}
-
-#ifndef MAKEPOINTS
-#define MAKEPOINTS(l)   (*((POINTS FAR *) & (l)))
-#endif
-
-//----------------------------------------------------------------------------
-LRESULT CALLBACK vtkHandleMessage2(HWND hWnd,UINT uMsg, WPARAM wParam,
-                                   LPARAM lParam,
-                                   vtkWin32RenderWindowInteractor *me)
-{
-  if ((uMsg == WM_USER+13)&&(wParam == 26))
-    {
-    // someone is telling us to set our OldProc
-    me->OldProc = (WNDPROC)lParam;
-    return 1;
-    }
-
-  switch (uMsg)
-    {
-    case WM_PAINT:
-      me->Render();
-      return CallWindowProc(me->OldProc,hWnd,uMsg,wParam,lParam);
-
-    case WM_SIZE:
-      me->OnSize(hWnd,wParam,LOWORD(lParam),HIWORD(lParam));
-      return CallWindowProc(me->OldProc,hWnd,uMsg,wParam,lParam);
-
-    case WM_LBUTTONDBLCLK:
-      me->OnLButtonDown(hWnd,wParam,MAKEPOINTS(lParam).x,MAKEPOINTS(lParam).y, 1);
-      break;
-
-    case WM_LBUTTONDOWN:
-      me->OnLButtonDown(hWnd,wParam,MAKEPOINTS(lParam).x,MAKEPOINTS(lParam).y, 0);
-      break;
-
-    case WM_LBUTTONUP:
-      me->OnLButtonUp(hWnd,wParam,MAKEPOINTS(lParam).x,MAKEPOINTS(lParam).y);
-      break;
-
-    case WM_MBUTTONDBLCLK:
-      me->OnMButtonDown(hWnd,wParam,MAKEPOINTS(lParam).x,MAKEPOINTS(lParam).y, 1);
-      break;
-
-    case WM_MBUTTONDOWN:
-      me->OnMButtonDown(hWnd,wParam,MAKEPOINTS(lParam).x,MAKEPOINTS(lParam).y, 0);
-      break;
-
-    case WM_MBUTTONUP:
-      me->OnMButtonUp(hWnd,wParam,MAKEPOINTS(lParam).x,MAKEPOINTS(lParam).y);
-      break;
-
-    case WM_RBUTTONDBLCLK:
-      me->OnRButtonDown(hWnd,wParam,MAKEPOINTS(lParam).x,MAKEPOINTS(lParam).y, 1);
-      break;
-
-    case WM_RBUTTONDOWN:
-      me->OnRButtonDown(hWnd,wParam,MAKEPOINTS(lParam).x,MAKEPOINTS(lParam).y, 0);
-      break;
-
-    case WM_RBUTTONUP:
-      me->OnRButtonUp(hWnd,wParam,MAKEPOINTS(lParam).x,MAKEPOINTS(lParam).y);
-      break;
-
-    case WM_MOUSELEAVE:
-      me->InvokeEvent(vtkCommand::LeaveEvent, NULL);
-      me->MouseInWindow = 0;
-      break;
-
-    case WM_MOUSEMOVE:
-      me->OnMouseMove(hWnd,wParam,MAKEPOINTS(lParam).x,MAKEPOINTS(lParam).y);
-      break;
-
-    case WM_MOUSEWHEEL:
-      {
-      POINT pt;
-      pt.x = MAKEPOINTS(lParam).x;
-      pt.y = MAKEPOINTS(lParam).y;
-      ::ScreenToClient(hWnd, &pt);
-      if( GET_WHEEL_DELTA_WPARAM(wParam) > 0)
-        me->OnMouseWheelForward(hWnd,wParam,pt.x,pt.y);
-      else
-        me->OnMouseWheelBackward(hWnd,wParam,pt.x,pt.y);
-      }
-      break;
-
-#ifdef WM_MCVMOUSEMOVE
-    case WM_NCMOUSEMOVE:
-      me->OnNCMouseMove(hWnd,wParam,MAKEPOINTS(lParam).x,MAKEPOINTS(lParam).y);
-      break;
-#endif
-
-    case WM_CLOSE:
-      me->ExitCallback();
-      break;
-
-    case WM_CHAR:
-      me->OnChar(hWnd,wParam,LOWORD(lParam),HIWORD(lParam));
-      break;
-
-    case WM_KEYDOWN:
-    case WM_SYSKEYDOWN:
-      me->OnKeyDown(hWnd,wParam,LOWORD(lParam),HIWORD(lParam));
-      break;
-
-    case WM_KEYUP:
-    case WM_SYSKEYUP:
-      me->OnKeyUp(hWnd,wParam,LOWORD(lParam),HIWORD(lParam));
-      break;
-
-    case WM_TIMER:
-      me->OnTimer(hWnd,wParam);
-      break;
-
-    case WM_ACTIVATE:
-      if(wParam==WA_INACTIVE)
-        {
-        me->OnKillFocus(hWnd,wParam);
-        }
-      else
-        {
-        me->OnFocus(hWnd,wParam);
-        }
-      break;
-
-    case WM_SETFOCUS:
-      // occurs when SetFocus() is called on the current window
-      me->OnFocus(hWnd,wParam);
-      break;
-
-    case WM_KILLFOCUS:
-      // occurs when the focus was on the current window and SetFocus() is
-      // called on another window.
-      me->OnKillFocus(hWnd,wParam);
-      break;
-
-    case WM_TOUCH:
-      me->OnTouch(hWnd,wParam,lParam);
-      break;
-
-    default:
-      if (me)
-        {
-        return CallWindowProc(me->OldProc,hWnd,uMsg,wParam,lParam);
-        }
-    };
-
-  return 0;
-}
-
-//----------------------------------------------------------------------------
-// Specify the default function to be called when an interactor needs to exit.
-// This callback is overridden by an instance ExitMethod that is defined.
-void
-vtkWin32RenderWindowInteractor::SetClassExitMethod(void (*f)(void *),void *arg)
-{
-  if ( f != vtkWin32RenderWindowInteractor::ClassExitMethod
-       || arg != vtkWin32RenderWindowInteractor::ClassExitMethodArg)
-    {
-    // delete the current arg if there is a delete method
-    if ((vtkWin32RenderWindowInteractor::ClassExitMethodArg)
-        && (vtkWin32RenderWindowInteractor::ClassExitMethodArgDelete))
-      {
-      (*vtkWin32RenderWindowInteractor::ClassExitMethodArgDelete)
-        (vtkWin32RenderWindowInteractor::ClassExitMethodArg);
-      }
-    vtkWin32RenderWindowInteractor::ClassExitMethod = f;
-    vtkWin32RenderWindowInteractor::ClassExitMethodArg = arg;
-
-    // no call to this->Modified() since this is a class member function
-    }
-}
-
-//----------------------------------------------------------------------------
-// Set the arg delete method.  This is used to free user memory.
-void
-vtkWin32RenderWindowInteractor::SetClassExitMethodArgDelete(void (*f)(void *))
-{
-  if (f != vtkWin32RenderWindowInteractor::ClassExitMethodArgDelete)
-    {
-    vtkWin32RenderWindowInteractor::ClassExitMethodArgDelete = f;
-
-    // no call to this->Modified() since this is a class member function
-    }
-}
-
-//----------------------------------------------------------------------------
-void vtkWin32RenderWindowInteractor::PrintSelf(ostream& os, vtkIndent indent)
-{
-  this->Superclass::PrintSelf(os,indent);
-  os << indent << "InstallMessageProc: " << this->InstallMessageProc << endl;
-  os << indent << "StartedMessageLoop: " << this->StartedMessageLoop << endl;
-}
-
-//----------------------------------------------------------------------------
-void vtkWin32RenderWindowInteractor::ExitCallback()
-{
-  if (this->HasObserver(vtkCommand::ExitEvent))
-    {
-    this->InvokeEvent(vtkCommand::ExitEvent,NULL);
-    }
-  else if (this->ClassExitMethod)
-    {
-    (*this->ClassExitMethod)(this->ClassExitMethodArg);
-    }
-
-  this->TerminateApp();
-}
diff --git a/Rendering/OpenGL2/vtkWin32RenderWindowInteractor.h b/Rendering/OpenGL2/vtkWin32RenderWindowInteractor.h
deleted file mode 100644
index 2d51518..0000000
--- a/Rendering/OpenGL2/vtkWin32RenderWindowInteractor.h
+++ /dev/null
@@ -1,158 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkWin32RenderWindowInteractor.h
-
-  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.
-
-=========================================================================*/
-// .NAME vtkWin32RenderWindowInteractor - implements Win32 specific functions
-// required by vtkRenderWindowInteractor.
-//
-// .SECTION Description
-// By default the interactor installs a MessageProc callback which
-// intercepts windows' messages to the window and controls interactions by
-// routing them to the InteractoStyle classes.
-// MFC or BCB programs can prevent this and instead directly route any mouse/key
-// messages into the event bindings by setting InstallMessageProc to false.
-// This provides a minimal "Mapped" mode of interaction
-//
-#ifndef vtkWin32RenderWindowInteractor_h
-#define vtkWin32RenderWindowInteractor_h
-
-#include "vtkRenderingOpenGL2Module.h" // For export macro
-#include "vtkRenderWindowInteractor.h"
-#include "vtkWindows.h" // For windows API.
-
-#include "vtkTDxConfigure.h" // defines VTK_USE_TDX
-#ifdef VTK_USE_TDX
-class vtkTDxWinDevice;
-#endif
-
-class VTKRENDERINGOPENGL2_EXPORT vtkWin32RenderWindowInteractor : public vtkRenderWindowInteractor
-{
-public:
-  // Description:
-  // Construct object so that light follows camera motion.
-  static vtkWin32RenderWindowInteractor *New();
-
-  vtkTypeMacro(vtkWin32RenderWindowInteractor,vtkRenderWindowInteractor);
-  void PrintSelf(ostream& os, vtkIndent indent);
-
-  // Description:
-  // Initialize the event handler
-  virtual void Initialize();
-
-  // Description:
-  // Enable/Disable interactions.  By default interactors are enabled when
-  // initialized.  Initialize() must be called prior to enabling/disabling
-  // interaction. These methods are used when a window/widget is being
-  // shared by multiple renderers and interactors.  This allows a "modal"
-  // display where one interactor is active when its data is to be displayed
-  // and all other interactors associated with the widget are disabled
-  // when their data is not displayed.
-  virtual void Enable();
-  virtual void Disable();
-
-  // Description:
-  // By default the interactor installs a MessageProc callback which
-  // intercepts windows messages to the window and controls interactions.
-  // MFC or BCB programs can prevent this and instead directly route any mouse/key
-  // messages into the event bindings by setting InstallMessgeProc to false.
-  vtkSetMacro(InstallMessageProc,int);
-  vtkGetMacro(InstallMessageProc,int);
-  vtkBooleanMacro(InstallMessageProc,int);
-
-  // Description:
-  // Win32 specific application terminate, calls ClassExitMethod then
-  // calls PostQuitMessage(0) to terminate the application. An application can Specify
-  // ExitMethod for alternative behavior (i.e. suppression of keyboard exit)
-  void TerminateApp(void);
-
-  friend VTKRENDERINGOPENGL2_EXPORT LRESULT CALLBACK vtkHandleMessage(HWND hwnd,UINT uMsg, WPARAM w, LPARAM l);
-  friend VTKRENDERINGOPENGL2_EXPORT LRESULT CALLBACK vtkHandleMessage2(HWND hwnd,UINT uMsg, WPARAM w, LPARAM l, vtkWin32RenderWindowInteractor *me);
-
-  // Description:
-  // Various methods that a Win32 window can redirect to this class to be
-  // handled.
-  virtual void OnMouseMove  (HWND wnd, UINT nFlags, int X, int Y);
-  virtual void OnNCMouseMove(HWND wnd, UINT nFlags, int X, int Y);
-  virtual void OnRButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat=0);
-  virtual void OnRButtonUp  (HWND wnd, UINT nFlags, int X, int Y);
-  virtual void OnMButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat=0);
-  virtual void OnMButtonUp  (HWND wnd, UINT nFlags, int X, int Y);
-  virtual void OnLButtonDown(HWND wnd, UINT nFlags, int X, int Y, int repeat=0);
-  virtual void OnLButtonUp  (HWND wnd, UINT nFlags, int X, int Y);
-  virtual void OnSize       (HWND wnd, UINT nType,  int X, int Y);
-  virtual void OnTimer      (HWND wnd, UINT nIDEvent);
-  virtual void OnKeyDown    (HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags);
-  virtual void OnKeyUp      (HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags);
-  virtual void OnChar       (HWND wnd, UINT nChar, UINT nRepCnt, UINT nFlags);
-  virtual void OnMouseWheelForward (HWND wnd, UINT nFlags, int X, int Y);
-  virtual void OnMouseWheelBackward(HWND wnd, UINT nFlags, int X, int Y);
-  virtual void OnFocus(HWND wnd, UINT nFlags);
-  virtual void OnKillFocus(HWND wnd, UINT nFlags);
-  virtual void OnTouch(HWND wnd, UINT wParam, UINT lParam);
-
-  // Description:
-  // Methods to set the default exit method for the class. This method is
-  // only used if no instance level ExitMethod has been defined.  It is
-  // provided as a means to control how an interactor is exited given
-  // the various language bindings (tcl, Win32, etc.).
-  static void SetClassExitMethod(void (*f)(void *), void *arg);
-  static void SetClassExitMethodArgDelete(void (*f)(void *));
-
-  // Description:
-  // These methods correspond to the the Exit, User and Pick
-  // callbacks. They allow for the Style to invoke them.
-  virtual void ExitCallback();
-
-protected:
-  vtkWin32RenderWindowInteractor();
-  ~vtkWin32RenderWindowInteractor();
-
-  HWND    WindowId;
-  WNDPROC OldProc;
-  int     InstallMessageProc;
-  int     MouseInWindow;
-  int     StartedMessageLoop;
-
-  // Description:
-  // Class variables so an exit method can be defined for this class
-  // (used to set different exit methods for various language bindings,
-  // i.e. tcl, java, Win32)
-  static void (*ClassExitMethod)(void *);
-  static void (*ClassExitMethodArgDelete)(void *);
-  static void *ClassExitMethodArg;
-
-  // Description:
-  // Win32-specific internal timer methods. See the superclass for detailed
-  // documentation.
-  virtual int InternalCreateTimer(int timerId, int timerType, unsigned long duration);
-  virtual int InternalDestroyTimer(int platformTimerId);
-
-  // Description:
-  // This will start up the event loop and never return. If you
-  // call this method it will loop processing events until the
-  // application is exited.
-  virtual void StartEventLoop();
-
-  int GetContactIndex(int id);
-  int IDLookup[VTKI_MAX_POINTERS];
-
-#ifdef VTK_USE_TDX
-  vtkTDxWinDevice *Device;
-#endif
-
-private:
-  vtkWin32RenderWindowInteractor(const vtkWin32RenderWindowInteractor&);  // Not implemented.
-  void operator=(const vtkWin32RenderWindowInteractor&);  // Not implemented.
-};
-
-#endif
diff --git a/Rendering/OpenGL2/vtkXOpenGLRenderWindow.cxx b/Rendering/OpenGL2/vtkXOpenGLRenderWindow.cxx
index 5687638..ca9fee1 100644
--- a/Rendering/OpenGL2/vtkXOpenGLRenderWindow.cxx
+++ b/Rendering/OpenGL2/vtkXOpenGLRenderWindow.cxx
@@ -17,17 +17,10 @@
 #include "vtkOpenGLRenderer.h"
 
 #include "vtk_glew.h"
-// Define GLX_GLXEXT_LEGACY to prevent glx.h from including the glxext.h
-// provided by the system.
-//#define GLX_GLXEXT_LEGACY
 
-// New Workaround:
-// The GLX_GLXEXT_LEGACY definition was added to work around system glxext.h
-// files that used the GLintptr and GLsizeiptr types, but did not define them.
-// However, this broke multisampling (See PR#15433). Instead of using that
-// define, we're just defining the missing typedefs here.
-typedef ptrdiff_t GLintptr;
-typedef ptrdiff_t GLsizeiptr;
+// define GLX_GLXEXT_LEGACY to prevent glx.h to include glxext.h provided by
+// the system
+//#define GLX_GLXEXT_LEGACY
 #include "GL/glx.h"
 
 #include "vtkToolkits.h"
@@ -50,10 +43,6 @@ typedef ptrdiff_t GLsizeiptr;
 #include <X11/Xutil.h>
 #include <X11/cursorfont.h>
 
-#define GLX_CONTEXT_MAJOR_VERSION_ARB       0x2091
-#define GLX_CONTEXT_MINOR_VERSION_ARB       0x2092
-typedef GLXContext (*glXCreateContextAttribsARBProc)(Display*, GLXFBConfig, GLXContext, Bool, const int*);
-
 class vtkXOpenGLRenderWindow;
 class vtkRenderWindow;
 class vtkXOpenGLRenderWindowInternal
@@ -63,7 +52,6 @@ private:
   vtkXOpenGLRenderWindowInternal(vtkRenderWindow*);
 
   GLXContext ContextId;
-  GLXFBConfig *FBConfig;
 
   // so we basically have 4 methods here for handling drawables
   // how about abstracting this a bit?
@@ -160,7 +148,6 @@ GLXFBConfig* vtkXOpenGLRenderWindowTryForFBConfig(Display *DisplayId,
   if (doublebuff)
     {
     attributes[index++] = GLX_DOUBLEBUFFER;
-    attributes[index++] = True;
     }
   if (stencil)
     {
@@ -171,7 +158,6 @@ GLXFBConfig* vtkXOpenGLRenderWindowTryForFBConfig(Display *DisplayId,
     {
     // also try for STEREO
     attributes[index++] = GLX_STEREO;
-    attributes[index++] = True;
     }
   if (multisamples)
     {
@@ -196,17 +182,52 @@ XVisualInfo *vtkXOpenGLRenderWindowTryForVisual(Display *DisplayId,
                                                 int alphaBitPlanes,
                                                 int stencil)
 {
-  GLXFBConfig *fbc = vtkXOpenGLRenderWindowTryForFBConfig(DisplayId,
-       GLX_WINDOW_BIT,
-       doublebuff,
-       stereo, multisamples,
-       alphaBitPlanes,
-       stencil);
+  int           index;
+  static int    attributes[50];
 
-  XVisualInfo *v = glXGetVisualFromFBConfig( DisplayId, fbc[0]);
-  XFree (fbc);
+  // setup the default stuff we ask for
+  index = 0;
+  attributes[index++] = GLX_RGBA;
+  attributes[index++] = GLX_RED_SIZE;
+  attributes[index++] = 1;
+  attributes[index++] = GLX_GREEN_SIZE;
+  attributes[index++] = 1;
+  attributes[index++] = GLX_BLUE_SIZE;
+  attributes[index++] = 1;
+  attributes[index++] = GLX_DEPTH_SIZE;
+  attributes[index++] = 1;
+  if (alphaBitPlanes)
+    {
+    attributes[index++] = GLX_ALPHA_SIZE;
+    attributes[index++] = 1;
+    }
+  if (doublebuff)
+    {
+    attributes[index++] = GLX_DOUBLEBUFFER;
+    }
+  if (stencil)
+    {
+    attributes[index++] = GLX_STENCIL_SIZE;
+    attributes[index++] = 8;
+    }
+  if (stereo)
+    {
+    // also try for STEREO
+    attributes[index++] = GLX_STEREO;
+    }
+  if (multisamples)
+    {
+#ifdef GLX_SAMPLE_BUFFERS_SGIS
+    attributes[index++] = GLX_SAMPLE_BUFFERS_SGIS;
+    attributes[index++] = 1;
+    attributes[index++] = GLX_SAMPLES_SGIS;
+    attributes[index++] = multisamples;
+#endif
+    }
 
-  return v;
+  attributes[index++] = None;
+
+  return glXChooseVisual(DisplayId, XDefaultScreen(DisplayId), attributes );
 }
 
 GLXFBConfig *vtkXOpenGLRenderWindowGetDesiredFBConfig(
@@ -275,6 +296,10 @@ GLXFBConfig *vtkXOpenGLRenderWindowGetDesiredFBConfig(
 XVisualInfo *vtkXOpenGLRenderWindow::GetDesiredVisualInfo()
 {
   XVisualInfo   *v = NULL;
+  int           alpha;
+  int           multi;
+  int           stereo = 0;
+  int           stencil;
 
   // get the default display connection
   if (!this->DisplayId)
@@ -291,29 +316,62 @@ XVisualInfo *vtkXOpenGLRenderWindow::GetDesiredVisualInfo()
     this->OwnDisplay = 1;
     }
 
-  this->Internal->FBConfig =
-    vtkXOpenGLRenderWindowGetDesiredFBConfig(
-      this->DisplayId,
-      this->StereoCapableWindow,
-      this->MultiSamples,
-      this->DoubleBuffer,
-      this->AlphaBitPlanes,
-      GLX_WINDOW_BIT,
-      this->StencilCapable);
-
-  if (!this->Internal->FBConfig)
+  // try every possibility stoping when we find one that works
+  for (stencil = this->StencilCapable; !v && stencil >= 0; stencil--)
     {
-    vtkErrorMacro(<< "Could not find a decent config\n");
+    for (alpha = this->AlphaBitPlanes; !v && alpha >= 0; alpha--)
+      {
+      for (stereo = this->StereoCapableWindow; !v && stereo >= 0; stereo--)
+        {
+        for (multi = this->MultiSamples; !v && multi >= 0; multi--)
+          {
+          if (v)
+            {
+            XFree(v);
+            }
+          v = vtkXOpenGLRenderWindowTryForVisual(this->DisplayId,
+                                                 this->DoubleBuffer,
+                                                 stereo, multi, alpha,
+                                                 stencil);
+          if (v)
+            {
+            this->StereoCapableWindow = stereo;
+            this->MultiSamples = multi;
+            this->AlphaBitPlanes = alpha;
+            this->StencilCapable = stencil;
+            }
+          }
+        }
+      }
     }
-  else
+  for (stencil = this->StencilCapable; !v && stencil >= 0; stencil--)
     {
-    v = glXGetVisualFromFBConfig( this->DisplayId,
-      this->Internal->FBConfig[0]);
-    if (!v)
+    for (alpha = this->AlphaBitPlanes; !v && alpha >= 0; alpha--)
       {
-      vtkErrorMacro(<< "Could not find a decent visual\n");
+      for (stereo = this->StereoCapableWindow; !v && stereo >= 0; stereo--)
+        {
+        for (multi = this->MultiSamples; !v && multi >= 0; multi--)
+          {
+          v = vtkXOpenGLRenderWindowTryForVisual(this->DisplayId,
+                                                 !this->DoubleBuffer,
+                                                 stereo, multi, alpha,
+                                                 stencil);
+          if (v)
+            {
+            this->DoubleBuffer = !this->DoubleBuffer;
+            this->StereoCapableWindow = stereo;
+            this->MultiSamples = multi;
+            this->AlphaBitPlanes = alpha;
+            this->StencilCapable = stencil;
+            }
+          }
+        }
       }
     }
+  if (!v)
+    {
+    vtkErrorMacro(<< "Could not find a decent visual\n");
+    }
   return ( v );
 }
 
@@ -543,41 +601,7 @@ void vtkXOpenGLRenderWindow::CreateAWindow()
       }
     }
 
-  // try for 32 context
-  if (this->Internal->FBConfig)
-    {
-    // NOTE: It is not necessary to create or make current to a context before
-    // calling glXGetProcAddressARB
-    glXCreateContextAttribsARBProc glXCreateContextAttribsARB = 0;
-    glXCreateContextAttribsARB = (glXCreateContextAttribsARBProc)
-      glXGetProcAddressARB( (const GLubyte *) "glXCreateContextAttribsARB" );
-
-    int context_attribs[] =
-      {
-      GLX_CONTEXT_MAJOR_VERSION_ARB, 3,
-      GLX_CONTEXT_MINOR_VERSION_ARB, 2,
-      //GLX_CONTEXT_FLAGS_ARB        , GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB,
-      0
-      };
-
-    if (glXCreateContextAttribsARB)
-      {
-      this->Internal->ContextId =
-        glXCreateContextAttribsARB( this->DisplayId,
-          this->Internal->FBConfig[0], 0,
-          GL_TRUE, context_attribs );
-
-      // Sync to ensure any errors generated are processed.
-      XSync( this->DisplayId, False );
-      if ( this->Internal->ContextId )
-        {
-        this->SetContextSupportsOpenGL32(true);
-        }
-      }
-    }
-
-  // old failsafe
-  if (this->Internal->ContextId == NULL)
+  if (!this->Internal->ContextId)
     {
     this->Internal->ContextId =
       glXCreateContext(this->DisplayId, v, 0, GL_TRUE);
@@ -693,7 +717,7 @@ void vtkXOpenGLRenderWindow::DestroyWindow()
 
   if (this->OwnContext && this->Internal->ContextId)
     {
-    this->MakeCurrent();
+      this->MakeCurrent();
     // tell each of the renderers that this render window/graphics context
     // is being removed (the RendererCollection is removed by vtkRenderWindow's
     // destructor)
@@ -706,10 +730,15 @@ void vtkXOpenGLRenderWindow::DestroyWindow()
       ren->SetRenderWindow(NULL);
       ren->SetRenderWindow(this);
       }
-    this->ReleaseGraphicsResources();
 
     if (this->Internal->ContextId)
       {
+      /* first delete all the old lights */
+      for (short cur_light = GL_LIGHT0; cur_light < GL_LIGHT0+MAX_LIGHTS; cur_light++)
+        {
+        glDisable(static_cast<GLenum>(cur_light));
+        }
+
       glFinish();
       glXDestroyContext(this->DisplayId, this->Internal->ContextId);
       }
@@ -730,8 +759,11 @@ void vtkXOpenGLRenderWindow::DestroyWindow()
     this->DisplayId = NULL;
     }
 
-  delete[] this->Capabilities;
-  this->Capabilities = 0;
+  if (this->Capabilities)
+    {
+    delete[] this->Capabilities;
+    this->Capabilities = 0;
+    }
 
   // make sure all other code knows we're not mapped anymore
   this->Mapped = 0;
@@ -741,6 +773,8 @@ void vtkXOpenGLRenderWindow::DestroyWindow()
 void vtkXOpenGLRenderWindow::CreateOffScreenWindow(int width, int height)
 {
 
+  XVisualInfo  *v;
+
   this->DoubleBuffer = 0;
 
   // always prefer OSMESA if we built with it
@@ -778,77 +812,75 @@ void vtkXOpenGLRenderWindow::CreateOffScreenWindow(int width, int height)
         this->OwnDisplay = 1;
         }
 
-      if(!this->Internal->PbufferContextId)
-        {
-        // get FBConfig
-        GLXFBConfig* fb = vtkXOpenGLRenderWindowGetDesiredFBConfig(
-          this->DisplayId,this->StereoCapableWindow, this->MultiSamples,
-          this->DoubleBuffer,this->AlphaBitPlanes, GLX_PBUFFER_BIT,
-          this->StencilCapable);
-        if(fb)
-          {
-          XErrorHandler previousHandler = XSetErrorHandler(vtkXOGLPbufferErrorHandler);
-          // NOTE: It is not necessary to create or make current to a context before
-          // calling glXGetProcAddressARB
-          glXCreateContextAttribsARBProc glXCreateContextAttribsARB = 0;
-          glXCreateContextAttribsARB = (glXCreateContextAttribsARBProc)
-            glXGetProcAddressARB( (const GLubyte *) "glXCreateContextAttribsARB" );
-
-          int context_attribs[] =
-            {
-            GLX_CONTEXT_MAJOR_VERSION_ARB, 3,
-            GLX_CONTEXT_MINOR_VERSION_ARB, 2,
-            //GLX_CONTEXT_FLAGS_ARB        , GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB,
-            0
-            };
+      int v1, v2;
+      glXQueryVersion(this->DisplayId, &v1, &v2);
 
-        if (glXCreateContextAttribsARB)
+      // check for GLX 1.3 or greater for Pbuffer offscreen support
+      if(v1 > 1 || (v1 == 1 && v2 >= 3))
+        {
+        if(!this->Internal->PbufferContextId)
           {
-          this->Internal->PbufferContextId =
-            glXCreateContextAttribsARB( this->DisplayId,
-              fb[0], 0,
-              GL_TRUE, context_attribs );
-
-          // Sync to ensure any errors generated are processed.
-          XSync( this->DisplayId, False );
-          if ( this->Internal->ContextId )
+          // get FBConfig
+          GLXFBConfig* fb = vtkXOpenGLRenderWindowGetDesiredFBConfig(
+            this->DisplayId,this->StereoCapableWindow, this->MultiSamples,
+            this->DoubleBuffer,this->AlphaBitPlanes, GLX_PBUFFER_BIT,
+            this->StencilCapable);
+          if(fb)
             {
-            this->SetContextSupportsOpenGL32(true);
+            XErrorHandler previousHandler = XSetErrorHandler(vtkXOGLPbufferErrorHandler);
+            this->Internal->PbufferContextId =
+              glXCreateNewContext(this->DisplayId, fb[0],
+                                       GLX_RGBA_TYPE, NULL, true);
+            int atts [] =
+              {
+                GLX_PBUFFER_WIDTH, width,
+                GLX_PBUFFER_HEIGHT, height,
+                0
+              };
+            this->Internal->Pbuffer = glXCreatePbuffer(this->DisplayId,
+                                                            fb[0], atts);
+            glXMakeContextCurrent( this->DisplayId,
+                                        this->Internal->Pbuffer,
+                                        this->Internal->Pbuffer,
+                                        this->Internal->PbufferContextId );
+            XFree(fb);
+            XSetErrorHandler(previousHandler);
+            // failed to allocate Pbuffer, clean up
+            if(PbufferAllocFail)
+              {
+              //vtkglX::DestroyPbuffer(this->DisplayId, this->Internal->Pbuffer);
+              this->Internal->Pbuffer = 0;
+              if(this->Internal->PbufferContextId)
+                glXDestroyContext(this->DisplayId,
+                                  this->Internal->PbufferContextId);
+              this->Internal->PbufferContextId = NULL;
+              }
+            PbufferAllocFail = 0;
             }
           }
+        }
 
-        // old failsafe
-        if (this->Internal->PbufferContextId == NULL)
+      // GLX 1.3 doesn't exist or failed to allocate Pbuffer
+      // fallback on GLX 1.0 GLXPixmap offscreen support
+      if(!this->Internal->PbufferContextId && !this->Internal->PixmapContextId)
+        {
+        v = this->GetDesiredVisualInfo();
+        this->Internal->PixmapContextId = glXCreateContext(this->DisplayId,
+                                                           v, 0, GL_FALSE);
+        this->Internal->pixmap=
+          XCreatePixmap(this->DisplayId,
+                        XRootWindow(this->DisplayId,v->screen),
+                        static_cast<unsigned int>(width),
+                        static_cast<unsigned int>(height),
+                        static_cast<unsigned int>(v->depth));
+
+        this->Internal->PixmapWindowId = glXCreateGLXPixmap(this->DisplayId, v, this->Internal->pixmap);
+        glXMakeCurrent(this->DisplayId,this->Internal->PixmapWindowId,
+                       this->Internal->PixmapContextId);
+
+        if(v)
           {
-          this->Internal->PbufferContextId =
-            glXCreateNewContext(this->DisplayId, fb[0],
-                                     GLX_RGBA_TYPE, NULL, true);
-            }
-          int atts [] =
-            {
-              GLX_PBUFFER_WIDTH, width,
-              GLX_PBUFFER_HEIGHT, height,
-              0
-            };
-          this->Internal->Pbuffer = glXCreatePbuffer(this->DisplayId,
-                                                          fb[0], atts);
-          glXMakeContextCurrent( this->DisplayId,
-                                      this->Internal->Pbuffer,
-                                      this->Internal->Pbuffer,
-                                      this->Internal->PbufferContextId );
-          XFree(fb);
-          XSetErrorHandler(previousHandler);
-          // failed to allocate Pbuffer, clean up
-          if(PbufferAllocFail)
-            {
-            //vtkglX::DestroyPbuffer(this->DisplayId, this->Internal->Pbuffer);
-            this->Internal->Pbuffer = 0;
-            if(this->Internal->PbufferContextId)
-              glXDestroyContext(this->DisplayId,
-                                this->Internal->PbufferContextId);
-            this->Internal->PbufferContextId = NULL;
-            }
-          PbufferAllocFail = 0;
+          XFree(v);
           }
         }
       } // if not hardware offscreen
@@ -1595,10 +1627,13 @@ const char* vtkXOpenGLRenderWindow::ReportCapabilities()
                                                       GLX_EXTENSIONS);
   const char *clientVendor = glXGetClientString(this->DisplayId, GLX_VENDOR);
   const char *clientVersion = glXGetClientString(this->DisplayId, GLX_VERSION);
+  const char *clientExtensions = glXGetClientString(this->DisplayId,
+                                                    GLX_EXTENSIONS);
   const char *glxExtensions = glXQueryExtensionsString(this->DisplayId,scrnum);
   const char *glVendor = reinterpret_cast<const char *>(glGetString(GL_VENDOR));
   const char *glRenderer = reinterpret_cast<const char *>(glGetString(GL_RENDERER));
   const char *glVersion = reinterpret_cast<const char *>(glGetString(GL_VERSION));
+  const char *glExtensions = reinterpret_cast<const char *>(glGetString(GL_EXTENSIONS));
 
   vtksys_ios::ostringstream strm;
   strm << "server glx vendor string:  " << serverVendor << endl;
@@ -1606,21 +1641,15 @@ const char* vtkXOpenGLRenderWindow::ReportCapabilities()
   strm << "server glx extensions:  " << serverExtensions << endl;
   strm << "client glx vendor string:  " << clientVendor << endl;
   strm << "client glx version string:  " << clientVersion << endl;
+  strm << "client glx extensions:  " << clientExtensions << endl;
   strm << "glx extensions:  " << glxExtensions << endl;
   strm << "OpenGL vendor string:  " << glVendor << endl;
   strm << "OpenGL renderer string:  " << glRenderer << endl;
   strm << "OpenGL version string:  " << glVersion << endl;
-  strm << "OpenGL extensions:  " << endl;
-  int n = 0;
-  glGetIntegerv(GL_NUM_EXTENSIONS, &n);
-  for (int i = 0; i < n; i++)
-    {
-    const char *ext = (const char *)glGetStringi(GL_EXTENSIONS, i);
-    strm << "  " << ext << endl;
-    }
-
+  strm << "OpenGL extensions:  " << glExtensions << endl;
   strm << "X Extensions:  ";
 
+  int n = 0;
   char **extlist = XListExtensions(this->DisplayId, &n);
 
   for (int i = 0; i < n; i++)
diff --git a/Rendering/OpenGL2/vtkXOpenGLRenderWindowInteractor.cxx b/Rendering/OpenGL2/vtkXOpenGLRenderWindowInteractor.cxx
new file mode 100644
index 0000000..ba3bdc6
--- /dev/null
+++ b/Rendering/OpenGL2/vtkXOpenGLRenderWindowInteractor.cxx
@@ -0,0 +1,901 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+  Module:    vtkXOpenGLRenderWindowInteractor.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 <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+// We have to define XTSTRINGDEFINES (used in X11/StringDefs.h and X11/Shell.h)
+// otherwise the string are define as char * instead of const char which can
+// cause warnings.
+#define XTSTRINGDEFINES
+#include <X11/X.h>
+#include <X11/keysym.h>
+#include "vtkXOpenGLRenderWindowInteractor.h"
+#include "vtkInteractorStyle.h"
+#include "vtkXOpenGLRenderWindow.h"
+#include "vtkCallbackCommand.h"
+#include "vtkActor.h"
+#include <X11/Shell.h>
+#include <math.h>
+#include "vtkObjectFactory.h"
+#include "vtkCommand.h"
+
+#include <map>
+
+vtkStandardNewMacro(vtkXOpenGLRenderWindowInteractor);
+
+// Map between the X native id to our own integer count id.  Note this
+// is separate from the TimerMap in the vtkRenderWindowInteractor
+// superclass.  This is used to avoid passing 64-bit values back
+// through the "int" return type of InternalCreateTimer.
+class vtkXOpenGLRenderWindowInteractorInternals
+{
+public:
+  vtkXOpenGLRenderWindowInteractorInternals()
+    {
+    this->TimerIdCount = 1;
+    }
+  ~vtkXOpenGLRenderWindowInteractorInternals()
+    {
+    }
+
+  int CreateLocalId(XtIntervalId xid)
+    {
+    int id = this->TimerIdCount++;
+    this->LocalToX[id] = xid;
+    this->XToLocal[xid] = id;
+    return id;
+    }
+
+  int GetLocalId(XtIntervalId xid)
+    {
+    return this->XToLocal[xid];
+    }
+
+  XtIntervalId DestroyLocalId(int id)
+    {
+    XtIntervalId xid = this->LocalToX[id];
+    this->LocalToX.erase(id);
+    this->XToLocal.erase(xid);
+    return xid;
+    }
+
+private:
+  int TimerIdCount;
+  std::map<int, XtIntervalId> LocalToX;
+  std::map<XtIntervalId, int> XToLocal;
+};
+
+// Initialize static members:
+int vtkXOpenGLRenderWindowInteractor::NumAppInitialized = 0;
+XtAppContext vtkXOpenGLRenderWindowInteractor::App = 0;
+int vtkXOpenGLRenderWindowInteractor::BreakLoopFlag = 1;
+
+
+typedef struct
+{
+  Visual        *visual;
+  int   depth;
+} OptionsRec;
+OptionsRec      Options;
+
+//-------------------------------------------------------------------------
+vtkXOpenGLRenderWindowInteractor::vtkXOpenGLRenderWindowInteractor()
+{
+  this->Internal = new vtkXOpenGLRenderWindowInteractorInternals;
+  this->Top = 0;
+  this->OwnTop = 0;
+  this->OwnApp = 0;
+  this->TopLevelShell = NULL;
+}
+
+//-------------------------------------------------------------------------
+vtkXOpenGLRenderWindowInteractor::~vtkXOpenGLRenderWindowInteractor()
+{
+  this->Disable();
+
+  if(this->OwnTop)
+    {
+    XtDestroyWidget(this->Top);
+    }
+
+  delete this->Internal;
+
+  if (vtkXOpenGLRenderWindowInteractor::App)
+    {
+    if(vtkXOpenGLRenderWindowInteractor::NumAppInitialized == 1)
+      {
+      if(this->OwnApp)
+        {
+        XtDestroyApplicationContext(vtkXOpenGLRenderWindowInteractor::App);
+        }
+      vtkXOpenGLRenderWindowInteractor::App = 0;
+      }
+    vtkXOpenGLRenderWindowInteractor::NumAppInitialized--;
+    }
+}
+
+//-------------------------------------------------------------------------
+// Specify the Xt widget to use for interaction. This method is
+// one of a couple steps that are required for setting up a
+// vtkRenderWindowInteractor as a widget inside of another user
+// interface. You do not need to use this method if the render window
+// will be a stand-alone window. This is only used when you want the
+// render window to be a subwindow within a larger user interface.
+// In that case, you must tell the render window what X display id
+// to use, and then ask the render window what depth, visual and
+// colormap it wants. Then, you must create an Xt TopLevelShell with
+// those settings. Then you can create the rest of your user interface
+// as a child of the TopLevelShell you created. Eventually, you will
+// create a drawing area or some other widget to serve as the rendering
+// window. You must use the SetWidget method to tell this Interactor
+// about that widget. It's X and it's not terribly easy, but it looks cool.
+void  vtkXOpenGLRenderWindowInteractor::SetWidget(Widget foo)
+{
+  this->Top = foo;
+  this->OwnTop = 0;
+}
+
+//-------------------------------------------------------------------------
+// This method will store the top level shell widget for the interactor.
+// This method and the method invocation sequence applies for:
+//     1 vtkRenderWindow-Interactor pair in a nested widget hierarchy
+//     multiple vtkRenderWindow-Interactor pairs in the same top level shell
+// It is not needed for
+//     1 vtkRenderWindow-Interactor pair as the direct child of a top level shell
+//     multiple vtkRenderWindow-Interactor pairs, each in its own top level shell
+//
+// The method, along with EnterNotify event, changes the keyboard focus among
+// the widgets/vtkRenderWindow(s) so the Interactor(s) can receive the proper
+// keyboard events. The following calls need to be made:
+//     vtkRenderWindow's display ID need to be set to the top level shell's
+//           display ID.
+//     vtkXOpenGLRenderWindowInteractor's Widget has to be set to the vtkRenderWindow's
+//           container widget
+//     vtkXOpenGLRenderWindowInteractor's TopLevel has to be set to the top level
+//           shell widget
+// note that the procedure for setting up render window in a widget needs to
+// be followed.  See vtkRenderWindowInteractor's SetWidget method.
+//
+// If multiple vtkRenderWindow-Interactor pairs in SEPARATE windows are desired,
+// do not set the display ID (Interactor will create them as needed.  Alternatively,
+// create and set distinct DisplayID for each vtkRenderWindow. Using the same
+// display ID without setting the parent widgets will cause the display to be
+// reinitialized every time an interactor is initialized), do not set the
+// widgets (so the render windows would be in their own windows), and do
+// not set TopLevelShell (each has its own top level shell already)
+void vtkXOpenGLRenderWindowInteractor::SetTopLevelShell(Widget topLevel)
+{
+  this->TopLevelShell = topLevel;
+}
+
+//-------------------------------------------------------------------------
+// TerminateApp() notifies the event loop to exit.
+// The event loop is started by Start() or by one own's method.
+// This results in Start() returning to its caller.
+void vtkXOpenGLRenderWindowInteractor::TerminateApp()
+{
+  if(this->BreakLoopFlag)
+    {
+    return;
+    }
+
+  this->BreakLoopFlag = 1;
+
+  // Send a VTK_BreakXtLoop ClientMessage event to be sure we pop out of the
+  // event loop.  This "wakes up" the event loop.  Otherwise, it might sit idle
+  // waiting for an event before realizing an exit was requested.
+  XClientMessageEvent client;
+  memset(&client, 0, sizeof(client));
+
+  client.type = ClientMessage;
+  //client.serial; //leave zeroed
+  //client.send_event; //leave zeroed
+  client.display = this->DisplayId;
+  client.window = this->WindowId;
+  client.message_type = XInternAtom(this->DisplayId, "VTK_BreakXtLoop",
+    False);
+  client.format = 32; // indicates size of data chunks: 8, 16 or 32 bits...
+  //client.data; //leave zeroed
+
+  XSendEvent(client.display, client.window, True, NoEventMask,
+    reinterpret_cast<XEvent *>(&client));
+  XFlush(client.display);
+}
+
+void vtkXOpenGLRenderWindowInteractor::SetBreakLoopFlag(int f)
+{
+  if(f)
+    {
+    this->BreakLoopFlagOn();
+    }
+  else
+    {
+    this->BreakLoopFlagOff();
+    }
+}
+
+void vtkXOpenGLRenderWindowInteractor::BreakLoopFlagOff()
+{
+  this->BreakLoopFlag = 0;
+  this->Modified();
+}
+
+void vtkXOpenGLRenderWindowInteractor::BreakLoopFlagOn()
+{
+  this->TerminateApp();
+  this->Modified();
+}
+
+//-------------------------------------------------------------------------
+// This will start up the X event loop. If you
+// call this method it will loop processing X events until the
+// loop is exited.
+void vtkXOpenGLRenderWindowInteractor::StartEventLoop()
+{
+  this->BreakLoopFlag = 0;
+  do
+    {
+    XEvent event;
+    XtAppNextEvent(vtkXOpenGLRenderWindowInteractor::App, &event);
+    XtDispatchEvent(&event);
+    }
+  while (this->BreakLoopFlag == 0);
+}
+
+//-------------------------------------------------------------------------
+// Initializes the event handlers using an XtAppContext that you have
+// provided.  This assumes that you want to own the event loop.
+void vtkXOpenGLRenderWindowInteractor::Initialize(XtAppContext app)
+{
+  vtkXOpenGLRenderWindowInteractor::App = app;
+
+  this->Initialize();
+}
+
+//-------------------------------------------------------------------------
+// Initializes the event handlers without an XtAppContext.  This is
+// good for when you don't have a user interface, but you still
+// want to have mouse interaction.
+void vtkXOpenGLRenderWindowInteractor::Initialize()
+{
+  if (this->Initialized)
+    {
+    return;
+    }
+
+  vtkXOpenGLRenderWindow *ren;
+  int depth;
+  Colormap cmap;
+  Visual  *vis;
+  int *size;
+  int *position;
+  int argc = 0;
+
+
+  // make sure we have a RenderWindow and camera
+  if ( ! this->RenderWindow)
+    {
+    vtkErrorMacro(<<"No renderer defined!");
+    return;
+    }
+
+  this->Initialized = 1;
+  ren = static_cast<vtkXOpenGLRenderWindow *>(this->RenderWindow);
+
+  // do initialization stuff if not initialized yet
+  if (vtkXOpenGLRenderWindowInteractor::App)
+    {
+    vtkXOpenGLRenderWindowInteractor::NumAppInitialized++;
+    }
+  if (!vtkXOpenGLRenderWindowInteractor::NumAppInitialized)
+    {
+    vtkDebugMacro( << "Toolkit init :" << vtkXOpenGLRenderWindowInteractor::App );
+    XtToolkitInitialize();
+    vtkXOpenGLRenderWindowInteractor::App = XtCreateApplicationContext();
+    this->OwnApp = 1;
+    vtkDebugMacro( << "App context :" << vtkXOpenGLRenderWindowInteractor::App);
+    vtkXOpenGLRenderWindowInteractor::NumAppInitialized = 1;
+    }
+
+  this->DisplayId = ren->GetDisplayId();
+  if (!this->DisplayId)
+    {
+    vtkDebugMacro("opening display");
+    this->DisplayId =
+      XtOpenDisplay(vtkXOpenGLRenderWindowInteractor::App,NULL,"VTK","vtk",NULL,0,&argc,NULL);
+    vtkDebugMacro("opened display");
+    }
+  else
+    {
+    // if there is no parent widget
+    if (!this->Top)
+      {
+      XtDisplayInitialize(vtkXOpenGLRenderWindowInteractor::App,this->DisplayId,
+                          "VTK","vtk",NULL,0,&argc,NULL);
+      }
+    }
+
+  // get the info we need from the RenderingWindow
+  ren->SetDisplayId(this->DisplayId);
+
+  size    = ren->GetActualSize();
+  size[0] = ((size[0] > 0) ? size[0] : 300);
+  size[1] = ((size[1] > 0) ? size[1] : 300);
+  if (!this->Top)
+    {
+    depth   = ren->GetDesiredDepth();
+    cmap    = ren->GetDesiredColormap();
+    vis     = ren->GetDesiredVisual();
+    position= ren->GetPosition();
+
+    this->Top = XtVaAppCreateShell(this->RenderWindow->GetWindowName(),"vtk",
+                                   applicationShellWidgetClass,
+                                   this->DisplayId,
+                                   XtNdepth, depth,
+                                   XtNcolormap, cmap,
+                                   XtNvisual, vis,
+                                   XtNx, position[0],
+                                   XtNy, position[1],
+                                   XtNwidth, size[0],
+                                   XtNheight, size[1],
+                                   XtNinput, True,
+                                   XtNmappedWhenManaged, 0,
+                                   static_cast<void *>(NULL));
+    this->OwnTop = 1;
+    XtRealizeWidget(this->Top);
+    XSync(this->DisplayId,False);
+    ren->SetWindowId(XtWindow(this->Top));
+
+    XMapWindow(this->DisplayId, XtWindow(this->Top));
+    XSync(this->DisplayId,False);
+    }
+  else
+    {
+    XWindowAttributes attribs;
+
+    XtRealizeWidget(this->Top);
+    XSync(this->DisplayId,False);
+    ren->SetWindowId(XtWindow(this->Top));
+
+    XMapWindow(this->DisplayId, XtWindow(this->Top));
+    XSync(this->DisplayId,False);
+
+    //  Find the current window size
+    XGetWindowAttributes(this->DisplayId,
+                         XtWindow(this->Top), &attribs);
+    size[0] = attribs.width;
+    size[1] = attribs.height;
+    ren->SetSize(size[0], size[1]);
+    }
+
+  this->WindowId = XtWindow(this->Top);
+
+  ren->Start();
+  this->Enable();
+  this->Size[0] = size[0];
+  this->Size[1] = size[1];
+}
+
+//-------------------------------------------------------------------------
+void vtkXOpenGLRenderWindowInteractor::Enable()
+{
+  // avoid cycles of calling Initialize() and Enable()
+  if (this->Enabled)
+    {
+    return;
+    }
+
+  if (!this->Top)
+    {
+    vtkErrorMacro(<< "Calling Enable too early, before Top is set...");
+    }
+
+  // Add the event handler to the system.
+  // If we change the types of events processed by this handler, then
+  // we need to change the Disable() routine to match.  In order for Disable()
+  // to work properly, both the callback function AND the client data
+  // passed to XtAddEventHandler and XtRemoveEventHandler must MATCH
+  // PERFECTLY
+  XtAddEventHandler(this->Top,
+                    KeyPressMask | KeyReleaseMask |
+                    ButtonPressMask | ButtonReleaseMask |
+                    ExposureMask | StructureNotifyMask |
+                    EnterWindowMask | LeaveWindowMask |
+                    PointerMotionHintMask | PointerMotionMask,
+                    True,  // True means we also observe ClientMessage
+                    vtkXOpenGLRenderWindowInteractorCallback,
+                    static_cast<XtPointer>(this));
+
+  // Setup for capturing the window deletion
+  this->KillAtom = XInternAtom(this->DisplayId,"WM_DELETE_WINDOW",False);
+  XSetWMProtocols(this->DisplayId,this->WindowId,&this->KillAtom,1);
+
+  this->Enabled = 1;
+
+  this->Modified();
+}
+
+//-------------------------------------------------------------------------
+void vtkXOpenGLRenderWindowInteractor::Disable()
+{
+  if (!this->Enabled)
+    {
+    return;
+    }
+
+  this->Enabled = 0;
+
+  // Remove the event handler to the system.
+  // If we change the types of events processed by this handler, then
+  // we need to change the Disable() routine to match.  In order for Disable()
+  // to work properly, both the callback function AND the client data
+  // passed to XtAddEventHandler and XtRemoveEventHandler must MATCH
+  // PERFECTLY.
+  //
+  // NOTE: we do not remove the StructureNotifyMask event since we need to
+  // keep track of the window size (we will not render if we are disabled,
+  // we simply track the window size changes for a possible Enable()).
+  // Expose events are disabled.
+  if (this->Top)
+    {
+    XtRemoveEventHandler(this->Top,
+                        KeyPressMask | KeyReleaseMask | ButtonPressMask |
+                        ExposureMask | ButtonReleaseMask |
+                        EnterWindowMask | LeaveWindowMask |
+                        PointerMotionHintMask | PointerMotionMask,
+                        True,vtkXOpenGLRenderWindowInteractorCallback,
+                        static_cast<XtPointer>(this));
+    }
+
+  this->Modified();
+}
+
+//-------------------------------------------------------------------------
+void vtkXOpenGLRenderWindowInteractor::PrintSelf(ostream& os, vtkIndent indent)
+{
+  this->Superclass::PrintSelf(os,indent);
+
+  if (vtkXOpenGLRenderWindowInteractor::App)
+    {
+    os << indent << "App: " << this->App << "\n";
+    }
+  else
+    {
+    os << indent << "App: (none)\n";
+    }
+
+  os << indent << "BreakLoopFlag: "
+     << (this->BreakLoopFlag ? "On\n" : "Off\n");
+}
+
+//-------------------------------------------------------------------------
+void vtkXOpenGLRenderWindowInteractor::UpdateSize(int x,int y)
+{
+  // if the size changed send this on to the RenderWindow
+  if ((x != this->Size[0])||(y != this->Size[1]))
+    {
+    this->Size[0] = x;
+    this->Size[1] = y;
+    this->RenderWindow->SetSize(x,y);
+    }
+}
+
+//-------------------------------------------------------------------------
+void vtkXOpenGLRenderWindowInteractorTimer(XtPointer client_data,
+                                     XtIntervalId *id)
+{
+  vtkXOpenGLRenderWindowInteractor *me =
+    static_cast<vtkXOpenGLRenderWindowInteractor*>(client_data);
+  XtIntervalId xid = *id;
+
+  int platformTimerId = me->Internal->GetLocalId(xid);
+  int timerId = me->GetVTKTimerId(platformTimerId);
+
+  if (me->GetEnabled())
+    {
+    me->InvokeEvent(vtkCommand::TimerEvent,&timerId);
+    }
+
+  if ( ! me->IsOneShotTimer(timerId) )
+    {
+    me->ResetTimer(timerId);
+    }
+}
+
+//-------------------------------------------------------------------------
+// X always creates one shot timers
+int vtkXOpenGLRenderWindowInteractor::InternalCreateTimer(int vtkNotUsed(timerId),
+                                                    int vtkNotUsed(timerType),
+                                                    unsigned long duration)
+{
+  duration = (duration > 0 ? duration : this->TimerDuration);
+  XtIntervalId xid =
+    this->AddTimeOut(vtkXOpenGLRenderWindowInteractor::App,
+                     duration,
+                     vtkXOpenGLRenderWindowInteractorTimer,
+                     static_cast<XtPointer>(this));
+  int platformTimerId = this->Internal->CreateLocalId(xid);
+  return platformTimerId;
+}
+
+//-------------------------------------------------------------------------
+int vtkXOpenGLRenderWindowInteractor::InternalDestroyTimer(int platformTimerId)
+{
+  XtRemoveTimeOut(this->Internal->DestroyLocalId(platformTimerId));
+  return 1;
+}
+
+//-------------------------------------------------------------------------
+void vtkXOpenGLRenderWindowInteractorCallback(Widget vtkNotUsed(w),
+                                        XtPointer client_data,
+                                        XEvent *event,
+                                        Boolean *vtkNotUsed(ctd))
+{
+  vtkXOpenGLRenderWindowInteractor *me;
+  int xp, yp;
+
+  me = static_cast<vtkXOpenGLRenderWindowInteractor *>(client_data);
+
+  switch (event->type)
+    {
+    case Expose:
+      {
+      if (!me->Enabled)
+        {
+        return;
+        }
+      XEvent result;
+      while (XCheckTypedWindowEvent(me->DisplayId,
+                                    me->WindowId,
+                                    Expose,
+                                    &result))
+        {
+        // just getting the expose configure event
+        event = &result;
+        }
+      XExposeEvent* exposeEvent = reinterpret_cast<XExposeEvent *>(event);
+      me->SetEventSize(exposeEvent->width, exposeEvent->height);
+      xp = exposeEvent->x;
+      yp = exposeEvent->y;
+      yp = me->Size[1] - yp - 1;
+      me->SetEventPosition(xp, yp);
+
+      // only render if we are currently accepting events
+      if (me->Enabled)
+        {
+        me->InvokeEvent(vtkCommand::ExposeEvent,NULL);
+        me->Render();
+        }
+      }
+      break;
+
+    case MapNotify:
+      {
+      // only render if we are currently accepting events
+      if (me->Enabled && me->GetRenderWindow()->GetNeverRendered())
+        {
+        me->Render();
+        }
+      }
+      break;
+
+    case ConfigureNotify:
+      {
+      XEvent result;
+      while (XCheckTypedWindowEvent(me->DisplayId,
+                                    me->WindowId,
+                                    ConfigureNotify,
+                                    &result))
+        {
+        // just getting the last configure event
+        event = &result;
+        }
+      int width = (reinterpret_cast<XConfigureEvent *>(event))->width;
+      int height = (reinterpret_cast<XConfigureEvent *>(event))->height;
+      if (width != me->Size[0] || height != me->Size[1])
+        {
+        bool resizeSmaller=width<=me->Size[0] && height<=me->Size[1];
+        me->UpdateSize(width, height);
+        xp = (reinterpret_cast<XButtonEvent*>(event))->x;
+        yp = (reinterpret_cast<XButtonEvent*>(event))->y;
+        me->SetEventPosition(xp, me->Size[1] - yp - 1);
+        // only render if we are currently accepting events
+        if (me->Enabled)
+          {
+          me->InvokeEvent(vtkCommand::ConfigureEvent,NULL);
+          if(resizeSmaller)
+            {
+            // Don't call Render when the window is resized to be larger:
+            //
+            // - if the window is resized to be larger, an Expose event will
+            // be trigged by the X server which will trigger a call to
+            // Render().
+            // - if the window is resized to be smaller, no Expose event will
+            // be trigged by the X server, as no new area become visible.
+            // only in this case, we need to explicitly call Render()
+            // in ConfigureNotify.
+            me->Render();
+            }
+          }
+        }
+      }
+      break;
+
+    case ButtonPress:
+      {
+      if (!me->Enabled)
+        {
+        return;
+        }
+      int ctrl =
+        (reinterpret_cast<XButtonEvent *>(event))->state & ControlMask ? 1 : 0;
+      int shift =
+        (reinterpret_cast<XButtonEvent *>(event))->state & ShiftMask ? 1 : 0;
+      int alt =
+        (reinterpret_cast<XButtonEvent *>(event))->state & Mod1Mask ? 1 : 0;
+      xp = (reinterpret_cast<XButtonEvent*>(event))->x;
+      yp = (reinterpret_cast<XButtonEvent*>(event))->y;
+
+      // check for double click
+      static int MousePressTime = 0;
+      int repeat = 0;
+      // 400 ms threshold by default is probably good to start
+      int eventTime=static_cast<int>(reinterpret_cast<XButtonEvent*>(event)->time);
+      if((eventTime - MousePressTime) < 400)
+        {
+        MousePressTime -= 2000;  // no double click next time
+        repeat = 1;
+        }
+      else
+        {
+        MousePressTime = eventTime;
+        }
+
+      me->SetEventInformationFlipY(xp,
+                                   yp,
+                                   ctrl,
+                                   shift,
+                                   0,
+                                   repeat);
+      me->SetAltKey(alt);
+      switch ((reinterpret_cast<XButtonEvent *>(event))->button)
+        {
+        case Button1:
+          me->InvokeEvent(vtkCommand::LeftButtonPressEvent,NULL);
+          break;
+        case Button2:
+          me->InvokeEvent(vtkCommand::MiddleButtonPressEvent,NULL);
+          break;
+        case Button3:
+          me->InvokeEvent(vtkCommand::RightButtonPressEvent,NULL);
+          break;
+        case Button4:
+          me->InvokeEvent(vtkCommand::MouseWheelForwardEvent,NULL);
+          break;
+        case Button5:
+          me->InvokeEvent(vtkCommand::MouseWheelBackwardEvent,NULL);
+          break;
+        }
+      }
+      break;
+
+    case ButtonRelease:
+      {
+      if (!me->Enabled)
+        {
+        return;
+        }
+      int ctrl =
+        (reinterpret_cast<XButtonEvent *>(event))->state & ControlMask ? 1 : 0;
+      int shift =
+        (reinterpret_cast<XButtonEvent *>(event))->state & ShiftMask ? 1 : 0;
+      int alt =
+        (reinterpret_cast<XButtonEvent *>(event))->state & Mod1Mask ? 1 : 0;
+      xp = (reinterpret_cast<XButtonEvent*>(event))->x;
+      yp = (reinterpret_cast<XButtonEvent*>(event))->y;
+      me->SetEventInformationFlipY(xp,
+                                   yp,
+                                   ctrl,
+                                   shift);
+      me->SetAltKey(alt);
+      switch ((reinterpret_cast<XButtonEvent *>(event))->button)
+        {
+        case Button1:
+          me->InvokeEvent(vtkCommand::LeftButtonReleaseEvent,NULL);
+          break;
+        case Button2:
+          me->InvokeEvent(vtkCommand::MiddleButtonReleaseEvent,NULL);
+          break;
+        case Button3:
+          me->InvokeEvent(vtkCommand::RightButtonReleaseEvent,NULL);
+          break;
+        }
+      }
+      break;
+
+    case EnterNotify:
+      {
+      // Force the keyboard focus to be this render window
+      if (me->TopLevelShell != NULL)
+        {
+        XtSetKeyboardFocus(me->TopLevelShell, me->Top);
+        }
+      if (me->Enabled)
+        {
+        XEnterWindowEvent *e = reinterpret_cast<XEnterWindowEvent *>(event);
+        me->SetEventInformationFlipY(e->x,
+                                     e->y,
+                                     (e->state & ControlMask) != 0,
+                                     (e->state & ShiftMask) != 0);
+        me->SetAltKey(
+          (reinterpret_cast<XButtonEvent *>(event))->state & Mod1Mask ? 1 : 0);
+        me->InvokeEvent(vtkCommand::EnterEvent, NULL);
+        }
+      }
+      break;
+
+    case LeaveNotify:
+      {
+      if (me->Enabled)
+        {
+        XLeaveWindowEvent *e = reinterpret_cast<XLeaveWindowEvent *>(event);
+        me->SetEventInformationFlipY(e->x,
+                                     e->y,
+                                     (e->state & ControlMask) != 0,
+                                     (e->state & ShiftMask) != 0);
+        me->SetAltKey(
+          (reinterpret_cast<XButtonEvent *>(event))->state & Mod1Mask ? 1 : 0);
+        me->InvokeEvent(vtkCommand::LeaveEvent, NULL);
+        }
+      }
+      break;
+
+    case KeyPress:
+      {
+      if (!me->Enabled)
+        {
+        return;
+        }
+      int ctrl =
+        (reinterpret_cast<XButtonEvent *>(event))->state & ControlMask ? 1 : 0;
+      int shift =
+        (reinterpret_cast<XButtonEvent *>(event))->state & ShiftMask ? 1 : 0;
+      int alt =
+        (reinterpret_cast<XButtonEvent *>(event))->state & Mod1Mask ? 1 : 0;
+      KeySym ks;
+      static char buffer[20];
+      buffer[0] = '\0';
+      XLookupString(reinterpret_cast<XKeyEvent *>(event),buffer, 20, &ks,NULL);
+      xp = (reinterpret_cast<XKeyEvent*>(event))->x;
+      yp = (reinterpret_cast<XKeyEvent*>(event))->y;
+      me->SetEventInformationFlipY(xp,
+                                   yp,
+                                   ctrl,
+                                   shift,
+                                   buffer[0],
+                                   1,
+                                   XKeysymToString(ks));
+      me->SetAltKey(alt);
+      me->InvokeEvent(vtkCommand::KeyPressEvent, NULL);
+      me->InvokeEvent(vtkCommand::CharEvent, NULL);
+      }
+      break;
+
+    case KeyRelease:
+      {
+      if (!me->Enabled)
+        {
+        return;
+        }
+      int ctrl =
+        (reinterpret_cast<XButtonEvent *>(event))->state & ControlMask ? 1 : 0;
+      int shift =
+        (reinterpret_cast<XButtonEvent *>(event))->state & ShiftMask ? 1 : 0;
+      int alt =
+        (reinterpret_cast<XButtonEvent *>(event))->state & Mod1Mask ? 1 : 0;
+      KeySym ks;
+      static char buffer[20];
+      buffer[0] = '\0';
+      XLookupString(reinterpret_cast<XKeyEvent *>(event),buffer, 20, &ks,NULL);
+      xp = (reinterpret_cast<XKeyEvent *>(event))->x;
+      yp = (reinterpret_cast<XKeyEvent *>(event))->y;
+      me->SetEventInformationFlipY(xp,
+                                   yp,
+                                   ctrl,
+                                   shift,
+                                   buffer[0],
+                                   1,
+                                   XKeysymToString(ks));
+      me->SetAltKey(alt);
+      me->InvokeEvent(vtkCommand::KeyReleaseEvent, NULL);
+      }
+      break;
+
+    case MotionNotify:
+      {
+      if (!me->Enabled)
+        {
+        return;
+        }
+      int ctrl =
+        (reinterpret_cast<XButtonEvent *>(event))->state & ControlMask ? 1 : 0;
+      int shift =
+        (reinterpret_cast<XButtonEvent *>(event))->state & ShiftMask ? 1 : 0;
+      int alt =
+        (reinterpret_cast<XButtonEvent *>(event))->state & Mod1Mask ? 1 : 0;
+
+      // Note that even though the (x,y) location of the pointer is event structure,
+      // we must call XQueryPointer for the hints (motion event compression) to
+      // work properly.
+      me->GetMousePosition(&xp, &yp);
+      me->SetEventInformation(xp, yp, ctrl, shift);
+      me->SetAltKey(alt);
+      me->InvokeEvent(vtkCommand::MouseMoveEvent, NULL);
+      }
+      break;
+
+    case ClientMessage:
+      {
+      //cout << "XGetAtomName(message_type): "
+      //  << XGetAtomName(me->DisplayId,
+      //       (reinterpret_cast<XClientMessageEvent *>(event))->message_type)
+      //  << endl;
+      if( static_cast<Atom>(event->xclient.data.l[0]) == me->KillAtom )
+        {
+        me->ExitCallback();
+        }
+      }
+      break;
+    }
+}
+
+//-------------------------------------------------------------------------
+XtIntervalId vtkXOpenGLRenderWindowInteractor::AddTimeOut(XtAppContext app_context,
+                                                    unsigned long interval,
+                                                    XtTimerCallbackProc proc,
+                                                    XtPointer client_data)
+{
+  return XtAppAddTimeOut(app_context, interval, proc, client_data);
+}
+
+//-------------------------------------------------------------------------
+void vtkXOpenGLRenderWindowInteractor::GetMousePosition(int *x, int *y)
+{
+  Window root,child;
+  int root_x,root_y;
+  unsigned int keys;
+
+  XQueryPointer(this->DisplayId,this->WindowId,
+                &root,&child,&root_x,&root_y,x,y,&keys);
+
+  *y = this->Size[1] - *y - 1;
+}
+
+//-------------------------------------------------------------------------
+void vtkXOpenGLRenderWindowInteractor::Timer(XtPointer client_data,
+                                       XtIntervalId *id)
+{
+  vtkXOpenGLRenderWindowInteractorTimer(client_data, id);
+}
+
+//-------------------------------------------------------------------------
+void vtkXOpenGLRenderWindowInteractor::Callback(Widget w,
+                                          XtPointer client_data,
+                                          XEvent *event,
+                                          Boolean *ctd)
+{
+  vtkXOpenGLRenderWindowInteractorCallback(w, client_data, event, ctd);
+}
diff --git a/Rendering/OpenGL2/vtkXOpenGLRenderWindowInteractor.h b/Rendering/OpenGL2/vtkXOpenGLRenderWindowInteractor.h
new file mode 100644
index 0000000..613f27b
--- /dev/null
+++ b/Rendering/OpenGL2/vtkXOpenGLRenderWindowInteractor.h
@@ -0,0 +1,199 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+  Module:    vtkXOpenGLRenderWindowInteractor.h
+
+  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.
+
+=========================================================================*/
+// .NAME vtkXOpenGLRenderWindowInteractor - an X event driven interface for a RenderWindow
+// .SECTION Description
+// vtkXOpenGLRenderWindowInteractor is a convenience object that provides event
+// bindings to common graphics functions. For example, camera and actor
+// functions such as zoom-in/zoom-out, azimuth, roll, and pan. IT is one of
+// the window system specific subclasses of vtkRenderWindowInteractor. Please
+// see vtkRenderWindowInteractor documentation for event bindings.
+//
+// .SECTION see also
+// vtkRenderWindowInteractor vtkXOpenGL2RenderWindow
+
+// I've been though this and deleted all I think should go, tried to create
+// the basic structure and if you're lucky it might even work!
+// but frankly I doubt it
+
+#ifndef vtkXOpenGLRenderWindowInteractor_h
+#define vtkXOpenGLRenderWindowInteractor_h
+
+//===========================================================
+// now we define the C++ class
+
+#include "vtkRenderingOpenGL2Module.h" // For export macro
+#include "vtkRenderWindowInteractor.h"
+#include <X11/StringDefs.h> // Needed for X types in the public interface
+#include <X11/Intrinsic.h> // Needed for X types in the public interface
+
+class vtkCallbackCommand;
+class vtkXOpenGLRenderWindowInteractorInternals;
+
+// Forward declare internal friend functions.
+void VTKRENDERINGOPENGL2_EXPORT vtkXOpenGLRenderWindowInteractorCallback(Widget,XtPointer, XEvent *,Boolean *);
+void VTKRENDERINGOPENGL2_EXPORT vtkXOpenGLRenderWindowInteractorTimer(XtPointer,XtIntervalId *);
+
+class VTKRENDERINGOPENGL2_EXPORT vtkXOpenGLRenderWindowInteractor : public vtkRenderWindowInteractor
+{
+public:
+  static vtkXOpenGLRenderWindowInteractor *New();
+  vtkTypeMacro(vtkXOpenGLRenderWindowInteractor,vtkRenderWindowInteractor);
+  void PrintSelf(ostream& os, vtkIndent indent);
+
+  // Description:
+  // Initializes the event handlers without an XtAppContext.  This is
+  // good for when you don't have a user interface, but you still
+  // want to have mouse interaction.
+  virtual void Initialize();
+
+  // Description:
+  // Break the event loop on 'q','e' keypress. Want more ???
+  void TerminateApp();
+
+  // Description:
+  // The BreakLoopFlag is checked in the Start() method.
+  // Setting it to anything other than zero will cause
+  // the interactor loop to terminate and return to the
+  // calling function.
+  vtkGetMacro(BreakLoopFlag, int);
+  void SetBreakLoopFlag(int);
+  void BreakLoopFlagOff();
+  void BreakLoopFlagOn();
+
+  // Description:
+  // Initializes the event handlers using an XtAppContext that you have
+  // provided.  This assumes that you want to own the event loop.
+  virtual void Initialize(XtAppContext app);
+  vtkGetMacro( App, XtAppContext );
+
+  // Description:
+  // Enable/Disable interactions.  By default interactors are enabled when
+  // initialized.  Initialize() must be called prior to enabling/disabling
+  // interaction. These methods are used when a window/widget is being
+  // shared by multiple renderers and interactors.  This allows a "modal"
+  // display where one interactor is active when its data is to be displayed
+  // and all other interactors associated with the widget are disabled
+  // when their data is not displayed.
+  virtual void Enable();
+  virtual void Disable();
+
+  // Description:
+  // Update the Size data member and set the associated RenderWindow's
+  // size.
+  virtual void UpdateSize(int,int);
+
+  // Description:
+  // Specify the Xt widget to use for interaction. This method is
+  // one of a couple steps that are required for setting up a
+  // vtkRenderWindowInteractor as a widget inside of another user
+  // interface. You do not need to use this method if the render window
+  // will be a stand-alone window. This is only used when you want the
+  // render window to be a subwindow within a larger user interface.
+  // In that case, you must tell the render window what X display id
+  // to use, and then ask the render window what depth, visual and
+  // colormap it wants. Then, you must create an Xt TopLevelShell with
+  // those settings. Then you can create the rest of your user interface
+  // as a child of the TopLevelShell you created. Eventually, you will
+  // create a drawing area or some other widget to serve as the rendering
+  // window. You must use the SetWidget method to tell this Interactor
+  // about that widget. It's X and it's not terribly easy, but it looks cool.
+  virtual void SetWidget(Widget);
+  Widget GetWidget() {return this->Top;};
+
+  // Description
+  // This method will store the top level shell widget for the interactor.
+  // This method and the method invocation sequence applies for:
+  //     1 vtkRenderWindow-Interactor pair in a nested widget hierarchy
+  //     multiple vtkRenderWindow-Interactor pairs in the same top level shell
+  // It is not needed for
+  //     1 vtkRenderWindow-Interactor pair as the direct child of a top level shell
+  //     multiple vtkRenderWindow-Interactor pairs, each in its own top level shell
+  //
+  // The method, along with EnterNotify event, changes the keyboard focus among
+  // the widgets/vtkRenderWindow(s) so the Interactor(s) can receive the proper
+  // keyboard events. The following calls need to be made:
+  //     vtkRenderWindow's display ID need to be set to the top level shell's
+  //           display ID.
+  //     vtkXOpenGLRenderWindowInteractor's Widget has to be set to the vtkRenderWindow's
+  //           container widget
+  //     vtkXOpenGLRenderWindowInteractor's TopLevel has to be set to the top level
+  //           shell widget
+  // note that the procedure for setting up render window in a widget needs to
+  // be followed.  See vtkRenderWindowInteractor's SetWidget method.
+  //
+  // If multiple vtkRenderWindow-Interactor pairs in SEPARATE windows are desired,
+  // do not set the display ID (Interactor will create them as needed.  Alternatively,
+  // create and set distinct DisplayID for each vtkRenderWindow. Using the same
+  // display ID without setting the parent widgets will cause the display to be
+  // reinitialized every time an interactor is initialized), do not set the
+  // widgets (so the render windows would be in their own windows), and do
+  // not set TopLevelShell (each has its own top level shell already)
+  virtual void SetTopLevelShell(Widget);
+  Widget GetTopLevelShell() {return this->TopLevelShell;};
+
+  // Description:
+  // Re-defines virtual function to get mouse position by querying X-server.
+  virtual void GetMousePosition(int *x, int *y);
+
+  // Description:
+  // Functions that are used internally.
+  friend void vtkXOpenGLRenderWindowInteractorCallback(Widget,XtPointer,
+                                                 XEvent *,Boolean *);
+  friend void vtkXOpenGLRenderWindowInteractorTimer(XtPointer,XtIntervalId *);
+
+protected:
+  vtkXOpenGLRenderWindowInteractor();
+  ~vtkXOpenGLRenderWindowInteractor();
+
+  //Using static here to avoid detroying context when many apps are open:
+  static XtAppContext App;
+  static int NumAppInitialized;
+
+  Display *DisplayId;
+  Window WindowId;
+  Atom KillAtom;
+  Widget Top;
+  int OwnTop;
+  int OwnApp;
+  int PositionBeforeStereo[2];
+  Widget TopLevelShell;
+  int TimerId;
+  vtkXOpenGLRenderWindowInteractorInternals* Internal;
+
+  // Description:
+  // X-specific internal timer methods. See the superclass for detailed
+  // documentation.
+  virtual int InternalCreateTimer(int timerId, int timerType, unsigned long duration);
+  virtual int InternalDestroyTimer(int platformTimerId);
+
+  XtIntervalId AddTimeOut(XtAppContext app_context, unsigned long interval,
+                          XtTimerCallbackProc proc, XtPointer client_data) ;
+  void Timer(XtPointer client_data, XtIntervalId *id);
+  void Callback(Widget w, XtPointer client_data, XEvent *event, Boolean *ctd);
+
+  static int BreakLoopFlag;
+
+  // Description:
+  // This will start up the X event loop and never return. If you
+  // call this method it will loop processing X events until the
+  // application is exited.
+  virtual void StartEventLoop();
+
+private:
+  vtkXOpenGLRenderWindowInteractor(const vtkXOpenGLRenderWindowInteractor&);  // Not implemented.
+  void operator=(const vtkXOpenGLRenderWindowInteractor&);  // Not implemented.
+};
+
+#endif
diff --git a/Rendering/OpenGL2/vtkXRenderWindowInteractor.cxx b/Rendering/OpenGL2/vtkXRenderWindowInteractor.cxx
deleted file mode 100644
index 2d66991..0000000
--- a/Rendering/OpenGL2/vtkXRenderWindowInteractor.cxx
+++ /dev/null
@@ -1,901 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkXRenderWindowInteractor.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 <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-// We have to define XTSTRINGDEFINES (used in X11/StringDefs.h and X11/Shell.h)
-// otherwise the string are define as char * instead of const char which can
-// cause warnings.
-#define XTSTRINGDEFINES
-#include <X11/X.h>
-#include <X11/keysym.h>
-#include "vtkXRenderWindowInteractor.h"
-#include "vtkInteractorStyle.h"
-#include "vtkXOpenGLRenderWindow.h"
-#include "vtkCallbackCommand.h"
-#include "vtkActor.h"
-#include <X11/Shell.h>
-#include <math.h>
-#include "vtkObjectFactory.h"
-#include "vtkCommand.h"
-
-#include <map>
-
-vtkStandardNewMacro(vtkXRenderWindowInteractor);
-
-// Map between the X native id to our own integer count id.  Note this
-// is separate from the TimerMap in the vtkRenderWindowInteractor
-// superclass.  This is used to avoid passing 64-bit values back
-// through the "int" return type of InternalCreateTimer.
-class vtkXRenderWindowInteractorInternals
-{
-public:
-  vtkXRenderWindowInteractorInternals()
-    {
-    this->TimerIdCount = 1;
-    }
-  ~vtkXRenderWindowInteractorInternals()
-    {
-    }
-
-  int CreateLocalId(XtIntervalId xid)
-    {
-    int id = this->TimerIdCount++;
-    this->LocalToX[id] = xid;
-    this->XToLocal[xid] = id;
-    return id;
-    }
-
-  int GetLocalId(XtIntervalId xid)
-    {
-    return this->XToLocal[xid];
-    }
-
-  XtIntervalId DestroyLocalId(int id)
-    {
-    XtIntervalId xid = this->LocalToX[id];
-    this->LocalToX.erase(id);
-    this->XToLocal.erase(xid);
-    return xid;
-    }
-
-private:
-  int TimerIdCount;
-  std::map<int, XtIntervalId> LocalToX;
-  std::map<XtIntervalId, int> XToLocal;
-};
-
-// Initialize static members:
-int vtkXRenderWindowInteractor::NumAppInitialized = 0;
-XtAppContext vtkXRenderWindowInteractor::App = 0;
-int vtkXRenderWindowInteractor::BreakLoopFlag = 1;
-
-
-typedef struct
-{
-  Visual        *visual;
-  int   depth;
-} OptionsRec;
-OptionsRec      Options;
-
-//-------------------------------------------------------------------------
-vtkXRenderWindowInteractor::vtkXRenderWindowInteractor()
-{
-  this->Internal = new vtkXRenderWindowInteractorInternals;
-  this->Top = 0;
-  this->OwnTop = 0;
-  this->OwnApp = 0;
-  this->TopLevelShell = NULL;
-}
-
-//-------------------------------------------------------------------------
-vtkXRenderWindowInteractor::~vtkXRenderWindowInteractor()
-{
-  this->Disable();
-
-  if(this->OwnTop)
-    {
-    XtDestroyWidget(this->Top);
-    }
-
-  delete this->Internal;
-
-  if (vtkXRenderWindowInteractor::App)
-    {
-    if(vtkXRenderWindowInteractor::NumAppInitialized == 1)
-      {
-      if(this->OwnApp)
-        {
-        XtDestroyApplicationContext(vtkXRenderWindowInteractor::App);
-        }
-      vtkXRenderWindowInteractor::App = 0;
-      }
-    vtkXRenderWindowInteractor::NumAppInitialized--;
-    }
-}
-
-//-------------------------------------------------------------------------
-// Specify the Xt widget to use for interaction. This method is
-// one of a couple steps that are required for setting up a
-// vtkRenderWindowInteractor as a widget inside of another user
-// interface. You do not need to use this method if the render window
-// will be a stand-alone window. This is only used when you want the
-// render window to be a subwindow within a larger user interface.
-// In that case, you must tell the render window what X display id
-// to use, and then ask the render window what depth, visual and
-// colormap it wants. Then, you must create an Xt TopLevelShell with
-// those settings. Then you can create the rest of your user interface
-// as a child of the TopLevelShell you created. Eventually, you will
-// create a drawing area or some other widget to serve as the rendering
-// window. You must use the SetWidget method to tell this Interactor
-// about that widget. It's X and it's not terribly easy, but it looks cool.
-void  vtkXRenderWindowInteractor::SetWidget(Widget foo)
-{
-  this->Top = foo;
-  this->OwnTop = 0;
-}
-
-//-------------------------------------------------------------------------
-// This method will store the top level shell widget for the interactor.
-// This method and the method invocation sequence applies for:
-//     1 vtkRenderWindow-Interactor pair in a nested widget hierarchy
-//     multiple vtkRenderWindow-Interactor pairs in the same top level shell
-// It is not needed for
-//     1 vtkRenderWindow-Interactor pair as the direct child of a top level shell
-//     multiple vtkRenderWindow-Interactor pairs, each in its own top level shell
-//
-// The method, along with EnterNotify event, changes the keyboard focus among
-// the widgets/vtkRenderWindow(s) so the Interactor(s) can receive the proper
-// keyboard events. The following calls need to be made:
-//     vtkRenderWindow's display ID need to be set to the top level shell's
-//           display ID.
-//     vtkXRenderWindowInteractor's Widget has to be set to the vtkRenderWindow's
-//           container widget
-//     vtkXRenderWindowInteractor's TopLevel has to be set to the top level
-//           shell widget
-// note that the procedure for setting up render window in a widget needs to
-// be followed.  See vtkRenderWindowInteractor's SetWidget method.
-//
-// If multiple vtkRenderWindow-Interactor pairs in SEPARATE windows are desired,
-// do not set the display ID (Interactor will create them as needed.  Alternatively,
-// create and set distinct DisplayID for each vtkRenderWindow. Using the same
-// display ID without setting the parent widgets will cause the display to be
-// reinitialized every time an interactor is initialized), do not set the
-// widgets (so the render windows would be in their own windows), and do
-// not set TopLevelShell (each has its own top level shell already)
-void vtkXRenderWindowInteractor::SetTopLevelShell(Widget topLevel)
-{
-  this->TopLevelShell = topLevel;
-}
-
-//-------------------------------------------------------------------------
-// TerminateApp() notifies the event loop to exit.
-// The event loop is started by Start() or by one own's method.
-// This results in Start() returning to its caller.
-void vtkXRenderWindowInteractor::TerminateApp()
-{
-  if(this->BreakLoopFlag)
-    {
-    return;
-    }
-
-  this->BreakLoopFlag = 1;
-
-  // Send a VTK_BreakXtLoop ClientMessage event to be sure we pop out of the
-  // event loop.  This "wakes up" the event loop.  Otherwise, it might sit idle
-  // waiting for an event before realizing an exit was requested.
-  XClientMessageEvent client;
-  memset(&client, 0, sizeof(client));
-
-  client.type = ClientMessage;
-  //client.serial; //leave zeroed
-  //client.send_event; //leave zeroed
-  client.display = this->DisplayId;
-  client.window = this->WindowId;
-  client.message_type = XInternAtom(this->DisplayId, "VTK_BreakXtLoop",
-    False);
-  client.format = 32; // indicates size of data chunks: 8, 16 or 32 bits...
-  //client.data; //leave zeroed
-
-  XSendEvent(client.display, client.window, True, NoEventMask,
-    reinterpret_cast<XEvent *>(&client));
-  XFlush(client.display);
-}
-
-void vtkXRenderWindowInteractor::SetBreakLoopFlag(int f)
-{
-  if(f)
-    {
-    this->BreakLoopFlagOn();
-    }
-  else
-    {
-    this->BreakLoopFlagOff();
-    }
-}
-
-void vtkXRenderWindowInteractor::BreakLoopFlagOff()
-{
-  this->BreakLoopFlag = 0;
-  this->Modified();
-}
-
-void vtkXRenderWindowInteractor::BreakLoopFlagOn()
-{
-  this->TerminateApp();
-  this->Modified();
-}
-
-//-------------------------------------------------------------------------
-// This will start up the X event loop. If you
-// call this method it will loop processing X events until the
-// loop is exited.
-void vtkXRenderWindowInteractor::StartEventLoop()
-{
-  this->BreakLoopFlag = 0;
-  do
-    {
-    XEvent event;
-    XtAppNextEvent(vtkXRenderWindowInteractor::App, &event);
-    XtDispatchEvent(&event);
-    }
-  while (this->BreakLoopFlag == 0);
-}
-
-//-------------------------------------------------------------------------
-// Initializes the event handlers using an XtAppContext that you have
-// provided.  This assumes that you want to own the event loop.
-void vtkXRenderWindowInteractor::Initialize(XtAppContext app)
-{
-  vtkXRenderWindowInteractor::App = app;
-
-  this->Initialize();
-}
-
-//-------------------------------------------------------------------------
-// Initializes the event handlers without an XtAppContext.  This is
-// good for when you don't have a user interface, but you still
-// want to have mouse interaction.
-void vtkXRenderWindowInteractor::Initialize()
-{
-  if (this->Initialized)
-    {
-    return;
-    }
-
-  vtkXOpenGLRenderWindow *ren;
-  int depth;
-  Colormap cmap;
-  Visual  *vis;
-  int *size;
-  int *position;
-  int argc = 0;
-
-
-  // make sure we have a RenderWindow and camera
-  if ( ! this->RenderWindow)
-    {
-    vtkErrorMacro(<<"No renderer defined!");
-    return;
-    }
-
-  this->Initialized = 1;
-  ren = static_cast<vtkXOpenGLRenderWindow *>(this->RenderWindow);
-
-  // do initialization stuff if not initialized yet
-  if (vtkXRenderWindowInteractor::App)
-    {
-    vtkXRenderWindowInteractor::NumAppInitialized++;
-    }
-  if (!vtkXRenderWindowInteractor::NumAppInitialized)
-    {
-    vtkDebugMacro( << "Toolkit init :" << vtkXRenderWindowInteractor::App );
-    XtToolkitInitialize();
-    vtkXRenderWindowInteractor::App = XtCreateApplicationContext();
-    this->OwnApp = 1;
-    vtkDebugMacro( << "App context :" << vtkXRenderWindowInteractor::App);
-    vtkXRenderWindowInteractor::NumAppInitialized = 1;
-    }
-
-  this->DisplayId = ren->GetDisplayId();
-  if (!this->DisplayId)
-    {
-    vtkDebugMacro("opening display");
-    this->DisplayId =
-      XtOpenDisplay(vtkXRenderWindowInteractor::App,NULL,"VTK","vtk",NULL,0,&argc,NULL);
-    vtkDebugMacro("opened display");
-    }
-  else
-    {
-    // if there is no parent widget
-    if (!this->Top)
-      {
-      XtDisplayInitialize(vtkXRenderWindowInteractor::App,this->DisplayId,
-                          "VTK","vtk",NULL,0,&argc,NULL);
-      }
-    }
-
-  // get the info we need from the RenderingWindow
-  ren->SetDisplayId(this->DisplayId);
-
-  size    = ren->GetActualSize();
-  size[0] = ((size[0] > 0) ? size[0] : 300);
-  size[1] = ((size[1] > 0) ? size[1] : 300);
-  if (!this->Top)
-    {
-    depth   = ren->GetDesiredDepth();
-    cmap    = ren->GetDesiredColormap();
-    vis     = ren->GetDesiredVisual();
-    position= ren->GetPosition();
-
-    this->Top = XtVaAppCreateShell(this->RenderWindow->GetWindowName(),"vtk",
-                                   applicationShellWidgetClass,
-                                   this->DisplayId,
-                                   XtNdepth, depth,
-                                   XtNcolormap, cmap,
-                                   XtNvisual, vis,
-                                   XtNx, position[0],
-                                   XtNy, position[1],
-                                   XtNwidth, size[0],
-                                   XtNheight, size[1],
-                                   XtNinput, True,
-                                   XtNmappedWhenManaged, 0,
-                                   static_cast<void *>(NULL));
-    this->OwnTop = 1;
-    XtRealizeWidget(this->Top);
-    XSync(this->DisplayId,False);
-    ren->SetWindowId(XtWindow(this->Top));
-
-    XMapWindow(this->DisplayId, XtWindow(this->Top));
-    XSync(this->DisplayId,False);
-    }
-  else
-    {
-    XWindowAttributes attribs;
-
-    XtRealizeWidget(this->Top);
-    XSync(this->DisplayId,False);
-    ren->SetWindowId(XtWindow(this->Top));
-
-    XMapWindow(this->DisplayId, XtWindow(this->Top));
-    XSync(this->DisplayId,False);
-
-    //  Find the current window size
-    XGetWindowAttributes(this->DisplayId,
-                         XtWindow(this->Top), &attribs);
-    size[0] = attribs.width;
-    size[1] = attribs.height;
-    ren->SetSize(size[0], size[1]);
-    }
-
-  this->WindowId = XtWindow(this->Top);
-
-  ren->Start();
-  this->Enable();
-  this->Size[0] = size[0];
-  this->Size[1] = size[1];
-}
-
-//-------------------------------------------------------------------------
-void vtkXRenderWindowInteractor::Enable()
-{
-  // avoid cycles of calling Initialize() and Enable()
-  if (this->Enabled)
-    {
-    return;
-    }
-
-  if (!this->Top)
-    {
-    vtkErrorMacro(<< "Calling Enable too early, before Top is set...");
-    }
-
-  // Add the event handler to the system.
-  // If we change the types of events processed by this handler, then
-  // we need to change the Disable() routine to match.  In order for Disable()
-  // to work properly, both the callback function AND the client data
-  // passed to XtAddEventHandler and XtRemoveEventHandler must MATCH
-  // PERFECTLY
-  XtAddEventHandler(this->Top,
-                    KeyPressMask | KeyReleaseMask |
-                    ButtonPressMask | ButtonReleaseMask |
-                    ExposureMask | StructureNotifyMask |
-                    EnterWindowMask | LeaveWindowMask |
-                    PointerMotionHintMask | PointerMotionMask,
-                    True,  // True means we also observe ClientMessage
-                    vtkXRenderWindowInteractorCallback,
-                    static_cast<XtPointer>(this));
-
-  // Setup for capturing the window deletion
-  this->KillAtom = XInternAtom(this->DisplayId,"WM_DELETE_WINDOW",False);
-  XSetWMProtocols(this->DisplayId,this->WindowId,&this->KillAtom,1);
-
-  this->Enabled = 1;
-
-  this->Modified();
-}
-
-//-------------------------------------------------------------------------
-void vtkXRenderWindowInteractor::Disable()
-{
-  if (!this->Enabled)
-    {
-    return;
-    }
-
-  this->Enabled = 0;
-
-  // Remove the event handler to the system.
-  // If we change the types of events processed by this handler, then
-  // we need to change the Disable() routine to match.  In order for Disable()
-  // to work properly, both the callback function AND the client data
-  // passed to XtAddEventHandler and XtRemoveEventHandler must MATCH
-  // PERFECTLY.
-  //
-  // NOTE: we do not remove the StructureNotifyMask event since we need to
-  // keep track of the window size (we will not render if we are disabled,
-  // we simply track the window size changes for a possible Enable()).
-  // Expose events are disabled.
-  if (this->Top)
-    {
-    XtRemoveEventHandler(this->Top,
-                        KeyPressMask | KeyReleaseMask | ButtonPressMask |
-                        ExposureMask | ButtonReleaseMask |
-                        EnterWindowMask | LeaveWindowMask |
-                        PointerMotionHintMask | PointerMotionMask,
-                        True,vtkXRenderWindowInteractorCallback,
-                        static_cast<XtPointer>(this));
-    }
-
-  this->Modified();
-}
-
-//-------------------------------------------------------------------------
-void vtkXRenderWindowInteractor::PrintSelf(ostream& os, vtkIndent indent)
-{
-  this->Superclass::PrintSelf(os,indent);
-
-  if (vtkXRenderWindowInteractor::App)
-    {
-    os << indent << "App: " << this->App << "\n";
-    }
-  else
-    {
-    os << indent << "App: (none)\n";
-    }
-
-  os << indent << "BreakLoopFlag: "
-     << (this->BreakLoopFlag ? "On\n" : "Off\n");
-}
-
-//-------------------------------------------------------------------------
-void vtkXRenderWindowInteractor::UpdateSize(int x,int y)
-{
-  // if the size changed send this on to the RenderWindow
-  if ((x != this->Size[0])||(y != this->Size[1]))
-    {
-    this->Size[0] = x;
-    this->Size[1] = y;
-    this->RenderWindow->SetSize(x,y);
-    }
-}
-
-//-------------------------------------------------------------------------
-void vtkXRenderWindowInteractorTimer(XtPointer client_data,
-                                     XtIntervalId *id)
-{
-  vtkXRenderWindowInteractor *me =
-    static_cast<vtkXRenderWindowInteractor*>(client_data);
-  XtIntervalId xid = *id;
-
-  int platformTimerId = me->Internal->GetLocalId(xid);
-  int timerId = me->GetVTKTimerId(platformTimerId);
-
-  if (me->GetEnabled())
-    {
-    me->InvokeEvent(vtkCommand::TimerEvent,&timerId);
-    }
-
-  if ( ! me->IsOneShotTimer(timerId) )
-    {
-    me->ResetTimer(timerId);
-    }
-}
-
-//-------------------------------------------------------------------------
-// X always creates one shot timers
-int vtkXRenderWindowInteractor::InternalCreateTimer(int vtkNotUsed(timerId),
-                                                    int vtkNotUsed(timerType),
-                                                    unsigned long duration)
-{
-  duration = (duration > 0 ? duration : this->TimerDuration);
-  XtIntervalId xid =
-    this->AddTimeOut(vtkXRenderWindowInteractor::App,
-                     duration,
-                     vtkXRenderWindowInteractorTimer,
-                     static_cast<XtPointer>(this));
-  int platformTimerId = this->Internal->CreateLocalId(xid);
-  return platformTimerId;
-}
-
-//-------------------------------------------------------------------------
-int vtkXRenderWindowInteractor::InternalDestroyTimer(int platformTimerId)
-{
-  XtRemoveTimeOut(this->Internal->DestroyLocalId(platformTimerId));
-  return 1;
-}
-
-//-------------------------------------------------------------------------
-void vtkXRenderWindowInteractorCallback(Widget vtkNotUsed(w),
-                                        XtPointer client_data,
-                                        XEvent *event,
-                                        Boolean *vtkNotUsed(ctd))
-{
-  vtkXRenderWindowInteractor *me;
-  int xp, yp;
-
-  me = static_cast<vtkXRenderWindowInteractor *>(client_data);
-
-  switch (event->type)
-    {
-    case Expose:
-      {
-      if (!me->Enabled)
-        {
-        return;
-        }
-      XEvent result;
-      while (XCheckTypedWindowEvent(me->DisplayId,
-                                    me->WindowId,
-                                    Expose,
-                                    &result))
-        {
-        // just getting the expose configure event
-        event = &result;
-        }
-      XExposeEvent* exposeEvent = reinterpret_cast<XExposeEvent *>(event);
-      me->SetEventSize(exposeEvent->width, exposeEvent->height);
-      xp = exposeEvent->x;
-      yp = exposeEvent->y;
-      yp = me->Size[1] - yp - 1;
-      me->SetEventPosition(xp, yp);
-
-      // only render if we are currently accepting events
-      if (me->Enabled)
-        {
-        me->InvokeEvent(vtkCommand::ExposeEvent,NULL);
-        me->Render();
-        }
-      }
-      break;
-
-    case MapNotify:
-      {
-      // only render if we are currently accepting events
-      if (me->Enabled && me->GetRenderWindow()->GetNeverRendered())
-        {
-        me->Render();
-        }
-      }
-      break;
-
-    case ConfigureNotify:
-      {
-      XEvent result;
-      while (XCheckTypedWindowEvent(me->DisplayId,
-                                    me->WindowId,
-                                    ConfigureNotify,
-                                    &result))
-        {
-        // just getting the last configure event
-        event = &result;
-        }
-      int width = (reinterpret_cast<XConfigureEvent *>(event))->width;
-      int height = (reinterpret_cast<XConfigureEvent *>(event))->height;
-      if (width != me->Size[0] || height != me->Size[1])
-        {
-        bool resizeSmaller=width<=me->Size[0] && height<=me->Size[1];
-        me->UpdateSize(width, height);
-        xp = (reinterpret_cast<XButtonEvent*>(event))->x;
-        yp = (reinterpret_cast<XButtonEvent*>(event))->y;
-        me->SetEventPosition(xp, me->Size[1] - yp - 1);
-        // only render if we are currently accepting events
-        if (me->Enabled)
-          {
-          me->InvokeEvent(vtkCommand::ConfigureEvent,NULL);
-          if(resizeSmaller)
-            {
-            // Don't call Render when the window is resized to be larger:
-            //
-            // - if the window is resized to be larger, an Expose event will
-            // be trigged by the X server which will trigger a call to
-            // Render().
-            // - if the window is resized to be smaller, no Expose event will
-            // be trigged by the X server, as no new area become visible.
-            // only in this case, we need to explicitly call Render()
-            // in ConfigureNotify.
-            me->Render();
-            }
-          }
-        }
-      }
-      break;
-
-    case ButtonPress:
-      {
-      if (!me->Enabled)
-        {
-        return;
-        }
-      int ctrl =
-        (reinterpret_cast<XButtonEvent *>(event))->state & ControlMask ? 1 : 0;
-      int shift =
-        (reinterpret_cast<XButtonEvent *>(event))->state & ShiftMask ? 1 : 0;
-      int alt =
-        (reinterpret_cast<XButtonEvent *>(event))->state & Mod1Mask ? 1 : 0;
-      xp = (reinterpret_cast<XButtonEvent*>(event))->x;
-      yp = (reinterpret_cast<XButtonEvent*>(event))->y;
-
-      // check for double click
-      static int MousePressTime = 0;
-      int repeat = 0;
-      // 400 ms threshold by default is probably good to start
-      int eventTime=static_cast<int>(reinterpret_cast<XButtonEvent*>(event)->time);
-      if((eventTime - MousePressTime) < 400)
-        {
-        MousePressTime -= 2000;  // no double click next time
-        repeat = 1;
-        }
-      else
-        {
-        MousePressTime = eventTime;
-        }
-
-      me->SetEventInformationFlipY(xp,
-                                   yp,
-                                   ctrl,
-                                   shift,
-                                   0,
-                                   repeat);
-      me->SetAltKey(alt);
-      switch ((reinterpret_cast<XButtonEvent *>(event))->button)
-        {
-        case Button1:
-          me->InvokeEvent(vtkCommand::LeftButtonPressEvent,NULL);
-          break;
-        case Button2:
-          me->InvokeEvent(vtkCommand::MiddleButtonPressEvent,NULL);
-          break;
-        case Button3:
-          me->InvokeEvent(vtkCommand::RightButtonPressEvent,NULL);
-          break;
-        case Button4:
-          me->InvokeEvent(vtkCommand::MouseWheelForwardEvent,NULL);
-          break;
-        case Button5:
-          me->InvokeEvent(vtkCommand::MouseWheelBackwardEvent,NULL);
-          break;
-        }
-      }
-      break;
-
-    case ButtonRelease:
-      {
-      if (!me->Enabled)
-        {
-        return;
-        }
-      int ctrl =
-        (reinterpret_cast<XButtonEvent *>(event))->state & ControlMask ? 1 : 0;
-      int shift =
-        (reinterpret_cast<XButtonEvent *>(event))->state & ShiftMask ? 1 : 0;
-      int alt =
-        (reinterpret_cast<XButtonEvent *>(event))->state & Mod1Mask ? 1 : 0;
-      xp = (reinterpret_cast<XButtonEvent*>(event))->x;
-      yp = (reinterpret_cast<XButtonEvent*>(event))->y;
-      me->SetEventInformationFlipY(xp,
-                                   yp,
-                                   ctrl,
-                                   shift);
-      me->SetAltKey(alt);
-      switch ((reinterpret_cast<XButtonEvent *>(event))->button)
-        {
-        case Button1:
-          me->InvokeEvent(vtkCommand::LeftButtonReleaseEvent,NULL);
-          break;
-        case Button2:
-          me->InvokeEvent(vtkCommand::MiddleButtonReleaseEvent,NULL);
-          break;
-        case Button3:
-          me->InvokeEvent(vtkCommand::RightButtonReleaseEvent,NULL);
-          break;
-        }
-      }
-      break;
-
-    case EnterNotify:
-      {
-      // Force the keyboard focus to be this render window
-      if (me->TopLevelShell != NULL)
-        {
-        XtSetKeyboardFocus(me->TopLevelShell, me->Top);
-        }
-      if (me->Enabled)
-        {
-        XEnterWindowEvent *e = reinterpret_cast<XEnterWindowEvent *>(event);
-        me->SetEventInformationFlipY(e->x,
-                                     e->y,
-                                     (e->state & ControlMask) != 0,
-                                     (e->state & ShiftMask) != 0);
-        me->SetAltKey(
-          (reinterpret_cast<XButtonEvent *>(event))->state & Mod1Mask ? 1 : 0);
-        me->InvokeEvent(vtkCommand::EnterEvent, NULL);
-        }
-      }
-      break;
-
-    case LeaveNotify:
-      {
-      if (me->Enabled)
-        {
-        XLeaveWindowEvent *e = reinterpret_cast<XLeaveWindowEvent *>(event);
-        me->SetEventInformationFlipY(e->x,
-                                     e->y,
-                                     (e->state & ControlMask) != 0,
-                                     (e->state & ShiftMask) != 0);
-        me->SetAltKey(
-          (reinterpret_cast<XButtonEvent *>(event))->state & Mod1Mask ? 1 : 0);
-        me->InvokeEvent(vtkCommand::LeaveEvent, NULL);
-        }
-      }
-      break;
-
-    case KeyPress:
-      {
-      if (!me->Enabled)
-        {
-        return;
-        }
-      int ctrl =
-        (reinterpret_cast<XButtonEvent *>(event))->state & ControlMask ? 1 : 0;
-      int shift =
-        (reinterpret_cast<XButtonEvent *>(event))->state & ShiftMask ? 1 : 0;
-      int alt =
-        (reinterpret_cast<XButtonEvent *>(event))->state & Mod1Mask ? 1 : 0;
-      KeySym ks;
-      static char buffer[20];
-      buffer[0] = '\0';
-      XLookupString(reinterpret_cast<XKeyEvent *>(event),buffer, 20, &ks,NULL);
-      xp = (reinterpret_cast<XKeyEvent*>(event))->x;
-      yp = (reinterpret_cast<XKeyEvent*>(event))->y;
-      me->SetEventInformationFlipY(xp,
-                                   yp,
-                                   ctrl,
-                                   shift,
-                                   buffer[0],
-                                   1,
-                                   XKeysymToString(ks));
-      me->SetAltKey(alt);
-      me->InvokeEvent(vtkCommand::KeyPressEvent, NULL);
-      me->InvokeEvent(vtkCommand::CharEvent, NULL);
-      }
-      break;
-
-    case KeyRelease:
-      {
-      if (!me->Enabled)
-        {
-        return;
-        }
-      int ctrl =
-        (reinterpret_cast<XButtonEvent *>(event))->state & ControlMask ? 1 : 0;
-      int shift =
-        (reinterpret_cast<XButtonEvent *>(event))->state & ShiftMask ? 1 : 0;
-      int alt =
-        (reinterpret_cast<XButtonEvent *>(event))->state & Mod1Mask ? 1 : 0;
-      KeySym ks;
-      static char buffer[20];
-      buffer[0] = '\0';
-      XLookupString(reinterpret_cast<XKeyEvent *>(event),buffer, 20, &ks,NULL);
-      xp = (reinterpret_cast<XKeyEvent *>(event))->x;
-      yp = (reinterpret_cast<XKeyEvent *>(event))->y;
-      me->SetEventInformationFlipY(xp,
-                                   yp,
-                                   ctrl,
-                                   shift,
-                                   buffer[0],
-                                   1,
-                                   XKeysymToString(ks));
-      me->SetAltKey(alt);
-      me->InvokeEvent(vtkCommand::KeyReleaseEvent, NULL);
-      }
-      break;
-
-    case MotionNotify:
-      {
-      if (!me->Enabled)
-        {
-        return;
-        }
-      int ctrl =
-        (reinterpret_cast<XButtonEvent *>(event))->state & ControlMask ? 1 : 0;
-      int shift =
-        (reinterpret_cast<XButtonEvent *>(event))->state & ShiftMask ? 1 : 0;
-      int alt =
-        (reinterpret_cast<XButtonEvent *>(event))->state & Mod1Mask ? 1 : 0;
-
-      // Note that even though the (x,y) location of the pointer is event structure,
-      // we must call XQueryPointer for the hints (motion event compression) to
-      // work properly.
-      me->GetMousePosition(&xp, &yp);
-      me->SetEventInformation(xp, yp, ctrl, shift);
-      me->SetAltKey(alt);
-      me->InvokeEvent(vtkCommand::MouseMoveEvent, NULL);
-      }
-      break;
-
-    case ClientMessage:
-      {
-      //cout << "XGetAtomName(message_type): "
-      //  << XGetAtomName(me->DisplayId,
-      //       (reinterpret_cast<XClientMessageEvent *>(event))->message_type)
-      //  << endl;
-      if( static_cast<Atom>(event->xclient.data.l[0]) == me->KillAtom )
-        {
-        me->ExitCallback();
-        }
-      }
-      break;
-    }
-}
-
-//-------------------------------------------------------------------------
-XtIntervalId vtkXRenderWindowInteractor::AddTimeOut(XtAppContext app_context,
-                                                    unsigned long interval,
-                                                    XtTimerCallbackProc proc,
-                                                    XtPointer client_data)
-{
-  return XtAppAddTimeOut(app_context, interval, proc, client_data);
-}
-
-//-------------------------------------------------------------------------
-void vtkXRenderWindowInteractor::GetMousePosition(int *x, int *y)
-{
-  Window root,child;
-  int root_x,root_y;
-  unsigned int keys;
-
-  XQueryPointer(this->DisplayId,this->WindowId,
-                &root,&child,&root_x,&root_y,x,y,&keys);
-
-  *y = this->Size[1] - *y - 1;
-}
-
-//-------------------------------------------------------------------------
-void vtkXRenderWindowInteractor::Timer(XtPointer client_data,
-                                       XtIntervalId *id)
-{
-  vtkXRenderWindowInteractorTimer(client_data, id);
-}
-
-//-------------------------------------------------------------------------
-void vtkXRenderWindowInteractor::Callback(Widget w,
-                                          XtPointer client_data,
-                                          XEvent *event,
-                                          Boolean *ctd)
-{
-  vtkXRenderWindowInteractorCallback(w, client_data, event, ctd);
-}
diff --git a/Rendering/OpenGL2/vtkXRenderWindowInteractor.h b/Rendering/OpenGL2/vtkXRenderWindowInteractor.h
deleted file mode 100644
index 7477691..0000000
--- a/Rendering/OpenGL2/vtkXRenderWindowInteractor.h
+++ /dev/null
@@ -1,199 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkXRenderWindowInteractor.h
-
-  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.
-
-=========================================================================*/
-// .NAME vtkXRenderWindowInteractor - an X event driven interface for a RenderWindow
-// .SECTION Description
-// vtkXRenderWindowInteractor is a convenience object that provides event
-// bindings to common graphics functions. For example, camera and actor
-// functions such as zoom-in/zoom-out, azimuth, roll, and pan. IT is one of
-// the window system specific subclasses of vtkRenderWindowInteractor. Please
-// see vtkRenderWindowInteractor documentation for event bindings.
-//
-// .SECTION see also
-// vtkRenderWindowInteractor vtkXOpenGL2RenderWindow
-
-// I've been though this and deleted all I think should go, tried to create
-// the basic structure and if you're lucky it might even work!
-// but frankly I doubt it
-
-#ifndef vtkXRenderWindowInteractor_h
-#define vtkXRenderWindowInteractor_h
-
-//===========================================================
-// now we define the C++ class
-
-#include "vtkRenderingOpenGL2Module.h" // For export macro
-#include "vtkRenderWindowInteractor.h"
-#include <X11/StringDefs.h> // Needed for X types in the public interface
-#include <X11/Intrinsic.h> // Needed for X types in the public interface
-
-class vtkCallbackCommand;
-class vtkXRenderWindowInteractorInternals;
-
-// Forward declare internal friend functions.
-void VTKRENDERINGOPENGL2_EXPORT vtkXRenderWindowInteractorCallback(Widget,XtPointer, XEvent *,Boolean *);
-void VTKRENDERINGOPENGL2_EXPORT vtkXRenderWindowInteractorTimer(XtPointer,XtIntervalId *);
-
-class VTKRENDERINGOPENGL2_EXPORT vtkXRenderWindowInteractor : public vtkRenderWindowInteractor
-{
-public:
-  static vtkXRenderWindowInteractor *New();
-  vtkTypeMacro(vtkXRenderWindowInteractor,vtkRenderWindowInteractor);
-  void PrintSelf(ostream& os, vtkIndent indent);
-
-  // Description:
-  // Initializes the event handlers without an XtAppContext.  This is
-  // good for when you don't have a user interface, but you still
-  // want to have mouse interaction.
-  virtual void Initialize();
-
-  // Description:
-  // Break the event loop on 'q','e' keypress. Want more ???
-  void TerminateApp();
-
-  // Description:
-  // The BreakLoopFlag is checked in the Start() method.
-  // Setting it to anything other than zero will cause
-  // the interactor loop to terminate and return to the
-  // calling function.
-  vtkGetMacro(BreakLoopFlag, int);
-  void SetBreakLoopFlag(int);
-  void BreakLoopFlagOff();
-  void BreakLoopFlagOn();
-
-  // Description:
-  // Initializes the event handlers using an XtAppContext that you have
-  // provided.  This assumes that you want to own the event loop.
-  virtual void Initialize(XtAppContext app);
-  vtkGetMacro( App, XtAppContext );
-
-  // Description:
-  // Enable/Disable interactions.  By default interactors are enabled when
-  // initialized.  Initialize() must be called prior to enabling/disabling
-  // interaction. These methods are used when a window/widget is being
-  // shared by multiple renderers and interactors.  This allows a "modal"
-  // display where one interactor is active when its data is to be displayed
-  // and all other interactors associated with the widget are disabled
-  // when their data is not displayed.
-  virtual void Enable();
-  virtual void Disable();
-
-  // Description:
-  // Update the Size data member and set the associated RenderWindow's
-  // size.
-  virtual void UpdateSize(int,int);
-
-  // Description:
-  // Specify the Xt widget to use for interaction. This method is
-  // one of a couple steps that are required for setting up a
-  // vtkRenderWindowInteractor as a widget inside of another user
-  // interface. You do not need to use this method if the render window
-  // will be a stand-alone window. This is only used when you want the
-  // render window to be a subwindow within a larger user interface.
-  // In that case, you must tell the render window what X display id
-  // to use, and then ask the render window what depth, visual and
-  // colormap it wants. Then, you must create an Xt TopLevelShell with
-  // those settings. Then you can create the rest of your user interface
-  // as a child of the TopLevelShell you created. Eventually, you will
-  // create a drawing area or some other widget to serve as the rendering
-  // window. You must use the SetWidget method to tell this Interactor
-  // about that widget. It's X and it's not terribly easy, but it looks cool.
-  virtual void SetWidget(Widget);
-  Widget GetWidget() {return this->Top;};
-
-  // Description
-  // This method will store the top level shell widget for the interactor.
-  // This method and the method invocation sequence applies for:
-  //     1 vtkRenderWindow-Interactor pair in a nested widget hierarchy
-  //     multiple vtkRenderWindow-Interactor pairs in the same top level shell
-  // It is not needed for
-  //     1 vtkRenderWindow-Interactor pair as the direct child of a top level shell
-  //     multiple vtkRenderWindow-Interactor pairs, each in its own top level shell
-  //
-  // The method, along with EnterNotify event, changes the keyboard focus among
-  // the widgets/vtkRenderWindow(s) so the Interactor(s) can receive the proper
-  // keyboard events. The following calls need to be made:
-  //     vtkRenderWindow's display ID need to be set to the top level shell's
-  //           display ID.
-  //     vtkXRenderWindowInteractor's Widget has to be set to the vtkRenderWindow's
-  //           container widget
-  //     vtkXRenderWindowInteractor's TopLevel has to be set to the top level
-  //           shell widget
-  // note that the procedure for setting up render window in a widget needs to
-  // be followed.  See vtkRenderWindowInteractor's SetWidget method.
-  //
-  // If multiple vtkRenderWindow-Interactor pairs in SEPARATE windows are desired,
-  // do not set the display ID (Interactor will create them as needed.  Alternatively,
-  // create and set distinct DisplayID for each vtkRenderWindow. Using the same
-  // display ID without setting the parent widgets will cause the display to be
-  // reinitialized every time an interactor is initialized), do not set the
-  // widgets (so the render windows would be in their own windows), and do
-  // not set TopLevelShell (each has its own top level shell already)
-  virtual void SetTopLevelShell(Widget);
-  Widget GetTopLevelShell() {return this->TopLevelShell;};
-
-  // Description:
-  // Re-defines virtual function to get mouse position by querying X-server.
-  virtual void GetMousePosition(int *x, int *y);
-
-  // Description:
-  // Functions that are used internally.
-  friend void vtkXRenderWindowInteractorCallback(Widget,XtPointer,
-                                                 XEvent *,Boolean *);
-  friend void vtkXRenderWindowInteractorTimer(XtPointer,XtIntervalId *);
-
-protected:
-  vtkXRenderWindowInteractor();
-  ~vtkXRenderWindowInteractor();
-
-  //Using static here to avoid detroying context when many apps are open:
-  static XtAppContext App;
-  static int NumAppInitialized;
-
-  Display *DisplayId;
-  Window WindowId;
-  Atom KillAtom;
-  Widget Top;
-  int OwnTop;
-  int OwnApp;
-  int PositionBeforeStereo[2];
-  Widget TopLevelShell;
-  int TimerId;
-  vtkXRenderWindowInteractorInternals* Internal;
-
-  // Description:
-  // X-specific internal timer methods. See the superclass for detailed
-  // documentation.
-  virtual int InternalCreateTimer(int timerId, int timerType, unsigned long duration);
-  virtual int InternalDestroyTimer(int platformTimerId);
-
-  XtIntervalId AddTimeOut(XtAppContext app_context, unsigned long interval,
-                          XtTimerCallbackProc proc, XtPointer client_data) ;
-  void Timer(XtPointer client_data, XtIntervalId *id);
-  void Callback(Widget w, XtPointer client_data, XEvent *event, Boolean *ctd);
-
-  static int BreakLoopFlag;
-
-  // Description:
-  // This will start up the X event loop and never return. If you
-  // call this method it will loop processing X events until the
-  // application is exited.
-  virtual void StartEventLoop();
-
-private:
-  vtkXRenderWindowInteractor(const vtkXRenderWindowInteractor&);  // Not implemented.
-  void operator=(const vtkXRenderWindowInteractor&);  // Not implemented.
-};
-
-#endif
diff --git a/Rendering/OpenGL2/vtkglBufferObject.cxx b/Rendering/OpenGL2/vtkglBufferObject.cxx
new file mode 100644
index 0000000..5fcf61f
--- /dev/null
+++ b/Rendering/OpenGL2/vtkglBufferObject.cxx
@@ -0,0 +1,133 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+
+  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 "vtkglBufferObject.h"
+
+#include "vtk_glew.h"
+
+namespace vtkgl {
+
+namespace {
+inline GLenum convertType(BufferObject::ObjectType type)
+{
+  switch (type)
+    {
+    default:
+    case BufferObject::ArrayBuffer:
+      return GL_ARRAY_BUFFER;
+    case BufferObject::ElementArrayBuffer:
+      return GL_ELEMENT_ARRAY_BUFFER;
+    }
+}
+}
+
+struct BufferObject::Private
+{
+  Private() : handle(0) {}
+  GLenum type;
+  GLuint handle;
+};
+
+BufferObject::BufferObject(ObjectType type)
+  : d(new Private), Dirty(true)
+{
+  if (type == ArrayBuffer)
+    {
+    this->d->type = GL_ARRAY_BUFFER;
+    }
+  else
+    {
+    this->d->type = GL_ELEMENT_ARRAY_BUFFER;
+    }
+}
+
+BufferObject::~BufferObject()
+{
+  if (this->d->handle != 0)
+    {
+    glDeleteBuffers(1, &this->d->handle);
+    }
+  delete this->d;
+}
+
+void BufferObject::ReleaseGraphicsResources()
+{
+  if (this->d->handle != 0)
+    {
+    glBindBuffer(this->d->type, 0);
+    glDeleteBuffers(1, &this->d->handle);
+    this->d->handle = 0;
+    }
+}
+
+BufferObject::ObjectType BufferObject::GetType() const
+{
+  if (this->d->type == GL_ARRAY_BUFFER)
+    {
+    return ArrayBuffer;
+    }
+  else
+    {
+    return ElementArrayBuffer;
+    }
+}
+
+int BufferObject::GetHandle() const
+{
+  return static_cast<int>(this->d->handle);
+}
+
+bool BufferObject::Bind()
+{
+  if (!this->d->handle)
+    {
+    return false;
+    }
+
+  glBindBuffer(this->d->type, this->d->handle);
+  return true;
+}
+
+bool BufferObject::Release()
+{
+  if (!this->d->handle)
+    {
+    return false;
+    }
+
+  glBindBuffer(this->d->type, 0);
+  return true;
+}
+
+bool BufferObject::UploadInternal(const void *buffer, size_t size,
+                                  ObjectType objectType)
+{
+  GLenum objectTypeGl = convertType(objectType);
+  if (d->handle == 0)
+    {
+    glGenBuffers(1, &this->d->handle);
+    this->d->type = objectTypeGl;
+    }
+  else if (this->d->type != objectTypeGl)
+    {
+    this->Error = "Trying to upload array buffer to incompatible buffer.";
+    return false;
+    }
+  glBindBuffer(this->d->type, this->d->handle);
+  glBufferData(this->d->type, size, static_cast<const GLvoid *>(buffer),
+               GL_STATIC_DRAW);
+  this->Dirty = false;
+  return true;
+}
+
+}
diff --git a/Rendering/OpenGL2/vtkglBufferObject.h b/Rendering/OpenGL2/vtkglBufferObject.h
new file mode 100644
index 0000000..e4430aa
--- /dev/null
+++ b/Rendering/OpenGL2/vtkglBufferObject.h
@@ -0,0 +1,129 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+
+  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.
+
+=========================================================================*/
+#ifndef vtkglBufferObject_h
+#define vtkglBufferObject_h
+
+#include "vtkRenderingOpenGL2Module.h"
+#include "vtkStdString.h" // for std::string
+
+namespace vtkgl {
+
+/**
+ * @brief OpenGL buffer object
+ *
+ * OpenGL buffer object to store index, geometry and/or attribute data on the
+ * GPU.
+ */
+
+class VTKRENDERINGOPENGL2_EXPORT BufferObject
+{
+public:
+  enum ObjectType {
+    ArrayBuffer,
+    ElementArrayBuffer
+  };
+
+  BufferObject(ObjectType type = ArrayBuffer);
+  ~BufferObject();
+
+  /** Get the type of the buffer object. */
+  ObjectType GetType() const;
+
+  /** Get the handle of the buffer object. */
+  int GetHandle() const;
+
+  /** Determine if the buffer object is ready to be used. */
+  bool IsReady() const { return Dirty == false; }
+
+  /**
+   * Upload data to the buffer object. The BufferObject::type() must match
+   * @a type or be uninitialized.
+   *
+   * The T type must have tightly packed values of T::value_type accessible by
+   * reference via T::operator[]. Additionally, the standard size() and empty()
+   * methods must be implemented. The std::vector class is an example of such a
+   * supported containers.
+   */
+  template <class T>
+  bool Upload(const T &array, ObjectType type);
+
+  // non vector version
+  template <class T>
+  bool Upload(const T *array, size_t numElements, ObjectType type);
+
+  /**
+   * Bind the buffer object ready for rendering.
+   * @note Only one ARRAY_BUFFER and one ELEMENT_ARRAY_BUFFER may be bound at
+   * any time.
+   */
+  bool Bind();
+
+  /**
+   * Release the buffer. This should be done after rendering is complete.
+   */
+  bool Release();
+
+
+  // Description:
+  // Release any graphics resources that are being consumed by this class.
+  void ReleaseGraphicsResources();
+
+  /**
+   * Return a string describing errors.
+   */
+  std::string GetError() const { return Error; }
+
+private:
+  bool UploadInternal(const void *buffer, size_t size, ObjectType objectType);
+
+  struct Private;
+  Private *d;
+
+  bool  Dirty;
+  std::string Error;
+};
+
+template <class T>
+inline bool BufferObject::Upload(const T &array,
+                                 BufferObject::ObjectType objectType)
+{
+  if (array.empty())
+    {
+    this->Error = "Refusing to upload empty array.";
+    return false;
+    }
+  return this->UploadInternal(&array[0],
+                              array.size() * sizeof(typename T::value_type),
+                              objectType);
+}
+
+template <class T>
+inline bool BufferObject::Upload(const T *array, size_t numElements,
+                                 BufferObject::ObjectType objectType)
+{
+  if (!array)
+    {
+    this->Error = "Refusing to upload empty array.";
+    return false;
+    }
+  return this->UploadInternal(array,
+                              numElements * sizeof(T),
+                              objectType);
+}
+
+}
+
+#endif
+
+// VTK-HeaderTest-Exclude: vtkglBufferObject.h
diff --git a/Rendering/OpenGL2/vtkglVBOHelper.cxx b/Rendering/OpenGL2/vtkglVBOHelper.cxx
new file mode 100644
index 0000000..05dabdc
--- /dev/null
+++ b/Rendering/OpenGL2/vtkglVBOHelper.cxx
@@ -0,0 +1,707 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+
+  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 "vtkglVBOHelper.h"
+
+#include "vtkCellArray.h"
+#include "vtkPoints.h"
+#include "vtkPolygon.h"
+#include "vtkPolyData.h"
+#include "vtkShaderProgram.h"
+
+
+// we only instantiate some cases to avoid template explosion
+#define vtkFloatDoubleTemplateMacro(call)                                              \
+  vtkTemplateMacroCase(VTK_DOUBLE, double, call);                           \
+  vtkTemplateMacroCase(VTK_FLOAT, float, call);
+
+
+namespace vtkgl {
+
+// internal function called by AppendVBO
+template<typename T, typename T2, typename T3>
+void TemplatedAppendVBO3(VBOLayout &layout,
+  T* points, T2* normals, vtkIdType numPts,
+  T3* tcoords, int textureComponents,
+  unsigned char *colors, int colorComponents,
+  unsigned int *cellPointMap,
+  unsigned int *pointCellMap,
+  bool cellScalars, bool cellNormals)
+{
+  // Figure out how big each block will be, currently 6 or 7 floats.
+  int blockSize = 3;
+  layout.VertexOffset = 0;
+  layout.NormalOffset = 0;
+  layout.TCoordOffset = 0;
+  layout.TCoordComponents = 0;
+  layout.ColorComponents = 0;
+  layout.ColorOffset = 0;
+  if (normals)
+    {
+    layout.NormalOffset = sizeof(float) * blockSize;
+    blockSize += 3;
+    }
+  if (tcoords)
+    {
+    layout.TCoordOffset = sizeof(float) * blockSize;
+    layout.TCoordComponents = textureComponents;
+    blockSize += textureComponents;
+    }
+  if (colors)
+    {
+    layout.ColorComponents = colorComponents;
+    layout.ColorOffset = sizeof(float) * blockSize;
+    ++blockSize;
+    }
+  layout.Stride = sizeof(float) * blockSize;
+
+  // Create a buffer, and copy the data over.
+  layout.PackedVBO.resize(blockSize * (numPts + layout.VertexCount));
+  std::vector<float>::iterator it = layout.PackedVBO.begin()
+    + (layout.VertexCount*layout.Stride/sizeof(float));
+
+  T *pointPtr;
+  T2 *normalPtr;
+  T3 *tcoordPtr;
+  unsigned char *colorPtr;
+
+  // TODO: optimize this somehow, lots of if statements in here
+  for (vtkIdType i = 0; i < numPts; ++i)
+    {
+    if (cellPointMap && cellPointMap[i] > 0)
+      {
+      pointPtr = points + (cellPointMap[i]-1)*3;
+      normalPtr = normals + (cellPointMap[i]-1)*3;
+      tcoordPtr = tcoords + (cellPointMap[i]-1)*textureComponents;
+      colorPtr = colors + (cellPointMap[i]-1)*colorComponents;
+      }
+    else
+      {
+      pointPtr = points + i*3;
+      normalPtr = normals + i*3;
+      tcoordPtr = tcoords + i*textureComponents;
+      colorPtr = colors + i*colorComponents;
+      }
+    // Vertices
+    *(it++) = *(pointPtr++);
+    *(it++) = *(pointPtr++);
+    *(it++) = *(pointPtr++);
+    if (normals)
+      {
+      if (cellNormals)
+        {
+        normalPtr = normals + pointCellMap[i]*3;
+        }
+      *(it++) = *(normalPtr++);
+      *(it++) = *(normalPtr++);
+      *(it++) = *(normalPtr++);
+      }
+    if (tcoords)
+      {
+      for (int j = 0; j < textureComponents; ++j)
+        {
+        *(it++) = *(tcoordPtr++);
+        }
+      }
+    if (colors)
+      {
+      if (cellScalars)
+        {
+        colorPtr = colors + pointCellMap[i]*colorComponents;
+        }
+      if (colorComponents == 4)
+        {
+        *(it++) = *reinterpret_cast<float *>(colorPtr);
+        }
+      else
+        {
+        unsigned char c[4];
+        c[0] = *(colorPtr++);
+        c[1] = *(colorPtr++);
+        c[2] = *(colorPtr);
+        c[3] =  255;
+        *(it++) = *reinterpret_cast<float *>(c);
+        }
+      }
+    }
+  layout.VertexCount += numPts;
+}
+
+//----------------------------------------------------------------------------
+template<typename T, typename T2>
+void TemplatedAppendVBO2(VBOLayout &layout,
+  T* points, T2 *normals, vtkIdType numPts,
+  vtkDataArray *tcoords,
+  unsigned char *colors, int colorComponents,
+  unsigned int *cellPointMap,
+  unsigned int *pointCellMap,
+  bool cellScalars, bool cellNormals)
+{
+  if (tcoords)
+    {
+    switch(tcoords->GetDataType())
+      {
+      vtkFloatDoubleTemplateMacro(
+        TemplatedAppendVBO3(layout, points, normals,
+                  numPts,
+                  static_cast<VTK_TT*>(tcoords->GetVoidPointer(0)),
+                  tcoords->GetNumberOfComponents(),
+                  colors, colorComponents,
+                  cellPointMap, pointCellMap,
+                  cellScalars, cellNormals));
+      }
+    }
+  else
+    {
+    TemplatedAppendVBO3(layout, points, normals,
+                        numPts, (float *)NULL, 0,
+                        colors, colorComponents,
+                        cellPointMap, pointCellMap,
+                        cellScalars, cellNormals);
+    }
+}
+
+//----------------------------------------------------------------------------
+template<typename T>
+void TemplatedAppendVBO(VBOLayout &layout,
+  T* points, vtkDataArray *normals, vtkIdType numPts,
+  vtkDataArray *tcoords,
+  unsigned char *colors, int colorComponents,
+  unsigned int *cellPointMap,
+  unsigned int *pointCellMap,
+  bool cellScalars, bool cellNormals)
+{
+  if (normals)
+    {
+    switch(normals->GetDataType())
+      {
+      vtkFloatDoubleTemplateMacro(
+        TemplatedAppendVBO2(layout, points,
+                  static_cast<VTK_TT*>(normals->GetVoidPointer(0)),
+                  numPts, tcoords, colors, colorComponents,
+                  cellPointMap, pointCellMap,
+                  cellScalars, cellNormals));
+      }
+    }
+  else
+    {
+    TemplatedAppendVBO2(layout, points,
+                        (float *)NULL,
+                        numPts, tcoords, colors, colorComponents,
+                        cellPointMap, pointCellMap,
+                        cellScalars, cellNormals);
+    }
+}
+
+// Take the points, and pack them into the VBO object supplied. This currently
+// takes whatever the input type might be and packs them into a VBO using
+// floats for the vertices and normals, and unsigned char for the colors (if
+// the array is non-null).
+void AppendVBO(VBOLayout &layout,
+  vtkPoints *points, unsigned int numPts,
+  vtkDataArray *normals,
+  vtkDataArray *tcoords,
+  unsigned char *colors, int colorComponents,
+  unsigned int *cellPointMap, unsigned int *pointCellMap,
+  bool cellScalars, bool cellNormals)
+{
+  switch(points->GetDataType())
+    {
+    vtkTemplateMacro(
+      TemplatedAppendVBO(layout, static_cast<VTK_TT*>(points->GetVoidPointer(0)),
+                normals, numPts, tcoords, colors, colorComponents,
+                cellPointMap, pointCellMap,
+                cellScalars, cellNormals));
+    }
+}
+
+// create a VBO, append the data to it, then upload it
+VBOLayout CreateVBO(
+  vtkPoints *points, unsigned int numPts,
+  vtkDataArray *normals,
+  vtkDataArray *tcoords,
+  unsigned char *colors, int colorComponents,
+  BufferObject &vertexBuffer,
+  unsigned int *cellPointMap, unsigned int *pointCellMap,
+  bool cellScalars, bool cellNormals)
+{
+  VBOLayout layout;
+
+  // fast path
+  if (!tcoords && !normals && !colors && points->GetDataType() == VTK_FLOAT)
+    {
+    int blockSize = 3;
+    layout.VertexOffset = 0;
+    layout.NormalOffset = 0;
+    layout.TCoordOffset = 0;
+    layout.TCoordComponents = 0;
+    layout.ColorComponents = 0;
+    layout.ColorOffset = 0;
+    layout.Stride = sizeof(float) * blockSize;
+    layout.VertexCount = numPts;
+    vertexBuffer.Upload((float *)(points->GetVoidPointer(0)), numPts*3,
+      vtkgl::BufferObject::ArrayBuffer);
+    return layout;
+    }
+
+  // slower path
+  layout.VertexCount = 0;
+  AppendVBO(layout,points,numPts,normals,tcoords,colors,colorComponents,
+    cellPointMap, pointCellMap, cellScalars, cellNormals);
+  vertexBuffer.Upload(layout.PackedVBO, vtkgl::BufferObject::ArrayBuffer);
+  layout.PackedVBO.resize(0);
+  return layout;
+}
+
+// Process the string, and return a version with replacements.
+std::string replace(std::string source, const std::string &search,
+                    const std::string replace, bool all)
+{
+  std::string::size_type pos = 0;
+  while ((pos = source.find(search, 0)) != std::string::npos)
+    {
+    source.replace(pos, search.length(), replace);
+    if (!all)
+      {
+      return source;
+      }
+    pos += search.length();
+    }
+  return source;
+}
+
+// Process the string, and return a version with replacements.
+bool substitute(std::string &source, const std::string &search,
+             const std::string replace, bool all)
+{
+  std::string::size_type pos = 0;
+  bool replaced = false;
+  while ((pos = source.find(search, 0)) != std::string::npos)
+    {
+    source.replace(pos, search.length(), replace);
+    if (!all)
+      {
+      return true;
+      }
+    pos += search.length();
+    replaced = true;
+    }
+  return replaced;
+}
+
+// used to create an IBO for triangle primatives
+void AppendTriangleIndexBuffer(
+  std::vector<unsigned int> &indexArray,
+  vtkCellArray *cells,
+  vtkPoints *points,
+  std::vector<unsigned int> &cellPointMap,
+  vtkIdType vOffset)
+{
+  vtkIdType* indices(NULL);
+  vtkIdType npts(0);
+  size_t targetSize = indexArray.size() +
+    (cells->GetNumberOfConnectivityEntries() -
+     cells->GetNumberOfCells()*3)*3;
+  if (targetSize > indexArray.capacity())
+    {
+    if (targetSize < indexArray.capacity()*1.5)
+      {
+      targetSize = indexArray.capacity()*1.5;
+      }
+    indexArray.reserve(targetSize);
+    }
+
+  // the folowing are only used if we have to triangulate a polygon
+  // otherwise they just sit at NULL
+  vtkPolygon *polygon = NULL;
+  vtkIdList *tris = NULL;
+  vtkPoints *triPoints = NULL;
+
+  for (cells->InitTraversal(); cells->GetNextCell(npts, indices); )
+    {
+    // ignore degenerate triangles
+    if (npts < 3)
+      {
+      continue;
+      }
+
+    // triangulate needed
+    if (npts > 3)
+      {
+      // special case for quads, penta, hex which are common
+      if (npts == 4)
+        {
+        indexArray.push_back(static_cast<unsigned int>(indices[0]+vOffset));
+        indexArray.push_back(static_cast<unsigned int>(indices[1]+vOffset));
+        indexArray.push_back(static_cast<unsigned int>(indices[2]+vOffset));
+        indexArray.push_back(static_cast<unsigned int>(indices[0]+vOffset));
+        indexArray.push_back(static_cast<unsigned int>(indices[2]+vOffset));
+        indexArray.push_back(static_cast<unsigned int>(indices[3]+vOffset));
+        }
+      else if (npts == 5)
+        {
+        indexArray.push_back(static_cast<unsigned int>(indices[0]+vOffset));
+        indexArray.push_back(static_cast<unsigned int>(indices[1]+vOffset));
+        indexArray.push_back(static_cast<unsigned int>(indices[2]+vOffset));
+        indexArray.push_back(static_cast<unsigned int>(indices[0]+vOffset));
+        indexArray.push_back(static_cast<unsigned int>(indices[2]+vOffset));
+        indexArray.push_back(static_cast<unsigned int>(indices[3]+vOffset));
+        indexArray.push_back(static_cast<unsigned int>(indices[0]+vOffset));
+        indexArray.push_back(static_cast<unsigned int>(indices[3]+vOffset));
+        indexArray.push_back(static_cast<unsigned int>(indices[4]+vOffset));
+        }
+      else if (npts == 6)
+        {
+        indexArray.push_back(static_cast<unsigned int>(indices[0]+vOffset));
+        indexArray.push_back(static_cast<unsigned int>(indices[1]+vOffset));
+        indexArray.push_back(static_cast<unsigned int>(indices[2]+vOffset));
+        indexArray.push_back(static_cast<unsigned int>(indices[0]+vOffset));
+        indexArray.push_back(static_cast<unsigned int>(indices[2]+vOffset));
+        indexArray.push_back(static_cast<unsigned int>(indices[3]+vOffset));
+        indexArray.push_back(static_cast<unsigned int>(indices[0]+vOffset));
+        indexArray.push_back(static_cast<unsigned int>(indices[3]+vOffset));
+        indexArray.push_back(static_cast<unsigned int>(indices[5]+vOffset));
+        indexArray.push_back(static_cast<unsigned int>(indices[3]+vOffset));
+        indexArray.push_back(static_cast<unsigned int>(indices[4]+vOffset));
+        indexArray.push_back(static_cast<unsigned int>(indices[5]+vOffset));
+        }
+      else // 7 sided polygon or higher, do a full smart triangulation
+        {
+        if (!polygon)
+          {
+          polygon = vtkPolygon::New();
+          tris = vtkIdList::New();
+          triPoints = vtkPoints::New();
+          }
+
+        vtkIdType *triIndices = new vtkIdType[npts];
+        triPoints->SetNumberOfPoints(npts);
+        for (int i = 0; i < npts; ++i)
+          {
+          int idx = indices[i];
+          if (cellPointMap.size() > 0 && cellPointMap[indices[i]] > 0)
+            {
+            idx = cellPointMap[indices[i]]-1;
+            }
+          triPoints->SetPoint(i,points->GetPoint(idx));
+          triIndices[i] = i;
+          }
+        polygon->Initialize(npts, triIndices, triPoints);
+        polygon->Triangulate(tris);
+        for (int j = 0; j < tris->GetNumberOfIds(); ++j)
+          {
+          indexArray.push_back(static_cast<unsigned int>(
+            indices[tris->GetId(j)]+vOffset));
+          }
+        delete [] triIndices;
+        }
+      }
+    else
+      {
+      indexArray.push_back(static_cast<unsigned int>(*(indices++)+vOffset));
+      indexArray.push_back(static_cast<unsigned int>(*(indices++)+vOffset));
+      indexArray.push_back(static_cast<unsigned int>(*(indices++)+vOffset));
+      }
+    }
+  if (polygon)
+    {
+    polygon->Delete();
+    tris->Delete();
+    triPoints->Delete();
+    }
+}
+
+// used to create an IBO for triangle primatives
+size_t CreateTriangleIndexBuffer(
+  vtkCellArray *cells, BufferObject &indexBuffer,
+  vtkPoints *points, std::vector<unsigned int> &cellPointMap)
+{
+  if (!cells->GetNumberOfCells())
+    {
+    return 0;
+    }
+  std::vector<unsigned int> indexArray;
+  AppendTriangleIndexBuffer(indexArray, cells, points, cellPointMap, 0);
+  indexBuffer.Upload(indexArray, vtkgl::BufferObject::ElementArrayBuffer);
+  return indexArray.size();
+}
+
+// used to create an IBO for point primatives
+void AppendPointIndexBuffer(
+  std::vector<unsigned int> &indexArray,
+  vtkCellArray *cells,
+  vtkIdType vOffset)
+{
+  vtkIdType* indices(NULL);
+  vtkIdType npts(0);
+  size_t targetSize = indexArray.size() +
+    cells->GetNumberOfConnectivityEntries() -
+    cells->GetNumberOfCells();
+  if (targetSize > indexArray.capacity())
+    {
+    if (targetSize < indexArray.capacity()*1.5)
+      {
+      targetSize = indexArray.capacity()*1.5;
+      }
+    indexArray.reserve(targetSize);
+    }
+
+  for (cells->InitTraversal(); cells->GetNextCell(npts, indices); )
+    {
+    for (int i = 0; i < npts; ++i)
+      {
+      indexArray.push_back(static_cast<unsigned int>(*(indices++)+vOffset));
+      }
+    }
+}
+
+// used to create an IBO for triangle primatives
+size_t CreatePointIndexBuffer(
+  vtkCellArray *cells, BufferObject &indexBuffer)
+{
+  if (!cells->GetNumberOfCells())
+    {
+    return 0;
+    }
+  std::vector<unsigned int> indexArray;
+  AppendPointIndexBuffer(indexArray, cells, 0);
+  indexBuffer.Upload(indexArray, vtkgl::BufferObject::ElementArrayBuffer);
+  return indexArray.size();
+}
+
+
+// used to create an IBO for primatives as lines.  This method treats each line segment
+// as independent.  So for a triangle mesh you would get 6 verts per triangle
+// 3 edges * 2 verts each.  With a line loop you only get 3 verts so half the storage.
+// but... line loops are slower than line segments.
+void AppendTriangleLineIndexBuffer(
+  std::vector<unsigned int> &indexArray,
+  vtkCellArray *cells,
+  vtkIdType vOffset)
+{
+  vtkIdType* indices(NULL);
+  vtkIdType npts(0);
+  size_t targetSize = indexArray.size() + 2*(
+    cells->GetNumberOfConnectivityEntries() -
+    cells->GetNumberOfCells());
+  if (targetSize > indexArray.capacity())
+    {
+    if (targetSize < indexArray.capacity()*1.5)
+      {
+      targetSize = indexArray.capacity()*1.5;
+      }
+    indexArray.reserve(targetSize);
+    }
+
+  for (cells->InitTraversal(); cells->GetNextCell(npts, indices); )
+    {
+    for (int i = 0; i < npts; ++i)
+      {
+      indexArray.push_back(static_cast<unsigned int>(indices[i]+vOffset));
+      indexArray.push_back(static_cast<unsigned int>(
+        indices[i < npts-1 ? i+1 : 0] + vOffset));
+      }
+    }
+}
+
+// used to create an IBO for primatives as lines.  This method treats each line segment
+// as independent.  So for a triangle mesh you would get 6 verts per triangle
+// 3 edges * 2 verts each.  With a line loop you only get 3 verts so half the storage.
+// but... line loops are slower than line segments.
+size_t CreateTriangleLineIndexBuffer(vtkCellArray *cells, BufferObject &indexBuffer)
+{
+  if (!cells->GetNumberOfCells())
+    {
+    return 0;
+    }
+  std::vector<unsigned int> indexArray;
+  AppendTriangleLineIndexBuffer(indexArray, cells, 0);
+  indexBuffer.Upload(indexArray, vtkgl::BufferObject::ElementArrayBuffer);
+  return indexArray.size();
+}
+
+// used to create an IBO for stripped primatives such as lines and triangle strips
+size_t CreateMultiIndexBuffer(vtkCellArray *cells, BufferObject &indexBuffer,
+                              std::vector<GLintptr> &memoryOffsetArray,
+                              std::vector<unsigned int> &elementCountArray,
+                              bool wireframeTriStrips)
+{
+  if (!cells->GetNumberOfCells())
+    {
+    return 0;
+    }
+  vtkIdType      *pts = 0;
+  vtkIdType      npts = 0;
+  std::vector<unsigned int> indexArray;
+  memoryOffsetArray.clear();
+  elementCountArray.clear();
+  unsigned int count = 0;
+  indexArray.reserve(cells->GetData()->GetSize());
+  for (cells->InitTraversal(); cells->GetNextCell(npts,pts); )
+    {
+    memoryOffsetArray.push_back(count*sizeof(unsigned int));
+    for (int j = 0; j < npts; ++j)
+      {
+      indexArray.push_back(static_cast<unsigned int>(pts[j]));
+      count++;
+      }
+    if (wireframeTriStrips)
+      {
+      for (int j = (npts-1)/2; j >= 0; j--)
+        {
+        indexArray.push_back(static_cast<unsigned int>(pts[j*2]));
+        count++;
+        }
+      for (int j = 1; j < (npts/2)*2; j += 2)
+        {
+        indexArray.push_back(static_cast<unsigned int>(pts[j]));
+        count++;
+        }
+      npts *= 2;
+      }
+    elementCountArray.push_back(npts);
+    }
+  indexBuffer.Upload(indexArray, vtkgl::BufferObject::ElementArrayBuffer);
+  return indexArray.size();
+}
+
+// used to create an IBO for polys in wireframe with edge flags
+size_t CreateEdgeFlagIndexBuffer(vtkCellArray *cells, BufferObject &indexBuffer,
+                                 vtkDataArray *ef)
+{
+  if (!cells->GetNumberOfCells())
+    {
+    return 0;
+    }
+  vtkIdType      *pts = 0;
+  vtkIdType      npts = 0;
+  std::vector<unsigned int> indexArray;
+  unsigned char *ucef = NULL;
+  ucef = vtkUnsignedCharArray::SafeDownCast(ef)->GetPointer(0);
+  indexArray.reserve(cells->GetData()->GetSize()*2);
+  for (cells->InitTraversal(); cells->GetNextCell(npts,pts); )
+    {
+    for (int j = 0; j < npts; ++j)
+      {
+      if (ucef[pts[j]] && npts > 1) // draw this edge and poly is not degenerate
+        {
+        // determine the ending vertex
+        vtkIdType nextVert = (j == npts-1) ? pts[0] : pts[j+1];
+        indexArray.push_back(static_cast<unsigned int>(pts[j]));
+        indexArray.push_back(static_cast<unsigned int>(nextVert));
+        }
+      }
+    }
+  indexBuffer.Upload(indexArray, vtkgl::BufferObject::ElementArrayBuffer);
+  return indexArray.size();
+}
+
+// Create supporting arays that are needed when rendering cell data
+// With cell data we have to duplicate any shared vertices
+// and then later map the original cell point indices to the new
+// duplicated vertices. The following code fills in
+//
+//   cellPointMap which maps a point index to the original
+//     point index it came from. For the original points this
+//     is just a 1 to 1 mapping, but for any shared points
+//     there will be new entries that point to the original index
+//
+//   pointCellMap which maps point indices to the cells they belong to
+//
+//   prims new cell arrays that have cells with no shared points.
+//
+void CreateCellSupportArrays(vtkPolyData *poly, vtkCellArray *prims[4],
+                             std::vector<unsigned int> &cellPointMap,
+                             std::vector<unsigned int> &pointCellMap)
+{
+  vtkCellArray *newPrims[4];
+
+  // need an array to track what points have already been used
+  cellPointMap.resize(prims[0]->GetSize() +
+                       prims[1]->GetSize() +
+                       prims[2]->GetSize() +
+                       prims[3]->GetSize(), 0);
+  // need an array to track what cells the points are part of
+  pointCellMap.resize(prims[0]->GetSize() +
+                     prims[1]->GetSize() +
+                     prims[2]->GetSize() +
+                     prims[3]->GetSize(), 0);
+  vtkIdType* indices(NULL);
+  vtkIdType npts(0);
+  unsigned int nextId = poly->GetPoints()->GetNumberOfPoints();
+  // make sure we have at least Num Points entries
+  if (cellPointMap.size() < nextId)
+    {
+      cellPointMap.resize(nextId);
+      pointCellMap.resize(nextId);
+    }
+
+  unsigned int cellCount = 0;
+  for (int primType = 0; primType < 4; primType++)
+    {
+    newPrims[primType] = vtkCellArray::New();
+    for (prims[primType]->InitTraversal(); prims[primType]->GetNextCell(npts, indices); )
+      {
+      newPrims[primType]->InsertNextCell(npts);
+
+      for (int i=0; i < npts; ++i)
+        {
+        // point not used yet?
+        if (cellPointMap[indices[i]] == 0)
+          {
+          cellPointMap[indices[i]] =  indices[i] + 1;
+          newPrims[primType]->InsertCellPoint(indices[i]);
+          pointCellMap[indices[i]] = cellCount;
+          }
+        // point used, need new point
+        else
+          {
+          // might be beyond the current allocation
+          if (nextId >= cellPointMap.size())
+            {
+            cellPointMap.resize(nextId*1.5);
+            pointCellMap.resize(nextId*1.5);
+            }
+          cellPointMap[nextId] = indices[i] + 1;
+          newPrims[primType]->InsertCellPoint(nextId);
+          pointCellMap[nextId] = cellCount;
+          nextId++;
+          }
+        }
+        cellCount++;
+      } // for cell
+
+    prims[primType] = newPrims[primType];
+    } // for primType
+
+  cellPointMap.resize(nextId);
+  pointCellMap.resize(nextId);
+}
+
+
+
+void CellBO::ReleaseGraphicsResources(vtkWindow * vtkNotUsed(win))
+{
+  if (this->Program)
+    {
+    // Let ShaderCache release the graphics resources as it is
+    // responsible for creation and deletion.
+    this->Program = 0;
+    }
+  this->ibo.ReleaseGraphicsResources();
+  this->vao.ReleaseGraphicsResources();
+  this->offsetArray.clear();
+  this->elementsArray.clear();
+}
+
+}
diff --git a/Rendering/OpenGL2/vtkglVBOHelper.h b/Rendering/OpenGL2/vtkglVBOHelper.h
new file mode 100644
index 0000000..08d3b6d
--- /dev/null
+++ b/Rendering/OpenGL2/vtkglVBOHelper.h
@@ -0,0 +1,151 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+
+  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.
+
+=========================================================================*/
+
+#ifndef vtkGLVBOHelpher_h
+#define vtkGLVBOHelpher_h
+
+#include "vtkRenderingOpenGL2Module.h" // for export macro
+
+#include "vtkglBufferObject.h"
+#include "vtkglVertexArrayObject.h"
+
+#include "vtk_glew.h" // used for struct ivars
+#include <vector> // used for struct ivars
+#include "vtkTimeStamp.h" // used for struct ivars
+
+class vtkCellArray;
+class vtkPoints;
+class vtkDataArray;
+class vtkPolyData;
+class vtkOpenGLShaderCache;
+class vtkWindow;
+
+namespace vtkgl
+{
+
+// Process the string, and return a version with replacements.
+std::string VTKRENDERINGOPENGL2_EXPORT replace(std::string source,
+  const std::string &search,
+  const std::string replace, bool all = true);
+
+// perform in place string substitutions, indicate if a substitution was done
+bool VTKRENDERINGOPENGL2_EXPORT substitute(std::string &source,
+  const std::string &search,
+  const std::string replace, bool all = true);
+
+// used to create an IBO for triangle primatives
+size_t CreateTriangleIndexBuffer(vtkCellArray *cells,
+  BufferObject &indexBuffer,
+  vtkPoints *points, std::vector<unsigned int> &cellPointMap);
+
+// used to create an IBO for triangle primatives
+void AppendTriangleIndexBuffer(
+  std::vector<unsigned int> &indexArray,
+  vtkCellArray *cells,
+  vtkPoints *points,
+  std::vector<unsigned int> &cellPointMap,
+  vtkIdType vertexOffset);
+
+// create a IBO for wireframe polys/tris
+size_t CreateTriangleLineIndexBuffer(vtkCellArray *cells,
+  BufferObject &indexBuffer);
+
+// create a IBO for wireframe polys/tris
+void AppendTriangleLineIndexBuffer(
+  std::vector<unsigned int> &indexArray,
+  vtkCellArray *cells,
+  vtkIdType vertexOffset);
+
+// used to create an IBO for primatives as points
+size_t CreatePointIndexBuffer(vtkCellArray *cells, BufferObject &indexBuffer);
+
+// used to create an IBO for primatives as points
+void AppendPointIndexBuffer(
+  std::vector<unsigned int> &indexArray,
+  vtkCellArray *cells,
+  vtkIdType vertexOffset);
+
+// used to create an IBO for line strips and triangle strips
+size_t CreateMultiIndexBuffer(vtkCellArray *cells, BufferObject &indexBuffer,
+                              std::vector<GLintptr> &memoryOffsetArray,
+                              std::vector<unsigned int> &elementCountArray,
+                              bool wireframeTriStrips);
+
+// special index buffer for polys wireframe with edge visibilityflags
+size_t CreateEdgeFlagIndexBuffer(vtkCellArray *cells, BufferObject &indexBuffer,
+                                 vtkDataArray *edgeflags);
+
+// Store the shaders, program, and ibo in a common struct.
+class VTKRENDERINGOPENGL2_EXPORT CellBO
+{
+public:
+  vtkShaderProgram *Program;
+  BufferObject ibo;
+  VertexArrayObject vao;
+  vtkTimeStamp ShaderSourceTime;
+
+  size_t indexCount;
+  // These are client side objects for multi draw where IBOs are not used.
+  std::vector<GLintptr> offsetArray;
+  std::vector<unsigned int> elementsArray;
+
+  vtkTimeStamp attributeUpdateTime;
+
+  CellBO() {this->Program = NULL; };
+  void ReleaseGraphicsResources(vtkWindow *win);
+};
+
+// Sizes/offsets are all in bytes as OpenGL API expects them.
+struct VBOLayout
+{
+  size_t VertexCount; // Number of vertices in the VBO
+  int Stride;       // The size of a complete vertex + attributes
+  int VertexOffset; // Offset of the vertex
+  int NormalOffset; // Offset of the normal
+  int TCoordOffset; // Offset of the texture coordinates
+  int TCoordComponents; // Number of texture dimensions
+  int ColorOffset;  // Offset of the color
+  int ColorComponents; // Number of color components
+  std::vector<float> PackedVBO; // the data
+};
+
+// Take the points, and pack them into the VBO object supplied. This currently
+// takes whatever the input type might be and packs them into a VBO using
+// floats for the vertices and normals, and unsigned char for the colors (if
+// the array is non-null).
+VBOLayout CreateVBO(vtkPoints *points, unsigned int numPoints,
+    vtkDataArray *normals,
+    vtkDataArray *tcoords,
+    unsigned char *colors, int colorComponents,
+    BufferObject &vertexBuffer,
+    unsigned int *cellPointMap, unsigned int *pointCellMap,
+    bool cellScalars, bool cellNormals);
+void AppendVBO(VBOLayout &layout, vtkPoints *points, unsigned int numPoints,
+    vtkDataArray *normals,
+    vtkDataArray *tcoords,
+    unsigned char *colors, int colorComponents,
+    unsigned int *cellPointMap, unsigned int *pointCellMap,
+    bool cellScalars, bool cellNormals);
+
+
+// used to create an IBO for stripped primatives such as lines and strips
+void CreateCellSupportArrays(vtkPolyData *poly, vtkCellArray *[4],
+                             std::vector<unsigned int> &cellPointMap,
+                             std::vector<unsigned int> &pointCellMap);
+
+} // End namespace
+
+#endif // vtkGLVBOHelpher_h
+
+// VTK-HeaderTest-Exclude: vtkglVBOHelper.h
diff --git a/Rendering/OpenGL2/vtkglVertexArrayObject.cxx b/Rendering/OpenGL2/vtkglVertexArrayObject.cxx
new file mode 100644
index 0000000..f7d7ddb
--- /dev/null
+++ b/Rendering/OpenGL2/vtkglVertexArrayObject.cxx
@@ -0,0 +1,447 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+
+  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 "vtkglVertexArrayObject.h"
+#include "vtk_glew.h"
+
+#include "vtkOpenGLRenderWindow.h"
+#include "vtkglBufferObject.h"
+#include "vtkShaderProgram.h"
+
+#include <map>
+#include <vector>
+
+namespace vtkgl
+{
+
+namespace
+{
+// Copied from vtkglShaderProgram, time to move into a common header?
+inline GLenum convertTypeToGL(int type)
+{
+  switch (type)
+    {
+    case VTK_CHAR:
+      return GL_BYTE;
+    case VTK_UNSIGNED_CHAR:
+      return GL_UNSIGNED_BYTE;
+    case VTK_SHORT:
+      return GL_SHORT;
+    case VTK_UNSIGNED_SHORT:
+      return GL_UNSIGNED_SHORT;
+    case VTK_INT:
+      return GL_INT;
+    case VTK_UNSIGNED_INT:
+      return GL_UNSIGNED_INT;
+    case VTK_FLOAT:
+      return GL_FLOAT;
+    case VTK_DOUBLE:
+#ifdef GL_DOUBLE
+      return GL_DOUBLE;
+#else
+      vtkGenericWarningMacro(<< "Attempt to use GL_DOUBLE when not supported");
+      return 0;
+#endif
+    default:
+      return 0;
+    }
+}
+}
+
+struct VertexAttributes
+{
+  GLint index;
+  GLint  size;
+  GLenum type;
+  GLboolean normalize;
+  GLsizei stride;
+  GLuint offset;
+  int divisor;
+  bool isMatrix;
+};
+
+class VertexArrayObject::Private
+{
+public:
+  Private() : handleVAO(0), handleProgram(0), supported(true)
+  {
+    this->ForceEmulation = false;
+  }
+  ~Private()
+  {
+    if (this->handleVAO)
+      {
+      glDeleteVertexArrays(1, &this->handleVAO);
+      }
+  }
+
+  void Initialize()
+  {
+    if (!this->ForceEmulation && GLEW_ARB_vertex_array_object)
+      {
+      this->supported = true;
+      glGenVertexArrays(1, &this->handleVAO);
+      }
+    else
+      {
+      this->supported = false;
+      }
+  }
+
+  bool IsReady() const
+  {
+    // We either probed and allocated a VAO, or are falling back as the current
+    // hardware does not support VAOs.
+    return (this->handleVAO != 0 || this->supported == false);
+  }
+
+  void ReleaseGraphicsResources()
+  {
+    if (this->handleVAO)
+      {
+      glDeleteVertexArrays(1, &this->handleVAO);
+      }
+    this->handleVAO = 0;
+    this->supported = true;
+    this->handleProgram = 0;
+  }
+
+  GLuint handleVAO;
+  GLuint handleProgram;
+  bool supported;
+  bool ForceEmulation;
+
+  typedef std::map< GLuint, std::vector<VertexAttributes> > AttributeMap;
+  AttributeMap attributes;
+};
+
+#define BUFFER_OFFSET(i) ((char *)NULL + (i))
+
+VertexArrayObject::VertexArrayObject() : d(new Private)
+{
+}
+
+VertexArrayObject::~VertexArrayObject()
+{
+  delete d;
+}
+
+void VertexArrayObject::SetForceEmulation(bool val)
+{
+  this->d->ForceEmulation = val;
+}
+
+void VertexArrayObject::Bind()
+{
+  // Either simply bind the VAO, or emulate behavior by binding all attributes.
+  if (!this->d->IsReady())
+    {
+    this->d->Initialize();
+    }
+  if (this->d->IsReady() && this->d->supported)
+    {
+    glBindVertexArray(this->d->handleVAO);
+    }
+  else if (this->d->IsReady())
+    {
+    Private::AttributeMap::const_iterator it;
+    for (it = this->d->attributes.begin(); it != this->d->attributes.end();
+         ++it)
+      {
+      std::vector<VertexAttributes>::const_iterator attrIt;
+      glBindBuffer(GL_ARRAY_BUFFER, it->first);
+      for (attrIt = it->second.begin(); attrIt != it->second.end(); ++attrIt)
+        {
+        int matrixCount = attrIt->isMatrix ? attrIt->size : 1;
+        for (int i = 0; i < matrixCount; ++i)
+          {
+          glEnableVertexAttribArray(attrIt->index+i);
+          glVertexAttribPointer(attrIt->index+i, attrIt->size, attrIt->type,
+                                attrIt->normalize, attrIt->stride,
+                                BUFFER_OFFSET(attrIt->offset + attrIt->stride*i/attrIt->size));
+          if (attrIt->divisor > 0)
+            {
+#if GL_ES_VERSION_2_0 != 1 || GL_ES_VERSION_3_0 == 1
+#if GL_ES_VERSION_3_0 == 1
+            glVertexAttribDivisor(attrIt->index+i, 1);
+#else
+            if (vtkOpenGLRenderWindow::GetContextSupportsOpenGL32())
+              {
+              glVertexAttribDivisor(attrIt->index+i, 1);
+              }
+            else if (GLEW_ARB_instanced_arrays)
+              {
+              glVertexAttribDivisorARB(attrIt->index+i, 1);
+              }
+#endif
+#endif
+            }
+          }
+        }
+      glBindBuffer(GL_ARRAY_BUFFER, 0);
+      }
+    }
+}
+
+void VertexArrayObject::Release()
+{
+  if (this->d->IsReady() && this->d->supported)
+    {
+    glBindVertexArray(0);
+    }
+  else if (this->d->IsReady())
+    {
+    Private::AttributeMap::const_iterator it;
+    for (it = this->d->attributes.begin(); it != this->d->attributes.end();
+         ++it)
+      {
+      std::vector<VertexAttributes>::const_iterator attrIt;
+      for (attrIt = it->second.begin(); attrIt != it->second.end(); ++attrIt)
+        {
+        int matrixCount = attrIt->isMatrix ? attrIt->size : 1;
+        for (int i = 0; i < matrixCount; ++i)
+          {
+          if (attrIt->divisor > 0)
+            {
+#if GL_ES_VERSION_2_0 != 1 || GL_ES_VERSION_3_0 == 1
+#if GL_ES_VERSION_3_0 == 1
+            glVertexAttribDivisor(attrIt->index+i, 0);
+#else
+            if (vtkOpenGLRenderWindow::GetContextSupportsOpenGL32())
+              {
+              glVertexAttribDivisor(attrIt->index+i, 0);
+              }
+            else if (GLEW_ARB_instanced_arrays)
+              {
+              glVertexAttribDivisorARB(attrIt->index+i, 0);
+              }
+#endif
+#endif
+            }
+          glDisableVertexAttribArray(attrIt->index+i);
+          }
+        }
+      }
+    }
+}
+
+void VertexArrayObject::ShaderProgramChanged()
+{
+  this->Release();
+
+  Private::AttributeMap::iterator it;
+  for (it = this->d->attributes.begin(); it != this->d->attributes.end();
+       ++it)
+    {
+    it->second.clear();
+    }
+  this->d->attributes.clear();
+
+  this->d->handleProgram = 0;
+}
+
+void VertexArrayObject::ReleaseGraphicsResources()
+{
+  this->ShaderProgramChanged();
+  this->d->ReleaseGraphicsResources();
+}
+
+bool VertexArrayObject::AddAttributeArrayWithDivisor(vtkShaderProgram *program,
+                                          BufferObject &buffer,
+                                          const std::string &name,
+                                          int offset, size_t stride,
+                                          int elementType, int elementTupleSize,
+                                          bool normalize,
+                                          int divisor, bool isMatrix)
+{
+  // Check the program is bound, and the buffer is valid.
+  if (!program->isBound() || buffer.GetHandle() == 0 ||
+      buffer.GetType() != BufferObject::ArrayBuffer)
+    {
+    return false;
+    }
+
+  // Perform initalization if necessary, ensure program matches VAOs.
+  if (this->d->handleProgram == 0)
+    {
+    this->d->handleProgram = static_cast<GLuint>(program->GetHandle());
+    }
+  if (!this->d->IsReady() ||
+      this->d->handleProgram != static_cast<GLuint>(program->GetHandle()))
+    {
+    return false;
+    }
+
+  const GLchar *namePtr = static_cast<const GLchar *>(name.c_str());
+  VertexAttributes attribs;
+  attribs.index = glGetAttribLocation(this->d->handleProgram, namePtr);
+  attribs.offset = offset;
+  attribs.stride = static_cast<GLsizei>(stride);
+  attribs.type = convertTypeToGL(elementType);
+  attribs.size = elementTupleSize;
+  attribs.normalize = normalize;
+  attribs.isMatrix = isMatrix;
+  attribs.divisor = divisor;
+
+  if (attribs.index == -1)
+    {
+    return false;
+    }
+
+  // Always make the call as even the first use wants the attrib pointer setting
+  // up when we are emulating.
+  glEnableVertexAttribArray(attribs.index);
+  glVertexAttribPointer(attribs.index, attribs.size, attribs.type,
+                        attribs.normalize, attribs.stride,
+                        BUFFER_OFFSET(attribs.offset));
+
+
+  if (divisor > 0)
+    {
+#if GL_ES_VERSION_2_0 != 1 || GL_ES_VERSION_3_0 == 1
+#if GL_ES_VERSION_3_0 == 1
+    glVertexAttribDivisor(attribs.index, 1);
+#else
+    if (vtkOpenGLRenderWindow::GetContextSupportsOpenGL32())
+      {
+      glVertexAttribDivisor(attribs.index, 1);
+      }
+    else if (GLEW_ARB_instanced_arrays)
+      {
+      glVertexAttribDivisorARB(attribs.index, 1);
+      }
+#endif
+#endif
+    }
+
+  // If vertex array objects are not supported then build up our list.
+  if (!this->d->supported)
+    {
+    GLuint handleBuffer = buffer.GetHandle();
+    Private::AttributeMap::iterator it = this->d->attributes.find(handleBuffer);
+    if (it != this->d->attributes.end())
+      {
+      std::vector<VertexAttributes> &attribsVector = it->second;
+      std::vector<VertexAttributes>::iterator it2;
+      for (it2 = attribsVector.begin(); it2 != attribsVector.end(); ++it2)
+        {
+        if (it2->index == attribs.index)
+          {
+          *it2 = attribs;
+          return true;
+          }
+        }
+      // Attribute not found, add it.
+      attribsVector.push_back(attribs);
+      }
+    else
+      {
+      // a single handle can have multiple attribs
+      std::vector<VertexAttributes> attribsVector;
+      attribsVector.push_back(attribs);
+      this->d->attributes[handleBuffer] = attribsVector;
+      }
+    }
+
+  return true;
+}
+
+bool VertexArrayObject::AddAttributeMatrixWithDivisor(vtkShaderProgram *program,
+                                          BufferObject &buffer,
+                                          const std::string &name,
+                                          int offset, size_t stride,
+                                          int elementType, int elementTupleSize,
+                                          bool normalize,
+                                          int divisor)
+{
+  // bind the first row of values
+  bool result =
+    this->AddAttributeArrayWithDivisor(program, buffer, name,
+      offset, stride, elementType, elementTupleSize, normalize, divisor, true);
+
+  if (!result)
+    {
+    return result;
+    }
+
+  const GLchar *namePtr = static_cast<const GLchar *>(name.c_str());
+  VertexAttributes attribs;
+  attribs.index = glGetAttribLocation(this->d->handleProgram, namePtr);
+
+  for (int i = 1; i < elementTupleSize; i++)
+    {
+    glEnableVertexAttribArray(attribs.index+i);
+    glVertexAttribPointer(attribs.index + i, elementTupleSize, convertTypeToGL(elementType),
+                          normalize, static_cast<GLsizei>(stride),
+                          BUFFER_OFFSET(offset + stride*i/elementTupleSize));
+    if (divisor > 0)
+      {
+#if GL_ES_VERSION_2_0 != 1 || GL_ES_VERSION_3_0 == 1
+#if GL_ES_VERSION_3_0 == 1
+      glVertexAttribDivisor(attribs.index+i, 1);
+#else
+      if (vtkOpenGLRenderWindow::GetContextSupportsOpenGL32())
+        {
+        glVertexAttribDivisor(attribs.index+i, 1);
+        }
+      else if (GLEW_ARB_instanced_arrays)
+        {
+        glVertexAttribDivisorARB(attribs.index+i, 1);
+       }
+#endif
+#endif
+      }
+    }
+
+  return true;
+}
+
+bool VertexArrayObject::RemoveAttributeArray(const std::string &name)
+{
+  if (!this->d->IsReady() || this->d->handleProgram == 0)
+    {
+    return false;
+    }
+
+  const GLchar *namePtr = static_cast<const GLchar *>(name.c_str());
+  GLint location = glGetAttribLocation(this->d->handleProgram, namePtr);
+  if (location == -1)
+    {
+    return false;
+    }
+
+  glDisableVertexAttribArray(location);
+  // If we don't have real VAOs find the entry and remove it too.
+  if (!this->d->supported)
+    {
+    Private::AttributeMap::iterator it;
+    for (it = this->d->attributes.begin(); it != this->d->attributes.end();
+         ++it)
+      {
+      std::vector<VertexAttributes>::iterator attrIt;
+      for (attrIt = it->second.begin(); attrIt != it->second.end(); ++attrIt)
+        {
+        if (attrIt->index == location)
+          {
+          it->second.erase(attrIt);
+          return true;
+          }
+        }
+      }
+    }
+
+  return true;
+}
+
+} // End of vtkgl namespace
diff --git a/Rendering/OpenGL2/vtkglVertexArrayObject.h b/Rendering/OpenGL2/vtkglVertexArrayObject.h
new file mode 100644
index 0000000..9288733
--- /dev/null
+++ b/Rendering/OpenGL2/vtkglVertexArrayObject.h
@@ -0,0 +1,85 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+
+  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.
+
+=========================================================================*/
+#ifndef vtkglVertexArrayObject_h
+#define vtkglVertexArrayObject_h
+
+#include "vtkRenderingOpenGL2Module.h"
+#include <string> // For API.
+
+class vtkShaderProgram;
+
+namespace vtkgl
+{
+class BufferObject;
+
+/**
+ * @brief The VertexArrayObject class uses, or emulates, vertex array objects.
+ * These are extremely useful for setup/tear down of vertex attributes, and can
+ * offer significant performance benefits when the hardware supports them.
+ *
+ * It should be noted that this object is very lightweight, and it assumes the
+ * objects being used are correctly set up. Even without support for VAOs this
+ * class caches the array locations, types, etc and avoids repeated look ups. It
+ * it bound to a single ShaderProgram object.
+ */
+
+class VTKRENDERINGOPENGL2_EXPORT VertexArrayObject
+{
+public:
+  VertexArrayObject();
+  ~VertexArrayObject();
+
+  void Bind();
+
+  void Release();
+
+  void ReleaseGraphicsResources();
+
+  void ShaderProgramChanged();
+
+  bool AddAttributeArray(vtkShaderProgram *program, BufferObject &buffer,
+                         const std::string &name, int offset, size_t stride,
+                         int elementType, int elementTupleSize, bool normalize)
+    {
+    return this->AddAttributeArrayWithDivisor(program, buffer, name,
+      offset,stride,elementType, elementTupleSize, normalize, 0, false);
+    }
+
+  bool AddAttributeArrayWithDivisor(vtkShaderProgram *program, BufferObject &buffer,
+                         const std::string &name, int offset, size_t stride,
+                         int elementType, int elementTupleSize, bool normalize,
+                         int divisor, bool isMatrix);
+
+  bool AddAttributeMatrixWithDivisor(vtkShaderProgram *program, BufferObject &buffer,
+                         const std::string &name, int offset, size_t stride,
+                         int elementType, int elementTupleSize, bool normalize,
+                         int divisor);
+
+  bool RemoveAttributeArray(const std::string &name);
+
+  // Force this VAO to emulate a vertex aray object even if
+  // the system supports VAOs. This can be useful in cases where
+  // the vertex array object does not handle all extensions.
+  void SetForceEmulation(bool val);
+
+private:
+  class Private;
+  Private *d;
+};
+
+} // End of vtkgl namespace
+
+#endif // vtkglVertexArrayObject_h
+
+// VTK-HeaderTest-Exclude: vtkglVertexArrayObject.h
diff --git a/Rendering/Parallel/CMakeLists.txt b/Rendering/Parallel/CMakeLists.txt
index 0d27009..42baa0b 100644
--- a/Rendering/Parallel/CMakeLists.txt
+++ b/Rendering/Parallel/CMakeLists.txt
@@ -47,7 +47,7 @@ set_source_files_properties(
   )
 
 if("${VTK_RENDERING_BACKEND}" STREQUAL "OpenGL2")
-  add_definitions(-DVTK_OPENGL2)
+  add_definitions(-DVTKGL2)
 endif()
 
 vtk_module_library(vtkRenderingParallel ${Module_SRCS})
diff --git a/Rendering/Parallel/Testing/Cxx/TestClientServerRendering.cxx b/Rendering/Parallel/Testing/Cxx/TestClientServerRendering.cxx
index 4467e14..02187e2 100644
--- a/Rendering/Parallel/Testing/Cxx/TestClientServerRendering.cxx
+++ b/Rendering/Parallel/Testing/Cxx/TestClientServerRendering.cxx
@@ -62,6 +62,7 @@ class MyProcess : public vtkObject
 {
 public:
   static MyProcess *New();
+  vtkTypeMacro(MyProcess, vtkObject);
   vtkSetMacro(ImageReductionFactor, int);
   // Returns true on success.
   bool Execute(int argc, char** argv);
diff --git a/Rendering/Parallel/Testing/Cxx/TestDistributedDataCompositeZPass.cxx b/Rendering/Parallel/Testing/Cxx/TestDistributedDataCompositeZPass.cxx
index c97ecdd..e98ae4c 100644
--- a/Rendering/Parallel/Testing/Cxx/TestDistributedDataCompositeZPass.cxx
+++ b/Rendering/Parallel/Testing/Cxx/TestDistributedDataCompositeZPass.cxx
@@ -97,6 +97,7 @@ class MyProcess : public vtkProcess
 {
 public:
   static MyProcess *New();
+  vtkTypeMacro(MyProcess, vtkProcess);
 
   virtual void Execute();
 
diff --git a/Rendering/Parallel/Testing/Cxx/TestPCompositeZPass.cxx b/Rendering/Parallel/Testing/Cxx/TestPCompositeZPass.cxx
index c5ae7e2..1ca9255 100644
--- a/Rendering/Parallel/Testing/Cxx/TestPCompositeZPass.cxx
+++ b/Rendering/Parallel/Testing/Cxx/TestPCompositeZPass.cxx
@@ -97,6 +97,7 @@ class MyProcess : public vtkProcess
 {
 public:
   static MyProcess *New();
+  vtkTypeMacro(MyProcess, vtkProcess);
 
   virtual void Execute();
 
diff --git a/Rendering/Parallel/Testing/Cxx/TestPShadowMapPass.cxx b/Rendering/Parallel/Testing/Cxx/TestPShadowMapPass.cxx
index 2a550f7..ff56cdc 100644
--- a/Rendering/Parallel/Testing/Cxx/TestPShadowMapPass.cxx
+++ b/Rendering/Parallel/Testing/Cxx/TestPShadowMapPass.cxx
@@ -90,6 +90,7 @@ class MyProcess : public vtkProcess
 {
 public:
   static MyProcess *New();
+  vtkTypeMacro(MyProcess, vtkProcess);
 
   virtual void Execute();
 
diff --git a/Rendering/Parallel/Testing/Cxx/TestParallelRendering.cxx b/Rendering/Parallel/Testing/Cxx/TestParallelRendering.cxx
index b6035f6..60d4071 100644
--- a/Rendering/Parallel/Testing/Cxx/TestParallelRendering.cxx
+++ b/Rendering/Parallel/Testing/Cxx/TestParallelRendering.cxx
@@ -40,6 +40,7 @@ class MyProcess : public vtkProcess
 {
 public:
   static MyProcess *New();
+  vtkTypeMacro(MyProcess, vtkProcess);
 
   virtual void Execute();
 
diff --git a/Rendering/Parallel/Testing/Cxx/TestSimplePCompositeZPass.cxx b/Rendering/Parallel/Testing/Cxx/TestSimplePCompositeZPass.cxx
index 560ecc9..7017ea4 100644
--- a/Rendering/Parallel/Testing/Cxx/TestSimplePCompositeZPass.cxx
+++ b/Rendering/Parallel/Testing/Cxx/TestSimplePCompositeZPass.cxx
@@ -94,6 +94,7 @@ class MyProcess : public vtkProcess
 {
 public:
   static MyProcess *New();
+  vtkTypeMacro(MyProcess, vtkProcess);
 
   virtual void Execute();
 
diff --git a/Rendering/Parallel/vtkCompositeRGBAPass.cxx b/Rendering/Parallel/vtkCompositeRGBAPass.cxx
index 4344f35..7ff9976 100644
--- a/Rendering/Parallel/vtkCompositeRGBAPass.cxx
+++ b/Rendering/Parallel/vtkCompositeRGBAPass.cxx
@@ -48,9 +48,7 @@
 # include "vtkOpenGLState.h"
 #endif
 
-#ifdef VTK_OPENGL2
-# include "vtk_glew.h"
-#else
+#ifndef VTKGL2
 # include "vtkgl.h"
 # include "vtkOpenGLExtensionManager.h"
 #endif
@@ -94,7 +92,10 @@ vtkCompositeRGBAPass::~vtkCompositeRGBAPass()
      {
      vtkErrorMacro(<<"RootTexture should have been deleted in ReleaseGraphicsResources().");
     }
-   delete[] this->RawRGBABuffer;
+   if(this->RawRGBABuffer!=0)
+     {
+     delete[] this->RawRGBABuffer;
+     }
 }
 
 // ----------------------------------------------------------------------------
@@ -125,7 +126,7 @@ void vtkCompositeRGBAPass::PrintSelf(ostream& os, vtkIndent indent)
 // ----------------------------------------------------------------------------
 bool vtkCompositeRGBAPass::IsSupported(vtkOpenGLRenderWindow *context)
 {
-#ifdef VTK_OPENGL2
+#ifdef VTKGL2
   return (context != 0);
 #else
   vtkOpenGLExtensionManager *extmgr = context->GetExtensionManager();
@@ -354,38 +355,22 @@ void vtkCompositeRGBAPass::Render(const vtkRenderState *s)
       }
 #endif
 
-  // framebuffers have their color premultiplied by alpha.
-
-#ifdef VTK_OPENGL2
-    // save off current state of src / dst blend functions
-    GLint blendSrcA;
-    GLint blendDstA;
-    GLint blendSrcC;
-    GLint blendDstC;
-    glGetIntegerv(GL_BLEND_SRC_ALPHA, &blendSrcA);
-    glGetIntegerv(GL_BLEND_DST_ALPHA, &blendDstA);
-    glGetIntegerv(GL_BLEND_SRC_RGB, &blendSrcC);
-    glGetIntegerv(GL_BLEND_DST_RGB, &blendDstC);
-
-    glColorMask(GL_TRUE,GL_TRUE,GL_TRUE,GL_TRUE);
-
-    // per-fragment operations
-    glDisable(GL_DEPTH_TEST);
-    glDisable(GL_BLEND);
-    glBlendFuncSeparate(GL_ONE, GL_ONE_MINUS_SRC_ALPHA,
-                        GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
-#else
     glPushAttrib(GL_DEPTH_BUFFER_BIT|GL_COLOR_BUFFER_BIT|GL_LIGHTING);
     glColorMask(GL_TRUE,GL_TRUE,GL_TRUE,GL_TRUE);
 
     // per-fragment operations
+    glDisable(GL_ALPHA_TEST);
     glDisable(GL_STENCIL_TEST);
     glDisable(GL_DEPTH_TEST);
     glDisable(GL_BLEND);
-
-    glDisable(GL_ALPHA_TEST);
     glDisable(GL_INDEX_LOGIC_OP);
     glDisable(GL_COLOR_LOGIC_OP);
+
+    // framebuffers have their color premultiplied by alpha.
+#ifdef VTKGL2
+    glBlendFuncSeparate(GL_ONE, GL_ONE_MINUS_SRC_ALPHA,
+                        GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
+#else
     vtkgl::BlendFuncSeparate(GL_ONE,GL_ONE_MINUS_SRC_ALPHA,
                              GL_ONE,GL_ONE_MINUS_SRC_ALPHA);
     // fixed vertex shader
@@ -394,9 +379,9 @@ void vtkCompositeRGBAPass::Render(const vtkRenderState *s)
     // fixed fragment shader
     glEnable(GL_TEXTURE_2D);
     glDisable(GL_FOG);
-    glTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_REPLACE);
 #endif
 
+    glTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_REPLACE);
     glPixelStorei(GL_UNPACK_ALIGNMENT,1);// client to server
 
     // 2. if root is not farest, save it in a TO
@@ -449,26 +434,21 @@ void vtkCompositeRGBAPass::Render(const vtkRenderState *s)
         glEnable(GL_BLEND);
         blendingEnabled=true;
         }
-#ifdef VTK_OPENGL2
+#ifdef VTKGL2
       to->Activate();
       to->CopyToFrameBuffer(0, 0, w - 1, h - 1, 0, 0, w, h, NULL, NULL);
       to->Deactivate();
-      --procIndex;
-      }
-    // restore blend func
-    glBlendFuncSeparate(blendSrcC, blendDstC, blendSrcA, blendDstA);
 #else
       vtkgl::ActiveTexture(vtkgl::TEXTURE0);
       // fixed-pipeline for vertex and fragment shaders.
       to->Bind();
       to->CopyToFrameBuffer(0,0,w-1,h-1,0,0,w,h);
       to->UnBind();
+#endif
       --procIndex;
       }
     glPopAttrib();
-#endif
     frontToBackList->Delete();
-
 #ifdef VTK_COMPOSITE_RGBAPASS_DEBUG
     // get rgba-buffer of root before any blending with satellite
     // for debugging only.
diff --git a/Rendering/Parallel/vtkCompositeZPass.cxx b/Rendering/Parallel/vtkCompositeZPass.cxx
index 1a8e070..fde7c76 100644
--- a/Rendering/Parallel/vtkCompositeZPass.cxx
+++ b/Rendering/Parallel/vtkCompositeZPass.cxx
@@ -45,13 +45,12 @@
 # include "vtkOpenGLState.h"
 #endif
 
-#ifdef VTK_OPENGL2
+#ifdef VTKGL2
 # include "vtkOpenGLShaderCache.h"
 # include "vtkShaderProgram.h"
-# include "vtkOpenGLHelper.h"
+# include "vtkglVBOHelper.h"
 # include "vtkTextureObjectVS.h"
 # include "vtkCompositeZPassFS.h"
-# include "vtk_glew.h"
 #else
 # include "vtkgl.h"
 # include "vtkShaderProgram2.h"
@@ -93,14 +92,17 @@ vtkCompositeZPass::~vtkCompositeZPass()
     }
    if(this->Program!=0)
      {
-#ifdef VTK_OPENGL2
+#ifdef VTKGL2
      delete this->Program;
 #else
      this->Program->Delete();
 #endif
      this->Program = 0;
      }
-   delete[] this->RawZBuffer;
+   if(this->RawZBuffer!=0)
+     {
+     delete[] this->RawZBuffer;
+     }
 }
 
 // ----------------------------------------------------------------------------
@@ -122,7 +124,7 @@ void vtkCompositeZPass::PrintSelf(ostream& os, vtkIndent indent)
 // ----------------------------------------------------------------------------
 bool vtkCompositeZPass::IsSupported(vtkOpenGLRenderWindow *context)
 {
-#ifdef VTK_OPENGL2
+#ifdef VTKGL2
   return context != 0;
 #else
   return vtkFrameBufferObject::IsSupported(context)
@@ -161,7 +163,7 @@ void vtkCompositeZPass::Render(const vtkRenderState *s)
   vtkOpenGLRenderWindow *context=static_cast<vtkOpenGLRenderWindow *>(
     r->GetRenderWindow());
 
-#ifndef VTK_OPENGL2
+#ifndef VTKGL2
    // Test for Hardware support. If not supported, return.
   bool supported=vtkFrameBufferObject::IsSupported(context);
 
@@ -226,7 +228,7 @@ void vtkCompositeZPass::Render(const vtkRenderState *s)
   continuousInc[2]=0;
 
 
-  if(this->RawZBufferSize<static_cast<size_t>(w*h))
+  if(this->RawZBuffer!=0 && this->RawZBufferSize<static_cast<size_t>(w*h))
     {
     delete[] this->RawZBuffer;
     }
@@ -448,6 +450,13 @@ void vtkCompositeZPass::Render(const vtkRenderState *s)
       this->ZTexture->CreateDepth(dims[0],dims[1],vtkTextureObject::Native,
                                   this->PBO);
 
+      // Apply TO on quad with special zcomposite fragment shader.
+      glPushAttrib(GL_DEPTH_BUFFER_BIT|GL_COLOR_BUFFER_BIT);
+      glColorMask(GL_FALSE,GL_FALSE,GL_FALSE,GL_FALSE);
+      glEnable(GL_DEPTH_TEST);
+      glDepthMask(GL_TRUE);
+      glDepthFunc(GL_LEQUAL);
+
       if(this->Program==0)
         {
         this->CreateProgram(context);
@@ -457,24 +466,11 @@ void vtkCompositeZPass::Render(const vtkRenderState *s)
       cout << "sourceId=" << sourceId << endl;
 #endif
 
-#ifdef VTK_OPENGL2
-      // Apply TO on quad with special zcomposite fragment shader.
-      glColorMask(GL_FALSE,GL_FALSE,GL_FALSE,GL_FALSE);
-      glEnable(GL_DEPTH_TEST);
-      glDepthMask(GL_TRUE);
-      glDepthFunc(GL_LEQUAL);
-
-      context->GetShaderCache()->ReadyShaderProgram(this->Program->Program);
+#ifdef VTKGL2
+      context->GetShaderCache()->ReadyShader(this->Program->Program);
       this->ZTexture->Activate();
       this->Program->Program->SetUniformi("depth", this->ZTexture->GetTextureUnit());
 #else
-      // Apply TO on quad with special zcomposite fragment shader.
-      glPushAttrib(GL_DEPTH_BUFFER_BIT|GL_COLOR_BUFFER_BIT);
-      glColorMask(GL_FALSE,GL_FALSE,GL_FALSE,GL_FALSE);
-      glEnable(GL_DEPTH_TEST);
-      glDepthMask(GL_TRUE);
-      glDepthFunc(GL_LEQUAL);
-
       vtkTextureUnitManager *tu=context->GetTextureUnitManager();
       int sourceId=tu->Allocate();
 
@@ -498,11 +494,11 @@ void vtkCompositeZPass::Render(const vtkRenderState *s)
       outfile04.close();
 #endif
 
-#ifdef VTK_OPENGL2
+#ifdef VTKGL2
       this->ZTexture->CopyToFrameBuffer(0, 0, w - 1, h - 1,
                                         0, 0, w, h,
                                         this->Program->Program,
-                                        this->Program->VAO);
+                                        &this->Program->vao);
 #else
       this->ZTexture->Bind();
       this->ZTexture->CopyToFrameBuffer(0,0,
@@ -521,7 +517,7 @@ void vtkCompositeZPass::Render(const vtkRenderState *s)
       outfile05.close();
 #endif
 
-#ifdef VTK_OPENGL2
+#ifdef VTKGL2
       this->ZTexture->Deactivate();
 #else
       this->ZTexture->UnBind();
@@ -541,9 +537,7 @@ void vtkCompositeZPass::Render(const vtkRenderState *s)
       outfile06.close();
 #endif
 
-#ifndef VTK_OPENGL2
       glPopAttrib();
-#endif
 
 #ifdef VTK_COMPOSITE_ZPASS_DEBUG
       state->Update();
@@ -764,14 +758,14 @@ void vtkCompositeZPass::Render(const vtkRenderState *s)
       this->CreateProgram(context);
       }
 
-#ifdef VTK_OPENGL2
-    context->GetShaderCache()->ReadyShaderProgram(this->Program->Program);
+#ifdef VTKGL2
+    context->GetShaderCache()->ReadyShader(this->Program->Program);
     this->ZTexture->Activate();
     this->Program->Program->SetUniformi("depth", this->ZTexture->GetTextureUnit());
     this->ZTexture->CopyToFrameBuffer(0, 0, w - 1, h - 1,
                                       0, 0, w, h,
                                       this->Program->Program,
-                                      this->Program->VAO);
+                                      &this->Program->vao);
     this->ZTexture->Deactivate();
 #else
     vtkTextureUnitManager *tu=context->GetTextureUnitManager();
@@ -805,10 +799,10 @@ void vtkCompositeZPass::CreateProgram(vtkOpenGLRenderWindow *context)
   assert("pre: context_exists" && context!=0);
   assert("pre: Program_void" && this->Program==0);
 
-#ifdef VTK_OPENGL2
-  this->Program = new vtkOpenGLHelper;
+#ifdef VTKGL2
+  this->Program = new vtkgl::CellBO;
   this->Program->Program =
-    context->GetShaderCache()->ReadyShaderProgram(vtkTextureObjectVS,
+    context->GetShaderCache()->ReadyShader(vtkTextureObjectVS,
                                            vtkCompositeZPassFS,
                                            "");
   if (!this->Program->Program)
@@ -859,7 +853,7 @@ void vtkCompositeZPass::ReleaseGraphicsResources(vtkWindow *w)
     }
   if(this->Program!=0)
     {
-#ifdef VTK_OPENGL2
+#ifdef VTKGL2
     this->Program->ReleaseGraphicsResources(w);
 #else
     this->Program->ReleaseGraphicsResources();
diff --git a/Rendering/Parallel/vtkCompositeZPass.h b/Rendering/Parallel/vtkCompositeZPass.h
index 3e4c2ab..dea7a0a 100644
--- a/Rendering/Parallel/vtkCompositeZPass.h
+++ b/Rendering/Parallel/vtkCompositeZPass.h
@@ -36,8 +36,11 @@ class vtkMultiProcessController;
 class vtkPixelBufferObject;
 class vtkTextureObject;
 class vtkOpenGLRenderWindow;
-#ifdef VTK_OPENGL2
-class vtkOpenGLHelper;
+#ifdef VTKGL2
+namespace vtkgl
+{
+class CellBO;
+}
 #else
 class vtkShaderProgram2;
 #endif
@@ -91,8 +94,8 @@ public:
 
   vtkPixelBufferObject *PBO;
   vtkTextureObject *ZTexture;
-#ifdef VTK_OPENGL2
-  vtkOpenGLHelper *Program;
+#ifdef VTKGL2
+  vtkgl::CellBO *Program;
 #else
   vtkShaderProgram2 *Program;
 #endif
diff --git a/Rendering/Parallel/vtkSynchronizedRenderers.cxx b/Rendering/Parallel/vtkSynchronizedRenderers.cxx
index b4241b2..1f60711 100644
--- a/Rendering/Parallel/vtkSynchronizedRenderers.cxx
+++ b/Rendering/Parallel/vtkSynchronizedRenderers.cxx
@@ -30,7 +30,7 @@
 #include "vtkOpenGLRenderWindow.h"
 #include "vtkOpenGLError.h"
 
-#ifndef VTK_OPENGL2
+#ifndef VTKGL2
 # include "vtkgl.h"
 #endif
 
@@ -684,7 +684,7 @@ bool vtkSynchronizedRenderers::vtkRawImage::PushToFrameBuffer(vtkRenderer *ren)
 
   vtkOpenGLClearErrorMacro();
 
-#ifdef VTK_OPENGL2
+#ifdef VTKGL2
   // always draw the entire image on the entire viewport
   vtkOpenGLRenderWindow *renWin = vtkOpenGLRenderWindow::SafeDownCast(ren->GetVTKWindow());
   renWin->DrawPixels(this->GetWidth(), this->GetHeight(),
diff --git a/Rendering/Parallel/vtkSynchronizedRenderers.h b/Rendering/Parallel/vtkSynchronizedRenderers.h
index 85ab1d1..9e29ffb 100644
--- a/Rendering/Parallel/vtkSynchronizedRenderers.h
+++ b/Rendering/Parallel/vtkSynchronizedRenderers.h
@@ -226,7 +226,7 @@ protected:
   // Can be used in HandleEndRender(), MasterEndRender() or SlaveEndRender()
   // calls to paste back the image from either this->ReducedImage or
   // this->FullImage info the viewport.
-  virtual void PushImageToScreen();
+  void PushImageToScreen();
 
   vtkSynchronizedRenderers* CaptureDelegate;
   vtkRawImage ReducedImage;
diff --git a/Rendering/ParallelLIC/CMakeLists.txt b/Rendering/ParallelLIC/CMakeLists.txt
index f9dae15..8575596 100644
--- a/Rendering/ParallelLIC/CMakeLists.txt
+++ b/Rendering/ParallelLIC/CMakeLists.txt
@@ -7,6 +7,7 @@ set(Module_SRCS
   vtkPLineIntegralConvolution2D.cxx
   vtkPPainterCommunicator.cxx
   vtkPSurfaceLICComposite.cxx
+  vtkPSurfaceLICPainter.cxx
   ${CMAKE_CURRENT_BINARY_DIR}/vtkRenderingParallelLICObjectFactory.cxx
   )
 
@@ -38,26 +39,9 @@ if (VTK_RENDERINGPARALLELLIC_LINEINTEGRALCONVLOLUTION2D_TIMER)
   add_definitions("-DvtkLineIntegralConvolution2DTIME")
 endif()
 
-if(VTK_RENDERING_BACKEND STREQUAL "OpenGL2")
-  set_source_files_properties(
-    vtkPSurfaceLICComposite.cxx
-    PROPERTIES COMPILE_FLAGS -DVTK_OPENGL2)
-  list(APPEND Module_SRCS
-    vtkPSurfaceLICMapper.cxx
-    )
-  vtk_add_override(vtkSurfaceLICMapper vtkPSurfaceLICMapper)
-  set(shader_files
-    vtkPSurfaceLICComposite_CompFS.glsl
-    )
-else()
-  list(APPEND Module_SRCS
-    vtkPSurfaceLICPainter.cxx
-    )
-  vtk_add_override(vtkSurfaceLICPainter vtkPSurfaceLICPainter)
-  set(shader_files
-    vtkPSurfaceLICComposite_Comp.glsl
-    )
-endif()
+set(shader_files
+  vtkPSurfaceLICComposite_Comp.glsl
+  )
 
 unset(shader_h_files)
 foreach(file ${shader_files})
@@ -81,6 +65,7 @@ endforeach()
 
 vtk_add_override(vtkLineIntegralConvolution2D vtkPLineIntegralConvolution2D)
 vtk_add_override(vtkSurfaceLICComposite vtkPSurfaceLICComposite)
+vtk_add_override(vtkSurfaceLICPainter vtkPSurfaceLICPainter)
 vtk_object_factory_configure("${vtk_module_overrides}")
 
 include(vtkMPI)
diff --git a/Rendering/ParallelLIC/module.cmake b/Rendering/ParallelLIC/module.cmake
index 0edd188..4771a6b 100644
--- a/Rendering/ParallelLIC/module.cmake
+++ b/Rendering/ParallelLIC/module.cmake
@@ -1,12 +1,8 @@
-if(VTK_RENDERING_BACKEND STREQUAL "OpenGL2")
-  set(_imp_backend OpenGL2)
-endif()
-
 vtk_module(vtkRenderingParallelLIC
   IMPLEMENTS
-    vtkRenderingLIC${_imp_backend}
+    vtkRenderingLIC
   DEPENDS
-    vtkRendering${VTK_RENDERING_BACKEND}
+    vtkRenderingOpenGL
     vtkParallelMPI
     vtkIOLegacy
   KIT
diff --git a/Rendering/ParallelLIC/vtkPSurfaceLICComposite.cxx b/Rendering/ParallelLIC/vtkPSurfaceLICComposite.cxx
index a7c0ccf..0767d34 100644
--- a/Rendering/ParallelLIC/vtkPSurfaceLICComposite.cxx
+++ b/Rendering/ParallelLIC/vtkPSurfaceLICComposite.cxx
@@ -20,44 +20,19 @@
 #include "vtkPainterCommunicator.h"
 #include "vtkPPainterCommunicator.h"
 #include "vtkRenderWindow.h"
-#ifdef VTK_OPENGL2
-# include "vtkOpenGLRenderUtilities.h"
-#endif
 #include "vtkOpenGLRenderWindow.h"
 #include "vtkTextureObject.h"
 #include "vtkPixelBufferObject.h"
 #include "vtkFrameBufferObject2.h"
 #include "vtkRenderbuffer.h"
+#include "vtkShader2.h"
+#include "vtkShaderProgram2.h"
+#include "vtkUniformVariables.h"
+#include "vtkShader2Collection.h"
+#include "vtkOpenGLExtensionManager.h"
+#include "vtkgl.h"
 #include "vtkMPI.h"
 
-
-#ifdef VTK_OPENGL2
-# include "vtkOpenGLHelper.h"
-# include "vtkOpenGLShaderCache.h"
-# include "vtkShaderProgram.h"
-# include "vtkTextureObjectVS.h"
-# include "vtkPSurfaceLICComposite_CompFS.h"
-#else
-# include "vtkShader2.h"
-# include "vtkShaderProgram2.h"
-# include "vtkUniformVariables.h"
-# include "vtkShader2Collection.h"
-# include "vtkOpenGLExtensionManager.h"
-# include "vtkgl.h"
-// compositing shader
-extern const char *vtkPSurfaceLICComposite_Comp;
-# ifndef GL_FRAMEBUFFER
-#  define GL_FRAMEBUFFER vtkgl::FRAMEBUFFER_EXT
-# endif
-# ifndef GL_DRAW_FRAMEBUFFER
-#  define GL_DRAW_FRAMEBUFFER vtkgl::DRAW_FRAMEBUFFER_EXT
-# endif
-# ifndef GL_TEXTURE0
-#  define GL_TEXTURE0 vtkgl::TEXTURE0
-# endif
-#endif
-
-
 #include <list>
 #include <deque>
 #include <vector>
@@ -108,6 +83,9 @@ string mpifn(int rank, const char *fn)
 
 // #define DUPLICATE_COMMUNICATOR
 
+// compositing shader
+extern const char *vtkPSurfaceLICComposite_Comp;
+
 // ***************************************************************************
 static
 int maxNumPasses(){ return 100; }
@@ -336,12 +314,7 @@ vtkPSurfaceLICComposite::~vtkPSurfaceLICComposite()
   delete this->PixelOps;
   if (this->CompositeShader)
     {
-#ifdef VTK_OPENGL2
-    delete this->CompositeShader;
-#else
     this->CompositeShader->Delete();
-#endif
-    this->CompositeShader = 0;
     }
   if (this->FBO)
     {
@@ -376,12 +349,7 @@ void vtkPSurfaceLICComposite::SetContext(vtkOpenGLRenderWindow *rwin)
   // free the existing shader and fbo
   if ( this->CompositeShader )
     {
-#ifdef VTK_OPENGL2
-    this->CompositeShader->ReleaseGraphicsResources(rwin);
-    delete this->CompositeShader;
-#else
     this->CompositeShader->Delete();
-#endif
     this->CompositeShader = NULL;
     }
 
@@ -394,14 +362,6 @@ void vtkPSurfaceLICComposite::SetContext(vtkOpenGLRenderWindow *rwin)
   if ( this->Context )
     {
     // load, compile, and link the shader
-#ifdef VTK_OPENGL2
-    this->CompositeShader = new vtkOpenGLHelper;
-    std::string GSSource;
-    this->CompositeShader->Program =
-        rwin->GetShaderCache()->ReadyShaderProgram(vtkTextureObjectVS,
-                                          vtkPSurfaceLICComposite_CompFS,
-                                            GSSource.c_str());
-#else
     vtkShader2 *compositeShaderSrc = vtkShader2::New();
     compositeShaderSrc->SetContext(this->Context);
     compositeShaderSrc->SetType(VTK_SHADER_TYPE_FRAGMENT);
@@ -413,7 +373,6 @@ void vtkPSurfaceLICComposite::SetContext(vtkOpenGLRenderWindow *rwin)
     this->CompositeShader->Build();
 
     compositeShaderSrc->Delete();
-#endif
 
     // setup a FBO for rendering
     this->FBO = vtkFrameBufferObject2::New();
@@ -1406,16 +1365,16 @@ int vtkPSurfaceLICComposite::Gather(
     }
 
   this->FBO->SaveCurrentBindings();
-  this->FBO->Bind(GL_FRAMEBUFFER);
-  this->FBO->AddColorAttachment(GL_DRAW_FRAMEBUFFER, 0U, newImage);
+  this->FBO->Bind(vtkgl::FRAMEBUFFER_EXT);
+  this->FBO->AddColorAttachment(vtkgl::DRAW_FRAMEBUFFER_EXT, 0U, newImage);
   this->FBO->ActivateDrawBuffer(0U);
 
   vtkRenderbuffer *depthBuf = vtkRenderbuffer::New();
   depthBuf->SetContext(this->Context);
   depthBuf->CreateDepthAttachment(winExtSize[0], winExtSize[1]);
-  this->FBO->AddDepthAttachment(GL_DRAW_FRAMEBUFFER, depthBuf);
+  this->FBO->AddDepthAttachment(vtkgl::DRAW_FRAMEBUFFER_EXT, depthBuf);
 
-  vtkCheckFrameBufferStatusMacro(GL_FRAMEBUFFER);
+  vtkCheckFrameBufferStatusMacro(vtkgl::FRAMEBUFFER_EXT);
 
   // the LIC'er requires all fragments in the vector
   // texture to be initialized to 0
@@ -1425,14 +1384,9 @@ int vtkPSurfaceLICComposite::Gather(
   glClearColor(0.0, 0.0, 0.0, 0.0);
   glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);
 
-#ifdef VTK_OPENGL2
-  this->Context->GetShaderCache()->ReadyShaderProgram(
-    this->CompositeShader->Program);
-#else
   vtkUniformVariables *uniforms = this->CompositeShader->GetUniformVariables();
   uniforms->SetUniformit("texData", 0);
   this->CompositeShader->Use();
-#endif
 
   // overlap compositing of local data with communication
   for (int j=0; j<nTransactions; ++j)
@@ -1574,14 +1528,12 @@ int vtkPSurfaceLICComposite::Gather(
 
     tex->Delete();
     }
-#ifndef VTK_OPENGL2
   this->CompositeShader->Restore();
-#endif
 
   this->FBO->DeactivateDrawBuffers();
-  this->FBO->RemoveTexColorAttachment(GL_DRAW_FRAMEBUFFER, 0U);
-  this->FBO->RemoveRenDepthAttachment(GL_DRAW_FRAMEBUFFER);
-  this->FBO->UnBind(GL_FRAMEBUFFER);
+  this->FBO->RemoveTexColorAttachment(vtkgl::DRAW_FRAMEBUFFER_EXT, 0U);
+  this->FBO->RemoveRenDepthAttachment(vtkgl::DRAW_FRAMEBUFFER_EXT);
+  this->FBO->UnBind(vtkgl::FRAMEBUFFER_EXT);
   depthBuf->Delete();
 
   // wait for sends to complete
@@ -1605,6 +1557,8 @@ int vtkPSurfaceLICComposite::ExecuteShader(
       const vtkPixelExtent &ext,
       vtkTextureObject *tex)
 {
+  tex->Activate(vtkgl::TEXTURE0);
+
   // cell to node
   vtkPixelExtent next(ext);
   next.CellToNode();
@@ -1613,24 +1567,6 @@ int vtkPSurfaceLICComposite::ExecuteShader(
   next.GetData(fext);
 
   float tcoords[4] = {0.0f,1.0f, 0.0f,1.0f};
-
-#ifdef VTK_OPENGL2
-    tex->Activate();
-    this->CompositeShader->Program->SetUniformi("texData",
-      tex->GetTextureUnit());
-    // may beed to divide by winExtSize here
-    float verts[] = {
-      fext[0]*2.0-1.0, fext[2]*2.0-1.0, 0.0f,
-      fext[1]*2.0-1.0, fext[2]*2.0-1.0, 0.0f,
-      fext[1]*2.0-1.0, fext[3]*2.0-1.0, 0.0f,
-      fext[0]*2.0-1.0, fext[3]*2.0-1.0, 0.0f};
-
-    vtkOpenGLRenderUtilities::RenderQuad(verts, tcoords,
-      this->CompositeShader->Program, this->CompositeShader->VAO);
-    tex->Deactivate();
-#else
-  tex->Activate(GL_TEXTURE0);
-
   int ids[8] = {0,2, 1,2, 1,3, 0,3};
 
   glBegin(GL_QUADS);
@@ -1642,8 +1578,7 @@ int vtkPSurfaceLICComposite::ExecuteShader(
     }
   glEnd();
 
-  //tex->Deactivate(GL_TEXTURE0);
-#endif
+  //tex->Deactivate(vtkgl::TEXTURE0);
 
   return 0;
 }
diff --git a/Rendering/ParallelLIC/vtkPSurfaceLICComposite.h b/Rendering/ParallelLIC/vtkPSurfaceLICComposite.h
index e0bd0d8..9db5687 100644
--- a/Rendering/ParallelLIC/vtkPSurfaceLICComposite.h
+++ b/Rendering/ParallelLIC/vtkPSurfaceLICComposite.h
@@ -37,16 +37,11 @@ class vtkFloatArray;
 class vtkRenderWindow;
 class vtkFrameBufferObject2;
 class vtkTextureObject;
+class vtkShaderProgram2;
 class vtkPainterCommunicator;
 class vtkPPainterCommunicator;
 class vtkPPixelExtentOps;
 
-#ifdef VTK_OPENGL2
-class vtkOpenGLHelper;
-#else
-class vtkShaderProgram2;
-#endif
-
 class VTKRENDERINGPARALLELLIC_EXPORT vtkPSurfaceLICComposite : public vtkSurfaceLICComposite
 {
 public:
@@ -186,12 +181,7 @@ private:
 
   vtkWeakPointer<vtkOpenGLRenderWindow> Context; // rendering context
   vtkFrameBufferObject2 *FBO;                    // buffer object
-
-#ifdef VTK_OPENGL2
-  vtkOpenGLHelper *CompositeShader;
-#else
   vtkShaderProgram2 *CompositeShader;            // shader program for compositing
-#endif
 
   std::deque<vtkPPixelTransfer> GatherProgram;   // ordered steps required to move data to new decomp
   std::deque<vtkPPixelTransfer> ScatterProgram;  // ordered steps required to unmove data from new decomp
diff --git a/Rendering/ParallelLIC/vtkPSurfaceLICComposite_CompFS.glsl b/Rendering/ParallelLIC/vtkPSurfaceLICComposite_CompFS.glsl
deleted file mode 100644
index 442ada6..0000000
--- a/Rendering/ParallelLIC/vtkPSurfaceLICComposite_CompFS.glsl
+++ /dev/null
@@ -1,38 +0,0 @@
-//=========================================================================
-//
-//  Program:   Visualization Toolkit
-//  Module:    vtkSurfaceLICComposite_fs1.glsl
-//
-//  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.
-//
-//=========================================================================
-
-// This shader composites for surface lic
-// it expects float depth values encoded
-// in alpha channel.
-
-// The following line handles system declarations such as
-// default precisions, or defining precisions to null
-//VTK::System::Dec
-
-uniform sampler2D texData;
-
-varying vec2 tcoordVC;
-
-void main()
-{
-  vec4 newData = texture2D(texData, tcoordVC.st);
-  float newDepth = newData.a;
-  if (newDepth == 0.0)
-    {
-    discard;
-    }
-  gl_FragDepth = newDepth;
-  gl_FragData[0] = newData;
-}
diff --git a/Rendering/ParallelLIC/vtkPSurfaceLICMapper.cxx b/Rendering/ParallelLIC/vtkPSurfaceLICMapper.cxx
deleted file mode 100644
index 4ad416c..0000000
--- a/Rendering/ParallelLIC/vtkPSurfaceLICMapper.cxx
+++ /dev/null
@@ -1,172 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkPSurfaceLICMapper.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 "vtkPSurfaceLICMapper.h"
-
-#include "vtkObjectFactory.h"
-#include "vtkPainterCommunicator.h"
-#include "vtkPPainterCommunicator.h"
-#include "vtkMPI.h"
-#include "vtkParallelTimer.h"
-
-//----------------------------------------------------------------------------
-vtkStandardNewMacro(vtkPSurfaceLICMapper);
-
-//----------------------------------------------------------------------------
-vtkPSurfaceLICMapper::vtkPSurfaceLICMapper()
-{}
-
-//----------------------------------------------------------------------------
-vtkPSurfaceLICMapper::~vtkPSurfaceLICMapper()
-{
-  #ifdef vtkPSurfaceLICMapperDEBUG
-  cerr << "=====vtkPSurfaceLICMapper::~vtkPSurfaceLICMapper" << endl;
-  #endif
-}
-
-//----------------------------------------------------------------------------
-bool vtkPSurfaceLICMapper::NeedToUpdateCommunicator()
-{
-  // TODO -- with slice widget in PV the input dataset
-  // MTime is changing at different rates on different
-  // MPI ranks. Because of this some ranks want to update
-  // there comunicator while other do not. To work around
-  // this force the communicator update on all ranks if any
-  // rank will update it.
-
-  int updateComm = this->Superclass::NeedToUpdateCommunicator() ? 1 : 0;
-
-  vtkMPICommunicatorOpaqueComm *globalComm
-    = vtkPPainterCommunicator::GetGlobalCommunicator();
-
-  if (globalComm)
-    {
-    MPI_Allreduce(
-         MPI_IN_PLACE,
-         &updateComm,
-         1,
-         MPI_INT,
-         MPI_MAX,
-         *globalComm->GetHandle());
-
-    if (updateComm != 0)
-      {
-      this->SetUpdateAll();
-      }
-    }
-
-  return updateComm != 0;
-}
-
-// ----------------------------------------------------------------------------
-void vtkPSurfaceLICMapper::GetGlobalMinMax(
-      vtkPainterCommunicator *painterComm,
-      float &min,
-      float &max)
-{
-  vtkPPainterCommunicator *pPainterComm
-    = dynamic_cast<vtkPPainterCommunicator*>(painterComm);
-
-  if (pPainterComm->GetMPIInitialized())
-    {
-    MPI_Comm comm
-      = *static_cast<MPI_Comm*>(pPainterComm->GetCommunicator());
-
-    MPI_Allreduce(
-          MPI_IN_PLACE,
-          &min,
-          1,
-          MPI_FLOAT,
-          MPI_MIN,
-          comm);
-
-    MPI_Allreduce(
-          MPI_IN_PLACE,
-          &max,
-          1,
-          MPI_FLOAT,
-          MPI_MAX,
-          comm);
-    }
-}
-
-//-----------------------------------------------------------------------------
-void vtkPSurfaceLICMapper::StartTimerEvent(const char *event)
-{
-  #if defined(vtkSurfaceLICMapperTIME)
-  vtkParallelTimer *log = vtkParallelTimer::GetGlobalInstance();
-  log->StartEvent(event);
-  #else
-  (void)event;
-  #endif
-}
-
-//-----------------------------------------------------------------------------
-void vtkPSurfaceLICMapper::EndTimerEvent(const char *event)
-{
-  #if defined(vtkSurfaceLICMapperTIME)
-  vtkParallelTimer *log = vtkParallelTimer::GetGlobalInstance();
-  log->EndEvent(event);
-  #else
-  (void)event;
-  #endif
-}
-
-//----------------------------------------------------------------------------
-void vtkPSurfaceLICMapper::WriteTimerLog(const char *fileName)
-{
-  #if defined(vtkSurfaceLICMapperTIME)
-  std::string fname = fileName?fileName:"";
-  if (fname == this->LogFileName)
-    {
-    return;
-    }
-  this->LogFileName = fname;
-  if (!fname.empty())
-    {
-    vtkParallelTimer *log = vtkParallelTimer::GetGlobalInstance();
-    log->SetFileName(fname.c_str());
-    log->Update();
-    log->Write();
-    }
-  #else
-  (void)fileName;
-  #endif
-}
-
-//----------------------------------------------------------------------------
-vtkPainterCommunicator *vtkPSurfaceLICMapper::CreateCommunicator(int include)
-{
-  // if we're using MPI and it's been initialized then
-  // subset VTK's world communicator otherwise run the
-  // painter serially.
-  vtkPPainterCommunicator *comm = new vtkPPainterCommunicator;
-
-  vtkMPICommunicatorOpaqueComm *globalComm
-    = vtkPPainterCommunicator::GetGlobalCommunicator();
-
-  if (globalComm)
-    {
-    comm->SubsetCommunicator(globalComm, include);
-    }
-
-  return comm;
-}
-
-//----------------------------------------------------------------------------
-void vtkPSurfaceLICMapper::PrintSelf(ostream & os, vtkIndent indent)
-{
-  this->Superclass::PrintSelf(os, indent);
-  os << indent << "LogFileName=" << this->LogFileName << endl;
-}
diff --git a/Rendering/ParallelLIC/vtkPSurfaceLICMapper.h b/Rendering/ParallelLIC/vtkPSurfaceLICMapper.h
deleted file mode 100644
index fd05b30..0000000
--- a/Rendering/ParallelLIC/vtkPSurfaceLICMapper.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkPSurfaceLICMapper.h
-
-  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.
-
-=========================================================================*/
-// .NAME vtkPSurfaceLICMapper - parallel parts of the vtkSurfaceLICMapper
-//
-// .SECTION Description
-// Parallel parts of the vtkSurfaceLICMapper, see that class for
-// documentation.
-
-#ifndef vtkPSurfaceLICMapper_h
-#define vtkPSurfaceLICMapper_h
-
-#include "vtkSurfaceLICMapper.h"
-#include "vtkRenderingParallelLICModule.h" // For export macro
-#include <string> // for string
-
-class vtkPainterCommunicator;
-
-class VTKRENDERINGPARALLELLIC_EXPORT vtkPSurfaceLICMapper : public vtkSurfaceLICMapper
-{
-public:
-  static vtkPSurfaceLICMapper* New();
-  vtkTypeMacro(vtkPSurfaceLICMapper, vtkSurfaceLICMapper);
-  virtual void PrintSelf(ostream& os, vtkIndent indent);
-
-  // Description:
-  // Methods used for parallel benchmarks. Use cmake to define
-  // vtkSurfaceLICMapperTIME to enable benchmarks. During each
-  // update timing information is stored, it can be written to
-  // disk by calling WriteLog.
-  virtual void WriteTimerLog(const char *fileName);
-
-protected:
-  vtkPSurfaceLICMapper();
-  ~vtkPSurfaceLICMapper();
-
-  //BTX
-  // Description:
-  // Get the min/max across all ranks. min/max are in/out.
-  // In serial operation this is a no-op, in parallel it
-  // is a global collective reduction.
-  virtual void GetGlobalMinMax(
-        vtkPainterCommunicator *comm,
-        float &min,
-        float &max);
-
-  // Description:
-  // Creates a new communicator with/without the calling processes
-  // as indicated by the passed in flag, if not 0 the calling process
-  // is included in the new communicator. In parallel this call is mpi
-  // collective on the world communicator. In serial this is a no-op.
-  virtual vtkPainterCommunicator *CreateCommunicator(int include);
-  //ETX
-
-  // Description:
-  // Ensure that if any rank udpates the communicator they all
-  // do. This is a global collective operation.
-  virtual bool NeedToUpdateCommunicator();
-
-  // Description:
-  // Methods used for parallel benchmarks. Use cmake to define
-  // vtkSurfaceLICMapperTIME to enable benchmarks. During each
-  // update timing information is stored, it can be written to
-  // disk by calling WriteLog.
-  virtual void StartTimerEvent(const char *name);
-  virtual void EndTimerEvent(const char *name);
-
-private:
-  std::string LogFileName;
-
-private:
-  vtkPSurfaceLICMapper(const vtkPSurfaceLICMapper&); // Not implemented.
-  void operator=(const vtkPSurfaceLICMapper&); // Not implemented.
-};
-
-#endif
diff --git a/Rendering/Qt/CMakeLists.txt b/Rendering/Qt/CMakeLists.txt
index b91fc2e..46be6a6 100644
--- a/Rendering/Qt/CMakeLists.txt
+++ b/Rendering/Qt/CMakeLists.txt
@@ -9,7 +9,7 @@ set(LibSrcs
   )
 
 if(VTK_QT_VERSION VERSION_GREATER "4")
-  find_package(Qt5 COMPONENTS Widgets REQUIRED QUIET)
+  find_package(Qt5Widgets REQUIRED QUIET)
   include_directories(${Qt5Widgets_INCLUDE_DIRS})
   add_definitions(${Qt5Widgets_DEFINITIONS})
   set(QT_LIBRARIES ${Qt5Widgets_LIBRARIES})
diff --git a/Rendering/Qt/vtkQtInitialization.cxx b/Rendering/Qt/vtkQtInitialization.cxx
index 5cb7b6e..6683839 100644
--- a/Rendering/Qt/vtkQtInitialization.cxx
+++ b/Rendering/Qt/vtkQtInitialization.cxx
@@ -37,7 +37,10 @@ vtkQtInitialization::vtkQtInitialization()
 
 vtkQtInitialization::~vtkQtInitialization()
 {
-  delete this->Application;
+  if (this->Application)
+    {
+    delete this->Application;
+    }
 }
 
 void vtkQtInitialization::PrintSelf(ostream &os, vtkIndent indent)
diff --git a/Rendering/Qt/vtkQtStringToImage.cxx b/Rendering/Qt/vtkQtStringToImage.cxx
index bb95bf7..7221ef8 100644
--- a/Rendering/Qt/vtkQtStringToImage.cxx
+++ b/Rendering/Qt/vtkQtStringToImage.cxx
@@ -48,12 +48,12 @@ struct vtkQtLabelMapEntry
 class vtkQtStringToImage::Internals
 {
 public:
-  QFont TextPropertyToFont(vtkTextProperty* tprop, int dpi)
+  QFont TextPropertyToFont(vtkTextProperty* tprop)
     {
     QFont fontSpec(tprop->GetFontFamilyAsString());
     fontSpec.setBold(tprop->GetBold());
     fontSpec.setItalic(tprop->GetItalic());
-    fontSpec.setPixelSize(static_cast<int>(tprop->GetFontSize() * (dpi / 72.)));
+    fontSpec.setPixelSize(tprop->GetFontSize());
     return fontSpec;
     }
 
@@ -86,8 +86,7 @@ vtkQtStringToImage::~vtkQtStringToImage()
 
 //-----------------------------------------------------------------------------
 vtkVector2i vtkQtStringToImage::GetBounds(vtkTextProperty *property,
-                                          const vtkUnicodeString& string,
-                                          int dpi)
+                                          const vtkUnicodeString& string)
 {
   vtkVector2i recti(0, 0);
   if (!QApplication::instance())
@@ -101,7 +100,7 @@ vtkVector2i vtkQtStringToImage::GetBounds(vtkTextProperty *property,
     return recti;
     }
 
-  QFont fontSpec = this->Implementation->TextPropertyToFont(property, dpi);
+  QFont fontSpec = this->Implementation->TextPropertyToFont(property);
 
   QString text = QString::fromUtf8(string.utf8_str());
 
@@ -118,7 +117,7 @@ vtkVector2i vtkQtStringToImage::GetBounds(vtkTextProperty *property,
 
 //-----------------------------------------------------------------------------
 vtkVector2i vtkQtStringToImage::GetBounds(vtkTextProperty *property,
-                                          const vtkStdString& string, int dpi)
+                                          const vtkStdString& string)
 {
   vtkVector2i recti(0, 0);
   if (!QApplication::instance())
@@ -132,7 +131,7 @@ vtkVector2i vtkQtStringToImage::GetBounds(vtkTextProperty *property,
     return recti;
     }
 
-  QFont fontSpec = this->Implementation->TextPropertyToFont(property, dpi);
+  QFont fontSpec = this->Implementation->TextPropertyToFont(property);
 
   QString text(string.c_str());
 
@@ -148,7 +147,7 @@ vtkVector2i vtkQtStringToImage::GetBounds(vtkTextProperty *property,
 }
 
 int vtkQtStringToImage::RenderString(vtkTextProperty *property,
-                                     const vtkUnicodeString& string, int dpi,
+                                     const vtkUnicodeString& string,
                                      vtkImageData *data, int textDims[2])
 {
   if (!QApplication::instance())
@@ -157,7 +156,7 @@ int vtkQtStringToImage::RenderString(vtkTextProperty *property,
     return 0;
     }
   // Get the required size, and initialize a new QImage to draw on.
-  vtkVector2i box = this->GetBounds(property, string, dpi);
+  vtkVector2i box = this->GetBounds(property, string);
   if (box.GetX() == 0 || box.GetY() == 0)
     {
     return 0;
@@ -169,7 +168,7 @@ int vtkQtStringToImage::RenderString(vtkTextProperty *property,
     }
 
   QString text = QString::fromUtf8(string.utf8_str());
-  QFont fontSpec = this->Implementation->TextPropertyToFont(property, dpi);
+  QFont fontSpec = this->Implementation->TextPropertyToFont(property);
   QFontMetrics fontMetric(fontSpec);
 
   // Get properties from text property
@@ -227,11 +226,11 @@ int vtkQtStringToImage::RenderString(vtkTextProperty *property,
 }
 
 int vtkQtStringToImage::RenderString(vtkTextProperty *property,
-                                     const vtkStdString& string, int dpi,
+                                     const vtkStdString& string,
                                      vtkImageData *data, int textDims[2])
 {
-  return this->RenderString(property, vtkUnicodeString::from_utf8(string), dpi,
-                            data, textDims);
+  return this->RenderString(property, vtkUnicodeString::from_utf8(string), data,
+                            textDims);
 }
 
 //-----------------------------------------------------------------------------
diff --git a/Rendering/Qt/vtkQtStringToImage.h b/Rendering/Qt/vtkQtStringToImage.h
index 119ef15..32c7c17 100644
--- a/Rendering/Qt/vtkQtStringToImage.h
+++ b/Rendering/Qt/vtkQtStringToImage.h
@@ -48,20 +48,20 @@ public:
   // is valid (it may not if GetBoundingBox() failed or if the string
   // was empty).
   virtual vtkVector2i GetBounds(vtkTextProperty *property,
-                                const vtkUnicodeString& string, int dpi);
+                                const vtkUnicodeString& string);
   virtual vtkVector2i GetBounds(vtkTextProperty *property,
-                                const vtkStdString& string, int dpi);
+                                const vtkStdString& string);
 
   // Description:
   // Given a text property and a string, this function initializes the
   // vtkImageData *data and renders it in a vtkImageData. textDims, if provided,
   // will be overwritten by the pixel width and height of the rendered string.
   virtual int RenderString(vtkTextProperty *property,
-                           const vtkUnicodeString& string, int dpi,
+                           const vtkUnicodeString& string,
                            vtkImageData *data,
                            int textDims[2] = NULL);
   virtual int RenderString(vtkTextProperty *property,
-                           const vtkStdString& string, int dpi,
+                           const vtkStdString& string,
                            vtkImageData *data,
                            int textDims[2] = NULL);
 
diff --git a/Rendering/Tk/CMakeLists.txt b/Rendering/Tk/CMakeLists.txt
index 8f82f1f..0b94cd3 100644
--- a/Rendering/Tk/CMakeLists.txt
+++ b/Rendering/Tk/CMakeLists.txt
@@ -82,7 +82,7 @@ if(TK_FOUND AND VTK_USE_TK)
         message(FATAL_ERROR "X11_Xt_LIB could not be found. Required for VTK X lib.")
       endif()
       set(Module_TCL_SRCS ${Module_TCL_SRCS} vtkXRenderWindowTclInteractor.cxx)
-      set(Module_TCL_LIBS vtksys vtkRendering${VTK_RENDERING_BACKEND} ${TK_LIBRARY} ${X11_LIBRARIES})
+      set(Module_TCL_LIBS vtksys vtkRenderingOpenGL ${TK_LIBRARY} ${X11_LIBRARIES})
     endif()
 
     if(VTK_USE_CARBON)
@@ -126,7 +126,7 @@ if(TK_FOUND AND VTK_USE_TK)
 
     set(Module_PYTHON_LIBS ${VTK_TK_LIBRARIES})
     if(VTK_USE_X)
-      set(Module_PYTHON_LIBS vtksys vtkRendering${VTK_RENDERING_BACKEND} ${Module_PYTHON_LIBS}
+      set(Module_PYTHON_LIBS vtksys vtkRenderingOpenGL ${Module_PYTHON_LIBS}
           ${X11_LIBRARIES})
     endif()
 
diff --git a/Rendering/Tk/Testing/Data/Baseline/TestTextActor3D.png.md5 b/Rendering/Tk/Testing/Data/Baseline/TestTextActor3D.png.md5
deleted file mode 100644
index c188d60..0000000
--- a/Rendering/Tk/Testing/Data/Baseline/TestTextActor3D.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-dfff308bee082f5e9b7c6a5efccd41b3
diff --git a/Rendering/Tk/Testing/Python/CMakeLists.txt b/Rendering/Tk/Testing/Python/CMakeLists.txt
index 3584a93..76c55b1 100644
--- a/Rendering/Tk/Testing/Python/CMakeLists.txt
+++ b/Rendering/Tk/Testing/Python/CMakeLists.txt
@@ -1,7 +1,5 @@
 vtk_add_test_python(
   NO_RT
-  cursor3D.py
-  TestTextActor3D.py
   TestTkRenderWidget.py
   TestTkRenderWindowInteractor.py
   )
diff --git a/Rendering/Tk/Testing/Python/TestTextActor3D.py b/Rendering/Tk/Testing/Python/TestTextActor3D.py
deleted file mode 100755
index 4450467..0000000
--- a/Rendering/Tk/Testing/Python/TestTextActor3D.py
+++ /dev/null
@@ -1,243 +0,0 @@
-#!/usr/bin/env python
-
-import sys
-import math
-from functools import partial
-import vtk
-from vtk.test import Testing
-from vtk.util.misc import vtkGetDataRoot
-from Tkinter import Pack
-VTK_DATA_ROOT = vtkGetDataRoot()
-
-import Tkinter
-#from vtk.tk.vtkTkRenderWindowInteractor import vtkTkRenderWindowInteractor
-from vtk.tk.vtkTkRenderWidget import vtkTkRenderWidget
-from vtk.tk.vtkTkImageViewerWidget import vtkTkImageViewerWidget
-
-# Tkinter constants.
-E = Tkinter.E
-W = Tkinter.W
-N = Tkinter.N
-S = Tkinter.S
-HORIZONTAL = Tkinter.HORIZONTAL
-VERTICAL = Tkinter.VERTICAL
-RIGHT = Tkinter.RIGHT
-LEFT = Tkinter.LEFT
-TOP = Tkinter.TOP
-BOTTOM = Tkinter.BOTTOM
-X = Tkinter.X
-BOTH = Tkinter.BOTH
-NO = Tkinter.NO
-YES = Tkinter.YES
-NORMAL = Tkinter.NORMAL
-DISABLED = Tkinter.DISABLED
-TRUE = Tkinter.TRUE
-FALSE = Tkinter.FALSE
-GROOVE = Tkinter.GROOVE
-INSERT = Tkinter.INSERT
-END = Tkinter.END
-
-class TestTextActor3DViewer(Testing.vtkTest):
-    '''
-    Provide a testing framework for for TestTextActor3D.
-
-    Note:
-        root, the top-level widget for Tk,
-        tkrw, the vtkTkRenderWidget and
-        renWin, the vtkRenderindow
-        are accessible from any function in this class
-        after SetUp() has run.
-    '''
-
-    def SetUp(self):
-        '''
-        Set up cursor3D
-        '''
-
-        def OnClosing():
-            self.root.quit()
-
-        def AddSphere(ren):
-            objSource = vtk.vtkSphereSource()
-
-            objMapper = vtk.vtkPolyDataMapper()
-            objMapper.SetInputConnection(objSource.GetOutputPort())
-
-            objActor = vtk.vtkActor()
-            objActor.SetMapper(objMapper)
-            objActor.GetProperty().SetRepresentationToWireframe()
-            print "Sphere:", objActor.GetOrigin()
-
-            ren.AddActor(objActor)
-
-        def AddOneTextActor(baseTextProp):
-            name = "ia"
-            self.textActors[name] = vtk.vtkTextActor3D()
-            # This adjustment is needed to reduce the difference
-            # between the Tcl and Python versions.
-            self.textActors[name].SetOrigin(0, -0.127878, 0)
-
-
-            tprop = self.textActors[name].GetTextProperty()
-            tprop.ShallowCopy(baseTextProp)
-            tprop.SetColor(1,0,0)
-
-        # Add many text actors.
-        def AddManyTextActors(baseTextProp):
-            lut = vtk.vtkColorTransferFunction()
-            lut.SetColorSpaceToHSV()
-            lut.AddRGBPoint(0.0, 0.0, 1.0, 1.0)
-            lut.AddRGBPoint(1.0, 1.0, 1.0, 1.0)
-
-            for i in range(0, 10):
-                name = "ia" + str(i)
-
-                self.textActors[name] = vtk.vtkTextActor3D()
-                self.textActors[name].SetOrientation(0, i*36, 0)
-                #self.textActors[name].SetPosition(math.cos(i * 0.0314), 0, 0)
-                # This adjustment is needed to reduce the diffierence
-                # between the Tcl and Python versions.
-                self.textActors[name].SetOrigin(0, -0.127878, 0)
-
-                tprop = self.textActors[name].GetTextProperty()
-                tprop.ShallowCopy(baseTextProp)
-                value = i / 10.0
-                tprop.SetColor(lut.GetColor(value))
-
-            del lut
-
-        # Update all text actors
-        def UpdateTextActors(event):
-            orientation = self.scaleOrientation.get()
-            fontSize = self.scaleFontSize.get()
-            scale = self.scaleScale.get() / 10000.0
-            text = self.entryText.get("1.0",'end+1c')
-            opacity = self.scaleOpacity.get()
-
-            for actor in self.textActors.values():
-                actor.SetScale(scale)
-                actor.SetInput(text)
-                tprop = actor.GetTextProperty()
-                tprop.SetFontSize(fontSize)
-                tprop.SetOrientation(orientation)
-                tprop.SetOpacity(opacity)
-
-            self.renWin.Render()
-
-        ren = vtk.vtkRenderer()
-        ren.SetBackground(0.1, 0.2, 0.4)
-        self.renWin = vtk.vtkRenderWindow()
-        self.renWin.AddRenderer(ren)
-        #self.renWin.SetSize(600, 600)
-
-        self.root = Tkinter.Tk()
-        self.root.title("TestTextActor3D.py")
-        # Define what to do when the user explicitly closes a window.
-        self.root.protocol("WM_DELETE_WINDOW", OnClosing)
-
-        # The Tk render widget.
-        self.tkrw = vtkTkRenderWidget(
-                        self.root, width=450, height=450, rw=self.renWin)
-        self.tkrw.BindTkRenderWidget()
-        #self.renWin.GetInteractor().GetInteractorStyle().SetCurrentStyleToTrackballCamera()
-        self.tkrw.pack(side=LEFT, fill=BOTH, expand=YES)
-
-        # Base text property
-        baseTextProp = vtk.vtkTextProperty()
-        baseTextProp.SetFontSize(48)
-        baseTextProp.ShadowOn()
-        baseTextProp.SetColor(1.0, 0.0, 0.0)
-        baseTextProp.SetFontFamilyToArial()
-
-        baseScale = 0.0025
-
-        baseText = "This is a test"
-
-        # The text actors
-        self.textActors = dict()
-
-        scaleLength = 200
-        controls = Tkinter.Frame(self.root, relief=GROOVE, bd=2)
-        controls.pack(
-                padx=2, pady=2, anchor=N+W, side=LEFT, fill=BOTH, expand=NO)
-
-        # Add control of text.
-        self.entryText = Tkinter.Text(controls, height=1, width=25)
-        self.entryText.insert(INSERT,baseText)
-        self.entryText.pack(padx=4, pady=4, side=TOP, fill=X, expand=NO)
-        self.entryText.bind('<Return>',UpdateTextActors)
-        self.entryText.bind('<FocusOut>',UpdateTextActors)
-
-        # Add control of orientation.
-        self.scaleOrientation = Tkinter.Scale(controls,
-                                from_=0, to=360, res=1,
-                                length= scaleLength,
-                                orient=HORIZONTAL,
-                                label="Text orientation:",
-                                command=UpdateTextActors)
-        self.scaleOrientation.set(baseTextProp.GetOrientation())
-        self.scaleOrientation.pack(side=TOP, fill=X, expand=NO)
-
-        # Add control of font size.
-        self.scaleFontSize = Tkinter.Scale(controls,
-                                from_=5, to=150, res=1,
-                                length= scaleLength,
-                                orient=HORIZONTAL,
-                                label="Font Size:",
-                                command=UpdateTextActors)
-        self.scaleFontSize.set(baseTextProp.GetFontSize())
-        self.scaleFontSize.pack(side=TOP, fill=X, expand=NO)
-
-        # Add control of scale.
-        self.scaleScale = Tkinter.Scale(controls,
-                                from_=0, to=100, res=1,
-                                length= scaleLength,
-                                orient=HORIZONTAL,
-                                label="Actor scale:",
-                                command=UpdateTextActors)
-        self.scaleScale.set(baseScale * 10000.0)
-        self.scaleScale.pack(side=TOP, fill=X, expand=NO)
-
-        # Add control of scale.
-        self.scaleOpacity = Tkinter.Scale(controls,
-                                from_=0, to=1.0, res=0.01,
-                                length= scaleLength,
-                                orient=HORIZONTAL,
-                                label="Text opacity:",
-                                command=UpdateTextActors)
-        self.scaleOpacity.set(baseTextProp.GetOpacity())
-        self.scaleOpacity.pack(side=TOP, fill=X, expand=NO)
-
-        # Create and add all the text actors.
-        if False:
-            AddSphere(ren)
-            AddOneTextActor(baseTextProp)
-            ren.ResetCamera()
-        else:
-            AddManyTextActors(baseTextProp)
-            ren.ResetCamera()
-
-            ren.GetActiveCamera().Elevation(30.0)
-            ren.GetActiveCamera().Dolly(0.40)
-
-        UpdateTextActors(0)
-
-        for actor in self.textActors.itervalues():
-            ren.AddActor(actor)
-
-    def DoIt(self):
-        self.SetUp()
-        self.renWin.Render()
-        self.tkrw.Render()
-        self.root.update()
-        # If you want to interact and use the sliders etc,
-        # uncomment the following line.
-        #self.root.mainloop()
-        img_file = "TestTextActor3D.png"
-        Testing.compareImage(self.renWin, Testing.getAbsImagePath(img_file))
-        Testing.interact()
-
-if __name__ == '__main__':
-    cases = [(TestTextActor3DViewer, 'DoIt')]
-    del TestTextActor3DViewer
-    Testing.main(cases)
diff --git a/Rendering/Tk/Testing/Python/cursor3D.py b/Rendering/Tk/Testing/Python/cursor3D.py
deleted file mode 100755
index fb901d8..0000000
--- a/Rendering/Tk/Testing/Python/cursor3D.py
+++ /dev/null
@@ -1,274 +0,0 @@
-#!/usr/bin/env python
-
-'''
-This little example shows how a cursor can be created in
- image viewers, and renderers.  The standard TkImageViewerWidget and
- TkRenderWidget bindings are used.  There is a new binding:
- middle button in the image viewer sets the position of the cursor.
-'''
-
-import sys
-from functools import partial
-import vtk
-from vtk.test import Testing
-from vtk.util.misc import vtkGetDataRoot
-from Tkinter import Pack
-VTK_DATA_ROOT = vtkGetDataRoot()
-
-import Tkinter
-#from vtk.tk.vtkTkRenderWindowInteractor import vtkTkRenderWindowInteractor
-from vtk.tk.vtkTkRenderWidget import vtkTkRenderWidget
-from vtk.tk.vtkTkImageViewerWidget import vtkTkImageViewerWidget
-
-# Tkinter constants.
-E = Tkinter.E
-W = Tkinter.W
-N = Tkinter.N
-S = Tkinter.S
-HORIZONTAL = Tkinter.HORIZONTAL
-VERTICAL = Tkinter.VERTICAL
-RIGHT = Tkinter.RIGHT
-LEFT = Tkinter.LEFT
-TOP = Tkinter.TOP
-BOTTOM = Tkinter.BOTTOM
-X = Tkinter.X
-BOTH = Tkinter.BOTH
-NO = Tkinter.NO
-YES = Tkinter.YES
-NORMAL = Tkinter.NORMAL
-DISABLED = Tkinter.DISABLED
-TRUE = Tkinter.TRUE
-FALSE = Tkinter.FALSE
-
-# Global values.
-CURSOR_X = 20
-CURSOR_Y = 20
-CURSOR_Z = 20
-
-IMAGE_MAG_X = 4
-IMAGE_MAG_Y = 4
-IMAGE_MAG_Z = 1
-
-
-class Cursor3DViewer(Testing.vtkTest):
-    '''
-    Provide a testing framework for for cursor3D.
-
-    Note:
-        root, the top-level widget for Tk,
-        tkrw, the vtkTkRenderWidget and
-        viewer, the Image viewer
-        are accessible from any function in this class
-        after SetUp() has run.
-    '''
-
-    def SetUp(self):
-        '''
-        Set up cursor3D
-        '''
-
-        def OnClosing():
-            self.root.quit()
-
-        def ViewerDown(viewer):
-            ViewerSetZSlice(viewer, viewer.GetZSlice() - 1)
-
-        def ViewerUp(viewer):
-            ViewerSetZSlice(viewer, viewer.GetZSlice() + 1)
-
-        def ViewerSetZSlice(viewer, z):
-            viewer.SetZSlice(z)
-            txt = 'slice: ' + str(z)
-            sliceLabel.configure(text=txt)
-            viewer.Render()
-
-        def SetCursorFromViewer(event):
-            x = int(event.x)
-            y = int(event.y)
-            # We have to flip y axis because tk uses upper right origin.
-            self.root.update_idletasks()
-            height = int(self.tkvw.configure()['height'][4])
-            y = height - y
-            print height
-            z = self.viewer.GetZSlice()
-            SetCursor( x / IMAGE_MAG_X, y / IMAGE_MAG_Y, z / IMAGE_MAG_Z )
-
-        def SetCursor(x, y, z):
-
-            CURSOR_X = x
-            CURSOR_Y = y
-            CURSOR_Z = z
-
-            axes.SetOrigin(CURSOR_X,CURSOR_Y,CURSOR_Z)
-            imageCursor.SetCursorPosition(
-                CURSOR_X * IMAGE_MAG_X,
-                CURSOR_Y * IMAGE_MAG_Y,
-                CURSOR_Z * IMAGE_MAG_Z)
-
-            self.viewer.Render()
-            self.renWin.Render()
-
-        # Pipeline stuff.
-        reader = vtk.vtkSLCReader()
-        reader.SetFileName(VTK_DATA_ROOT + "/Data/neghip.slc")
-        # Cursor stuff
-
-        magnify = vtk.vtkImageMagnify()
-        magnify.SetInputConnection(reader.GetOutputPort())
-        magnify.SetMagnificationFactors(IMAGE_MAG_X, IMAGE_MAG_Y ,IMAGE_MAG_Z)
-
-        imageCursor = vtk.vtkImageCursor3D()
-        imageCursor.SetInputConnection(magnify.GetOutputPort())
-        imageCursor.SetCursorPosition(
-                CURSOR_X*IMAGE_MAG_X,
-                CURSOR_Y*IMAGE_MAG_Y,
-                CURSOR_Z*IMAGE_MAG_Z)
-        imageCursor.SetCursorValue(255)
-        imageCursor.SetCursorRadius(50*IMAGE_MAG_X)
-
-        axes = vtk.vtkAxes()
-        axes.SymmetricOn()
-        axes.SetOrigin(CURSOR_X, CURSOR_Y, CURSOR_Z)
-        axes.SetScaleFactor(50.0)
-
-        axes_mapper = vtk.vtkPolyDataMapper()
-        axes_mapper.SetInputConnection(axes.GetOutputPort())
-
-        axesActor = vtk.vtkActor()
-        axesActor.SetMapper(axes_mapper)
-        axesActor.GetProperty().SetAmbient(0.5)
-
-        # Image viewer stuff.
-        self.viewer = vtk.vtkImageViewer()
-        self.viewer.SetInputConnection(imageCursor.GetOutputPort())
-        self.viewer.SetZSlice(CURSOR_Z*IMAGE_MAG_Z)
-        self.viewer.SetColorWindow(256)
-        self.viewer.SetColorLevel(128)
-
-        # Create transfer functions for opacity and color.
-        opacity_transfer_function = vtk.vtkPiecewiseFunction()
-        opacity_transfer_function.AddPoint(20, 0.0)
-        opacity_transfer_function.AddPoint(255, 0.2)
-
-        color_transfer_function = vtk.vtkColorTransferFunction()
-        color_transfer_function.AddRGBPoint(0, 0, 0, 0)
-        color_transfer_function.AddRGBPoint(64, 1, 0, 0)
-        color_transfer_function.AddRGBPoint(128, 0, 0, 1)
-        color_transfer_function.AddRGBPoint(192, 0, 1, 0)
-        color_transfer_function.AddRGBPoint(255, 0, .2, 0)
-
-        # Create properties, mappers, volume actors, and ray cast function.
-        volume_property = vtk.vtkVolumeProperty()
-        volume_property.SetColor(color_transfer_function)
-#         volume_property.SetColor(color_transfer_function[0],
-#                                  color_transfer_function[1],
-#                                  color_transfer_function[2])
-        volume_property.SetScalarOpacity(opacity_transfer_function)
-
-        composite_function = vtk.vtkVolumeRayCastCompositeFunction()
-
-        volume_mapper = vtk.vtkVolumeRayCastMapper()
-        volume_mapper.SetInputConnection(reader.GetOutputPort())
-        volume_mapper.SetVolumeRayCastFunction(composite_function)
-
-        volume = vtk.vtkVolume()
-        volume.SetMapper(volume_mapper)
-        volume.SetProperty(volume_property)
-
-        # Create outline.
-        outline = vtk.vtkOutlineFilter()
-        outline.SetInputConnection(reader.GetOutputPort())
-
-        outline_mapper = vtk.vtkPolyDataMapper()
-        outline_mapper.SetInputConnection(outline.GetOutputPort())
-
-        outlineActor = vtk.vtkActor()
-        outlineActor.SetMapper(outline_mapper)
-        outlineActor.GetProperty().SetColor(1, 1, 1)
-
-        # Create the renderer.
-        ren = vtk.vtkRenderer()
-        ren.AddActor(axesActor)
-        ren.AddVolume(volume)
-        ren.SetBackground(0.1, 0.2, 0.4)
-
-        self.renWin = vtk.vtkRenderWindow()
-        self.renWin.AddRenderer(ren)
-        self.renWin.SetSize(256, 256)
-
-        # Create the GUI: two renderer widgets and a quit button.
-        self.root = Tkinter.Tk()
-        self.root.title("cursor3D")
-        # Define what to do when the user explicitly closes a window.
-        self.root.protocol("WM_DELETE_WINDOW", OnClosing)
-
-        # Help label, frame and quit button
-        helpLabel = Tkinter.Label(self.root,
-            text=
-            "MiddleMouse (or shift-LeftMouse) in image viewer to place cursor")
-        displayFrame = Tkinter.Frame(self.root)
-        quitButton = Tkinter.Button(self.root, text= "Quit", command=OnClosing)
-
-        # Pack the GUI.
-        helpLabel.pack()
-        displayFrame.pack(fill=BOTH, expand=TRUE)
-        quitButton.pack(fill=X)
-
-        # Create the viewer widget.
-        viewerFrame = Tkinter.Frame(displayFrame)
-        viewerFrame.pack(padx=3, pady=3, side=LEFT, anchor=N,
-                        fill=BOTH, expand=FALSE)
-        self.tkvw = vtkTkImageViewerWidget(viewerFrame, iv=self.viewer,
-                        width=264, height=264)
-        viewerControls = Tkinter.Frame(viewerFrame)
-        viewerControls.pack(side=BOTTOM, anchor=S, fill=BOTH, expand=TRUE)
-        self.tkvw.pack(side=TOP, anchor=N, fill=BOTH, expand=FALSE)
-        downButton = Tkinter.Button(viewerControls, text="Down",
-                            command=[ViewerDown,self.viewer])
-        upButton = Tkinter.Button(viewerControls, text="Up",
-                            command=[ViewerUp,self.viewer])
-        sliceLabel = Tkinter.Label(viewerControls,
-                            text="slice: "+str(CURSOR_Z*IMAGE_MAG_Z))
-        downButton.pack(side=LEFT, expand=TRUE, fill=BOTH)
-        upButton.pack(side=LEFT, expand=TRUE, fill=BOTH)
-        sliceLabel.pack(side=LEFT, expand=TRUE, fill=BOTH)
-
-        # Create the render widget
-        renderFrame = Tkinter.Frame(displayFrame)
-        renderFrame.pack(padx=3, pady=3, side=LEFT, anchor=N,
-                        fill=BOTH, expand=TRUE)
-        self.tkrw = vtkTkRenderWidget(renderFrame, rw=self.renWin,
-                        width=264, height=264)
-
-        self.tkrw.pack(side=TOP, anchor=N, fill=BOTH, expand=TRUE)
-
-        # Bindings
-        self.tkvw.BindTkImageViewer()
-        self.tkrw.BindTkRenderWidget()
-
-        # Lets add an extra binding of the middle button in the image viewer
-        # to set the cursor location.
-        self.tkvw.bind('<Button-2>',SetCursorFromViewer)
-        self.tkvw.bind('<Shift-Button-1>',SetCursorFromViewer)
-
-        # Associate the functions with the buttons and label.
-        #
-        downButton.config(command=partial(ViewerDown, self.viewer))
-        upButton.config(command=partial(ViewerUp, self.viewer))
-
-    def DoIt(self):
-        self.SetUp()
-        self.viewer.Render()
-        self.tkrw.Render()
-        self.root.update()
-        # If you want to interact and use the sliders etc,
-        # uncomment the following line.
-        #self.root.mainloop()
-        img_file = "cursor3D.png"
-        Testing.compareImage(self.viewer.GetRenderWindow(), Testing.getAbsImagePath(img_file))
-#         Testing.interact()
-
-if __name__ == '__main__':
-    cases = [(Cursor3DViewer, 'DoIt')]
-    del Cursor3DViewer
-    Testing.main(cases)
diff --git a/Rendering/Tk/Testing/Tcl/TestTextActor3D.tcl b/Rendering/Tk/Testing/Tcl/TestTextActor3D.tcl
new file mode 100644
index 0000000..a33c7ec
--- /dev/null
+++ b/Rendering/Tk/Testing/Tcl/TestTextActor3D.tcl
@@ -0,0 +1,206 @@
+package require vtk
+package require vtkinteraction
+
+# Renderer, renwin
+
+vtkRenderer ren1
+ren1 SetBackground 0.1 0.2 0.4
+
+vtkRenderWindow renWin
+renWin AddRenderer ren1
+renWin SetSize 600 600
+
+# The Tk render widget
+
+set vtkw [vtkTkRenderWidget .ren -width 450 -height 450 -rw renWin]
+::vtk::bind_tk_render_widget $vtkw
+
+[[renWin GetInteractor] GetInteractorStyle] SetCurrentStyleToTrackballCamera
+
+pack $vtkw -side left -fill both -expand yes
+
+# Base text property
+
+vtkTextProperty base_text_prop
+base_text_prop SetFontSize 48
+base_text_prop ShadowOn
+base_text_prop SetColor 1.0 0.0 0.0
+base_text_prop SetFontFamilyToArial
+
+set base_scale 0.0025
+
+set base_text "This is a test"
+
+# The text actors
+
+set text_actors {}
+
+# Add a sphere
+
+proc add_sphere {} {
+    vtkSphereSource obj_source
+
+    vtkPolyDataMapper obj_mapper
+    obj_mapper SetInputConnection [obj_source GetOutputPort]
+
+    vtkActor obj_actor
+    obj_actor SetMapper obj_mapper
+    [obj_actor GetProperty] SetRepresentationToWireframe
+
+    ren1 AddActor obj_actor
+}
+
+# Add one text actor, centered
+
+proc add_one_text_actor {} {
+    global text_actors
+
+    vtkTextActor3D ia
+    lappend text_actors ia
+
+    set tprop [ia GetTextProperty]
+    $tprop ShallowCopy base_text_prop
+}
+
+# Add many text actor
+
+proc add_many_text_actors {} {
+    global text_actors
+
+    vtkColorTransferFunction lut
+    lut SetColorSpaceToHSV
+    lut AddRGBPoint 0.0 0.0 1.0 1.0
+    lut AddRGBPoint 1.0 1.0 1.0 1.0
+
+    for {set i 0} {$i < 10} {incr i} {
+        set name "ia$i"
+        vtkTextActor3D $name
+        $name SetOrientation 0 [expr $i * 36] 0
+  #      $name SetPosition [expr cos($i * 0.0314)] 0 0
+        lappend text_actors $name
+
+        set tprop [$name GetTextProperty]
+        $tprop ShallowCopy base_text_prop
+        set value [expr $i / 10.0]
+        eval $tprop SetColor [lut GetColor $value]
+    }
+
+    lut Delete
+}
+
+set scale_length 200
+frame .controls -relief groove -bd 2
+pack .controls -padx 2 -pady 2 -anchor nw -side left -fill both -expand n
+
+# Add control of text
+
+set entry_text [entry .controls.text]
+
+$entry_text insert 0 "$base_text"
+
+pack $entry_text -padx 4 -pady 4 -side top -fill x -expand n
+
+bind $entry_text <Return> {update_text_actors 0}
+bind $entry_text <FocusOut> {update_text_actors 0}
+
+# Add control of orientation
+
+set scale_orientation [scale .controls.orientation \
+        -from 0 -to 360 -res 1 \
+        -length $scale_length \
+        -orient horizontal \
+        -label "Text orientation:" \
+        -command update_text_actors]
+
+$scale_orientation set [base_text_prop GetOrientation]
+pack $scale_orientation -side top -fill x -expand n
+
+# Add control of font size
+
+set scale_font_size [scale .controls.font_size \
+        -from 5 -to 150 -res 1 \
+        -length $scale_length \
+        -orient horizontal \
+        -label "Font Size:" \
+        -command update_text_actors]
+
+$scale_font_size set [base_text_prop GetFontSize]
+pack $scale_font_size -side top -fill x -expand n
+
+# Add control of scale
+
+set scale_scale [scale .controls.scale \
+        -from 0 -to 100 -res 1 \
+        -length $scale_length \
+        -orient horizontal \
+        -label "Actor scale:" \
+        -command update_text_actors]
+
+$scale_scale set [expr $base_scale * 10000.0]
+pack $scale_scale -side top -fill x -expand n
+
+# Add control of opacity
+
+set scale_opacity [scale .controls.opacity \
+        -from 0.0 -to 1.0 -res 0.01 \
+        -length $scale_length \
+        -orient horizontal \
+        -label "Text opacity:" \
+        -command update_text_actors]
+
+$scale_opacity set [base_text_prop GetOpacity]
+pack $scale_opacity -side top -fill x -expand n
+
+# Update all text actors
+
+proc update_text_actors {dummy} {
+    global scale_orientation scale_font_size scale_scale entry_text scale_opacity
+    set orientation [$scale_orientation get]
+    set font_size [$scale_font_size get]
+    set scale [expr [$scale_scale get] / 10000.0]
+    set text [$entry_text get]
+    set opacity [$scale_opacity get]
+
+    global text_actors
+    set i 0
+    foreach actor $text_actors {
+        $actor SetScale $scale
+        $actor SetInput "$text"
+        set tprop [$actor GetTextProperty]
+        $tprop SetFontSize $font_size
+        $tprop SetOrientation $orientation
+        $tprop SetOpacity $opacity
+        incr i
+    }
+
+    renWin Render
+}
+
+# Create and add all text actors
+
+if {0} {
+    add_sphere
+    add_one_text_actor
+    ren1 ResetCamera
+} {
+    add_many_text_actors
+    ren1 ResetCamera
+
+    set cam [ren1 GetActiveCamera]
+    $cam Elevation 30
+    $cam Dolly 0.4
+}
+
+update_text_actors 0
+
+foreach actor $text_actors {
+    ren1 AddActor $actor
+}
+
+# Interact
+
+renWin Render
+
+wm protocol . WM_DELETE_WINDOW ::vtk::cb_exit
+tkwait window .
+vtkCommand DeleteAllObject
diff --git a/Rendering/Tk/module.cmake b/Rendering/Tk/module.cmake
index 7e4b59e..040234c 100644
--- a/Rendering/Tk/module.cmake
+++ b/Rendering/Tk/module.cmake
@@ -2,7 +2,7 @@ vtk_module(vtkRenderingTk
   GROUPS
     Tk
   DEPENDS
-    vtkRendering${VTK_RENDERING_BACKEND}
+    vtkRenderingOpenGL
     vtkInteractionStyle
     vtkInteractionImage
   COMPILE_DEPENDS
diff --git a/Rendering/Tk/vtkXRenderWindowTclInteractor.cxx b/Rendering/Tk/vtkXRenderWindowTclInteractor.cxx
index 7c07729..7a4538d 100644
--- a/Rendering/Tk/vtkXRenderWindowTclInteractor.cxx
+++ b/Rendering/Tk/vtkXRenderWindowTclInteractor.cxx
@@ -244,7 +244,7 @@ void vtkXRenderWindowTclInteractor::Enable()
                ButtonPressMask | ButtonReleaseMask |
                ExposureMask | StructureNotifyMask |
                EnterWindowMask | LeaveWindowMask |
-               PointerMotionMask);
+               PointerMotionMask | PointerMotionMask);
 
   // Setup for capturing the window deletion
   this->KillAtom = XInternAtom(this->DisplayId,"WM_DELETE_WINDOW",False);
diff --git a/Rendering/Volume/CMakeLists.txt b/Rendering/Volume/CMakeLists.txt
index 2edbb23..434e81a 100644
--- a/Rendering/Volume/CMakeLists.txt
+++ b/Rendering/Volume/CMakeLists.txt
@@ -51,13 +51,6 @@ set_source_files_properties(
   ABSTRACT
   )
 
-if(VTK_RENDERING_BACKEND STREQUAL "OpenGL2")
-  set_source_files_properties(
-    vtkGPUVolumeRayCastMapper.cxx APPEND PROPERTIES
-    COMPILE_DEFINITIONS VTK_OPENGL2
-    )
-endif()
-
 # only some volume mappers are supported for the OpenGL2 backend
 if(NOT VTK_RENDERING_BACKEND STREQUAL "OpenGL2")
   set(Module_SRCS ${Module_SRCS}
diff --git a/Rendering/Volume/Testing/Cxx/CMakeLists.txt b/Rendering/Volume/Testing/Cxx/CMakeLists.txt
index 7caf367..991fcb4 100644
--- a/Rendering/Volume/Testing/Cxx/CMakeLists.txt
+++ b/Rendering/Volume/Testing/Cxx/CMakeLists.txt
@@ -23,13 +23,32 @@ set (GenericVolumeCxxTests
   TestGPURayCastNearestDataTypesMIP.cxx
   TestGPURayCastPerspectiveParallel.cxx
   TestGPURayCastVolumeUpdate.cxx
-  TestGPUVolumeRayCastMapper.cxx
   TestMinIntensityRendering.cxx
   TestProjectedTetrahedra.cxx
   TestSmartVolumeMapper.cxx
   TestSmartVolumeMapperWindowLevel.cxx
   )
 
+# These tests are built only if either Module_vtkRenderingVolumeOpenGLNew is ON
+# or if the rendering backend is OpenGL2
+set (OpenGLNew_OR_OpenGL2_CxxTests
+  #TestGPURayCastAdditive1.cxx
+  TestGPURayCastClipping.cxx
+  #TestGPURayCastCropping1.cxx
+  #TestGPURayCastDataTypesMinIP1.cxx
+  TestGPURayCastGradientOpacity.cxx
+  TestGPURayCastVolumePolyData.cxx
+  TestGPURayCastVolumeRotation.cxx
+  TestGPURayCastVolumeScale.cxx
+  )
+
+if ("${VTK_RENDERING_BACKEND}" STREQUAL "OpenGL2")
+  list(APPEND OpenGLNew_OR_OpenGL2_CxxTests
+    TestGPURayCastVolumeLightKit.cxx
+    TestGPURayCastPositionalLights.cxx
+    )
+endif()
+
 # These tests are built for the OpenGL backend
 set (VolumeOpenGLCxxTests
   HomogeneousRayIntegration.cxx
@@ -46,32 +65,16 @@ set (VolumeOpenGLCxxTests
   volProt.cxx
   )
 
-# These tests are only built for the OpenGL2 backend
-set (VolumeOpenGL2CxxTests
-  TestGPURayCastCameraInside.cxx
-  TestGPURayCastCameraInsideSmallSpacing.cxx
-  TestGPURayCastClipping.cxx
-  TestGPURayCastGradientOpacity.cxx
-  TestGPURayCastPositionalLights.cxx
-  TestGPURayCastReleaseResources.cxx
-  TestGPURayCastThreeComponentsIndependent.cxx
-  TestGPURayCastTwoComponentsDependent.cxx
-  TestGPURayCastTwoComponentsIndependent.cxx
-  TestGPURayCastVolumeLightKit.cxx
-  TestGPURayCastVolumePolyData.cxx
-  TestGPURayCastVolumeRotation.cxx
-  TestGPURayCastVolumeScale.cxx
-  )
-
 # everyone gets these tests
 vtk_add_test_cxx(${vtk-module}CxxTests tests
   ${GenericVolumeCxxTests}
   )
 
-# If OpenGL2 backend, add all VolumeOpenGL2CxxTests
-if ("${VTK_RENDERING_BACKEND}" STREQUAL "OpenGL2")
+# If OpenGL2 backend, add all GenericVolumeCxxTests
+if (("${VTK_RENDERING_BACKEND}" STREQUAL "OpenGL2") OR
+  (Module_vtkRenderingVolumeOpenGLNew))
   vtk_add_test_cxx(${vtk-module}CxxTests tests
-    ${VolumeOpenGL2CxxTests}
+    ${OpenGLNew_OR_OpenGL2_CxxTests}
     )
 endif ()
 
diff --git a/Rendering/Volume/Testing/Cxx/TestGPURayCastAdditive.cxx b/Rendering/Volume/Testing/Cxx/TestGPURayCastAdditive.cxx
index c18c6df..8ebd7a5 100644
--- a/Rendering/Volume/Testing/Cxx/TestGPURayCastAdditive.cxx
+++ b/Rendering/Volume/Testing/Cxx/TestGPURayCastAdditive.cxx
@@ -40,11 +40,11 @@ int TestGPURayCastAdditive(int argc,
   cout << "CTEST_FULL_OUTPUT (Avoid ctest truncation of output)" << endl;
 
   // Create a spherical implicit function.
-  vtkSphere *shape = vtkSphere::New();
+  vtkSphere *shape=vtkSphere::New();
   shape->SetRadius(0.1);
   shape->SetCenter(0.0,0.0,0.0);
 
-  vtkSampleFunction *source = vtkSampleFunction::New();
+  vtkSampleFunction *source=vtkSampleFunction::New();
   source->SetImplicitFunction(shape);
   shape->Delete();
   source->SetOutputScalarTypeToDouble();
@@ -56,53 +56,48 @@ int TestGPURayCastAdditive(int argc,
 
   source->Update();
 
-  vtkDataArray *a = source->GetOutput()->GetPointData()->GetScalars("values");
+  vtkDataArray *a=source->GetOutput()->GetPointData()->GetScalars("values");
   double range[2];
   a->GetRange(range);
 
-  vtkImageShiftScale *t = vtkImageShiftScale::New();
+  vtkImageShiftScale *t=vtkImageShiftScale::New();
   t->SetInputConnection(source->GetOutputPort());
   source->Delete();
   t->SetShift(-range[0]);
-  double magnitude = range[1]-range[0];
-  if(magnitude == 0.0)
+  double magnitude=range[1]-range[0];
+  if(magnitude==0.0)
     {
-    magnitude = 1.0;
+    magnitude=1.0;
     }
   t->SetScale(255.0/magnitude);
   t->SetOutputScalarTypeToUnsignedChar();
 
   t->Update();
 
-  vtkRenderWindow *renWin = vtkRenderWindow::New();
-  vtkRenderer *ren1 = vtkRenderer::New();
+  vtkRenderWindow *renWin=vtkRenderWindow::New();
+  vtkRenderer *ren1=vtkRenderer::New();
   ren1->SetBackground(0.1,0.4,0.2);
 
   renWin->AddRenderer(ren1);
   ren1->Delete();
+  renWin->SetSize(301,300); // intentional odd and NPOT  width/height
 
-  // intentional odd and NPOT  width/height
-  renWin->SetSize(301,300);
-
-  vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();
+  vtkRenderWindowInteractor *iren=vtkRenderWindowInteractor::New();
   iren->SetRenderWindow(renWin);
   renWin->Delete();
 
-  // make sure we have an OpenGL context.
-  renWin->Render();
+  renWin->Render(); // make sure we have an OpenGL context.
 
   vtkGPUVolumeRayCastMapper *volumeMapper;
   vtkVolumeProperty *volumeProperty;
   vtkVolume *volume;
 
-  volumeMapper = vtkGPUVolumeRayCastMapper::New();
-  volumeMapper->SetAutoAdjustSampleDistances(0);
-  volumeMapper->SetSampleDistance(0.2);
+  volumeMapper=vtkGPUVolumeRayCastMapper::New();
   volumeMapper->SetBlendModeToComposite(); // composite first
   volumeMapper->SetInputConnection(
     t->GetOutputPort());
 
-  volumeProperty = vtkVolumeProperty::New();
+  volumeProperty=vtkVolumeProperty::New();
   volumeProperty->ShadeOff();
   volumeProperty->SetInterpolationType(VTK_LINEAR_INTERPOLATION);
 
@@ -119,19 +114,19 @@ int TestGPURayCastAdditive(int argc,
   compositeOpacity->AddPoint(255.0,0.0);
   volumeProperty->SetScalarOpacity(compositeOpacity); // composite first.
 
-  vtkColorTransferFunction *color = vtkColorTransferFunction::New();
+  vtkColorTransferFunction *color=vtkColorTransferFunction::New();
   color->AddRGBPoint(0.0  ,0.0,0.0,1.0);
   color->AddRGBPoint(40.0  ,1.0,0.0,0.0);
   color->AddRGBPoint(255.0,1.0,1.0,1.0);
   volumeProperty->SetColor(color);
   color->Delete();
 
-  volume = vtkVolume::New();
+  volume=vtkVolume::New();
   volume->SetMapper(volumeMapper);
   volume->SetProperty(volumeProperty);
   ren1->AddViewProp(volume);
 
-  int valid = volumeMapper->IsRenderSupported(renWin,volumeProperty);
+  int valid=volumeMapper->IsRenderSupported(renWin,volumeProperty);
 
   int retVal;
   if(valid)
@@ -154,7 +149,7 @@ int TestGPURayCastAdditive(int argc,
     }
   else
     {
-    retVal = vtkTesting::PASSED;
+    retVal=vtkTesting::PASSED;
     cout << "Required extensions not supported." << endl;
     }
 
diff --git a/Rendering/Volume/Testing/Cxx/TestGPURayCastAdditive1.cxx b/Rendering/Volume/Testing/Cxx/TestGPURayCastAdditive1.cxx
new file mode 100644
index 0000000..6af0ed9
--- /dev/null
+++ b/Rendering/Volume/Testing/Cxx/TestGPURayCastAdditive1.cxx
@@ -0,0 +1,162 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+  Module:    TestGPURayCastAdditive1.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.
+
+=========================================================================*/
+// This test covers additive method.
+// This test volume renders a synthetic dataset with unsigned char values,
+// with the additive method.
+
+#include "vtkCamera.h"
+#include "vtkColorTransferFunction.h"
+#include "vtkDataArray.h"
+#include "vtkGPUVolumeRayCastMapper.h"
+#include "vtkImageData.h"
+#include "vtkImageShiftScale.h"
+#include "vtkPiecewiseFunction.h"
+#include "vtkPointData.h"
+#include "vtkRegressionTestImage.h"
+#include "vtkRenderWindow.h"
+#include "vtkRenderWindowInteractor.h"
+#include "vtkRenderer.h"
+#include "vtkTestUtilities.h"
+#include "vtkVolumeProperty.h"
+
+int TestGPURayCastAdditive1(int argc, char *argv[])
+{
+  cout << "CTEST_FULL_OUTPUT (Avoid ctest truncation of output)" << endl;
+
+  // Create a spherical implicit function.
+  vtkSphere *shape=vtkSphere::New();
+  shape->SetRadius(0.1);
+  shape->SetCenter(0.0,0.0,0.0);
+
+  vtkSampleFunction *source=vtkSampleFunction::New();
+  source->SetImplicitFunction(shape);
+  shape->Delete();
+  source->SetOutputScalarTypeToDouble();
+  source->SetSampleDimensions(127,127,127); // intentional NPOT dimensions.
+  source->SetModelBounds(-1.0,1.0,-1.0,1.0,-1.0,1.0);
+  source->SetCapping(false);
+  source->SetComputeNormals(false);
+  source->SetScalarArrayName("values");
+
+  source->Update();
+
+  vtkDataArray *a=source->GetOutput()->GetPointData()->GetScalars("values");
+  double range[2];
+  a->GetRange(range);
+
+  vtkImageShiftScale *t=vtkImageShiftScale::New();
+  t->SetInputConnection(source->GetOutputPort());
+  source->Delete();
+  t->SetShift(-range[0]);
+  double magnitude=range[1]-range[0];
+  if(magnitude==0.0)
+    {
+    magnitude=1.0;
+    }
+  t->SetScale(255.0/magnitude);
+  t->SetOutputScalarTypeToUnsignedChar();
+
+  t->Update();
+
+  vtkRenderWindow *renWin=vtkRenderWindow::New();
+  vtkRenderer *ren1=vtkRenderer::New();
+  ren1->SetBackground(0.1,0.4,0.2);
+
+  renWin->AddRenderer(ren1);
+  ren1->Delete();
+  renWin->SetSize(301,300); // intentional odd and NPOT  width/height
+
+  vtkRenderWindowInteractor *iren=vtkRenderWindowInteractor::New();
+  iren->SetRenderWindow(renWin);
+  renWin->Delete();
+
+  renWin->Render(); // make sure we have an OpenGL context.
+
+  vtkGPUVolumeRayCastMapper *volumeMapper;
+  vtkVolumeProperty *volumeProperty;
+  vtkVolume *volume;
+
+  volumeMapper=vtkGPUVolumeRayCastMapper::New();
+  volumeMapper->SetSampleDistance(0.01);
+  volumeMapper->SetBlendModeToComposite(); // composite first
+  volumeMapper->SetInputConnection(
+    t->GetOutputPort());
+
+  volumeProperty=vtkVolumeProperty::New();
+  volumeProperty->ShadeOff();
+  volumeProperty->SetInterpolationType(VTK_LINEAR_INTERPOLATION);
+
+  vtkPiecewiseFunction *additiveOpacity = vtkPiecewiseFunction::New();
+  additiveOpacity->AddPoint(0.0,0.0);
+  additiveOpacity->AddPoint(200.0,0.5);
+  additiveOpacity->AddPoint(200.1,1.0);
+  additiveOpacity->AddPoint(255.0,1.0);
+
+  vtkPiecewiseFunction *compositeOpacity = vtkPiecewiseFunction::New();
+  compositeOpacity->AddPoint(0.0,0.0);
+  compositeOpacity->AddPoint(80.0,1.0);
+  compositeOpacity->AddPoint(80.1,0.0);
+  compositeOpacity->AddPoint(255.0,0.0);
+  volumeProperty->SetScalarOpacity(compositeOpacity); // composite first.
+
+  vtkColorTransferFunction *color=vtkColorTransferFunction::New();
+  color->AddRGBPoint(0.0  ,0.0,0.0,1.0);
+  color->AddRGBPoint(40.0  ,1.0,0.0,0.0);
+  color->AddRGBPoint(255.0,1.0,1.0,1.0);
+  volumeProperty->SetColor(color);
+  color->Delete();
+
+  volume=vtkVolume::New();
+  volume->SetMapper(volumeMapper);
+  volume->SetProperty(volumeProperty);
+  ren1->AddViewProp(volume);
+
+  //int valid=volumeMapper->IsRenderSupported(renWin,volumeProperty);
+
+  int retVal;
+  if(1)
+    {
+    ren1->ResetCamera();
+
+    // Render composite.
+    renWin->Render();
+
+    // Switch to Additive
+    volumeMapper->SetBlendModeToAdditive();
+    volumeProperty->SetScalarOpacity(additiveOpacity);
+    renWin->Render();
+
+    retVal = vtkTesting::Test(argc, argv, renWin, 75);
+    if (retVal == vtkRegressionTester::DO_INTERACTOR)
+      {
+      iren->Start();
+      }
+    }
+  else
+    {
+    retVal=vtkTesting::PASSED;
+    cout << "Required extensions not supported." << endl;
+    }
+
+  volumeMapper->Delete();
+  volumeProperty->Delete();
+  volume->Delete();
+  iren->Delete();
+  t->Delete();
+  additiveOpacity->Delete();
+  compositeOpacity->Delete();
+
+  return !((retVal == vtkTesting::PASSED) || (retVal == vtkTesting::DO_INTERACTOR));
+}
diff --git a/Rendering/Volume/Testing/Cxx/TestGPURayCastCameraInside.cxx b/Rendering/Volume/Testing/Cxx/TestGPURayCastCameraInside.cxx
deleted file mode 100644
index 9dadab0..0000000
--- a/Rendering/Volume/Testing/Cxx/TestGPURayCastCameraInside.cxx
+++ /dev/null
@@ -1,968 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    TestGPURayCastCameraInside.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.
-
-=========================================================================*/
-
-// Description
-// This is a test for clipping of volume using the camera near plane when the
-// camera is inside the volume. The test renders the ironProt dataset and
-// dollies the camera inside the dataset.
-
-#include "vtkColorTransferFunction.h"
-#include "vtkGPUVolumeRayCastMapper.h"
-#include "vtkInteractorStyleTrackballCamera.h"
-#include "vtkNew.h"
-#include "vtkPiecewiseFunction.h"
-#include "vtkRenderer.h"
-#include "vtkRenderWindow.h"
-#include "vtkRenderWindowInteractor.h"
-#include "vtkStructuredPointsReader.h"
-#include "vtkTesting.h"
-#include "vtkTestUtilities.h"
-#include "vtkVolume.h"
-#include "vtkVolumeProperty.h"
-
-static const char* TestGPURayCastCameraInsideLog =
-"# StreamVersion 1\n"
-"EnterEvent 298 27 0 0 0 0 0\n"
-"MouseMoveEvent 298 27 0 0 0 0 0\n"
-"MouseMoveEvent 289 39 0 0 0 0 0\n"
-"MouseMoveEvent 280 52 0 0 0 0 0\n"
-"MouseMoveEvent 271 64 0 0 0 0 0\n"
-"MouseMoveEvent 263 77 0 0 0 0 0\n"
-"MouseMoveEvent 256 88 0 0 0 0 0\n"
-"MouseMoveEvent 249 99 0 0 0 0 0\n"
-"MouseMoveEvent 240 110 0 0 0 0 0\n"
-"MouseMoveEvent 231 121 0 0 0 0 0\n"
-"MouseMoveEvent 226 128 0 0 0 0 0\n"
-"MouseMoveEvent 219 135 0 0 0 0 0\n"
-"MouseMoveEvent 214 142 0 0 0 0 0\n"
-"MouseMoveEvent 209 147 0 0 0 0 0\n"
-"MouseMoveEvent 205 151 0 0 0 0 0\n"
-"MouseMoveEvent 204 152 0 0 0 0 0\n"
-"MouseMoveEvent 203 153 0 0 0 0 0\n"
-"MouseMoveEvent 202 153 0 0 0 0 0\n"
-"MouseMoveEvent 201 152 0 0 0 0 0\n"
-"MouseMoveEvent 201 151 0 0 0 0 0\n"
-"MouseMoveEvent 201 149 0 0 0 0 0\n"
-"MouseMoveEvent 201 148 0 0 0 0 0\n"
-"MouseMoveEvent 201 147 0 0 0 0 0\n"
-"MouseMoveEvent 201 146 0 0 0 0 0\n"
-"MouseMoveEvent 201 145 0 0 0 0 0\n"
-"MouseMoveEvent 201 144 0 0 0 0 0\n"
-"MouseMoveEvent 200 143 0 0 0 0 0\n"
-"MouseMoveEvent 200 142 0 0 0 0 0\n"
-"MouseWheelForwardEvent 200 142 0 0 0 0 0\n"
-"StartInteractionEvent 200 142 0 0 0 0 0\n"
-"RenderEvent 200 142 0 0 0 0 0\n"
-"EndInteractionEvent 200 142 0 0 0 0 0\n"
-"RenderEvent 200 142 0 0 0 0 0\n"
-"MouseWheelForwardEvent 200 142 0 0 0 1 0\n"
-"StartInteractionEvent 200 142 0 0 0 1 0\n"
-"RenderEvent 200 142 0 0 0 1 0\n"
-"EndInteractionEvent 200 142 0 0 0 1 0\n"
-"RenderEvent 200 142 0 0 0 1 0\n"
-"MouseWheelForwardEvent 200 142 0 0 0 0 0\n"
-"StartInteractionEvent 200 142 0 0 0 0 0\n"
-"RenderEvent 200 142 0 0 0 0 0\n"
-"EndInteractionEvent 200 142 0 0 0 0 0\n"
-"RenderEvent 200 142 0 0 0 0 0\n"
-"MouseWheelForwardEvent 200 142 0 0 0 1 0\n"
-"StartInteractionEvent 200 142 0 0 0 1 0\n"
-"RenderEvent 200 142 0 0 0 1 0\n"
-"EndInteractionEvent 200 142 0 0 0 1 0\n"
-"RenderEvent 200 142 0 0 0 1 0\n"
-"MouseWheelForwardEvent 200 142 0 0 0 0 0\n"
-"StartInteractionEvent 200 142 0 0 0 0 0\n"
-"RenderEvent 200 142 0 0 0 0 0\n"
-"EndInteractionEvent 200 142 0 0 0 0 0\n"
-"RenderEvent 200 142 0 0 0 0 0\n"
-"MouseWheelForwardEvent 200 142 0 0 0 1 0\n"
-"StartInteractionEvent 200 142 0 0 0 1 0\n"
-"RenderEvent 200 142 0 0 0 1 0\n"
-"EndInteractionEvent 200 142 0 0 0 1 0\n"
-"RenderEvent 200 142 0 0 0 1 0\n"
-"MouseWheelForwardEvent 200 142 0 0 0 0 0\n"
-"StartInteractionEvent 200 142 0 0 0 0 0\n"
-"RenderEvent 200 142 0 0 0 0 0\n"
-"EndInteractionEvent 200 142 0 0 0 0 0\n"
-"RenderEvent 200 142 0 0 0 0 0\n"
-"MouseWheelForwardEvent 200 142 0 0 0 1 0\n"
-"StartInteractionEvent 200 142 0 0 0 1 0\n"
-"RenderEvent 200 142 0 0 0 1 0\n"
-"EndInteractionEvent 200 142 0 0 0 1 0\n"
-"RenderEvent 200 142 0 0 0 1 0\n"
-"MouseWheelForwardEvent 200 142 0 0 0 0 0\n"
-"StartInteractionEvent 200 142 0 0 0 0 0\n"
-"RenderEvent 200 142 0 0 0 0 0\n"
-"EndInteractionEvent 200 142 0 0 0 0 0\n"
-"RenderEvent 200 142 0 0 0 0 0\n"
-"MouseWheelForwardEvent 200 142 0 0 0 1 0\n"
-"StartInteractionEvent 200 142 0 0 0 1 0\n"
-"RenderEvent 200 142 0 0 0 1 0\n"
-"EndInteractionEvent 200 142 0 0 0 1 0\n"
-"RenderEvent 200 142 0 0 0 1 0\n"
-"MouseWheelForwardEvent 200 142 0 0 0 0 0\n"
-"StartInteractionEvent 200 142 0 0 0 0 0\n"
-"RenderEvent 200 142 0 0 0 0 0\n"
-"EndInteractionEvent 200 142 0 0 0 0 0\n"
-"RenderEvent 200 142 0 0 0 0 0\n"
-"MouseWheelForwardEvent 200 142 0 0 0 1 0\n"
-"StartInteractionEvent 200 142 0 0 0 1 0\n"
-"RenderEvent 200 142 0 0 0 1 0\n"
-"EndInteractionEvent 200 142 0 0 0 1 0\n"
-"RenderEvent 200 142 0 0 0 1 0\n"
-"MouseWheelForwardEvent 200 142 0 0 0 0 0\n"
-"StartInteractionEvent 200 142 0 0 0 0 0\n"
-"RenderEvent 200 142 0 0 0 0 0\n"
-"EndInteractionEvent 200 142 0 0 0 0 0\n"
-"RenderEvent 200 142 0 0 0 0 0\n"
-"MouseWheelForwardEvent 200 142 0 0 0 1 0\n"
-"StartInteractionEvent 200 142 0 0 0 1 0\n"
-"RenderEvent 200 142 0 0 0 1 0\n"
-"EndInteractionEvent 200 142 0 0 0 1 0\n"
-"RenderEvent 200 142 0 0 0 1 0\n"
-"MouseWheelForwardEvent 200 142 0 0 0 0 0\n"
-"StartInteractionEvent 200 142 0 0 0 0 0\n"
-"RenderEvent 200 142 0 0 0 0 0\n"
-"EndInteractionEvent 200 142 0 0 0 0 0\n"
-"RenderEvent 200 142 0 0 0 0 0\n"
-"MouseWheelForwardEvent 200 142 0 0 0 1 0\n"
-"StartInteractionEvent 200 142 0 0 0 1 0\n"
-"RenderEvent 200 142 0 0 0 1 0\n"
-"EndInteractionEvent 200 142 0 0 0 1 0\n"
-"RenderEvent 200 142 0 0 0 1 0\n"
-"MouseWheelForwardEvent 200 142 0 0 0 0 0\n"
-"StartInteractionEvent 200 142 0 0 0 0 0\n"
-"RenderEvent 200 142 0 0 0 0 0\n"
-"EndInteractionEvent 200 142 0 0 0 0 0\n"
-"RenderEvent 200 142 0 0 0 0 0\n"
-"MouseWheelForwardEvent 200 142 0 0 0 1 0\n"
-"StartInteractionEvent 200 142 0 0 0 1 0\n"
-"RenderEvent 200 142 0 0 0 1 0\n"
-"EndInteractionEvent 200 142 0 0 0 1 0\n"
-"RenderEvent 200 142 0 0 0 1 0\n"
-"MouseWheelForwardEvent 200 142 0 0 0 0 0\n"
-"StartInteractionEvent 200 142 0 0 0 0 0\n"
-"RenderEvent 200 142 0 0 0 0 0\n"
-"EndInteractionEvent 200 142 0 0 0 0 0\n"
-"RenderEvent 200 142 0 0 0 0 0\n"
-"MouseWheelForwardEvent 200 142 0 0 0 1 0\n"
-"StartInteractionEvent 200 142 0 0 0 1 0\n"
-"RenderEvent 200 142 0 0 0 1 0\n"
-"EndInteractionEvent 200 142 0 0 0 1 0\n"
-"RenderEvent 200 142 0 0 0 1 0\n"
-"MouseWheelForwardEvent 200 142 0 0 0 0 0\n"
-"StartInteractionEvent 200 142 0 0 0 0 0\n"
-"RenderEvent 200 142 0 0 0 0 0\n"
-"EndInteractionEvent 200 142 0 0 0 0 0\n"
-"RenderEvent 200 142 0 0 0 0 0\n"
-"MouseWheelForwardEvent 200 142 0 0 0 1 0\n"
-"StartInteractionEvent 200 142 0 0 0 1 0\n"
-"RenderEvent 200 142 0 0 0 1 0\n"
-"EndInteractionEvent 200 142 0 0 0 1 0\n"
-"RenderEvent 200 142 0 0 0 1 0\n"
-"MouseWheelForwardEvent 200 142 0 0 0 0 0\n"
-"StartInteractionEvent 200 142 0 0 0 0 0\n"
-"RenderEvent 200 142 0 0 0 0 0\n"
-"EndInteractionEvent 200 142 0 0 0 0 0\n"
-"RenderEvent 200 142 0 0 0 0 0\n"
-"MouseWheelForwardEvent 200 142 0 0 0 1 0\n"
-"StartInteractionEvent 200 142 0 0 0 1 0\n"
-"RenderEvent 200 142 0 0 0 1 0\n"
-"EndInteractionEvent 200 142 0 0 0 1 0\n"
-"RenderEvent 200 142 0 0 0 1 0\n"
-"MouseWheelForwardEvent 200 142 0 0 0 0 0\n"
-"StartInteractionEvent 200 142 0 0 0 0 0\n"
-"RenderEvent 200 142 0 0 0 0 0\n"
-"EndInteractionEvent 200 142 0 0 0 0 0\n"
-"RenderEvent 200 142 0 0 0 0 0\n"
-"MouseWheelForwardEvent 200 142 0 0 0 1 0\n"
-"StartInteractionEvent 200 142 0 0 0 1 0\n"
-"RenderEvent 200 142 0 0 0 1 0\n"
-"EndInteractionEvent 200 142 0 0 0 1 0\n"
-"RenderEvent 200 142 0 0 0 1 0\n"
-"MouseWheelForwardEvent 200 142 0 0 0 0 0\n"
-"StartInteractionEvent 200 142 0 0 0 0 0\n"
-"RenderEvent 200 142 0 0 0 0 0\n"
-"EndInteractionEvent 200 142 0 0 0 0 0\n"
-"RenderEvent 200 142 0 0 0 0 0\n"
-"MouseWheelForwardEvent 200 142 0 0 0 1 0\n"
-"StartInteractionEvent 200 142 0 0 0 1 0\n"
-"RenderEvent 200 142 0 0 0 1 0\n"
-"EndInteractionEvent 200 142 0 0 0 1 0\n"
-"RenderEvent 200 142 0 0 0 1 0\n"
-"MouseWheelForwardEvent 200 142 0 0 0 0 0\n"
-"StartInteractionEvent 200 142 0 0 0 0 0\n"
-"RenderEvent 200 142 0 0 0 0 0\n"
-"EndInteractionEvent 200 142 0 0 0 0 0\n"
-"RenderEvent 200 142 0 0 0 0 0\n"
-"MouseWheelForwardEvent 200 142 0 0 0 1 0\n"
-"StartInteractionEvent 200 142 0 0 0 1 0\n"
-"RenderEvent 200 142 0 0 0 1 0\n"
-"EndInteractionEvent 200 142 0 0 0 1 0\n"
-"RenderEvent 200 142 0 0 0 1 0\n"
-"MouseWheelForwardEvent 200 142 0 0 0 0 0\n"
-"StartInteractionEvent 200 142 0 0 0 0 0\n"
-"RenderEvent 200 142 0 0 0 0 0\n"
-"EndInteractionEvent 200 142 0 0 0 0 0\n"
-"RenderEvent 200 142 0 0 0 0 0\n"
-"MouseWheelForwardEvent 200 142 0 0 0 1 0\n"
-"StartInteractionEvent 200 142 0 0 0 1 0\n"
-"RenderEvent 200 142 0 0 0 1 0\n"
-"EndInteractionEvent 200 142 0 0 0 1 0\n"
-"RenderEvent 200 142 0 0 0 1 0\n"
-"MouseWheelForwardEvent 200 142 0 0 0 0 0\n"
-"StartInteractionEvent 200 142 0 0 0 0 0\n"
-"RenderEvent 200 142 0 0 0 0 0\n"
-"EndInteractionEvent 200 142 0 0 0 0 0\n"
-"RenderEvent 200 142 0 0 0 0 0\n"
-"MouseWheelForwardEvent 200 142 0 0 0 1 0\n"
-"StartInteractionEvent 200 142 0 0 0 1 0\n"
-"RenderEvent 200 142 0 0 0 1 0\n"
-"EndInteractionEvent 200 142 0 0 0 1 0\n"
-"RenderEvent 200 142 0 0 0 1 0\n"
-"MouseWheelForwardEvent 200 142 0 0 0 0 0\n"
-"StartInteractionEvent 200 142 0 0 0 0 0\n"
-"RenderEvent 200 142 0 0 0 0 0\n"
-"EndInteractionEvent 200 142 0 0 0 0 0\n"
-"RenderEvent 200 142 0 0 0 0 0\n"
-"MouseWheelForwardEvent 200 142 0 0 0 1 0\n"
-"StartInteractionEvent 200 142 0 0 0 1 0\n"
-"RenderEvent 200 142 0 0 0 1 0\n"
-"EndInteractionEvent 200 142 0 0 0 1 0\n"
-"RenderEvent 200 142 0 0 0 1 0\n"
-"MouseWheelBackwardEvent 200 142 0 0 0 0 0\n"
-"StartInteractionEvent 200 142 0 0 0 0 0\n"
-"RenderEvent 200 142 0 0 0 0 0\n"
-"EndInteractionEvent 200 142 0 0 0 0 0\n"
-"RenderEvent 200 142 0 0 0 0 0\n"
-"MouseWheelBackwardEvent 200 142 0 0 0 1 0\n"
-"StartInteractionEvent 200 142 0 0 0 1 0\n"
-"RenderEvent 200 142 0 0 0 1 0\n"
-"EndInteractionEvent 200 142 0 0 0 1 0\n"
-"RenderEvent 200 142 0 0 0 1 0\n"
-"MouseWheelBackwardEvent 200 142 0 0 0 0 0\n"
-"StartInteractionEvent 200 142 0 0 0 0 0\n"
-"RenderEvent 200 142 0 0 0 0 0\n"
-"EndInteractionEvent 200 142 0 0 0 0 0\n"
-"RenderEvent 200 142 0 0 0 0 0\n"
-"MouseWheelBackwardEvent 200 142 0 0 0 1 0\n"
-"StartInteractionEvent 200 142 0 0 0 1 0\n"
-"RenderEvent 200 142 0 0 0 1 0\n"
-"EndInteractionEvent 200 142 0 0 0 1 0\n"
-"RenderEvent 200 142 0 0 0 1 0\n"
-"MouseWheelBackwardEvent 200 142 0 0 0 0 0\n"
-"StartInteractionEvent 200 142 0 0 0 0 0\n"
-"RenderEvent 200 142 0 0 0 0 0\n"
-"EndInteractionEvent 200 142 0 0 0 0 0\n"
-"RenderEvent 200 142 0 0 0 0 0\n"
-"MouseWheelBackwardEvent 200 142 0 0 0 1 0\n"
-"StartInteractionEvent 200 142 0 0 0 1 0\n"
-"RenderEvent 200 142 0 0 0 1 0\n"
-"EndInteractionEvent 200 142 0 0 0 1 0\n"
-"RenderEvent 200 142 0 0 0 1 0\n"
-"MouseWheelBackwardEvent 200 142 0 0 0 0 0\n"
-"StartInteractionEvent 200 142 0 0 0 0 0\n"
-"RenderEvent 200 142 0 0 0 0 0\n"
-"EndInteractionEvent 200 142 0 0 0 0 0\n"
-"RenderEvent 200 142 0 0 0 0 0\n"
-"MouseWheelBackwardEvent 200 142 0 0 0 1 0\n"
-"StartInteractionEvent 200 142 0 0 0 1 0\n"
-"RenderEvent 200 142 0 0 0 1 0\n"
-"EndInteractionEvent 200 142 0 0 0 1 0\n"
-"RenderEvent 200 142 0 0 0 1 0\n"
-"MouseWheelBackwardEvent 200 142 0 0 0 0 0\n"
-"StartInteractionEvent 200 142 0 0 0 0 0\n"
-"RenderEvent 200 142 0 0 0 0 0\n"
-"EndInteractionEvent 200 142 0 0 0 0 0\n"
-"RenderEvent 200 142 0 0 0 0 0\n"
-"MouseWheelBackwardEvent 200 142 0 0 0 1 0\n"
-"StartInteractionEvent 200 142 0 0 0 1 0\n"
-"RenderEvent 200 142 0 0 0 1 0\n"
-"EndInteractionEvent 200 142 0 0 0 1 0\n"
-"RenderEvent 200 142 0 0 0 1 0\n"
-"MouseWheelBackwardEvent 200 142 0 0 0 0 0\n"
-"StartInteractionEvent 200 142 0 0 0 0 0\n"
-"RenderEvent 200 142 0 0 0 0 0\n"
-"EndInteractionEvent 200 142 0 0 0 0 0\n"
-"RenderEvent 200 142 0 0 0 0 0\n"
-"MouseWheelBackwardEvent 200 142 0 0 0 1 0\n"
-"StartInteractionEvent 200 142 0 0 0 1 0\n"
-"RenderEvent 200 142 0 0 0 1 0\n"
-"EndInteractionEvent 200 142 0 0 0 1 0\n"
-"RenderEvent 200 142 0 0 0 1 0\n"
-"MouseWheelBackwardEvent 200 142 0 0 0 0 0\n"
-"StartInteractionEvent 200 142 0 0 0 0 0\n"
-"RenderEvent 200 142 0 0 0 0 0\n"
-"EndInteractionEvent 200 142 0 0 0 0 0\n"
-"RenderEvent 200 142 0 0 0 0 0\n"
-"MouseWheelBackwardEvent 200 142 0 0 0 1 0\n"
-"StartInteractionEvent 200 142 0 0 0 1 0\n"
-"RenderEvent 200 142 0 0 0 1 0\n"
-"EndInteractionEvent 200 142 0 0 0 1 0\n"
-"RenderEvent 200 142 0 0 0 1 0\n"
-"MouseWheelBackwardEvent 200 142 0 0 0 0 0\n"
-"StartInteractionEvent 200 142 0 0 0 0 0\n"
-"RenderEvent 200 142 0 0 0 0 0\n"
-"EndInteractionEvent 200 142 0 0 0 0 0\n"
-"RenderEvent 200 142 0 0 0 0 0\n"
-"MouseMoveEvent 200 141 0 0 0 0 0\n"
-"MouseWheelBackwardEvent 200 141 0 0 0 1 0\n"
-"StartInteractionEvent 200 141 0 0 0 1 0\n"
-"RenderEvent 200 141 0 0 0 1 0\n"
-"EndInteractionEvent 200 141 0 0 0 1 0\n"
-"RenderEvent 200 141 0 0 0 1 0\n"
-"MouseWheelBackwardEvent 200 141 0 0 0 0 0\n"
-"StartInteractionEvent 200 141 0 0 0 0 0\n"
-"RenderEvent 200 141 0 0 0 0 0\n"
-"EndInteractionEvent 200 141 0 0 0 0 0\n"
-"RenderEvent 200 141 0 0 0 0 0\n"
-"MouseWheelBackwardEvent 200 141 0 0 0 1 0\n"
-"StartInteractionEvent 200 141 0 0 0 1 0\n"
-"RenderEvent 200 141 0 0 0 1 0\n"
-"EndInteractionEvent 200 141 0 0 0 1 0\n"
-"RenderEvent 200 141 0 0 0 1 0\n"
-"MouseWheelBackwardEvent 200 141 0 0 0 0 0\n"
-"StartInteractionEvent 200 141 0 0 0 0 0\n"
-"RenderEvent 200 141 0 0 0 0 0\n"
-"EndInteractionEvent 200 141 0 0 0 0 0\n"
-"RenderEvent 200 141 0 0 0 0 0\n"
-"MouseWheelBackwardEvent 200 141 0 0 0 1 0\n"
-"StartInteractionEvent 200 141 0 0 0 1 0\n"
-"RenderEvent 200 141 0 0 0 1 0\n"
-"EndInteractionEvent 200 141 0 0 0 1 0\n"
-"RenderEvent 200 141 0 0 0 1 0\n"
-"MouseWheelBackwardEvent 200 141 0 0 0 0 0\n"
-"StartInteractionEvent 200 141 0 0 0 0 0\n"
-"RenderEvent 200 141 0 0 0 0 0\n"
-"EndInteractionEvent 200 141 0 0 0 0 0\n"
-"RenderEvent 200 141 0 0 0 0 0\n"
-"MouseWheelBackwardEvent 200 141 0 0 0 1 0\n"
-"StartInteractionEvent 200 141 0 0 0 1 0\n"
-"RenderEvent 200 141 0 0 0 1 0\n"
-"EndInteractionEvent 200 141 0 0 0 1 0\n"
-"RenderEvent 200 141 0 0 0 1 0\n"
-"MouseWheelBackwardEvent 200 141 0 0 0 0 0\n"
-"StartInteractionEvent 200 141 0 0 0 0 0\n"
-"RenderEvent 200 141 0 0 0 0 0\n"
-"EndInteractionEvent 200 141 0 0 0 0 0\n"
-"RenderEvent 200 141 0 0 0 0 0\n"
-"MouseWheelBackwardEvent 200 141 0 0 0 1 0\n"
-"StartInteractionEvent 200 141 0 0 0 1 0\n"
-"RenderEvent 200 141 0 0 0 1 0\n"
-"EndInteractionEvent 200 141 0 0 0 1 0\n"
-"RenderEvent 200 141 0 0 0 1 0\n"
-"MouseWheelBackwardEvent 200 141 0 0 0 0 0\n"
-"StartInteractionEvent 200 141 0 0 0 0 0\n"
-"RenderEvent 200 141 0 0 0 0 0\n"
-"EndInteractionEvent 200 141 0 0 0 0 0\n"
-"RenderEvent 200 141 0 0 0 0 0\n"
-"MouseWheelBackwardEvent 200 141 0 0 0 0 0\n"
-"StartInteractionEvent 200 141 0 0 0 0 0\n"
-"RenderEvent 200 141 0 0 0 0 0\n"
-"EndInteractionEvent 200 141 0 0 0 0 0\n"
-"RenderEvent 200 141 0 0 0 0 0\n"
-"MouseWheelBackwardEvent 200 141 0 0 0 1 0\n"
-"StartInteractionEvent 200 141 0 0 0 1 0\n"
-"RenderEvent 200 141 0 0 0 1 0\n"
-"EndInteractionEvent 200 141 0 0 0 1 0\n"
-"RenderEvent 200 141 0 0 0 1 0\n"
-"MouseWheelBackwardEvent 200 141 0 0 0 0 0\n"
-"StartInteractionEvent 200 141 0 0 0 0 0\n"
-"RenderEvent 200 141 0 0 0 0 0\n"
-"EndInteractionEvent 200 141 0 0 0 0 0\n"
-"RenderEvent 200 141 0 0 0 0 0\n"
-"MouseWheelBackwardEvent 200 141 0 0 0 0 0\n"
-"StartInteractionEvent 200 141 0 0 0 0 0\n"
-"RenderEvent 200 141 0 0 0 0 0\n"
-"EndInteractionEvent 200 141 0 0 0 0 0\n"
-"RenderEvent 200 141 0 0 0 0 0\n"
-"MouseMoveEvent 198 141 0 0 0 0 0\n"
-"MouseMoveEvent 195 144 0 0 0 0 0\n"
-"MouseMoveEvent 189 148 0 0 0 0 0\n"
-"MouseMoveEvent 185 150 0 0 0 0 0\n"
-"MouseMoveEvent 181 152 0 0 0 0 0\n"
-"MouseMoveEvent 177 154 0 0 0 0 0\n"
-"MouseMoveEvent 174 155 0 0 0 0 0\n"
-"MouseMoveEvent 171 159 0 0 0 0 0\n"
-"MouseMoveEvent 167 161 0 0 0 0 0\n"
-"MouseMoveEvent 163 163 0 0 0 0 0\n"
-"MouseMoveEvent 160 164 0 0 0 0 0\n"
-"MouseMoveEvent 159 165 0 0 0 0 0\n"
-"MouseMoveEvent 158 167 0 0 0 0 0\n"
-"MouseMoveEvent 157 170 0 0 0 0 0\n"
-"MouseMoveEvent 155 173 0 0 0 0 0\n"
-"MouseMoveEvent 154 174 0 0 0 0 0\n"
-"MouseMoveEvent 154 175 0 0 0 0 0\n"
-"LeftButtonPressEvent 154 175 0 0 0 0 0\n"
-"StartInteractionEvent 154 175 0 0 0 0 0\n"
-"MouseMoveEvent 153 176 0 0 0 0 0\n"
-"RenderEvent 153 176 0 0 0 0 0\n"
-"InteractionEvent 153 176 0 0 0 0 0\n"
-"MouseMoveEvent 152 175 0 0 0 0 0\n"
-"RenderEvent 152 175 0 0 0 0 0\n"
-"InteractionEvent 152 175 0 0 0 0 0\n"
-"MouseMoveEvent 152 174 0 0 0 0 0\n"
-"RenderEvent 152 174 0 0 0 0 0\n"
-"InteractionEvent 152 174 0 0 0 0 0\n"
-"MouseMoveEvent 152 173 0 0 0 0 0\n"
-"RenderEvent 152 173 0 0 0 0 0\n"
-"InteractionEvent 152 173 0 0 0 0 0\n"
-"MouseMoveEvent 152 172 0 0 0 0 0\n"
-"RenderEvent 152 172 0 0 0 0 0\n"
-"InteractionEvent 152 172 0 0 0 0 0\n"
-"MouseMoveEvent 152 169 0 0 0 0 0\n"
-"RenderEvent 152 169 0 0 0 0 0\n"
-"InteractionEvent 152 169 0 0 0 0 0\n"
-"MouseMoveEvent 152 168 0 0 0 0 0\n"
-"RenderEvent 152 168 0 0 0 0 0\n"
-"InteractionEvent 152 168 0 0 0 0 0\n"
-"MouseMoveEvent 152 165 0 0 0 0 0\n"
-"RenderEvent 152 165 0 0 0 0 0\n"
-"InteractionEvent 152 165 0 0 0 0 0\n"
-"MouseMoveEvent 152 162 0 0 0 0 0\n"
-"RenderEvent 152 162 0 0 0 0 0\n"
-"InteractionEvent 152 162 0 0 0 0 0\n"
-"MouseMoveEvent 152 160 0 0 0 0 0\n"
-"RenderEvent 152 160 0 0 0 0 0\n"
-"InteractionEvent 152 160 0 0 0 0 0\n"
-"MouseMoveEvent 152 156 0 0 0 0 0\n"
-"RenderEvent 152 156 0 0 0 0 0\n"
-"InteractionEvent 152 156 0 0 0 0 0\n"
-"MouseMoveEvent 152 152 0 0 0 0 0\n"
-"RenderEvent 152 152 0 0 0 0 0\n"
-"InteractionEvent 152 152 0 0 0 0 0\n"
-"MouseMoveEvent 152 148 0 0 0 0 0\n"
-"RenderEvent 152 148 0 0 0 0 0\n"
-"InteractionEvent 152 148 0 0 0 0 0\n"
-"MouseMoveEvent 152 144 0 0 0 0 0\n"
-"RenderEvent 152 144 0 0 0 0 0\n"
-"InteractionEvent 152 144 0 0 0 0 0\n"
-"MouseMoveEvent 152 141 0 0 0 0 0\n"
-"RenderEvent 152 141 0 0 0 0 0\n"
-"InteractionEvent 152 141 0 0 0 0 0\n"
-"MouseMoveEvent 152 138 0 0 0 0 0\n"
-"RenderEvent 152 138 0 0 0 0 0\n"
-"InteractionEvent 152 138 0 0 0 0 0\n"
-"MouseMoveEvent 152 134 0 0 0 0 0\n"
-"RenderEvent 152 134 0 0 0 0 0\n"
-"InteractionEvent 152 134 0 0 0 0 0\n"
-"MouseMoveEvent 152 130 0 0 0 0 0\n"
-"RenderEvent 152 130 0 0 0 0 0\n"
-"InteractionEvent 152 130 0 0 0 0 0\n"
-"MouseMoveEvent 152 127 0 0 0 0 0\n"
-"RenderEvent 152 127 0 0 0 0 0\n"
-"InteractionEvent 152 127 0 0 0 0 0\n"
-"MouseMoveEvent 152 123 0 0 0 0 0\n"
-"RenderEvent 152 123 0 0 0 0 0\n"
-"InteractionEvent 152 123 0 0 0 0 0\n"
-"MouseMoveEvent 152 119 0 0 0 0 0\n"
-"RenderEvent 152 119 0 0 0 0 0\n"
-"InteractionEvent 152 119 0 0 0 0 0\n"
-"MouseMoveEvent 151 115 0 0 0 0 0\n"
-"RenderEvent 151 115 0 0 0 0 0\n"
-"InteractionEvent 151 115 0 0 0 0 0\n"
-"MouseMoveEvent 151 113 0 0 0 0 0\n"
-"RenderEvent 151 113 0 0 0 0 0\n"
-"InteractionEvent 151 113 0 0 0 0 0\n"
-"MouseMoveEvent 151 112 0 0 0 0 0\n"
-"RenderEvent 151 112 0 0 0 0 0\n"
-"InteractionEvent 151 112 0 0 0 0 0\n"
-"MouseMoveEvent 151 111 0 0 0 0 0\n"
-"RenderEvent 151 111 0 0 0 0 0\n"
-"InteractionEvent 151 111 0 0 0 0 0\n"
-"MouseMoveEvent 151 110 0 0 0 0 0\n"
-"RenderEvent 151 110 0 0 0 0 0\n"
-"InteractionEvent 151 110 0 0 0 0 0\n"
-"MouseMoveEvent 150 109 0 0 0 0 0\n"
-"RenderEvent 150 109 0 0 0 0 0\n"
-"InteractionEvent 150 109 0 0 0 0 0\n"
-"MouseMoveEvent 150 110 0 0 0 0 0\n"
-"RenderEvent 150 110 0 0 0 0 0\n"
-"InteractionEvent 150 110 0 0 0 0 0\n"
-"MouseMoveEvent 150 111 0 0 0 0 0\n"
-"RenderEvent 150 111 0 0 0 0 0\n"
-"InteractionEvent 150 111 0 0 0 0 0\n"
-"MouseMoveEvent 150 112 0 0 0 0 0\n"
-"RenderEvent 150 112 0 0 0 0 0\n"
-"InteractionEvent 150 112 0 0 0 0 0\n"
-"MouseMoveEvent 149 114 0 0 0 0 0\n"
-"RenderEvent 149 114 0 0 0 0 0\n"
-"InteractionEvent 149 114 0 0 0 0 0\n"
-"MouseMoveEvent 148 118 0 0 0 0 0\n"
-"RenderEvent 148 118 0 0 0 0 0\n"
-"InteractionEvent 148 118 0 0 0 0 0\n"
-"MouseMoveEvent 148 122 0 0 0 0 0\n"
-"RenderEvent 148 122 0 0 0 0 0\n"
-"InteractionEvent 148 122 0 0 0 0 0\n"
-"MouseMoveEvent 148 125 0 0 0 0 0\n"
-"RenderEvent 148 125 0 0 0 0 0\n"
-"InteractionEvent 148 125 0 0 0 0 0\n"
-"MouseMoveEvent 148 127 0 0 0 0 0\n"
-"RenderEvent 148 127 0 0 0 0 0\n"
-"InteractionEvent 148 127 0 0 0 0 0\n"
-"LeftButtonReleaseEvent 148 127 0 0 0 0 0\n"
-"EndInteractionEvent 148 127 0 0 0 0 0\n"
-"RenderEvent 148 127 0 0 0 0 0\n"
-"MouseMoveEvent 147 128 0 0 0 0 0\n"
-"MouseMoveEvent 146 127 0 0 0 0 0\n"
-"MouseMoveEvent 146 126 0 0 0 0 0\n"
-"MouseMoveEvent 146 125 0 0 0 0 0\n"
-"MouseMoveEvent 146 124 0 0 0 0 0\n"
-"MouseMoveEvent 146 123 0 0 0 0 0\n"
-"MouseMoveEvent 146 122 0 0 0 0 0\n"
-"MouseMoveEvent 146 120 0 0 0 0 0\n"
-"MouseMoveEvent 146 119 0 0 0 0 0\n"
-"MouseMoveEvent 146 118 0 0 0 0 0\n"
-"MouseMoveEvent 146 117 0 0 0 0 0\n"
-"MouseMoveEvent 146 116 0 0 0 0 0\n"
-"MouseMoveEvent 147 114 0 0 0 0 0\n"
-"MouseMoveEvent 148 113 0 0 0 0 0\n"
-"MouseWheelForwardEvent 148 113 0 0 0 0 0\n"
-"StartInteractionEvent 148 113 0 0 0 0 0\n"
-"RenderEvent 148 113 0 0 0 0 0\n"
-"EndInteractionEvent 148 113 0 0 0 0 0\n"
-"RenderEvent 148 113 0 0 0 0 0\n"
-"MouseWheelForwardEvent 148 113 0 0 0 0 0\n"
-"StartInteractionEvent 148 113 0 0 0 0 0\n"
-"RenderEvent 148 113 0 0 0 0 0\n"
-"EndInteractionEvent 148 113 0 0 0 0 0\n"
-"RenderEvent 148 113 0 0 0 0 0\n"
-"MouseMoveEvent 148 112 0 0 0 0 0\n"
-"MouseMoveEvent 148 111 0 0 0 0 0\n"
-"MouseMoveEvent 148 110 0 0 0 0 0\n"
-"MouseMoveEvent 148 109 0 0 0 0 0\n"
-"MouseMoveEvent 148 108 0 0 0 0 0\n"
-"MouseMoveEvent 148 107 0 0 0 0 0\n"
-"MouseMoveEvent 148 106 0 0 0 0 0\n"
-"MouseMoveEvent 148 105 0 0 0 0 0\n"
-"MouseMoveEvent 148 103 0 0 0 0 0\n"
-"MouseMoveEvent 149 101 0 0 0 0 0\n"
-"MouseMoveEvent 149 99 0 0 0 0 0\n"
-"MouseMoveEvent 150 98 0 0 0 0 0\n"
-"MouseMoveEvent 150 96 0 0 0 0 0\n"
-"MouseMoveEvent 151 95 0 0 0 0 0\n"
-"MouseMoveEvent 152 93 0 0 0 0 0\n"
-"MouseMoveEvent 153 91 0 0 0 0 0\n"
-"MouseMoveEvent 155 88 0 0 0 0 0\n"
-"MouseMoveEvent 156 87 0 0 0 0 0\n"
-"MouseMoveEvent 157 85 0 0 0 0 0\n"
-"MouseMoveEvent 159 83 0 0 0 0 0\n"
-"MouseMoveEvent 160 81 0 0 0 0 0\n"
-"MouseMoveEvent 162 79 0 0 0 0 0\n"
-"MouseMoveEvent 163 77 0 0 0 0 0\n"
-"MouseMoveEvent 164 76 0 0 0 0 0\n"
-"MouseMoveEvent 165 75 0 0 0 0 0\n"
-"MouseMoveEvent 166 74 0 0 0 0 0\n"
-"MouseMoveEvent 167 72 0 0 0 0 0\n"
-"MouseMoveEvent 168 71 0 0 0 0 0\n"
-"MouseMoveEvent 169 70 0 0 0 0 0\n"
-"MouseMoveEvent 170 69 0 0 0 0 0\n"
-"MouseMoveEvent 171 67 0 0 0 0 0\n"
-"MouseMoveEvent 172 66 0 0 0 0 0\n"
-"MouseMoveEvent 172 65 0 0 0 0 0\n"
-"MouseMoveEvent 173 64 0 0 0 0 0\n"
-"MouseMoveEvent 174 62 0 0 0 0 0\n"
-"MouseMoveEvent 175 60 0 0 0 0 0\n"
-"MouseMoveEvent 176 59 0 0 0 0 0\n"
-"MouseMoveEvent 177 58 0 0 0 0 0\n"
-"MouseMoveEvent 179 57 0 0 0 0 0\n"
-"MouseMoveEvent 180 57 0 0 0 0 0\n"
-"MouseMoveEvent 182 56 0 0 0 0 0\n"
-"MouseMoveEvent 183 56 0 0 0 0 0\n"
-"MouseMoveEvent 184 55 0 0 0 0 0\n"
-"MouseMoveEvent 185 55 0 0 0 0 0\n"
-"MouseMoveEvent 187 55 0 0 0 0 0\n"
-"MouseMoveEvent 188 55 0 0 0 0 0\n"
-"MouseMoveEvent 189 55 0 0 0 0 0\n"
-"MouseMoveEvent 190 55 0 0 0 0 0\n"
-"MouseMoveEvent 191 55 0 0 0 0 0\n"
-"MouseMoveEvent 193 55 0 0 0 0 0\n"
-"MouseMoveEvent 194 55 0 0 0 0 0\n"
-"MouseMoveEvent 195 55 0 0 0 0 0\n"
-"MouseMoveEvent 196 55 0 0 0 0 0\n"
-"MouseMoveEvent 197 55 0 0 0 0 0\n"
-"MouseMoveEvent 198 55 0 0 0 0 0\n"
-"MouseMoveEvent 199 55 0 0 0 0 0\n"
-"LeftButtonPressEvent 199 55 0 0 0 0 0\n"
-"StartInteractionEvent 199 55 0 0 0 0 0\n"
-"MouseMoveEvent 200 56 0 0 0 0 0\n"
-"RenderEvent 200 56 0 0 0 0 0\n"
-"InteractionEvent 200 56 0 0 0 0 0\n"
-"MouseMoveEvent 200 57 0 0 0 0 0\n"
-"RenderEvent 200 57 0 0 0 0 0\n"
-"InteractionEvent 200 57 0 0 0 0 0\n"
-"MouseMoveEvent 200 58 0 0 0 0 0\n"
-"RenderEvent 200 58 0 0 0 0 0\n"
-"InteractionEvent 200 58 0 0 0 0 0\n"
-"MouseMoveEvent 200 59 0 0 0 0 0\n"
-"RenderEvent 200 59 0 0 0 0 0\n"
-"InteractionEvent 200 59 0 0 0 0 0\n"
-"MouseMoveEvent 199 60 0 0 0 0 0\n"
-"RenderEvent 199 60 0 0 0 0 0\n"
-"InteractionEvent 199 60 0 0 0 0 0\n"
-"MouseMoveEvent 199 62 0 0 0 0 0\n"
-"RenderEvent 199 62 0 0 0 0 0\n"
-"InteractionEvent 199 62 0 0 0 0 0\n"
-"MouseMoveEvent 198 64 0 0 0 0 0\n"
-"RenderEvent 198 64 0 0 0 0 0\n"
-"InteractionEvent 198 64 0 0 0 0 0\n"
-"MouseMoveEvent 198 66 0 0 0 0 0\n"
-"RenderEvent 198 66 0 0 0 0 0\n"
-"InteractionEvent 198 66 0 0 0 0 0\n"
-"MouseMoveEvent 197 67 0 0 0 0 0\n"
-"RenderEvent 197 67 0 0 0 0 0\n"
-"InteractionEvent 197 67 0 0 0 0 0\n"
-"MouseMoveEvent 197 68 0 0 0 0 0\n"
-"RenderEvent 197 68 0 0 0 0 0\n"
-"InteractionEvent 197 68 0 0 0 0 0\n"
-"MouseMoveEvent 197 69 0 0 0 0 0\n"
-"RenderEvent 197 69 0 0 0 0 0\n"
-"InteractionEvent 197 69 0 0 0 0 0\n"
-"LeftButtonReleaseEvent 197 69 0 0 0 0 0\n"
-"EndInteractionEvent 197 69 0 0 0 0 0\n"
-"RenderEvent 197 69 0 0 0 0 0\n"
-"MouseMoveEvent 197 66 0 0 0 0 0\n"
-"MouseMoveEvent 197 64 0 0 0 0 0\n"
-"MouseMoveEvent 200 61 0 0 0 0 0\n"
-"MouseMoveEvent 201 60 0 0 0 0 0\n"
-"MouseMoveEvent 202 59 0 0 0 0 0\n"
-"MouseMoveEvent 203 57 0 0 0 0 0\n"
-"MouseMoveEvent 203 56 0 0 0 0 0\n"
-"MouseMoveEvent 204 55 0 0 0 0 0\n"
-"MouseMoveEvent 205 53 0 0 0 0 0\n"
-"MouseMoveEvent 205 52 0 0 0 0 0\n"
-"MouseWheelForwardEvent 205 52 0 0 0 0 0\n"
-"StartInteractionEvent 205 52 0 0 0 0 0\n"
-"RenderEvent 205 52 0 0 0 0 0\n"
-"EndInteractionEvent 205 52 0 0 0 0 0\n"
-"RenderEvent 205 52 0 0 0 0 0\n"
-"MouseWheelForwardEvent 205 52 0 0 0 0 0\n"
-"StartInteractionEvent 205 52 0 0 0 0 0\n"
-"RenderEvent 205 52 0 0 0 0 0\n"
-"EndInteractionEvent 205 52 0 0 0 0 0\n"
-"RenderEvent 205 52 0 0 0 0 0\n"
-"MouseMoveEvent 206 51 0 0 0 0 0\n"
-"MouseMoveEvent 207 50 0 0 0 0 0\n"
-"LeftButtonPressEvent 207 50 0 0 0 0 0\n"
-"StartInteractionEvent 207 50 0 0 0 0 0\n"
-"MouseMoveEvent 206 51 0 0 0 0 0\n"
-"RenderEvent 206 51 0 0 0 0 0\n"
-"InteractionEvent 206 51 0 0 0 0 0\n"
-"MouseMoveEvent 205 51 0 0 0 0 0\n"
-"RenderEvent 205 51 0 0 0 0 0\n"
-"InteractionEvent 205 51 0 0 0 0 0\n"
-"MouseMoveEvent 204 52 0 0 0 0 0\n"
-"RenderEvent 204 52 0 0 0 0 0\n"
-"InteractionEvent 204 52 0 0 0 0 0\n"
-"MouseMoveEvent 203 52 0 0 0 0 0\n"
-"RenderEvent 203 52 0 0 0 0 0\n"
-"InteractionEvent 203 52 0 0 0 0 0\n"
-"MouseMoveEvent 201 52 0 0 0 0 0\n"
-"RenderEvent 201 52 0 0 0 0 0\n"
-"InteractionEvent 201 52 0 0 0 0 0\n"
-"MouseMoveEvent 199 54 0 0 0 0 0\n"
-"RenderEvent 199 54 0 0 0 0 0\n"
-"InteractionEvent 199 54 0 0 0 0 0\n"
-"MouseMoveEvent 197 56 0 0 0 0 0\n"
-"RenderEvent 197 56 0 0 0 0 0\n"
-"InteractionEvent 197 56 0 0 0 0 0\n"
-"MouseMoveEvent 196 57 0 0 0 0 0\n"
-"RenderEvent 196 57 0 0 0 0 0\n"
-"InteractionEvent 196 57 0 0 0 0 0\n"
-"MouseMoveEvent 195 58 0 0 0 0 0\n"
-"RenderEvent 195 58 0 0 0 0 0\n"
-"InteractionEvent 195 58 0 0 0 0 0\n"
-"MouseMoveEvent 194 59 0 0 0 0 0\n"
-"RenderEvent 194 59 0 0 0 0 0\n"
-"InteractionEvent 194 59 0 0 0 0 0\n"
-"MouseMoveEvent 192 61 0 0 0 0 0\n"
-"RenderEvent 192 61 0 0 0 0 0\n"
-"InteractionEvent 192 61 0 0 0 0 0\n"
-"MouseMoveEvent 191 62 0 0 0 0 0\n"
-"RenderEvent 191 62 0 0 0 0 0\n"
-"InteractionEvent 191 62 0 0 0 0 0\n"
-"MouseMoveEvent 190 63 0 0 0 0 0\n"
-"RenderEvent 190 63 0 0 0 0 0\n"
-"InteractionEvent 190 63 0 0 0 0 0\n"
-"MouseMoveEvent 189 64 0 0 0 0 0\n"
-"RenderEvent 189 64 0 0 0 0 0\n"
-"InteractionEvent 189 64 0 0 0 0 0\n"
-"MouseMoveEvent 189 65 0 0 0 0 0\n"
-"RenderEvent 189 65 0 0 0 0 0\n"
-"InteractionEvent 189 65 0 0 0 0 0\n"
-"MouseMoveEvent 188 66 0 0 0 0 0\n"
-"RenderEvent 188 66 0 0 0 0 0\n"
-"InteractionEvent 188 66 0 0 0 0 0\n"
-"MouseMoveEvent 188 67 0 0 0 0 0\n"
-"RenderEvent 188 67 0 0 0 0 0\n"
-"InteractionEvent 188 67 0 0 0 0 0\n"
-"MouseMoveEvent 187 68 0 0 0 0 0\n"
-"RenderEvent 187 68 0 0 0 0 0\n"
-"InteractionEvent 187 68 0 0 0 0 0\n"
-"MouseMoveEvent 187 69 0 0 0 0 0\n"
-"RenderEvent 187 69 0 0 0 0 0\n"
-"InteractionEvent 187 69 0 0 0 0 0\n"
-"MouseMoveEvent 186 70 0 0 0 0 0\n"
-"RenderEvent 186 70 0 0 0 0 0\n"
-"InteractionEvent 186 70 0 0 0 0 0\n"
-"LeftButtonReleaseEvent 186 70 0 0 0 0 0\n"
-"EndInteractionEvent 186 70 0 0 0 0 0\n"
-"RenderEvent 186 70 0 0 0 0 0\n"
-"MouseMoveEvent 187 70 0 0 0 0 0\n"
-"MouseMoveEvent 188 70 0 0 0 0 0\n"
-"MouseMoveEvent 189 70 0 0 0 0 0\n"
-"MouseMoveEvent 190 70 0 0 0 0 0\n"
-"MouseMoveEvent 192 69 0 0 0 0 0\n"
-"MouseMoveEvent 194 68 0 0 0 0 0\n"
-"MouseMoveEvent 196 67 0 0 0 0 0\n"
-"MouseMoveEvent 198 66 0 0 0 0 0\n"
-"MouseMoveEvent 202 62 0 0 0 0 0\n"
-"MouseMoveEvent 204 60 0 0 0 0 0\n"
-"MouseMoveEvent 206 58 0 0 0 0 0\n"
-"MouseMoveEvent 208 56 0 0 0 0 0\n"
-"MouseMoveEvent 209 55 0 0 0 0 0\n"
-"MouseMoveEvent 210 54 0 0 0 0 0\n"
-"MouseMoveEvent 212 52 0 0 0 0 0\n"
-"MouseMoveEvent 213 51 0 0 0 0 0\n"
-"MouseMoveEvent 214 49 0 0 0 0 0\n"
-"MouseMoveEvent 216 47 0 0 0 0 0\n"
-"MouseMoveEvent 219 43 0 0 0 0 0\n"
-"MouseMoveEvent 222 40 0 0 0 0 0\n"
-"MouseMoveEvent 227 35 0 0 0 0 0\n"
-"MouseMoveEvent 232 30 0 0 0 0 0\n"
-"MouseMoveEvent 240 22 0 0 0 0 0\n"
-"MouseMoveEvent 247 15 0 0 0 0 0\n"
-"MouseMoveEvent 255 7 0 0 0 0 0\n"
-"LeaveEvent 265 -1 0 0 0 0 0\n"
-"EnterEvent 273 0 0 0 0 0 0\n"
-"MouseMoveEvent 273 0 0 0 0 0 0\n"
-"MouseMoveEvent 271 4 0 0 0 0 0\n"
-"MouseMoveEvent 270 5 0 0 0 0 0\n"
-"MouseMoveEvent 269 7 0 0 0 0 0\n"
-"MouseMoveEvent 268 9 0 0 0 0 0\n"
-"MouseMoveEvent 267 11 0 0 0 0 0\n"
-"MouseMoveEvent 266 12 0 0 0 0 0\n"
-"MouseMoveEvent 265 14 0 0 0 0 0\n"
-"MouseMoveEvent 264 16 0 0 0 0 0\n"
-"MouseMoveEvent 262 20 0 0 0 0 0\n"
-"MouseMoveEvent 261 21 0 0 0 0 0\n"
-"MouseMoveEvent 260 23 0 0 0 0 0\n"
-"MouseMoveEvent 258 26 0 0 0 0 0\n"
-"MouseMoveEvent 258 27 0 0 0 0 0\n"
-"MouseMoveEvent 257 29 0 0 0 0 0\n"
-"MouseMoveEvent 256 30 0 0 0 0 0\n"
-"MouseMoveEvent 255 32 0 0 0 0 0\n"
-"MouseMoveEvent 254 33 0 0 0 0 0\n"
-"MouseMoveEvent 253 34 0 0 0 0 0\n"
-"MouseMoveEvent 253 35 0 0 0 0 0\n"
-"MouseMoveEvent 252 37 0 0 0 0 0\n"
-"MouseMoveEvent 251 38 0 0 0 0 0\n"
-"MouseMoveEvent 250 39 0 0 0 0 0\n"
-"MouseMoveEvent 249 42 0 0 0 0 0\n"
-"MouseMoveEvent 249 43 0 0 0 0 0\n"
-"MouseMoveEvent 248 44 0 0 0 0 0\n"
-"MouseWheelForwardEvent 248 44 0 0 0 0 0\n"
-"StartInteractionEvent 248 44 0 0 0 0 0\n"
-"RenderEvent 248 44 0 0 0 0 0\n"
-"EndInteractionEvent 248 44 0 0 0 0 0\n"
-"RenderEvent 248 44 0 0 0 0 0\n"
-"LeftButtonPressEvent 248 44 0 0 0 0 0\n"
-"StartInteractionEvent 248 44 0 0 0 0 0\n"
-"MouseMoveEvent 246 45 0 0 0 0 0\n"
-"RenderEvent 246 45 0 0 0 0 0\n"
-"InteractionEvent 246 45 0 0 0 0 0\n"
-"MouseMoveEvent 245 46 0 0 0 0 0\n"
-"RenderEvent 245 46 0 0 0 0 0\n"
-"InteractionEvent 245 46 0 0 0 0 0\n"
-"MouseMoveEvent 244 47 0 0 0 0 0\n"
-"RenderEvent 244 47 0 0 0 0 0\n"
-"InteractionEvent 244 47 0 0 0 0 0\n"
-"MouseMoveEvent 243 49 0 0 0 0 0\n"
-"RenderEvent 243 49 0 0 0 0 0\n"
-"InteractionEvent 243 49 0 0 0 0 0\n"
-"MouseMoveEvent 242 50 0 0 0 0 0\n"
-"RenderEvent 242 50 0 0 0 0 0\n"
-"InteractionEvent 242 50 0 0 0 0 0\n"
-"MouseMoveEvent 241 52 0 0 0 0 0\n"
-"RenderEvent 241 52 0 0 0 0 0\n"
-"InteractionEvent 241 52 0 0 0 0 0\n"
-"MouseMoveEvent 240 53 0 0 0 0 0\n"
-"RenderEvent 240 53 0 0 0 0 0\n"
-"InteractionEvent 240 53 0 0 0 0 0\n"
-"MouseMoveEvent 240 54 0 0 0 0 0\n"
-"RenderEvent 240 54 0 0 0 0 0\n"
-"InteractionEvent 240 54 0 0 0 0 0\n"
-"MouseMoveEvent 238 57 0 0 0 0 0\n"
-"RenderEvent 238 57 0 0 0 0 0\n"
-"InteractionEvent 238 57 0 0 0 0 0\n"
-"MouseMoveEvent 238 58 0 0 0 0 0\n"
-"RenderEvent 238 58 0 0 0 0 0\n"
-"InteractionEvent 238 58 0 0 0 0 0\n"
-"MouseMoveEvent 237 59 0 0 0 0 0\n"
-"RenderEvent 237 59 0 0 0 0 0\n"
-"InteractionEvent 237 59 0 0 0 0 0\n"
-"MouseMoveEvent 237 60 0 0 0 0 0\n"
-"RenderEvent 237 60 0 0 0 0 0\n"
-"InteractionEvent 237 60 0 0 0 0 0\n"
-"MouseMoveEvent 236 61 0 0 0 0 0\n"
-"RenderEvent 236 61 0 0 0 0 0\n"
-"InteractionEvent 236 61 0 0 0 0 0\n"
-"MouseMoveEvent 236 62 0 0 0 0 0\n"
-"RenderEvent 236 62 0 0 0 0 0\n"
-"InteractionEvent 236 62 0 0 0 0 0\n"
-"MouseMoveEvent 235 63 0 0 0 0 0\n"
-"RenderEvent 235 63 0 0 0 0 0\n"
-"InteractionEvent 235 63 0 0 0 0 0\n"
-"LeftButtonReleaseEvent 235 63 0 0 0 0 0\n"
-"EndInteractionEvent 235 63 0 0 0 0 0\n"
-"RenderEvent 235 63 0 0 0 0 0\n"
-"MouseMoveEvent 237 64 0 0 0 0 0\n"
-"MouseMoveEvent 242 64 0 0 0 0 0\n"
-"MouseMoveEvent 250 61 0 0 0 0 0\n"
-"MouseMoveEvent 261 58 0 0 0 0 0\n"
-"MouseMoveEvent 272 56 0 0 0 0 0\n"
-"MouseMoveEvent 283 53 0 0 0 0 0\n"
-"MouseMoveEvent 293 51 0 0 0 0 0\n"
-"LeaveEvent 304 46 0 0 0 0 0\n"
-"EnterEvent 251 4 0 0 0 0 0\n"
-"MouseMoveEvent 251 4 0 0 0 0 0\n"
-"MouseMoveEvent 244 15 0 0 0 0 0\n"
-"MouseMoveEvent 237 26 0 0 0 0 0\n"
-"MouseMoveEvent 230 33 0 0 0 0 0\n"
-"MouseMoveEvent 223 42 0 0 0 0 0\n"
-"MouseMoveEvent 218 51 0 0 0 0 0\n"
-"MouseMoveEvent 213 58 0 0 0 0 0\n"
-"MouseMoveEvent 208 65 0 0 0 0 0\n"
-"MouseMoveEvent 203 72 0 0 0 0 0\n"
-"MouseMoveEvent 199 79 0 0 0 0 0\n"
-"MouseMoveEvent 194 83 0 0 0 0 0\n"
-"MouseMoveEvent 189 88 0 0 0 0 0\n"
-"MouseMoveEvent 185 92 0 0 0 0 0\n"
-"MouseMoveEvent 180 97 0 0 0 0 0\n"
-"MouseMoveEvent 174 105 0 0 0 0 0\n"
-"MouseMoveEvent 172 107 0 0 0 0 0\n"
-"MouseMoveEvent 170 111 0 0 0 0 0\n"
-"MouseMoveEvent 168 114 0 0 0 0 0\n"
-"MouseMoveEvent 167 118 0 0 0 0 0\n"
-"MouseMoveEvent 165 122 0 0 0 0 0\n"
-"MouseMoveEvent 165 125 0 0 0 0 0\n"
-"MouseWheelBackwardEvent 165 125 0 0 0 0 0\n"
-"StartInteractionEvent 165 125 0 0 0 0 0\n"
-"RenderEvent 165 125 0 0 0 0 0\n"
-"EndInteractionEvent 165 125 0 0 0 0 0\n"
-"RenderEvent 165 125 0 0 0 0 0\n"
-"MouseMoveEvent 164 126 0 0 0 0 0\n"
-"MouseMoveEvent 163 126 0 0 0 0 0\n"
-"MouseMoveEvent 162 126 0 0 0 0 0\n"
-"MouseMoveEvent 161 125 0 0 0 0 0\n"
-"LeftButtonPressEvent 161 125 0 0 0 0 0\n"
-"StartInteractionEvent 161 125 0 0 0 0 0\n"
-"MouseMoveEvent 163 124 0 0 0 0 0\n"
-"RenderEvent 163 124 0 0 0 0 0\n"
-"InteractionEvent 163 124 0 0 0 0 0\n"
-"MouseMoveEvent 164 123 0 0 0 0 0\n"
-"RenderEvent 164 123 0 0 0 0 0\n"
-"InteractionEvent 164 123 0 0 0 0 0\n"
-"MouseMoveEvent 165 122 0 0 0 0 0\n"
-"RenderEvent 165 122 0 0 0 0 0\n"
-"InteractionEvent 165 122 0 0 0 0 0\n"
-"MouseMoveEvent 167 121 0 0 0 0 0\n"
-"RenderEvent 167 121 0 0 0 0 0\n"
-"InteractionEvent 167 121 0 0 0 0 0\n"
-"MouseMoveEvent 169 120 0 0 0 0 0\n"
-"RenderEvent 169 120 0 0 0 0 0\n"
-"InteractionEvent 169 120 0 0 0 0 0\n"
-"LeftButtonReleaseEvent 169 120 0 0 0 0 0\n"
-"EndInteractionEvent 169 120 0 0 0 0 0\n"
-"RenderEvent 169 120 0 0 0 0 0\n"
-"MouseWheelBackwardEvent 169 120 0 0 0 0 0\n"
-"StartInteractionEvent 169 120 0 0 0 0 0\n"
-"RenderEvent 169 120 0 0 0 0 0\n"
-"EndInteractionEvent 169 120 0 0 0 0 0\n"
-"RenderEvent 169 120 0 0 0 0 0\n"
-"MouseMoveEvent 170 119 0 0 0 0 0\n"
-"MouseMoveEvent 169 118 0 0 0 0 0\n"
-"MouseMoveEvent 168 117 0 0 0 0 0\n"
-"MouseMoveEvent 167 116 0 0 0 0 0\n"
-"MouseMoveEvent 169 114 0 0 0 0 0\n"
-"MouseMoveEvent 176 113 0 0 0 0 0\n"
-"MouseMoveEvent 186 110 0 0 0 0 0\n"
-"MouseMoveEvent 201 105 0 0 0 0 0\n"
-"MouseMoveEvent 216 100 0 0 0 0 0\n"
-"MouseMoveEvent 231 95 0 0 0 0 0\n"
-"MouseMoveEvent 250 90 0 0 0 0 0\n"
-"MouseMoveEvent 269 85 0 0 0 0 0\n"
-"MouseMoveEvent 290 78 0 0 0 0 0\n"
-"LeaveEvent 311 71 0 0 0 0 0\n"
-;
-
-int TestGPURayCastCameraInside(int argc, char *argv[])
-{
-  cout << "CTEST_FULL_OUTPUT (Avoid ctest truncation of output)" << endl;
-
-  char* volumeFile = vtkTestUtilities::ExpandDataFileName(
-                       argc, argv, "Data/ironProt.vtk");
-  vtkNew<vtkStructuredPointsReader> reader;
-  reader->SetFileName(volumeFile);
-  delete[] volumeFile;
-
-  vtkNew<vtkGPUVolumeRayCastMapper> mapper;
-  mapper->SetInputConnection(reader->GetOutputPort());
-  mapper->SetAutoAdjustSampleDistances(0);
-  mapper->SetSampleDistance(1.0);
-
-  vtkNew<vtkColorTransferFunction> color;
-  color->AddRGBPoint(0.0, 0.0, 0.0, 0.0);
-  color->AddRGBPoint(64.0, 1.0, 0.0, 0.0);
-  color->AddRGBPoint(128.0, 0.0, 0.0, 1.0);
-  color->AddRGBPoint(192.0, 0.0, 1.0, 0.0);
-  color->AddRGBPoint(255.0, 0.0, 0.2, 0.0);
-
-  vtkNew<vtkPiecewiseFunction> opacity;
-  opacity->AddPoint(0.0, 0.0);
-  opacity->AddPoint(255.0, 1.0);
-
-  vtkNew<vtkVolumeProperty> property;
-  property->SetColor(color.GetPointer());
-  property->SetScalarOpacity(opacity.GetPointer());
-  property->SetInterpolationTypeToLinear();
-  property->ShadeOff();
-
-  vtkNew<vtkVolume> volume;
-  volume->SetMapper(mapper.GetPointer());
-  volume->SetProperty(property.GetPointer());
-
-  vtkNew<vtkRenderWindow> renWin;
-  renWin->SetSize(301, 300);
-  renWin->SetMultiSamples(0);
-
-  vtkNew<vtkRenderWindowInteractor> iren;
-  iren->SetRenderWindow(renWin.GetPointer());
-  vtkNew<vtkInteractorStyleTrackballCamera> style;
-  iren->SetInteractorStyle(style.GetPointer());
-
-  vtkNew<vtkRenderer> ren;
-  renWin->AddRenderer(ren.GetPointer());
-
-  ren->AddVolume(volume.GetPointer());
-  ren->ResetCamera();
-
-  renWin->Render();
-  iren->Initialize();
-
-  return vtkTesting::InteractorEventLoop(argc, argv,
-                                         iren.GetPointer(),
-                                         TestGPURayCastCameraInsideLog);
-}
diff --git a/Rendering/Volume/Testing/Cxx/TestGPURayCastCameraInsideSmallSpacing.cxx b/Rendering/Volume/Testing/Cxx/TestGPURayCastCameraInsideSmallSpacing.cxx
deleted file mode 100644
index a2babcb..0000000
--- a/Rendering/Volume/Testing/Cxx/TestGPURayCastCameraInsideSmallSpacing.cxx
+++ /dev/null
@@ -1,1628 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    TestGPURayCastCameraInsideSmallSpacing.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.
-
-=========================================================================*/
-
-// Description
-// This is a test for clipping of volume using the camera near plane when the
-// camera is inside the volume. The test renders the ironProt dataset after
-// changing it to have a very small spacing and dollies the camera inside the
-// volume geometry.
-
-#include "vtkColorTransferFunction.h"
-#include "vtkGPUVolumeRayCastMapper.h"
-#include "vtkImageChangeInformation.h"
-#include "vtkInteractorStyleTrackballCamera.h"
-#include "vtkNew.h"
-#include "vtkPiecewiseFunction.h"
-#include "vtkRenderer.h"
-#include "vtkRenderWindow.h"
-#include "vtkRenderWindowInteractor.h"
-#include "vtkStructuredPoints.h"
-#include "vtkStructuredPointsReader.h"
-#include "vtkTesting.h"
-#include "vtkTestUtilities.h"
-#include "vtkVolume.h"
-#include "vtkVolumeProperty.h"
-
-static const char* TestGPURayCastCameraInsideSmallSpacingLog =
-"# StreamVersion 1\n"
-"EnterEvent 188 3 0 0 0 0 0\n"
-"MouseMoveEvent 188 3 0 0 0 0 0\n"
-"MouseMoveEvent 186 5 0 0 0 0 0\n"
-"MouseMoveEvent 184 7 0 0 0 0 0\n"
-"MouseMoveEvent 183 9 0 0 0 0 0\n"
-"MouseMoveEvent 181 11 0 0 0 0 0\n"
-"MouseMoveEvent 179 15 0 0 0 0 0\n"
-"MouseMoveEvent 178 18 0 0 0 0 0\n"
-"MouseMoveEvent 177 20 0 0 0 0 0\n"
-"MouseMoveEvent 177 21 0 0 0 0 0\n"
-"MouseMoveEvent 176 22 0 0 0 0 0\n"
-"MouseMoveEvent 175 24 0 0 0 0 0\n"
-"MouseMoveEvent 175 26 0 0 0 0 0\n"
-"MouseMoveEvent 174 27 0 0 0 0 0\n"
-"MouseMoveEvent 174 28 0 0 0 0 0\n"
-"MouseMoveEvent 173 30 0 0 0 0 0\n"
-"MouseMoveEvent 172 31 0 0 0 0 0\n"
-"MouseMoveEvent 170 34 0 0 0 0 0\n"
-"MouseMoveEvent 169 36 0 0 0 0 0\n"
-"MouseMoveEvent 168 38 0 0 0 0 0\n"
-"MouseMoveEvent 168 41 0 0 0 0 0\n"
-"MouseMoveEvent 167 42 0 0 0 0 0\n"
-"MouseMoveEvent 167 44 0 0 0 0 0\n"
-"MouseMoveEvent 167 47 0 0 0 0 0\n"
-"MouseMoveEvent 167 50 0 0 0 0 0\n"
-"MouseMoveEvent 166 52 0 0 0 0 0\n"
-"MouseMoveEvent 166 55 0 0 0 0 0\n"
-"MouseMoveEvent 166 57 0 0 0 0 0\n"
-"MouseMoveEvent 166 59 0 0 0 0 0\n"
-"MouseMoveEvent 166 60 0 0 0 0 0\n"
-"MouseMoveEvent 166 61 0 0 0 0 0\n"
-"MouseMoveEvent 166 62 0 0 0 0 0\n"
-"MouseMoveEvent 166 63 0 0 0 0 0\n"
-"MouseMoveEvent 167 65 0 0 0 0 0\n"
-"MouseMoveEvent 167 66 0 0 0 0 0\n"
-"MouseMoveEvent 165 67 0 0 0 0 0\n"
-"MouseMoveEvent 164 67 0 0 0 0 0\n"
-"MouseWheelForwardEvent 164 67 0 0 0 0 0\n"
-"StartInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"EndInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"MouseWheelForwardEvent 164 67 0 0 0 1 0\n"
-"StartInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"EndInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"MouseWheelForwardEvent 164 67 0 0 0 0 0\n"
-"StartInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"EndInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"MouseWheelForwardEvent 164 67 0 0 0 1 0\n"
-"StartInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"EndInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"MouseWheelForwardEvent 164 67 0 0 0 0 0\n"
-"StartInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"EndInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"MouseWheelForwardEvent 164 67 0 0 0 1 0\n"
-"StartInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"EndInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"MouseWheelForwardEvent 164 67 0 0 0 0 0\n"
-"StartInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"EndInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"MouseWheelForwardEvent 164 67 0 0 0 1 0\n"
-"StartInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"EndInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"MouseWheelForwardEvent 164 67 0 0 0 0 0\n"
-"StartInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"EndInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"MouseWheelForwardEvent 164 67 0 0 0 0 0\n"
-"StartInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"EndInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"MouseWheelForwardEvent 164 67 0 0 0 1 0\n"
-"StartInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"EndInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"MouseWheelForwardEvent 164 67 0 0 0 0 0\n"
-"StartInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"EndInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"MouseWheelForwardEvent 164 67 0 0 0 1 0\n"
-"StartInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"EndInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"MouseWheelForwardEvent 164 67 0 0 0 0 0\n"
-"StartInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"EndInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"MouseWheelForwardEvent 164 67 0 0 0 1 0\n"
-"StartInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"EndInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"MouseWheelForwardEvent 164 67 0 0 0 0 0\n"
-"StartInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"EndInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"MouseWheelForwardEvent 164 67 0 0 0 0 0\n"
-"StartInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"EndInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"MouseWheelForwardEvent 164 67 0 0 0 1 0\n"
-"StartInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"EndInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"MouseWheelForwardEvent 164 67 0 0 0 0 0\n"
-"StartInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"EndInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"MouseWheelForwardEvent 164 67 0 0 0 1 0\n"
-"StartInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"EndInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"MouseWheelForwardEvent 164 67 0 0 0 0 0\n"
-"StartInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"EndInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"MouseWheelForwardEvent 164 67 0 0 0 1 0\n"
-"StartInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"EndInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"MouseWheelForwardEvent 164 67 0 0 0 0 0\n"
-"StartInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"EndInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"MouseWheelForwardEvent 164 67 0 0 0 1 0\n"
-"StartInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"EndInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"MouseWheelForwardEvent 164 67 0 0 0 0 0\n"
-"StartInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"EndInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"MouseWheelForwardEvent 164 67 0 0 0 1 0\n"
-"StartInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"EndInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"MouseWheelForwardEvent 164 67 0 0 0 0 0\n"
-"StartInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"EndInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"MouseWheelForwardEvent 164 67 0 0 0 1 0\n"
-"StartInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"EndInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"MouseWheelForwardEvent 164 67 0 0 0 0 0\n"
-"StartInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"EndInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"MouseWheelForwardEvent 164 67 0 0 0 1 0\n"
-"StartInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"EndInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"MouseWheelForwardEvent 164 67 0 0 0 0 0\n"
-"StartInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"EndInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"MouseWheelForwardEvent 164 67 0 0 0 1 0\n"
-"StartInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"EndInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"MouseWheelForwardEvent 164 67 0 0 0 0 0\n"
-"StartInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"EndInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"MouseWheelForwardEvent 164 67 0 0 0 1 0\n"
-"StartInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"EndInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"MouseWheelForwardEvent 164 67 0 0 0 0 0\n"
-"StartInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"EndInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"MouseWheelForwardEvent 164 67 0 0 0 1 0\n"
-"StartInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"EndInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"MouseWheelForwardEvent 164 67 0 0 0 0 0\n"
-"StartInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"EndInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"MouseWheelForwardEvent 164 67 0 0 0 1 0\n"
-"StartInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"EndInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"MouseWheelForwardEvent 164 67 0 0 0 0 0\n"
-"StartInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"EndInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"MouseWheelForwardEvent 164 67 0 0 0 1 0\n"
-"StartInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"EndInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"MouseWheelForwardEvent 164 67 0 0 0 0 0\n"
-"StartInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"EndInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"MouseWheelForwardEvent 164 67 0 0 0 1 0\n"
-"StartInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"EndInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"MouseWheelForwardEvent 164 67 0 0 0 0 0\n"
-"StartInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"EndInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"MouseWheelForwardEvent 164 67 0 0 0 1 0\n"
-"StartInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"EndInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"MouseWheelForwardEvent 164 67 0 0 0 0 0\n"
-"StartInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"EndInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"MouseWheelBackwardEvent 164 67 0 0 0 1 0\n"
-"StartInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"EndInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"MouseWheelBackwardEvent 164 67 0 0 0 0 0\n"
-"StartInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"EndInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"MouseWheelBackwardEvent 164 67 0 0 0 1 0\n"
-"StartInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"EndInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"MouseWheelBackwardEvent 164 67 0 0 0 0 0\n"
-"StartInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"EndInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"MouseWheelBackwardEvent 164 67 0 0 0 1 0\n"
-"StartInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"EndInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"MouseWheelBackwardEvent 164 67 0 0 0 0 0\n"
-"StartInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"EndInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"MouseWheelBackwardEvent 164 67 0 0 0 1 0\n"
-"StartInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"EndInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"MouseWheelBackwardEvent 164 67 0 0 0 0 0\n"
-"StartInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"EndInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"MouseWheelBackwardEvent 164 67 0 0 0 1 0\n"
-"StartInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"EndInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"MouseWheelBackwardEvent 164 67 0 0 0 0 0\n"
-"StartInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"EndInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"MouseWheelBackwardEvent 164 67 0 0 0 1 0\n"
-"StartInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"EndInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"MouseWheelBackwardEvent 164 67 0 0 0 0 0\n"
-"StartInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"EndInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"MouseWheelBackwardEvent 164 67 0 0 0 1 0\n"
-"StartInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"EndInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"MouseWheelBackwardEvent 164 67 0 0 0 0 0\n"
-"StartInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"EndInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"MouseWheelBackwardEvent 164 67 0 0 0 1 0\n"
-"StartInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"EndInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"MouseWheelBackwardEvent 164 67 0 0 0 0 0\n"
-"StartInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"EndInteractionEvent 164 67 0 0 0 0 0\n"
-"RenderEvent 164 67 0 0 0 0 0\n"
-"MouseWheelBackwardEvent 164 67 0 0 0 1 0\n"
-"StartInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"EndInteractionEvent 164 67 0 0 0 1 0\n"
-"RenderEvent 164 67 0 0 0 1 0\n"
-"MouseMoveEvent 163 66 0 0 0 0 0\n"
-"MouseWheelBackwardEvent 163 66 0 0 0 0 0\n"
-"StartInteractionEvent 163 66 0 0 0 0 0\n"
-"RenderEvent 163 66 0 0 0 0 0\n"
-"EndInteractionEvent 163 66 0 0 0 0 0\n"
-"RenderEvent 163 66 0 0 0 0 0\n"
-"MouseWheelBackwardEvent 163 66 0 0 0 1 0\n"
-"StartInteractionEvent 163 66 0 0 0 1 0\n"
-"RenderEvent 163 66 0 0 0 1 0\n"
-"EndInteractionEvent 163 66 0 0 0 1 0\n"
-"RenderEvent 163 66 0 0 0 1 0\n"
-"MouseWheelBackwardEvent 163 66 0 0 0 0 0\n"
-"StartInteractionEvent 163 66 0 0 0 0 0\n"
-"RenderEvent 163 66 0 0 0 0 0\n"
-"EndInteractionEvent 163 66 0 0 0 0 0\n"
-"RenderEvent 163 66 0 0 0 0 0\n"
-"MouseWheelBackwardEvent 163 66 0 0 0 1 0\n"
-"StartInteractionEvent 163 66 0 0 0 1 0\n"
-"RenderEvent 163 66 0 0 0 1 0\n"
-"EndInteractionEvent 163 66 0 0 0 1 0\n"
-"RenderEvent 163 66 0 0 0 1 0\n"
-"MouseWheelBackwardEvent 163 66 0 0 0 0 0\n"
-"StartInteractionEvent 163 66 0 0 0 0 0\n"
-"RenderEvent 163 66 0 0 0 0 0\n"
-"EndInteractionEvent 163 66 0 0 0 0 0\n"
-"RenderEvent 163 66 0 0 0 0 0\n"
-"MouseWheelBackwardEvent 163 66 0 0 0 1 0\n"
-"StartInteractionEvent 163 66 0 0 0 1 0\n"
-"RenderEvent 163 66 0 0 0 1 0\n"
-"EndInteractionEvent 163 66 0 0 0 1 0\n"
-"RenderEvent 163 66 0 0 0 1 0\n"
-"MouseWheelBackwardEvent 163 66 0 0 0 0 0\n"
-"StartInteractionEvent 163 66 0 0 0 0 0\n"
-"RenderEvent 163 66 0 0 0 0 0\n"
-"EndInteractionEvent 163 66 0 0 0 0 0\n"
-"RenderEvent 163 66 0 0 0 0 0\n"
-"MouseWheelBackwardEvent 163 66 0 0 0 1 0\n"
-"StartInteractionEvent 163 66 0 0 0 1 0\n"
-"RenderEvent 163 66 0 0 0 1 0\n"
-"EndInteractionEvent 163 66 0 0 0 1 0\n"
-"RenderEvent 163 66 0 0 0 1 0\n"
-"MouseWheelBackwardEvent 163 66 0 0 0 0 0\n"
-"StartInteractionEvent 163 66 0 0 0 0 0\n"
-"RenderEvent 163 66 0 0 0 0 0\n"
-"EndInteractionEvent 163 66 0 0 0 0 0\n"
-"RenderEvent 163 66 0 0 0 0 0\n"
-"MouseWheelBackwardEvent 163 66 0 0 0 1 0\n"
-"StartInteractionEvent 163 66 0 0 0 1 0\n"
-"RenderEvent 163 66 0 0 0 1 0\n"
-"EndInteractionEvent 163 66 0 0 0 1 0\n"
-"RenderEvent 163 66 0 0 0 1 0\n"
-"MouseWheelBackwardEvent 163 66 0 0 0 0 0\n"
-"StartInteractionEvent 163 66 0 0 0 0 0\n"
-"RenderEvent 163 66 0 0 0 0 0\n"
-"EndInteractionEvent 163 66 0 0 0 0 0\n"
-"RenderEvent 163 66 0 0 0 0 0\n"
-"MouseWheelBackwardEvent 163 66 0 0 0 1 0\n"
-"StartInteractionEvent 163 66 0 0 0 1 0\n"
-"RenderEvent 163 66 0 0 0 1 0\n"
-"EndInteractionEvent 163 66 0 0 0 1 0\n"
-"RenderEvent 163 66 0 0 0 1 0\n"
-"MouseWheelBackwardEvent 163 66 0 0 0 0 0\n"
-"StartInteractionEvent 163 66 0 0 0 0 0\n"
-"RenderEvent 163 66 0 0 0 0 0\n"
-"EndInteractionEvent 163 66 0 0 0 0 0\n"
-"RenderEvent 163 66 0 0 0 0 0\n"
-"MouseWheelBackwardEvent 163 66 0 0 0 1 0\n"
-"StartInteractionEvent 163 66 0 0 0 1 0\n"
-"RenderEvent 163 66 0 0 0 1 0\n"
-"EndInteractionEvent 163 66 0 0 0 1 0\n"
-"RenderEvent 163 66 0 0 0 1 0\n"
-"MouseWheelBackwardEvent 163 66 0 0 0 0 0\n"
-"StartInteractionEvent 163 66 0 0 0 0 0\n"
-"RenderEvent 163 66 0 0 0 0 0\n"
-"EndInteractionEvent 163 66 0 0 0 0 0\n"
-"RenderEvent 163 66 0 0 0 0 0\n"
-"MouseWheelBackwardEvent 163 66 0 0 0 1 0\n"
-"StartInteractionEvent 163 66 0 0 0 1 0\n"
-"RenderEvent 163 66 0 0 0 1 0\n"
-"EndInteractionEvent 163 66 0 0 0 1 0\n"
-"RenderEvent 163 66 0 0 0 1 0\n"
-"MouseWheelBackwardEvent 163 66 0 0 0 0 0\n"
-"StartInteractionEvent 163 66 0 0 0 0 0\n"
-"RenderEvent 163 66 0 0 0 0 0\n"
-"EndInteractionEvent 163 66 0 0 0 0 0\n"
-"RenderEvent 163 66 0 0 0 0 0\n"
-"MouseWheelBackwardEvent 163 66 0 0 0 1 0\n"
-"StartInteractionEvent 163 66 0 0 0 1 0\n"
-"RenderEvent 163 66 0 0 0 1 0\n"
-"EndInteractionEvent 163 66 0 0 0 1 0\n"
-"RenderEvent 163 66 0 0 0 1 0\n"
-"MouseWheelBackwardEvent 163 66 0 0 0 0 0\n"
-"StartInteractionEvent 163 66 0 0 0 0 0\n"
-"RenderEvent 163 66 0 0 0 0 0\n"
-"EndInteractionEvent 163 66 0 0 0 0 0\n"
-"RenderEvent 163 66 0 0 0 0 0\n"
-"MouseWheelBackwardEvent 163 66 0 0 0 0 0\n"
-"StartInteractionEvent 163 66 0 0 0 0 0\n"
-"RenderEvent 163 66 0 0 0 0 0\n"
-"EndInteractionEvent 163 66 0 0 0 0 0\n"
-"RenderEvent 163 66 0 0 0 0 0\n"
-"MouseWheelBackwardEvent 163 66 0 0 0 1 0\n"
-"StartInteractionEvent 163 66 0 0 0 1 0\n"
-"RenderEvent 163 66 0 0 0 1 0\n"
-"EndInteractionEvent 163 66 0 0 0 1 0\n"
-"RenderEvent 163 66 0 0 0 1 0\n"
-"MouseWheelBackwardEvent 163 66 0 0 0 0 0\n"
-"StartInteractionEvent 163 66 0 0 0 0 0\n"
-"RenderEvent 163 66 0 0 0 0 0\n"
-"EndInteractionEvent 163 66 0 0 0 0 0\n"
-"RenderEvent 163 66 0 0 0 0 0\n"
-"MouseWheelBackwardEvent 163 66 0 0 0 1 0\n"
-"StartInteractionEvent 163 66 0 0 0 1 0\n"
-"RenderEvent 163 66 0 0 0 1 0\n"
-"EndInteractionEvent 163 66 0 0 0 1 0\n"
-"RenderEvent 163 66 0 0 0 1 0\n"
-"MouseWheelBackwardEvent 163 66 0 0 0 0 0\n"
-"StartInteractionEvent 163 66 0 0 0 0 0\n"
-"RenderEvent 163 66 0 0 0 0 0\n"
-"EndInteractionEvent 163 66 0 0 0 0 0\n"
-"RenderEvent 163 66 0 0 0 0 0\n"
-"MouseMoveEvent 162 67 0 0 0 0 0\n"
-"MouseMoveEvent 163 67 0 0 0 0 0\n"
-"MouseMoveEvent 165 67 0 0 0 0 0\n"
-"MouseMoveEvent 166 68 0 0 0 0 0\n"
-"MouseMoveEvent 167 69 0 0 0 0 0\n"
-"MouseMoveEvent 168 70 0 0 0 0 0\n"
-"MouseMoveEvent 169 71 0 0 0 0 0\n"
-"MouseMoveEvent 170 72 0 0 0 0 0\n"
-"MouseMoveEvent 171 73 0 0 0 0 0\n"
-"MouseMoveEvent 172 74 0 0 0 0 0\n"
-"MouseMoveEvent 173 75 0 0 0 0 0\n"
-"MouseMoveEvent 174 76 0 0 0 0 0\n"
-"MouseMoveEvent 176 78 0 0 0 0 0\n"
-"MouseMoveEvent 177 79 0 0 0 0 0\n"
-"MouseMoveEvent 178 80 0 0 0 0 0\n"
-"MouseMoveEvent 178 81 0 0 0 0 0\n"
-"MouseMoveEvent 179 83 0 0 0 0 0\n"
-"LeftButtonPressEvent 179 83 0 0 0 0 0\n"
-"StartInteractionEvent 179 83 0 0 0 0 0\n"
-"MouseMoveEvent 178 82 0 0 0 0 0\n"
-"RenderEvent 178 82 0 0 0 0 0\n"
-"InteractionEvent 178 82 0 0 0 0 0\n"
-"MouseMoveEvent 177 81 0 0 0 0 0\n"
-"RenderEvent 177 81 0 0 0 0 0\n"
-"InteractionEvent 177 81 0 0 0 0 0\n"
-"MouseMoveEvent 175 80 0 0 0 0 0\n"
-"RenderEvent 175 80 0 0 0 0 0\n"
-"InteractionEvent 175 80 0 0 0 0 0\n"
-"MouseMoveEvent 173 78 0 0 0 0 0\n"
-"RenderEvent 173 78 0 0 0 0 0\n"
-"InteractionEvent 173 78 0 0 0 0 0\n"
-"MouseMoveEvent 169 74 0 0 0 0 0\n"
-"RenderEvent 169 74 0 0 0 0 0\n"
-"InteractionEvent 169 74 0 0 0 0 0\n"
-"MouseMoveEvent 165 70 0 0 0 0 0\n"
-"RenderEvent 165 70 0 0 0 0 0\n"
-"InteractionEvent 165 70 0 0 0 0 0\n"
-"MouseMoveEvent 159 66 0 0 0 0 0\n"
-"RenderEvent 159 66 0 0 0 0 0\n"
-"InteractionEvent 159 66 0 0 0 0 0\n"
-"MouseMoveEvent 155 63 0 0 0 0 0\n"
-"RenderEvent 155 63 0 0 0 0 0\n"
-"InteractionEvent 155 63 0 0 0 0 0\n"
-"MouseMoveEvent 153 61 0 0 0 0 0\n"
-"RenderEvent 153 61 0 0 0 0 0\n"
-"InteractionEvent 153 61 0 0 0 0 0\n"
-"MouseMoveEvent 152 60 0 0 0 0 0\n"
-"RenderEvent 152 60 0 0 0 0 0\n"
-"InteractionEvent 152 60 0 0 0 0 0\n"
-"MouseMoveEvent 151 59 0 0 0 0 0\n"
-"RenderEvent 151 59 0 0 0 0 0\n"
-"InteractionEvent 151 59 0 0 0 0 0\n"
-"MouseMoveEvent 150 58 0 0 0 0 0\n"
-"RenderEvent 150 58 0 0 0 0 0\n"
-"InteractionEvent 150 58 0 0 0 0 0\n"
-"MouseMoveEvent 149 58 0 0 0 0 0\n"
-"RenderEvent 149 58 0 0 0 0 0\n"
-"InteractionEvent 149 58 0 0 0 0 0\n"
-"MouseMoveEvent 147 57 0 0 0 0 0\n"
-"RenderEvent 147 57 0 0 0 0 0\n"
-"InteractionEvent 147 57 0 0 0 0 0\n"
-"MouseMoveEvent 145 57 0 0 0 0 0\n"
-"RenderEvent 145 57 0 0 0 0 0\n"
-"InteractionEvent 145 57 0 0 0 0 0\n"
-"MouseMoveEvent 141 57 0 0 0 0 0\n"
-"RenderEvent 141 57 0 0 0 0 0\n"
-"InteractionEvent 141 57 0 0 0 0 0\n"
-"MouseMoveEvent 136 57 0 0 0 0 0\n"
-"RenderEvent 136 57 0 0 0 0 0\n"
-"InteractionEvent 136 57 0 0 0 0 0\n"
-"MouseMoveEvent 133 57 0 0 0 0 0\n"
-"RenderEvent 133 57 0 0 0 0 0\n"
-"InteractionEvent 133 57 0 0 0 0 0\n"
-"MouseMoveEvent 130 57 0 0 0 0 0\n"
-"RenderEvent 130 57 0 0 0 0 0\n"
-"InteractionEvent 130 57 0 0 0 0 0\n"
-"MouseMoveEvent 125 56 0 0 0 0 0\n"
-"RenderEvent 125 56 0 0 0 0 0\n"
-"InteractionEvent 125 56 0 0 0 0 0\n"
-"MouseMoveEvent 121 56 0 0 0 0 0\n"
-"RenderEvent 121 56 0 0 0 0 0\n"
-"InteractionEvent 121 56 0 0 0 0 0\n"
-"MouseMoveEvent 119 56 0 0 0 0 0\n"
-"RenderEvent 119 56 0 0 0 0 0\n"
-"InteractionEvent 119 56 0 0 0 0 0\n"
-"MouseMoveEvent 116 55 0 0 0 0 0\n"
-"RenderEvent 116 55 0 0 0 0 0\n"
-"InteractionEvent 116 55 0 0 0 0 0\n"
-"MouseMoveEvent 114 54 0 0 0 0 0\n"
-"RenderEvent 114 54 0 0 0 0 0\n"
-"InteractionEvent 114 54 0 0 0 0 0\n"
-"MouseMoveEvent 113 54 0 0 0 0 0\n"
-"RenderEvent 113 54 0 0 0 0 0\n"
-"InteractionEvent 113 54 0 0 0 0 0\n"
-"MouseMoveEvent 112 54 0 0 0 0 0\n"
-"RenderEvent 112 54 0 0 0 0 0\n"
-"InteractionEvent 112 54 0 0 0 0 0\n"
-"MouseMoveEvent 108 53 0 0 0 0 0\n"
-"RenderEvent 108 53 0 0 0 0 0\n"
-"InteractionEvent 108 53 0 0 0 0 0\n"
-"MouseMoveEvent 103 53 0 0 0 0 0\n"
-"RenderEvent 103 53 0 0 0 0 0\n"
-"InteractionEvent 103 53 0 0 0 0 0\n"
-"MouseMoveEvent 99 52 0 0 0 0 0\n"
-"RenderEvent 99 52 0 0 0 0 0\n"
-"InteractionEvent 99 52 0 0 0 0 0\n"
-"MouseMoveEvent 96 52 0 0 0 0 0\n"
-"RenderEvent 96 52 0 0 0 0 0\n"
-"InteractionEvent 96 52 0 0 0 0 0\n"
-"MouseMoveEvent 95 52 0 0 0 0 0\n"
-"RenderEvent 95 52 0 0 0 0 0\n"
-"InteractionEvent 95 52 0 0 0 0 0\n"
-"LeftButtonReleaseEvent 95 52 0 0 0 0 0\n"
-"EndInteractionEvent 95 52 0 0 0 0 0\n"
-"RenderEvent 95 52 0 0 0 0 0\n"
-"MouseMoveEvent 94 52 0 0 0 0 0\n"
-"MouseMoveEvent 95 53 0 0 0 0 0\n"
-"MouseMoveEvent 98 55 0 0 0 0 0\n"
-"MouseMoveEvent 100 55 0 0 0 0 0\n"
-"MouseMoveEvent 102 56 0 0 0 0 0\n"
-"MouseMoveEvent 104 58 0 0 0 0 0\n"
-"MouseMoveEvent 106 60 0 0 0 0 0\n"
-"MouseMoveEvent 109 62 0 0 0 0 0\n"
-"MouseMoveEvent 111 63 0 0 0 0 0\n"
-"MouseMoveEvent 112 64 0 0 0 0 0\n"
-"MouseMoveEvent 113 65 0 0 0 0 0\n"
-"MouseMoveEvent 114 65 0 0 0 0 0\n"
-"MouseMoveEvent 116 66 0 0 0 0 0\n"
-"MouseMoveEvent 119 68 0 0 0 0 0\n"
-"MouseMoveEvent 121 68 0 0 0 0 0\n"
-"MouseMoveEvent 123 69 0 0 0 0 0\n"
-"MouseMoveEvent 125 70 0 0 0 0 0\n"
-"MouseMoveEvent 126 70 0 0 0 0 0\n"
-"MouseWheelForwardEvent 126 70 0 0 0 0 0\n"
-"StartInteractionEvent 126 70 0 0 0 0 0\n"
-"RenderEvent 126 70 0 0 0 0 0\n"
-"EndInteractionEvent 126 70 0 0 0 0 0\n"
-"RenderEvent 126 70 0 0 0 0 0\n"
-"MouseWheelForwardEvent 126 70 0 0 0 1 0\n"
-"StartInteractionEvent 126 70 0 0 0 1 0\n"
-"RenderEvent 126 70 0 0 0 1 0\n"
-"EndInteractionEvent 126 70 0 0 0 1 0\n"
-"RenderEvent 126 70 0 0 0 1 0\n"
-"MouseWheelForwardEvent 126 70 0 0 0 0 0\n"
-"StartInteractionEvent 126 70 0 0 0 0 0\n"
-"RenderEvent 126 70 0 0 0 0 0\n"
-"EndInteractionEvent 126 70 0 0 0 0 0\n"
-"RenderEvent 126 70 0 0 0 0 0\n"
-"MouseWheelForwardEvent 126 70 0 0 0 1 0\n"
-"StartInteractionEvent 126 70 0 0 0 1 0\n"
-"RenderEvent 126 70 0 0 0 1 0\n"
-"EndInteractionEvent 126 70 0 0 0 1 0\n"
-"RenderEvent 126 70 0 0 0 1 0\n"
-"MouseMoveEvent 128 70 0 0 0 0 0\n"
-"MouseMoveEvent 132 70 0 0 0 0 0\n"
-"MouseMoveEvent 137 70 0 0 0 0 0\n"
-"MouseMoveEvent 141 70 0 0 0 0 0\n"
-"MouseMoveEvent 143 71 0 0 0 0 0\n"
-"MouseMoveEvent 146 71 0 0 0 0 0\n"
-"MouseMoveEvent 152 71 0 0 0 0 0\n"
-"MouseMoveEvent 162 73 0 0 0 0 0\n"
-"MouseMoveEvent 174 74 0 0 0 0 0\n"
-"MouseMoveEvent 182 76 0 0 0 0 0\n"
-"MouseMoveEvent 187 78 0 0 0 0 0\n"
-"MouseMoveEvent 191 80 0 0 0 0 0\n"
-"MouseMoveEvent 195 83 0 0 0 0 0\n"
-"MouseMoveEvent 199 87 0 0 0 0 0\n"
-"MouseMoveEvent 201 91 0 0 0 0 0\n"
-"MouseMoveEvent 203 98 0 0 0 0 0\n"
-"MouseMoveEvent 205 105 0 0 0 0 0\n"
-"MouseMoveEvent 207 112 0 0 0 0 0\n"
-"MouseMoveEvent 207 119 0 0 0 0 0\n"
-"MouseMoveEvent 208 127 0 0 0 0 0\n"
-"MouseMoveEvent 208 131 0 0 0 0 0\n"
-"MouseMoveEvent 208 135 0 0 0 0 0\n"
-"MouseMoveEvent 208 139 0 0 0 0 0\n"
-"MouseMoveEvent 208 144 0 0 0 0 0\n"
-"MouseMoveEvent 208 150 0 0 0 0 0\n"
-"MouseMoveEvent 208 155 0 0 0 0 0\n"
-"MouseMoveEvent 208 163 0 0 0 0 0\n"
-"MouseMoveEvent 206 170 0 0 0 0 0\n"
-"MouseMoveEvent 202 177 0 0 0 0 0\n"
-"MouseMoveEvent 200 181 0 0 0 0 0\n"
-"MouseMoveEvent 199 185 0 0 0 0 0\n"
-"MouseMoveEvent 197 187 0 0 0 0 0\n"
-"MouseMoveEvent 197 188 0 0 0 0 0\n"
-"MouseMoveEvent 196 189 0 0 0 0 0\n"
-"MouseMoveEvent 195 190 0 0 0 0 0\n"
-"MouseMoveEvent 194 189 0 0 0 0 0\n"
-"MouseMoveEvent 194 188 0 0 0 0 0\n"
-"MouseMoveEvent 194 187 0 0 0 0 0\n"
-"MouseMoveEvent 194 186 0 0 0 0 0\n"
-"MouseMoveEvent 194 185 0 0 0 0 0\n"
-"MouseMoveEvent 194 184 0 0 0 0 0\n"
-"MouseMoveEvent 195 182 0 0 0 0 0\n"
-"MiddleButtonPressEvent 195 182 0 0 0 0 0\n"
-"StartInteractionEvent 195 182 0 0 0 0 0\n"
-"MouseMoveEvent 195 181 0 0 0 0 0\n"
-"RenderEvent 195 181 0 0 0 0 0\n"
-"InteractionEvent 195 181 0 0 0 0 0\n"
-"MouseMoveEvent 194 180 0 0 0 0 0\n"
-"RenderEvent 194 180 0 0 0 0 0\n"
-"InteractionEvent 194 180 0 0 0 0 0\n"
-"MouseMoveEvent 193 180 0 0 0 0 0\n"
-"RenderEvent 193 180 0 0 0 0 0\n"
-"InteractionEvent 193 180 0 0 0 0 0\n"
-"MouseMoveEvent 192 180 0 0 0 0 0\n"
-"RenderEvent 192 180 0 0 0 0 0\n"
-"InteractionEvent 192 180 0 0 0 0 0\n"
-"MouseMoveEvent 191 180 0 0 0 0 0\n"
-"RenderEvent 191 180 0 0 0 0 0\n"
-"InteractionEvent 191 180 0 0 0 0 0\n"
-"MouseMoveEvent 189 181 0 0 0 0 0\n"
-"RenderEvent 189 181 0 0 0 0 0\n"
-"InteractionEvent 189 181 0 0 0 0 0\n"
-"MouseMoveEvent 187 183 0 0 0 0 0\n"
-"RenderEvent 187 183 0 0 0 0 0\n"
-"InteractionEvent 187 183 0 0 0 0 0\n"
-"MouseMoveEvent 182 189 0 0 0 0 0\n"
-"RenderEvent 182 189 0 0 0 0 0\n"
-"InteractionEvent 182 189 0 0 0 0 0\n"
-"MouseMoveEvent 179 195 0 0 0 0 0\n"
-"RenderEvent 179 195 0 0 0 0 0\n"
-"InteractionEvent 179 195 0 0 0 0 0\n"
-"MouseMoveEvent 176 201 0 0 0 0 0\n"
-"RenderEvent 176 201 0 0 0 0 0\n"
-"InteractionEvent 176 201 0 0 0 0 0\n"
-"MouseMoveEvent 175 205 0 0 0 0 0\n"
-"RenderEvent 175 205 0 0 0 0 0\n"
-"InteractionEvent 175 205 0 0 0 0 0\n"
-"MouseMoveEvent 173 209 0 0 0 0 0\n"
-"RenderEvent 173 209 0 0 0 0 0\n"
-"InteractionEvent 173 209 0 0 0 0 0\n"
-"MouseMoveEvent 172 211 0 0 0 0 0\n"
-"RenderEvent 172 211 0 0 0 0 0\n"
-"InteractionEvent 172 211 0 0 0 0 0\n"
-"MouseMoveEvent 171 213 0 0 0 0 0\n"
-"RenderEvent 171 213 0 0 0 0 0\n"
-"InteractionEvent 171 213 0 0 0 0 0\n"
-"MouseMoveEvent 170 216 0 0 0 0 0\n"
-"RenderEvent 170 216 0 0 0 0 0\n"
-"InteractionEvent 170 216 0 0 0 0 0\n"
-"MouseMoveEvent 170 217 0 0 0 0 0\n"
-"RenderEvent 170 217 0 0 0 0 0\n"
-"InteractionEvent 170 217 0 0 0 0 0\n"
-"MouseMoveEvent 169 218 0 0 0 0 0\n"
-"RenderEvent 169 218 0 0 0 0 0\n"
-"InteractionEvent 169 218 0 0 0 0 0\n"
-"MouseMoveEvent 168 221 0 0 0 0 0\n"
-"RenderEvent 168 221 0 0 0 0 0\n"
-"InteractionEvent 168 221 0 0 0 0 0\n"
-"MouseMoveEvent 168 222 0 0 0 0 0\n"
-"RenderEvent 168 222 0 0 0 0 0\n"
-"InteractionEvent 168 222 0 0 0 0 0\n"
-"MouseMoveEvent 167 224 0 0 0 0 0\n"
-"RenderEvent 167 224 0 0 0 0 0\n"
-"InteractionEvent 167 224 0 0 0 0 0\n"
-"MouseMoveEvent 167 225 0 0 0 0 0\n"
-"RenderEvent 167 225 0 0 0 0 0\n"
-"InteractionEvent 167 225 0 0 0 0 0\n"
-"MouseMoveEvent 167 227 0 0 0 0 0\n"
-"RenderEvent 167 227 0 0 0 0 0\n"
-"InteractionEvent 167 227 0 0 0 0 0\n"
-"MouseMoveEvent 167 230 0 0 0 0 0\n"
-"RenderEvent 167 230 0 0 0 0 0\n"
-"InteractionEvent 167 230 0 0 0 0 0\n"
-"MouseMoveEvent 167 232 0 0 0 0 0\n"
-"RenderEvent 167 232 0 0 0 0 0\n"
-"InteractionEvent 167 232 0 0 0 0 0\n"
-"MouseMoveEvent 166 236 0 0 0 0 0\n"
-"RenderEvent 166 236 0 0 0 0 0\n"
-"InteractionEvent 166 236 0 0 0 0 0\n"
-"MouseMoveEvent 166 239 0 0 0 0 0\n"
-"RenderEvent 166 239 0 0 0 0 0\n"
-"InteractionEvent 166 239 0 0 0 0 0\n"
-"MouseMoveEvent 166 243 0 0 0 0 0\n"
-"RenderEvent 166 243 0 0 0 0 0\n"
-"InteractionEvent 166 243 0 0 0 0 0\n"
-"MouseMoveEvent 166 245 0 0 0 0 0\n"
-"RenderEvent 166 245 0 0 0 0 0\n"
-"InteractionEvent 166 245 0 0 0 0 0\n"
-"MouseMoveEvent 166 250 0 0 0 0 0\n"
-"RenderEvent 166 250 0 0 0 0 0\n"
-"InteractionEvent 166 250 0 0 0 0 0\n"
-"MouseMoveEvent 166 253 0 0 0 0 0\n"
-"RenderEvent 166 253 0 0 0 0 0\n"
-"InteractionEvent 166 253 0 0 0 0 0\n"
-"MouseMoveEvent 166 255 0 0 0 0 0\n"
-"RenderEvent 166 255 0 0 0 0 0\n"
-"InteractionEvent 166 255 0 0 0 0 0\n"
-"MouseMoveEvent 166 259 0 0 0 0 0\n"
-"RenderEvent 166 259 0 0 0 0 0\n"
-"InteractionEvent 166 259 0 0 0 0 0\n"
-"MouseMoveEvent 166 261 0 0 0 0 0\n"
-"RenderEvent 166 261 0 0 0 0 0\n"
-"InteractionEvent 166 261 0 0 0 0 0\n"
-"MouseMoveEvent 166 262 0 0 0 0 0\n"
-"RenderEvent 166 262 0 0 0 0 0\n"
-"InteractionEvent 166 262 0 0 0 0 0\n"
-"MouseMoveEvent 166 263 0 0 0 0 0\n"
-"RenderEvent 166 263 0 0 0 0 0\n"
-"InteractionEvent 166 263 0 0 0 0 0\n"
-"MouseMoveEvent 166 266 0 0 0 0 0\n"
-"RenderEvent 166 266 0 0 0 0 0\n"
-"InteractionEvent 166 266 0 0 0 0 0\n"
-"MouseMoveEvent 166 267 0 0 0 0 0\n"
-"RenderEvent 166 267 0 0 0 0 0\n"
-"InteractionEvent 166 267 0 0 0 0 0\n"
-"MouseMoveEvent 166 268 0 0 0 0 0\n"
-"RenderEvent 166 268 0 0 0 0 0\n"
-"InteractionEvent 166 268 0 0 0 0 0\n"
-"MouseMoveEvent 167 269 0 0 0 0 0\n"
-"RenderEvent 167 269 0 0 0 0 0\n"
-"InteractionEvent 167 269 0 0 0 0 0\n"
-"MiddleButtonReleaseEvent 167 269 0 0 0 0 0\n"
-"EndInteractionEvent 167 269 0 0 0 0 0\n"
-"RenderEvent 167 269 0 0 0 0 0\n"
-"MouseMoveEvent 167 267 0 0 0 0 0\n"
-"MouseMoveEvent 167 265 0 0 0 0 0\n"
-"MouseMoveEvent 165 261 0 0 0 0 0\n"
-"MouseMoveEvent 165 258 0 0 0 0 0\n"
-"MouseMoveEvent 165 254 0 0 0 0 0\n"
-"MouseMoveEvent 165 247 0 0 0 0 0\n"
-"MouseMoveEvent 165 238 0 0 0 0 0\n"
-"MouseMoveEvent 165 227 0 0 0 0 0\n"
-"MouseMoveEvent 165 215 0 0 0 0 0\n"
-"MouseMoveEvent 165 206 0 0 0 0 0\n"
-"MouseMoveEvent 165 196 0 0 0 0 0\n"
-"MouseMoveEvent 165 188 0 0 0 0 0\n"
-"MouseMoveEvent 168 180 0 0 0 0 0\n"
-"MouseMoveEvent 170 172 0 0 0 0 0\n"
-"MouseMoveEvent 170 164 0 0 0 0 0\n"
-"MouseMoveEvent 173 156 0 0 0 0 0\n"
-"MouseMoveEvent 175 148 0 0 0 0 0\n"
-"MouseMoveEvent 177 142 0 0 0 0 0\n"
-"MouseMoveEvent 178 136 0 0 0 0 0\n"
-"MouseMoveEvent 180 130 0 0 0 0 0\n"
-"MouseMoveEvent 180 125 0 0 0 0 0\n"
-"MouseWheelForwardEvent 180 125 0 0 0 0 0\n"
-"StartInteractionEvent 180 125 0 0 0 0 0\n"
-"RenderEvent 180 125 0 0 0 0 0\n"
-"EndInteractionEvent 180 125 0 0 0 0 0\n"
-"RenderEvent 180 125 0 0 0 0 0\n"
-"MouseWheelForwardEvent 180 125 0 0 0 1 0\n"
-"StartInteractionEvent 180 125 0 0 0 1 0\n"
-"RenderEvent 180 125 0 0 0 1 0\n"
-"EndInteractionEvent 180 125 0 0 0 1 0\n"
-"RenderEvent 180 125 0 0 0 1 0\n"
-"MouseWheelForwardEvent 180 125 0 0 0 0 0\n"
-"StartInteractionEvent 180 125 0 0 0 0 0\n"
-"RenderEvent 180 125 0 0 0 0 0\n"
-"EndInteractionEvent 180 125 0 0 0 0 0\n"
-"RenderEvent 180 125 0 0 0 0 0\n"
-"MouseWheelForwardEvent 180 125 0 0 0 1 0\n"
-"StartInteractionEvent 180 125 0 0 0 1 0\n"
-"RenderEvent 180 125 0 0 0 1 0\n"
-"EndInteractionEvent 180 125 0 0 0 1 0\n"
-"RenderEvent 180 125 0 0 0 1 0\n"
-"MouseWheelForwardEvent 180 125 0 0 0 0 0\n"
-"StartInteractionEvent 180 125 0 0 0 0 0\n"
-"RenderEvent 180 125 0 0 0 0 0\n"
-"EndInteractionEvent 180 125 0 0 0 0 0\n"
-"RenderEvent 180 125 0 0 0 0 0\n"
-"MouseWheelForwardEvent 180 125 0 0 0 0 0\n"
-"StartInteractionEvent 180 125 0 0 0 0 0\n"
-"RenderEvent 180 125 0 0 0 0 0\n"
-"EndInteractionEvent 180 125 0 0 0 0 0\n"
-"RenderEvent 180 125 0 0 0 0 0\n"
-"MouseWheelForwardEvent 180 125 0 0 0 1 0\n"
-"StartInteractionEvent 180 125 0 0 0 1 0\n"
-"RenderEvent 180 125 0 0 0 1 0\n"
-"EndInteractionEvent 180 125 0 0 0 1 0\n"
-"RenderEvent 180 125 0 0 0 1 0\n"
-"MouseWheelForwardEvent 180 125 0 0 0 0 0\n"
-"StartInteractionEvent 180 125 0 0 0 0 0\n"
-"RenderEvent 180 125 0 0 0 0 0\n"
-"EndInteractionEvent 180 125 0 0 0 0 0\n"
-"RenderEvent 180 125 0 0 0 0 0\n"
-"MouseMoveEvent 181 124 0 0 0 0 0\n"
-"MouseMoveEvent 185 124 0 0 0 0 0\n"
-"MouseMoveEvent 195 124 0 0 0 0 0\n"
-"MouseMoveEvent 207 124 0 0 0 0 0\n"
-"MouseMoveEvent 217 124 0 0 0 0 0\n"
-"MouseMoveEvent 228 124 0 0 0 0 0\n"
-"MouseMoveEvent 237 124 0 0 0 0 0\n"
-"MouseMoveEvent 249 124 0 0 0 0 0\n"
-"MouseMoveEvent 260 124 0 0 0 0 0\n"
-"MouseMoveEvent 270 126 0 0 0 0 0\n"
-"MouseMoveEvent 272 126 0 0 0 0 0\n"
-"MouseMoveEvent 273 126 0 0 0 0 0\n"
-"MouseMoveEvent 274 127 0 0 0 0 0\n"
-"MouseMoveEvent 275 127 0 0 0 0 0\n"
-"MouseMoveEvent 276 128 0 0 0 0 0\n"
-"MouseMoveEvent 277 129 0 0 0 0 0\n"
-"LeftButtonPressEvent 277 129 0 0 0 0 0\n"
-"StartInteractionEvent 277 129 0 0 0 0 0\n"
-"MouseMoveEvent 276 130 0 0 0 0 0\n"
-"RenderEvent 276 130 0 0 0 0 0\n"
-"InteractionEvent 276 130 0 0 0 0 0\n"
-"MouseMoveEvent 275 130 0 0 0 0 0\n"
-"RenderEvent 275 130 0 0 0 0 0\n"
-"InteractionEvent 275 130 0 0 0 0 0\n"
-"MouseMoveEvent 273 130 0 0 0 0 0\n"
-"RenderEvent 273 130 0 0 0 0 0\n"
-"InteractionEvent 273 130 0 0 0 0 0\n"
-"MouseMoveEvent 272 130 0 0 0 0 0\n"
-"RenderEvent 272 130 0 0 0 0 0\n"
-"InteractionEvent 272 130 0 0 0 0 0\n"
-"MouseMoveEvent 271 130 0 0 0 0 0\n"
-"RenderEvent 271 130 0 0 0 0 0\n"
-"InteractionEvent 271 130 0 0 0 0 0\n"
-"MouseMoveEvent 270 130 0 0 0 0 0\n"
-"RenderEvent 270 130 0 0 0 0 0\n"
-"InteractionEvent 270 130 0 0 0 0 0\n"
-"MouseMoveEvent 269 130 0 0 0 0 0\n"
-"RenderEvent 269 130 0 0 0 0 0\n"
-"InteractionEvent 269 130 0 0 0 0 0\n"
-"MouseMoveEvent 267 130 0 0 0 0 0\n"
-"RenderEvent 267 130 0 0 0 0 0\n"
-"InteractionEvent 267 130 0 0 0 0 0\n"
-"MouseMoveEvent 266 130 0 0 0 0 0\n"
-"RenderEvent 266 130 0 0 0 0 0\n"
-"InteractionEvent 266 130 0 0 0 0 0\n"
-"MouseMoveEvent 265 130 0 0 0 0 0\n"
-"RenderEvent 265 130 0 0 0 0 0\n"
-"InteractionEvent 265 130 0 0 0 0 0\n"
-"MouseMoveEvent 264 130 0 0 0 0 0\n"
-"RenderEvent 264 130 0 0 0 0 0\n"
-"InteractionEvent 264 130 0 0 0 0 0\n"
-"MouseMoveEvent 263 130 0 0 0 0 0\n"
-"RenderEvent 263 130 0 0 0 0 0\n"
-"InteractionEvent 263 130 0 0 0 0 0\n"
-"MouseMoveEvent 261 130 0 0 0 0 0\n"
-"RenderEvent 261 130 0 0 0 0 0\n"
-"InteractionEvent 261 130 0 0 0 0 0\n"
-"MouseMoveEvent 260 130 0 0 0 0 0\n"
-"RenderEvent 260 130 0 0 0 0 0\n"
-"InteractionEvent 260 130 0 0 0 0 0\n"
-"MouseMoveEvent 259 130 0 0 0 0 0\n"
-"RenderEvent 259 130 0 0 0 0 0\n"
-"InteractionEvent 259 130 0 0 0 0 0\n"
-"MouseMoveEvent 258 130 0 0 0 0 0\n"
-"RenderEvent 258 130 0 0 0 0 0\n"
-"InteractionEvent 258 130 0 0 0 0 0\n"
-"MouseMoveEvent 256 130 0 0 0 0 0\n"
-"RenderEvent 256 130 0 0 0 0 0\n"
-"InteractionEvent 256 130 0 0 0 0 0\n"
-"MouseMoveEvent 255 130 0 0 0 0 0\n"
-"RenderEvent 255 130 0 0 0 0 0\n"
-"InteractionEvent 255 130 0 0 0 0 0\n"
-"MouseMoveEvent 254 130 0 0 0 0 0\n"
-"RenderEvent 254 130 0 0 0 0 0\n"
-"InteractionEvent 254 130 0 0 0 0 0\n"
-"MouseMoveEvent 251 130 0 0 0 0 0\n"
-"RenderEvent 251 130 0 0 0 0 0\n"
-"InteractionEvent 251 130 0 0 0 0 0\n"
-"MouseMoveEvent 248 130 0 0 0 0 0\n"
-"RenderEvent 248 130 0 0 0 0 0\n"
-"InteractionEvent 248 130 0 0 0 0 0\n"
-"MouseMoveEvent 245 130 0 0 0 0 0\n"
-"RenderEvent 245 130 0 0 0 0 0\n"
-"InteractionEvent 245 130 0 0 0 0 0\n"
-"MouseMoveEvent 244 130 0 0 0 0 0\n"
-"RenderEvent 244 130 0 0 0 0 0\n"
-"InteractionEvent 244 130 0 0 0 0 0\n"
-"MouseMoveEvent 245 130 0 0 0 0 0\n"
-"RenderEvent 245 130 0 0 0 0 0\n"
-"InteractionEvent 245 130 0 0 0 0 0\n"
-"MouseMoveEvent 247 130 0 0 0 0 0\n"
-"RenderEvent 247 130 0 0 0 0 0\n"
-"InteractionEvent 247 130 0 0 0 0 0\n"
-"MouseMoveEvent 248 130 0 0 0 0 0\n"
-"RenderEvent 248 130 0 0 0 0 0\n"
-"InteractionEvent 248 130 0 0 0 0 0\n"
-"MouseMoveEvent 250 130 0 0 0 0 0\n"
-"RenderEvent 250 130 0 0 0 0 0\n"
-"InteractionEvent 250 130 0 0 0 0 0\n"
-"MouseMoveEvent 253 130 0 0 0 0 0\n"
-"RenderEvent 253 130 0 0 0 0 0\n"
-"InteractionEvent 253 130 0 0 0 0 0\n"
-"MouseMoveEvent 257 130 0 0 0 0 0\n"
-"RenderEvent 257 130 0 0 0 0 0\n"
-"InteractionEvent 257 130 0 0 0 0 0\n"
-"MouseMoveEvent 258 130 0 0 0 0 0\n"
-"RenderEvent 258 130 0 0 0 0 0\n"
-"InteractionEvent 258 130 0 0 0 0 0\n"
-"MouseMoveEvent 260 130 0 0 0 0 0\n"
-"RenderEvent 260 130 0 0 0 0 0\n"
-"InteractionEvent 260 130 0 0 0 0 0\n"
-"MouseMoveEvent 261 130 0 0 0 0 0\n"
-"RenderEvent 261 130 0 0 0 0 0\n"
-"InteractionEvent 261 130 0 0 0 0 0\n"
-"MouseMoveEvent 262 130 0 0 0 0 0\n"
-"RenderEvent 262 130 0 0 0 0 0\n"
-"InteractionEvent 262 130 0 0 0 0 0\n"
-"MouseMoveEvent 263 130 0 0 0 0 0\n"
-"RenderEvent 263 130 0 0 0 0 0\n"
-"InteractionEvent 263 130 0 0 0 0 0\n"
-"MouseMoveEvent 266 130 0 0 0 0 0\n"
-"RenderEvent 266 130 0 0 0 0 0\n"
-"InteractionEvent 266 130 0 0 0 0 0\n"
-"MouseMoveEvent 269 130 0 0 0 0 0\n"
-"RenderEvent 269 130 0 0 0 0 0\n"
-"InteractionEvent 269 130 0 0 0 0 0\n"
-"MouseMoveEvent 271 130 0 0 0 0 0\n"
-"RenderEvent 271 130 0 0 0 0 0\n"
-"InteractionEvent 271 130 0 0 0 0 0\n"
-"MouseMoveEvent 275 130 0 0 0 0 0\n"
-"RenderEvent 275 130 0 0 0 0 0\n"
-"InteractionEvent 275 130 0 0 0 0 0\n"
-"MouseMoveEvent 276 130 0 0 0 0 0\n"
-"RenderEvent 276 130 0 0 0 0 0\n"
-"InteractionEvent 276 130 0 0 0 0 0\n"
-"MouseMoveEvent 277 130 0 0 0 0 0\n"
-"RenderEvent 277 130 0 0 0 0 0\n"
-"InteractionEvent 277 130 0 0 0 0 0\n"
-"MouseMoveEvent 278 130 0 0 0 0 0\n"
-"RenderEvent 278 130 0 0 0 0 0\n"
-"InteractionEvent 278 130 0 0 0 0 0\n"
-"MouseMoveEvent 279 130 0 0 0 0 0\n"
-"RenderEvent 279 130 0 0 0 0 0\n"
-"InteractionEvent 279 130 0 0 0 0 0\n"
-"MouseMoveEvent 280 130 0 0 0 0 0\n"
-"RenderEvent 280 130 0 0 0 0 0\n"
-"InteractionEvent 280 130 0 0 0 0 0\n"
-"MouseMoveEvent 282 130 0 0 0 0 0\n"
-"RenderEvent 282 130 0 0 0 0 0\n"
-"InteractionEvent 282 130 0 0 0 0 0\n"
-"MouseMoveEvent 283 130 0 0 0 0 0\n"
-"RenderEvent 283 130 0 0 0 0 0\n"
-"InteractionEvent 283 130 0 0 0 0 0\n"
-"MouseMoveEvent 284 130 0 0 0 0 0\n"
-"RenderEvent 284 130 0 0 0 0 0\n"
-"InteractionEvent 284 130 0 0 0 0 0\n"
-"MouseMoveEvent 285 130 0 0 0 0 0\n"
-"RenderEvent 285 130 0 0 0 0 0\n"
-"InteractionEvent 285 130 0 0 0 0 0\n"
-"MouseMoveEvent 286 130 0 0 0 0 0\n"
-"RenderEvent 286 130 0 0 0 0 0\n"
-"InteractionEvent 286 130 0 0 0 0 0\n"
-"MouseMoveEvent 287 130 0 0 0 0 0\n"
-"RenderEvent 287 130 0 0 0 0 0\n"
-"InteractionEvent 287 130 0 0 0 0 0\n"
-"MouseMoveEvent 289 130 0 0 0 0 0\n"
-"RenderEvent 289 130 0 0 0 0 0\n"
-"InteractionEvent 289 130 0 0 0 0 0\n"
-"MouseMoveEvent 291 130 0 0 0 0 0\n"
-"RenderEvent 291 130 0 0 0 0 0\n"
-"InteractionEvent 291 130 0 0 0 0 0\n"
-"MouseMoveEvent 293 130 0 0 0 0 0\n"
-"RenderEvent 293 130 0 0 0 0 0\n"
-"InteractionEvent 293 130 0 0 0 0 0\n"
-"MouseMoveEvent 296 130 0 0 0 0 0\n"
-"RenderEvent 296 130 0 0 0 0 0\n"
-"InteractionEvent 296 130 0 0 0 0 0\n"
-"MouseMoveEvent 298 130 0 0 0 0 0\n"
-"RenderEvent 298 130 0 0 0 0 0\n"
-"InteractionEvent 298 130 0 0 0 0 0\n"
-"MouseMoveEvent 300 130 0 0 0 0 0\n"
-"RenderEvent 300 130 0 0 0 0 0\n"
-"InteractionEvent 300 130 0 0 0 0 0\n"
-"LeaveEvent 301 130 0 0 0 0 0\n"
-"MouseMoveEvent 301 130 0 0 0 0 0\n"
-"RenderEvent 301 130 0 0 0 0 0\n"
-"InteractionEvent 301 130 0 0 0 0 0\n"
-"MouseMoveEvent 303 130 0 0 0 0 0\n"
-"RenderEvent 303 130 0 0 0 0 0\n"
-"InteractionEvent 303 130 0 0 0 0 0\n"
-"MouseMoveEvent 304 130 0 0 0 0 0\n"
-"RenderEvent 304 130 0 0 0 0 0\n"
-"InteractionEvent 304 130 0 0 0 0 0\n"
-"LeftButtonReleaseEvent 304 130 0 0 0 0 0\n"
-"EndInteractionEvent 304 130 0 0 0 0 0\n"
-"RenderEvent 304 130 0 0 0 0 0\n"
-"LeaveEvent 304 130 0 0 0 0 0\n"
-"EnterEvent 300 124 0 0 0 0 0\n"
-"MouseMoveEvent 300 124 0 0 0 0 0\n"
-"MouseMoveEvent 297 121 0 0 0 0 0\n"
-"MouseMoveEvent 294 118 0 0 0 0 0\n"
-"MouseMoveEvent 292 116 0 0 0 0 0\n"
-"MouseMoveEvent 290 114 0 0 0 0 0\n"
-"MouseMoveEvent 287 111 0 0 0 0 0\n"
-"MouseMoveEvent 284 108 0 0 0 0 0\n"
-"MouseMoveEvent 282 106 0 0 0 0 0\n"
-"MouseMoveEvent 280 104 0 0 0 0 0\n"
-"MouseMoveEvent 279 103 0 0 0 0 0\n"
-"MouseMoveEvent 278 102 0 0 0 0 0\n"
-"MouseMoveEvent 277 101 0 0 0 0 0\n"
-"MouseMoveEvent 276 100 0 0 0 0 0\n"
-"MouseMoveEvent 275 99 0 0 0 0 0\n"
-"MouseMoveEvent 274 98 0 0 0 0 0\n"
-"MouseMoveEvent 273 97 0 0 0 0 0\n"
-"MouseMoveEvent 272 96 0 0 0 0 0\n"
-"MouseMoveEvent 271 95 0 0 0 0 0\n"
-"MouseMoveEvent 270 94 0 0 0 0 0\n"
-"MouseMoveEvent 268 93 0 0 0 0 0\n"
-"MouseMoveEvent 265 91 0 0 0 0 0\n"
-"MouseMoveEvent 263 90 0 0 0 0 0\n"
-"MouseMoveEvent 261 89 0 0 0 0 0\n"
-"MouseMoveEvent 258 88 0 0 0 0 0\n"
-"MouseMoveEvent 255 88 0 0 0 0 0\n"
-"MouseMoveEvent 252 88 0 0 0 0 0\n"
-"MouseMoveEvent 249 87 0 0 0 0 0\n"
-"MouseMoveEvent 247 87 0 0 0 0 0\n"
-"MouseMoveEvent 245 87 0 0 0 0 0\n"
-"MouseMoveEvent 244 87 0 0 0 0 0\n"
-"MouseMoveEvent 243 87 0 0 0 0 0\n"
-"MouseMoveEvent 242 87 0 0 0 0 0\n"
-"MouseMoveEvent 240 86 0 0 0 0 0\n"
-"MouseMoveEvent 237 86 0 0 0 0 0\n"
-"MouseMoveEvent 236 86 0 0 0 0 0\n"
-"MouseMoveEvent 234 86 0 0 0 0 0\n"
-"MouseMoveEvent 232 86 0 0 0 0 0\n"
-"MouseMoveEvent 229 86 0 0 0 0 0\n"
-"MouseMoveEvent 227 86 0 0 0 0 0\n"
-"MouseMoveEvent 226 86 0 0 0 0 0\n"
-"MouseMoveEvent 225 86 0 0 0 0 0\n"
-"MouseMoveEvent 224 87 0 0 0 0 0\n"
-"MouseMoveEvent 224 88 0 0 0 0 0\n"
-"MouseMoveEvent 224 89 0 0 0 0 0\n"
-"MouseMoveEvent 224 90 0 0 0 0 0\n"
-"MouseWheelForwardEvent 224 90 0 0 0 0 0\n"
-"StartInteractionEvent 224 90 0 0 0 0 0\n"
-"RenderEvent 224 90 0 0 0 0 0\n"
-"EndInteractionEvent 224 90 0 0 0 0 0\n"
-"RenderEvent 224 90 0 0 0 0 0\n"
-"MouseWheelBackwardEvent 224 90 0 0 0 0 0\n"
-"StartInteractionEvent 224 90 0 0 0 0 0\n"
-"RenderEvent 224 90 0 0 0 0 0\n"
-"EndInteractionEvent 224 90 0 0 0 0 0\n"
-"RenderEvent 224 90 0 0 0 0 0\n"
-"MouseWheelBackwardEvent 224 90 0 0 0 1 0\n"
-"StartInteractionEvent 224 90 0 0 0 1 0\n"
-"RenderEvent 224 90 0 0 0 1 0\n"
-"EndInteractionEvent 224 90 0 0 0 1 0\n"
-"RenderEvent 224 90 0 0 0 1 0\n"
-"MouseWheelBackwardEvent 224 90 0 0 0 0 0\n"
-"StartInteractionEvent 224 90 0 0 0 0 0\n"
-"RenderEvent 224 90 0 0 0 0 0\n"
-"EndInteractionEvent 224 90 0 0 0 0 0\n"
-"RenderEvent 224 90 0 0 0 0 0\n"
-"MouseWheelBackwardEvent 224 90 0 0 0 0 0\n"
-"StartInteractionEvent 224 90 0 0 0 0 0\n"
-"RenderEvent 224 90 0 0 0 0 0\n"
-"EndInteractionEvent 224 90 0 0 0 0 0\n"
-"RenderEvent 224 90 0 0 0 0 0\n"
-"MouseWheelBackwardEvent 224 90 0 0 0 1 0\n"
-"StartInteractionEvent 224 90 0 0 0 1 0\n"
-"RenderEvent 224 90 0 0 0 1 0\n"
-"EndInteractionEvent 224 90 0 0 0 1 0\n"
-"RenderEvent 224 90 0 0 0 1 0\n"
-"MouseWheelBackwardEvent 224 90 0 0 0 0 0\n"
-"StartInteractionEvent 224 90 0 0 0 0 0\n"
-"RenderEvent 224 90 0 0 0 0 0\n"
-"EndInteractionEvent 224 90 0 0 0 0 0\n"
-"RenderEvent 224 90 0 0 0 0 0\n"
-"MouseMoveEvent 223 89 0 0 0 0 0\n"
-"MouseMoveEvent 222 89 0 0 0 0 0\n"
-"MouseMoveEvent 220 88 0 0 0 0 0\n"
-"MouseMoveEvent 219 88 0 0 0 0 0\n"
-"MouseMoveEvent 216 88 0 0 0 0 0\n"
-"MouseMoveEvent 213 88 0 0 0 0 0\n"
-"MouseMoveEvent 209 88 0 0 0 0 0\n"
-"MouseMoveEvent 202 88 0 0 0 0 0\n"
-"MouseMoveEvent 195 88 0 0 0 0 0\n"
-"MouseMoveEvent 186 88 0 0 0 0 0\n"
-"MouseMoveEvent 176 88 0 0 0 0 0\n"
-"MouseMoveEvent 169 88 0 0 0 0 0\n"
-"MouseMoveEvent 165 88 0 0 0 0 0\n"
-"MouseMoveEvent 162 88 0 0 0 0 0\n"
-"MouseMoveEvent 159 88 0 0 0 0 0\n"
-"MouseMoveEvent 158 88 0 0 0 0 0\n"
-"MouseMoveEvent 157 88 0 0 0 0 0\n"
-"MouseMoveEvent 155 88 0 0 0 0 0\n"
-"MouseMoveEvent 154 88 0 0 0 0 0\n"
-"MouseMoveEvent 153 88 0 0 0 0 0\n"
-"MouseMoveEvent 152 88 0 0 0 0 0\n"
-"MouseMoveEvent 151 88 0 0 0 0 0\n"
-"MouseMoveEvent 150 88 0 0 0 0 0\n"
-"MouseMoveEvent 148 88 0 0 0 0 0\n"
-"MouseMoveEvent 147 88 0 0 0 0 0\n"
-"MouseMoveEvent 146 88 0 0 0 0 0\n"
-"MouseMoveEvent 145 88 0 0 0 0 0\n"
-"MouseMoveEvent 144 88 0 0 0 0 0\n"
-"MouseMoveEvent 143 88 0 0 0 0 0\n"
-"MouseMoveEvent 142 88 0 0 0 0 0\n"
-"MouseMoveEvent 141 88 0 0 0 0 0\n"
-"MouseMoveEvent 140 88 0 0 0 0 0\n"
-"MouseMoveEvent 141 88 0 0 0 0 0\n"
-"MouseMoveEvent 142 88 0 0 0 0 0\n"
-"MouseMoveEvent 144 90 0 0 0 0 0\n"
-"MouseMoveEvent 144 92 0 0 0 0 0\n"
-"MouseMoveEvent 145 94 0 0 0 0 0\n"
-"MouseMoveEvent 145 96 0 0 0 0 0\n"
-"MouseMoveEvent 145 98 0 0 0 0 0\n"
-"MouseMoveEvent 145 100 0 0 0 0 0\n"
-"MouseMoveEvent 145 103 0 0 0 0 0\n"
-"MouseMoveEvent 145 105 0 0 0 0 0\n"
-"MouseMoveEvent 145 109 0 0 0 0 0\n"
-"MouseMoveEvent 145 112 0 0 0 0 0\n"
-"MouseMoveEvent 144 115 0 0 0 0 0\n"
-"MouseMoveEvent 144 118 0 0 0 0 0\n"
-"MouseMoveEvent 144 122 0 0 0 0 0\n"
-"MouseMoveEvent 145 125 0 0 0 0 0\n"
-"MouseMoveEvent 146 129 0 0 0 0 0\n"
-"MouseMoveEvent 148 133 0 0 0 0 0\n"
-"MouseMoveEvent 149 138 0 0 0 0 0\n"
-"MouseMoveEvent 152 145 0 0 0 0 0\n"
-"MouseMoveEvent 156 152 0 0 0 0 0\n"
-"MouseMoveEvent 162 159 0 0 0 0 0\n"
-"MouseMoveEvent 168 168 0 0 0 0 0\n"
-"MouseMoveEvent 172 174 0 0 0 0 0\n"
-"MouseMoveEvent 176 182 0 0 0 0 0\n"
-"MouseMoveEvent 181 190 0 0 0 0 0\n"
-"MouseMoveEvent 185 198 0 0 0 0 0\n"
-"MouseMoveEvent 189 202 0 0 0 0 0\n"
-"MouseMoveEvent 194 206 0 0 0 0 0\n"
-"MouseMoveEvent 198 211 0 0 0 0 0\n"
-"MouseMoveEvent 202 212 0 0 0 0 0\n"
-"MouseMoveEvent 203 214 0 0 0 0 0\n"
-"MouseMoveEvent 205 215 0 0 0 0 0\n"
-"MouseMoveEvent 206 215 0 0 0 0 0\n"
-"MouseMoveEvent 208 215 0 0 0 0 0\n"
-"MouseMoveEvent 210 215 0 0 0 0 0\n"
-"MouseMoveEvent 212 215 0 0 0 0 0\n"
-"MouseMoveEvent 215 215 0 0 0 0 0\n"
-"MouseMoveEvent 217 215 0 0 0 0 0\n"
-"MouseMoveEvent 220 215 0 0 0 0 0\n"
-"MouseMoveEvent 225 215 0 0 0 0 0\n"
-"MouseMoveEvent 231 215 0 0 0 0 0\n"
-"MouseMoveEvent 239 215 0 0 0 0 0\n"
-"MouseMoveEvent 250 215 0 0 0 0 0\n"
-"MouseMoveEvent 262 215 0 0 0 0 0\n"
-"MouseMoveEvent 273 212 0 0 0 0 0\n"
-"MouseMoveEvent 284 206 0 0 0 0 0\n"
-"MouseMoveEvent 296 198 0 0 0 0 0\n"
-"LeaveEvent 304 189 0 0 0 0 0\n"
-"EnterEvent 296 131 0 0 0 0 0\n"
-"MouseMoveEvent 296 131 0 0 0 0 0\n"
-"MouseMoveEvent 291 133 0 0 0 0 0\n"
-"MouseMoveEvent 286 135 0 0 0 0 0\n"
-"MouseMoveEvent 280 139 0 0 0 0 0\n"
-"MouseMoveEvent 276 143 0 0 0 0 0\n"
-"MouseMoveEvent 275 144 0 0 0 0 0\n"
-"MouseMoveEvent 274 145 0 0 0 0 0\n"
-"MouseMoveEvent 273 146 0 0 0 0 0\n"
-"MouseMoveEvent 271 147 0 0 0 0 0\n"
-"MouseMoveEvent 270 148 0 0 0 0 0\n"
-"MouseMoveEvent 269 148 0 0 0 0 0\n"
-"MouseMoveEvent 268 148 0 0 0 0 0\n"
-"MouseMoveEvent 267 148 0 0 0 0 0\n"
-"MouseMoveEvent 266 148 0 0 0 0 0\n"
-"MouseMoveEvent 265 148 0 0 0 0 0\n"
-"MouseMoveEvent 264 148 0 0 0 0 0\n"
-"MouseMoveEvent 263 148 0 0 0 0 0\n"
-"MouseMoveEvent 261 148 0 0 0 0 0\n"
-"MouseMoveEvent 260 148 0 0 0 0 0\n"
-"MouseMoveEvent 259 148 0 0 0 0 0\n"
-"MouseMoveEvent 257 148 0 0 0 0 0\n"
-"MouseMoveEvent 255 147 0 0 0 0 0\n"
-"MouseMoveEvent 254 147 0 0 0 0 0\n"
-"MouseMoveEvent 253 146 0 0 0 0 0\n"
-"MouseMoveEvent 252 146 0 0 0 0 0\n"
-"MouseMoveEvent 250 146 0 0 0 0 0\n"
-"MouseMoveEvent 248 146 0 0 0 0 0\n"
-"MouseMoveEvent 246 146 0 0 0 0 0\n"
-"MouseMoveEvent 244 146 0 0 0 0 0\n"
-"MouseMoveEvent 242 146 0 0 0 0 0\n"
-"MouseMoveEvent 240 146 0 0 0 0 0\n"
-"MouseMoveEvent 238 146 0 0 0 0 0\n"
-"MouseMoveEvent 235 146 0 0 0 0 0\n"
-"MouseMoveEvent 233 146 0 0 0 0 0\n"
-"MouseMoveEvent 229 147 0 0 0 0 0\n"
-"MouseMoveEvent 228 148 0 0 0 0 0\n"
-"MouseMoveEvent 225 149 0 0 0 0 0\n"
-"MouseMoveEvent 222 151 0 0 0 0 0\n"
-"MouseMoveEvent 219 154 0 0 0 0 0\n"
-"MouseMoveEvent 217 155 0 0 0 0 0\n"
-"MouseMoveEvent 214 158 0 0 0 0 0\n"
-"MouseMoveEvent 210 165 0 0 0 0 0\n"
-"MouseMoveEvent 205 172 0 0 0 0 0\n"
-"MouseMoveEvent 200 179 0 0 0 0 0\n"
-"MouseMoveEvent 194 186 0 0 0 0 0\n"
-"MouseMoveEvent 190 191 0 0 0 0 0\n"
-"MouseMoveEvent 189 192 0 0 0 0 0\n"
-"MouseMoveEvent 188 193 0 0 0 0 0\n"
-"MouseMoveEvent 188 194 0 0 0 0 0\n"
-"MouseMoveEvent 187 195 0 0 0 0 0\n"
-"MouseMoveEvent 186 196 0 0 0 0 0\n"
-"MouseMoveEvent 185 197 0 0 0 0 0\n"
-"MouseMoveEvent 184 198 0 0 0 0 0\n"
-"MouseMoveEvent 183 198 0 0 0 0 0\n"
-"MouseMoveEvent 182 197 0 0 0 0 0\n"
-"MouseMoveEvent 181 197 0 0 0 0 0\n"
-"MouseMoveEvent 180 197 0 0 0 0 0\n"
-"MouseMoveEvent 179 196 0 0 0 0 0\n"
-"MouseMoveEvent 178 196 0 0 0 0 0\n"
-"MouseMoveEvent 175 196 0 0 0 0 0\n"
-"MouseMoveEvent 172 196 0 0 0 0 0\n"
-"MouseMoveEvent 171 196 0 0 0 0 0\n"
-"MouseMoveEvent 168 196 0 0 0 0 0\n"
-"MouseMoveEvent 166 196 0 0 0 0 0\n"
-"MouseMoveEvent 164 196 0 0 0 0 0\n"
-"MouseMoveEvent 161 196 0 0 0 0 0\n"
-"MouseMoveEvent 159 196 0 0 0 0 0\n"
-"MouseMoveEvent 157 196 0 0 0 0 0\n"
-"MouseMoveEvent 155 196 0 0 0 0 0\n"
-"MouseMoveEvent 153 196 0 0 0 0 0\n"
-"MouseMoveEvent 152 196 0 0 0 0 0\n"
-"MouseMoveEvent 149 196 0 0 0 0 0\n"
-"MouseMoveEvent 146 198 0 0 0 0 0\n"
-"MouseMoveEvent 144 200 0 0 0 0 0\n"
-"MouseMoveEvent 142 202 0 0 0 0 0\n"
-"MouseMoveEvent 139 204 0 0 0 0 0\n"
-"MouseMoveEvent 138 210 0 0 0 0 0\n"
-"MouseMoveEvent 135 215 0 0 0 0 0\n"
-"MouseMoveEvent 131 221 0 0 0 0 0\n"
-"MouseMoveEvent 130 223 0 0 0 0 0\n"
-"MouseMoveEvent 129 224 0 0 0 0 0\n"
-"MouseMoveEvent 128 224 0 0 0 0 0\n"
-"MouseMoveEvent 127 224 0 0 0 0 0\n"
-"MouseMoveEvent 126 224 0 0 0 0 0\n"
-"LeftButtonPressEvent 126 224 0 0 0 0 0\n"
-"StartInteractionEvent 126 224 0 0 0 0 0\n"
-"MouseMoveEvent 127 223 0 0 0 0 0\n"
-"RenderEvent 127 223 0 0 0 0 0\n"
-"InteractionEvent 127 223 0 0 0 0 0\n"
-"MouseMoveEvent 128 222 0 0 0 0 0\n"
-"RenderEvent 128 222 0 0 0 0 0\n"
-"InteractionEvent 128 222 0 0 0 0 0\n"
-"MouseMoveEvent 129 221 0 0 0 0 0\n"
-"RenderEvent 129 221 0 0 0 0 0\n"
-"InteractionEvent 129 221 0 0 0 0 0\n"
-"MouseMoveEvent 130 220 0 0 0 0 0\n"
-"RenderEvent 130 220 0 0 0 0 0\n"
-"InteractionEvent 130 220 0 0 0 0 0\n"
-"MouseMoveEvent 131 218 0 0 0 0 0\n"
-"RenderEvent 131 218 0 0 0 0 0\n"
-"InteractionEvent 131 218 0 0 0 0 0\n"
-"MouseMoveEvent 133 215 0 0 0 0 0\n"
-"RenderEvent 133 215 0 0 0 0 0\n"
-"InteractionEvent 133 215 0 0 0 0 0\n"
-"MouseMoveEvent 135 212 0 0 0 0 0\n"
-"RenderEvent 135 212 0 0 0 0 0\n"
-"InteractionEvent 135 212 0 0 0 0 0\n"
-"MouseMoveEvent 138 208 0 0 0 0 0\n"
-"RenderEvent 138 208 0 0 0 0 0\n"
-"InteractionEvent 138 208 0 0 0 0 0\n"
-"MouseMoveEvent 139 206 0 0 0 0 0\n"
-"RenderEvent 139 206 0 0 0 0 0\n"
-"InteractionEvent 139 206 0 0 0 0 0\n"
-"MouseMoveEvent 140 204 0 0 0 0 0\n"
-"RenderEvent 140 204 0 0 0 0 0\n"
-"InteractionEvent 140 204 0 0 0 0 0\n"
-"MouseMoveEvent 141 202 0 0 0 0 0\n"
-"RenderEvent 141 202 0 0 0 0 0\n"
-"InteractionEvent 141 202 0 0 0 0 0\n"
-"MouseMoveEvent 141 201 0 0 0 0 0\n"
-"RenderEvent 141 201 0 0 0 0 0\n"
-"InteractionEvent 141 201 0 0 0 0 0\n"
-"MouseMoveEvent 141 200 0 0 0 0 0\n"
-"RenderEvent 141 200 0 0 0 0 0\n"
-"InteractionEvent 141 200 0 0 0 0 0\n"
-"MouseMoveEvent 141 199 0 0 0 0 0\n"
-"RenderEvent 141 199 0 0 0 0 0\n"
-"InteractionEvent 141 199 0 0 0 0 0\n"
-"MouseMoveEvent 141 196 0 0 0 0 0\n"
-"RenderEvent 141 196 0 0 0 0 0\n"
-"InteractionEvent 141 196 0 0 0 0 0\n"
-"MouseMoveEvent 142 194 0 0 0 0 0\n"
-"RenderEvent 142 194 0 0 0 0 0\n"
-"InteractionEvent 142 194 0 0 0 0 0\n"
-"MouseMoveEvent 142 193 0 0 0 0 0\n"
-"RenderEvent 142 193 0 0 0 0 0\n"
-"InteractionEvent 142 193 0 0 0 0 0\n"
-"MouseMoveEvent 142 192 0 0 0 0 0\n"
-"RenderEvent 142 192 0 0 0 0 0\n"
-"InteractionEvent 142 192 0 0 0 0 0\n"
-"MouseMoveEvent 142 191 0 0 0 0 0\n"
-"RenderEvent 142 191 0 0 0 0 0\n"
-"InteractionEvent 142 191 0 0 0 0 0\n"
-"MouseMoveEvent 142 190 0 0 0 0 0\n"
-"RenderEvent 142 190 0 0 0 0 0\n"
-"InteractionEvent 142 190 0 0 0 0 0\n"
-"MouseMoveEvent 142 189 0 0 0 0 0\n"
-"RenderEvent 142 189 0 0 0 0 0\n"
-"InteractionEvent 142 189 0 0 0 0 0\n"
-"MouseMoveEvent 142 188 0 0 0 0 0\n"
-"RenderEvent 142 188 0 0 0 0 0\n"
-"InteractionEvent 142 188 0 0 0 0 0\n"
-"MouseMoveEvent 142 187 0 0 0 0 0\n"
-"RenderEvent 142 187 0 0 0 0 0\n"
-"InteractionEvent 142 187 0 0 0 0 0\n"
-"MouseMoveEvent 143 186 0 0 0 0 0\n"
-"RenderEvent 143 186 0 0 0 0 0\n"
-"InteractionEvent 143 186 0 0 0 0 0\n"
-"MouseMoveEvent 144 185 0 0 0 0 0\n"
-"RenderEvent 144 185 0 0 0 0 0\n"
-"InteractionEvent 144 185 0 0 0 0 0\n"
-"MouseMoveEvent 143 184 0 0 0 0 0\n"
-"RenderEvent 143 184 0 0 0 0 0\n"
-"InteractionEvent 143 184 0 0 0 0 0\n"
-"LeftButtonReleaseEvent 143 184 0 0 0 0 0\n"
-"EndInteractionEvent 143 184 0 0 0 0 0\n"
-"RenderEvent 143 184 0 0 0 0 0\n"
-"MouseMoveEvent 145 182 0 0 0 0 0\n"
-"MouseMoveEvent 147 179 0 0 0 0 0\n"
-"MouseMoveEvent 152 175 0 0 0 0 0\n"
-"MouseMoveEvent 156 171 0 0 0 0 0\n"
-"MouseMoveEvent 160 167 0 0 0 0 0\n"
-"MouseMoveEvent 164 163 0 0 0 0 0\n"
-"MouseMoveEvent 165 159 0 0 0 0 0\n"
-"MouseMoveEvent 167 153 0 0 0 0 0\n"
-"MouseMoveEvent 170 150 0 0 0 0 0\n"
-"MouseMoveEvent 171 146 0 0 0 0 0\n"
-"MouseMoveEvent 173 140 0 0 0 0 0\n"
-"MouseMoveEvent 174 137 0 0 0 0 0\n"
-"MouseMoveEvent 174 133 0 0 0 0 0\n"
-"MouseMoveEvent 175 131 0 0 0 0 0\n"
-"MouseMoveEvent 175 129 0 0 0 0 0\n"
-"LeftButtonPressEvent 175 129 0 0 0 0 0\n"
-"StartInteractionEvent 175 129 0 0 0 0 0\n"
-"MouseMoveEvent 174 131 0 0 0 0 0\n"
-"RenderEvent 174 131 0 0 0 0 0\n"
-"InteractionEvent 174 131 0 0 0 0 0\n"
-"MouseMoveEvent 173 133 0 0 0 0 0\n"
-"RenderEvent 173 133 0 0 0 0 0\n"
-"InteractionEvent 173 133 0 0 0 0 0\n"
-"MouseMoveEvent 173 134 0 0 0 0 0\n"
-"RenderEvent 173 134 0 0 0 0 0\n"
-"InteractionEvent 173 134 0 0 0 0 0\n"
-"MouseMoveEvent 170 140 0 0 0 0 0\n"
-"RenderEvent 170 140 0 0 0 0 0\n"
-"InteractionEvent 170 140 0 0 0 0 0\n"
-"MouseMoveEvent 170 142 0 0 0 0 0\n"
-"RenderEvent 170 142 0 0 0 0 0\n"
-"InteractionEvent 170 142 0 0 0 0 0\n"
-"MouseMoveEvent 169 144 0 0 0 0 0\n"
-"RenderEvent 169 144 0 0 0 0 0\n"
-"InteractionEvent 169 144 0 0 0 0 0\n"
-"MouseMoveEvent 169 145 0 0 0 0 0\n"
-"RenderEvent 169 145 0 0 0 0 0\n"
-"InteractionEvent 169 145 0 0 0 0 0\n"
-"MouseMoveEvent 169 146 0 0 0 0 0\n"
-"RenderEvent 169 146 0 0 0 0 0\n"
-"InteractionEvent 169 146 0 0 0 0 0\n"
-"LeftButtonReleaseEvent 169 146 0 0 0 0 0\n"
-"EndInteractionEvent 169 146 0 0 0 0 0\n"
-"RenderEvent 169 146 0 0 0 0 0\n"
-"MouseMoveEvent 170 145 0 0 0 0 0\n"
-"MouseMoveEvent 171 144 0 0 0 0 0\n"
-"MouseMoveEvent 172 142 0 0 0 0 0\n"
-"MouseMoveEvent 173 141 0 0 0 0 0\n"
-"MouseMoveEvent 174 140 0 0 0 0 0\n"
-"MouseMoveEvent 175 138 0 0 0 0 0\n"
-"MouseMoveEvent 177 135 0 0 0 0 0\n"
-"MouseMoveEvent 180 132 0 0 0 0 0\n"
-"MouseMoveEvent 180 131 0 0 0 0 0\n"
-"MouseMoveEvent 182 129 0 0 0 0 0\n"
-"MouseMoveEvent 184 126 0 0 0 0 0\n"
-"MouseMoveEvent 185 124 0 0 0 0 0\n"
-"MouseMoveEvent 187 122 0 0 0 0 0\n"
-"MouseMoveEvent 189 119 0 0 0 0 0\n"
-"MouseMoveEvent 190 118 0 0 0 0 0\n"
-"MouseMoveEvent 191 117 0 0 0 0 0\n"
-"MouseMoveEvent 192 116 0 0 0 0 0\n"
-"MouseMoveEvent 192 115 0 0 0 0 0\n"
-"MouseMoveEvent 193 114 0 0 0 0 0\n"
-"MouseMoveEvent 193 113 0 0 0 0 0\n"
-"MouseMoveEvent 194 112 0 0 0 0 0\n"
-"MouseMoveEvent 195 111 0 0 0 0 0\n"
-"MouseMoveEvent 196 110 0 0 0 0 0\n"
-"MouseMoveEvent 197 109 0 0 0 0 0\n"
-"MouseMoveEvent 198 109 0 0 0 0 0\n"
-"MouseMoveEvent 200 109 0 0 0 0 0\n"
-"MouseMoveEvent 201 109 0 0 0 0 0\n"
-"MouseMoveEvent 203 109 0 0 0 0 0\n"
-"MouseMoveEvent 204 109 0 0 0 0 0\n"
-"MouseMoveEvent 205 109 0 0 0 0 0\n"
-"MouseMoveEvent 206 109 0 0 0 0 0\n"
-"MouseMoveEvent 207 109 0 0 0 0 0\n"
-"MouseMoveEvent 208 109 0 0 0 0 0\n"
-"MouseMoveEvent 209 110 0 0 0 0 0\n"
-"MouseMoveEvent 210 111 0 0 0 0 0\n"
-"MouseMoveEvent 211 112 0 0 0 0 0\n"
-"MouseMoveEvent 212 113 0 0 0 0 0\n"
-"MouseMoveEvent 212 114 0 0 0 0 0\n"
-"MouseMoveEvent 212 116 0 0 0 0 0\n"
-"MouseMoveEvent 212 118 0 0 0 0 0\n"
-"MouseMoveEvent 213 120 0 0 0 0 0\n"
-"MouseMoveEvent 213 121 0 0 0 0 0\n"
-"MouseMoveEvent 214 123 0 0 0 0 0\n"
-"MouseMoveEvent 215 126 0 0 0 0 0\n"
-"MouseMoveEvent 216 129 0 0 0 0 0\n"
-"MouseMoveEvent 218 132 0 0 0 0 0\n"
-"MouseMoveEvent 219 135 0 0 0 0 0\n"
-"MouseMoveEvent 221 139 0 0 0 0 0\n"
-"MouseMoveEvent 222 142 0 0 0 0 0\n"
-"MouseMoveEvent 224 146 0 0 0 0 0\n"
-"MouseMoveEvent 226 150 0 0 0 0 0\n"
-"MouseMoveEvent 229 156 0 0 0 0 0\n"
-"MouseMoveEvent 232 163 0 0 0 0 0\n"
-"MouseMoveEvent 235 170 0 0 0 0 0\n"
-"MouseMoveEvent 238 177 0 0 0 0 0\n"
-"MouseMoveEvent 242 185 0 0 0 0 0\n"
-"MouseMoveEvent 243 192 0 0 0 0 0\n"
-"MouseMoveEvent 246 200 0 0 0 0 0\n"
-"MouseMoveEvent 248 208 0 0 0 0 0\n"
-"MouseMoveEvent 250 214 0 0 0 0 0\n"
-"MouseMoveEvent 253 220 0 0 0 0 0\n"
-"MouseMoveEvent 255 226 0 0 0 0 0\n"
-"MouseMoveEvent 255 231 0 0 0 0 0\n"
-"MouseMoveEvent 257 234 0 0 0 0 0\n"
-"MouseMoveEvent 258 238 0 0 0 0 0\n"
-"MouseMoveEvent 260 239 0 0 0 0 0\n"
-"MouseMoveEvent 260 241 0 0 0 0 0\n"
-"MouseMoveEvent 260 242 0 0 0 0 0\n"
-"MouseMoveEvent 261 243 0 0 0 0 0\n"
-"MouseMoveEvent 261 245 0 0 0 0 0\n"
-"MouseMoveEvent 262 246 0 0 0 0 0\n"
-"MouseMoveEvent 262 247 0 0 0 0 0\n"
-"MouseMoveEvent 262 249 0 0 0 0 0\n"
-"MouseMoveEvent 263 251 0 0 0 0 0\n"
-"MouseMoveEvent 263 253 0 0 0 0 0\n"
-"MouseMoveEvent 264 255 0 0 0 0 0\n"
-"MouseMoveEvent 265 258 0 0 0 0 0\n"
-"MouseMoveEvent 265 262 0 0 0 0 0\n"
-"MouseMoveEvent 266 266 0 0 0 0 0\n"
-"MouseMoveEvent 266 269 0 0 0 0 0\n"
-"MouseMoveEvent 267 273 0 0 0 0 0\n"
-"MouseMoveEvent 267 276 0 0 0 0 0\n"
-"MouseMoveEvent 268 279 0 0 0 0 0\n"
-"MouseMoveEvent 268 280 0 0 0 0 0\n"
-"MouseMoveEvent 269 282 0 0 0 0 0\n"
-"MouseMoveEvent 269 283 0 0 0 0 0\n"
-"MouseMoveEvent 269 284 0 0 0 0 0\n"
-"MouseMoveEvent 270 285 0 0 0 0 0\n"
-"MouseMoveEvent 270 287 0 0 0 0 0\n"
-"MouseMoveEvent 271 288 0 0 0 0 0\n"
-"MouseMoveEvent 272 290 0 0 0 0 0\n"
-"MouseMoveEvent 273 291 0 0 0 0 0\n"
-"MouseMoveEvent 274 293 0 0 0 0 0\n"
-"MouseMoveEvent 275 297 0 0 0 0 0\n"
-"MouseMoveEvent 276 298 0 0 0 0 0\n"
-"LeaveEvent 276 300 0 0 0 0 0\n"
-;
-
-int TestGPURayCastCameraInsideSmallSpacing(int argc, char *argv[])
-{
-  cout << "CTEST_FULL_OUTPUT (Avoid ctest truncation of output)" << endl;
-
-  char* volumeFile = vtkTestUtilities::ExpandDataFileName(
-                       argc, argv, "Data/ironProt.vtk");
-  vtkNew<vtkStructuredPointsReader> reader;
-  reader->SetFileName(volumeFile);
-  delete[] volumeFile;
-
-  int dims[3];
-  reader->Update();
-  reader->GetOutput()->GetDimensions(dims);
-
-  double desiredBounds = 0.0005;
-  double desiredSpacing[3];
-  for (int i = 0; i < 3; ++i)
-    {
-    desiredSpacing[i] = desiredBounds / static_cast<double> (dims[i]);
-    }
-
-  vtkNew<vtkImageChangeInformation> imageChangeInfo;
-  imageChangeInfo->SetInputConnection(reader->GetOutputPort());
-  imageChangeInfo->SetOutputSpacing(desiredSpacing);
-
-  vtkNew<vtkGPUVolumeRayCastMapper> mapper;
-  mapper->SetInputConnection(imageChangeInfo->GetOutputPort());
-  mapper->SetAutoAdjustSampleDistances(0);
-  mapper->SetSampleDistance(7e-6);
-
-  vtkNew<vtkColorTransferFunction> color;
-  color->AddRGBPoint(0.0, 0.0, 0.0, 0.0);
-  color->AddRGBPoint(64.0, 1.0, 0.0, 0.0);
-  color->AddRGBPoint(128.0, 0.0, 0.0, 1.0);
-  color->AddRGBPoint(192.0, 0.0, 1.0, 0.0);
-  color->AddRGBPoint(255.0, 0.0, 0.2, 0.0);
-
-  vtkNew<vtkPiecewiseFunction> opacity;
-  opacity->AddPoint(0.0, 0.0);
-  opacity->AddPoint(255.0, 1.0);
-
-  vtkNew<vtkVolumeProperty> property;
-  property->SetColor(color.GetPointer());
-  property->SetScalarOpacity(opacity.GetPointer());
-  property->SetInterpolationTypeToLinear();
-  property->ShadeOff();
-  property->SetScalarOpacityUnitDistance(7e-6);
-
-  vtkNew<vtkVolume> volume;
-  volume->SetMapper(mapper.GetPointer());
-  volume->SetProperty(property.GetPointer());
-
-  vtkNew<vtkRenderWindow> renWin;
-  renWin->SetSize(301, 300);
-  renWin->SetMultiSamples(0);
-
-  vtkNew<vtkRenderWindowInteractor> iren;
-  iren->SetRenderWindow(renWin.GetPointer());
-  vtkNew<vtkInteractorStyleTrackballCamera> style;
-  iren->SetInteractorStyle(style.GetPointer());
-
-  vtkNew<vtkRenderer> ren;
-  renWin->AddRenderer(ren.GetPointer());
-
-  ren->AddVolume(volume.GetPointer());
-  ren->ResetCamera();
-
-  renWin->Render();
-  iren->Initialize();
-
-  return vtkTesting::InteractorEventLoop(argc, argv,
-                                         iren.GetPointer(),
-                                         TestGPURayCastCameraInsideSmallSpacingLog);
-}
diff --git a/Rendering/Volume/Testing/Cxx/TestGPURayCastClipping.cxx b/Rendering/Volume/Testing/Cxx/TestGPURayCastClipping.cxx
index 00e76cb..afc1fbb 100644
--- a/Rendering/Volume/Testing/Cxx/TestGPURayCastClipping.cxx
+++ b/Rendering/Volume/Testing/Cxx/TestGPURayCastClipping.cxx
@@ -15,12 +15,12 @@
 // This test covers cropping on volume datasets.
 
 #include <vtkActor.h>
-#include <vtkCamera.h>
 #include <vtkColorTransferFunction.h>
 #include <vtkCommand.h>
 #include <vtkGPUVolumeRayCastMapper.h>
 #include <vtkImageData.h>
 #include <vtkNew.h>
+#include <vtkOutlineFilter.h>
 #include <vtkPiecewiseFunction.h>
 #include <vtkPlane.h>
 #include <vtkPlaneCollection.h>
@@ -40,6 +40,8 @@ int TestGPURayCastClipping(int argc, char *argv[])
 {
   double scalarRange[2];
 
+  vtkNew<vtkActor> outlineActor;
+  vtkNew<vtkPolyDataMapper> outlineMapper;
   vtkNew<vtkGPUVolumeRayCastMapper> volumeMapper;
 
   vtkNew<vtkXMLImageDataReader> reader;
@@ -50,6 +52,12 @@ int TestGPURayCastClipping(int argc, char *argv[])
   reader->Update();
   volumeMapper->SetInputConnection(reader->GetOutputPort());
 
+  // Add outline filter
+  vtkNew<vtkOutlineFilter> outlineFilter;
+  outlineFilter->SetInputConnection(reader->GetOutputPort());
+  outlineMapper->SetInputConnection(outlineFilter->GetOutputPort());
+  outlineActor->SetMapper(outlineMapper.GetPointer());
+
   volumeMapper->GetInput()->GetScalarRange(scalarRange);
   volumeMapper->SetBlendModeToComposite();
 
@@ -76,18 +84,18 @@ int TestGPURayCastClipping(int argc, char *argv[])
   vtkSmartPointer<vtkColorTransferFunction> colorTransferFunction =
     volumeProperty->GetRGBTransferFunction(0);
   colorTransferFunction->RemoveAllPoints();
-  colorTransferFunction->AddRGBPoint(scalarRange[0], 0.1, 0.5, 1.0);
-  colorTransferFunction->AddRGBPoint(scalarRange[1], 1.0, 0.5, 0.1);
+  colorTransferFunction->AddRGBPoint(scalarRange[0], 0.0, 0.0, 0.0);
+  colorTransferFunction->AddRGBPoint(scalarRange[1], 1.0, 1.0, 1.0);
 
   // Test cropping now
   double* bounds = reader->GetOutput()->GetBounds();
   vtkNew<vtkPlane> clipPlane1;
   clipPlane1->SetOrigin(0.45 * (bounds[0] + bounds[1]), 0.0, 0.0);
-  clipPlane1->SetNormal(0.8, 0.0, 0.0);
+  clipPlane1->SetNormal(1.0, 0.0, 0.0);
 
   vtkNew<vtkPlane> clipPlane2;
-  clipPlane2->SetOrigin(0.0, 0.35 * (bounds[2] + bounds[3]), 0.0);
-  clipPlane2->SetNormal(0.2, -0.2, 0.0);
+  clipPlane2->SetOrigin(0.55 * (bounds[0] + bounds[1]), 0.0, 0.0);
+  clipPlane2->SetNormal(-1.0, 0.0, 0.0);
 
   vtkNew<vtkPlaneCollection> clipPlaneCollection;
   clipPlaneCollection->AddItem(clipPlane1.GetPointer());
@@ -100,7 +108,7 @@ int TestGPURayCastClipping(int argc, char *argv[])
   volume->SetProperty(volumeProperty.GetPointer());
 
   ren->AddViewProp(volume.GetPointer());
-  ren->GetActiveCamera()->Azimuth(-40);
+  ren->AddActor(outlineActor.GetPointer());
   ren->ResetCamera();
   renWin->Render();
   iren->Initialize();
diff --git a/Rendering/Volume/Testing/Cxx/TestGPURayCastCropping1.cxx b/Rendering/Volume/Testing/Cxx/TestGPURayCastCropping1.cxx
index bb26e57..bc07478 100644
--- a/Rendering/Volume/Testing/Cxx/TestGPURayCastCropping1.cxx
+++ b/Rendering/Volume/Testing/Cxx/TestGPURayCastCropping1.cxx
@@ -14,18 +14,21 @@
 =========================================================================*/
 // This test covers cropping on volume datasets.
 
-#include <vtkCamera.h>
+#include <vtkActor.h>
 #include <vtkColorTransferFunction.h>
 #include <vtkCommand.h>
 #include <vtkGPUVolumeRayCastMapper.h>
 #include <vtkImageData.h>
 #include <vtkNew.h>
+#include <vtkOutlineFilter.h>
 #include <vtkPiecewiseFunction.h>
+#include <vtkPolyDataMapper.h>
 #include <vtkRegressionTestImage.h>
 #include <vtkRenderWindow.h>
 #include <vtkRenderWindowInteractor.h>
 #include <vtkRenderer.h>
 #include <vtkSmartPointer.h>
+#include <vtkSphereSource.h>
 #include <vtkTestUtilities.h>
 #include <vtkTimerLog.h>
 #include <vtkVolumeProperty.h>
@@ -36,7 +39,8 @@ int TestGPURayCastCropping1(int argc, char *argv[])
   double scalarRange[2];
 
   vtkNew<vtkActor> outlineActor;
-   vtkNew<vtkGPUVolumeRayCastMapper> volumeMapper;
+  vtkNew<vtkPolyDataMapper> outlineMapper;
+  vtkNew<vtkGPUVolumeRayCastMapper> volumeMapper;
   volumeMapper->AutoAdjustSampleDistancesOff();
   volumeMapper->SetSampleDistance(0.05);
 
@@ -45,13 +49,19 @@ int TestGPURayCastCropping1(int argc, char *argv[])
                             argc, argv, "Data/vase_1comp.vti");
   reader->SetFileName(volumeFile);
   volumeMapper->SetInputConnection(reader->GetOutputPort());
+
+  // Add outline filter
+  vtkNew<vtkOutlineFilter> outlineFilter;
+  outlineFilter->SetInputConnection(reader->GetOutputPort());
+  outlineMapper->SetInputConnection(outlineFilter->GetOutputPort());
+  outlineActor->SetMapper(outlineMapper.GetPointer());
+
   volumeMapper->GetInput()->GetScalarRange(scalarRange);
   volumeMapper->SetBlendModeToComposite();
 
   // Testing prefers image comparison with small images
   vtkNew<vtkRenderWindow> renWin;
   renWin->SetSize(400, 400);
-  renWin->SetMultiSamples(0);
 
   // Intentional odd and NPOT  width/height
   vtkNew<vtkRenderer> ren;
@@ -75,8 +85,8 @@ int TestGPURayCastCropping1(int argc, char *argv[])
   vtkSmartPointer<vtkColorTransferFunction> colorTransferFunction =
     volumeProperty->GetRGBTransferFunction(0);
   colorTransferFunction->RemoveAllPoints();
-  colorTransferFunction->AddRGBPoint(0, 0.0, 0.0, 0.0);
-  colorTransferFunction->AddRGBPoint(255, 0.0, 1.0, 0.0);
+  colorTransferFunction->AddRGBPoint(scalarRange[0], 0.0, 0.0, 0.0);
+  colorTransferFunction->AddRGBPoint(scalarRange[1], 1.0, 1.0, 1.0);
 
   // Test cropping now
   volumeMapper->SetCroppingRegionPlanes(10.0, 20.0, 10.0, 20.0, 10.0, 20.0);
@@ -89,8 +99,8 @@ int TestGPURayCastCropping1(int argc, char *argv[])
   volume->SetProperty(volumeProperty.GetPointer());
 
   ren->AddViewProp(volume.GetPointer());
+  ren->AddActor(outlineActor.GetPointer());
   ren->ResetCamera();
-  ren->GetActiveCamera()->Zoom(2);
 
   renWin->Render();
   iren->Initialize();
diff --git a/Rendering/Volume/Testing/Cxx/TestGPURayCastDataTypesMinIP1.cxx b/Rendering/Volume/Testing/Cxx/TestGPURayCastDataTypesMinIP1.cxx
new file mode 100644
index 0000000..3294af0
--- /dev/null
+++ b/Rendering/Volume/Testing/Cxx/TestGPURayCastDataTypesMinIP1.cxx
@@ -0,0 +1,293 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+  Module:    TestGPURayCastDataTypesMinIP1.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.
+
+=========================================================================*/
+
+// This test volume renders the same dataset using 8 different data types
+// (unsigned char, signed char, unsigned short, signed short, unsigned int
+// int, float, and double). It uses compositing and no shading. The extents of
+// the dataset are (0, 114, 0, 100, 0, 74).
+
+#include "vtkCamera.h"
+#include "vtkColorTransferFunction.h"
+#include "vtkDataArray.h"
+#include "vtkGPUVolumeRayCastMapper.h"
+#include "vtkImageData.h"
+#include "vtkImageShiftScale.h"
+#include "vtkPiecewiseFunction.h"
+#include "vtkPointData.h"
+#include "vtkRegressionTestImage.h"
+#include "vtkRenderWindow.h"
+#include "vtkRenderWindowInteractor.h"
+#include "vtkRenderer.h"
+#include "vtkTestUtilities.h"
+#include "vtkTransform.h"
+#include "vtkVolumeProperty.h"
+#include "vtkXMLImageDataReader.h"
+
+int TestGPURayCastDataTypesMinIP1(int argc, char *argv[])
+{
+  cout << "CTEST_FULL_OUTPUT (Avoid ctest truncation of output)" << endl;
+  char *cfname=
+    vtkTestUtilities::ExpandDataFileName(argc, argv, "Data/vase_1comp.vti");
+
+  vtkXMLImageDataReader *reader=vtkXMLImageDataReader::New();
+  reader->SetFileName(cfname);
+  delete [] cfname;
+
+  vtkImageShiftScale *shiftScale[4][2];
+  vtkColorTransferFunction *color[4][2];
+  vtkPiecewiseFunction *opacity[4][2];
+
+// unsigned char
+  shiftScale[0][0]=vtkImageShiftScale::New();
+  shiftScale[0][0]->SetShift(-255);
+  shiftScale[0][0]->SetScale(-1);
+  shiftScale[0][0]->SetInputConnection(reader->GetOutputPort());
+  shiftScale[0][0]->Update();
+  double range[2];
+  shiftScale[0][0]->GetOutput()->GetPointData()->GetScalars()->GetRange(range);
+  cout<<"range="<<range[0]<<","<<range[1]<<endl;
+
+  color[0][0]=vtkColorTransferFunction::New();
+  color[0][0]->AddRGBPoint(0,0,0,1);
+  color[0][0]->AddRGBPoint(255,0,1,0);
+
+  opacity[0][0]=vtkPiecewiseFunction::New();
+  opacity[0][0]->AddPoint(0,1);
+  opacity[0][0]->AddPoint(255,0);
+
+// signed char
+  shiftScale[0][1]=vtkImageShiftScale::New();
+  shiftScale[0][1]->SetInputConnection(shiftScale[0][0]->GetOutputPort());
+  shiftScale[0][1]->SetShift(-128);
+  shiftScale[0][1]->SetOutputScalarType(15);
+
+  color[0][1]=vtkColorTransferFunction::New();
+  color[0][1]->AddRGBPoint(-128,0,0,1);
+  color[0][1]->AddRGBPoint(127,0,1,0);
+
+  opacity[0][1]=vtkPiecewiseFunction::New();
+  opacity[0][1]->AddPoint(-128,1);
+  opacity[0][1]->AddPoint(127,0);
+
+// unsigned short
+  shiftScale[1][0]=vtkImageShiftScale::New();
+  shiftScale[1][0]->SetInputConnection(shiftScale[0][0]->GetOutputPort());
+  shiftScale[1][0]->SetScale(256);
+  shiftScale[1][0]->SetOutputScalarTypeToUnsignedShort();
+
+  color[1][0]=vtkColorTransferFunction::New();
+  color[1][0]->AddRGBPoint(0,0,0,1);
+  color[1][0]->AddRGBPoint(65535,0,1,0);
+
+  opacity[1][0]=vtkPiecewiseFunction::New();
+  opacity[1][0]->AddPoint(0,1);
+  opacity[1][0]->AddPoint(65535,0);
+
+//  short
+  shiftScale[1][1]=vtkImageShiftScale::New();
+  shiftScale[1][1]->SetInputConnection(shiftScale[1][0]->GetOutputPort());
+  shiftScale[1][1]->SetShift(-32768);
+  shiftScale[1][1]->SetOutputScalarTypeToShort();
+
+  color[1][1]=vtkColorTransferFunction::New();
+  color[1][1]->AddRGBPoint(-32768,0,0,1);
+  color[1][1]->AddRGBPoint(32767,0,1,0);
+
+  opacity[1][1]=vtkPiecewiseFunction::New();
+  opacity[1][1]->AddPoint(-32768,1);
+  opacity[1][1]->AddPoint(32767,0);
+
+// unsigned int
+  shiftScale[2][0]=vtkImageShiftScale::New();
+  shiftScale[2][0]->SetInputConnection (shiftScale[0][0]->GetOutputPort());
+  shiftScale[2][0]->SetScale(16777216);
+  shiftScale[2][0]->SetOutputScalarTypeToUnsignedInt();
+
+  color[2][0]=vtkColorTransferFunction::New();
+  color[2][0]->AddRGBPoint(0,0,0,1);
+  color[2][0]->AddRGBPoint(VTK_UNSIGNED_INT_MAX,0,1,0);
+
+  opacity[2][0]=vtkPiecewiseFunction::New();
+  opacity[2][0]->AddPoint(0,1);
+  opacity[2][0]->AddPoint(VTK_UNSIGNED_INT_MAX,0);
+
+// int
+  shiftScale[2][1]=vtkImageShiftScale::New();
+  shiftScale[2][1]->SetInputConnection(shiftScale[2][0]->GetOutputPort());
+  shiftScale[2][1]->SetShift(VTK_INT_MIN);
+  shiftScale[2][1]->SetOutputScalarTypeToInt();
+
+  color[2][1]=vtkColorTransferFunction::New();
+  color[2][1]->AddRGBPoint(VTK_INT_MIN,0,0,1);
+  color[2][1]->AddRGBPoint(VTK_INT_MAX,0,1,0);
+
+  opacity[2][1]=vtkPiecewiseFunction::New();
+
+  opacity[2][1]->AddPoint(VTK_INT_MIN,1);
+  opacity[2][1]->AddPoint(VTK_INT_MAX,0);
+
+// float [-1 1]
+  vtkImageShiftScale *shiftScale_3_0_pre=vtkImageShiftScale::New();
+  shiftScale_3_0_pre->SetInputConnection(shiftScale[0][0]->GetOutputPort());
+  shiftScale_3_0_pre->SetScale(0.0078125);
+  shiftScale_3_0_pre->SetOutputScalarTypeToFloat();
+
+  shiftScale[3][0]=vtkImageShiftScale::New();
+  shiftScale[3][0]->SetInputConnection(shiftScale_3_0_pre->GetOutputPort());
+  shiftScale[3][0]->SetShift(-1.0);
+  shiftScale[3][0]->SetOutputScalarTypeToFloat();
+
+  color[3][0]=vtkColorTransferFunction::New();
+  color[3][0]->AddRGBPoint(-1.0,0,0,1);
+  color[3][0]->AddRGBPoint(1.0,0,1,0);
+
+  opacity[3][0]=vtkPiecewiseFunction::New();
+  opacity[3][0]->AddPoint(-1.0,1);
+  opacity[3][0]->AddPoint(1.0,0);
+
+// double [-1000 3000]
+  vtkImageShiftScale *shiftScale_3_1_pre=vtkImageShiftScale::New();
+  shiftScale_3_1_pre->SetInputConnection(shiftScale[0][0]->GetOutputPort());
+  shiftScale_3_1_pre->SetScale(15.625);
+  shiftScale_3_1_pre->SetOutputScalarTypeToDouble();
+
+  shiftScale[3][1]=vtkImageShiftScale::New();
+  shiftScale[3][1]->SetInputConnection(shiftScale_3_1_pre->GetOutputPort());
+  shiftScale[3][1]->SetShift(-1000);
+  shiftScale[3][1]->SetOutputScalarTypeToDouble();
+
+  color[3][1]=vtkColorTransferFunction::New();
+  color[3][1]->AddRGBPoint(-1000,0,0,1);
+  color[3][1]->AddRGBPoint(3000,0,1,0);
+
+  opacity[3][1]=vtkPiecewiseFunction::New();
+  opacity[3][1]->AddPoint(-1000,1);
+  opacity[3][1]->AddPoint(3000,0);
+
+  vtkRenderer *ren1=vtkRenderer::New();
+  vtkRenderWindow *renWin=vtkRenderWindow::New();
+  renWin->AddRenderer(ren1);
+  renWin->SetSize(600,300);
+  vtkRenderWindowInteractor *iren=vtkRenderWindowInteractor::New();
+  iren->SetRenderWindow(renWin);
+
+  renWin->Render();
+
+  const int rows = 4;
+  const int cols = 2;
+#if 1
+  vtkGPUVolumeRayCastMapper *volumeMapper[rows][cols];
+#else
+  vtkGPUVolumeRayCastMapper *volumeMapper[rows][cols];
+#endif
+  vtkVolumeProperty *volumeProperty[rows][cols];
+  vtkVolume *volume[rows][cols];
+  vtkTransform *userMatrix[rows][cols];
+
+  int i=0;
+  while(i < rows)
+    {
+    int j = 0;
+    while(j < cols)
+      {
+#if 1
+      volumeMapper[i][j] = vtkGPUVolumeRayCastMapper::New();
+#else
+      volumeMapper[i][j] = vtkGPUVolumeRayCastMapper::New();
+#endif
+      volumeMapper[i][j]->SetBlendModeToMinimumIntensity();
+      volumeMapper[i][j]->SetInputConnection(
+        shiftScale[i][j]->GetOutputPort());
+
+      volumeProperty[i][j]=vtkVolumeProperty::New();
+      volumeProperty[i][j]->SetColor(color[i][j]);
+      volumeProperty[i][j]->SetScalarOpacity(opacity[i][j]);
+
+      volume[i][j]=vtkVolume::New();
+      volume[i][j]->SetMapper(volumeMapper[i][j]);
+      volume[i][j]->SetProperty(volumeProperty[i][j]);
+
+      userMatrix[i][j]=vtkTransform::New();
+      userMatrix[i][j]->PostMultiply();
+      userMatrix[i][j]->Identity();
+      userMatrix[i][j]->Translate(i*120,j*120,0);
+
+      volume[i][j]->SetUserTransform(userMatrix[i][j]);
+      ren1->AddViewProp(volume[i][j]);
+      ++j;
+      }
+    ++i;
+    }
+
+  ren1->AddViewProp(volume[0][0]);
+
+  /// TODO: FIX THIS
+  //int valid=volumeMapper[0][0]->IsRenderSupported(renWin,volumeProperty[0][0]);
+
+  int retVal;
+//  if(valid)
+  if (1)
+    {
+    iren->Initialize();
+    ren1->SetBackground(0.1,0.4,0.2);
+    ren1->ResetCamera();
+    ren1->GetActiveCamera()->Zoom(2.0);
+    renWin->Render();
+
+    retVal = vtkTesting::Test(argc, argv, renWin, 75);
+    if (retVal == vtkRegressionTester::DO_INTERACTOR)
+      {
+      iren->Start();
+      }
+    }
+  else
+    {
+    retVal=vtkTesting::PASSED;
+    cout << "Required extensions not supported." << endl;
+    }
+
+  iren->Delete();
+  renWin->Delete();
+  ren1->Delete();
+  shiftScale_3_1_pre->Delete();
+  shiftScale_3_0_pre->Delete();
+  i=0;
+  while( i < rows)
+    {
+    int j=0;
+    while(j < cols)
+      {
+      volumeMapper[i][j]->Delete();
+      volumeProperty[i][j]->Delete();
+      volume[i][j]->Delete();
+      userMatrix[i][j]->Delete();
+      shiftScale[i][j]->Delete();
+      color[i][j]->Delete();
+      opacity[i][j]->Delete();
+      ++j;
+      }
+    ++i;
+    }
+  reader->Delete();
+
+  if ((retVal == vtkTesting::PASSED) || (retVal == vtkTesting::DO_INTERACTOR))
+    {
+    return 0;
+    }
+  else
+    {
+    return 1;
+    }
+}
diff --git a/Rendering/Volume/Testing/Cxx/TestGPURayCastMapperBenchmark.cxx b/Rendering/Volume/Testing/Cxx/TestGPURayCastMapperBenchmark.cxx
index 9437349..f2bce79 100644
--- a/Rendering/Volume/Testing/Cxx/TestGPURayCastMapperBenchmark.cxx
+++ b/Rendering/Volume/Testing/Cxx/TestGPURayCastMapperBenchmark.cxx
@@ -19,14 +19,17 @@
 #include "vtkImageData.h"
 #include "vtkNew.h"
 #include "vtkPiecewiseFunction.h"
-#include "vtkRegressionTestImage.h"
-#include "vtkRenderer.h"
+#include "vtkRTAnalyticSource.h"
 #include "vtkRenderWindow.h"
 #include "vtkRenderWindowInteractor.h"
-#include "vtkRTAnalyticSource.h"
+#include "vtkRenderer.h"
 #include "vtkTimerLog.h"
 #include "vtkVolume.h"
 #include "vtkVolumeProperty.h"
+#include "vtkXMLImageDataReader.h"
+
+#include "vtkRegressionTestImage.h"
+#include "vtkTestUtilities.h"
 
 //----------------------------------------------------------------------------
 int TestGPURayCastMapperBenchmark(int argc, char* argv[])
diff --git a/Rendering/Volume/Testing/Cxx/TestGPURayCastReleaseResources.cxx b/Rendering/Volume/Testing/Cxx/TestGPURayCastReleaseResources.cxx
deleted file mode 100644
index 81ea56a..0000000
--- a/Rendering/Volume/Testing/Cxx/TestGPURayCastReleaseResources.cxx
+++ /dev/null
@@ -1,111 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    TestGPURayCastReleaseResources.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.
-
-=========================================================================*/
-// This is a test to make sure graphics resources are properly released and
-// re-allocated when the context changes
-
-#include <vtkActor.h>
-#include <vtkCamera.h>
-#include <vtkColorTransferFunction.h>
-#include <vtkCommand.h>
-#include <vtkGPUVolumeRayCastMapper.h>
-#include <vtkImageData.h>
-#include <vtkNew.h>
-#include <vtkPiecewiseFunction.h>
-#include <vtkPlane.h>
-#include <vtkPlaneCollection.h>
-#include <vtkPolyDataMapper.h>
-#include <vtkRegressionTestImage.h>
-#include <vtkRenderWindow.h>
-#include <vtkRenderWindowInteractor.h>
-#include <vtkRenderer.h>
-#include <vtkSmartPointer.h>
-#include <vtkSphereSource.h>
-#include <vtkTestUtilities.h>
-#include <vtkTimerLog.h>
-#include <vtkVolumeProperty.h>
-#include <vtkXMLImageDataReader.h>
-
-int TestGPURayCastReleaseResources(int argc, char *argv[])
-{
-  double scalarRange[2];
-
-  vtkNew<vtkGPUVolumeRayCastMapper> volumeMapper;
-
-  vtkNew<vtkXMLImageDataReader> reader;
-  const char* volumeFile = vtkTestUtilities::ExpandDataFileName(
-                            argc, argv, "Data/vase_1comp.vti");
-
-  reader->SetFileName(volumeFile);
-  reader->Update();
-  volumeMapper->SetInputConnection(reader->GetOutputPort());
-
-  volumeMapper->GetInput()->GetScalarRange(scalarRange);
-  volumeMapper->SetBlendModeToComposite();
-
-  // Testing prefers image comparison with small images
-  vtkRenderWindow* renWin =
-    vtkRenderWindow::New();
-  // Intentional odd and NPOT  width/height
-  renWin->SetSize(500, 401);
-
-  vtkNew<vtkRenderer> ren;
-  renWin->AddRenderer(ren.GetPointer());
-
-  vtkNew<vtkPiecewiseFunction> scalarOpacity;
-  scalarOpacity->AddPoint(scalarRange[0], 0.0);
-  scalarOpacity->AddPoint(scalarRange[1], 1.0);
-
-  vtkNew<vtkVolumeProperty> volumeProperty;
-  volumeProperty->ShadeOff();
-  volumeProperty->SetInterpolationType(VTK_LINEAR_INTERPOLATION);
-  volumeProperty->SetScalarOpacity(scalarOpacity.GetPointer());
-
-  vtkSmartPointer<vtkColorTransferFunction> colorTransferFunction =
-    volumeProperty->GetRGBTransferFunction(0);
-  colorTransferFunction->RemoveAllPoints();
-  colorTransferFunction->AddRGBPoint(scalarRange[0], 0.1, 0.5, 1.0);
-  colorTransferFunction->AddRGBPoint(scalarRange[1], 1.0, 0.5, 0.1);
-
-  // Setup volume actor
-  vtkNew<vtkVolume> volume;
-  volume->SetMapper(volumeMapper.GetPointer());
-  volume->SetProperty(volumeProperty.GetPointer());
-
-  ren->AddViewProp(volume.GetPointer());
-  ren->GetActiveCamera()->Azimuth(-40);
-  ren->ResetCamera();
-  renWin->Render();
-
-  // Delete the old render window to release graphics resources
-  renWin->Delete();
-
-  vtkNew<vtkRenderWindow> renWin2;
-  renWin2->SetSize(300, 401);
-  renWin2->AddRenderer(ren.GetPointer());
-  renWin2->Render();
-
-  vtkNew<vtkRenderWindowInteractor> iren;
-  iren->SetRenderWindow(renWin2.GetPointer());
-
-  iren->Initialize();
-
-  int retVal = vtkRegressionTestImage( renWin2.GetPointer() );
-  if( retVal == vtkRegressionTester::DO_INTERACTOR)
-    {
-    iren->Start();
-    }
-
-  return !retVal;
-}
diff --git a/Rendering/Volume/Testing/Cxx/TestGPURayCastThreeComponentsIndependent.cxx b/Rendering/Volume/Testing/Cxx/TestGPURayCastThreeComponentsIndependent.cxx
deleted file mode 100644
index b6f7d4f..0000000
--- a/Rendering/Volume/Testing/Cxx/TestGPURayCastThreeComponentsIndependent.cxx
+++ /dev/null
@@ -1,853 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    TestGPURayCastThreeComponentsIndependent.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.
-
-=========================================================================*/
-
-// Description
-// This test creates a vtkImageData with three components.
-// The data is volume rendered considering the three components as independent.
-
-#include "vtkCamera.h"
-#include "vtkColorTransferFunction.h"
-#include "vtkGPUVolumeRayCastMapper.h"
-#include "vtkImageData.h"
-#include "vtkInteractorStyleTrackballCamera.h"
-#include "vtkNew.h"
-#include "vtkPiecewiseFunction.h"
-#include "vtkRenderer.h"
-#include "vtkRenderWindow.h"
-#include "vtkRenderWindowInteractor.h"
-#include "vtkSphere.h"
-#include "vtkTesting.h"
-#include "vtkTestUtilities.h"
-#include "vtkVolume.h"
-#include "vtkVolumeProperty.h"
-
-static const char * TestGPURayCastThreeComponentsIndependentLog =
-"# StreamVersion 1\n"
-"EnterEvent 282 37 0 0 0 0 0\n"
-"MouseMoveEvent 282 37 0 0 0 0 0\n"
-"MouseMoveEvent 263 37 0 0 0 0 0\n"
-"MouseMoveEvent 244 42 0 0 0 0 0\n"
-"MouseMoveEvent 231 44 0 0 0 0 0\n"
-"MouseMoveEvent 222 47 0 0 0 0 0\n"
-"MouseMoveEvent 213 49 0 0 0 0 0\n"
-"MouseMoveEvent 212 50 0 0 0 0 0\n"
-"MouseMoveEvent 211 50 0 0 0 0 0\n"
-"MouseMoveEvent 210 51 0 0 0 0 0\n"
-"MouseMoveEvent 209 51 0 0 0 0 0\n"
-"MouseMoveEvent 207 52 0 0 0 0 0\n"
-"MouseMoveEvent 205 54 0 0 0 0 0\n"
-"MouseMoveEvent 203 56 0 0 0 0 0\n"
-"MouseMoveEvent 200 59 0 0 0 0 0\n"
-"MouseMoveEvent 198 61 0 0 0 0 0\n"
-"MouseMoveEvent 197 62 0 0 0 0 0\n"
-"MouseMoveEvent 196 63 0 0 0 0 0\n"
-"MouseMoveEvent 195 64 0 0 0 0 0\n"
-"MouseMoveEvent 192 67 0 0 0 0 0\n"
-"MouseMoveEvent 189 70 0 0 0 0 0\n"
-"MouseMoveEvent 186 72 0 0 0 0 0\n"
-"MouseMoveEvent 185 73 0 0 0 0 0\n"
-"MouseMoveEvent 183 74 0 0 0 0 0\n"
-"MouseMoveEvent 183 76 0 0 0 0 0\n"
-"MouseMoveEvent 183 79 0 0 0 0 0\n"
-"MouseMoveEvent 183 81 0 0 0 0 0\n"
-"MouseMoveEvent 183 82 0 0 0 0 0\n"
-"MouseMoveEvent 183 83 0 0 0 0 0\n"
-"MouseMoveEvent 183 84 0 0 0 0 0\n"
-"MouseMoveEvent 183 85 0 0 0 0 0\n"
-"MouseMoveEvent 183 86 0 0 0 0 0\n"
-"MouseMoveEvent 183 88 0 0 0 0 0\n"
-"MouseMoveEvent 183 91 0 0 0 0 0\n"
-"MouseMoveEvent 184 93 0 0 0 0 0\n"
-"MouseMoveEvent 184 94 0 0 0 0 0\n"
-"MouseMoveEvent 184 95 0 0 0 0 0\n"
-"MouseMoveEvent 185 96 0 0 0 0 0\n"
-"MouseMoveEvent 185 97 0 0 0 0 0\n"
-"MouseMoveEvent 186 99 0 0 0 0 0\n"
-"MouseMoveEvent 187 100 0 0 0 0 0\n"
-"MouseMoveEvent 188 101 0 0 0 0 0\n"
-"MouseMoveEvent 188 102 0 0 0 0 0\n"
-"MouseMoveEvent 189 104 0 0 0 0 0\n"
-"MouseMoveEvent 191 107 0 0 0 0 0\n"
-"MouseMoveEvent 192 109 0 0 0 0 0\n"
-"MouseMoveEvent 193 111 0 0 0 0 0\n"
-"MouseMoveEvent 193 112 0 0 0 0 0\n"
-"MouseMoveEvent 194 114 0 0 0 0 0\n"
-"MouseMoveEvent 195 115 0 0 0 0 0\n"
-"MouseMoveEvent 195 116 0 0 0 0 0\n"
-"MouseMoveEvent 195 117 0 0 0 0 0\n"
-"MouseWheelForwardEvent 195 117 0 0 0 0 0\n"
-"StartInteractionEvent 195 117 0 0 0 0 0\n"
-"RenderEvent 195 117 0 0 0 0 0\n"
-"EndInteractionEvent 195 117 0 0 0 0 0\n"
-"RenderEvent 195 117 0 0 0 0 0\n"
-"MouseWheelForwardEvent 195 117 0 0 0 0 0\n"
-"StartInteractionEvent 195 117 0 0 0 0 0\n"
-"RenderEvent 195 117 0 0 0 0 0\n"
-"EndInteractionEvent 195 117 0 0 0 0 0\n"
-"RenderEvent 195 117 0 0 0 0 0\n"
-"MouseMoveEvent 195 118 0 0 0 0 0\n"
-"MouseMoveEvent 195 119 0 0 0 0 0\n"
-"MouseMoveEvent 194 121 0 0 0 0 0\n"
-"MouseMoveEvent 193 122 0 0 0 0 0\n"
-"MouseMoveEvent 192 123 0 0 0 0 0\n"
-"MouseMoveEvent 190 125 0 0 0 0 0\n"
-"MouseMoveEvent 187 127 0 0 0 0 0\n"
-"MouseMoveEvent 184 130 0 0 0 0 0\n"
-"MouseMoveEvent 177 137 0 0 0 0 0\n"
-"MouseMoveEvent 169 145 0 0 0 0 0\n"
-"MouseMoveEvent 161 153 0 0 0 0 0\n"
-"MouseMoveEvent 155 157 0 0 0 0 0\n"
-"MouseMoveEvent 150 162 0 0 0 0 0\n"
-"MouseMoveEvent 144 167 0 0 0 0 0\n"
-"MouseMoveEvent 139 171 0 0 0 0 0\n"
-"MouseMoveEvent 137 175 0 0 0 0 0\n"
-"MouseMoveEvent 134 179 0 0 0 0 0\n"
-"MouseMoveEvent 133 182 0 0 0 0 0\n"
-"MouseMoveEvent 133 184 0 0 0 0 0\n"
-"MouseMoveEvent 132 185 0 0 0 0 0\n"
-"MouseMoveEvent 131 187 0 0 0 0 0\n"
-"MouseMoveEvent 130 189 0 0 0 0 0\n"
-"MouseMoveEvent 129 190 0 0 0 0 0\n"
-"LeftButtonPressEvent 129 190 0 0 0 0 0\n"
-"StartInteractionEvent 129 190 0 0 0 0 0\n"
-"MouseMoveEvent 130 190 0 0 0 0 0\n"
-"RenderEvent 130 190 0 0 0 0 0\n"
-"InteractionEvent 130 190 0 0 0 0 0\n"
-"MouseMoveEvent 135 185 0 0 0 0 0\n"
-"RenderEvent 135 185 0 0 0 0 0\n"
-"InteractionEvent 135 185 0 0 0 0 0\n"
-"MouseMoveEvent 138 179 0 0 0 0 0\n"
-"RenderEvent 138 179 0 0 0 0 0\n"
-"InteractionEvent 138 179 0 0 0 0 0\n"
-"MouseMoveEvent 147 169 0 0 0 0 0\n"
-"RenderEvent 147 169 0 0 0 0 0\n"
-"InteractionEvent 147 169 0 0 0 0 0\n"
-"MouseMoveEvent 154 161 0 0 0 0 0\n"
-"RenderEvent 154 161 0 0 0 0 0\n"
-"InteractionEvent 154 161 0 0 0 0 0\n"
-"MouseMoveEvent 158 154 0 0 0 0 0\n"
-"RenderEvent 158 154 0 0 0 0 0\n"
-"InteractionEvent 158 154 0 0 0 0 0\n"
-"MouseMoveEvent 163 147 0 0 0 0 0\n"
-"RenderEvent 163 147 0 0 0 0 0\n"
-"InteractionEvent 163 147 0 0 0 0 0\n"
-"MouseMoveEvent 168 136 0 0 0 0 0\n"
-"RenderEvent 168 136 0 0 0 0 0\n"
-"InteractionEvent 168 136 0 0 0 0 0\n"
-"MouseMoveEvent 177 121 0 0 0 0 0\n"
-"RenderEvent 177 121 0 0 0 0 0\n"
-"InteractionEvent 177 121 0 0 0 0 0\n"
-"MouseMoveEvent 184 109 0 0 0 0 0\n"
-"RenderEvent 184 109 0 0 0 0 0\n"
-"InteractionEvent 184 109 0 0 0 0 0\n"
-"MouseMoveEvent 189 97 0 0 0 0 0\n"
-"RenderEvent 189 97 0 0 0 0 0\n"
-"InteractionEvent 189 97 0 0 0 0 0\n"
-"MouseMoveEvent 197 84 0 0 0 0 0\n"
-"RenderEvent 197 84 0 0 0 0 0\n"
-"InteractionEvent 197 84 0 0 0 0 0\n"
-"MouseMoveEvent 201 74 0 0 0 0 0\n"
-"RenderEvent 201 74 0 0 0 0 0\n"
-"InteractionEvent 201 74 0 0 0 0 0\n"
-"MouseMoveEvent 206 66 0 0 0 0 0\n"
-"RenderEvent 206 66 0 0 0 0 0\n"
-"InteractionEvent 206 66 0 0 0 0 0\n"
-"MouseMoveEvent 211 54 0 0 0 0 0\n"
-"RenderEvent 211 54 0 0 0 0 0\n"
-"InteractionEvent 211 54 0 0 0 0 0\n"
-"MouseMoveEvent 219 41 0 0 0 0 0\n"
-"RenderEvent 219 41 0 0 0 0 0\n"
-"InteractionEvent 219 41 0 0 0 0 0\n"
-"MouseMoveEvent 223 34 0 0 0 0 0\n"
-"RenderEvent 223 34 0 0 0 0 0\n"
-"InteractionEvent 223 34 0 0 0 0 0\n"
-"MouseMoveEvent 230 24 0 0 0 0 0\n"
-"RenderEvent 230 24 0 0 0 0 0\n"
-"InteractionEvent 230 24 0 0 0 0 0\n"
-"MouseMoveEvent 234 17 0 0 0 0 0\n"
-"RenderEvent 234 17 0 0 0 0 0\n"
-"InteractionEvent 234 17 0 0 0 0 0\n"
-"MouseMoveEvent 236 15 0 0 0 0 0\n"
-"RenderEvent 236 15 0 0 0 0 0\n"
-"InteractionEvent 236 15 0 0 0 0 0\n"
-"MouseMoveEvent 239 10 0 0 0 0 0\n"
-"RenderEvent 239 10 0 0 0 0 0\n"
-"InteractionEvent 239 10 0 0 0 0 0\n"
-"LeftButtonReleaseEvent 239 10 0 0 0 0 0\n"
-"EndInteractionEvent 239 10 0 0 0 0 0\n"
-"RenderEvent 239 10 0 0 0 0 0\n"
-"MouseMoveEvent 239 11 0 0 0 0 0\n"
-"MouseMoveEvent 239 12 0 0 0 0 0\n"
-"MouseMoveEvent 239 14 0 0 0 0 0\n"
-"MouseMoveEvent 239 15 0 0 0 0 0\n"
-"MouseMoveEvent 237 19 0 0 0 0 0\n"
-"MouseMoveEvent 234 24 0 0 0 0 0\n"
-"MouseMoveEvent 228 35 0 0 0 0 0\n"
-"MouseMoveEvent 220 48 0 0 0 0 0\n"
-"MouseMoveEvent 209 62 0 0 0 0 0\n"
-"MouseMoveEvent 198 77 0 0 0 0 0\n"
-"MouseMoveEvent 187 92 0 0 0 0 0\n"
-"MouseMoveEvent 176 107 0 0 0 0 0\n"
-"MouseMoveEvent 165 120 0 0 0 0 0\n"
-"MouseMoveEvent 156 133 0 0 0 0 0\n"
-"MouseMoveEvent 147 146 0 0 0 0 0\n"
-"MouseMoveEvent 140 155 0 0 0 0 0\n"
-"MouseMoveEvent 133 164 0 0 0 0 0\n"
-"MouseMoveEvent 126 173 0 0 0 0 0\n"
-"MouseMoveEvent 119 182 0 0 0 0 0\n"
-"MouseMoveEvent 112 191 0 0 0 0 0\n"
-"MouseMoveEvent 107 198 0 0 0 0 0\n"
-"MouseMoveEvent 102 205 0 0 0 0 0\n"
-"MouseMoveEvent 98 212 0 0 0 0 0\n"
-"MouseMoveEvent 98 213 0 0 0 0 0\n"
-"MouseMoveEvent 96 214 0 0 0 0 0\n"
-"MouseMoveEvent 96 215 0 0 0 0 0\n"
-"MouseMoveEvent 96 217 0 0 0 0 0\n"
-"MouseMoveEvent 96 218 0 0 0 0 0\n"
-"MouseMoveEvent 96 219 0 0 0 0 0\n"
-"MouseMoveEvent 96 220 0 0 0 0 0\n"
-"MouseMoveEvent 97 221 0 0 0 0 0\n"
-"MouseMoveEvent 98 221 0 0 0 0 0\n"
-"MouseMoveEvent 99 221 0 0 0 0 0\n"
-"MouseMoveEvent 101 221 0 0 0 0 0\n"
-"MouseMoveEvent 103 220 0 0 0 0 0\n"
-"MouseMoveEvent 104 219 0 0 0 0 0\n"
-"LeftButtonPressEvent 104 219 0 0 0 0 0\n"
-"StartInteractionEvent 104 219 0 0 0 0 0\n"
-"MouseMoveEvent 105 218 0 0 0 0 0\n"
-"RenderEvent 105 218 0 0 0 0 0\n"
-"InteractionEvent 105 218 0 0 0 0 0\n"
-"MouseMoveEvent 113 208 0 0 0 0 0\n"
-"RenderEvent 113 208 0 0 0 0 0\n"
-"InteractionEvent 113 208 0 0 0 0 0\n"
-"MouseMoveEvent 124 187 0 0 0 0 0\n"
-"RenderEvent 124 187 0 0 0 0 0\n"
-"InteractionEvent 124 187 0 0 0 0 0\n"
-"MouseMoveEvent 132 171 0 0 0 0 0\n"
-"RenderEvent 132 171 0 0 0 0 0\n"
-"InteractionEvent 132 171 0 0 0 0 0\n"
-"MouseMoveEvent 136 164 0 0 0 0 0\n"
-"RenderEvent 136 164 0 0 0 0 0\n"
-"InteractionEvent 136 164 0 0 0 0 0\n"
-"MouseMoveEvent 140 158 0 0 0 0 0\n"
-"RenderEvent 140 158 0 0 0 0 0\n"
-"InteractionEvent 140 158 0 0 0 0 0\n"
-"MouseMoveEvent 146 149 0 0 0 0 0\n"
-"RenderEvent 146 149 0 0 0 0 0\n"
-"InteractionEvent 146 149 0 0 0 0 0\n"
-"MouseMoveEvent 150 139 0 0 0 0 0\n"
-"RenderEvent 150 139 0 0 0 0 0\n"
-"InteractionEvent 150 139 0 0 0 0 0\n"
-"MouseMoveEvent 153 134 0 0 0 0 0\n"
-"RenderEvent 153 134 0 0 0 0 0\n"
-"InteractionEvent 153 134 0 0 0 0 0\n"
-"MouseMoveEvent 157 127 0 0 0 0 0\n"
-"RenderEvent 157 127 0 0 0 0 0\n"
-"InteractionEvent 157 127 0 0 0 0 0\n"
-"MouseMoveEvent 161 121 0 0 0 0 0\n"
-"RenderEvent 161 121 0 0 0 0 0\n"
-"InteractionEvent 161 121 0 0 0 0 0\n"
-"MouseMoveEvent 164 116 0 0 0 0 0\n"
-"RenderEvent 164 116 0 0 0 0 0\n"
-"InteractionEvent 164 116 0 0 0 0 0\n"
-"MouseMoveEvent 167 111 0 0 0 0 0\n"
-"RenderEvent 167 111 0 0 0 0 0\n"
-"InteractionEvent 167 111 0 0 0 0 0\n"
-"MouseMoveEvent 172 107 0 0 0 0 0\n"
-"RenderEvent 172 107 0 0 0 0 0\n"
-"InteractionEvent 172 107 0 0 0 0 0\n"
-"MouseMoveEvent 177 105 0 0 0 0 0\n"
-"RenderEvent 177 105 0 0 0 0 0\n"
-"InteractionEvent 177 105 0 0 0 0 0\n"
-"MouseMoveEvent 185 101 0 0 0 0 0\n"
-"RenderEvent 185 101 0 0 0 0 0\n"
-"InteractionEvent 185 101 0 0 0 0 0\n"
-"MouseMoveEvent 192 99 0 0 0 0 0\n"
-"RenderEvent 192 99 0 0 0 0 0\n"
-"InteractionEvent 192 99 0 0 0 0 0\n"
-"MouseMoveEvent 195 99 0 0 0 0 0\n"
-"RenderEvent 195 99 0 0 0 0 0\n"
-"InteractionEvent 195 99 0 0 0 0 0\n"
-"MouseMoveEvent 196 99 0 0 0 0 0\n"
-"RenderEvent 196 99 0 0 0 0 0\n"
-"InteractionEvent 196 99 0 0 0 0 0\n"
-"MouseMoveEvent 201 107 0 0 0 0 0\n"
-"RenderEvent 201 107 0 0 0 0 0\n"
-"InteractionEvent 201 107 0 0 0 0 0\n"
-"MouseMoveEvent 207 115 0 0 0 0 0\n"
-"RenderEvent 207 115 0 0 0 0 0\n"
-"InteractionEvent 207 115 0 0 0 0 0\n"
-"MouseMoveEvent 213 127 0 0 0 0 0\n"
-"RenderEvent 213 127 0 0 0 0 0\n"
-"InteractionEvent 213 127 0 0 0 0 0\n"
-"MouseMoveEvent 220 143 0 0 0 0 0\n"
-"RenderEvent 220 143 0 0 0 0 0\n"
-"InteractionEvent 220 143 0 0 0 0 0\n"
-"MouseMoveEvent 223 154 0 0 0 0 0\n"
-"RenderEvent 223 154 0 0 0 0 0\n"
-"InteractionEvent 223 154 0 0 0 0 0\n"
-"MouseMoveEvent 225 165 0 0 0 0 0\n"
-"RenderEvent 225 165 0 0 0 0 0\n"
-"InteractionEvent 225 165 0 0 0 0 0\n"
-"MouseMoveEvent 226 180 0 0 0 0 0\n"
-"RenderEvent 226 180 0 0 0 0 0\n"
-"InteractionEvent 226 180 0 0 0 0 0\n"
-"MouseMoveEvent 226 187 0 0 0 0 0\n"
-"RenderEvent 226 187 0 0 0 0 0\n"
-"InteractionEvent 226 187 0 0 0 0 0\n"
-"MouseMoveEvent 226 201 0 0 0 0 0\n"
-"RenderEvent 226 201 0 0 0 0 0\n"
-"InteractionEvent 226 201 0 0 0 0 0\n"
-"MouseMoveEvent 225 205 0 0 0 0 0\n"
-"RenderEvent 225 205 0 0 0 0 0\n"
-"InteractionEvent 225 205 0 0 0 0 0\n"
-"MouseMoveEvent 224 206 0 0 0 0 0\n"
-"RenderEvent 224 206 0 0 0 0 0\n"
-"InteractionEvent 224 206 0 0 0 0 0\n"
-"MouseMoveEvent 223 206 0 0 0 0 0\n"
-"RenderEvent 223 206 0 0 0 0 0\n"
-"InteractionEvent 223 206 0 0 0 0 0\n"
-"MouseMoveEvent 219 204 0 0 0 0 0\n"
-"RenderEvent 219 204 0 0 0 0 0\n"
-"InteractionEvent 219 204 0 0 0 0 0\n"
-"MouseMoveEvent 212 202 0 0 0 0 0\n"
-"RenderEvent 212 202 0 0 0 0 0\n"
-"InteractionEvent 212 202 0 0 0 0 0\n"
-"MouseMoveEvent 204 201 0 0 0 0 0\n"
-"RenderEvent 204 201 0 0 0 0 0\n"
-"InteractionEvent 204 201 0 0 0 0 0\n"
-"MouseMoveEvent 185 201 0 0 0 0 0\n"
-"RenderEvent 185 201 0 0 0 0 0\n"
-"InteractionEvent 185 201 0 0 0 0 0\n"
-"MouseMoveEvent 179 201 0 0 0 0 0\n"
-"RenderEvent 179 201 0 0 0 0 0\n"
-"InteractionEvent 179 201 0 0 0 0 0\n"
-"MouseMoveEvent 171 201 0 0 0 0 0\n"
-"RenderEvent 171 201 0 0 0 0 0\n"
-"InteractionEvent 171 201 0 0 0 0 0\n"
-"MouseMoveEvent 165 203 0 0 0 0 0\n"
-"RenderEvent 165 203 0 0 0 0 0\n"
-"InteractionEvent 165 203 0 0 0 0 0\n"
-"MouseMoveEvent 157 207 0 0 0 0 0\n"
-"RenderEvent 157 207 0 0 0 0 0\n"
-"InteractionEvent 157 207 0 0 0 0 0\n"
-"MouseMoveEvent 149 212 0 0 0 0 0\n"
-"RenderEvent 149 212 0 0 0 0 0\n"
-"InteractionEvent 149 212 0 0 0 0 0\n"
-"MouseMoveEvent 141 219 0 0 0 0 0\n"
-"RenderEvent 141 219 0 0 0 0 0\n"
-"InteractionEvent 141 219 0 0 0 0 0\n"
-"MouseMoveEvent 139 221 0 0 0 0 0\n"
-"RenderEvent 139 221 0 0 0 0 0\n"
-"InteractionEvent 139 221 0 0 0 0 0\n"
-"MouseMoveEvent 138 220 0 0 0 0 0\n"
-"RenderEvent 138 220 0 0 0 0 0\n"
-"InteractionEvent 138 220 0 0 0 0 0\n"
-"MouseMoveEvent 137 211 0 0 0 0 0\n"
-"RenderEvent 137 211 0 0 0 0 0\n"
-"InteractionEvent 137 211 0 0 0 0 0\n"
-"MouseMoveEvent 137 196 0 0 0 0 0\n"
-"RenderEvent 137 196 0 0 0 0 0\n"
-"InteractionEvent 137 196 0 0 0 0 0\n"
-"MouseMoveEvent 137 174 0 0 0 0 0\n"
-"RenderEvent 137 174 0 0 0 0 0\n"
-"InteractionEvent 137 174 0 0 0 0 0\n"
-"MouseMoveEvent 137 161 0 0 0 0 0\n"
-"RenderEvent 137 161 0 0 0 0 0\n"
-"InteractionEvent 137 161 0 0 0 0 0\n"
-"MouseMoveEvent 138 151 0 0 0 0 0\n"
-"RenderEvent 138 151 0 0 0 0 0\n"
-"InteractionEvent 138 151 0 0 0 0 0\n"
-"MouseMoveEvent 142 138 0 0 0 0 0\n"
-"RenderEvent 142 138 0 0 0 0 0\n"
-"InteractionEvent 142 138 0 0 0 0 0\n"
-"MouseMoveEvent 146 128 0 0 0 0 0\n"
-"RenderEvent 146 128 0 0 0 0 0\n"
-"InteractionEvent 146 128 0 0 0 0 0\n"
-"MouseMoveEvent 152 116 0 0 0 0 0\n"
-"RenderEvent 152 116 0 0 0 0 0\n"
-"InteractionEvent 152 116 0 0 0 0 0\n"
-"MouseMoveEvent 162 95 0 0 0 0 0\n"
-"RenderEvent 162 95 0 0 0 0 0\n"
-"InteractionEvent 162 95 0 0 0 0 0\n"
-"MouseMoveEvent 167 81 0 0 0 0 0\n"
-"RenderEvent 167 81 0 0 0 0 0\n"
-"InteractionEvent 167 81 0 0 0 0 0\n"
-"MouseMoveEvent 170 71 0 0 0 0 0\n"
-"RenderEvent 170 71 0 0 0 0 0\n"
-"InteractionEvent 170 71 0 0 0 0 0\n"
-"MouseMoveEvent 171 63 0 0 0 0 0\n"
-"RenderEvent 171 63 0 0 0 0 0\n"
-"InteractionEvent 171 63 0 0 0 0 0\n"
-"MouseMoveEvent 171 57 0 0 0 0 0\n"
-"RenderEvent 171 57 0 0 0 0 0\n"
-"InteractionEvent 171 57 0 0 0 0 0\n"
-"MouseMoveEvent 171 50 0 0 0 0 0\n"
-"RenderEvent 171 50 0 0 0 0 0\n"
-"InteractionEvent 171 50 0 0 0 0 0\n"
-"MouseMoveEvent 171 43 0 0 0 0 0\n"
-"RenderEvent 171 43 0 0 0 0 0\n"
-"InteractionEvent 171 43 0 0 0 0 0\n"
-"MouseMoveEvent 169 32 0 0 0 0 0\n"
-"RenderEvent 169 32 0 0 0 0 0\n"
-"InteractionEvent 169 32 0 0 0 0 0\n"
-"MouseMoveEvent 168 15 0 0 0 0 0\n"
-"RenderEvent 168 15 0 0 0 0 0\n"
-"InteractionEvent 168 15 0 0 0 0 0\n"
-"MouseMoveEvent 168 7 0 0 0 0 0\n"
-"RenderEvent 168 7 0 0 0 0 0\n"
-"InteractionEvent 168 7 0 0 0 0 0\n"
-"MouseMoveEvent 168 6 0 0 0 0 0\n"
-"RenderEvent 168 6 0 0 0 0 0\n"
-"InteractionEvent 168 6 0 0 0 0 0\n"
-"LeftButtonReleaseEvent 168 6 0 0 0 0 0\n"
-"EndInteractionEvent 168 6 0 0 0 0 0\n"
-"RenderEvent 168 6 0 0 0 0 0\n"
-"MouseMoveEvent 167 7 0 0 0 0 0\n"
-"MouseMoveEvent 167 8 0 0 0 0 0\n"
-"MouseMoveEvent 166 11 0 0 0 0 0\n"
-"MouseMoveEvent 164 14 0 0 0 0 0\n"
-"MouseMoveEvent 162 19 0 0 0 0 0\n"
-"MouseMoveEvent 158 28 0 0 0 0 0\n"
-"MouseMoveEvent 153 42 0 0 0 0 0\n"
-"MouseMoveEvent 146 57 0 0 0 0 0\n"
-"MouseMoveEvent 141 76 0 0 0 0 0\n"
-"MouseMoveEvent 136 95 0 0 0 0 0\n"
-"MouseMoveEvent 131 114 0 0 0 0 0\n"
-"MouseMoveEvent 129 131 0 0 0 0 0\n"
-"MouseMoveEvent 129 142 0 0 0 0 0\n"
-"MouseMoveEvent 127 153 0 0 0 0 0\n"
-"MouseMoveEvent 127 160 0 0 0 0 0\n"
-"MouseMoveEvent 126 166 0 0 0 0 0\n"
-"MouseMoveEvent 126 170 0 0 0 0 0\n"
-"MouseMoveEvent 126 173 0 0 0 0 0\n"
-"MouseMoveEvent 126 174 0 0 0 0 0\n"
-"MouseMoveEvent 126 175 0 0 0 0 0\n"
-"MouseMoveEvent 125 176 0 0 0 0 0\n"
-"MouseMoveEvent 125 177 0 0 0 0 0\n"
-"MouseMoveEvent 125 178 0 0 0 0 0\n"
-"MouseMoveEvent 125 176 0 0 0 0 0\n"
-"MouseMoveEvent 125 175 0 0 0 0 0\n"
-"MouseMoveEvent 125 173 0 0 0 0 0\n"
-"MouseMoveEvent 125 172 0 0 0 0 0\n"
-"LeftButtonPressEvent 125 172 0 0 0 0 0\n"
-"StartInteractionEvent 125 172 0 0 0 0 0\n"
-"MouseMoveEvent 125 170 0 0 0 0 0\n"
-"RenderEvent 125 170 0 0 0 0 0\n"
-"InteractionEvent 125 170 0 0 0 0 0\n"
-"MouseMoveEvent 125 160 0 0 0 0 0\n"
-"RenderEvent 125 160 0 0 0 0 0\n"
-"InteractionEvent 125 160 0 0 0 0 0\n"
-"MouseMoveEvent 125 154 0 0 0 0 0\n"
-"RenderEvent 125 154 0 0 0 0 0\n"
-"InteractionEvent 125 154 0 0 0 0 0\n"
-"MouseMoveEvent 124 149 0 0 0 0 0\n"
-"RenderEvent 124 149 0 0 0 0 0\n"
-"InteractionEvent 124 149 0 0 0 0 0\n"
-"MouseMoveEvent 122 140 0 0 0 0 0\n"
-"RenderEvent 122 140 0 0 0 0 0\n"
-"InteractionEvent 122 140 0 0 0 0 0\n"
-"MouseMoveEvent 120 131 0 0 0 0 0\n"
-"RenderEvent 120 131 0 0 0 0 0\n"
-"InteractionEvent 120 131 0 0 0 0 0\n"
-"MouseMoveEvent 119 122 0 0 0 0 0\n"
-"RenderEvent 119 122 0 0 0 0 0\n"
-"InteractionEvent 119 122 0 0 0 0 0\n"
-"MouseMoveEvent 117 117 0 0 0 0 0\n"
-"RenderEvent 117 117 0 0 0 0 0\n"
-"InteractionEvent 117 117 0 0 0 0 0\n"
-"MouseMoveEvent 116 111 0 0 0 0 0\n"
-"RenderEvent 116 111 0 0 0 0 0\n"
-"InteractionEvent 116 111 0 0 0 0 0\n"
-"MouseMoveEvent 114 105 0 0 0 0 0\n"
-"RenderEvent 114 105 0 0 0 0 0\n"
-"InteractionEvent 114 105 0 0 0 0 0\n"
-"MouseMoveEvent 112 91 0 0 0 0 0\n"
-"RenderEvent 112 91 0 0 0 0 0\n"
-"InteractionEvent 112 91 0 0 0 0 0\n"
-"MouseMoveEvent 111 87 0 0 0 0 0\n"
-"RenderEvent 111 87 0 0 0 0 0\n"
-"InteractionEvent 111 87 0 0 0 0 0\n"
-"MouseMoveEvent 111 84 0 0 0 0 0\n"
-"RenderEvent 111 84 0 0 0 0 0\n"
-"InteractionEvent 111 84 0 0 0 0 0\n"
-"MouseMoveEvent 111 81 0 0 0 0 0\n"
-"RenderEvent 111 81 0 0 0 0 0\n"
-"InteractionEvent 111 81 0 0 0 0 0\n"
-"MouseMoveEvent 112 78 0 0 0 0 0\n"
-"RenderEvent 112 78 0 0 0 0 0\n"
-"InteractionEvent 112 78 0 0 0 0 0\n"
-"MouseMoveEvent 115 74 0 0 0 0 0\n"
-"RenderEvent 115 74 0 0 0 0 0\n"
-"InteractionEvent 115 74 0 0 0 0 0\n"
-"MouseMoveEvent 116 73 0 0 0 0 0\n"
-"RenderEvent 116 73 0 0 0 0 0\n"
-"InteractionEvent 116 73 0 0 0 0 0\n"
-"MouseMoveEvent 118 72 0 0 0 0 0\n"
-"RenderEvent 118 72 0 0 0 0 0\n"
-"InteractionEvent 118 72 0 0 0 0 0\n"
-"MouseMoveEvent 121 72 0 0 0 0 0\n"
-"RenderEvent 121 72 0 0 0 0 0\n"
-"InteractionEvent 121 72 0 0 0 0 0\n"
-"MouseMoveEvent 123 72 0 0 0 0 0\n"
-"RenderEvent 123 72 0 0 0 0 0\n"
-"InteractionEvent 123 72 0 0 0 0 0\n"
-"MouseMoveEvent 125 73 0 0 0 0 0\n"
-"RenderEvent 125 73 0 0 0 0 0\n"
-"InteractionEvent 125 73 0 0 0 0 0\n"
-"MouseMoveEvent 127 74 0 0 0 0 0\n"
-"RenderEvent 127 74 0 0 0 0 0\n"
-"InteractionEvent 127 74 0 0 0 0 0\n"
-"MouseMoveEvent 128 74 0 0 0 0 0\n"
-"RenderEvent 128 74 0 0 0 0 0\n"
-"InteractionEvent 128 74 0 0 0 0 0\n"
-"LeftButtonReleaseEvent 128 74 0 0 0 0 0\n"
-"EndInteractionEvent 128 74 0 0 0 0 0\n"
-"RenderEvent 128 74 0 0 0 0 0\n"
-"MouseMoveEvent 131 75 0 0 0 0 0\n"
-"MouseMoveEvent 134 76 0 0 0 0 0\n"
-"MouseMoveEvent 139 77 0 0 0 0 0\n"
-"MouseMoveEvent 144 77 0 0 0 0 0\n"
-"MouseMoveEvent 151 80 0 0 0 0 0\n"
-"MouseMoveEvent 159 81 0 0 0 0 0\n"
-"MouseMoveEvent 166 84 0 0 0 0 0\n"
-"MouseMoveEvent 174 85 0 0 0 0 0\n"
-"MouseMoveEvent 181 87 0 0 0 0 0\n"
-"MouseMoveEvent 189 90 0 0 0 0 0\n"
-"MouseMoveEvent 193 92 0 0 0 0 0\n"
-"MouseMoveEvent 197 94 0 0 0 0 0\n"
-"MouseMoveEvent 201 96 0 0 0 0 0\n"
-"MouseMoveEvent 203 98 0 0 0 0 0\n"
-"MouseMoveEvent 205 100 0 0 0 0 0\n"
-"MouseMoveEvent 206 102 0 0 0 0 0\n"
-"MouseMoveEvent 207 104 0 0 0 0 0\n"
-"MouseMoveEvent 207 106 0 0 0 0 0\n"
-"MouseMoveEvent 208 108 0 0 0 0 0\n"
-"MouseMoveEvent 208 109 0 0 0 0 0\n"
-"MouseMoveEvent 209 111 0 0 0 0 0\n"
-"MouseMoveEvent 209 112 0 0 0 0 0\n"
-"MouseMoveEvent 209 113 0 0 0 0 0\n"
-"MouseMoveEvent 209 114 0 0 0 0 0\n"
-"MouseMoveEvent 210 116 0 0 0 0 0\n"
-"MouseMoveEvent 211 117 0 0 0 0 0\n"
-"MouseMoveEvent 212 117 0 0 0 0 0\n"
-"MouseMoveEvent 213 118 0 0 0 0 0\n"
-"MouseMoveEvent 214 118 0 0 0 0 0\n"
-"MouseMoveEvent 215 118 0 0 0 0 0\n"
-"MouseMoveEvent 216 118 0 0 0 0 0\n"
-"MouseMoveEvent 218 119 0 0 0 0 0\n"
-"MouseMoveEvent 219 119 0 0 0 0 0\n"
-"MouseMoveEvent 220 119 0 0 0 0 0\n"
-"MouseMoveEvent 221 120 0 0 0 0 0\n"
-"MouseMoveEvent 222 120 0 0 0 0 0\n"
-"MouseMoveEvent 224 121 0 0 0 0 0\n"
-"MouseMoveEvent 225 121 0 0 0 0 0\n"
-"MouseMoveEvent 226 121 0 0 0 0 0\n"
-"MouseMoveEvent 227 122 0 0 0 0 0\n"
-"MouseMoveEvent 228 122 0 0 0 0 0\n"
-"MouseMoveEvent 229 122 0 0 0 0 0\n"
-"MouseMoveEvent 230 122 0 0 0 0 0\n"
-"MouseMoveEvent 232 123 0 0 0 0 0\n"
-"MouseMoveEvent 233 123 0 0 0 0 0\n"
-"MouseMoveEvent 234 124 0 0 0 0 0\n"
-"MouseMoveEvent 235 123 0 0 0 0 0\n"
-"MouseMoveEvent 235 121 0 0 0 0 0\n"
-"MouseMoveEvent 234 120 0 0 0 0 0\n"
-"MouseMoveEvent 233 118 0 0 0 0 0\n"
-"MouseMoveEvent 233 117 0 0 0 0 0\n"
-"MouseMoveEvent 232 116 0 0 0 0 0\n"
-"MouseMoveEvent 232 114 0 0 0 0 0\n"
-"MouseMoveEvent 231 113 0 0 0 0 0\n"
-"MouseMoveEvent 231 111 0 0 0 0 0\n"
-"MouseMoveEvent 231 109 0 0 0 0 0\n"
-"MouseMoveEvent 231 107 0 0 0 0 0\n"
-"MouseMoveEvent 231 105 0 0 0 0 0\n"
-"MouseMoveEvent 231 103 0 0 0 0 0\n"
-"MouseMoveEvent 231 101 0 0 0 0 0\n"
-"MouseMoveEvent 231 99 0 0 0 0 0\n"
-"MouseMoveEvent 231 97 0 0 0 0 0\n"
-"MouseMoveEvent 231 96 0 0 0 0 0\n"
-"MouseMoveEvent 231 95 0 0 0 0 0\n"
-"MouseMoveEvent 231 94 0 0 0 0 0\n"
-"MouseMoveEvent 232 93 0 0 0 0 0\n"
-"MouseMoveEvent 233 92 0 0 0 0 0\n"
-"MouseMoveEvent 234 90 0 0 0 0 0\n"
-"MouseMoveEvent 235 89 0 0 0 0 0\n"
-"MouseMoveEvent 236 88 0 0 0 0 0\n"
-"MouseMoveEvent 237 87 0 0 0 0 0\n"
-"MouseMoveEvent 238 86 0 0 0 0 0\n"
-"MouseMoveEvent 239 85 0 0 0 0 0\n"
-"MouseMoveEvent 240 84 0 0 0 0 0\n"
-"MouseMoveEvent 241 83 0 0 0 0 0\n"
-"MouseMoveEvent 242 82 0 0 0 0 0\n"
-"MouseMoveEvent 243 82 0 0 0 0 0\n"
-"MouseMoveEvent 244 81 0 0 0 0 0\n"
-"MouseMoveEvent 245 81 0 0 0 0 0\n"
-"MouseMoveEvent 246 80 0 0 0 0 0\n"
-"MouseMoveEvent 247 79 0 0 0 0 0\n"
-"MouseMoveEvent 248 78 0 0 0 0 0\n"
-"MouseMoveEvent 249 77 0 0 0 0 0\n"
-"MouseMoveEvent 249 76 0 0 0 0 0\n"
-"MouseMoveEvent 250 75 0 0 0 0 0\n"
-"MouseMoveEvent 250 74 0 0 0 0 0\n"
-"MouseMoveEvent 250 73 0 0 0 0 0\n"
-"MouseMoveEvent 250 72 0 0 0 0 0\n"
-"MouseMoveEvent 250 71 0 0 0 0 0\n"
-"MouseMoveEvent 250 69 0 0 0 0 0\n"
-"MouseMoveEvent 250 68 0 0 0 0 0\n"
-"MouseMoveEvent 250 67 0 0 0 0 0\n"
-"MouseMoveEvent 250 66 0 0 0 0 0\n"
-"MouseMoveEvent 250 65 0 0 0 0 0\n"
-"MouseMoveEvent 248 67 0 0 0 0 0\n"
-"MouseMoveEvent 247 68 0 0 0 0 0\n"
-"MouseMoveEvent 246 69 0 0 0 0 0\n"
-"MouseMoveEvent 245 70 0 0 0 0 0\n"
-"MouseMoveEvent 244 71 0 0 0 0 0\n"
-"MouseMoveEvent 243 72 0 0 0 0 0\n"
-"MouseMoveEvent 241 74 0 0 0 0 0\n"
-"MouseMoveEvent 240 75 0 0 0 0 0\n"
-"MouseMoveEvent 239 76 0 0 0 0 0\n"
-"MouseMoveEvent 236 78 0 0 0 0 0\n"
-"MouseMoveEvent 235 80 0 0 0 0 0\n"
-"MouseMoveEvent 234 81 0 0 0 0 0\n"
-"MouseMoveEvent 234 82 0 0 0 0 0\n"
-"MouseMoveEvent 234 83 0 0 0 0 0\n"
-"MouseMoveEvent 234 85 0 0 0 0 0\n"
-"MouseMoveEvent 234 87 0 0 0 0 0\n"
-"MouseMoveEvent 233 88 0 0 0 0 0\n"
-"MouseMoveEvent 233 90 0 0 0 0 0\n"
-"MouseMoveEvent 232 93 0 0 0 0 0\n"
-"MouseMoveEvent 232 94 0 0 0 0 0\n"
-"MouseMoveEvent 232 97 0 0 0 0 0\n"
-"MouseMoveEvent 232 99 0 0 0 0 0\n"
-"MouseMoveEvent 231 102 0 0 0 0 0\n"
-"MouseMoveEvent 231 103 0 0 0 0 0\n"
-"MouseMoveEvent 231 105 0 0 0 0 0\n"
-"MouseMoveEvent 231 106 0 0 0 0 0\n"
-"MouseMoveEvent 231 108 0 0 0 0 0\n"
-"MouseMoveEvent 231 109 0 0 0 0 0\n"
-"MouseMoveEvent 231 110 0 0 0 0 0\n"
-"MouseMoveEvent 231 112 0 0 0 0 0\n"
-"MouseMoveEvent 231 113 0 0 0 0 0\n"
-"MouseMoveEvent 231 114 0 0 0 0 0\n"
-"MouseMoveEvent 231 115 0 0 0 0 0\n"
-"MouseMoveEvent 231 116 0 0 0 0 0\n"
-"MouseMoveEvent 231 117 0 0 0 0 0\n"
-"MouseMoveEvent 232 120 0 0 0 0 0\n"
-"MouseMoveEvent 232 123 0 0 0 0 0\n"
-"MouseMoveEvent 233 126 0 0 0 0 0\n"
-"MouseMoveEvent 233 129 0 0 0 0 0\n"
-"MouseMoveEvent 233 133 0 0 0 0 0\n"
-"MouseMoveEvent 234 136 0 0 0 0 0\n"
-"MouseMoveEvent 234 138 0 0 0 0 0\n"
-"MouseMoveEvent 234 139 0 0 0 0 0\n"
-"MouseMoveEvent 234 140 0 0 0 0 0\n"
-"MouseMoveEvent 234 141 0 0 0 0 0\n"
-"MouseWheelBackwardEvent 234 141 0 0 0 0 0\n"
-"StartInteractionEvent 234 141 0 0 0 0 0\n"
-"RenderEvent 234 141 0 0 0 0 0\n"
-"EndInteractionEvent 234 141 0 0 0 0 0\n"
-"RenderEvent 234 141 0 0 0 0 0\n"
-"MouseWheelForwardEvent 234 141 0 0 0 0 0\n"
-"StartInteractionEvent 234 141 0 0 0 0 0\n"
-"RenderEvent 234 141 0 0 0 0 0\n"
-"EndInteractionEvent 234 141 0 0 0 0 0\n"
-"RenderEvent 234 141 0 0 0 0 0\n"
-"MouseWheelForwardEvent 234 141 0 0 0 1 0\n"
-"StartInteractionEvent 234 141 0 0 0 1 0\n"
-"RenderEvent 234 141 0 0 0 1 0\n"
-"EndInteractionEvent 234 141 0 0 0 1 0\n"
-"RenderEvent 234 141 0 0 0 1 0\n"
-"MouseWheelBackwardEvent 234 141 0 0 0 0 0\n"
-"StartInteractionEvent 234 141 0 0 0 0 0\n"
-"RenderEvent 234 141 0 0 0 0 0\n"
-"EndInteractionEvent 234 141 0 0 0 0 0\n"
-"RenderEvent 234 141 0 0 0 0 0\n"
-"MouseWheelForwardEvent 234 141 0 0 0 0 0\n"
-"StartInteractionEvent 234 141 0 0 0 0 0\n"
-"RenderEvent 234 141 0 0 0 0 0\n"
-"EndInteractionEvent 234 141 0 0 0 0 0\n"
-"RenderEvent 234 141 0 0 0 0 0\n"
-"MouseMoveEvent 234 144 0 0 0 0 0\n"
-"MouseMoveEvent 237 148 0 0 0 0 0\n"
-"MouseMoveEvent 241 156 0 0 0 0 0\n"
-"MouseMoveEvent 246 166 0 0 0 0 0\n"
-"MouseMoveEvent 248 177 0 0 0 0 0\n"
-"MouseMoveEvent 251 192 0 0 0 0 0\n"
-"MouseMoveEvent 254 204 0 0 0 0 0\n"
-"MouseMoveEvent 256 213 0 0 0 0 0\n"
-"MouseMoveEvent 259 222 0 0 0 0 0\n"
-"MouseMoveEvent 261 227 0 0 0 0 0\n"
-"MouseMoveEvent 261 228 0 0 0 0 0\n"
-"MouseMoveEvent 262 229 0 0 0 0 0\n"
-"MouseMoveEvent 262 230 0 0 0 0 0\n"
-"MouseMoveEvent 263 231 0 0 0 0 0\n"
-"MouseMoveEvent 263 232 0 0 0 0 0\n"
-"MouseMoveEvent 263 233 0 0 0 0 0\n"
-"KeyPressEvent 263 233 1 0 3 1 c\n"
-"CharEvent 263 233 1 0 3 1 c\n"
-"KeyReleaseEvent 263 233 1 0 3 1 c\n"
-"KeyReleaseEvent 263 233 1 0 0 1 Control_L\n"
-"MouseMoveEvent 264 234 0 0 0 0 Control_L\n"
-"MouseMoveEvent 270 234 0 0 0 0 Control_L\n"
-"MouseMoveEvent 291 232 0 0 0 0 Control_L\n"
-"LeaveEvent 312 229 0 0 0 0 Control_L\n"
-;
-
-int TestGPURayCastThreeComponentsIndependent(int argc, char *argv[])
-{
-  cout << "CTEST_FULL_OUTPUT (Avoid ctest truncation of output)" << endl;
-
-  int dims[3] = {100, 100, 100};
-
-  // Create a vtkImageData with two components
-  vtkNew<vtkImageData> image;
-  image->SetDimensions(dims[0], dims[1], dims[2]);
-  image->AllocateScalars(VTK_DOUBLE, 3);
-
-  // Fill the first half rectangular parallelopiped along X with the
-  // first component values and the second half with second component values
-  double * ptr = static_cast<double *> (image->GetScalarPointer(0, 0, 0));
-
-  double center1[3], center2[3], center3[3];
-  center1[0] = dims[0]/3; center2[0] = center1[0]*2; center3[0] = dims[0]/2;
-  center1[1] = center2[1] = dims[1]/2; center3[1] = dims[1]/3;
-  center1[2] = center2[2] = center3[2] = dims[2]/2;
-
-  double radius;
-  radius = center1[0];
-
-  vtkNew<vtkSphere> sphere1;
-  sphere1->SetCenter(center1);
-  sphere1->SetRadius(radius);
-  vtkNew<vtkSphere> sphere2;
-  sphere2->SetCenter(center2);
-  sphere2->SetRadius(radius);
-  vtkNew<vtkSphere> sphere3;
-  sphere3->SetCenter(center3);
-  sphere3->SetRadius(radius);
-
-  for (int z = 0; z < dims[2]; ++z)
-    {
-    for (int y = 0; y < dims[1]; ++y)
-      {
-      for (int x = 0; x < dims[0]; ++x)
-        {
-        // Set first component
-        if (sphere1->EvaluateFunction(x, y, z) > 0)
-          {
-          // point outside sphere 1
-          *ptr++ = 0.0;
-          }
-        else
-          {
-          *ptr++ = 0.33;
-          }
-        // Set second component
-        if (sphere2->EvaluateFunction(x, y, z) > 0)
-          {
-          // point outside sphere 2
-          *ptr++ = 0.0;
-          }
-        else
-          {
-          *ptr++ = 0.33;
-          }
-        // Set third component
-        if (sphere3->EvaluateFunction(x, y, z) > 0)
-          {
-          // point outside sphere 2
-          *ptr++ = 0.0;
-          }
-        else
-          {
-          *ptr++ = 0.33;
-          }
-        }
-      }
-    }
-
-  vtkNew<vtkRenderWindow> renWin;
-  renWin->SetSize(301, 300); // Intentional NPOT size
-  renWin->SetMultiSamples(0);
-
-  vtkNew<vtkRenderer> ren;
-  renWin->AddRenderer(ren.GetPointer());
-
-  vtkNew<vtkRenderWindowInteractor> iren;
-  vtkNew<vtkInteractorStyleTrackballCamera> style;
-  iren->SetInteractorStyle(style.GetPointer());
-  iren->SetRenderWindow(renWin.GetPointer());
-
-  renWin->Render();
-
-  // Volume render the dataset
-  vtkNew<vtkGPUVolumeRayCastMapper> mapper;
-  mapper->AutoAdjustSampleDistancesOff();
-  mapper->SetSampleDistance(0.9);
-  mapper->SetInputData(image.GetPointer());
-
-  // Color transfer function
-  vtkNew<vtkColorTransferFunction> ctf1;
-  ctf1->AddRGBPoint(0.0, 0.0, 0.0, 0.0);
-  ctf1->AddRGBPoint(1.0, 1.0, 0.0, 0.0);
-
-  vtkNew<vtkColorTransferFunction> ctf2;
-  ctf2->AddRGBPoint(0.0, 0.0, 0.0, 0.0);
-  ctf2->AddRGBPoint(1.0, 0.0, 1.0, 0.0);
-
-  vtkNew<vtkColorTransferFunction> ctf3;
-  ctf3->AddRGBPoint(0.0, 0.0, 0.0, 0.0);
-  ctf3->AddRGBPoint(1.0, 0.0, 0.0, 1.0);
-
-  // Opacity functions
-  vtkNew<vtkPiecewiseFunction> pf1;
-  pf1->AddPoint(0.0, 0.0);
-  pf1->AddPoint(1.0, 0.2);
-
-  vtkNew<vtkPiecewiseFunction> pf2;
-  pf2->AddPoint(0.0, 0.0);
-  pf2->AddPoint(1.0, 0.2);
-
-  vtkNew<vtkPiecewiseFunction> pf3;
-  pf3->AddPoint(0.0, 0.0);
-  pf3->AddPoint(1.0, 0.2);
-
-  // Volume property with independent components ON
-  vtkNew<vtkVolumeProperty> property;
-  property->IndependentComponentsOn();
-
-  // Set color and opacity functions
-  property->SetColor(0, ctf1.GetPointer());
-  property->SetColor(1, ctf2.GetPointer());
-  property->SetColor(2, ctf3.GetPointer());
-  property->SetScalarOpacity(0, pf1.GetPointer());
-  property->SetScalarOpacity(1, pf2.GetPointer());
-  property->SetScalarOpacity(2, pf3.GetPointer());
-
-  vtkNew<vtkVolume> volume;
-  volume->SetMapper(mapper.GetPointer());
-  volume->SetProperty(property.GetPointer());
-  ren->AddVolume(volume.GetPointer());
-
-  ren->ResetCamera();
-
-  iren->Initialize();
-  renWin->Render();
-
-  return vtkTesting::InteractorEventLoop(argc, argv,
-                                         iren.GetPointer(),
-                                         TestGPURayCastThreeComponentsIndependentLog);
-}
diff --git a/Rendering/Volume/Testing/Cxx/TestGPURayCastTwoComponentsDependent.cxx b/Rendering/Volume/Testing/Cxx/TestGPURayCastTwoComponentsDependent.cxx
deleted file mode 100644
index 54ebf8f..0000000
--- a/Rendering/Volume/Testing/Cxx/TestGPURayCastTwoComponentsDependent.cxx
+++ /dev/null
@@ -1,846 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    TestGPURayCastTwoComponentsDependent.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.
-
-=========================================================================*/
-
-// Description
-// This test creates a vtkImageData with two components.
-// The dataset is volume rendered with IndependentComponents off, i.e.
-// the first component is passed through the color transfer function and the
-// second is passed through the opacity transfer function.
-
-#include "vtkCamera.h"
-#include "vtkColorTransferFunction.h"
-#include "vtkGPUVolumeRayCastMapper.h"
-#include "vtkImageData.h"
-#include "vtkInteractorStyleTrackballCamera.h"
-#include "vtkNew.h"
-#include "vtkPiecewiseFunction.h"
-#include "vtkRenderer.h"
-#include "vtkRenderWindow.h"
-#include "vtkRenderWindowInteractor.h"
-#include "vtkTesting.h"
-#include "vtkTestUtilities.h"
-#include "vtkVolume.h"
-#include "vtkVolumeProperty.h"
-
-static const char * TestGPURayCastTwoComponentsDependentLog =
-"# StreamVersion 1\n"
-"EnterEvent 298 109 0 0 0 0 0\n"
-"MouseMoveEvent 298 109 0 0 0 0 0\n"
-"MouseMoveEvent 287 111 0 0 0 0 0\n"
-"MouseMoveEvent 278 114 0 0 0 0 0\n"
-"MouseMoveEvent 271 117 0 0 0 0 0\n"
-"MouseMoveEvent 264 120 0 0 0 0 0\n"
-"MouseMoveEvent 259 123 0 0 0 0 0\n"
-"MouseMoveEvent 255 126 0 0 0 0 0\n"
-"MouseMoveEvent 250 128 0 0 0 0 0\n"
-"MouseMoveEvent 244 133 0 0 0 0 0\n"
-"MouseMoveEvent 240 137 0 0 0 0 0\n"
-"MouseMoveEvent 238 139 0 0 0 0 0\n"
-"MouseMoveEvent 233 141 0 0 0 0 0\n"
-"MouseMoveEvent 229 143 0 0 0 0 0\n"
-"MouseMoveEvent 225 146 0 0 0 0 0\n"
-"MouseMoveEvent 221 148 0 0 0 0 0\n"
-"MouseMoveEvent 217 151 0 0 0 0 0\n"
-"MouseMoveEvent 213 153 0 0 0 0 0\n"
-"MouseMoveEvent 212 154 0 0 0 0 0\n"
-"MouseMoveEvent 211 155 0 0 0 0 0\n"
-"MouseMoveEvent 210 156 0 0 0 0 0\n"
-"MouseMoveEvent 209 158 0 0 0 0 0\n"
-"MouseMoveEvent 208 159 0 0 0 0 0\n"
-"MouseMoveEvent 207 160 0 0 0 0 0\n"
-"MouseMoveEvent 204 162 0 0 0 0 0\n"
-"MouseMoveEvent 200 164 0 0 0 0 0\n"
-"MouseMoveEvent 195 166 0 0 0 0 0\n"
-"MouseMoveEvent 188 169 0 0 0 0 0\n"
-"MouseMoveEvent 176 176 0 0 0 0 0\n"
-"MouseMoveEvent 164 183 0 0 0 0 0\n"
-"MouseMoveEvent 153 189 0 0 0 0 0\n"
-"MouseMoveEvent 144 193 0 0 0 0 0\n"
-"MouseMoveEvent 138 197 0 0 0 0 0\n"
-"MouseMoveEvent 133 201 0 0 0 0 0\n"
-"MouseMoveEvent 127 206 0 0 0 0 0\n"
-"MouseMoveEvent 121 210 0 0 0 0 0\n"
-"MouseMoveEvent 119 211 0 0 0 0 0\n"
-"MouseMoveEvent 118 212 0 0 0 0 0\n"
-"LeftButtonPressEvent 118 212 0 0 0 0 0\n"
-"StartInteractionEvent 118 212 0 0 0 0 0\n"
-"MouseMoveEvent 117 211 0 0 0 0 0\n"
-"RenderEvent 117 211 0 0 0 0 0\n"
-"InteractionEvent 117 211 0 0 0 0 0\n"
-"MouseMoveEvent 118 209 0 0 0 0 0\n"
-"RenderEvent 118 209 0 0 0 0 0\n"
-"InteractionEvent 118 209 0 0 0 0 0\n"
-"MouseMoveEvent 121 207 0 0 0 0 0\n"
-"RenderEvent 121 207 0 0 0 0 0\n"
-"InteractionEvent 121 207 0 0 0 0 0\n"
-"MouseMoveEvent 125 199 0 0 0 0 0\n"
-"RenderEvent 125 199 0 0 0 0 0\n"
-"InteractionEvent 125 199 0 0 0 0 0\n"
-"MouseMoveEvent 128 196 0 0 0 0 0\n"
-"RenderEvent 128 196 0 0 0 0 0\n"
-"InteractionEvent 128 196 0 0 0 0 0\n"
-"MouseMoveEvent 132 190 0 0 0 0 0\n"
-"RenderEvent 132 190 0 0 0 0 0\n"
-"InteractionEvent 132 190 0 0 0 0 0\n"
-"MouseMoveEvent 136 185 0 0 0 0 0\n"
-"RenderEvent 136 185 0 0 0 0 0\n"
-"InteractionEvent 136 185 0 0 0 0 0\n"
-"MouseMoveEvent 139 181 0 0 0 0 0\n"
-"RenderEvent 139 181 0 0 0 0 0\n"
-"InteractionEvent 139 181 0 0 0 0 0\n"
-"MouseMoveEvent 142 177 0 0 0 0 0\n"
-"RenderEvent 142 177 0 0 0 0 0\n"
-"InteractionEvent 142 177 0 0 0 0 0\n"
-"MouseMoveEvent 144 174 0 0 0 0 0\n"
-"RenderEvent 144 174 0 0 0 0 0\n"
-"InteractionEvent 144 174 0 0 0 0 0\n"
-"MouseMoveEvent 149 169 0 0 0 0 0\n"
-"RenderEvent 149 169 0 0 0 0 0\n"
-"InteractionEvent 149 169 0 0 0 0 0\n"
-"MouseMoveEvent 153 165 0 0 0 0 0\n"
-"RenderEvent 153 165 0 0 0 0 0\n"
-"InteractionEvent 153 165 0 0 0 0 0\n"
-"MouseMoveEvent 157 161 0 0 0 0 0\n"
-"RenderEvent 157 161 0 0 0 0 0\n"
-"InteractionEvent 157 161 0 0 0 0 0\n"
-"MouseMoveEvent 159 158 0 0 0 0 0\n"
-"RenderEvent 159 158 0 0 0 0 0\n"
-"InteractionEvent 159 158 0 0 0 0 0\n"
-"MouseMoveEvent 165 151 0 0 0 0 0\n"
-"RenderEvent 165 151 0 0 0 0 0\n"
-"InteractionEvent 165 151 0 0 0 0 0\n"
-"MouseMoveEvent 168 147 0 0 0 0 0\n"
-"RenderEvent 168 147 0 0 0 0 0\n"
-"InteractionEvent 168 147 0 0 0 0 0\n"
-"MouseMoveEvent 172 142 0 0 0 0 0\n"
-"RenderEvent 172 142 0 0 0 0 0\n"
-"InteractionEvent 172 142 0 0 0 0 0\n"
-"MouseMoveEvent 175 139 0 0 0 0 0\n"
-"RenderEvent 175 139 0 0 0 0 0\n"
-"InteractionEvent 175 139 0 0 0 0 0\n"
-"MouseMoveEvent 179 135 0 0 0 0 0\n"
-"RenderEvent 179 135 0 0 0 0 0\n"
-"InteractionEvent 179 135 0 0 0 0 0\n"
-"MouseMoveEvent 183 131 0 0 0 0 0\n"
-"RenderEvent 183 131 0 0 0 0 0\n"
-"InteractionEvent 183 131 0 0 0 0 0\n"
-"MouseMoveEvent 186 128 0 0 0 0 0\n"
-"RenderEvent 186 128 0 0 0 0 0\n"
-"InteractionEvent 186 128 0 0 0 0 0\n"
-"MouseMoveEvent 188 126 0 0 0 0 0\n"
-"RenderEvent 188 126 0 0 0 0 0\n"
-"InteractionEvent 188 126 0 0 0 0 0\n"
-"MouseMoveEvent 189 125 0 0 0 0 0\n"
-"RenderEvent 189 125 0 0 0 0 0\n"
-"InteractionEvent 189 125 0 0 0 0 0\n"
-"MouseMoveEvent 192 123 0 0 0 0 0\n"
-"RenderEvent 192 123 0 0 0 0 0\n"
-"InteractionEvent 192 123 0 0 0 0 0\n"
-"MouseMoveEvent 194 121 0 0 0 0 0\n"
-"RenderEvent 194 121 0 0 0 0 0\n"
-"InteractionEvent 194 121 0 0 0 0 0\n"
-"MouseMoveEvent 196 120 0 0 0 0 0\n"
-"RenderEvent 196 120 0 0 0 0 0\n"
-"InteractionEvent 196 120 0 0 0 0 0\n"
-"MouseMoveEvent 199 118 0 0 0 0 0\n"
-"RenderEvent 199 118 0 0 0 0 0\n"
-"InteractionEvent 199 118 0 0 0 0 0\n"
-"MouseMoveEvent 200 118 0 0 0 0 0\n"
-"RenderEvent 200 118 0 0 0 0 0\n"
-"InteractionEvent 200 118 0 0 0 0 0\n"
-"MouseMoveEvent 201 120 0 0 0 0 0\n"
-"RenderEvent 201 120 0 0 0 0 0\n"
-"InteractionEvent 201 120 0 0 0 0 0\n"
-"MouseMoveEvent 201 123 0 0 0 0 0\n"
-"RenderEvent 201 123 0 0 0 0 0\n"
-"InteractionEvent 201 123 0 0 0 0 0\n"
-"MouseMoveEvent 201 127 0 0 0 0 0\n"
-"RenderEvent 201 127 0 0 0 0 0\n"
-"InteractionEvent 201 127 0 0 0 0 0\n"
-"MouseMoveEvent 197 138 0 0 0 0 0\n"
-"RenderEvent 197 138 0 0 0 0 0\n"
-"InteractionEvent 197 138 0 0 0 0 0\n"
-"MouseMoveEvent 193 151 0 0 0 0 0\n"
-"RenderEvent 193 151 0 0 0 0 0\n"
-"InteractionEvent 193 151 0 0 0 0 0\n"
-"MouseMoveEvent 187 167 0 0 0 0 0\n"
-"RenderEvent 187 167 0 0 0 0 0\n"
-"InteractionEvent 187 167 0 0 0 0 0\n"
-"MouseMoveEvent 183 177 0 0 0 0 0\n"
-"RenderEvent 183 177 0 0 0 0 0\n"
-"InteractionEvent 183 177 0 0 0 0 0\n"
-"MouseMoveEvent 182 185 0 0 0 0 0\n"
-"RenderEvent 182 185 0 0 0 0 0\n"
-"InteractionEvent 182 185 0 0 0 0 0\n"
-"MouseMoveEvent 182 193 0 0 0 0 0\n"
-"RenderEvent 182 193 0 0 0 0 0\n"
-"InteractionEvent 182 193 0 0 0 0 0\n"
-"MouseMoveEvent 180 201 0 0 0 0 0\n"
-"RenderEvent 180 201 0 0 0 0 0\n"
-"InteractionEvent 180 201 0 0 0 0 0\n"
-"MouseMoveEvent 177 208 0 0 0 0 0\n"
-"RenderEvent 177 208 0 0 0 0 0\n"
-"InteractionEvent 177 208 0 0 0 0 0\n"
-"MouseMoveEvent 176 215 0 0 0 0 0\n"
-"RenderEvent 176 215 0 0 0 0 0\n"
-"InteractionEvent 176 215 0 0 0 0 0\n"
-"MouseMoveEvent 174 219 0 0 0 0 0\n"
-"RenderEvent 174 219 0 0 0 0 0\n"
-"InteractionEvent 174 219 0 0 0 0 0\n"
-"MouseMoveEvent 173 222 0 0 0 0 0\n"
-"RenderEvent 173 222 0 0 0 0 0\n"
-"InteractionEvent 173 222 0 0 0 0 0\n"
-"MouseMoveEvent 172 227 0 0 0 0 0\n"
-"RenderEvent 172 227 0 0 0 0 0\n"
-"InteractionEvent 172 227 0 0 0 0 0\n"
-"MouseMoveEvent 169 232 0 0 0 0 0\n"
-"RenderEvent 169 232 0 0 0 0 0\n"
-"InteractionEvent 169 232 0 0 0 0 0\n"
-"MouseMoveEvent 167 236 0 0 0 0 0\n"
-"RenderEvent 167 236 0 0 0 0 0\n"
-"InteractionEvent 167 236 0 0 0 0 0\n"
-"MouseMoveEvent 164 240 0 0 0 0 0\n"
-"RenderEvent 164 240 0 0 0 0 0\n"
-"InteractionEvent 164 240 0 0 0 0 0\n"
-"MouseMoveEvent 160 244 0 0 0 0 0\n"
-"RenderEvent 160 244 0 0 0 0 0\n"
-"InteractionEvent 160 244 0 0 0 0 0\n"
-"MouseMoveEvent 158 246 0 0 0 0 0\n"
-"RenderEvent 158 246 0 0 0 0 0\n"
-"InteractionEvent 158 246 0 0 0 0 0\n"
-"MouseMoveEvent 157 247 0 0 0 0 0\n"
-"RenderEvent 157 247 0 0 0 0 0\n"
-"InteractionEvent 157 247 0 0 0 0 0\n"
-"MouseMoveEvent 156 249 0 0 0 0 0\n"
-"RenderEvent 156 249 0 0 0 0 0\n"
-"InteractionEvent 156 249 0 0 0 0 0\n"
-"MouseMoveEvent 154 252 0 0 0 0 0\n"
-"RenderEvent 154 252 0 0 0 0 0\n"
-"InteractionEvent 154 252 0 0 0 0 0\n"
-"MouseMoveEvent 153 253 0 0 0 0 0\n"
-"RenderEvent 153 253 0 0 0 0 0\n"
-"InteractionEvent 153 253 0 0 0 0 0\n"
-"MouseMoveEvent 152 254 0 0 0 0 0\n"
-"RenderEvent 152 254 0 0 0 0 0\n"
-"InteractionEvent 152 254 0 0 0 0 0\n"
-"MouseMoveEvent 151 255 0 0 0 0 0\n"
-"RenderEvent 151 255 0 0 0 0 0\n"
-"InteractionEvent 151 255 0 0 0 0 0\n"
-"MouseMoveEvent 150 256 0 0 0 0 0\n"
-"RenderEvent 150 256 0 0 0 0 0\n"
-"InteractionEvent 150 256 0 0 0 0 0\n"
-"MouseMoveEvent 149 257 0 0 0 0 0\n"
-"RenderEvent 149 257 0 0 0 0 0\n"
-"InteractionEvent 149 257 0 0 0 0 0\n"
-"MouseMoveEvent 147 259 0 0 0 0 0\n"
-"RenderEvent 147 259 0 0 0 0 0\n"
-"InteractionEvent 147 259 0 0 0 0 0\n"
-"MouseMoveEvent 146 261 0 0 0 0 0\n"
-"RenderEvent 146 261 0 0 0 0 0\n"
-"InteractionEvent 146 261 0 0 0 0 0\n"
-"MouseMoveEvent 146 262 0 0 0 0 0\n"
-"RenderEvent 146 262 0 0 0 0 0\n"
-"InteractionEvent 146 262 0 0 0 0 0\n"
-"MouseMoveEvent 145 263 0 0 0 0 0\n"
-"RenderEvent 145 263 0 0 0 0 0\n"
-"InteractionEvent 145 263 0 0 0 0 0\n"
-"MouseMoveEvent 144 264 0 0 0 0 0\n"
-"RenderEvent 144 264 0 0 0 0 0\n"
-"InteractionEvent 144 264 0 0 0 0 0\n"
-"MouseMoveEvent 143 264 0 0 0 0 0\n"
-"RenderEvent 143 264 0 0 0 0 0\n"
-"InteractionEvent 143 264 0 0 0 0 0\n"
-"MouseMoveEvent 142 264 0 0 0 0 0\n"
-"RenderEvent 142 264 0 0 0 0 0\n"
-"InteractionEvent 142 264 0 0 0 0 0\n"
-"MouseMoveEvent 141 264 0 0 0 0 0\n"
-"RenderEvent 141 264 0 0 0 0 0\n"
-"InteractionEvent 141 264 0 0 0 0 0\n"
-"MouseMoveEvent 140 264 0 0 0 0 0\n"
-"RenderEvent 140 264 0 0 0 0 0\n"
-"InteractionEvent 140 264 0 0 0 0 0\n"
-"MouseMoveEvent 138 263 0 0 0 0 0\n"
-"RenderEvent 138 263 0 0 0 0 0\n"
-"InteractionEvent 138 263 0 0 0 0 0\n"
-"MouseMoveEvent 137 261 0 0 0 0 0\n"
-"RenderEvent 137 261 0 0 0 0 0\n"
-"InteractionEvent 137 261 0 0 0 0 0\n"
-"MouseMoveEvent 136 260 0 0 0 0 0\n"
-"RenderEvent 136 260 0 0 0 0 0\n"
-"InteractionEvent 136 260 0 0 0 0 0\n"
-"MouseMoveEvent 132 255 0 0 0 0 0\n"
-"RenderEvent 132 255 0 0 0 0 0\n"
-"InteractionEvent 132 255 0 0 0 0 0\n"
-"MouseMoveEvent 128 249 0 0 0 0 0\n"
-"RenderEvent 128 249 0 0 0 0 0\n"
-"InteractionEvent 128 249 0 0 0 0 0\n"
-"MouseMoveEvent 124 242 0 0 0 0 0\n"
-"RenderEvent 124 242 0 0 0 0 0\n"
-"InteractionEvent 124 242 0 0 0 0 0\n"
-"MouseMoveEvent 122 237 0 0 0 0 0\n"
-"RenderEvent 122 237 0 0 0 0 0\n"
-"InteractionEvent 122 237 0 0 0 0 0\n"
-"MouseMoveEvent 120 231 0 0 0 0 0\n"
-"RenderEvent 120 231 0 0 0 0 0\n"
-"InteractionEvent 120 231 0 0 0 0 0\n"
-"MouseMoveEvent 118 225 0 0 0 0 0\n"
-"RenderEvent 118 225 0 0 0 0 0\n"
-"InteractionEvent 118 225 0 0 0 0 0\n"
-"MouseMoveEvent 115 215 0 0 0 0 0\n"
-"RenderEvent 115 215 0 0 0 0 0\n"
-"InteractionEvent 115 215 0 0 0 0 0\n"
-"MouseMoveEvent 114 203 0 0 0 0 0\n"
-"RenderEvent 114 203 0 0 0 0 0\n"
-"InteractionEvent 114 203 0 0 0 0 0\n"
-"MouseMoveEvent 112 193 0 0 0 0 0\n"
-"RenderEvent 112 193 0 0 0 0 0\n"
-"InteractionEvent 112 193 0 0 0 0 0\n"
-"MouseMoveEvent 112 184 0 0 0 0 0\n"
-"RenderEvent 112 184 0 0 0 0 0\n"
-"InteractionEvent 112 184 0 0 0 0 0\n"
-"MouseMoveEvent 112 178 0 0 0 0 0\n"
-"RenderEvent 112 178 0 0 0 0 0\n"
-"InteractionEvent 112 178 0 0 0 0 0\n"
-"MouseMoveEvent 112 173 0 0 0 0 0\n"
-"RenderEvent 112 173 0 0 0 0 0\n"
-"InteractionEvent 112 173 0 0 0 0 0\n"
-"MouseMoveEvent 115 166 0 0 0 0 0\n"
-"RenderEvent 115 166 0 0 0 0 0\n"
-"InteractionEvent 115 166 0 0 0 0 0\n"
-"MouseMoveEvent 116 163 0 0 0 0 0\n"
-"RenderEvent 116 163 0 0 0 0 0\n"
-"InteractionEvent 116 163 0 0 0 0 0\n"
-"MouseMoveEvent 117 160 0 0 0 0 0\n"
-"RenderEvent 117 160 0 0 0 0 0\n"
-"InteractionEvent 117 160 0 0 0 0 0\n"
-"MouseMoveEvent 118 157 0 0 0 0 0\n"
-"RenderEvent 118 157 0 0 0 0 0\n"
-"InteractionEvent 118 157 0 0 0 0 0\n"
-"MouseMoveEvent 120 152 0 0 0 0 0\n"
-"RenderEvent 120 152 0 0 0 0 0\n"
-"InteractionEvent 120 152 0 0 0 0 0\n"
-"MouseMoveEvent 121 148 0 0 0 0 0\n"
-"RenderEvent 121 148 0 0 0 0 0\n"
-"InteractionEvent 121 148 0 0 0 0 0\n"
-"MouseMoveEvent 122 142 0 0 0 0 0\n"
-"RenderEvent 122 142 0 0 0 0 0\n"
-"InteractionEvent 122 142 0 0 0 0 0\n"
-"MouseMoveEvent 123 136 0 0 0 0 0\n"
-"RenderEvent 123 136 0 0 0 0 0\n"
-"InteractionEvent 123 136 0 0 0 0 0\n"
-"MouseMoveEvent 124 131 0 0 0 0 0\n"
-"RenderEvent 124 131 0 0 0 0 0\n"
-"InteractionEvent 124 131 0 0 0 0 0\n"
-"MouseMoveEvent 126 124 0 0 0 0 0\n"
-"RenderEvent 126 124 0 0 0 0 0\n"
-"InteractionEvent 126 124 0 0 0 0 0\n"
-"MouseMoveEvent 127 120 0 0 0 0 0\n"
-"RenderEvent 127 120 0 0 0 0 0\n"
-"InteractionEvent 127 120 0 0 0 0 0\n"
-"MouseMoveEvent 128 119 0 0 0 0 0\n"
-"RenderEvent 128 119 0 0 0 0 0\n"
-"InteractionEvent 128 119 0 0 0 0 0\n"
-"MouseMoveEvent 128 118 0 0 0 0 0\n"
-"RenderEvent 128 118 0 0 0 0 0\n"
-"InteractionEvent 128 118 0 0 0 0 0\n"
-"MouseMoveEvent 130 116 0 0 0 0 0\n"
-"RenderEvent 130 116 0 0 0 0 0\n"
-"InteractionEvent 130 116 0 0 0 0 0\n"
-"MouseMoveEvent 131 115 0 0 0 0 0\n"
-"RenderEvent 131 115 0 0 0 0 0\n"
-"InteractionEvent 131 115 0 0 0 0 0\n"
-"MouseMoveEvent 133 113 0 0 0 0 0\n"
-"RenderEvent 133 113 0 0 0 0 0\n"
-"InteractionEvent 133 113 0 0 0 0 0\n"
-"MouseMoveEvent 135 110 0 0 0 0 0\n"
-"RenderEvent 135 110 0 0 0 0 0\n"
-"InteractionEvent 135 110 0 0 0 0 0\n"
-"MouseMoveEvent 137 108 0 0 0 0 0\n"
-"RenderEvent 137 108 0 0 0 0 0\n"
-"InteractionEvent 137 108 0 0 0 0 0\n"
-"MouseMoveEvent 142 105 0 0 0 0 0\n"
-"RenderEvent 142 105 0 0 0 0 0\n"
-"InteractionEvent 142 105 0 0 0 0 0\n"
-"MouseMoveEvent 147 100 0 0 0 0 0\n"
-"RenderEvent 147 100 0 0 0 0 0\n"
-"InteractionEvent 147 100 0 0 0 0 0\n"
-"MouseMoveEvent 155 94 0 0 0 0 0\n"
-"RenderEvent 155 94 0 0 0 0 0\n"
-"InteractionEvent 155 94 0 0 0 0 0\n"
-"MouseMoveEvent 165 88 0 0 0 0 0\n"
-"RenderEvent 165 88 0 0 0 0 0\n"
-"InteractionEvent 165 88 0 0 0 0 0\n"
-"MouseMoveEvent 178 80 0 0 0 0 0\n"
-"RenderEvent 178 80 0 0 0 0 0\n"
-"InteractionEvent 178 80 0 0 0 0 0\n"
-"MouseMoveEvent 190 73 0 0 0 0 0\n"
-"RenderEvent 190 73 0 0 0 0 0\n"
-"InteractionEvent 190 73 0 0 0 0 0\n"
-"MouseMoveEvent 202 65 0 0 0 0 0\n"
-"RenderEvent 202 65 0 0 0 0 0\n"
-"InteractionEvent 202 65 0 0 0 0 0\n"
-"MouseMoveEvent 213 56 0 0 0 0 0\n"
-"RenderEvent 213 56 0 0 0 0 0\n"
-"InteractionEvent 213 56 0 0 0 0 0\n"
-"MouseMoveEvent 223 53 0 0 0 0 0\n"
-"RenderEvent 223 53 0 0 0 0 0\n"
-"InteractionEvent 223 53 0 0 0 0 0\n"
-"MouseMoveEvent 228 51 0 0 0 0 0\n"
-"RenderEvent 228 51 0 0 0 0 0\n"
-"InteractionEvent 228 51 0 0 0 0 0\n"
-"MouseMoveEvent 233 49 0 0 0 0 0\n"
-"RenderEvent 233 49 0 0 0 0 0\n"
-"InteractionEvent 233 49 0 0 0 0 0\n"
-"MouseMoveEvent 239 46 0 0 0 0 0\n"
-"RenderEvent 239 46 0 0 0 0 0\n"
-"InteractionEvent 239 46 0 0 0 0 0\n"
-"MouseMoveEvent 241 45 0 0 0 0 0\n"
-"RenderEvent 241 45 0 0 0 0 0\n"
-"InteractionEvent 241 45 0 0 0 0 0\n"
-"MouseMoveEvent 242 44 0 0 0 0 0\n"
-"RenderEvent 242 44 0 0 0 0 0\n"
-"InteractionEvent 242 44 0 0 0 0 0\n"
-"MouseMoveEvent 244 43 0 0 0 0 0\n"
-"RenderEvent 244 43 0 0 0 0 0\n"
-"InteractionEvent 244 43 0 0 0 0 0\n"
-"MouseMoveEvent 251 39 0 0 0 0 0\n"
-"RenderEvent 251 39 0 0 0 0 0\n"
-"InteractionEvent 251 39 0 0 0 0 0\n"
-"MouseMoveEvent 254 37 0 0 0 0 0\n"
-"RenderEvent 254 37 0 0 0 0 0\n"
-"InteractionEvent 254 37 0 0 0 0 0\n"
-"MouseMoveEvent 257 34 0 0 0 0 0\n"
-"RenderEvent 257 34 0 0 0 0 0\n"
-"InteractionEvent 257 34 0 0 0 0 0\n"
-"MouseMoveEvent 259 32 0 0 0 0 0\n"
-"RenderEvent 259 32 0 0 0 0 0\n"
-"InteractionEvent 259 32 0 0 0 0 0\n"
-"MouseMoveEvent 260 31 0 0 0 0 0\n"
-"RenderEvent 260 31 0 0 0 0 0\n"
-"InteractionEvent 260 31 0 0 0 0 0\n"
-"MouseMoveEvent 260 30 0 0 0 0 0\n"
-"RenderEvent 260 30 0 0 0 0 0\n"
-"InteractionEvent 260 30 0 0 0 0 0\n"
-"MouseMoveEvent 260 29 0 0 0 0 0\n"
-"RenderEvent 260 29 0 0 0 0 0\n"
-"InteractionEvent 260 29 0 0 0 0 0\n"
-"MouseMoveEvent 260 28 0 0 0 0 0\n"
-"RenderEvent 260 28 0 0 0 0 0\n"
-"InteractionEvent 260 28 0 0 0 0 0\n"
-"MouseMoveEvent 260 26 0 0 0 0 0\n"
-"RenderEvent 260 26 0 0 0 0 0\n"
-"InteractionEvent 260 26 0 0 0 0 0\n"
-"MouseMoveEvent 261 22 0 0 0 0 0\n"
-"RenderEvent 261 22 0 0 0 0 0\n"
-"InteractionEvent 261 22 0 0 0 0 0\n"
-"MouseMoveEvent 261 19 0 0 0 0 0\n"
-"RenderEvent 261 19 0 0 0 0 0\n"
-"InteractionEvent 261 19 0 0 0 0 0\n"
-"MouseMoveEvent 262 16 0 0 0 0 0\n"
-"RenderEvent 262 16 0 0 0 0 0\n"
-"InteractionEvent 262 16 0 0 0 0 0\n"
-"MouseMoveEvent 263 14 0 0 0 0 0\n"
-"RenderEvent 263 14 0 0 0 0 0\n"
-"InteractionEvent 263 14 0 0 0 0 0\n"
-"MouseMoveEvent 264 11 0 0 0 0 0\n"
-"RenderEvent 264 11 0 0 0 0 0\n"
-"InteractionEvent 264 11 0 0 0 0 0\n"
-"MouseMoveEvent 264 10 0 0 0 0 0\n"
-"RenderEvent 264 10 0 0 0 0 0\n"
-"InteractionEvent 264 10 0 0 0 0 0\n"
-"MouseMoveEvent 265 9 0 0 0 0 0\n"
-"RenderEvent 265 9 0 0 0 0 0\n"
-"InteractionEvent 265 9 0 0 0 0 0\n"
-"LeftButtonReleaseEvent 265 9 0 0 0 0 0\n"
-"EndInteractionEvent 265 9 0 0 0 0 0\n"
-"RenderEvent 265 9 0 0 0 0 0\n"
-"MouseMoveEvent 265 10 0 0 0 0 0\n"
-"MouseMoveEvent 265 11 0 0 0 0 0\n"
-"MouseMoveEvent 265 14 0 0 0 0 0\n"
-"MouseMoveEvent 262 17 0 0 0 0 0\n"
-"MouseMoveEvent 257 25 0 0 0 0 0\n"
-"MouseMoveEvent 248 36 0 0 0 0 0\n"
-"MouseMoveEvent 239 47 0 0 0 0 0\n"
-"MouseMoveEvent 228 58 0 0 0 0 0\n"
-"MouseMoveEvent 217 69 0 0 0 0 0\n"
-"MouseMoveEvent 204 80 0 0 0 0 0\n"
-"MouseMoveEvent 191 91 0 0 0 0 0\n"
-"MouseMoveEvent 182 100 0 0 0 0 0\n"
-"MouseMoveEvent 173 109 0 0 0 0 0\n"
-"MouseMoveEvent 166 116 0 0 0 0 0\n"
-"MouseMoveEvent 161 123 0 0 0 0 0\n"
-"MouseMoveEvent 156 129 0 0 0 0 0\n"
-"MouseMoveEvent 154 136 0 0 0 0 0\n"
-"MouseMoveEvent 150 143 0 0 0 0 0\n"
-"MouseMoveEvent 145 152 0 0 0 0 0\n"
-"MouseMoveEvent 140 158 0 0 0 0 0\n"
-"MouseMoveEvent 138 165 0 0 0 0 0\n"
-"MouseMoveEvent 136 169 0 0 0 0 0\n"
-"MouseMoveEvent 135 171 0 0 0 0 0\n"
-"MouseMoveEvent 135 172 0 0 0 0 0\n"
-"MouseWheelForwardEvent 135 172 0 0 0 0 0\n"
-"StartInteractionEvent 135 172 0 0 0 0 0\n"
-"RenderEvent 135 172 0 0 0 0 0\n"
-"EndInteractionEvent 135 172 0 0 0 0 0\n"
-"RenderEvent 135 172 0 0 0 0 0\n"
-"MouseWheelForwardEvent 135 172 0 0 0 1 0\n"
-"StartInteractionEvent 135 172 0 0 0 1 0\n"
-"RenderEvent 135 172 0 0 0 1 0\n"
-"EndInteractionEvent 135 172 0 0 0 1 0\n"
-"RenderEvent 135 172 0 0 0 1 0\n"
-"LeftButtonPressEvent 135 172 0 0 0 0 0\n"
-"StartInteractionEvent 135 172 0 0 0 0 0\n"
-"MouseMoveEvent 136 171 0 0 0 0 0\n"
-"RenderEvent 136 171 0 0 0 0 0\n"
-"InteractionEvent 136 171 0 0 0 0 0\n"
-"MouseMoveEvent 137 171 0 0 0 0 0\n"
-"RenderEvent 137 171 0 0 0 0 0\n"
-"InteractionEvent 137 171 0 0 0 0 0\n"
-"MouseMoveEvent 138 170 0 0 0 0 0\n"
-"RenderEvent 138 170 0 0 0 0 0\n"
-"InteractionEvent 138 170 0 0 0 0 0\n"
-"MouseMoveEvent 139 169 0 0 0 0 0\n"
-"RenderEvent 139 169 0 0 0 0 0\n"
-"InteractionEvent 139 169 0 0 0 0 0\n"
-"MouseMoveEvent 140 168 0 0 0 0 0\n"
-"RenderEvent 140 168 0 0 0 0 0\n"
-"InteractionEvent 140 168 0 0 0 0 0\n"
-"MouseMoveEvent 143 166 0 0 0 0 0\n"
-"RenderEvent 143 166 0 0 0 0 0\n"
-"InteractionEvent 143 166 0 0 0 0 0\n"
-"MouseMoveEvent 147 163 0 0 0 0 0\n"
-"RenderEvent 147 163 0 0 0 0 0\n"
-"InteractionEvent 147 163 0 0 0 0 0\n"
-"MouseMoveEvent 149 161 0 0 0 0 0\n"
-"RenderEvent 149 161 0 0 0 0 0\n"
-"InteractionEvent 149 161 0 0 0 0 0\n"
-"MouseMoveEvent 151 159 0 0 0 0 0\n"
-"RenderEvent 151 159 0 0 0 0 0\n"
-"InteractionEvent 151 159 0 0 0 0 0\n"
-"MouseMoveEvent 152 158 0 0 0 0 0\n"
-"RenderEvent 152 158 0 0 0 0 0\n"
-"InteractionEvent 152 158 0 0 0 0 0\n"
-"MouseMoveEvent 153 157 0 0 0 0 0\n"
-"RenderEvent 153 157 0 0 0 0 0\n"
-"InteractionEvent 153 157 0 0 0 0 0\n"
-"MouseMoveEvent 154 155 0 0 0 0 0\n"
-"RenderEvent 154 155 0 0 0 0 0\n"
-"InteractionEvent 154 155 0 0 0 0 0\n"
-"MouseMoveEvent 156 153 0 0 0 0 0\n"
-"RenderEvent 156 153 0 0 0 0 0\n"
-"InteractionEvent 156 153 0 0 0 0 0\n"
-"MouseMoveEvent 157 152 0 0 0 0 0\n"
-"RenderEvent 157 152 0 0 0 0 0\n"
-"InteractionEvent 157 152 0 0 0 0 0\n"
-"MouseMoveEvent 159 151 0 0 0 0 0\n"
-"RenderEvent 159 151 0 0 0 0 0\n"
-"InteractionEvent 159 151 0 0 0 0 0\n"
-"MouseMoveEvent 163 148 0 0 0 0 0\n"
-"RenderEvent 163 148 0 0 0 0 0\n"
-"InteractionEvent 163 148 0 0 0 0 0\n"
-"MouseMoveEvent 165 146 0 0 0 0 0\n"
-"RenderEvent 165 146 0 0 0 0 0\n"
-"InteractionEvent 165 146 0 0 0 0 0\n"
-"MouseMoveEvent 167 144 0 0 0 0 0\n"
-"RenderEvent 167 144 0 0 0 0 0\n"
-"InteractionEvent 167 144 0 0 0 0 0\n"
-"MouseMoveEvent 168 143 0 0 0 0 0\n"
-"RenderEvent 168 143 0 0 0 0 0\n"
-"InteractionEvent 168 143 0 0 0 0 0\n"
-"MouseMoveEvent 169 142 0 0 0 0 0\n"
-"RenderEvent 169 142 0 0 0 0 0\n"
-"InteractionEvent 169 142 0 0 0 0 0\n"
-"MouseMoveEvent 170 141 0 0 0 0 0\n"
-"RenderEvent 170 141 0 0 0 0 0\n"
-"InteractionEvent 170 141 0 0 0 0 0\n"
-"MouseMoveEvent 169 140 0 0 0 0 0\n"
-"RenderEvent 169 140 0 0 0 0 0\n"
-"InteractionEvent 169 140 0 0 0 0 0\n"
-"MouseMoveEvent 168 140 0 0 0 0 0\n"
-"RenderEvent 168 140 0 0 0 0 0\n"
-"InteractionEvent 168 140 0 0 0 0 0\n"
-"MouseMoveEvent 167 140 0 0 0 0 0\n"
-"RenderEvent 167 140 0 0 0 0 0\n"
-"InteractionEvent 167 140 0 0 0 0 0\n"
-"MouseMoveEvent 165 140 0 0 0 0 0\n"
-"RenderEvent 165 140 0 0 0 0 0\n"
-"InteractionEvent 165 140 0 0 0 0 0\n"
-"MouseMoveEvent 164 140 0 0 0 0 0\n"
-"RenderEvent 164 140 0 0 0 0 0\n"
-"InteractionEvent 164 140 0 0 0 0 0\n"
-"MouseMoveEvent 163 140 0 0 0 0 0\n"
-"RenderEvent 163 140 0 0 0 0 0\n"
-"InteractionEvent 163 140 0 0 0 0 0\n"
-"MouseMoveEvent 161 142 0 0 0 0 0\n"
-"RenderEvent 161 142 0 0 0 0 0\n"
-"InteractionEvent 161 142 0 0 0 0 0\n"
-"MouseMoveEvent 159 144 0 0 0 0 0\n"
-"RenderEvent 159 144 0 0 0 0 0\n"
-"InteractionEvent 159 144 0 0 0 0 0\n"
-"MouseMoveEvent 157 146 0 0 0 0 0\n"
-"RenderEvent 157 146 0 0 0 0 0\n"
-"InteractionEvent 157 146 0 0 0 0 0\n"
-"MouseMoveEvent 156 147 0 0 0 0 0\n"
-"RenderEvent 156 147 0 0 0 0 0\n"
-"InteractionEvent 156 147 0 0 0 0 0\n"
-"MouseMoveEvent 156 148 0 0 0 0 0\n"
-"RenderEvent 156 148 0 0 0 0 0\n"
-"InteractionEvent 156 148 0 0 0 0 0\n"
-"MouseMoveEvent 157 149 0 0 0 0 0\n"
-"RenderEvent 157 149 0 0 0 0 0\n"
-"InteractionEvent 157 149 0 0 0 0 0\n"
-"LeftButtonReleaseEvent 157 149 0 0 0 0 0\n"
-"EndInteractionEvent 157 149 0 0 0 0 0\n"
-"RenderEvent 157 149 0 0 0 0 0\n"
-"LeftButtonPressEvent 157 149 0 0 0 0 0\n"
-"StartInteractionEvent 157 149 0 0 0 0 0\n"
-"MouseMoveEvent 156 148 0 0 0 0 0\n"
-"RenderEvent 156 148 0 0 0 0 0\n"
-"InteractionEvent 156 148 0 0 0 0 0\n"
-"MouseMoveEvent 155 147 0 0 0 0 0\n"
-"RenderEvent 155 147 0 0 0 0 0\n"
-"InteractionEvent 155 147 0 0 0 0 0\n"
-"MouseMoveEvent 154 146 0 0 0 0 0\n"
-"RenderEvent 154 146 0 0 0 0 0\n"
-"InteractionEvent 154 146 0 0 0 0 0\n"
-"MouseMoveEvent 153 145 0 0 0 0 0\n"
-"RenderEvent 153 145 0 0 0 0 0\n"
-"InteractionEvent 153 145 0 0 0 0 0\n"
-"MouseMoveEvent 151 142 0 0 0 0 0\n"
-"RenderEvent 151 142 0 0 0 0 0\n"
-"InteractionEvent 151 142 0 0 0 0 0\n"
-"MouseMoveEvent 150 140 0 0 0 0 0\n"
-"RenderEvent 150 140 0 0 0 0 0\n"
-"InteractionEvent 150 140 0 0 0 0 0\n"
-"MouseMoveEvent 149 139 0 0 0 0 0\n"
-"RenderEvent 149 139 0 0 0 0 0\n"
-"InteractionEvent 149 139 0 0 0 0 0\n"
-"MouseMoveEvent 148 138 0 0 0 0 0\n"
-"RenderEvent 148 138 0 0 0 0 0\n"
-"InteractionEvent 148 138 0 0 0 0 0\n"
-"MouseMoveEvent 147 137 0 0 0 0 0\n"
-"RenderEvent 147 137 0 0 0 0 0\n"
-"InteractionEvent 147 137 0 0 0 0 0\n"
-"LeftButtonReleaseEvent 147 137 0 0 0 0 0\n"
-"EndInteractionEvent 147 137 0 0 0 0 0\n"
-"RenderEvent 147 137 0 0 0 0 0\n"
-"MouseMoveEvent 149 140 0 0 0 0 0\n"
-"MouseMoveEvent 150 141 0 0 0 0 0\n"
-"MouseMoveEvent 152 143 0 0 0 0 0\n"
-"MouseMoveEvent 153 144 0 0 0 0 0\n"
-"MouseMoveEvent 154 145 0 0 0 0 0\n"
-"MouseMoveEvent 156 147 0 0 0 0 0\n"
-"MouseMoveEvent 157 148 0 0 0 0 0\n"
-"MouseMoveEvent 159 149 0 0 0 0 0\n"
-"MouseMoveEvent 160 150 0 0 0 0 0\n"
-"MouseMoveEvent 162 151 0 0 0 0 0\n"
-"MouseMoveEvent 163 152 0 0 0 0 0\n"
-"MouseMoveEvent 164 153 0 0 0 0 0\n"
-"MouseMoveEvent 165 154 0 0 0 0 0\n"
-"MouseMoveEvent 167 156 0 0 0 0 0\n"
-"MouseMoveEvent 168 157 0 0 0 0 0\n"
-"MouseMoveEvent 169 158 0 0 0 0 0\n"
-"MouseMoveEvent 170 159 0 0 0 0 0\n"
-"MouseMoveEvent 171 161 0 0 0 0 0\n"
-"MouseMoveEvent 172 162 0 0 0 0 0\n"
-"MouseMoveEvent 173 163 0 0 0 0 0\n"
-"MouseMoveEvent 174 164 0 0 0 0 0\n"
-"MouseMoveEvent 175 166 0 0 0 0 0\n"
-"MouseMoveEvent 176 167 0 0 0 0 0\n"
-"MouseMoveEvent 175 165 0 0 0 0 0\n"
-"MouseMoveEvent 174 164 0 0 0 0 0\n"
-"MouseMoveEvent 173 161 0 0 0 0 0\n"
-"MouseMoveEvent 172 159 0 0 0 0 0\n"
-"MouseMoveEvent 170 157 0 0 0 0 0\n"
-"MouseMoveEvent 169 157 0 0 0 0 0\n"
-"MouseMoveEvent 168 156 0 0 0 0 0\n"
-"MouseMoveEvent 166 155 0 0 0 0 0\n"
-"MouseMoveEvent 164 154 0 0 0 0 0\n"
-"MouseMoveEvent 163 154 0 0 0 0 0\n"
-"MouseMoveEvent 161 154 0 0 0 0 0\n"
-"MouseMoveEvent 158 154 0 0 0 0 0\n"
-"MouseMoveEvent 155 154 0 0 0 0 0\n"
-"MouseMoveEvent 152 154 0 0 0 0 0\n"
-"MouseMoveEvent 150 155 0 0 0 0 0\n"
-"MouseMoveEvent 149 155 0 0 0 0 0\n"
-"MouseMoveEvent 148 156 0 0 0 0 0\n"
-"MouseMoveEvent 146 156 0 0 0 0 0\n"
-"MouseMoveEvent 145 157 0 0 0 0 0\n"
-"MouseMoveEvent 144 159 0 0 0 0 0\n"
-"MouseMoveEvent 143 160 0 0 0 0 0\n"
-"MouseMoveEvent 142 162 0 0 0 0 0\n"
-"MouseMoveEvent 142 163 0 0 0 0 0\n"
-"MouseMoveEvent 141 164 0 0 0 0 0\n"
-"MouseMoveEvent 142 165 0 0 0 0 0\n"
-"MouseMoveEvent 144 165 0 0 0 0 0\n"
-"MouseMoveEvent 145 165 0 0 0 0 0\n"
-"MouseMoveEvent 147 166 0 0 0 0 0\n"
-"MouseMoveEvent 150 166 0 0 0 0 0\n"
-"MouseMoveEvent 153 166 0 0 0 0 0\n"
-"MouseMoveEvent 158 166 0 0 0 0 0\n"
-"MouseMoveEvent 165 166 0 0 0 0 0\n"
-"MouseMoveEvent 168 166 0 0 0 0 0\n"
-"MouseMoveEvent 171 166 0 0 0 0 0\n"
-"MouseMoveEvent 174 166 0 0 0 0 0\n"
-"MouseMoveEvent 176 166 0 0 0 0 0\n"
-"MouseMoveEvent 177 166 0 0 0 0 0\n"
-"MouseMoveEvent 178 166 0 0 0 0 0\n"
-"MouseMoveEvent 180 166 0 0 0 0 0\n"
-"MouseMoveEvent 182 166 0 0 0 0 0\n"
-"MouseMoveEvent 183 166 0 0 0 0 0\n"
-"MouseMoveEvent 185 166 0 0 0 0 0\n"
-"MouseMoveEvent 186 166 0 0 0 0 0\n"
-"MouseMoveEvent 187 166 0 0 0 0 0\n"
-"MouseMoveEvent 190 167 0 0 0 0 0\n"
-"MouseMoveEvent 191 168 0 0 0 0 0\n"
-"MouseMoveEvent 192 169 0 0 0 0 0\n"
-"MouseMoveEvent 193 170 0 0 0 0 0\n"
-"MouseMoveEvent 193 171 0 0 0 0 0\n"
-"MouseMoveEvent 193 173 0 0 0 0 0\n"
-"MouseMoveEvent 194 175 0 0 0 0 0\n"
-"MouseMoveEvent 195 177 0 0 0 0 0\n"
-"MouseMoveEvent 196 180 0 0 0 0 0\n"
-"MouseMoveEvent 198 184 0 0 0 0 0\n"
-"MouseMoveEvent 200 189 0 0 0 0 0\n"
-"MouseMoveEvent 203 196 0 0 0 0 0\n"
-"MouseMoveEvent 207 203 0 0 0 0 0\n"
-"MouseMoveEvent 211 210 0 0 0 0 0\n"
-"MouseMoveEvent 215 217 0 0 0 0 0\n"
-"MouseMoveEvent 219 223 0 0 0 0 0\n"
-"MouseMoveEvent 220 228 0 0 0 0 0\n"
-"MouseMoveEvent 223 234 0 0 0 0 0\n"
-"MouseMoveEvent 225 239 0 0 0 0 0\n"
-"MouseMoveEvent 227 245 0 0 0 0 0\n"
-"MouseMoveEvent 228 250 0 0 0 0 0\n"
-"MouseMoveEvent 230 256 0 0 0 0 0\n"
-"MouseMoveEvent 232 260 0 0 0 0 0\n"
-"MouseMoveEvent 232 265 0 0 0 0 0\n"
-"MouseMoveEvent 233 269 0 0 0 0 0\n"
-"MouseMoveEvent 235 270 0 0 0 0 0\n"
-"MouseMoveEvent 235 271 0 0 0 0 0\n"
-"MouseMoveEvent 235 272 0 0 0 0 0\n"
-"MouseMoveEvent 235 273 0 0 0 0 0\n"
-"MouseMoveEvent 235 274 0 0 0 0 0\n"
-"MouseMoveEvent 236 276 0 0 0 0 0\n"
-"MouseMoveEvent 236 277 0 0 0 0 0\n"
-"MouseMoveEvent 237 278 0 0 0 0 0\n"
-"MouseMoveEvent 237 279 0 0 0 0 0\n"
-"MouseMoveEvent 238 281 0 0 0 0 0\n"
-"MouseMoveEvent 239 282 0 0 0 0 0\n"
-"MouseMoveEvent 240 283 0 0 0 0 0\n"
-"MouseMoveEvent 240 284 0 0 0 0 0\n"
-"MouseMoveEvent 241 285 0 0 0 0 0\n"
-"MouseMoveEvent 242 286 0 0 0 0 0\n"
-"MouseMoveEvent 243 288 0 0 0 0 0\n"
-"MouseMoveEvent 244 289 0 0 0 0 0\n"
-"MouseMoveEvent 245 290 0 0 0 0 0\n"
-"MouseMoveEvent 246 292 0 0 0 0 0\n"
-"MouseMoveEvent 247 293 0 0 0 0 0\n"
-"MouseMoveEvent 248 294 0 0 0 0 0\n"
-"MouseMoveEvent 249 295 0 0 0 0 0\n"
-"MouseMoveEvent 250 297 0 0 0 0 0\n"
-"MouseMoveEvent 251 299 0 0 0 0 0\n"
-"LeaveEvent 252 300 0 0 0 0 0\n"
-"ExitEvent 252 300 0 0 0 0 0\n"
-;
-
-int TestGPURayCastTwoComponentsDependent(int argc, char *argv[])
-{
-  cout << "CTEST_FULL_OUTPUT (Avoid ctest truncation of output)" << endl;
-
-  int dims[3] = {25, 25, 25};
-
-  // Create a vtkImageData with two components
-  vtkNew<vtkImageData> image;
-  image->SetDimensions(dims[0], dims[1], dims[2]);
-  image->AllocateScalars(VTK_FLOAT, 2);
-
-  // Fill the first half rectangular parallelopiped along X with the
-  // first component values and the second half with second component values
-  float * ptr = static_cast<float *> (image->GetScalarPointer(0, 0, 0));
-
-
-  for (int z = 0; z < dims[2]; ++z)
-    {
-    for (int y = 0; y < dims[1]; ++y)
-      {
-      for (int x = 0; x < dims[0]; ++x)
-        {
-        double itr = floor(x / 5.0);
-        *ptr++ = itr;
-        *ptr++ = itr / 5.0;
-        }
-      }
-    }
-
-  vtkNew<vtkRenderWindow> renWin;
-  renWin->SetSize(301, 300); // Intentional NPOT size
-  renWin->SetMultiSamples(0);
-
-  vtkNew<vtkRenderer> ren;
-  renWin->AddRenderer(ren.GetPointer());
-
-  vtkNew<vtkRenderWindowInteractor> iren;
-  vtkNew<vtkInteractorStyleTrackballCamera> style;
-  iren->SetInteractorStyle(style.GetPointer());
-  iren->SetRenderWindow(renWin.GetPointer());
-
-  renWin->Render();
-
-  // Volume render the dataset
-  vtkNew<vtkGPUVolumeRayCastMapper> mapper;
-  mapper->AutoAdjustSampleDistancesOff();
-  mapper->SetSampleDistance(0.9);
-  mapper->SetInputData(image.GetPointer());
-
-  // Color transfer function
-  vtkNew<vtkColorTransferFunction> ctf;
-  ctf->AddRGBPoint(0.0, 1.0, 0.0, 0.0);
-  ctf->AddRGBPoint(1.0, 1.0, 1.0, 0.0);
-  ctf->AddRGBPoint(2.0, 1.0, 1.0, 1.0);
-  ctf->AddRGBPoint(3.0, 0.0, 1.0, 1.0);
-  ctf->AddRGBPoint(4.0, 0.0, 0.0, 1.0);
-
-  // Opacity functions
-  vtkNew<vtkPiecewiseFunction> pf;
-  pf->AddPoint(0.0, 0.1);
-  pf->AddPoint(0.2, 1.0);
-  pf->AddPoint(0.4, 0.1);
-  pf->AddPoint(0.6, 1.0);
-  pf->AddPoint(0.8, 0.1);
-
-  // Volume property with independent components ON
-  vtkNew<vtkVolumeProperty> property;
-  property->IndependentComponentsOff();
-  property->SetInterpolationTypeToLinear();
-
-  // Set color and opacity functions
-  property->SetColor(ctf.GetPointer());
-  property->SetScalarOpacity(pf.GetPointer());
-
-  vtkNew<vtkVolume> volume;
-  volume->SetMapper(mapper.GetPointer());
-  volume->SetProperty(property.GetPointer());
-  ren->AddVolume(volume.GetPointer());
-
-  ren->ResetCamera();
-
-  iren->Initialize();
-  renWin->Render();
-
-  return vtkTesting::InteractorEventLoop(argc, argv,
-                                         iren.GetPointer(),
-                                         TestGPURayCastTwoComponentsDependentLog);
-}
diff --git a/Rendering/Volume/Testing/Cxx/TestGPURayCastTwoComponentsIndependent.cxx b/Rendering/Volume/Testing/Cxx/TestGPURayCastTwoComponentsIndependent.cxx
deleted file mode 100644
index ca4d85b..0000000
--- a/Rendering/Volume/Testing/Cxx/TestGPURayCastTwoComponentsIndependent.cxx
+++ /dev/null
@@ -1,631 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    TestGPURayCastTwoComponentsIndependent.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.
-
-=========================================================================*/
-
-// Description
-// This test creates a vtkImageData with two components.
-// The data is volume rendered considering the two components as independent.
-
-#include "vtkCamera.h"
-#include "vtkColorTransferFunction.h"
-#include "vtkGPUVolumeRayCastMapper.h"
-#include "vtkImageData.h"
-#include "vtkInteractorStyleTrackballCamera.h"
-#include "vtkNew.h"
-#include "vtkPiecewiseFunction.h"
-#include "vtkRenderer.h"
-#include "vtkRenderWindow.h"
-#include "vtkRenderWindowInteractor.h"
-#include "vtkTesting.h"
-#include "vtkTestUtilities.h"
-#include "vtkVolume.h"
-#include "vtkVolumeProperty.h"
-
-static const char * TestGPURayCastTwoComponentsIndependentLog =
-"# StreamVersion 1\n"
-"EnterEvent 298 198 0 0 0 0 0\n"
-"MouseMoveEvent 298 198 0 0 0 0 0\n"
-"MouseMoveEvent 292 200 0 0 0 0 0\n"
-"MouseMoveEvent 285 200 0 0 0 0 0\n"
-"MouseMoveEvent 281 202 0 0 0 0 0\n"
-"MouseMoveEvent 277 202 0 0 0 0 0\n"
-"MouseMoveEvent 274 203 0 0 0 0 0\n"
-"MouseMoveEvent 270 205 0 0 0 0 0\n"
-"MouseMoveEvent 266 205 0 0 0 0 0\n"
-"MouseMoveEvent 262 205 0 0 0 0 0\n"
-"MouseMoveEvent 260 205 0 0 0 0 0\n"
-"MouseMoveEvent 258 206 0 0 0 0 0\n"
-"MouseMoveEvent 255 206 0 0 0 0 0\n"
-"MouseMoveEvent 253 207 0 0 0 0 0\n"
-"MouseMoveEvent 251 207 0 0 0 0 0\n"
-"MouseMoveEvent 250 207 0 0 0 0 0\n"
-"MouseMoveEvent 248 207 0 0 0 0 0\n"
-"MouseMoveEvent 244 207 0 0 0 0 0\n"
-"MouseMoveEvent 237 208 0 0 0 0 0\n"
-"MouseMoveEvent 232 210 0 0 0 0 0\n"
-"MouseMoveEvent 226 210 0 0 0 0 0\n"
-"MouseMoveEvent 222 211 0 0 0 0 0\n"
-"MouseMoveEvent 220 211 0 0 0 0 0\n"
-"MouseMoveEvent 219 212 0 0 0 0 0\n"
-"MouseMoveEvent 216 212 0 0 0 0 0\n"
-"MouseMoveEvent 215 213 0 0 0 0 0\n"
-"MouseMoveEvent 213 213 0 0 0 0 0\n"
-"MouseMoveEvent 211 214 0 0 0 0 0\n"
-"MouseMoveEvent 210 214 0 0 0 0 0\n"
-"MouseMoveEvent 207 216 0 0 0 0 0\n"
-"MouseMoveEvent 206 217 0 0 0 0 0\n"
-"MouseMoveEvent 205 218 0 0 0 0 0\n"
-"MouseMoveEvent 203 220 0 0 0 0 0\n"
-"MouseMoveEvent 200 222 0 0 0 0 0\n"
-"MouseMoveEvent 197 224 0 0 0 0 0\n"
-"MouseMoveEvent 194 226 0 0 0 0 0\n"
-"MouseMoveEvent 193 227 0 0 0 0 0\n"
-"MouseMoveEvent 191 228 0 0 0 0 0\n"
-"MouseMoveEvent 190 229 0 0 0 0 0\n"
-"MouseMoveEvent 188 231 0 0 0 0 0\n"
-"MouseMoveEvent 187 232 0 0 0 0 0\n"
-"MouseMoveEvent 186 233 0 0 0 0 0\n"
-"MouseMoveEvent 185 234 0 0 0 0 0\n"
-"MouseMoveEvent 184 235 0 0 0 0 0\n"
-"MouseMoveEvent 184 236 0 0 0 0 0\n"
-"MouseMoveEvent 183 237 0 0 0 0 0\n"
-"MouseMoveEvent 182 238 0 0 0 0 0\n"
-"MouseMoveEvent 181 239 0 0 0 0 0\n"
-"MouseMoveEvent 179 240 0 0 0 0 0\n"
-"MouseMoveEvent 176 240 0 0 0 0 0\n"
-"MouseMoveEvent 174 241 0 0 0 0 0\n"
-"MouseMoveEvent 172 241 0 0 0 0 0\n"
-"MouseMoveEvent 170 242 0 0 0 0 0\n"
-"MouseMoveEvent 168 242 0 0 0 0 0\n"
-"MouseMoveEvent 166 242 0 0 0 0 0\n"
-"MouseMoveEvent 165 242 0 0 0 0 0\n"
-"MouseMoveEvent 164 242 0 0 0 0 0\n"
-"MouseMoveEvent 160 242 0 0 0 0 0\n"
-"MouseMoveEvent 156 242 0 0 0 0 0\n"
-"MouseMoveEvent 153 242 0 0 0 0 0\n"
-"MouseMoveEvent 150 242 0 0 0 0 0\n"
-"MouseMoveEvent 148 242 0 0 0 0 0\n"
-"MouseMoveEvent 147 242 0 0 0 0 0\n"
-"MouseMoveEvent 146 242 0 0 0 0 0\n"
-"MouseMoveEvent 144 242 0 0 0 0 0\n"
-"MouseMoveEvent 143 242 0 0 0 0 0\n"
-"MouseMoveEvent 142 242 0 0 0 0 0\n"
-"MouseMoveEvent 141 242 0 0 0 0 0\n"
-"MouseMoveEvent 140 242 0 0 0 0 0\n"
-"MouseMoveEvent 139 242 0 0 0 0 0\n"
-"MouseMoveEvent 138 242 0 0 0 0 0\n"
-"MouseMoveEvent 137 242 0 0 0 0 0\n"
-"LeftButtonPressEvent 137 242 0 0 0 0 0\n"
-"StartInteractionEvent 137 242 0 0 0 0 0\n"
-"TimerEvent 137 242 0 0 0 0 0\n"
-"RenderEvent 137 242 0 0 0 0 0\n"
-"TimerEvent 137 242 0 0 0 0 0\n"
-"RenderEvent 137 242 0 0 0 0 0\n"
-"TimerEvent 137 242 0 0 0 0 0\n"
-"RenderEvent 137 242 0 0 0 0 0\n"
-"TimerEvent 137 242 0 0 0 0 0\n"
-"RenderEvent 137 242 0 0 0 0 0\n"
-"TimerEvent 137 242 0 0 0 0 0\n"
-"RenderEvent 137 242 0 0 0 0 0\n"
-"TimerEvent 137 242 0 0 0 0 0\n"
-"RenderEvent 137 242 0 0 0 0 0\n"
-"TimerEvent 137 242 0 0 0 0 0\n"
-"RenderEvent 137 242 0 0 0 0 0\n"
-"TimerEvent 137 242 0 0 0 0 0\n"
-"RenderEvent 137 242 0 0 0 0 0\n"
-"TimerEvent 137 242 0 0 0 0 0\n"
-"RenderEvent 137 242 0 0 0 0 0\n"
-"TimerEvent 137 242 0 0 0 0 0\n"
-"RenderEvent 137 242 0 0 0 0 0\n"
-"TimerEvent 137 242 0 0 0 0 0\n"
-"RenderEvent 137 242 0 0 0 0 0\n"
-"TimerEvent 137 242 0 0 0 0 0\n"
-"RenderEvent 137 242 0 0 0 0 0\n"
-"TimerEvent 137 242 0 0 0 0 0\n"
-"RenderEvent 137 242 0 0 0 0 0\n"
-"MouseMoveEvent 136 241 0 0 0 0 0\n"
-"InteractionEvent 136 241 0 0 0 0 0\n"
-"TimerEvent 136 241 0 0 0 0 0\n"
-"RenderEvent 136 241 0 0 0 0 0\n"
-"MouseMoveEvent 136 240 0 0 0 0 0\n"
-"InteractionEvent 136 240 0 0 0 0 0\n"
-"MouseMoveEvent 136 239 0 0 0 0 0\n"
-"InteractionEvent 136 239 0 0 0 0 0\n"
-"TimerEvent 136 239 0 0 0 0 0\n"
-"RenderEvent 136 239 0 0 0 0 0\n"
-"MouseMoveEvent 136 238 0 0 0 0 0\n"
-"InteractionEvent 136 238 0 0 0 0 0\n"
-"MouseMoveEvent 136 237 0 0 0 0 0\n"
-"InteractionEvent 136 237 0 0 0 0 0\n"
-"TimerEvent 136 237 0 0 0 0 0\n"
-"RenderEvent 136 237 0 0 0 0 0\n"
-"MouseMoveEvent 136 236 0 0 0 0 0\n"
-"InteractionEvent 136 236 0 0 0 0 0\n"
-"MouseMoveEvent 136 235 0 0 0 0 0\n"
-"InteractionEvent 136 235 0 0 0 0 0\n"
-"TimerEvent 136 235 0 0 0 0 0\n"
-"RenderEvent 136 235 0 0 0 0 0\n"
-"MouseMoveEvent 136 234 0 0 0 0 0\n"
-"InteractionEvent 136 234 0 0 0 0 0\n"
-"TimerEvent 136 234 0 0 0 0 0\n"
-"RenderEvent 136 234 0 0 0 0 0\n"
-"MouseMoveEvent 136 233 0 0 0 0 0\n"
-"InteractionEvent 136 233 0 0 0 0 0\n"
-"MouseMoveEvent 136 232 0 0 0 0 0\n"
-"InteractionEvent 136 232 0 0 0 0 0\n"
-"TimerEvent 136 232 0 0 0 0 0\n"
-"RenderEvent 136 232 0 0 0 0 0\n"
-"MouseMoveEvent 136 231 0 0 0 0 0\n"
-"InteractionEvent 136 231 0 0 0 0 0\n"
-"MouseMoveEvent 136 230 0 0 0 0 0\n"
-"InteractionEvent 136 230 0 0 0 0 0\n"
-"TimerEvent 136 230 0 0 0 0 0\n"
-"RenderEvent 136 230 0 0 0 0 0\n"
-"TimerEvent 136 230 0 0 0 0 0\n"
-"RenderEvent 136 230 0 0 0 0 0\n"
-"TimerEvent 136 230 0 0 0 0 0\n"
-"RenderEvent 136 230 0 0 0 0 0\n"
-"TimerEvent 136 230 0 0 0 0 0\n"
-"RenderEvent 136 230 0 0 0 0 0\n"
-"TimerEvent 136 230 0 0 0 0 0\n"
-"RenderEvent 136 230 0 0 0 0 0\n"
-"TimerEvent 136 230 0 0 0 0 0\n"
-"RenderEvent 136 230 0 0 0 0 0\n"
-"TimerEvent 136 230 0 0 0 0 0\n"
-"RenderEvent 136 230 0 0 0 0 0\n"
-"LeftButtonReleaseEvent 136 230 0 0 0 0 0\n"
-"EndInteractionEvent 136 230 0 0 0 0 0\n"
-"RenderEvent 136 230 0 0 0 0 0\n"
-"MouseMoveEvent 136 228 0 0 0 0 0\n"
-"MouseMoveEvent 136 226 0 0 0 0 0\n"
-"MouseMoveEvent 136 224 0 0 0 0 0\n"
-"MouseMoveEvent 136 222 0 0 0 0 0\n"
-"MouseMoveEvent 136 220 0 0 0 0 0\n"
-"MouseMoveEvent 136 218 0 0 0 0 0\n"
-"MouseMoveEvent 136 216 0 0 0 0 0\n"
-"MouseMoveEvent 136 213 0 0 0 0 0\n"
-"MouseMoveEvent 136 210 0 0 0 0 0\n"
-"MouseMoveEvent 136 207 0 0 0 0 0\n"
-"MouseMoveEvent 136 204 0 0 0 0 0\n"
-"MouseMoveEvent 137 201 0 0 0 0 0\n"
-"MouseMoveEvent 138 198 0 0 0 0 0\n"
-"MouseMoveEvent 139 196 0 0 0 0 0\n"
-"MouseMoveEvent 139 194 0 0 0 0 0\n"
-"MouseMoveEvent 140 191 0 0 0 0 0\n"
-"MouseMoveEvent 142 187 0 0 0 0 0\n"
-"MouseMoveEvent 142 184 0 0 0 0 0\n"
-"MouseMoveEvent 144 181 0 0 0 0 0\n"
-"MouseMoveEvent 145 177 0 0 0 0 0\n"
-"MouseMoveEvent 148 173 0 0 0 0 0\n"
-"MouseMoveEvent 151 169 0 0 0 0 0\n"
-"MouseMoveEvent 156 164 0 0 0 0 0\n"
-"MouseMoveEvent 162 158 0 0 0 0 0\n"
-"MouseMoveEvent 166 153 0 0 0 0 0\n"
-"MouseMoveEvent 170 149 0 0 0 0 0\n"
-"MouseMoveEvent 174 145 0 0 0 0 0\n"
-"MouseMoveEvent 178 143 0 0 0 0 0\n"
-"MouseMoveEvent 184 142 0 0 0 0 0\n"
-"MouseMoveEvent 188 140 0 0 0 0 0\n"
-"MouseMoveEvent 193 139 0 0 0 0 0\n"
-"MouseMoveEvent 197 139 0 0 0 0 0\n"
-"MouseMoveEvent 201 137 0 0 0 0 0\n"
-"MouseMoveEvent 202 137 0 0 0 0 0\n"
-"MouseMoveEvent 204 137 0 0 0 0 0\n"
-"MouseMoveEvent 205 137 0 0 0 0 0\n"
-"MouseMoveEvent 206 137 0 0 0 0 0\n"
-"MouseMoveEvent 209 136 0 0 0 0 0\n"
-"MouseMoveEvent 211 136 0 0 0 0 0\n"
-"MouseMoveEvent 212 136 0 0 0 0 0\n"
-"MouseMoveEvent 213 135 0 0 0 0 0\n"
-"MouseMoveEvent 214 135 0 0 0 0 0\n"
-"MouseMoveEvent 215 134 0 0 0 0 0\n"
-"MouseMoveEvent 216 133 0 0 0 0 0\n"
-"LeftButtonPressEvent 216 133 0 0 0 0 0\n"
-"StartInteractionEvent 216 133 0 0 0 0 0\n"
-"TimerEvent 216 133 0 0 0 0 0\n"
-"RenderEvent 216 133 0 0 0 0 0\n"
-"MouseMoveEvent 219 132 0 0 0 0 0\n"
-"InteractionEvent 219 132 0 0 0 0 0\n"
-"MouseMoveEvent 220 131 0 0 0 0 0\n"
-"InteractionEvent 220 131 0 0 0 0 0\n"
-"TimerEvent 220 131 0 0 0 0 0\n"
-"RenderEvent 220 131 0 0 0 0 0\n"
-"MouseMoveEvent 221 130 0 0 0 0 0\n"
-"InteractionEvent 221 130 0 0 0 0 0\n"
-"MouseMoveEvent 222 129 0 0 0 0 0\n"
-"InteractionEvent 222 129 0 0 0 0 0\n"
-"TimerEvent 222 129 0 0 0 0 0\n"
-"RenderEvent 222 129 0 0 0 0 0\n"
-"MouseMoveEvent 223 128 0 0 0 0 0\n"
-"InteractionEvent 223 128 0 0 0 0 0\n"
-"TimerEvent 223 128 0 0 0 0 0\n"
-"RenderEvent 223 128 0 0 0 0 0\n"
-"TimerEvent 223 128 0 0 0 0 0\n"
-"RenderEvent 223 128 0 0 0 0 0\n"
-"TimerEvent 223 128 0 0 0 0 0\n"
-"RenderEvent 223 128 0 0 0 0 0\n"
-"TimerEvent 223 128 0 0 0 0 0\n"
-"RenderEvent 223 128 0 0 0 0 0\n"
-"TimerEvent 223 128 0 0 0 0 0\n"
-"RenderEvent 223 128 0 0 0 0 0\n"
-"LeftButtonReleaseEvent 223 128 0 0 0 0 0\n"
-"EndInteractionEvent 223 128 0 0 0 0 0\n"
-"RenderEvent 223 128 0 0 0 0 0\n"
-"MouseMoveEvent 224 126 0 0 0 0 0\n"
-"MouseMoveEvent 225 125 0 0 0 0 0\n"
-"MouseMoveEvent 226 123 0 0 0 0 0\n"
-"MouseMoveEvent 227 122 0 0 0 0 0\n"
-"MouseMoveEvent 228 121 0 0 0 0 0\n"
-"MouseMoveEvent 229 120 0 0 0 0 0\n"
-"MouseMoveEvent 230 119 0 0 0 0 0\n"
-"MouseMoveEvent 231 118 0 0 0 0 0\n"
-"MouseMoveEvent 232 117 0 0 0 0 0\n"
-"MouseMoveEvent 233 116 0 0 0 0 0\n"
-"MouseMoveEvent 233 115 0 0 0 0 0\n"
-"MouseMoveEvent 234 114 0 0 0 0 0\n"
-"MouseMoveEvent 234 113 0 0 0 0 0\n"
-"MouseMoveEvent 234 112 0 0 0 0 0\n"
-"MouseMoveEvent 234 111 0 0 0 0 0\n"
-"MouseMoveEvent 234 110 0 0 0 0 0\n"
-"MouseMoveEvent 233 108 0 0 0 0 0\n"
-"MouseMoveEvent 231 107 0 0 0 0 0\n"
-"MouseMoveEvent 229 106 0 0 0 0 0\n"
-"MouseMoveEvent 226 105 0 0 0 0 0\n"
-"MouseMoveEvent 223 105 0 0 0 0 0\n"
-"MouseMoveEvent 220 104 0 0 0 0 0\n"
-"MouseMoveEvent 216 103 0 0 0 0 0\n"
-"MouseMoveEvent 209 101 0 0 0 0 0\n"
-"MouseMoveEvent 202 99 0 0 0 0 0\n"
-"MouseMoveEvent 195 98 0 0 0 0 0\n"
-"MouseMoveEvent 188 96 0 0 0 0 0\n"
-"MouseMoveEvent 179 94 0 0 0 0 0\n"
-"MouseMoveEvent 168 93 0 0 0 0 0\n"
-"MouseMoveEvent 156 91 0 0 0 0 0\n"
-"MouseMoveEvent 144 89 0 0 0 0 0\n"
-"MouseMoveEvent 135 87 0 0 0 0 0\n"
-"MouseMoveEvent 127 86 0 0 0 0 0\n"
-"MouseMoveEvent 120 86 0 0 0 0 0\n"
-"MouseMoveEvent 116 84 0 0 0 0 0\n"
-"MouseMoveEvent 115 84 0 0 0 0 0\n"
-"MouseMoveEvent 114 83 0 0 0 0 0\n"
-"LeftButtonPressEvent 114 83 0 0 0 0 0\n"
-"StartInteractionEvent 114 83 0 0 0 0 0\n"
-"TimerEvent 114 83 0 0 0 0 0\n"
-"RenderEvent 114 83 0 0 0 0 0\n"
-"MouseMoveEvent 108 82 0 0 0 0 0\n"
-"InteractionEvent 108 82 0 0 0 0 0\n"
-"TimerEvent 108 82 0 0 0 0 0\n"
-"RenderEvent 108 82 0 0 0 0 0\n"
-"MouseMoveEvent 104 81 0 0 0 0 0\n"
-"InteractionEvent 104 81 0 0 0 0 0\n"
-"MouseMoveEvent 102 81 0 0 0 0 0\n"
-"InteractionEvent 102 81 0 0 0 0 0\n"
-"TimerEvent 102 81 0 0 0 0 0\n"
-"RenderEvent 102 81 0 0 0 0 0\n"
-"MouseMoveEvent 95 81 0 0 0 0 0\n"
-"InteractionEvent 95 81 0 0 0 0 0\n"
-"MouseMoveEvent 92 81 0 0 0 0 0\n"
-"InteractionEvent 92 81 0 0 0 0 0\n"
-"TimerEvent 92 81 0 0 0 0 0\n"
-"RenderEvent 92 81 0 0 0 0 0\n"
-"MouseMoveEvent 86 81 0 0 0 0 0\n"
-"InteractionEvent 86 81 0 0 0 0 0\n"
-"MouseMoveEvent 83 81 0 0 0 0 0\n"
-"InteractionEvent 83 81 0 0 0 0 0\n"
-"TimerEvent 83 81 0 0 0 0 0\n"
-"RenderEvent 83 81 0 0 0 0 0\n"
-"MouseMoveEvent 77 81 0 0 0 0 0\n"
-"InteractionEvent 77 81 0 0 0 0 0\n"
-"MouseMoveEvent 75 80 0 0 0 0 0\n"
-"InteractionEvent 75 80 0 0 0 0 0\n"
-"TimerEvent 75 80 0 0 0 0 0\n"
-"RenderEvent 75 80 0 0 0 0 0\n"
-"MouseMoveEvent 72 80 0 0 0 0 0\n"
-"InteractionEvent 72 80 0 0 0 0 0\n"
-"TimerEvent 72 80 0 0 0 0 0\n"
-"RenderEvent 72 80 0 0 0 0 0\n"
-"TimerEvent 72 80 0 0 0 0 0\n"
-"RenderEvent 72 80 0 0 0 0 0\n"
-"TimerEvent 72 80 0 0 0 0 0\n"
-"RenderEvent 72 80 0 0 0 0 0\n"
-"TimerEvent 72 80 0 0 0 0 0\n"
-"RenderEvent 72 80 0 0 0 0 0\n"
-"TimerEvent 72 80 0 0 0 0 0\n"
-"RenderEvent 72 80 0 0 0 0 0\n"
-"TimerEvent 72 80 0 0 0 0 0\n"
-"RenderEvent 72 80 0 0 0 0 0\n"
-"TimerEvent 72 80 0 0 0 0 0\n"
-"RenderEvent 72 80 0 0 0 0 0\n"
-"TimerEvent 72 80 0 0 0 0 0\n"
-"RenderEvent 72 80 0 0 0 0 0\n"
-"TimerEvent 72 80 0 0 0 0 0\n"
-"RenderEvent 72 80 0 0 0 0 0\n"
-"TimerEvent 72 80 0 0 0 0 0\n"
-"RenderEvent 72 80 0 0 0 0 0\n"
-"MouseMoveEvent 71 79 0 0 0 0 0\n"
-"InteractionEvent 71 79 0 0 0 0 0\n"
-"MouseMoveEvent 71 78 0 0 0 0 0\n"
-"InteractionEvent 71 78 0 0 0 0 0\n"
-"TimerEvent 71 78 0 0 0 0 0\n"
-"RenderEvent 71 78 0 0 0 0 0\n"
-"MouseMoveEvent 70 74 0 0 0 0 0\n"
-"InteractionEvent 70 74 0 0 0 0 0\n"
-"MouseMoveEvent 70 73 0 0 0 0 0\n"
-"InteractionEvent 70 73 0 0 0 0 0\n"
-"TimerEvent 70 73 0 0 0 0 0\n"
-"RenderEvent 70 73 0 0 0 0 0\n"
-"MouseMoveEvent 70 71 0 0 0 0 0\n"
-"InteractionEvent 70 71 0 0 0 0 0\n"
-"MouseMoveEvent 70 70 0 0 0 0 0\n"
-"InteractionEvent 70 70 0 0 0 0 0\n"
-"TimerEvent 70 70 0 0 0 0 0\n"
-"RenderEvent 70 70 0 0 0 0 0\n"
-"MouseMoveEvent 70 64 0 0 0 0 0\n"
-"InteractionEvent 70 64 0 0 0 0 0\n"
-"MouseMoveEvent 70 63 0 0 0 0 0\n"
-"InteractionEvent 70 63 0 0 0 0 0\n"
-"TimerEvent 70 63 0 0 0 0 0\n"
-"RenderEvent 70 63 0 0 0 0 0\n"
-"MouseMoveEvent 72 59 0 0 0 0 0\n"
-"InteractionEvent 72 59 0 0 0 0 0\n"
-"MouseMoveEvent 73 58 0 0 0 0 0\n"
-"InteractionEvent 73 58 0 0 0 0 0\n"
-"TimerEvent 73 58 0 0 0 0 0\n"
-"RenderEvent 73 58 0 0 0 0 0\n"
-"MouseMoveEvent 77 52 0 0 0 0 0\n"
-"InteractionEvent 77 52 0 0 0 0 0\n"
-"MouseMoveEvent 78 51 0 0 0 0 0\n"
-"InteractionEvent 78 51 0 0 0 0 0\n"
-"TimerEvent 78 51 0 0 0 0 0\n"
-"RenderEvent 78 51 0 0 0 0 0\n"
-"MouseMoveEvent 83 44 0 0 0 0 0\n"
-"InteractionEvent 83 44 0 0 0 0 0\n"
-"MouseMoveEvent 85 42 0 0 0 0 0\n"
-"InteractionEvent 85 42 0 0 0 0 0\n"
-"MouseMoveEvent 86 41 0 0 0 0 0\n"
-"InteractionEvent 86 41 0 0 0 0 0\n"
-"TimerEvent 86 41 0 0 0 0 0\n"
-"RenderEvent 86 41 0 0 0 0 0\n"
-"MouseMoveEvent 89 38 0 0 0 0 0\n"
-"InteractionEvent 89 38 0 0 0 0 0\n"
-"MouseMoveEvent 90 37 0 0 0 0 0\n"
-"InteractionEvent 90 37 0 0 0 0 0\n"
-"TimerEvent 90 37 0 0 0 0 0\n"
-"RenderEvent 90 37 0 0 0 0 0\n"
-"MouseMoveEvent 94 33 0 0 0 0 0\n"
-"InteractionEvent 94 33 0 0 0 0 0\n"
-"MouseMoveEvent 95 32 0 0 0 0 0\n"
-"InteractionEvent 95 32 0 0 0 0 0\n"
-"TimerEvent 95 32 0 0 0 0 0\n"
-"RenderEvent 95 32 0 0 0 0 0\n"
-"MouseMoveEvent 99 30 0 0 0 0 0\n"
-"InteractionEvent 99 30 0 0 0 0 0\n"
-"MouseMoveEvent 101 29 0 0 0 0 0\n"
-"InteractionEvent 101 29 0 0 0 0 0\n"
-"TimerEvent 101 29 0 0 0 0 0\n"
-"RenderEvent 101 29 0 0 0 0 0\n"
-"MouseMoveEvent 108 25 0 0 0 0 0\n"
-"InteractionEvent 108 25 0 0 0 0 0\n"
-"TimerEvent 108 25 0 0 0 0 0\n"
-"RenderEvent 108 25 0 0 0 0 0\n"
-"MouseMoveEvent 111 23 0 0 0 0 0\n"
-"InteractionEvent 111 23 0 0 0 0 0\n"
-"TimerEvent 111 23 0 0 0 0 0\n"
-"RenderEvent 111 23 0 0 0 0 0\n"
-"MouseMoveEvent 115 21 0 0 0 0 0\n"
-"InteractionEvent 115 21 0 0 0 0 0\n"
-"TimerEvent 115 21 0 0 0 0 0\n"
-"RenderEvent 115 21 0 0 0 0 0\n"
-"MouseMoveEvent 118 19 0 0 0 0 0\n"
-"InteractionEvent 118 19 0 0 0 0 0\n"
-"TimerEvent 118 19 0 0 0 0 0\n"
-"RenderEvent 118 19 0 0 0 0 0\n"
-"MouseMoveEvent 122 18 0 0 0 0 0\n"
-"InteractionEvent 122 18 0 0 0 0 0\n"
-"TimerEvent 122 18 0 0 0 0 0\n"
-"RenderEvent 122 18 0 0 0 0 0\n"
-"MouseMoveEvent 127 16 0 0 0 0 0\n"
-"InteractionEvent 127 16 0 0 0 0 0\n"
-"MouseMoveEvent 128 15 0 0 0 0 0\n"
-"InteractionEvent 128 15 0 0 0 0 0\n"
-"TimerEvent 128 15 0 0 0 0 0\n"
-"RenderEvent 128 15 0 0 0 0 0\n"
-"MouseMoveEvent 133 13 0 0 0 0 0\n"
-"InteractionEvent 133 13 0 0 0 0 0\n"
-"TimerEvent 133 13 0 0 0 0 0\n"
-"RenderEvent 133 13 0 0 0 0 0\n"
-"MouseMoveEvent 139 11 0 0 0 0 0\n"
-"InteractionEvent 139 11 0 0 0 0 0\n"
-"MouseMoveEvent 140 11 0 0 0 0 0\n"
-"InteractionEvent 140 11 0 0 0 0 0\n"
-"TimerEvent 140 11 0 0 0 0 0\n"
-"RenderEvent 140 11 0 0 0 0 0\n"
-"MouseMoveEvent 144 10 0 0 0 0 0\n"
-"InteractionEvent 144 10 0 0 0 0 0\n"
-"MouseMoveEvent 145 9 0 0 0 0 0\n"
-"InteractionEvent 145 9 0 0 0 0 0\n"
-"TimerEvent 145 9 0 0 0 0 0\n"
-"RenderEvent 145 9 0 0 0 0 0\n"
-"MouseMoveEvent 147 8 0 0 0 0 0\n"
-"InteractionEvent 147 8 0 0 0 0 0\n"
-"TimerEvent 147 8 0 0 0 0 0\n"
-"RenderEvent 147 8 0 0 0 0 0\n"
-"MouseMoveEvent 150 7 0 0 0 0 0\n"
-"InteractionEvent 150 7 0 0 0 0 0\n"
-"MouseMoveEvent 151 7 0 0 0 0 0\n"
-"InteractionEvent 151 7 0 0 0 0 0\n"
-"MouseMoveEvent 154 6 0 0 0 0 0\n"
-"InteractionEvent 154 6 0 0 0 0 0\n"
-"TimerEvent 154 6 0 0 0 0 0\n"
-"RenderEvent 154 6 0 0 0 0 0\n"
-"MouseMoveEvent 156 6 0 0 0 0 0\n"
-"InteractionEvent 156 6 0 0 0 0 0\n"
-"MouseMoveEvent 158 5 0 0 0 0 0\n"
-"InteractionEvent 158 5 0 0 0 0 0\n"
-"TimerEvent 158 5 0 0 0 0 0\n"
-"RenderEvent 158 5 0 0 0 0 0\n"
-"MouseMoveEvent 160 4 0 0 0 0 0\n"
-"InteractionEvent 160 4 0 0 0 0 0\n"
-"TimerEvent 160 4 0 0 0 0 0\n"
-"RenderEvent 160 4 0 0 0 0 0\n"
-"TimerEvent 160 4 0 0 0 0 0\n"
-"RenderEvent 160 4 0 0 0 0 0\n"
-"MouseMoveEvent 162 3 0 0 0 0 0\n"
-"InteractionEvent 162 3 0 0 0 0 0\n"
-"MouseMoveEvent 164 2 0 0 0 0 0\n"
-"InteractionEvent 164 2 0 0 0 0 0\n"
-"TimerEvent 164 2 0 0 0 0 0\n"
-"RenderEvent 164 2 0 0 0 0 0\n"
-"MouseMoveEvent 167 1 0 0 0 0 0\n"
-"InteractionEvent 167 1 0 0 0 0 0\n"
-"TimerEvent 167 1 0 0 0 0 0\n"
-"RenderEvent 167 1 0 0 0 0 0\n"
-"MouseMoveEvent 171 -1 0 0 0 0 0\n"
-"InteractionEvent 171 -1 0 0 0 0 0\n"
-"LeaveEvent 171 -1 0 0 0 0 0\n"
-"MouseMoveEvent 171 -1 0 0 0 0 0\n"
-"InteractionEvent 171 -1 0 0 0 0 0\n"
-"TimerEvent 171 -1 0 0 0 0 0\n"
-"RenderEvent 171 -1 0 0 0 0 0\n"
-"TimerEvent 171 -1 0 0 0 0 0\n"
-"RenderEvent 171 -1 0 0 0 0 0\n"
-"TimerEvent 171 -1 0 0 0 0 0\n"
-"RenderEvent 171 -1 0 0 0 0 0\n"
-"LeftButtonReleaseEvent 171 -1 0 0 0 0 0\n"
-"EndInteractionEvent 171 -1 0 0 0 0 0\n"
-"RenderEvent 171 -1 0 0 0 0 0\n"
-"LeaveEvent 171 -1 0 0 0 0 0\n"
-"EnterEvent 174 0 0 0 0 0 0\n"
-"MouseMoveEvent 174 0 0 0 0 0 0\n"
-"MouseMoveEvent 175 1 0 0 0 0 0\n"
-"MouseMoveEvent 175 2 0 0 0 0 0\n"
-"MouseMoveEvent 175 4 0 0 0 0 0\n"
-"MouseMoveEvent 175 6 0 0 0 0 0\n"
-"MouseMoveEvent 175 8 0 0 0 0 0\n"
-"MouseMoveEvent 175 10 0 0 0 0 0\n"
-"MouseMoveEvent 175 12 0 0 0 0 0\n"
-"MouseMoveEvent 175 15 0 0 0 0 0\n"
-"MouseMoveEvent 175 18 0 0 0 0 0\n"
-"MouseMoveEvent 175 21 0 0 0 0 0\n"
-"MouseMoveEvent 176 23 0 0 0 0 0\n"
-"MouseMoveEvent 178 27 0 0 0 0 0\n"
-"MouseMoveEvent 180 29 0 0 0 0 0\n"
-"MouseMoveEvent 188 33 0 0 0 0 0\n"
-"MouseMoveEvent 198 34 0 0 0 0 0\n"
-"MouseMoveEvent 207 36 0 0 0 0 0\n"
-"MouseMoveEvent 221 36 0 0 0 0 0\n"
-"MouseMoveEvent 238 36 0 0 0 0 0\n"
-"MouseMoveEvent 255 36 0 0 0 0 0\n"
-"MouseMoveEvent 272 36 0 0 0 0 0\n"
-"MouseMoveEvent 289 36 0 0 0 0 0\n"
-"LeaveEvent 306 36 0 0 0 0 0\n"
-;
-
-int TestGPURayCastTwoComponentsIndependent(int argc, char *argv[])
-{
-  cout << "CTEST_FULL_OUTPUT (Avoid ctest truncation of output)" << endl;
-
-  int dims[3] = {35, 35, 35};
-
-  // Create a vtkImageData with two components
-  vtkNew<vtkImageData> image;
-  image->SetDimensions(dims[0], dims[1], dims[2]);
-  image->AllocateScalars(VTK_DOUBLE, 2);
-
-  // Fill the first half rectangular parallelopiped along X with the
-  // first component values and the second half with second component values
-  double * ptr = static_cast<double *> (image->GetScalarPointer(0, 0, 0));
-
-  for (int z = 0; z < dims[2]; ++z)
-    {
-    for (int y = 0; y < dims[1]; ++y)
-      {
-      for (int x = 0; x < dims[0]; ++x)
-        {
-        if (x < dims[0]/2)
-          {
-          *ptr++ = 1.0;
-          *ptr++ = 0.0;
-          }
-        else
-          {
-          *ptr++ = 0.0;
-          *ptr++ = 1.0;
-          }
-        }
-      }
-    }
-
-  vtkNew<vtkRenderWindow> renWin;
-  renWin->SetSize(301, 300); // Intentional NPOT size
-  renWin->SetMultiSamples(0);
-
-  vtkNew<vtkRenderer> ren;
-  renWin->AddRenderer(ren.GetPointer());
-
-  vtkNew<vtkRenderWindowInteractor> iren;
-  vtkNew<vtkInteractorStyleTrackballCamera> style;
-  iren->SetInteractorStyle(style.GetPointer());
-  iren->SetRenderWindow(renWin.GetPointer());
-
-  renWin->Render();
-
-  // Volume render the dataset
-  vtkNew<vtkGPUVolumeRayCastMapper> mapper;
-  mapper->AutoAdjustSampleDistancesOff();
-  mapper->SetSampleDistance(0.9);
-  mapper->SetInputData(image.GetPointer());
-
-  // Color transfer function
-  vtkNew<vtkColorTransferFunction> ctf1;
-  ctf1->AddRGBPoint(0.0, 0.0, 0.0, 0.0);
-  ctf1->AddRGBPoint(1.0, 1.0, 0.0, 0.0);
-
-  vtkNew<vtkColorTransferFunction> ctf2;
-  ctf2->AddRGBPoint(0.0, 0.0, 0.0, 0.0);
-  ctf2->AddRGBPoint(1.0, 0.0, 0.0, 1.0);
-
-  // Opacity functions
-  vtkNew<vtkPiecewiseFunction> pf1;
-  pf1->AddPoint(0.0, 0.0);
-  pf1->AddPoint(1.0, 0.5);
-
-  vtkNew<vtkPiecewiseFunction> pf2;
-  pf2->AddPoint(0.0, 0.0);
-  pf2->AddPoint(1.0, 0.5);
-
-  // Volume property with independent components ON
-  vtkNew<vtkVolumeProperty> property;
-  property->IndependentComponentsOn();
-
-  // Set color and opacity functions
-  property->SetColor(0, ctf1.GetPointer());
-  property->SetColor(1, ctf2.GetPointer());
-  property->SetScalarOpacity(0, pf1.GetPointer());
-  property->SetScalarOpacity(1, pf2.GetPointer());
-
-  vtkNew<vtkVolume> volume;
-  volume->SetMapper(mapper.GetPointer());
-  volume->SetProperty(property.GetPointer());
-  ren->AddVolume(volume.GetPointer());
-
-  ren->ResetCamera();
-
-  iren->Initialize();
-  renWin->Render();
-
-  return vtkTesting::InteractorEventLoop(argc, argv,
-                                         iren.GetPointer(),
-                                         TestGPURayCastTwoComponentsIndependentLog);
-}
diff --git a/Rendering/Volume/Testing/Cxx/TestGPURayCastVolumeUpdate.cxx b/Rendering/Volume/Testing/Cxx/TestGPURayCastVolumeUpdate.cxx
index 6fba4db..ffcd41e 100644
--- a/Rendering/Volume/Testing/Cxx/TestGPURayCastVolumeUpdate.cxx
+++ b/Rendering/Volume/Testing/Cxx/TestGPURayCastVolumeUpdate.cxx
@@ -38,29 +38,144 @@ static const char * TestGPURayCastVolumeUpdateLog =
 "# StreamVersion 1\n"
 "EnterEvent 396 237 0 0 0 0 0\n"
 "MouseMoveEvent 396 237 0 0 0 0 0\n"
+"MouseMoveEvent 390 239 0 0 0 0 0\n"
+"MouseMoveEvent 383 240 0 0 0 0 0\n"
+"MouseMoveEvent 376 240 0 0 0 0 0\n"
+"MouseMoveEvent 369 242 0 0 0 0 0\n"
+"MouseMoveEvent 360 244 0 0 0 0 0\n"
+"MouseMoveEvent 351 244 0 0 0 0 0\n"
 "MouseMoveEvent 342 244 0 0 0 0 0\n"
+"MouseMoveEvent 332 244 0 0 0 0 0\n"
+"MouseMoveEvent 323 244 0 0 0 0 0\n"
+"MouseMoveEvent 315 244 0 0 0 0 0\n"
+"MouseMoveEvent 309 244 0 0 0 0 0\n"
+"MouseMoveEvent 306 244 0 0 0 0 0\n"
+"MouseMoveEvent 304 244 0 0 0 0 0\n"
+"MouseMoveEvent 303 244 0 0 0 0 0\n"
 "MouseMoveEvent 301 244 0 0 0 0 0\n"
+"MouseMoveEvent 298 244 0 0 0 0 0\n"
+"MouseMoveEvent 294 244 0 0 0 0 0\n"
+"MouseMoveEvent 288 244 0 0 0 0 0\n"
+"MouseMoveEvent 281 244 0 0 0 0 0\n"
+"MouseMoveEvent 274 244 0 0 0 0 0\n"
+"MouseMoveEvent 268 244 0 0 0 0 0\n"
+"MouseMoveEvent 262 244 0 0 0 0 0\n"
+"MouseMoveEvent 259 244 0 0 0 0 0\n"
+"MouseMoveEvent 258 244 0 0 0 0 0\n"
+"MouseMoveEvent 256 244 0 0 0 0 0\n"
+"MouseMoveEvent 254 244 0 0 0 0 0\n"
+"MouseMoveEvent 253 245 0 0 0 0 0\n"
+"MouseMoveEvent 251 246 0 0 0 0 0\n"
+"MouseMoveEvent 250 246 0 0 0 0 0\n"
+"MouseMoveEvent 249 246 0 0 0 0 0\n"
 "MouseMoveEvent 246 247 0 0 0 0 0\n"
+"MouseMoveEvent 244 248 0 0 0 0 0\n"
+"MouseMoveEvent 243 248 0 0 0 0 0\n"
+"MouseMoveEvent 240 249 0 0 0 0 0\n"
+"MouseMoveEvent 238 249 0 0 0 0 0\n"
+"MouseMoveEvent 236 250 0 0 0 0 0\n"
+"MouseMoveEvent 233 251 0 0 0 0 0\n"
 "MouseMoveEvent 232 251 0 0 0 0 0\n"
+"MouseMoveEvent 230 251 0 0 0 0 0\n"
+"MouseMoveEvent 229 252 0 0 0 0 0\n"
+"MouseMoveEvent 228 252 0 0 0 0 0\n"
+"MouseMoveEvent 227 253 0 0 0 0 0\n"
+"MouseMoveEvent 226 253 0 0 0 0 0\n"
+"MouseMoveEvent 225 254 0 0 0 0 0\n"
+"MouseMoveEvent 224 254 0 0 0 0 0\n"
 "MouseMoveEvent 223 255 0 0 0 0 0\n"
 "LeftButtonPressEvent 223 255 0 0 0 0 0\n"
 "StartInteractionEvent 223 255 0 0 0 0 0\n"
 "TimerEvent 223 255 0 0 0 0 0\n"
 "RenderEvent 223 255 0 0 0 0 0\n"
+"TimerEvent 223 255 0 0 0 0 0\n"
+"RenderEvent 223 255 0 0 0 0 0\n"
+"TimerEvent 223 255 0 0 0 0 0\n"
+"RenderEvent 223 255 0 0 0 0 0\n"
+"MouseMoveEvent 223 252 0 0 0 0 0\n"
+"MouseMoveEvent 224 251 0 0 0 0 0\n"
+"TimerEvent 224 251 0 0 0 0 0\n"
+"RenderEvent 224 251 0 0 0 0 0\n"
+"MouseMoveEvent 228 242 0 0 0 0 0\n"
+"MouseMoveEvent 229 240 0 0 0 0 0\n"
 "TimerEvent 229 240 0 0 0 0 0\n"
 "RenderEvent 229 240 0 0 0 0 0\n"
 "MouseMoveEvent 232 233 0 0 0 0 0\n"
 "MouseMoveEvent 232 231 0 0 0 0 0\n"
+"TimerEvent 232 231 0 0 0 0 0\n"
+"RenderEvent 232 231 0 0 0 0 0\n"
+"MouseMoveEvent 236 222 0 0 0 0 0\n"
+"MouseMoveEvent 237 220 0 0 0 0 0\n"
+"MouseMoveEvent 238 218 0 0 0 0 0\n"
+"TimerEvent 238 218 0 0 0 0 0\n"
+"RenderEvent 238 218 0 0 0 0 0\n"
+"MouseMoveEvent 240 212 0 0 0 0 0\n"
+"MouseMoveEvent 241 211 0 0 0 0 0\n"
+"TimerEvent 241 211 0 0 0 0 0\n"
+"RenderEvent 241 211 0 0 0 0 0\n"
+"MouseMoveEvent 242 207 0 0 0 0 0\n"
+"MouseMoveEvent 242 206 0 0 0 0 0\n"
+"TimerEvent 242 206 0 0 0 0 0\n"
+"RenderEvent 242 206 0 0 0 0 0\n"
+"MouseMoveEvent 244 200 0 0 0 0 0\n"
+"MouseMoveEvent 244 199 0 0 0 0 0\n"
+"TimerEvent 244 199 0 0 0 0 0\n"
+"RenderEvent 244 199 0 0 0 0 0\n"
+"MouseMoveEvent 245 192 0 0 0 0 0\n"
+"MouseMoveEvent 245 190 0 0 0 0 0\n"
+"TimerEvent 245 190 0 0 0 0 0\n"
+"RenderEvent 245 190 0 0 0 0 0\n"
+"MouseMoveEvent 246 184 0 0 0 0 0\n"
+"MouseMoveEvent 246 182 0 0 0 0 0\n"
+"TimerEvent 246 182 0 0 0 0 0\n"
+"RenderEvent 246 182 0 0 0 0 0\n"
+"MouseMoveEvent 246 177 0 0 0 0 0\n"
+"MouseMoveEvent 246 176 0 0 0 0 0\n"
 "TimerEvent 246 176 0 0 0 0 0\n"
 "RenderEvent 246 176 0 0 0 0 0\n"
 "MouseMoveEvent 247 172 0 0 0 0 0\n"
 "MouseMoveEvent 247 171 0 0 0 0 0\n"
+"TimerEvent 247 171 0 0 0 0 0\n"
+"RenderEvent 247 171 0 0 0 0 0\n"
+"MouseMoveEvent 247 165 0 0 0 0 0\n"
+"MouseMoveEvent 248 164 0 0 0 0 0\n"
+"MouseMoveEvent 248 163 0 0 0 0 0\n"
+"TimerEvent 248 163 0 0 0 0 0\n"
+"RenderEvent 248 163 0 0 0 0 0\n"
+"MouseMoveEvent 249 159 0 0 0 0 0\n"
+"MouseMoveEvent 249 158 0 0 0 0 0\n"
+"MouseMoveEvent 249 157 0 0 0 0 0\n"
+"TimerEvent 249 157 0 0 0 0 0\n"
+"RenderEvent 249 157 0 0 0 0 0\n"
+"MouseMoveEvent 249 152 0 0 0 0 0\n"
+"MouseMoveEvent 249 150 0 0 0 0 0\n"
 "TimerEvent 249 150 0 0 0 0 0\n"
 "RenderEvent 249 150 0 0 0 0 0\n"
 "MouseMoveEvent 249 147 0 0 0 0 0\n"
+"TimerEvent 249 147 0 0 0 0 0\n"
+"RenderEvent 249 147 0 0 0 0 0\n"
+"MouseMoveEvent 249 145 0 0 0 0 0\n"
+"MouseMoveEvent 249 144 0 0 0 0 0\n"
 "TimerEvent 249 144 0 0 0 0 0\n"
 "RenderEvent 249 144 0 0 0 0 0\n"
 "MouseMoveEvent 249 143 0 0 0 0 0\n"
+"TimerEvent 249 143 0 0 0 0 0\n"
+"RenderEvent 249 143 0 0 0 0 0\n"
+"MouseMoveEvent 249 142 0 0 0 0 0\n"
+"TimerEvent 249 142 0 0 0 0 0\n"
+"RenderEvent 249 142 0 0 0 0 0\n"
+"TimerEvent 249 142 0 0 0 0 0\n"
+"RenderEvent 249 142 0 0 0 0 0\n"
+"TimerEvent 249 142 0 0 0 0 0\n"
+"RenderEvent 249 142 0 0 0 0 0\n"
+"TimerEvent 249 142 0 0 0 0 0\n"
+"RenderEvent 249 142 0 0 0 0 0\n"
+"TimerEvent 249 142 0 0 0 0 0\n"
+"RenderEvent 249 142 0 0 0 0 0\n"
+"TimerEvent 249 142 0 0 0 0 0\n"
+"RenderEvent 249 142 0 0 0 0 0\n"
+"TimerEvent 249 142 0 0 0 0 0\n"
+"RenderEvent 249 142 0 0 0 0 0\n"
 "TimerEvent 249 142 0 0 0 0 0\n"
 "RenderEvent 249 142 0 0 0 0 0\n"
 "TimerEvent 249 142 0 0 0 0 0\n"
@@ -69,6 +184,7 @@ static const char * TestGPURayCastVolumeUpdateLog =
 "EndInteractionEvent 249 142 0 0 0 0 0\n"
 "RenderEvent 249 142 0 0 0 0 0\n"
 "MouseMoveEvent 248 141 0 0 0 0 0\n"
+"MouseMoveEvent 247 140 0 0 0 0 0\n"
 "MouseMoveEvent 246 139 0 0 0 0 0\n"
 "MouseMoveEvent 245 138 0 0 0 0 0\n"
 "LeftButtonPressEvent 245 138 0 0 0 0 0\n"
@@ -77,13 +193,68 @@ static const char * TestGPURayCastVolumeUpdateLog =
 "RenderEvent 245 138 0 0 0 0 0\n"
 "MouseMoveEvent 244 138 0 0 0 0 0\n"
 "MouseMoveEvent 243 138 0 0 0 0 0\n"
+"TimerEvent 243 138 0 0 0 0 0\n"
+"RenderEvent 243 138 0 0 0 0 0\n"
+"MouseMoveEvent 237 137 0 0 0 0 0\n"
+"MouseMoveEvent 235 137 0 0 0 0 0\n"
+"TimerEvent 235 137 0 0 0 0 0\n"
+"RenderEvent 235 137 0 0 0 0 0\n"
+"MouseMoveEvent 229 135 0 0 0 0 0\n"
+"MouseMoveEvent 227 134 0 0 0 0 0\n"
+"MouseMoveEvent 225 133 0 0 0 0 0\n"
+"TimerEvent 225 133 0 0 0 0 0\n"
+"RenderEvent 225 133 0 0 0 0 0\n"
+"MouseMoveEvent 219 130 0 0 0 0 0\n"
+"MouseMoveEvent 217 129 0 0 0 0 0\n"
+"TimerEvent 217 129 0 0 0 0 0\n"
+"RenderEvent 217 129 0 0 0 0 0\n"
+"MouseMoveEvent 212 126 0 0 0 0 0\n"
+"MouseMoveEvent 211 125 0 0 0 0 0\n"
 "TimerEvent 211 125 0 0 0 0 0\n"
 "RenderEvent 211 125 0 0 0 0 0\n"
 "MouseMoveEvent 210 124 0 0 0 0 0\n"
+"TimerEvent 210 124 0 0 0 0 0\n"
+"RenderEvent 210 124 0 0 0 0 0\n"
+"MouseMoveEvent 209 124 0 0 0 0 0\n"
+"MouseMoveEvent 208 124 0 0 0 0 0\n"
+"TimerEvent 208 124 0 0 0 0 0\n"
+"RenderEvent 208 124 0 0 0 0 0\n"
+"MouseMoveEvent 207 123 0 0 0 0 0\n"
+"TimerEvent 207 123 0 0 0 0 0\n"
+"RenderEvent 207 123 0 0 0 0 0\n"
+"MouseMoveEvent 204 121 0 0 0 0 0\n"
+"TimerEvent 204 121 0 0 0 0 0\n"
+"RenderEvent 204 121 0 0 0 0 0\n"
+"MouseMoveEvent 202 119 0 0 0 0 0\n"
+"TimerEvent 202 119 0 0 0 0 0\n"
+"RenderEvent 202 119 0 0 0 0 0\n"
+"MouseMoveEvent 200 117 0 0 0 0 0\n"
+"TimerEvent 200 117 0 0 0 0 0\n"
+"RenderEvent 200 117 0 0 0 0 0\n"
+"MouseMoveEvent 199 116 0 0 0 0 0\n"
+"MouseMoveEvent 198 115 0 0 0 0 0\n"
 "TimerEvent 198 115 0 0 0 0 0\n"
 "RenderEvent 198 115 0 0 0 0 0\n"
 "MouseMoveEvent 198 113 0 0 0 0 0\n"
 "MouseMoveEvent 198 112 0 0 0 0 0\n"
+"TimerEvent 198 112 0 0 0 0 0\n"
+"RenderEvent 198 112 0 0 0 0 0\n"
+"MouseMoveEvent 198 111 0 0 0 0 0\n"
+"MouseMoveEvent 197 109 0 0 0 0 0\n"
+"TimerEvent 197 109 0 0 0 0 0\n"
+"RenderEvent 197 109 0 0 0 0 0\n"
+"MouseMoveEvent 197 108 0 0 0 0 0\n"
+"TimerEvent 197 108 0 0 0 0 0\n"
+"RenderEvent 197 108 0 0 0 0 0\n"
+"MouseMoveEvent 197 106 0 0 0 0 0\n"
+"TimerEvent 197 106 0 0 0 0 0\n"
+"RenderEvent 197 106 0 0 0 0 0\n"
+"MouseMoveEvent 197 104 0 0 0 0 0\n"
+"MouseMoveEvent 197 103 0 0 0 0 0\n"
+"TimerEvent 197 103 0 0 0 0 0\n"
+"RenderEvent 197 103 0 0 0 0 0\n"
+"MouseMoveEvent 197 102 0 0 0 0 0\n"
+"MouseMoveEvent 197 101 0 0 0 0 0\n"
 "TimerEvent 197 101 0 0 0 0 0\n"
 "RenderEvent 197 101 0 0 0 0 0\n"
 "MouseMoveEvent 197 99 0 0 0 0 0\n"
@@ -91,6 +262,9 @@ static const char * TestGPURayCastVolumeUpdateLog =
 "EndInteractionEvent 197 100 0 0 0 0 0\n"
 "RenderEvent 197 100 0 0 0 0 0\n"
 "MouseMoveEvent 197 96 0 0 0 0 0\n"
+"MouseMoveEvent 197 96 0 0 0 0 0\n"
+"MouseMoveEvent 197 95 0 0 0 0 0\n"
+"MouseMoveEvent 197 93 0 0 0 0 0\n"
 "MouseMoveEvent 197 92 0 0 0 0 0\n"
 "MouseMoveEvent 197 91 0 0 0 0 0\n"
 "MouseMoveEvent 197 90 0 0 0 0 0\n"
@@ -102,11 +276,50 @@ static const char * TestGPURayCastVolumeUpdateLog =
 "TimerEvent 199 87 0 0 0 0 0\n"
 "RenderEvent 199 87 0 0 0 0 0\n"
 "MouseMoveEvent 199 86 0 0 0 0 0\n"
+"TimerEvent 199 86 0 0 0 0 0\n"
+"RenderEvent 199 86 0 0 0 0 0\n"
+"MouseMoveEvent 199 85 0 0 0 0 0\n"
+"MouseMoveEvent 199 84 0 0 0 0 0\n"
+"TimerEvent 199 84 0 0 0 0 0\n"
+"RenderEvent 199 84 0 0 0 0 0\n"
+"MouseMoveEvent 199 82 0 0 0 0 0\n"
+"MouseMoveEvent 200 81 0 0 0 0 0\n"
+"TimerEvent 200 81 0 0 0 0 0\n"
+"RenderEvent 200 81 0 0 0 0 0\n"
+"MouseMoveEvent 200 79 0 0 0 0 0\n"
+"MouseMoveEvent 200 78 0 0 0 0 0\n"
+"MouseMoveEvent 200 77 0 0 0 0 0\n"
 "TimerEvent 200 77 0 0 0 0 0\n"
 "RenderEvent 200 77 0 0 0 0 0\n"
 "MouseMoveEvent 200 76 0 0 0 0 0\n"
 "MouseMoveEvent 200 75 0 0 0 0 0\n"
 "MouseMoveEvent 200 74 0 0 0 0 0\n"
+"TimerEvent 200 74 0 0 0 0 0\n"
+"RenderEvent 200 74 0 0 0 0 0\n"
+"MouseMoveEvent 200 73 0 0 0 0 0\n"
+"MouseMoveEvent 200 72 0 0 0 0 0\n"
+"TimerEvent 200 72 0 0 0 0 0\n"
+"RenderEvent 200 72 0 0 0 0 0\n"
+"MouseMoveEvent 200 70 0 0 0 0 0\n"
+"MouseMoveEvent 200 69 0 0 0 0 0\n"
+"TimerEvent 200 69 0 0 0 0 0\n"
+"RenderEvent 200 69 0 0 0 0 0\n"
+"MouseMoveEvent 200 68 0 0 0 0 0\n"
+"TimerEvent 200 68 0 0 0 0 0\n"
+"RenderEvent 200 68 0 0 0 0 0\n"
+"MouseMoveEvent 200 67 0 0 0 0 0\n"
+"TimerEvent 200 67 0 0 0 0 0\n"
+"RenderEvent 200 67 0 0 0 0 0\n"
+"TimerEvent 200 67 0 0 0 0 0\n"
+"RenderEvent 200 67 0 0 0 0 0\n"
+"TimerEvent 200 67 0 0 0 0 0\n"
+"RenderEvent 200 67 0 0 0 0 0\n"
+"TimerEvent 200 67 0 0 0 0 0\n"
+"RenderEvent 200 67 0 0 0 0 0\n"
+"TimerEvent 200 67 0 0 0 0 0\n"
+"RenderEvent 200 67 0 0 0 0 0\n"
+"TimerEvent 200 67 0 0 0 0 0\n"
+"RenderEvent 200 67 0 0 0 0 0\n"
 "TimerEvent 200 67 0 0 0 0 0\n"
 "RenderEvent 200 67 0 0 0 0 0\n"
 "TimerEvent 200 67 0 0 0 0 0\n"
@@ -115,35 +328,165 @@ static const char * TestGPURayCastVolumeUpdateLog =
 "EndInteractionEvent 200 67 0 0 0 0 0\n"
 "RenderEvent 200 67 0 0 0 0 0\n"
 "MouseMoveEvent 201 66 0 0 0 0 0\n"
+"MouseMoveEvent 202 67 0 0 0 0 0\n"
+"MouseMoveEvent 203 68 0 0 0 0 0\n"
+"MouseMoveEvent 204 69 0 0 0 0 0\n"
+"MouseMoveEvent 205 70 0 0 0 0 0\n"
 "MouseMoveEvent 206 71 0 0 0 0 0\n"
+"MouseMoveEvent 207 74 0 0 0 0 0\n"
+"MouseMoveEvent 208 77 0 0 0 0 0\n"
+"MouseMoveEvent 210 81 0 0 0 0 0\n"
+"MouseMoveEvent 211 85 0 0 0 0 0\n"
+"MouseMoveEvent 212 89 0 0 0 0 0\n"
 "MouseMoveEvent 213 92 0 0 0 0 0\n"
+"MouseMoveEvent 214 96 0 0 0 0 0\n"
+"MouseMoveEvent 214 100 0 0 0 0 0\n"
+"MouseMoveEvent 215 104 0 0 0 0 0\n"
+"MouseMoveEvent 215 107 0 0 0 0 0\n"
+"MouseMoveEvent 216 110 0 0 0 0 0\n"
 "MouseMoveEvent 216 112 0 0 0 0 0\n"
+"MouseMoveEvent 216 114 0 0 0 0 0\n"
+"MouseMoveEvent 216 115 0 0 0 0 0\n"
+"MouseMoveEvent 217 117 0 0 0 0 0\n"
+"MouseMoveEvent 218 119 0 0 0 0 0\n"
+"MouseMoveEvent 218 120 0 0 0 0 0\n"
 "MouseMoveEvent 218 122 0 0 0 0 0\n"
+"MouseMoveEvent 219 124 0 0 0 0 0\n"
+"MouseMoveEvent 220 126 0 0 0 0 0\n"
+"MouseMoveEvent 220 127 0 0 0 0 0\n"
+"MouseMoveEvent 220 128 0 0 0 0 0\n"
+"MouseMoveEvent 221 130 0 0 0 0 0\n"
 "MouseMoveEvent 222 131 0 0 0 0 0\n"
 "LeftButtonPressEvent 222 131 0 0 0 0 0\n"
 "StartInteractionEvent 222 131 0 0 0 0 0\n"
 "TimerEvent 222 131 0 0 0 0 0\n"
 "RenderEvent 222 131 0 0 0 0 0\n"
 "MouseMoveEvent 224 132 0 0 0 0 0\n"
+"TimerEvent 224 132 0 0 0 0 0\n"
+"RenderEvent 224 132 0 0 0 0 0\n"
+"MouseMoveEvent 227 137 0 0 0 0 0\n"
+"TimerEvent 227 137 0 0 0 0 0\n"
+"RenderEvent 227 137 0 0 0 0 0\n"
+"MouseMoveEvent 229 143 0 0 0 0 0\n"
+"MouseMoveEvent 230 145 0 0 0 0 0\n"
 "TimerEvent 230 145 0 0 0 0 0\n"
 "RenderEvent 230 145 0 0 0 0 0\n"
 "MouseMoveEvent 233 151 0 0 0 0 0\n"
 "MouseMoveEvent 233 152 0 0 0 0 0\n"
+"TimerEvent 233 152 0 0 0 0 0\n"
+"RenderEvent 233 152 0 0 0 0 0\n"
+"MouseMoveEvent 235 155 0 0 0 0 0\n"
+"MouseMoveEvent 236 156 0 0 0 0 0\n"
+"TimerEvent 236 156 0 0 0 0 0\n"
+"RenderEvent 236 156 0 0 0 0 0\n"
+"MouseMoveEvent 238 160 0 0 0 0 0\n"
+"MouseMoveEvent 239 162 0 0 0 0 0\n"
+"TimerEvent 239 162 0 0 0 0 0\n"
+"RenderEvent 239 162 0 0 0 0 0\n"
+"MouseMoveEvent 241 167 0 0 0 0 0\n"
+"MouseMoveEvent 241 168 0 0 0 0 0\n"
+"TimerEvent 241 168 0 0 0 0 0\n"
+"RenderEvent 241 168 0 0 0 0 0\n"
+"MouseMoveEvent 242 170 0 0 0 0 0\n"
+"MouseMoveEvent 242 171 0 0 0 0 0\n"
+"TimerEvent 242 171 0 0 0 0 0\n"
+"RenderEvent 242 171 0 0 0 0 0\n"
+"MouseMoveEvent 244 176 0 0 0 0 0\n"
+"MouseMoveEvent 245 177 0 0 0 0 0\n"
 "TimerEvent 245 177 0 0 0 0 0\n"
 "RenderEvent 245 177 0 0 0 0 0\n"
 "MouseMoveEvent 247 183 0 0 0 0 0\n"
 "MouseMoveEvent 247 185 0 0 0 0 0\n"
+"TimerEvent 247 185 0 0 0 0 0\n"
+"RenderEvent 247 185 0 0 0 0 0\n"
+"MouseMoveEvent 249 190 0 0 0 0 0\n"
+"MouseMoveEvent 249 191 0 0 0 0 0\n"
+"TimerEvent 249 191 0 0 0 0 0\n"
+"RenderEvent 249 191 0 0 0 0 0\n"
+"MouseMoveEvent 250 194 0 0 0 0 0\n"
+"TimerEvent 250 194 0 0 0 0 0\n"
+"RenderEvent 250 194 0 0 0 0 0\n"
+"MouseMoveEvent 249 201 0 0 0 0 0\n"
+"TimerEvent 249 201 0 0 0 0 0\n"
+"RenderEvent 249 201 0 0 0 0 0\n"
+"MouseMoveEvent 248 208 0 0 0 0 0\n"
+"MouseMoveEvent 247 209 0 0 0 0 0\n"
+"MouseMoveEvent 246 212 0 0 0 0 0\n"
+"TimerEvent 246 212 0 0 0 0 0\n"
+"RenderEvent 246 212 0 0 0 0 0\n"
+"MouseMoveEvent 244 218 0 0 0 0 0\n"
+"MouseMoveEvent 243 219 0 0 0 0 0\n"
+"MouseMoveEvent 242 220 0 0 0 0 0\n"
+"TimerEvent 242 220 0 0 0 0 0\n"
+"RenderEvent 242 220 0 0 0 0 0\n"
+"MouseMoveEvent 236 227 0 0 0 0 0\n"
+"MouseMoveEvent 234 229 0 0 0 0 0\n"
+"TimerEvent 234 229 0 0 0 0 0\n"
+"RenderEvent 234 229 0 0 0 0 0\n"
+"MouseMoveEvent 226 237 0 0 0 0 0\n"
+"MouseMoveEvent 224 239 0 0 0 0 0\n"
+"TimerEvent 224 239 0 0 0 0 0\n"
+"RenderEvent 224 239 0 0 0 0 0\n"
+"MouseMoveEvent 218 245 0 0 0 0 0\n"
+"MouseMoveEvent 217 246 0 0 0 0 0\n"
+"MouseMoveEvent 216 247 0 0 0 0 0\n"
 "TimerEvent 216 247 0 0 0 0 0\n"
 "RenderEvent 216 247 0 0 0 0 0\n"
 "MouseMoveEvent 212 251 0 0 0 0 0\n"
+"TimerEvent 212 251 0 0 0 0 0\n"
+"RenderEvent 212 251 0 0 0 0 0\n"
+"MouseMoveEvent 210 253 0 0 0 0 0\n"
+"TimerEvent 210 253 0 0 0 0 0\n"
+"RenderEvent 210 253 0 0 0 0 0\n"
+"TimerEvent 210 253 0 0 0 0 0\n"
+"RenderEvent 210 253 0 0 0 0 0\n"
+"TimerEvent 210 253 0 0 0 0 0\n"
+"RenderEvent 210 253 0 0 0 0 0\n"
+"TimerEvent 210 253 0 0 0 0 0\n"
+"RenderEvent 210 253 0 0 0 0 0\n"
+"MouseMoveEvent 209 254 0 0 0 0 0\n"
+"TimerEvent 209 254 0 0 0 0 0\n"
+"RenderEvent 209 254 0 0 0 0 0\n"
+"MouseMoveEvent 208 252 0 0 0 0 0\n"
+"MouseMoveEvent 208 250 0 0 0 0 0\n"
+"TimerEvent 208 250 0 0 0 0 0\n"
+"RenderEvent 208 250 0 0 0 0 0\n"
+"MouseMoveEvent 208 244 0 0 0 0 0\n"
+"MouseMoveEvent 208 242 0 0 0 0 0\n"
+"TimerEvent 208 242 0 0 0 0 0\n"
+"RenderEvent 208 242 0 0 0 0 0\n"
+"MouseMoveEvent 208 236 0 0 0 0 0\n"
+"MouseMoveEvent 208 234 0 0 0 0 0\n"
 "TimerEvent 208 234 0 0 0 0 0\n"
 "RenderEvent 208 234 0 0 0 0 0\n"
 "MouseMoveEvent 210 229 0 0 0 0 0\n"
 "MouseMoveEvent 210 227 0 0 0 0 0\n"
+"TimerEvent 210 227 0 0 0 0 0\n"
+"RenderEvent 210 227 0 0 0 0 0\n"
+"MouseMoveEvent 212 221 0 0 0 0 0\n"
+"MouseMoveEvent 213 219 0 0 0 0 0\n"
+"MouseMoveEvent 213 217 0 0 0 0 0\n"
+"TimerEvent 213 217 0 0 0 0 0\n"
+"RenderEvent 213 217 0 0 0 0 0\n"
+"MouseMoveEvent 215 212 0 0 0 0 0\n"
+"MouseMoveEvent 215 211 0 0 0 0 0\n"
+"MouseMoveEvent 216 209 0 0 0 0 0\n"
+"TimerEvent 216 209 0 0 0 0 0\n"
+"RenderEvent 216 209 0 0 0 0 0\n"
+"MouseMoveEvent 217 204 0 0 0 0 0\n"
+"MouseMoveEvent 218 202 0 0 0 0 0\n"
 "TimerEvent 218 202 0 0 0 0 0\n"
 "RenderEvent 218 202 0 0 0 0 0\n"
 "MouseMoveEvent 220 198 0 0 0 0 0\n"
 "MouseMoveEvent 221 196 0 0 0 0 0\n"
+"TimerEvent 221 196 0 0 0 0 0\n"
+"RenderEvent 221 196 0 0 0 0 0\n"
+"MouseMoveEvent 223 190 0 0 0 0 0\n"
+"MouseMoveEvent 224 189 0 0 0 0 0\n"
+"TimerEvent 224 189 0 0 0 0 0\n"
+"RenderEvent 224 189 0 0 0 0 0\n"
+"MouseMoveEvent 226 184 0 0 0 0 0\n"
+"MouseMoveEvent 226 183 0 0 0 0 0\n"
 "TimerEvent 226 183 0 0 0 0 0\n"
 "RenderEvent 226 183 0 0 0 0 0\n"
 "MouseMoveEvent 228 179 0 0 0 0 0\n"
@@ -153,16 +496,64 @@ static const char * TestGPURayCastVolumeUpdateLog =
 "RenderEvent 229 177 0 0 0 0 0\n"
 "MouseMoveEvent 230 175 0 0 0 0 0\n"
 "MouseMoveEvent 230 174 0 0 0 0 0\n"
+"TimerEvent 230 174 0 0 0 0 0\n"
+"RenderEvent 230 174 0 0 0 0 0\n"
+"MouseMoveEvent 230 172 0 0 0 0 0\n"
+"TimerEvent 230 172 0 0 0 0 0\n"
+"RenderEvent 230 172 0 0 0 0 0\n"
+"MouseMoveEvent 231 170 0 0 0 0 0\n"
+"TimerEvent 231 170 0 0 0 0 0\n"
+"RenderEvent 231 170 0 0 0 0 0\n"
+"MouseMoveEvent 231 168 0 0 0 0 0\n"
+"TimerEvent 231 168 0 0 0 0 0\n"
+"RenderEvent 231 168 0 0 0 0 0\n"
+"MouseMoveEvent 231 166 0 0 0 0 0\n"
+"TimerEvent 231 166 0 0 0 0 0\n"
+"RenderEvent 231 166 0 0 0 0 0\n"
+"MouseMoveEvent 231 165 0 0 0 0 0\n"
+"MouseMoveEvent 231 164 0 0 0 0 0\n"
+"TimerEvent 231 164 0 0 0 0 0\n"
+"RenderEvent 231 164 0 0 0 0 0\n"
+"MouseMoveEvent 231 163 0 0 0 0 0\n"
+"TimerEvent 231 163 0 0 0 0 0\n"
+"RenderEvent 231 163 0 0 0 0 0\n"
+"MouseMoveEvent 231 161 0 0 0 0 0\n"
+"TimerEvent 231 161 0 0 0 0 0\n"
+"RenderEvent 231 161 0 0 0 0 0\n"
+"MouseMoveEvent 230 158 0 0 0 0 0\n"
+"TimerEvent 230 158 0 0 0 0 0\n"
+"RenderEvent 230 158 0 0 0 0 0\n"
+"MouseMoveEvent 229 157 0 0 0 0 0\n"
+"TimerEvent 229 157 0 0 0 0 0\n"
+"RenderEvent 229 157 0 0 0 0 0\n"
+"MouseMoveEvent 229 156 0 0 0 0 0\n"
+"TimerEvent 229 156 0 0 0 0 0\n"
+"RenderEvent 229 156 0 0 0 0 0\n"
+"MouseMoveEvent 228 154 0 0 0 0 0\n"
+"TimerEvent 228 154 0 0 0 0 0\n"
+"RenderEvent 228 154 0 0 0 0 0\n"
+"MouseMoveEvent 227 153 0 0 0 0 0\n"
+"TimerEvent 227 153 0 0 0 0 0\n"
+"RenderEvent 227 153 0 0 0 0 0\n"
+"MouseMoveEvent 226 152 0 0 0 0 0\n"
 "TimerEvent 226 152 0 0 0 0 0\n"
 "RenderEvent 226 152 0 0 0 0 0\n"
 "MouseMoveEvent 225 151 0 0 0 0 0\n"
 "TimerEvent 225 151 0 0 0 0 0\n"
 "RenderEvent 225 151 0 0 0 0 0\n"
+"TimerEvent 225 151 0 0 0 0 0\n"
+"RenderEvent 225 151 0 0 0 0 0\n"
 "LeftButtonReleaseEvent 225 151 0 0 0 0 0\n"
 "EndInteractionEvent 225 151 0 0 0 0 0\n"
 "RenderEvent 225 151 0 0 0 0 0\n"
 "MouseMoveEvent 224 151 0 0 0 0 0\n"
+"MouseMoveEvent 223 151 0 0 0 0 0\n"
+"MouseMoveEvent 222 151 0 0 0 0 0\n"
+"MouseMoveEvent 221 151 0 0 0 0 0\n"
+"MouseMoveEvent 219 151 0 0 0 0 0\n"
+"MouseMoveEvent 218 151 0 0 0 0 0\n"
 "MouseMoveEvent 217 151 0 0 0 0 0\n"
+"MouseMoveEvent 216 151 0 0 0 0 0\n"
 "MouseMoveEvent 215 151 0 0 0 0 0\n"
 "MouseMoveEvent 214 151 0 0 0 0 0\n"
 "LeftButtonPressEvent 214 151 0 0 0 0 0\n"
@@ -174,18 +565,65 @@ static const char * TestGPURayCastVolumeUpdateLog =
 "RenderEvent 206 146 0 0 0 0 0\n"
 "MouseMoveEvent 199 143 0 0 0 0 0\n"
 "MouseMoveEvent 198 143 0 0 0 0 0\n"
+"TimerEvent 198 143 0 0 0 0 0\n"
+"RenderEvent 198 143 0 0 0 0 0\n"
+"MouseMoveEvent 192 141 0 0 0 0 0\n"
+"MouseMoveEvent 191 140 0 0 0 0 0\n"
+"TimerEvent 191 140 0 0 0 0 0\n"
+"RenderEvent 191 140 0 0 0 0 0\n"
+"MouseMoveEvent 187 136 0 0 0 0 0\n"
+"TimerEvent 187 136 0 0 0 0 0\n"
+"RenderEvent 187 136 0 0 0 0 0\n"
+"MouseMoveEvent 186 135 0 0 0 0 0\n"
+"TimerEvent 186 135 0 0 0 0 0\n"
+"RenderEvent 186 135 0 0 0 0 0\n"
+"MouseMoveEvent 185 135 0 0 0 0 0\n"
 "TimerEvent 185 135 0 0 0 0 0\n"
 "RenderEvent 185 135 0 0 0 0 0\n"
 "MouseMoveEvent 184 135 0 0 0 0 0\n"
+"TimerEvent 184 135 0 0 0 0 0\n"
+"RenderEvent 184 135 0 0 0 0 0\n"
+"MouseMoveEvent 180 136 0 0 0 0 0\n"
 "TimerEvent 180 136 0 0 0 0 0\n"
 "RenderEvent 180 136 0 0 0 0 0\n"
 "LeftButtonReleaseEvent 180 136 0 0 0 0 0\n"
 "EndInteractionEvent 180 136 0 0 0 0 0\n"
 "RenderEvent 180 136 0 0 0 0 0\n"
 "MouseMoveEvent 179 138 0 0 0 0 0\n"
+"MouseMoveEvent 179 139 0 0 0 0 0\n"
+"MouseMoveEvent 179 140 0 0 0 0 0\n"
+"MouseMoveEvent 179 141 0 0 0 0 0\n"
+"MouseMoveEvent 179 142 0 0 0 0 0\n"
+"MouseMoveEvent 179 143 0 0 0 0 0\n"
+"MouseMoveEvent 179 144 0 0 0 0 0\n"
+"MouseMoveEvent 178 145 0 0 0 0 0\n"
+"MouseMoveEvent 178 146 0 0 0 0 0\n"
+"MouseMoveEvent 177 147 0 0 0 0 0\n"
+"MouseMoveEvent 177 148 0 0 0 0 0\n"
+"MouseMoveEvent 176 149 0 0 0 0 0\n"
+"MouseMoveEvent 175 150 0 0 0 0 0\n"
 "MouseMoveEvent 174 152 0 0 0 0 0\n"
+"MouseMoveEvent 174 153 0 0 0 0 0\n"
+"MouseMoveEvent 174 154 0 0 0 0 0\n"
+"MouseMoveEvent 173 155 0 0 0 0 0\n"
+"MouseMoveEvent 173 157 0 0 0 0 0\n"
+"MouseMoveEvent 173 158 0 0 0 0 0\n"
+"MouseMoveEvent 172 161 0 0 0 0 0\n"
 "MouseMoveEvent 171 162 0 0 0 0 0\n"
+"MouseMoveEvent 171 164 0 0 0 0 0\n"
+"MouseMoveEvent 171 166 0 0 0 0 0\n"
+"MouseMoveEvent 170 167 0 0 0 0 0\n"
+"MouseMoveEvent 170 168 0 0 0 0 0\n"
+"MouseMoveEvent 169 170 0 0 0 0 0\n"
+"MouseMoveEvent 169 172 0 0 0 0 0\n"
+"MouseMoveEvent 168 174 0 0 0 0 0\n"
+"MouseMoveEvent 167 175 0 0 0 0 0\n"
+"MouseMoveEvent 166 176 0 0 0 0 0\n"
+"MouseMoveEvent 165 177 0 0 0 0 0\n"
 "MouseMoveEvent 164 178 0 0 0 0 0\n"
+"MouseMoveEvent 163 179 0 0 0 0 0\n"
+"MouseMoveEvent 163 180 0 0 0 0 0\n"
+"MouseMoveEvent 162 181 0 0 0 0 0\n"
 "MouseMoveEvent 161 182 0 0 0 0 0\n"
 "MouseMoveEvent 160 183 0 0 0 0 0\n"
 "MouseMoveEvent 159 184 0 0 0 0 0\n"
@@ -197,46 +635,210 @@ static const char * TestGPURayCastVolumeUpdateLog =
 "MouseMoveEvent 150 192 0 0 0 0 0\n"
 "MouseMoveEvent 149 193 0 0 0 0 0\n"
 "MouseMoveEvent 147 195 0 0 0 0 0\n"
+"TimerEvent 147 195 0 0 0 0 0\n"
+"RenderEvent 147 195 0 0 0 0 0\n"
+"MouseMoveEvent 139 203 0 0 0 0 0\n"
+"MouseMoveEvent 138 204 0 0 0 0 0\n"
+"TimerEvent 138 204 0 0 0 0 0\n"
+"RenderEvent 138 204 0 0 0 0 0\n"
+"MouseMoveEvent 133 211 0 0 0 0 0\n"
+"MouseMoveEvent 133 212 0 0 0 0 0\n"
+"MouseMoveEvent 132 213 0 0 0 0 0\n"
 "TimerEvent 132 213 0 0 0 0 0\n"
 "RenderEvent 132 213 0 0 0 0 0\n"
 "MouseMoveEvent 131 215 0 0 0 0 0\n"
+"TimerEvent 131 215 0 0 0 0 0\n"
+"RenderEvent 131 215 0 0 0 0 0\n"
+"MouseMoveEvent 131 217 0 0 0 0 0\n"
+"MouseMoveEvent 130 219 0 0 0 0 0\n"
+"TimerEvent 130 219 0 0 0 0 0\n"
+"RenderEvent 130 219 0 0 0 0 0\n"
+"MouseMoveEvent 130 220 0 0 0 0 0\n"
 "TimerEvent 130 220 0 0 0 0 0\n"
 "RenderEvent 130 220 0 0 0 0 0\n"
 "MouseMoveEvent 130 221 0 0 0 0 0\n"
 "MouseMoveEvent 130 222 0 0 0 0 0\n"
+"TimerEvent 130 222 0 0 0 0 0\n"
+"RenderEvent 130 222 0 0 0 0 0\n"
+"MouseMoveEvent 130 223 0 0 0 0 0\n"
+"TimerEvent 130 223 0 0 0 0 0\n"
+"RenderEvent 130 223 0 0 0 0 0\n"
+"MouseMoveEvent 131 225 0 0 0 0 0\n"
 "TimerEvent 131 225 0 0 0 0 0\n"
 "RenderEvent 131 225 0 0 0 0 0\n"
 "MouseMoveEvent 132 226 0 0 0 0 0\n"
+"TimerEvent 132 226 0 0 0 0 0\n"
+"RenderEvent 132 226 0 0 0 0 0\n"
+"MouseMoveEvent 133 227 0 0 0 0 0\n"
+"MouseMoveEvent 134 228 0 0 0 0 0\n"
+"TimerEvent 134 228 0 0 0 0 0\n"
+"RenderEvent 134 228 0 0 0 0 0\n"
+"MouseMoveEvent 135 229 0 0 0 0 0\n"
+"MouseMoveEvent 136 230 0 0 0 0 0\n"
+"TimerEvent 136 230 0 0 0 0 0\n"
+"RenderEvent 136 230 0 0 0 0 0\n"
+"MouseMoveEvent 138 231 0 0 0 0 0\n"
+"MouseMoveEvent 140 232 0 0 0 0 0\n"
+"TimerEvent 140 232 0 0 0 0 0\n"
+"RenderEvent 140 232 0 0 0 0 0\n"
+"MouseMoveEvent 142 233 0 0 0 0 0\n"
+"MouseMoveEvent 143 233 0 0 0 0 0\n"
+"MouseMoveEvent 144 233 0 0 0 0 0\n"
 "TimerEvent 144 233 0 0 0 0 0\n"
 "RenderEvent 144 233 0 0 0 0 0\n"
 "MouseMoveEvent 148 235 0 0 0 0 0\n"
+"TimerEvent 148 235 0 0 0 0 0\n"
+"RenderEvent 148 235 0 0 0 0 0\n"
+"MouseMoveEvent 157 239 0 0 0 0 0\n"
+"MouseMoveEvent 158 240 0 0 0 0 0\n"
+"TimerEvent 158 240 0 0 0 0 0\n"
+"RenderEvent 158 240 0 0 0 0 0\n"
+"MouseMoveEvent 163 242 0 0 0 0 0\n"
+"TimerEvent 163 242 0 0 0 0 0\n"
+"RenderEvent 163 242 0 0 0 0 0\n"
+"MouseMoveEvent 165 243 0 0 0 0 0\n"
+"MouseMoveEvent 167 244 0 0 0 0 0\n"
+"TimerEvent 167 244 0 0 0 0 0\n"
+"RenderEvent 167 244 0 0 0 0 0\n"
+"MouseMoveEvent 171 246 0 0 0 0 0\n"
+"MouseMoveEvent 172 247 0 0 0 0 0\n"
+"TimerEvent 172 247 0 0 0 0 0\n"
+"RenderEvent 172 247 0 0 0 0 0\n"
+"MouseMoveEvent 174 249 0 0 0 0 0\n"
+"MouseMoveEvent 175 250 0 0 0 0 0\n"
+"TimerEvent 175 250 0 0 0 0 0\n"
+"RenderEvent 175 250 0 0 0 0 0\n"
+"MouseMoveEvent 176 252 0 0 0 0 0\n"
+"MouseMoveEvent 176 253 0 0 0 0 0\n"
 "TimerEvent 176 253 0 0 0 0 0\n"
 "RenderEvent 176 253 0 0 0 0 0\n"
 "MouseMoveEvent 176 257 0 0 0 0 0\n"
 "MouseMoveEvent 176 258 0 0 0 0 0\n"
+"TimerEvent 176 258 0 0 0 0 0\n"
+"RenderEvent 176 258 0 0 0 0 0\n"
+"MouseMoveEvent 176 261 0 0 0 0 0\n"
+"MouseMoveEvent 176 262 0 0 0 0 0\n"
+"TimerEvent 176 262 0 0 0 0 0\n"
+"RenderEvent 176 262 0 0 0 0 0\n"
+"MouseMoveEvent 175 264 0 0 0 0 0\n"
+"MouseMoveEvent 174 265 0 0 0 0 0\n"
+"TimerEvent 174 265 0 0 0 0 0\n"
+"RenderEvent 174 265 0 0 0 0 0\n"
+"MouseMoveEvent 174 266 0 0 0 0 0\n"
+"MouseMoveEvent 174 267 0 0 0 0 0\n"
+"TimerEvent 174 267 0 0 0 0 0\n"
+"RenderEvent 174 267 0 0 0 0 0\n"
+"MouseMoveEvent 173 270 0 0 0 0 0\n"
+"MouseMoveEvent 173 271 0 0 0 0 0\n"
+"MouseMoveEvent 173 272 0 0 0 0 0\n"
 "TimerEvent 173 272 0 0 0 0 0\n"
 "RenderEvent 173 272 0 0 0 0 0\n"
 "MouseMoveEvent 173 275 0 0 0 0 0\n"
 "MouseMoveEvent 173 276 0 0 0 0 0\n"
 "MouseMoveEvent 173 277 0 0 0 0 0\n"
+"TimerEvent 173 277 0 0 0 0 0\n"
+"RenderEvent 173 277 0 0 0 0 0\n"
+"MouseMoveEvent 173 280 0 0 0 0 0\n"
+"MouseMoveEvent 173 282 0 0 0 0 0\n"
+"TimerEvent 173 282 0 0 0 0 0\n"
+"RenderEvent 173 282 0 0 0 0 0\n"
+"MouseMoveEvent 173 285 0 0 0 0 0\n"
+"MouseMoveEvent 173 287 0 0 0 0 0\n"
+"TimerEvent 173 287 0 0 0 0 0\n"
+"RenderEvent 173 287 0 0 0 0 0\n"
+"MouseMoveEvent 173 292 0 0 0 0 0\n"
+"MouseMoveEvent 174 294 0 0 0 0 0\n"
 "TimerEvent 174 294 0 0 0 0 0\n"
 "RenderEvent 174 294 0 0 0 0 0\n"
 "MouseMoveEvent 174 299 0 0 0 0 0\n"
 "MouseMoveEvent 174 300 0 0 0 0 0\n"
+"TimerEvent 174 300 0 0 0 0 0\n"
+"RenderEvent 174 300 0 0 0 0 0\n"
+"MouseMoveEvent 174 305 0 0 0 0 0\n"
+"MouseMoveEvent 174 307 0 0 0 0 0\n"
+"MouseMoveEvent 174 309 0 0 0 0 0\n"
+"TimerEvent 174 309 0 0 0 0 0\n"
+"RenderEvent 174 309 0 0 0 0 0\n"
+"MouseMoveEvent 174 313 0 0 0 0 0\n"
+"MouseMoveEvent 174 314 0 0 0 0 0\n"
+"TimerEvent 174 314 0 0 0 0 0\n"
+"RenderEvent 174 314 0 0 0 0 0\n"
+"MouseMoveEvent 173 317 0 0 0 0 0\n"
+"MouseMoveEvent 172 318 0 0 0 0 0\n"
+"TimerEvent 172 318 0 0 0 0 0\n"
+"RenderEvent 172 318 0 0 0 0 0\n"
+"MouseMoveEvent 171 319 0 0 0 0 0\n"
+"MouseMoveEvent 170 320 0 0 0 0 0\n"
+"MouseMoveEvent 169 321 0 0 0 0 0\n"
+"TimerEvent 169 321 0 0 0 0 0\n"
+"RenderEvent 169 321 0 0 0 0 0\n"
+"MouseMoveEvent 167 323 0 0 0 0 0\n"
+"TimerEvent 167 323 0 0 0 0 0\n"
+"RenderEvent 167 323 0 0 0 0 0\n"
+"MouseMoveEvent 165 323 0 0 0 0 0\n"
+"MouseMoveEvent 164 323 0 0 0 0 0\n"
+"TimerEvent 164 323 0 0 0 0 0\n"
+"RenderEvent 164 323 0 0 0 0 0\n"
+"MouseMoveEvent 162 323 0 0 0 0 0\n"
+"MouseMoveEvent 161 323 0 0 0 0 0\n"
+"TimerEvent 161 323 0 0 0 0 0\n"
+"RenderEvent 161 323 0 0 0 0 0\n"
+"MouseMoveEvent 158 323 0 0 0 0 0\n"
+"MouseMoveEvent 156 323 0 0 0 0 0\n"
 "TimerEvent 156 323 0 0 0 0 0\n"
 "RenderEvent 156 323 0 0 0 0 0\n"
 "MouseMoveEvent 150 323 0 0 0 0 0\n"
 "MouseMoveEvent 148 323 0 0 0 0 0\n"
+"TimerEvent 148 323 0 0 0 0 0\n"
+"RenderEvent 148 323 0 0 0 0 0\n"
+"MouseMoveEvent 143 323 0 0 0 0 0\n"
+"MouseMoveEvent 141 323 0 0 0 0 0\n"
+"MouseMoveEvent 139 323 0 0 0 0 0\n"
+"TimerEvent 139 323 0 0 0 0 0\n"
+"RenderEvent 139 323 0 0 0 0 0\n"
+"MouseMoveEvent 136 323 0 0 0 0 0\n"
+"MouseMoveEvent 135 323 0 0 0 0 0\n"
+"TimerEvent 135 323 0 0 0 0 0\n"
+"RenderEvent 135 323 0 0 0 0 0\n"
+"MouseMoveEvent 132 323 0 0 0 0 0\n"
+"TimerEvent 132 323 0 0 0 0 0\n"
+"RenderEvent 132 323 0 0 0 0 0\n"
+"MouseMoveEvent 131 323 0 0 0 0 0\n"
+"TimerEvent 131 323 0 0 0 0 0\n"
+"RenderEvent 131 323 0 0 0 0 0\n"
+"MouseMoveEvent 130 324 0 0 0 0 0\n"
+"TimerEvent 130 324 0 0 0 0 0\n"
+"RenderEvent 130 324 0 0 0 0 0\n"
+"MouseMoveEvent 129 325 0 0 0 0 0\n"
+"MouseMoveEvent 128 326 0 0 0 0 0\n"
+"TimerEvent 128 326 0 0 0 0 0\n"
+"RenderEvent 128 326 0 0 0 0 0\n"
+"MouseMoveEvent 127 327 0 0 0 0 0\n"
 "TimerEvent 127 327 0 0 0 0 0\n"
 "RenderEvent 127 327 0 0 0 0 0\n"
 "MouseMoveEvent 126 329 0 0 0 0 0\n"
+"TimerEvent 126 329 0 0 0 0 0\n"
+"RenderEvent 126 329 0 0 0 0 0\n"
+"MouseMoveEvent 126 330 0 0 0 0 0\n"
+"TimerEvent 126 330 0 0 0 0 0\n"
+"RenderEvent 126 330 0 0 0 0 0\n"
 "TimerEvent 126 330 0 0 0 0 0\n"
 "RenderEvent 126 330 0 0 0 0 0\n"
 "LeftButtonReleaseEvent 126 330 0 0 0 0 0\n"
 "EndInteractionEvent 126 330 0 0 0 0 0\n"
 "RenderEvent 126 330 0 0 0 0 0\n"
 "MouseMoveEvent 128 328 0 0 0 0 0\n"
+"MouseMoveEvent 131 322 0 0 0 0 0\n"
+"MouseMoveEvent 135 316 0 0 0 0 0\n"
+"MouseMoveEvent 140 310 0 0 0 0 0\n"
+"MouseMoveEvent 144 301 0 0 0 0 0\n"
+"MouseMoveEvent 149 293 0 0 0 0 0\n"
+"MouseMoveEvent 154 283 0 0 0 0 0\n"
+"MouseMoveEvent 158 272 0 0 0 0 0\n"
 "MouseMoveEvent 163 266 0 0 0 0 0\n"
+"MouseMoveEvent 165 259 0 0 0 0 0\n"
+"MouseMoveEvent 168 253 0 0 0 0 0\n"
+"MouseMoveEvent 170 248 0 0 0 0 0\n"
 "MouseMoveEvent 172 244 0 0 0 0 0\n"
 "MouseMoveEvent 172 243 0 0 0 0 0\n"
 "MouseMoveEvent 173 242 0 0 0 0 0\n"
@@ -246,6 +848,14 @@ static const char * TestGPURayCastVolumeUpdateLog =
 "RenderEvent 173 242 0 0 0 0 0\n"
 "MouseMoveEvent 174 242 0 0 0 0 0\n"
 "MouseMoveEvent 175 242 0 0 0 0 0\n"
+"TimerEvent 175 242 0 0 0 0 0\n"
+"RenderEvent 175 242 0 0 0 0 0\n"
+"MouseMoveEvent 181 252 0 0 0 0 0\n"
+"MouseMoveEvent 181 254 0 0 0 0 0\n"
+"TimerEvent 181 254 0 0 0 0 0\n"
+"RenderEvent 181 254 0 0 0 0 0\n"
+"MouseMoveEvent 182 261 0 0 0 0 0\n"
+"MouseMoveEvent 182 263 0 0 0 0 0\n"
 "TimerEvent 182 263 0 0 0 0 0\n"
 "RenderEvent 182 263 0 0 0 0 0\n"
 "MouseMoveEvent 182 269 0 0 0 0 0\n"
@@ -253,15 +863,48 @@ static const char * TestGPURayCastVolumeUpdateLog =
 "TimerEvent 182 270 0 0 0 0 0\n"
 "RenderEvent 182 270 0 0 0 0 0\n"
 "MouseMoveEvent 182 274 0 0 0 0 0\n"
+"TimerEvent 182 274 0 0 0 0 0\n"
+"RenderEvent 182 274 0 0 0 0 0\n"
+"MouseMoveEvent 182 275 0 0 0 0 0\n"
+"MouseMoveEvent 182 276 0 0 0 0 0\n"
+"TimerEvent 182 276 0 0 0 0 0\n"
+"RenderEvent 182 276 0 0 0 0 0\n"
+"MouseMoveEvent 183 277 0 0 0 0 0\n"
+"MouseMoveEvent 184 278 0 0 0 0 0\n"
+"TimerEvent 184 278 0 0 0 0 0\n"
+"RenderEvent 184 278 0 0 0 0 0\n"
+"MouseMoveEvent 186 280 0 0 0 0 0\n"
+"MouseMoveEvent 187 281 0 0 0 0 0\n"
 "TimerEvent 187 281 0 0 0 0 0\n"
 "RenderEvent 187 281 0 0 0 0 0\n"
 "MouseMoveEvent 192 284 0 0 0 0 0\n"
 "MouseMoveEvent 193 285 0 0 0 0 0\n"
 "MouseMoveEvent 195 286 0 0 0 0 0\n"
+"TimerEvent 195 286 0 0 0 0 0\n"
+"RenderEvent 195 286 0 0 0 0 0\n"
+"MouseMoveEvent 198 287 0 0 0 0 0\n"
+"TimerEvent 198 287 0 0 0 0 0\n"
+"RenderEvent 198 287 0 0 0 0 0\n"
+"MouseMoveEvent 200 288 0 0 0 0 0\n"
+"MouseMoveEvent 201 288 0 0 0 0 0\n"
 "TimerEvent 201 288 0 0 0 0 0\n"
 "RenderEvent 201 288 0 0 0 0 0\n"
 "MouseMoveEvent 207 288 0 0 0 0 0\n"
 "MouseMoveEvent 208 288 0 0 0 0 0\n"
+"TimerEvent 208 288 0 0 0 0 0\n"
+"RenderEvent 208 288 0 0 0 0 0\n"
+"MouseMoveEvent 212 288 0 0 0 0 0\n"
+"MouseMoveEvent 213 288 0 0 0 0 0\n"
+"MouseMoveEvent 214 288 0 0 0 0 0\n"
+"TimerEvent 214 288 0 0 0 0 0\n"
+"RenderEvent 214 288 0 0 0 0 0\n"
+"MouseMoveEvent 220 288 0 0 0 0 0\n"
+"MouseMoveEvent 221 288 0 0 0 0 0\n"
+"TimerEvent 221 288 0 0 0 0 0\n"
+"RenderEvent 221 288 0 0 0 0 0\n"
+"MouseMoveEvent 226 288 0 0 0 0 0\n"
+"TimerEvent 226 288 0 0 0 0 0\n"
+"RenderEvent 226 288 0 0 0 0 0\n"
 "TimerEvent 226 288 0 0 0 0 0\n"
 "RenderEvent 226 288 0 0 0 0 0\n"
 "MouseMoveEvent 228 288 0 0 0 0 0\n"
@@ -270,7 +913,14 @@ static const char * TestGPURayCastVolumeUpdateLog =
 "RenderEvent 228 288 0 0 0 0 0\n"
 "MouseMoveEvent 230 288 0 0 0 0 0\n"
 "MouseMoveEvent 229 287 0 0 0 0 0\n"
+"MouseMoveEvent 229 286 0 0 0 0 0\n"
+"MouseMoveEvent 228 285 0 0 0 0 0\n"
+"MouseMoveEvent 227 284 0 0 0 0 0\n"
+"MouseMoveEvent 226 282 0 0 0 0 0\n"
+"MouseMoveEvent 225 280 0 0 0 0 0\n"
 "MouseMoveEvent 224 279 0 0 0 0 0\n"
+"MouseMoveEvent 223 278 0 0 0 0 0\n"
+"MouseMoveEvent 222 278 0 0 0 0 0\n"
 "MouseMoveEvent 221 278 0 0 0 0 0\n"
 "MouseMoveEvent 220 278 0 0 0 0 0\n"
 "MouseMoveEvent 219 278 0 0 0 0 0\n"
@@ -281,16 +931,35 @@ static const char * TestGPURayCastVolumeUpdateLog =
 "RenderEvent 218 278 0 0 0 0 0\n"
 "MouseMoveEvent 213 278 0 0 0 0 0\n"
 "MouseMoveEvent 212 278 0 0 0 0 0\n"
+"TimerEvent 212 278 0 0 0 0 0\n"
+"RenderEvent 212 278 0 0 0 0 0\n"
+"MouseMoveEvent 206 279 0 0 0 0 0\n"
 "TimerEvent 206 279 0 0 0 0 0\n"
 "RenderEvent 206 279 0 0 0 0 0\n"
 "MouseMoveEvent 196 281 0 0 0 0 0\n"
 "MouseMoveEvent 193 281 0 0 0 0 0\n"
+"TimerEvent 193 281 0 0 0 0 0\n"
+"RenderEvent 193 281 0 0 0 0 0\n"
+"MouseMoveEvent 175 287 0 0 0 0 0\n"
+"MouseMoveEvent 172 288 0 0 0 0 0\n"
+"MouseMoveEvent 169 289 0 0 0 0 0\n"
 "TimerEvent 169 289 0 0 0 0 0\n"
 "RenderEvent 169 289 0 0 0 0 0\n"
 "MouseMoveEvent 159 294 0 0 0 0 0\n"
+"TimerEvent 159 294 0 0 0 0 0\n"
+"RenderEvent 159 294 0 0 0 0 0\n"
+"MouseMoveEvent 155 296 0 0 0 0 0\n"
+"TimerEvent 155 296 0 0 0 0 0\n"
+"RenderEvent 155 296 0 0 0 0 0\n"
+"MouseMoveEvent 152 297 0 0 0 0 0\n"
+"MouseMoveEvent 151 297 0 0 0 0 0\n"
 "TimerEvent 151 297 0 0 0 0 0\n"
 "RenderEvent 151 297 0 0 0 0 0\n"
 "MouseMoveEvent 147 298 0 0 0 0 0\n"
+"TimerEvent 147 298 0 0 0 0 0\n"
+"RenderEvent 147 298 0 0 0 0 0\n"
+"MouseMoveEvent 143 298 0 0 0 0 0\n"
+"MouseMoveEvent 142 298 0 0 0 0 0\n"
 "TimerEvent 142 298 0 0 0 0 0\n"
 "RenderEvent 142 298 0 0 0 0 0\n"
 "MouseMoveEvent 141 299 0 0 0 0 0\n"
@@ -305,10 +974,38 @@ static const char * TestGPURayCastVolumeUpdateLog =
 "MouseMoveEvent 141 295 0 0 0 0 0\n"
 "MouseMoveEvent 142 293 0 0 0 0 0\n"
 "MouseMoveEvent 143 291 0 0 0 0 0\n"
+"MouseMoveEvent 143 289 0 0 0 0 0\n"
+"MouseMoveEvent 144 286 0 0 0 0 0\n"
+"MouseMoveEvent 145 284 0 0 0 0 0\n"
+"MouseMoveEvent 147 282 0 0 0 0 0\n"
+"MouseMoveEvent 148 279 0 0 0 0 0\n"
+"MouseMoveEvent 150 277 0 0 0 0 0\n"
 "MouseMoveEvent 152 275 0 0 0 0 0\n"
 "MouseMoveEvent 153 274 0 0 0 0 0\n"
+"MouseMoveEvent 156 272 0 0 0 0 0\n"
+"MouseMoveEvent 157 271 0 0 0 0 0\n"
+"MouseMoveEvent 160 270 0 0 0 0 0\n"
+"MouseMoveEvent 162 269 0 0 0 0 0\n"
+"MouseMoveEvent 163 268 0 0 0 0 0\n"
+"MouseMoveEvent 165 267 0 0 0 0 0\n"
 "MouseMoveEvent 167 266 0 0 0 0 0\n"
+"MouseMoveEvent 168 265 0 0 0 0 0\n"
+"MouseMoveEvent 170 264 0 0 0 0 0\n"
+"MouseMoveEvent 171 263 0 0 0 0 0\n"
+"MouseMoveEvent 173 262 0 0 0 0 0\n"
+"MouseMoveEvent 174 261 0 0 0 0 0\n"
+"MouseMoveEvent 177 259 0 0 0 0 0\n"
+"MouseMoveEvent 178 258 0 0 0 0 0\n"
+"MouseMoveEvent 179 257 0 0 0 0 0\n"
+"MouseMoveEvent 180 256 0 0 0 0 0\n"
+"MouseMoveEvent 181 255 0 0 0 0 0\n"
+"MouseMoveEvent 183 254 0 0 0 0 0\n"
+"MouseMoveEvent 184 253 0 0 0 0 0\n"
+"MouseMoveEvent 185 252 0 0 0 0 0\n"
 "MouseMoveEvent 186 251 0 0 0 0 0\n"
+"MouseMoveEvent 187 250 0 0 0 0 0\n"
+"MouseMoveEvent 188 249 0 0 0 0 0\n"
+"MouseMoveEvent 189 248 0 0 0 0 0\n"
 "MouseMoveEvent 190 246 0 0 0 0 0\n"
 "MouseMoveEvent 191 245 0 0 0 0 0\n"
 "LeftButtonPressEvent 191 245 0 0 0 0 0\n"
@@ -316,9 +1013,17 @@ static const char * TestGPURayCastVolumeUpdateLog =
 "TimerEvent 191 245 0 0 0 0 0\n"
 "RenderEvent 191 245 0 0 0 0 0\n"
 "MouseMoveEvent 191 247 0 0 0 0 0\n"
+"TimerEvent 191 247 0 0 0 0 0\n"
+"RenderEvent 191 247 0 0 0 0 0\n"
+"MouseMoveEvent 192 248 0 0 0 0 0\n"
 "TimerEvent 192 248 0 0 0 0 0\n"
 "RenderEvent 192 248 0 0 0 0 0\n"
 "MouseMoveEvent 195 251 0 0 0 0 0\n"
+"TimerEvent 195 251 0 0 0 0 0\n"
+"RenderEvent 195 251 0 0 0 0 0\n"
+"MouseMoveEvent 197 252 0 0 0 0 0\n"
+"TimerEvent 197 252 0 0 0 0 0\n"
+"RenderEvent 197 252 0 0 0 0 0\n"
 "TimerEvent 197 252 0 0 0 0 0\n"
 "RenderEvent 197 252 0 0 0 0 0\n"
 "TimerEvent 197 252 0 0 0 0 0\n"
@@ -326,6 +1031,21 @@ static const char * TestGPURayCastVolumeUpdateLog =
 "MouseMoveEvent 201 252 0 0 0 0 0\n"
 "MouseMoveEvent 202 252 0 0 0 0 0\n"
 "MouseMoveEvent 203 252 0 0 0 0 0\n"
+"TimerEvent 203 252 0 0 0 0 0\n"
+"RenderEvent 203 252 0 0 0 0 0\n"
+"MouseMoveEvent 210 252 0 0 0 0 0\n"
+"MouseMoveEvent 211 252 0 0 0 0 0\n"
+"TimerEvent 211 252 0 0 0 0 0\n"
+"RenderEvent 211 252 0 0 0 0 0\n"
+"MouseMoveEvent 214 251 0 0 0 0 0\n"
+"TimerEvent 214 251 0 0 0 0 0\n"
+"RenderEvent 214 251 0 0 0 0 0\n"
+"TimerEvent 214 251 0 0 0 0 0\n"
+"RenderEvent 214 251 0 0 0 0 0\n"
+"TimerEvent 214 251 0 0 0 0 0\n"
+"RenderEvent 214 251 0 0 0 0 0\n"
+"TimerEvent 214 251 0 0 0 0 0\n"
+"RenderEvent 214 251 0 0 0 0 0\n"
 "TimerEvent 214 251 0 0 0 0 0\n"
 "RenderEvent 214 251 0 0 0 0 0\n"
 "MouseMoveEvent 216 251 0 0 0 0 0\n"
@@ -336,8 +1056,31 @@ static const char * TestGPURayCastVolumeUpdateLog =
 "EndInteractionEvent 218 250 0 0 0 0 0\n"
 "RenderEvent 218 250 0 0 0 0 0\n"
 "MouseMoveEvent 219 250 0 0 0 0 0\n"
+"MouseMoveEvent 220 249 0 0 0 0 0\n"
+"MouseMoveEvent 221 248 0 0 0 0 0\n"
+"MouseMoveEvent 222 247 0 0 0 0 0\n"
+"MouseMoveEvent 223 246 0 0 0 0 0\n"
+"MouseMoveEvent 223 245 0 0 0 0 0\n"
+"MouseMoveEvent 223 244 0 0 0 0 0\n"
+"MouseMoveEvent 223 243 0 0 0 0 0\n"
+"MouseMoveEvent 223 242 0 0 0 0 0\n"
 "MouseMoveEvent 223 241 0 0 0 0 0\n"
+"MouseMoveEvent 223 239 0 0 0 0 0\n"
+"MouseMoveEvent 223 238 0 0 0 0 0\n"
+"MouseMoveEvent 222 237 0 0 0 0 0\n"
+"MouseMoveEvent 221 236 0 0 0 0 0\n"
+"MouseMoveEvent 221 235 0 0 0 0 0\n"
+"MouseMoveEvent 221 234 0 0 0 0 0\n"
+"MouseMoveEvent 220 233 0 0 0 0 0\n"
+"MouseMoveEvent 220 232 0 0 0 0 0\n"
+"MouseMoveEvent 220 231 0 0 0 0 0\n"
 "MouseMoveEvent 220 230 0 0 0 0 0\n"
+"MouseMoveEvent 219 228 0 0 0 0 0\n"
+"MouseMoveEvent 219 227 0 0 0 0 0\n"
+"MouseMoveEvent 219 226 0 0 0 0 0\n"
+"MouseMoveEvent 219 225 0 0 0 0 0\n"
+"MouseMoveEvent 218 224 0 0 0 0 0\n"
+"MouseMoveEvent 218 222 0 0 0 0 0\n"
 "MouseMoveEvent 218 221 0 0 0 0 0\n"
 "MouseMoveEvent 218 220 0 0 0 0 0\n"
 "LeftButtonPressEvent 218 220 0 0 0 0 0\n"
@@ -347,18 +1090,33 @@ static const char * TestGPURayCastVolumeUpdateLog =
 "RenderEvent 218 219 0 0 0 0 0\n"
 "MouseMoveEvent 218 210 0 0 0 0 0\n"
 "MouseMoveEvent 218 209 0 0 0 0 0\n"
+"TimerEvent 218 209 0 0 0 0 0\n"
+"RenderEvent 218 209 0 0 0 0 0\n"
+"MouseMoveEvent 218 204 0 0 0 0 0\n"
+"MouseMoveEvent 218 202 0 0 0 0 0\n"
 "TimerEvent 218 202 0 0 0 0 0\n"
 "RenderEvent 218 202 0 0 0 0 0\n"
 "MouseMoveEvent 219 199 0 0 0 0 0\n"
 "MouseMoveEvent 219 198 0 0 0 0 0\n"
+"TimerEvent 219 198 0 0 0 0 0\n"
+"RenderEvent 219 198 0 0 0 0 0\n"
+"MouseMoveEvent 220 196 0 0 0 0 0\n"
+"TimerEvent 220 196 0 0 0 0 0\n"
+"RenderEvent 220 196 0 0 0 0 0\n"
 "TimerEvent 220 196 0 0 0 0 0\n"
 "RenderEvent 220 196 0 0 0 0 0\n"
 "MouseMoveEvent 220 194 0 0 0 0 0\n"
 "MouseMoveEvent 220 193 0 0 0 0 0\n"
 "MouseMoveEvent 220 192 0 0 0 0 0\n"
+"TimerEvent 220 192 0 0 0 0 0\n"
+"RenderEvent 220 192 0 0 0 0 0\n"
+"MouseMoveEvent 221 190 0 0 0 0 0\n"
 "TimerEvent 221 190 0 0 0 0 0\n"
 "RenderEvent 221 190 0 0 0 0 0\n"
 "MouseMoveEvent 221 188 0 0 0 0 0\n"
+"TimerEvent 221 188 0 0 0 0 0\n"
+"RenderEvent 221 188 0 0 0 0 0\n"
+"MouseMoveEvent 221 187 0 0 0 0 0\n"
 "TimerEvent 221 187 0 0 0 0 0\n"
 "RenderEvent 221 187 0 0 0 0 0\n"
 "MouseMoveEvent 221 185 0 0 0 0 0\n"
@@ -369,10 +1127,57 @@ static const char * TestGPURayCastVolumeUpdateLog =
 "MouseMoveEvent 220 182 0 0 0 0 0\n"
 "MouseMoveEvent 220 181 0 0 0 0 0\n"
 "MouseMoveEvent 219 180 0 0 0 0 0\n"
+"MouseMoveEvent 220 178 0 0 0 0 0\n"
+"MouseMoveEvent 221 177 0 0 0 0 0\n"
+"MouseMoveEvent 222 177 0 0 0 0 0\n"
+"MouseMoveEvent 223 177 0 0 0 0 0\n"
+"MouseMoveEvent 225 178 0 0 0 0 0\n"
+"MouseMoveEvent 226 178 0 0 0 0 0\n"
+"MouseMoveEvent 227 178 0 0 0 0 0\n"
+"MouseMoveEvent 228 179 0 0 0 0 0\n"
+"MouseMoveEvent 230 179 0 0 0 0 0\n"
+"MouseMoveEvent 233 180 0 0 0 0 0\n"
+"MouseMoveEvent 234 180 0 0 0 0 0\n"
 "MouseMoveEvent 236 181 0 0 0 0 0\n"
+"MouseMoveEvent 238 182 0 0 0 0 0\n"
+"MouseMoveEvent 239 182 0 0 0 0 0\n"
+"MouseMoveEvent 241 183 0 0 0 0 0\n"
+"MouseMoveEvent 243 184 0 0 0 0 0\n"
+"MouseMoveEvent 244 185 0 0 0 0 0\n"
+"MouseMoveEvent 245 185 0 0 0 0 0\n"
+"MouseMoveEvent 246 186 0 0 0 0 0\n"
+"MouseMoveEvent 247 187 0 0 0 0 0\n"
 "MouseMoveEvent 249 188 0 0 0 0 0\n"
+"MouseMoveEvent 250 189 0 0 0 0 0\n"
+"MouseMoveEvent 252 190 0 0 0 0 0\n"
+"MouseMoveEvent 254 192 0 0 0 0 0\n"
+"MouseMoveEvent 257 194 0 0 0 0 0\n"
+"MouseMoveEvent 260 197 0 0 0 0 0\n"
+"MouseMoveEvent 263 200 0 0 0 0 0\n"
+"MouseMoveEvent 268 207 0 0 0 0 0\n"
+"MouseMoveEvent 274 214 0 0 0 0 0\n"
+"MouseMoveEvent 280 224 0 0 0 0 0\n"
+"MouseMoveEvent 284 234 0 0 0 0 0\n"
+"MouseMoveEvent 289 243 0 0 0 0 0\n"
+"MouseMoveEvent 290 252 0 0 0 0 0\n"
+"MouseMoveEvent 293 261 0 0 0 0 0\n"
 "MouseMoveEvent 295 273 0 0 0 0 0\n"
+"MouseMoveEvent 295 284 0 0 0 0 0\n"
+"MouseMoveEvent 297 296 0 0 0 0 0\n"
+"MouseMoveEvent 299 309 0 0 0 0 0\n"
+"MouseMoveEvent 300 320 0 0 0 0 0\n"
+"MouseMoveEvent 300 331 0 0 0 0 0\n"
+"MouseMoveEvent 300 338 0 0 0 0 0\n"
+"MouseMoveEvent 300 345 0 0 0 0 0\n"
+"MouseMoveEvent 300 351 0 0 0 0 0\n"
+"MouseMoveEvent 300 357 0 0 0 0 0\n"
 "MouseMoveEvent 300 364 0 0 0 0 0\n"
+"MouseMoveEvent 300 370 0 0 0 0 0\n"
+"MouseMoveEvent 300 374 0 0 0 0 0\n"
+"MouseMoveEvent 300 380 0 0 0 0 0\n"
+"MouseMoveEvent 300 386 0 0 0 0 0\n"
+"MouseMoveEvent 302 390 0 0 0 0 0\n"
+"MouseMoveEvent 304 394 0 0 0 0 0\n"
 "MouseMoveEvent 304 397 0 0 0 0 0\n"
 "MouseMoveEvent 305 399 0 0 0 0 0\n"
 ;
diff --git a/Rendering/Volume/Testing/Cxx/TestGPUVolumeRayCastMapper.cxx b/Rendering/Volume/Testing/Cxx/TestGPUVolumeRayCastMapper.cxx
deleted file mode 100644
index c0faf26..0000000
--- a/Rendering/Volume/Testing/Cxx/TestGPUVolumeRayCastMapper.cxx
+++ /dev/null
@@ -1,1310 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    TestGPUVolumeRayCastMapper.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.
-
-=========================================================================*/
-
-// Description
-// This is a basic test that creates and volume renders the wavelet dataset.
-
-#include "vtkCamera.h"
-#include "vtkColorTransferFunction.h"
-#include "vtkGPUVolumeRayCastMapper.h"
-#include "vtkImageData.h"
-#include "vtkInteractorStyleTrackballCamera.h"
-#include "vtkNew.h"
-#include "vtkPiecewiseFunction.h"
-#include "vtkRenderer.h"
-#include "vtkRenderWindow.h"
-#include "vtkRenderWindowInteractor.h"
-#include "vtkRTAnalyticSource.h"
-#include "vtkTesting.h"
-#include "vtkTimerLog.h"
-#include "vtkVolume.h"
-#include "vtkVolumeProperty.h"
-
-static const char * TestGPUVolumeRayCastMapperLog =
-"# StreamVersion 1\n"
-"EnterEvent 299 0 0 0 0 0 0\n"
-"MouseMoveEvent 299 0 0 0 0 0 0\n"
-"MouseMoveEvent 298 2 0 0 0 0 0\n"
-"MouseMoveEvent 297 4 0 0 0 0 0\n"
-"MouseMoveEvent 297 6 0 0 0 0 0\n"
-"MouseMoveEvent 296 8 0 0 0 0 0\n"
-"MouseMoveEvent 294 11 0 0 0 0 0\n"
-"MouseMoveEvent 292 14 0 0 0 0 0\n"
-"MouseMoveEvent 290 18 0 0 0 0 0\n"
-"MouseMoveEvent 287 23 0 0 0 0 0\n"
-"MouseMoveEvent 283 29 0 0 0 0 0\n"
-"MouseMoveEvent 279 37 0 0 0 0 0\n"
-"MouseMoveEvent 275 44 0 0 0 0 0\n"
-"MouseMoveEvent 271 51 0 0 0 0 0\n"
-"MouseMoveEvent 270 58 0 0 0 0 0\n"
-"MouseMoveEvent 267 65 0 0 0 0 0\n"
-"MouseMoveEvent 265 72 0 0 0 0 0\n"
-"MouseMoveEvent 262 80 0 0 0 0 0\n"
-"MouseMoveEvent 260 89 0 0 0 0 0\n"
-"MouseMoveEvent 257 99 0 0 0 0 0\n"
-"MouseMoveEvent 255 109 0 0 0 0 0\n"
-"MouseMoveEvent 253 119 0 0 0 0 0\n"
-"MouseMoveEvent 251 126 0 0 0 0 0\n"
-"MouseMoveEvent 251 132 0 0 0 0 0\n"
-"MouseMoveEvent 251 139 0 0 0 0 0\n"
-"MouseMoveEvent 250 145 0 0 0 0 0\n"
-"MouseMoveEvent 250 151 0 0 0 0 0\n"
-"MouseMoveEvent 248 157 0 0 0 0 0\n"
-"MouseMoveEvent 248 163 0 0 0 0 0\n"
-"MouseMoveEvent 246 168 0 0 0 0 0\n"
-"MouseMoveEvent 244 172 0 0 0 0 0\n"
-"MouseMoveEvent 244 176 0 0 0 0 0\n"
-"MouseMoveEvent 243 180 0 0 0 0 0\n"
-"MouseMoveEvent 243 182 0 0 0 0 0\n"
-"MouseMoveEvent 243 184 0 0 0 0 0\n"
-"MouseMoveEvent 243 186 0 0 0 0 0\n"
-"MouseMoveEvent 242 188 0 0 0 0 0\n"
-"MouseMoveEvent 242 190 0 0 0 0 0\n"
-"MouseMoveEvent 241 193 0 0 0 0 0\n"
-"MouseMoveEvent 241 196 0 0 0 0 0\n"
-"MouseMoveEvent 240 198 0 0 0 0 0\n"
-"MouseMoveEvent 239 200 0 0 0 0 0\n"
-"MouseMoveEvent 239 204 0 0 0 0 0\n"
-"MouseMoveEvent 238 206 0 0 0 0 0\n"
-"MouseMoveEvent 237 209 0 0 0 0 0\n"
-"MouseMoveEvent 236 212 0 0 0 0 0\n"
-"MouseMoveEvent 236 214 0 0 0 0 0\n"
-"MouseMoveEvent 236 216 0 0 0 0 0\n"
-"MouseMoveEvent 235 219 0 0 0 0 0\n"
-"MouseMoveEvent 235 220 0 0 0 0 0\n"
-"MouseMoveEvent 233 223 0 0 0 0 0\n"
-"MouseMoveEvent 233 224 0 0 0 0 0\n"
-"MouseMoveEvent 232 225 0 0 0 0 0\n"
-"MouseMoveEvent 232 226 0 0 0 0 0\n"
-"MouseMoveEvent 231 227 0 0 0 0 0\n"
-"MouseMoveEvent 231 228 0 0 0 0 0\n"
-"MouseMoveEvent 230 230 0 0 0 0 0\n"
-"MouseMoveEvent 229 232 0 0 0 0 0\n"
-"MouseMoveEvent 229 233 0 0 0 0 0\n"
-"MouseMoveEvent 228 235 0 0 0 0 0\n"
-"MouseMoveEvent 227 236 0 0 0 0 0\n"
-"MouseMoveEvent 227 237 0 0 0 0 0\n"
-"MouseMoveEvent 227 238 0 0 0 0 0\n"
-"MouseMoveEvent 226 239 0 0 0 0 0\n"
-"MouseMoveEvent 226 240 0 0 0 0 0\n"
-"MouseMoveEvent 225 241 0 0 0 0 0\n"
-"MouseMoveEvent 224 241 0 0 0 0 0\n"
-"MouseMoveEvent 223 242 0 0 0 0 0\n"
-"MouseMoveEvent 223 243 0 0 0 0 0\n"
-"MouseMoveEvent 222 245 0 0 0 0 0\n"
-"MouseMoveEvent 222 246 0 0 0 0 0\n"
-"MouseMoveEvent 222 249 0 0 0 0 0\n"
-"MouseMoveEvent 222 251 0 0 0 0 0\n"
-"MouseMoveEvent 221 253 0 0 0 0 0\n"
-"MouseMoveEvent 221 255 0 0 0 0 0\n"
-"MouseMoveEvent 221 256 0 0 0 0 0\n"
-"MouseMoveEvent 220 258 0 0 0 0 0\n"
-"MouseMoveEvent 220 259 0 0 0 0 0\n"
-"MouseMoveEvent 220 260 0 0 0 0 0\n"
-"MouseMoveEvent 220 261 0 0 0 0 0\n"
-"MouseMoveEvent 220 262 0 0 0 0 0\n"
-"MouseMoveEvent 220 263 0 0 0 0 0\n"
-"MouseMoveEvent 220 264 0 0 0 0 0\n"
-"MouseMoveEvent 219 266 0 0 0 0 0\n"
-"MouseMoveEvent 219 267 0 0 0 0 0\n"
-"MouseMoveEvent 219 268 0 0 0 0 0\n"
-"MouseMoveEvent 219 269 0 0 0 0 0\n"
-"MouseMoveEvent 218 271 0 0 0 0 0\n"
-"MouseMoveEvent 218 272 0 0 0 0 0\n"
-"LeftButtonPressEvent 218 272 0 0 0 0 0\n"
-"StartInteractionEvent 218 272 0 0 0 0 0\n"
-"MouseMoveEvent 219 273 0 0 0 0 0\n"
-"RenderEvent 219 273 0 0 0 0 0\n"
-"InteractionEvent 219 273 0 0 0 0 0\n"
-"MouseMoveEvent 220 272 0 0 0 0 0\n"
-"RenderEvent 220 272 0 0 0 0 0\n"
-"InteractionEvent 220 272 0 0 0 0 0\n"
-"MouseMoveEvent 220 271 0 0 0 0 0\n"
-"RenderEvent 220 271 0 0 0 0 0\n"
-"InteractionEvent 220 271 0 0 0 0 0\n"
-"MouseMoveEvent 221 270 0 0 0 0 0\n"
-"RenderEvent 221 270 0 0 0 0 0\n"
-"InteractionEvent 221 270 0 0 0 0 0\n"
-"MouseMoveEvent 221 269 0 0 0 0 0\n"
-"RenderEvent 221 269 0 0 0 0 0\n"
-"InteractionEvent 221 269 0 0 0 0 0\n"
-"MouseMoveEvent 221 268 0 0 0 0 0\n"
-"RenderEvent 221 268 0 0 0 0 0\n"
-"InteractionEvent 221 268 0 0 0 0 0\n"
-"MouseMoveEvent 221 266 0 0 0 0 0\n"
-"RenderEvent 221 266 0 0 0 0 0\n"
-"InteractionEvent 221 266 0 0 0 0 0\n"
-"MouseMoveEvent 221 265 0 0 0 0 0\n"
-"RenderEvent 221 265 0 0 0 0 0\n"
-"InteractionEvent 221 265 0 0 0 0 0\n"
-"MouseMoveEvent 222 263 0 0 0 0 0\n"
-"RenderEvent 222 263 0 0 0 0 0\n"
-"InteractionEvent 222 263 0 0 0 0 0\n"
-"MouseMoveEvent 222 262 0 0 0 0 0\n"
-"RenderEvent 222 262 0 0 0 0 0\n"
-"InteractionEvent 222 262 0 0 0 0 0\n"
-"MouseMoveEvent 222 258 0 0 0 0 0\n"
-"RenderEvent 222 258 0 0 0 0 0\n"
-"InteractionEvent 222 258 0 0 0 0 0\n"
-"MouseMoveEvent 223 255 0 0 0 0 0\n"
-"RenderEvent 223 255 0 0 0 0 0\n"
-"InteractionEvent 223 255 0 0 0 0 0\n"
-"MouseMoveEvent 223 253 0 0 0 0 0\n"
-"RenderEvent 223 253 0 0 0 0 0\n"
-"InteractionEvent 223 253 0 0 0 0 0\n"
-"MouseMoveEvent 223 250 0 0 0 0 0\n"
-"RenderEvent 223 250 0 0 0 0 0\n"
-"InteractionEvent 223 250 0 0 0 0 0\n"
-"MouseMoveEvent 223 248 0 0 0 0 0\n"
-"RenderEvent 223 248 0 0 0 0 0\n"
-"InteractionEvent 223 248 0 0 0 0 0\n"
-"MouseMoveEvent 223 247 0 0 0 0 0\n"
-"RenderEvent 223 247 0 0 0 0 0\n"
-"InteractionEvent 223 247 0 0 0 0 0\n"
-"MouseMoveEvent 223 246 0 0 0 0 0\n"
-"RenderEvent 223 246 0 0 0 0 0\n"
-"InteractionEvent 223 246 0 0 0 0 0\n"
-"MouseMoveEvent 223 245 0 0 0 0 0\n"
-"RenderEvent 223 245 0 0 0 0 0\n"
-"InteractionEvent 223 245 0 0 0 0 0\n"
-"MouseMoveEvent 223 244 0 0 0 0 0\n"
-"RenderEvent 223 244 0 0 0 0 0\n"
-"InteractionEvent 223 244 0 0 0 0 0\n"
-"MouseMoveEvent 223 242 0 0 0 0 0\n"
-"RenderEvent 223 242 0 0 0 0 0\n"
-"InteractionEvent 223 242 0 0 0 0 0\n"
-"MouseMoveEvent 223 241 0 0 0 0 0\n"
-"RenderEvent 223 241 0 0 0 0 0\n"
-"InteractionEvent 223 241 0 0 0 0 0\n"
-"MouseMoveEvent 223 240 0 0 0 0 0\n"
-"RenderEvent 223 240 0 0 0 0 0\n"
-"InteractionEvent 223 240 0 0 0 0 0\n"
-"MouseMoveEvent 223 238 0 0 0 0 0\n"
-"RenderEvent 223 238 0 0 0 0 0\n"
-"InteractionEvent 223 238 0 0 0 0 0\n"
-"MouseMoveEvent 223 237 0 0 0 0 0\n"
-"RenderEvent 223 237 0 0 0 0 0\n"
-"InteractionEvent 223 237 0 0 0 0 0\n"
-"MouseMoveEvent 223 235 0 0 0 0 0\n"
-"RenderEvent 223 235 0 0 0 0 0\n"
-"InteractionEvent 223 235 0 0 0 0 0\n"
-"MouseMoveEvent 223 233 0 0 0 0 0\n"
-"RenderEvent 223 233 0 0 0 0 0\n"
-"InteractionEvent 223 233 0 0 0 0 0\n"
-"MouseMoveEvent 223 232 0 0 0 0 0\n"
-"RenderEvent 223 232 0 0 0 0 0\n"
-"InteractionEvent 223 232 0 0 0 0 0\n"
-"MouseMoveEvent 223 230 0 0 0 0 0\n"
-"RenderEvent 223 230 0 0 0 0 0\n"
-"InteractionEvent 223 230 0 0 0 0 0\n"
-"MouseMoveEvent 223 228 0 0 0 0 0\n"
-"RenderEvent 223 228 0 0 0 0 0\n"
-"InteractionEvent 223 228 0 0 0 0 0\n"
-"MouseMoveEvent 223 226 0 0 0 0 0\n"
-"RenderEvent 223 226 0 0 0 0 0\n"
-"InteractionEvent 223 226 0 0 0 0 0\n"
-"MouseMoveEvent 223 223 0 0 0 0 0\n"
-"RenderEvent 223 223 0 0 0 0 0\n"
-"InteractionEvent 223 223 0 0 0 0 0\n"
-"MouseMoveEvent 223 221 0 0 0 0 0\n"
-"RenderEvent 223 221 0 0 0 0 0\n"
-"InteractionEvent 223 221 0 0 0 0 0\n"
-"MouseMoveEvent 223 220 0 0 0 0 0\n"
-"RenderEvent 223 220 0 0 0 0 0\n"
-"InteractionEvent 223 220 0 0 0 0 0\n"
-"MouseMoveEvent 223 219 0 0 0 0 0\n"
-"RenderEvent 223 219 0 0 0 0 0\n"
-"InteractionEvent 223 219 0 0 0 0 0\n"
-"MouseMoveEvent 223 217 0 0 0 0 0\n"
-"RenderEvent 223 217 0 0 0 0 0\n"
-"InteractionEvent 223 217 0 0 0 0 0\n"
-"MouseMoveEvent 223 215 0 0 0 0 0\n"
-"RenderEvent 223 215 0 0 0 0 0\n"
-"InteractionEvent 223 215 0 0 0 0 0\n"
-"MouseMoveEvent 223 214 0 0 0 0 0\n"
-"RenderEvent 223 214 0 0 0 0 0\n"
-"InteractionEvent 223 214 0 0 0 0 0\n"
-"MouseMoveEvent 223 213 0 0 0 0 0\n"
-"RenderEvent 223 213 0 0 0 0 0\n"
-"InteractionEvent 223 213 0 0 0 0 0\n"
-"MouseMoveEvent 223 212 0 0 0 0 0\n"
-"RenderEvent 223 212 0 0 0 0 0\n"
-"InteractionEvent 223 212 0 0 0 0 0\n"
-"MouseMoveEvent 223 210 0 0 0 0 0\n"
-"RenderEvent 223 210 0 0 0 0 0\n"
-"InteractionEvent 223 210 0 0 0 0 0\n"
-"MouseMoveEvent 223 209 0 0 0 0 0\n"
-"RenderEvent 223 209 0 0 0 0 0\n"
-"InteractionEvent 223 209 0 0 0 0 0\n"
-"MouseMoveEvent 223 208 0 0 0 0 0\n"
-"RenderEvent 223 208 0 0 0 0 0\n"
-"InteractionEvent 223 208 0 0 0 0 0\n"
-"MouseMoveEvent 223 206 0 0 0 0 0\n"
-"RenderEvent 223 206 0 0 0 0 0\n"
-"InteractionEvent 223 206 0 0 0 0 0\n"
-"MouseMoveEvent 223 205 0 0 0 0 0\n"
-"RenderEvent 223 205 0 0 0 0 0\n"
-"InteractionEvent 223 205 0 0 0 0 0\n"
-"MouseMoveEvent 223 204 0 0 0 0 0\n"
-"RenderEvent 223 204 0 0 0 0 0\n"
-"InteractionEvent 223 204 0 0 0 0 0\n"
-"MouseMoveEvent 223 203 0 0 0 0 0\n"
-"RenderEvent 223 203 0 0 0 0 0\n"
-"InteractionEvent 223 203 0 0 0 0 0\n"
-"MouseMoveEvent 223 202 0 0 0 0 0\n"
-"RenderEvent 223 202 0 0 0 0 0\n"
-"InteractionEvent 223 202 0 0 0 0 0\n"
-"MouseMoveEvent 223 201 0 0 0 0 0\n"
-"RenderEvent 223 201 0 0 0 0 0\n"
-"InteractionEvent 223 201 0 0 0 0 0\n"
-"MouseMoveEvent 223 200 0 0 0 0 0\n"
-"RenderEvent 223 200 0 0 0 0 0\n"
-"InteractionEvent 223 200 0 0 0 0 0\n"
-"MouseMoveEvent 223 199 0 0 0 0 0\n"
-"RenderEvent 223 199 0 0 0 0 0\n"
-"InteractionEvent 223 199 0 0 0 0 0\n"
-"MouseMoveEvent 223 198 0 0 0 0 0\n"
-"RenderEvent 223 198 0 0 0 0 0\n"
-"InteractionEvent 223 198 0 0 0 0 0\n"
-"MouseMoveEvent 223 197 0 0 0 0 0\n"
-"RenderEvent 223 197 0 0 0 0 0\n"
-"InteractionEvent 223 197 0 0 0 0 0\n"
-"MouseMoveEvent 223 196 0 0 0 0 0\n"
-"RenderEvent 223 196 0 0 0 0 0\n"
-"InteractionEvent 223 196 0 0 0 0 0\n"
-"MouseMoveEvent 223 195 0 0 0 0 0\n"
-"RenderEvent 223 195 0 0 0 0 0\n"
-"InteractionEvent 223 195 0 0 0 0 0\n"
-"MouseMoveEvent 223 194 0 0 0 0 0\n"
-"RenderEvent 223 194 0 0 0 0 0\n"
-"InteractionEvent 223 194 0 0 0 0 0\n"
-"MouseMoveEvent 223 192 0 0 0 0 0\n"
-"RenderEvent 223 192 0 0 0 0 0\n"
-"InteractionEvent 223 192 0 0 0 0 0\n"
-"MouseMoveEvent 223 191 0 0 0 0 0\n"
-"RenderEvent 223 191 0 0 0 0 0\n"
-"InteractionEvent 223 191 0 0 0 0 0\n"
-"MouseMoveEvent 223 190 0 0 0 0 0\n"
-"RenderEvent 223 190 0 0 0 0 0\n"
-"InteractionEvent 223 190 0 0 0 0 0\n"
-"MouseMoveEvent 223 189 0 0 0 0 0\n"
-"RenderEvent 223 189 0 0 0 0 0\n"
-"InteractionEvent 223 189 0 0 0 0 0\n"
-"MouseMoveEvent 223 188 0 0 0 0 0\n"
-"RenderEvent 223 188 0 0 0 0 0\n"
-"InteractionEvent 223 188 0 0 0 0 0\n"
-"MouseMoveEvent 223 187 0 0 0 0 0\n"
-"RenderEvent 223 187 0 0 0 0 0\n"
-"InteractionEvent 223 187 0 0 0 0 0\n"
-"MouseMoveEvent 223 185 0 0 0 0 0\n"
-"RenderEvent 223 185 0 0 0 0 0\n"
-"InteractionEvent 223 185 0 0 0 0 0\n"
-"MouseMoveEvent 223 183 0 0 0 0 0\n"
-"RenderEvent 223 183 0 0 0 0 0\n"
-"InteractionEvent 223 183 0 0 0 0 0\n"
-"MouseMoveEvent 223 182 0 0 0 0 0\n"
-"RenderEvent 223 182 0 0 0 0 0\n"
-"InteractionEvent 223 182 0 0 0 0 0\n"
-"MouseMoveEvent 223 181 0 0 0 0 0\n"
-"RenderEvent 223 181 0 0 0 0 0\n"
-"InteractionEvent 223 181 0 0 0 0 0\n"
-"MouseMoveEvent 223 180 0 0 0 0 0\n"
-"RenderEvent 223 180 0 0 0 0 0\n"
-"InteractionEvent 223 180 0 0 0 0 0\n"
-"MouseMoveEvent 223 178 0 0 0 0 0\n"
-"RenderEvent 223 178 0 0 0 0 0\n"
-"InteractionEvent 223 178 0 0 0 0 0\n"
-"MouseMoveEvent 223 176 0 0 0 0 0\n"
-"RenderEvent 223 176 0 0 0 0 0\n"
-"InteractionEvent 223 176 0 0 0 0 0\n"
-"MouseMoveEvent 223 175 0 0 0 0 0\n"
-"RenderEvent 223 175 0 0 0 0 0\n"
-"InteractionEvent 223 175 0 0 0 0 0\n"
-"MouseMoveEvent 223 173 0 0 0 0 0\n"
-"RenderEvent 223 173 0 0 0 0 0\n"
-"InteractionEvent 223 173 0 0 0 0 0\n"
-"MouseMoveEvent 223 172 0 0 0 0 0\n"
-"RenderEvent 223 172 0 0 0 0 0\n"
-"InteractionEvent 223 172 0 0 0 0 0\n"
-"MouseMoveEvent 223 170 0 0 0 0 0\n"
-"RenderEvent 223 170 0 0 0 0 0\n"
-"InteractionEvent 223 170 0 0 0 0 0\n"
-"MouseMoveEvent 223 169 0 0 0 0 0\n"
-"RenderEvent 223 169 0 0 0 0 0\n"
-"InteractionEvent 223 169 0 0 0 0 0\n"
-"MouseMoveEvent 223 166 0 0 0 0 0\n"
-"RenderEvent 223 166 0 0 0 0 0\n"
-"InteractionEvent 223 166 0 0 0 0 0\n"
-"MouseMoveEvent 223 165 0 0 0 0 0\n"
-"RenderEvent 223 165 0 0 0 0 0\n"
-"InteractionEvent 223 165 0 0 0 0 0\n"
-"MouseMoveEvent 223 164 0 0 0 0 0\n"
-"RenderEvent 223 164 0 0 0 0 0\n"
-"InteractionEvent 223 164 0 0 0 0 0\n"
-"MouseMoveEvent 223 162 0 0 0 0 0\n"
-"RenderEvent 223 162 0 0 0 0 0\n"
-"InteractionEvent 223 162 0 0 0 0 0\n"
-"MouseMoveEvent 223 160 0 0 0 0 0\n"
-"RenderEvent 223 160 0 0 0 0 0\n"
-"InteractionEvent 223 160 0 0 0 0 0\n"
-"MouseMoveEvent 223 158 0 0 0 0 0\n"
-"RenderEvent 223 158 0 0 0 0 0\n"
-"InteractionEvent 223 158 0 0 0 0 0\n"
-"MouseMoveEvent 223 157 0 0 0 0 0\n"
-"RenderEvent 223 157 0 0 0 0 0\n"
-"InteractionEvent 223 157 0 0 0 0 0\n"
-"MouseMoveEvent 223 156 0 0 0 0 0\n"
-"RenderEvent 223 156 0 0 0 0 0\n"
-"InteractionEvent 223 156 0 0 0 0 0\n"
-"MouseMoveEvent 223 155 0 0 0 0 0\n"
-"RenderEvent 223 155 0 0 0 0 0\n"
-"InteractionEvent 223 155 0 0 0 0 0\n"
-"MouseMoveEvent 223 154 0 0 0 0 0\n"
-"RenderEvent 223 154 0 0 0 0 0\n"
-"InteractionEvent 223 154 0 0 0 0 0\n"
-"MouseMoveEvent 223 153 0 0 0 0 0\n"
-"RenderEvent 223 153 0 0 0 0 0\n"
-"InteractionEvent 223 153 0 0 0 0 0\n"
-"MouseMoveEvent 223 152 0 0 0 0 0\n"
-"RenderEvent 223 152 0 0 0 0 0\n"
-"InteractionEvent 223 152 0 0 0 0 0\n"
-"LeftButtonReleaseEvent 223 152 0 0 0 0 0\n"
-"EndInteractionEvent 223 152 0 0 0 0 0\n"
-"RenderEvent 223 152 0 0 0 0 0\n"
-"MouseMoveEvent 222 151 0 0 0 0 0\n"
-"MouseMoveEvent 221 151 0 0 0 0 0\n"
-"MouseMoveEvent 219 153 0 0 0 0 0\n"
-"MouseMoveEvent 219 155 0 0 0 0 0\n"
-"MouseMoveEvent 218 158 0 0 0 0 0\n"
-"MouseMoveEvent 217 161 0 0 0 0 0\n"
-"MouseMoveEvent 217 164 0 0 0 0 0\n"
-"MouseMoveEvent 217 167 0 0 0 0 0\n"
-"MouseMoveEvent 217 170 0 0 0 0 0\n"
-"MouseMoveEvent 217 175 0 0 0 0 0\n"
-"MouseMoveEvent 217 180 0 0 0 0 0\n"
-"MouseMoveEvent 217 184 0 0 0 0 0\n"
-"MouseMoveEvent 216 187 0 0 0 0 0\n"
-"MouseMoveEvent 216 188 0 0 0 0 0\n"
-"MouseMoveEvent 216 190 0 0 0 0 0\n"
-"MouseMoveEvent 216 192 0 0 0 0 0\n"
-"MouseMoveEvent 216 194 0 0 0 0 0\n"
-"MouseMoveEvent 216 196 0 0 0 0 0\n"
-"MouseMoveEvent 216 198 0 0 0 0 0\n"
-"MouseMoveEvent 216 199 0 0 0 0 0\n"
-"MouseMoveEvent 216 200 0 0 0 0 0\n"
-"RightButtonPressEvent 216 200 0 0 0 0 0\n"
-"StartInteractionEvent 216 200 0 0 0 0 0\n"
-"MouseMoveEvent 216 203 0 0 0 0 0\n"
-"RenderEvent 216 203 0 0 0 0 0\n"
-"InteractionEvent 216 203 0 0 0 0 0\n"
-"MouseMoveEvent 216 205 0 0 0 0 0\n"
-"RenderEvent 216 205 0 0 0 0 0\n"
-"InteractionEvent 216 205 0 0 0 0 0\n"
-"MouseMoveEvent 216 208 0 0 0 0 0\n"
-"RenderEvent 216 208 0 0 0 0 0\n"
-"InteractionEvent 216 208 0 0 0 0 0\n"
-"MouseMoveEvent 216 213 0 0 0 0 0\n"
-"RenderEvent 216 213 0 0 0 0 0\n"
-"InteractionEvent 216 213 0 0 0 0 0\n"
-"MouseMoveEvent 216 220 0 0 0 0 0\n"
-"RenderEvent 216 220 0 0 0 0 0\n"
-"InteractionEvent 216 220 0 0 0 0 0\n"
-"MouseMoveEvent 216 226 0 0 0 0 0\n"
-"RenderEvent 216 226 0 0 0 0 0\n"
-"InteractionEvent 216 226 0 0 0 0 0\n"
-"MouseMoveEvent 216 229 0 0 0 0 0\n"
-"RenderEvent 216 229 0 0 0 0 0\n"
-"InteractionEvent 216 229 0 0 0 0 0\n"
-"MouseMoveEvent 217 232 0 0 0 0 0\n"
-"RenderEvent 217 232 0 0 0 0 0\n"
-"InteractionEvent 217 232 0 0 0 0 0\n"
-"MouseMoveEvent 218 234 0 0 0 0 0\n"
-"RenderEvent 218 234 0 0 0 0 0\n"
-"InteractionEvent 218 234 0 0 0 0 0\n"
-"MouseMoveEvent 218 236 0 0 0 0 0\n"
-"RenderEvent 218 236 0 0 0 0 0\n"
-"InteractionEvent 218 236 0 0 0 0 0\n"
-"MouseMoveEvent 219 239 0 0 0 0 0\n"
-"RenderEvent 219 239 0 0 0 0 0\n"
-"InteractionEvent 219 239 0 0 0 0 0\n"
-"MouseMoveEvent 219 242 0 0 0 0 0\n"
-"RenderEvent 219 242 0 0 0 0 0\n"
-"InteractionEvent 219 242 0 0 0 0 0\n"
-"MouseMoveEvent 219 245 0 0 0 0 0\n"
-"RenderEvent 219 245 0 0 0 0 0\n"
-"InteractionEvent 219 245 0 0 0 0 0\n"
-"MouseMoveEvent 219 247 0 0 0 0 0\n"
-"RenderEvent 219 247 0 0 0 0 0\n"
-"InteractionEvent 219 247 0 0 0 0 0\n"
-"MouseMoveEvent 219 250 0 0 0 0 0\n"
-"RenderEvent 219 250 0 0 0 0 0\n"
-"InteractionEvent 219 250 0 0 0 0 0\n"
-"MouseMoveEvent 220 254 0 0 0 0 0\n"
-"RenderEvent 220 254 0 0 0 0 0\n"
-"InteractionEvent 220 254 0 0 0 0 0\n"
-"MouseMoveEvent 220 257 0 0 0 0 0\n"
-"RenderEvent 220 257 0 0 0 0 0\n"
-"InteractionEvent 220 257 0 0 0 0 0\n"
-"MouseMoveEvent 221 260 0 0 0 0 0\n"
-"RenderEvent 221 260 0 0 0 0 0\n"
-"InteractionEvent 221 260 0 0 0 0 0\n"
-"MouseMoveEvent 221 264 0 0 0 0 0\n"
-"RenderEvent 221 264 0 0 0 0 0\n"
-"InteractionEvent 221 264 0 0 0 0 0\n"
-"MouseMoveEvent 222 266 0 0 0 0 0\n"
-"RenderEvent 222 266 0 0 0 0 0\n"
-"InteractionEvent 222 266 0 0 0 0 0\n"
-"MouseMoveEvent 222 270 0 0 0 0 0\n"
-"RenderEvent 222 270 0 0 0 0 0\n"
-"InteractionEvent 222 270 0 0 0 0 0\n"
-"MouseMoveEvent 223 273 0 0 0 0 0\n"
-"RenderEvent 223 273 0 0 0 0 0\n"
-"InteractionEvent 223 273 0 0 0 0 0\n"
-"MouseMoveEvent 225 279 0 0 0 0 0\n"
-"RenderEvent 225 279 0 0 0 0 0\n"
-"InteractionEvent 225 279 0 0 0 0 0\n"
-"MouseMoveEvent 225 282 0 0 0 0 0\n"
-"RenderEvent 225 282 0 0 0 0 0\n"
-"InteractionEvent 225 282 0 0 0 0 0\n"
-"MouseMoveEvent 225 285 0 0 0 0 0\n"
-"RenderEvent 225 285 0 0 0 0 0\n"
-"InteractionEvent 225 285 0 0 0 0 0\n"
-"MouseMoveEvent 226 287 0 0 0 0 0\n"
-"RenderEvent 226 287 0 0 0 0 0\n"
-"InteractionEvent 226 287 0 0 0 0 0\n"
-"MouseMoveEvent 226 291 0 0 0 0 0\n"
-"RenderEvent 226 291 0 0 0 0 0\n"
-"InteractionEvent 226 291 0 0 0 0 0\n"
-"MouseMoveEvent 227 295 0 0 0 0 0\n"
-"RenderEvent 227 295 0 0 0 0 0\n"
-"InteractionEvent 227 295 0 0 0 0 0\n"
-"MouseMoveEvent 227 298 0 0 0 0 0\n"
-"RenderEvent 227 298 0 0 0 0 0\n"
-"InteractionEvent 227 298 0 0 0 0 0\n"
-"MouseMoveEvent 228 300 0 0 0 0 0\n"
-"RenderEvent 228 300 0 0 0 0 0\n"
-"InteractionEvent 228 300 0 0 0 0 0\n"
-"MouseMoveEvent 228 302 0 0 0 0 0\n"
-"RenderEvent 228 302 0 0 0 0 0\n"
-"InteractionEvent 228 302 0 0 0 0 0\n"
-"MouseMoveEvent 228 304 0 0 0 0 0\n"
-"RenderEvent 228 304 0 0 0 0 0\n"
-"InteractionEvent 228 304 0 0 0 0 0\n"
-"MouseMoveEvent 228 305 0 0 0 0 0\n"
-"RenderEvent 228 305 0 0 0 0 0\n"
-"InteractionEvent 228 305 0 0 0 0 0\n"
-"MouseMoveEvent 229 307 0 0 0 0 0\n"
-"RenderEvent 229 307 0 0 0 0 0\n"
-"InteractionEvent 229 307 0 0 0 0 0\n"
-"MouseMoveEvent 229 308 0 0 0 0 0\n"
-"RenderEvent 229 308 0 0 0 0 0\n"
-"InteractionEvent 229 308 0 0 0 0 0\n"
-"MouseMoveEvent 229 309 0 0 0 0 0\n"
-"RenderEvent 229 309 0 0 0 0 0\n"
-"InteractionEvent 229 309 0 0 0 0 0\n"
-"MouseMoveEvent 229 310 0 0 0 0 0\n"
-"RenderEvent 229 310 0 0 0 0 0\n"
-"InteractionEvent 229 310 0 0 0 0 0\n"
-"MouseMoveEvent 230 312 0 0 0 0 0\n"
-"RenderEvent 230 312 0 0 0 0 0\n"
-"InteractionEvent 230 312 0 0 0 0 0\n"
-"MouseMoveEvent 231 315 0 0 0 0 0\n"
-"RenderEvent 231 315 0 0 0 0 0\n"
-"InteractionEvent 231 315 0 0 0 0 0\n"
-"MouseMoveEvent 232 318 0 0 0 0 0\n"
-"RenderEvent 232 318 0 0 0 0 0\n"
-"InteractionEvent 232 318 0 0 0 0 0\n"
-"MouseMoveEvent 233 321 0 0 0 0 0\n"
-"RenderEvent 233 321 0 0 0 0 0\n"
-"InteractionEvent 233 321 0 0 0 0 0\n"
-"MouseMoveEvent 234 323 0 0 0 0 0\n"
-"RenderEvent 234 323 0 0 0 0 0\n"
-"InteractionEvent 234 323 0 0 0 0 0\n"
-"MouseMoveEvent 234 324 0 0 0 0 0\n"
-"RenderEvent 234 324 0 0 0 0 0\n"
-"InteractionEvent 234 324 0 0 0 0 0\n"
-"MouseMoveEvent 234 325 0 0 0 0 0\n"
-"RenderEvent 234 325 0 0 0 0 0\n"
-"InteractionEvent 234 325 0 0 0 0 0\n"
-"MouseMoveEvent 234 327 0 0 0 0 0\n"
-"RenderEvent 234 327 0 0 0 0 0\n"
-"InteractionEvent 234 327 0 0 0 0 0\n"
-"MouseMoveEvent 235 329 0 0 0 0 0\n"
-"RenderEvent 235 329 0 0 0 0 0\n"
-"InteractionEvent 235 329 0 0 0 0 0\n"
-"MouseMoveEvent 235 330 0 0 0 0 0\n"
-"RenderEvent 235 330 0 0 0 0 0\n"
-"InteractionEvent 235 330 0 0 0 0 0\n"
-"MouseMoveEvent 235 332 0 0 0 0 0\n"
-"RenderEvent 235 332 0 0 0 0 0\n"
-"InteractionEvent 235 332 0 0 0 0 0\n"
-"MouseMoveEvent 235 334 0 0 0 0 0\n"
-"RenderEvent 235 334 0 0 0 0 0\n"
-"InteractionEvent 235 334 0 0 0 0 0\n"
-"MouseMoveEvent 235 335 0 0 0 0 0\n"
-"RenderEvent 235 335 0 0 0 0 0\n"
-"InteractionEvent 235 335 0 0 0 0 0\n"
-"MouseMoveEvent 235 336 0 0 0 0 0\n"
-"RenderEvent 235 336 0 0 0 0 0\n"
-"InteractionEvent 235 336 0 0 0 0 0\n"
-"MouseMoveEvent 235 338 0 0 0 0 0\n"
-"RenderEvent 235 338 0 0 0 0 0\n"
-"InteractionEvent 235 338 0 0 0 0 0\n"
-"MouseMoveEvent 235 339 0 0 0 0 0\n"
-"RenderEvent 235 339 0 0 0 0 0\n"
-"InteractionEvent 235 339 0 0 0 0 0\n"
-"MouseMoveEvent 235 341 0 0 0 0 0\n"
-"RenderEvent 235 341 0 0 0 0 0\n"
-"InteractionEvent 235 341 0 0 0 0 0\n"
-"MouseMoveEvent 235 342 0 0 0 0 0\n"
-"RenderEvent 235 342 0 0 0 0 0\n"
-"InteractionEvent 235 342 0 0 0 0 0\n"
-"MouseMoveEvent 235 343 0 0 0 0 0\n"
-"RenderEvent 235 343 0 0 0 0 0\n"
-"InteractionEvent 235 343 0 0 0 0 0\n"
-"MouseMoveEvent 235 344 0 0 0 0 0\n"
-"RenderEvent 235 344 0 0 0 0 0\n"
-"InteractionEvent 235 344 0 0 0 0 0\n"
-"MouseMoveEvent 235 346 0 0 0 0 0\n"
-"RenderEvent 235 346 0 0 0 0 0\n"
-"InteractionEvent 235 346 0 0 0 0 0\n"
-"MouseMoveEvent 235 347 0 0 0 0 0\n"
-"RenderEvent 235 347 0 0 0 0 0\n"
-"InteractionEvent 235 347 0 0 0 0 0\n"
-"MouseMoveEvent 234 349 0 0 0 0 0\n"
-"RenderEvent 234 349 0 0 0 0 0\n"
-"InteractionEvent 234 349 0 0 0 0 0\n"
-"MouseMoveEvent 234 350 0 0 0 0 0\n"
-"RenderEvent 234 350 0 0 0 0 0\n"
-"InteractionEvent 234 350 0 0 0 0 0\n"
-"MouseMoveEvent 234 351 0 0 0 0 0\n"
-"RenderEvent 234 351 0 0 0 0 0\n"
-"InteractionEvent 234 351 0 0 0 0 0\n"
-"MouseMoveEvent 233 352 0 0 0 0 0\n"
-"RenderEvent 233 352 0 0 0 0 0\n"
-"InteractionEvent 233 352 0 0 0 0 0\n"
-"RightButtonReleaseEvent 233 352 0 0 0 0 0\n"
-"EndInteractionEvent 233 352 0 0 0 0 0\n"
-"RenderEvent 233 352 0 0 0 0 0\n"
-"MouseMoveEvent 232 353 0 0 0 0 0\n"
-"MiddleButtonPressEvent 232 353 0 0 0 0 0\n"
-"StartInteractionEvent 232 353 0 0 0 0 0\n"
-"MouseMoveEvent 232 352 0 0 0 0 0\n"
-"RenderEvent 232 352 0 0 0 0 0\n"
-"InteractionEvent 232 352 0 0 0 0 0\n"
-"MouseMoveEvent 232 351 0 0 0 0 0\n"
-"RenderEvent 232 351 0 0 0 0 0\n"
-"InteractionEvent 232 351 0 0 0 0 0\n"
-"MouseMoveEvent 232 350 0 0 0 0 0\n"
-"RenderEvent 232 350 0 0 0 0 0\n"
-"InteractionEvent 232 350 0 0 0 0 0\n"
-"MouseMoveEvent 232 348 0 0 0 0 0\n"
-"RenderEvent 232 348 0 0 0 0 0\n"
-"InteractionEvent 232 348 0 0 0 0 0\n"
-"MouseMoveEvent 232 344 0 0 0 0 0\n"
-"RenderEvent 232 344 0 0 0 0 0\n"
-"InteractionEvent 232 344 0 0 0 0 0\n"
-"MouseMoveEvent 232 340 0 0 0 0 0\n"
-"RenderEvent 232 340 0 0 0 0 0\n"
-"InteractionEvent 232 340 0 0 0 0 0\n"
-"MouseMoveEvent 232 333 0 0 0 0 0\n"
-"RenderEvent 232 333 0 0 0 0 0\n"
-"InteractionEvent 232 333 0 0 0 0 0\n"
-"MouseMoveEvent 231 329 0 0 0 0 0\n"
-"RenderEvent 231 329 0 0 0 0 0\n"
-"InteractionEvent 231 329 0 0 0 0 0\n"
-"MouseMoveEvent 230 326 0 0 0 0 0\n"
-"RenderEvent 230 326 0 0 0 0 0\n"
-"InteractionEvent 230 326 0 0 0 0 0\n"
-"MouseMoveEvent 230 324 0 0 0 0 0\n"
-"RenderEvent 230 324 0 0 0 0 0\n"
-"InteractionEvent 230 324 0 0 0 0 0\n"
-"MouseMoveEvent 230 321 0 0 0 0 0\n"
-"RenderEvent 230 321 0 0 0 0 0\n"
-"InteractionEvent 230 321 0 0 0 0 0\n"
-"MouseMoveEvent 229 318 0 0 0 0 0\n"
-"RenderEvent 229 318 0 0 0 0 0\n"
-"InteractionEvent 229 318 0 0 0 0 0\n"
-"MouseMoveEvent 228 314 0 0 0 0 0\n"
-"RenderEvent 228 314 0 0 0 0 0\n"
-"InteractionEvent 228 314 0 0 0 0 0\n"
-"MouseMoveEvent 227 311 0 0 0 0 0\n"
-"RenderEvent 227 311 0 0 0 0 0\n"
-"InteractionEvent 227 311 0 0 0 0 0\n"
-"MouseMoveEvent 226 309 0 0 0 0 0\n"
-"RenderEvent 226 309 0 0 0 0 0\n"
-"InteractionEvent 226 309 0 0 0 0 0\n"
-"MouseMoveEvent 225 306 0 0 0 0 0\n"
-"RenderEvent 225 306 0 0 0 0 0\n"
-"InteractionEvent 225 306 0 0 0 0 0\n"
-"MouseMoveEvent 224 302 0 0 0 0 0\n"
-"RenderEvent 224 302 0 0 0 0 0\n"
-"InteractionEvent 224 302 0 0 0 0 0\n"
-"MouseMoveEvent 223 299 0 0 0 0 0\n"
-"RenderEvent 223 299 0 0 0 0 0\n"
-"InteractionEvent 223 299 0 0 0 0 0\n"
-"MouseMoveEvent 222 295 0 0 0 0 0\n"
-"RenderEvent 222 295 0 0 0 0 0\n"
-"InteractionEvent 222 295 0 0 0 0 0\n"
-"MouseMoveEvent 219 289 0 0 0 0 0\n"
-"RenderEvent 219 289 0 0 0 0 0\n"
-"InteractionEvent 219 289 0 0 0 0 0\n"
-"MouseMoveEvent 219 285 0 0 0 0 0\n"
-"RenderEvent 219 285 0 0 0 0 0\n"
-"InteractionEvent 219 285 0 0 0 0 0\n"
-"MouseMoveEvent 218 281 0 0 0 0 0\n"
-"RenderEvent 218 281 0 0 0 0 0\n"
-"InteractionEvent 218 281 0 0 0 0 0\n"
-"MouseMoveEvent 217 278 0 0 0 0 0\n"
-"RenderEvent 217 278 0 0 0 0 0\n"
-"InteractionEvent 217 278 0 0 0 0 0\n"
-"MouseMoveEvent 217 274 0 0 0 0 0\n"
-"RenderEvent 217 274 0 0 0 0 0\n"
-"InteractionEvent 217 274 0 0 0 0 0\n"
-"MouseMoveEvent 217 270 0 0 0 0 0\n"
-"RenderEvent 217 270 0 0 0 0 0\n"
-"InteractionEvent 217 270 0 0 0 0 0\n"
-"MouseMoveEvent 216 267 0 0 0 0 0\n"
-"RenderEvent 216 267 0 0 0 0 0\n"
-"InteractionEvent 216 267 0 0 0 0 0\n"
-"MouseMoveEvent 216 263 0 0 0 0 0\n"
-"RenderEvent 216 263 0 0 0 0 0\n"
-"InteractionEvent 216 263 0 0 0 0 0\n"
-"MouseMoveEvent 216 259 0 0 0 0 0\n"
-"RenderEvent 216 259 0 0 0 0 0\n"
-"InteractionEvent 216 259 0 0 0 0 0\n"
-"MouseMoveEvent 216 254 0 0 0 0 0\n"
-"RenderEvent 216 254 0 0 0 0 0\n"
-"InteractionEvent 216 254 0 0 0 0 0\n"
-"MouseMoveEvent 216 249 0 0 0 0 0\n"
-"RenderEvent 216 249 0 0 0 0 0\n"
-"InteractionEvent 216 249 0 0 0 0 0\n"
-"MouseMoveEvent 217 244 0 0 0 0 0\n"
-"RenderEvent 217 244 0 0 0 0 0\n"
-"InteractionEvent 217 244 0 0 0 0 0\n"
-"MouseMoveEvent 219 237 0 0 0 0 0\n"
-"RenderEvent 219 237 0 0 0 0 0\n"
-"InteractionEvent 219 237 0 0 0 0 0\n"
-"MouseMoveEvent 220 232 0 0 0 0 0\n"
-"RenderEvent 220 232 0 0 0 0 0\n"
-"InteractionEvent 220 232 0 0 0 0 0\n"
-"MouseMoveEvent 223 227 0 0 0 0 0\n"
-"RenderEvent 223 227 0 0 0 0 0\n"
-"InteractionEvent 223 227 0 0 0 0 0\n"
-"MouseMoveEvent 224 224 0 0 0 0 0\n"
-"RenderEvent 224 224 0 0 0 0 0\n"
-"InteractionEvent 224 224 0 0 0 0 0\n"
-"MouseMoveEvent 227 219 0 0 0 0 0\n"
-"RenderEvent 227 219 0 0 0 0 0\n"
-"InteractionEvent 227 219 0 0 0 0 0\n"
-"MouseMoveEvent 229 213 0 0 0 0 0\n"
-"RenderEvent 229 213 0 0 0 0 0\n"
-"InteractionEvent 229 213 0 0 0 0 0\n"
-"MouseMoveEvent 231 208 0 0 0 0 0\n"
-"RenderEvent 231 208 0 0 0 0 0\n"
-"InteractionEvent 231 208 0 0 0 0 0\n"
-"MouseMoveEvent 232 203 0 0 0 0 0\n"
-"RenderEvent 232 203 0 0 0 0 0\n"
-"InteractionEvent 232 203 0 0 0 0 0\n"
-"MouseMoveEvent 233 201 0 0 0 0 0\n"
-"RenderEvent 233 201 0 0 0 0 0\n"
-"InteractionEvent 233 201 0 0 0 0 0\n"
-"MouseMoveEvent 234 197 0 0 0 0 0\n"
-"RenderEvent 234 197 0 0 0 0 0\n"
-"InteractionEvent 234 197 0 0 0 0 0\n"
-"MouseMoveEvent 234 196 0 0 0 0 0\n"
-"RenderEvent 234 196 0 0 0 0 0\n"
-"InteractionEvent 234 196 0 0 0 0 0\n"
-"MouseMoveEvent 235 194 0 0 0 0 0\n"
-"RenderEvent 235 194 0 0 0 0 0\n"
-"InteractionEvent 235 194 0 0 0 0 0\n"
-"MouseMoveEvent 236 191 0 0 0 0 0\n"
-"RenderEvent 236 191 0 0 0 0 0\n"
-"InteractionEvent 236 191 0 0 0 0 0\n"
-"MouseMoveEvent 237 189 0 0 0 0 0\n"
-"RenderEvent 237 189 0 0 0 0 0\n"
-"InteractionEvent 237 189 0 0 0 0 0\n"
-"MouseMoveEvent 238 187 0 0 0 0 0\n"
-"RenderEvent 238 187 0 0 0 0 0\n"
-"InteractionEvent 238 187 0 0 0 0 0\n"
-"MouseMoveEvent 240 184 0 0 0 0 0\n"
-"RenderEvent 240 184 0 0 0 0 0\n"
-"InteractionEvent 240 184 0 0 0 0 0\n"
-"MouseMoveEvent 241 181 0 0 0 0 0\n"
-"RenderEvent 241 181 0 0 0 0 0\n"
-"InteractionEvent 241 181 0 0 0 0 0\n"
-"MouseMoveEvent 243 177 0 0 0 0 0\n"
-"RenderEvent 243 177 0 0 0 0 0\n"
-"InteractionEvent 243 177 0 0 0 0 0\n"
-"MouseMoveEvent 243 176 0 0 0 0 0\n"
-"RenderEvent 243 176 0 0 0 0 0\n"
-"InteractionEvent 243 176 0 0 0 0 0\n"
-"MouseMoveEvent 244 173 0 0 0 0 0\n"
-"RenderEvent 244 173 0 0 0 0 0\n"
-"InteractionEvent 244 173 0 0 0 0 0\n"
-"MouseMoveEvent 245 169 0 0 0 0 0\n"
-"RenderEvent 245 169 0 0 0 0 0\n"
-"InteractionEvent 245 169 0 0 0 0 0\n"
-"MouseMoveEvent 246 165 0 0 0 0 0\n"
-"RenderEvent 246 165 0 0 0 0 0\n"
-"InteractionEvent 246 165 0 0 0 0 0\n"
-"MouseMoveEvent 247 161 0 0 0 0 0\n"
-"RenderEvent 247 161 0 0 0 0 0\n"
-"InteractionEvent 247 161 0 0 0 0 0\n"
-"MouseMoveEvent 249 157 0 0 0 0 0\n"
-"RenderEvent 249 157 0 0 0 0 0\n"
-"InteractionEvent 249 157 0 0 0 0 0\n"
-"MouseMoveEvent 251 152 0 0 0 0 0\n"
-"RenderEvent 251 152 0 0 0 0 0\n"
-"InteractionEvent 251 152 0 0 0 0 0\n"
-"MouseMoveEvent 252 147 0 0 0 0 0\n"
-"RenderEvent 252 147 0 0 0 0 0\n"
-"InteractionEvent 252 147 0 0 0 0 0\n"
-"MouseMoveEvent 253 142 0 0 0 0 0\n"
-"RenderEvent 253 142 0 0 0 0 0\n"
-"InteractionEvent 253 142 0 0 0 0 0\n"
-"MouseMoveEvent 254 138 0 0 0 0 0\n"
-"RenderEvent 254 138 0 0 0 0 0\n"
-"InteractionEvent 254 138 0 0 0 0 0\n"
-"MouseMoveEvent 255 133 0 0 0 0 0\n"
-"RenderEvent 255 133 0 0 0 0 0\n"
-"InteractionEvent 255 133 0 0 0 0 0\n"
-"MouseMoveEvent 257 129 0 0 0 0 0\n"
-"RenderEvent 257 129 0 0 0 0 0\n"
-"InteractionEvent 257 129 0 0 0 0 0\n"
-"MouseMoveEvent 259 125 0 0 0 0 0\n"
-"RenderEvent 259 125 0 0 0 0 0\n"
-"InteractionEvent 259 125 0 0 0 0 0\n"
-"MiddleButtonReleaseEvent 259 125 0 0 0 0 0\n"
-"EndInteractionEvent 259 125 0 0 0 0 0\n"
-"RenderEvent 259 125 0 0 0 0 0\n"
-"MouseMoveEvent 259 124 0 0 0 0 0\n"
-"MouseMoveEvent 256 120 0 0 0 0 0\n"
-"MouseMoveEvent 252 115 0 0 0 0 0\n"
-"MouseMoveEvent 248 111 0 0 0 0 0\n"
-"MouseMoveEvent 244 108 0 0 0 0 0\n"
-"MouseMoveEvent 238 102 0 0 0 0 0\n"
-"MouseMoveEvent 234 98 0 0 0 0 0\n"
-"MouseMoveEvent 230 94 0 0 0 0 0\n"
-"MouseMoveEvent 226 89 0 0 0 0 0\n"
-"MouseMoveEvent 222 85 0 0 0 0 0\n"
-"MouseMoveEvent 222 84 0 0 0 0 0\n"
-"MouseMoveEvent 221 83 0 0 0 0 0\n"
-"MouseMoveEvent 221 82 0 0 0 0 0\n"
-"MouseMoveEvent 221 81 0 0 0 0 0\n"
-"MouseMoveEvent 220 80 0 0 0 0 0\n"
-"RightButtonPressEvent 220 80 0 0 0 0 0\n"
-"StartInteractionEvent 220 80 0 0 0 0 0\n"
-"MouseMoveEvent 220 82 0 0 0 0 0\n"
-"RenderEvent 220 82 0 0 0 0 0\n"
-"InteractionEvent 220 82 0 0 0 0 0\n"
-"MouseMoveEvent 220 85 0 0 0 0 0\n"
-"RenderEvent 220 85 0 0 0 0 0\n"
-"InteractionEvent 220 85 0 0 0 0 0\n"
-"MouseMoveEvent 220 87 0 0 0 0 0\n"
-"RenderEvent 220 87 0 0 0 0 0\n"
-"InteractionEvent 220 87 0 0 0 0 0\n"
-"MouseMoveEvent 219 93 0 0 0 0 0\n"
-"RenderEvent 219 93 0 0 0 0 0\n"
-"InteractionEvent 219 93 0 0 0 0 0\n"
-"MouseMoveEvent 219 99 0 0 0 0 0\n"
-"RenderEvent 219 99 0 0 0 0 0\n"
-"InteractionEvent 219 99 0 0 0 0 0\n"
-"MouseMoveEvent 219 105 0 0 0 0 0\n"
-"RenderEvent 219 105 0 0 0 0 0\n"
-"InteractionEvent 219 105 0 0 0 0 0\n"
-"MouseMoveEvent 219 111 0 0 0 0 0\n"
-"RenderEvent 219 111 0 0 0 0 0\n"
-"InteractionEvent 219 111 0 0 0 0 0\n"
-"MouseMoveEvent 219 116 0 0 0 0 0\n"
-"RenderEvent 219 116 0 0 0 0 0\n"
-"InteractionEvent 219 116 0 0 0 0 0\n"
-"MouseMoveEvent 219 120 0 0 0 0 0\n"
-"RenderEvent 219 120 0 0 0 0 0\n"
-"InteractionEvent 219 120 0 0 0 0 0\n"
-"MouseMoveEvent 219 124 0 0 0 0 0\n"
-"RenderEvent 219 124 0 0 0 0 0\n"
-"InteractionEvent 219 124 0 0 0 0 0\n"
-"MouseMoveEvent 219 128 0 0 0 0 0\n"
-"RenderEvent 219 128 0 0 0 0 0\n"
-"InteractionEvent 219 128 0 0 0 0 0\n"
-"MouseMoveEvent 219 132 0 0 0 0 0\n"
-"RenderEvent 219 132 0 0 0 0 0\n"
-"InteractionEvent 219 132 0 0 0 0 0\n"
-"MouseMoveEvent 219 136 0 0 0 0 0\n"
-"RenderEvent 219 136 0 0 0 0 0\n"
-"InteractionEvent 219 136 0 0 0 0 0\n"
-"MouseMoveEvent 219 139 0 0 0 0 0\n"
-"RenderEvent 219 139 0 0 0 0 0\n"
-"InteractionEvent 219 139 0 0 0 0 0\n"
-"MouseMoveEvent 219 143 0 0 0 0 0\n"
-"RenderEvent 219 143 0 0 0 0 0\n"
-"InteractionEvent 219 143 0 0 0 0 0\n"
-"MouseMoveEvent 219 147 0 0 0 0 0\n"
-"RenderEvent 219 147 0 0 0 0 0\n"
-"InteractionEvent 219 147 0 0 0 0 0\n"
-"MouseMoveEvent 219 152 0 0 0 0 0\n"
-"RenderEvent 219 152 0 0 0 0 0\n"
-"InteractionEvent 219 152 0 0 0 0 0\n"
-"MouseMoveEvent 219 156 0 0 0 0 0\n"
-"RenderEvent 219 156 0 0 0 0 0\n"
-"InteractionEvent 219 156 0 0 0 0 0\n"
-"MouseMoveEvent 219 159 0 0 0 0 0\n"
-"RenderEvent 219 159 0 0 0 0 0\n"
-"InteractionEvent 219 159 0 0 0 0 0\n"
-"MouseMoveEvent 219 162 0 0 0 0 0\n"
-"RenderEvent 219 162 0 0 0 0 0\n"
-"InteractionEvent 219 162 0 0 0 0 0\n"
-"MouseMoveEvent 219 165 0 0 0 0 0\n"
-"RenderEvent 219 165 0 0 0 0 0\n"
-"InteractionEvent 219 165 0 0 0 0 0\n"
-"MouseMoveEvent 219 169 0 0 0 0 0\n"
-"RenderEvent 219 169 0 0 0 0 0\n"
-"InteractionEvent 219 169 0 0 0 0 0\n"
-"MouseMoveEvent 220 173 0 0 0 0 0\n"
-"RenderEvent 220 173 0 0 0 0 0\n"
-"InteractionEvent 220 173 0 0 0 0 0\n"
-"MouseMoveEvent 220 176 0 0 0 0 0\n"
-"RenderEvent 220 176 0 0 0 0 0\n"
-"InteractionEvent 220 176 0 0 0 0 0\n"
-"MouseMoveEvent 221 180 0 0 0 0 0\n"
-"RenderEvent 221 180 0 0 0 0 0\n"
-"InteractionEvent 221 180 0 0 0 0 0\n"
-"MouseMoveEvent 221 184 0 0 0 0 0\n"
-"RenderEvent 221 184 0 0 0 0 0\n"
-"InteractionEvent 221 184 0 0 0 0 0\n"
-"MouseMoveEvent 222 187 0 0 0 0 0\n"
-"RenderEvent 222 187 0 0 0 0 0\n"
-"InteractionEvent 222 187 0 0 0 0 0\n"
-"MouseMoveEvent 222 189 0 0 0 0 0\n"
-"RenderEvent 222 189 0 0 0 0 0\n"
-"InteractionEvent 222 189 0 0 0 0 0\n"
-"MouseMoveEvent 222 193 0 0 0 0 0\n"
-"RenderEvent 222 193 0 0 0 0 0\n"
-"InteractionEvent 222 193 0 0 0 0 0\n"
-"MouseMoveEvent 222 195 0 0 0 0 0\n"
-"RenderEvent 222 195 0 0 0 0 0\n"
-"InteractionEvent 222 195 0 0 0 0 0\n"
-"MouseMoveEvent 222 197 0 0 0 0 0\n"
-"RenderEvent 222 197 0 0 0 0 0\n"
-"InteractionEvent 222 197 0 0 0 0 0\n"
-"MouseMoveEvent 222 198 0 0 0 0 0\n"
-"RenderEvent 222 198 0 0 0 0 0\n"
-"InteractionEvent 222 198 0 0 0 0 0\n"
-"MouseMoveEvent 222 199 0 0 0 0 0\n"
-"RenderEvent 222 199 0 0 0 0 0\n"
-"InteractionEvent 222 199 0 0 0 0 0\n"
-"MouseMoveEvent 222 201 0 0 0 0 0\n"
-"RenderEvent 222 201 0 0 0 0 0\n"
-"InteractionEvent 222 201 0 0 0 0 0\n"
-"MouseMoveEvent 222 202 0 0 0 0 0\n"
-"RenderEvent 222 202 0 0 0 0 0\n"
-"InteractionEvent 222 202 0 0 0 0 0\n"
-"MouseMoveEvent 222 203 0 0 0 0 0\n"
-"RenderEvent 222 203 0 0 0 0 0\n"
-"InteractionEvent 222 203 0 0 0 0 0\n"
-"MouseMoveEvent 222 204 0 0 0 0 0\n"
-"RenderEvent 222 204 0 0 0 0 0\n"
-"InteractionEvent 222 204 0 0 0 0 0\n"
-"MouseMoveEvent 223 205 0 0 0 0 0\n"
-"RenderEvent 223 205 0 0 0 0 0\n"
-"InteractionEvent 223 205 0 0 0 0 0\n"
-"MouseMoveEvent 223 206 0 0 0 0 0\n"
-"RenderEvent 223 206 0 0 0 0 0\n"
-"InteractionEvent 223 206 0 0 0 0 0\n"
-"MouseMoveEvent 223 207 0 0 0 0 0\n"
-"RenderEvent 223 207 0 0 0 0 0\n"
-"InteractionEvent 223 207 0 0 0 0 0\n"
-"MouseMoveEvent 223 208 0 0 0 0 0\n"
-"RenderEvent 223 208 0 0 0 0 0\n"
-"InteractionEvent 223 208 0 0 0 0 0\n"
-"MouseMoveEvent 223 209 0 0 0 0 0\n"
-"RenderEvent 223 209 0 0 0 0 0\n"
-"InteractionEvent 223 209 0 0 0 0 0\n"
-"MouseMoveEvent 223 210 0 0 0 0 0\n"
-"RenderEvent 223 210 0 0 0 0 0\n"
-"InteractionEvent 223 210 0 0 0 0 0\n"
-"MouseMoveEvent 224 211 0 0 0 0 0\n"
-"RenderEvent 224 211 0 0 0 0 0\n"
-"InteractionEvent 224 211 0 0 0 0 0\n"
-"MouseMoveEvent 224 212 0 0 0 0 0\n"
-"RenderEvent 224 212 0 0 0 0 0\n"
-"InteractionEvent 224 212 0 0 0 0 0\n"
-"MouseMoveEvent 224 215 0 0 0 0 0\n"
-"RenderEvent 224 215 0 0 0 0 0\n"
-"InteractionEvent 224 215 0 0 0 0 0\n"
-"MouseMoveEvent 224 218 0 0 0 0 0\n"
-"RenderEvent 224 218 0 0 0 0 0\n"
-"InteractionEvent 224 218 0 0 0 0 0\n"
-"MouseMoveEvent 225 221 0 0 0 0 0\n"
-"RenderEvent 225 221 0 0 0 0 0\n"
-"InteractionEvent 225 221 0 0 0 0 0\n"
-"MouseMoveEvent 225 222 0 0 0 0 0\n"
-"RenderEvent 225 222 0 0 0 0 0\n"
-"InteractionEvent 225 222 0 0 0 0 0\n"
-"MouseMoveEvent 225 223 0 0 0 0 0\n"
-"RenderEvent 225 223 0 0 0 0 0\n"
-"InteractionEvent 225 223 0 0 0 0 0\n"
-"MouseMoveEvent 225 224 0 0 0 0 0\n"
-"RenderEvent 225 224 0 0 0 0 0\n"
-"InteractionEvent 225 224 0 0 0 0 0\n"
-"MouseMoveEvent 225 226 0 0 0 0 0\n"
-"RenderEvent 225 226 0 0 0 0 0\n"
-"InteractionEvent 225 226 0 0 0 0 0\n"
-"MouseMoveEvent 225 227 0 0 0 0 0\n"
-"RenderEvent 225 227 0 0 0 0 0\n"
-"InteractionEvent 225 227 0 0 0 0 0\n"
-"MouseMoveEvent 225 229 0 0 0 0 0\n"
-"RenderEvent 225 229 0 0 0 0 0\n"
-"InteractionEvent 225 229 0 0 0 0 0\n"
-"MouseMoveEvent 225 231 0 0 0 0 0\n"
-"RenderEvent 225 231 0 0 0 0 0\n"
-"InteractionEvent 225 231 0 0 0 0 0\n"
-"MouseMoveEvent 225 232 0 0 0 0 0\n"
-"RenderEvent 225 232 0 0 0 0 0\n"
-"InteractionEvent 225 232 0 0 0 0 0\n"
-"MouseMoveEvent 225 233 0 0 0 0 0\n"
-"RenderEvent 225 233 0 0 0 0 0\n"
-"InteractionEvent 225 233 0 0 0 0 0\n"
-"RightButtonReleaseEvent 225 233 0 0 0 0 0\n"
-"EndInteractionEvent 225 233 0 0 0 0 0\n"
-"RenderEvent 225 233 0 0 0 0 0\n"
-"MouseMoveEvent 227 235 0 0 0 0 0\n"
-"MouseMoveEvent 228 236 0 0 0 0 0\n"
-"MouseMoveEvent 230 238 0 0 0 0 0\n"
-"MouseMoveEvent 231 238 0 0 0 0 0\n"
-"MouseMoveEvent 233 240 0 0 0 0 0\n"
-"MouseMoveEvent 234 241 0 0 0 0 0\n"
-"MouseMoveEvent 236 243 0 0 0 0 0\n"
-"MouseMoveEvent 237 244 0 0 0 0 0\n"
-"MouseMoveEvent 238 245 0 0 0 0 0\n"
-"MouseMoveEvent 239 246 0 0 0 0 0\n"
-"MouseMoveEvent 240 248 0 0 0 0 0\n"
-"MouseMoveEvent 242 251 0 0 0 0 0\n"
-"MouseMoveEvent 244 253 0 0 0 0 0\n"
-"MouseMoveEvent 245 254 0 0 0 0 0\n"
-"MouseMoveEvent 245 255 0 0 0 0 0\n"
-"MouseMoveEvent 246 257 0 0 0 0 0\n"
-"MouseMoveEvent 247 258 0 0 0 0 0\n"
-"MiddleButtonPressEvent 247 258 0 0 0 0 0\n"
-"StartInteractionEvent 247 258 0 0 0 0 0\n"
-"MouseMoveEvent 247 256 0 0 0 0 0\n"
-"RenderEvent 247 256 0 0 0 0 0\n"
-"InteractionEvent 247 256 0 0 0 0 0\n"
-"MouseMoveEvent 247 254 0 0 0 0 0\n"
-"RenderEvent 247 254 0 0 0 0 0\n"
-"InteractionEvent 247 254 0 0 0 0 0\n"
-"MouseMoveEvent 247 252 0 0 0 0 0\n"
-"RenderEvent 247 252 0 0 0 0 0\n"
-"InteractionEvent 247 252 0 0 0 0 0\n"
-"MouseMoveEvent 247 248 0 0 0 0 0\n"
-"RenderEvent 247 248 0 0 0 0 0\n"
-"InteractionEvent 247 248 0 0 0 0 0\n"
-"MouseMoveEvent 247 243 0 0 0 0 0\n"
-"RenderEvent 247 243 0 0 0 0 0\n"
-"InteractionEvent 247 243 0 0 0 0 0\n"
-"MouseMoveEvent 247 239 0 0 0 0 0\n"
-"RenderEvent 247 239 0 0 0 0 0\n"
-"InteractionEvent 247 239 0 0 0 0 0\n"
-"MouseMoveEvent 247 235 0 0 0 0 0\n"
-"RenderEvent 247 235 0 0 0 0 0\n"
-"InteractionEvent 247 235 0 0 0 0 0\n"
-"MouseMoveEvent 247 231 0 0 0 0 0\n"
-"RenderEvent 247 231 0 0 0 0 0\n"
-"InteractionEvent 247 231 0 0 0 0 0\n"
-"MouseMoveEvent 247 226 0 0 0 0 0\n"
-"RenderEvent 247 226 0 0 0 0 0\n"
-"InteractionEvent 247 226 0 0 0 0 0\n"
-"MouseMoveEvent 247 221 0 0 0 0 0\n"
-"RenderEvent 247 221 0 0 0 0 0\n"
-"InteractionEvent 247 221 0 0 0 0 0\n"
-"MouseMoveEvent 248 215 0 0 0 0 0\n"
-"RenderEvent 248 215 0 0 0 0 0\n"
-"InteractionEvent 248 215 0 0 0 0 0\n"
-"MouseMoveEvent 249 207 0 0 0 0 0\n"
-"RenderEvent 249 207 0 0 0 0 0\n"
-"InteractionEvent 249 207 0 0 0 0 0\n"
-"MouseMoveEvent 249 200 0 0 0 0 0\n"
-"RenderEvent 249 200 0 0 0 0 0\n"
-"InteractionEvent 249 200 0 0 0 0 0\n"
-"MouseMoveEvent 249 196 0 0 0 0 0\n"
-"RenderEvent 249 196 0 0 0 0 0\n"
-"InteractionEvent 249 196 0 0 0 0 0\n"
-"MouseMoveEvent 250 191 0 0 0 0 0\n"
-"RenderEvent 250 191 0 0 0 0 0\n"
-"InteractionEvent 250 191 0 0 0 0 0\n"
-"MouseMoveEvent 250 189 0 0 0 0 0\n"
-"RenderEvent 250 189 0 0 0 0 0\n"
-"InteractionEvent 250 189 0 0 0 0 0\n"
-"MouseMoveEvent 250 185 0 0 0 0 0\n"
-"RenderEvent 250 185 0 0 0 0 0\n"
-"InteractionEvent 250 185 0 0 0 0 0\n"
-"MouseMoveEvent 250 179 0 0 0 0 0\n"
-"RenderEvent 250 179 0 0 0 0 0\n"
-"InteractionEvent 250 179 0 0 0 0 0\n"
-"MouseMoveEvent 251 178 0 0 0 0 0\n"
-"RenderEvent 251 178 0 0 0 0 0\n"
-"InteractionEvent 251 178 0 0 0 0 0\n"
-"MouseMoveEvent 251 177 0 0 0 0 0\n"
-"RenderEvent 251 177 0 0 0 0 0\n"
-"InteractionEvent 251 177 0 0 0 0 0\n"
-"MouseMoveEvent 251 176 0 0 0 0 0\n"
-"RenderEvent 251 176 0 0 0 0 0\n"
-"InteractionEvent 251 176 0 0 0 0 0\n"
-"MouseMoveEvent 251 175 0 0 0 0 0\n"
-"RenderEvent 251 175 0 0 0 0 0\n"
-"InteractionEvent 251 175 0 0 0 0 0\n"
-"MouseMoveEvent 251 174 0 0 0 0 0\n"
-"RenderEvent 251 174 0 0 0 0 0\n"
-"InteractionEvent 251 174 0 0 0 0 0\n"
-"MouseMoveEvent 251 172 0 0 0 0 0\n"
-"RenderEvent 251 172 0 0 0 0 0\n"
-"InteractionEvent 251 172 0 0 0 0 0\n"
-"MouseMoveEvent 251 170 0 0 0 0 0\n"
-"RenderEvent 251 170 0 0 0 0 0\n"
-"InteractionEvent 251 170 0 0 0 0 0\n"
-"MouseMoveEvent 251 167 0 0 0 0 0\n"
-"RenderEvent 251 167 0 0 0 0 0\n"
-"InteractionEvent 251 167 0 0 0 0 0\n"
-"MouseMoveEvent 251 166 0 0 0 0 0\n"
-"RenderEvent 251 166 0 0 0 0 0\n"
-"InteractionEvent 251 166 0 0 0 0 0\n"
-"MouseMoveEvent 251 165 0 0 0 0 0\n"
-"RenderEvent 251 165 0 0 0 0 0\n"
-"InteractionEvent 251 165 0 0 0 0 0\n"
-"MouseMoveEvent 251 164 0 0 0 0 0\n"
-"RenderEvent 251 164 0 0 0 0 0\n"
-"InteractionEvent 251 164 0 0 0 0 0\n"
-"MouseMoveEvent 251 162 0 0 0 0 0\n"
-"RenderEvent 251 162 0 0 0 0 0\n"
-"InteractionEvent 251 162 0 0 0 0 0\n"
-"MouseMoveEvent 251 161 0 0 0 0 0\n"
-"RenderEvent 251 161 0 0 0 0 0\n"
-"InteractionEvent 251 161 0 0 0 0 0\n"
-"MouseMoveEvent 251 159 0 0 0 0 0\n"
-"RenderEvent 251 159 0 0 0 0 0\n"
-"InteractionEvent 251 159 0 0 0 0 0\n"
-"MouseMoveEvent 251 157 0 0 0 0 0\n"
-"RenderEvent 251 157 0 0 0 0 0\n"
-"InteractionEvent 251 157 0 0 0 0 0\n"
-"MouseMoveEvent 250 159 0 0 0 0 0\n"
-"RenderEvent 250 159 0 0 0 0 0\n"
-"InteractionEvent 250 159 0 0 0 0 0\n"
-"MouseMoveEvent 250 160 0 0 0 0 0\n"
-"RenderEvent 250 160 0 0 0 0 0\n"
-"InteractionEvent 250 160 0 0 0 0 0\n"
-"MouseMoveEvent 249 162 0 0 0 0 0\n"
-"RenderEvent 249 162 0 0 0 0 0\n"
-"InteractionEvent 249 162 0 0 0 0 0\n"
-"MouseMoveEvent 249 163 0 0 0 0 0\n"
-"RenderEvent 249 163 0 0 0 0 0\n"
-"InteractionEvent 249 163 0 0 0 0 0\n"
-"MouseMoveEvent 249 165 0 0 0 0 0\n"
-"RenderEvent 249 165 0 0 0 0 0\n"
-"InteractionEvent 249 165 0 0 0 0 0\n"
-"MouseMoveEvent 249 167 0 0 0 0 0\n"
-"RenderEvent 249 167 0 0 0 0 0\n"
-"InteractionEvent 249 167 0 0 0 0 0\n"
-"MouseMoveEvent 249 168 0 0 0 0 0\n"
-"RenderEvent 249 168 0 0 0 0 0\n"
-"InteractionEvent 249 168 0 0 0 0 0\n"
-"MouseMoveEvent 249 169 0 0 0 0 0\n"
-"RenderEvent 249 169 0 0 0 0 0\n"
-"InteractionEvent 249 169 0 0 0 0 0\n"
-"MouseMoveEvent 249 170 0 0 0 0 0\n"
-"RenderEvent 249 170 0 0 0 0 0\n"
-"InteractionEvent 249 170 0 0 0 0 0\n"
-"MouseMoveEvent 249 171 0 0 0 0 0\n"
-"RenderEvent 249 171 0 0 0 0 0\n"
-"InteractionEvent 249 171 0 0 0 0 0\n"
-"MouseMoveEvent 249 172 0 0 0 0 0\n"
-"RenderEvent 249 172 0 0 0 0 0\n"
-"InteractionEvent 249 172 0 0 0 0 0\n"
-"MouseMoveEvent 249 173 0 0 0 0 0\n"
-"RenderEvent 249 173 0 0 0 0 0\n"
-"InteractionEvent 249 173 0 0 0 0 0\n"
-"MouseMoveEvent 249 174 0 0 0 0 0\n"
-"RenderEvent 249 174 0 0 0 0 0\n"
-"InteractionEvent 249 174 0 0 0 0 0\n"
-"MouseMoveEvent 249 175 0 0 0 0 0\n"
-"RenderEvent 249 175 0 0 0 0 0\n"
-"InteractionEvent 249 175 0 0 0 0 0\n"
-"MouseMoveEvent 249 176 0 0 0 0 0\n"
-"RenderEvent 249 176 0 0 0 0 0\n"
-"InteractionEvent 249 176 0 0 0 0 0\n"
-"MouseMoveEvent 249 177 0 0 0 0 0\n"
-"RenderEvent 249 177 0 0 0 0 0\n"
-"InteractionEvent 249 177 0 0 0 0 0\n"
-"MouseMoveEvent 249 178 0 0 0 0 0\n"
-"RenderEvent 249 178 0 0 0 0 0\n"
-"InteractionEvent 249 178 0 0 0 0 0\n"
-"MouseMoveEvent 249 179 0 0 0 0 0\n"
-"RenderEvent 249 179 0 0 0 0 0\n"
-"InteractionEvent 249 179 0 0 0 0 0\n"
-"MouseMoveEvent 250 181 0 0 0 0 0\n"
-"RenderEvent 250 181 0 0 0 0 0\n"
-"InteractionEvent 250 181 0 0 0 0 0\n"
-"MiddleButtonReleaseEvent 250 181 0 0 0 0 0\n"
-"EndInteractionEvent 250 181 0 0 0 0 0\n"
-"RenderEvent 250 181 0 0 0 0 0\n"
-"MouseMoveEvent 251 182 0 0 0 0 0\n"
-"MouseMoveEvent 252 180 0 0 0 0 0\n"
-"MouseMoveEvent 253 179 0 0 0 0 0\n"
-"MouseMoveEvent 254 176 0 0 0 0 0\n"
-"MouseMoveEvent 255 174 0 0 0 0 0\n"
-"MouseMoveEvent 256 171 0 0 0 0 0\n"
-"MouseMoveEvent 258 167 0 0 0 0 0\n"
-"MouseMoveEvent 259 165 0 0 0 0 0\n"
-"MouseMoveEvent 260 162 0 0 0 0 0\n"
-"MouseMoveEvent 261 159 0 0 0 0 0\n"
-"MouseMoveEvent 262 157 0 0 0 0 0\n"
-"MouseMoveEvent 263 156 0 0 0 0 0\n"
-"MouseMoveEvent 264 154 0 0 0 0 0\n"
-"MouseMoveEvent 265 153 0 0 0 0 0\n"
-"MouseMoveEvent 266 151 0 0 0 0 0\n"
-"MouseMoveEvent 267 148 0 0 0 0 0\n"
-"MouseMoveEvent 268 146 0 0 0 0 0\n"
-"MouseMoveEvent 269 144 0 0 0 0 0\n"
-"MouseMoveEvent 271 141 0 0 0 0 0\n"
-"MouseMoveEvent 272 139 0 0 0 0 0\n"
-"MouseMoveEvent 274 137 0 0 0 0 0\n"
-"MouseMoveEvent 276 134 0 0 0 0 0\n"
-"MouseMoveEvent 278 131 0 0 0 0 0\n"
-"MouseMoveEvent 280 129 0 0 0 0 0\n"
-"MouseMoveEvent 281 128 0 0 0 0 0\n"
-"MouseMoveEvent 283 125 0 0 0 0 0\n"
-"MouseMoveEvent 284 124 0 0 0 0 0\n"
-"MouseMoveEvent 286 122 0 0 0 0 0\n"
-"MouseMoveEvent 287 119 0 0 0 0 0\n"
-"MouseMoveEvent 288 117 0 0 0 0 0\n"
-"MouseMoveEvent 289 115 0 0 0 0 0\n"
-"MouseMoveEvent 289 113 0 0 0 0 0\n"
-"MouseMoveEvent 290 111 0 0 0 0 0\n"
-"MouseMoveEvent 291 108 0 0 0 0 0\n"
-"MouseMoveEvent 292 105 0 0 0 0 0\n"
-"MouseMoveEvent 293 102 0 0 0 0 0\n"
-"MouseMoveEvent 295 98 0 0 0 0 0\n"
-"MouseMoveEvent 296 96 0 0 0 0 0\n"
-"MouseMoveEvent 298 92 0 0 0 0 0\n"
-"MouseMoveEvent 300 89 0 0 0 0 0\n"
-"MouseMoveEvent 301 87 0 0 0 0 0\n"
-"MouseMoveEvent 303 82 0 0 0 0 0\n"
-"MouseMoveEvent 304 79 0 0 0 0 0\n"
-"MouseMoveEvent 306 75 0 0 0 0 0\n"
-"MouseMoveEvent 308 70 0 0 0 0 0\n"
-"MouseMoveEvent 312 65 0 0 0 0 0\n"
-"MouseMoveEvent 318 59 0 0 0 0 0\n"
-"MouseMoveEvent 325 53 0 0 0 0 0\n"
-"MouseMoveEvent 334 47 0 0 0 0 0\n"
-"MouseMoveEvent 344 41 0 0 0 0 0\n"
-"MouseMoveEvent 354 33 0 0 0 0 0\n"
-"MouseMoveEvent 364 27 0 0 0 0 0\n"
-"MouseMoveEvent 371 22 0 0 0 0 0\n"
-"MouseMoveEvent 377 22 0 0 0 0 0\n"
-"MouseMoveEvent 378 22 0 0 0 0 0\n"
-"MouseMoveEvent 378 23 0 0 0 0 0\n"
-"MouseMoveEvent 379 25 0 0 0 0 0\n"
-"MouseMoveEvent 380 26 0 0 0 0 0\n"
-"MouseMoveEvent 381 27 0 0 0 0 0\n"
-"MouseMoveEvent 380 27 0 0 0 0 0\n"
-"MouseMoveEvent 379 27 0 0 0 0 0\n"
-"MouseMoveEvent 378 27 0 0 0 0 0\n"
-"MouseMoveEvent 377 27 0 0 0 0 0\n"
-"MouseMoveEvent 376 26 0 0 0 0 0\n"
-"MouseMoveEvent 374 25 0 0 0 0 0\n"
-"MouseMoveEvent 371 24 0 0 0 0 0\n"
-"MouseMoveEvent 369 23 0 0 0 0 0\n"
-"MouseMoveEvent 367 22 0 0 0 0 0\n"
-"MouseMoveEvent 366 22 0 0 0 0 0\n"
-"MouseMoveEvent 364 20 0 0 0 0 0\n"
-"MouseMoveEvent 364 18 0 0 0 0 0\n"
-"MouseMoveEvent 364 16 0 0 0 0 0\n"
-"MouseMoveEvent 365 13 0 0 0 0 0\n"
-"MouseMoveEvent 367 11 0 0 0 0 0\n"
-"MouseMoveEvent 368 10 0 0 0 0 0\n"
-"MouseMoveEvent 372 8 0 0 0 0 0\n"
-"MouseMoveEvent 375 6 0 0 0 0 0\n"
-"MouseMoveEvent 384 1 0 0 0 0 0\n"
-"LeaveEvent 399 -8 0 0 0 0 0\n"
-;
-
-int TestGPUVolumeRayCastMapper(int argc, char *argv[])
-{
-  cout << "CTEST_FULL_OUTPUT (Avoid ctest truncation of output)" << endl;
-
-  vtkNew<vtkRTAnalyticSource> wavelet;
-  wavelet->SetWholeExtent(-10, 10,
-                          -10, 10,
-                          -10, 10);
-  wavelet->SetCenter(0.0, 0.0, 0.0);
-
-  vtkNew<vtkGPUVolumeRayCastMapper> volumeMapper;
-  volumeMapper->SetAutoAdjustSampleDistances(0);
-  volumeMapper->SetSampleDistance(0.5);
-  volumeMapper->SetInputConnection(wavelet->GetOutputPort());
-
-  vtkNew<vtkVolumeProperty> volumeProperty;
-  vtkNew<vtkColorTransferFunction> ctf;
-  ctf->AddRGBPoint(37.3531, 0.2, 0.29, 1);
-  ctf->AddRGBPoint(157.091, 0.87, 0.87, 0.87);
-  ctf->AddRGBPoint(276.829, 0.7, 0.015, 0.15);
-
-  vtkNew<vtkPiecewiseFunction> pwf;
-  pwf->AddPoint(37.3531, 0.0);
-  pwf->AddPoint(276.829, 1.0);
-
-  volumeProperty->SetColor(ctf.GetPointer());
-  volumeProperty->SetScalarOpacity(pwf.GetPointer());
-  volumeProperty->SetShade(0);
-  volumeProperty->SetScalarOpacityUnitDistance(1.732);
-
-  vtkNew<vtkVolume> volume;
-  volume->SetMapper(volumeMapper.GetPointer());
-  volume->SetProperty(volumeProperty.GetPointer());
-
-  // Create the renderwindow, interactor and renderer
-  vtkNew<vtkRenderWindow> renderWindow;
-  renderWindow->SetMultiSamples(0);
-  renderWindow->SetSize(401, 399); // NPOT size
-  vtkNew<vtkRenderWindowInteractor> iren;
-  iren->SetRenderWindow(renderWindow.GetPointer());
-  vtkNew<vtkInteractorStyleTrackballCamera> style;
-  iren->SetInteractorStyle(style.GetPointer());
-  vtkNew<vtkRenderer> renderer;
-  renderer->SetBackground(0.3, 0.3, 0.4);
-  renderWindow->AddRenderer(renderer.GetPointer());
-
-  renderer->AddVolume(volume.GetPointer());
-  renderer->ResetCamera();
-  renderWindow->Render();
-
-  int valid = volumeMapper->IsRenderSupported(renderWindow.GetPointer(),
-                                              volumeProperty.GetPointer());
-
-  int retVal;
-  if (valid)
-    {
-    retVal = !( vtkTesting::InteractorEventLoop(argc, argv,
-                                                iren.GetPointer(),
-                                                TestGPUVolumeRayCastMapperLog));
-    }
-  else
-    {
-    retVal = vtkTesting::PASSED;
-    cout << "Required extensions not supported." << endl;
-    }
-
-  return !retVal;
-}
diff --git a/Rendering/Volume/Testing/Cxx/TestSmartVolumeMapperWindowLevel.cxx b/Rendering/Volume/Testing/Cxx/TestSmartVolumeMapperWindowLevel.cxx
index 90304a3..dafdecf 100644
--- a/Rendering/Volume/Testing/Cxx/TestSmartVolumeMapperWindowLevel.cxx
+++ b/Rendering/Volume/Testing/Cxx/TestSmartVolumeMapperWindowLevel.cxx
@@ -626,24 +626,12 @@ int TestSmartVolumeMapperWindowLevel(int argc,
 
   vtkNew<vtkSmartVolumeMapper> mapper1;
   mapper1->SetInputConnection(reader->GetOutputPort());
-  mapper1->SetRequestedRenderModeToDefault();
-
   vtkNew<vtkSmartVolumeMapper> mapper2;
   mapper2->SetInputConnection(reader->GetOutputPort());
-
   vtkNew<vtkSmartVolumeMapper> mapper3;
   mapper3->SetInputConnection(reader->GetOutputPort());
   mapper3->SetRequestedRenderModeToRayCast();
 
-#ifdef VTK_OPENGL2
-  mapper1->SetAutoAdjustSampleDistances(0);
-  mapper1->SetInteractiveAdjustSampleDistances(0);
-  mapper2->SetAutoAdjustSampleDistances(0);
-  mapper2->SetInteractiveAdjustSampleDistances(0);
-  mapper3->SetAutoAdjustSampleDistances(0);
-  mapper3->SetInteractiveAdjustSampleDistances(0);
-#endif
-
   vtkNew<vtkColorTransferFunction> ctf;
   ctf->AddHSVPoint(1.0, 0.65, 1.0, 1.0);
   ctf->AddHSVPoint(256, 0.95, 0.098, 1.0);
diff --git a/Rendering/Volume/Testing/Data/Baseline/TestGPURayCastCameraInside.png.md5 b/Rendering/Volume/Testing/Data/Baseline/TestGPURayCastCameraInside.png.md5
deleted file mode 100644
index d04d5a7..0000000
--- a/Rendering/Volume/Testing/Data/Baseline/TestGPURayCastCameraInside.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-4996294578e73d254b9ad16d4693cc3b
diff --git a/Rendering/Volume/Testing/Data/Baseline/TestGPURayCastCameraInsideSmallSpacing.png.md5 b/Rendering/Volume/Testing/Data/Baseline/TestGPURayCastCameraInsideSmallSpacing.png.md5
deleted file mode 100644
index 691952d..0000000
--- a/Rendering/Volume/Testing/Data/Baseline/TestGPURayCastCameraInsideSmallSpacing.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-1f3f318ea408ff107545617b25747adf
diff --git a/Rendering/Volume/Testing/Data/Baseline/TestGPURayCastClipping.png.md5 b/Rendering/Volume/Testing/Data/Baseline/TestGPURayCastClipping.png.md5
index ea15ac0..0be8715 100644
--- a/Rendering/Volume/Testing/Data/Baseline/TestGPURayCastClipping.png.md5
+++ b/Rendering/Volume/Testing/Data/Baseline/TestGPURayCastClipping.png.md5
@@ -1 +1 @@
-8a9b985a6e629a234bc8d8d343b2c8a2
+78d105bba949350374da5f3e1267a654
diff --git a/Rendering/Volume/Testing/Data/Baseline/TestGPURayCastCropping1.png.md5 b/Rendering/Volume/Testing/Data/Baseline/TestGPURayCastCropping1.png.md5
index 6f9f5a1..1623c65 100644
--- a/Rendering/Volume/Testing/Data/Baseline/TestGPURayCastCropping1.png.md5
+++ b/Rendering/Volume/Testing/Data/Baseline/TestGPURayCastCropping1.png.md5
@@ -1 +1 @@
-66208589a3e3f324ec67652a3303d3e8
+031cc017ff4bed0d620bdebc041fffe4
diff --git a/Rendering/Volume/Testing/Data/Baseline/TestGPURayCastIndependentComponentMinIP.png.md5 b/Rendering/Volume/Testing/Data/Baseline/TestGPURayCastIndependentComponentMinIP.png.md5
index 978b842..4d6e7ed 100644
--- a/Rendering/Volume/Testing/Data/Baseline/TestGPURayCastIndependentComponentMinIP.png.md5
+++ b/Rendering/Volume/Testing/Data/Baseline/TestGPURayCastIndependentComponentMinIP.png.md5
@@ -1 +1 @@
-a4b519ff5daf727ae39cd4ca9bc5918e
+787ac19c55b11c28cb0249fee76acc8d
diff --git a/Rendering/Volume/Testing/Data/Baseline/TestGPURayCastReleaseResources.png.md5 b/Rendering/Volume/Testing/Data/Baseline/TestGPURayCastReleaseResources.png.md5
deleted file mode 100644
index c49bad6..0000000
--- a/Rendering/Volume/Testing/Data/Baseline/TestGPURayCastReleaseResources.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-81411d562fc26f918cbc1d9bf5764073
diff --git a/Rendering/Volume/Testing/Data/Baseline/TestGPURayCastThreeComponentsIndependent.png.md5 b/Rendering/Volume/Testing/Data/Baseline/TestGPURayCastThreeComponentsIndependent.png.md5
deleted file mode 100644
index 8c04a4e..0000000
--- a/Rendering/Volume/Testing/Data/Baseline/TestGPURayCastThreeComponentsIndependent.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-ed3ef7b4303f8fbb76755200a8d70aeb
diff --git a/Rendering/Volume/Testing/Data/Baseline/TestGPURayCastTwoComponentsDependent.png.md5 b/Rendering/Volume/Testing/Data/Baseline/TestGPURayCastTwoComponentsDependent.png.md5
deleted file mode 100644
index 1cb5271..0000000
--- a/Rendering/Volume/Testing/Data/Baseline/TestGPURayCastTwoComponentsDependent.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-9cb55c594221d346ff07fffbb3fb13e5
diff --git a/Rendering/Volume/Testing/Data/Baseline/TestGPURayCastTwoComponentsIndependent.png.md5 b/Rendering/Volume/Testing/Data/Baseline/TestGPURayCastTwoComponentsIndependent.png.md5
deleted file mode 100644
index 2abba02..0000000
--- a/Rendering/Volume/Testing/Data/Baseline/TestGPURayCastTwoComponentsIndependent.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-2f7b9a39d33d0b46deaed0d524b4a22b
diff --git a/Rendering/Volume/Testing/Data/Baseline/TestGPURayCastVolumeUpdate.png.md5 b/Rendering/Volume/Testing/Data/Baseline/TestGPURayCastVolumeUpdate.png.md5
index 5cb0e80..2b26e52 100644
--- a/Rendering/Volume/Testing/Data/Baseline/TestGPURayCastVolumeUpdate.png.md5
+++ b/Rendering/Volume/Testing/Data/Baseline/TestGPURayCastVolumeUpdate.png.md5
@@ -1 +1 @@
-b076ea879c259729c3296f589a2c3668
+2bdeeb7de22c7fee671c13c9051344e0
diff --git a/Rendering/Volume/Testing/Data/Baseline/TestGPURayCastVolumeUpdate_1.png.md5 b/Rendering/Volume/Testing/Data/Baseline/TestGPURayCastVolumeUpdate_1.png.md5
index 2a969f2..fc7c657 100644
--- a/Rendering/Volume/Testing/Data/Baseline/TestGPURayCastVolumeUpdate_1.png.md5
+++ b/Rendering/Volume/Testing/Data/Baseline/TestGPURayCastVolumeUpdate_1.png.md5
@@ -1 +1 @@
-1c57fcc259ca8af12a92147790c1367f
+d2ccc09d634b94865e6e9606d96c364b
diff --git a/Rendering/Volume/Testing/Data/Baseline/TestGPUVolumeRayCastMapper.png.md5 b/Rendering/Volume/Testing/Data/Baseline/TestGPUVolumeRayCastMapper.png.md5
deleted file mode 100644
index 6e9d337..0000000
--- a/Rendering/Volume/Testing/Data/Baseline/TestGPUVolumeRayCastMapper.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-00b6935d399b80e4f9edc1414a4c363f
diff --git a/Rendering/Volume/Testing/Data/Baseline/TestGPUVolumeRayCastMapper_1.png.md5 b/Rendering/Volume/Testing/Data/Baseline/TestGPUVolumeRayCastMapper_1.png.md5
deleted file mode 100644
index e70707a..0000000
--- a/Rendering/Volume/Testing/Data/Baseline/TestGPUVolumeRayCastMapper_1.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-de748c53084ac9a9e21cb9ec7911c429
diff --git a/Rendering/Volume/module.cmake b/Rendering/Volume/module.cmake
index 3c9fe44..61177dc 100644
--- a/Rendering/Volume/module.cmake
+++ b/Rendering/Volume/module.cmake
@@ -1,3 +1,11 @@
+if (Module_vtkRenderingVolumeOpenGLNEW AND
+    NOT (VTK_RENDERING_BACKEND STREQUAL "OpenGL2"))
+  set(VTK_RENDERING_VOLUME_BACKEND
+    "vtkRenderingVolumeOpenGLNew")
+else ()
+  set (VTK_RENDERING_VOLUME_BACKEND "")
+endif()
+
 vtk_module(vtkRenderingVolume
   GROUPS
     Rendering
@@ -9,6 +17,7 @@ vtk_module(vtkRenderingVolume
     vtkTestingCore
     vtkTestingRendering
     vtkRenderingVolume${VTK_RENDERING_BACKEND}
+    ${VTK_RENDERING_VOLUME_BACKEND}
     vtkRenderingFreeType
     vtkIOXML
     vtkImagingSources
diff --git a/Rendering/Volume/vtkEncodedGradientEstimator.cxx b/Rendering/Volume/vtkEncodedGradientEstimator.cxx
index c0a0f50..6376f33 100644
--- a/Rendering/Volume/vtkEncodedGradientEstimator.cxx
+++ b/Rendering/Volume/vtkEncodedGradientEstimator.cxx
@@ -70,16 +70,25 @@ vtkEncodedGradientEstimator::~vtkEncodedGradientEstimator()
   this->Threader->Delete();
   this->Threader = NULL;
 
-  delete [] this->EncodedNormals;
+  if ( this->EncodedNormals )
+    {
+    delete [] this->EncodedNormals;
+    }
 
-  delete [] this->GradientMagnitudes;
+  if ( this->GradientMagnitudes )
+    {
+    delete [] this->GradientMagnitudes;
+    }
 
   if ( this->DirectionEncoder )
     {
     this->DirectionEncoder->UnRegister( this );
     }
 
-  delete [] this->CircleLimits;
+  if ( this->CircleLimits )
+    {
+    delete [] this->CircleLimits;
+    }
 }
 
 void vtkEncodedGradientEstimator::SetZeroNormalThreshold( float v )
@@ -191,11 +200,16 @@ void vtkEncodedGradientEstimator::Update( )
          this->EncodedNormalsSize[1] != scalarInputSize[1] ||
          this->EncodedNormalsSize[2] != scalarInputSize[2] )
       {
-      delete [] this->EncodedNormals;
-      this->EncodedNormals = NULL;
-
-      delete [] this->GradientMagnitudes;
-      this->GradientMagnitudes = NULL;
+      if ( this->EncodedNormals )
+        {
+        delete [] this->EncodedNormals;
+        this->EncodedNormals = NULL;
+        }
+      if ( this->GradientMagnitudes )
+        {
+        delete [] this->GradientMagnitudes;
+        this->GradientMagnitudes = NULL;
+        }
       }
 
     // Compute the number of encoded voxels
@@ -254,7 +268,10 @@ void vtkEncodedGradientEstimator::ComputeCircleLimits( int size )
 
   if ( this->CircleLimitsSize != size )
     {
-    delete [] this->CircleLimits;
+    if ( this->CircleLimits )
+      {
+      delete [] this->CircleLimits;
+      }
     this->CircleLimits = new int[2*size];
     this->CircleLimitsSize = size;
     }
diff --git a/Rendering/Volume/vtkEncodedGradientShader.cxx b/Rendering/Volume/vtkEncodedGradientShader.cxx
index 40e9e36..73463f9 100644
--- a/Rendering/Volume/vtkEncodedGradientShader.cxx
+++ b/Rendering/Volume/vtkEncodedGradientShader.cxx
@@ -57,7 +57,10 @@ vtkEncodedGradientShader::~vtkEncodedGradientShader()
     {
     for ( i=0; i<6; i++ )
       {
-      delete [] this->ShadingTable[j][i];
+      if ( this->ShadingTable[j][i] )
+        {
+        delete [] this->ShadingTable[j][i];
+        }
       }
     }
 }
@@ -440,7 +443,10 @@ void vtkEncodedGradientShader::BuildShadingTable( int index,
     {
     for ( i=0; i<6; i++ )
       {
-      delete [] this->ShadingTable[index][i];
+      if ( this->ShadingTable[index][i] )
+        {
+        delete [] this->ShadingTable[index][i];
+        }
       this->ShadingTable[index][i] = new float[norm_size];
       }
       this->ShadingTableSize[index] = norm_size;
diff --git a/Rendering/Volume/vtkFixedPointVolumeRayCastMapper.cxx b/Rendering/Volume/vtkFixedPointVolumeRayCastMapper.cxx
index cd64ce0..ba5a440 100644
--- a/Rendering/Volume/vtkFixedPointVolumeRayCastMapper.cxx
+++ b/Rendering/Volume/vtkFixedPointVolumeRayCastMapper.cxx
@@ -410,6 +410,9 @@ void vtkFixedPointVolumeRayCastMapperComputeGradients( T *dataPtr,
   aspect[1] = spacing[1] * 2.0 / avgSpacing;
   aspect[2] = spacing[2] * 2.0 / avgSpacing;
 
+  std::cerr << "spacing is " << spacing[0] << " " << spacing[1] << " " << spacing[2] << std::endl;
+  std::cerr << "aspect is " << aspect[0] << " " << aspect[1] << " " << aspect[2] << std::endl;
+
   // compute the increments
   yinc = static_cast<vtkIdType>(dim[0]);
   zinc = yinc*static_cast<vtkIdType>(dim[1]);
diff --git a/Rendering/Volume/vtkGPUVolumeRayCastMapper.cxx b/Rendering/Volume/vtkGPUVolumeRayCastMapper.cxx
index a594435..6ab6532 100644
--- a/Rendering/Volume/vtkGPUVolumeRayCastMapper.cxx
+++ b/Rendering/Volume/vtkGPUVolumeRayCastMapper.cxx
@@ -369,44 +369,12 @@ int vtkGPUVolumeRayCastMapper::ValidateRender(vtkRenderer *ren,
       }
     }
 
-  int numberOfComponents = 0;
-  numberOfComponents = scalars->GetNumberOfComponents();
-
-#ifdef VTK_OPENGL2
-  // This mapper supports anywhere from 1-4 components. Number of components
-  // outside this range is not supported.
-  if( goodSoFar )
-    {
-    if( numberOfComponents <= 0 || numberOfComponents > 4 )
-      {
-      goodSoFar = 0;
-      vtkErrorMacro(<< "Only 1 - 4 component scalars "
-                    << "are supported by this mapper."
-                    << "The input data has " << numberOfComponents
-                    << " component(s).");
-      }
-    }
-
-  // If the dataset has dependent components (as set in the volume property),
-  // only 2 or 4 component scalars are supported.
-  if( goodSoFar )
-    {
-    if( !(vol->GetProperty()->GetIndependentComponents()) &&
-        (numberOfComponents == 1 || numberOfComponents == 3) )
-      {
-      goodSoFar = 0;
-      vtkErrorMacro(<< "If IndependentComponents is Off in the "
-                    << "volume property, then the data must have "
-                    << "either 2 or 4 component scalars. "
-                    << "The input data has " << numberOfComponents
-                    << " component(s).");
-      }
-    }
-#else
   // This mapper supports 1 component data, or 4 component if it is not independent
   // component (i.e. the four components define RGBA)
+  int numberOfComponents = 0;
   if ( goodSoFar )
     {
+    numberOfComponents = scalars->GetNumberOfComponents();
     if( !(numberOfComponents == 1 ||
           numberOfComponents == 4) )
       {
@@ -432,7 +400,7 @@ int vtkGPUVolumeRayCastMapper::ValidateRender(vtkRenderer *ren,
     goodSoFar=0;
     vtkErrorMacro("Additive mode only works with 1-component scalars!");
     }
-#endif
+
   // return our status
   return goodSoFar;
 }
diff --git a/Rendering/Volume/vtkHAVSVolumeMapper.cxx b/Rendering/Volume/vtkHAVSVolumeMapper.cxx
index c34e3fe..f73c9c4 100644
--- a/Rendering/Volume/vtkHAVSVolumeMapper.cxx
+++ b/Rendering/Volume/vtkHAVSVolumeMapper.cxx
@@ -185,7 +185,7 @@ public:
 
   ~vtkHAVSScalarHistogram()
   {
-    if (this->ScalarTable) { delete [] ScalarTable; }
+    this->Cleanup();
   }
 
   void DefineBuckets(unsigned int nBuckets)
@@ -227,6 +227,12 @@ public:
       }
     return max;
   }
+
+  void Cleanup()
+  {
+    if (this->ScalarTable) { delete [] ScalarTable; }
+    this->ScalarTable = NULL;
+  }
 };
 
 
diff --git a/Rendering/Volume/vtkRecursiveSphereDirectionEncoder.cxx b/Rendering/Volume/vtkRecursiveSphereDirectionEncoder.cxx
index 4c9b942..2e5ec1c 100644
--- a/Rendering/Volume/vtkRecursiveSphereDirectionEncoder.cxx
+++ b/Rendering/Volume/vtkRecursiveSphereDirectionEncoder.cxx
@@ -33,8 +33,14 @@ vtkRecursiveSphereDirectionEncoder::vtkRecursiveSphereDirectionEncoder()
 // Destruct a vtkRecursiveSphereDirectionEncoder - free up any memory used
 vtkRecursiveSphereDirectionEncoder::~vtkRecursiveSphereDirectionEncoder()
 {
-  delete [] this->IndexTable;
-  delete [] this->DecodedNormal;
+  if ( this->IndexTable )
+    {
+    delete [] this->IndexTable;
+    }
+  if ( this->DecodedNormal )
+    {
+    delete [] this->DecodedNormal;
+    }
 }
 
 
@@ -154,8 +160,14 @@ void vtkRecursiveSphereDirectionEncoder::InitializeIndexTable( void )
   int     limit;
 
   // Free up any memory previously used
-  delete [] this->IndexTable;
-  delete [] this->DecodedNormal;
+  if ( this->IndexTable )
+    {
+    delete [] this->IndexTable;
+    }
+  if ( this->DecodedNormal )
+    {
+    delete [] this->DecodedNormal;
+    }
 
   this->OuterSize = (int)(pow( 2.0, (double) this->RecursionDepth ) + 1);
   this->InnerSize = this->OuterSize - 1;
diff --git a/Rendering/Volume/vtkUnstructuredGridBunykRayCastFunction.cxx b/Rendering/Volume/vtkUnstructuredGridBunykRayCastFunction.cxx
index e946117..5817acb 100644
--- a/Rendering/Volume/vtkUnstructuredGridBunykRayCastFunction.cxx
+++ b/Rendering/Volume/vtkUnstructuredGridBunykRayCastFunction.cxx
@@ -36,8 +36,6 @@
 #include "vtkCellIterator.h"
 #include "vtkDataArrayIteratorMacro.h"
 
-#include <cassert>
-
 vtkStandardNewMacro(vtkUnstructuredGridBunykRayCastFunction);
 
 #define VTK_BUNYKRCF_NUMLISTS 100000
@@ -889,24 +887,24 @@ int  vtkUnstructuredGridBunykRayCastFunction::IsTriangleFrontFacing( Triangle *t
   pts[2] = cell->GetPointId(2);
   pts[3] = cell->GetPointId(3);
 
-  for( int i = 0; i < 4; i++ )
+  int i;
+  for( i = 0; i < 4; i++ )
     {
     if ( pts[i] != triPtr->PointIndex[0] &&
          pts[i] != triPtr->PointIndex[1] &&
          pts[i] != triPtr->PointIndex[2] )
       {
-      double d =
-        triPtr->A*this->Points[3*pts[i]] +
-        triPtr->B*this->Points[3*pts[i]+1] +
-        triPtr->C*this->Points[3*pts[i]+2] +
-        triPtr->D;
-
-      return (d>0);
+      break;
       }
     }
 
-  assert(0);
-  return false;
+  double d =
+    triPtr->A*this->Points[3*pts[i]] +
+    triPtr->B*this->Points[3*pts[i]+1] +
+    triPtr->C*this->Points[3*pts[i]+2] +
+    triPtr->D;
+
+  return (d>0);
 }
 
 template <class T, class ScalarIterator>
diff --git a/Rendering/Volume/vtkUnstructuredGridLinearRayIntegrator.cxx b/Rendering/Volume/vtkUnstructuredGridLinearRayIntegrator.cxx
index 42cf44d..7b640dc 100644
--- a/Rendering/Volume/vtkUnstructuredGridLinearRayIntegrator.cxx
+++ b/Rendering/Volume/vtkUnstructuredGridLinearRayIntegrator.cxx
@@ -293,8 +293,7 @@ inline void vtkLinearRayIntegratorTransferFunction::GetColor(double x,
                                                              double c[4])
 {
   int i = 1;
-  while ((i < this->NumControlPoints-1) && (this->ControlPoints[i] < x))
-    i++;
+  while ((this->ControlPoints[i] < x) && (i < this->NumControlPoints-1)) i++;
 
   double before = this->ControlPoints[i-1];
   double after = this->ControlPoints[i];
diff --git a/Rendering/Volume/vtkUnstructuredGridPartialPreIntegration.cxx b/Rendering/Volume/vtkUnstructuredGridPartialPreIntegration.cxx
index e33c2d6..c00f9c3 100644
--- a/Rendering/Volume/vtkUnstructuredGridPartialPreIntegration.cxx
+++ b/Rendering/Volume/vtkUnstructuredGridPartialPreIntegration.cxx
@@ -273,7 +273,7 @@ inline void vtkPartialPreIntegrationTransferFunction::GetColor(double x,
       c[3] = 0.0;
     return;
     }
-  while ((i < size-1) && (this->ControlPoints[i] < x))
+  while (this->ControlPoints[i] < x && i < size-1)
     {
     i++;
     }
@@ -310,7 +310,10 @@ vtkUnstructuredGridPartialPreIntegration::vtkUnstructuredGridPartialPreIntegrati
 //-----------------------------------------------------------------------------
 vtkUnstructuredGridPartialPreIntegration::~vtkUnstructuredGridPartialPreIntegration()
 {
-  delete[] this->TransferFunctions;
+  if (this->TransferFunctions)
+    {
+    delete[] this->TransferFunctions;
+    }
 }
 
 //-----------------------------------------------------------------------------
@@ -362,7 +365,10 @@ void vtkUnstructuredGridPartialPreIntegration::Initialize(
     return;
     }
 
-  delete[] this->TransferFunctions;
+  if (this->TransferFunctions)
+    {
+    delete[] this->TransferFunctions;
+    }
 
   this->NumIndependentComponents = numcomponents;
   this->TransferFunctions
diff --git a/Rendering/Volume/vtkUnstructuredGridVolumeRayCastMapper.cxx b/Rendering/Volume/vtkUnstructuredGridVolumeRayCastMapper.cxx
index cc4a95d..f166fb2 100644
--- a/Rendering/Volume/vtkUnstructuredGridVolumeRayCastMapper.cxx
+++ b/Rendering/Volume/vtkUnstructuredGridVolumeRayCastMapper.cxx
@@ -92,7 +92,10 @@ vtkUnstructuredGridVolumeRayCastMapper::~vtkUnstructuredGridVolumeRayCastMapper(
 {
   this->Threader->Delete();
 
-  delete [] this->Image;
+  if ( this->Image )
+    {
+    delete [] this->Image;
+    }
 
   if ( this->RenderTableSize )
     {
@@ -340,7 +343,10 @@ void vtkUnstructuredGridVolumeRayCastMapper::Render( vtkRenderer *ren, vtkVolume
        this->ImageMemorySize[1] > oldImageMemorySize[1] )
     {
     // If there is an image there must be row bounds
-    delete [] this->Image;
+    if ( this->Image )
+      {
+      delete [] this->Image;
+      }
 
     this->Image = new unsigned char[(this->ImageMemorySize[0] *
                                      this->ImageMemorySize[1] * 4)];
@@ -496,8 +502,11 @@ void vtkUnstructuredGridVolumeRayCastMapper::Render( vtkRenderer *ren, vtkVolume
     }
 
 
-  delete [] this->ZBuffer;
-  this->ZBuffer = NULL;
+  if ( this->ZBuffer )
+    {
+    delete [] this->ZBuffer;
+    this->ZBuffer = NULL;
+    }
 
   this->UpdateProgress(1.0);
 }
diff --git a/Rendering/Volume/vtkUnstructuredGridVolumeZSweepMapper.cxx b/Rendering/Volume/vtkUnstructuredGridVolumeZSweepMapper.cxx
index 431eac6..95a92e2 100644
--- a/Rendering/Volume/vtkUnstructuredGridVolumeZSweepMapper.cxx
+++ b/Rendering/Volume/vtkUnstructuredGridVolumeZSweepMapper.cxx
@@ -2450,15 +2450,28 @@ vtkUnstructuredGridVolumeZSweepMapper::vtkUnstructuredGridVolumeZSweepMapper()
 //-----------------------------------------------------------------------------
 vtkUnstructuredGridVolumeZSweepMapper::~vtkUnstructuredGridVolumeZSweepMapper()
 {
-  delete this->MemoryManager;
-  delete this->PixelListFrame;
+  if(this->MemoryManager!=0)
+    {
+    delete this->MemoryManager;
+    }
+  if(this->PixelListFrame!=0)
+    {
+    delete this->PixelListFrame;
+    }
   this->Cell->Delete();
   this->EventList->Delete();
 
   this->ImageDisplayHelper->Delete();
 
-  delete this->UseSet;
-  delete this->Vertices;
+  if(this->UseSet!=0)
+    {
+    delete this->UseSet;
+    }
+
+  if(this->Vertices!=0)
+    {
+    delete this->Vertices;
+    }
 
   this->PerspectiveTransform->Delete();
   this->PerspectiveMatrix->Delete();
@@ -2927,8 +2940,11 @@ void vtkUnstructuredGridVolumeZSweepMapper::Render(vtkRenderer *ren,
     this->ImageSampleDistance = oldImageSampleDistance;
     }
 
-  delete [] this->ZBuffer;
-  this->ZBuffer = NULL;
+  if ( this->ZBuffer )
+    {
+    delete [] this->ZBuffer;
+    this->ZBuffer = NULL;
+    }
 
   this->UpdateProgress(1.0);
 }
diff --git a/Rendering/Volume/vtkVolumeRayCastMapper.cxx b/Rendering/Volume/vtkVolumeRayCastMapper.cxx
index 3306380..4e22d68 100644
--- a/Rendering/Volume/vtkVolumeRayCastMapper.cxx
+++ b/Rendering/Volume/vtkVolumeRayCastMapper.cxx
@@ -144,7 +144,10 @@ vtkVolumeRayCastMapper::~vtkVolumeRayCastMapper()
 
   this->Threader->Delete();
 
-  delete [] this->Image;
+  if ( this->Image )
+    {
+    delete [] this->Image;
+    }
 
   if ( this->RenderTableSize )
     {
@@ -552,10 +555,18 @@ void vtkVolumeRayCastMapper::Render( vtkRenderer *ren, vtkVolume *vol )
       this->ImageSampleDistance = oldImageSampleDistance;
       }
 
-    delete [] staticInfo->ClippingPlane;
+    if ( staticInfo->ClippingPlane )
+      {
+      delete [] staticInfo->ClippingPlane;
+      }
     delete staticInfo;
-    delete [] this->ZBuffer;
-    this->ZBuffer = NULL;
+
+    if ( this->ZBuffer )
+      {
+      delete [] this->ZBuffer;
+      this->ZBuffer = NULL;
+      }
+
     }
 }
 VTK_THREAD_RETURN_TYPE VolumeRayCastMapper_CastRays( void *arg )
diff --git a/Rendering/Volume/vtkVolumeRayCastSpaceLeapingImageFilter.cxx b/Rendering/Volume/vtkVolumeRayCastSpaceLeapingImageFilter.cxx
index d3add8b..1e3fc84 100644
--- a/Rendering/Volume/vtkVolumeRayCastSpaceLeapingImageFilter.cxx
+++ b/Rendering/Volume/vtkVolumeRayCastSpaceLeapingImageFilter.cxx
@@ -65,8 +65,16 @@ vtkVolumeRayCastSpaceLeapingImageFilter::vtkVolumeRayCastSpaceLeapingImageFilter
 vtkVolumeRayCastSpaceLeapingImageFilter::~vtkVolumeRayCastSpaceLeapingImageFilter()
 {
   this->SetCurrentScalars(NULL);
-  delete [] this->MinNonZeroScalarIndex;
-  delete [] this->MinNonZeroGradientMagnitudeIndex;
+  if (this->MinNonZeroScalarIndex)
+    {
+    delete [] this->MinNonZeroScalarIndex;
+    this->MinNonZeroScalarIndex = NULL;
+    }
+  if (this->MinNonZeroGradientMagnitudeIndex)
+    {
+    delete [] this->MinNonZeroGradientMagnitudeIndex;
+    this->MinNonZeroGradientMagnitudeIndex = NULL;
+    }
 }
 
 //----------------------------------------------------------------------------
@@ -148,8 +156,7 @@ vtkVolumeRayCastSpaceLeapingImageFilterClearOutput(vtkDataArray *scalars,
   vtkIdType outInc0, outInc1, outInc2;
   outData->GetContinuousIncrements(scalars,
                                    outExt, outInc0, outInc1, outInc2);
-  outInc1 *= 3;
-  outInc2 *= 3;
+
   // A. Initialize the arrays with a blank flag.
 
   int i,j,k;
@@ -771,9 +778,6 @@ void vtkVolumeRayCastSpaceLeapingImageFilter
   outData->GetContinuousIncrements(this->CurrentScalars,
                                    outExt, outInc0, outInc1, outInc2);
 
-  outInc1 *= 3;
-  outInc2 *= 3;
-
   // Now process the flags
 
   unsigned short *tmpPtr = static_cast< unsigned short * >(
@@ -1038,10 +1042,16 @@ void vtkVolumeRayCastSpaceLeapingImageFilter
   const int nComponents = this->GetNumberOfIndependentComponents();
 
   // Initialize these arrays.
-  delete [] this->MinNonZeroScalarIndex;
-  this->MinNonZeroScalarIndex = NULL;
-  delete [] this->MinNonZeroGradientMagnitudeIndex;
-  this->MinNonZeroGradientMagnitudeIndex = NULL;
+  if (this->MinNonZeroScalarIndex)
+    {
+    delete [] this->MinNonZeroScalarIndex;
+    this->MinNonZeroScalarIndex = NULL;
+    }
+  if (this->MinNonZeroGradientMagnitudeIndex)
+    {
+    delete [] this->MinNonZeroGradientMagnitudeIndex;
+    this->MinNonZeroGradientMagnitudeIndex = NULL;
+    }
 
   // Update the flags now
   int i;
diff --git a/Rendering/Volume/vtkVolumeTextureMapper.cxx b/Rendering/Volume/vtkVolumeTextureMapper.cxx
index e6196a6..930c113 100644
--- a/Rendering/Volume/vtkVolumeTextureMapper.cxx
+++ b/Rendering/Volume/vtkVolumeTextureMapper.cxx
@@ -50,8 +50,15 @@ vtkVolumeTextureMapper::~vtkVolumeTextureMapper()
   this->SetGradientEstimator( NULL );
   this->GradientShader->Delete();
 
-  delete [] this->RGBAArray;
-  delete [] this->GradientOpacityArray;
+  if ( this->RGBAArray )
+    {
+    delete [] this->RGBAArray;
+    }
+
+  if ( this->GradientOpacityArray )
+    {
+    delete [] this->GradientOpacityArray;
+    }
 }
 
 void vtkVolumeTextureMapper::SetGradientEstimator(
@@ -125,8 +132,14 @@ void vtkVolumeTextureMapper::InitializeRender( vtkRenderer *ren,
   if ( this->ArraySize != size ||
        this->NumberOfComponents != numComponents )
     {
-    delete [] this->RGBAArray;
-    delete [] this->GradientOpacityArray;
+    if ( this->RGBAArray )
+      {
+      delete [] this->RGBAArray;
+      }
+    if ( this->GradientOpacityArray )
+      {
+      delete [] this->GradientOpacityArray;
+      }
 
     this->RGBAArray            = new unsigned char [4*size*numComponents];
     this->GradientOpacityArray = new float [256*numComponents];
diff --git a/Rendering/Volume/vtkVolumeTextureMapper2D.cxx b/Rendering/Volume/vtkVolumeTextureMapper2D.cxx
index 3caffb5..c3b60b8 100644
--- a/Rendering/Volume/vtkVolumeTextureMapper2D.cxx
+++ b/Rendering/Volume/vtkVolumeTextureMapper2D.cxx
@@ -479,7 +479,10 @@ vtkVolumeTextureMapper2D::vtkVolumeTextureMapper2D()
 
 vtkVolumeTextureMapper2D::~vtkVolumeTextureMapper2D()
 {
-  delete [] this->Texture;
+  if ( this->Texture )
+    {
+    delete [] this->Texture;
+    }
 }
 
 void vtkVolumeTextureMapper2D::RenderSavedTexture()
@@ -747,8 +750,11 @@ void vtkVolumeTextureMapper2D::GenerateTexturesAndRenderQuads( vtkRenderer *ren,
 
   // Otherwise, we need to generate textures. We can throw away any
   // saved textures
-  delete [] this->Texture;
-  this->Texture = NULL;
+  if ( this->Texture )
+    {
+    delete [] this->Texture;
+        this->Texture = NULL;
+    }
   this->TextureSize = 0;
 
   // Will all the textures fit in the allotted storage?
diff --git a/Rendering/VolumeAMR/module.cmake b/Rendering/VolumeAMR/module.cmake
index b4ba753..531b35b 100644
--- a/Rendering/VolumeAMR/module.cmake
+++ b/Rendering/VolumeAMR/module.cmake
@@ -1,7 +1,9 @@
 vtk_module(vtkRenderingVolumeAMR
+  BACKEND
+    OpenGL
   DEPENDS
     vtkParallelCore
-    vtkRenderingVolume${VTK_RENDERING_BACKEND}
+    vtkRenderingVolumeOpenGL
     vtkFiltersAMR
   KIT
     vtkParallel
diff --git a/Rendering/VolumeAMR/vtkAMRVolumeMapper.cxx b/Rendering/VolumeAMR/vtkAMRVolumeMapper.cxx
index 5d27d20..7954f89 100644
--- a/Rendering/VolumeAMR/vtkAMRVolumeMapper.cxx
+++ b/Rendering/VolumeAMR/vtkAMRVolumeMapper.cxx
@@ -249,6 +249,16 @@ int vtkAMRVolumeMapper::GetRequestedRenderMode()
   return this->InternalMapper->GetRequestedRenderMode();
 }
 //----------------------------------------------------------------------------
+void vtkAMRVolumeMapper::SetInteractiveUpdateRate(double rate)
+{
+  this->InternalMapper->SetInteractiveUpdateRate(rate);
+}
+//----------------------------------------------------------------------------
+double vtkAMRVolumeMapper::GetInteractiveUpdateRate()
+{
+  return this->InternalMapper->GetInteractiveUpdateRate();
+}
+//----------------------------------------------------------------------------
 void vtkAMRVolumeMapper::SetInterpolationMode(int mode)
 {
   this->InternalMapper->SetInterpolationMode(mode);
@@ -269,10 +279,8 @@ void vtkAMRVolumeMapper::Render(vtkRenderer *ren, vtkVolume *vol)
   // Hack - Make sure the camera is in the right mode for moving the focal point
   ren->GetActiveCamera()->SetFreezeFocalPoint(this->FreezeFocalPoint);
   // If there is no grid initially we need to see if we can create one
-  // The grid is not created if it is an interactive render; meaning the desired
-  // time is less than the previous time to draw
-  if (!(this->Grid && (1.0 / ren->GetRenderWindow()->GetDesiredUpdateRate()
-                       < this->InternalMapper->GetTimeToDraw())))
+  if (!(this->Grid && (ren->GetRenderWindow()->GetDesiredUpdateRate()
+                       >= this->InternalMapper->GetInteractiveUpdateRate())))
     {
     if (!this->HasMetaData)
       {
diff --git a/Rendering/VolumeAMR/vtkAMRVolumeMapper.h b/Rendering/VolumeAMR/vtkAMRVolumeMapper.h
index 8381f22..5e9dc29 100644
--- a/Rendering/VolumeAMR/vtkAMRVolumeMapper.h
+++ b/Rendering/VolumeAMR/vtkAMRVolumeMapper.h
@@ -208,6 +208,20 @@ public:
   vtkSetVector3Macro(NumberOfSamples,int);
   vtkGetVector3Macro(NumberOfSamples,int);
 
+  // Description:
+  // Set the rate at or above this render will be considered interactive.
+  // If the DesiredUpdateRate of the vtkRenderWindow that caused the Render
+  // falls at or above this rate, the render is considered interactive and
+  // the mapper may be adjusted (depending on the render mode).
+  // Initial value is 1.0.
+  virtual void SetInteractiveUpdateRate(double rate);
+
+  // Description:
+  // Get the update rate at or above which this is considered an
+  // interactive render.
+  // Initial value is 1.0.
+  virtual double GetInteractiveUpdateRate();
+
 //BTX
   // Description:
   // WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE
diff --git a/Rendering/VolumeOpenGL/vtkOpenGLGPUVolumeRayCastMapper.cxx b/Rendering/VolumeOpenGL/vtkOpenGLGPUVolumeRayCastMapper.cxx
index e5c8ef1..4527dd2 100644
--- a/Rendering/VolumeOpenGL/vtkOpenGLGPUVolumeRayCastMapper.cxx
+++ b/Rendering/VolumeOpenGL/vtkOpenGLGPUVolumeRayCastMapper.cxx
@@ -267,7 +267,11 @@ public:
         vtkOpenGLStaticCheckErrorMacro("failed at glDeleteTextures");
         this->TextureId=0;
         }
-      delete[] this->Table;
+      if(this->Table!=0)
+        {
+        delete[] this->Table;
+        this->Table=0;
+        }
     }
 
   bool IsLoaded()
@@ -464,7 +468,11 @@ public:
         vtkOpenGLStaticCheckErrorMacro("failed at glDeleteTextures");
         this->TextureId=0;
         }
-      delete[] this->Table;
+      if(this->Table!=0)
+        {
+        delete[] this->Table;
+        this->Table=0;
+        }
     }
 
   bool IsLoaded()
@@ -933,9 +941,34 @@ public:
                      *(dim[0]-cellFlag)+textureExtent[0])
                     *scalars->GetNumberOfComponents());
 
-                  vtkgl::TexImage3D(vtkgl::TEXTURE_3D, 0, internalFormat,
-                                    textureSize[0],textureSize[1],textureSize[2],
-                                    0,format,type,dataPtr);
+                  if(1) // !this->SupportsPixelBufferObjects)
+                    {
+                    vtkgl::TexImage3D(vtkgl::TEXTURE_3D, 0, internalFormat,
+                                      textureSize[0],textureSize[1],textureSize[2],
+                                      0,format,type,dataPtr);
+                    }
+                  else
+                    {
+                    GLuint pbo=0;
+                    vtkgl::GenBuffers(1,&pbo);
+                    vtkOpenGLStaticCheckErrorMacro("genbuffer");
+                    vtkgl::BindBuffer(vtkgl::PIXEL_UNPACK_BUFFER,pbo);
+                    vtkOpenGLStaticCheckErrorMacro("binbuffer");
+                    vtkgl::GLsizeiptr texSize=
+                      textureSize[0]*textureSize[1]*textureSize[2]*
+                      vtkAbstractArray::GetDataTypeSize(scalarType)*
+                      scalars->GetNumberOfComponents();
+                    vtkgl::BufferData(vtkgl::PIXEL_UNPACK_BUFFER,texSize,dataPtr,
+                                      vtkgl::STREAM_DRAW);
+                    vtkOpenGLStaticCheckErrorMacro("bufferdata");
+                    vtkgl::TexImage3D(vtkgl::TEXTURE_3D, 0, internalFormat,
+                                      textureSize[0],textureSize[1],textureSize[2],
+                                      0,format,type,0);
+                    vtkOpenGLStaticCheckErrorMacro("teximage3d");
+                    vtkgl::BindBuffer(vtkgl::PIXEL_UNPACK_BUFFER,0);
+                    vtkOpenGLStaticCheckErrorMacro("bindbuffer to 0");
+                    vtkgl::DeleteBuffers(1,&pbo);
+                    }
                   vtkOpenGLStaticCheckErrorMacro("3d texture is too large2");
                   // make sure TexImage3D is executed with our PixelTransfer mode
                   glFinish();
@@ -1968,8 +2001,11 @@ vtkOpenGLGPUVolumeRayCastMapper::vtkOpenGLGPUVolumeRayCastMapper()
 //-----------------------------------------------------------------------------
 vtkOpenGLGPUVolumeRayCastMapper::~vtkOpenGLGPUVolumeRayCastMapper()
 {
-  delete this->UnsupportedRequiredExtensions;
-
+  if(this->UnsupportedRequiredExtensions!=0)
+    {
+    delete this->UnsupportedRequiredExtensions;
+    this->UnsupportedRequiredExtensions=0;
+    }
   int i=0;
   while(i<3)
     {
@@ -1978,7 +2014,11 @@ vtkOpenGLGPUVolumeRayCastMapper::~vtkOpenGLGPUVolumeRayCastMapper()
     ++i;
     }
 
-  delete[] this->ErrorString;
+  if(this->ErrorString!=0)
+    {
+    delete[] this->ErrorString;
+    this->ErrorString=0;
+    }
 
   if ( this->SmallInput )
     {
@@ -2019,9 +2059,24 @@ vtkOpenGLGPUVolumeRayCastMapper::~vtkOpenGLGPUVolumeRayCastMapper()
   this->InvVolumeMatrix->UnRegister(this);
   this->InvVolumeMatrix=0;
 
-  delete[] this->NoiseTexture;
-  delete this->ScalarsTextures;
-  delete this->MaskTextures;
+  if(this->NoiseTexture!=0)
+    {
+    delete[] this->NoiseTexture;
+    this->NoiseTexture=0;
+    this->NoiseTextureSize=0;
+    }
+
+  if(this->ScalarsTextures!=0)
+    {
+    delete this->ScalarsTextures;
+    this->ScalarsTextures=0;
+    }
+
+  if(this->MaskTextures!=0)
+    {
+    delete this->MaskTextures;
+    this->MaskTextures=0;
+    }
 
   if(this->Program!=0)
     {
@@ -2132,7 +2187,10 @@ void vtkOpenGLGPUVolumeRayCastMapper::LoadExtensions(
 {
   // We may already have a string stream for the unsupported extensions
   // from the last time this method was called. If so, delete it.
-  delete this->UnsupportedRequiredExtensions;
+  if(this->UnsupportedRequiredExtensions!=0)
+    {
+    delete this->UnsupportedRequiredExtensions;
+    }
 
   // Create a string stream to hold the unsupported extensions so we can
   // report something meaningful back
@@ -2142,15 +2200,14 @@ void vtkOpenGLGPUVolumeRayCastMapper::LoadExtensions(
   // It does not work on Apple OS X Snow Leopard with nVidia.
   // There is a bug in the OpenGL driver with an error in the
   // Cg compiler about an infinite loop.
-#if defined(__APPLE__) && !defined(APPLE_SNOW_LEOPARD_BUG)
-
-  (void)window;
+#ifndef APPLE_SNOW_LEOPARD_BUG
+ #ifdef __APPLE__
   this->UnsupportedRequiredExtensions->Stream<<
     " Disabled on Apple OS X Snow Leopard with nVidia.";
   this->LoadExtensionsSucceeded=0;
   return;
-
-#else
+ #endif
+#endif
 
   // Assume success
   this->LoadExtensionsSucceeded=1;
@@ -2431,8 +2488,6 @@ void vtkOpenGLGPUVolumeRayCastMapper::LoadExtensions(
   this->LastComponent=
     vtkOpenGLGPUVolumeRayCastMapperComponentNotInitialized;
   this->LastShade=vtkOpenGLGPUVolumeRayCastMapperShadeNotInitialized;
-
-#endif
 }
 
 //-----------------------------------------------------------------------------
@@ -2529,17 +2584,29 @@ void vtkOpenGLGPUVolumeRayCastMapper::ReleaseGraphicsResources(
       }
     }
 
-  delete this->RGBTable;
-  this->RGBTable=0;
+  if(this->RGBTable!=0)
+    {
+    delete this->RGBTable;
+    this->RGBTable=0;
+    }
 
-  delete this->Mask1RGBTable;
-  this->Mask1RGBTable=0;
+  if(this->Mask1RGBTable!=0)
+    {
+    delete this->Mask1RGBTable;
+    this->Mask1RGBTable=0;
+    }
 
-  delete this->Mask2RGBTable;
-  this->Mask2RGBTable=0;
+  if(this->Mask2RGBTable!=0)
+    {
+    delete this->Mask2RGBTable;
+    this->Mask2RGBTable=0;
+    }
 
-  delete this->OpacityTables;
-  this->OpacityTables=0;
+  if(this->OpacityTables!=0)
+    {
+    delete this->OpacityTables;
+    this->OpacityTables=0;
+    }
 
   if(this->Program!=0)
     {
diff --git a/Rendering/VolumeOpenGL/vtkOpenGLHAVSVolumeMapper.cxx b/Rendering/VolumeOpenGL/vtkOpenGLHAVSVolumeMapper.cxx
index df4cc44..fc73709 100644
--- a/Rendering/VolumeOpenGL/vtkOpenGLHAVSVolumeMapper.cxx
+++ b/Rendering/VolumeOpenGL/vtkOpenGLHAVSVolumeMapper.cxx
@@ -64,7 +64,10 @@ vtkOpenGLHAVSVolumeMapper::~vtkOpenGLHAVSVolumeMapper()
 {
   if (!this->GPUDataStructures)
     {
-    delete [] this->OrderedTriangles;
+    if(this->OrderedTriangles!=0)
+      {
+      delete [] this->OrderedTriangles;
+      }
     }
 }
 
@@ -239,8 +242,11 @@ void vtkOpenGLHAVSVolumeMapper::SetGPUDataStructures(bool gpu)
     {
     if(!this->GPUDataStructures)
       {
-      delete [] this->OrderedTriangles;
-      this->OrderedTriangles=0;
+      if(this->OrderedTriangles!=0)
+        {
+        delete [] this->OrderedTriangles;
+        this->OrderedTriangles=0;
+        }
       }
     this->GPUDataStructures = gpu;
     if (this->Initialized)
@@ -298,7 +304,10 @@ void vtkOpenGLHAVSVolumeMapper::InitializeGPUDataStructures()
     }
   else
     {
-    delete [] this->OrderedTriangles;
+    if (this->OrderedTriangles)
+      {
+      delete [] this->OrderedTriangles;
+      }
     this->OrderedTriangles = new unsigned int[this->NumberOfTriangles*3];
     }
 
diff --git a/Rendering/VolumeOpenGL/vtkSmartVolumeMapper.cxx b/Rendering/VolumeOpenGL/vtkSmartVolumeMapper.cxx
index af10e6a..5fef3db 100644
--- a/Rendering/VolumeOpenGL/vtkSmartVolumeMapper.cxx
+++ b/Rendering/VolumeOpenGL/vtkSmartVolumeMapper.cxx
@@ -627,18 +627,6 @@ void vtkSmartVolumeMapper::SetRequestedRenderModeToDefault()
 }
 
 // ----------------------------------------------------------------------------
-void vtkSmartVolumeMapper::SetRequestedRenderModeToGPU()
-{
-  this->SetRequestedRenderMode(vtkSmartVolumeMapper::GPURenderMode);
-}
-
-// ----------------------------------------------------------------------------
-void vtkSmartVolumeMapper::SetRequestedRenderModeToTexture()
-{
-  this->SetRequestedRenderMode(vtkSmartVolumeMapper::TextureRenderMode);
-}
-
-// ----------------------------------------------------------------------------
 void vtkSmartVolumeMapper::SetRequestedRenderModeToRayCastAndTexture()
 {
   this->SetRequestedRenderMode(
diff --git a/Rendering/VolumeOpenGL/vtkSmartVolumeMapper.h b/Rendering/VolumeOpenGL/vtkSmartVolumeMapper.h
index aec2ea6..390c0cb 100644
--- a/Rendering/VolumeOpenGL/vtkSmartVolumeMapper.h
+++ b/Rendering/VolumeOpenGL/vtkSmartVolumeMapper.h
@@ -171,17 +171,6 @@ public:
   void SetRequestedRenderModeToDefault();
 
   // Description:
-  // Set the requested render mode to vtkSmartVolumeMapper::GPURenderMode.
-  // This option will use hardware accelerated rendering exclusively. This is a
-  // good option if you know there is hardware acceleration.
-  void SetRequestedRenderModeToGPU();
-
-  // Description:
-  // Set the requested render mode to
-  // vtkSmartVolumeMapper::TextureRenderMode.
-  void SetRequestedRenderModeToTexture();
-
-  // Description:
   // Set the requested render mode to
   // vtkSmartVolumeMapper::RayCastAndTextureRenderMode.
   // This is a good option if you want to avoid using advanced OpenGL
diff --git a/Rendering/VolumeOpenGL2/shaders/raycasterfs.glsl b/Rendering/VolumeOpenGL2/shaders/raycasterfs.glsl
index 4c4886d..aaa6a28 100644
--- a/Rendering/VolumeOpenGL2/shaders/raycasterfs.glsl
+++ b/Rendering/VolumeOpenGL2/shaders/raycasterfs.glsl
@@ -12,6 +12,8 @@
      PURPOSE.  See the above copyright notice for more information.
 
 =========================================================================*/
+#version 120
+
 // The following line handle system declarations such a
 // default precisions, or defining precisions to null
 //VTK::System::Dec
@@ -44,32 +46,19 @@ vec3 g_dirStep;
 vec4 g_srcColor;
 vec4 g_eyePosObj;
 
-uniform vec4 in_volume_scale;
-uniform vec4 in_volume_bias;
-
-//VTK::Output::Dec
-
 //VTK::Base::Dec
-
 //VTK::Termination::Dec
-
 //VTK::Cropping::Dec
-
 //VTK::Shading::Dec
-
 //VTK::BinaryMask::Dec
-
 //VTK::CompositeMask::Dec
 
 //VTK::ComputeOpacity::Dec
-
 //VTK::ComputeGradient::Dec
-
 //VTK::ComputeLighting::Dec
+//VTK::ColorTransferFunc::Dec
 
-//VTK::ComputeColor::Dec
-
-//VTK::ComputeRayDirection::Dec
+//VTK::RayDirectionFunc::Dec
 
 /// We support only 8 clipping planes for now
 /// The first value is the size of the data array for clipping
@@ -90,30 +79,20 @@ void main()
   g_dirStep = vec3(0.0);
 
   //VTK::Base::Init
-
   //VTK::Terminate::Init
-
   //VTK::Shading::Init
-
   //VTK::Cropping::Init
-
   //VTK::Clipping::Init
 
   /// For all samples along the ray
   while (true)
     {
     //VTK::Base::Impl
-
     //VTK::Terminate::Impl
-
     //VTK::Cropping::Impl
-
     //VTK::Clipping::Impl
-
     //VTK::BinaryMask::Impl
-
     //VTK::CompositeMask::Impl
-
     //VTK::Shading::Impl
 
     /// Advance ray
@@ -121,17 +100,13 @@ void main()
     }
 
   //VTK::Base::Exit
-
   //VTK::Terminate::Exit
-
   //VTK::Cropping::Exit
-
   //VTK::Clipping::Exit
-
   //VTK::Shading::Exit
 
   g_fragColor.r = g_fragColor.r * in_scale + in_bias * g_fragColor.a;
   g_fragColor.g = g_fragColor.g * in_scale + in_bias * g_fragColor.a;
   g_fragColor.b = g_fragColor.b * in_scale + in_bias * g_fragColor.a;
-  gl_FragData[0] = g_fragColor;
+  gl_FragColor = g_fragColor;
   }
diff --git a/Rendering/VolumeOpenGL2/shaders/raycastervs.glsl b/Rendering/VolumeOpenGL2/shaders/raycastervs.glsl
index 2e45f99..9b02acf 100644
--- a/Rendering/VolumeOpenGL2/shaders/raycastervs.glsl
+++ b/Rendering/VolumeOpenGL2/shaders/raycastervs.glsl
@@ -12,24 +12,23 @@
      PURPOSE.  See the above copyright notice for more information.
 
 =========================================================================*/
-// The following line handle system declarations such a
-// default precisions, or defining precisions to null
-//VTK::System::Dec
+#version 120
 
 /// Needed to enable inverse function
 #extension GL_ARB_gpu_shader5 : enable
 
+// The following line handle system declarations such a
+// default precisions, or defining precisions to null
+//VTK::System::Dec
+
 //////////////////////////////////////////////////////////////////////////////
 ///
 /// Uniforms, attributes, and globals
 ///
 //////////////////////////////////////////////////////////////////////////////
 //VTK::Base::Dec
-
 //VTK::Termination::Dec
-
 //VTK::Cropping::Dec
-
 //VTK::Shading::Dec
 
 //////////////////////////////////////////////////////////////////////////////
diff --git a/Rendering/VolumeOpenGL2/shaders/vtkglProjectedTetrahedraFS.glsl b/Rendering/VolumeOpenGL2/shaders/vtkglProjectedTetrahedraFS.glsl
index b684566..e70a4ac 100644
--- a/Rendering/VolumeOpenGL2/shaders/vtkglProjectedTetrahedraFS.glsl
+++ b/Rendering/VolumeOpenGL2/shaders/vtkglProjectedTetrahedraFS.glsl
@@ -17,8 +17,6 @@
 // default precisions, or defining precisions to null
 //VTK::System::Dec
 
-//VTK::Output::Dec
-
 varying vec3 fcolor;
 varying float fdepth;
 varying float fattenuation;
@@ -32,9 +30,9 @@ void main()
   float opacity = 1.0 - exp(-1.0*fattenuation*fdepth);
 
 
-  gl_FragData[0] =  vec4(opacity*fcolor,opacity);
+  gl_FragColor =  vec4(opacity*fcolor,opacity);
 
-  if (gl_FragData[0].a <= 0.0)
+  if (gl_FragColor.a <= 0.0)
     {
     discard;
     }
diff --git a/Rendering/VolumeOpenGL2/vtkOpenGLGPUVolumeRayCastMapper.cxx b/Rendering/VolumeOpenGL2/vtkOpenGLGPUVolumeRayCastMapper.cxx
index 763f259..381a7e6 100644
--- a/Rendering/VolumeOpenGL2/vtkOpenGLGPUVolumeRayCastMapper.cxx
+++ b/Rendering/VolumeOpenGL2/vtkOpenGLGPUVolumeRayCastMapper.cxx
@@ -88,9 +88,10 @@ public:
     this->LoadDepthTextureExtensionsSucceeded = false;
     this->CameraWasInsideInLastUpdate = false;
     this->CubeVBOId = 0;
+#ifndef __APPLE__
     this->CubeVAOId = 0;
+#endif
     this->CubeIndicesId = 0;
-    this->InterpolationType = vtkTextureObject::Linear;
     this->VolumeTextureObject = 0;
     this->NoiseTextureObject = 0;
     this->DepthTextureObject = 0;
@@ -118,19 +119,17 @@ public:
     this->Extents[5] = VTK_INT_MIN;
 
     this->MaskTextures = new vtkMapMaskTextureId;
-
-    this->ScalarsRange.clear();
-    this->Scale.clear();
-    this->Bias.clear();
-
-    this->NeedToInitializeResources = false;
     }
 
   // Destructor
   //--------------------------------------------------------------------------
   ~vtkInternal()
     {
-    delete [] this->NoiseTextureData;
+    if (this->NoiseTextureData)
+      {
+      delete [] this->NoiseTextureData;
+      this->NoiseTextureData = 0;
+      }
 
     if (this->NoiseTextureObject)
       {
@@ -144,13 +143,13 @@ public:
       this->DepthTextureObject = 0;
       }
 
-    this->DeleteTransferFunctions();
-
-    delete this->MaskTextures;
+    if (this->MaskTextures)
+      {
+      delete this->MaskTextures;
+      this->MaskTextures = 0;
+      }
 
-    this->ScalarsRange.clear();
-    this->Scale.clear();
-    this->Bias.clear();
+    this->DeleteTransferFunctions();
     }
 
   // Helper methods
@@ -175,8 +174,7 @@ public:
                   int noOfComponents, int independentComponents);
 
   bool LoadVolume(vtkRenderer* ren, vtkImageData* imageData,
-                  vtkVolumeProperty* volumeProperty,
-                  vtkDataArray* scalars, int independentComponents);
+                  vtkDataArray* scalars);
 
   bool LoadMask(vtkRenderer* ren, vtkImageData* input,
                 vtkImageData* maskInput, int textureExtent[6],
@@ -186,12 +184,6 @@ public:
 
   void ComputeBounds(vtkImageData* input);
 
-  // Update OpenGL volume information
-  int UpdateVolume(vtkVolumeProperty* volumeProperty);
-
-  // Update interpolation to be used for 3D volume
-  int UpdateInterpolationType(vtkVolumeProperty* volumeProperty);
-
   // Update transfer color function based on the incoming inputs
   // and number of scalar components.
   int UpdateColorTransferFunction(vtkRenderer* ren,
@@ -254,22 +246,21 @@ public:
   bool ValidTransferFunction;
   bool LoadDepthTextureExtensionsSucceeded;
   bool CameraWasInsideInLastUpdate;
-  bool HandleLargeDataTypes;
 
   GLuint CubeVBOId;
+#ifndef __APPLE__
   GLuint CubeVAOId;
+#endif
   GLuint CubeIndicesId;
 
-  int InterpolationType;
-
   vtkTextureObject* VolumeTextureObject;
   vtkTextureObject* NoiseTextureObject;
   vtkTextureObject* DepthTextureObject;
 
   int TextureWidth;
 
-  std::vector<double> Scale;
-  std::vector<double> Bias;
+  double Scale;
+  double Bias;
 
   float* NoiseTextureData;
   GLint NoiseTextureSize;
@@ -282,7 +273,7 @@ public:
   int WindowLowerLeft[2];
   int WindowSize[2];
 
-  std::vector< std::vector<double> > ScalarsRange;
+  double ScalarsRange[2];
   double LoadedBounds[6];
   int Extents[6];
   double DatasetStepSize[3];
@@ -324,10 +315,6 @@ public:
 
   vtkTimeStamp InitializationTime;
   vtkTimeStamp InputUpdateTime;
-  vtkTimeStamp VolumeUpdateTime;
-  vtkTimeStamp ReleaseResourcesTime;
-
-  bool NeedToInitializeResources;
 
   vtkShaderProgram* ShaderProgram;
   vtkOpenGLShaderCache* ShaderCache;
@@ -498,247 +485,137 @@ void vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::Initialize(
 
 //----------------------------------------------------------------------------
 bool vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::LoadVolume(vtkRenderer* ren,
-  vtkImageData* imageData, vtkVolumeProperty* volumeProperty, vtkDataArray* scalars,
-  int vtkNotUsed(independentComponents))
+  vtkImageData* imageData, vtkDataArray* scalars)
 {
   // Allocate data with internal format and foramt as (GL_RED)
   GLint internalFormat = 0;
   GLenum format = 0;
   GLenum type = 0;
 
-  this->HandleLargeDataTypes = false;
-  int noOfComponents = scalars->GetNumberOfComponents();
-
-  // scale and bias
-  // NP = P*scale + bias
-  // given two point matcvhes a,b to c,d the fomula
-  // is scale = (d-c)/(b-a) and
-  // bias = c - a*scale
-  // for unsigned/float types c is zero
-  std::vector<double> bias(noOfComponents, 0.0);
-  std::vector<double> scale(noOfComponents, 1.0);
-  double oglScale = 1.0;
-  double oglBias = 0.0;
+  double shift = 0.0;
+  double scale = 1.0;
+  bool handleLargeDataTypes = false;
 
   int scalarType = scalars->GetDataType();
-
-  switch(scalarType)
+  if (scalars->GetNumberOfComponents() == 4)
     {
-    case VTK_FLOAT:
-      type = GL_FLOAT;
-      if (glewIsSupported("GL_ARB_texture_float") ||
-          vtkOpenGLRenderWindow::GetContextSupportsOpenGL32())
+    internalFormat = GL_RGBA8;
+    format = GL_RGBA;
+    type = GL_UNSIGNED_BYTE;
+    }
+  else
+    {
+    switch(scalarType)
+      {
+      case VTK_FLOAT:
+      if (glewIsSupported("GL_ARB_texture_float"))
         {
-        switch(noOfComponents)
-          {
-          case 1:
-            internalFormat = GL_R16F;
-            format = GL_RED;
-            break;
-          case 2:
-            internalFormat = GL_RG16F;
-            format = GL_RG;
-            break;
-          case 3:
-            internalFormat = GL_RGB16F;
-            format = GL_RGB;
-            break;
-          case 4:
-            internalFormat = GL_RGBA16F;
-            format = GL_RGBA;
-            break;
-          }
+        internalFormat = GL_INTENSITY16F_ARB;
         }
       else
         {
-        switch(noOfComponents)
+        internalFormat = GL_INTENSITY16;
+        }
+        format = GL_RED;
+        type = GL_FLOAT;
+        shift=-ScalarsRange[0];
+        scale = 1/(this->ScalarsRange[1]-this->ScalarsRange[0]);
+        break;
+      case VTK_UNSIGNED_CHAR:
+        internalFormat = GL_INTENSITY8;
+        format = GL_RED;
+        type = GL_UNSIGNED_BYTE;
+        shift = -this->ScalarsRange[0]/VTK_UNSIGNED_CHAR_MAX;
+        scale =
+          VTK_UNSIGNED_CHAR_MAX/(this->ScalarsRange[1]-this->ScalarsRange[0]);
+        break;
+      case VTK_SIGNED_CHAR:
+        internalFormat = GL_INTENSITY8;
+        format = GL_RED;
+        type = GL_BYTE;
+        shift = -(2 * this->ScalarsRange[0] + 1)/VTK_UNSIGNED_CHAR_MAX;
+        scale = VTK_SIGNED_CHAR_MAX / (this->ScalarsRange[1] -
+                                       this->ScalarsRange[0]);
+        break;
+      case VTK_CHAR:
+        // not supported
+        assert("check: impossible case" && 0);
+        break;
+      case VTK_BIT:
+        // not supported
+        assert("check: impossible case" && 0);
+        break;
+      case VTK_ID_TYPE:
+        // not supported
+        assert("check: impossible case" && 0);
+        break;
+      case VTK_INT:
+        internalFormat = GL_INTENSITY16;
+        format = GL_RED;
+        type = GL_INT;
+        shift=-(2*this->ScalarsRange[0]+1)/VTK_UNSIGNED_INT_MAX;
+        scale = VTK_INT_MAX/(this->ScalarsRange[1]-this->ScalarsRange[0]);
+        break;
+      case VTK_DOUBLE:
+      case VTK___INT64:
+      case VTK_LONG:
+      case VTK_LONG_LONG:
+      case VTK_UNSIGNED___INT64:
+      case VTK_UNSIGNED_LONG:
+      case VTK_UNSIGNED_LONG_LONG:
+        handleLargeDataTypes = true;
+        if (glewIsSupported("GL_ARB_texture_float"))
           {
-          case 1:
-            internalFormat = GL_R16;
-            format = GL_RED;
-            break;
-          case 2:
-            internalFormat = GL_RG;
-            format = GL_RG;
-            break;
-          case 3:
-            internalFormat = GL_RGB;
-            format = GL_RGB;
-            break;
-          case 4:
-            internalFormat = GL_RGBA;
-            format = GL_RGBA;
-            break;
+          internalFormat=GL_INTENSITY16F_ARB;
           }
-        }
-      break;
-    case VTK_UNSIGNED_CHAR:
-      type = GL_UNSIGNED_BYTE;
-      oglScale = 1.0/VTK_UNSIGNED_CHAR_MAX;
-      oglBias = 0.0;
-      switch(noOfComponents)
-        {
-        case 1:
-          internalFormat = GL_RED;
-          format = GL_RED;
-          break;
-        case 2:
-          internalFormat = GL_RG;
-          format = GL_RG;
-          break;
-        case 3:
-          internalFormat = GL_RGB;
-          format = GL_RGB;
-          break;
-        case 4:
-          internalFormat = GL_RGBA;
-          format = GL_RGBA;
-          break;
-        }
-      break;
-    case VTK_SIGNED_CHAR:
-      type = GL_BYTE;
-      oglScale = 2.0/(VTK_SIGNED_CHAR_MAX - VTK_SIGNED_CHAR_MIN);
-      oglBias = -1.0 - VTK_SIGNED_CHAR_MIN*oglScale;
-      switch(noOfComponents)
-        {
-        case 1:
-          internalFormat = GL_R8_SNORM;
-          format = GL_RED;
-          break;
-        case 2:
-          internalFormat = GL_RG;
-          format = GL_RG;
-          break;
-        case 3:
-          internalFormat = GL_RGB;
-          format = GL_RGB;
-          break;
-        case 4:
-          internalFormat = GL_RGBA;
-          format = GL_RGBA;
-          break;
-        }
-      break;
-    case VTK_CHAR:
-      // not supported
-      assert("check: impossible case" && 0);
-      break;
-    case VTK_BIT:
-      // not supported
-      assert("check: impossible case" && 0);
-      break;
-    case VTK_ID_TYPE:
-      // not supported
-      assert("check: impossible case" && 0);
-      break;
-    case VTK_INT:
-    case VTK_DOUBLE:
-    case VTK___INT64:
-    case VTK_LONG:
-    case VTK_LONG_LONG:
-    case VTK_UNSIGNED_INT:
-    case VTK_UNSIGNED___INT64:
-    case VTK_UNSIGNED_LONG:
-    case VTK_UNSIGNED_LONG_LONG:
-      this->HandleLargeDataTypes = true;
-      type = GL_FLOAT;
-      switch(noOfComponents)
-        {
-        case 1:
-          if (glewIsSupported("GL_ARB_texture_float") ||
-              vtkOpenGLRenderWindow::GetContextSupportsOpenGL32())
-            {
-            internalFormat = GL_R16F;
-            }
-          else
-            {
-            internalFormat = GL_R16;
-            }
-          format = GL_RED;
-          break;
-        case 2:
-          internalFormat = GL_RG;
-          format = GL_RG;
-          break;
-        case 3:
-          internalFormat = GL_RGB;
-          format = GL_RGB;
-          break;
-        case 4:
-          internalFormat = GL_RGBA;
-          format = GL_RGBA;
-          break;
-        }
-      break;
-    case VTK_SHORT:
-      type = GL_SHORT;
-      oglScale = 2.0/(VTK_SHORT_MAX - VTK_SHORT_MIN);
-      oglBias = -1.0 - VTK_SHORT_MIN*oglScale;
-      switch(noOfComponents)
-        {
-        case 1:
-          internalFormat = GL_R16_SNORM;
-          format = GL_RED;
-          break;
-        case 2:
-          internalFormat = GL_RG;
-          format = GL_RG;
-          break;
-        case 3:
-          internalFormat = GL_RGB;
-          format = GL_RGB;
-          break;
-        case 4:
-          internalFormat = GL_RGBA;
-          format = GL_RGBA;
-          break;
-        }
-      break;
-    case VTK_STRING:
-      // not supported
-      assert("check: impossible case" && 0);
-      break;
-    case VTK_UNSIGNED_SHORT:
-      type = GL_UNSIGNED_SHORT;
-      oglScale = 1.0/VTK_UNSIGNED_SHORT_MAX;
-      oglBias = 0.0;
-      switch(noOfComponents)
-        {
-        case 1:
-          internalFormat = GL_R16;
-          format = GL_RED;
-          break;
-        case 2:
-          internalFormat = GL_RG;
-          format = GL_RG;
-          break;
-        case 3:
-          internalFormat = GL_RGB;
-          format = GL_RGB;
-          break;
-        case 4:
-          internalFormat = GL_RGBA;
-          format = GL_RGBA;
-          break;
-        }
-      break;
-    default:
-      assert("check: impossible case" && 0);
-      break;
-  }
-
-  for (int n = 0; n < noOfComponents; ++n)
-    {
-    double oglA = this->ScalarsRange[n][0]*oglScale + oglBias;
-    double oglB = this->ScalarsRange[n][1]*oglScale + oglBias;
-    scale[n] = 1.0/ (oglB - oglA);
-    bias[n] = 0.0 - oglA*scale[n];
+        else
+          {
+          internalFormat=GL_INTENSITY16;
+          }
+        format = GL_RED;
+        type = GL_FLOAT;
+        shift = -this->ScalarsRange[0];
+        scale = 1 / (this->ScalarsRange[1] - this->ScalarsRange[0]);
+        break;
+      case VTK_SHORT:
+        internalFormat = GL_INTENSITY16;
+        format = GL_RED;
+        type = GL_SHORT;
+        shift = -(2*this->ScalarsRange[0]+1)/VTK_UNSIGNED_SHORT_MAX;
+        scale = VTK_SHORT_MAX / (this->ScalarsRange[1] -
+                                 this->ScalarsRange[0]);
+        break;
+      case VTK_STRING:
+        // not supported
+        assert("check: impossible case" && 0);
+        break;
+      case VTK_UNSIGNED_SHORT:
+        internalFormat = GL_INTENSITY16;
+        format = GL_RED;
+        type = GL_UNSIGNED_SHORT;
+
+        shift=-this->ScalarsRange[0]/VTK_UNSIGNED_SHORT_MAX;
+        scale=
+          VTK_UNSIGNED_SHORT_MAX / (this->ScalarsRange[1] -
+                                    this->ScalarsRange[0]);
+        break;
+      case VTK_UNSIGNED_INT:
+        internalFormat = GL_INTENSITY16;
+        format = GL_RED;
+        type = GL_UNSIGNED_INT;
+        shift=-this->ScalarsRange[0] / VTK_UNSIGNED_INT_MAX;
+        scale = VTK_UNSIGNED_INT_MAX / (this->ScalarsRange[1] -
+                                        this->ScalarsRange[0]);
+        break;
+      default:
+        assert("check: impossible case" && 0);
+        break;
+      }
     }
 
   // Update scale and bias
   this->Scale = scale;
-  this->Bias = bias;
+  this->Bias = shift * this->Scale;
 
   // Update texture size
   imageData->GetExtent(this->Extents);
@@ -763,26 +640,32 @@ bool vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::LoadVolume(vtkRenderer* ren,
   this->VolumeTextureObject->SetFormat(format);
   this->VolumeTextureObject->SetInternalFormat(internalFormat);
 
-  this->UpdateInterpolationType(volumeProperty);
-
-  if (!this->HandleLargeDataTypes)
+  if (!handleLargeDataTypes)
     {
     void* dataPtr = scalars->GetVoidPointer(0);
 
+    // TODO: glPixelTransfer is not supported in GL 3.2 or higher.
+    // When we tried to apply scale and bias in the shader, then something
+    // didn't work out quite right.
+    glPixelTransferf(GL_RED_SCALE,static_cast<GLfloat>(this->Scale));
+    glPixelTransferf(GL_RED_BIAS,static_cast<GLfloat>(this->Bias));
     this->VolumeTextureObject->Create3DFromRaw(
       this->TextureSize[0],
       this->TextureSize[1],
       this->TextureSize[2],
-      noOfComponents,
+      scalars->GetNumberOfComponents(),
       scalarType,
       dataPtr);
     this->VolumeTextureObject->Activate();
     this->VolumeTextureObject->SetWrapS(vtkTextureObject::ClampToEdge);
     this->VolumeTextureObject->SetWrapT(vtkTextureObject::ClampToEdge);
     this->VolumeTextureObject->SetWrapR(vtkTextureObject::ClampToEdge);
-    this->VolumeTextureObject->SetMagnificationFilter(this->InterpolationType);
-    this->VolumeTextureObject->SetMinificationFilter(this->InterpolationType);
+    this->VolumeTextureObject->SetMagnificationFilter(vtkTextureObject::Linear);
+    this->VolumeTextureObject->SetMinificationFilter(vtkTextureObject::Linear);
     this->VolumeTextureObject->SetBorderColor(0.0f, 0.0f, 0.0f, 0.0f);
+
+    glPixelTransferf(GL_RED_SCALE, 1.0);
+    glPixelTransferf(GL_RED_BIAS, 0.0);
     }
   else
     {
@@ -794,22 +677,22 @@ bool vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::LoadVolume(vtkRenderer* ren,
       this->TextureSize[0],
       this->TextureSize[1],
       this->TextureSize[2],
-      noOfComponents,
+      scalars->GetNumberOfComponents(),
       scalarType,
       0);
     this->VolumeTextureObject->Activate();
     this->VolumeTextureObject->SetWrapS(vtkTextureObject::ClampToEdge);
     this->VolumeTextureObject->SetWrapT(vtkTextureObject::ClampToEdge);
     this->VolumeTextureObject->SetWrapR(vtkTextureObject::ClampToEdge);
-    this->VolumeTextureObject->SetMagnificationFilter(this->InterpolationType);
-    this->VolumeTextureObject->SetMinificationFilter(this->InterpolationType);
+    this->VolumeTextureObject->SetMagnificationFilter(vtkTextureObject::Linear);
+    this->VolumeTextureObject->SetMinificationFilter(vtkTextureObject::Linear);
     this->VolumeTextureObject->SetBorderColor(0.0f, 0.0f, 0.0f, 0.0f);
 
     // Send the slices one by one to the GPU. We are not sending all of them
     // together so as to avoid allocating big data on the GPU which may not
     // work if the original dataset is big as well.
     vtkFloatArray* sliceArray = vtkFloatArray::New();
-    sliceArray->SetNumberOfComponents(noOfComponents);
+    sliceArray->SetNumberOfComponents(1);
     sliceArray->SetNumberOfTuples(this->TextureSize[0] * this->TextureSize[1]);
     void* slicePtr = sliceArray->GetVoidPointer(0);
     int k = 0;
@@ -820,7 +703,6 @@ bool vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::LoadVolume(vtkRenderer* ren,
                    this->Extents[2]) *
                   (this->Dimensions[0] - this->Parent->CellFlag) +
                    this->Extents[0];
-    float *tupPtr = new float [noOfComponents];
     while(k < this->TextureSize[2])
       {
       int j = 0;
@@ -831,12 +713,9 @@ bool vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::LoadVolume(vtkRenderer* ren,
         i = 0;
         while(i < this->TextureSize[0])
           {
-          double * scalarPtr = scalars->GetTuple(kOffset + jOffset + i);
-          for (int n = 0; n < noOfComponents; ++n)
-            {
-            tupPtr[n] = scalarPtr[n]*scale[n] + bias[n];
-            }
-          sliceArray->SetTuple(jDestOffset + i, tupPtr);
+          sliceArray->SetTuple1(jDestOffset + i,
+                                (scalars->GetTuple1(kOffset + jOffset + i) +
+                                 shift)*scale);
           ++i;
           }
         ++j;
@@ -852,12 +731,8 @@ bool vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::LoadVolume(vtkRenderer* ren,
       ++k;
       kOffset += kInc;
       }
-    delete [] tupPtr;
     sliceArray->Delete();
     }
-  // do not tie up the texture unit unless we are activly using it
-  // textures can exist without being active
-  this->VolumeTextureObject->Deactivate();
   return 1;
 }
 
@@ -908,20 +783,35 @@ bool vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::LoadMask(vtkRenderer* ren,
 //----------------------------------------------------------------------------
 void vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::DeleteTransferFunctions()
 {
-  delete this->RGBTables;
-  this->RGBTables = 0;
+  if (this->RGBTables)
+    {
+    delete this->RGBTables;
+    this->RGBTables = 0;
+    }
 
-  delete this->Mask1RGBTable;
-  this->Mask1RGBTable=0;
+  if(this->Mask1RGBTable!=0)
+    {
+    delete this->Mask1RGBTable;
+    this->Mask1RGBTable=0;
+    }
 
-  delete this->Mask2RGBTable;
-  this->Mask2RGBTable=0;
+  if(this->Mask2RGBTable!=0)
+    {
+    delete this->Mask2RGBTable;
+    this->Mask2RGBTable=0;
+    }
 
-  delete this->OpacityTables;
-  this->OpacityTables = 0;
+  if (this->OpacityTables)
+    {
+    delete this->OpacityTables;
+    this->OpacityTables = 0;
+    }
 
-  delete this->GradientOpacityTables;
-  this->GradientOpacityTables = 0;
+  if (this->GradientOpacityTables)
+    {
+    delete this->GradientOpacityTables;
+    this->GradientOpacityTables = 0;
+    }
 
   if (this->MaskTextures != 0)
     {
@@ -1023,70 +913,9 @@ void vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::ComputeBounds(
 }
 
 //----------------------------------------------------------------------------
-int vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::UpdateVolume(
-  vtkVolumeProperty* volumeProperty)
-{
-  if (volumeProperty->GetMTime() > this->VolumeUpdateTime.GetMTime())
-    {
-    int interpolationType = this->InterpolationType;
-
-    this->UpdateInterpolationType(volumeProperty);
-
-    if (interpolationType != this->InterpolationType)
-      {
-      this->VolumeTextureObject->Activate();
-      this->VolumeTextureObject->SetMagnificationFilter(this->InterpolationType);
-      this->VolumeTextureObject->SetMinificationFilter(this->InterpolationType);
-      }
-    }
-  this->VolumeUpdateTime.Modified();
-
-  return 0;
-}
-
-//----------------------------------------------------------------------------
-int vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::UpdateInterpolationType(
-  vtkVolumeProperty* volumeProperty)
-{
-    if (volumeProperty != NULL)
-      {
-      if (volumeProperty->GetInterpolationType() ==
-          VTK_LINEAR_INTERPOLATION &&
-          this->InterpolationType != vtkTextureObject::Linear)
-        {
-        this->InterpolationType = vtkTextureObject::Linear;
-        return 0;
-        }
-      else if(volumeProperty->GetInterpolationType() ==
-              VTK_NEAREST_INTERPOLATION &&
-              this->InterpolationType != vtkTextureObject::Nearest)
-        {
-        this->InterpolationType = vtkTextureObject::Nearest;
-        return 0;
-        }
-      else if (volumeProperty->GetInterpolationType() !=
-               VTK_LINEAR_INTERPOLATION &&
-               volumeProperty->GetInterpolationType() !=
-               VTK_NEAREST_INTERPOLATION)
-        {
-        std::cerr << "Invalid interpolation type for volume texture"
-                  << std::endl;
-        return 1;
-        }
-      else
-        {
-        // Do nothing
-        return 0;
-        }
-      }
-
-    return 0;
-  }
-
-  //----------------------------------------------------------------------------
-  int vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::UpdateColorTransferFunction(
-    vtkRenderer* ren, vtkVolume* vol, int vtkNotUsed(noOfComponents),
-    unsigned int component)
+int vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::UpdateColorTransferFunction(
+  vtkRenderer* ren, vtkVolume* vol, int vtkNotUsed(noOfComponents),
+  unsigned int component)
 {
   // Volume property cannot be null.
   vtkVolumeProperty* volumeProperty = vol->GetProperty();
@@ -1100,25 +929,17 @@ int vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::UpdateInterpolationType(
   // Add points only if its not being added before
   if (colorTransferFunction->GetSize() < 1)
     {
-    colorTransferFunction->AddRGBPoint(this->ScalarsRange[component][0],
-                                       0.0, 0.0, 0.0);
-    colorTransferFunction->AddRGBPoint(this->ScalarsRange[component][1],
-                                       1.0, 1.0, 1.0);
+    colorTransferFunction->AddRGBPoint(this->ScalarsRange[0], 0.0, 0.0, 0.0);
+    colorTransferFunction->AddRGBPoint(this->ScalarsRange[1], 1.0, 1.0, 1.0);
     }
 
   int filterVal =
     volumeProperty->GetInterpolationType() == VTK_LINEAR_INTERPOLATION ?
       vtkTextureObject::Linear : vtkTextureObject::Nearest;
 
-  double scalarRange[2];
-  for (int i = 0; i < 2; ++i)
-    {
-    scalarRange[i] = this->ScalarsRange[component][i];
-    }
-
   this->RGBTables->GetTable(component)->Update(
     volumeProperty->GetRGBTransferFunction(component),
-    scalarRange,
+    this->ScalarsRange,
     filterVal,
     vtkOpenGLRenderWindow::SafeDownCast(ren->GetRenderWindow()));
 
@@ -1127,13 +948,13 @@ int vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::UpdateInterpolationType(
     {
     vtkColorTransferFunction* colorTransferFunc =
       volumeProperty->GetRGBTransferFunction(1);
-    this->Mask1RGBTable->Update(colorTransferFunc, scalarRange,
+    this->Mask1RGBTable->Update(colorTransferFunc, this->ScalarsRange,
                                 vtkTextureObject::Nearest,
                                 vtkOpenGLRenderWindow::SafeDownCast(
                                   ren->GetRenderWindow()));
 
     colorTransferFunc = volumeProperty->GetRGBTransferFunction(2);
-    this->Mask2RGBTable->Update(colorTransferFunc, scalarRange,
+    this->Mask2RGBTable->Update(colorTransferFunc, this->ScalarsRange,
                                 vtkTextureObject::Nearest,
                                 vtkOpenGLRenderWindow::SafeDownCast(
                                   ren->GetRenderWindow()));
@@ -1153,39 +974,23 @@ int vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::UpdateOpacityTransferFunction(
     }
 
   vtkVolumeProperty* volumeProperty = vol->GetProperty();
-  vtkPiecewiseFunction* scalarOpacity = 0;
-
-  if (!vol->GetProperty()->GetIndependentComponents())
-    {
-    scalarOpacity = volumeProperty->GetScalarOpacity(0);
-    }
-  else
-    {
-    scalarOpacity = volumeProperty->GetScalarOpacity(component);
-    }
+  vtkPiecewiseFunction* scalarOpacity =
+    volumeProperty->GetScalarOpacity(component);
 
   if (scalarOpacity->GetSize() < 1)
     {
-    scalarOpacity->AddPoint(this->ScalarsRange[component][0], 0.0);
-    scalarOpacity->AddPoint(this->ScalarsRange[component][1], 0.5);
+    scalarOpacity->AddPoint(this->ScalarsRange[0], 0.0);
+    scalarOpacity->AddPoint(this->ScalarsRange[1], 0.5);
     }
 
   int filterVal =
     volumeProperty->GetInterpolationType() == VTK_LINEAR_INTERPOLATION ?
       vtkTextureObject::Linear : vtkTextureObject::Nearest;
 
-  double scalarRange[2];
-  for (int i = 0; i < 2; ++i)
-    {
-    scalarRange[i] = this->ScalarsRange[component][i];
-    }
-
-  int tableIndex = component < this->OpacityTables->GetNumberOfTables() ?
-                   component : this->OpacityTables->GetNumberOfTables() - 1;
-  this->OpacityTables->GetTable(tableIndex)->Update(
+  this->OpacityTables->GetTable(component)->Update(
     scalarOpacity,this->Parent->BlendMode,
     this->ActualSampleDistance,
-    scalarRange,
+    this->ScalarsRange,
     volumeProperty->GetScalarOpacityUnitDistance(component),
     filterVal,
     vtkOpenGLRenderWindow::SafeDownCast(ren->GetRenderWindow()));
@@ -1214,40 +1019,23 @@ int vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::
     return 1;
     }
 
-  vtkPiecewiseFunction* gradientOpacity = 0;
-
-  if (!vol->GetProperty()->GetIndependentComponents())
-    {
-    gradientOpacity = volumeProperty->GetGradientOpacity(0);
-    }
-  else
-    {
-    gradientOpacity = volumeProperty->GetGradientOpacity(component);
-    }
+  vtkPiecewiseFunction* gradientOpacity =
+    volumeProperty->GetGradientOpacity(component);
 
   if (gradientOpacity->GetSize() < 1)
     {
-    gradientOpacity->AddPoint(this->ScalarsRange[component][0], 0.0);
-    gradientOpacity->AddPoint(this->ScalarsRange[component][1], 0.5);
+    gradientOpacity->AddPoint(this->ScalarsRange[0], 0.0);
+    gradientOpacity->AddPoint(this->ScalarsRange[1], 0.5);
     }
 
   int filterVal =
     volumeProperty->GetInterpolationType() == VTK_LINEAR_INTERPOLATION ?
       vtkTextureObject::Linear : vtkTextureObject::Nearest;
 
-  double scalarRange[2];
-  for (int i = 0; i < 2; ++i)
-    {
-    scalarRange[i] = this->ScalarsRange[component][i];
-    }
-
-  int tableIndex =
-    component < this->GradientOpacityTables->GetNumberOfTables() ?
-    component : this->GradientOpacityTables->GetNumberOfTables() - 1;
-  this->GradientOpacityTables->GetTable(tableIndex)->Update(
+  this->GradientOpacityTables->GetTable(component)->Update(
     gradientOpacity,
     this->ActualSampleDistance,
-    scalarRange,
+    this->ScalarsRange,
     volumeProperty->GetScalarOpacityUnitDistance(),
     filterVal,
     vtkOpenGLRenderWindow::SafeDownCast(ren->GetRenderWindow()));
@@ -1278,7 +1066,7 @@ void vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::UpdateNoiseTexture(
       size = maxSize;
       }
 
-    if (this->NoiseTextureSize != size)
+    if (this->NoiseTextureData != 0 && this->NoiseTextureSize != size)
       {
       delete[] this->NoiseTextureData;
       this->NoiseTextureData = 0;
@@ -1317,6 +1105,7 @@ void vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::UpdateNoiseTexture(
     this->NoiseTextureObject->SetMagnificationFilter(vtkTextureObject::Nearest);
     this->NoiseTextureObject->SetMinificationFilter(vtkTextureObject::Nearest);
     this->NoiseTextureObject->SetBorderColor(0.0f, 0.0f, 0.0f, 0.0f);
+    this->NoiseTextureObject->Activate();
     }
 }
 
@@ -1373,18 +1162,13 @@ void vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::UpdateDepthTexture(
 
 //----------------------------------------------------------------------------
 void vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::UpdateLightingParameters(
-  vtkRenderer* ren, vtkVolume* vol)
+  vtkRenderer* ren, vtkVolume* vtkNotUsed(vol))
 {
   if (!this->ShaderProgram)
     {
     return;
     }
 
-  if (vol && !vol->GetProperty()->GetShade())
-    {
-    return;
-    }
-
   this->ShaderProgram->SetUniformi("in_twoSidedLighting",
                                    ren->GetTwoSidedLighting());
 
@@ -1560,8 +1344,7 @@ bool vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::IsCameraInside(
 void vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::UpdateVolumeGeometry(
   vtkRenderer* ren, vtkVolume* vol, vtkImageData* input)
 {
-  if (this->NeedToInitializeResources ||
-      input->GetMTime() > this->InputUpdateTime.GetMTime() ||
+  if (input->GetMTime() > this->InputUpdateTime.GetMTime() ||
       this->IsCameraInside(ren, vol) ||
       this->CameraWasInsideInLastUpdate)
     {
@@ -1652,19 +1435,18 @@ void vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::UpdateVolumeGeometry(
       // We add an offset to the near plane to avoid hardware clipping of the
       // near plane due to floating-point precision.
       // camPlaneNormal is a unit vector, if the offset is larger than the
-      // distance between near and far point, it will not work. Hence, we choose
-      // a fraction of the near-far distance. However, care should be taken
-      // to avoid hardware clipping in volumes with very small spacing where the
-      // distance between near and far plane is also very small. In that case,
-      // a minimum offset is chosen. This is chosen based on the typical
-      // epsilon values on x86 systems.
-      double offset = sqrt(vtkMath::Distance2BetweenPoints(
-                           camNearPoint, camFarPoint)) / 1000.0;
-      // Minimum offset to avoid floating point precision issues for volumes
-      // with very small spacing
-      double minOffset =  static_cast<double>(
-                         std::numeric_limits<float>::epsilon()) * 1000.0;
-      offset = offset < minOffset ? minOffset : offset;
+      // distance between near and far point, it will not work, in this case we
+      // pick a fraction of the near-far distance.
+      // 100.0 and 1000.0 are chosen based on the typical epsilon values on
+      // x86 systems.
+      double offset =  static_cast<double>(
+                         std::numeric_limits<float>::epsilon()) * 100.0;
+      if(offset > 0.001)
+        {
+        double newOffset = sqrt(vtkMath::Distance2BetweenPoints(
+                             camNearPoint, camFarPoint)) / 1000.0;
+        offset = offset > newOffset ? newOffset : offset;
+        }
 
       camNearPoint[0] += camPlaneNormal[0]*offset;
       camNearPoint[1] += camPlaneNormal[1]*offset;
@@ -1715,14 +1497,9 @@ void vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::UpdateVolumeGeometry(
     // Now create new ones
     this->CreateBufferObjects();
 
-    // TODO: should realy use the built in VAO class
-    // which handles these apple issues internally
-#ifdef __APPLE__
-    if (vtkOpenGLRenderWindow::GetContextSupportsOpenGL32())
+#ifndef __APPLE__
+    glBindVertexArray(this->CubeVAOId);
 #endif
-      {
-      glBindVertexArray(this->CubeVAOId);
-      }
     // Pass cube vertices to buffer object memory
     glBindBuffer (GL_ARRAY_BUFFER, this->CubeVBOId);
     glBufferData (GL_ARRAY_BUFFER, points->GetData()->GetDataSize() *
@@ -1740,20 +1517,15 @@ void vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::UpdateVolumeGeometry(
     }
   else
     {
-#ifdef __APPLE__
-    if (!vtkOpenGLRenderWindow::GetContextSupportsOpenGL32())
-      {
-      glBindBuffer (GL_ARRAY_BUFFER, this->CubeVBOId);
-      this->ShaderProgram->EnableAttributeArray("in_vertexPos");
-      this->ShaderProgram->UseAttributeArray("in_vertexPos", 0, 0, VTK_FLOAT,
-                                             3, vtkShaderProgram::NoNormalize);
-      glBindBuffer (GL_ELEMENT_ARRAY_BUFFER, this->CubeIndicesId);
-      }
-    else
+#ifndef __APPLE__
+    glBindVertexArray(this->CubeVAOId);
+#else
+    glBindBuffer (GL_ARRAY_BUFFER, this->CubeVBOId);
+    this->ShaderProgram->EnableAttributeArray("in_vertexPos");
+    this->ShaderProgram->UseAttributeArray("in_vertexPos", 0, 0, VTK_FLOAT,
+                                           3, vtkShaderProgram::NoNormalize);
+    glBindBuffer (GL_ELEMENT_ARRAY_BUFFER, this->CubeIndicesId);
 #endif
-      {
-      glBindVertexArray(this->CubeVAOId);
-      }
     }
 }
 
@@ -1901,11 +1673,11 @@ void vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::UpdateSamplingDistance(
     // by 1/reduceFactor.
     this->ActualSampleDistance = static_cast<float>(minWorldSpacing);
 
-    if (this->Parent->ReductionFactor < 1.0 &&
-        this->Parent->ReductionFactor != 0.0)
+    if (this->Parent->ReductionFactor < 1.0)
       {
+      // 0.5 is done to increase the impact factor
       this->ActualSampleDistance /=
-        static_cast<GLfloat>(this->Parent->ReductionFactor);
+        static_cast<GLfloat>(this->Parent->ReductionFactor * 0.5);
       }
     }
 }
@@ -1915,12 +1687,6 @@ void vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::
   LoadRequireDepthTextureExtensions(vtkRenderWindow* vtkNotUsed(renWin))
 {
   // Reset the message stream for extensions
-  if (vtkOpenGLRenderWindow::GetContextSupportsOpenGL32())
-    {
-    this->LoadDepthTextureExtensionsSucceeded = true;
-    return;
-    }
-
   this->ExtensionsStringStream.str("");
   this->ExtensionsStringStream.clear();
 
@@ -1956,12 +1722,9 @@ void vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::
 //----------------------------------------------------------------------------
 void vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::CreateBufferObjects()
 {
-#ifdef __APPLE__
-  if (vtkOpenGLRenderWindow::GetContextSupportsOpenGL32())
+#ifndef __APPLE__
+  glGenVertexArrays(1, &this->CubeVAOId);
 #endif
-    {
-    glGenVertexArrays(1, &this->CubeVAOId);
-    }
   glGenBuffers(1, &this->CubeVBOId);
   glGenBuffers(1, &this->CubeIndicesId);
 }
@@ -1969,30 +1732,22 @@ void vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::CreateBufferObjects()
 //----------------------------------------------------------------------------
 void vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::DeleteBufferObjects()
 {
+#ifndef __APPLE__
+  if (this->CubeVAOId)
+    {
+    glDeleteVertexArrays(1, &this->CubeVAOId);
+    }
+#endif
+
   if (this->CubeVBOId)
     {
-    glBindBuffer (GL_ARRAY_BUFFER, this->CubeVBOId);
     glDeleteBuffers(1, &this->CubeVBOId);
-    this->CubeVBOId = 0;
     }
 
   if (this->CubeIndicesId)
    {
-   glBindBuffer (GL_ELEMENT_ARRAY_BUFFER, this->CubeIndicesId);
    glDeleteBuffers(1, &this->CubeIndicesId);
-    this->CubeIndicesId = 0;
    }
-
-  if (this->CubeVAOId)
-    {
-#ifdef __APPLE__
-  if (vtkOpenGLRenderWindow::GetContextSupportsOpenGL32())
-#endif
-      {
-      glDeleteVertexArrays(1, &this->CubeVAOId);
-      }
-    this->CubeVAOId = 0;
-    }
 }
 
 //----------------------------------------------------------------------------
@@ -2000,7 +1755,6 @@ vtkOpenGLGPUVolumeRayCastMapper::vtkOpenGLGPUVolumeRayCastMapper() :
   vtkGPUVolumeRayCastMapper()
 {
   this->Impl = new vtkInternal(this);
-  this->ReductionFactor = 1.0;
 }
 
 ///
@@ -2106,8 +1860,6 @@ void vtkOpenGLGPUVolumeRayCastMapper::ReleaseGraphicsResources(
     delete this->Impl->GradientOpacityTables;
     this->Impl->GradientOpacityTables = 0;
     }
-
-  this->Impl->ReleaseResourcesTime.Modified();
 }
 
 //----------------------------------------------------------------------------
@@ -2126,8 +1878,6 @@ void vtkOpenGLGPUVolumeRayCastMapper::BuildShader(vtkRenderer* ren,
     {
     vtkLightCollection* lc = ren->GetLights();
     vtkLight* light;
-    this->Impl->NumberOfLights = 0;
-
     // Compute light complexity.
     vtkCollectionSimpleIterator sit;
     for (lc->InitTraversal(sit); (light = lc->GetNextLight(sit)); )
@@ -2164,39 +1914,39 @@ void vtkOpenGLGPUVolumeRayCastMapper::BuildShader(vtkRenderer* ren,
   vertexShader = vtkvolume::replace(
     vertexShader,
     "//VTK::ComputeClipPos::Impl",
-    vtkvolume::ComputeClipPositionImplementation(ren, this, vol),
+    vtkvolume::ComputeClip(ren, this, vol),
     true);
 
   vertexShader = vtkvolume::replace(
     vertexShader,
     "//VTK::ComputeTextureCoords::Impl",
-    vtkvolume::ComputeTextureCoordinates(ren, this, vol),
+    vtkvolume::ComputeTextureCoords(ren, this, vol),
     true);
 
   vertexShader = vtkvolume::replace(
     vertexShader,
     "//VTK::Base::Dec",
-    vtkvolume::BaseDeclarationVertex(ren, this, vol),
+    vtkvolume::BaseGlobalsVert(ren, this, vol),
     true);
 
   fragmentShader = vtkvolume::replace(
     fragmentShader,
     "//VTK::Base::Dec",
-    vtkvolume::BaseDeclarationFragment(ren, this, vol, this->Impl->NumberOfLights,
-                                       this->Impl->LightComplexity, noOfComponents,
-                                       independentComponents),
+    vtkvolume::BaseGlobalsFrag(ren, this, vol, this->Impl->NumberOfLights,
+                               this->Impl->LightComplexity, noOfComponents,
+                               independentComponents),
     true);
 
   fragmentShader = vtkvolume::replace(
     fragmentShader,
     "//VTK::Base::Init",
-    vtkvolume::BaseInit(ren, this, vol, this->Impl->LightComplexity),
+    vtkvolume::BaseInit(ren, this, vol),
     true);
 
   fragmentShader = vtkvolume::replace(
     fragmentShader,
     "//VTK::Base::Impl",
-    vtkvolume::BaseImplementation(ren, this, vol),
+    vtkvolume::BaseIncrement(ren, this, vol),
     true);
 
   fragmentShader = vtkvolume::replace(
@@ -2210,13 +1960,13 @@ void vtkOpenGLGPUVolumeRayCastMapper::BuildShader(vtkRenderer* ren,
   vertexShader = vtkvolume::replace(
     vertexShader,
     "//VTK::Termination::Dec",
-    vtkvolume::TerminationDeclarationVertex(ren, this, vol),
+    vtkvolume::TerminationGlobalsVert(ren, this, vol),
     true);
 
   fragmentShader = vtkvolume::replace(
     fragmentShader,
     "//VTK::Termination::Dec",
-    vtkvolume::TerminationDeclarationFragment(ren, this, vol),
+    vtkvolume::TerminationGlobalsFrag(ren, this, vol),
     true);
 
   fragmentShader = vtkvolume::replace(
@@ -2228,7 +1978,7 @@ void vtkOpenGLGPUVolumeRayCastMapper::BuildShader(vtkRenderer* ren,
   fragmentShader = vtkvolume::replace(
     fragmentShader,
     "//VTK::Terminate::Impl",
-    vtkvolume::TerminationImplementation(ren, this, vol),
+    vtkvolume::TerminationIncrement(ren, this, vol),
     true);
 
   fragmentShader = vtkvolume::replace(
@@ -2242,13 +1992,13 @@ void vtkOpenGLGPUVolumeRayCastMapper::BuildShader(vtkRenderer* ren,
   vertexShader = vtkvolume::replace(
     vertexShader,
     "//VTK::Shading::Dec",
-    vtkvolume::ShadingDeclarationVertex(ren, this, vol),
+    vtkvolume::ShadingGlobalsVert(ren, this, vol),
     true);
 
   fragmentShader = vtkvolume::replace(
     fragmentShader,
     "//VTK::Shading::Dec",
-    vtkvolume::ShadingDeclarationFragment(ren, this, vol),
+    vtkvolume::ShadingGlobalsFrag(ren, this, vol),
     true);
 
   fragmentShader = vtkvolume::replace(
@@ -2260,10 +2010,10 @@ void vtkOpenGLGPUVolumeRayCastMapper::BuildShader(vtkRenderer* ren,
   fragmentShader = vtkvolume::replace(
     fragmentShader,
     "//VTK::Shading::Impl",
-    vtkvolume::ShadingImplementation(ren, this, vol, this->MaskInput,
-                                     this->Impl->CurrentMask,
-                                     this->MaskType, noOfComponents,
-                                     independentComponents),
+    vtkvolume::ShadingIncrement(ren, this, vol, this->MaskInput,
+                                this->Impl->CurrentMask,
+                                this->MaskType, noOfComponents,
+                                independentComponents),
     true);
 
   fragmentShader = vtkvolume::replace(
@@ -2279,39 +2029,40 @@ void vtkOpenGLGPUVolumeRayCastMapper::BuildShader(vtkRenderer* ren,
   fragmentShader = vtkvolume::replace(
     fragmentShader,
     "//VTK::ComputeOpacity::Dec",
-    vtkvolume::ComputeOpacityDeclaration(ren, this, vol, noOfComponents,
-                                         independentComponents,
-                                         this->Impl->OpacityTablesMap),
+    vtkvolume::OpacityTransferFunc(ren, this, vol, noOfComponents,
+                                  independentComponents,
+                                   this->Impl->OpacityTablesMap),
     true);
 
   fragmentShader = vtkvolume::replace(
     fragmentShader,
     "//VTK::ComputeGradient::Dec",
-    vtkvolume::ComputeGradientDeclaration(ren, this, vol, noOfComponents,
-                                          independentComponents,
-                                          this->Impl->GradientOpacityTablesMap),
+    vtkvolume::GradientsComputeFunc(ren, this, vol, noOfComponents,
+                                    independentComponents,
+                                    this->Impl->GradientOpacityTablesMap),
     true);
 
   fragmentShader = vtkvolume::replace(
     fragmentShader,
-    "//VTK::ComputeColor::Dec",
-    vtkvolume::ComputeColorDeclaration(ren, this, vol, noOfComponents,
-                                       independentComponents,
-                                       this->Impl->RGBTablesMap),
+    "//VTK::ColorTransferFunc::Dec",
+    vtkvolume::ColorTransferFunc(ren, this, vol, noOfComponents,
+                                 independentComponents,
+                                 this->Impl->RGBTablesMap),
     true);
 
   fragmentShader = vtkvolume::replace(
     fragmentShader,
     "//VTK::ComputeLighting::Dec",
-    vtkvolume::ComputeLightingDeclaration(ren, this, vol, noOfComponents,
-                                          independentComponents,
-                                          this->Impl->NumberOfLights,
-                                          this->Impl->LightComplexity),
+    vtkvolume::LightComputeFunc(ren, this, vol, noOfComponents,
+                                independentComponents,
+                                this->Impl->NumberOfLights,
+                                this->Impl->LightComplexity),
     true);
 
-  fragmentShader = vtkvolume::replace(fragmentShader,
-                                      "//VTK::ComputeRayDirection::Dec",
-      vtkvolume::ComputeRayDirectionDeclaration(ren, this, vol,noOfComponents),
+  fragmentShader = vtkvolume::replace(
+    fragmentShader,
+    "//VTK::RayDirectionFunc::Dec",
+    vtkvolume::RayDirectionFunc(ren, this, vol,noOfComponents),
     true);
 
   // Cropping methods replacements
@@ -2319,13 +2070,13 @@ void vtkOpenGLGPUVolumeRayCastMapper::BuildShader(vtkRenderer* ren,
   vertexShader = vtkvolume::replace(
     vertexShader,
     "//VTK::Cropping::Dec",
-    vtkvolume::CroppingDeclarationVertex(ren, this, vol),
+    vtkvolume::CroppingGlobalsVert(ren, this, vol),
     true);
 
   fragmentShader = vtkvolume::replace(
     fragmentShader,
     "//VTK::Cropping::Dec",
-    vtkvolume::CroppingDeclarationFragment(ren, this, vol),
+    vtkvolume::CroppingGlobalsFrag(ren, this, vol),
     true);
 
   fragmentShader = vtkvolume::replace(
@@ -2337,7 +2088,7 @@ void vtkOpenGLGPUVolumeRayCastMapper::BuildShader(vtkRenderer* ren,
   fragmentShader = vtkvolume::replace(
     fragmentShader,
     "//VTK::Cropping::Impl",
-    vtkvolume::CroppingImplementation(ren, this, vol),
+    vtkvolume::CroppingIncrement(ren, this, vol),
     true);
 
   fragmentShader = vtkvolume::replace(
@@ -2351,13 +2102,13 @@ void vtkOpenGLGPUVolumeRayCastMapper::BuildShader(vtkRenderer* ren,
   vertexShader = vtkvolume::replace(
     vertexShader,
     "//VTK::Clipping::Dec",
-    vtkvolume::ClippingDeclarationVertex(ren, this, vol),
+    vtkvolume::ClippingGlobalsVert(ren, this, vol),
     true);
 
   fragmentShader = vtkvolume::replace(
     fragmentShader,
     "//VTK::Clipping::Dec",
-    vtkvolume::ClippingDeclarationFragment(ren, this, vol),
+    vtkvolume::ClippingGlobalsFrag(ren, this, vol),
     true);
 
   fragmentShader = vtkvolume::replace(
@@ -2369,7 +2120,7 @@ void vtkOpenGLGPUVolumeRayCastMapper::BuildShader(vtkRenderer* ren,
   fragmentShader = vtkvolume::replace(
     fragmentShader,
     "//VTK::Clipping::Impl",
-    vtkvolume::ClippingImplementation(ren, this, vol),
+    vtkvolume::ClippingIncrement(ren, this, vol),
     true);
 
   fragmentShader = vtkvolume::replace(
@@ -2383,7 +2134,7 @@ void vtkOpenGLGPUVolumeRayCastMapper::BuildShader(vtkRenderer* ren,
   fragmentShader = vtkvolume::replace(
     fragmentShader,
     "//VTK::BinaryMask::Dec",
-    vtkvolume::BinaryMaskDeclaration(ren, this, vol, this->MaskInput,
+    vtkvolume::BinaryMaskGlobalsFrag(ren, this, vol, this->MaskInput,
                                      this->Impl->CurrentMask,
                                      this->MaskType),
     true);
@@ -2391,40 +2142,37 @@ void vtkOpenGLGPUVolumeRayCastMapper::BuildShader(vtkRenderer* ren,
   fragmentShader = vtkvolume::replace(
     fragmentShader,
     "//VTK::BinaryMask::Impl",
-    vtkvolume::BinaryMaskImplementation(ren, this, vol, this->MaskInput,
-                                        this->Impl->CurrentMask,
-                                        this->MaskType),
+    vtkvolume::BinaryMaskIncrement(ren, this, vol, this->MaskInput,
+                                   this->Impl->CurrentMask,
+                                   this->MaskType),
     true);
 
   fragmentShader = vtkvolume::replace(
     fragmentShader,
     "//VTK::CompositeMask::Dec",
-    vtkvolume::CompositeMaskDeclarationFragment(
-      ren, this, vol, this->MaskInput,
-      this->Impl->CurrentMask,
-      this->MaskType),
+    vtkvolume::CompositeMaskGlobalsFrag(ren, this, vol, this->MaskInput,
+                                        this->Impl->CurrentMask,
+                                        this->MaskType),
     true);
 
   fragmentShader = vtkvolume::replace(
     fragmentShader,
     "//VTK::CompositeMask::Impl",
-    vtkvolume::CompositeMaskImplementation(
-      ren, this, vol, this->MaskInput,
-      this->Impl->CurrentMask,
-      this->MaskType,
-      noOfComponents),
+    vtkvolume::CompositeMaskIncrement(ren, this, vol, this->MaskInput,
+                                      this->Impl->CurrentMask,
+                                      this->MaskType),
     true);
 
   // Now compile the shader
   //--------------------------------------------------------------------------
-  this->Impl->ShaderProgram = this->Impl->ShaderCache->ReadyShaderProgram(
+  this->Impl->ShaderProgram = this->Impl->ShaderCache->ReadyShader(
     vertexShader.c_str(), fragmentShader.c_str(), "");
-
   if (!this->Impl->ShaderProgram->GetCompiled())
     {
     vtkErrorMacro("Shader failed to compile");
     }
 
+
   this->Impl->ShaderBuildTime.Modified();
 }
 
@@ -2465,9 +2213,6 @@ void vtkOpenGLGPUVolumeRayCastMapper::ComputeReductionFactor(
       timeToDraw = this->BigTimeToDraw;
       }
 
-    // This should be the case when rendering the volume very first time
-    // 10.0 is an arbitrary value chosen which happen to a large number
-    // in this context
     if ( timeToDraw == 0.0 )
       {
       timeToDraw = 10.0;
@@ -2476,30 +2221,33 @@ void vtkOpenGLGPUVolumeRayCastMapper::ComputeReductionFactor(
     double fullTime = timeToDraw / this->ReductionFactor;
     double newFactor = allocatedTime / fullTime;
 
-    // Compute average factor
-    this->ReductionFactor = (newFactor+oldFactor)/2.0;
+    if ( oldFactor == 1.0 ||
+         newFactor / oldFactor > 1.3 ||
+         newFactor / oldFactor < .95 )
+      {
+      this->ReductionFactor = (newFactor+oldFactor)/2.0;
 
-    // Discretize reduction factor so that it doesn't cause
-    // visual artifacts when used to reduce the sample distance
-    this->ReductionFactor = (this->ReductionFactor > 1.0) ? 1.0 :
-                              (this->ReductionFactor);
-    this->ReductionFactor = (this->ReductionFactor < 1.0) ? (0.5) :
-                              (this->ReductionFactor);
-    this->ReductionFactor = (this->ReductionFactor < 0.5) ? (0.25) :
-                              (this->ReductionFactor);
-    this->ReductionFactor = (this->ReductionFactor < 0.25) ? (0.1) :
-                              (this->ReductionFactor);
+      this->ReductionFactor = (this->ReductionFactor > 5.0) ? (1.00) :
+                                (this->ReductionFactor);
+      this->ReductionFactor = (this->ReductionFactor > 1.0) ? (0.99) :
+                                (this->ReductionFactor);
+      this->ReductionFactor = (this->ReductionFactor < 0.1) ? (0.10) :
+                                (this->ReductionFactor);
 
-    // Clamp it
-    if ( 1.0/this->ReductionFactor > this->MaximumImageSampleDistance )
-      {
-      this->ReductionFactor = 1.0 / this->MaximumImageSampleDistance;
-      }
-    if ( 1.0/this->ReductionFactor < this->MinimumImageSampleDistance )
-      {
-      this->ReductionFactor = 1.0 / this->MinimumImageSampleDistance;
+      if ( 1.0/this->ReductionFactor > this->MaximumImageSampleDistance )
+        {
+        this->ReductionFactor = 1.0 / this->MaximumImageSampleDistance;
+        }
+      if ( 1.0/this->ReductionFactor < this->MinimumImageSampleDistance )
+        {
+        this->ReductionFactor = 1.0 / this->MinimumImageSampleDistance;
+        }
       }
     }
+  else
+    {
+    this->ReductionFactor = 1.0;
+    }
 }
 
 //----------------------------------------------------------------------------
@@ -2508,9 +2256,6 @@ void vtkOpenGLGPUVolumeRayCastMapper::GPURender(vtkRenderer* ren,
 {
   vtkOpenGLClearErrorMacro();
 
-  this->Impl->NeedToInitializeResources  =
-    (this->Impl->ReleaseResourcesTime.GetMTime() >
-    this->Impl->InitializationTime.GetMTime());
   // Make sure the context is current
   ren->GetRenderWindow()->MakeCurrent();
 
@@ -2536,37 +2281,29 @@ void vtkOpenGLGPUVolumeRayCastMapper::GPURender(vtkRenderer* ren,
   // How many components are there?
   int noOfComponents = scalars->GetNumberOfComponents();
 
-  // Allocate important variables
-  this->Impl->Bias.resize(noOfComponents, 0.0);
-  this->Impl->ScalarsRange.resize(noOfComponents);
-  for (int n = 0; n < noOfComponents; ++n)
-    {
-    this->Impl->ScalarsRange[n].resize(2, 0.0);
-    }
-
   // Set OpenGL states
   vtkVolumeStateRAII glState;
 
-  if (this->Impl->NeedToInitializeResources ||
-      (volumeProperty->GetMTime() > this->Impl->InitializationTime.GetMTime()))
+  if (volumeProperty->GetMTime() > this->Impl->InitializationTime.GetMTime())
     {
     this->Impl->Initialize(ren, vol, noOfComponents,
                            independentComponents);
     }
 
-  // Three dependent components are not supported
-  if ((noOfComponents == 3) && !independentComponents)
+  // If it is just one, then get the range from the scalars
+  if(noOfComponents == 1)
     {
-    vtkErrorMacro("Three dependent components are not supported");
+    // NOTE: here, we ignore the blank cells.
+    scalars->GetRange(this->Impl->ScalarsRange);
     }
-
-  for (int n = 0; n < noOfComponents; ++n)
+  // If it is 3, then use the 4th component's range since that is
+  // the component that will be passed through the scalar opacity
+  // transfer function to look up opacity
+  else
     {
-    double* range = scalars->GetRange(n);
-    for (int i = 0; i < 2; ++i)
-      {
-      this->Impl->ScalarsRange[n][i] = range[i];
-      }
+    // Note that we've already checked data type and we know this is
+    // unsigned char
+    scalars->GetRange(this->Impl->ScalarsRange, 3);
     }
 
   // Invert the volume matrix
@@ -2577,22 +2314,17 @@ void vtkOpenGLGPUVolumeRayCastMapper::GPURender(vtkRenderer* ren,
 
   // Update the volume if needed
   bool volumeModified = false;
-  if (this->Impl->NeedToInitializeResources ||
-      (input->GetMTime() > this->Impl->InputUpdateTime.GetMTime()))
+  if (input->GetMTime() > this->Impl->InputUpdateTime.GetMTime())
     {
     volumeModified = true;
     input->GetDimensions(this->Impl->Dimensions);
 
     // Update bounds, data, and geometry
     this->Impl->ComputeBounds(input);
-    this->Impl->LoadVolume(ren, input, volumeProperty, scalars, independentComponents);
+    this->Impl->LoadVolume(ren, input, scalars);
     this->Impl->LoadMask(ren, input, this->MaskInput,
                          this->Impl->Extents, vol);
     }
-  else
-    {
-    this->Impl->UpdateVolume(volumeProperty);
-    }
 
   // Mask
   vtkVolumeMask* mask = 0;
@@ -2622,8 +2354,7 @@ void vtkOpenGLGPUVolumeRayCastMapper::GPURender(vtkRenderer* ren,
     vtkOpenGLRenderWindow::SafeDownCast(ren->GetRenderWindow());
   this->Impl->ShaderCache = renWin->GetShaderCache();
 
-  if (this->Impl->NeedToInitializeResources ||
-      volumeProperty->GetMTime() >
+  if (volumeProperty->GetMTime() >
       this->Impl->ShaderBuildTime.GetMTime() ||
       this->GetMTime() > this->Impl->ShaderBuildTime.GetMTime() ||
       ren->GetActiveCamera()->GetParallelProjection() !=
@@ -2635,39 +2366,26 @@ void vtkOpenGLGPUVolumeRayCastMapper::GPURender(vtkRenderer* ren,
     }
 
   // Bind the shader
-  this->Impl->ShaderCache->ReadyShaderProgram(
+  this->Impl->ShaderCache->ReadyShader(
     this->Impl->ShaderProgram);
 
   // And now update the geometry that will be used
   // to render the 3D texture
   this->Impl->UpdateVolumeGeometry(ren, vol, input);
 
-  // Update the transfer functions
-  if (independentComponents)
-    {
-    for (int i = 0; i < noOfComponents; ++i)
-      {
-      this->Impl->UpdateOpacityTransferFunction(ren, vol, noOfComponents, i);
-      this->Impl->UpdateGradientOpacityTransferFunction(ren, vol,
-                                                        noOfComponents, i);
-      this->Impl->UpdateColorTransferFunction(ren, vol, noOfComponents, i);
-      }
-    }
-  else
+  // Update opacity transfer function
+  for (int i = 0; i < (independentComponents ?
+       noOfComponents : 1); ++i)
     {
-    if (noOfComponents == 2)
-      {
-      this->Impl->UpdateOpacityTransferFunction(ren, vol, noOfComponents, 1);
-      this->Impl->UpdateGradientOpacityTransferFunction(ren, vol,
-                                                        noOfComponents, 1);
-      this->Impl->UpdateColorTransferFunction(ren, vol, noOfComponents, 0);
-      }
-    else if (noOfComponents == 4)
-      {
-      this->Impl->UpdateOpacityTransferFunction(ren, vol, noOfComponents, 3);
-      this->Impl->UpdateGradientOpacityTransferFunction(ren, vol,
-                                                        noOfComponents, 3);
-      }
+    this->Impl->UpdateOpacityTransferFunction(ren, vol,
+      scalars->GetNumberOfComponents(), i);
+
+    this->Impl->UpdateGradientOpacityTransferFunction(ren, vol,
+      scalars->GetNumberOfComponents(), i);
+
+    // Update transfer color functions
+    this->Impl->UpdateColorTransferFunction(ren, vol,
+      scalars->GetNumberOfComponents(), i);
     }
 
   // Update noise sampler texture
@@ -2725,19 +2443,6 @@ void vtkOpenGLGPUVolumeRayCastMapper::GPURender(vtkRenderer* ren,
   this->Impl->ShaderProgram->SetUniformi("in_independentComponents",
                                          independentComponents);
 
-  float tscale[4] = {1.0, 1.0, 1.0, 1.0};
-  float tbias[4] = {0.0, 0.0, 0.0, 0.0};
-  if (!this->Impl->HandleLargeDataTypes &&
-      (noOfComponents == 1 || noOfComponents == 2 || independentComponents))
-    {
-    for (int i = 0; i < noOfComponents; i++)
-      {
-      tscale[i] = this->Impl->Scale[i];
-      tbias[i] = this->Impl->Bias[i];
-      }
-    }
-  this->Impl->ShaderProgram->SetUniform4f("in_volume_scale",tscale);
-  this->Impl->ShaderProgram->SetUniform4f("in_volume_bias",tbias);
 
   // Step should be dependant on the bounds and not on the texture size
   // since we can have non uniform voxel size / spacing / aspect ratio
@@ -2753,12 +2458,7 @@ void vtkOpenGLGPUVolumeRayCastMapper::GPURender(vtkRenderer* ren,
   this->Impl->ShaderProgram->SetUniformf("in_sampleDistance",
                                          this->Impl->ActualSampleDistance);
 
-  double scalarRange[2];
-  for (int i = 0; i < 2; ++i)
-    {
-    scalarRange[i] = this->Impl->ScalarsRange[noOfComponents - 1][i];
-    }
-  vtkInternal::ToFloat(scalarRange, fvalue2);
+  vtkInternal::ToFloat(this->Impl->ScalarsRange, fvalue2);
   this->Impl->ShaderProgram->SetUniform2fv("in_scalarsRange", 1, &fvalue2);
 
   // Bind textures
@@ -2771,14 +2471,14 @@ void vtkOpenGLGPUVolumeRayCastMapper::GPURender(vtkRenderer* ren,
 
   for (int i = 0; i < numberOfSamplers; ++i)
     {
-    this->Impl->OpacityTables->GetTable(i)->Activate();
+    this->Impl->OpacityTables->GetTable(i)->Bind();
     this->Impl->ShaderProgram->SetUniformi(
       this->Impl->OpacityTablesMap[i].c_str(),
       this->Impl->OpacityTables->GetTable(i)->GetTextureUnit());
 
     if (this->BlendMode != vtkGPUVolumeRayCastMapper::ADDITIVE_BLEND)
       {
-      this->Impl->RGBTables->GetTable(i)->Activate();
+      this->Impl->RGBTables->GetTable(i)->Bind();
       this->Impl->ShaderProgram->SetUniformi(
         this->Impl->RGBTablesMap[i].c_str(),
         this->Impl->RGBTables->GetTable(i)->GetTextureUnit());
@@ -2786,7 +2486,6 @@ void vtkOpenGLGPUVolumeRayCastMapper::GPURender(vtkRenderer* ren,
 
     if (this->Impl->GradientOpacityTables)
       {
-      this->Impl->GradientOpacityTables->GetTable(i)->Activate();
       this->Impl->ShaderProgram->SetUniformi(
         this->Impl->GradientOpacityTablesMap[i].c_str(),
         this->Impl->GradientOpacityTables->GetTable(i)->GetTextureUnit());
@@ -2803,7 +2502,7 @@ void vtkOpenGLGPUVolumeRayCastMapper::GPURender(vtkRenderer* ren,
 
   if (this->Impl->CurrentMask)
     {
-    this->Impl->CurrentMask->Activate();
+    this->Impl->CurrentMask->Bind();
     this->Impl->ShaderProgram->SetUniformi(
       "in_mask", this->Impl->CurrentMask->GetTextureUnit());
     }
@@ -2813,11 +2512,11 @@ void vtkOpenGLGPUVolumeRayCastMapper::GPURender(vtkRenderer* ren,
     {
     if (this->MaskInput != 0 && this->MaskType == LabelMapMaskType)
       {
-      this->Impl->Mask1RGBTable->Activate();
+      this->Impl->Mask1RGBTable->Bind();
       this->Impl->ShaderProgram->SetUniformi("in_mask1",
         this->Impl->Mask1RGBTable->GetTextureUnit());
 
-      this->Impl->Mask2RGBTable->Activate();
+      this->Impl->Mask2RGBTable->Bind();
       this->Impl->ShaderProgram->SetUniformi("in_mask2",
         this->Impl->Mask2RGBTable->GetTextureUnit());
       this->Impl->ShaderProgram->SetUniformf("in_maskBlendFactor",
@@ -2975,6 +2674,10 @@ void vtkOpenGLGPUVolumeRayCastMapper::GPURender(vtkRenderer* ren,
   this->Impl->UpdateClipping(ren, vol);
 
   // Finally set the scale and bias for color correction
+  this->Impl->ShaderProgram->SetUniformf("in_volumeScale", this->Impl->Scale);
+  this->Impl->ShaderProgram->SetUniformf("in_volumeBias", this->Impl->Bias);
+
+  // Finally set the scale and bias for color correction
   this->Impl->ShaderProgram->SetUniformf("in_scale",
     1.0 / this->FinalColorWindow);
   this->Impl->ShaderProgram->SetUniformf("in_bias",
@@ -2989,49 +2692,13 @@ void vtkOpenGLGPUVolumeRayCastMapper::GPURender(vtkRenderer* ren,
     this->Impl->ShaderProgram->SetUniform4fv("in_componentWeight", 1, &fvalue4);
     }
 
-#ifdef __APPLE__
-  if (vtkOpenGLRenderWindow::GetContextSupportsOpenGL32())
+#ifndef __APPLE__
+  glBindVertexArray(this->Impl->CubeVAOId);
 #endif
-    {
-    glBindVertexArray(this->Impl->CubeVAOId);
-    }
   glDrawElements(GL_TRIANGLES,
                  this->Impl->BBoxPolyData->GetNumberOfCells() * 3,
                  GL_UNSIGNED_INT, 0);
 
-  // relase the texture units we were using
-  this->Impl->VolumeTextureObject->Deactivate();
-  this->Impl->NoiseTextureObject->Deactivate();
-  this->Impl->DepthTextureObject->Deactivate();
-
-  for (int i = 0; i < numberOfSamplers; ++i)
-    {
-    this->Impl->OpacityTables->GetTable(i)->Deactivate();
-    if (this->BlendMode != vtkGPUVolumeRayCastMapper::ADDITIVE_BLEND)
-      {
-      this->Impl->RGBTables->GetTable(i)->Deactivate();
-      }
-    if (this->Impl->GradientOpacityTables)
-      {
-      this->Impl->GradientOpacityTables->GetTable(i)->Deactivate();
-      }
-    }
-
-  if (this->Impl->CurrentMask)
-    {
-    this->Impl->CurrentMask->Deactivate();
-    }
-
-  if(noOfComponents == 1 &&
-     this->BlendMode != vtkGPUVolumeRayCastMapper::ADDITIVE_BLEND)
-    {
-    if (this->MaskInput != 0 && this->MaskType == LabelMapMaskType)
-      {
-      this->Impl->Mask1RGBTable->Deactivate();
-      this->Impl->Mask2RGBTable->Deactivate();
-      }
-    }
-
   if (volumeModified)
     {
     this->Impl->InputUpdateTime.Modified();
diff --git a/Rendering/VolumeOpenGL2/vtkOpenGLProjectedTetrahedraMapper.cxx b/Rendering/VolumeOpenGL2/vtkOpenGLProjectedTetrahedraMapper.cxx
index e30a0c7..ed87fda 100644
--- a/Rendering/VolumeOpenGL2/vtkOpenGLProjectedTetrahedraMapper.cxx
+++ b/Rendering/VolumeOpenGL2/vtkOpenGLProjectedTetrahedraMapper.cxx
@@ -37,11 +37,8 @@
 #include "vtkNew.h"
 #include "vtkObjectFactory.h"
 #include "vtkOpenGLCamera.h"
-#include "vtkOpenGLIndexBufferObject.h"
 #include "vtkOpenGLRenderWindow.h"
 #include "vtkOpenGLShaderCache.h"
-#include "vtkOpenGLVertexArrayObject.h"
-#include "vtkOpenGLVertexBufferObject.h"
 #include "vtkPointData.h"
 #include "vtkRenderer.h"
 #include "vtkShaderProgram.h"
@@ -103,7 +100,6 @@ vtkOpenGLProjectedTetrahedraMapper::vtkOpenGLProjectedTetrahedraMapper()
   this->UseFloatingPointFrameBuffer = true;
   this->CanDoFloatingPointFrameBuffer = false;
   this->HasHardwareSupport = false;
-  this->VBO = vtkOpenGLVertexBufferObject::New();
 }
 
 //-----------------------------------------------------------------------------
@@ -114,7 +110,6 @@ vtkOpenGLProjectedTetrahedraMapper::~vtkOpenGLProjectedTetrahedraMapper()
   this->Colors->Delete();
   delete this->Internals;
   delete[] this->SqrtTable;
-  this->VBO->Delete();
 }
 
 //-----------------------------------------------------------------------------
@@ -316,8 +311,7 @@ void vtkOpenGLProjectedTetrahedraMapper::ReleaseGraphicsResources(vtkWindow *win
       this->Internals->RenderBufferObjectIds[1] = 0;
     }
 
-  this->VBO->ReleaseGraphicsResources();
-  this->Tris.ReleaseGraphicsResources(win);
+  this->VBO.ReleaseGraphicsResources();
 
   this->Superclass::ReleaseGraphicsResources(win);
 }
@@ -352,7 +346,7 @@ void vtkOpenGLProjectedTetrahedraMapper::Render(vtkRenderer *renderer,
 
     // compile and bind it if needed
     vtkShaderProgram *newShader =
-      renWin->GetShaderCache()->ReadyShaderProgram(VSSource.c_str(),
+      renWin->GetShaderCache()->ReadyShader(VSSource.c_str(),
                                             FSSource.c_str(),
                                             GSSource.c_str());
 
@@ -360,14 +354,14 @@ void vtkOpenGLProjectedTetrahedraMapper::Render(vtkRenderer *renderer,
     if (newShader != this->Tris.Program)
       {
       this->Tris.Program = newShader;
-      this->Tris.VAO->ShaderProgramChanged(); // reset the VAO as the shader has changed
+      this->Tris.vao.ShaderProgramChanged(); // reset the VAO as the shader has changed
       }
 
     this->Tris.ShaderSourceTime.Modified();
     }
   else
     {
-    renWin->GetShaderCache()->ReadyShaderProgram(this->Tris.Program);
+    renWin->GetShaderCache()->ReadyShader(this->Tris.Program);
     }
 
   // Check to see if input changed.
@@ -536,6 +530,9 @@ void vtkOpenGLProjectedTetrahedraMapper::ProjectTetrahedra(vtkRenderer *renderer
 
   // after mucking about with FBO bindings be sure
   // we're saving the default fbo attributes/blend function
+  glPushAttrib(GL_COLOR_BUFFER_BIT);
+  vtkOpenGLCheckErrorMacro("failed at glPushAttrib");
+
   this->AllocateFBOResources(renderer);
 
   if (this->UseFloatingPointFrameBuffer
@@ -690,13 +687,13 @@ void vtkOpenGLProjectedTetrahedraMapper::ProjectTetrahedra(vtkRenderer *renderer
   // build the VBO and IBOs,  we so these in chuncks as based on
   // the settings of the VisibilitySort tclass
 
-  this->VBO->VertexOffset = 0;
-  this->VBO->NormalOffset = 0;
-  this->VBO->ColorOffset = 3*sizeof(float);
-  this->VBO->ColorComponents = 3;
-  this->VBO->TCoordOffset = 4*sizeof(float);
-  this->VBO->TCoordComponents = 2;
-  this->VBO->Stride = 6*sizeof(float);
+  this->Layout.VertexOffset = 0;
+  this->Layout.NormalOffset = 0;
+  this->Layout.ColorOffset = 3*sizeof(float);
+  this->Layout.ColorComponents = 3;
+  this->Layout.TCoordOffset = 4*sizeof(float);
+  this->Layout.TCoordComponents = 2;
+  this->Layout.Stride = 6*sizeof(float);
 
   // Establish vertex arrays.
   // tets have 4 points, 5th point here is used
@@ -1035,55 +1032,55 @@ void vtkOpenGLProjectedTetrahedraMapper::ProjectTetrahedra(vtkRenderer *renderer
       numPts += 5;
       }
 
-    this->VBO->Upload(packedVBO, vtkOpenGLBufferObject::ArrayBuffer);
-    this->VBO->VertexCount = numPts;
-    this->VBO->Bind();
+    this->VBO.Upload(packedVBO, vtkgl::BufferObject::ArrayBuffer);
+    this->Layout.VertexCount = numPts;
+    this->VBO.Bind();
 
-    this->Tris.VAO->Bind();
-    if (this->Tris.IBO->IndexCount && (
-        this->Tris.ShaderSourceTime > this->Tris.AttributeUpdateTime))
+    this->Tris.vao.Bind();
+    if (this->Tris.indexCount && (
+        this->Tris.ShaderSourceTime > this->Tris.attributeUpdateTime))
       {
-      if (!this->Tris.VAO->AddAttributeArray(this->Tris.Program, this->VBO,
-                                      "vertexDC", this->VBO->VertexOffset,
-                                      this->VBO->Stride, VTK_FLOAT, 3, false))
+      if (!this->Tris.vao.AddAttributeArray(this->Tris.Program, this->VBO,
+                                      "vertexDC", this->Layout.VertexOffset,
+                                      this->Layout.Stride, VTK_FLOAT, 3, false))
         {
         vtkErrorMacro(<< "Error setting 'vertexDC' in shader VAO.");
         }
-      if (!this->Tris.VAO->AddAttributeArray(this->Tris.Program, this->VBO,
-                                      "scalarColor", this->VBO->ColorOffset,
-                                      this->VBO->Stride, VTK_UNSIGNED_CHAR,
-                                      this->VBO->ColorComponents, true))
+      if (!this->Tris.vao.AddAttributeArray(this->Tris.Program, this->VBO,
+                                      "scalarColor", this->Layout.ColorOffset,
+                                      this->Layout.Stride, VTK_UNSIGNED_CHAR,
+                                      this->Layout.ColorComponents, true))
         {
         vtkErrorMacro(<< "Error setting 'scalarColor' in shader VAO.");
         }
-      if (!this->Tris.VAO->AddAttributeArray(this->Tris.Program, this->VBO,
-                                      "attenuationArray", this->VBO->TCoordOffset,
-                                      this->VBO->Stride, VTK_FLOAT,
+      if (!this->Tris.vao.AddAttributeArray(this->Tris.Program, this->VBO,
+                                      "attenuationArray", this->Layout.TCoordOffset,
+                                      this->Layout.Stride, VTK_FLOAT,
                                       1, false))
         {
         vtkErrorMacro(<< "Error setting attenuation in shader VAO.");
         }
-      if (!this->Tris.VAO->AddAttributeArray(this->Tris.Program, this->VBO,
-                                      "depthArray", this->VBO->TCoordOffset+sizeof(float),
-                                      this->VBO->Stride, VTK_FLOAT,
+      if (!this->Tris.vao.AddAttributeArray(this->Tris.Program, this->VBO,
+                                      "depthArray", this->Layout.TCoordOffset+sizeof(float),
+                                      this->Layout.Stride, VTK_FLOAT,
                                       1, false))
         {
         vtkErrorMacro(<< "Error setting depth in shader VAO.");
         }
-      this->Tris.AttributeUpdateTime.Modified();
+      this->Tris.attributeUpdateTime.Modified();
       }
 
-    this->Tris.IBO->Upload(indexArray, vtkOpenGLBufferObject::ElementArrayBuffer);
-    this->Tris.IBO->IndexCount = indexArray.size();
-    this->Tris.IBO->Bind();
+    this->Tris.ibo.Upload(indexArray, vtkgl::BufferObject::ElementArrayBuffer);
+    this->Tris.indexCount = indexArray.size();
+    this->Tris.ibo.Bind();
     glDrawRangeElements(GL_TRIANGLES, 0,
-                        static_cast<GLuint>(this->VBO->VertexCount - 1),
-                        static_cast<GLsizei>(this->Tris.IBO->IndexCount),
+                        static_cast<GLuint>(this->Layout.VertexCount - 1),
+                        static_cast<GLsizei>(this->Tris.indexCount),
                         GL_UNSIGNED_INT,
                         reinterpret_cast<const GLvoid *>(NULL));
-    this->Tris.IBO->Release();
-    this->Tris.VAO->Release();
-    this->VBO->Release();
+    this->Tris.ibo.Release();
+    this->Tris.vao.Release();
+    this->VBO.Release();
     numcellsrendered += num_cell_ids;
     }
 
@@ -1120,6 +1117,7 @@ void vtkOpenGLProjectedTetrahedraMapper::ProjectTetrahedra(vtkRenderer *renderer
     }
 
   // Restore the blend function.
+  glPopAttrib();
   vtkOpenGLCheckErrorMacro("failed at glPopAttrib");
 
   glDepthMask(GL_TRUE);
diff --git a/Rendering/VolumeOpenGL2/vtkOpenGLProjectedTetrahedraMapper.h b/Rendering/VolumeOpenGL2/vtkOpenGLProjectedTetrahedraMapper.h
index ef971d0..9c0837c 100644
--- a/Rendering/VolumeOpenGL2/vtkOpenGLProjectedTetrahedraMapper.h
+++ b/Rendering/VolumeOpenGL2/vtkOpenGLProjectedTetrahedraMapper.h
@@ -36,14 +36,13 @@
 #include "vtkRenderingVolumeOpenGL2Module.h" // For export macro
 #include "vtkProjectedTetrahedraMapper.h"
 
-#include "vtkOpenGLHelper.h" // used for ivars
+#include "vtkglVBOHelper.h" // used for ivars
 
 class vtkVisibilitySort;
 class vtkUnsignedCharArray;
 class vtkFloatArray;
 class vtkRenderWindow;
 class vtkOpenGLRenderWindow;
-class vtkOpenGLVertexBufferObject;
 
 class VTKRENDERINGVOLUMEOPENGL2_EXPORT vtkOpenGLProjectedTetrahedraMapper
   : public vtkProjectedTetrahedraMapper
@@ -93,10 +92,11 @@ protected:
   vtkTimeStamp ColorsMappedTime;
 
   // The VBO and its layout.
-  vtkOpenGLVertexBufferObject *VBO;
+  vtkgl::BufferObject VBO;
+  vtkgl::VBOLayout Layout;
 
   // Structures for the various cell types we render.
-  vtkOpenGLHelper Tris;
+  vtkgl::CellBO Tris;
 
   int GaveError;
 
diff --git a/Rendering/VolumeOpenGL2/vtkOpenGLRayCastImageDisplayHelper.cxx b/Rendering/VolumeOpenGL2/vtkOpenGLRayCastImageDisplayHelper.cxx
index 19ed055..250615f 100644
--- a/Rendering/VolumeOpenGL2/vtkOpenGLRayCastImageDisplayHelper.cxx
+++ b/Rendering/VolumeOpenGL2/vtkOpenGLRayCastImageDisplayHelper.cxx
@@ -14,51 +14,136 @@
 =========================================================================*/
 #include "vtkOpenGLRayCastImageDisplayHelper.h"
 
+#include "vtkMatrix4x4.h"
 #include "vtkObjectFactory.h"
 #include "vtkVolume.h"
 #include "vtkRenderer.h"
+#include "vtkOpenGLPolyDataMapper.h"
 #include "vtkTransform.h"
+#include "vtkCamera.h"
 #include "vtkFixedPointRayCastImage.h"
 #include "vtkNew.h"
+#include "vtkPoints.h"
+#include "vtkPolyData.h"
 #include "vtkProperty.h"
+#include "vtkCellArray.h"
+#include "vtkPointData.h"
+#include "vtkTrivialProducer.h"
+#include "vtkFloatArray.h"
 #include "vtkTextureObject.h"
-#include "vtkOpenGLRenderUtilities.h"
 #include "vtkOpenGLRenderWindow.h"
-#include "vtkOpenGLShaderCache.h"
-#include "vtkOpenGLVertexArrayObject.h"
-#include "vtkShaderProgram.h"
+#include "vtkOpenGLTexture.h"
 
-#include "vtkOpenGLHelper.h"
+#include "vtk_glew.h"
 
 #include "vtkOpenGLError.h"
 
 #include <math.h>
 
-#include "vtkTextureObjectVS.h"  // a pass through shader
-
 vtkStandardNewMacro(vtkOpenGLRayCastImageDisplayHelper);
 
 //----------------------------------------------------------------------------
+struct vtkOpenGLRayCastImageDisplayHelperRAII
+{
+  vtkOpenGLRayCastImageDisplayHelperRAII(float pixelScale)
+    {
+    this->BlendWasEnabled = (glIsEnabled(GL_BLEND) != 0);
+    glEnable( GL_BLEND );
+
+    glPixelTransferf(GL_RED_SCALE,    pixelScale);
+    glPixelTransferf(GL_GREEN_SCALE,  pixelScale);
+    glPixelTransferf(GL_BLUE_SCALE,   pixelScale);
+    glPixelTransferf(GL_ALPHA_SCALE,  pixelScale);
+    }
+
+  ~vtkOpenGLRayCastImageDisplayHelperRAII()
+    {
+    // Restore to defaults
+    if (!this->BlendWasEnabled)
+      {
+      glDisable(GL_BLEND );
+      }
+
+    glPixelTransferf(GL_RED_SCALE,    1);
+    glPixelTransferf(GL_GREEN_SCALE,  1);
+    glPixelTransferf(GL_BLUE_SCALE,   1);
+    glPixelTransferf(GL_ALPHA_SCALE,  1);
+    }
+
+  bool BlendWasEnabled;
+};
+
+//----------------------------------------------------------------------------
 // Construct a new vtkOpenGLRayCastImageDisplayHelper with default values
 vtkOpenGLRayCastImageDisplayHelper::vtkOpenGLRayCastImageDisplayHelper()
 {
+  this->TextureActor = vtkActor::New();
+  vtkNew<vtkPolyDataMapper> mapper;
+  vtkNew<vtkPolyData> polydata;
+  vtkNew<vtkPoints> points;
+  points->SetNumberOfPoints(4);
+  polydata->SetPoints(points.Get());
+
+  vtkNew<vtkCellArray> tris;
+  tris->InsertNextCell(3);
+  tris->InsertCellPoint(0);
+  tris->InsertCellPoint(1);
+  tris->InsertCellPoint(2);
+  tris->InsertNextCell(3);
+  tris->InsertCellPoint(0);
+  tris->InsertCellPoint(2);
+  tris->InsertCellPoint(3);
+  polydata->SetPolys(tris.Get());
+
+  vtkNew<vtkTrivialProducer> prod;
+  prod->SetOutput(polydata.Get());
+
+  // Set some properties.
+  mapper->SetInputConnection(prod->GetOutputPort());
+  this->TextureActor->SetMapper(mapper.Get());
+
+  this->Texture = vtkOpenGLTexture::New();
+  this->Texture->RepeatOff();
+
   this->TextureObject = vtkTextureObject::New();
-  this->ShaderProgram = NULL;
+  this->Texture->SetTextureObject(this->TextureObject);
+
+  this->TextureActor->SetTexture(this->Texture);
+
+  // FIXME: Sine we switched to vtkActor/Mapper,
+  // this fix is requied as of November 13, 2014 because
+  // for our mapper to work correctly, we need depth write off
+  // but even if we do it in our mapper, the vtkActor/Mapper turn it back
+  // on as it looks for opacity on the property only even though early
+  // on we check for opacity correctly.
+  this->TextureActor->GetProperty()->SetOpacity(0.999);
+
+  vtkNew<vtkFloatArray> tcoords;
+  tcoords->SetNumberOfComponents(2);
+  tcoords->SetNumberOfTuples(4);
+  polydata->GetPointData()->SetTCoords(tcoords.Get());
 }
 
 //----------------------------------------------------------------------------
 // Destruct a vtkOpenGLRayCastImageDisplayHelper - clean up any memory used
 vtkOpenGLRayCastImageDisplayHelper::~vtkOpenGLRayCastImageDisplayHelper()
 {
+  if (this->TextureActor)
+    {
+    this->TextureActor->Delete();
+    this->TextureActor = 0;
+    }
+
   if (this->TextureObject)
     {
     this->TextureObject->Delete();
     this->TextureObject = 0;
     }
-  if (this->ShaderProgram)
+
+  if (this->Texture)
     {
-    delete this->ShaderProgram;
-    this->ShaderProgram = 0;
+    this->Texture->Delete();
+    this->Texture = 0;
     }
 }
 
@@ -127,16 +212,15 @@ void vtkOpenGLRayCastImageDisplayHelper::RenderTextureInternal( vtkVolume *vol,
   vtkOpenGLClearErrorMacro();
 
   // Set the context
-  vtkOpenGLRenderWindow *ctx =
-    vtkOpenGLRenderWindow::SafeDownCast(ren->GetRenderWindow());
-  this->TextureObject->SetContext(ctx);
+  this->TextureObject->SetContext(
+    vtkOpenGLRenderWindow::SafeDownCast(ren->GetRenderWindow()));
 
   float offsetX, offsetY;
 
   float depth;
   if ( requestedDepth > 0.0 && requestedDepth <= 1.0 )
     {
-    depth = requestedDepth*2.0 - 1.0;
+    depth = requestedDepth;
     }
   else
     {
@@ -148,8 +232,95 @@ void vtkOpenGLRayCastImageDisplayHelper::RenderTextureInternal( vtkVolume *vol,
                         vol->GetCenter()[1],
                         vol->GetCenter()[2],
                         1.0 );
-    ren->WorldToDisplay();
-    depth = ren->GetDisplayPoint()[2];
+    ren->WorldToView();
+    depth = ren->GetViewPoint()[2];
+    }
+
+  // Convert the four corners of the image into world coordinates
+  // hard casts should be good here as we created all these objects
+  // in our constructor.
+  vtkPolyData *polydata = (vtkPolyData *)(this->TextureActor->GetMapper()->GetInput());
+  float *verts = (float *)(polydata->GetPoints()->GetVoidPointer(0));
+  float *tcoords = (float *)(polydata->GetPointData()->GetTCoords()->GetVoidPointer(0));
+  vtkMatrix4x4 *viewToWorldMatrix = vtkMatrix4x4::New();
+  float in[4], out[4];
+
+  vtkCamera *cam = ren->GetActiveCamera();
+  ren->ComputeAspect();
+  double *aspect = ren->GetAspect();
+
+  vtkTransform *perspectiveTransform = vtkTransform::New();
+  perspectiveTransform->Identity();
+  perspectiveTransform->Concatenate(
+    cam->GetProjectionTransformMatrix(aspect[0]/aspect[1],
+                                      0.0, 1.0 ));
+  perspectiveTransform->Concatenate(cam->GetViewTransformMatrix());
+
+  // get the perspective transformation from the active camera
+  viewToWorldMatrix->DeepCopy( perspectiveTransform->GetMatrix() );
+  perspectiveTransform->Delete();
+
+  // use the inverse matrix
+  viewToWorldMatrix->Invert();
+
+  // These two values never change
+  in[2] = depth;
+  in[3] = 1.0;
+
+  // This is the lower left corner
+  in[0] = (float)imageOrigin[0]/imageViewportSize[0] * 2.0 - 1.0;
+  in[1] = (float)imageOrigin[1]/imageViewportSize[1] * 2.0 - 1.0;
+
+  viewToWorldMatrix->MultiplyPoint( in, out );
+  verts[0] = out[0] / out[3];
+  verts[1] = out[1] / out[3];
+  verts[2] = out[2] / out[3];
+
+  // This is the lower right corner
+  in[0] = (float)(imageOrigin[0]+imageInUseSize[0]) /
+    imageViewportSize[0] * 2.0 - 1.0;
+  in[1] = (float)imageOrigin[1]/imageViewportSize[1] * 2.0 - 1.0;
+
+  viewToWorldMatrix->MultiplyPoint( in, out );
+  verts[3] = out[0] / out[3];
+  verts[4] = out[1] / out[3];
+  verts[5] = out[2] / out[3];
+
+  // This is the upper right corner
+  in[0] = (float)(imageOrigin[0]+imageInUseSize[0]) /
+    imageViewportSize[0] * 2.0 - 1.0;
+  in[1] = (float)(imageOrigin[1]+imageInUseSize[1]) /
+    imageViewportSize[1] * 2.0 - 1.0;
+
+  viewToWorldMatrix->MultiplyPoint( in, out );
+  verts[6] = out[0] / out[3];
+  verts[7] = out[1] / out[3];
+  verts[8] = out[2] / out[3];
+
+  // This is the upper left corner
+  in[0] = (float)imageOrigin[0]/imageViewportSize[0] * 2.0 - 1.0;
+  in[1] = (float)(imageOrigin[1]+imageInUseSize[1]) /
+    imageViewportSize[1] * 2.0 - 1.0;
+
+  viewToWorldMatrix->MultiplyPoint( in, out );
+  verts[9]  = out[0] / out[3];
+  verts[10] = out[1] / out[3];
+  verts[11] = out[2] / out[3];
+
+  viewToWorldMatrix->Delete();
+
+  // We still need these
+  vtkOpenGLRayCastImageDisplayHelperRAII glState(this->PixelScale);
+
+  if ( this->PreMultipliedColors )
+    {
+    // Values in the texture map have already been pre-multiplied by alpha
+    this->Texture->SetPremultipliedAlpha(true);
+    }
+  else
+    {
+    // Values in the texture map have not been pre-multiplied by alpha
+    this->Texture->SetPremultipliedAlpha(false);
     }
 
   // Don't write into the Zbuffer - just use it for comparisons
@@ -171,10 +342,234 @@ void vtkOpenGLRayCastImageDisplayHelper::RenderTextureInternal( vtkVolume *vol,
       VTK_UNSIGNED_SHORT, static_cast<unsigned short *>(image));
     }
 
+#if 0
+  // NOTE: For now assume that we can fit the entire texture in memory
+
+  // if it does, we will render it later. define the texture here
+  if ( params[0] != 0 )
+    {
+    if ( imageScalarType == VTK_UNSIGNED_CHAR )
+      {
+      glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA8,
+                    imageMemorySize[0], imageMemorySize[1],
+                    0, GL_RGBA, GL_UNSIGNED_BYTE,
+                    static_cast<unsigned char *>(image) );
+      }
+    else
+      {
+      glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA8,
+                    imageMemorySize[0], imageMemorySize[1],
+                    0, GL_RGBA, GL_UNSIGNED_SHORT,
+                    static_cast<unsigned short *>(image) );
+      }
+    }
+  // if it doesn't, we are going to break it up now and render it.
+  else
+    {
+    // Figure out our new texture size. Keep dividing the big one in half until
+    // OpenGL says this texture is OK
+    newTextureSize[0] = imageMemorySize[0];
+    newTextureSize[1] = imageMemorySize[1];
+
+    while ( params[0] == 0 && newTextureSize[0] >= 32 &&
+            newTextureSize[1] >= 32 )
+      {
+      if ( newTextureSize[0] > newTextureSize[1] )
+        {
+        newTextureSize[0] /= 2;
+        }
+      else
+        {
+        newTextureSize[1] /= 2;
+        }
+
+      if ( imageScalarType == VTK_UNSIGNED_CHAR )
+        {
+        glTexImage2D( GL_PROXY_TEXTURE_2D, 0, GL_RGBA8,
+                      newTextureSize[0], newTextureSize[1],
+                      0, GL_RGBA, GL_UNSIGNED_BYTE,
+                      static_cast<unsigned char *>(image) );
+        }
+      else
+        {
+        glTexImage2D( GL_PROXY_TEXTURE_2D, 0, GL_RGBA8,
+                      newTextureSize[0], newTextureSize[1],
+                      0, GL_RGBA, GL_UNSIGNED_SHORT,
+                      static_cast<unsigned short *>(image) );
+        }
+      glGetTexLevelParameteriv ( GL_PROXY_TEXTURE_2D, 0,
+                                 GL_TEXTURE_WIDTH, params );
+      }
+
+    // If we got down to 32 by 32 and OpenGL still doesn't like it, something
+    // must be seriously wrong and we will ignore it. Otherwise, we have our
+    // new texture size and let's start chopping up the image
+    if ( newTextureSize[0] >= 32 && newTextureSize[1] >= 32 )
+      {
+      // How many tiles in x?
+      int xLimit = 1 + static_cast<int>(
+        static_cast<float>(imageInUseSize[0]) /
+        static_cast<float>((newTextureSize[0]-2)));
+
+      // How many tiles in y?
+      int yLimit = 1 + static_cast<int>(
+        static_cast<float>(imageInUseSize[1]) /
+        static_cast<float>((newTextureSize[1]-2)));
+
+      // Create memory for the new texture
+      unsigned char  *newTextureChar  = NULL;
+      unsigned short *newTextureShort = NULL;
+
+      if ( imageScalarType == VTK_UNSIGNED_CHAR )
+        {
+        newTextureChar =
+          new unsigned char [newTextureSize[0] * newTextureSize[1] * 4];
+        }
+      else
+        {
+        newTextureShort =
+          new unsigned short [newTextureSize[0] * newTextureSize[1] * 4];
+        }
+
+
+      // This is the 1/2 pixel offset for texture coordinates
+      offsetX = .5 / static_cast<float>(newTextureSize[0]);
+      offsetY = .5 / static_cast<float>(newTextureSize[1]);
+
+      int ii, jj;
+      float newVerts[12];
+      float vx1, vx2, vy1, vy2;
+      int px1, py1, pxSize, pySize;
+
+
+      // loop through the tiles in y
+      for ( jj = 0; jj < yLimit; jj++ )
+        {
+        vy1 = static_cast<float>(jj) / static_cast<float>(yLimit);
+        vy2 = static_cast<float>(jj+1) / static_cast<float>(yLimit);
+
+        py1 = static_cast<int>(vy1 * static_cast<float>(
+                                 imageInUseSize[1]));
+        pySize = static_cast<int>(2 - py1 + vy2 * static_cast<float>(
+                                    imageInUseSize[1]-1));
+        if ( py1 + pySize > imageInUseSize[1] )
+          {
+          pySize = imageInUseSize[1] - py1;
+          }
+
+        yMinOffset = 2.0 * offsetY *
+          (vy1*static_cast<float>(imageInUseSize[1]-1)-static_cast<float>(py1));
+
+        yMaxOffset = 2.0 * offsetY *
+          (static_cast<float>(py1+pySize-1)-vy2*static_cast<float>(imageInUseSize[1]-1));
+
+        // loop through the tiles in x
+        for ( ii = 0; ii < xLimit; ii++ )
+          {
+          vx1 = static_cast<float>(ii) / static_cast<float>(xLimit);
+          vx2 = static_cast<float>(ii+1) / static_cast<float>(xLimit);
+
+          px1 = static_cast<int>(vx1 * static_cast<float>(
+                                   imageInUseSize[0]));
+          pxSize = static_cast<int>(2 - px1 + vx2 * static_cast<float>(
+                                      imageInUseSize[0]-1));
+          if ( px1 + pxSize > imageInUseSize[0] )
+            {
+            pxSize = imageInUseSize[0] - px1;
+            }
+
+          xMinOffset = 2.0 * offsetX *
+            (vx1*static_cast<float>(imageInUseSize[0]-1) -
+             static_cast<float>(px1));
+
+          xMaxOffset = 2.0 * offsetX *
+            (static_cast<float>(px1+pxSize-1) -
+             vx2*static_cast<float>(imageInUseSize[0]-1));
+
+          if ( px1 + pxSize > imageInUseSize[0] )
+            {
+            pxSize = imageInUseSize[0] - px1;
+            }
+
+          // copy subtexture of image into newTexture
+          int loop;
+          for ( loop = 0; loop < pySize; loop++ )
+            {
+            if ( imageScalarType == VTK_UNSIGNED_CHAR )
+              {
+              memcpy( newTextureChar + 4*loop*newTextureSize[0],
+                      static_cast<unsigned char *>(image) +
+                      4*(py1+loop)*imageMemorySize[0] + 4*px1,
+                      pxSize * sizeof(unsigned char) * 4 );
+              }
+            else
+              {
+              memcpy( newTextureShort + 4*loop*newTextureSize[0],
+                      static_cast<unsigned short *>(image) +
+                      4*(py1+loop)*imageMemorySize[0] + 4*px1,
+                      pxSize * sizeof(unsigned short) * 4 );
+              }
+            }
+
+          newVerts[ 0] = verts[0] + vx1*(verts[3]-verts[0]) + vy1*(verts[ 9]-verts[0]);
+          newVerts[ 1] = verts[1] + vx1*(verts[4]-verts[1]) + vy1*(verts[10]-verts[1]);
+          newVerts[ 2] = verts[2] + vx1*(verts[5]-verts[2]) + vy1*(verts[11]-verts[2]);
+
+          newVerts[ 3] = verts[0] + vx2*(verts[3]-verts[0]) + vy1*(verts[ 9]-verts[0]);
+          newVerts[ 4] = verts[1] + vx2*(verts[4]-verts[1]) + vy1*(verts[10]-verts[1]);
+          newVerts[ 5] = verts[2] + vx2*(verts[5]-verts[2]) + vy1*(verts[11]-verts[2]);
+
+          newVerts[ 6] = verts[0] + vx2*(verts[3]-verts[0]) + vy2*(verts[ 9]-verts[0]);
+          newVerts[ 7] = verts[1] + vx2*(verts[4]-verts[1]) + vy2*(verts[10]-verts[1]);
+          newVerts[ 8] = verts[2] + vx2*(verts[5]-verts[2]) + vy2*(verts[11]-verts[2]);
+
+          newVerts[ 9] = verts[0] + vx1*(verts[3]-verts[0]) + vy2*(verts[ 9]-verts[0]);
+          newVerts[10] = verts[1] + vx1*(verts[4]-verts[1]) + vy2*(verts[10]-verts[1]);
+          newVerts[11] = verts[2] + vx1*(verts[5]-verts[2]) + vy2*(verts[11]-verts[2]);
+
+          tcoords[0]  = offsetX + xMinOffset;
+          tcoords[1]  = offsetY + yMinOffset;
+          tcoords[2]  = (float)pxSize/(float)newTextureSize[0] - offsetX - xMaxOffset;
+          tcoords[3]  = offsetY + yMinOffset;
+          tcoords[4]  = (float)pxSize/(float)newTextureSize[0] - offsetX - xMaxOffset;
+          tcoords[5]  = (float)pySize/(float)newTextureSize[1] - offsetY - yMaxOffset;
+          tcoords[6]  = offsetX + xMaxOffset;
+          tcoords[7]  = (float)pySize/(float)newTextureSize[1] - offsetY - yMaxOffset;
+
+          if ( imageScalarType == VTK_UNSIGNED_CHAR )
+            {
+            glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA8,
+                          newTextureSize[0], newTextureSize[1],
+                          0, GL_RGBA, GL_UNSIGNED_BYTE, newTextureChar );
+            }
+          else
+            {
+            glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA8,
+                          newTextureSize[0], newTextureSize[1],
+                          0, GL_RGBA, GL_UNSIGNED_SHORT, newTextureShort );
+            }
+
+          polydata->Modified();
+          this->TextureActor->RenderTranslucentPolygonalGeometry(ren);
+          }
+        }
+
+      // Delete the memory we created
+      delete [] newTextureChar;
+      delete [] newTextureShort;
+      }
+
+    // Restore state
+    glPopAttrib();
+
+    vtkOpenGLCheckErrorMacro("failed after RenderTextureInternal");
+    return;
+    }
+#endif
+
   offsetX = .5 / static_cast<float>(imageMemorySize[0]);
   offsetY = .5 / static_cast<float>(imageMemorySize[1]);
 
-  float tcoords[8];
   tcoords[0]  = 0.0 + offsetX;
   tcoords[1]  = 0.0 + offsetY;
   tcoords[2]  =
@@ -188,73 +583,9 @@ void vtkOpenGLRayCastImageDisplayHelper::RenderTextureInternal( vtkVolume *vol,
   tcoords[7]  =
     (float)imageInUseSize[1]/(float)imageMemorySize[1] - offsetY;
 
-  float verts[12] = {
-    2.0f*imageOrigin[0]/imageViewportSize[0] - 1.0f,
-    2.0f*imageOrigin[1]/imageViewportSize[1] - 1.0f, depth,
-    2.0f*(imageOrigin[0]+imageInUseSize[0]) /
-    imageViewportSize[0] - 1.0f,
-    2.0f*imageOrigin[1]/imageViewportSize[1] - 1.0f, depth,
-    2.0f*(imageOrigin[0]+imageInUseSize[0]) /
-    imageViewportSize[0] - 1.0f,
-    2.0f*(imageOrigin[1]+imageInUseSize[1]) /
-    imageViewportSize[1] - 1.0f, depth,
-    2.0f*imageOrigin[0]/imageViewportSize[0] - 1.0f,
-    2.0f*(imageOrigin[1]+imageInUseSize[1]) /
-    imageViewportSize[1] - 1.0f, depth};
-
-  if (!this->ShaderProgram)
-    {
-    this->ShaderProgram = new vtkOpenGLHelper;
-
-    // build the shader source code
-    std::string VSSource = vtkTextureObjectVS;
-    std::string FSSource =
-      "//VTK::System::Dec\n"
-      "//VTK::Output::Dec\n"
-      "varying vec2 tcoordVC;\n"
-      "uniform sampler2D source;\n"
-      "uniform float scale;\n"
-      "void main(void)\n"
-      "{\n"
-      "  gl_FragData[0] = texture2D(source,tcoordVC)*scale;\n"
-      "}\n";
-    std::string GSSource;
-
-    // compile and bind it if needed
-    vtkShaderProgram *newShader =
-      ctx->GetShaderCache()->ReadyShaderProgram(VSSource.c_str(),
-                                         FSSource.c_str(),
-                                         GSSource.c_str());
-
-    // if the shader changed reinitialize the VAO
-    if (newShader != this->ShaderProgram->Program)
-      {
-      this->ShaderProgram->Program = newShader;
-      this->ShaderProgram->VAO->ShaderProgramChanged(); // reset the VAO as the shader has changed
-      }
-
-    this->ShaderProgram->ShaderSourceTime.Modified();
-    }
-  else
-    {
-    ctx->GetShaderCache()->ReadyShaderProgram(this->ShaderProgram->Program);
-    }
-
-  glEnable(GL_BLEND);
-  if (this->PreMultipliedColors)
-    {
-    // make the blend function correct for textures premultiplied by alpha.
-    glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
-    }
-
-  // bind and activate this texture
-  this->TextureObject->Activate();
-  int sourceId = this->TextureObject->GetTextureUnit();
-  this->ShaderProgram->Program->SetUniformi("source",sourceId);
-  this->ShaderProgram->Program->SetUniformf("scale",this->PixelScale);
-  vtkOpenGLRenderUtilities::RenderQuad(verts, tcoords, this->ShaderProgram->Program,
-    this->ShaderProgram->VAO);
-  this->TextureObject->Deactivate();
+  // Render the polygon
+  polydata->Modified();
+  this->TextureActor->RenderTranslucentPolygonalGeometry(ren);
 
   vtkOpenGLCheckErrorMacro("failed after RenderTextureInternal");
 }
@@ -268,11 +599,11 @@ void vtkOpenGLRayCastImageDisplayHelper::PrintSelf(ostream& os, vtkIndent indent
 //----------------------------------------------------------------------------
 void vtkOpenGLRayCastImageDisplayHelper::ReleaseGraphicsResources(vtkWindow *win)
 {
-  this->TextureObject->ReleaseGraphicsResources(win);
-  if (this->ShaderProgram)
+  if (win && this->TextureActor)
     {
-    this->ShaderProgram->ReleaseGraphicsResources(win);
-    delete this->ShaderProgram;
-    this->ShaderProgram = NULL;
+    // We only need to free up resources on the texture actor
+    // as it will release the resources on the texture and ultimately
+    // the texture object.
+    this->TextureActor->ReleaseGraphicsResources(win);
     }
 }
diff --git a/Rendering/VolumeOpenGL2/vtkOpenGLRayCastImageDisplayHelper.h b/Rendering/VolumeOpenGL2/vtkOpenGLRayCastImageDisplayHelper.h
index 4b2f574..3ff96c4 100644
--- a/Rendering/VolumeOpenGL2/vtkOpenGLRayCastImageDisplayHelper.h
+++ b/Rendering/VolumeOpenGL2/vtkOpenGLRayCastImageDisplayHelper.h
@@ -27,12 +27,13 @@
 #include "vtkRenderingVolumeOpenGL2Module.h" // For export macro
 #include "vtkRayCastImageDisplayHelper.h"
 
+class vtkActor;
 class vtkFixedPointRayCastImage;
-class vtkOpenGLHelper;
+class vtkOpenGLTexture;
 class vtkRenderer;
-class vtkTextureObject;
 class vtkVolume;
 class vtkWindow;
+class vtkTextureObject;
 
 class VTKRENDERINGVOLUMEOPENGL2_EXPORT vtkOpenGLRayCastImageDisplayHelper
   : public vtkRayCastImageDisplayHelper
@@ -77,11 +78,9 @@ protected:
                               int imageScalarType,
                               void *image );
 
-  // used for copying to framebuffer
+  vtkActor *TextureActor;
+  vtkOpenGLTexture* Texture;
   vtkTextureObject *TextureObject;
-  vtkOpenGLHelper *ShaderProgram;
-
-
 
 private:
   vtkOpenGLRayCastImageDisplayHelper(const vtkOpenGLRayCastImageDisplayHelper&);  // Not implemented.
diff --git a/Rendering/VolumeOpenGL2/vtkOpenGLVolumeGradientOpacityTable.h b/Rendering/VolumeOpenGL2/vtkOpenGLVolumeGradientOpacityTable.h
index 965e5bc..8ccca5a 100644
--- a/Rendering/VolumeOpenGL2/vtkOpenGLVolumeGradientOpacityTable.h
+++ b/Rendering/VolumeOpenGL2/vtkOpenGLVolumeGradientOpacityTable.h
@@ -46,12 +46,16 @@ public:
         this->TextureObject = 0;
         }
 
-      delete[] this->Table;
+      if (this->Table)
+        {
+        delete[] this->Table;
+        this->Table=0;
+        }
     }
 
-  // activate texture.
+  // Bind texture.
   //--------------------------------------------------------------------------
-  void Activate()
+  void Bind()
     {
     if (!this->TextureObject)
       {
@@ -60,15 +64,6 @@ public:
     this->TextureObject->Activate();
     }
 
-  void Deactivate()
-    {
-    if (!this->TextureObject)
-      {
-      return;
-      }
-    this->TextureObject->Deactivate();
-    }
-
   // Update opacity tranfer function texture.
   //--------------------------------------------------------------------------
   void Update(vtkPiecewiseFunction* gradientOpacity,
@@ -114,6 +109,7 @@ public:
                                               VTK_FLOAT,
                                               this->Table);
 
+      this->TextureObject->Activate();
       this->TextureObject->SetWrapS(vtkTextureObject::ClampToEdge);
       this->TextureObject->SetMagnificationFilter(filterValue);
       this->TextureObject->SetMinificationFilter(filterValue);
diff --git a/Rendering/VolumeOpenGL2/vtkOpenGLVolumeOpacityTable.h b/Rendering/VolumeOpenGL2/vtkOpenGLVolumeOpacityTable.h
index 5b2e699..6ddee19 100644
--- a/Rendering/VolumeOpenGL2/vtkOpenGLVolumeOpacityTable.h
+++ b/Rendering/VolumeOpenGL2/vtkOpenGLVolumeOpacityTable.h
@@ -47,12 +47,16 @@ public:
         this->TextureObject = 0;
         }
 
-      delete[] this->Table;
+      if (this->Table)
+        {
+        delete[] this->Table;
+        this->Table=0;
+        }
     }
 
-  // Activate texture.
+  // Bind texture.
   //--------------------------------------------------------------------------
-  void Activate()
+  void Bind()
     {
     if (!this->TextureObject)
       {
@@ -61,17 +65,6 @@ public:
     this->TextureObject->Activate();
     }
 
-  // Deactivate texture.
-  //--------------------------------------------------------------------------
-  void Deactivate()
-    {
-    if (!this->TextureObject)
-      {
-      return;
-      }
-    this->TextureObject->Deactivate();
-    }
-
   // Update opacity tranfer function texture.
   //--------------------------------------------------------------------------
   void Update(vtkPiecewiseFunction* scalarOpacity,
@@ -161,6 +154,7 @@ public:
                                               VTK_FLOAT,
                                               this->Table);
       this->LastInterpolation = filterValue;
+      this->TextureObject->Activate();
       this->BuildTime.Modified();
       }
 
diff --git a/Rendering/VolumeOpenGL2/vtkOpenGLVolumeRGBTable.h b/Rendering/VolumeOpenGL2/vtkOpenGLVolumeRGBTable.h
index 2d0b80e..14e7894 100644
--- a/Rendering/VolumeOpenGL2/vtkOpenGLVolumeRGBTable.h
+++ b/Rendering/VolumeOpenGL2/vtkOpenGLVolumeRGBTable.h
@@ -43,29 +43,22 @@ public:
       this->TextureObject->Delete();
       this->TextureObject = 0;
       }
-    delete[] this->Table;
-    }
-
-  // Activate texture.
-  //--------------------------------------------------------------------------
-  void Activate()
-    {
-    if (!this->TextureObject)
+    if(this->Table)
       {
-      return;
+      delete[] this->Table;
+      this->Table=0;
       }
-    this->TextureObject->Activate();
     }
 
-  // Deactivate texture.
+  // Bind texture.
   //--------------------------------------------------------------------------
-  void Deactivate()
+  void Bind(void)
     {
     if (!this->TextureObject)
       {
       return;
       }
-    this->TextureObject->Deactivate();
+    this->TextureObject->Activate();
     }
 
   // Update color transfer function texture.
@@ -112,6 +105,7 @@ public:
                                            VTK_FLOAT,
                                            this->Table);
       this->LastInterpolation = filterValue;
+      this->TextureObject->Activate();
       this->BuildTime.Modified();
       }
 
diff --git a/Rendering/VolumeOpenGL2/vtkSmartVolumeMapper.cxx b/Rendering/VolumeOpenGL2/vtkSmartVolumeMapper.cxx
index 47f15b0..edc1a28 100644
--- a/Rendering/VolumeOpenGL2/vtkSmartVolumeMapper.cxx
+++ b/Rendering/VolumeOpenGL2/vtkSmartVolumeMapper.cxx
@@ -52,18 +52,6 @@ vtkSmartVolumeMapper::vtkSmartVolumeMapper()
   this->LowResGPUNecessary = 0;
   this->InterpolationMode=VTK_RESLICE_CUBIC;
 
-  // If the render window has a desired update greater than or equal to the
-  // interactive update rate, we apply certain optimizations to ensure that the
-  // rendering is interactive.
-  this->InteractiveUpdateRate = 1.0;
-  // Enable checking whether the render is interactive and use the appropriate
-  // sample distance for rendering
-  this->InteractiveAdjustSampleDistances = 1;
-
-  // Initial sample distance
-  this->AutoAdjustSampleDistances  = 1;
-  this->SampleDistance             = -1.0;
-
   // Create all the mappers we might need
   this->RayCastMapper   = vtkFixedPointVolumeRayCastMapper::New();
 
@@ -73,6 +61,10 @@ vtkSmartVolumeMapper::vtkSmartVolumeMapper()
 
   this->GPULowResMapper = vtkGPUVolumeRayCastMapper::New();
 
+  // If the render window has a desired update rate of at least 1 frame
+  // per second or more, we'll consider this interactive
+  this->InteractiveUpdateRate = 1.0;
+
   // This is the resample filter that may be used if we need
   // a lower resolution version of the input for GPU rendering
   this->GPUResampleFilter = vtkImageResample::New();
@@ -169,17 +161,6 @@ void vtkSmartVolumeMapper::Render( vtkRenderer *ren, vtkVolume *vol )
   switch ( this->CurrentRenderMode )
     {
     case vtkSmartVolumeMapper::RayCastRenderMode:
-      if (this->InteractiveAdjustSampleDistances)
-        {
-        this->RayCastMapper->SetAutoAdjustSampleDistances(
-          ren->GetRenderWindow()->GetDesiredUpdateRate()>=
-          this->InteractiveUpdateRate);
-        }
-      else
-        {
-        this->RayCastMapper->SetAutoAdjustSampleDistances(
-                              this->AutoAdjustSampleDistances);
-        }
       this->RayCastMapper->Render(ren,vol);
       break;
     case vtkSmartVolumeMapper::GPURenderMode:
@@ -191,17 +172,9 @@ void vtkSmartVolumeMapper::Render( vtkRenderer *ren, vtkVolume *vol )
         {
         usedMapper=this->GPUMapper;
         }
-      if (this->InteractiveAdjustSampleDistances)
-        {
-        usedMapper->SetAutoAdjustSampleDistances(
-          ren->GetRenderWindow()->GetDesiredUpdateRate()>=
-          this->InteractiveUpdateRate);
-        }
-      else
-        {
-        usedMapper->SetAutoAdjustSampleDistances(
-                      this->AutoAdjustSampleDistances);
-        }
+      usedMapper->SetAutoAdjustSampleDistances(
+        ren->GetRenderWindow()->GetDesiredUpdateRate()>=
+        this->InteractiveUpdateRate);
       usedMapper->Render(ren, vol);
       break;
     case vtkSmartVolumeMapper::InvalidRenderMode:
@@ -315,15 +288,6 @@ void vtkSmartVolumeMapper::ComputeRenderMode(vtkRenderer *ren, vtkVolume *vol)
   double spacing[3];
   this->GetInput()->GetSpacing(spacing);
 
-  // Compute the sample distance based on dataset spacing.
-  // It is assumed that a negative SampleDistance means the user would like to
-  // compute volume mapper sample distance based on data spacing.
-  if (this->SampleDistance < 0)
-    {
-    this->SampleDistance =
-      static_cast<float>((spacing[0] + spacing[1] + spacing[2]) / 6.0);
-    }
-
   vtkRenderWindow *win=ren->GetRenderWindow();
 
   switch ( this->RequestedRenderMode )
@@ -389,7 +353,6 @@ void vtkSmartVolumeMapper::ComputeRenderMode(vtkRenderer *ren, vtkVolume *vol)
       this->RayCastMapper->SetBlendMode( this->GetBlendMode() );
       this->RayCastMapper->SetFinalColorWindow(this->FinalColorWindow);
       this->RayCastMapper->SetFinalColorLevel(this->FinalColorLevel);
-      this->RayCastMapper->SetSampleDistance(this->SampleDistance);
       break;
 
     // We are rendering with the vtkGPUVolumeRayCastMapper
@@ -405,6 +368,8 @@ void vtkSmartVolumeMapper::ComputeRenderMode(vtkRenderer *ren, vtkVolume *vol)
       this->GPUMapper->SetScalarMode(this->GetScalarMode());
       this->GPUMapper->SetMaxMemoryInBytes(this->MaxMemoryInBytes);
       this->GPUMapper->SetMaxMemoryFraction(this->MaxMemoryFraction);
+      this->GPUMapper->SetSampleDistance(
+        static_cast<float>((spacing[0] + spacing[1] + spacing[2] ) / 6.0) );
       this->ConnectMapperInput(this->GPUMapper);
       this->GPUMapper->SetClippingPlanes(this->GetClippingPlanes());
       this->GPUMapper->SetCropping(this->GetCropping());
@@ -415,7 +380,6 @@ void vtkSmartVolumeMapper::ComputeRenderMode(vtkRenderer *ren, vtkVolume *vol)
       this->GPUMapper->SetBlendMode( this->GetBlendMode() );
       this->GPUMapper->SetFinalColorWindow(this->FinalColorWindow);
       this->GPUMapper->SetFinalColorLevel(this->FinalColorLevel);
-      this->GPUMapper->SetSampleDistance(this->SampleDistance);
 
       // Make the window current because we need the OpenGL context
       win->MakeCurrent();
@@ -438,6 +402,8 @@ void vtkSmartVolumeMapper::ComputeRenderMode(vtkRenderer *ren, vtkVolume *vol)
 
         this->GPULowResMapper->SetMaxMemoryInBytes(this->MaxMemoryInBytes);
         this->GPULowResMapper->SetMaxMemoryFraction(this->MaxMemoryFraction);
+        this->GPULowResMapper->SetSampleDistance(
+        static_cast<float>((spacing[0] + spacing[1] + spacing[2] ) / 6.0) );
 
         this->GPULowResMapper->SetInputConnection(
           this->GPUResampleFilter->GetOutputPort());
@@ -450,7 +416,6 @@ void vtkSmartVolumeMapper::ComputeRenderMode(vtkRenderer *ren, vtkVolume *vol)
         this->GPULowResMapper->SetBlendMode( this->GetBlendMode() );
         this->GPULowResMapper->SetFinalColorWindow(this->FinalColorWindow);
         this->GPULowResMapper->SetFinalColorLevel(this->FinalColorLevel);
-        this->GPULowResMapper->SetSampleDistance(this->SampleDistance);
         }
       else
         {
@@ -567,12 +532,6 @@ void vtkSmartVolumeMapper::SetRequestedRenderModeToRayCast()
 }
 
 // ----------------------------------------------------------------------------
-void vtkSmartVolumeMapper::SetRequestedRenderModeToGPU()
-{
-  this->SetRequestedRenderMode(vtkSmartVolumeMapper::GPURenderMode);
-}
-
-// ----------------------------------------------------------------------------
 void vtkSmartVolumeMapper::ReleaseGraphicsResources(vtkWindow *w)
 {
   this->RayCastMapper->ReleaseGraphicsResources(w);
@@ -656,12 +615,7 @@ void vtkSmartVolumeMapper::PrintSelf(ostream& os, vtkIndent indent)
   os << "FinalColorLevel: " << this->FinalColorLevel << endl;
   os << "RequestedRenderMode: " << this->RequestedRenderMode << endl;
   os << "InteractiveUpdateRate: " << this->InteractiveUpdateRate << endl;
-  os << "InteractiveAdjustSampleDistances: " <<
-    this->InteractiveAdjustSampleDistances << endl;
   os << "InterpolationMode: " << this->InterpolationMode << endl;
   os << "MaxMemoryInBytes:" << this->MaxMemoryInBytes << endl;
   os << "MaxMemoryFraction:" << this->MaxMemoryFraction << endl;
-  os << "AutoAdjustSampleDistances: "
-     << this->AutoAdjustSampleDistances << endl;
-  os << indent << "SampleDistance: " << this->SampleDistance << endl;
 }
diff --git a/Rendering/VolumeOpenGL2/vtkSmartVolumeMapper.h b/Rendering/VolumeOpenGL2/vtkSmartVolumeMapper.h
index 868dea2..5f4666b 100644
--- a/Rendering/VolumeOpenGL2/vtkSmartVolumeMapper.h
+++ b/Rendering/VolumeOpenGL2/vtkSmartVolumeMapper.h
@@ -146,16 +146,24 @@ public:
   void SetRequestedRenderModeToRayCast();
 
   // Description:
-  // Set the requested render mode to vtkSmartVolumeMapper::GPURenderMode.
-  // This option will use hardware accelerated rendering exclusively. This is a
-  // good option if you know there is hardware acceleration.
-  void SetRequestedRenderModeToGPU();
-
-  // Description:
   // Get the requested render mode.
   vtkGetMacro( RequestedRenderMode, int );
 
   // Description:
+  // Set the rate at or above this render will be considered interactive.
+  // If the DesiredUpdateRate of the vtkRenderWindow that caused the Render
+  // falls at or above this rate, the render is considered interactive and
+  // the mapper may be adjusted (depending on the render mode).
+  // Initial value is 1.0.
+  vtkSetClampMacro( InteractiveUpdateRate, double, 1.0e-10, 1.0e10 );
+
+  // Description:
+  // Get the update rate at or above which this is considered an
+  // interactive render.
+  // Initial value is 1.0.
+  vtkGetMacro( InteractiveUpdateRate, double );
+
+  // Description:
   // This will return the render mode used during the previous call to
   // Render().
   int GetLastUsedRenderMode();
@@ -199,51 +207,6 @@ public:
                             double viewDirection[3],
                             double viewUp[3] );
 
-  // Description:
-  // If the DesiredUpdateRate of the vtkRenderWindow that caused the Render
-  // falls at or above this rate, the render is considered interactive and
-  // the mapper may be adjusted (depending on the render mode).
-  // Initial value is 1.0.
-  vtkSetClampMacro( InteractiveUpdateRate, double, 1.0e-10, 1.0e10 );
-
-  // Description:
-  // Get the update rate at or above which this is considered an
-  // interactive render.
-  // Initial value is 1.0.
-  vtkGetMacro( InteractiveUpdateRate, double );
-
-  // Description:
-  // If the InteractiveAdjustSampleDistances flag is enabled,
-  // vtkSmartVolumeMapper interactively sets and resets the
-  // AutoAdjustSampleDistances flag on the internal volume mapper. This flag
-  // along with InteractiveUpdateRate is useful to adjust volume mapper sample
-  // distance based on whether the render is interactive or still.
-  // By default, InteractiveAdjustSampleDistances is enabled.
-  vtkSetClampMacro( InteractiveAdjustSampleDistances, int, 0, 1);
-  vtkGetMacro( InteractiveAdjustSampleDistances, int);
-  vtkBooleanMacro( InteractiveAdjustSampleDistances, int);
-
-  // Description:
-  // If AutoAdjustSampleDistances is on, the ImageSampleDistance
-  // will be varied to achieve the allocated render time of this
-  // prop (controlled by the desired update rate and any culling in
-  // use).
-  // Note that, this flag is ignored when InteractiveAdjustSampleDistances is
-  // enabled. To explicitly set and use this flag, one must disable
-  // InteractiveAdjustSampleDistances.
-  vtkSetClampMacro( AutoAdjustSampleDistances, int, 0, 1 );
-  vtkGetMacro( AutoAdjustSampleDistances, int );
-  vtkBooleanMacro( AutoAdjustSampleDistances, int );
-
-  // Description:
-  // Set/Get the distance between samples used for rendering
-  // when AutoAdjustSampleDistances is off, or when this mapper
-  // has more than 1 second allocated to it for rendering.
-  // If SampleDistance is negative, it will be computed based on the dataset
-  // spacing. Initial value is -1.0.
-  vtkSetMacro( SampleDistance, float );
-  vtkGetMacro( SampleDistance, float );
-
 
 //BTX
   // Description:
@@ -303,6 +266,11 @@ protected:
   // create a low resolution version of the volume for GPU rendering
   vtkImageResample *GPUResampleFilter;
 
+  // If the DesiredUpdateRate of the vtkRenderWindow causing the Render is at
+  // or above this value, the render is considered interactive. Otherwise it is
+  // considered still.
+  double InteractiveUpdateRate;
+
   // The initialize method. Called from ComputeRenderMode whenever something
   // relevant has changed.
   void  Initialize(vtkRenderer *ren,
@@ -324,25 +292,6 @@ protected:
   // it changes
   int  InitializedBlendMode;
 
-  // The distance between sample points along the ray
-  float  SampleDistance;
-
-  // Set whether or not the sample distance should be automatically calculated
-  // within the internal volume mapper
-  int    AutoAdjustSampleDistances;
-
-  // If the DesiredUpdateRate of the vtkRenderWindow causing the Render is at
-  // or above this value, the render is considered interactive. Otherwise it is
-  // considered still.
-  double InteractiveUpdateRate;
-
-  // If the InteractiveAdjustSampleDistances flag is enabled,
-  // vtkSmartVolumeMapper interactively sets and resets the
-  // AutoAdjustSampleDistances flag on the internal volume mapper. This flag
-  // along with InteractiveUpdateRate is useful to adjust volume mapper sample
-  // distance based on whether the render is interactive or still.
-  int InteractiveAdjustSampleDistances;
-
 private:
   vtkSmartVolumeMapper(const vtkSmartVolumeMapper&);  // Not implemented.
   void operator=(const vtkSmartVolumeMapper&);  // Not implemented.
diff --git a/Rendering/VolumeOpenGL2/vtkVolumeMask.h b/Rendering/VolumeOpenGL2/vtkVolumeMask.h
index c7bdc54..3d5e196 100644
--- a/Rendering/VolumeOpenGL2/vtkVolumeMask.h
+++ b/Rendering/VolumeOpenGL2/vtkVolumeMask.h
@@ -59,18 +59,12 @@ public:
     }
 
   //--------------------------------------------------------------------------
-  void Activate()
+  void Bind()
     {
     this->Texture->Activate();
     }
 
   //--------------------------------------------------------------------------
-  void Deactivate()
-    {
-    this->Texture->Deactivate();
-    }
-
-  //--------------------------------------------------------------------------
   void Update(vtkRenderer* ren,
               vtkImageData *input,
               int cellFlag,
@@ -136,8 +130,8 @@ public:
           cout << "Mask should be a one-component scalar field." << endl;
           }
 
-        GLint internalFormat = GL_R8;
-        GLenum format = GL_RED;
+        GLint internalFormat = GL_ALPHA8;
+        GLenum format = GL_ALPHA;
         GLenum type = GL_UNSIGNED_BYTE;
 
         // Enough memory?
@@ -185,6 +179,7 @@ public:
             this->Texture->Create3DFromRaw(
               textureSize[0], textureSize[1], textureSize[2],
               1, scalarType, dataPtr);
+            this->Texture->Activate();
             this->Texture->SetWrapS(vtkTextureObject::ClampToEdge);
             this->Texture->SetWrapT(vtkTextureObject::ClampToEdge);
             this->Texture->SetWrapR(vtkTextureObject::ClampToEdge);
diff --git a/Rendering/VolumeOpenGL2/vtkVolumeShaderComposer.h b/Rendering/VolumeOpenGL2/vtkVolumeShaderComposer.h
index 20c6c11..2c1c902 100644
--- a/Rendering/VolumeOpenGL2/vtkVolumeShaderComposer.h
+++ b/Rendering/VolumeOpenGL2/vtkVolumeShaderComposer.h
@@ -25,7 +25,6 @@
 #include <vtkVolumeProperty.h>
 
 #include <map>
-#include <sstream>
 #include <string>
 
 namespace vtkvolume
@@ -34,11 +33,6 @@ namespace vtkvolume
   std::string replace(std::string source, const std::string &search,
                       const std::string replace, bool all)
     {
-    if (replace.empty())
-      {
-      return source;
-      }
-
     std::string::size_type pos = 0;
     bool first = true;
     while ((pos = source.find(search, 0)) != std::string::npos)
@@ -58,9 +52,9 @@ namespace vtkvolume
     }
 
   //--------------------------------------------------------------------------
-  std::string ComputeClipPositionImplementation(vtkRenderer* vtkNotUsed(ren),
-                                                vtkVolumeMapper* vtkNotUsed(mapper),
-                                                vtkVolume* vtkNotUsed(vol))
+  std::string ComputeClip(vtkRenderer* vtkNotUsed(ren),
+                          vtkVolumeMapper* vtkNotUsed(mapper),
+                          vtkVolume* vtkNotUsed(vol))
     {
     return std::string("\
       \n  vec4 pos = in_projectionMatrix * in_modelViewMatrix *\
@@ -70,9 +64,9 @@ namespace vtkvolume
     }
 
   //--------------------------------------------------------------------------
-  std::string ComputeTextureCoordinates(vtkRenderer* vtkNotUsed(ren),
-                                        vtkVolumeMapper* vtkNotUsed(mapper),
-                                        vtkVolume* vtkNotUsed(vol))
+  std::string ComputeTextureCoords(vtkRenderer* vtkNotUsed(ren),
+                                   vtkVolumeMapper* vtkNotUsed(mapper),
+                                   vtkVolume* vtkNotUsed(vol))
     {
     return std::string(
       "\n  // Assuming point data only. Also, we offset the texture coordinate\
@@ -85,9 +79,9 @@ namespace vtkvolume
     }
 
   //--------------------------------------------------------------------------
-  std::string BaseDeclarationVertex(vtkRenderer* vtkNotUsed(ren),
-                                    vtkVolumeMapper* vtkNotUsed(mapper),
-                                    vtkVolume* vtkNotUsed(vol))
+  std::string BaseGlobalsVert(vtkRenderer* vtkNotUsed(ren),
+                              vtkVolumeMapper* vtkNotUsed(mapper),
+                              vtkVolume* vtkNotUsed(vol))
     {
     return std::string("\
       \n  uniform mat4 in_modelViewMatrix;\
@@ -103,13 +97,13 @@ namespace vtkvolume
     }
 
   //--------------------------------------------------------------------------
-  std::string BaseDeclarationFragment(vtkRenderer* vtkNotUsed(ren),
-                                      vtkVolumeMapper* vtkNotUsed(mapper),
-                                      vtkVolume* vtkNotUsed(vol),
-                                      int vtkNotUsed(numberOfLights),
-                                      int lightingComplexity,
-                                      int noOfComponents,
-                                      int independentComponents)
+  std::string BaseGlobalsFrag(vtkRenderer* vtkNotUsed(ren),
+                              vtkVolumeMapper* vtkNotUsed(mapper),
+                              vtkVolume* vtkNotUsed(vol),
+                              int vtkNotUsed(numberOfLights),
+                              int lightingComplexity,
+                              int noOfComponents,
+                              int independentComponents)
     {
     std::string shaderStr = std::string("\
       \n// Volume dataset\
@@ -149,6 +143,8 @@ namespace vtkvolume
       \nuniform vec2 in_inverseWindowSize;\
       \nuniform vec3 in_textureExtentsMax;\
       \nuniform vec3 in_textureExtentsMin;\
+      \nuniform float in_volumeScale;\
+      \nuniform float in_volumeBias;\
       \n\
       \n// Material and lighting\
       \nuniform vec3 in_diffuse;\
@@ -160,19 +156,13 @@ namespace vtkvolume
     if (lightingComplexity > 0)
       {
       shaderStr += std::string("\
-        \nuniform bool in_twoSidedLighting;\
-        \nvec3 g_xvec;\
-        \nvec3 g_yvec;\
-        \nvec3 g_zvec;\
-        \nvec3 g_cellSpacing;\
-        \nfloat g_avgSpacing;"
+        \nuniform bool in_twoSidedLighting;"
       );
       }
 
     if (lightingComplexity == 3)
       {
       shaderStr += std::string("\
-        \nvec4 g_fragWorldPos;\
         \nuniform int in_numberOfLights;\
         \nuniform vec3 in_lightAmbientColor[6];\
         \nuniform vec3 in_lightDiffuseColor[6];\
@@ -188,7 +178,6 @@ namespace vtkvolume
     else if (lightingComplexity == 2)
       {
       shaderStr += std::string("\
-        \nvec4 g_fragWorldPos;\
         \nuniform int in_numberOfLights;\
         \nuniform vec3 in_lightAmbientColor[6];\
         \nuniform vec3 in_lightDiffuseColor[6];\
@@ -202,12 +191,7 @@ namespace vtkvolume
         \nuniform vec3 in_lightAmbientColor[1];\
         \nuniform vec3 in_lightDiffuseColor[1];\
         \nuniform vec3 in_lightSpecularColor[1];\
-        \nvec4 g_lightPosObj;\
-        \nvec3 g_ldir;\
-        \nvec3 g_vdir;\
-        \nvec3 g_h;\
-        \nvec3 g_aspect;"
-      );
+      ");
       }
 
     if (noOfComponents > 1 && independentComponents)
@@ -222,10 +206,9 @@ namespace vtkvolume
   //--------------------------------------------------------------------------
   std::string BaseInit(vtkRenderer* vtkNotUsed(ren),
                        vtkVolumeMapper* vtkNotUsed(mapper),
-                       vtkVolume* vol,
-                       int lightingComplexity)
+                       vtkVolume* vtkNotUsed(vol))
     {
-    std::string shaderStr = std::string("\
+    return std::string("\
       \n  // Get the 3D texture coordinates for lookup into the in_volume dataset\
       \n  g_dataPos = ip_textureCoords.xyz;\
       \n\
@@ -251,50 +234,12 @@ namespace vtkvolume
       \n\
       \n  // Flag to deternmine if voxel should be considered for the rendering\
       \n  bool l_skip = false;");
-
-    if (vol->GetProperty()->GetShade() && lightingComplexity == 1)
-      {
-        shaderStr += std::string("\
-          \n  // Light position in object space\
-          \n  g_lightPosObj = (in_inverseVolumeMatrix *\
-          \n                      vec4(in_cameraPos, 1.0));\
-          \n  if (g_lightPosObj.w != 0.0)\
-          \n    {\
-          \n    g_lightPosObj.x /= g_lightPosObj.w;\
-          \n    g_lightPosObj.y /= g_lightPosObj.w;\
-          \n    g_lightPosObj.z /= g_lightPosObj.w;\
-          \n    g_lightPosObj.w = 1.0;\
-          \n    }\
-          \n  g_ldir = normalize(g_lightPosObj.xyz - ip_vertexPos);\
-          \n  g_vdir = normalize(g_eyePosObj.xyz - ip_vertexPos);\
-          \n  g_h = normalize(g_ldir + g_vdir);\
-          \n  g_cellSpacing = vec3(in_cellSpacing[0],\
-          \n                       in_cellSpacing[1],\
-          \n                       in_cellSpacing[2]);\
-          \n  g_avgSpacing = (g_cellSpacing[0] +\
-          \n                  g_cellSpacing[1] +\
-          \n                  g_cellSpacing[2])/3.0;\
-          \n  // Adjust the aspect\
-          \n  g_aspect.x = g_cellSpacing[0] * 2.0 / g_avgSpacing;\
-          \n  g_aspect.y = g_cellSpacing[1] * 2.0 / g_avgSpacing;\
-          \n  g_aspect.z = g_cellSpacing[2] * 2.0 / g_avgSpacing;"
-        );
-      }
-    if (vol->GetProperty()->GetShade())
-      {
-      shaderStr += std::string("\
-        \n  g_xvec = vec3(in_cellStep[0], 0.0, 0.0);\
-        \n  g_yvec = vec3(0.0, in_cellStep[1], 0.0);\
-        \n  g_zvec = vec3(0.0, 0.0, in_cellStep[2]);"
-      );
-      }
-      return shaderStr;
     }
 
   //--------------------------------------------------------------------------
-  std::string BaseImplementation(vtkRenderer* vtkNotUsed(ren),
-                                 vtkVolumeMapper* vtkNotUsed(mapper),
-                                 vtkVolume* vtkNotUsed(vol))
+  std::string BaseIncrement(vtkRenderer* vtkNotUsed(ren),
+                            vtkVolumeMapper* vtkNotUsed(mapper),
+                            vtkVolume* vtkNotUsed(vol))
     {
     return std::string("\
       \n    l_skip = false;"
@@ -310,12 +255,12 @@ namespace vtkvolume
     }
 
   //--------------------------------------------------------------------------
-  std::string ComputeGradientDeclaration(vtkRenderer* vtkNotUsed(ren),
-                                         vtkVolumeMapper* vtkNotUsed(mapper),
-                                         vtkVolume* vol,
-                                         int noOfComponents,
-                                         int independentComponents,
-                                         std::map<int, std::string> gradientTableMap)
+  std::string GradientsComputeFunc(vtkRenderer* vtkNotUsed(ren),
+                                   vtkVolumeMapper* vtkNotUsed(mapper),
+                                   vtkVolume* vol,
+                                   int noOfComponents,
+                                   int independentComponents,
+                                   std::map<int, std::string> gradientTableMap)
   {
     std::string shaderStr;
     if (noOfComponents == 1 && vol->GetProperty()->HasGradientOpacity())
@@ -324,7 +269,7 @@ namespace vtkvolume
         \nuniform sampler1D in_gradientTransferFunc;\
         \nfloat computeGradientOpacity(vec4 grad)\
         \n  {\
-        \n  return texture1D(in_gradientTransferFunc, grad.w).r;\
+        \n  return texture1D(in_gradientTransferFunc, grad.w).w;\
         \n  }"
       );
       }
@@ -342,19 +287,19 @@ namespace vtkvolume
         \n  {\
         \n  if (component == 0)\
         \n    {\
-        \n    return texture1D(in_gradientTransferFunc, grad.w).r;\
+        \n    return texture1D(in_gradientTransferFunc, grad.w).w;\
         \n    }\
         \n  if (component == 1)\
         \n    {\
-        \n    return texture1D(in_gradientTransferFunc1, grad.w).r;\
+        \n    return texture1D(in_gradientTransferFunc1, grad.w).w;\
         \n    }\
         \n  if (component == 2)\
         \n    {\
-        \n    return texture1D(in_gradientTransferFunc2, grad.w).r;\
+        \n    return texture1D(in_gradientTransferFunc2, grad.w).w;\
         \n    }\
         \n  if (component == 3)\
         \n    {\
-        \n    return texture1D(in_gradientTransferFunc3, grad.w).r;\
+        \n    return texture1D(in_gradientTransferFunc3, grad.w).w;\
         \n    }\
         \n  }"
       );
@@ -368,14 +313,15 @@ namespace vtkvolume
         \n  {\
         \n  vec3 g1;\
         \n  vec3 g2;\
-        \n  g1.x = texture3D(in_volume, vec3(g_dataPos + g_xvec)).x;\
-        \n  g1.y = texture3D(in_volume, vec3(g_dataPos + g_yvec)).x;\
-        \n  g1.z = texture3D(in_volume, vec3(g_dataPos + g_zvec)).x;\
-        \n  g2.x = texture3D(in_volume, vec3(g_dataPos - g_xvec)).x;\
-        \n  g2.y = texture3D(in_volume, vec3(g_dataPos - g_yvec)).x;\
-        \n  g2.z = texture3D(in_volume, vec3(g_dataPos - g_zvec)).x;\
-        \n  g1 = g1 * in_volume_scale.r + in_volume_bias.r;\
-        \n  g2 = g2 * in_volume_scale.r + in_volume_bias.r;\
+        \n  vec3 xvec = vec3(in_cellStep[0], 0.0, 0.0);\
+        \n  vec3 yvec = vec3(0.0, in_cellStep[1], 0.0);\
+        \n  vec3 zvec = vec3(0.0, 0.0, in_cellStep[2]);\
+        \n  g1.x = texture3D(in_volume, vec3(g_dataPos + xvec)).x;\
+        \n  g1.y = texture3D(in_volume, vec3(g_dataPos + yvec)).x;\
+        \n  g1.z = texture3D(in_volume, vec3(g_dataPos + zvec)).x;\
+        \n  g2.x = texture3D(in_volume, vec3(g_dataPos - xvec)).x;\
+        \n  g2.y = texture3D(in_volume, vec3(g_dataPos - yvec)).x;\
+        \n  g2.z = texture3D(in_volume, vec3(g_dataPos - zvec)).x;\
         \n  return vec4((g1 - g2), -1.0);\
         \n  }"
       );
@@ -388,14 +334,15 @@ namespace vtkvolume
         \n  {\
         \n  vec3 g1;\
         \n  vec4 g2;\
-        \n  g1.x = texture3D(in_volume, vec3(g_dataPos + g_xvec)).x;\
-        \n  g1.y = texture3D(in_volume, vec3(g_dataPos + g_yvec)).x;\
-        \n  g1.z = texture3D(in_volume, vec3(g_dataPos + g_zvec)).x;\
-        \n  g2.x = texture3D(in_volume, vec3(g_dataPos - g_xvec)).x;\
-        \n  g2.y = texture3D(in_volume, vec3(g_dataPos - g_yvec)).x;\
-        \n  g2.z = texture3D(in_volume, vec3(g_dataPos - g_zvec)).x;\
-        \n  g1 = g1*in_volume_scale.r + in_volume_bias.r;\
-        \n  g2 = g2*in_volume_scale.r + in_volume_bias.r;\
+        \n  vec3 xvec = vec3(in_cellStep[0], 0.0, 0.0);\
+        \n  vec3 yvec = vec3(0.0, in_cellStep[1], 0.0);\
+        \n  vec3 zvec = vec3(0.0, 0.0, in_cellStep[2]);\
+        \n  g1.x = texture3D(in_volume, vec3(g_dataPos + xvec)).x;\
+        \n  g1.y = texture3D(in_volume, vec3(g_dataPos + yvec)).x;\
+        \n  g1.z = texture3D(in_volume, vec3(g_dataPos + zvec)).x;\
+        \n  g2.x = texture3D(in_volume, vec3(g_dataPos - xvec)).x;\
+        \n  g2.y = texture3D(in_volume, vec3(g_dataPos - yvec)).x;\
+        \n  g2.z = texture3D(in_volume, vec3(g_dataPos - zvec)).x;\
         \n  g1.x = in_scalarsRange[0] + (\
         \n         in_scalarsRange[1] - in_scalarsRange[0]) * g1.x;\
         \n  g1.y = in_scalarsRange[0] + (\
@@ -409,9 +356,20 @@ namespace vtkvolume
         \n  g2.z = in_scalarsRange[0] + (\
         \n         in_scalarsRange[1] - in_scalarsRange[0]) * g2.z;\
         \n  g2.xyz = g1 - g2.xyz;\
-        \n  g2.x /= g_aspect.x;\
-        \n  g2.y /= g_aspect.y;\
-        \n  g2.z /= g_aspect.z;\
+        \n  vec3 cellSpacing = vec3(in_cellSpacing[0],\
+        \n                          in_cellSpacing[1],\
+        \n                          in_cellSpacing[2]);\
+        \n  vec3 aspect;\
+        \n  float avgSpacing = (cellSpacing[0] +\
+        \n                      cellSpacing[1] +\
+        \n                      cellSpacing[2])/3.0;\
+        \n  // Adjust the aspect\
+        \n  aspect.x = cellSpacing[0] * 2.0 / avgSpacing;\
+        \n  aspect.y = cellSpacing[1] * 2.0 / avgSpacing;\
+        \n  aspect.z = cellSpacing[2] * 2.0 / avgSpacing;\
+        \n  g2.x /= aspect.x;\
+        \n  g2.y /= aspect.y;\
+        \n  g2.z /= aspect.z;\
         \n  float grad_mag = sqrt(g2.x * g2.x  +\
         \n                        g2.y * g2.y +\
         \n                        g2.z * g2.z);\
@@ -446,19 +404,18 @@ namespace vtkvolume
   }
 
   //--------------------------------------------------------------------------
-  std::string ComputeLightingDeclaration(vtkRenderer* vtkNotUsed(ren),
-                                         vtkVolumeMapper* vtkNotUsed(mapper),
-                                         vtkVolume* vol,
-                                         int noOfComponents,
-                                         int independentComponents,
-                                         int vtkNotUsed(numberOfLights),
-                                         int lightingComplexity)
+  std::string LightComputeFunc(vtkRenderer* vtkNotUsed(ren),
+                               vtkVolumeMapper* vtkNotUsed(mapper),
+                               vtkVolume* vol,
+                               int noOfComponents,
+                               int independentComponents,
+                               int vtkNotUsed(numberOfLights),
+                               int lightingComplexity)
     {
     vtkVolumeProperty* volProperty = vol->GetProperty();
     std::string shaderStr = std::string("\
       \nvec4 computeLighting(vec4 color)\
-      \n  {\
-      \n  vec4 finalColor = vec4(0.0);"
+      \n  {"
     );
 
     if (volProperty->GetShade() || volProperty->HasGradientOpacity())
@@ -474,20 +431,34 @@ namespace vtkvolume
       if (lightingComplexity == 1)
         {
         shaderStr += std::string("\
+          \n  // Light position in object space\
+          \n  vec4 lightPosObj = (in_inverseVolumeMatrix *\
+          \n                      vec4(in_cameraPos, 1.0));\
+          \n  if (lightPosObj.w != 0.0)\
+          \n    {\
+          \n    lightPosObj.x /= lightPosObj.w;\
+          \n    lightPosObj.y /= lightPosObj.w;\
+          \n    lightPosObj.z /= lightPosObj.w;\
+          \n    lightPosObj.w = 1.0;\
+          \n    }\
           \n  vec3 diffuse = vec3(0.0);\
           \n  vec3 specular = vec3(0.0);\
-          \n  vec3 normal = gradient.xyz / in_cellSpacing;\
-          \n  float normalLength = length(normal);\
+          \n  vec3 ldir = normalize(lightPosObj.xyz - ip_vertexPos);\
+          \n  vec3 vdir = normalize(g_eyePosObj.xyz - ip_vertexPos);\
+          \n  vec3 h = normalize(ldir + vdir);\
+          \n  vec3 g2 = gradient.xyz;\
+          \n  g2 = (1.0/in_cellSpacing) * g2;\
+          \n  float normalLength = length(g2);\
           \n  if (normalLength > 0.0)\
           \n    {\
-          \n    normal = normalize(normal);\
+          \n    g2 = normalize(g2);\
           \n    }\
           \n  else\
           \n    {\
-          \n    normal = vec3(0.0, 0.0, 0.0);\
+          \n   g2 = vec3(0.0, 0.0, 0.0);\
           \n    }\
-          \n   float nDotL = dot(normal, g_ldir);\
-          \n   float nDotH = dot(normal, g_h);\
+          \n   float nDotL = dot(g2, ldir);\
+          \n   float nDotH = dot(g2, h);\
           \n   if (nDotL < 0.0 && in_twoSidedLighting)\
           \n     {\
           \n     nDotL = -nDotL;\
@@ -501,23 +472,27 @@ namespace vtkvolume
           \n     diffuse = nDotL * in_diffuse * in_lightDiffuseColor[0]\
           \n                 * color.rgb;\
           \n     }\
+          \n  if (nDotH > 0)\
+          \n    {\
           \n    specular = pow(nDotH, in_shininess) * in_specular *\
           \n                 in_lightSpecularColor[0];\
+          \n    }\
           \n  // For the headlight, ignore the light's ambient color\
           \n  // for now as it is causing the old mapper tests to fail\
-          \n  finalColor.xyz = in_ambient * color.rgb + diffuse + specular;"
+          \n  vec3 finalColor = (in_ambient * color.rgb +\
+          \n                    diffuse + specular);"
           );
         }
       else if (lightingComplexity == 2)
         {
         shaderStr += std::string("\
-          \n  g_fragWorldPos = in_modelViewMatrix * in_volumeMatrix *\
+          \n  vec4 fragWorldPos = in_modelViewMatrix * in_volumeMatrix *\
           \n                      in_textureDatasetMatrix * vec4(-g_dataPos, 1.0);\
-          \n  if (g_fragWorldPos.w != 0.0)\
+          \n  if (fragWorldPos.w != 0.0)\
           \n   {\
-          \n   g_fragWorldPos /= g_fragWorldPos.w;\
+          \n   fragWorldPos /= fragWorldPos.w;\
           \n   }\
-          \n  vec3 vdir = normalize(g_fragWorldPos.xyz);\
+          \n  vec3 vdir = normalize(fragWorldPos.xyz);\
           \n  vec3 normal = gradient.xyz;\
           \n  vec3 ambient = vec3(0.0);\
           \n  vec3 diffuse = vec3(0.0);\
@@ -555,21 +530,21 @@ namespace vtkvolume
           \n    }\
           \n  ambient += in_lightAmbientColor[lightNum];\
           \n  }\
-          \n  finalColor.xyz = in_ambient * ambient +\
-          \n                   in_diffuse * diffuse * color.rgb +\
-          \n                   in_specular * specular;"
+          \n  vec3 finalColor = in_ambient * ambient +\
+          \n                    in_diffuse * diffuse * color.rgb +\
+          \n                    in_specular * specular;"
           );
         }
       else if (lightingComplexity == 3)
         {
         shaderStr += std::string("\
-          \n  g_fragWorldPos = in_modelViewMatrix * in_volumeMatrix *\
+          \n  vec4 fragWorldPos = in_modelViewMatrix * in_volumeMatrix *\
           \n                      in_textureDatasetMatrix * vec4(g_dataPos, 1.0);\
-          \n  if (g_fragWorldPos.w != 0.0)\
+          \n  if (fragWorldPos.w != 0.0)\
           \n    {\
-          \n    g_fragWorldPos /= g_fragWorldPos.w;\
+          \n    fragWorldPos /= fragWorldPos.w;\
           \n    }\
-          \n  vec3 viewDirection = normalize(-g_fragWorldPos.xyz);\
+          \n  vec3 viewDirection = normalize(-fragWorldPos.xyz);\
           \n  vec3 ambient = vec3(0,0,0);\
           \n  vec3 diffuse = vec3(0,0,0);\
           \n  vec3 specular = vec3(0,0,0);\
@@ -587,7 +562,7 @@ namespace vtkvolume
           \n      }\
           \n    else\
           \n      {\
-          \n      vertLightDirection = (g_fragWorldPos.xyz - in_lightPosition[lightNum]);\
+          \n      vertLightDirection = (fragWorldPos.xyz - in_lightPosition[lightNum]);\
           \n      float distance = length(vertLightDirection);\
           \n      vertLightDirection = normalize(vertLightDirection);\
           \n      attenuation = 1.0 /\
@@ -633,15 +608,15 @@ namespace vtkvolume
           \n    }\
           \n    ambient += in_lightAmbientColor[lightNum];\
           \n  }\
-          \n  finalColor.xyz = in_ambient * ambient + in_diffuse *\
-          \n                   diffuse * color.rgb + in_specular * specular;\
+          \n  vec3 finalColor = in_ambient * ambient + in_diffuse *\
+          \n                    diffuse * color.rgb + in_specular * specular;\
         ");
         }
       }
     else
       {
       shaderStr += std::string(
-        "\n  finalColor = vec4(color.rgb, 0.0);"
+        "\n  vec3 finalColor = color.rgb;"
       );
       }
 
@@ -670,8 +645,7 @@ namespace vtkvolume
       }
 
     shaderStr += std::string("\
-      \n  finalColor.a = color.a;\
-      \n  return finalColor;\
+      \n  return vec4(finalColor, color.a);\
       \n  }"
     );
 
@@ -679,10 +653,10 @@ namespace vtkvolume
     }
 
   //--------------------------------------------------------------------------
-  std::string ComputeRayDirectionDeclaration(vtkRenderer* ren,
-                                             vtkVolumeMapper* vtkNotUsed(mapper),
-                                             vtkVolume* vtkNotUsed(vol),
-                                             int vtkNotUsed(noOfComponents))
+  std::string RayDirectionFunc(vtkRenderer* ren,
+                               vtkVolumeMapper* vtkNotUsed(mapper),
+                               vtkVolume* vtkNotUsed(vol),
+                               int vtkNotUsed(noOfComponents))
     {
     if (!ren->GetActiveCamera()->GetParallelProjection())
       {
@@ -705,27 +679,27 @@ namespace vtkvolume
     }
 
   //--------------------------------------------------------------------------
-  std::string ComputeColorDeclaration(vtkRenderer* vtkNotUsed(ren),
-                                      vtkVolumeMapper* vtkNotUsed(mapper),
-                                      vtkVolume* vtkNotUsed(vol),
-                                      int noOfComponents,
-                                      int independentComponents,
-                                      std::map<int, std::string> colorTableMap)
+  std::string ColorTransferFunc(vtkRenderer* vtkNotUsed(ren),
+                                vtkVolumeMapper* vtkNotUsed(mapper),
+                                vtkVolume* vtkNotUsed(vol),
+                                int noOfComponents,
+                                int independentComponents,
+                                std::map<int, std::string> colorTableMap)
     {
       if (noOfComponents == 1)
         {
         return std::string("\
           \nuniform sampler1D in_colorTransferFunc;\
-          \nvec4 computeColor(vec4 scalar, float opacity)\
+          \nvec4 computeColor(vec4 scalar)\
           \n  {\
           \n  return computeLighting(vec4(texture1D(in_colorTransferFunc,\
-          \n                                        scalar.w).xyz, opacity));\
+          \n                                        scalar.w).xyz,\
+          \n                              computeOpacity(scalar)));\
           \n  }");
         }
       else if (noOfComponents > 1 && independentComponents)
         {
         std::string shaderStr;
-        std::ostringstream toString;
         for (int i = 0; i < noOfComponents; ++i)
           {
           shaderStr += std::string("\n uniform sampler1D ") +
@@ -733,107 +707,91 @@ namespace vtkvolume
           }
 
         shaderStr += std::string("\
-          \nvec4 computeColor(vec4 scalar, float opacity, int component)\
-          \n  {");
-
-        for (int i = 0; i < noOfComponents; ++i)
-          {
-          toString << i;
-          shaderStr += std::string("\
-            \n  if (component == " + toString.str() + ")");
-
-          shaderStr += std::string("\
-            \n    {\
-            \n    return computeLighting(vec4(texture1D(\
-            \n      in_colorTransferFunc");
-          shaderStr += (i == 0 ? "" : toString.str());
-          shaderStr += std::string(",\
-            \n      scalar[" + toString.str() + "]).xyz,\
-            \n      opacity));\
-            \n    }");
-
-          // Reset
-          toString.str("");
-          toString.clear();
-          }
-
-          shaderStr += std::string("\n  }");
-          return shaderStr;
-        }
-      else if (noOfComponents == 2&& !independentComponents)
-        {
-        return std::string("\
-          \nuniform sampler1D in_colorTransferFunc;\
-          \nvec4 computeColor(vec4 scalar, float opacity)\
+          \nvec4 computeColor(vec4 scalar, int component)\
           \n  {\
-          \n  return computeLighting(vec4(texture1D(in_colorTransferFunc,\
-          \n                                        scalar.x).xyz,\
-          \n                              opacity));\
-          \n  }");
-        }
-      else
-        {
-        return std::string("\
-          \nvec4 computeColor(vec4 scalar, float opacity)\
-          \n  {\
-          \n  return computeLighting(vec4(scalar.xyz, opacity));\
+          \n  if (component == 0)\
+          \n    {\
+          \n    return computeLighting(vec4(texture1D(\
+          \n      in_colorTransferFunc,\
+          \n      scalar[component]).xyz,\
+          \n      computeOpacity(scalar, component)));\
+          \n    }\
+          \n  if (component == 1)\
+          \n    {\
+          \n    return computeLighting(vec4(texture1D(\
+          \n      in_colorTransferFunc1,\
+          \n      scalar[component]).xyz,\
+          \n      computeOpacity(scalar, component)));\
+          \n    }\
+          \n  if (component == 2)\
+          \n    {\
+          \n      return computeLighting(vec4(texture1D(\
+          \n        in_colorTransferFunc2,\
+          \n        scalar[component]).xyz,\
+          \n        computeOpacity(scalar, component)));\
+          \n    }\
+          \n  if (component == 3)\
+          \n    {\
+          \n      return computeLighting(vec4(texture1D(\
+          \n        in_colorTransferFunc3,\
+          \n        scalar[component]).xyz,\
+          \n        computeOpacity(scalar, component)));\
+          \n    }\
           \n  }");
+
+          return shaderStr;
         }
+
+      return std::string("\
+        \nvec4 computeColor(vec4 scalar)\
+        \n  {\
+        \n  return computeLighting(vec4(scalar.xyz, computeOpacity(scalar)));\
+        \n  }");
     }
 
   //--------------------------------------------------------------------------
-  std::string ComputeOpacityDeclaration(vtkRenderer* vtkNotUsed(ren),
-                                        vtkVolumeMapper* vtkNotUsed(mapper),
-                                        vtkVolume* vtkNotUsed(vol),
-                                        int noOfComponents,
-                                        int independentComponents,
-                                        std::map<int, std::string> opacityTableMap)
+  std::string OpacityTransferFunc(vtkRenderer* vtkNotUsed(ren),
+                                  vtkVolumeMapper* vtkNotUsed(mapper),
+                                  vtkVolume* vtkNotUsed(vol),
+                                  int noOfComponents,
+                                  int independentComponents,
+                                  std::map<int, std::string> opacityTableMap)
     {
     if (noOfComponents > 1 && independentComponents)
       {
       std::string shaderStr;
-      std::ostringstream toString;
-
       for (int i = 0; i < noOfComponents; ++i)
         {
         shaderStr += std::string("\n uniform sampler1D ") +
                      opacityTableMap[i] + std::string(";");
-
         }
 
-        shaderStr += std::string("\
-          \nfloat computeOpacity(vec4 scalar, int component)\
-          \n  {");
-
-        for (int i = 0; i < noOfComponents; ++i)
-          {
-          toString << i;
-          shaderStr += std::string("\
-            \n  if (component == " + toString.str() + ")");
-
-          shaderStr += std::string("\
-            \n    {\
-            \n    return texture1D(in_opacityTransferFunc");
-          shaderStr += (i == 0 ? "" : toString.str());
-          shaderStr += std::string(",scalar[" + toString.str() + "]).r;\
-            \n    }");
-
-           // Reset
-           toString.str("");
-           toString.clear();
-           }
-
-        shaderStr += std::string("\n  }");
-        return shaderStr;
-      }
-    else if (noOfComponents == 2 && !independentComponents)
-      {
-      return std::string("\
-        \nuniform sampler1D in_opacityTransferFunc;\
-        \nfloat computeOpacity(vec4 scalar)\
+      shaderStr += std::string("\
+        \nfloat computeOpacity(vec4 scalar, int component)\
         \n  {\
-        \n  return texture1D(in_opacityTransferFunc, scalar.y).r;\
+        \n  if (component == 0)\
+        \n    {\
+        \n    return texture1D(in_opacityTransferFunc,\
+        \n                     scalar[component]).w;\
+        \n    }\
+        \n  if (component == 1)\
+        \n    {\
+        \n    return texture1D(in_opacityTransferFunc1,\
+        \n                     scalar[component]).w;\
+        \n    }\
+        \n  if (component == 2)\
+        \n    {\
+        \n      return texture1D(in_opacityTransferFunc2,\
+        \n                       scalar[component]).w;\
+        \n    }\
+        \n  if (component == 3)\
+        \n    {\
+        \n      return texture1D(in_opacityTransferFunc3,\
+        \n                       scalar[component]).w;\
+        \n    }\
         \n  }");
+
+        return shaderStr;
       }
     else
       {
@@ -841,23 +799,23 @@ namespace vtkvolume
         \nuniform sampler1D in_opacityTransferFunc;\
         \nfloat computeOpacity(vec4 scalar)\
         \n  {\
-        \n  return texture1D(in_opacityTransferFunc, scalar.w).r;\
+        \n  return texture1D(in_opacityTransferFunc, scalar.w).w;\
         \n  }");
       }
     }
 
   //--------------------------------------------------------------------------
-  std::string ShadingDeclarationVertex(vtkRenderer* vtkNotUsed(ren),
-                                       vtkVolumeMapper* vtkNotUsed(mapper),
-                                       vtkVolume* vtkNotUsed(vol))
+  std::string ShadingGlobalsVert(vtkRenderer* vtkNotUsed(ren),
+                                 vtkVolumeMapper* vtkNotUsed(mapper),
+                                 vtkVolume* vtkNotUsed(vol))
     {
     return std::string();
     }
 
   //--------------------------------------------------------------------------
-  std::string ShadingDeclarationFragment(vtkRenderer* vtkNotUsed(ren),
-                                         vtkVolumeMapper* vtkNotUsed(mapper),
-                                         vtkVolume* vtkNotUsed(vol))
+  std::string ShadingGlobalsFrag(vtkRenderer* vtkNotUsed(ren),
+                                 vtkVolumeMapper* vtkNotUsed(mapper),
+                                 vtkVolume* vtkNotUsed(vol))
     {
     return std::string();
     }
@@ -897,74 +855,40 @@ namespace vtkvolume
     }
 
   //--------------------------------------------------------------------------
-  std::string ShadingImplementation(vtkRenderer* vtkNotUsed(ren),
-                                    vtkVolumeMapper* mapper,
-                                    vtkVolume* vtkNotUsed(vol),
-                                    vtkImageData* maskInput,
-                                    vtkVolumeMask* mask, int maskType,
-                                    int noOfComponents,
-                                    int independentComponents = 0)
+  std::string ShadingIncrement(vtkRenderer* vtkNotUsed(ren),
+                               vtkVolumeMapper* mapper,
+                               vtkVolume* vtkNotUsed(vol),
+                               vtkImageData* maskInput,
+                               vtkVolumeMask* mask, int maskType,
+                               int noOfComponents,
+                               int independentComponents = 0)
     {
     std::string shaderStr = std::string("\
       \n    if (!l_skip)\
-      \n      {\
-      \n      vec4 scalar = texture3D(in_volume, g_dataPos);"
+      \n      {"
     );
 
-    // simulate old intensity textures
-    if (noOfComponents == 1)
-      {
-      shaderStr += std::string("\
-        \n      scalar.r = scalar.r*in_volume_scale.r + in_volume_bias.r;\
-        \n      scalar = vec4(scalar.r,scalar.r,scalar.r,scalar.r);"
-        );
-      }
-    else
-      {
-      // handle bias and scale
-      shaderStr += std::string("\
-        \n      scalar = scalar*in_volume_scale + in_volume_bias;"
-        );
-      }
-
     if (mapper->GetBlendMode() == vtkVolumeMapper::MAXIMUM_INTENSITY_BLEND)
       {
-      if (noOfComponents > 1)
+      if (noOfComponents == 4)
         {
-        if (!independentComponents)
-          {
-          shaderStr += std::string("\
-            \n      if (l_maxValue.w < scalar.w || l_firstValue)\
-            \n        {\
-            \n        l_maxValue = scalar;\
-            \n        }\
-            \n\
-            \n     if (l_firstValue)\
-            \n        {\
-            \n        l_firstValue = false;\
-            \n        }"
-          );
-          }
-        else
-          {
-          shaderStr += std::string("\
-           \n      for (int i = 0; i < in_noOfComponents; ++i)\
-           \n        {\
-           \n        if (l_maxValue[i] < scalar[i] || l_firstValue)\
-           \n          {\
-           \n          l_maxValue[i] = scalar[i];\
-           \n          }\
-           \n        }\
-           \n     if (l_firstValue)\
-           \n        {\
-           \n        l_firstValue = false;\
-           \n        }"
-          );
-          }
+        shaderStr += std::string("\
+          \n      vec4 scalar = texture3D(in_volume, g_dataPos);\
+          \n      if (l_maxValue.w < scalar.w || l_firstValue)\
+          \n        {\
+          \n        l_maxValue = scalar;\
+          \n        }\
+          \n\
+          \n     if (l_firstValue)\
+          \n        {\
+          \n        l_firstValue = false;\
+          \n        }"
+        );
         }
       else
         {
         shaderStr += std::string("\
+          \n      vec4 scalar = texture3D(in_volume, g_dataPos);\
           \n      if (l_maxValue.w < scalar.x || l_firstValue)\
           \n        {\
           \n        l_maxValue.w = scalar.x;\
@@ -979,42 +903,25 @@ namespace vtkvolume
       }
     else if (mapper->GetBlendMode() == vtkVolumeMapper::MINIMUM_INTENSITY_BLEND)
       {
-      if (noOfComponents > 1)
+      if (noOfComponents == 4)
         {
-        if (!independentComponents)
-          {
-          shaderStr += std::string("\
-            \n      if (l_minValue.w > scalar.w || l_firstValue)\
-            \n        {\
-            \n        l_minValue = scalar;\
-            \n        }\
-            \n\
-            \n     if (l_firstValue)\
-            \n        {\
-            \n        l_firstValue = false;\
-            \n        }"
-          );
-          }
-        else
-          {
-          shaderStr += std::string("\
-          \n      for (int i = 0; i < in_noOfComponents; ++i)\
+        shaderStr += std::string("\
+          \n      vec4 scalar = texture3D(in_volume, g_dataPos);\
+          \n      if (l_minValue.w > scalar.w || l_firstValue)\
           \n        {\
-          \n        if (l_minValue[i] < scalar[i] || l_firstValue)\
-          \n          {\
-          \n          l_minValue[i] = scalar[i];\
-          \n          }\
+          \n        l_minValue = scalar;\
           \n        }\
+          \n\
           \n     if (l_firstValue)\
           \n        {\
           \n        l_firstValue = false;\
           \n        }"
-          );
-          }
+        );
         }
       else
         {
         shaderStr += std::string("\
+          \n      vec4 scalar = texture3D(in_volume, g_dataPos);\
           \n      if (l_minValue.w > scalar.x || l_firstValue)\
           \n        {\
           \n        l_minValue.w = scalar.x;\
@@ -1029,64 +936,42 @@ namespace vtkvolume
       }
     else if (mapper->GetBlendMode() == vtkVolumeMapper::ADDITIVE_BLEND)
       {
-      if (noOfComponents > 1)
-       {
-       if (!independentComponents)
-         {
-         shaderStr += std::string("\
-           \n      float opacity = computeOpacity(scalar);\
-           \n      l_sumValue = l_sumValue + opacity * scalar.x;"
-         );
-         }
-       else
-         {
-         shaderStr += std::string("\
-         \n       for (int i = 0; i < in_noOfComponents; ++i)\
-         \n         {\
-         \n         float opacity = computeOpacity(scalar, i);\
-         \n         l_sumValue[i] = l_sumValue[i] + opacity * scalar[i];\
-         \n         }"
-         );
-         }
-       }
-       else
-         {
-         shaderStr += std::string("\
-           \n      float opacity = computeOpacity(scalar);\
-           \n      l_sumValue = l_sumValue + opacity * scalar.x;"
-         );
-         }
+      shaderStr += std::string("\
+        \n      vec4 scalar = texture3D(in_volume, g_dataPos);\
+        \n      float opacity = computeOpacity(scalar);\
+        \n      l_sumValue = l_sumValue + opacity * scalar.x;"
+      );
       }
     else if (mapper->GetBlendMode() == vtkVolumeMapper::COMPOSITE_BLEND)
       {
       if (noOfComponents > 1 && independentComponents)
         {
         shaderStr += std::string("\
-        \n      vec4 color[4]; vec4 tmp = vec4(0.0);\
-        \n      float totalAlpha = 0.0;\
-        \n      for (int i = 0; i < in_noOfComponents; ++i)\
-        \n        {\
+        \n       vec4 color[4]; vec4 tmp = vec4(0.0);\
+        \n       float totalAlpha = 0.0;\
+        \n       vec4 scalar = texture3D(in_volume, g_dataPos);\
+        \n       for (int i = 0; i < in_noOfComponents; ++i)\
+        \n         {\
         ");
         if (!mask || !maskInput ||
             maskType != vtkGPUVolumeRayCastMapper::LabelMapMaskType)
           {
           shaderStr += std::string("\
-          \n        // Data fetching from the red channel of volume texture\
-          \n        color[i][3] = computeOpacity(scalar, i);\
-          \n        color[i] = computeColor(scalar, color[i][3], i);\
-          \n        totalAlpha += color[i][3] * in_componentWeight[i];\
-          \n        }\
-          \n      if (totalAlpha > 0.0)\
-          \n        {\
-          \n        for (int i = 0; i < in_noOfComponents; ++i)\
-          \n          {\
-          \n          tmp.x += color[i].x * color[i].w * in_componentWeight[i] ;\
-          \n          tmp.y += color[i].y * color[i].w * in_componentWeight[i];\
-          \n          tmp.z += color[i].z * color[i].w * in_componentWeight[i];\
-          \n          tmp.w += ((color[i].w * color[i].w)/totalAlpha);\
+          \n          // Data fetching from the red channel of volume texture\
+          \n          color[i] = vec4(computeColor(scalar, i));\
+          \n          totalAlpha += color[i][3] * in_componentWeight[i];\
           \n          }\
-          \n        }\
-          \n      g_fragColor = (1.0f - g_fragColor.a) * tmp + g_fragColor;"
+          \n       if (totalAlpha > 0.0)\
+          \n         {\
+          \n         for (int i = 0; i < in_noOfComponents; ++i)\
+          \n           {\
+          \n           tmp.x += color[i].x * color[i].w * in_componentWeight[i] ;\
+          \n           tmp.y += color[i].y * color[i].w * in_componentWeight[i];\
+          \n           tmp.z += color[i].z * color[i].w * in_componentWeight[i];\
+          \n           tmp.w += ((color[i].w * color[i].w)/totalAlpha);\
+          \n           }\
+          \n         }\
+          \n       g_fragColor = (1.0f - g_fragColor.a) * tmp + g_fragColor;"
           );
           }
         }
@@ -1096,11 +981,9 @@ namespace vtkvolume
              maskType != vtkGPUVolumeRayCastMapper::LabelMapMaskType)
            {
            shaderStr += std::string("\
-             \n      vec4 g_srcColor = vec4(0.0);\
-             \n      g_srcColor.a = computeOpacity(scalar);\
-             \n      if (g_srcColor.a > 0.0)\
-             \n        {\
-             \n        g_srcColor = computeColor(scalar, g_srcColor.a);"
+             \n      // Data fetching from the red channel of volume texture\
+             \n      vec4 scalar = texture3D(in_volume, g_dataPos);\
+             \n      vec4 g_srcColor = computeColor(scalar);"
            );
            }
 
@@ -1117,14 +1000,6 @@ namespace vtkvolume
            \n      g_srcColor.rgb *= g_srcColor.a;\
            \n      g_fragColor = (1.0f - g_fragColor.a) * g_srcColor + g_fragColor;"
          );
-
-         if (!mask || !maskInput ||
-           maskType != vtkGPUVolumeRayCastMapper::LabelMapMaskType)
-           {
-           shaderStr += std::string("\
-             \n      }"
-           );
-           }
         }
       }
      else
@@ -1153,7 +1028,7 @@ namespace vtkvolume
           \n   vec4 g_srcColor = vec4(0);\
           \n   for (int i = 0; i < in_noOfComponents; ++i)\
           \n     {\
-          \n     vec4 tmp = computeColor(l_maxValue, computeOpacity(l_maxValue, i), i);\
+          \n     vec4 tmp = computeColor(l_maxValue, i);\
           \n     g_srcColor[0] += tmp[0] * tmp[3] * in_componentWeight[i];\
           \n     g_srcColor[1] += tmp[1] * tmp[3] * in_componentWeight[i];\
           \n     g_srcColor[2] += tmp[2] * tmp[3] * in_componentWeight[i];\
@@ -1165,8 +1040,8 @@ namespace vtkvolume
       else
         {
         return std::string("\
-         \n  vec4 g_srcColor = computeColor(l_maxValue,\
-                                            computeOpacity(l_maxValue));\
+         \n  vec4 g_srcColor = vec4(computeColor(l_maxValue).xyz,\
+         \n                         computeOpacity(l_maxValue));\
          \n  g_fragColor.rgb = g_srcColor.rgb * g_srcColor.a;\
          \n  g_fragColor.a = g_srcColor.a;"
         );
@@ -1180,7 +1055,7 @@ namespace vtkvolume
           \n  vec4 g_srcColor = vec4(0);\
           \n  for (int i = 0; i < in_noOfComponents; ++i)\
           \n    {\
-          \n    vec4 tmp = computeColor(l_minValue, computeOpacity(l_minValue, i), i);\
+          \n    vec4 tmp = computeColor(l_minValue, i);\
           \n    g_srcColor[0] += tmp[0] * tmp[3] * in_componentWeight[i];\
           \n    g_srcColor[1] += tmp[1] * tmp[3] * in_componentWeight[i];\
           \n    g_srcColor[2] += tmp[2] * tmp[3] * in_componentWeight[i];\
@@ -1192,8 +1067,8 @@ namespace vtkvolume
       else
         {
         return std::string("\
-          \n  vec4 g_srcColor = computeColor(l_minValue,\
-          \n                                 computeOpacity(l_minValue));\
+          \n  vec4 g_srcColor = vec4(computeColor(l_minValue).xyz,\
+          \n                         computeOpacity(l_minValue));\
           \n  g_fragColor.rgb = g_srcColor.rgb * g_srcColor.a;\
           \n  g_fragColor.a = g_srcColor.a;"
         );
@@ -1201,20 +1076,10 @@ namespace vtkvolume
       }
     else if (mapper->GetBlendMode() == vtkVolumeMapper::ADDITIVE_BLEND)
       {
-      if (noOfComponents > 1 && independentComponents)
-        {
-        return std::string("\
-          \n  l_sumValue = clamp(l_sumValue, 0.0, 1.0);\
-          \n  g_fragColor = vec4(l_sumValue);"
-        );
-        }
-      else
-        {
-        return std::string("\
-          \n  l_sumValue = clamp(l_sumValue, 0.0, 1.0);\
-          \n  g_fragColor = vec4(vec3(l_sumValue), 1.0);"
-        );
-        }
+      return std::string("\
+        \n  l_sumValue = clamp(l_sumValue, 0.0, 1.0);\
+        \n  g_fragColor = vec4(vec3(l_sumValue), 1.0);"
+      );
       }
     else
       {
@@ -1223,17 +1088,17 @@ namespace vtkvolume
   }
 
   //--------------------------------------------------------------------------
-  std::string TerminationDeclarationVertex(vtkRenderer* vtkNotUsed(ren),
-                                           vtkVolumeMapper* vtkNotUsed(mapper),
-                                           vtkVolume* vtkNotUsed(vol))
+  std::string TerminationGlobalsVert(vtkRenderer* vtkNotUsed(ren),
+                                     vtkVolumeMapper* vtkNotUsed(mapper),
+                                     vtkVolume* vtkNotUsed(vol))
     {
     return std::string();
     }
 
   //--------------------------------------------------------------------------
-  std::string TerminationDeclarationFragment(vtkRenderer* vtkNotUsed(ren),
-                                             vtkVolumeMapper* vtkNotUsed(mapper),
-                                             vtkVolume* vtkNotUsed(vol))
+  std::string TerminationGlobalsFrag(vtkRenderer* vtkNotUsed(ren),
+                                     vtkVolumeMapper* vtkNotUsed(mapper),
+                                     vtkVolume* vtkNotUsed(vol))
     {
     return std::string();
     }
@@ -1305,9 +1170,9 @@ namespace vtkvolume
     }
 
   //--------------------------------------------------------------------------
-  std::string TerminationImplementation(vtkRenderer* vtkNotUsed(ren),
-                                        vtkVolumeMapper* vtkNotUsed(mapper),
-                                        vtkVolume* vtkNotUsed(vol))
+  std::string TerminationIncrement(vtkRenderer* vtkNotUsed(ren),
+                                   vtkVolumeMapper* vtkNotUsed(mapper),
+                                   vtkVolume* vtkNotUsed(vol))
     {
     return std::string("\
       \n    // The two constants l_tex_min and l_tex_max have a value of\
@@ -1353,17 +1218,17 @@ namespace vtkvolume
    }
 
   //--------------------------------------------------------------------------
-  std::string CroppingDeclarationVertex(vtkRenderer* vtkNotUsed(ren),
-                                        vtkVolumeMapper* vtkNotUsed(mapper),
-                                        vtkVolume* vtkNotUsed(vol))
+  std::string CroppingGlobalsVert(vtkRenderer* vtkNotUsed(ren),
+                                  vtkVolumeMapper* vtkNotUsed(mapper),
+                                  vtkVolume* vtkNotUsed(vol))
   {
     return std::string();
   }
 
   //--------------------------------------------------------------------------
-  std::string CroppingDeclarationFragment(vtkRenderer* vtkNotUsed(ren),
-                                          vtkVolumeMapper* mapper,
-                                          vtkVolume* vtkNotUsed(vol))
+  std::string CroppingGlobalsFrag(vtkRenderer* vtkNotUsed(ren),
+                                  vtkVolumeMapper* mapper,
+                                  vtkVolume* vtkNotUsed(vol))
   {
     if (!mapper->GetCropping()) {
       return std::string();
@@ -1417,61 +1282,39 @@ namespace vtkvolume
       \n  // Convert cropping region to texture space\
       \n  float cropping_planes_ts[6];\
       \n  mat4  datasetToTextureMat = in_inverseTextureDatasetMatrix;\
-      \n\
-      \n  vec4 temp = vec4(cropping_planes[0], 0.0, 0.0, 1.0);\
+      \n  vec4 temp = vec4(cropping_planes[0], cropping_planes[1], 0.0, 1.0);\
       \n  temp = datasetToTextureMat * temp;\
       \n  if (temp[3] != 0.0)\
       \n   {\
-      \n   temp[0] /= temp[3];\
+      \n   temp[0] /= temp[3]; temp[1] /= temp[3];\
       \n   }\
       \n  cropping_planes_ts[0] = temp[0];\
+      \n  cropping_planes_ts[1] = temp[1];\
       \n\
-      \n  temp = vec4(cropping_planes[1], 0.0, 0.0, 1.0);\
-      \n  temp = datasetToTextureMat * temp;\
-      \n  if (temp[3] != 0.0)\
-      \n   {\
-      \n   temp[0] /= temp[3];\
-      \n   }\
-      \n  cropping_planes_ts[1] = temp[0];\
-      \n\
-      \n  temp = vec4(0.0, cropping_planes[2], 0.0, 1.0);\
-      \n  temp = datasetToTextureMat * temp;\
-      \n  if (temp[3] != 0.0)\
-      \n   {\
-      \n   temp[1] /= temp[3];\
-      \n   }\
-      \n  cropping_planes_ts[2] = temp[1];\
-      \n\
-      \n  temp = vec4(0.0, cropping_planes[3], 0.0, 1.0);\
+      \n  temp = vec4(cropping_planes[2], cropping_planes[3], 0.0, 1.0);\
       \n  temp = datasetToTextureMat * temp;\
       \n  if (temp[3] != 0.0)\
-      \n   {\
-      \n   temp[1] /= temp[3];\
-      \n   }\
+      \n    {\
+      \n    temp[0] /= temp[3]; temp[1] /= temp[3];\
+      \n    }\
+      \n  cropping_planes_ts[2] = temp[0];\
       \n  cropping_planes_ts[3] = temp[1];\
       \n\
-      \n  temp = vec4(0.0, 0.0, cropping_planes[4], 1.0);\
+      \n  temp = vec4(cropping_planes[4], cropping_planes[5], 0.0, 1.0);\
       \n  temp = datasetToTextureMat * temp;\
       \n  if (temp[3] != 0.0)\
-      \n   {\
-      \n   temp[2] /= temp[3];\
-      \n   }\
-      \n  cropping_planes_ts[4] = temp[2];\
-      \n\
-      \n  temp = vec4(0.0, 0.0, cropping_planes[5], 1.0);\
-      \n  temp = datasetToTextureMat * temp;\
-      \n  if (temp[3] != 0.0)\
-      \n   {\
-      \n   temp[2] /= temp[3];\
-      \n   }\
-      \n  cropping_planes_ts[5] = temp[2];"
+      \n    {\
+      \n    temp[0] /= temp[3]; temp[1] /= temp[3];\
+      \n    }\
+      \n  cropping_planes_ts[4] = temp[0];\
+      \n  cropping_planes_ts[5] = temp[1];"
     );
   }
 
   //--------------------------------------------------------------------------
-  std::string CroppingImplementation(vtkRenderer* vtkNotUsed(ren),
-                                     vtkVolumeMapper* mapper,
-                                     vtkVolume* vtkNotUsed(vol))
+  std::string CroppingIncrement(vtkRenderer* vtkNotUsed(ren),
+                                vtkVolumeMapper* mapper,
+                                vtkVolume* vtkNotUsed(vol))
   {
     if (!mapper->GetCropping()) {
       return std::string();
@@ -1500,17 +1343,17 @@ namespace vtkvolume
   }
 
   //--------------------------------------------------------------------------
-  std::string ClippingDeclarationVertex(vtkRenderer* vtkNotUsed(ren),
-                                        vtkVolumeMapper* vtkNotUsed(mapper),
-                                        vtkVolume* vtkNotUsed(vol))
+  std::string ClippingGlobalsVert(vtkRenderer* vtkNotUsed(ren),
+                                  vtkVolumeMapper* vtkNotUsed(mapper),
+                                  vtkVolume* vtkNotUsed(vol))
   {
     return std::string();
   }
 
   //--------------------------------------------------------------------------
-  std::string ClippingDeclarationFragment(vtkRenderer* vtkNotUsed(ren),
-                                          vtkVolumeMapper* vtkNotUsed(mapper),
-                                          vtkVolume* vtkNotUsed(vol))
+  std::string ClippingGlobalsFrag(vtkRenderer* vtkNotUsed(ren),
+                                  vtkVolumeMapper* vtkNotUsed(mapper),
+                                  vtkVolume* vtkNotUsed(vol))
   {
     return std::string();
   }
@@ -1570,9 +1413,9 @@ namespace vtkvolume
   }
 
   //--------------------------------------------------------------------------
-  std::string ClippingImplementation(vtkRenderer* vtkNotUsed(ren),
-                                     vtkVolumeMapper* mapper,
-                                     vtkVolume* vtkNotUsed(vol))
+  std::string ClippingIncrement(vtkRenderer* vtkNotUsed(ren),
+                                vtkVolumeMapper* mapper,
+                                vtkVolume* vtkNotUsed(vol))
   {
     if (!mapper->GetClippingPlanes())
       {
@@ -1607,12 +1450,12 @@ namespace vtkvolume
   }
 
   //--------------------------------------------------------------------------
-  std::string BinaryMaskDeclaration(vtkRenderer* vtkNotUsed(ren),
-                                            vtkVolumeMapper* vtkNotUsed(mapper),
-                                            vtkVolume* vtkNotUsed(vol),
-                                            vtkImageData* maskInput,
-                                            vtkVolumeMask* mask,
-                                            int vtkNotUsed(maskType))
+  std::string BinaryMaskGlobalsFrag(vtkRenderer* vtkNotUsed(ren),
+                                    vtkVolumeMapper* vtkNotUsed(mapper),
+                                    vtkVolume* vtkNotUsed(vol),
+                                    vtkImageData* maskInput,
+                                    vtkVolumeMask* mask,
+                                    int vtkNotUsed(maskType))
   {
     if (!mask || !maskInput)
       {
@@ -1625,12 +1468,12 @@ namespace vtkvolume
   }
 
   //--------------------------------------------------------------------------
-  std::string BinaryMaskImplementation(vtkRenderer* vtkNotUsed(ren),
-                                       vtkVolumeMapper* vtkNotUsed(mapper),
-                                       vtkVolume* vtkNotUsed(vol),
-                                       vtkImageData* maskInput,
-                                       vtkVolumeMask* mask,
-                                       int maskType)
+  std::string BinaryMaskIncrement(vtkRenderer* vtkNotUsed(ren),
+                                  vtkVolumeMapper* vtkNotUsed(mapper),
+                                  vtkVolume* vtkNotUsed(vol),
+                                  vtkImageData* maskInput,
+                                  vtkVolumeMask* mask,
+                                  int maskType)
   {
     if (!mask || !maskInput ||
         maskType == vtkGPUVolumeRayCastMapper::LabelMapMaskType)
@@ -1641,7 +1484,7 @@ namespace vtkvolume
       {
       return std::string("\
         \nvec4 maskValue = texture3D(in_mask, g_dataPos);\
-        \nif(maskValue.r <= 0.0)\
+        \nif(maskValue.a <= 0.0)\
         \n  {\
         \n  l_skip = true;\
         \n  }"
@@ -1650,12 +1493,12 @@ namespace vtkvolume
   }
 
   //--------------------------------------------------------------------------
-  std::string CompositeMaskDeclarationFragment(vtkRenderer* vtkNotUsed(ren),
-                                               vtkVolumeMapper* vtkNotUsed(mapper),
-                                               vtkVolume* vtkNotUsed(vol),
-                                               vtkImageData* maskInput,
-                                               vtkVolumeMask* mask,
-                                               int maskType)
+  std::string CompositeMaskGlobalsFrag(vtkRenderer* vtkNotUsed(ren),
+                                       vtkVolumeMapper* vtkNotUsed(mapper),
+                                       vtkVolume* vtkNotUsed(vol),
+                                       vtkImageData* maskInput,
+                                       vtkVolumeMask* mask,
+                                       int maskType)
   {
     if (!mask || !maskInput ||
         maskType != vtkGPUVolumeRayCastMapper::LabelMapMaskType)
@@ -1673,13 +1516,12 @@ namespace vtkvolume
   }
 
   //--------------------------------------------------------------------------
-  std::string CompositeMaskImplementation(vtkRenderer* vtkNotUsed(ren),
-                                          vtkVolumeMapper* vtkNotUsed(mapper),
-                                          vtkVolume* vtkNotUsed(vol),
-                                          vtkImageData* maskInput,
-                                          vtkVolumeMask* mask,
-                                          int maskType,
-                                          int noOfComponents)
+  std::string CompositeMaskIncrement(vtkRenderer* vtkNotUsed(ren),
+                                     vtkVolumeMapper* vtkNotUsed(mapper),
+                                     vtkVolume* vtkNotUsed(vol),
+                                     vtkImageData* maskInput,
+                                     vtkVolumeMask* mask,
+                                     int maskType)
   {
     if (!mask || !maskInput ||
         maskType != vtkGPUVolumeRayCastMapper::LabelMapMaskType)
@@ -1688,58 +1530,39 @@ namespace vtkvolume
       }
     else
       {
-      std::string shaderStr = std::string("\
-        \nvec4 scalar = texture3D(in_volume, g_dataPos);");
-
-      // simulate old intensity textures
-      if (noOfComponents == 1)
-        {
-        shaderStr += std::string("\
-          \n      scalar.r = scalar.r*in_volume_scale.r + in_volume_bias.r;\
-          \n      scalar = vec4(scalar.r,scalar.r,scalar.r,scalar.r);"
-          );
-        }
-      else
-        {
-        // handle bias and scale
-        shaderStr += std::string("\
-          \n      scalar = scalar*in_volume_scale + in_volume_bias;"
-          );
-        }
-
-      return shaderStr + std::string("\
+      return std::string("\
+        \nvec4 scalar = texture3D(in_volume, g_dataPos);\
         \nif (in_maskBlendFactor == 0.0)\
         \n  {\
-        \n  g_srcColor = computeColor(scalar, computeOpacity(scalar));\
+        \n  g_srcColor = computeColor(scalar);\
         \n  }\
         \nelse\
         \n  {\
-        \n  float opacity = computeOpacity(scalar);\
         \n  // Get the mask value at this same location\
         \n  vec4 maskValue = texture3D(in_mask, g_dataPos);\
-        \n  if(maskValue.r == 0.0)\
+        \n  if(maskValue.a == 0.0)\
         \n    {\
-        \n    g_srcColor = computeColor(scalar, opacity);\
+        \n    g_srcColor = computeColor(scalar);\
         \n    }\
         \n  else\
         \n    {\
-        \n    if (maskValue.r == 1.0/255.0)\
+        \n    if (maskValue.a == 1.0/255.0)\
         \n      {\
         \n      g_srcColor = texture1D(in_mask1, scalar.w);\
         \n      }\
         \n    else\
         \n      {\
-        \n      // maskValue.r == 2.0/255.0\
+        \n      // maskValue.a == 2.0/255.0\
         \n      g_srcColor = texture1D(in_mask2, scalar.w);\
         \n      }\
         \n    g_srcColor.a = 1.0;\
         \n    if(in_maskBlendFactor < 1.0)\
         \n      {\
-        \n      g_srcColor = (1.0 - in_maskBlendFactor) * computeColor(scalar, opacity)\
+        \n      g_srcColor = (1.0 - in_maskBlendFactor) * computeColor(scalar)\
         \n                   + in_maskBlendFactor * g_srcColor;\
         \n      }\
         \n    }\
-        \n    g_srcColor.a = opacity;\
+        \n    g_srcColor.a = computeOpacity(scalar);\
         \n  }"
       );
       }
diff --git a/Rendering/VolumeOpenGL2/vtkVolumeStateRAII.h b/Rendering/VolumeOpenGL2/vtkVolumeStateRAII.h
index 9f0fac3..cb97d96 100644
--- a/Rendering/VolumeOpenGL2/vtkVolumeStateRAII.h
+++ b/Rendering/VolumeOpenGL2/vtkVolumeStateRAII.h
@@ -56,12 +56,9 @@ class vtkVolumeStateRAII
 
     ~vtkVolumeStateRAII()
       {
-#ifdef __APPLE__
-      if (vtkOpenGLRenderWindow::GetContextSupportsOpenGL32())
+#ifndef __APPLE__
+      glBindVertexArray(0);
 #endif
-        {
-        glBindVertexArray(0);
-        }
       glBindBuffer(GL_ARRAY_BUFFER, 0);
       glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
 
diff --git a/Rendering/VolumeOpenGLNew/CMakeLists.txt b/Rendering/VolumeOpenGLNew/CMakeLists.txt
new file mode 100644
index 0000000..ee2f54f
--- /dev/null
+++ b/Rendering/VolumeOpenGLNew/CMakeLists.txt
@@ -0,0 +1,54 @@
+include(vtkObjectFactory)
+
+ # Source files
+set(Module_SRCS
+  #vtkGPUVolumeRayCastMapper.cxx
+  vtkOpenGLGPUVolumeRayCastMapper.cxx
+  vtkVolumeShader.cxx
+  ${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.cxx)
+
+set_source_files_properties(
+#  vtkGPUVolumeRayCastMapper
+  vtkVolumeShader
+  ${vtk-module}ObjectFactory
+  WRAP_EXCLUDE)
+
+set(opengl_overrides
+  GPUVolumeRayCastMapper
+  )
+foreach(_override ${opengl_overrides})
+  vtk_add_override(vtk${_override} vtkOpenGL${_override})
+endforeach()
+
+set(shader_files
+    shaders/raycasterfs.glsl
+    shaders/raycastervs.glsl)
+
+unset(shader_h_files)
+foreach(file ${shader_files})
+  get_filename_component(file_we ${file} NAME_WE)
+  set(src  ${CMAKE_CURRENT_SOURCE_DIR}/${file})
+  set(res  ${CMAKE_CURRENT_BINARY_DIR}/${file_we}.cxx)
+  set(resh ${CMAKE_CURRENT_BINARY_DIR}/${file_we}.h)
+  list(APPEND shader_h_files ${resh})
+  add_custom_command(
+    OUTPUT ${res} ${resh}
+    DEPENDS ${src} vtkEncodeString
+    COMMAND vtkEncodeString
+    ARGS ${res} ${src} ${file_we}
+      --build-header VTKRENDERINGVOLUMEOPENGLNEW_EXPORT
+      vtkRenderingVolumeOpenGLNewModule.h
+    )
+  list(APPEND Module_SRCS ${res})
+  set_source_files_properties(${file_we} WRAP_EXCLUDE)
+endforeach()
+
+vtk_object_factory_configure("${vtk_module_overrides}")
+
+vtk_module_library(vtkRenderingVolumeOpenGLNew ${Module_SRCS})
+
+add_custom_command(OUTPUT "${vtkRenderingVolumeOpenGLNew_BINARY_DIR}/shaders"
+                   COMMAND ${CMAKE_COMMAND} -E copy_directory
+                   "${vtkRenderingVolumeOpenGLNew_SOURCE_DIR}/shaders" "${CMAKE_BINARY_DIR}/shaders")
+add_custom_target(copy_shaders ALL DEPENDS "${vtkRenderingVolumeOpenGLNew_BINARY_DIR}/shaders")
+add_dependencies(vtkRenderingVolumeOpenGLNew copy_shaders)
diff --git a/Rendering/VolumeOpenGLNew/module.cmake b/Rendering/VolumeOpenGLNew/module.cmake
new file mode 100644
index 0000000..a212667
--- /dev/null
+++ b/Rendering/VolumeOpenGLNew/module.cmake
@@ -0,0 +1,35 @@
+# This module cannot be built when the rendering backend is OpenGL2
+if (Module_vtkRenderingVolumeOpenGLNew AND
+    ("${VTK_RENDERING_BACKEND}" STREQUAL "OpenGL2"))
+  message (SEND_ERROR "
+  vtkRenderingVolumeOpenGLNew cannot be built
+  when the rendering backend is OpenGL2.
+  Please disable vtkRenderingVolumeOpenGLNew or
+  change VTK_RENDERING_BACKEND to OpenGL.
+  ")
+  return()
+endif()
+
+vtk_module(vtkRenderingVolumeOpenGLNew
+  DEPENDS
+    vtkCommonCore
+    vtkCommonDataModel
+    vtkCommonExecutionModel
+    vtkFiltersSources
+    vtkglew
+    vtkRenderingOpenGL
+    vtkRenderingVolume
+  IMPLEMENTS
+    vtkRenderingVolume
+  TEST_DEPENDS
+    vtkCommonCore
+    vtkFiltersModeling
+    vtkglew
+    vtkInteractionStyle
+    vtkIOLegacy
+    vtkIOXML
+    vtkRenderingOpenGL
+    vtkTestingCore
+    vtkTestingRendering
+  EXCLUDE_FROM_ALL
+)
diff --git a/Rendering/VolumeOpenGLNew/shaders/raycasterfs.glsl b/Rendering/VolumeOpenGLNew/shaders/raycasterfs.glsl
new file mode 100644
index 0000000..8bc3f13
--- /dev/null
+++ b/Rendering/VolumeOpenGLNew/shaders/raycasterfs.glsl
@@ -0,0 +1,105 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+  Module:    raycasterfs.glsl
+
+  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.
+
+=========================================================================*/
+#version 120
+
+// The following line handle system declarations such a
+// default precisions, or defining precisions to null
+//VTK::System::Dec
+
+//////////////////////////////////////////////////////////////////////////////
+///
+/// Inputs
+///
+//////////////////////////////////////////////////////////////////////////////
+
+/// 3D texture coordinates form vertex shader
+varying vec3 m_texture_coords;
+varying vec3 m_vertex_pos;
+
+//////////////////////////////////////////////////////////////////////////////
+///
+/// Outputs
+///
+//////////////////////////////////////////////////////////////////////////////
+
+vec4 g_frag_color;
+
+//////////////////////////////////////////////////////////////////////////////
+///
+/// Uniforms, attributes, and globals
+///
+//////////////////////////////////////////////////////////////////////////////
+vec3 g_data_pos;
+vec3 g_dir_step;
+
+//VTK::Base::Dec
+//VTK::Termination::Dec
+//VTK::Cropping::Dec
+//VTK::Shading::Dec
+//VTK::BinaryMask::Dec
+//VTK::CompositeMask::Dec
+
+//VTK::ComputeOpacity::Dec
+//VTK::ComputeGradient::Dec
+//VTK::ComputeLighting::Dec
+//VTK::ColorTransferFunc::Dec
+
+//VTK::RayDirectionFunc::Dec
+
+/// We support only 8 clipping planes for now
+/// The first value is the size of the data array for clipping
+/// planes (origin, normal)
+uniform float m_clipping_planes[49];
+
+//////////////////////////////////////////////////////////////////////////////
+///
+/// Main
+///
+//////////////////////////////////////////////////////////////////////////////
+void main()
+{
+  /// Initialize g_frag_color (output) to 0
+  g_frag_color = vec4(0.0);
+  g_dir_step = vec3(0.0);
+
+  //VTK::Base::Init
+  //VTK::Terminate::Init
+  //VTK::Shading::Init
+  //VTK::Cropping::Init
+  //VTK::Clipping::Init
+
+  /// For all samples along the ray
+  while (true)
+    {
+    //VTK::Base::Impl
+    //VTK::Terminate::Impl
+    //VTK::Cropping::Impl
+    //VTK::Clipping::Impl
+    //VTK::BinaryMask::Impl
+    //VTK::CompositeMask::Impl
+    //VTK::Shading::Impl
+
+    /// Advance ray by m_dir_step
+    g_data_pos += g_dir_step;
+    }
+
+  //VTK::Base::Exit
+  //VTK::Terminate::Exit
+  //VTK::Cropping::Exit
+  //VTK::Clipping::Exit
+  //VTK::Shading::Exit
+
+  gl_FragColor = g_frag_color;
+}
diff --git a/Rendering/VolumeOpenGLNew/shaders/raycastervs.glsl b/Rendering/VolumeOpenGLNew/shaders/raycastervs.glsl
new file mode 100644
index 0000000..2713158
--- /dev/null
+++ b/Rendering/VolumeOpenGLNew/shaders/raycastervs.glsl
@@ -0,0 +1,60 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+  Module:    raycastervs.glsl
+
+  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.
+
+=========================================================================*/
+#version 120
+
+/// Needed to enable inverse function
+#extension GL_ARB_gpu_shader5 : enable
+
+// The following line handle system declarations such a
+// default precisions, or defining precisions to null
+//VTK::System::Dec
+
+//////////////////////////////////////////////////////////////////////////////
+///
+/// Uniforms, attributes, and globals
+///
+//////////////////////////////////////////////////////////////////////////////
+//VTK::Base::Dec
+//VTK::Termination::Dec
+//VTK::Cropping::Dec
+//VTK::Shading::Dec
+
+//////////////////////////////////////////////////////////////////////////////
+///
+/// Inputs
+///
+//////////////////////////////////////////////////////////////////////////////
+attribute vec3 m_in_vertex_pos;
+
+//////////////////////////////////////////////////////////////////////////////
+///
+/// Outputs
+///
+//////////////////////////////////////////////////////////////////////////////
+/// 3D texture coordinates for texture lookup in the fragment shader
+varying vec3 m_texture_coords;
+varying vec3 m_vertex_pos;
+
+void main()
+{
+  /// Get clipspace position
+  //VTK::ComputeClipPos::Impl
+
+  /// Compute texture coordinates
+  //VTK::ComputeTextureCoords::Impl
+
+  /// Copy incoming vertex position for the fragment shader
+  m_vertex_pos = m_in_vertex_pos;
+}
diff --git a/Rendering/VolumeOpenGLNew/shaders/shader.frag b/Rendering/VolumeOpenGLNew/shaders/shader.frag
new file mode 100644
index 0000000..1e2112c
--- /dev/null
+++ b/Rendering/VolumeOpenGLNew/shaders/shader.frag
@@ -0,0 +1,9 @@
+#version 330 core
+
+layout(location = 0) out vec4 vFragColor;	//fragment shader output
+
+void main()
+{
+  //return the constant white colour as shader output
+  vFragColor = vec4(1,1,1,1);
+}
diff --git a/Rendering/VolumeOpenGLNew/shaders/shader.vert b/Rendering/VolumeOpenGLNew/shaders/shader.vert
new file mode 100644
index 0000000..6ac32f1
--- /dev/null
+++ b/Rendering/VolumeOpenGLNew/shaders/shader.vert
@@ -0,0 +1,14 @@
+#version 330 core
+
+layout(location = 0) in vec3 vVertex; //object space vertex position
+
+layout(location = 1) in vec2 vUV; //object space vertex position
+
+//uniform
+uniform mat4 MVP;  //combined modelview projection matrix
+
+void main()
+{
+  //get the clipspace vertex position
+  gl_Position = MVP*vec4(vVertex.xyz,1);
+}
diff --git a/Rendering/VolumeOpenGLNew/vtkOpenGLGPUVolumeRayCastMapper.cxx b/Rendering/VolumeOpenGLNew/vtkOpenGLGPUVolumeRayCastMapper.cxx
new file mode 100644
index 0000000..e041b52
--- /dev/null
+++ b/Rendering/VolumeOpenGLNew/vtkOpenGLGPUVolumeRayCastMapper.cxx
@@ -0,0 +1,2185 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+  Module:    vtkOpenGLGPUVolumeRayCastMapper.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 "vtkOpenGLGPUVolumeRayCastMapper.h"
+
+#include "vtkOpenGLGradientOpacityTable.h"
+#include "vtkOpenGLOpacityTable.h"
+#include "vtkOpenGLRGBTable.h"
+#include "vtkVolumeShaderComposer.h"
+#include "vtkVolumeShader.h"
+#include "vtkVolumeStateRAII.h"
+
+// Include compiled shader code
+#include <raycasterfs.h>
+#include <raycastervs.h>
+
+// VTK includes
+#include <vtkBoundingBox.h>
+#include <vtkCamera.h>
+#include <vtkCellArray.h>
+#include <vtkClipConvexPolyData.h>
+#include <vtkColorTransferFunction.h>
+#include <vtkCommand.h>
+#include <vtkDataArray.h>
+#include <vtkDensifyPolyData.h>
+#include <vtkFloatArray.h>
+#include <vtk_glew.h>
+#include <vtkImageData.h>
+#include <vtkMath.h>
+#include <vtkMatrix4x4.h>
+#include <vtkNew.h>
+#include <vtkObjectFactory.h>
+#include <vtkPerlinNoise.h>
+#include <vtkPlaneCollection.h>
+#include <vtkPointData.h>
+#include <vtkPoints.h>
+#include <vtkPolyData.h>
+#include <vtkRenderer.h>
+#include <vtkRenderWindow.h>
+#include <vtkSmartPointer.h>
+#include <vtkTessellatedBoxSource.h>
+#include <vtkTimerLog.h>
+#include <vtkUnsignedCharArray.h>
+#include <vtkUnsignedIntArray.h>
+#include <vtkVolumeMask.h>
+#include <vtkVolumeProperty.h>
+
+// C/C++ includes
+#include <cassert>
+#include <limits>
+#include <sstream>
+#include <string>
+
+vtkStandardNewMacro(vtkOpenGLGPUVolumeRayCastMapper);
+
+//----------------------------------------------------------------------------
+class vtkOpenGLGPUVolumeRayCastMapper::vtkInternal
+{
+public:
+  // Constructor
+  //--------------------------------------------------------------------------
+  vtkInternal(vtkOpenGLGPUVolumeRayCastMapper* parent)
+    {
+    this->Parent = parent;
+    this->Initialized = false;
+    this->ValidTransferFunction = false;
+    this->LoadDepthTextureExtensionsSucceeded = false;
+    this->CameraWasInsideInLastUpdate = false;
+    this->CubeVBOId = 0;
+#ifndef __APPLE__
+    this->CubeVAOId = 0;
+#endif
+    this->CubeIndicesId = 0;
+    this->VolumeTextureId = 0;
+    this->NoiseTextureId = 0;
+    this->DepthTextureId = 0;
+    this->TextureWidth = 1024;
+    this->ActualSampleDistance = 1.0;
+    this->RGBTable = 0;
+    this->OpacityTables = 0;
+    this->Mask1RGBTable = 0;
+    this->Mask2RGBTable =  0;
+    this->GradientOpacityTables = 0;
+    this->Dimensions[0] = this->Dimensions[1] = this->Dimensions[2] = -1;
+    this->TextureSize[0] = this->TextureSize[1] = this->TextureSize[2] = -1;
+    this->CellScale[0] = this->CellScale[1] = this->CellScale[2] = 0.0;
+    this->NoiseTextureData = 0;
+
+    this->Extents[0] = VTK_INT_MAX;
+    this->Extents[1] = VTK_INT_MIN;
+    this->Extents[2] = VTK_INT_MAX;
+    this->Extents[3] = VTK_INT_MIN;
+    this->Extents[4] = VTK_INT_MAX;
+    this->Extents[5] = VTK_INT_MIN;
+
+    this->MaskTextures = new vtkMapMaskTextureId;
+
+    this->PrevInput = NULL;
+    }
+
+  // Destructor
+  //--------------------------------------------------------------------------
+  ~vtkInternal()
+    {
+    delete this->RGBTable;
+    this->RGBTable = 0;
+
+    if(this->Mask1RGBTable!=0)
+      {
+      delete this->Mask1RGBTable;
+      this->Mask1RGBTable=0;
+      }
+
+    if(this->Mask2RGBTable!=0)
+      {
+      delete this->Mask2RGBTable;
+      this->Mask2RGBTable=0;
+      }
+
+    delete this->OpacityTables;
+    this->OpacityTables = 0;
+
+    delete this->GradientOpacityTables;
+    this->GradientOpacityTables = 0;
+
+    delete this->NoiseTextureData;
+    this->NoiseTextureData = 0;
+
+    if (this->MaskTextures != 0)
+      {
+      if (!this->MaskTextures->Map.empty())
+        {
+        std::map<vtkImageData*,vtkVolumeMask*>::iterator it =
+          this->MaskTextures->Map.begin();
+        while(it != this->MaskTextures->Map.end())
+          {
+          vtkVolumeMask* texture = (*it).second;
+          delete texture;
+          ++it;
+          }
+        this->MaskTextures->Map.clear();
+        }
+      }
+    }
+
+  // Helper methods
+  //--------------------------------------------------------------------------
+  template<typename T>
+  static void ToFloat(const T& in1, const T& in2, float (&out)[2]);
+  template<typename T>
+  static void ToFloat(const T& in1, const T& in2, const T& in3,
+                      float (&out)[3]);
+  template<typename T>
+  static void ToFloat(T* in, float* out, int numberOfComponents);
+  template<typename T>
+  static void ToFloat(T (&in)[3], float (&out)[3]);
+  template<typename T>
+  static void ToFloat(T (&in)[2], float (&out)[2]);
+  template<typename T>
+  static void ToFloat(T& in, float& out);
+  static void VtkToGlMatrix(vtkMatrix4x4* in, float (&out)[16]);
+
+  void Initialize(vtkRenderer* ren, vtkVolume* vol);
+
+  bool LoadVolume(vtkImageData* imageData, vtkDataArray* scalars);
+
+  bool LoadMask(vtkImageData* input,
+                vtkImageData* maskInput,
+                int textureExtent[6],
+                vtkVolume* volume);
+
+  bool IsInitialized();
+
+  void CompileAndLinkShader(const string& vertexShader,
+                            const string& fragmentShader);
+
+  void ComputeBounds(vtkImageData* input);
+
+
+  // Update transfer color function based on the incoming inputs and number of
+  // scalar components.
+  // TODO Deal with numberOfScalarComponents > 1
+  int UpdateColorTransferFunction(vtkVolume* vol, int numberOfScalarComponents);
+
+  // Update opacity transfer function (not gradient opacity)
+  int UpdateOpacityTransferFunction(vtkVolume* vol,
+                                    int numberOfScalarComponents,
+                                    unsigned int level);
+
+  // Update gradient opacity function
+  int UpdateGradientOpacityTransferFunction(vtkVolume* vol,
+                                            int numberOfScalarComponents,
+                                            unsigned int level);
+
+  // Update noise texture (used to reduce rendering artifacts
+  // specifically banding effects)
+  void UpdateNoiseTexture();
+
+  // Update depth texture (used for early termination of the ray)
+  void UpdateDepthTexture(vtkRenderer* ren, vtkVolume* vol);
+
+  // Test if camera is inside the volume geometry
+  bool IsCameraInside(vtkRenderer* ren, vtkVolume* vol);
+
+  // Update the volume geometry
+  void UpdateVolumeGeometry(vtkRenderer* ren, vtkVolume* vol,
+                            vtkImageData* input);
+
+  // Update cropping params to shader
+  void UpdateCropping(vtkRenderer* ren, vtkVolume* vol);
+
+  // Update clipping params to shader
+  void UpdateClipping(vtkRenderer* ren, vtkVolume* vol);
+
+  // Update the interval of sampling
+  void UpdateSamplingDistance(vtkImageData *input,
+                              vtkRenderer* ren, vtkVolume* vol);
+
+  // Load OpenGL extensiosn required to grab depth sampler buffer
+  void LoadRequireDepthTextureExtensions(vtkRenderWindow* renWin);
+
+  // Create GL buffers
+  void CreateBufferObjects();
+
+  // Dispose / free GL buffers
+  void DeleteBufferObjects();
+
+  // Private member variables
+  //--------------------------------------------------------------------------
+  vtkOpenGLGPUVolumeRayCastMapper* Parent;
+
+  bool Initialized;
+  bool ValidTransferFunction;
+  bool LoadDepthTextureExtensionsSucceeded;
+  bool CameraWasInsideInLastUpdate;
+
+  GLuint CubeVBOId;
+#ifndef __APPLE__
+  GLuint CubeVAOId;
+#endif
+  GLuint CubeIndicesId;
+
+  GLuint VolumeTextureId;
+  GLuint NoiseTextureId;
+  GLuint DepthTextureId;
+
+  vtkVolumeShader Shader;
+
+  int TextureWidth;
+
+  double Scale;
+  double Bias;
+
+  float* NoiseTextureData;
+  GLint NoiseTextureSize;
+
+  float ActualSampleDistance;
+
+  int LastProjectionParallel;
+  int Dimensions[3];
+  int TextureSize[3];
+  int WindowLowerLeft[2];
+  int WindowSize[2];
+
+  double ScalarsRange[2];
+  double LoadedBounds[6];
+  int Extents[6];
+  double DatasetStepSize[3];
+  double CellScale[3];
+  double CellStep[3];
+  double CellSpacing[3];
+
+  std::ostringstream ExtensionsStringStream;
+
+  vtkOpenGLRGBTable* RGBTable;
+  vtkOpenGLOpacityTables* OpacityTables;
+  vtkOpenGLRGBTable* Mask1RGBTable;
+  vtkOpenGLRGBTable* Mask2RGBTable;
+  vtkOpenGLGradientOpacityTables* GradientOpacityTables;
+
+  vtkTimeStamp ShaderBuildTime;
+
+  vtkNew<vtkMatrix4x4> TextureToDataSetMat;
+  vtkNew<vtkMatrix4x4> InverseTextureToDataSetMat;
+
+  vtkNew<vtkMatrix4x4> InverseProjectionMat;
+  vtkNew<vtkMatrix4x4> InverseModelViewMat;
+  vtkNew<vtkMatrix4x4> InverseVolumeMat;
+
+  vtkSmartPointer<vtkPolyData> BBoxPolyData;
+
+  vtkMapMaskTextureId* MaskTextures;
+  vtkVolumeMask* CurrentMask;
+
+  vtkImageData* PrevInput;
+};
+
+//----------------------------------------------------------------------------
+template<typename T>
+void vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::ToFloat(
+  const T& in1, const T& in2, float (&out)[2])
+{
+  out[0] = static_cast<float>(in1);
+  out[1] = static_cast<float>(in2);
+}
+
+template<typename T>
+void vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::ToFloat(
+  const T& in1, const T& in2, const T& in3, float (&out)[3])
+{
+  out[0] = static_cast<float>(in1);
+  out[1] = static_cast<float>(in2);
+  out[2] = static_cast<float>(in3);
+}
+
+//----------------------------------------------------------------------------
+template<typename T>
+void vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::ToFloat(
+  T* in, float* out, int numberOfComponents)
+{
+  for (int i = 0; i < numberOfComponents; ++i)
+    {
+    out[i] = static_cast<float>(in[i]);
+    }
+}
+
+//----------------------------------------------------------------------------
+template<typename T>
+void vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::ToFloat(
+  T (&in)[3], float (&out)[3])
+{
+  out[0] = static_cast<float>(in[0]);
+  out[1] = static_cast<float>(in[1]);
+  out[2] = static_cast<float>(in[2]);
+}
+
+//----------------------------------------------------------------------------
+template<typename T>
+void vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::ToFloat(
+  T (&in)[2], float (&out)[2])
+{
+  out[0] = static_cast<float>(in[0]);
+  out[1] = static_cast<float>(in[1]);
+}
+
+//----------------------------------------------------------------------------
+template<typename T>
+void vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::ToFloat(
+  T& in, float& out)
+{
+  out = static_cast<float>(in);
+}
+
+//----------------------------------------------------------------------------
+void vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::VtkToGlMatrix(
+  vtkMatrix4x4* in, float (&out)[16])
+{
+  for (int i = 0; i < 4; ++i)
+    {
+    for (int j = 0; j < 4; ++j)
+      {
+      out[j * 4 + i] = in->Element[i][j];
+      }
+    }
+}
+
+//----------------------------------------------------------------------------
+void vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::Initialize(
+  vtkRenderer* vtkNotUsed(ren), vtkVolume* vtkNotUsed(vol))
+{
+  GLenum err = glewInit();
+  if (GLEW_OK != err)
+    {
+    cerr <<"Error: "<< glewGetErrorString(err)<<endl;
+    }
+
+  // This is to ignore INVALID ENUM error 1282
+  err = glGetError();
+
+  // Create RGB lookup table
+  this->RGBTable = new vtkOpenGLRGBTable();
+
+  if (this->Parent->MaskInput != 0 &&
+      this->Parent->MaskType == LabelMapMaskType)
+    {
+    if(this->Mask1RGBTable == 0)
+      {
+      this->Mask1RGBTable = new vtkOpenGLRGBTable();
+      }
+    if(this->Mask2RGBTable == 0)
+      {
+      this->Mask2RGBTable = new vtkOpenGLRGBTable();
+      }
+    }
+
+  // TODO Currently we are supporting only one level
+  // Create opacity lookup table
+  this->OpacityTables = new vtkOpenGLOpacityTables(1);
+
+  this->Initialized = true;
+}
+
+//----------------------------------------------------------------------------
+bool vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::LoadVolume(
+  vtkImageData* imageData, vtkDataArray* scalars)
+{
+  // Generate OpenGL texture
+  glActiveTexture(GL_TEXTURE0);
+  glGenTextures(1, &this->VolumeTextureId);
+  glBindTexture(GL_TEXTURE_3D, this->VolumeTextureId);
+
+  // Set the texture parameters
+  glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+  glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+  glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE);
+  GLfloat borderColor[4]={0.0,0.0,0.0,0.0};
+  glTexParameterfv(GL_TEXTURE_3D,GL_TEXTURE_BORDER_COLOR, borderColor);
+  glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+  glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+
+  // Allocate data with internal format and foramt as (GL_RED)
+  GLint internalFormat = 0;
+  GLenum format = 0;
+  GLenum type = 0;
+
+  double shift = 0.0;
+  double scale = 1.0;
+  bool handleLargeDataTypes = false;
+
+  int scalarType = scalars->GetDataType();
+  if (scalars->GetNumberOfComponents()==4)
+    {
+    internalFormat = GL_RGBA16;
+    format = GL_RGBA;
+    type = GL_UNSIGNED_BYTE;
+    }
+  else
+    {
+    switch(scalarType)
+      {
+      case VTK_FLOAT:
+      if (glewIsSupported("GL_ARB_texture_float"))
+        {
+        internalFormat = GL_INTENSITY16F_ARB;
+        }
+      else
+        {
+        internalFormat = GL_INTENSITY16;
+        }
+        format = GL_RED;
+        type = GL_FLOAT;
+        shift=-ScalarsRange[0];
+        scale = 1/(this->ScalarsRange[1]-this->ScalarsRange[0]);
+        break;
+      case VTK_UNSIGNED_CHAR:
+        internalFormat = GL_INTENSITY8;
+        format = GL_RED;
+        type = GL_UNSIGNED_BYTE;
+        shift = -this->ScalarsRange[0]/VTK_UNSIGNED_CHAR_MAX;
+        scale =
+          VTK_UNSIGNED_CHAR_MAX/(this->ScalarsRange[1]-this->ScalarsRange[0]);
+        break;
+      case VTK_SIGNED_CHAR:
+        internalFormat = GL_INTENSITY8;
+        format = GL_RED;
+        type = GL_BYTE;
+        shift = -(2 * this->ScalarsRange[0] + 1)/VTK_UNSIGNED_CHAR_MAX;
+        scale = VTK_SIGNED_CHAR_MAX / (this->ScalarsRange[1] -
+                                       this->ScalarsRange[0]);
+        break;
+      case VTK_CHAR:
+        // not supported
+        assert("check: impossible case" && 0);
+        break;
+      case VTK_BIT:
+        // not supported
+        assert("check: impossible case" && 0);
+        break;
+      case VTK_ID_TYPE:
+        // not supported
+        assert("check: impossible case" && 0);
+        break;
+      case VTK_INT:
+        internalFormat = GL_INTENSITY16;
+        format = GL_RED;
+        type = GL_INT;
+        shift=-(2*this->ScalarsRange[0]+1)/VTK_UNSIGNED_INT_MAX;
+        scale = VTK_INT_MAX/(this->ScalarsRange[1]-this->ScalarsRange[0]);
+        break;
+      case VTK_DOUBLE:
+      case VTK___INT64:
+      case VTK_LONG:
+      case VTK_LONG_LONG:
+      case VTK_UNSIGNED___INT64:
+      case VTK_UNSIGNED_LONG:
+      case VTK_UNSIGNED_LONG_LONG:
+        handleLargeDataTypes = true;
+        if (glewIsSupported("GL_ARB_texture_float"))
+          {
+          internalFormat=GL_INTENSITY16F_ARB;
+          }
+        else
+          {
+          internalFormat=GL_INTENSITY16;
+          }
+        format = GL_RED;
+        type = GL_FLOAT;
+        shift = -this->ScalarsRange[0];
+        scale = 1 / (this->ScalarsRange[1] - this->ScalarsRange[0]);
+        break;
+      case VTK_SHORT:
+        internalFormat = GL_INTENSITY16;
+        format = GL_RED;
+        type = GL_SHORT;
+        shift = -(2*this->ScalarsRange[0]+1)/VTK_UNSIGNED_SHORT_MAX;
+        scale = VTK_SHORT_MAX / (this->ScalarsRange[1] -
+                                 this->ScalarsRange[0]);
+        break;
+      case VTK_STRING:
+        // not supported
+        assert("check: impossible case" && 0);
+        break;
+      case VTK_UNSIGNED_SHORT:
+        internalFormat = GL_INTENSITY16;
+        format = GL_RED;
+        type = GL_UNSIGNED_SHORT;
+
+        shift=-this->ScalarsRange[0]/VTK_UNSIGNED_SHORT_MAX;
+        scale=
+          VTK_UNSIGNED_SHORT_MAX / (this->ScalarsRange[1] -
+                                    this->ScalarsRange[0]);
+        break;
+      case VTK_UNSIGNED_INT:
+        internalFormat = GL_INTENSITY16;
+        format = GL_RED;
+        type = GL_UNSIGNED_INT;
+        shift=-this->ScalarsRange[0]/VTK_UNSIGNED_INT_MAX;
+        scale = VTK_UNSIGNED_INT_MAX / (this->ScalarsRange[1] -
+                                        this->ScalarsRange[0]);
+        break;
+      default:
+        assert("check: impossible case" && 0);
+        break;
+      }
+    }
+
+  // Update scale and bias
+  this->Scale = scale;
+  this->Bias = shift * this->Scale;
+
+  imageData->GetExtent(this->Extents);
+
+  int i = 0;
+  while(i < 3)
+    {
+    this->TextureSize[i] = this->Extents[2*i+1] - this->Extents[2*i] + 1;
+    ++i;
+    }
+
+  if (!handleLargeDataTypes)
+    {
+    void* dataPtr = scalars->GetVoidPointer(0);
+
+    glPixelTransferf(GL_RED_SCALE,static_cast<GLfloat>(this->Scale));
+    glPixelTransferf(GL_RED_BIAS,static_cast<GLfloat>(this->Bias));
+    glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+    glTexImage3D(GL_TEXTURE_3D, 0, internalFormat,
+                 this->TextureSize[0],this->TextureSize[1],
+                 this->TextureSize[2], 0,
+                 format, type, dataPtr);
+
+
+
+    // Set scale and bias to their defaults
+    glPixelTransferf(GL_RED_SCALE,1.0);
+    glPixelTransferf(GL_RED_BIAS, 0.0);
+    }
+  else
+    {
+    // Convert and send to the GPU, z-slice by z-slice so that we won't allocate
+    // memory at once.Allocate memory on the GPU (NULL data pointer with the
+    // right dimensions). Here we are assuming that
+    // GL_ARB_texture_non_power_of_two is available
+    glPixelStorei( GL_UNPACK_ALIGNMENT, 1 );
+
+    glTexImage3D(GL_TEXTURE_3D, 0, internalFormat,
+                 this->TextureSize[0], this->TextureSize[1],
+                 this->TextureSize[2], 0, format, type, 0);
+
+    // Send the slices one by one to the GPU. We are not sending all of them
+    // together so as to avoid allocating big data on the GPU which may not
+    // work if the original dataset is big as well.
+    vtkFloatArray* sliceArray=vtkFloatArray::New();
+    sliceArray->SetNumberOfComponents(1);
+    sliceArray->SetNumberOfTuples(this->TextureSize[0] * this->TextureSize[1]);
+    void* slicePtr = sliceArray->GetVoidPointer(0);
+    int k = 0;
+    int kInc = (this->Dimensions[0] - this->Parent->CellFlag) *
+               (this->Dimensions[1] - this->Parent->CellFlag);
+    int kOffset = (this->Extents[4] *
+                  (this->Dimensions[1] - this->Parent->CellFlag) +
+                   this->Extents[2]) *
+                  (this->Dimensions[0] - this->Parent->CellFlag) +
+                   this->Extents[0];
+    while(k < this->TextureSize[2])
+      {
+      int j = 0;
+      int jOffset = 0;
+      int jDestOffset = 0;
+      while(j < this->TextureSize[1])
+        {
+        i = 0;
+        while(i < this->TextureSize[0])
+          {
+          sliceArray->SetTuple1(jDestOffset + i,
+                                (scalars->GetTuple1(kOffset + jOffset + i) +
+                                 shift)*scale);
+          ++i;
+          }
+        ++j;
+        jOffset += this->Dimensions[0] - this->Parent->CellFlag;
+        jDestOffset += this->TextureSize[0];
+        }
+
+      // Here we are assuming that GL_ARB_texture_non_power_of_two is
+      // available
+      glTexSubImage3D(GL_TEXTURE_3D, 0, 0, 0, k,
+                      this->TextureSize[0], this->TextureSize[1], 1,
+                      format,type, slicePtr);
+      ++k;
+      kOffset += kInc;
+      }
+    sliceArray->Delete();
+    }
+
+  return 1;
+}
+
+//-----------------------------------------------------------------------------
+bool vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::LoadMask(
+  vtkImageData* vtkNotUsed(input), vtkImageData* maskInput,
+  int textureExtent[6], vtkVolume* vtkNotUsed(volume))
+{
+  bool result = true;
+
+  // Mask
+  if(maskInput != 0)
+    {
+    // Find the texture.
+    std::map<vtkImageData *,vtkVolumeMask*>::iterator it2 =
+      this->MaskTextures->Map.find(maskInput);
+
+    vtkVolumeMask* mask;
+    if(it2 == this->MaskTextures->Map.end())
+      {
+      mask = new vtkVolumeMask();
+      this->MaskTextures->Map[maskInput] = mask;
+      }
+    else
+      {
+      mask = (*it2).second;
+      }
+
+    mask->Update(maskInput,
+                 this->Parent->CellFlag,
+                 textureExtent,
+                 this->Parent->ScalarMode,
+                 this->Parent->ArrayAccessMode,
+                 this->Parent->ArrayId,
+                 this->Parent->ArrayName,
+                 static_cast<vtkIdType>(static_cast<float>(
+                   this->Parent->MaxMemoryInBytes) *
+                   this->Parent->MaxMemoryFraction));
+
+    result = result && mask->IsLoaded();
+    this->CurrentMask = mask;
+    }
+
+  return result;
+}
+
+//----------------------------------------------------------------------------
+bool vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::IsInitialized()
+{
+  return this->Initialized;
+}
+
+//----------------------------------------------------------------------------
+void vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::CompileAndLinkShader(
+  const std::string& vertexShader, const std::string& fragmentShader)
+{
+  this->Shader.LoadFromString(GL_VERTEX_SHADER, vertexShader);
+  this->Shader.LoadFromString(GL_FRAGMENT_SHADER, fragmentShader);
+
+  // Compile and link the shader
+  this->Shader.CreateAndLinkProgram();
+}
+
+//----------------------------------------------------------------------------
+void vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::ComputeBounds(
+  vtkImageData* input)
+{
+  double origin[3];
+
+  input->GetSpacing(this->CellSpacing);
+  input->GetOrigin(origin);
+  input->GetExtent(this->Extents);
+
+  int swapBounds[3];
+  swapBounds[0] = (this->CellSpacing[0] < 0);
+  swapBounds[1] = (this->CellSpacing[1] < 0);
+  swapBounds[2] = (this->CellSpacing[2] < 0);
+
+  // Loaded data represents points
+  if (!this->Parent->CellFlag)
+    {
+    // If spacing is negative, we may have to rethink the equation
+    // between real point and texture coordinate...
+    this->LoadedBounds[0] = origin[0] +
+      static_cast<double>(this->Extents[0 + swapBounds[0]]) *
+      this->CellSpacing[0];
+    this->LoadedBounds[2] = origin[1] +
+      static_cast<double>(this->Extents[2 + swapBounds[1]]) *
+      this->CellSpacing[1];
+    this->LoadedBounds[4] = origin[2] +
+      static_cast<double>(this->Extents[4 + swapBounds[2]]) *
+      this->CellSpacing[2];
+    this->LoadedBounds[1] = origin[0] +
+      static_cast<double>(this->Extents[1 - swapBounds[0]]) *
+      this->CellSpacing[0];
+    this->LoadedBounds[3] = origin[1] +
+      static_cast<double>(this->Extents[3 - swapBounds[1]]) *
+      this->CellSpacing[1];
+    this->LoadedBounds[5] = origin[2] +
+      static_cast<double>(this->Extents[5 - swapBounds[2]]) *
+      this->CellSpacing[2];
+    }
+  // Loaded extents represent cells
+  else
+    {
+    int wholeTextureExtent[6];
+    input->GetExtent(wholeTextureExtent);
+    int i = 1;
+    while (i < 6)
+      {
+      wholeTextureExtent[i]--;
+      i += 2;
+      }
+
+    i = 0;
+    while (i < 3)
+      {
+      if(this->Extents[2 * i] == wholeTextureExtent[2 * i])
+        {
+        this->LoadedBounds[2 * i + swapBounds[i]] = origin[i];
+        }
+      else
+        {
+        this->LoadedBounds[2 * i + swapBounds[i]] = origin[i] +
+          (static_cast<double>(this->Extents[2 * i]) + 0.5) *
+          this->CellSpacing[i];
+        }
+
+      if(this->Extents[2 * i + 1] == wholeTextureExtent[2 * i + 1])
+        {
+        this->LoadedBounds[2 * i + 1 - swapBounds[i]] = origin[i] +
+          (static_cast<double>(this->Extents[2 * i + 1]) + 1.0) *
+          this->CellSpacing[i];
+        }
+      else
+        {
+        this->LoadedBounds[2 * i + 1-swapBounds[i]] = origin[i] +
+          (static_cast<double>(this->Extents[2 * i + 1]) + 0.5) *
+          this->CellSpacing[i];
+        }
+      ++i;
+      }
+    }
+}
+
+//----------------------------------------------------------------------------
+int vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::UpdateColorTransferFunction(
+  vtkVolume* vol, int numberOfScalarComponents)
+{
+  // Build the colormap in a 1D texture.
+  // 1D RGB-texture=mapping from scalar values to color values
+  // build the table.
+  if(numberOfScalarComponents == 1)
+    {
+    vtkVolumeProperty* volumeProperty = vol->GetProperty();
+    vtkColorTransferFunction* colorTransferFunction =
+      volumeProperty->GetRGBTransferFunction(0);
+
+    // Add points only if its not being added before
+    if (colorTransferFunction->GetSize() < 1)
+      {
+      colorTransferFunction->AddRGBPoint(this->ScalarsRange[0], 0.0, 0.0, 0.0);
+      colorTransferFunction->AddRGBPoint(this->ScalarsRange[1], 1.0, 1.0, 1.0);
+      }
+
+    this->RGBTable->Update(
+      colorTransferFunction, this->ScalarsRange,
+      volumeProperty->GetInterpolationType() == VTK_LINEAR_INTERPOLATION);
+    }
+
+  if (this->Parent->MaskInput != 0 &&
+      this->Parent->MaskType == LabelMapMaskType)
+    {
+    vtkVolumeProperty* volumeProperty = vol->GetProperty();
+
+    vtkColorTransferFunction* colorTransferFunc =
+      volumeProperty->GetRGBTransferFunction(1);
+    this->Mask1RGBTable->Update(colorTransferFunc, this->ScalarsRange,
+                                false, 7);
+
+    colorTransferFunc = volumeProperty->GetRGBTransferFunction(2);
+    this->Mask2RGBTable->Update(colorTransferFunc, this->ScalarsRange,
+                                false, 8);
+    }
+
+  return 0;
+}
+
+//----------------------------------------------------------------------------
+int vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::UpdateOpacityTransferFunction(
+  vtkVolume* vol, int vtkNotUsed(numberOfScalarComponents), unsigned int level)
+{
+  if (!vol)
+    {
+    std::cerr << "Invalid m_volume" << std::endl;
+    return 1;
+    }
+
+  vtkVolumeProperty* volumeProperty = vol->GetProperty();
+  vtkPiecewiseFunction* scalarOpacity = volumeProperty->GetScalarOpacity();
+
+  // TODO: Do a better job to create the default opacity map
+  // Add points only if its not being added before
+  if (scalarOpacity->GetSize() < 1)
+    {
+    scalarOpacity->AddPoint(this->ScalarsRange[0], 0.0);
+    scalarOpacity->AddPoint(this->ScalarsRange[1], 0.5);
+    }
+
+  this->OpacityTables->GetTable(level)->Update(
+    scalarOpacity,this->Parent->BlendMode,
+    this->ActualSampleDistance,
+    this->ScalarsRange,
+    volumeProperty->GetScalarOpacityUnitDistance(),
+    volumeProperty->GetInterpolationType() == VTK_LINEAR_INTERPOLATION);
+  return 0;
+}
+
+//----------------------------------------------------------------------------
+int vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::
+  UpdateGradientOpacityTransferFunction(vtkVolume* vol,
+    int vtkNotUsed(numberOfScalarComponents), unsigned int level)
+{
+  if (!vol)
+    {
+    std::cerr << "Invalid m_volume" << std::endl;
+    return 1;
+    }
+
+  vtkVolumeProperty* volumeProperty = vol->GetProperty();
+  vtkPiecewiseFunction* gradientOpacity = volumeProperty->GetGradientOpacity();
+
+  if (!this->GradientOpacityTables && gradientOpacity)
+    {
+    // NOTE Handling only one component
+    this->GradientOpacityTables = new vtkOpenGLGradientOpacityTables(1);
+    }
+
+  // TODO: Do a better job to create the default opacity map
+  // Add points only if its not being added before
+  if (gradientOpacity->GetSize() < 1)
+    {
+    gradientOpacity->AddPoint(this->ScalarsRange[0], 0.0);
+    gradientOpacity->AddPoint(this->ScalarsRange[1], 0.5);
+    }
+
+  this->GradientOpacityTables->GetTable(level)->Update(
+    gradientOpacity,
+    this->ActualSampleDistance,
+    this->ScalarsRange,
+    volumeProperty->GetScalarOpacityUnitDistance(),
+    volumeProperty->GetInterpolationType() == VTK_LINEAR_INTERPOLATION);
+
+  return 0;
+}
+
+//----------------------------------------------------------------------------
+void vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::UpdateNoiseTexture()
+{
+  if (!this->NoiseTextureId)
+    {
+    glActiveTexture(GL_TEXTURE3);
+    glGenTextures(1, &this->NoiseTextureId);
+    glBindTexture(GL_TEXTURE_2D, this->NoiseTextureId);
+
+    GLsizei size = 128;
+    GLint maxSize;
+
+    glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxSize);
+    if (size > maxSize)
+      {
+      size=maxSize;
+      }
+
+    if (this->NoiseTextureData != 0 && this->NoiseTextureSize != size)
+      {
+      delete[] this->NoiseTextureData;
+      this->NoiseTextureData = 0;
+      }
+
+    if (this->NoiseTextureData == 0)
+      {
+      this->NoiseTextureData = new float[size * size];
+      this->NoiseTextureSize = size;
+      vtkNew<vtkPerlinNoise> noiseGenerator;
+      noiseGenerator->SetFrequency(size, 1.0, 1.0);
+      noiseGenerator->SetPhase(0.0, 0.0, 0.0);
+      // -0.5 and 0.5 range
+      noiseGenerator->SetAmplitude(0.5);
+      int j = 0;
+      while(j < size)
+        {
+        int i = 0;
+        while(i < size)
+          {
+          this->NoiseTextureData[j * size + i] =
+            static_cast<float>(noiseGenerator->EvaluateFunction(i, j, 0.0));
+          ++i;
+          }
+        ++j;
+        }
+      }
+    glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, size, size, 0,
+                 GL_RED, GL_FLOAT, this->NoiseTextureData);
+
+    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
+    glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
+    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+    glActiveTexture(GL_TEXTURE0);
+    }
+}
+
+//----------------------------------------------------------------------------
+void vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::UpdateDepthTexture(
+  vtkRenderer* ren, vtkVolume* vtkNotUsed(vol))
+{
+  // Make sure our render window is the current OpenGL context
+  ren->GetRenderWindow()->MakeCurrent();
+
+  // Load required extensions for grabbing depth sampler buffer
+  if (!this->LoadDepthTextureExtensionsSucceeded)
+    {
+    this->LoadRequireDepthTextureExtensions(ren->GetRenderWindow());
+    }
+
+  // If we can't load the necessary extensions, provide
+  // feedback on why it failed.
+  if(!this->LoadDepthTextureExtensionsSucceeded)
+    {
+    std::cerr << this->ExtensionsStringStream.str() << std::endl;
+    return;
+    }
+
+  // Now grab the depth sampler buffer as texture
+  ren->GetTiledSizeAndOrigin(this->WindowSize, this->WindowSize + 1,
+                             this->WindowLowerLeft, this->WindowLowerLeft + 1);
+
+  glActiveTexture(GL_TEXTURE4);
+  if (!this->DepthTextureId)
+    {
+    // TODO Use framebuffer objects for best performance
+    glGenTextures(1, &this->DepthTextureId);
+    glBindTexture(GL_TEXTURE_2D, this->DepthTextureId);
+    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
+    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
+    glTexParameteri(GL_TEXTURE_2D, GL_DEPTH_TEXTURE_MODE, GL_LUMINANCE);
+    }
+  glBindTexture(GL_TEXTURE_2D, this->DepthTextureId);
+  glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT32,
+               this->WindowSize[0], this->WindowSize[1],
+               0, GL_DEPTH_COMPONENT, GL_FLOAT, NULL );
+  glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0 , 0,
+                      this->WindowLowerLeft[0], this->WindowLowerLeft[1],
+                      this->WindowSize[0], this->WindowSize[1]);
+  glActiveTexture(GL_TEXTURE0);
+}
+
+//----------------------------------------------------------------------------
+bool vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::IsCameraInside(
+  vtkRenderer* ren, vtkVolume* vtkNotUsed(vol))
+{
+  vtkNew<vtkMatrix4x4> tempMat;
+
+  vtkMatrix4x4::Transpose(this->InverseVolumeMat.GetPointer(),
+                          tempMat.GetPointer());
+
+  vtkCamera* cam = ren->GetActiveCamera();
+  double camWorldRange[2];
+  double camWorldPos[4];
+  double camFocalWorldPoint[4];
+  double camWorldDirection[4];
+  double camPos[4];
+  double camPlaneNormal[4];
+
+  cam->GetPosition(camWorldPos);
+  camWorldPos[3] = 1.0;
+  this->InverseVolumeMat->MultiplyPoint( camWorldPos, camPos );
+  if ( camPos[3] )
+    {
+    camPos[0] /= camPos[3];
+    camPos[1] /= camPos[3];
+    camPos[2] /= camPos[3];
+    }
+
+  cam->GetFocalPoint(camFocalWorldPoint);
+  camFocalWorldPoint[3]=1.0;
+
+  // The range (near/far) must also be transformed
+  // into the local coordinate system.
+  camWorldDirection[0] = camFocalWorldPoint[0] - camWorldPos[0];
+  camWorldDirection[1] = camFocalWorldPoint[1] - camWorldPos[1];
+  camWorldDirection[2] = camFocalWorldPoint[2] - camWorldPos[2];
+  camWorldDirection[3] = 1.0;
+
+  // Compute the normalized near plane normal
+  tempMat->MultiplyPoint( camWorldDirection, camPlaneNormal );
+
+  vtkMath::Normalize(camWorldDirection);
+  vtkMath::Normalize(camPlaneNormal);
+
+  double camNearWorldPoint[4];
+  double camNearPoint[4];
+
+  cam->GetClippingRange(camWorldRange);
+  camNearWorldPoint[0] = camWorldPos[0] + camWorldRange[0]*camWorldDirection[0];
+  camNearWorldPoint[1] = camWorldPos[1] + camWorldRange[0]*camWorldDirection[1];
+  camNearWorldPoint[2] = camWorldPos[2] + camWorldRange[0]*camWorldDirection[2];
+  camNearWorldPoint[3] = 1.;
+
+  this->InverseVolumeMat->MultiplyPoint( camNearWorldPoint, camNearPoint );
+  if (camNearPoint[3]!=0.0)
+    {
+    camNearPoint[0] /= camNearPoint[3];
+    camNearPoint[1] /= camNearPoint[3];
+    camNearPoint[2] /= camNearPoint[3];
+    }
+
+  double tolerance[3] = { 1e-12, 1e-12, 1e-12 };
+  if (vtkMath::PointIsWithinBounds(camNearPoint, this->LoadedBounds, tolerance))
+    {
+    return true;
+    }
+
+  return false;
+}
+
+//----------------------------------------------------------------------------
+void vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::UpdateVolumeGeometry(
+  vtkRenderer* ren, vtkVolume* vol, vtkImageData* input)
+{
+  if (input != this->PrevInput || this->IsCameraInside(ren, vol) ||
+      this->CameraWasInsideInLastUpdate)
+    {
+    vtkNew<vtkTessellatedBoxSource> boxSource;
+    boxSource->SetBounds(this->LoadedBounds);
+    boxSource->QuadsOn();
+    boxSource->SetLevel(0);
+
+    vtkNew<vtkDensifyPolyData> densityPolyData;
+
+    if (input == this->PrevInput && this->IsCameraInside(ren, vol))
+      {
+      // Normals should be transformed using the transpose of inverse
+      // InverseVolumeMat
+      vtkNew<vtkMatrix4x4> tempMat;
+      vtkMatrix4x4::Transpose(this->InverseVolumeMat.GetPointer(),
+                              tempMat.GetPointer());
+
+      vtkCamera* cam = ren->GetActiveCamera();
+      double camWorldRange[2];
+      double camWorldPos[4];
+      double camFocalWorldPoint[4];
+      double camWorldDirection[4];
+      double camPos[4];
+      double camPlaneNormal[4];
+
+      cam->GetPosition(camWorldPos);
+      camWorldPos[3] = 1.0;
+      this->InverseVolumeMat->MultiplyPoint( camWorldPos, camPos );
+      if ( camPos[3] )
+        {
+        camPos[0] /= camPos[3];
+        camPos[1] /= camPos[3];
+        camPos[2] /= camPos[3];
+        }
+
+      cam->GetFocalPoint(camFocalWorldPoint);
+      camFocalWorldPoint[3]=1.0;
+
+      // The range (near/far) must also be transformed
+      // into the local coordinate system.
+      camWorldDirection[0] = camFocalWorldPoint[0] - camWorldPos[0];
+      camWorldDirection[1] = camFocalWorldPoint[1] - camWorldPos[1];
+      camWorldDirection[2] = camFocalWorldPoint[2] - camWorldPos[2];
+      camWorldDirection[3] = 1.0;
+
+      // Compute the normalized near plane normal
+      tempMat->MultiplyPoint( camWorldDirection, camPlaneNormal );
+
+      vtkMath::Normalize(camWorldDirection);
+      vtkMath::Normalize(camPlaneNormal);
+
+      double camNearWorldPoint[4];
+      double camFarWorldPoint[4];
+      double camNearPoint[4];
+      double camFarPoint[4];
+
+      cam->GetClippingRange(camWorldRange);
+      camNearWorldPoint[0] = camWorldPos[0] + camWorldRange[0]*camWorldDirection[0];
+      camNearWorldPoint[1] = camWorldPos[1] + camWorldRange[0]*camWorldDirection[1];
+      camNearWorldPoint[2] = camWorldPos[2] + camWorldRange[0]*camWorldDirection[2];
+      camNearWorldPoint[3] = 1.;
+
+      camFarWorldPoint[0] = camWorldPos[0] + camWorldRange[1]*camWorldDirection[0];
+      camFarWorldPoint[1] = camWorldPos[1] + camWorldRange[1]*camWorldDirection[1];
+      camFarWorldPoint[2] = camWorldPos[2] + camWorldRange[1]*camWorldDirection[2];
+      camFarWorldPoint[3] = 1.;
+
+      this->InverseVolumeMat->MultiplyPoint( camNearWorldPoint, camNearPoint );
+      if (camNearPoint[3]!=0.0)
+        {
+        camNearPoint[0] /= camNearPoint[3];
+        camNearPoint[1] /= camNearPoint[3];
+        camNearPoint[2] /= camNearPoint[3];
+        }
+
+      this->InverseVolumeMat->MultiplyPoint( camFarWorldPoint, camFarPoint );
+      if (camFarPoint[3]!=0.0)
+        {
+        camFarPoint[0] /= camFarPoint[3];
+        camFarPoint[1] /= camFarPoint[3];
+        camFarPoint[2] /= camFarPoint[3];
+        }
+
+      vtkNew<vtkPlane> nearPlane;
+
+      // We add an offset to the near plane to avoid hardware clipping of the
+      // near plane due to floating-point precision.
+      // camPlaneNormal is a unit vector, if the offset is larger than the
+      // distance between near and far point, it will not work, in this case we
+      // pick a fraction of the near-far distance.
+      // 100.0 and 1000.0 are chosen based on the typical epsilon values on
+      // x86 systems.
+      double offset =  static_cast<double>(
+                         std::numeric_limits<float>::epsilon()) * 100.0;
+      if(offset > 0.001)
+        {
+        double newOffset = sqrt(vtkMath::Distance2BetweenPoints(
+                             camNearPoint, camFarPoint)) / 1000.0;
+        offset = offset > newOffset ? newOffset : offset;
+        }
+
+      camNearPoint[0] += camPlaneNormal[0]*offset;
+      camNearPoint[1] += camPlaneNormal[1]*offset;
+      camNearPoint[2] += camPlaneNormal[2]*offset;
+
+      nearPlane->SetOrigin( camNearPoint );
+      nearPlane->SetNormal( camPlaneNormal );
+
+      vtkNew<vtkPlaneCollection> planes;
+      planes->RemoveAllItems();
+      planes->AddItem(nearPlane.GetPointer());
+
+      vtkNew<vtkClipConvexPolyData> clip;
+      clip->SetInputConnection(boxSource->GetOutputPort());
+      clip->SetPlanes(planes.GetPointer());
+
+      densityPolyData->SetInputConnection(clip->GetOutputPort());
+
+      this->CameraWasInsideInLastUpdate = true;
+      }
+    else
+      {
+      densityPolyData->SetInputConnection(boxSource->GetOutputPort());
+      this->CameraWasInsideInLastUpdate = false;
+      }
+
+    densityPolyData->SetNumberOfSubdivisions(2);
+    densityPolyData->Update();
+
+    this->BBoxPolyData = vtkSmartPointer<vtkPolyData>::New();
+    this->BBoxPolyData->ShallowCopy(densityPolyData->GetOutput());
+    vtkPoints* points = this->BBoxPolyData->GetPoints();
+    vtkCellArray* cells = this->BBoxPolyData->GetPolys();
+
+    vtkNew<vtkUnsignedIntArray> polys;
+    polys->SetNumberOfComponents(3);
+    vtkIdType npts;
+    vtkIdType *pts;
+
+    while(cells->GetNextCell(npts, pts))
+      {
+      polys->InsertNextTuple3(pts[0], pts[1], pts[2]);
+      }
+
+    // Dispose any previously created buffers
+    this->DeleteBufferObjects();
+
+    // Now create new ones
+    this->CreateBufferObjects();
+
+#ifndef __APPLE__
+    glBindVertexArray(this->CubeVAOId);
+#endif
+    // Pass cube vertices to buffer object memory
+    glBindBuffer (GL_ARRAY_BUFFER, this->CubeVBOId);
+    glBufferData (GL_ARRAY_BUFFER, points->GetData()->GetDataSize() *
+                  points->GetData()->GetDataTypeSize(),
+                  points->GetData()->GetVoidPointer(0), GL_STATIC_DRAW);
+
+    // Enable vertex attributre array for position
+    // and pass indices to element array  buffer
+    glEnableVertexAttribArray(this->Shader["m_in_vertex_pos"]);
+    glVertexAttribPointer(this->Shader["m_in_vertex_pos"],
+                          3, GL_FLOAT, GL_FALSE, 0, 0);
+
+    glBindBuffer (GL_ELEMENT_ARRAY_BUFFER, this->CubeIndicesId);
+    glBufferData (GL_ELEMENT_ARRAY_BUFFER, polys->GetDataSize() *
+                  polys->GetDataTypeSize(), polys->GetVoidPointer(0),
+                  GL_STATIC_DRAW);
+    }
+  else
+    {
+#ifndef __APPLE__
+    glBindVertexArray(this->CubeVAOId);
+#else
+    glBindBuffer (GL_ARRAY_BUFFER, this->CubeVBOId);
+    glEnableVertexAttribArray(this->Shader["m_in_vertex_pos"]);
+    glVertexAttribPointer(this->Shader["m_in_vertex_pos"],
+                          3, GL_FLOAT, GL_FALSE, 0, 0);
+    glBindBuffer (GL_ELEMENT_ARRAY_BUFFER, this->CubeIndicesId);
+#endif
+    }
+}
+
+//----------------------------------------------------------------------------
+void vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::UpdateCropping(
+  vtkRenderer* vtkNotUsed(ren), vtkVolume* vtkNotUsed(vol))
+{
+  if (this->Parent->GetCropping())
+    {
+    int cropFlags = this->Parent->GetCroppingRegionFlags();
+    double croppingRegionPlanes[6];
+    this->Parent->GetCroppingRegionPlanes(croppingRegionPlanes);
+
+    // Clamp it
+    croppingRegionPlanes[0] = croppingRegionPlanes[0] < this->LoadedBounds[0] ?
+                              this->LoadedBounds[0] : croppingRegionPlanes[0];
+    croppingRegionPlanes[0] = croppingRegionPlanes[0] > this->LoadedBounds[1] ?
+                              this->LoadedBounds[1] : croppingRegionPlanes[0];
+    croppingRegionPlanes[1] = croppingRegionPlanes[1] < this->LoadedBounds[0] ?
+                              this->LoadedBounds[0] : croppingRegionPlanes[1];
+    croppingRegionPlanes[1] = croppingRegionPlanes[1] > this->LoadedBounds[1] ?
+                              this->LoadedBounds[1] : croppingRegionPlanes[1];
+
+    croppingRegionPlanes[2] = croppingRegionPlanes[2] < this->LoadedBounds[2] ?
+                              this->LoadedBounds[2] : croppingRegionPlanes[2];
+    croppingRegionPlanes[2] = croppingRegionPlanes[2] > this->LoadedBounds[3] ?
+                              this->LoadedBounds[3] : croppingRegionPlanes[2];
+    croppingRegionPlanes[3] = croppingRegionPlanes[3] < this->LoadedBounds[2] ?
+                              this->LoadedBounds[2] : croppingRegionPlanes[3];
+    croppingRegionPlanes[3] = croppingRegionPlanes[3] > this->LoadedBounds[3] ?
+                              this->LoadedBounds[3] : croppingRegionPlanes[3];
+
+    croppingRegionPlanes[4] = croppingRegionPlanes[4] < this->LoadedBounds[4] ?
+                              this->LoadedBounds[4] : croppingRegionPlanes[4];
+    croppingRegionPlanes[4] = croppingRegionPlanes[4] > this->LoadedBounds[5] ?
+                              this->LoadedBounds[5] : croppingRegionPlanes[4];
+    croppingRegionPlanes[5] = croppingRegionPlanes[5] < this->LoadedBounds[4] ?
+                              this->LoadedBounds[4] : croppingRegionPlanes[5];
+    croppingRegionPlanes[5] = croppingRegionPlanes[5] > this->LoadedBounds[5] ?
+                              this->LoadedBounds[5] : croppingRegionPlanes[5];
+
+    float cropPlanes[6] = { static_cast<float>(croppingRegionPlanes[0]),
+                            static_cast<float>(croppingRegionPlanes[1]),
+                            static_cast<float>(croppingRegionPlanes[2]),
+                            static_cast<float>(croppingRegionPlanes[3]),
+                            static_cast<float>(croppingRegionPlanes[4]),
+                            static_cast<float>(croppingRegionPlanes[5]) };
+
+    glUniform1fv(this->Shader("cropping_planes"), 6, cropPlanes);
+    const int numberOfRegions = 32;
+    int cropFlagsArray[numberOfRegions];
+    cropFlagsArray[0] = 0;
+    int i = 1;
+    while(cropFlags && i < 32)
+      {
+      cropFlagsArray[i] = cropFlags & 1;
+      cropFlags = cropFlags >> 1;
+      ++i;
+      }
+    for (; i < 32; ++i)
+      {
+      cropFlagsArray[i] = 0;
+      }
+
+    glUniform1iv(this->Shader("cropping_flags"), numberOfRegions,
+                 cropFlagsArray);
+    }
+}
+
+//----------------------------------------------------------------------------
+void vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::UpdateClipping(
+  vtkRenderer* vtkNotUsed(ren), vtkVolume* vtkNotUsed(vol))
+{
+  if (this->Parent->GetClippingPlanes())
+    {
+    std::vector<float> clippingPlanes;
+    // Currently we don't have any clipping plane
+    clippingPlanes.push_back(0);
+
+    this->Parent->ClippingPlanes->InitTraversal();
+    vtkPlane* plane;
+    while ((plane = this->Parent->ClippingPlanes->GetNextItem()))
+      {
+      // Planes are in world coordinates
+      double planeOrigin[3], planeNormal[3];
+      plane->GetOrigin(planeOrigin);
+      plane->GetNormal(planeNormal);
+
+      clippingPlanes.push_back(planeOrigin[0]);
+      clippingPlanes.push_back(planeOrigin[1]);
+      clippingPlanes.push_back(planeOrigin[2]);
+      clippingPlanes.push_back(planeNormal[0]);
+      clippingPlanes.push_back(planeNormal[1]);
+      clippingPlanes.push_back(planeNormal[2]);
+      }
+
+    double croppingRegionPlanes[6];
+    this->Parent->GetCroppingRegionPlanes(croppingRegionPlanes);
+
+    clippingPlanes[0] = clippingPlanes.size() > 0 ?
+      (clippingPlanes.size() - 1) : 0;
+
+    glUniform1fv(this->Shader("m_clipping_planes"),
+                 static_cast<int>(clippingPlanes.size()),
+                 &clippingPlanes[0]);
+    }
+}
+
+//----------------------------------------------------------------------------
+void vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::UpdateSamplingDistance(
+  vtkImageData* input, vtkRenderer* vtkNotUsed(ren), vtkVolume* vol)
+{
+  if(!this->Parent->AutoAdjustSampleDistances)
+    {
+    this->ActualSampleDistance = this->Parent->SampleDistance;
+    }
+  else
+    {
+    input->GetSpacing(this->CellSpacing);
+
+    vtkMatrix4x4* worldToDataset = vol->GetMatrix();
+    double minWorldSpacing = VTK_DOUBLE_MAX;
+    int i = 0;
+    while (i < 3)
+      {
+      double tmp = worldToDataset->GetElement(0,i);
+      double tmp2 = tmp * tmp;
+      tmp = worldToDataset->GetElement(1,i);
+      tmp2 += tmp * tmp;
+      tmp = worldToDataset->GetElement(2,i);
+      tmp2 += tmp * tmp;
+
+      // We use fabs() in case the spacing is negative.
+      double worldSpacing = fabs(this->CellSpacing[i] * sqrt(tmp2));
+      if(worldSpacing < minWorldSpacing)
+        {
+        minWorldSpacing = worldSpacing;
+        }
+      ++i;
+      }
+
+    // minWorldSpacing is the optimal sample distance in world space.
+    // To go faster (reduceFactor<1.0), we multiply this distance
+    // by 1/reduceFactor.
+    this->ActualSampleDistance = static_cast<float>(minWorldSpacing);
+
+    // TODO: Support reduction factor
+    //    if (this->ReductionFactor < 1.0)
+    //      {
+    //      this->ActualSampleDistance /=
+    //      static_cast<GLfloat>(this->ReductionFactor*0.5);
+    //      }
+    //    }
+    }
+}
+
+//----------------------------------------------------------------------------
+void vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::
+  LoadRequireDepthTextureExtensions(vtkRenderWindow* vtkNotUsed(renWin))
+{
+  // Reset the message stream for extensions
+  this->ExtensionsStringStream.str("");
+  this->ExtensionsStringStream.clear();
+
+  if (!GLEW_VERSION_2_0)
+    {
+    this->ExtensionsStringStream << "Requires OpenGL 2.0 or higher";
+    return;
+    }
+
+  // Check for npot even though it should be supported since
+  // it is in core since 2.0 as per specification
+  if (!glewIsSupported("GL_ARB_texture_non_power_of_two"))
+    {
+    this->ExtensionsStringStream << "Required extension "
+      << " GL_ARB_texture_non_power_of_two is not supported";
+    return;
+    }
+
+  // Check for float texture support. This extension became core
+  // in 3.0
+  if (!glewIsSupported("GL_ARB_texture_float"))
+    {
+    this->ExtensionsStringStream << "Required extension "
+      << " GL_ARB_texture_float is not supported";
+    return;
+    }
+
+  // Check for framebuffer objects. Framebuffer objects
+  // are core since version 3.0 only
+  if (!glewIsSupported("GL_EXT_framebuffer_object"))
+    {
+    this->ExtensionsStringStream << "Required extension "
+      << " GL_EXT_framebuffer_object is not supported";
+    return;
+    }
+
+  // NOTE: Support for depth sampler texture made into the core since version
+  // 1.4 and therefore we are no longer checking for it.
+  this->LoadDepthTextureExtensionsSucceeded = true;
+}
+
+//----------------------------------------------------------------------------
+void vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::CreateBufferObjects()
+{
+#ifndef __APPLE__
+  glGenVertexArrays(1, &this->CubeVAOId);
+#endif
+  glGenBuffers(1, &this->CubeVBOId);
+  glGenBuffers(1, &this->CubeIndicesId);
+}
+
+//----------------------------------------------------------------------------
+void vtkOpenGLGPUVolumeRayCastMapper::vtkInternal::DeleteBufferObjects()
+{
+#ifndef __APPLE__
+  if (this->CubeVAOId)
+    {
+    glDeleteVertexArrays(1, &this->CubeVAOId);
+    }
+#endif
+
+  if (this->CubeVBOId)
+    {
+    glDeleteBuffers(1, &this->CubeVBOId);
+    }
+
+  if (this->CubeIndicesId)
+   {
+   glDeleteBuffers(1, &this->CubeIndicesId);
+   }
+}
+
+//----------------------------------------------------------------------------
+vtkOpenGLGPUVolumeRayCastMapper::vtkOpenGLGPUVolumeRayCastMapper() :
+  vtkGPUVolumeRayCastMapper()
+{
+  this->Impl = new vtkInternal(this);
+}
+
+///
+//----------------------------------------------------------------------------
+vtkOpenGLGPUVolumeRayCastMapper::~vtkOpenGLGPUVolumeRayCastMapper()
+{
+  delete this->Impl;
+  this->Impl = 0;
+}
+
+//----------------------------------------------------------------------------
+void vtkOpenGLGPUVolumeRayCastMapper::PrintSelf(ostream& os, vtkIndent indent)
+{
+  this->Superclass::PrintSelf(os, indent);
+
+  os << indent << "Dimensions: " << this->Impl->Dimensions[0] << ", " <<
+                                    this->Impl->Dimensions[1] << ", " <<
+                                    this->Impl->Dimensions[2] << ", " << "\n";
+  os << indent << "Bounds: " << this->Impl->LoadedBounds[0] << ", " <<
+                                this->Impl->LoadedBounds[1] << ", " <<
+                                this->Impl->LoadedBounds[2] << "\n";
+  os << indent << "ActualSampleDistance: " <<
+    this->Impl->ActualSampleDistance << "\n";
+  os << indent << "LastProjectionParallel: " <<
+    this->Impl->LastProjectionParallel << "\n";
+}
+
+//----------------------------------------------------------------------------
+void vtkOpenGLGPUVolumeRayCastMapper::ReleaseGraphicsResources(
+  vtkWindow *window)
+{
+  this->Impl->DeleteBufferObjects();
+
+  if(this->Impl->VolumeTextureId)
+    {
+    window->MakeCurrent();
+    GLuint volumeTextureObject = static_cast<GLuint>(
+                                   this->Impl->VolumeTextureId);
+    glDeleteTextures(1, &volumeTextureObject);
+    this->Impl->VolumeTextureId = 0;
+    }
+
+  if(this->Impl->NoiseTextureId)
+    {
+    window->MakeCurrent();
+    GLuint noiseTextureObject = static_cast<GLuint>(
+                                  this->Impl->NoiseTextureId);
+    glDeleteTextures(1, &noiseTextureObject);
+    this->Impl->NoiseTextureId = 0;
+    }
+
+  if(this->Impl->DepthTextureId)
+    {
+    window->MakeCurrent();
+    GLuint depthTextureObject = static_cast<GLuint>(
+                                  this->Impl->DepthTextureId);
+    glDeleteTextures(1, &depthTextureObject);
+    this->Impl->DepthTextureId = 0;
+    }
+
+  if(this->Impl->MaskTextures != 0)
+    {
+    if(!this->Impl->MaskTextures->Map.empty())
+      {
+      std::map<vtkImageData*, vtkVolumeMask*>::iterator it =
+        this->Impl->MaskTextures->Map.begin();
+      while(it != this->Impl->MaskTextures->Map.end())
+        {
+        vtkVolumeMask* texture = (*it).second;
+        delete texture;
+        ++it;
+        }
+      this->Impl->MaskTextures->Map.clear();
+      }
+    }
+
+  if(this->Impl->RGBTable != 0)
+    {
+    delete this->Impl->RGBTable;
+    this->Impl->RGBTable = 0;
+    }
+
+  if(this->Impl->Mask1RGBTable != 0)
+    {
+    delete this->Impl->Mask1RGBTable;
+    this->Impl->Mask1RGBTable = 0;
+    }
+
+  if(this->Impl->Mask2RGBTable != 0)
+    {
+    delete this->Impl->Mask2RGBTable;
+    this->Impl->Mask2RGBTable = 0;
+    }
+
+  if(this->Impl->OpacityTables != 0)
+    {
+    delete this->Impl->OpacityTables;
+    this->Impl->OpacityTables = 0;
+    }
+}
+
+//----------------------------------------------------------------------------
+void vtkOpenGLGPUVolumeRayCastMapper::BuildShader(vtkRenderer* ren,
+                                                  vtkVolume* vol,
+                                                  int noOfComponents)
+{
+  vtkVolumeProperty* volProperty = vol->GetProperty();
+  this->Impl->Shader.DeleteShaderProgram();
+
+  std::string vertexShader (raycastervs);
+  std::string fragmentShader (raycasterfs);
+
+  vertexShader = vtkvolume::replace(vertexShader, "//VTK::ComputeClipPos::Impl",
+    vtkvolume::ComputeClip(ren, this, vol), true);
+  vertexShader = vtkvolume::replace(vertexShader, "//VTK::ComputeTextureCoords::Impl",
+    vtkvolume::ComputeTextureCoords(ren, this, vol), true);
+
+  vertexShader = vtkvolume::replace(vertexShader, "//VTK::Base::Dec",
+    vtkvolume::BaseGlobalsVert(ren, this, vol), true);
+  fragmentShader = vtkvolume::replace(fragmentShader, "//VTK::Base::Dec",
+    vtkvolume::BaseGlobalsFrag(ren, this, vol), true);
+  fragmentShader = vtkvolume::replace(fragmentShader, "//VTK::Base::Init",
+    vtkvolume::BaseInit(ren, this, vol), true);
+  fragmentShader = vtkvolume::replace(fragmentShader, "//VTK::Base::Impl",
+    vtkvolume::BaseIncrement(ren, this, vol), true);
+  fragmentShader = vtkvolume::replace(fragmentShader, "//VTK::Base::Exit",
+    vtkvolume::BaseExit(ren, this, vol), true);
+
+  vertexShader = vtkvolume::replace(vertexShader, "//VTK::Termination::Dec",
+    vtkvolume::TerminationGlobalsVert(ren, this, vol), true);
+  fragmentShader = vtkvolume::replace(fragmentShader, "//VTK::Termination::Dec",
+    vtkvolume::TerminationGlobalsFrag(ren, this, vol), true);
+  fragmentShader = vtkvolume::replace(fragmentShader, "//VTK::Terminate::Init",
+    vtkvolume::TerminationInit(ren, this, vol), true);
+  fragmentShader = vtkvolume::replace(fragmentShader, "//VTK::Terminate::Impl",
+    vtkvolume::TerminationIncrement(ren, this, vol), true);
+  fragmentShader = vtkvolume::replace(fragmentShader, "//VTK::Terminate::Exit",
+    vtkvolume::TerminationExit(ren, this, vol), true);
+
+  vertexShader = vtkvolume::replace(vertexShader, "//VTK::Shading::Dec",
+    vtkvolume::ShadingGlobalsVert(ren, this, vol), true);
+  fragmentShader = vtkvolume::replace(fragmentShader, "//VTK::Shading::Dec",
+    vtkvolume::ShadingGlobalsFrag(ren, this, vol), true);
+  fragmentShader = vtkvolume::replace(fragmentShader, "//VTK::Shading::Init",
+    vtkvolume::ShadingInit(ren, this, vol), true);
+  fragmentShader = vtkvolume::replace(fragmentShader, "//VTK::Shading::Impl",
+    vtkvolume::ShadingIncrement(ren, this, vol, this->MaskInput,
+                                this->Impl->CurrentMask,
+                                this->MaskType), true);
+  fragmentShader = vtkvolume::replace(fragmentShader, "//VTK::Shading::Exit",
+    vtkvolume::ShadingExit(ren, this, vol), true);
+
+  fragmentShader = vtkvolume::replace(fragmentShader, "//VTK::ComputeOpacity::Dec",
+    vtkvolume::OpacityTransferFunc(ren, this, vol, noOfComponents), true);
+  fragmentShader = vtkvolume::replace(fragmentShader, "//VTK::ComputeGradient::Dec",
+    vtkvolume::GradientsComputeFunc(ren, this, vol, noOfComponents), true);
+  fragmentShader = vtkvolume::replace(fragmentShader, "//VTK::ColorTransferFunc::Dec",
+     vtkvolume::ColorTransferFunc(ren, this, vol, noOfComponents), true);
+  fragmentShader = vtkvolume::replace(fragmentShader, "//VTK::ComputeLighting::Dec",
+    vtkvolume::LightComputeFunc(ren, this, vol,noOfComponents), true);
+  fragmentShader = vtkvolume::replace(fragmentShader,
+                                      "//VTK::RayDirectionFunc::Dec",
+    vtkvolume::RayDirectionFunc(ren, this, vol,noOfComponents), true);
+
+  vertexShader = vtkvolume::replace(vertexShader, "//VTK::Cropping::Dec",
+    vtkvolume::CroppingGlobalsVert(ren, this, vol), true);
+  fragmentShader = vtkvolume::replace(fragmentShader, "//VTK::Cropping::Dec",
+    vtkvolume::CroppingGlobalsFrag(ren, this, vol), true);
+  fragmentShader = vtkvolume::replace(fragmentShader, "//VTK::Cropping::Init",
+    vtkvolume::CroppingInit(ren, this, vol), true);
+  fragmentShader = vtkvolume::replace(fragmentShader, "//VTK::Cropping::Impl",
+    vtkvolume::CroppingIncrement(ren, this, vol), true);
+  fragmentShader = vtkvolume::replace(fragmentShader, "//VTK::Cropping::Exit",
+    vtkvolume::CroppingExit(ren, this, vol), true);
+
+  vertexShader = vtkvolume::replace(vertexShader, "//VTK::Clipping::Dec",
+    vtkvolume::ClippingGlobalsVert(ren, this, vol), true);
+  fragmentShader = vtkvolume::replace(fragmentShader, "//VTK::Clipping::Dec",
+    vtkvolume::ClippingGlobalsFrag(ren, this, vol), true);
+  fragmentShader = vtkvolume::replace(fragmentShader, "//VTK::Clipping::Init",
+    vtkvolume::ClippingInit(ren, this, vol), true);
+  fragmentShader = vtkvolume::replace(fragmentShader, "//VTK::Clipping::Impl",
+    vtkvolume::ClippingIncrement(ren, this, vol), true);
+  fragmentShader = vtkvolume::replace(fragmentShader, "//VTK::Clipping::Exit",
+    vtkvolume::ClippingExit(ren, this, vol), true);
+
+  fragmentShader = vtkvolume::replace(fragmentShader,
+                                      "//VTK::BinaryMask::Dec",
+    vtkvolume::BinaryMaskGlobalsFrag(ren, this, vol, this->MaskInput,
+                                     this->Impl->CurrentMask,
+                                     this->MaskType), true);
+  fragmentShader = vtkvolume::replace(fragmentShader, "//VTK::BinaryMask::Impl",
+    vtkvolume::BinaryMaskIncrement(ren, this, vol, this->MaskInput,
+                                   this->Impl->CurrentMask,
+                                   this->MaskType), true);
+
+  fragmentShader = vtkvolume::replace(fragmentShader,
+                                      "//VTK::CompositeMask::Dec",
+    vtkvolume::CompositeMaskGlobalsFrag(ren, this, vol, this->MaskInput,
+                                        this->Impl->CurrentMask,
+                                        this->MaskType), true);
+  fragmentShader = vtkvolume::replace(fragmentShader,
+                                      "//VTK::CompositeMask::Impl",
+    vtkvolume::CompositeMaskIncrement(ren, this, vol, this->MaskInput,
+                                      this->Impl->CurrentMask,
+                                      this->MaskType), true);
+
+  // Compile and link it
+  this->Impl->CompileAndLinkShader(vertexShader, fragmentShader);
+
+  // Add attributes and uniforms
+  this->Impl->Shader.AddAttribute("m_in_vertex_pos");
+
+  this->Impl->Shader.AddUniform("m_volume_matrix");
+  this->Impl->Shader.AddUniform("m_inverse_volume_matrix");
+  this->Impl->Shader.AddUniform("m_modelview_matrix");
+  this->Impl->Shader.AddUniform("m_inverse_modelview_matrix");
+  this->Impl->Shader.AddUniform("m_projection_matrix");
+  this->Impl->Shader.AddUniform("m_inverse_projection_matrix");
+  this->Impl->Shader.AddUniform("m_texture_dataset_matrix");
+  this->Impl->Shader.AddUniform("m_inverse_texture_dataset_matrix");
+  this->Impl->Shader.AddUniform("m_volume");
+  this->Impl->Shader.AddUniform("m_camera_pos");
+  this->Impl->Shader.AddUniform("m_light_pos");
+  this->Impl->Shader.AddUniform("m_cell_step");
+  this->Impl->Shader.AddUniform("m_cell_scale");
+  this->Impl->Shader.AddUniform("m_cell_spacing");
+  this->Impl->Shader.AddUniform("m_sample_distance");
+  this->Impl->Shader.AddUniform("m_scalars_range");
+
+  if (noOfComponents == 1 &&
+      this->BlendMode != vtkGPUVolumeRayCastMapper::ADDITIVE_BLEND)
+    {
+    this->Impl->Shader.AddUniform("m_color_transfer_func");
+    }
+
+  this->Impl->Shader.AddUniform("m_opacity_transfer_func");
+
+  if (volProperty->GetGradientOpacity())
+    {
+    this->Impl->Shader.AddUniform("m_gradient_transfer_func");
+    }
+
+  this->Impl->Shader.AddUniform("m_noise_sampler");
+  this->Impl->Shader.AddUniform("m_depth_sampler");
+  this->Impl->Shader.AddUniform("m_vol_extents_min");
+  this->Impl->Shader.AddUniform("m_vol_extents_max");
+  this->Impl->Shader.AddUniform("m_texture_extents_min");
+  this->Impl->Shader.AddUniform("m_texture_extents_max");
+  this->Impl->Shader.AddUniform("m_ambient");
+  this->Impl->Shader.AddUniform("m_diffuse");
+  this->Impl->Shader.AddUniform("m_specular");
+  this->Impl->Shader.AddUniform("m_shininess");
+  this->Impl->Shader.AddUniform("m_window_lower_left_corner");
+  this->Impl->Shader.AddUniform("m_inv_original_window_size");
+  this->Impl->Shader.AddUniform("m_inv_window_size");
+
+  if (this->GetCropping())
+    {
+    this->Impl->Shader.AddUniform("cropping_planes");
+    this->Impl->Shader.AddUniform("cropping_flags");
+    }
+
+  if (this->GetClippingPlanes())
+    {
+    this->Impl->Shader.AddUniform("m_clipping_planes");
+    this->Impl->Shader.AddUniform("m_clipping_planes_size");
+    }
+
+  if (this->Impl->CurrentMask)
+    {
+    this->Impl->Shader.AddUniform("m_mask");
+    }
+
+  if (this->MaskInput && this->MaskType == LabelMapMaskType)
+    {
+      this->Impl->Shader.AddUniform("m_mask_1");
+      this->Impl->Shader.AddUniform("m_mask_2");
+      this->Impl->Shader.AddUniform("m_mask_blendfactor");
+    }
+
+  if (ren->GetActiveCamera()->GetParallelProjection())
+    {
+    this->Impl->Shader.AddUniform("m_projection_direction");
+    }
+
+  this->Impl->ShaderBuildTime.Modified();
+}
+
+//----------------------------------------------------------------------------
+void vtkOpenGLGPUVolumeRayCastMapper::GPURender(vtkRenderer* ren,
+                                                vtkVolume* vol)
+{
+  // Make sure the context is current
+  ren->GetRenderWindow()->MakeCurrent();
+
+  // Update m_volume first to make sure states are current
+  vol->Update();
+
+  vtkImageData* input = this->GetTransformedInput();
+
+  // Set OpenGL states
+  vtkVolumeStateRAII glState;
+
+  if (!this->Impl->IsInitialized())
+    {
+    this->Impl->Initialize(ren, vol);
+    }
+
+  vtkDataArray* scalars = this->GetScalars(input,
+                          this->ScalarMode,
+                          this->ArrayAccessMode,
+                          this->ArrayId,
+                          this->ArrayName,
+                          this->CellFlag);
+
+  // How many components are there?
+  int numberOfScalarComponents = scalars->GetNumberOfComponents();
+
+  // If it is just one, then get the range from the scalars
+  if(numberOfScalarComponents == 1)
+    {
+    // NOTE: here, we ignore the blank cells.
+    scalars->GetRange(this->Impl->ScalarsRange);
+    }
+  // If it is 3, then use the 4th component's range since that is
+  // the component that will be passed through the scalar opacity
+  // transfer function to look up opacity
+  else
+    {
+    // Note that we've already checked data type and we know this is
+    // unsigned char
+    scalars->GetRange(this->Impl->ScalarsRange, 3);
+    }
+
+  // Invert the volume matrix
+  // Will require transpose of this matrix for OpenGL
+  // Scene matrix
+  this->Impl->InverseVolumeMat->DeepCopy(vol->GetMatrix());
+  this->Impl->InverseVolumeMat->Invert();
+
+  // Update the volume if needed
+  if (input != this->Impl->PrevInput)
+    {
+    input->GetDimensions(this->Impl->Dimensions);
+
+    // Update bounds, data, and geometry
+    this->Impl->ComputeBounds(input);
+    this->Impl->LoadVolume(input, scalars);
+    this->Impl->LoadMask(input, this->MaskInput,
+                         this->Impl->Extents, vol);
+    }
+
+  this->Impl->UpdateVolumeGeometry(ren, vol, input);
+
+  // Mask
+  vtkVolumeMask* mask = 0;
+  if(this->MaskInput != 0)
+    {
+    std::map<vtkImageData *,vtkVolumeMask*>::iterator it2 =
+      this->Impl->MaskTextures->Map.find(this->MaskInput);
+    if(it2 == this->Impl->MaskTextures->Map.end())
+      {
+      mask=0;
+      }
+    else
+      {
+      mask=(*it2).second;
+      }
+    }
+  this->Impl->CurrentMask = mask;
+  if (this->Impl->CurrentMask != 0)
+   {
+   this->Impl->CurrentMask->Bind();
+   }
+
+  this->Impl->UpdateSamplingDistance(input, ren, vol);
+
+  // Build shader
+  if (vol->GetProperty()->GetMTime() >
+      this->Impl->ShaderBuildTime.GetMTime() ||
+      this->GetMTime() > this->Impl->ShaderBuildTime.GetMTime() ||
+      ren->GetActiveCamera()->GetParallelProjection() !=
+      this->Impl->LastProjectionParallel
+      )
+    {
+    this->Impl->LastProjectionParallel =
+      ren->GetActiveCamera()->GetParallelProjection();
+    this->BuildShader(ren, vol, numberOfScalarComponents);
+    }
+
+  // Update opacity transfer function
+  // TODO Passing level 0 for now
+  this->Impl->UpdateOpacityTransferFunction(vol,
+    scalars->GetNumberOfComponents(), 0);
+
+  this->Impl->UpdateGradientOpacityTransferFunction(vol,
+    scalars->GetNumberOfComponents(), 0);
+
+  // Update transfer color functions
+  this->Impl->UpdateColorTransferFunction(vol,
+    scalars->GetNumberOfComponents());
+
+  // Update noise sampler texture
+  this->Impl->UpdateNoiseTexture();
+
+  // Grab depth sampler buffer (to handle cases when we are rendering geometry
+  // and m_volume together
+  this->Impl->UpdateDepthTexture(ren, vol);
+
+  // Temporary variables
+  float fvalue2[2];
+  float fvalue3[3];
+  float fvalue16[16];
+
+  // Update sampling distance
+  int* loadedExtent = input->GetExtent();
+
+  this->Impl->CellStep[0] =
+    (1.0/static_cast<double>(loadedExtent[1] - loadedExtent[0]));
+  this->Impl->CellStep[1] =
+    (1.0/static_cast<double>(loadedExtent[3] - loadedExtent[2]));
+  this->Impl->CellStep[2] =
+    (1.0/static_cast<double>(loadedExtent[5] -loadedExtent[4]));
+
+  this->Impl->CellScale[0] = (this->Impl->LoadedBounds[1] -
+                              this->Impl->LoadedBounds[0]) * 0.5;
+  this->Impl->CellScale[1] = (this->Impl->LoadedBounds[3] -
+                              this->Impl->LoadedBounds[2]) * 0.5;
+  this->Impl->CellScale[2] = (this->Impl->LoadedBounds[5] -
+                              this->Impl->LoadedBounds[4]) * 0.5;
+
+  this->Impl->DatasetStepSize[0] = 1.0 / (this->Impl->LoadedBounds[1] -
+                                          this->Impl->LoadedBounds[0]);
+  this->Impl->DatasetStepSize[1] = 1.0 / (this->Impl->LoadedBounds[3] -
+                                          this->Impl->LoadedBounds[2]);
+  this->Impl->DatasetStepSize[2] = 1.0 / (this->Impl->LoadedBounds[5] -
+                                          this->Impl->LoadedBounds[4]);
+
+  // Now use the shader
+  this->Impl->Shader.Use();
+
+  if (ren->GetActiveCamera()->GetParallelProjection())
+    {
+    double dir[4];
+    ren->GetActiveCamera()->GetDirectionOfProjection(dir);
+    vtkInternal::ToFloat(dir[0], dir[1], dir[2], fvalue3);
+    glUniform3f(this->Impl->Shader("m_projection_direction"),
+                fvalue3[0], fvalue3[1], fvalue3[2]);
+    }
+
+  // Pass constant uniforms at initialization
+  // Step should be dependant on the bounds and not on the texture size
+  // since we can have non uniform voxel size / spacing / aspect ratio
+  vtkInternal::ToFloat(this->Impl->CellStep, fvalue3);
+  glUniform3f(this->Impl->Shader("m_cell_step"),
+              fvalue3[0], fvalue3[1], fvalue3[2]);
+
+  vtkInternal::ToFloat(this->Impl->CellScale, fvalue3);
+  glUniform3f(this->Impl->Shader("m_cell_scale"),
+              fvalue3[0], fvalue3[1], fvalue3[2]);
+
+  vtkInternal::ToFloat(this->Impl->CellSpacing, fvalue3);
+  glUniform3f(this->Impl->Shader("m_cell_spacing"),
+              fvalue3[0], fvalue3[1], fvalue3[2]);
+
+  glUniform1f(this->Impl->Shader("m_sample_distance"),
+              this->Impl->ActualSampleDistance);
+
+  vtkInternal::ToFloat(this->Impl->ScalarsRange, fvalue2);
+  glUniform2f(this->Impl->Shader("m_scalars_range"),
+              fvalue2[0], fvalue2[1]);
+
+  glUniform1i(this->Impl->Shader("m_volume"), 0);
+  glUniform1i(this->Impl->Shader("m_opacity_transfer_func"), 2);
+  glUniform1i(this->Impl->Shader("m_noise_sampler"), 3);
+  glUniform1i(this->Impl->Shader("m_depth_sampler"), 4);
+  glUniform1i(this->Impl->Shader("m_gradient_transfer_func"), 5);
+
+  if (this->Impl->CurrentMask)
+    {
+    glUniform1i(this->Impl->Shader("m_mask"), 6);
+    }
+
+  if(numberOfScalarComponents == 1 &&
+     this->BlendMode!=vtkGPUVolumeRayCastMapper::ADDITIVE_BLEND)
+    {
+    glUniform1i(this->Impl->Shader("m_color_transfer_func"), 1);
+
+    if (this->MaskInput != 0 && this->MaskType == LabelMapMaskType)
+      {
+      glUniform1i(this->Impl->Shader("m_mask_1"), 7);
+      glUniform1i(this->Impl->Shader("m_mask_2"), 8);
+      glUniform1f(this->Impl->Shader("m_mask_blendfactor"),
+                  this->MaskBlendFactor);
+      }
+    }
+
+  fvalue3[0] = fvalue3[1] = fvalue3[2] = vol->GetProperty()->GetAmbient();
+  glUniform3f(this->Impl->Shader("m_ambient"),
+              fvalue3[0], fvalue3[1], fvalue3[2]);
+
+  fvalue3[0] = fvalue3[1] = fvalue3[2] = vol->GetProperty()->GetDiffuse();
+  glUniform3f(this->Impl->Shader("m_diffuse"),
+              fvalue3[0], fvalue3[1], fvalue3[2]);
+
+  fvalue3[0] = fvalue3[1] = fvalue3[2] = vol->GetProperty()->GetSpecular();
+  glUniform3f(this->Impl->Shader("m_specular"),
+              fvalue3[0], fvalue3[1], fvalue3[2]);
+
+  fvalue3[0] = vol->GetProperty()->GetSpecularPower();
+  glUniform1f(this->Impl->Shader("m_shininess"), fvalue3[0]);
+
+  // Bind textures
+  // Volume texture is at unit 0
+  glActiveTexture(GL_TEXTURE0);
+  glBindTexture(GL_TEXTURE_3D, this->Impl->VolumeTextureId);
+
+  // Color texture is at unit 1
+  if (numberOfScalarComponents == 1)
+    {
+    this->Impl->RGBTable->Bind();
+
+    if (this->MaskInput != 0 && this->MaskType == LabelMapMaskType)
+      {
+      this->Impl->Mask1RGBTable->Bind(7);
+      this->Impl->Mask2RGBTable->Bind(8);
+      }
+    }
+
+  // Opacity texture is at unit 2
+  // TODO Supports only one table for now
+  this->Impl->OpacityTables->GetTable(0)->Bind();
+
+  // Noise texture is at unit 3
+  glActiveTexture(GL_TEXTURE3);
+  glBindTexture(GL_TEXTURE_2D, this->Impl->NoiseTextureId);
+
+  // Depth texture is at unit 4
+  glActiveTexture(GL_TEXTURE4);
+  glBindTexture(GL_TEXTURE_2D, this->Impl->DepthTextureId);
+
+  // Look at the OpenGL Camera for the exact aspect computation
+  double aspect[2];
+  ren->ComputeAspect();
+  ren->GetAspect(aspect);
+
+  double clippingRange[2];
+  ren->GetActiveCamera()->GetClippingRange(clippingRange);
+
+  // Will require transpose of this matrix for OpenGL
+  vtkMatrix4x4* projectionMat4x4 = ren->GetActiveCamera()->
+    GetProjectionTransformMatrix(aspect[0]/aspect[1], -1, 1);
+  this->Impl->InverseProjectionMat->DeepCopy(projectionMat4x4);
+  this->Impl->InverseProjectionMat->Invert();
+  vtkInternal::VtkToGlMatrix(projectionMat4x4, fvalue16);
+  glUniformMatrix4fv(this->Impl->Shader("m_projection_matrix"), 1,
+                     GL_FALSE, &(fvalue16[0]));
+
+  vtkInternal::VtkToGlMatrix(this->Impl->InverseProjectionMat.GetPointer(),
+                             fvalue16);
+  glUniformMatrix4fv(this->Impl->Shader("m_inverse_projection_matrix"), 1,
+                     GL_FALSE, &(fvalue16[0]));
+
+  // Will require transpose of this matrix for OpenGL
+  vtkMatrix4x4* modelviewMat4x4 =
+    ren->GetActiveCamera()->GetViewTransformMatrix();
+  this->Impl->InverseModelViewMat->DeepCopy(modelviewMat4x4);
+  this->Impl->InverseModelViewMat->Invert();
+
+  vtkInternal::VtkToGlMatrix(modelviewMat4x4, fvalue16);
+  glUniformMatrix4fv(this->Impl->Shader("m_modelview_matrix"), 1,
+                     GL_FALSE, &(fvalue16[0]));
+
+  vtkInternal::VtkToGlMatrix(this->Impl->InverseModelViewMat.GetPointer(),
+                             fvalue16);
+  glUniformMatrix4fv(this->Impl->Shader("m_inverse_modelview_matrix"), 1,
+                     GL_FALSE, &(fvalue16[0]));
+
+  // Will require transpose of this matrix for OpenGL
+  // Scene matrix
+  vtkMatrix4x4* volumeMatrix4x4 = vol->GetMatrix();
+  this->Impl->InverseVolumeMat->DeepCopy(volumeMatrix4x4);
+  this->Impl->InverseVolumeMat->Invert();
+
+  vtkInternal::VtkToGlMatrix(volumeMatrix4x4, fvalue16);
+  glUniformMatrix4fv(this->Impl->Shader("m_volume_matrix"), 1,
+                     GL_FALSE, &(fvalue16[0]));
+
+  vtkInternal::VtkToGlMatrix(this->Impl->InverseVolumeMat.GetPointer(),
+                             fvalue16);
+  glUniformMatrix4fv(this->Impl->Shader("m_inverse_volume_matrix"), 1,
+                     GL_FALSE, &(fvalue16[0]));
+
+  // Compute texture to dataset matrix
+  this->Impl->TextureToDataSetMat->Identity();
+  this->Impl->TextureToDataSetMat->SetElement(0, 0,
+    (1.0 / this->Impl->DatasetStepSize[0]));
+  this->Impl->TextureToDataSetMat->SetElement(1, 1,
+    (1.0 / this->Impl->DatasetStepSize[1]));
+  this->Impl->TextureToDataSetMat->SetElement(2, 2,
+    (1.0 / this->Impl->DatasetStepSize[2]));
+  this->Impl->TextureToDataSetMat->SetElement(3, 3,
+    1.0);
+  this->Impl->TextureToDataSetMat->SetElement(0, 3,
+    this->Impl->LoadedBounds[0]);
+  this->Impl->TextureToDataSetMat->SetElement(1, 3,
+    this->Impl->LoadedBounds[2]);
+  this->Impl->TextureToDataSetMat->SetElement(2, 3,
+    this->Impl->LoadedBounds[4]);
+
+  this->Impl->InverseTextureToDataSetMat->DeepCopy(
+    this->Impl->TextureToDataSetMat.GetPointer());
+  this->Impl->InverseTextureToDataSetMat->Invert();
+  vtkInternal::VtkToGlMatrix(this->Impl->TextureToDataSetMat.GetPointer(),
+                             fvalue16);
+  glUniformMatrix4fv(this->Impl->Shader("m_texture_dataset_matrix"), 1,
+                     GL_FALSE, &(fvalue16[0]));
+  vtkInternal::VtkToGlMatrix(
+    this->Impl->InverseTextureToDataSetMat.GetPointer(), fvalue16);
+  glUniformMatrix4fv(this->Impl->Shader("m_inverse_texture_dataset_matrix"), 1,
+                     GL_FALSE, &(fvalue16[0]));
+
+  vtkInternal::ToFloat(ren->GetActiveCamera()->GetPosition(), fvalue3, 3);
+  glUniform3fv(this->Impl->Shader("m_camera_pos"), 1, &(fvalue3[0]));
+
+  // NOTE Assuming that light is located on the camera
+  glUniform3fv(this->Impl->Shader("m_light_pos"), 1, &(fvalue3[0]));
+
+  vtkInternal::ToFloat(this->Impl->LoadedBounds[0],
+                       this->Impl->LoadedBounds[2],
+                       this->Impl->LoadedBounds[4], fvalue3);
+  glUniform3fv(this->Impl->Shader("m_vol_extents_min"), 1,
+               &(fvalue3[0]));
+
+  vtkInternal::ToFloat(this->Impl->LoadedBounds[1],
+                       this->Impl->LoadedBounds[3],
+                       this->Impl->LoadedBounds[5], fvalue3);
+  glUniform3fv(this->Impl->Shader("m_vol_extents_max"), 1,
+               &(fvalue3[0]));
+
+  vtkInternal::ToFloat(this->Impl->Extents[0],
+                       this->Impl->Extents[2],
+                       this->Impl->Extents[4], fvalue3);
+  glUniform3fv(this->Impl->Shader("m_texture_extents_min"), 1,
+               &(fvalue3[0]));
+  vtkInternal::ToFloat(this->Impl->Extents[1],
+                       this->Impl->Extents[3],
+                       this->Impl->Extents[5], fvalue3);
+  glUniform3fv(this->Impl->Shader("m_texture_extents_max"), 1,
+               &(fvalue3[0]));
+
+  // TODO Take consideration of reduction factor
+  vtkInternal::ToFloat(this->Impl->WindowLowerLeft, fvalue2);
+  glUniform2fv(this->Impl->Shader("m_window_lower_left_corner"),
+               1, &fvalue2[0]);
+
+  vtkInternal::ToFloat(1.0 / this->Impl->WindowSize[0],
+                       1.0 / this->Impl->WindowSize[1], fvalue2);
+  glUniform2fv(this->Impl->Shader("m_inv_original_window_size"),
+               1, &fvalue2[0]);
+
+  vtkInternal::ToFloat(1.0 / this->Impl->WindowSize[0],
+                       1.0 / this->Impl->WindowSize[1], fvalue2);
+  glUniform2fv(this->Impl->Shader("m_inv_window_size"), 1, &fvalue2[0]);
+
+  // Updating cropping if enabled
+  this->Impl->UpdateCropping(ren, vol);
+
+  // Updating clipping if enabled
+  this->Impl->UpdateClipping(ren, vol);
+
+#ifndef __APPLE__
+  glBindVertexArray(this->Impl->CubeVAOId);
+#endif
+  glDrawElements(GL_TRIANGLES,
+                 this->Impl->BBoxPolyData->GetNumberOfCells() * 3,
+                 GL_UNSIGNED_INT, 0);
+
+  // Undo binds and state changes
+  // TODO Provide a stack Impl
+  this->Impl->Shader.UnUse();
+
+  this->Impl->PrevInput = input;
+}
diff --git a/Rendering/VolumeOpenGLNew/vtkOpenGLGPUVolumeRayCastMapper.h b/Rendering/VolumeOpenGLNew/vtkOpenGLGPUVolumeRayCastMapper.h
new file mode 100644
index 0000000..4dd2a2b
--- /dev/null
+++ b/Rendering/VolumeOpenGLNew/vtkOpenGLGPUVolumeRayCastMapper.h
@@ -0,0 +1,94 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+  Module:    vtkOpenGLGPUVolumeRayCastMapper.h
+
+  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.
+
+=========================================================================*/
+
+#ifndef vtkOpenGLGPUVolumeRayCastMapper_h
+#define vtkOpenGLGPUVolumeRayCastMapper_h
+
+#include "vtkRenderingVolumeOpenGLNewModule.h" // For export macro
+
+#include <vtkGPUVolumeRayCastMapper.h>
+
+//----------------------------------------------------------------------------
+class VTKRENDERINGVOLUMEOPENGLNEW_EXPORT vtkOpenGLGPUVolumeRayCastMapper :
+  public vtkGPUVolumeRayCastMapper
+{
+public:
+  static vtkOpenGLGPUVolumeRayCastMapper* New();
+
+  vtkTypeMacro(vtkOpenGLGPUVolumeRayCastMapper, vtkGPUVolumeRayCastMapper);
+  void PrintSelf( ostream& os, vtkIndent indent );
+
+protected:
+  vtkOpenGLGPUVolumeRayCastMapper();
+  ~vtkOpenGLGPUVolumeRayCastMapper();
+
+  // Description:
+  // Delete OpenGL objects.
+  // \post done: this->OpenGLObjectsCreated==0
+  virtual void ReleaseGraphicsResources(vtkWindow *window);
+
+  // Description:
+  // Build vertex and fragment shader for the volume rendering
+  void BuildShader(vtkRenderer* ren, vtkVolume* vol, int noOfComponents);
+
+  // Description:
+  // Rendering volume on GPU
+  void GPURender(vtkRenderer *ren, vtkVolume *vol);
+
+  // Description:
+  // Not implemented
+  virtual void PreRender(vtkRenderer* vtkNotUsed(ren),
+                         vtkVolume* vtkNotUsed(vol),
+                         double vtkNotUsed(datasetBounds)[6],
+                         double vtkNotUsed(scalarRange)[2],
+                         int vtkNotUsed(numberOfScalarComponents),
+                         unsigned int vtkNotUsed(numberOfLevels)) {};
+
+  // Description:
+  // Empty implementation.
+  virtual void RenderBlock(vtkRenderer* vtkNotUsed(ren),
+                           vtkVolume* vtkNotUsed(vol),
+                           unsigned int vtkNotUsed(level)) {};
+
+  // Description:
+  // Empty implementation.
+  virtual void PostRender(vtkRenderer* vtkNotUsed(ren),
+                          int vtkNotUsed(umberOfScalarComponents)) {};
+
+  // Description:
+  // Empty implementation.
+  void GetReductionRatio(double* ratio)
+    {
+    ratio[0] = ratio[1] = ratio[2] = 1.0;
+    }
+
+  // Description:
+  // Empty implementation.
+  virtual int IsRenderSupported(vtkRenderWindow *vtkNotUsed(window),
+                                vtkVolumeProperty *vtkNotUsed(property))
+    {
+    return 1;
+    }
+
+private:
+  class vtkInternal;
+  vtkInternal* Impl;
+
+  vtkOpenGLGPUVolumeRayCastMapper(
+    const vtkOpenGLGPUVolumeRayCastMapper&); // Not implemented.
+  void operator=(const vtkOpenGLGPUVolumeRayCastMapper&); // Not implemented.
+};
+
+#endif // vtkOpenGLGPUVolumeRayCastMapper_h
diff --git a/Rendering/VolumeOpenGLNew/vtkOpenGLGradientOpacityTable.h b/Rendering/VolumeOpenGLNew/vtkOpenGLGradientOpacityTable.h
new file mode 100644
index 0000000..a6b0f66
--- /dev/null
+++ b/Rendering/VolumeOpenGLNew/vtkOpenGLGradientOpacityTable.h
@@ -0,0 +1,201 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+  Module:    vtkOpenGLGradientOpacityTable.h
+
+  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.
+
+=========================================================================*/
+
+#ifndef vtkOpenGLGradientOpacityTable_h_
+#define vtkOpenGLGradientOpacityTable_h_
+
+#include <vtkPiecewiseFunction.h>
+#include <vtkVolumeMapper.h>
+
+#include <vtk_glew.h>
+
+//----------------------------------------------------------------------------
+class vtkOpenGLGradientOpacityTable
+{
+public:
+  //--------------------------------------------------------------------------
+  vtkOpenGLGradientOpacityTable(int width = 1024)
+    {
+      this->TextureId = 0;
+      this->TextureWidth = width;
+      this->TextureHeight = 0;
+      this->LastSampleDistance = 1.0;
+      this->Table = 0;
+      this->Loaded = false;
+      this->LastLinearInterpolation = false;
+      this->LastRange[0] = this->LastRange[1] = 0.0;
+    }
+
+  //--------------------------------------------------------------------------
+  ~vtkOpenGLGradientOpacityTable()
+    {
+      if (this->TextureId != 0)
+        {
+        glDeleteTextures(1, &this->TextureId);
+        this->TextureId=0;
+        }
+
+      if (this->Table!=0)
+        {
+        delete[] this->Table;
+        this->Table=0;
+        }
+    }
+
+
+  // Check if opacity transfer function texture is loaded.
+  //--------------------------------------------------------------------------
+  bool IsLoaded()
+    {
+    return this->Loaded;
+    }
+
+  // Bind texture.
+  //--------------------------------------------------------------------------
+  void Bind()
+    {
+    // Activate texture 5
+    glActiveTexture(GL_TEXTURE5);
+    glBindTexture(GL_TEXTURE_1D, this->TextureId);
+    }
+
+  // Update opacity tranfer function texture.
+  //--------------------------------------------------------------------------
+  void Update(vtkPiecewiseFunction* gradientOpacity,
+              double sampleDistance,
+              double range[2],
+              double vtkNotUsed(unitDistance),
+              bool linearInterpolation)
+    {
+    // Activate texture 5
+    glActiveTexture(GL_TEXTURE5);
+
+    bool needUpdate=false;
+    if(this->TextureId == 0)
+      {
+      glGenTextures(1,&this->TextureId);
+      needUpdate = true;
+      }
+
+    if (this->LastRange[0] != range[0] ||
+        this->LastRange[1] != range[1])
+      {
+      needUpdate = true;
+      this->LastRange[0] = range[0];
+      this->LastRange[1] = range[1];
+      }
+
+    glBindTexture(GL_TEXTURE_1D, this->TextureId);
+    if(needUpdate)
+      {
+      glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_WRAP_S,
+                      GL_CLAMP_TO_EDGE);
+      }
+
+    if(gradientOpacity->GetMTime() > this->BuildTime ||
+       this->LastSampleDistance != sampleDistance ||
+       needUpdate || !this->Loaded)
+      {
+      this->Loaded = false;
+      if(this->Table == 0)
+        {
+        this->Table = new float[this->TextureWidth];
+        }
+
+      gradientOpacity->GetTable(0, (range[1] - range[0]) * 0.25,
+        this->TextureWidth, this->Table);
+
+      glTexImage1D(GL_TEXTURE_1D, 0, GL_ALPHA16, this->TextureWidth,
+                   this->TextureHeight, GL_ALPHA, GL_FLOAT, this->Table);
+      this->Loaded = true;
+      this->BuildTime.Modified();
+      }
+
+    needUpdate= needUpdate ||
+      this->LastLinearInterpolation!=linearInterpolation;
+    if(needUpdate)
+      {
+      this->LastLinearInterpolation = linearInterpolation;
+      GLint value = linearInterpolation ? GL_LINEAR : GL_NEAREST;
+      glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, value);
+      glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, value);
+      }
+
+    glActiveTexture(GL_TEXTURE0);
+    }
+
+protected:
+  GLuint TextureId;
+  int TextureWidth;
+  int TextureHeight;
+
+  double LastSampleDistance;
+  vtkTimeStamp BuildTime;
+  float* Table;
+  bool Loaded;
+  bool LastLinearInterpolation;
+  double LastRange[2];
+private:
+  vtkOpenGLGradientOpacityTable(const vtkOpenGLGradientOpacityTable&);
+  vtkOpenGLGradientOpacityTable& operator=(const vtkOpenGLGradientOpacityTable&);
+};
+
+//-----------------------------------------------------------------------------
+class vtkOpenGLGradientOpacityTables
+{
+public:
+  //--------------------------------------------------------------------------
+  vtkOpenGLGradientOpacityTables(unsigned int numberOfTables)
+    {
+    this->Tables = new vtkOpenGLGradientOpacityTable[numberOfTables];
+    this->NumberOfTables = numberOfTables;
+    }
+
+  //--------------------------------------------------------------------------
+  ~vtkOpenGLGradientOpacityTables()
+    {
+    delete [] this->Tables;
+    }
+
+  // Get opacity table at a given index.
+  //--------------------------------------------------------------------------
+  vtkOpenGLGradientOpacityTable* GetTable(unsigned int i)
+    {
+    return &this->Tables[i];
+    }
+
+  // Get number of tables.
+  //--------------------------------------------------------------------------
+  unsigned int GetNumberOfTables()
+    {
+    return this->NumberOfTables;
+    }
+
+private:
+  unsigned int NumberOfTables;
+  vtkOpenGLGradientOpacityTable* Tables;
+
+  // vtkOpenGLGradientOpacityTables (Not implemented)
+  vtkOpenGLGradientOpacityTables();
+
+  // vtkOpenGLGradientOpacityTables (Not implemented)
+  vtkOpenGLGradientOpacityTables(const vtkOpenGLGradientOpacityTables &other);
+
+  // operator = (Not implemented)
+  vtkOpenGLGradientOpacityTables &operator=(const vtkOpenGLGradientOpacityTables &other);
+};
+
+#endif // vtkOpenGLGradientOpacityTable_h_
+// VTK-HeaderTest-Exclude: vtkOpenGLGradientOpacityTable.h
diff --git a/Rendering/VolumeOpenGLNew/vtkOpenGLOpacityTable.h b/Rendering/VolumeOpenGLNew/vtkOpenGLOpacityTable.h
new file mode 100644
index 0000000..1fe8c8d
--- /dev/null
+++ b/Rendering/VolumeOpenGLNew/vtkOpenGLOpacityTable.h
@@ -0,0 +1,242 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+  Module:    vtkOpenGLOpacityTable.h
+
+  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.
+
+=========================================================================*/
+
+#ifndef vtkOpenGLVolumeOpacityTable_h_
+#define vtkOpenGLVolumeOpacityTable_h_
+
+#include <vtkPiecewiseFunction.h>
+#include <vtkVolumeMapper.h>
+
+#include <vtk_glew.h>
+
+//----------------------------------------------------------------------------
+class vtkOpenGLOpacityTable
+{
+public:
+  //--------------------------------------------------------------------------
+  vtkOpenGLOpacityTable(int width = 1024)
+    {
+      this->TextureId = 0;
+      this->LastBlendMode = vtkVolumeMapper::MAXIMUM_INTENSITY_BLEND;
+      this->TextureWidth = width;
+      this->TextureHeight = 0;
+      this->LastSampleDistance = 1.0;
+      this->Table = 0;
+      this->Loaded = false;
+      this->LastLinearInterpolation = false;
+      this->LastRange[0] = this->LastRange[1] = 0.0;
+    }
+
+  //--------------------------------------------------------------------------
+  ~vtkOpenGLOpacityTable()
+    {
+      if (this->TextureId != 0)
+        {
+        glDeleteTextures(1, &this->TextureId);
+        this->TextureId=0;
+        }
+
+      if (this->Table!=0)
+        {
+        delete[] this->Table;
+        this->Table=0;
+        }
+    }
+
+  // Check if opacity transfer function texture is loaded.
+  //--------------------------------------------------------------------------
+  bool IsLoaded()
+    {
+    return this->Loaded;
+    }
+
+  // Bind texture.
+  //--------------------------------------------------------------------------
+  void Bind()
+    {
+    // Activate texture 2
+    glActiveTexture(GL_TEXTURE2);
+    glBindTexture(GL_TEXTURE_1D, this->TextureId);
+    }
+
+  // Update opacity tranfer function texture.
+  //--------------------------------------------------------------------------
+  void Update(vtkPiecewiseFunction* scalarOpacity,
+              int blendMode,
+              double sampleDistance,
+              double range[2],
+              double unitDistance,
+              bool linearInterpolation)
+    {
+    // Activate texture 2
+    glActiveTexture(GL_TEXTURE2);
+
+    bool needUpdate=false;
+    if(this->TextureId == 0)
+      {
+      glGenTextures(1,&this->TextureId);
+      needUpdate = true;
+      }
+
+    if (this->LastRange[0] != range[0] ||
+        this->LastRange[1] != range[1])
+      {
+      needUpdate = true;
+      this->LastRange[0] = range[0];
+      this->LastRange[1] = range[1];
+      }
+
+    glBindTexture(GL_TEXTURE_1D,this->TextureId);
+    if(needUpdate)
+      {
+      glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_WRAP_S,
+                      GL_CLAMP_TO_EDGE);
+      }
+
+    if(scalarOpacity->GetMTime() > this->BuildTime ||
+       (this->LastBlendMode != blendMode) ||
+       (blendMode == vtkVolumeMapper::COMPOSITE_BLEND &&
+        this->LastSampleDistance != sampleDistance) ||
+       needUpdate || !this->Loaded)
+      {
+      this->Loaded = false;
+      if(this->Table == 0)
+        {
+        this->Table = new float[this->TextureWidth];
+        }
+
+      scalarOpacity->GetTable(range[0], range[1], this->TextureWidth, this->Table);
+      this->LastBlendMode = blendMode;
+
+      // Correct the opacity array for the spacing between the planes if we
+      // are using a composite blending operation
+      // TODO Fix this code for sample distance in three dimensions
+        if(blendMode == vtkVolumeMapper::COMPOSITE_BLEND)
+          {
+          float* ptr = this->Table;
+          double factor = sampleDistance/unitDistance;
+          int i=0;
+          while(i < this->TextureWidth)
+            {
+            if(*ptr > 0.0001f)
+              {
+              *ptr = static_cast<float>(1.0-pow(1.0-static_cast<double>(*ptr),
+                                        factor));
+              }
+            ++ptr;
+            ++i;
+            }
+          this->LastSampleDistance = sampleDistance;
+          }
+        else if (blendMode==vtkVolumeMapper::ADDITIVE_BLEND)
+          {
+          float* ptr = this->Table;
+          double factor = sampleDistance/unitDistance;
+          int i = 0;
+          while( i < this->TextureWidth)
+            {
+            if(*ptr > 0.0001f)
+              {
+              *ptr = static_cast<float>(static_cast<double>(*ptr)*factor);
+              }
+            ++ptr;
+            ++i;
+            }
+          this->LastSampleDistance = sampleDistance;
+          }
+
+      glTexImage1D(GL_TEXTURE_1D, 0, GL_ALPHA16, this->TextureWidth,
+                   this->TextureHeight, GL_ALPHA, GL_FLOAT, this->Table);
+      this->Loaded = true;
+      this->BuildTime.Modified();
+      }
+
+    needUpdate= needUpdate ||
+      this->LastLinearInterpolation!=linearInterpolation;
+    if(needUpdate)
+      {
+      this->LastLinearInterpolation = linearInterpolation;
+      GLint value = linearInterpolation ? GL_LINEAR : GL_NEAREST;
+      glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, value);
+      glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, value);
+      }
+
+    glActiveTexture(GL_TEXTURE0);
+    }
+
+protected:
+  GLuint TextureId;
+  int LastBlendMode;
+  int TextureWidth;
+  int TextureHeight;
+
+  double LastSampleDistance;
+  vtkTimeStamp BuildTime;
+  float *Table;
+  bool Loaded;
+  bool LastLinearInterpolation;
+  double LastRange[2];
+private:
+  vtkOpenGLOpacityTable(const vtkOpenGLOpacityTable&);
+  vtkOpenGLOpacityTable& operator=(const vtkOpenGLOpacityTable&);
+};
+
+//----------------------------------------------------------------------------
+class vtkOpenGLOpacityTables
+{
+public:
+  //--------------------------------------------------------------------------
+  vtkOpenGLOpacityTables(unsigned int numberOfTables)
+    {
+    this->Tables = new vtkOpenGLOpacityTable[numberOfTables];
+    this->NumberOfTables = numberOfTables;
+    }
+
+  //--------------------------------------------------------------------------
+  ~vtkOpenGLOpacityTables()
+    {
+    delete [] this->Tables;
+    }
+
+  // brief Get opacity table at a given index.
+  //--------------------------------------------------------------------------
+  vtkOpenGLOpacityTable* GetTable(unsigned int i)
+    {
+    return &this->Tables[i];
+    }
+
+  // Get number of opacity tables.
+  //--------------------------------------------------------------------------
+  unsigned int GetNumberOfTables()
+    {
+    return this->NumberOfTables;
+    }
+
+private:
+  unsigned int NumberOfTables;
+  vtkOpenGLOpacityTable *Tables;
+
+  // vtkOpenGLOpacityTables (Not implemented)
+  vtkOpenGLOpacityTables();
+
+  // vtkOpenGLOpacityTables (Not implemented)
+  vtkOpenGLOpacityTables(const vtkOpenGLOpacityTables &other);
+
+  // operator = (Not implemented)
+  vtkOpenGLOpacityTables &operator=(const vtkOpenGLOpacityTables &other);
+};
+
+#endif // vtkOpenGLVolumeOpacityTable_h_
+// VTK-HeaderTest-Exclude: vtkOpenGLOpacityTable.h
diff --git a/Rendering/VolumeOpenGLNew/vtkOpenGLRGBTable.h b/Rendering/VolumeOpenGLNew/vtkOpenGLRGBTable.h
new file mode 100644
index 0000000..54f2321
--- /dev/null
+++ b/Rendering/VolumeOpenGLNew/vtkOpenGLRGBTable.h
@@ -0,0 +1,156 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+  Module:    vtkOpenGLRGBTable.h
+
+  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.
+
+=========================================================================*/
+
+#ifndef vtkOpenGLRGBTable_h_
+#define vtkOpenGLRGBTable_h_
+
+#include <vtkColorTransferFunction.h>
+#include <vtk_glew.h>
+
+//----------------------------------------------------------------------------
+class vtkOpenGLRGBTable
+{
+public:
+  //--------------------------------------------------------------------------
+  vtkOpenGLRGBTable()
+    {
+    this->Loaded = false;
+    this->LastLinearInterpolation = false;
+    this->TexutureWidth = 1024;
+    this->NumberOfColorComponents = 3;
+    this->TextureId = 0;
+    this->LastRange[0] = this->LastRange[1] = 0;
+    this->Table = 0;
+    }
+
+  //--------------------------------------------------------------------------
+  ~vtkOpenGLRGBTable()
+    {
+    if(this->TextureId!=0)
+      {
+      glDeleteTextures(1,&this->TextureId);
+      this->TextureId=0;
+      }
+    if(this->Table!=0)
+      {
+      delete[] this->Table;
+      this->Table=0;
+      }
+    }
+
+  // Check if color transfer function texture is loaded.
+  //--------------------------------------------------------------------------
+  bool IsLoaded()
+    {
+    return this->Loaded;
+    }
+
+  // Bind texture.
+  //--------------------------------------------------------------------------
+  void Bind(int textureUnit = 1)
+    {
+    // Activate texture 1
+    glActiveTexture(GL_TEXTURE0 + textureUnit);
+    glBindTexture(GL_TEXTURE_1D, this->TextureId);
+    }
+
+  // Update color transfer function texture.
+  //--------------------------------------------------------------------------
+  void Update(vtkColorTransferFunction* scalarRGB,
+              double range[2],
+              bool linearInterpolation, int textureUnit = 1)
+    {
+    // Activate texture 1
+    glActiveTexture(GL_TEXTURE0 + textureUnit);
+
+    bool needUpdate = false;
+
+    if(this->TextureId == 0)
+      {
+      glGenTextures(1, &this->TextureId);
+      needUpdate = true;
+      }
+
+    if (range[0] != this->LastRange[0] || range[1] != this->LastRange[1])
+      {
+      needUpdate=true;
+      }
+
+    glBindTexture(GL_TEXTURE_1D, this->TextureId);
+    if(needUpdate)
+      {
+      glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_WRAP_S,
+                      GL_CLAMP_TO_EDGE);
+      }
+    if(scalarRGB->GetMTime() > this->BuildTime || needUpdate || !this->Loaded)
+      {
+      this->Loaded = false;
+
+      // Create table if not created already
+      if(this->Table==0)
+        {
+        this->Table = new float[this->TexutureWidth *
+          this->NumberOfColorComponents];
+        }
+
+      scalarRGB->GetTable(range[0],range[1], this->TexutureWidth, this->Table);
+      glTexImage1D(GL_TEXTURE_1D, 0, GL_RGB16, this->TexutureWidth, 0,
+                   GL_RGB, GL_FLOAT, this->Table);
+
+      this->Loaded = true;
+      this->BuildTime.Modified();
+
+      this->LastRange[0] = range[0];
+      this->LastRange[1] = range[1];
+      }
+
+    needUpdate = needUpdate ||
+      this->LastLinearInterpolation!=linearInterpolation;
+    if (needUpdate)
+      {
+      this->LastLinearInterpolation = linearInterpolation;
+      GLint value;
+      if (linearInterpolation)
+        {
+        value = GL_LINEAR;
+        }
+      else
+        {
+        value = GL_NEAREST;
+        }
+      glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, value);
+      glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, value);
+      }
+
+    glActiveTexture(GL_TEXTURE0);
+    }
+
+protected:
+
+  bool Loaded;
+  bool LastLinearInterpolation;
+
+  int TexutureWidth;
+  int NumberOfColorComponents;
+
+  GLuint TextureId;
+
+  double LastRange[2];
+  float* Table;
+  vtkTimeStamp BuildTime;
+};
+
+#endif // vtkOpenGLRGBTable_h_
+// VTK-HeaderTest-Exclude: vtkOpenGLRGBTable.h
diff --git a/Rendering/VolumeOpenGLNew/vtkVolumeMask.h b/Rendering/VolumeOpenGLNew/vtkVolumeMask.h
new file mode 100644
index 0000000..052174a
--- /dev/null
+++ b/Rendering/VolumeOpenGLNew/vtkVolumeMask.h
@@ -0,0 +1,349 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+  Module:    vtkVolumeMask.h
+
+  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.
+
+=========================================================================*/
+
+#ifndef vtkVolumeMask_h_
+#define vtkVolumeMask_h_
+
+#include <vtkDataArray.h>
+#include <vtkImageData.h>
+
+#include <map> // STL required
+
+//----------------------------------------------------------------------------
+class vtkVolumeMask
+{
+public:
+  vtkVolumeMask()
+    {
+      this->TextureId = 0;
+      this->Loaded = false;
+      this->LoadedExtent[0] = VTK_INT_MAX;
+      this->LoadedExtent[1] = VTK_INT_MIN;
+      this->LoadedExtent[2] = VTK_INT_MAX;
+      this->LoadedExtent[3] = VTK_INT_MIN;
+      this->LoadedExtent[4] = VTK_INT_MAX;
+      this->LoadedExtent[5] = VTK_INT_MIN;
+    }
+
+  ~vtkVolumeMask()
+    {
+      if(this->TextureId != 0)
+        {
+        glDeleteTextures(1, &this->TextureId);
+        this->TextureId = 0;
+        }
+    }
+
+  vtkTimeStamp GetBuildTime()
+    {
+    return this->BuildTime;
+    }
+
+  void Bind()
+    {
+      // Activate texture 6
+      glActiveTexture(GL_TEXTURE6);
+      glBindTexture(GL_TEXTURE_3D, this->TextureId);
+    }
+
+  void Update(vtkImageData *input,
+              int cellFlag,
+              int textureExtent[6],
+              int scalarMode,
+              int arrayAccessMode,
+              int arrayId,
+              const char* arrayName,
+              vtkIdType maxMemoryInBytes)
+    {
+      glActiveTexture(GL_TEXTURE6);
+
+      bool needUpdate = false;
+      bool modified = false;
+      if(this->TextureId == 0)
+        {
+        glGenTextures(1, &this->TextureId);
+        needUpdate = true;
+        }
+      glBindTexture(GL_TEXTURE_3D,this->TextureId);
+
+      int obsolete = needUpdate || !this->Loaded ||
+                     input->GetMTime()>this->BuildTime;
+      if(!obsolete)
+        {
+        obsolete = cellFlag != this->LoadedCellFlag;
+        int i = 0;
+        while(!obsolete && i<6)
+          {
+          obsolete = obsolete || this->LoadedExtent[i]>textureExtent[i];
+          ++i;
+          obsolete = obsolete || this->LoadedExtent[i]<textureExtent[i];
+          ++i;
+          }
+        }
+
+      if(obsolete)
+        {
+        this->Loaded = false;
+        int dim[3];
+        input->GetDimensions(dim);
+
+        vtkDataArray *scalars =
+          vtkAbstractMapper::GetScalars(input,scalarMode,arrayAccessMode,
+                                        arrayId,arrayName,
+                                        this->LoadedCellFlag);
+
+        // DONT USE GetScalarType() or GetNumberOfScalarComponents() on
+        // ImageData as it deals only with point data...
+        int scalarType = scalars->GetDataType();
+        if(scalarType != VTK_UNSIGNED_CHAR)
+          {
+          cout <<"Mask should be VTK_UNSIGNED_CHAR." << endl;
+          }
+        if(scalars->GetNumberOfComponents()!=1)
+          {
+          cout << "Mask should be a one-component scalar field." << endl;
+          }
+
+        GLint internalFormat = GL_ALPHA8;
+        GLenum format = GL_ALPHA;
+        GLenum type = GL_UNSIGNED_BYTE;
+
+        // Enough memory?
+        int textureSize[3];
+        int i=0;
+        while(i<3)
+          {
+          textureSize[i] = textureExtent[2*i+1] - textureExtent[2*i] + 1;
+          ++i;
+          }
+
+        GLint width;
+        glGetIntegerv(GL_MAX_3D_TEXTURE_SIZE, &width);
+        this->Loaded = textureSize[0] <= width && textureSize[1] <= width &&
+                       textureSize[2] <= width;
+        if(this->Loaded)
+          {
+          // So far, so good but some cards always succeed with a proxy texture
+          // let's try to actually allocate..
+          glTexImage3D(GL_TEXTURE_3D, 0, internalFormat, textureSize[0],
+                       textureSize[1], textureSize[2], 0, format, type, 0);
+          GLenum errorCode = glGetError();
+          this->Loaded = errorCode!= GL_OUT_OF_MEMORY;
+          if(this->Loaded)
+            {
+            // so far, so good, actual allocation succeeded.
+            if(errorCode != GL_NO_ERROR)
+              {
+              cout << "After try to load the texture";
+              cout << "ERROR (x"<<hex<<errorCode<<") " << dec;
+              cout << endl;
+              }
+            // so far, so good but some cards don't report allocation error
+            this->Loaded = textureSize[0] * textureSize[1]*
+                           textureSize[2]*vtkAbstractArray::GetDataTypeSize(scalarType)*
+            scalars->GetNumberOfComponents() <= maxMemoryInBytes;
+            if(this->Loaded)
+              {
+              // OK, we consider the allocation above succeeded...
+              // If it actually didn't the only to fix it for the user
+              // is to decrease the value of this->MaxMemoryInBytes.
+
+              // enough memory! We can load the scalars!
+
+              // we don't clamp to edge because for the computation of the
+              // gradient on the border we need some external value.
+              glTexParameterf(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE);
+              glTexParameterf(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+              glTexParameterf(GL_TEXTURE_3D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+
+              GLfloat borderColor[4]={0.0,0.0,0.0,0.0};
+              glTexParameterfv(GL_TEXTURE_3D, GL_TEXTURE_BORDER_COLOR, borderColor);
+
+              glPixelTransferf(GL_ALPHA_SCALE, 1.0);
+              glPixelTransferf(GL_ALPHA_BIAS, 0.0);
+              glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+
+              if(!(textureExtent[1]-textureExtent[0]+cellFlag==dim[0]))
+                {
+                glPixelStorei(GL_UNPACK_ROW_LENGTH,dim[0]-cellFlag);
+                }
+              if(!(textureExtent[3]-textureExtent[2]+cellFlag==dim[1]))
+                {
+                glPixelStorei(GL_UNPACK_IMAGE_HEIGHT_EXT,
+                              dim[1]-cellFlag);
+                }
+              void* dataPtr = scalars->GetVoidPointer(
+                              ((textureExtent[4]*(dim[1]-cellFlag)+textureExtent[2]) *
+                              (dim[0]-cellFlag)+textureExtent[0]) *
+                              scalars->GetNumberOfComponents());
+
+              glTexImage3D(GL_TEXTURE_3D, 0, internalFormat,
+                           textureSize[0], textureSize[1], textureSize[2],
+                           0, format, type, dataPtr);
+
+              // Restore the default values.
+              glPixelStorei(GL_UNPACK_ROW_LENGTH,0);
+              glPixelStorei(GL_UNPACK_IMAGE_HEIGHT_EXT,0);
+              glPixelTransferf(GL_ALPHA_SCALE,1.0);
+              glPixelTransferf(GL_ALPHA_BIAS,0.0);
+
+              this->LoadedCellFlag = cellFlag;
+              i = 0;
+              while(i < 6)
+                {
+                this->LoadedExtent[i] = textureExtent[i];
+                ++i;
+                }
+
+              double spacing[3];
+              double origin[3];
+              input->GetSpacing(spacing);
+              input->GetOrigin(origin);
+              int swapBounds[3];
+              swapBounds[0] = (spacing[0] < 0);
+              swapBounds[1] = (spacing[1] < 0);
+              swapBounds[2] = (spacing[2] < 0);
+
+              if(!this->LoadedCellFlag) // loaded extents represent points
+                {
+                // slabsPoints[i]=(slabsDataSet[i] - origin[i/2]) / spacing[i/2];
+                // in general, x=o+i*spacing.
+                // if spacing is positive min extent match the min of the
+                // bounding box
+                // and the max extent match the max of the bounding box
+                // if spacing is negative min extent match the max of the
+                // bounding box
+                // and the max extent match the min of the bounding box
+
+                // if spacing is negative, we may have to rethink the equation
+                // between real point and texture coordinate...
+                this->LoadedBounds[0]=origin[0]+
+                  static_cast<double>(this->LoadedExtent[0+swapBounds[0]])*spacing[0];
+                this->LoadedBounds[2]=origin[1]+
+                  static_cast<double>(this->LoadedExtent[2+swapBounds[1]])*spacing[1];
+                this->LoadedBounds[4]=origin[2]+
+                  static_cast<double>(this->LoadedExtent[4+swapBounds[2]])*spacing[2];
+                this->LoadedBounds[1]=origin[0]+
+                  static_cast<double>(this->LoadedExtent[1-swapBounds[0]])*spacing[0];
+                this->LoadedBounds[3]=origin[1]+
+                  static_cast<double>(this->LoadedExtent[3-swapBounds[1]])*spacing[1];
+                this->LoadedBounds[5]=origin[2]+
+                  static_cast<double>(this->LoadedExtent[5-swapBounds[2]])*spacing[2];
+
+                }
+              else // loaded extents represent cells
+                {
+                int wholeTextureExtent[6];
+                input->GetExtent(wholeTextureExtent);
+                i=1;
+                while(i<6)
+                  {
+                  wholeTextureExtent[i]--;
+                  i+=2;
+                  }
+
+                i=0;
+                while(i<3)
+                  {
+                  if(this->LoadedExtent[2*i]==wholeTextureExtent[2*i])
+                    {
+                    this->LoadedBounds[2*i+swapBounds[i]]=origin[i];
+                    }
+                  else
+                    {
+                    this->LoadedBounds[2*i+swapBounds[i]]=origin[i]+
+                      (static_cast<double>(this->LoadedExtent[2*i])+0.5)*spacing[i];
+                    }
+
+                  if(this->LoadedExtent[2*i+1]==wholeTextureExtent[2*i+1])
+                    {
+                    this->LoadedBounds[2*i+1-swapBounds[i]]=origin[i]+
+                      (static_cast<double>(this->LoadedExtent[2*i+1])+1.0)*spacing[i];
+                    }
+                  else
+                    {
+                    this->LoadedBounds[2*i+1-swapBounds[i]]=origin[i]+
+                      (static_cast<double>(this->LoadedExtent[2*i+1])+0.5)*spacing[i];
+                    }
+                  ++i;
+                  }
+                }
+              modified=true;
+              } // if enough memory
+            } //load fail with out of memory
+          }
+        }
+
+      if(this->Loaded && (needUpdate || modified))
+        {
+        glTexParameterf(GL_TEXTURE_3D,GL_TEXTURE_MIN_FILTER,
+                        GL_NEAREST );
+        glTexParameterf(GL_TEXTURE_3D,GL_TEXTURE_MAG_FILTER,
+                        GL_NEAREST );
+        modified=true;
+        }
+      if(modified)
+        {
+        this->BuildTime.Modified();
+        }
+      glActiveTexture(GL_TEXTURE0);
+    }
+
+  double* GetLoadedBounds()
+    {
+    return this->LoadedBounds;
+    }
+
+  vtkIdType* GetLoadedExtent()
+    {
+    return this->LoadedExtent;
+    }
+
+  int GetLoadedCellFlag()
+    {
+    return this->LoadedCellFlag;
+    }
+
+  bool IsLoaded()
+    {
+    return this->Loaded;
+    }
+
+protected:
+  GLuint TextureId;
+  vtkTimeStamp BuildTime;
+
+  double LoadedBounds[6];
+  vtkIdType LoadedExtent[6];
+
+  int LoadedCellFlag;
+  bool Loaded;
+};
+
+//----------------------------------------------------------------------------
+class vtkMapMaskTextureId
+{
+public:
+  std::map<vtkImageData *,vtkVolumeMask*> Map;
+  vtkMapMaskTextureId()
+    {
+    }
+private:
+  vtkMapMaskTextureId(const vtkMapMaskTextureId &other);
+  vtkMapMaskTextureId &operator=(const vtkMapMaskTextureId &other);
+};
+
+#endif // vtkVolumeMask_h_
+// VTK-HeaderTest-Exclude: vtkVolumeMask.h
diff --git a/Rendering/VolumeOpenGLNew/vtkVolumeShader.cxx b/Rendering/VolumeOpenGLNew/vtkVolumeShader.cxx
new file mode 100644
index 0000000..cf43e79
--- /dev/null
+++ b/Rendering/VolumeOpenGLNew/vtkVolumeShader.cxx
@@ -0,0 +1,215 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+  Module:    vtkOpenGLProjectedTetrahedraMapper.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 "vtkVolumeShader.h"
+
+#include <iostream>
+#include <fstream>
+
+///---------------------------------------------------------------------------
+vtkVolumeShader::vtkVolumeShader(void)
+{
+  this->Program = 0;
+  this->TotalShaders = 0;
+  this->Shaders[VERTEX_SHADER] = 0;
+  this->Shaders[FRAGMENT_SHADER] = 0;
+  this->Shaders[GEOMETRY_SHADER] = 0;
+  this->AttributeList.clear();
+  this->UniformLocationList.clear();
+}
+
+///---------------------------------------------------------------------------
+///
+vtkVolumeShader::~vtkVolumeShader(void)
+{
+    this->AttributeList.clear();
+    this->UniformLocationList.clear();
+}
+
+///---------------------------------------------------------------------------
+///
+/// \brief vtkVolumeShader::DeleteShaderProgram
+///
+void vtkVolumeShader::DeleteShaderProgram()
+{
+    if (this->Program)
+      {
+      glDeleteProgram(this->Program);
+      }
+    this->Program = 0;
+    this->AttributeList.clear();
+    this->UniformLocationList.clear();
+}
+
+///---------------------------------------------------------------------------
+///
+/// \brief vtkVolumeShader::LoadFromString
+/// \param type
+/// \param source
+///
+void vtkVolumeShader::LoadFromString(GLenum type, const string& source)
+{
+  GLuint shader = glCreateShader(type);
+
+  const char * ptmp = source.c_str();
+  glShaderSource (shader, 1, &ptmp, NULL);
+
+  //check whether the shader loads fine
+  GLint status;
+  glCompileShader (shader);
+  glGetShaderiv (shader, GL_COMPILE_STATUS, &status);
+  if (status == GL_FALSE)
+    {
+    GLint infoLogLength;
+    glGetShaderiv (shader, GL_INFO_LOG_LENGTH, &infoLogLength);
+    GLchar *infoLog= new GLchar[infoLogLength];
+    glGetShaderInfoLog (shader, infoLogLength, NULL, infoLog);
+    cerr <<"Compile log: " << infoLog << endl;
+    delete [] infoLog;
+    }
+  this->Shaders[this->TotalShaders++] = shader;
+}
+
+///---------------------------------------------------------------------------
+///
+/// \brief vtkVolumeShader::CreateAndLinkProgram
+///
+void vtkVolumeShader::CreateAndLinkProgram()
+{
+  this->Program = glCreateProgram ();
+  if (this->Shaders[VERTEX_SHADER] != 0)
+    {
+    glAttachShader (this->Program, this->Shaders[VERTEX_SHADER]);
+    }
+  if (this->Shaders[FRAGMENT_SHADER] != 0)
+    {
+    glAttachShader (this->Program, this->Shaders[FRAGMENT_SHADER]);
+    }
+  if (this->Shaders[GEOMETRY_SHADER] != 0)
+    {
+    glAttachShader (this->Program, this->Shaders[GEOMETRY_SHADER]);
+    }
+
+  //link and check whether the program links fine
+  GLint status;
+  glLinkProgram (this->Program);
+  glGetProgramiv (this->Program, GL_LINK_STATUS, &status);
+  if (status == GL_FALSE)
+    {
+    GLint infoLogLength;
+
+    glGetProgramiv (this->Program, GL_INFO_LOG_LENGTH, &infoLogLength);
+    GLchar* infoLog = new GLchar[infoLogLength];
+    glGetProgramInfoLog (this->Program, infoLogLength, NULL, infoLog);
+    cerr << "Link log: " << infoLog <<endl;
+    delete [] infoLog;
+    }
+
+  glDeleteShader(this->Shaders[VERTEX_SHADER]);
+  glDeleteShader(this->Shaders[FRAGMENT_SHADER]);
+  glDeleteShader(this->Shaders[GEOMETRY_SHADER]);
+
+  this->TotalShaders = 0;
+}
+
+///---------------------------------------------------------------------------
+///
+/// \brief vtkVolumeShader::Use
+///
+void vtkVolumeShader::Use()
+{
+    glUseProgram(this->Program);
+}
+
+///---------------------------------------------------------------------------
+///
+/// \brief vtkVolumeShader::UnUse
+///
+void vtkVolumeShader::UnUse()
+{
+    glUseProgram(0);
+}
+
+///---------------------------------------------------------------------------
+///
+/// \brief vtkVolumeShader::AddAttribute
+/// \param attribute
+///
+void vtkVolumeShader::AddAttribute(const string& attribute)
+{
+  this->AttributeList[attribute] = glGetAttribLocation(
+                                     this->Program, attribute.c_str());
+}
+
+///---------------------------------------------------------------------------
+/// An indexer that returns the location of the attribute
+////
+/// \brief vtkVolumeShader::operator []
+/// \param attribute
+/// \return
+///
+GLuint vtkVolumeShader::operator [](const string& attribute)
+{
+  return this->AttributeList[attribute];
+}
+
+///---------------------------------------------------------------------------
+///
+/// \brief vtkVolumeShader::AddUniform
+/// \param uniform
+///
+void vtkVolumeShader::AddUniform(const string& uniform)
+{
+  this->UniformLocationList[uniform] =
+    glGetUniformLocation(this->Program, uniform.c_str());
+}
+
+///---------------------------------------------------------------------------
+///
+/// \brief vtkVolumeShader::operator ()
+/// \param uniform
+/// \return
+///
+GLuint vtkVolumeShader::operator()(const string& uniform)
+{
+  return this->UniformLocationList[uniform];
+}
+
+///---------------------------------------------------------------------------
+///
+/// \brief vtkVolumeShader::LoadFromFile
+/// \param whichShader
+/// \param filename
+///
+void vtkVolumeShader::LoadFromFile(GLenum whichShader, const string& filename)
+{
+  ifstream fp;
+  fp.open(filename.c_str(), ios_base::in);
+  if(fp)
+    {
+    string line, buffer;
+    while(getline(fp, line))
+      {
+      buffer.append(line);
+      buffer.append("\r\n");
+      }
+    /// copy to source
+    LoadFromString(whichShader, buffer);
+  }
+  else
+    {
+    cerr<<"Error loading shader: "<<filename<<endl;
+    }
+}
diff --git a/Rendering/VolumeOpenGLNew/vtkVolumeShader.h b/Rendering/VolumeOpenGLNew/vtkVolumeShader.h
new file mode 100644
index 0000000..5f6da56
--- /dev/null
+++ b/Rendering/VolumeOpenGLNew/vtkVolumeShader.h
@@ -0,0 +1,58 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+  Module:    vtkOpenGLProjectedTetrahedraMapper.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.
+
+=========================================================================*/
+
+#ifndef vtkVolumeShader_h
+#define vtkVolumeShader_h
+
+#include <vtk_glew.h>
+
+#include <string>
+#include <map>
+
+using namespace std;
+
+class vtkVolumeShader
+{
+public:
+    vtkVolumeShader(void);
+    ~vtkVolumeShader(void);
+    void LoadFromString(GLenum whichShader, const string& source);
+    void LoadFromFile(GLenum whichShader, const string& filename);
+    void CreateAndLinkProgram();
+    void Use();
+    void UnUse();
+    void AddAttribute(const string& attribute);
+    void AddUniform(const string& uniform);
+    unsigned int GetProgram()
+      {
+      return this->Program;
+      }
+
+    //An indexer that returns the location of the attribute/uniform
+    GLuint operator[](const string& attribute);
+    GLuint operator()(const string& uniform);
+    void DeleteShaderProgram();
+
+private:
+    enum ShaderType {VERTEX_SHADER, FRAGMENT_SHADER, GEOMETRY_SHADER};
+    GLuint	Program;
+    int TotalShaders;
+    GLuint Shaders[3];//0->vertexshader, 1->fragmentshader, 2->geometryshader
+    map<string,GLuint> AttributeList;
+    map<string,GLuint> UniformLocationList;
+};
+
+#endif // vtkVolumeShader_h
+// VTK-HeaderTest-Exclude: vtkVolumeShader.h
diff --git a/Rendering/VolumeOpenGLNew/vtkVolumeShaderComposer.h b/Rendering/VolumeOpenGLNew/vtkVolumeShaderComposer.h
new file mode 100644
index 0000000..ed151b4
--- /dev/null
+++ b/Rendering/VolumeOpenGLNew/vtkVolumeShaderComposer.h
@@ -0,0 +1,1086 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+  Module:    vtkVolumeShaderComposer.h
+
+  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.
+
+=========================================================================*/
+
+#ifndef _vtkVolumeShaderComposer_h
+#define _vtkVolumeShaderComposer_h
+
+#include "vtkVolumeMask.h"
+
+#include <vtkCamera.h>
+#include <vtkRenderer.h>
+#include <vtkVolume.h>
+#include <vtkVolumeMapper.h>
+#include <vtkVolumeProperty.h>
+
+#include <string>
+
+namespace vtkvolume
+{
+  //--------------------------------------------------------------------------
+  std::string replace(std::string source, const std::string &search,
+                      const std::string replace, bool all)
+    {
+    std::string::size_type pos = 0;
+    bool first = true;
+    while ((pos = source.find(search, 0)) != std::string::npos)
+      {
+      source.replace(pos, search.length(), replace);
+      pos += search.length();
+      if (first)
+        {
+        first = false;
+        if (!all)
+          {
+          return source;
+          }
+        }
+      }
+    return source;
+    }
+
+  //--------------------------------------------------------------------------
+  std::string ComputeClip(vtkRenderer* vtkNotUsed(ren),
+                          vtkVolumeMapper* vtkNotUsed(mapper),
+                          vtkVolume* vtkNotUsed(vol))
+    {
+    return std::string(
+      "mat4 ogl_projection_matrix = m_projection_matrix; \n\
+      mat4 ogl_modelview_matrix = m_modelview_matrix; \n\
+      vec4 pos = ogl_projection_matrix * ogl_modelview_matrix * \n\
+                 m_volume_matrix * vec4(m_in_vertex_pos.xyz, 1); \n\
+      gl_Position = pos;"
+    );
+    }
+
+  //--------------------------------------------------------------------------
+  std::string ComputeTextureCoords(vtkRenderer* vtkNotUsed(ren),
+                                   vtkVolumeMapper* vtkNotUsed(mapper),
+                                   vtkVolume* vtkNotUsed(vol))
+    {
+    return std::string(
+      "// Assuming point data only. Also, we offset the texture coordinate \n\
+       // to account for OpenGL treating voxel at the center of the cell. \n\
+       vec3 uvx = (m_in_vertex_pos - m_vol_extents_min) / \n\
+                  (m_vol_extents_max - m_vol_extents_min); \n\
+       vec3 delta = m_texture_extents_max - m_texture_extents_min; \n\
+       m_texture_coords = (uvx * (delta - vec3(1.0)) + vec3(0.5)) / delta;"
+    );
+    }
+
+  //--------------------------------------------------------------------------
+  std::string BaseGlobalsVert(vtkRenderer* vtkNotUsed(ren),
+                              vtkVolumeMapper* vtkNotUsed(mapper),
+                              vtkVolume* vtkNotUsed(vol))
+    { return std::string(
+    "uniform mat4 m_modelview_matrix; \n\
+    uniform mat4 m_projection_matrix; \n\
+    uniform mat4 m_volume_matrix; \n\
+    \n\
+    uniform vec3 m_vol_extents_min; \n\
+    uniform vec3 m_vol_extents_max; \n\
+    \n\
+    uniform vec3 m_texture_extents_max; \n\
+    uniform vec3 m_texture_extents_min;"
+    );
+    }
+
+  //--------------------------------------------------------------------------
+  std::string BaseGlobalsFrag(vtkRenderer* vtkNotUsed(ren),
+                              vtkVolumeMapper* vtkNotUsed(mapper),
+                              vtkVolume* vtkNotUsed(vol))
+    {
+    return std::string(
+      "// Volume dataset \n\
+      uniform sampler3D m_volume; \n\
+      \n\
+      uniform sampler2D m_noise_sampler; \n\
+      uniform sampler2D m_depth_sampler; \n\
+      \n\
+      // Camera position \n\
+      uniform vec3 m_camera_pos; \n\
+      uniform vec3 m_light_pos; \n\
+      \n\
+      // view and model matrices \n\
+      uniform mat4 m_volume_matrix; \n\
+      uniform mat4 m_inverse_volume_matrix; \n\
+      uniform mat4 m_projection_matrix; \n\
+      uniform mat4 m_inverse_projection_matrix; \n\
+      uniform mat4 m_modelview_matrix; \n\
+      uniform mat4 m_inverse_modelview_matrix; \n\
+      uniform mat4 m_texture_dataset_matrix; \n\
+      uniform mat4 m_inverse_texture_dataset_matrix; \n\
+      \n\
+      // Ray step size \n\
+      uniform vec3 m_cell_step; \n\
+      uniform vec2 m_scalars_range; \n\
+      uniform vec3 m_cell_spacing; \n\
+      \n\
+      // Sample distance \n\
+      uniform float m_sample_distance; \n\
+      \n\
+      // Scales \n\
+      uniform vec3 m_cell_scale; \n\
+      uniform vec2 m_window_lower_left_corner; \n\
+      uniform vec2 m_inv_original_window_size; \n\
+      uniform vec2 m_inv_window_size; \n\
+      uniform vec3 m_texture_extents_max; \n\
+      uniform vec3 m_texture_extents_min; \n\
+      \n\
+      // Material and lighting \n\
+      uniform vec3 m_diffuse; \n\
+      uniform vec3 m_ambient; \n\
+      uniform vec3 m_specular; \n\
+      uniform float m_shininess; \n\
+      // Other useful variales; \n\
+      vec4 g_src_color; \n\
+      vec4 g_light_pos_obj; \n\
+      vec4 g_eye_pos_obj; ");
+    }
+
+  //--------------------------------------------------------------------------
+  std::string BaseInit(vtkRenderer* vtkNotUsed(ren),
+                       vtkVolumeMapper* vtkNotUsed(mapper),
+                       vtkVolume* vtkNotUsed(vol))
+    {
+    return std::string(
+      "g_light_pos_obj; \n\
+      \n\
+      // Get the 3D texture coordinates for lookup into the m_volume dataset \n\
+      g_data_pos = m_texture_coords.xyz; \n\
+      \n\
+      // Eye position in object space  \n\
+      g_eye_pos_obj = (m_inverse_volume_matrix * vec4(m_camera_pos, 1.0)); \n\
+      if (g_eye_pos_obj.w != 0.0) \n\
+        { \n\
+        g_eye_pos_obj.x /= g_eye_pos_obj.w; \n\
+        g_eye_pos_obj.y /= g_eye_pos_obj.w; \n\
+        g_eye_pos_obj.z /= g_eye_pos_obj.w; \n\
+        g_eye_pos_obj.w = 1.0; \n\
+        } \n\
+      \n\
+      // Getting the ray marching direction (in object space); \n\
+      vec3 geom_dir = computeRayDirection(); \n\
+      \n\
+      // Multiply the raymarching direction with the step size to get the \n\
+      // sub-step size we need to take at each raymarching step  \n\
+      g_dir_step = (m_inverse_texture_dataset_matrix * \n\
+                    vec4(geom_dir, 0.0)).xyz * m_sample_distance; \n\
+      \n\
+      g_data_pos += g_dir_step * texture2D(m_noise_sampler, g_data_pos.xy).x;\n\
+      \n\
+      // Flag to deternmine if voxel should be considered for the rendering \n\
+      bool l_skip = false;");
+    }
+
+  //--------------------------------------------------------------------------
+  std::string BaseIncrement(vtkRenderer* vtkNotUsed(ren),
+                            vtkVolumeMapper* vtkNotUsed(mapper),
+                            vtkVolume* vtkNotUsed(vol))
+    {
+    return std::string("\n\
+                       l_skip = false;");
+    }
+
+  //--------------------------------------------------------------------------
+  std::string BaseExit(vtkRenderer* vtkNotUsed(ren),
+                       vtkVolumeMapper* vtkNotUsed(mapper),
+                       vtkVolume* vtkNotUsed(vol))
+    {
+    return std::string("");
+    }
+
+  //--------------------------------------------------------------------------
+  std::string GradientsComputeFunc(vtkRenderer* vtkNotUsed(ren),
+                                   vtkVolumeMapper* vtkNotUsed(mapper),
+                                   vtkVolume* vol,
+                                   int vtkNotUsed(numberOfComponents))
+  {
+    if (vol->GetProperty()->GetShade() &&
+        vol->GetProperty()->GetDisableGradientOpacity())
+      {
+      return std::string(" \n\
+        vec3 computeGradient() \n\
+          { \n\
+          vec3 g1; \n\
+          vec3 g2; \n\
+          vec3 xvec = vec3(m_cell_step[0], 0.0, 0.0); \n\
+          vec3 yvec = vec3(0.0, m_cell_step[1], 0.0); \n\
+          vec3 zvec = vec3(0.0, 0.0, m_cell_step[2]); \n\
+          g1.x = texture3D(m_volume, vec3(g_data_pos + xvec)).x; \n\
+          g1.y = texture3D(m_volume, vec3(g_data_pos + yvec)).x; \n\
+          g1.z = texture3D(m_volume, vec3(g_data_pos + zvec)).x; \n\
+          g2.x = texture3D(m_volume, vec3(g_data_pos - xvec)).x; \n\
+          g2.y = texture3D(m_volume, vec3(g_data_pos - yvec)).x; \n\
+          g2.z = texture3D(m_volume, vec3(g_data_pos - zvec)).x; \n\
+          return (g1 - g2); \n\
+         }");
+    }
+    else if (vol->GetProperty()->GetShade() &&
+             !vol->GetProperty()->GetDisableGradientOpacity())
+      {
+      return std::string(" \n\
+        vec3 computeGradient() \n\
+          { \n\
+          vec3 g1; \n\
+          vec3 g2; \n\
+          vec3 xvec = vec3(m_cell_step[0], 0.0, 0.0); \n\
+          vec3 yvec = vec3(0.0, m_cell_step[1], 0.0); \n\
+          vec3 zvec = vec3(0.0, 0.0, m_cell_step[2]); \n\
+          g1.x = texture3D(m_volume, vec3(g_data_pos + xvec)).x; \n\
+          g1.y = texture3D(m_volume, vec3(g_data_pos + yvec)).x; \n\
+          g1.z = texture3D(m_volume, vec3(g_data_pos + zvec)).x; \n\
+          g2.x = texture3D(m_volume, vec3(g_data_pos - xvec)).x; \n\
+          g2.y = texture3D(m_volume, vec3(g_data_pos - yvec)).x; \n\
+          g2.z = texture3D(m_volume, vec3(g_data_pos - zvec)).x; \n\
+          g1.x = m_scalars_range[0] + ( \n\
+                 m_scalars_range[1] - m_scalars_range[0]) * g1.x; \n\
+          g1.y = m_scalars_range[0] + ( \n\
+                 m_scalars_range[1] - m_scalars_range[0]) * g1.y; \n\
+          g1.z = m_scalars_range[0] + ( \n\
+                 m_scalars_range[1] - m_scalars_range[0]) * g1.z; \n\
+          g2.x = m_scalars_range[0] + ( \n\
+                 m_scalars_range[1] - m_scalars_range[0]) * g2.x; \n\
+          g2.y = m_scalars_range[0] + ( \n\
+                 m_scalars_range[1] - m_scalars_range[0]) * g2.y; \n\
+          g2.z = m_scalars_range[0] + ( \n\
+                 m_scalars_range[1] - m_scalars_range[0]) * g2.z; \n\
+          g2 = g1 - g2; \n\
+          return g2; \n\
+          }");
+      }
+    else
+      {
+      return std::string(
+        "vec3 computeGradient() \n\
+           { \n\
+             return vec3(0.0); \n\
+           }");
+      }
+  }
+
+  //--------------------------------------------------------------------------
+  std::string LightComputeFunc(vtkRenderer*vtkNotUsed(ren),
+                               vtkVolumeMapper* vtkNotUsed(mapper),
+                               vtkVolume* vol,
+                               int vtkNotUsed(numberOfComponents))
+    {
+    vtkVolumeProperty* volProperty = vol->GetProperty();
+    if (volProperty->GetShade() &&
+        volProperty->GetDisableGradientOpacity())
+      {
+      return std::string(" \n\
+        vec4 computeLighting(vec4 color) \n\
+          {\n\
+          vec3 ldir = normalize(g_light_pos_obj.xyz - m_vertex_pos); \n\
+          vec3 vdir = normalize(g_eye_pos_obj.xyz - m_vertex_pos); \n\
+          vec3 h = normalize(ldir + vdir); \n\
+          vec3 g2 = computeGradient(); \n\
+          g2 = (1.0/m_cell_spacing) * g2; \n\
+          float normalLength = length(g2);\n\
+          if (normalLength > 0.0) \n\
+             { \n\
+             g2 = normalize(g2); \n\
+             } \n\
+           else \n\
+             { \n\
+             g2 = vec3(0.0, 0.0, 0.0); \n\
+             } \n\
+          vec3 final_color = vec3(0.0); \n\
+          float n_dot_l = dot(g2, ldir); \n\
+          float n_dot_h = dot(g2, h); \n\
+          if (n_dot_l < 0.0) \n\
+            { \n\
+            n_dot_l = -n_dot_l; \n\
+            } \n\
+          if (n_dot_h < 0.0) \n\
+            { \n\
+            n_dot_h = -n_dot_h; \n\
+            } \n\
+          final_color += m_ambient * color.rgb; \n\
+          if (n_dot_l > 0) { \n\
+            final_color += m_diffuse * n_dot_l * color.rgb; \n\
+           } \n\
+          final_color += m_specular * pow(n_dot_h, m_shininess); \n\
+          final_color = clamp(final_color, vec3(0.0), vec3(1.0)); \n\
+          return vec4(final_color, color.a); \n\
+          }");
+      }
+    else if (volProperty->GetShade() &&
+        !volProperty->GetDisableGradientOpacity())
+      {
+      return std::string(" \n\
+        uniform sampler1D m_gradient_transfer_func; \n\
+        vec4 computeLighting(vec4 color) \n\
+          { \n\
+          vec3 grad = computeGradient(); \n\
+          vec3 m_spacing = vec3(m_cell_spacing[0], \n\
+                                m_cell_spacing[1], \n\
+                                m_cell_spacing[2]); \n\
+          vec3 aspect; \n\
+          float avg_spacing = (m_spacing[0] + \n\
+                               m_spacing[1] + \n\
+                               m_spacing[2])/3.0; \n\
+          // Adjust the aspect \n\
+          aspect.x = m_spacing[0] * 2.0 / avg_spacing; \n\
+          aspect.y = m_spacing[1] * 2.0 / avg_spacing; \n\
+          aspect.z = m_spacing[2] * 2.0 / avg_spacing; \n\
+          grad.x /= aspect.x; \n\
+          grad.y /= aspect.y; \n\
+          grad.z /= aspect.z; \n\
+          float grad_mag = sqrt(grad.x * grad.x  + \n\
+                                grad.y * grad.y + \n\
+                                grad.z * grad.z); \n\
+          if (grad_mag > 0.0) \n\
+             { \n\
+             grad.x /= grad_mag; \n\
+             grad.y /= grad_mag; \n\
+             grad.z /= grad_mag; \n\
+             } \n\
+           else \n\
+             { \n\
+             grad = vec3(0.0, 0.0, 0.0); \n\
+             } \n\
+          grad_mag = grad_mag * 1.0 / (0.25 * (m_scalars_range[1] - \n\
+                                              (m_scalars_range[0]))); \n\
+          grad_mag = clamp(grad_mag, 0.0, 1.0); \n\
+          vec4 final_color = vec4(0.0); \n\
+          vec3 ldir = normalize(g_light_pos_obj.xyz - m_vertex_pos); \n\
+          vec3 vdir = normalize(g_eye_pos_obj.xyz - m_vertex_pos); \n\
+          vec3 h = normalize(ldir + vdir); \n\
+          float n_dot_l = dot(grad, ldir); \n\
+          float n_dot_h = dot(grad, h); \n\
+          if (n_dot_l < 0.0) \n\
+            { \n\
+            n_dot_l = -n_dot_l; \n\
+            } \n\
+          if (n_dot_h < 0.0) \n\
+            { \n\
+            n_dot_h = -n_dot_h; \n\
+            } \n\
+          final_color.rgb += m_ambient; \n\
+          final_color.rgb += m_diffuse * n_dot_l * color.rgb; \n\
+          final_color.rgb += m_specular * pow(n_dot_h, m_shininess); \n\
+          final_color.rgb = clamp(final_color.rgb, vec3(0.0), vec3(1.0)); \n\
+          final_color.a = color.a * \n\
+                          texture1D(m_gradient_transfer_func, grad_mag).w; \n\
+          return final_color; \n\
+          }");
+      }
+    else
+      {
+      return std::string(
+        "vec4 computeLighting(vec4 color) \n\
+           { \n\
+           return color; \n\
+           }");
+      }
+    }
+
+  //--------------------------------------------------------------------------
+  std::string RayDirectionFunc(vtkRenderer* ren,
+                               vtkVolumeMapper* vtkNotUsed(mapper),
+                               vtkVolume* vtkNotUsed(vol),
+                               int vtkNotUsed(numberOfComponents))
+    {
+    if (!ren->GetActiveCamera()->GetParallelProjection())
+      {
+      return std::string(
+        "vec3 computeRayDirection() \n\
+           { \n\
+           return normalize(m_vertex_pos.xyz - g_eye_pos_obj.xyz); \n\
+           }");
+      }
+    else
+      {
+      return std::string(
+        "uniform vec3 m_projection_direction; \n\
+         vec3 computeRayDirection() \n\
+           { \n\
+           return normalize((m_inverse_volume_matrix * \n\
+                             vec4(m_projection_direction, 0.0)).xyz); \n\
+           }");
+      }
+    }
+
+  //--------------------------------------------------------------------------
+  std::string ColorTransferFunc(vtkRenderer* vtkNotUsed(ren),
+                                vtkVolumeMapper* vtkNotUsed(mapper),
+                                vtkVolume* vtkNotUsed(vol),
+                                int numberOfComponents)
+    {
+      if (numberOfComponents == 1)
+        {
+        return std::string(" \n\
+          uniform sampler1D m_color_transfer_func; \n\
+          vec4 computeColor(vec4 scalar) \n\
+            { \n\
+            return computeLighting(vec4(texture1D(m_color_transfer_func, \n\
+                                                  scalar.w).xyz, \n\
+                                        computeOpacity(scalar))); \n\
+            }");
+        }
+
+        return std::string(" \n\
+          vec4 computeColor(vec4 scalar) \n\
+          { \n\
+          return computeLighting(vec4(scalar.xyz, computeOpacity(scalar))); \n\
+          }");
+    }
+
+  //--------------------------------------------------------------------------
+  std::string OpacityTransferFunc(vtkRenderer* vtkNotUsed(ren),
+                                  vtkVolumeMapper* vtkNotUsed(mapper),
+                                  vtkVolume* vtkNotUsed(vol),
+                                  int vtkNotUsed(numberOfComponents))
+    {
+    return std::string(
+      "uniform sampler1D m_opacity_transfer_func; \n\
+       float computeOpacity(vec4 scalar) \n\
+         { \n\
+         return texture1D(m_opacity_transfer_func, scalar.w).w; \n\
+         }");
+    }
+
+  //--------------------------------------------------------------------------
+  std::string ShadingGlobalsVert(vtkRenderer* vtkNotUsed(ren),
+                                 vtkVolumeMapper* vtkNotUsed(mapper),
+                                 vtkVolume* vtkNotUsed(vol))
+    {
+    return std::string("");
+    }
+
+  //--------------------------------------------------------------------------
+  std::string ShadingGlobalsFrag(vtkRenderer* vtkNotUsed(ren),
+                                 vtkVolumeMapper* vtkNotUsed(mapper),
+                                 vtkVolume* vtkNotUsed(vol))
+    {
+    return std::string("");
+    }
+
+  //--------------------------------------------------------------------------
+  std::string ShadingInit(vtkRenderer* vtkNotUsed(ren),
+                          vtkVolumeMapper* mapper,
+                          vtkVolume* vol)
+    {
+    if (mapper->GetBlendMode() == vtkVolumeMapper::MAXIMUM_INTENSITY_BLEND)
+      {
+      return std::string(
+        "// We get data between 0.0 - 1.0 range \n\
+         vec4 l_max_value = vec4(0.0);");
+      }
+    else if (mapper->GetBlendMode() == vtkVolumeMapper::MINIMUM_INTENSITY_BLEND)
+      {
+      return std::string(
+        "// We get data between 0.0 - 1.0 range \n\
+        vec4 l_min_value = vec4(1.0);");
+      }
+    else if (mapper->GetBlendMode() == vtkVolumeMapper::ADDITIVE_BLEND)
+      {
+      return std::string(
+        "// We get data between 0.0 - 1.0 range \n\
+        float l_sum_value = 0.0;");
+      }
+    else if (vol->GetProperty()->GetShade())
+      {
+      return std::string(
+        "// Light position in object space \n\
+         g_light_pos_obj = (m_inverse_volume_matrix * \n\
+                            vec4(m_light_pos, 1.0)); \n\
+         if (g_light_pos_obj.w != 0.0) \n\
+          { \n\
+          g_light_pos_obj.x /= g_light_pos_obj.w; \n\
+          g_light_pos_obj.y /= g_light_pos_obj.w; \n\
+          g_light_pos_obj.z /= g_light_pos_obj.w; \n\
+          g_light_pos_obj.w = 1.0; \n\
+          };");
+      }
+    else
+      {
+      return std::string("");
+      }
+    }
+
+  //--------------------------------------------------------------------------
+  std::string ShadingIncrement(vtkRenderer* vtkNotUsed(ren),
+                               vtkVolumeMapper* mapper,
+                               vtkVolume* vtkNotUsed(vol),
+                               vtkImageData* maskInput,
+                               vtkVolumeMask* mask, int maskType)
+    {
+    std::string shaderStr = std::string(
+      "if (!l_skip) \n\
+         {\n");
+
+    if (mapper->GetBlendMode() == vtkVolumeMapper::MAXIMUM_INTENSITY_BLEND)
+      {
+      shaderStr += std::string(
+        "vec4 scalar = texture3D(m_volume, g_data_pos); \n\
+         if (l_max_value.w < scalar.w) \n\
+           { \n\
+           l_max_value = scalar; \n\
+           }");
+      }
+    else if (mapper->GetBlendMode() == vtkVolumeMapper::MINIMUM_INTENSITY_BLEND)
+      {
+      shaderStr += std::string(
+        "vec4 scalar = texture3D(m_volume, g_data_pos) ; \n\
+          if (l_min_value.w > scalar.w) \n\
+            { \n\
+            l_min_value = scalar; \n\
+            }");
+      }
+    else if (mapper->GetBlendMode() == vtkVolumeMapper::ADDITIVE_BLEND)
+      {
+      shaderStr += std::string(
+        "vec4 scalar = texture3D(m_volume, g_data_pos); \n\
+        float opacity = computeOpacity(scalar); \n\
+        l_sum_value = l_sum_value + opacity * scalar.w;");
+      }
+    else if (mapper->GetBlendMode() == vtkVolumeMapper::COMPOSITE_BLEND)
+      {
+      if (!mask || !maskInput ||
+          maskType != vtkGPUVolumeRayCastMapper::LabelMapMaskType)
+        {
+        shaderStr += std::string(
+          "// Data fetching from the red channel of volume texture \n\
+          vec4 scalar = texture3D(m_volume, g_data_pos); \n\
+          vec4 g_src_color = computeColor(scalar);");
+        }
+
+      shaderStr += std::string(
+        "// Opacity calculation using compositing: \n\
+         // here we use front to back compositing scheme whereby the current \n\
+         // sample value is multiplied to the currently accumulated alpha \n\
+         // and then this product is subtracted from the sample value to \n\
+         // get the alpha from the previous steps. \n\
+         // Next, this alpha is multiplied with the current sample colour \n\
+         // and accumulated to the composited colour. The alpha value from \n\
+         // the previous steps is then accumulated to the composited colour \n\
+         // alpha. \n\
+         g_src_color.rgb *= g_src_color.a; \n\
+         g_frag_color = (1.0f - g_frag_color.a) * g_src_color + g_frag_color;");
+      }
+     else
+       {
+       shaderStr += std::string("");
+       }
+      shaderStr += std::string("}");
+      return shaderStr;
+    }
+
+  //--------------------------------------------------------------------------
+  std::string ShadingExit(vtkRenderer* vtkNotUsed(ren),
+                          vtkVolumeMapper* mapper,
+                          vtkVolume* vtkNotUsed(vol))
+    {
+    if (mapper->GetBlendMode() == vtkVolumeMapper::MAXIMUM_INTENSITY_BLEND)
+      {
+      return std::string(
+       "vec4 g_src_color = vec4(computeColor(l_max_value).xyz, \n\
+                                computeOpacity(l_max_value)); \n\
+        g_frag_color.rgb = g_src_color.rgb * g_src_color.a; \n\
+        g_frag_color.a = g_src_color.a;");
+      }
+    else if (mapper->GetBlendMode() == vtkVolumeMapper::MINIMUM_INTENSITY_BLEND)
+      {
+      return std::string(
+        "vec4 g_src_color = vec4(computeColor(l_min_value).xyz, \n\
+                                 computeOpacity(l_min_value)); \n\
+        g_frag_color.rgb = g_src_color.rgb * g_src_color.a; \n\
+        g_frag_color.a = g_src_color.a;");
+      }
+    else if (mapper->GetBlendMode() == vtkVolumeMapper::ADDITIVE_BLEND)
+      {
+      return std::string(
+        "l_sum_value = clamp(l_sum_value, 0.0, 1.0); \n\
+         g_frag_color = vec4(vec3(l_sum_value), 1.0);");
+      }
+    else
+      {
+      return std::string("");
+      }
+  }
+
+  //--------------------------------------------------------------------------
+  std::string TerminationGlobalsVert(vtkRenderer* vtkNotUsed(ren),
+                                     vtkVolumeMapper* vtkNotUsed(mapper),
+                                     vtkVolume* vtkNotUsed(vol))
+    {
+    return std::string("");
+    }
+
+  //--------------------------------------------------------------------------
+  std::string TerminationGlobalsFrag(vtkRenderer* vtkNotUsed(ren),
+                                     vtkVolumeMapper* vtkNotUsed(mapper),
+                                     vtkVolume* vtkNotUsed(vol))
+    {
+    return std::string("");
+    }
+
+  //--------------------------------------------------------------------------
+  std::string TerminationInit(vtkRenderer* vtkNotUsed(ren),
+                              vtkVolumeMapper* vtkNotUsed(mapper),
+                              vtkVolume* vtkNotUsed(vol))
+    {
+    return std::string(
+      "// Minimum texture access coordinate \n\
+      const vec3 l_tex_min = vec3(0); \n\
+      \n\
+      // Maximum texture access coordinate \n\
+      const vec3 l_tex_max = vec3(1); \n\
+      \n\
+      // Flag to indicate if the raymarch loop should terminate \n\
+      bool stop = false; \n\
+      \n\
+      // 2D Texture fragment coordinates [0,1] from fragment coordinates \n\
+      // the frame buffer texture has the size of the plain buffer but \n\
+      // we use a fraction of it. The texture coordinates is less than 1 if \n\
+      // the reduction factor is less than 1. \n\
+      // Device coordinates are between -1 and 1. We need texture \n\
+      // coordinates between 0 and 1 the m_depth_sampler buffer has the \n\
+      // original size buffer. \n\
+      vec2 m_frag_tex_coord = \n\
+        (gl_FragCoord.xy - m_window_lower_left_corner) * \n\
+                               m_inv_window_size; \n\
+      vec4 l_depth_value = texture2D(m_depth_sampler, m_frag_tex_coord); \n\
+      float m_terminate_point_max = 0.0; \n\
+      \n\
+      // Depth test \n\
+      if(gl_FragCoord.z >= l_depth_value.x) \n\
+       { \n\
+       discard; \n\
+       } \n\
+      \n\
+      // color buffer or max scalar buffer have a reduced size. \n\
+      m_frag_tex_coord = (gl_FragCoord.xy - m_window_lower_left_corner) * \n\
+                           m_inv_original_window_size; \n\
+      \n\
+      // Compute max number of iterations it will take before we hit \n\
+      // the termination point \n\
+      \n\
+      // Abscissa of the point on the depth buffer along the ray. \n\
+      // point in texture coordinates \n\
+      vec4 m_terminate_point; \n\
+      m_terminate_point.x = \n\
+        (gl_FragCoord.x - m_window_lower_left_corner.x) * 2.0 * \n\
+                            m_inv_window_size.x - 1.0; \n\
+      m_terminate_point.y = \n\
+        (gl_FragCoord.y - m_window_lower_left_corner.y) * 2.0 * \n\
+                            m_inv_window_size.y - 1.0; \n\
+      m_terminate_point.z = (2.0 * l_depth_value.x - (gl_DepthRange.near + \n\
+                            gl_DepthRange.far)) / gl_DepthRange.diff; \n\
+      m_terminate_point.w = 1.0; \n\
+      \n\
+      // From normalized device coordinates to eye coordinates. \n\
+      // m_projection_matrix is inversed because of way VT \n\
+      // From eye coordinates to texture coordinates \n\
+      m_terminate_point = m_inverse_texture_dataset_matrix * \n\
+                          m_inverse_volume_matrix * \n\
+                          m_inverse_modelview_matrix * \n\
+                          m_inverse_projection_matrix * \n\
+                          m_terminate_point; \n\
+      m_terminate_point /= m_terminate_point.w; \n\
+      \n\
+      m_terminate_point_max = \n\
+        length(m_terminate_point.xyz - g_data_pos.xyz) / \n\
+                              length(g_dir_step); \n\
+      float m_current_t = 0.0;");
+    }
+
+  //--------------------------------------------------------------------------
+  std::string TerminationIncrement(vtkRenderer* vtkNotUsed(ren),
+                                   vtkVolumeMapper* vtkNotUsed(mapper),
+                                   vtkVolume* vtkNotUsed(vol))
+    {
+    return std::string(
+      "// The two constants l_tex_min and l_tex_max have a value of \n\
+      // vec3(-1,-1,-1) and vec3(1,1,1) respectively. To determine if the \n\
+      // data value is outside the m_volume data, we use the sign function. \n\
+      // The sign function return -1 if the value is less than 0, 0 if the \n\
+      // value is equal to 0 and 1 if value is greater than 0. Hence, the \n\
+      // sign function for the calculation (sign(g_data_pos-l_tex_min) and \n\
+      // sign (l_tex_max-g_data_pos)) will give us vec3(1,1,1) at the \n\
+      // possible minimum and maximum position. \n\
+      // When we do a dot product between two vec3(1,1,1) we get answer 3. \n\
+      // So to be within the dataset limits, the dot product will return a \n\
+      // value less than 3. If it is greater than 3, we are already out of \n\
+      // the m_volume dataset \n\
+      stop = dot(sign(g_data_pos - l_tex_min), sign(l_tex_max - g_data_pos)) \n\
+             < 3.0; \n\
+      \n\
+      // If the stopping condition is true we brek out of the ray marching \n\
+      // loop \n\
+      if (stop) \n\
+       { \n\
+       break; \n\
+       } \n\
+      // Early ray termination \n\
+      // if the currently composited colour alpha is already fully saturated \n\
+      // we terminated the loop or if we have hit an obstacle in the \n\
+      // direction of they ray (using depth buffer) we terminate as well. \n\
+      if((g_frag_color.a > (1 - 1/255.0)) ||  \n\
+          m_current_t >= m_terminate_point_max) \n\
+        { \n\
+        break; \n\
+        } \n\
+      ++m_current_t;"
+    );
+    }
+
+  //--------------------------------------------------------------------------
+  std::string TerminationExit(vtkRenderer* vtkNotUsed(ren),
+                              vtkVolumeMapper* vtkNotUsed(mapper),
+                              vtkVolume* vtkNotUsed(vol))
+   {
+    return std::string("");
+   }
+
+  //--------------------------------------------------------------------------
+  std::string CroppingGlobalsVert(vtkRenderer* vtkNotUsed(ren),
+                                  vtkVolumeMapper* vtkNotUsed(mapper),
+                                  vtkVolume* vtkNotUsed(vol))
+  {
+    return std::string("");
+  }
+
+  //--------------------------------------------------------------------------
+  std::string CroppingGlobalsFrag(vtkRenderer* vtkNotUsed(ren),
+                                  vtkVolumeMapper* mapper,
+                                  vtkVolume* vtkNotUsed(vol))
+  {
+    if (!mapper->GetCropping()) {
+      return std::string("");
+    }
+
+    return std::string("\n\
+      uniform float cropping_planes[6]; \n\
+      uniform int cropping_flags [32]; \n\
+      // X: axis = 0, Y: axis = 1, Z: axis = 2 \n\
+      // cp Cropping plane bounds (minX, maxX, minY, maxY, minZ, maxZ) \n\
+      int computeRegionCoord(float cp[6], vec3 pos, int axis) \n\
+      { \n\
+        int cpmin = axis * 2; \n\
+        int cpmax = cpmin + 1; \n\
+        \n\
+        if (pos[axis] < cp[cpmin]) \n\
+          { \n\
+          return 1; \n\
+          } \n\
+        else if (pos[axis] >= cp[cpmin] && \n\
+                 pos[axis]  < cp[cpmax]) \n\
+          { \n\
+          return 2; \n\
+          } \n\
+        else if (pos[axis] >= cp[cpmax]) \n\
+          { \n\
+          return 3; \n\
+          } \n\
+        return 0; \n\
+      } \n\
+      \n\
+      int computeRegion(float cp[6], vec3 pos) \n\
+      { \n\
+        return ( computeRegionCoord(cp, pos, 0) +  \n\
+                (computeRegionCoord(cp, pos, 1) - 1) * 3 + \n\
+                (computeRegionCoord(cp, pos, 2) - 1) * 9); \n\
+      }");
+  }
+
+  //--------------------------------------------------------------------------
+  std::string CroppingInit(vtkRenderer* vtkNotUsed(ren),
+                           vtkVolumeMapper* mapper,
+                           vtkVolume* vtkNotUsed(vol))
+  {
+    if (!mapper->GetCropping()) {
+      return std::string("");
+    }
+
+    return std::string("\n\
+      // Convert cropping region to texture space \n\
+      float cropping_planes_ts[6];\n\
+      mat4  datasetToTextureMat = m_inverse_texture_dataset_matrix; \n\
+      vec4 temp = vec4(cropping_planes[0], cropping_planes[1], 0.0, 1.0); \n\
+      temp = datasetToTextureMat * temp; \n\
+      if (temp[3] != 0.0) {temp[0] /= temp[3]; temp[1] /= temp[3];} \n\
+      cropping_planes_ts[0] = temp[0];\n\
+      cropping_planes_ts[1] = temp[1];\n\
+      \n\
+      temp = vec4(cropping_planes[2], cropping_planes[3], 0.0, 1.0); \n\
+      temp = datasetToTextureMat * temp; \n\
+      if (temp[3] != 0.0) {temp[0] /= temp[3]; temp[1] /= temp[3];} \n\
+      cropping_planes_ts[2] = temp[0];\n\
+      cropping_planes_ts[3] = temp[1];\n\
+      \n\
+      temp = vec4(cropping_planes[4], cropping_planes[5], 0.0, 1.0); \n\
+      temp = datasetToTextureMat * temp; \n\
+      if (temp[3] != 0.0) {temp[0] /= temp[3]; temp[1] /= temp[3];} \n\
+      cropping_planes_ts[4] = temp[0];\n\
+      cropping_planes_ts[5] = temp[1];");
+  }
+
+  //--------------------------------------------------------------------------
+  std::string CroppingIncrement(vtkRenderer* vtkNotUsed(ren),
+                                vtkVolumeMapper* mapper,
+                                vtkVolume* vtkNotUsed(vol))
+  {
+    if (!mapper->GetCropping()) {
+      return std::string("");
+    }
+
+    return std::string("\n\
+      // Determine region \n\
+      int regionNo = computeRegion(cropping_planes_ts, g_data_pos); \n\
+      \n\
+      // Do & operation with cropping flags \n\
+      // Pass the flag that its Ok to sample or not to sample \n\
+      if (cropping_flags[regionNo] == 0) \n\
+       { \n\
+       // Skip this voxel \n\
+       l_skip = true; \n\
+       }");
+  }
+
+  //--------------------------------------------------------------------------
+  std::string CroppingExit(vtkRenderer* vtkNotUsed(ren),
+                           vtkVolumeMapper* vtkNotUsed(mapper),
+                           vtkVolume* vtkNotUsed(vol))
+  {
+    return std::string("");
+  }
+
+  //--------------------------------------------------------------------------
+  std::string ClippingGlobalsVert(vtkRenderer* vtkNotUsed(ren),
+                                  vtkVolumeMapper* vtkNotUsed(mapper),
+                                  vtkVolume* vtkNotUsed(vol))
+  {
+    return std::string("");
+  }
+
+  //--------------------------------------------------------------------------
+  std::string ClippingGlobalsFrag(vtkRenderer* vtkNotUsed(ren),
+                                  vtkVolumeMapper* vtkNotUsed(mapper),
+                                  vtkVolume* vtkNotUsed(vol))
+  {
+    return std::string("");
+  }
+
+  //--------------------------------------------------------------------------
+  std::string ClippingInit(vtkRenderer* vtkNotUsed(ren),
+                           vtkVolumeMapper* mapper,
+                           vtkVolume* vtkNotUsed(vol))
+  {
+    if (!mapper->GetClippingPlanes())
+      {
+      return std::string("");
+      }
+   else
+      {
+      return std::string("\n\
+        float clipping_planes_ts[48];\n\
+        int clipping_planes_size = int(m_clipping_planes[0]);\n\
+        \n\
+        mat4 world_to_texture_mat = m_inverse_texture_dataset_matrix *\n\
+                                    m_inverse_volume_matrix;\n\
+        for (int i = 0; i < clipping_planes_size; i = i + 6)\n\
+          {\n\
+          vec4 origin = vec4(m_clipping_planes[i + 1],\n\
+                             m_clipping_planes[i + 2],\n\
+                             m_clipping_planes[i + 3], 1.0);\n\
+          vec4 normal = vec4(m_clipping_planes[i + 4],\n\
+                             m_clipping_planes[i + 5],\n\
+                             m_clipping_planes[i + 6], 0.0);\n\
+          \n\
+          origin = world_to_texture_mat * origin;\n\
+          normal = world_to_texture_mat * normal;\n\
+          \n\
+          if (origin[3] != 0.0)\n\
+            {\n\
+            origin[0] = origin[0] / origin[3];\n\
+            origin[1] = origin[1] / origin[3];\n\
+            origin[2] = origin[2] / origin[3];\n\
+            }\n\
+          if (normal[3] != 0.0)\n\
+            {\n\
+            normal[0] = normal[0] / normal[3];\n\
+            normal[1] = normal[1] / normal[3];\n\
+            normal[2] = normal[2] / normal[3];\n\
+            }\n\
+          \n\
+          clipping_planes_ts[i]     = origin[0];\n\
+          clipping_planes_ts[i + 1] = origin[1];\n\
+          clipping_planes_ts[i + 2] = origin[2];\n\
+          \n\
+          clipping_planes_ts[i + 3] = normal[0];\n\
+          clipping_planes_ts[i + 4] = normal[1];\n\
+          clipping_planes_ts[i + 5] = normal[2];\n\
+          }");
+      }
+  }
+
+  //--------------------------------------------------------------------------
+  std::string ClippingIncrement(vtkRenderer* vtkNotUsed(ren),
+                                vtkVolumeMapper* mapper,
+                                vtkVolume* vtkNotUsed(vol))
+  {
+    if (!mapper->GetClippingPlanes())
+      {
+      return std::string("");
+      }
+    else
+      {
+      return std::string("\n\
+        for (int i = 0; i < (clipping_planes_size) && !l_skip; i = i + 6)\n\
+         {\n\
+         if (dot(vec3(g_data_pos - vec3(clipping_planes_ts[i],\n\
+                                        clipping_planes_ts[i + 1],\n\
+                                        clipping_planes_ts[i + 2])),\n\
+             vec3(clipping_planes_ts[i + 3],\n\
+                  clipping_planes_ts[i + 4],\n\
+                  clipping_planes_ts[i + 5])) < 0)\n\
+           {\n\
+           l_skip = true;\n\
+           break;\n\
+           }\n\
+         }");
+      }
+  }
+
+  //--------------------------------------------------------------------------
+  std::string ClippingExit(vtkRenderer* vtkNotUsed(ren),
+                           vtkVolumeMapper* vtkNotUsed(mapper),
+                           vtkVolume* vtkNotUsed(vol))
+  {
+    return std::string("");
+  }
+
+  //--------------------------------------------------------------------------
+  std::string BinaryMaskGlobalsFrag(vtkRenderer* vtkNotUsed(ren),
+                                    vtkVolumeMapper* vtkNotUsed(mapper),
+                                    vtkVolume* vtkNotUsed(vol),
+                                    vtkImageData* maskInput,
+                                    vtkVolumeMask* mask,
+                                    int vtkNotUsed(maskType))
+  {
+    if (!mask || !maskInput)
+      {
+      return std::string("");
+      }
+    else
+      {
+      return std::string("uniform sampler3D m_mask;");
+      }
+  }
+
+  //--------------------------------------------------------------------------
+  std::string BinaryMaskIncrement(vtkRenderer* vtkNotUsed(ren),
+                                  vtkVolumeMapper* vtkNotUsed(mapper),
+                                  vtkVolume* vtkNotUsed(vol),
+                                  vtkImageData* maskInput,
+                                  vtkVolumeMask* mask,
+                                  int maskType)
+  {
+    if (!mask || !maskInput ||
+        maskType == vtkGPUVolumeRayCastMapper::LabelMapMaskType)
+      {
+      return std::string("");
+      }
+    else
+      {
+      return std::string("\n\
+        vec4 maskValue = texture3D(m_mask, g_data_pos);\n\
+        if(maskValue.a <= 0.0)\n\
+          {\n\
+          l_skip = true;\n\
+          }");
+      }
+  }
+
+  //--------------------------------------------------------------------------
+  std::string CompositeMaskGlobalsFrag(vtkRenderer* vtkNotUsed(ren),
+                                       vtkVolumeMapper* vtkNotUsed(mapper),
+                                       vtkVolume* vtkNotUsed(vol),
+                                       vtkImageData* maskInput,
+                                       vtkVolumeMask* mask,
+                                       int maskType)
+  {
+    if (!mask || !maskInput ||
+        maskType != vtkGPUVolumeRayCastMapper::LabelMapMaskType)
+      {
+      return std::string("");
+      }
+    else
+      {
+      return std::string("\n\
+        uniform float m_mask_blendfactor;\n\
+        uniform sampler1D m_mask_1;\n\
+        uniform sampler1D m_mask_2;");
+      }
+  }
+
+  //--------------------------------------------------------------------------
+  std::string CompositeMaskIncrement(vtkRenderer* vtkNotUsed(ren),
+                                     vtkVolumeMapper* vtkNotUsed(mapper),
+                                     vtkVolume* vtkNotUsed(vol),
+                                     vtkImageData* maskInput,
+                                     vtkVolumeMask* mask,
+                                     int maskType)
+  {
+    if (!mask || !maskInput ||
+        maskType != vtkGPUVolumeRayCastMapper::LabelMapMaskType)
+      {
+      return std::string("");
+      }
+    else
+      {
+      return std::string("\n\
+        vec4 scalar = texture3D(m_volume, g_data_pos); \n\
+        if (m_mask_blendfactor == 0.0)\n\
+          {\n\
+          g_src_color = computeColor(scalar);\n\
+          }\n\
+        else\n\
+         {\n\
+         // Get the mask value at this same location\n\
+         vec4 maskValue = texture3D(m_mask, g_data_pos);\n\
+         if(maskValue.a == 0.0)\n\
+           {\n\
+           g_src_color = computeColor(scalar);\n\
+           }\n\
+         else\n\
+           {\n\
+           if (maskValue.a == 1.0/255.0)\n\
+             {\n\
+             g_src_color = texture1D(m_mask_1, scalar.w);\n\
+             }\n\
+           else\n\
+             {\n\
+             // maskValue.a == 2.0/255.0\n\
+             g_src_color = texture1D(m_mask_2, scalar.w);\n\
+             }\n\
+           g_src_color.a = 1.0; \n\
+           if(m_mask_blendfactor < 1.0) \n\
+             {\n\
+             g_src_color = (1.0 - m_mask_blendfactor) * computeColor(scalar)\n\
+               + m_mask_blendfactor * g_src_color;\n\
+             }\n\
+           }\n\
+          g_src_color.a = computeOpacity(scalar); \n\
+         }");
+      }
+  }
+}
+
+#endif // _vtkVolumeShaderComposer_h
+// VTK-HeaderTest-Exclude: vtkVolumeShaderComposer.h
diff --git a/Rendering/VolumeOpenGLNew/vtkVolumeStateRAII.h b/Rendering/VolumeOpenGLNew/vtkVolumeStateRAII.h
new file mode 100644
index 0000000..eb28ca7
--- /dev/null
+++ b/Rendering/VolumeOpenGLNew/vtkVolumeStateRAII.h
@@ -0,0 +1,102 @@
+/*=========================================================================
+
+  Program:   Visualization Toolkit
+  Module:    vtkVolumeStateRAII.h
+
+  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.
+
+=========================================================================*/
+
+#ifndef vtkVolumeStateRAII_h
+#define vtkVolumeStateRAII_h
+
+// Only these states can be queries via glIsEnabled:
+// http://www.khronos.org/opengles/sdk/docs/man/
+
+class vtkVolumeStateRAII
+  {
+  public:
+    vtkVolumeStateRAII()
+      {
+      this->DepthTestEnabled = (glIsEnabled(GL_DEPTH_TEST) != 0);
+
+      this->BlendEnabled = (glIsEnabled(GL_BLEND) != 0);
+
+      this->CullFaceEnabled = (glIsEnabled(GL_CULL_FACE) != 0);
+
+      // Enable texture 1D and 3D as we are using it
+      // for transfer functions and m_volume data
+      glEnable(GL_TEXTURE_1D);
+      glEnable(GL_TEXTURE_2D);
+      glEnable(GL_TEXTURE_3D);
+
+      // Enable depth_sampler test
+      if (!this->DepthTestEnabled)
+        {
+        std::cerr << "enabling depth test" << std::endl;
+        glEnable(GL_DEPTH_TEST);
+        }
+
+      // Set the over blending function
+      // NOTE: It is important to choose GL_ONE vs GL_SRC_ALPHA as our colors
+      // will be premultiplied by the alpha value (doing front to back blending)
+      glBlendFunc(GL_ONE,GL_ONE_MINUS_SRC_ALPHA);
+
+      if (!this->BlendEnabled)
+        {
+        glEnable(GL_BLEND);
+        }
+
+      // Enable cull face
+      if (!this->CullFaceEnabled)
+        {
+        glEnable(GL_CULL_FACE);
+        }
+      }
+
+    ~vtkVolumeStateRAII()
+      {
+#ifndef __APPLE__
+      glBindVertexArray(0);
+#endif
+      glBindBuffer(GL_ARRAY_BUFFER, 0);
+      glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
+
+      if (!this->CullFaceEnabled)
+        {
+        glDisable(GL_CULL_FACE);
+        }
+
+      glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+
+      if (!this->BlendEnabled)
+        {
+        glDisable(GL_BLEND);
+        }
+
+      if (!this->DepthTestEnabled)
+        {
+        glDisable(GL_DEPTH_TEST);
+        }
+
+      glActiveTexture(GL_TEXTURE0);
+
+      glDisable(GL_TEXTURE_3D);
+      glDisable(GL_TEXTURE_2D);
+      glDisable(GL_TEXTURE_1D);
+      }
+
+private:
+  bool DepthTestEnabled;
+  bool BlendEnabled;
+  bool CullFaceEnabled;
+};
+
+#endif // vtkVolumeStateRAII_h
+// VTK-HeaderTest-Exclude: vtkVolumeStateRAII.h
diff --git a/Testing/Data/CuspySurface.vtp.md5 b/Testing/Data/CuspySurface.vtp.md5
deleted file mode 100644
index 4dfd37e..0000000
--- a/Testing/Data/CuspySurface.vtp.md5
+++ /dev/null
@@ -1 +0,0 @@
-b78e62003c1960033b7b5e80c4b3e38a
diff --git a/Testing/Data/XDMF/temporalStaticMeshes.h5.md5 b/Testing/Data/XDMF/temporalStaticMeshes.h5.md5
deleted file mode 100644
index 28ab205..0000000
--- a/Testing/Data/XDMF/temporalStaticMeshes.h5.md5
+++ /dev/null
@@ -1 +0,0 @@
-70249b3970291bca08b61b20614af6da
diff --git a/Testing/Data/XDMF/temporalStaticMeshes.xmf.md5 b/Testing/Data/XDMF/temporalStaticMeshes.xmf.md5
deleted file mode 100644
index 9f4acf6..0000000
--- a/Testing/Data/XDMF/temporalStaticMeshes.xmf.md5
+++ /dev/null
@@ -1 +0,0 @@
-bbb4f0d6a1e35eca6bc0daf99554dd2d
diff --git a/Testing/Data/al_foam_smallest.0.tif.md5 b/Testing/Data/al_foam_smallest.0.tif.md5
deleted file mode 100644
index 2770ad1..0000000
--- a/Testing/Data/al_foam_smallest.0.tif.md5
+++ /dev/null
@@ -1 +0,0 @@
-e1227be0aa2058bb2070bb9e3a62d320
diff --git a/Testing/Data/cyl_with_NaN.g.md5 b/Testing/Data/cyl_with_NaN.g.md5
deleted file mode 100644
index 1f49d93..0000000
--- a/Testing/Data/cyl_with_NaN.g.md5
+++ /dev/null
@@ -1 +0,0 @@
-df330c4e2d7603b5d7c16d54b1d4d43f
diff --git a/Testing/Data/ghost_cells.vtk.md5 b/Testing/Data/ghost_cells.vtk.md5
deleted file mode 100644
index 9eaf67c..0000000
--- a/Testing/Data/ghost_cells.vtk.md5
+++ /dev/null
@@ -1 +0,0 @@
-74ab71228a6ae61f5ddfaa477304c5b7
diff --git a/Testing/Data/ghost_cells.vtu.md5 b/Testing/Data/ghost_cells.vtu.md5
deleted file mode 100644
index f2f7a9a..0000000
--- a/Testing/Data/ghost_cells.vtu.md5
+++ /dev/null
@@ -1 +0,0 @@
-3f1d9e9a470ebd35aedfce8860ac091c
diff --git a/Testing/Data/golf.csv.md5 b/Testing/Data/golf.csv.md5
deleted file mode 100644
index e353145..0000000
--- a/Testing/Data/golf.csv.md5
+++ /dev/null
@@ -1 +0,0 @@
-a934e3e244376fc48dda4123c5ffd923
diff --git a/Testing/Data/periodicPiece.vtu.md5 b/Testing/Data/periodicPiece.vtu.md5
deleted file mode 100644
index 0f7f037..0000000
--- a/Testing/Data/periodicPiece.vtu.md5
+++ /dev/null
@@ -1 +0,0 @@
-c57f0cfd6832cabb3e9f9751b6f9f809
diff --git a/Testing/Data/planar_rgb.nii.gz.md5 b/Testing/Data/planar_rgb.nii.gz.md5
deleted file mode 100644
index 0f5b1f1..0000000
--- a/Testing/Data/planar_rgb.nii.gz.md5
+++ /dev/null
@@ -1 +0,0 @@
-d4efcf01edb656d21c4d2b7f69fa1c80
diff --git a/Testing/GenericBridge/vtkBridgeAttribute.cxx b/Testing/GenericBridge/vtkBridgeAttribute.cxx
index b158138..ce15a99 100644
--- a/Testing/GenericBridge/vtkBridgeAttribute.cxx
+++ b/Testing/GenericBridge/vtkBridgeAttribute.cxx
@@ -140,7 +140,7 @@ vtkIdType vtkBridgeAttribute::GetSize()
 
 //-----------------------------------------------------------------------------
 // Description:
-// Size in kibibytes (1024 bytes) taken by the attribute.
+// Size in kilobytes taken by the attribute.
 unsigned long vtkBridgeAttribute::GetActualMemorySize()
 {
   return this->Data->GetArray(this->AttributeNumber)->GetActualMemorySize();
@@ -472,7 +472,10 @@ vtkBridgeAttribute::~vtkBridgeAttribute()
       this->Cd->Delete();
       }
     }
-  delete[] this->InternalTuple;
+  if(this->InternalTuple!=0)
+    {
+    delete[] this->InternalTuple;
+    }
 }
 
 //-----------------------------------------------------------------------------
diff --git a/Testing/GenericBridge/vtkBridgeAttribute.h b/Testing/GenericBridge/vtkBridgeAttribute.h
index ae8b2b1..8afff6b 100644
--- a/Testing/GenericBridge/vtkBridgeAttribute.h
+++ b/Testing/GenericBridge/vtkBridgeAttribute.h
@@ -78,7 +78,7 @@ class VTKTESTINGGENERICBRIDGE_EXPORT vtkBridgeAttribute : public vtkGenericAttri
   vtkIdType GetSize();
 
   // Description:
-  // Size in kibibytes (1024 bytes) taken by the attribute.
+  // Size in kilobytes taken by the attribute.
   unsigned long GetActualMemorySize();
 
   // Description:
diff --git a/Testing/GenericBridge/vtkBridgeCell.cxx b/Testing/GenericBridge/vtkBridgeCell.cxx
index 1ea8125..d200d40 100644
--- a/Testing/GenericBridge/vtkBridgeCell.cxx
+++ b/Testing/GenericBridge/vtkBridgeCell.cxx
@@ -1034,7 +1034,10 @@ vtkBridgeCell::~vtkBridgeCell()
   vtkSetObjectBodyMacro(InternalIterator,vtkBridgeCellIterator,0);
   vtkSetObjectBodyMacro(Cell,vtkCell,0);
 
-  delete[] this->Weights;
+  if(this->Weights)
+    {
+    delete[] this->Weights;
+    }
 }
 
 //----------------------------------------------------------------------------
diff --git a/Testing/Rendering/vtkTesting.cxx b/Testing/Rendering/vtkTesting.cxx
index e0a352c..4fc36c5 100644
--- a/Testing/Rendering/vtkTesting.cxx
+++ b/Testing/Rendering/vtkTesting.cxx
@@ -64,7 +64,7 @@ static string vtkTestingGetArgOrEnvOrDefault(
   int argc = static_cast<int>(argv.size());
   for (int i = 0; i < argc; i++)
     {
-    if ((i < (argc - 1)) && (argName == argv[i]))
+    if (argName == argv[i] && i < (argc - 1))
       {
       argValue = argv[i + 1];
       }
@@ -334,14 +334,6 @@ int vtkTesting::LookForFile(const char* newFileName)
     return 1;
     }
 }
-
-//-----------------------------------------------------------------------------
-void vtkTesting::SetFrontBuffer(int frontBuffer)
-{
-  vtkWarningMacro("SetFrontBuffer method is deprecated and has no effet anymore.");
-  this->FrontBuffer = frontBuffer;
-}
-
 //-----------------------------------------------------------------------------
 int vtkTesting::RegressionTest(vtkAlgorithm* imageSource, double thresh)
 {
@@ -386,7 +378,6 @@ int vtkTesting::RegressionTest(double thresh, ostream &os)
     {
     if ("-FrontBuffer" == this->Args[i])
       {
-      vtkWarningMacro("-FrontBuffer option is deprecated and has no effet anymore.");
       this->FrontBufferOn();
       }
     else if ("-NoRerender" == this->Args[i])
@@ -395,25 +386,21 @@ int vtkTesting::RegressionTest(double thresh, ostream &os)
       }
     }
 
-  std::ostringstream out1;
   // perform and extra render to make sure it is displayed
-  this->RenderWindow->Render();
-  rtW2if->ReadFrontBufferOff();
-  rtW2if->Update();
-  int res = this->RegressionTest(rtW2if.Get(), thresh, out1);
-  if (res == FAILED)
+  if (!this->FrontBuffer)
     {
-      std::ostringstream out2;
-      // tell it to read front buffer
-      rtW2if->ReadFrontBufferOn();
-      rtW2if->Update();
-      res = this->RegressionTest(rtW2if.Get(), thresh, out2);
-      os << out2.str();
+    this->RenderWindow->Render();
+    // tell it to read the back buffer
+    rtW2if->ReadFrontBufferOff();
     }
   else
     {
-    os << out1.str();
+    // read the front buffer
+    rtW2if->ReadFrontBufferOn();
     }
+
+  rtW2if->Update();
+  int res = this->RegressionTest(rtW2if.Get(), thresh, os);
   return res;
 }
 //-----------------------------------------------------------------------------
@@ -671,7 +658,7 @@ int vtkTesting::RegressionTest(vtkAlgorithm* imageSource,
     }
 
 
-  os << "Failed Image Test ( " << validName << " ) : " << minError << endl;
+  os << "Failed Image Test : " << minError << endl;
   if (errIndex >= 0)
     {
     newFileName = IncrementFileName(this->ValidImageFileName, errIndex);
@@ -767,13 +754,58 @@ int vtkTesting::Test(int argc, char *argv[], vtkRenderWindow *rw,
     return DO_INTERACTOR;
     }
 
+  testing->FrontBufferOff();
+  for (int i = 0; i < argc; ++i)
+    {
+    if (strcmp("-FrontBuffer", argv[i]) == 0)
+      {
+      testing->FrontBufferOn();
+      }
+    }
+
   if (testing->IsValidImageSpecified())
     {
     testing->SetRenderWindow(rw);
 
     std::ostringstream out1;
-    return testing->RegressionTestAndCaptureOutput(thresh, cout);
+    int res = testing->RegressionTestAndCaptureOutput(thresh, out1);
+    double diff1 = testing->GetImageDifference();
+    bool write_out1 = true;
+
+    // Typically, the image testing is done using the back buffer
+    // to avoid accidentally capturing overlapping window artifacts
+    // in the image when using the front buffer. However, some graphics
+    // drivers do not have up to date contents in the back buffer,
+    // causing "failed" tests even though, upon visual inspection, the
+    // front buffer looks perfectly valid... So:
+    //
+    // If the test failed using the back buffer, re-test using the
+    // front buffer. This way, more tests pass on dashboards run with
+    // the Intel HD built-in graphics drivers.
+    //
+    if (res == vtkTesting::FAILED && testing->GetFrontBuffer() == 0)
+      {
+      testing->FrontBufferOn();
+
+      std::ostringstream out2;
+      res = testing->RegressionTestAndCaptureOutput(thresh, out2);
+      double diff2 = testing->GetImageDifference();
+
+      if (diff2 < diff1)
+        {
+        cout << out2.str();
+        write_out1 = false;
+        }
+      }
+
+    if (write_out1)
+      {
+      cout << out1.str();
+      }
+
+    return res;
     }
+
   return NOT_RUN;
 }
 //-----------------------------------------------------------------------------
diff --git a/Testing/Rendering/vtkTesting.h b/Testing/Rendering/vtkTesting.h
index 7d4e7cc..3f72ffb 100644
--- a/Testing/Rendering/vtkTesting.h
+++ b/Testing/Rendering/vtkTesting.h
@@ -153,9 +153,9 @@ public:
   // Use the front buffer first for regression test comparisons. By
   // default use back buffer first, then try the front buffer if the
   // test fails when comparing to the back buffer.
+  vtkSetClampMacro(FrontBuffer, int, 0, 1);
   vtkBooleanMacro(FrontBuffer, int);
   vtkGetMacro(FrontBuffer, int);
-  void SetFrontBuffer(int frontBuffer);
 
   // Description:
   // Perform the test and return the result. Delegates to
diff --git a/ThirdParty/VPIC/VPICView.cxx b/ThirdParty/VPIC/VPICView.cxx
index ef8fc68..0b5a71b 100644
--- a/ThirdParty/VPIC/VPICView.cxx
+++ b/ThirdParty/VPIC/VPICView.cxx
@@ -26,10 +26,6 @@ VPICView::VPICView(int r, int t, VPICGlobal& dsGlobal) :
                 global(dsGlobal),
                 calculateGridNeeded(true)
 {
-  for (int i = 0; i < DIMENSION; ++i)
-    {
-    this->stride[i] = 1;
-    }
 }
 
 //////////////////////////////////////////////////////////////////////////////
diff --git a/ThirdParty/alglib/alglib/apvt.h b/ThirdParty/alglib/alglib/apvt.h
index f646a67..6778132 100644
--- a/ThirdParty/alglib/alglib/apvt.h
+++ b/ThirdParty/alglib/alglib/apvt.h
@@ -49,16 +49,16 @@ class const_raw_vector
 {
 public:
     const_raw_vector(const T *Data, int Length, int Step):
-        pData(const_cast<T*>(Data)),iLength(Length),iStep(Step){}
+        pData(const_cast<T*>(Data)),iLength(Length),iStep(Step){};
 
     const T* GetData() const
-    { return pData; }
+    { return pData; };
 
     int GetLength() const
-    { return iLength; }
+    { return iLength; };
 
     int GetStep() const
-    { return iStep; }
+    { return iStep; };
 protected:
     T       *pData;
     int     iLength, iStep;
@@ -79,10 +79,10 @@ template<class T>
 class raw_vector : public const_raw_vector<T>
 {
 public:
-    raw_vector(T *Data, int Length, int Step):const_raw_vector<T>(Data, Length, Step){}
+    raw_vector(T *Data, int Length, int Step):const_raw_vector<T>(Data, Length, Step){};
 
     T* GetData()
-    { return const_raw_vector<T>::pData; }
+    { return const_raw_vector<T>::pData; };
 };
 
 
diff --git a/ThirdParty/ftgl/src/FTFont.h b/ThirdParty/ftgl/src/FTFont.h
index a4d1245..7bf0a0c 100644
--- a/ThirdParty/ftgl/src/FTFont.h
+++ b/ThirdParty/ftgl/src/FTFont.h
@@ -88,7 +88,7 @@ class FTGL_EXPORT FTFont
      */
     bool FaceSize( const unsigned int size, const unsigned int res = 72);
 
-    FTSize& GetSize() { return this->charSize; }
+    FTSize& GetSize() { return this->charSize; };
     
     /**
      * Gets the current face.
diff --git a/ThirdParty/ftgl/src/FTSize.h b/ThirdParty/ftgl/src/FTSize.h
index 545fbee..81116ff 100644
--- a/ThirdParty/ftgl/src/FTSize.h
+++ b/ThirdParty/ftgl/src/FTSize.h
@@ -97,7 +97,7 @@ class FTGL_EXPORT FTSize
      */
     FT_Error Error() const { return err; }
     
-    int GetSizeInPoints() const { return this->size; }
+    int GetSizeInPoints() const { return this->size; };
 
   private:
     /**
diff --git a/ThirdParty/glew/vtk_glew.h.in b/ThirdParty/glew/vtk_glew.h.in
index ab306bd..3f95ba3 100644
--- a/ThirdParty/glew/vtk_glew.h.in
+++ b/ThirdParty/glew/vtk_glew.h.in
@@ -48,23 +48,16 @@
 # else
 /* Use the glew library configured for VTK.  */
 #cmakedefine VTK_USE_SYSTEM_GLEW
-//#cmakedefine VTK_USE_X
 #  ifdef VTK_USE_SYSTEM_GLEW
 #    include <GL/glew.h>
 #    ifdef WIN32
 #      include <GL/wglew.h>
 #    endif
-//#    ifdef VTK_USE_X
-//#      include <GL/glxew.h>
-//#    endif
 #  else
 #    include <vtkglew/include/GL/glew.h>
 #    ifdef WIN32
 #      include <vtkglew/include/GL/wglew.h>
 #    endif
-//#    ifdef VTK_USE_X
-//#      include <vtkglew/include/GL/glxew.h>
-//#    endif
 #  endif
 # endif
 #endif
diff --git a/ThirdParty/jsoncpp/CMakeLists.txt b/ThirdParty/jsoncpp/CMakeLists.txt
index a892e8c..206fa40 100644
--- a/ThirdParty/jsoncpp/CMakeLists.txt
+++ b/ThirdParty/jsoncpp/CMakeLists.txt
@@ -1,2 +1 @@
-vtk_module_third_party(JsonCpp
-  VERSION 0.7.0)
+vtk_module_third_party(JsonCpp)
diff --git a/ThirdParty/verdict/vtkverdict/README-VTK.txt b/ThirdParty/verdict/vtkverdict/README-VTK.txt
index 977d468..a46e272 100644
--- a/ThirdParty/verdict/vtkverdict/README-VTK.txt
+++ b/ThirdParty/verdict/vtkverdict/README-VTK.txt
@@ -40,7 +40,8 @@ appropriate date and version number:
  git commit --amend
 
 Edit the commit message to describe the procedure used to obtain the
-content.  Then push the changes back up to the main local repository:
+content.  Be sure to add a Gerrit Change-Id line to the bottom of the
+message.  Then push the changes back up to the main local repository:
 
  git push .. HEAD:verdict-upstream
  cd ..
diff --git a/ThirdParty/verdict/vtkverdict/V_TetMetric.cpp b/ThirdParty/verdict/vtkverdict/V_TetMetric.cpp
index dd183ca..cfa25b6 100644
--- a/ThirdParty/verdict/vtkverdict/V_TetMetric.cpp
+++ b/ThirdParty/verdict/vtkverdict/V_TetMetric.cpp
@@ -31,7 +31,7 @@
 //! the average volume of a tet
 static double v_tet_size = 0;
 
-/*!
+/*! 
   set the average volume of a tet
 */
 C_FUNC_DEF void v_set_tet_size( double size )
@@ -48,24 +48,24 @@ static int v_tet_get_weight (
 {
   static const double rt3 = sqrt(3.0);
   static const double root_of_2 = sqrt(2.0);
-
+  
   w1.set(1,0,0);
   w2.set(0.5, 0.5*rt3, 0 );
-  w3.set(0.5, rt3/6.0, root_of_2/rt3);
+  w3.set(0.5, rt3/6.0, root_of_2/rt3); 
 
-  double scale = pow( 6.*v_tet_size/v_determinant(w1,w2,w3),0.3333333333333);
+  double scale = pow( 6.*v_tet_size/v_determinant(w1,w2,w3),0.3333333333333);   
 
   w1 *= scale;
   w2 *= scale;
   w3 *= scale;
-
+  
   return 1;
 }
 
 /*!
    the edge ratio of a tet
 
-   NB (P. Pebay 01/22/07):
+   NB (P. Pebay 01/22/07): 
      Hmax / Hmin where Hmax and Hmin are respectively the maximum and the
      minimum edge lengths
 */
@@ -76,27 +76,27 @@ C_FUNC_DEF double v_tet_edge_ratio( int /*num_nodes*/, double coordinates[][3] )
   a.set( coordinates[1][0] - coordinates[0][0],
          coordinates[1][1] - coordinates[0][1],
          coordinates[1][2] - coordinates[0][2] );
-
+  
   b.set( coordinates[2][0] - coordinates[1][0],
          coordinates[2][1] - coordinates[1][1],
          coordinates[2][2] - coordinates[1][2] );
-
+  
   c.set( coordinates[0][0] - coordinates[2][0],
          coordinates[0][1] - coordinates[2][1],
          coordinates[0][2] - coordinates[2][2] );
-
+  
   d.set( coordinates[3][0] - coordinates[0][0],
          coordinates[3][1] - coordinates[0][1],
          coordinates[3][2] - coordinates[0][2] );
-
+  
   e.set( coordinates[3][0] - coordinates[1][0],
          coordinates[3][1] - coordinates[1][1],
          coordinates[3][2] - coordinates[1][2] );
-
+  
   f.set( coordinates[3][0] - coordinates[2][0],
          coordinates[3][1] - coordinates[2][1],
          coordinates[3][2] - coordinates[2][2] );
-
+  
   double a2 = a.length_squared();
   double b2 = b.length_squared();
   double c2 = c.length_squared();
@@ -140,14 +140,14 @@ C_FUNC_DEF double v_tet_edge_ratio( int /*num_nodes*/, double coordinates[][3] )
   m2 = mab < mcd ? mab : mcd;
   m2 = m2  < mef ? m2  : mef;
 
-  if( m2 < VERDICT_DBL_MIN )
+  if( m2 < VERDICT_DBL_MIN ) 
     return (double)VERDICT_DBL_MAX;
 
   M2 = Mab > Mcd ? Mab : Mcd;
   M2 = M2  > Mef ? M2  : Mef;
 
   double edge_ratio = sqrt( M2 / m2 );
-
+  
   if( edge_ratio > 0 )
     return (double) VERDICT_MIN( edge_ratio, VERDICT_DBL_MAX );
   return (double) VERDICT_MAX( edge_ratio, -VERDICT_DBL_MAX );
@@ -167,11 +167,11 @@ C_FUNC_DEF double v_tet_scaled_jacobian( int /*num_nodes*/, double coordinates[]
   side0.set( coordinates[1][0] - coordinates[0][0],
              coordinates[1][1] - coordinates[0][1],
              coordinates[1][2] - coordinates[0][2] );
-
+  
   side1.set( coordinates[2][0] - coordinates[1][0],
              coordinates[2][1] - coordinates[1][1],
              coordinates[2][2] - coordinates[1][2] );
-
+  
   side2.set( coordinates[0][0] - coordinates[2][0],
              coordinates[0][1] - coordinates[2][1],
              coordinates[0][2] - coordinates[2][2] );
@@ -179,15 +179,15 @@ C_FUNC_DEF double v_tet_scaled_jacobian( int /*num_nodes*/, double coordinates[]
   side3.set( coordinates[3][0] - coordinates[0][0],
              coordinates[3][1] - coordinates[0][1],
              coordinates[3][2] - coordinates[0][2] );
-
+  
   side4.set( coordinates[3][0] - coordinates[1][0],
              coordinates[3][1] - coordinates[1][1],
              coordinates[3][2] - coordinates[1][2] );
-
+  
   side5.set( coordinates[3][0] - coordinates[2][0],
              coordinates[3][1] - coordinates[2][1],
              coordinates[3][2] - coordinates[2][2] );
-
+  
   double jacobi;
 
   jacobi = side3 % ( side2 * side0 );
@@ -206,13 +206,13 @@ C_FUNC_DEF double v_tet_scaled_jacobian( int /*num_nodes*/, double coordinates[]
     which_node = 2;
   if(length_squared[3] > length_squared[which_node])
     which_node = 3;
-
+  
   double length_product = sqrt( length_squared[which_node] );
   if(length_product < fabs(jacobi))
     length_product = fabs(jacobi);
 
   if( length_product < VERDICT_DBL_MIN )
-    return (double) VERDICT_DBL_MAX;
+    return (double) VERDICT_DBL_MAX; 
 
   static const double root_of_2 = sqrt(2.0);
 
@@ -224,7 +224,7 @@ C_FUNC_DEF double v_tet_scaled_jacobian( int /*num_nodes*/, double coordinates[]
   The radius ratio of a tet
 
   NB (P. Pebay 04/16/07):
-    CR / (3.0 * IR) where CR is the circumsphere radius and IR is the inscribed
+    CR / (3.0 * IR) where CR is the circumsphere radius and IR is the inscribed 
     sphere radius.
     Note that this function is similar to the aspect beta of a tet, except that
     it does not return VERDICT_DBL_MAX if the element has negative orientation.
@@ -238,11 +238,11 @@ C_FUNC_DEF double v_tet_radius_ratio( int /*num_nodes*/, double coordinates[][3]
   side[0].set( coordinates[1][0] - coordinates[0][0],
                coordinates[1][1] - coordinates[0][1],
                coordinates[1][2] - coordinates[0][2] );
-
+  
   side[1].set( coordinates[2][0] - coordinates[1][0],
                coordinates[2][1] - coordinates[1][1],
                coordinates[2][2] - coordinates[1][2] );
-
+  
   side[2].set( coordinates[0][0] - coordinates[2][0],
                coordinates[0][1] - coordinates[2][1],
                coordinates[0][2] - coordinates[2][2] );
@@ -250,11 +250,11 @@ C_FUNC_DEF double v_tet_radius_ratio( int /*num_nodes*/, double coordinates[][3]
   side[3].set( coordinates[3][0] - coordinates[0][0],
                coordinates[3][1] - coordinates[0][1],
                coordinates[3][2] - coordinates[0][2] );
-
+  
   side[4].set( coordinates[3][0] - coordinates[1][0],
                coordinates[3][1] - coordinates[1][1],
                coordinates[3][2] - coordinates[1][2] );
-
+  
   side[5].set( coordinates[3][0] - coordinates[2][0],
                coordinates[3][1] - coordinates[2][1],
                coordinates[3][2] - coordinates[2][2] );
@@ -264,20 +264,20 @@ C_FUNC_DEF double v_tet_radius_ratio( int /*num_nodes*/, double coordinates[][3]
                             side[0].length_squared() * ( side[3] * side[2]);
 
   double area_sum;
-  area_sum = ((side[2] * side[0]).length() +
+  area_sum = ((side[2] * side[0]).length() + 
               (side[3] * side[0]).length() +
-              (side[4] * side[1]).length() +
+              (side[4] * side[1]).length() + 
               (side[3] * side[2]).length() ) * 0.5;
-
+  
   double volume = v_tet_volume(4, coordinates);
-
-  if( fabs( volume ) < VERDICT_DBL_MIN )
+  
+  if( fabs( volume ) < VERDICT_DBL_MIN ) 
     return (double)VERDICT_DBL_MAX;
   else
   {
     double radius_ratio;
-    radius_ratio = numerator.length() * area_sum / (108 * volume * volume);
-
+    radius_ratio = numerator.length() * area_sum / (108 * volume * volume); 
+    
     return (double) VERDICT_MIN( radius_ratio, VERDICT_DBL_MAX );
   }
 
@@ -286,15 +286,11 @@ C_FUNC_DEF double v_tet_radius_ratio( int /*num_nodes*/, double coordinates[][3]
 /*!
   The radius ratio of a positively-oriented tet, a.k.a. "aspect beta"
 
-  NB (P. Pebay 04/16/07):
-    CR / (3.0 * IR) where CR is the circumsphere radius and IR is the inscribed
+  NB (P. Pebay 04/16/07):  
+    CR / (3.0 * IR) where CR is the circumsphere radius and IR is the inscribed 
     sphere radius if the element has positive orientation.
     Note that this function is similar to the radius ratio of a tet, except that
     it returns VERDICT_DBL_MAX if the element has negative orientation.
-  NB (J. Pouderoux 01/27/15)
-    This will return VERDICT_DBL_MAX when the volume of the tetrahedron is ill-
-    conditioned. Previously, this would only happen when the volume was small
-    and positive, but now ill-conditioned inverted tetrahedra are also included.
 
 */
 C_FUNC_DEF double v_tet_aspect_beta( int /*num_nodes*/, double coordinates[][3] )
@@ -306,11 +302,11 @@ C_FUNC_DEF double v_tet_aspect_beta( int /*num_nodes*/, double coordinates[][3]
   side[0].set( coordinates[1][0] - coordinates[0][0],
                coordinates[1][1] - coordinates[0][1],
                coordinates[1][2] - coordinates[0][2] );
-
+  
   side[1].set( coordinates[2][0] - coordinates[1][0],
                coordinates[2][1] - coordinates[1][1],
                coordinates[2][2] - coordinates[1][2] );
-
+  
   side[2].set( coordinates[0][0] - coordinates[2][0],
                coordinates[0][1] - coordinates[2][1],
                coordinates[0][2] - coordinates[2][2] );
@@ -318,11 +314,11 @@ C_FUNC_DEF double v_tet_aspect_beta( int /*num_nodes*/, double coordinates[][3]
   side[3].set( coordinates[3][0] - coordinates[0][0],
                coordinates[3][1] - coordinates[0][1],
                coordinates[3][2] - coordinates[0][2] );
-
+  
   side[4].set( coordinates[3][0] - coordinates[1][0],
                coordinates[3][1] - coordinates[1][1],
                coordinates[3][2] - coordinates[1][2] );
-
+  
   side[5].set( coordinates[3][0] - coordinates[2][0],
                coordinates[3][1] - coordinates[2][1],
                coordinates[3][2] - coordinates[2][2] );
@@ -332,20 +328,20 @@ C_FUNC_DEF double v_tet_aspect_beta( int /*num_nodes*/, double coordinates[][3]
                             side[0].length_squared() * ( side[3] * side[2]);
 
   double area_sum;
-  area_sum = ((side[2] * side[0]).length() +
+  area_sum = ((side[2] * side[0]).length() + 
               (side[3] * side[0]).length() +
-              (side[4] * side[1]).length() +
+              (side[4] * side[1]).length() + 
               (side[3] * side[2]).length() ) * 0.5;
-
+  
   double volume = v_tet_volume(4, coordinates);
-
-  if( fabs( volume ) < VERDICT_DBL_MIN )
+  
+  if( volume < VERDICT_DBL_MIN ) 
     return (double)VERDICT_DBL_MAX;
   else
   {
     double radius_ratio;
-    radius_ratio = numerator.length() * area_sum / (108 * volume * volume);
-
+    radius_ratio = numerator.length() * area_sum / (108 * volume * volume); 
+    
     return (double) VERDICT_MIN( radius_ratio, VERDICT_DBL_MAX );
   }
 
@@ -355,12 +351,8 @@ C_FUNC_DEF double v_tet_aspect_beta( int /*num_nodes*/, double coordinates[][3]
   The aspect ratio of a tet
 
   NB (P. Pebay 01/22/07):
-    Hmax / (2 sqrt(6) r) where Hmax and r respectively denote the greatest edge
+    Hmax / (2 sqrt(6) r) where Hmax and r respectively denote the greatest edge 
     length and the inradius of the tetrahedron
-  NB (J. Pouderoux 01/27/15)
-    This will return VERDICT_DBL_MAX when the volume of the tetrahedron is ill-
-    conditioned. Previously, this would only happen when the volume was small
-    and positive, but now ill-conditioned inverted tetrahedra are also included.
 */
 C_FUNC_DEF double v_tet_aspect_ratio( int /*num_nodes*/, double coordinates[][3] )
 {
@@ -372,7 +364,7 @@ C_FUNC_DEF double v_tet_aspect_ratio( int /*num_nodes*/, double coordinates[][3]
   ab.set( coordinates[1][0] - coordinates[0][0],
           coordinates[1][1] - coordinates[0][1],
           coordinates[1][2] - coordinates[0][2] );
-
+  
   ac.set( coordinates[2][0] - coordinates[0][0],
           coordinates[2][1] - coordinates[0][1],
           coordinates[2][2] - coordinates[0][2] );
@@ -380,20 +372,20 @@ C_FUNC_DEF double v_tet_aspect_ratio( int /*num_nodes*/, double coordinates[][3]
   ad.set( coordinates[3][0] - coordinates[0][0],
           coordinates[3][1] - coordinates[0][1],
           coordinates[3][2] - coordinates[0][2] );
-
+  
   double detTet = ab % ( ac * ad );
-
-  if( fabs( detTet ) < VERDICT_DBL_MIN )
+  
+  if( detTet < VERDICT_DBL_MIN ) 
     return (double)VERDICT_DBL_MAX;
 
   bc.set( coordinates[2][0] - coordinates[1][0],
           coordinates[2][1] - coordinates[1][1],
           coordinates[2][2] - coordinates[1][2] );
-
+  
   bd.set( coordinates[3][0] - coordinates[1][0],
           coordinates[3][1] - coordinates[1][1],
           coordinates[3][2] - coordinates[1][2] );
-
+  
   cd.set( coordinates[3][0] - coordinates[2][0],
           coordinates[3][1] - coordinates[2][1],
           coordinates[3][2] - coordinates[2][2] );
@@ -419,10 +411,10 @@ C_FUNC_DEF double v_tet_aspect_ratio( int /*num_nodes*/, double coordinates[][3]
   C = bd.length();
   bd = bc * cd;
   D = bd.length();
-
+  
   double aspect_ratio;
   aspect_ratio = normal_coeff * hm * ( A + B + C + D ) / fabs( detTet );
-
+  
   if( aspect_ratio > 0 )
     return (double) VERDICT_MIN( aspect_ratio, VERDICT_DBL_MAX );
   return (double) VERDICT_MAX( aspect_ratio, -VERDICT_DBL_MAX );
@@ -440,13 +432,13 @@ C_FUNC_DEF double v_tet_aspect_gamma( int /*num_nodes*/, double coordinates[][3]
   VerdictVector side0, side1, side2, side3, side4, side5;
 
   side0.set( coordinates[1][0] - coordinates[0][0],
-             coordinates[1][1] - coordinates[0][1],
-             coordinates[1][2] - coordinates[0][2] );
+             coordinates[1][1] - coordinates[0][1], 
+             coordinates[1][2] - coordinates[0][2] ); 
 
   side1.set( coordinates[2][0] - coordinates[1][0],
              coordinates[2][1] - coordinates[1][1],
              coordinates[2][2] - coordinates[1][2] );
-
+  
   side2.set( coordinates[0][0] - coordinates[2][0],
              coordinates[0][1] - coordinates[2][1],
              coordinates[0][2] - coordinates[2][2] );
@@ -454,15 +446,15 @@ C_FUNC_DEF double v_tet_aspect_gamma( int /*num_nodes*/, double coordinates[][3]
   side3.set( coordinates[3][0] - coordinates[0][0],
              coordinates[3][1] - coordinates[0][1],
              coordinates[3][2] - coordinates[0][2] );
-
+  
   side4.set( coordinates[3][0] - coordinates[1][0],
              coordinates[3][1] - coordinates[1][1],
              coordinates[3][2] - coordinates[1][2] );
-
+  
   side5.set( coordinates[3][0] - coordinates[2][0],
              coordinates[3][1] - coordinates[2][1],
              coordinates[3][2] - coordinates[2][2] );
-
+  
 
   double volume = fabs( v_tet_volume(4, coordinates) );
 
@@ -474,7 +466,7 @@ C_FUNC_DEF double v_tet_aspect_gamma( int /*num_nodes*/, double coordinates[][3]
                         side2.length_squared() + side3.length_squared() +
                         side4.length_squared() + side5.length_squared()) / 6.0 );
 
-    double aspect_ratio_gamma = pow(srms, 3) / (8.48528137423857 * volume );
+    double aspect_ratio_gamma = pow(srms, 3) / (8.48528137423857 * volume );  
     return (double)aspect_ratio_gamma;
   }
 }
@@ -494,7 +486,7 @@ C_FUNC_DEF double v_tet_aspect_frobenius( int /*num_nodes*/, double coordinates[
   ab.set( coordinates[1][0] - coordinates[0][0],
           coordinates[1][1] - coordinates[0][1],
           coordinates[1][2] - coordinates[0][2] );
-
+  
   ac.set( coordinates[2][0] - coordinates[0][0],
           coordinates[2][1] - coordinates[0][1],
           coordinates[2][2] - coordinates[0][2] );
@@ -502,13 +494,13 @@ C_FUNC_DEF double v_tet_aspect_frobenius( int /*num_nodes*/, double coordinates[
   ad.set( coordinates[3][0] - coordinates[0][0],
           coordinates[3][1] - coordinates[0][1],
           coordinates[3][2] - coordinates[0][2] );
-
+  
   double denominator = ab % ( ac * ad );
   denominator *= denominator;
   denominator *= 2.;
   denominator = 3. * pow( denominator, normal_exp );
 
-  if( denominator < VERDICT_DBL_MIN )
+  if( denominator < VERDICT_DBL_MIN ) 
     return (double)VERDICT_DBL_MAX;
 
   double u[3];
@@ -525,9 +517,9 @@ C_FUNC_DEF double v_tet_aspect_frobenius( int /*num_nodes*/, double coordinates[
   numerator -= v[0] * u[0] + v[1] * u[1] + v[2] * u[2];
   numerator -= w[0] * u[0] + w[1] * u[1] + w[2] * u[2];
   numerator -= w[0] * v[0] + w[1] * v[1] + w[2] * v[2];
-
+  
   double aspect_frobenius = numerator / denominator;
-
+  
   if( aspect_frobenius > 0 )
     return (double) VERDICT_MIN( aspect_frobenius, VERDICT_DBL_MAX );
   return (double) VERDICT_MAX( aspect_frobenius, -VERDICT_DBL_MAX );
@@ -549,15 +541,15 @@ C_FUNC_DEF double v_tet_minimum_angle( int /*num_nodes*/, double coordinates[][3
   ab.set( coordinates[1][0] - coordinates[0][0],
           coordinates[1][1] - coordinates[0][1],
           coordinates[1][2] - coordinates[0][2] );
-
+  
   ad.set( coordinates[3][0] - coordinates[0][0],
           coordinates[3][1] - coordinates[0][1],
           coordinates[3][2] - coordinates[0][2] );
-
+  
   bc.set( coordinates[2][0] - coordinates[1][0],
           coordinates[2][1] - coordinates[1][1],
           coordinates[2][2] - coordinates[1][2] );
-
+  
   cd.set( coordinates[3][0] - coordinates[2][0],
           coordinates[3][1] - coordinates[2][1],
           coordinates[3][2] - coordinates[2][2] );
@@ -585,7 +577,7 @@ C_FUNC_DEF double v_tet_minimum_angle( int /*num_nodes*/, double coordinates[][3
   alpha = alpha < zeta    ? alpha : zeta;
   alpha *= normal_coeff;
 
-  if( alpha < VERDICT_DBL_MIN )
+  if( alpha < VERDICT_DBL_MIN ) 
     return (double)VERDICT_DBL_MAX;
 
   if( alpha > 0 )
@@ -595,11 +587,6 @@ C_FUNC_DEF double v_tet_minimum_angle( int /*num_nodes*/, double coordinates[][3
 
 /*!
   The collapse ratio of a tet
-
-  NB (J. Pouderoux 01/27/15)
-    This will return VERDICT_DBL_MAX when the volume of the tetrahedron is ill-
-    conditioned. Previously, this would only happen when the volume was small
-    and positive, but now ill-conditioned inverted tetrahedra are also included.
 */
 C_FUNC_DEF double v_tet_collapse_ratio( int /*num_nodes*/, double coordinates[][3] )
 {
@@ -609,23 +596,23 @@ C_FUNC_DEF double v_tet_collapse_ratio( int /*num_nodes*/, double coordinates[][
   e01.set( coordinates[1][0] - coordinates[0][0],
            coordinates[1][1] - coordinates[0][1],
            coordinates[1][2] - coordinates[0][2] );
-
+  
   e02.set( coordinates[2][0] - coordinates[0][0],
            coordinates[2][1] - coordinates[0][1],
            coordinates[2][2] - coordinates[0][2] );
-
+ 
   e03.set( coordinates[3][0] - coordinates[0][0],
            coordinates[3][1] - coordinates[0][1],
            coordinates[3][2] - coordinates[0][2] );
-
+  
   e12.set( coordinates[2][0] - coordinates[1][0],
            coordinates[2][1] - coordinates[1][1],
            coordinates[2][2] - coordinates[1][2] );
-
+  
   e13.set( coordinates[3][0] - coordinates[1][0],
            coordinates[3][1] - coordinates[1][1],
            coordinates[3][2] - coordinates[1][2] );
-
+  
   e23.set( coordinates[3][0] - coordinates[2][0],
            coordinates[3][1] - coordinates[2][1],
            coordinates[3][2] - coordinates[2][2] );
@@ -673,7 +660,7 @@ C_FUNC_DEF double v_tet_collapse_ratio( int /*num_nodes*/, double coordinates[][
   cr = h / l132;          // ratio of height to longest edge of 1-3-2
   if ( cr < crMin ) crMin = cr;
 
-  if( fabs( crMin ) < VERDICT_DBL_MIN )
+  if( crMin < VERDICT_DBL_MIN ) 
     return (double)VERDICT_DBL_MAX;
   if( crMin > 0 )
     return (double) VERDICT_MIN( crMin, VERDICT_DBL_MAX );
@@ -815,11 +802,11 @@ C_FUNC_DEF double v_tet_volume( int /*num_nodes*/, double coordinates[][3] )
   side0.set( coordinates[1][0] - coordinates[0][0],
              coordinates[1][1] - coordinates[0][1],
              coordinates[1][2] - coordinates[0][2] );
-
+  
   side2.set( coordinates[0][0] - coordinates[2][0],
              coordinates[0][1] - coordinates[2][1],
              coordinates[0][2] - coordinates[2][2] );
-
+  
   side3.set( coordinates[3][0] - coordinates[0][0],
              coordinates[3][1] - coordinates[0][1],
              coordinates[3][2] - coordinates[0][2] );
@@ -832,11 +819,6 @@ C_FUNC_DEF double v_tet_volume( int /*num_nodes*/, double coordinates[][3] )
   the condition of a tet
 
   condition number of the jacobian matrix at any corner
-
-  NB (J. Pouderoux 01/27/15)
-    This will return VERDICT_DBL_MAX when the volume of the tetrahedron is ill-
-    conditioned. Previously, this would only happen when the volume was small
-    and positive, but now ill-conditioned inverted tetrahedra are also included.
 */
 C_FUNC_DEF double v_tet_condition( int /*num_nodes*/, double coordinates[][3] )
 {
@@ -846,7 +828,7 @@ C_FUNC_DEF double v_tet_condition( int /*num_nodes*/, double coordinates[][3] )
   double rt6 = sqrt(6.0);
 
   VerdictVector side0, side2, side3;
-
+  
   side0.set(coordinates[1][0] - coordinates[0][0],
             coordinates[1][1] - coordinates[0][1],
             coordinates[1][2] - coordinates[0][2]);
@@ -859,23 +841,23 @@ C_FUNC_DEF double v_tet_condition( int /*num_nodes*/, double coordinates[][3] )
             coordinates[3][1] - coordinates[0][1],
             coordinates[3][2] - coordinates[0][2]);
 
-  VerdictVector c_1, c_2, c_3;
+  VerdictVector c_1, c_2, c_3; 
 
   c_1 = side0;
   c_2 = (-2*side2-side0)/rt3;
   c_3 = (3*side3+side2-side0)/rt6;
 
   term1 = c_1 % c_1 + c_2 % c_2 + c_3 % c_3;
-  term2 = ( c_1 * c_2 ) % ( c_1 * c_2 ) +
-          ( c_2 * c_3 ) % ( c_2 * c_3 ) +
+  term2 = ( c_1 * c_2 ) % ( c_1 * c_2 ) + 
+          ( c_2 * c_3 ) % ( c_2 * c_3 ) + 
           ( c_1 * c_3 ) % ( c_1 * c_3 );
   det = c_1 % ( c_2 * c_3 );
-
-  if ( fabs( det ) <= VERDICT_DBL_MIN )
+  
+  if ( det <= VERDICT_DBL_MIN )
     return VERDICT_DBL_MAX;
-  else
+  else 
     condition = sqrt( term1 * term2 ) /(3.0* det);
-
+  
   return (double)condition;
 }
 
@@ -892,7 +874,7 @@ C_FUNC_DEF double v_tet_jacobian( int /*num_nodes*/, double coordinates[][3] )
   side0.set( coordinates[1][0] - coordinates[0][0],
              coordinates[1][1] - coordinates[0][1],
              coordinates[1][2] - coordinates[0][2] );
-
+  
   side2.set( coordinates[0][0] - coordinates[2][0],
              coordinates[0][1] - coordinates[2][1],
              coordinates[0][2] - coordinates[2][2] );
@@ -900,7 +882,7 @@ C_FUNC_DEF double v_tet_jacobian( int /*num_nodes*/, double coordinates[][3] )
   side3.set( coordinates[3][0] - coordinates[0][0],
              coordinates[3][1] - coordinates[0][1],
              coordinates[3][2] - coordinates[0][2] );
-
+  
 
   return (double)(side3 % (side2 * side0));
 
@@ -940,9 +922,9 @@ C_FUNC_DEF double v_tet_shape( int /*num_nodes*/, double coordinates[][3] )
   double den = 1.5*(edge0%edge0  + edge2%edge2  + edge3%edge3)-
                    (edge0%-edge2 + -edge2%edge3 + edge3%edge0);
 
-  if ( den < VERDICT_DBL_MIN )
+  if ( den < VERDICT_DBL_MIN ) 
     return (double)0.0;
-
+    
   return (double)VERDICT_MAX( num/den, 0 );
 }
 
@@ -959,7 +941,7 @@ C_FUNC_DEF double v_tet_relative_size_squared( int /*num_nodes*/, double coordin
   VerdictVector w1, w2, w3;
   v_tet_get_weight(w1,w2,w3);
   double avg_volume = (w1 % (w2 *w3))/6.0;
-
+  
   double volume = v_tet_volume(4, coordinates);
 
   if( avg_volume < VERDICT_DBL_MIN )
@@ -969,7 +951,7 @@ C_FUNC_DEF double v_tet_relative_size_squared( int /*num_nodes*/, double coordin
     size = volume/avg_volume;
     if( size <= VERDICT_DBL_MIN )
       return 0.0;
-    if ( size > 1 )
+    if ( size > 1 ) 
       size = (double)(1)/size;
   }
   return (double)(size*size);
@@ -983,11 +965,11 @@ C_FUNC_DEF double v_tet_relative_size_squared( int /*num_nodes*/, double coordin
 */
 C_FUNC_DEF double v_tet_shape_and_size( int num_nodes, double coordinates[][3] )
 {
-
+  
   double shape, size;
   shape = v_tet_shape( num_nodes, coordinates );
-  size = v_tet_relative_size_squared (num_nodes, coordinates );
-
+  size = v_tet_relative_size_squared (num_nodes, coordinates );  
+  
   return (double)(shape * size);
 
 }
@@ -1101,19 +1083,19 @@ C_FUNC_DEF double v_tet_distortion( int num_nodes, double coordinates[][3] )
 /*!
   the quality functions of a tet
 */
-C_FUNC_DEF void v_tet_quality( int num_nodes, double coordinates[][3],
+C_FUNC_DEF void v_tet_quality( int num_nodes, double coordinates[][3], 
     unsigned int metrics_request_flag, TetMetricVals *metric_vals )
 {
 
   memset( metric_vals, 0, sizeof(TetMetricVals) );
 
   /*
-
+  
     node numbers and edge numbers below
 
 
-
-             3
+    
+             3 
              +            edge 0 is node 0 to 1
             +|+           edge 1 is node 1 to 2
           3/ | \5         edge 2 is node 0 to 2
@@ -1122,9 +1104,9 @@ C_FUNC_DEF void v_tet_quality( int num_nodes, double coordinates[][3],
           \  |  +         edge 5 is node 2 to 3
           0\ | /1
             +|/           edge 2 is behind edge 4
-             1
-
+             1 
 
+             
   */
 
   // lets start with making the vectors
@@ -1155,29 +1137,29 @@ C_FUNC_DEF void v_tet_quality( int num_nodes, double coordinates[][3],
 
   // common numbers
   static const double root_of_2 = sqrt(2.0);
-
-  // calculate the jacobian
-  static const int do_jacobian = V_TET_JACOBIAN | V_TET_VOLUME |
-    V_TET_ASPECT_BETA | V_TET_ASPECT_GAMMA | V_TET_SHAPE |
-    V_TET_RELATIVE_SIZE_SQUARED | V_TET_SHAPE_AND_SIZE |
+ 
+  // calculate the jacobian 
+  static const int do_jacobian = V_TET_JACOBIAN | V_TET_VOLUME | 
+    V_TET_ASPECT_BETA | V_TET_ASPECT_GAMMA | V_TET_SHAPE | 
+    V_TET_RELATIVE_SIZE_SQUARED | V_TET_SHAPE_AND_SIZE | 
     V_TET_SCALED_JACOBIAN | V_TET_CONDITION;
   if(metrics_request_flag & do_jacobian )
   {
     metric_vals->jacobian = (double)(edges[3] % (edges[2] * edges[0]));
   }
-
-  // calculate the volume
+ 
+  // calculate the volume 
   if(metrics_request_flag & V_TET_VOLUME)
   {
     metric_vals->volume = (double)(metric_vals->jacobian / 6.0);
   }
-
+  
   // calculate aspect ratio
   if(metrics_request_flag & V_TET_ASPECT_BETA)
   {
-    double surface_area = ((edges[2] * edges[0]).length() +
+    double surface_area = ((edges[2] * edges[0]).length() + 
                            (edges[3] * edges[0]).length() +
-                           (edges[4] * edges[1]).length() +
+                           (edges[4] * edges[1]).length() + 
                            (edges[3] * edges[2]).length() ) * 0.5;
 
     VerdictVector numerator = edges[3].length_squared() * ( edges[2] * edges[0] ) +
@@ -1189,15 +1171,15 @@ C_FUNC_DEF void v_tet_quality( int num_nodes, double coordinates[][3],
     if(volume < VERDICT_DBL_MIN )
       metric_vals->aspect_beta = (double)(VERDICT_DBL_MAX);
     else
-      metric_vals->aspect_beta =
+      metric_vals->aspect_beta = 
         (double)( numerator.length() * surface_area/ (108*volume*volume) );
   }
 
-  // calculate the aspect gamma
+  // calculate the aspect gamma 
   if(metrics_request_flag & V_TET_ASPECT_GAMMA)
   {
     double volume = fabs( metric_vals->jacobian / 6.0 );
-    if( fabs( volume ) < VERDICT_DBL_MIN )
+    if( fabs( volume ) < VERDICT_DBL_MIN ) 
       metric_vals->aspect_gamma = VERDICT_DBL_MAX;
     else
     {
@@ -1232,23 +1214,23 @@ C_FUNC_DEF void v_tet_quality( int num_nodes, double coordinates[][3],
       else
         metric_vals->shape = (double)VERDICT_MAX( num/den, 0 );
     }
-
+    
   }
-
+  
   // calculate the relative size of the tet
   if(metrics_request_flag & (V_TET_RELATIVE_SIZE_SQUARED | V_TET_SHAPE_AND_SIZE ))
   {
     VerdictVector w1, w2, w3;
     v_tet_get_weight(w1,w2,w3);
     double avg_vol = (w1 % (w2 *w3))/6;
-
+    
     if( avg_vol < VERDICT_DBL_MIN )
-      metric_vals->relative_size_squared = 0.0;
+      metric_vals->relative_size_squared = 0.0; 
     else
     {
       double tmp = metric_vals->jacobian / (6*avg_vol);
       if( tmp < VERDICT_DBL_MIN )
-        metric_vals->relative_size_squared = 0.0;
+        metric_vals->relative_size_squared = 0.0; 
       else
       {
         tmp *= tmp;
@@ -1256,13 +1238,13 @@ C_FUNC_DEF void v_tet_quality( int num_nodes, double coordinates[][3],
       }
     }
   }
-
+  
   // calculate the shape and size
   if(metrics_request_flag & V_TET_SHAPE_AND_SIZE)
   {
     metric_vals->shape_and_size = (double)(metric_vals->shape * metric_vals->relative_size_squared);
   }
-
+  
   // calculate the scaled jacobian
   if(metrics_request_flag & V_TET_SCALED_JACOBIAN)
   {
@@ -1274,7 +1256,7 @@ C_FUNC_DEF void v_tet_quality( int num_nodes, double coordinates[][3],
       edges[1].length_squared() * edges[2].length_squared() * edges[5].length_squared(),
       edges[3].length_squared() * edges[4].length_squared() * edges[5].length_squared()
     };
-
+    
     int which_node = 0;
     if(length_squared[1] > length_squared[which_node])
       which_node = 1;
@@ -1289,36 +1271,36 @@ C_FUNC_DEF void v_tet_quality( int num_nodes, double coordinates[][3],
       length_product = fabs(metric_vals->jacobian);
 
     if( length_product < VERDICT_DBL_MIN )
-      metric_vals->scaled_jacobian = (double) VERDICT_DBL_MAX;
+      metric_vals->scaled_jacobian = (double) VERDICT_DBL_MAX; 
     else
-      metric_vals->scaled_jacobian =
+      metric_vals->scaled_jacobian = 
         (double)(root_of_2 * metric_vals->jacobian / length_product);
   }
-
+  
   // calculate the condition number
   if(metrics_request_flag & V_TET_CONDITION)
   {
     static const double root_of_3 = sqrt(3.0);
     static const double root_of_6 = sqrt(6.0);
 
-    VerdictVector c_1, c_2, c_3;
+    VerdictVector c_1, c_2, c_3; 
     c_1 = edges[0];
     c_2 = (-2*edges[2] - edges[0])/root_of_3;
     c_3 = (3*edges[3] + edges[2] - edges[0])/root_of_6;
 
     double term1 =  c_1 % c_1 + c_2 % c_2 + c_3 % c_3;
-    double term2 = ( c_1 * c_2 ) % ( c_1 * c_2 ) +
-                   ( c_2 * c_3 ) % ( c_2 * c_3 ) +
+    double term2 = ( c_1 * c_2 ) % ( c_1 * c_2 ) + 
+                   ( c_2 * c_3 ) % ( c_2 * c_3 ) + 
                    ( c_3 * c_1 ) % ( c_3 * c_1 );
 
     double det = c_1 % ( c_2 * c_3 );
 
     if(det <= VERDICT_DBL_MIN)
-      metric_vals->condition = (double)VERDICT_DBL_MAX;
+      metric_vals->condition = (double)VERDICT_DBL_MAX; 
     else
-      metric_vals->condition = (double)(sqrt(term1 * term2) / (3.0*det));
+      metric_vals->condition = (double)(sqrt(term1 * term2) / (3.0*det)); 
   }
-
+    
   // calculate the distortion
   if(metrics_request_flag & V_TET_DISTORTION)
   {
@@ -1343,70 +1325,70 @@ C_FUNC_DEF void v_tet_quality( int num_nodes, double coordinates[][3],
   //check for overflow
   if(metrics_request_flag & V_TET_ASPECT_BETA )
   {
-    if( metric_vals->aspect_beta > 0 )
+    if( metric_vals->aspect_beta > 0 ) 
       metric_vals->aspect_beta = (double) VERDICT_MIN( metric_vals->aspect_beta, VERDICT_DBL_MAX );
     metric_vals->aspect_beta = (double) VERDICT_MAX( metric_vals->aspect_beta, -VERDICT_DBL_MAX );
   }
 
   if(metrics_request_flag & V_TET_ASPECT_GAMMA)
   {
-    if( metric_vals->aspect_gamma > 0 )
+    if( metric_vals->aspect_gamma > 0 ) 
       metric_vals->aspect_gamma = (double) VERDICT_MIN( metric_vals->aspect_gamma, VERDICT_DBL_MAX );
     metric_vals->aspect_gamma = (double) VERDICT_MAX( metric_vals->aspect_gamma, -VERDICT_DBL_MAX );
   }
 
   if(metrics_request_flag & V_TET_VOLUME)
   {
-    if( metric_vals->volume > 0 )
+    if( metric_vals->volume > 0 ) 
       metric_vals->volume = (double) VERDICT_MIN( metric_vals->volume, VERDICT_DBL_MAX );
     metric_vals->volume = (double) VERDICT_MAX( metric_vals->volume, -VERDICT_DBL_MAX );
   }
 
   if(metrics_request_flag & V_TET_CONDITION)
   {
-    if( metric_vals->condition > 0 )
+    if( metric_vals->condition > 0 ) 
       metric_vals->condition = (double) VERDICT_MIN( metric_vals->condition, VERDICT_DBL_MAX );
     metric_vals->condition = (double) VERDICT_MAX( metric_vals->condition, -VERDICT_DBL_MAX );
   }
 
   if(metrics_request_flag & V_TET_JACOBIAN)
   {
-    if( metric_vals->jacobian > 0 )
+    if( metric_vals->jacobian > 0 ) 
       metric_vals->jacobian = (double) VERDICT_MIN( metric_vals->jacobian, VERDICT_DBL_MAX );
     metric_vals->jacobian = (double) VERDICT_MAX( metric_vals->jacobian, -VERDICT_DBL_MAX );
   }
 
   if(metrics_request_flag & V_TET_SCALED_JACOBIAN)
   {
-    if( metric_vals->scaled_jacobian > 0 )
+    if( metric_vals->scaled_jacobian > 0 ) 
       metric_vals->scaled_jacobian = (double) VERDICT_MIN( metric_vals->scaled_jacobian, VERDICT_DBL_MAX );
     metric_vals->scaled_jacobian = (double) VERDICT_MAX( metric_vals->scaled_jacobian, -VERDICT_DBL_MAX );
   }
 
   if(metrics_request_flag & V_TET_SHAPE)
   {
-    if( metric_vals->shape > 0 )
+    if( metric_vals->shape > 0 ) 
       metric_vals->shape = (double) VERDICT_MIN( metric_vals->shape, VERDICT_DBL_MAX );
     metric_vals->shape = (double) VERDICT_MAX( metric_vals->shape, -VERDICT_DBL_MAX );
   }
 
   if(metrics_request_flag & V_TET_RELATIVE_SIZE_SQUARED)
   {
-    if( metric_vals->relative_size_squared > 0 )
+    if( metric_vals->relative_size_squared > 0 ) 
       metric_vals->relative_size_squared = (double) VERDICT_MIN( metric_vals->relative_size_squared, VERDICT_DBL_MAX );
     metric_vals->relative_size_squared = (double) VERDICT_MAX( metric_vals->relative_size_squared, -VERDICT_DBL_MAX );
   }
 
   if(metrics_request_flag & V_TET_SHAPE_AND_SIZE)
   {
-    if( metric_vals->shape_and_size > 0 )
+    if( metric_vals->shape_and_size > 0 ) 
       metric_vals->shape_and_size = (double) VERDICT_MIN( metric_vals->shape_and_size, VERDICT_DBL_MAX );
     metric_vals->shape_and_size = (double) VERDICT_MAX( metric_vals->shape_and_size, -VERDICT_DBL_MAX );
   }
 
   if(metrics_request_flag & V_TET_DISTORTION)
   {
-    if( metric_vals->distortion > 0 )
+    if( metric_vals->distortion > 0 ) 
       metric_vals->distortion = (double) VERDICT_MIN( metric_vals->distortion, VERDICT_DBL_MAX );
     metric_vals->distortion = (double) VERDICT_MAX( metric_vals->distortion, -VERDICT_DBL_MAX );
   }
diff --git a/ThirdParty/xdmf2/vtkxdmf2/README-VTK.txt b/ThirdParty/xdmf2/vtkxdmf2/README-VTK.txt
index 277954d..30f7b39 100644
--- a/ThirdParty/xdmf2/vtkxdmf2/README-VTK.txt
+++ b/ThirdParty/xdmf2/vtkxdmf2/README-VTK.txt
@@ -40,7 +40,8 @@ appropriate date and version number:
  git commit --amend
 
 Edit the commit message to describe the procedure used to obtain the
-content. Then push the changes back up to the main local repository:
+content. Be sure to add a gerrit change-id line to the bottom of the
+message. Then push the changes back up to the main local repository:
 
  git push .. HEAD:xdmf2-upstream
  cd ..
diff --git a/Utilities/Benchmarks/GLBenchmarking.cxx b/Utilities/Benchmarks/GLBenchmarking.cxx
index fe2be0c..270cd77 100644
--- a/Utilities/Benchmarks/GLBenchmarking.cxx
+++ b/Utilities/Benchmarks/GLBenchmarking.cxx
@@ -18,9 +18,11 @@
 #ifdef VTK_OPENGL2
 //VTK_MODULE_INIT(vtkRenderingOpenGL2)
 //VTK_MODULE_INIT(vtkRenderingContextOpenGL2)
+//VTK_MODULE_INIT(vtkRenderingFreeTypeOpenGL2)
 #else
 //VTK_MODULE_INIT(vtkRenderingOpenGL)
 //VTK_MODULE_INIT(vtkRenderingContextOpenGL)
+//VTK_MODULE_INIT(vtkRenderingFreeTypeOpenGL)
 #endif
 
 #include "vtkActor.h"
diff --git a/Utilities/Benchmarks/TimingTests.cxx b/Utilities/Benchmarks/TimingTests.cxx
index 35457ea..03bc4b8 100644
--- a/Utilities/Benchmarks/TimingTests.cxx
+++ b/Utilities/Benchmarks/TimingTests.cxx
@@ -44,8 +44,7 @@ int main( int argc, char *argv[] )
   a.TestsToRun.push_back(new moleculeTest("MoleculeAtomsOnly",true));
 #endif
 
-  a.TestsToRun.push_back(new volumeTest("Volume", false));
-  a.TestsToRun.push_back(new volumeTest("VolumeWithShading", true));
+  a.TestsToRun.push_back(new volumeTest("Volume"));
 
   // process them
   return a.ParseCommandLineArguments(argc, argv);
diff --git a/Utilities/Benchmarks/module.cmake b/Utilities/Benchmarks/module.cmake
index baeea14..f3fa6d9 100644
--- a/Utilities/Benchmarks/module.cmake
+++ b/Utilities/Benchmarks/module.cmake
@@ -4,6 +4,7 @@ vtk_module(vtkUtilitiesBenchmarks
     vtkCommonComputationalGeometry
     vtkRenderingContext${VTK_RENDERING_BACKEND}
     vtkRendering${VTK_RENDERING_BACKEND}
+    vtkRenderingFreeType${VTK_RENDERING_BACKEND}
     vtkRenderingVolume${VTK_RENDERING_BACKEND}
     vtkInteractionStyle
     vtkViewsContext2D
diff --git a/Utilities/Benchmarks/vtkRenderTimingTests.h b/Utilities/Benchmarks/vtkRenderTimingTests.h
index e8339cf..2bf5704 100644
--- a/Utilities/Benchmarks/vtkRenderTimingTests.h
+++ b/Utilities/Benchmarks/vtkRenderTimingTests.h
@@ -398,9 +398,8 @@ Define a test for volume rendering
 class volumeTest : public vtkRTTest
 {
   public:
-  volumeTest(const char *name, bool withShading) : vtkRTTest(name)
+  volumeTest(const char *name) : vtkRTTest(name)
     {
-    this->WithShading = withShading;
     }
 
   const char *GetSummaryResultName()
@@ -420,36 +419,24 @@ class volumeTest : public vtkRTTest
     ats->GetSequenceNumbers(res1,res2,res3);
 
     vtkNew<vtkRTAnalyticSource> wavelet;
-    wavelet->SetWholeExtent(-50*res1 - 1, 50*res1,
-                            -50*res2 - 1, 50*res2,
-                            -50*res3 - 1, 50*res3);
+    wavelet->SetWholeExtent(0, 100*res1 -1,
+                            0, 100*res2 -1,
+                            0, 100*res3 -1);
     wavelet->Update();
 
     vtkNew<vtkGPUVolumeRayCastMapper> volumeMapper;
     volumeMapper->SetInputConnection(wavelet->GetOutputPort());
-    volumeMapper->AutoAdjustSampleDistancesOff();
-    volumeMapper->SetSampleDistance(0.9);
 
     vtkNew<vtkVolumeProperty> volumeProperty;
     vtkNew<vtkColorTransferFunction> ctf;
-    ctf->AddRGBPoint(33.34, 0.23, 0.3, 0.75);
-    ctf->AddRGBPoint(72.27, 0.79, 0.05, 0.22);
-    ctf->AddRGBPoint(110.3, 0.8, 0.75, 0.82);
-    ctf->AddRGBPoint(134.19, 0.78, 0.84, 0.04);
-    ctf->AddRGBPoint(159.84, 0.07, 0.87, 0.43);
-    ctf->AddRGBPoint(181.96, 0.84, 0.31, 0.48);
-    ctf->AddRGBPoint(213.803, 0.73, 0.62, 0.8);
-    ctf->AddRGBPoint(255.38, 0.75, 0.19, 0.05);
-    ctf->AddRGBPoint(286.33, 0.7, 0.02, 0.15);
+    ctf->AddHSVPoint(37.3531, 0.3, 1.0, 1);
+    ctf->AddHSVPoint(100.091, 0.0, 1.0, 1.0);
+    ctf->AddHSVPoint(276.829, 0.0, 0.2, 1.0);
     ctf->SetColorSpaceToHSV();
 
     vtkNew<vtkPiecewiseFunction> pwf;
-    pwf->AddPoint(33.35, 0.0);
-    pwf->AddPoint(81.99, 0.01);
-    pwf->AddPoint(128.88, 0.02);
-    pwf->AddPoint(180.19, 0.03);
-    pwf->AddPoint(209.38, 0.04);
-    pwf->AddPoint(286.33, 0.05);
+    pwf->AddPoint(37.3531, 0.0);
+    pwf->AddPoint(276.829, 1.0/res1);
 
     volumeProperty->SetColor(ctf.GetPointer());
     volumeProperty->SetScalarOpacity(pwf.GetPointer());
@@ -457,10 +444,6 @@ class volumeTest : public vtkRTTest
     vtkNew<vtkVolume> volume;
     volume->SetMapper(volumeMapper.GetPointer());
     volume->SetProperty(volumeProperty.GetPointer());
-    if (this->WithShading)
-      {
-      volumeProperty->ShadeOn();
-      }
 
     // create a rendering window and renderer
     vtkNew<vtkRenderer> ren1;
@@ -504,7 +487,5 @@ class volumeTest : public vtkRTTest
 
     return result;
     }
-
-  protected:
-  bool WithShading;
 };
+
diff --git a/Utilities/DICOMParser/DICOMAppHelper.cxx b/Utilities/DICOMParser/DICOMAppHelper.cxx
index 6632f48..021c9b1 100644
--- a/Utilities/DICOMParser/DICOMAppHelper.cxx
+++ b/Utilities/DICOMParser/DICOMAppHelper.cxx
@@ -148,13 +148,34 @@ DICOMAppHelper::~DICOMAppHelper()
   //
   // Fix warning here.
   //
-  delete [] (static_cast<char*> (this->ImageData));
+  if (this->ImageData)
+    {
+    delete [] (static_cast<char*> (this->ImageData));
+    }
+  if (this->TransferSyntaxUID)
+    {
+    delete this->TransferSyntaxUID;
+    }
+  if (this->PhotometricInterpretation)
+    {
+    delete this->PhotometricInterpretation;
+    }
+
+  if (this->PatientName)
+    {
+    delete this->PatientName;
+    }
+
+  if (this->StudyUID)
+    {
+    delete this->StudyUID;
+    }
+
+  if (this->StudyID)
+    {
+    delete this->StudyID;
+    }
 
-  delete this->TransferSyntaxUID;
-  delete this->PhotometricInterpretation;
-  delete this->PatientName;
-  delete this->StudyUID;
-  delete this->StudyID;
   delete this->SeriesUIDCB;
   delete this->SliceNumberCB;
   delete this->SliceLocationCB;
@@ -461,8 +482,6 @@ void DICOMAppHelper::ArrayCallback(DICOMParser *parser,
         uival = DICOMFile::ReturnAsUnsignedShort(val, parser->GetDICOMFile()->GetPlatformIsBigEndian());
         HeaderFile << uival;
         break;
-      case DICOMParser::VR_UNKNOWN:
-      case DICOMParser::VR_AW:
       default:
         HeaderFile << val << dicom_stream::endl;
         break;
@@ -728,7 +747,10 @@ void DICOMAppHelper::TransferSyntaxCallback(DICOMParser *parser,
 #endif
     }
 
-  delete this->TransferSyntaxUID;
+  if (this->TransferSyntaxUID)
+    {
+    delete this->TransferSyntaxUID;
+    }
   this->TransferSyntaxUID = new dicom_stl::string(
     reinterpret_cast<char*>(val));
 
@@ -862,7 +884,10 @@ void DICOMAppHelper::PhotometricInterpretationCallback( DICOMParser *,
 #ifdef DEBUG_DICOM_APP_HELPER
   dicom_stream::cout << "Photometric Interpretation: " << (char*) val << dicom_stream::endl;
 #endif
-  delete this->PhotometricInterpretation;
+  if (this->PhotometricInterpretation)
+    {
+    delete this->PhotometricInterpretation;
+    }
 
   this->PhotometricInterpretation = new dicom_stl::string(
     reinterpret_cast<char*>(val));
@@ -905,7 +930,10 @@ void DICOMAppHelper::PixelDataCallback( DICOMParser *,
     dicom_stream::cout << "Slope and offset are not integer valued : ";
     dicom_stream::cout << this->RescaleSlope << ", " << this->RescaleOffset << dicom_stream::endl;
 #endif
-    delete [] (static_cast<char*> (this->ImageData));
+    if (this->ImageData)
+      {
+      delete [] (static_cast<char*> (this->ImageData));
+      }
     this->ImageData = new float[numPixels];
     floatOutputData = static_cast<float*> (this->ImageData);
 
@@ -948,7 +976,10 @@ void DICOMAppHelper::PixelDataCallback( DICOMParser *,
 
     if (ptrIncr == 1)
       {
-      delete [] (static_cast<char*> (this->ImageData));
+      if (this->ImageData)
+        {
+        delete [] (static_cast<char*> (this->ImageData));
+        }
       this->ImageData = new char[numPixels];
 
       char*  charOutputData =  static_cast<char*>  (this->ImageData);
@@ -970,7 +1001,10 @@ void DICOMAppHelper::PixelDataCallback( DICOMParser *,
       }
     else if (ptrIncr == 2)
       {
-      delete [] (static_cast<char*> (this->ImageData));
+      if (this->ImageData)
+        {
+        delete [] (static_cast<char*> (this->ImageData));
+        }
       this->ImageData = new short[numPixels];
       short* shortOutputData = static_cast<short*> (this->ImageData);
 
@@ -1154,7 +1188,7 @@ void DICOMAppHelper::GetSliceNumberFilenamePairs(const dicom_stl::string &series
 void DICOMAppHelper::GetSliceNumberFilenamePairs(dicom_stl::vector<dicom_stl::pair<int, dicom_stl::string> >& v, bool ascending)
 {
   // Default to using the first series
-  if (!this->Implementation->SeriesUIDMap.empty())
+  if (this->Implementation->SeriesUIDMap.size() > 0)
     {
     this->GetSliceNumberFilenamePairs( (*this->Implementation->SeriesUIDMap.begin()).first, v, ascending );
     }
@@ -1208,7 +1242,7 @@ void DICOMAppHelper::GetSliceLocationFilenamePairs(const dicom_stl::string &seri
 void DICOMAppHelper::GetSliceLocationFilenamePairs(dicom_stl::vector<dicom_stl::pair<float, dicom_stl::string> >& v, bool ascending)
 {
   // Default to using the first series
-  if (!this->Implementation->SeriesUIDMap.empty())
+  if (this->Implementation->SeriesUIDMap.size() > 0)
     {
     this->GetSliceLocationFilenamePairs( (*this->Implementation->SeriesUIDMap.begin()).first,
                                          v , ascending);
@@ -1285,7 +1319,7 @@ void DICOMAppHelper::GetImagePositionPatientFilenamePairs(const dicom_stl::strin
 void DICOMAppHelper::GetImagePositionPatientFilenamePairs(dicom_stl::vector<dicom_stl::pair<float, dicom_stl::string> >& v, bool ascending)
 {
   // Default to using the first series
-  if (!this->Implementation->SeriesUIDMap.empty())
+  if (this->Implementation->SeriesUIDMap.size() > 0)
     {
     this->GetImagePositionPatientFilenamePairs(
       (*this->Implementation->SeriesUIDMap.begin()).first, v, ascending);
@@ -1322,7 +1356,10 @@ void DICOMAppHelper::PatientNameCallback(DICOMParser *,
                                          unsigned char* val,
                                          quadbyte)
 {
-  delete this->PatientName;
+  if (this->PatientName)
+    {
+    delete this->PatientName;
+    }
 
   if (val)
     {
@@ -1341,7 +1378,10 @@ void DICOMAppHelper::StudyUIDCallback(DICOMParser *,
                                          unsigned char* val,
                                          quadbyte)
 {
-  delete this->StudyUID;
+  if (this->StudyUID)
+    {
+    delete this->StudyUID;
+    }
 
   this->StudyUID = new dicom_stl::string(reinterpret_cast<char*>(val));
 
@@ -1354,7 +1394,10 @@ void DICOMAppHelper::StudyIDCallback(DICOMParser *,
                                          unsigned char* val,
                                          quadbyte)
 {
-  delete this->StudyID;
+  if (this->StudyID)
+    {
+    delete this->StudyID;
+    }
 
   if (val)
     {
diff --git a/Utilities/DICOMParser/DICOMParser.cxx b/Utilities/DICOMParser/DICOMParser.cxx
index 3e883b9..3c0060f 100644
--- a/Utilities/DICOMParser/DICOMParser.cxx
+++ b/Utilities/DICOMParser/DICOMParser.cxx
@@ -95,8 +95,11 @@ DICOMParser::GetFileName()
 
 bool DICOMParser::OpenFile(const dicom_stl::string& filename)
 {
-  // Deleting the DataFile closes any previously opened file
-  delete this->DataFile;
+  if (this->DataFile)
+    {
+    // Deleting the DataFile closes the file
+    delete this->DataFile;
+    }
   this->DataFile = new DICOMFile();
   bool val = this->DataFile->Open(filename);
 
@@ -123,20 +126,17 @@ bool DICOMParser::OpenFile(const dicom_stl::string& filename)
   return val;
 }
 
-void DICOMParser::CloseFile()
-{
-  // Deleting the DataFile closes any previously opened file
-  delete this->DataFile;
-  this->DataFile = 0;
-}
-
 DICOMParser::~DICOMParser() {
   //
   // Delete the callbacks.
   //
   this->ClearAllDICOMTagCallbacks();
 
-  delete this->DataFile;
+  if (this->DataFile)
+    {
+    delete this->DataFile;
+    }
+
   delete this->TransferSyntaxCB;
   delete this->Implementation;
 
@@ -431,26 +431,6 @@ void DICOMParser::ReadNextRecord(doublebyte& group, doublebyte& element, DICOMPa
           case DICOMParser::VR_AT:
             // dicom_stream::cout << "ATTRIBUTE Byte swap needed!" << dicom_stream::endl;
             break;
-          case VR_UNKNOWN:
-          case VR_DA:
-          case VR_OB:
-          case VR_AE:
-          case VR_SH:
-          case VR_UI:
-          case VR_TM:
-          case VR_PN:
-          case VR_UN:
-          case VR_LO:
-          case VR_SQ:
-          case VR_AS:
-          case VR_CS:
-          case VR_DS:
-          case VR_IS:
-          case VR_DT:
-          case VR_LT:
-          case VR_ST:
-          case VR_UT:
-          case VR_AW:
           default:
             break;
           }
diff --git a/Utilities/DICOMParser/DICOMParser.h b/Utilities/DICOMParser/DICOMParser.h
index d6f713d..d00f2e1 100644
--- a/Utilities/DICOMParser/DICOMParser.h
+++ b/Utilities/DICOMParser/DICOMParser.h
@@ -72,11 +72,6 @@ class DICOM_EXPORT DICOMParser
   bool OpenFile(const dicom_stl::string& filename);
 
   //
-  // Closes the currently open file.
-  //
-  void CloseFile();
-
-  //
   // Return the name of the file last processed.
   //
   const dicom_stl::string& GetFileName();
diff --git a/Utilities/Doxygen/doxyfile.in b/Utilities/Doxygen/doxyfile.in
index ecde8bd..ad5e41c 100644
--- a/Utilities/Doxygen/doxyfile.in
+++ b/Utilities/Doxygen/doxyfile.in
@@ -22,7 +22,6 @@ PDF_HYPERLINKS       = YES
 
 HAVE_DOT             = @HAVE_DOT_YESNO@
 DOT_PATH             = "@DOT_PATH@"
-DOT_IMAGE_FORMAT     = svg
 CLASS_GRAPH          = YES
 COLLABORATION_GRAPH  = YES
 TEMPLATE_RELATIONS   = YES
diff --git a/Utilities/KWSys/vtksys/Base64.c b/Utilities/KWSys/vtksys/Base64.c
index 4b8ede2..d07bdd0 100644
--- a/Utilities/KWSys/vtksys/Base64.c
+++ b/Utilities/KWSys/vtksys/Base64.c
@@ -115,10 +115,10 @@ void kwsysBase64_Encode1(const unsigned char *src, unsigned char *dest)
    actually knowing how much data to expect (if the input is not a multiple of
    3 bytes then the extra padding needed to complete the encode 4 bytes will
    stop the decoding anyway).  */
-size_t kwsysBase64_Encode(const unsigned char *input,
-                          size_t length,
-                          unsigned char *output,
-                          int mark_end)
+unsigned long kwsysBase64_Encode(const unsigned char *input,
+                                 unsigned long length,
+                                 unsigned char *output,
+                                 int mark_end)
 {
   const unsigned char *ptr = input;
   const unsigned char *end = input + length;
@@ -157,7 +157,7 @@ size_t kwsysBase64_Encode(const unsigned char *input,
     optr += 4;
     }
 
-  return (size_t)(optr - output);
+  return (unsigned long)(optr - output);
 }
 
 /*--------------------------------------------------------------------------*/
@@ -207,10 +207,10 @@ int kwsysBase64_Decode3(const unsigned char *src, unsigned char *dest)
    'length' parameter is ignored. This enables the caller to decode a stream
    without actually knowing how much decoded data to expect (of course, the
    buffer must be large enough). */
-size_t kwsysBase64_Decode(const unsigned char *input,
-                          size_t length,
-                          unsigned char *output,
-                          size_t max_input_length)
+unsigned long kwsysBase64_Decode(const unsigned char *input, 
+                                 unsigned long length,
+                                 unsigned char *output,
+                                 unsigned long max_input_length)
 {
   const unsigned char *ptr = input;
   unsigned char *optr = output;
@@ -226,7 +226,7 @@ size_t kwsysBase64_Decode(const unsigned char *input,
       optr += len;
       if(len < 3)
         {
-        return (size_t)(optr - output);
+        return (unsigned long)(optr - output);
         }
       ptr += 4;
       }
@@ -240,7 +240,7 @@ size_t kwsysBase64_Decode(const unsigned char *input,
       optr += len;
       if(len < 3)
         {
-        return (size_t)(optr - output);
+        return (unsigned long)(optr - output);
         }
       ptr += 4;
       }
@@ -275,5 +275,5 @@ size_t kwsysBase64_Decode(const unsigned char *input,
       }
     }
 
-  return (size_t)(optr - output);
+  return (unsigned long)(optr - output);
 }
diff --git a/Utilities/KWSys/vtksys/Base64.h.in b/Utilities/KWSys/vtksys/Base64.h.in
index 36ed3cc..3468007 100644
--- a/Utilities/KWSys/vtksys/Base64.h.in
+++ b/Utilities/KWSys/vtksys/Base64.h.in
@@ -14,8 +14,6 @@
 
 #include <@KWSYS_NAMESPACE@/Configure.h>
 
-#include <stddef.h> /* size_t */
-
 /* Redefine all public interface symbol names to be in the proper
    namespace.  These macros are used internally to kwsys only, and are
    not visible to user code.  Use kwsysHeaderDump.pl to reproduce
@@ -70,10 +68,10 @@ kwsysEXPORT void kwsysBase64_Encode1(const unsigned char *src,
  * the extra padding needed to complete the encode 4 bytes will stop
  * the decoding anyway).
  */
-kwsysEXPORT size_t kwsysBase64_Encode(const unsigned char *input,
-                                      size_t length,
-                                      unsigned char *output,
-                                      int mark_end);
+kwsysEXPORT unsigned long kwsysBase64_Encode(const unsigned char *input,
+                                             unsigned long length,
+                                             unsigned char *output,
+                                             int mark_end);
 
 /**
  * Decode 4 bytes into a 3 byte string.  Returns the number of bytes
@@ -94,10 +92,10 @@ kwsysEXPORT int kwsysBase64_Decode3(const unsigned char *src,
  * much decoded data to expect (of course, the buffer must be large
  * enough).
  */
-kwsysEXPORT size_t kwsysBase64_Decode(const unsigned char *input,
-                                      size_t length,
-                                      unsigned char *output,
-                                      size_t max_input_length);
+kwsysEXPORT unsigned long kwsysBase64_Decode(const unsigned char *input, 
+                                             unsigned long length,
+                                             unsigned char *output,
+                                             unsigned long max_input_length);
 
 #if defined(__cplusplus)
 } /* extern "C" */
diff --git a/Utilities/KWSys/vtksys/CONTRIBUTING.rst b/Utilities/KWSys/vtksys/CONTRIBUTING.rst
deleted file mode 100644
index e097b76..0000000
--- a/Utilities/KWSys/vtksys/CONTRIBUTING.rst
+++ /dev/null
@@ -1,35 +0,0 @@
-Contributing to KWSys
-*********************
-
-Overview
-========
-
-KWSys is kept in its own Git repository and shared by several projects
-via copies in their source trees.  Changes to KWSys should not be made
-directly in a host project, except perhaps in maintenance branches.
-
-Please visit
-
-  http://public.kitware.com/Wiki/KWSys/Git
-
-to contribute changes directly to KWSys upstream.  Once changes are
-reviewed, tested, and integrated there then the copies of KWSys within
-dependent projects can be updated to get the changes.
-
-Issues
-======
-
-KWSys has no independent issue tracker.  After encountering an issue
-(bug) please try to submit a patch using the above instructions.
-Otherwise please report the issue to the tracker for the project that
-hosts the copy of KWSys in which the problem was found.
-
-License
-=======
-
-We do not require any formal copyright assignment or contributor license
-agreement.  Any contributions intentionally sent upstream are presumed
-to be offerred under terms of the OSI-approved BSD 3-clause License.
-See `Copyright.txt`_ for details.
-
-.. _`Copyright.txt`: Copyright.txt
diff --git a/Utilities/KWSys/vtksys/CPU.h.in b/Utilities/KWSys/vtksys/CPU.h.in
index 884d71a..626914b 100644
--- a/Utilities/KWSys/vtksys/CPU.h.in
+++ b/Utilities/KWSys/vtksys/CPU.h.in
@@ -76,15 +76,7 @@
 #elif defined(__m68k__) || defined(M68000)
 # define @KWSYS_NAMESPACE at _CPU_ENDIAN_ID @KWSYS_NAMESPACE at _CPU_ENDIAN_ID_BIG
 
-/* MIPSel (MIPS little endian) */
-#elif defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL)
-# define @KWSYS_NAMESPACE at _CPU_ENDIAN_ID @KWSYS_NAMESPACE at _CPU_ENDIAN_ID_LITTLE
-
-/* MIPSeb (MIPS big endian) */
-#elif defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB)
-# define @KWSYS_NAMESPACE at _CPU_ENDIAN_ID @KWSYS_NAMESPACE at _CPU_ENDIAN_ID_BIG
-
-/* MIPS (fallback, big endian) */
+/* MIPS */
 #elif defined(__mips) || defined(__mips__) || defined(__MIPS__)
 # define @KWSYS_NAMESPACE at _CPU_ENDIAN_ID @KWSYS_NAMESPACE at _CPU_ENDIAN_ID_BIG
 
diff --git a/Utilities/KWSys/vtksys/Directory.cxx b/Utilities/KWSys/vtksys/Directory.cxx
index 58cea63..741bcba 100644
--- a/Utilities/KWSys/vtksys/Directory.cxx
+++ b/Utilities/KWSys/vtksys/Directory.cxx
@@ -203,18 +203,13 @@ unsigned long Directory::GetNumberOfFilesInDirectory(const kwsys_stl::string& na
 #include <sys/types.h>
 #include <dirent.h>
 
-// PGI with glibc has trouble with dirent and large file support:
-//  http://www.pgroup.com/userforum/viewtopic.php?
-//  p=1992&sid=f16167f51964f1a68fe5041b8eb213b6
-// Work around the problem by mapping dirent the same way as readdir.
-#if defined(__PGI) && defined(__GLIBC__)
-# define kwsys_dirent_readdir dirent
-# define kwsys_dirent_readdir64 dirent64
-# define kwsys_dirent kwsys_dirent_lookup(readdir)
-# define kwsys_dirent_lookup(x) kwsys_dirent_lookup_delay(x)
-# define kwsys_dirent_lookup_delay(x) kwsys_dirent_##x
-#else
-# define kwsys_dirent dirent
+/* There is a problem with the Portland compiler, large file
+support and glibc/Linux system headers: 
+http://www.pgroup.com/userforum/viewtopic.php?
+p=1992&sid=f16167f51964f1a68fe5041b8eb213b6
+*/
+#if defined(__PGI) && defined(__USE_FILE_OFFSET64)
+# define dirent dirent64
 #endif
 
 namespace KWSYS_NAMESPACE
@@ -231,7 +226,7 @@ bool Directory::Load(const kwsys_stl::string& name)
     return 0;
     }
 
-  for (kwsys_dirent* d = readdir(dir); d; d = readdir(dir) )
+  for (dirent* d = readdir(dir); d; d = readdir(dir) )
     {
     this->Internal->Files.push_back(d->d_name);
     }
@@ -244,13 +239,8 @@ unsigned long Directory::GetNumberOfFilesInDirectory(const kwsys_stl::string& na
 {
   DIR* dir = opendir(name.c_str());
 
-  if (!dir)
-    {
-    return 0;
-    }
-
   unsigned long count = 0;
-  for (kwsys_dirent* d = readdir(dir); d; d = readdir(dir) )
+  for (dirent* d = readdir(dir); d; d = readdir(dir) )
     {
     count++;
     }
diff --git a/Utilities/KWSys/vtksys/DynamicLoader.cxx b/Utilities/KWSys/vtksys/DynamicLoader.cxx
index a776f97..66c7d57 100644
--- a/Utilities/KWSys/vtksys/DynamicLoader.cxx
+++ b/Utilities/KWSys/vtksys/DynamicLoader.cxx
@@ -48,10 +48,6 @@ DynamicLoader::LibraryHandle DynamicLoader::OpenLibrary(const kwsys_stl::string&
 //----------------------------------------------------------------------------
 int DynamicLoader::CloseLibrary(DynamicLoader::LibraryHandle lib)
 {
-  if (!lib)
-    {
-    return 0;
-    }
   return !shl_unload(lib);
 }
 
diff --git a/Utilities/KWSys/vtksys/EncodingC.c b/Utilities/KWSys/vtksys/EncodingC.c
index ba2cec2..cda78e2 100644
--- a/Utilities/KWSys/vtksys/EncodingC.c
+++ b/Utilities/KWSys/vtksys/EncodingC.c
@@ -44,7 +44,7 @@ wchar_t* kwsysEncoding_DupToWide(const char* str)
   size_t length = kwsysEncoding_mbstowcs(NULL, str, 0) + 1;
   if(length > 0)
     {
-    ret = (wchar_t*)malloc((length)*sizeof(wchar_t));
+    ret = malloc((length)*sizeof(wchar_t));
     ret[0] = 0;
     kwsysEncoding_mbstowcs(ret, str, length);
     }
@@ -71,7 +71,7 @@ char* kwsysEncoding_DupToNarrow(const wchar_t* str)
   size_t length = kwsysEncoding_wcstombs(0, str, 0) + 1;
   if(length > 0)
     {
-    ret = (char*)malloc(length);
+    ret = malloc(length);
     ret[0] = 0;
     kwsysEncoding_wcstombs(ret, str, length);
     }
diff --git a/Utilities/KWSys/vtksys/FStream.hxx.in b/Utilities/KWSys/vtksys/FStream.hxx.in
index 37055d6..45425ff 100644
--- a/Utilities/KWSys/vtksys/FStream.hxx.in
+++ b/Utilities/KWSys/vtksys/FStream.hxx.in
@@ -18,11 +18,6 @@
 namespace @KWSYS_NAMESPACE@
 {
 #if defined(_MSC_VER) && _MSC_VER >= 1400
-# if defined(_NOEXCEPT)
-#  define @KWSYS_NAMESPACE at _FStream_NOEXCEPT _NOEXCEPT
-# else
-#  define @KWSYS_NAMESPACE at _FStream_NOEXCEPT
-# endif
   template<typename CharType,typename Traits>
   class basic_filebuf : public std::basic_filebuf<CharType,Traits>
   {
@@ -90,7 +85,7 @@ namespace @KWSYS_NAMESPACE@
       return buf_;
     }
 
-    ~basic_ifstream() @KWSYS_NAMESPACE at _FStream_NOEXCEPT
+    ~basic_ifstream()
     {
       buf_->close();
       delete buf_;
@@ -152,7 +147,7 @@ class basic_ofstream : public std::basic_ostream<CharType,Traits>
   {
     return buf_.get();
   }
-  ~basic_ofstream() @KWSYS_NAMESPACE at _FStream_NOEXCEPT
+  ~basic_ofstream()
   {
     buf_->close();
     delete buf_;
@@ -165,7 +160,6 @@ class basic_ofstream : public std::basic_ostream<CharType,Traits>
   typedef basic_ifstream<char> ifstream;
   typedef basic_ofstream<char> ofstream;
 
-# undef @KWSYS_NAMESPACE at _FStream_NOEXCEPT
 #else
   using @KWSYS_NAMESPACE at _ios_namespace::ofstream;
   using @KWSYS_NAMESPACE at _ios_namespace::ifstream;
diff --git a/Utilities/KWSys/vtksys/Glob.cxx b/Utilities/KWSys/vtksys/Glob.cxx
index 11bfd16..5a96aed 100644
--- a/Utilities/KWSys/vtksys/Glob.cxx
+++ b/Utilities/KWSys/vtksys/Glob.cxx
@@ -19,7 +19,6 @@
 #include KWSYS_HEADER(Directory.hxx)
 #include KWSYS_HEADER(stl/string)
 #include KWSYS_HEADER(stl/vector)
-#include KWSYS_HEADER(stl/algorithm)
 
 // Work-around CMake dependency scanning limitation.  This must
 // duplicate the above list of headers.
@@ -31,8 +30,6 @@
 # include "SystemTools.hxx.in"
 # include "kwsys_stl.hxx.in"
 # include "kwsys_stl_string.hxx.in"
-# include "kwsys_stl_vector.hxx.in"
-# include "kwsys_stl_algorithm.hxx.in"
 #endif
 
 #include <ctype.h>
@@ -69,10 +66,6 @@ Glob::Glob()
     // RecurseThroughSymlinks is true by default for backwards compatibility,
     // not because it's a good idea...
   this->FollowedSymlinkCount = 0;
-
-  // Keep separate variables for directory listing for back compatibility
-  this->ListDirs = true;
-  this->RecurseListDirs = false;
 }
 
 //----------------------------------------------------------------------------
@@ -221,15 +214,16 @@ kwsys_stl::string Glob::PatternToRegex(const kwsys_stl::string& pattern,
 }
 
 //----------------------------------------------------------------------------
-bool Glob::RecurseDirectory(kwsys_stl::string::size_type start,
-  const kwsys_stl::string& dir, GlobMessages* messages)
+void Glob::RecurseDirectory(kwsys_stl::string::size_type start,
+  const kwsys_stl::string& dir)
 {
   kwsys::Directory d;
   if ( !d.Load(dir) )
     {
-    return true;
+    return;
     }
   unsigned long cc;
+  kwsys_stl::string fullname;
   kwsys_stl::string realname;
   kwsys_stl::string fname;
   for ( cc = 0; cc < d.GetNumberOfFiles(); cc ++ )
@@ -254,6 +248,15 @@ bool Glob::RecurseDirectory(kwsys_stl::string::size_type start,
     fname = kwsys::SystemTools::LowerCase(fname);
 #endif
 
+    if ( start == 0 )
+      {
+      fullname = dir + fname;
+      }
+    else
+      {
+      fullname = dir + "/" + fname;
+      }
+
     bool isDir = kwsys::SystemTools::FileIsDirectory(realname);
     bool isSymLink = kwsys::SystemTools::FileIsSymlink(realname);
 
@@ -262,67 +265,8 @@ bool Glob::RecurseDirectory(kwsys_stl::string::size_type start,
       if (isSymLink)
         {
         ++this->FollowedSymlinkCount;
-        kwsys_stl::string realPathErrorMessage;
-        kwsys_stl::string canonicalPath(SystemTools::GetRealPath(dir,
-            &realPathErrorMessage));
-
-        if(!realPathErrorMessage.empty())
-          {
-          if(messages)
-            {
-            messages->push_back(Message(
-                Glob::error, "Canonical path generation from path '"
-                + dir + "' failed! Reason: '" + realPathErrorMessage + "'"));
-            }
-          return false;
-          }
-
-        if(kwsys_stl::find(this->VisitedSymlinks.begin(),
-            this->VisitedSymlinks.end(),
-            canonicalPath) == this->VisitedSymlinks.end())
-          {
-          if(this->RecurseListDirs)
-            {
-            // symlinks are treated as directories
-            this->AddFile(this->Internals->Files, realname);
-            }
-
-          this->VisitedSymlinks.push_back(canonicalPath);
-          if(!this->RecurseDirectory(start+1, realname, messages))
-            {
-            this->VisitedSymlinks.pop_back();
-
-            return false;
-            }
-          this->VisitedSymlinks.pop_back();
-          }
-        // else we have already visited this symlink - prevent cyclic recursion
-        else if(messages)
-          {
-          kwsys_stl::string message;
-          for(kwsys_stl::vector<kwsys_stl::string>::const_iterator
-                pathIt = kwsys_stl::find(this->VisitedSymlinks.begin(),
-                                         this->VisitedSymlinks.end(),
-                                         canonicalPath);
-              pathIt != this->VisitedSymlinks.end(); ++pathIt)
-            {
-            message += *pathIt + "\n";
-            }
-          message += canonicalPath + "/" + fname;
-          messages->push_back(Message(Glob::cyclicRecursion, message));
-          }
-        }
-      else
-        {
-        if(this->RecurseListDirs)
-          {
-          this->AddFile(this->Internals->Files, realname);
-          }
-        if(!this->RecurseDirectory(start+1, realname, messages))
-          {
-          return false;
-          }
         }
+      this->RecurseDirectory(start+1, realname);
       }
     else
       {
@@ -333,19 +277,17 @@ bool Glob::RecurseDirectory(kwsys_stl::string::size_type start,
         }
       }
     }
-
-  return true;
 }
 
 //----------------------------------------------------------------------------
 void Glob::ProcessDirectory(kwsys_stl::string::size_type start,
-  const kwsys_stl::string& dir, GlobMessages* messages)
+  const kwsys_stl::string& dir)
 {
   //kwsys_ios::cout << "ProcessDirectory: " << dir << kwsys_ios::endl;
   bool last = ( start == this->Internals->Expressions.size()-1 );
   if ( last && this->Recurse )
     {
-    this->RecurseDirectory(start, dir, messages);
+    this->RecurseDirectory(start, dir);
     return;
     }
 
@@ -360,6 +302,7 @@ void Glob::ProcessDirectory(kwsys_stl::string::size_type start,
     return;
     }
   unsigned long cc;
+  kwsys_stl::string fullname;
   kwsys_stl::string realname;
   kwsys_stl::string fname;
   for ( cc = 0; cc < d.GetNumberOfFiles(); cc ++ )
@@ -384,14 +327,22 @@ void Glob::ProcessDirectory(kwsys_stl::string::size_type start,
     fname = kwsys::SystemTools::LowerCase(fname);
 #endif
 
+    if ( start == 0 )
+      {
+      fullname = dir + fname;
+      }
+    else
+      {
+      fullname = dir + "/" + fname;
+      }
+
     //kwsys_ios::cout << "Look at file: " << fname << kwsys_ios::endl;
     //kwsys_ios::cout << "Match: "
     // << this->Internals->TextExpressions[start].c_str() << kwsys_ios::endl;
-    //kwsys_ios::cout << "Real name: " << realname << kwsys_ios::endl;
+    //kwsys_ios::cout << "Full name: " << fullname << kwsys_ios::endl;
 
-    if( (!last && !kwsys::SystemTools::FileIsDirectory(realname))
-      || (!this->ListDirs && last &&
-          kwsys::SystemTools::FileIsDirectory(realname)) )
+    if ( !last &&
+      !kwsys::SystemTools::FileIsDirectory(realname) )
       {
       continue;
       }
@@ -404,14 +355,14 @@ void Glob::ProcessDirectory(kwsys_stl::string::size_type start,
         }
       else
         {
-        this->ProcessDirectory(start+1, realname, messages);
+        this->ProcessDirectory(start+1, realname + "/");
         }
       }
     }
 }
 
 //----------------------------------------------------------------------------
-bool Glob::FindFiles(const kwsys_stl::string& inexpr, GlobMessages* messages)
+bool Glob::FindFiles(const kwsys_stl::string& inexpr)
 {
   kwsys_stl::string cexpr;
   kwsys_stl::string::size_type cc;
@@ -507,11 +458,11 @@ bool Glob::FindFiles(const kwsys_stl::string& inexpr, GlobMessages* messages)
   // Handle network paths
   if ( skip > 0 )
     {
-    this->ProcessDirectory(0, fexpr.substr(0, skip) + "/", messages);
+    this->ProcessDirectory(0, fexpr.substr(0, skip) + "/");
     }
   else
     {
-    this->ProcessDirectory(0, "/", messages);
+    this->ProcessDirectory(0, "/");
     }
   return true;
 }
diff --git a/Utilities/KWSys/vtksys/Glob.hxx.in b/Utilities/KWSys/vtksys/Glob.hxx.in
index 5239ccd..d8b8491 100644
--- a/Utilities/KWSys/vtksys/Glob.hxx.in
+++ b/Utilities/KWSys/vtksys/Glob.hxx.in
@@ -40,42 +40,11 @@ class GlobInternals;
 class @KWSYS_NAMESPACE at _EXPORT Glob
 {
 public:
-  enum MessageType
-  {
-    error,
-    cyclicRecursion
-  };
-
-  struct Message
-  {
-    MessageType type;
-    kwsys_stl::string content;
-
-    Message(MessageType t, const kwsys_stl::string& c) :
-      type(t),
-      content(c)
-    {}
-    Message(const Message& msg) :
-      type(msg.type),
-      content(msg.content)
-    {}
-    Message& operator=(Message const& msg)
-      {
-      this->type = msg.type;
-      this->content = msg.content;
-      return *this;
-      }
-  };
-
-  typedef kwsys_stl::vector<Message> GlobMessages;
-  typedef kwsys_stl::vector<Message>::iterator GlobMessagesIterator;
-public:
   Glob();
   ~Glob();
 
   //! Find all files that match the pattern.
-  bool FindFiles(const kwsys_stl::string& inexpr,
-    GlobMessages* messages = 0);
+  bool FindFiles(const kwsys_stl::string& inexpr);
 
   //! Return the list of files that matched.
   kwsys_stl::vector<kwsys_stl::string>& GetFiles();
@@ -111,26 +80,15 @@ public:
                                           bool require_whole_string = true,
                                           bool preserve_case = false);
 
-  /** Getters and setters for enabling and disabling directory
-      listing in recursive and non recursive globbing mode.
-      If listing is enabled in recursive mode it also lists
-      directory symbolic links even if follow symlinks is enabled. */
-  void SetListDirs(bool list) { this->ListDirs=list; }
-  bool GetListDirs() const { return this->ListDirs; }
-  void SetRecurseListDirs(bool list) { this->RecurseListDirs=list; }
-  bool GetRecurseListDirs() const { return this->RecurseListDirs; }
-
 protected:
   //! Process directory
   void ProcessDirectory(kwsys_stl::string::size_type start,
-    const kwsys_stl::string& dir,
-    GlobMessages* messages);
+    const kwsys_stl::string& dir);
 
   //! Process last directory, but only when recurse flags is on. That is
   // effectively like saying: /path/to/file/**/file
-  bool RecurseDirectory(kwsys_stl::string::size_type start,
-    const kwsys_stl::string& dir,
-    GlobMessages* messages);
+  void RecurseDirectory(kwsys_stl::string::size_type start,
+    const kwsys_stl::string& dir);
 
   //! Add regular expression
   void AddExpression(const kwsys_stl::string& expr);
@@ -143,9 +101,6 @@ protected:
   kwsys_stl::string Relative;
   bool RecurseThroughSymlinks;
   unsigned int FollowedSymlinkCount;
-  kwsys_stl::vector<kwsys_stl::string> VisitedSymlinks;
-  bool ListDirs;
-  bool RecurseListDirs;
 
 private:
   Glob(const Glob&);  // Not implemented.
diff --git a/Utilities/KWSys/vtksys/Process.h.in b/Utilities/KWSys/vtksys/Process.h.in
index e35939f..c5995ea 100644
--- a/Utilities/KWSys/vtksys/Process.h.in
+++ b/Utilities/KWSys/vtksys/Process.h.in
@@ -36,7 +36,6 @@
 # define kwsysProcess_SetPipeShared       kwsys_ns(Process_SetPipeShared)
 # define kwsysProcess_Option_Detach       kwsys_ns(Process_Option_Detach)
 # define kwsysProcess_Option_HideWindow   kwsys_ns(Process_Option_HideWindow)
-# define kwsysProcess_Option_MergeOutput  kwsys_ns(Process_Option_MergeOutput)
 # define kwsysProcess_Option_Verbatim     kwsys_ns(Process_Option_Verbatim)
 # define kwsysProcess_GetOption           kwsys_ns(Process_GetOption)
 # define kwsysProcess_SetOption           kwsys_ns(Process_SetOption)
@@ -187,12 +186,6 @@ kwsysEXPORT void kwsysProcess_SetPipeNative(kwsysProcess* cp, int pipe,
  *         0 = No (default)
  *         1 = Yes
  *
- *  kwsysProcess_Option_MergeOutput = Whether to merge stdout/stderr.
- *                                    No content will be returned as stderr.
- *                                    Any actual stderr will be on stdout.
- *         0 = No (default)
- *         1 = Yes
- *
  *  kwsysProcess_Option_Verbatim = Whether SetCommand and AddCommand
  *                                 should treat the first argument
  *                                 as a verbatim command line
@@ -207,7 +200,6 @@ enum kwsysProcess_Option_e
 {
   kwsysProcess_Option_HideWindow,
   kwsysProcess_Option_Detach,
-  kwsysProcess_Option_MergeOutput,
   kwsysProcess_Option_Verbatim
 };
 
@@ -392,7 +384,6 @@ kwsysEXPORT void kwsysProcess_Kill(kwsysProcess* cp);
 #  undef kwsysProcess_SetPipeShared
 #  undef kwsysProcess_Option_Detach
 #  undef kwsysProcess_Option_HideWindow
-#  undef kwsysProcess_Option_MergeOutput
 #  undef kwsysProcess_Option_Verbatim
 #  undef kwsysProcess_GetOption
 #  undef kwsysProcess_SetOption
diff --git a/Utilities/KWSys/vtksys/ProcessUNIX.c b/Utilities/KWSys/vtksys/ProcessUNIX.c
index 0393a6d..ca9d424 100644
--- a/Utilities/KWSys/vtksys/ProcessUNIX.c
+++ b/Utilities/KWSys/vtksys/ProcessUNIX.c
@@ -157,7 +157,7 @@ static void kwsysProcessCleanupDescriptor(int* pfd);
 static void kwsysProcessClosePipes(kwsysProcess* cp);
 static int kwsysProcessSetNonBlocking(int fd);
 static int kwsysProcessCreate(kwsysProcess* cp, int prIndex,
-                              kwsysProcessCreateInformation* si);
+                              kwsysProcessCreateInformation* si, int* readEnd);
 static void kwsysProcessDestroy(kwsysProcess* cp);
 static int kwsysProcessSetupOutputPipeFile(int* p, const char* name);
 static int kwsysProcessSetupOutputPipeNative(int* p, int des[2]);
@@ -203,10 +203,6 @@ struct kwsysProcess_s
      the signal pipe. */
   int PipeReadEnds[KWSYSPE_PIPE_COUNT];
 
-  /* Descriptors for the child's ends of the pipes.
-     Used temporarily during process creation.  */
-  int PipeChildStd[3];
-
   /* Write descriptor for child termination signal pipe.  */
   int SignalPipe;
 
@@ -234,9 +230,6 @@ struct kwsysProcess_s
   /* Whether to treat command lines as verbatim.  */
   int Verbatim;
 
-  /* Whether to merge stdout/stderr of the child.  */
-  int MergeOutput;
-
   /* Time at which the child started.  Negative for no timeout.  */
   kwsysProcessTime StartTime;
 
@@ -554,7 +547,7 @@ int kwsysProcess_SetPipeFile(kwsysProcess* cp, int prPipe, const char* file)
     }
   if(file)
     {
-    *pfile = (char*)malloc(strlen(file)+1);
+    *pfile = malloc(strlen(file)+1);
     if(!*pfile)
       {
       return 0;
@@ -647,7 +640,6 @@ int kwsysProcess_GetOption(kwsysProcess* cp, int optionId)
   switch(optionId)
     {
     case kwsysProcess_Option_Detach: return cp->OptionDetach;
-    case kwsysProcess_Option_MergeOutput: return cp->MergeOutput;
     case kwsysProcess_Option_Verbatim: return cp->Verbatim;
     default: return 0;
     }
@@ -664,7 +656,6 @@ void kwsysProcess_SetOption(kwsysProcess* cp, int optionId, int value)
   switch(optionId)
     {
     case kwsysProcess_Option_Detach: cp->OptionDetach = value; break;
-    case kwsysProcess_Option_MergeOutput: cp->MergeOutput = value; break;
     case kwsysProcess_Option_Verbatim: cp->Verbatim = value; break;
     default: break;
     }
@@ -726,6 +717,7 @@ const char* kwsysProcess_GetExceptionString(kwsysProcess* cp)
 void kwsysProcess_Execute(kwsysProcess* cp)
 {
   int i;
+  kwsysProcessCreateInformation si = {-1, -1, -1, {-1, -1}};
 
   /* Do not execute a second copy simultaneously.  */
   if(!cp || cp->State == kwsysProcess_State_Executing)
@@ -793,50 +785,7 @@ void kwsysProcess_Execute(kwsysProcess* cp)
       }
     }
 
-  /* Setup the stdin pipe for the first process.  */
-  if(cp->PipeFileSTDIN)
-    {
-    /* Open a file for the child's stdin to read.  */
-    cp->PipeChildStd[0] = open(cp->PipeFileSTDIN, O_RDONLY);
-    if(cp->PipeChildStd[0] < 0)
-      {
-      kwsysProcessCleanup(cp, 1);
-      return;
-      }
-
-    /* Set close-on-exec flag on the pipe's end.  */
-    if(fcntl(cp->PipeChildStd[0], F_SETFD, FD_CLOEXEC) < 0)
-      {
-      kwsysProcessCleanup(cp, 1);
-      return;
-      }
-    }
-  else if(cp->PipeSharedSTDIN)
-    {
-    cp->PipeChildStd[0] = 0;
-    }
-  else if(cp->PipeNativeSTDIN[0] >= 0)
-    {
-    cp->PipeChildStd[0] = cp->PipeNativeSTDIN[0];
-
-    /* Set close-on-exec flag on the pipe's ends.  The read end will
-       be dup2-ed into the stdin descriptor after the fork but before
-       the exec.  */
-    if((fcntl(cp->PipeNativeSTDIN[0], F_SETFD, FD_CLOEXEC) < 0) ||
-       (fcntl(cp->PipeNativeSTDIN[1], F_SETFD, FD_CLOEXEC) < 0))
-      {
-      kwsysProcessCleanup(cp, 1);
-      return;
-      }
-    }
-  else
-    {
-    cp->PipeChildStd[0] = -1;
-    }
-
-  /* Create the output pipe for the last process.
-     We always create this so the pipe can be passed to select even if
-     it will report closed immediately.  */
+  /* Setup the stderr pipe to be shared by all processes.  */
   {
   /* Create the pipe.  */
   int p[2];
@@ -847,14 +796,15 @@ void kwsysProcess_Execute(kwsysProcess* cp)
     }
 
   /* Store the pipe.  */
-  cp->PipeReadEnds[KWSYSPE_PIPE_STDOUT] = p[0];
-  cp->PipeChildStd[1] = p[1];
+  cp->PipeReadEnds[KWSYSPE_PIPE_STDERR] = p[0];
+  si.StdErr = p[1];
 
   /* Set close-on-exec flag on the pipe's ends.  */
   if((fcntl(p[0], F_SETFD, FD_CLOEXEC) < 0) ||
      (fcntl(p[1], F_SETFD, FD_CLOEXEC) < 0))
     {
     kwsysProcessCleanup(cp, 1);
+    kwsysProcessCleanupDescriptor(&si.StdErr);
     return;
     }
 
@@ -863,93 +813,41 @@ void kwsysProcess_Execute(kwsysProcess* cp)
   if(!kwsysProcessSetNonBlocking(p[0]))
     {
     kwsysProcessCleanup(cp, 1);
+    kwsysProcessCleanupDescriptor(&si.StdErr);
     return;
     }
   }
 
-  if (cp->PipeFileSTDOUT)
+  /* Replace the stderr pipe with a file if requested.  In this case
+     the select call will report that stderr is closed immediately.  */
+  if(cp->PipeFileSTDERR)
     {
-    /* Use a file for stdout.  */
-    if(!kwsysProcessSetupOutputPipeFile(&cp->PipeChildStd[1],
-                                        cp->PipeFileSTDOUT))
-      {
-      kwsysProcessCleanup(cp, 1);
-      return;
-      }
-    }
-  else if (cp->PipeSharedSTDOUT)
-    {
-    /* Use the parent stdout.  */
-    kwsysProcessCleanupDescriptor(&cp->PipeChildStd[1]);
-    cp->PipeChildStd[1] = 1;
-    }
-  else if (cp->PipeNativeSTDOUT[1] >= 0)
-    {
-    /* Use the given descriptor for stdout.  */
-    if(!kwsysProcessSetupOutputPipeNative(&cp->PipeChildStd[1],
-                                          cp->PipeNativeSTDOUT))
+    if(!kwsysProcessSetupOutputPipeFile(&si.StdErr, cp->PipeFileSTDERR))
       {
       kwsysProcessCleanup(cp, 1);
+      kwsysProcessCleanupDescriptor(&si.StdErr);
       return;
       }
     }
 
-  /* Create stderr pipe to be shared by all processes in the pipeline.
-     We always create this so the pipe can be passed to select even if
-     it will report closed immediately.  */
-  {
-  /* Create the pipe.  */
-  int p[2];
-  if(pipe(p KWSYSPE_VMS_NONBLOCK) < 0)
-    {
-    kwsysProcessCleanup(cp, 1);
-    return;
-    }
-
-  /* Store the pipe.  */
-  cp->PipeReadEnds[KWSYSPE_PIPE_STDERR] = p[0];
-  cp->PipeChildStd[2] = p[1];
-
-  /* Set close-on-exec flag on the pipe's ends.  */
-  if((fcntl(p[0], F_SETFD, FD_CLOEXEC) < 0) ||
-     (fcntl(p[1], F_SETFD, FD_CLOEXEC) < 0))
+  /* Replace the stderr pipe with the parent's if requested.  In this
+     case the select call will report that stderr is closed
+     immediately.  */
+  if(cp->PipeSharedSTDERR)
     {
-    kwsysProcessCleanup(cp, 1);
-    return;
+    kwsysProcessCleanupDescriptor(&si.StdErr);
+    si.StdErr = 2;
     }
 
-  /* Set to non-blocking in case select lies, or for the polling
-     implementation.  */
-  if(!kwsysProcessSetNonBlocking(p[0]))
+  /* Replace the stderr pipe with the native pipe provided if any.  In
+     this case the select call will report that stderr is closed
+     immediately.  */
+  if(cp->PipeNativeSTDERR[1] >= 0)
     {
-    kwsysProcessCleanup(cp, 1);
-    return;
-    }
-  }
-
-  if (cp->PipeFileSTDERR)
-    {
-    /* Use a file for stderr.  */
-    if(!kwsysProcessSetupOutputPipeFile(&cp->PipeChildStd[2],
-                                        cp->PipeFileSTDERR))
-      {
-      kwsysProcessCleanup(cp, 1);
-      return;
-      }
-    }
-  else if (cp->PipeSharedSTDERR)
-    {
-    /* Use the parent stderr.  */
-    kwsysProcessCleanupDescriptor(&cp->PipeChildStd[2]);
-    cp->PipeChildStd[2] = 2;
-    }
-  else if (cp->PipeNativeSTDERR[1] >= 0)
-    {
-    /* Use the given handle for stderr.  */
-    if(!kwsysProcessSetupOutputPipeNative(&cp->PipeChildStd[2],
-                                          cp->PipeNativeSTDERR))
+    if(!kwsysProcessSetupOutputPipeNative(&si.StdErr, cp->PipeNativeSTDERR))
       {
       kwsysProcessCleanup(cp, 1);
+      kwsysProcessCleanupDescriptor(&si.StdErr);
       return;
       }
     }
@@ -961,85 +859,54 @@ void kwsysProcess_Execute(kwsysProcess* cp)
 
   /* Create the pipeline of processes.  */
   {
-  kwsysProcessCreateInformation si = {-1, -1, -1, {-1, -1}};
-  int nextStdIn = cp->PipeChildStd[0];
+  int readEnd = -1;
+  int failed = 0;
   for(i=0; i < cp->NumberOfCommands; ++i)
     {
-    /* Setup the process's pipes.  */
-    si.StdIn = nextStdIn;
-    if (i == cp->NumberOfCommands-1)
+    if(!kwsysProcessCreate(cp, i, &si, &readEnd))
       {
-      nextStdIn = -1;
-      si.StdOut = cp->PipeChildStd[1];
-      }
-    else
-      {
-      /* Create a pipe to sit between the children.  */
-      int p[2] = {-1,-1};
-      if(pipe(p KWSYSPE_VMS_NONBLOCK) < 0)
-        {
-        if (nextStdIn != cp->PipeChildStd[0])
-          {
-          kwsysProcessCleanupDescriptor(&nextStdIn);
-          }
-        kwsysProcessCleanup(cp, 1);
-        return;
-        }
-
-      /* Set close-on-exec flag on the pipe's ends.  */
-      if((fcntl(p[0], F_SETFD, FD_CLOEXEC) < 0) ||
-         (fcntl(p[1], F_SETFD, FD_CLOEXEC) < 0))
-        {
-        close(p[0]);
-        close(p[1]);
-        if (nextStdIn != cp->PipeChildStd[0])
-          {
-          kwsysProcessCleanupDescriptor(&nextStdIn);
-          }
-        kwsysProcessCleanup(cp, 1);
-        return;
-        }
-      nextStdIn = p[0];
-      si.StdOut = p[1];
+      failed = 1;
       }
-    si.StdErr = cp->MergeOutput? cp->PipeChildStd[1] : cp->PipeChildStd[2];
-
-    {
-    int res = kwsysProcessCreate(cp, i, &si);
 
-    /* Close our copies of pipes used between children.  */
-    if (si.StdIn != cp->PipeChildStd[0])
-      {
-      kwsysProcessCleanupDescriptor(&si.StdIn);
-      }
-    if (si.StdOut != cp->PipeChildStd[1])
-      {
-      kwsysProcessCleanupDescriptor(&si.StdOut);
-      }
-    if (si.StdErr != cp->PipeChildStd[2] && !cp->MergeOutput)
+    /* Set the output pipe of the last process to be non-blocking in
+       case select lies, or for the polling implementation.  */
+    if(i == (cp->NumberOfCommands-1) && !kwsysProcessSetNonBlocking(readEnd))
       {
-      kwsysProcessCleanupDescriptor(&si.StdErr);
+      failed = 1;
       }
 
-    if(!res)
+    if(failed)
       {
-      kwsysProcessCleanupDescriptor(&si.ErrorPipe[0]);
-      kwsysProcessCleanupDescriptor(&si.ErrorPipe[1]);
-      if (nextStdIn != cp->PipeChildStd[0])
+      kwsysProcessCleanup(cp, 1);
+
+      /* Release resources that may have been allocated for this
+         process before an error occurred.  */
+      kwsysProcessCleanupDescriptor(&readEnd);
+      if(si.StdIn != 0)
         {
-        kwsysProcessCleanupDescriptor(&nextStdIn);
+        kwsysProcessCleanupDescriptor(&si.StdIn);
         }
-      kwsysProcessCleanup(cp, 1);
+      if(si.StdOut != 1)
+        {
+        kwsysProcessCleanupDescriptor(&si.StdOut);
+        }
+      if(si.StdErr != 2)
+        {
+        kwsysProcessCleanupDescriptor(&si.StdErr);
+        }
+      kwsysProcessCleanupDescriptor(&si.ErrorPipe[0]);
+      kwsysProcessCleanupDescriptor(&si.ErrorPipe[1]);
       return;
       }
     }
-    }
+  /* Save a handle to the output pipe for the last process.  */
+  cp->PipeReadEnds[KWSYSPE_PIPE_STDOUT] = readEnd;
   }
 
-  /* The parent process does not need the child's pipe ends.  */
-  for (i=0; i < 3; ++i)
+  /* The parent process does not need the output pipe write ends.  */
+  if(si.StdErr != 2)
     {
-    kwsysProcessCleanupDescriptor(&cp->PipeChildStd[i]);
+    kwsysProcessCleanupDescriptor(&si.StdErr);
     }
 
   /* Restore the working directory. */
@@ -1547,10 +1414,6 @@ static int kwsysProcessInitialize(kwsysProcess* cp)
     {
     cp->PipeReadEnds[i] = -1;
     }
-  for(i=0; i < 3; ++i)
-    {
-    cp->PipeChildStd[i] = -1;
-    }
   cp->SignalPipe = -1;
   cp->SelectError = 0;
   cp->StartTime.tv_sec = -1;
@@ -1605,7 +1468,7 @@ static int kwsysProcessInitialize(kwsysProcess* cp)
     cp->RealWorkingDirectoryLength = 4096;
 #endif
     cp->RealWorkingDirectory =
-      (char*)malloc((size_t)(cp->RealWorkingDirectoryLength));
+      malloc((size_t)(cp->RealWorkingDirectoryLength));
     if(!cp->RealWorkingDirectory)
       {
       return 0;
@@ -1685,17 +1548,13 @@ static void kwsysProcessCleanup(kwsysProcess* cp, int error)
     {
     kwsysProcessCleanupDescriptor(&cp->PipeReadEnds[i]);
     }
-  for(i=0; i < 3; ++i)
-    {
-    kwsysProcessCleanupDescriptor(&cp->PipeChildStd[i]);
-    }
 }
 
 /*--------------------------------------------------------------------------*/
 /* Close the given file descriptor if it is open.  Reset its value to -1.  */
 static void kwsysProcessCleanupDescriptor(int* pfd)
 {
-  if(pfd && *pfd > 2)
+  if(pfd && *pfd >= 0)
     {
     /* Keep trying to close until it is not interrupted by a
      * signal.  */
@@ -1756,8 +1615,100 @@ int decc$set_child_standard_streams(int fd1, int fd2, int fd3);
 
 /*--------------------------------------------------------------------------*/
 static int kwsysProcessCreate(kwsysProcess* cp, int prIndex,
-                              kwsysProcessCreateInformation* si)
+                              kwsysProcessCreateInformation* si, int* readEnd)
 {
+  /* Setup the process's stdin.  */
+  if(prIndex > 0)
+    {
+    si->StdIn = *readEnd;
+    *readEnd = 0;
+    }
+  else if(cp->PipeFileSTDIN)
+    {
+    /* Open a file for the child's stdin to read.  */
+    si->StdIn = open(cp->PipeFileSTDIN, O_RDONLY);
+    if(si->StdIn < 0)
+      {
+      return 0;
+      }
+
+    /* Set close-on-exec flag on the pipe's end.  */
+    if(fcntl(si->StdIn, F_SETFD, FD_CLOEXEC) < 0)
+      {
+      return 0;
+      }
+    }
+  else if(cp->PipeSharedSTDIN)
+    {
+    si->StdIn = 0;
+    }
+  else if(cp->PipeNativeSTDIN[0] >= 0)
+    {
+    si->StdIn = cp->PipeNativeSTDIN[0];
+
+    /* Set close-on-exec flag on the pipe's ends.  The read end will
+       be dup2-ed into the stdin descriptor after the fork but before
+       the exec.  */
+    if((fcntl(cp->PipeNativeSTDIN[0], F_SETFD, FD_CLOEXEC) < 0) ||
+       (fcntl(cp->PipeNativeSTDIN[1], F_SETFD, FD_CLOEXEC) < 0))
+      {
+      return 0;
+      }
+    }
+  else
+    {
+    si->StdIn = -1;
+    }
+
+  /* Setup the process's stdout.  */
+  {
+  /* Create the pipe.  */
+  int p[2];
+  if(pipe(p KWSYSPE_VMS_NONBLOCK) < 0)
+    {
+    return 0;
+    }
+  *readEnd = p[0];
+  si->StdOut = p[1];
+
+  /* Set close-on-exec flag on the pipe's ends.  */
+  if((fcntl(p[0], F_SETFD, FD_CLOEXEC) < 0) ||
+     (fcntl(p[1], F_SETFD, FD_CLOEXEC) < 0))
+    {
+    return 0;
+    }
+  }
+
+  /* Replace the stdout pipe with a file if requested.  In this case
+     the select call will report that stdout is closed immediately.  */
+  if(prIndex == cp->NumberOfCommands-1 && cp->PipeFileSTDOUT)
+    {
+    if(!kwsysProcessSetupOutputPipeFile(&si->StdOut, cp->PipeFileSTDOUT))
+      {
+      return 0;
+      }
+    }
+
+  /* Replace the stdout pipe with the parent's if requested.  In this
+     case the select call will report that stderr is closed
+     immediately.  */
+  if(prIndex == cp->NumberOfCommands-1 && cp->PipeSharedSTDOUT)
+    {
+    kwsysProcessCleanupDescriptor(&si->StdOut);
+    si->StdOut = 1;
+    }
+
+  /* Replace the stdout pipe with the native pipe provided if any.  In
+     this case the select call will report that stdout is closed
+     immediately.  */
+  if(prIndex == cp->NumberOfCommands-1 && cp->PipeNativeSTDOUT[1] >= 0)
+    {
+    if(!kwsysProcessSetupOutputPipeNative(&si->StdOut, cp->PipeNativeSTDOUT))
+      {
+      return 0;
+      }
+    }
+
   /* Create the error reporting pipe.  */
   if(pipe(si->ErrorPipe) < 0)
     {
@@ -1868,6 +1819,19 @@ static int kwsysProcessCreate(kwsysProcess* cp, int prIndex,
     }
   }
 
+  /* Successfully created this child process.  */
+  if(prIndex > 0 || si->StdIn > 0)
+    {
+    /* The parent process does not need the input pipe read end.  */
+    kwsysProcessCleanupDescriptor(&si->StdIn);
+    }
+
+  /* The parent process does not need the output pipe write ends.  */
+  if(si->StdOut != 1)
+    {
+    kwsysProcessCleanupDescriptor(&si->StdOut);
+    }
+
   return 1;
 }
 
diff --git a/Utilities/KWSys/vtksys/ProcessWin32.c b/Utilities/KWSys/vtksys/ProcessWin32.c
index f630171..ef71f26 100644
--- a/Utilities/KWSys/vtksys/ProcessWin32.c
+++ b/Utilities/KWSys/vtksys/ProcessWin32.c
@@ -94,11 +94,6 @@ typedef struct kwsysProcessCreateInformation_s
 {
   /* Windows child startup control data.  */
   STARTUPINFOW StartupInfo;
-
-  /* Original handles before making inherited duplicates.  */
-  HANDLE hStdInput;
-  HANDLE hStdOutput;
-  HANDLE hStdError;
 } kwsysProcessCreateInformation;
 
 
@@ -112,12 +107,15 @@ static void kwsysProcessPipeThreadWakePipe(kwsysProcess* cp,
                                            kwsysProcessPipeData* td);
 static int kwsysProcessInitialize(kwsysProcess* cp);
 static int kwsysProcessCreate(kwsysProcess* cp, int index,
-                              kwsysProcessCreateInformation* si);
+                              kwsysProcessCreateInformation* si,
+                              PHANDLE readEnd);
 static void kwsysProcessDestroy(kwsysProcess* cp, int event);
 static int kwsysProcessSetupOutputPipeFile(PHANDLE handle, const char* name);
-static void kwsysProcessSetupSharedPipe(DWORD nStdHandle, PHANDLE handle);
-static void kwsysProcessSetupPipeNative(HANDLE native, PHANDLE handle);
+static int kwsysProcessSetupSharedPipe(DWORD nStdHandle, PHANDLE handle);
+static int kwsysProcessSetupPipeNative(PHANDLE handle, HANDLE p[2],
+                                       int isWrite);
 static void kwsysProcessCleanupHandle(PHANDLE h);
+static void kwsysProcessCleanupHandleSafe(PHANDLE h, DWORD nStdHandle);
 static void kwsysProcessCleanup(kwsysProcess* cp, int error);
 static void kwsysProcessCleanErrorMessage(kwsysProcess* cp);
 static int kwsysProcessComputeCommandLength(kwsysProcess* cp,
@@ -226,9 +224,6 @@ struct kwsysProcess_s
   /* Whether to treat command lines as verbatim.  */
   int Verbatim;
 
-  /* Whether to merge stdout/stderr of the child.  */
-  int MergeOutput;
-
   /* Mutex to protect the shared index used by threads to report data.  */
   HANDLE SharedIndexMutex;
 
@@ -311,10 +306,6 @@ struct kwsysProcess_s
   /* Real working directory of our own process.  */
   DWORD RealWorkingDirectoryLength;
   wchar_t* RealWorkingDirectory;
-
-  /* Own handles for the child's ends of the pipes in the parent process.
-     Used temporarily during process creation.  */
-  HANDLE PipeChildStd[3];
 };
 
 /*--------------------------------------------------------------------------*/
@@ -349,11 +340,7 @@ kwsysProcess* kwsysProcess_New(void)
   osv.dwOSVersionInfoSize = sizeof(osv);
 #ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx
 # pragma warning (push)
-# ifdef __INTEL_COMPILER
-#  pragma warning (disable:1478)
-# else
-#  pragma warning (disable:4996)
-# endif
+# pragma warning (disable:4996)
 #endif
   GetVersionEx(&osv);
 #ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx
@@ -455,10 +442,6 @@ kwsysProcess* kwsysProcess_New(void)
       return 0;
       }
     }
-  for(i=0; i < 3; ++i)
-    {
-    cp->PipeChildStd[i] = INVALID_HANDLE_VALUE;
-    }
 
   return cp;
 }
@@ -809,7 +792,6 @@ int kwsysProcess_GetOption(kwsysProcess* cp, int optionId)
     {
     case kwsysProcess_Option_Detach: return cp->OptionDetach;
     case kwsysProcess_Option_HideWindow: return cp->HideWindow;
-    case kwsysProcess_Option_MergeOutput: return cp->MergeOutput;
     case kwsysProcess_Option_Verbatim: return cp->Verbatim;
     default: return 0;
     }
@@ -827,7 +809,6 @@ void kwsysProcess_SetOption(kwsysProcess* cp, int optionId, int value)
     {
     case kwsysProcess_Option_Detach: cp->OptionDetach = value; break;
     case kwsysProcess_Option_HideWindow: cp->HideWindow = value; break;
-    case kwsysProcess_Option_MergeOutput: cp->MergeOutput = value; break;
     case kwsysProcess_Option_Verbatim: cp->Verbatim = value; break;
     default: break;
     }
@@ -890,6 +871,9 @@ void kwsysProcess_Execute(kwsysProcess* cp)
 {
   int i;
 
+  /* Child startup control data.  */
+  kwsysProcessCreateInformation si;
+
   /* Do not execute a second time.  */
   if(!cp || cp->State == kwsysProcess_State_Executing)
     {
@@ -926,211 +910,117 @@ void kwsysProcess_Execute(kwsysProcess* cp)
     SetCurrentDirectoryW(cp->WorkingDirectory);
     }
 
+  /* Initialize startup info data.  */
+  ZeroMemory(&si, sizeof(si));
+  si.StartupInfo.cb = sizeof(si.StartupInfo);
 
-  /* Setup the stdin pipe for the first process.  */
-  if(cp->PipeFileSTDIN)
-    {
-    /* Create a handle to read a file for stdin.  */
-    wchar_t* wstdin = kwsysEncoding_DupToWide(cp->PipeFileSTDIN);
-    cp->PipeChildStd[0] =
-      CreateFileW(wstdin, GENERIC_READ|GENERIC_WRITE,
-                  FILE_SHARE_READ|FILE_SHARE_WRITE,
-                  0, OPEN_EXISTING, 0, 0);
-    free(wstdin);
-    if(cp->PipeChildStd[0] == INVALID_HANDLE_VALUE)
-      {
-      kwsysProcessCleanup(cp, 1);
-      return;
-      }
-    }
-  else if(cp->PipeSharedSTDIN)
-    {
-    /* Share this process's stdin with the child.  */
-    kwsysProcessSetupSharedPipe(STD_INPUT_HANDLE, &cp->PipeChildStd[0]);
-    }
-  else if(cp->PipeNativeSTDIN[0])
-    {
-    /* Use the provided native pipe.  */
-    kwsysProcessSetupPipeNative(cp->PipeNativeSTDIN[0], &cp->PipeChildStd[0]);
-    }
-  else
-    {
-    /* Explicitly give the child no stdin.  */
-    cp->PipeChildStd[0] = INVALID_HANDLE_VALUE;
-    }
+  /* Decide whether a child window should be shown.  */
+  si.StartupInfo.dwFlags |= STARTF_USESHOWWINDOW;
+  si.StartupInfo.wShowWindow =
+    (unsigned short)(cp->HideWindow?SW_HIDE:SW_SHOWDEFAULT);
+
+  /* Connect the child's output pipes to the threads.  */
+  si.StartupInfo.dwFlags |= STARTF_USESTDHANDLES;
 
-  /* Create the output pipe for the last process.
-     We always create this so the pipe thread can run even if we
-     do not end up giving the write end to the child below.  */
-  if(!CreatePipe(&cp->Pipe[KWSYSPE_PIPE_STDOUT].Read,
-                 &cp->Pipe[KWSYSPE_PIPE_STDOUT].Write, 0, 0))
+  /* Create stderr pipe to be shared by all processes in the pipeline.
+     Neither end is directly inherited.  */
+  if(!CreatePipe(&cp->Pipe[KWSYSPE_PIPE_STDERR].Read,
+                 &cp->Pipe[KWSYSPE_PIPE_STDERR].Write, 0, 0))
     {
     kwsysProcessCleanup(cp, 1);
     return;
     }
 
-  if(cp->PipeFileSTDOUT)
-    {
-    /* Use a file for stdout.  */
-    if(!kwsysProcessSetupOutputPipeFile(&cp->PipeChildStd[1],
-                                        cp->PipeFileSTDOUT))
-      {
-      kwsysProcessCleanup(cp, 1);
-      return;
-      }
-    }
-  else if(cp->PipeSharedSTDOUT)
-    {
-    /* Use the parent stdout.  */
-    kwsysProcessSetupSharedPipe(STD_OUTPUT_HANDLE, &cp->PipeChildStd[1]);
-    }
-  else if(cp->PipeNativeSTDOUT[1])
-    {
-    /* Use the given handle for stdout.  */
-    kwsysProcessSetupPipeNative(cp->PipeNativeSTDOUT[1], &cp->PipeChildStd[1]);
-    }
-  else
-    {
-    /* Use our pipe for stdout.  Duplicate the handle since our waker
-       thread will use the original.  Do not make it inherited yet.  */
-    if(!DuplicateHandle(GetCurrentProcess(),
-                        cp->Pipe[KWSYSPE_PIPE_STDOUT].Write,
-                        GetCurrentProcess(), &cp->PipeChildStd[1],
-                        0, FALSE, DUPLICATE_SAME_ACCESS))
-      {
-      kwsysProcessCleanup(cp, 1);
-      return;
-      }
-    }
-
-  /* Create stderr pipe to be shared by all processes in the pipeline.
-     We always create this so the pipe thread can run even if we do not
-     end up giving the write end to the child below.  */
-  if(!CreatePipe(&cp->Pipe[KWSYSPE_PIPE_STDERR].Read,
-                 &cp->Pipe[KWSYSPE_PIPE_STDERR].Write, 0, 0))
+  /* Create an inherited duplicate of the write end, but do not
+     close the non-inherited version.  We need to keep it open
+     to use in waking up the pipe threads.  */
+  if(!DuplicateHandle(GetCurrentProcess(), cp->Pipe[KWSYSPE_PIPE_STDERR].Write,
+                      GetCurrentProcess(), &si.StartupInfo.hStdError,
+                      0, TRUE, DUPLICATE_SAME_ACCESS))
     {
     kwsysProcessCleanup(cp, 1);
+    kwsysProcessCleanupHandle(&si.StartupInfo.hStdError);
     return;
     }
 
+  /* Replace the stderr pipe with a file if requested.  In this case
+     the pipe thread will still run but never report data.  */
   if(cp->PipeFileSTDERR)
     {
-    /* Use a file for stderr.  */
-    if(!kwsysProcessSetupOutputPipeFile(&cp->PipeChildStd[2],
+    if(!kwsysProcessSetupOutputPipeFile(&si.StartupInfo.hStdError,
                                         cp->PipeFileSTDERR))
       {
       kwsysProcessCleanup(cp, 1);
+      kwsysProcessCleanupHandle(&si.StartupInfo.hStdError);
       return;
       }
     }
-  else if(cp->PipeSharedSTDERR)
-    {
-    /* Use the parent stderr.  */
-    kwsysProcessSetupSharedPipe(STD_ERROR_HANDLE, &cp->PipeChildStd[2]);
-    }
-  else if(cp->PipeNativeSTDERR[1])
+
+  /* Replace the stderr pipe with the parent process's if requested.
+     In this case the pipe thread will still run but never report
+     data.  */
+  if(cp->PipeSharedSTDERR)
     {
-    /* Use the given handle for stderr.  */
-    kwsysProcessSetupPipeNative(cp->PipeNativeSTDERR[1], &cp->PipeChildStd[2]);
+    if(!kwsysProcessSetupSharedPipe(STD_ERROR_HANDLE,
+                                    &si.StartupInfo.hStdError))
+      {
+      kwsysProcessCleanup(cp, 1);
+      kwsysProcessCleanupHandleSafe(&si.StartupInfo.hStdError,
+                                    STD_ERROR_HANDLE);
+      return;
+      }
     }
-  else
+
+  /* Replace the stderr pipe with the native pipe provided if any.  In
+     this case the pipe thread will still run but never report
+     data.  */
+  if(cp->PipeNativeSTDERR[1])
     {
-    /* Use our pipe for stderr.  Duplicate the handle since our waker
-       thread will use the original.  Do not make it inherited yet.  */
-    if(!DuplicateHandle(GetCurrentProcess(),
-                        cp->Pipe[KWSYSPE_PIPE_STDERR].Write,
-                        GetCurrentProcess(), &cp->PipeChildStd[2],
-                        0, FALSE, DUPLICATE_SAME_ACCESS))
+    if(!kwsysProcessSetupPipeNative(&si.StartupInfo.hStdError,
+                                    cp->PipeNativeSTDERR, 1))
       {
       kwsysProcessCleanup(cp, 1);
+      kwsysProcessCleanupHandleSafe(&si.StartupInfo.hStdError,
+                                    STD_ERROR_HANDLE);
       return;
       }
     }
 
   /* Create the pipeline of processes.  */
   {
-  /* Child startup control data.  */
-  kwsysProcessCreateInformation si;
-  HANDLE nextStdInput = cp->PipeChildStd[0];
-
-  /* Initialize startup info data.  */
-  ZeroMemory(&si, sizeof(si));
-  si.StartupInfo.cb = sizeof(si.StartupInfo);
-
-  /* Decide whether a child window should be shown.  */
-  si.StartupInfo.dwFlags |= STARTF_USESHOWWINDOW;
-  si.StartupInfo.wShowWindow =
-    (unsigned short)(cp->HideWindow?SW_HIDE:SW_SHOWDEFAULT);
-
-  /* Connect the child's output pipes to the threads.  */
-  si.StartupInfo.dwFlags |= STARTF_USESTDHANDLES;
-
+  HANDLE readEnd = 0;
   for(i=0; i < cp->NumberOfCommands; ++i)
     {
-    /* Setup the process's pipes.  */
-    si.hStdInput = nextStdInput;
-    if (i == cp->NumberOfCommands-1)
-      {
-      /* The last child gets the overall stdout.  */
-      nextStdInput = INVALID_HANDLE_VALUE;
-      si.hStdOutput = cp->PipeChildStd[1];
-      }
-    else
-      {
-      /* Create a pipe to sit between the children.  */
-      HANDLE p[2] = {INVALID_HANDLE_VALUE, INVALID_HANDLE_VALUE};
-      if (!CreatePipe(&p[0], &p[1], 0, 0))
-        {
-        if (nextStdInput != cp->PipeChildStd[0])
-          {
-          kwsysProcessCleanupHandle(&nextStdInput);
-          }
-        kwsysProcessCleanup(cp, 1);
-        return;
-        }
-      nextStdInput = p[0];
-      si.hStdOutput = p[1];
-      }
-    si.hStdError = cp->MergeOutput? cp->PipeChildStd[1] : cp->PipeChildStd[2];
-
-    {
-    int res = kwsysProcessCreate(cp, i, &si);
-
-    /* Close our copies of pipes used between children.  */
-    if (si.hStdInput != cp->PipeChildStd[0])
-      {
-      kwsysProcessCleanupHandle(&si.hStdInput);
-      }
-    if (si.hStdOutput != cp->PipeChildStd[1])
-      {
-      kwsysProcessCleanupHandle(&si.hStdOutput);
-      }
-    if (si.hStdError != cp->PipeChildStd[2] && !cp->MergeOutput)
-      {
-      kwsysProcessCleanupHandle(&si.hStdError);
-      }
-    if (res)
+    if(kwsysProcessCreate(cp, i, &si, &readEnd))
       {
       cp->ProcessEvents[i+1] = cp->ProcessInformation[i].hProcess;
       }
     else
       {
-      if (nextStdInput != cp->PipeChildStd[0])
-        {
-        kwsysProcessCleanupHandle(&nextStdInput);
-        }
       kwsysProcessCleanup(cp, 1);
+
+      /* Release resources that may have been allocated for this
+         process before an error occurred.  */
+      kwsysProcessCleanupHandle(&readEnd);
+      kwsysProcessCleanupHandleSafe(&si.StartupInfo.hStdInput,
+                                    STD_INPUT_HANDLE);
+      kwsysProcessCleanupHandleSafe(&si.StartupInfo.hStdOutput,
+                                    STD_OUTPUT_HANDLE);
+      kwsysProcessCleanupHandleSafe(&si.StartupInfo.hStdError,
+                                    STD_ERROR_HANDLE);
       return;
       }
     }
-    }
+
+  /* Save a handle to the output pipe for the last process.  */
+  cp->Pipe[KWSYSPE_PIPE_STDOUT].Read = readEnd;
   }
 
-  /* The parent process does not need the child's pipe ends.  */
-  for (i=0; i < 3; ++i)
-    {
-    kwsysProcessCleanupHandle(&cp->PipeChildStd[i]);
-    }
+  /* Close the inherited handles to the stderr pipe shared by all
+     processes in the pipeline.  The stdout and stdin pipes are not
+     shared among all children and are therefore closed by
+     kwsysProcessCreate after each child is created.  */
+  kwsysProcessCleanupHandleSafe(&si.StartupInfo.hStdError, STD_ERROR_HANDLE);
 
   /* Restore the working directory.  */
   if(cp->RealWorkingDirectory)
@@ -1649,90 +1539,162 @@ int kwsysProcessInitialize(kwsysProcess* cp)
         }
       }
     }
-  {
-  int i;
-  for (i=0; i < 3; ++i)
-    {
-    cp->PipeChildStd[i] = INVALID_HANDLE_VALUE;
-    }
-  }
 
   return 1;
 }
 
 /*--------------------------------------------------------------------------*/
-static int kwsysProcessCreateChildHandle(PHANDLE out, HANDLE in, int isStdIn)
+int kwsysProcessCreate(kwsysProcess* cp, int index,
+                       kwsysProcessCreateInformation* si,
+                       PHANDLE readEnd)
 {
-  DWORD flags;
-
-  /* Check whether the handle is valid for this process.  */
-  if (in != INVALID_HANDLE_VALUE && GetHandleInformation(in, &flags))
+  /* Setup the process's stdin.  */
+  if(*readEnd)
     {
-    /* Use the handle as-is if it is already inherited.  */
-    if (flags & HANDLE_FLAG_INHERIT)
+    /* Create an inherited duplicate of the read end from the output
+       pipe of the previous process.  This also closes the
+       non-inherited version. */
+    if(!DuplicateHandle(GetCurrentProcess(), *readEnd,
+                        GetCurrentProcess(), readEnd,
+                        0, TRUE, (DUPLICATE_CLOSE_SOURCE |
+                                  DUPLICATE_SAME_ACCESS)))
       {
-      *out = in;
-      return 1;
+      return 0;
       }
+    si->StartupInfo.hStdInput = *readEnd;
 
-    /* Create an inherited copy of this handle.  */
-    return DuplicateHandle(GetCurrentProcess(), in,
-                           GetCurrentProcess(), out,
-                           0, TRUE, DUPLICATE_SAME_ACCESS);
+    /* This function is done with this handle.  */
+    *readEnd = 0;
+    }
+  else if(cp->PipeFileSTDIN)
+    {
+    /* Create a handle to read a file for stdin.  */
+    wchar_t* wstdin = kwsysEncoding_DupToWide(cp->PipeFileSTDIN);
+    HANDLE fin = CreateFileW(wstdin, GENERIC_READ|GENERIC_WRITE,
+                            FILE_SHARE_READ|FILE_SHARE_WRITE,
+                            0, OPEN_EXISTING, 0, 0);
+    free(wstdin);
+    if(fin == INVALID_HANDLE_VALUE)
+      {
+      return 0;
+      }
+    /* Create an inherited duplicate of the handle.  This also closes
+       the non-inherited version.  */
+    if(!DuplicateHandle(GetCurrentProcess(), fin,
+                        GetCurrentProcess(), &fin,
+                        0, TRUE, (DUPLICATE_CLOSE_SOURCE |
+                                  DUPLICATE_SAME_ACCESS)))
+      {
+      return 0;
+      }
+    si->StartupInfo.hStdInput = fin;
+    }
+  else if(cp->PipeSharedSTDIN)
+    {
+    /* Share this process's stdin with the child.  */
+    if(!kwsysProcessSetupSharedPipe(STD_INPUT_HANDLE,
+                                    &si->StartupInfo.hStdInput))
+      {
+      return 0;
+      }
+    }
+  else if(cp->PipeNativeSTDIN[0])
+    {
+    /* Use the provided native pipe.  */
+    if(!kwsysProcessSetupPipeNative(&si->StartupInfo.hStdInput,
+                                    cp->PipeNativeSTDIN, 0))
+      {
+      return 0;
+      }
     }
   else
     {
-    /* The given handle is not valid for this process.  Some child
-       processes may break if they do not have a valid standard handle,
-       so open NUL to give to the child.  */
-    SECURITY_ATTRIBUTES sa;
-    ZeroMemory(&sa, sizeof(sa));
-    sa.nLength = (DWORD)sizeof(sa);
-    sa.bInheritHandle = 1;
-    *out = CreateFileW(L"NUL",
-                       (isStdIn ? GENERIC_READ :
-                        (GENERIC_WRITE | FILE_READ_ATTRIBUTES)),
-                       FILE_SHARE_READ|FILE_SHARE_WRITE,
-                       &sa, OPEN_EXISTING, 0, 0);
-    return *out != INVALID_HANDLE_VALUE;
+    /* Explicitly give the child no stdin.  */
+    si->StartupInfo.hStdInput = INVALID_HANDLE_VALUE;
     }
 
-}
+  /* Setup the process's stdout.  */
+  {
+  DWORD maybeClose = DUPLICATE_CLOSE_SOURCE;
+  HANDLE writeEnd;
 
-/*--------------------------------------------------------------------------*/
-int kwsysProcessCreate(kwsysProcess* cp, int index,
-                       kwsysProcessCreateInformation* si)
-{
-  int res =
+  /* Create the output pipe for this process.  Neither end is directly
+     inherited.  */
+  if(!CreatePipe(readEnd, &writeEnd, 0, 0))
+    {
+    return 0;
+    }
 
-    /* Create inherited copies the handles.  */
-    kwsysProcessCreateChildHandle(&si->StartupInfo.hStdInput,
-                                  si->hStdInput, 1) &&
-    kwsysProcessCreateChildHandle(&si->StartupInfo.hStdOutput,
-                                  si->hStdOutput, 0) &&
-    kwsysProcessCreateChildHandle(&si->StartupInfo.hStdError,
-                                  si->hStdError, 0) &&
+  /* Create an inherited duplicate of the write end.  Close the
+     non-inherited version unless this is the last process.  Save the
+     non-inherited write end of the last process.  */
+  if(index == cp->NumberOfCommands-1)
+    {
+    cp->Pipe[KWSYSPE_PIPE_STDOUT].Write = writeEnd;
+    maybeClose = 0;
+    }
+  if(!DuplicateHandle(GetCurrentProcess(), writeEnd,
+                      GetCurrentProcess(), &writeEnd,
+                      0, TRUE, (maybeClose | DUPLICATE_SAME_ACCESS)))
+    {
+    return 0;
+    }
+  si->StartupInfo.hStdOutput = writeEnd;
+  }
 
-    /* Create the child in a suspended state so we can wait until all
-       children have been created before running any one.  */
-    CreateProcessW(0, cp->Commands[index], 0, 0, TRUE, CREATE_SUSPENDED, 0,
-                   0, &si->StartupInfo, &cp->ProcessInformation[index]);
+  /* Replace the stdout pipe with a file if requested.  In this case
+     the pipe thread will still run but never report data.  */
+  if(index == cp->NumberOfCommands-1 && cp->PipeFileSTDOUT)
+    {
+    if(!kwsysProcessSetupOutputPipeFile(&si->StartupInfo.hStdOutput,
+                                        cp->PipeFileSTDOUT))
+      {
+      return 0;
+      }
+    }
 
-  /* Close the inherited copies of the handles. */
-  if (si->StartupInfo.hStdInput != si->hStdInput)
+  /* Replace the stdout pipe of the last child with the parent
+     process's if requested.  In this case the pipe thread will still
+     run but never report data.  */
+  if(index == cp->NumberOfCommands-1 && cp->PipeSharedSTDOUT)
     {
-    kwsysProcessCleanupHandle(&si->StartupInfo.hStdInput);
+    if(!kwsysProcessSetupSharedPipe(STD_OUTPUT_HANDLE,
+                                    &si->StartupInfo.hStdOutput))
+      {
+      return 0;
+      }
     }
-  if (si->StartupInfo.hStdOutput != si->hStdOutput)
+
+  /* Replace the stdout pipe with the native pipe provided if any.  In
+     this case the pipe thread will still run but never report
+     data.  */
+  if(index == cp->NumberOfCommands-1 && cp->PipeNativeSTDOUT[1])
     {
-    kwsysProcessCleanupHandle(&si->StartupInfo.hStdOutput);
+    if(!kwsysProcessSetupPipeNative(&si->StartupInfo.hStdOutput,
+                                    cp->PipeNativeSTDOUT, 1))
+      {
+      return 0;
+      }
     }
-  if (si->StartupInfo.hStdError != si->hStdError)
+
+  /* Create the child in a suspended state so we can wait until all
+     children have been created before running any one.  */
+  if(!CreateProcessW(0, cp->Commands[index], 0, 0, TRUE, CREATE_SUSPENDED, 0,
+                    0, &si->StartupInfo, &cp->ProcessInformation[index]))
     {
-    kwsysProcessCleanupHandle(&si->StartupInfo.hStdError);
+    return 0;
     }
 
-  return res;
+  /* Successfully created this child process.  Close the current
+     process's copies of the inherited stdout and stdin handles.  The
+     stderr handle is shared among all children and is closed by
+     kwsysProcess_Execute after all children have been created.  */
+  kwsysProcessCleanupHandleSafe(&si->StartupInfo.hStdInput,
+                                STD_INPUT_HANDLE);
+  kwsysProcessCleanupHandleSafe(&si->StartupInfo.hStdOutput,
+                                STD_OUTPUT_HANDLE);
+
+  return 1;
 }
 
 /*--------------------------------------------------------------------------*/
@@ -1797,7 +1759,7 @@ int kwsysProcessSetupOutputPipeFile(PHANDLE phandle, const char* name)
     return 1;
     }
 
-  /* Close the existing handle.  */
+  /* Close the existing inherited handle.  */
   kwsysProcessCleanupHandle(phandle);
 
   /* Create a handle to write a file for the pipe.  */
@@ -1810,27 +1772,103 @@ int kwsysProcessSetupOutputPipeFile(PHANDLE phandle, const char* name)
     return 0;
     }
 
+  /* Create an inherited duplicate of the handle.  This also closes
+     the non-inherited version.  */
+  if(!DuplicateHandle(GetCurrentProcess(), fout,
+                      GetCurrentProcess(), &fout,
+                      0, TRUE, (DUPLICATE_CLOSE_SOURCE |
+                                DUPLICATE_SAME_ACCESS)))
+    {
+    return 0;
+    }
+
   /* Assign the replacement handle.  */
   *phandle = fout;
   return 1;
 }
 
 /*--------------------------------------------------------------------------*/
-void kwsysProcessSetupSharedPipe(DWORD nStdHandle, PHANDLE handle)
+int kwsysProcessSetupSharedPipe(DWORD nStdHandle, PHANDLE handle)
 {
-  /* Close the existing handle.  */
+  /* Check whether the handle to be shared is already inherited.  */
+  DWORD flags;
+  int inherited = 0;
+  if(GetHandleInformation(GetStdHandle(nStdHandle), &flags) &&
+     (flags & HANDLE_FLAG_INHERIT))
+    {
+    inherited = 1;
+    }
+
+  /* Cleanup the previous handle.  */
   kwsysProcessCleanupHandle(handle);
-  /* Store the new standard handle.  */
-  *handle = GetStdHandle(nStdHandle);
+
+  /* If the standard handle is not inherited then duplicate it to
+     create an inherited copy.  Do not close the original handle when
+     duplicating!  */
+  if(inherited)
+    {
+    *handle = GetStdHandle(nStdHandle);
+    return 1;
+    }
+  else if(DuplicateHandle(GetCurrentProcess(), GetStdHandle(nStdHandle),
+                          GetCurrentProcess(), handle,
+                          0, TRUE, DUPLICATE_SAME_ACCESS))
+    {
+    return 1;
+    }
+  else
+    {
+    /* The given standard handle is not valid for this process.  Some
+       child processes may break if they do not have a valid standard
+       pipe, so give the child an empty pipe.  For the stdin pipe we
+       want to close the write end and give the read end to the child.
+       For stdout and stderr we want to close the read end and give
+       the write end to the child.  */
+    int child_end = (nStdHandle == STD_INPUT_HANDLE)? 0:1;
+    int parent_end = (nStdHandle == STD_INPUT_HANDLE)? 1:0;
+    HANDLE emptyPipe[2];
+    if(!CreatePipe(&emptyPipe[0], &emptyPipe[1], 0, 0))
+      {
+      return 0;
+      }
+
+    /* Close the non-inherited end so the pipe will be broken
+       immediately.  */
+    CloseHandle(emptyPipe[parent_end]);
+
+    /* Create an inherited duplicate of the handle.  This also
+       closes the non-inherited version.  */
+    if(!DuplicateHandle(GetCurrentProcess(), emptyPipe[child_end],
+                        GetCurrentProcess(), &emptyPipe[child_end],
+                        0, TRUE, (DUPLICATE_CLOSE_SOURCE |
+                                  DUPLICATE_SAME_ACCESS)))
+      {
+      return 0;
+      }
+
+    /* Give the inherited handle to the child.  */
+    *handle = emptyPipe[child_end];
+    return 1;
+    }
 }
 
 /*--------------------------------------------------------------------------*/
-void kwsysProcessSetupPipeNative(HANDLE native, PHANDLE handle)
+int kwsysProcessSetupPipeNative(PHANDLE handle, HANDLE p[2], int isWrite)
 {
-  /* Close the existing handle.  */
+  /* Close the existing inherited handle.  */
   kwsysProcessCleanupHandle(handle);
-  /* Store the new given handle.  */
-  *handle = native;
+
+  /* Create an inherited duplicate of the handle.  This also closes
+     the non-inherited version.  */
+  if(!DuplicateHandle(GetCurrentProcess(), p[isWrite? 1:0],
+                      GetCurrentProcess(), handle,
+                      0, TRUE, (DUPLICATE_CLOSE_SOURCE |
+                                DUPLICATE_SAME_ACCESS)))
+    {
+    return 0;
+    }
+
+  return 1;
 }
 
 /*--------------------------------------------------------------------------*/
@@ -1838,13 +1876,23 @@ void kwsysProcessSetupPipeNative(HANDLE native, PHANDLE handle)
 /* Close the given handle if it is open.  Reset its value to 0.  */
 void kwsysProcessCleanupHandle(PHANDLE h)
 {
-  if(h && *h && *h != INVALID_HANDLE_VALUE &&
-     *h != GetStdHandle(STD_INPUT_HANDLE) &&
-     *h != GetStdHandle(STD_OUTPUT_HANDLE) &&
-     *h != GetStdHandle(STD_ERROR_HANDLE))
+  if(h && *h)
+    {
+    CloseHandle(*h);
+    *h = 0;
+    }
+}
+
+/*--------------------------------------------------------------------------*/
+
+/* Close the given handle if it is open and not a standard handle.
+   Reset its value to 0.  */
+void kwsysProcessCleanupHandleSafe(PHANDLE h, DWORD nStdHandle)
+{
+  if(h && *h && (*h != GetStdHandle(nStdHandle)))
     {
     CloseHandle(*h);
-    *h = INVALID_HANDLE_VALUE;
+    *h = 0;
     }
 }
 
@@ -1934,10 +1982,6 @@ void kwsysProcessCleanup(kwsysProcess* cp, int error)
     kwsysProcessCleanupHandle(&cp->Pipe[i].Read);
     cp->Pipe[i].Closed = 0;
     }
-  for(i=0; i < 3; ++i)
-    {
-    kwsysProcessCleanupHandle(&cp->PipeChildStd[i]);
-    }
 }
 
 /*--------------------------------------------------------------------------*/
@@ -2338,11 +2382,7 @@ static kwsysProcess_List* kwsysProcess_List_New(void)
   osv.dwOSVersionInfoSize = sizeof(osv);
 #ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx
 # pragma warning (push)
-# ifdef __INTEL_COMPILER
-#  pragma warning (disable:1478)
-# else
-#  pragma warning (disable:4996)
-# endif
+# pragma warning (disable:4996)
 #endif
   GetVersionEx(&osv);
 #ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx
diff --git a/Utilities/KWSys/vtksys/README.txt b/Utilities/KWSys/vtksys/README.txt
index b8191f7..ba03f8d 100644
--- a/Utilities/KWSys/vtksys/README.txt
+++ b/Utilities/KWSys/vtksys/README.txt
@@ -8,5 +8,3 @@ details.
 You are probably reading this file in the source tree of a surrounding
 project.  In that case, see "../README.kwsys" for details of using
 KWSys in your project.
-
-See CONTRIBUTING.rst for instructions to contribute KWSys changes.
diff --git a/Utilities/KWSys/vtksys/SharedForward.h.in b/Utilities/KWSys/vtksys/SharedForward.h.in
index f22fa58..7ff29b4 100644
--- a/Utilities/KWSys/vtksys/SharedForward.h.in
+++ b/Utilities/KWSys/vtksys/SharedForward.h.in
@@ -65,15 +65,6 @@
   See the comments below for specific explanations of each macro.
 */
 
-/* Disable -Wcast-qual warnings since they are too hard to fix in a
-   cross-platform way.  */
-#if defined(__clang__) && defined(__has_warning)
-# if __has_warning("-Wcast-qual")
-#  pragma clang diagnostic push
-#  pragma clang diagnostic ignored "-Wcast-qual"
-# endif
-#endif
-
 /*--------------------------------------------------------------------------*/
 
 /* Full path to the directory in which this executable is built.  Do
@@ -822,7 +813,7 @@ static void kwsys_shared_forward_print_failure(char const* const* argv)
 }
 
 /* Static storage space to store the updated environment variable.  */
-static char kwsys_shared_forward_ldpath[65535] = KWSYS_SHARED_FORWARD_LDPATH "=";
+static char kwsys_shared_forward_ldpath[KWSYS_SHARED_FORWARD_MAXPATH*16] = KWSYS_SHARED_FORWARD_LDPATH "=";
 
 /*--------------------------------------------------------------------------*/
 /* Main driver function to be called from main.  */
@@ -926,13 +917,6 @@ static int @KWSYS_NAMESPACE at _shared_forward_to_real(int argc, char** argv_in)
   return 1;
 }
 
-/* Restore warning stack.  */
-#if defined(__clang__) && defined(__has_warning)
-# if __has_warning("-Wcast-qual")
-#  pragma clang diagnostic pop
-# endif
-#endif
-
 #else
 # error "@KWSYS_NAMESPACE@/SharedForward.h should be included only once."
 #endif
diff --git a/Utilities/KWSys/vtksys/SystemInformation.cxx b/Utilities/KWSys/vtksys/SystemInformation.cxx
index b0434f4..3e1a1ab 100644
--- a/Utilities/KWSys/vtksys/SystemInformation.cxx
+++ b/Utilities/KWSys/vtksys/SystemInformation.cxx
@@ -443,7 +443,7 @@ public:
     };
 
 protected:
-  // For windows
+  // Functions.
   bool RetrieveCPUFeatures();
   bool RetrieveCPUIdentity();
   bool RetrieveCPUCacheDetails();
@@ -457,7 +457,6 @@ protected:
   bool RetrieveClassicalCPUIdentity();
   bool RetrieveExtendedCPUIdentity();
 
-  // Processor information
   Manufacturer  ChipManufacturer;
   CPUFeatures   Features;
   ID            ChipID;
@@ -465,11 +464,11 @@ protected:
   unsigned int  NumberOfLogicalCPU;
   unsigned int  NumberOfPhysicalCPU;
 
-  int CPUCount(); // For windows
+  int CPUCount();
   unsigned char LogicalCPUPerPhysicalCPU();
-  unsigned char GetAPICId(); // For windows
+  unsigned char GetAPICId();
   bool IsHyperThreadingSupported();
-  static LongLong GetCyclesDifference(DELAY_FUNC, unsigned int); // For windows
+  static LongLong GetCyclesDifference(DELAY_FUNC, unsigned int);
 
   // For Linux and Cygwin, /proc/cpuinfo formats are slightly different
   bool RetreiveInformationFromCpuInfoFile();
@@ -1234,7 +1233,6 @@ void StacktraceSignalHandler(
 
         case ILL_ILLTRP:
           oss << "illegal trap";
-          break;
 
         case ILL_PRVOPC:
           oss << "privileged opcode";
@@ -1824,7 +1822,6 @@ const char * SystemInformationImplementation::GetVendorID()
       return "Motorola";
     case HP:
       return "Hewlett-Packard";
-    case UnknownManufacturer:
     default:
       return "Unknown Manufacturer";
     }
@@ -3066,12 +3063,6 @@ bool SystemInformationImplementation::RetrieveClassicalCPUIdentity()
     case NSC:
       this->ChipID.ProcessorName = "Cx486SLC \\ DLC \\ Cx486S A-Step";
       break;
-
-    case Sun:
-    case IBM:
-    case Motorola:
-    case HP:
-    case UnknownManufacturer:
     default:
       this->ChipID.ProcessorName = "Unknown family"; // We cannot identify the processor.
       return false;
@@ -3762,9 +3753,9 @@ bool SystemInformationImplementation::QueryWindowsMemory()
   }
 #  define MEM_VAL(value) ull##value
 # endif
-  tv = ms.MEM_VAL(TotalPageFile);
+  tv = ms.MEM_VAL(TotalVirtual);
   tp = ms.MEM_VAL(TotalPhys);
-  av = ms.MEM_VAL(AvailPageFile);
+  av = ms.MEM_VAL(AvailVirtual);
   ap = ms.MEM_VAL(AvailPhys);
   this->TotalVirtualMemory = tv>>10>>10;
   this->TotalPhysicalMemory = tp>>10>>10;
@@ -5077,11 +5068,7 @@ bool SystemInformationImplementation::QueryOSInformation()
   osvi.dwOSVersionInfoSize = sizeof (OSVERSIONINFOEXW);
 #ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx
 # pragma warning (push)
-# ifdef __INTEL_COMPILER
-#  pragma warning (disable:1478)
-# else
-#  pragma warning (disable:4996)
-# endif
+# pragma warning (disable:4996)
 #endif
   bOsVersionInfoEx = GetVersionExW ((OSVERSIONINFOW*)&osvi);
   if (!bOsVersionInfoEx)
diff --git a/Utilities/KWSys/vtksys/SystemTools.cxx b/Utilities/KWSys/vtksys/SystemTools.cxx
index 6c4a7a6..e4c82d8 100644
--- a/Utilities/KWSys/vtksys/SystemTools.cxx
+++ b/Utilities/KWSys/vtksys/SystemTools.cxx
@@ -16,14 +16,6 @@
 #  define _XOPEN_SOURCE_EXTENDED
 #endif
 
-#if defined(_WIN32) && (defined(_MSC_VER) || defined(__WATCOMC__) || defined(__BORLANDC__) || defined(__MINGW32__))
-#  define KWSYS_WINDOWS_DIRS
-#else
-#  if defined(__SUNPRO_CC)
-#    include <fcntl.h>
-#  endif
-#endif
-
 #include "kwsysPrivate.h"
 #include KWSYS_HEADER(RegularExpression.hxx)
 #include KWSYS_HEADER(SystemTools.hxx)
@@ -213,7 +205,8 @@ static time_t windows_filetime_to_posix_time(const FILETIME& ft)
 }
 #endif
 
-#ifdef KWSYS_WINDOWS_DIRS
+#if defined(_WIN32) && (defined(_MSC_VER) || defined(__WATCOMC__) || defined(__BORLANDC__) || defined(__MINGW32__))
+
 #include <wctype.h>
 
 inline int Mkdir(const kwsys_stl::string& dir)
@@ -250,46 +243,17 @@ inline int Chdir(const kwsys_stl::string& dir)
   return _wchdir(KWSYS_NAMESPACE::Encoding::ToWide(dir).c_str());
   #endif
 }
-inline void Realpath(const kwsys_stl::string& path,
-                     kwsys_stl::string& resolved_path,
-                     kwsys_stl::string* errorMessage = 0)
+inline void Realpath(const kwsys_stl::string& path, kwsys_stl::string & resolved_path)
 {
   kwsys_stl::wstring tmp = KWSYS_NAMESPACE::Encoding::ToWide(path);
   wchar_t *ptemp;
   wchar_t fullpath[MAX_PATH];
-  DWORD bufferLen = GetFullPathNameW(tmp.c_str(),
-      sizeof(fullpath) / sizeof(fullpath[0]),
-      fullpath, &ptemp);
-  if( bufferLen < sizeof(fullpath)/sizeof(fullpath[0]) )
+  if( GetFullPathNameW(tmp.c_str(), sizeof(fullpath)/sizeof(fullpath[0]),
+                       fullpath, &ptemp) )
     {
     resolved_path = KWSYS_NAMESPACE::Encoding::ToNarrow(fullpath);
     KWSYS_NAMESPACE::SystemTools::ConvertToUnixSlashes(resolved_path);
     }
-  else if(errorMessage)
-    {
-    if(bufferLen)
-      {
-      *errorMessage = "Destination path buffer size too small.";
-      }
-    else if(unsigned int errorId = GetLastError())
-      {
-      LPSTR message = NULL;
-      DWORD size = FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER
-                                   | FORMAT_MESSAGE_FROM_SYSTEM
-                                   | FORMAT_MESSAGE_IGNORE_INSERTS,
-                                   NULL, errorId,
-                                   MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
-                                   (LPSTR)&message, 0, NULL);
-      *errorMessage = std::string(message, size);
-      LocalFree(message);
-      }
-    else
-      {
-      *errorMessage = "Unknown error.";
-      }
-
-    resolved_path = "";
-    }
   else
     {
     resolved_path = path;
@@ -316,31 +280,15 @@ inline int Chdir(const kwsys_stl::string& dir)
 {
   return chdir(dir.c_str());
 }
-inline void Realpath(const kwsys_stl::string& path,
-                     kwsys_stl::string& resolved_path,
-                     kwsys_stl::string* errorMessage = 0)
+inline void Realpath(const kwsys_stl::string& path, kwsys_stl::string & resolved_path)
 {
   char resolved_name[KWSYS_SYSTEMTOOLS_MAXPATH];
 
-  errno = 0;
   char *ret = realpath(path.c_str(), resolved_name);
   if(ret)
     {
     resolved_path = ret;
     }
-  else if(errorMessage)
-    {
-    if(errno)
-      {
-      *errorMessage = strerror(errno);
-      }
-    else
-      {
-      *errorMessage = "Unknown error.";
-      }
-
-    resolved_path = "";
-    }
   else
     {
     // if path resolution fails, return what was passed in
@@ -1260,22 +1208,15 @@ bool SystemTools::PathCygwinToWin32(const char *path, char *win32_path)
 
 bool SystemTools::Touch(const kwsys_stl::string& filename, bool create)
 {
-  if (!SystemTools::FileExists(filename))
+  if(create && !SystemTools::FileExists(filename))
     {
-    if(create)
-      {
-      FILE* file = Fopen(filename, "a+b");
-      if(file)
-        {
-        fclose(file);
-        return true;
-        }
-      return false;
-      }
-    else
+    FILE* file = Fopen(filename, "a+b");
+    if(file)
       {
+      fclose(file);
       return true;
       }
+    return false;
     }
 #if defined(_WIN32) && !defined(__CYGWIN__)
   HANDLE h = CreateFileW(
@@ -2382,10 +2323,6 @@ bool SystemTools::CopyFileAlways(const kwsys_stl::string& source, const kwsys_st
       {
       fout.write(buffer, fin.gcount());
       }
-    else
-      {
-      break;
-      }
     }
 
   // Make sure the operating system has finished writing the file
@@ -3102,11 +3039,10 @@ kwsys_stl::string SystemTools
   return "";
 }
 
-kwsys_stl::string SystemTools::GetRealPath(const kwsys_stl::string& path,
-                                           kwsys_stl::string* errorMessage)
+kwsys_stl::string SystemTools::GetRealPath(const kwsys_stl::string& path)
 {
   kwsys_stl::string ret;
-  Realpath(path, ret, errorMessage);
+  Realpath(path, ret);
   return ret;
 }
 
@@ -4789,11 +4725,7 @@ kwsys_stl::string SystemTools::GetOperatingSystemNameAndVersion()
 
 #ifdef KWSYS_WINDOWS_DEPRECATED_GetVersionEx
 # pragma warning (push)
-# ifdef __INTEL_COMPILER
-#  pragma warning (disable:1478)
-# else
-#  pragma warning (disable:4996)
-# endif
+# pragma warning (disable:4996)
 #endif
   bOsVersionInfoEx = GetVersionEx((OSVERSIONINFO *)&osvi);
   if (!bOsVersionInfoEx)
diff --git a/Utilities/KWSys/vtksys/SystemTools.hxx.in b/Utilities/KWSys/vtksys/SystemTools.hxx.in
index 93cde02..beb2a7e 100644
--- a/Utilities/KWSys/vtksys/SystemTools.hxx.in
+++ b/Utilities/KWSys/vtksys/SystemTools.hxx.in
@@ -385,12 +385,9 @@ public:
   /** 
    * Get the real path for a given path, removing all symlinks.  In
    * the event of an error (non-existent path, permissions issue,
-   * etc.) the original path is returned if errorMessage pointer is
-   * NULL.  Otherwise empty string is returned and errorMessage
-   * contains error description.
+   * etc.) the original path is returned.
    */
-  static kwsys_stl::string GetRealPath(const kwsys_stl::string& path,
-                                       kwsys_stl::string* errorMessage = 0);
+  static kwsys_stl::string GetRealPath(const kwsys_stl::string& path);
 
   /**
    * Split a path name into its root component and the rest of the
diff --git a/Utilities/KWSys/vtksys/Terminal.c b/Utilities/KWSys/vtksys/Terminal.c
index d13f79a..e13003f 100644
--- a/Utilities/KWSys/vtksys/Terminal.c
+++ b/Utilities/KWSys/vtksys/Terminal.c
@@ -175,7 +175,6 @@ static const char* kwsysTerminalVT100Names[] =
   "xterm-88color",
   "xterm-color",
   "xterm-debian",
-  "xterm-termite",
   0
 };
 
diff --git a/Utilities/KWSys/vtksys/hashtable.hxx.in b/Utilities/KWSys/vtksys/hashtable.hxx.in
index 7e7dc42..b93e9be 100644
--- a/Utilities/KWSys/vtksys/hashtable.hxx.in
+++ b/Utilities/KWSys/vtksys/hashtable.hxx.in
@@ -408,7 +408,7 @@ enum { _stl_num_primes = 31 };
 
 // create a function with a static local to that function that returns
 // the static
-static inline const unsigned long* get_stl_prime_list() {
+inline const unsigned long* get_stl_prime_list() {
 
 static const unsigned long _stl_prime_list[_stl_num_primes] =
 {
@@ -423,7 +423,7 @@ static const unsigned long _stl_prime_list[_stl_num_primes] =
 
 return &_stl_prime_list[0]; }
 
-static inline size_t _stl_next_prime(size_t __n)
+inline size_t _stl_next_prime(size_t __n)
 {
   const unsigned long* __first = get_stl_prime_list();
   const unsigned long* __last = get_stl_prime_list() + (int)_stl_num_primes;
diff --git a/Utilities/KWSys/vtksys/kwsysPlatformTestsCXX.cxx b/Utilities/KWSys/vtksys/kwsysPlatformTestsCXX.cxx
index 8a1ee38..ca96b0e 100644
--- a/Utilities/KWSys/vtksys/kwsysPlatformTestsCXX.cxx
+++ b/Utilities/KWSys/vtksys/kwsysPlatformTestsCXX.cxx
@@ -548,10 +548,6 @@ int main()
 #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE)
 # define _GNU_SOURCE
 #endif
-#if defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5130 \
-     && __linux && __SUNPRO_CC_COMPAT == 'G'
-#  include <iostream>
-#endif
 #include <cxxabi.h>
 int main()
 {
diff --git a/Utilities/KWSys/vtksys/testHashSTL.cxx b/Utilities/KWSys/vtksys/testHashSTL.cxx
index ac5cf74..b861a5b 100644
--- a/Utilities/KWSys/vtksys/testHashSTL.cxx
+++ b/Utilities/KWSys/vtksys/testHashSTL.cxx
@@ -34,7 +34,7 @@
 template class kwsys::hash_map<const char*, int>;
 template class kwsys::hash_set<int>;
 
-static bool test_hash_map()
+bool test_hash_map()
 {
   typedef kwsys::hash_map<const char*, int> mtype;
   mtype m;
@@ -51,7 +51,7 @@ static bool test_hash_map()
   return sum == 3;
 }
 
-static bool test_hash_set()
+bool test_hash_set()
 {
   typedef kwsys::hash_set<int> stype;
   stype s;
diff --git a/Utilities/Maintenance/VTKTestsByLanguage.py b/Utilities/Maintenance/VTKTestsByLanguage.py
deleted file mode 100755
index ee60580..0000000
--- a/Utilities/Maintenance/VTKTestsByLanguage.py
+++ /dev/null
@@ -1,464 +0,0 @@
-#!/usr/bin/env python
-'''
-This program takes one mandatory parameter, the VTK base folder, and up to
- four optional parameters corresponding to the names of the testing language
- subfolders, e.g Cxx, Python, Tcl and, possibly, an optional print option along
- with some other optional options.
-
-If no optional parameters are given, then some statistics about the number
- of tests are provided. These statistics are also displayed when optional
- parameters are provided.
-
-Optional parameters are one or more of: Tcl, Cxx or Python.
-
-If one optional parameter e.g Python, is provided, then a list of the tests
- by folder for that parameter are given if the print option is specified.
-
-If two optional parameters, e.g Tcl Python, are provided, then a list
- of the tests by folder corresponding to those tests that are in Tcl but
- not Python is provided if the print option is specified.
-
-If three optional parameters, e.g Tcl Cxx Python, are provided, then a list
- of the tests by folder corresponding to those tests that are in Tcl but
- not Cxx or Python is provided if the print option is specified.
-
-These are the additional options:
-  -e: include only those tests enabled in the CMakeLists.txt file.
-  -d: include only those tests disabled in the CMakeLists.txt file.
-  -n: include only those tests not in the CMakeLists.txt file.
-  The above are mutually exclusive.
-  -p Print out a list of files.
-
-  Some examples of typical usage:
-  <program file Name> <path to VTK> Tcl Python Cxx
-  <program file Name> <path to VTK> Tcl Python Cxx -p
-  <program file Name> <path to VTK> Tcl -n -p
-  <program file Name> <path to VTK> -d -p
-
-'''
-
-from __future__ import absolute_import
-from __future__ import division
-from __future__ import print_function
-from __future__ import unicode_literals
-
-import sys
-import os
-import re
-import errno
-import shutil
-from collections import defaultdict
-import string
-import copy
-import argparse
-
-class FindTests(object):
-    '''
-    Search through the VTK folder and create a dictionary of all the tests.
-    Only the Testing folder's subdirectories: Cxx, Python and Tcl are searched.
-    '''
-    def __init__(self, inputPath):
-        self.patterns = {'Cxx': re.compile(r'(^.*Testing)(\/Cxx)(.?|\/)$'),
-                         'Python': re.compile(
-                                        r'(^.*Testing)(\/Python)(.?|\/)$'),
-                         'Tcl': re.compile(r'(^.*Testing)(\/Tcl)(.?|\/)$')}
-
-        self.inputPath = inputPath
-
-        # Dictionary of test names keyed by type e.g Python
-        self.tests = dict()
-        for key in self.patterns:
-            self.tests[key] = defaultdict(set)
-        self.fileExtensions = dict()
-        for key in self.patterns:
-            self.fileExtensions[key] = key.lower()
-        self.fileExtensions['Python'] = 'py'
-        # Used to validate input.
-        self.keys = {'cpp': 'Cxx', 'cxx': 'Cxx', 'c++': 'Cxx',
-                      'python': 'Python', 'tcl': 'Tcl'}
-
-    def ParseCMakeFile(self, dir):
-        '''
-        Parse the CMakeLists.txt file as best we can by eliminating spurious
-         lines and return two strings that can be searched for
-         programs/scripts.
-
-         The approach here is to just partition the file into two strings,
-          one containing comments and the other the non-comment lines.
-
-        :param: dir - the directory
-        :return: a pair of strings containing the enabled programs/scripts and
-                commented out programs/scripts.
-        '''
-        filePath = os.path.abspath(os.path.join(dir, 'CMakeLists.txt'))
-        if not os.path.exists(filePath):
-            return None, None
-        fh = open(filePath, 'rb')
-        nonComments = []
-        comments = []
-        for line in fh:
-            # convert bytes to a string.
-            line = line.strip().decode()
-            if not line:
-                continue
-            if line[0] == '#':
-                if len(line) > 1:
-                    comments.append(line[1:])
-                    continue
-            if line:
-                nonComments.append(line)
-        # Remove duplicates.
-        nonComments = set(nonComments)
-        comments = set(comments)
-        return '\n'.join(nonComments), '\n'.join(comments)
-#        return '\n'.join(map(str, nonComments)), '\n'.join(map(str, comments))
-
-    def AddValue(self, fn, key, v):
-        '''
-        :param: fn - the dictionary
-        :param: key - the key
-        :param: v - the value to add to the set of values in fn[key].
-        '''
-        try:
-            values = fn[key]
-            values.add(v)
-            fn[key] = values
-        except KeyError:
-            # Key is not present
-            fn[key] = set([v])
-
-    def WalkPaths(self, option=0):
-        """
-        Walk the paths producing a dictionary keyed by the testing
-         subdirectory type e.g Cxx, whose value is dictionary keyed by
-         relative path
-         whose value is a set of all the programs in that particular path.
-
-        :param: option - This relates to the CMakeLists.txt file.
-                         If 1: only enabled programs/scripts are selected,
-                            2: only disabled programs/scripts are selected,
-                            3: only programs/scripts not in CMakeLists.txt
-                                 are selected.
-                         Any other value - all programs/scripts are selected.
-        """
-        for root, dirs, files in os.walk(self.inputPath, topdown=True):
-            for key in self.patterns:
-                # Need to do this for Windows.
-                r = root.replace('\\', '/')
-                match = re.search(self.patterns[key], r)
-                if match:
-                    newKey = match.group(1)
-                    if option > 0 and option < 4:
-                        nonComments, comments = self.ParseCMakeFile(root)
-                    for name in files:
-                        fn = os.path.splitext(name)[0]
-                        if option == 1:
-                            if nonComments:
-                                if fn in nonComments:
-                                    if name.lower().endswith(
-                                            self.fileExtensions[key]):
-                                        self.AddValue(
-                                            self.tests[key], newKey, fn)
-                        elif option == 2:
-                            if comments:
-                                if fn in comments:
-                                    if name.lower().endswith(
-                                            self.fileExtensions[key]):
-                                        self.AddValue(
-                                            self.tests[key], newKey, fn)
-                        elif option == 3:
-                            s = None
-                            if comments and nonComments:
-                                s = comments + nonComments
-                            elif comments:
-                                s = comments
-                            else:
-                                s = nonComments
-                            if s:
-                                if not(fn in s):
-                                    if name.lower().endswith(
-                                            self.fileExtensions[key]):
-                                        self.AddValue(self.tests[key],
-                                                         newKey, fn)
-                        else:
-                            if name.lower().endswith(self.fileExtensions[key]):
-                                self.AddValue(self.tests[key], newKey, fn)
-
-    def Difference(self, a, b):
-        '''
-        :param: a - A dictionary of values.
-        :param: b - A dictionary of values.
-        :return: A dictionary where the values are the differences of the
-                 values in a and b for each key.
-        '''
-        c = defaultdict(set)
-        for key in a:
-            if key in b:
-                setDifference = a[key] - b[key]
-                if setDifference:
-                    for fn in setDifference:
-                        try:
-                            values = c[key]
-                            values.add(fn)
-                            c[key] = values
-                        except KeyError:
-                            # Key is not present
-                            c[key] = set([fn])
-            else:
-                for fn in a[key]:
-                    try:
-                        values = c[key]
-                        values.add(fn)
-                        c[key] = values
-                    except KeyError:
-                        # Key is not present
-                        c[key] = set([fn])
-        return c
-
-    def Union(self, a, b):
-        '''
-        :param: a - A dictionary of values.
-        :param: b - A dictionary of values.
-        :return: A dictionary of where the values are the union of the
-                 values in a and b for each key.
-        '''
-        c = copy.deepcopy(a)
-        for key in b:
-            if key in a:
-                setUnion = c[key] | b[key]
-            else:
-                setUnion = b[key]
-            if setUnion:
-                for fn in setUnion:
-                    newKey = key
-                    try:
-                        values = c[newKey]
-                        values.add(fn)
-                        c[newKey] = values
-                    except KeyError:
-                        # Key is not present
-                        c[newKey] = set([fn])
-        return c
-
-    def GetTotalNumberOfItems(self, a):
-        '''
-        :param: a - the dictionary.
-        :return: The sum of all the elements in each value in the dictionary.
-        '''
-        numberOfItems = 0;
-        for key in a:
-            numberOfItems += len(a[key])
-        return numberOfItems
-
-    def NumberOfTestsByLanguage(self, tl):
-        '''
-        :param: tl - the language, e.g. Cxx, Python or Tcl.
-        :return: The sum of all the elements in the dictionary for that language.
-        '''
-        return self.GetTotalNumberOfItems(self.tests[tl])
-
-    def NumberOfUniqueTestsByLanguage(self, tl1, tl2, tl3):
-        '''
-        :param: tl - the language, e.g. Cxx, Python or Tcl.
-        :param: t2 - the language, e.g. Cxx, Python or Tcl.
-        :param: t3 - the language, e.g. Cxx, Python or Tcl.
-        :return: The sum of all the elements in the dictionary for
-                  the language tl1 that are unique.
-        '''
-        x = self.InANotBOrC(tl1, tl2, tl3)
-        return self.GetTotalNumberOfItems(x)
-
-    def InANotB(self, a, b):
-        '''
-        :param: a - The key for the first dictionary.
-        :param: b - The key for the second dictionary.
-        :return: d[a] - d[b], where d is a dictionary.
-        '''
-        try:
-            v1 = self.tests[self.keys[a.lower()]]
-            v2 = self.tests[self.keys[b.lower()]]
-            return self.Difference(v1, v2)
-        except:
-            return None
-
-    def InANotBOrC(self, a, b, c):
-        '''
-        :param: a - The key for the first dictionary.
-        :param: b - The key for the second dictionary.
-        :return: d[a] - (d[b] + d[c]), where d is a dictionary.
-        '''
-        try:
-            v1 = self.tests[self.keys[a.lower()]]
-            v2 = self.tests[self.keys[b.lower()]]
-            v3 = self.tests[self.keys[c.lower()]]
-            u = self.Union(v2, v3)
-            return self.Difference(v1, u)
-        except:
-            return None
-
-    def MakeSorted(self, d, s=None):
-        '''
-        :param: d - The dictionary.
-        :param: s the string to append to the key.
-        :return: A string containing a sorted list of the keys and values.
-        '''
-        l = list()
-        for key, value in sorted(d.items()):
-            if s:
-                l.append(key + '/' + s)
-            else:
-                l.append(key)
-            for v in sorted(value):
-                if s:
-                    l.append('  {:s}'.format(v))
-                else:
-                    l.append('  {:s}'.format(v))
-        return '\n'.join(l)
-
-def GetProgramParameters():
-    description = 'Review the testing programs and scripts in VTK.'
-    epilogue = '''
-        This program produces statistics about the number of tests in VTK.
-        It can also list programs/scripts that are in one language but not
-         in other languages.
-    '''
-    parser = argparse.ArgumentParser(description=description, epilog=epilogue)
-    parser.add_argument('inputPath',
-        help='The path to the VTK source folder.', action='store')
-    parser.add_argument('a',
-        help='Tests in this folder e.g. one of Cxx, Python, Tcl.',
-        nargs='?', default=None, action='store')
-    parser.add_argument('b',
-        help='Exclude tests in this folder e.g. one of Cxx, Python, Tcl.',
-        nargs='?', default=None, action='store')
-    parser.add_argument('c',
-        help='Exclude tests in this folder e.g. one of Cxx, Python, Tcl.',
-        nargs='?', default=None, action='store')
-    group = parser.add_mutually_exclusive_group()
-    group.add_argument('-e', '--enabled',
-        help='Tests enabled as determined by the CMakeLists.txt file.',
-        action='store_true')
-    group.add_argument('-d', '--disabled',
-        help='Tests disabled as determined by the CMakeLists.txt file.',
-        action='store_true')
-    group.add_argument('-n', '--notIn',
-        help='Tests not in the CMakeLists.txt file.',
-        action='store_true')
-    group1 = parser.add_argument_group()
-    group1.add_argument('-p', '--printFileNames',
-        help='Print the filenames sorted by folder.',
-        action='store_true')
-    args = parser.parse_args()
-    return args.inputPath, \
-            [args.a, args.b, args.c, args.enabled, args.disabled,
-             args.notIn, args.printFileNames]
-
-def CheckPythonVersion(ver):
-    '''
-    Check the Python version.
-
-    :param: ver - the minimum required version number as hexadecimal.
-    :return: True if if the Python version is greater than or equal to ver.
-    '''
-    if sys.hexversion < ver:
-        return False
-    return True
-
-def main():
-    if not CheckPythonVersion(0x02070000):
-        print('This program requires Python 2.7 or greater.')
-        return
-
-    Ok = True
-
-    inputPath, opts = GetProgramParameters()
-    if not(os.path.exists(inputPath) and os.path.isdir(inputPath)):
-        print(
-    'Input path: {:s}\n should be the VTK top-level folder.'.format(inputPath))
-        Ok = False
-
-    tests = FindTests(inputPath)
-
-    # An index for the number of languages selected.
-    select = 0
-    idx = 0
-    for v in opts[:3]:
-        if v:
-            if not v.lower() in tests.keys:
-                print('Invalid value: ', v)
-                Ok = False
-            else:
-                opts[idx] = tests.keys[v.lower()]
-                select += 1
-        idx += 1
-    if not Ok:
-        return
-
-    testOptions = 0
-    testType = 'All tests'
-    if opts[3]:
-        testOptions = 1
-        testType = 'Enabled tests'
-    if opts[4]:
-        testOptions = 2
-        estType = 'Disabled tests'
-    if opts[5]:
-        testOptions = 3
-        testType = 'Not in CmakeLists.txt'
-
-    tests.WalkPaths(testOptions)
-
-    c = tests.NumberOfTestsByLanguage('Cxx')
-    ce = tests.NumberOfUniqueTestsByLanguage('Cxx', 'Python', 'Tcl')
-    p = tests.NumberOfTestsByLanguage('Python')
-    pe = tests.NumberOfUniqueTestsByLanguage('Python', 'Cxx', 'Tcl')
-    t = tests.NumberOfTestsByLanguage('Tcl')
-    te = tests.NumberOfUniqueTestsByLanguage('Tcl', 'Cxx', 'Python')
-
-    print('-' * 40)
-    print(testType + '.')
-    print('-' * 40)
-    print('{:32s}:{:6d}'.format('Unique Cxx tests', ce))
-    print('{:32s}:{:6d}'.format('Total number of Cxx tests', c))
-    print('-' * 40)
-    print('{:32s}:{:6d}'.format('Unique Python tests', pe))
-    print('{:32s}:{:6d}'.format('Total number of Python tests', p))
-    print('-' * 40)
-    print('{:32s}:{:6d}'.format('Unique Tcl tests', te))
-    print('{:32s}:{:6d}'.format('Total number of Tcl tests', t))
-    print('-' * 40)
-    print('{:32s}:{:6d}'.format('Total number of unique tests', ce + pe + te))
-    print('{:32s}:{:6d}'.format('Total number of tests', c + p + t))
-    print('-' * 40)
-    if opts[6]:  # Print the filenames.
-        if testOptions >= 0 and testOptions < 4:
-            if select > 0:
-                if select == 1:
-                    print('In {:s}.'.format(opts[0]))
-                    print('-' * 40)
-                    print(tests.MakeSorted(tests.tests[opts[0]], opts[0]))
-                elif select == 2:
-                    inANotB = tests.InANotB(opts[0], opts[1])
-                    if inANotB:
-                        print('In {:s} but not in {:s}.'.format(
-                                opts[0], opts[1]))
-                        print('-' * 40)
-                        print(tests.MakeSorted(inANotB, opts[0]))
-                elif select == 3:
-                    inANotBOrCOrCxx = tests.InANotBOrC(opts[0],
-                                                        opts[1], opts[2])
-                    if inANotBOrCOrCxx:
-                        print('In {:s} but not in {:s} or {:s}.'.format(
-                                opts[0], opts[1], opts[2]))
-                        print('-' * 40)
-                        print(tests.MakeSorted(inANotBOrCOrCxx, opts[0]))
-            else:
-                for k in sorted(tests.tests.keys()):
-                    print('-' * 40)
-                    print(tests.MakeSorted(tests.tests[k], k))
-            print('-' * 40)
-
-    return Ok
-
-if __name__ == '__main__':
-    main()
diff --git a/Utilities/Maintenance/WhatModulesVTK.py b/Utilities/Maintenance/WhatModulesVTK.py
index 99c7c8a..b5e7888 100755
--- a/Utilities/Maintenance/WhatModulesVTK.py
+++ b/Utilities/Maintenance/WhatModulesVTK.py
@@ -2,9 +2,7 @@
 import os, sys
 import re
 
-RENDERING_BACKENDS = ['OpenGL', 'OpenGL2']
-
-def displayHelp():
+if len(sys.argv) != 3:
     print """
 Usage: WhatModulesVTK.py vtkSourceTree applicationFile|applicationFolder
   Generate a FindPackage(VTK COMPONENTS) that lists all modules
@@ -66,22 +64,7 @@ Usage: WhatModulesVTK.py vtkSourceTree applicationFile|applicationFolder
 """
     exit(0)
 
-def EndsWithBackendName(moduleName):
-    '''
-    Return ``True`` if ``moduleName`` ends with any of the RENDERING_BACKENDS.
-    '''
-    for backend in RENDERING_BACKENDS:
-        if moduleName.endswith(backend):
-            return True
-    return False
-
-def ExcludeModuleName(moduleName, renderingBackend):
-   '''
-   Return ``True`` if ``moduleName`` should not be considered.
-   '''
-   return EndsWithBackendName(moduleName) and not moduleName.endswith(renderingBackend)
-
-def IncludesToPaths(path, renderingBackend='OpenGL'):
+def IncludesToPaths(path):
     '''
     Build a dict that maps include files to paths.
     '''
@@ -93,12 +76,10 @@ def IncludesToPaths(path, renderingBackend='OpenGL'):
                 includeFile = prog.findall(f)[0]
                 parts = root.split("/")
                 module = parts[len(parts)-2] + parts[len(parts)-1]
-                if ExcludeModuleName(module, renderingBackend):
-                    continue
                 includeToPath[includeFile] = module
     return includeToPath
 
-def FindModules(path, renderingBackend='OpenGL'):
+def FindModules(path):
     '''
     Build a dict that maps paths to modules.
     '''
@@ -113,8 +94,6 @@ def FindModules(path, renderingBackend='OpenGL'):
                 m = moduleProg.match(contents)
                 if m:
                     moduleName = m.group(1)
-                    if ExcludeModuleName(moduleName, renderingBackend):
-                        continue
                     parts = root.split("/")
                     pathToModule[parts[len(parts)-2] + parts[len(parts)-1]] = moduleName
                 fid.close()
@@ -133,18 +112,17 @@ def FindIncludes(path):
     fid.close()
     return includes
 
-def FindModuleFiles(path, renderingBackend='OpenGL'):
+def FindModuleFiles(path):
     '''
     Get a list of module files in the VTK directory.
     '''
     moduleFiles = [os.path.join(root, name)
                  for root, dirs, files in os.walk(path)
                  for name in files
-                 if name == ("module.cmake")
-                 and not ExcludeModuleName(name, renderingBackend)]
+                 if name == ("module.cmake")]
     return moduleFiles
 
-def ParseModuleFile(fileName, renderingBackend='OpenGL'):
+def ParseModuleFile(fileName):
     '''
     Read each module file returning the module name and what
     it depends on or implements.
@@ -182,7 +160,6 @@ def ParseModuleFile(fileName, renderingBackend='OpenGL'):
             state = item
             continue
         if state == 'DEPENDS' and item !=  ')':
-            item = item.replace("${VTK_RENDERING_BACKEND}", renderingBackend)
             depends.append(item)
             continue
         if state == 'IMPLEMENTS' and item !=  ')':
@@ -223,33 +200,34 @@ def MakeFindPackage(modules):
     res +=  ")"
     return res
 
-from pprint import pprint as pp
-
-def main(vtkSourceDir, sourceFiles, renderingBackend='OpenGL'):
+def main():
     '''
     Start the program
     '''
     # Generate dict's for mapping includes to modules
-    includesToPaths = IncludesToPaths(vtkSourceDir + "/", renderingBackend)
-    pathsToModules = FindModules(vtkSourceDir + "/", renderingBackend)
+    includesToPaths = IncludesToPaths(sys.argv[1] + "/")
+    pathsToModules = FindModules(sys.argv[1] + "/")
 
     # Test to see if VTK source is provided
     if len(pathsToModules) == 0:
-        raise IOError, vtkSourceDir +\
+        print sys.argv[1] +\
         " is not a VTK source directory. It does not contain any module.cmake files."
+        exit(1)
 
     # Parse the module files making a dictionary of each module and its
     # dependencies or what it implements.
     moduleDepencencies = dict()
-    moduleFiles = FindModuleFiles(vtkSourceDir + "/", renderingBackend)
-
+    moduleFiles = FindModuleFiles(sys.argv[1] + "/")
     for fname in moduleFiles:
-        m = ParseModuleFile(fname, renderingBackend)
+        m = ParseModuleFile(fname)
         moduleDepencencies[m[0]] = m[1]
 
     # Build a set of includes for all command line files
     allIncludes = set()
-    for f in sourceFiles:
+    program = sys.argv[0]
+    sys.argv.pop(0) # remove program name
+    sys.argv.pop(0) # remove vtk source tree
+    for f in sys.argv:
         if os.path.isfile(f):
             allIncludes.update(FindIncludes(f))
         else:
@@ -258,7 +236,8 @@ def main(vtkSourceDir, sourceFiles, renderingBackend='OpenGL'):
                 for fn in files:
                     allIncludes.update(FindIncludes(os.path.join(path,fn)))
     if len(allIncludes) == 0:
-        raise IOError, f + " does not exist"
+        print program + ": " + f + " does not exist"
+        exit(1)
 
     # Build a set that contains all modules referenced in command line files
     allModules = set()
@@ -275,10 +254,11 @@ def main(vtkSourceDir, sourceFiles, renderingBackend='OpenGL'):
     # Add OpenGL factory classes if required.
     if "vtkRenderingFreeType" in allModules:
         allModules.add("vtkRenderingFreeTypeFontConfig")
+        allModules.add("vtkRenderingFreeTypeOpenGL")
     if "vtkRenderingCore" in allModules:
-        allModules.add("vtkRendering%s" % renderingBackend)
+        allModules.add("vtkRenderingOpenGL")
     if "vtkRenderingVolume" in allModules:
-        allModules.add("vtkRenderingVolume%s" % renderingBackend)
+        allModules.add("vtkRenderingVolumeOpenGL")
 
     # Find the minimal set of modules.
     minimalSetOfModules =\
@@ -299,7 +279,4 @@ def main(vtkSourceDir, sourceFiles, renderingBackend='OpenGL'):
     print
 
 if __name__ == '__main__':
-    if len(sys.argv) != 3:
-      displayHelp()
-      exit(0)
-    main(sys.argv[1], sys.argv[2:])
+    main()
diff --git a/Utilities/Maintenance/semanticDiffVersion.py b/Utilities/Maintenance/semanticDiffVersion.py
index 0a5e7e2..babfcdc 100755
--- a/Utilities/Maintenance/semanticDiffVersion.py
+++ b/Utilities/Maintenance/semanticDiffVersion.py
@@ -20,7 +20,7 @@ import tempfile
 try:
     import argparse
 except ImportError:
-    from vtk.util import _argparse as argparse
+    import _argparse as argparse
 
 tagMatcherType = re.compile('^(.+)\t(\S+)\t/\^(.*)\$/;"\t(.*)\n')
 
diff --git a/Utilities/MetaIO/vtkmetaio/metaBlob.cxx b/Utilities/MetaIO/vtkmetaio/metaBlob.cxx
index fba6775..461e922 100644
--- a/Utilities/MetaIO/vtkmetaio/metaBlob.cxx
+++ b/Utilities/MetaIO/vtkmetaio/metaBlob.cxx
@@ -45,7 +45,7 @@ BlobPnt::
 ~BlobPnt()
 {
   delete []m_X;
-}
+};
 
 //
 // MedImage Constructors
diff --git a/Utilities/MetaIO/vtkmetaio/metaCommand.cxx b/Utilities/MetaIO/vtkmetaio/metaCommand.cxx
index 8bff830..1fef556 100644
--- a/Utilities/MetaIO/vtkmetaio/metaCommand.cxx
+++ b/Utilities/MetaIO/vtkmetaio/metaCommand.cxx
@@ -1876,7 +1876,7 @@ bool MetaCommand::Parse(int argc, char* argv[])
             char optName[255];
             for(unsigned int j=0; j<valuesInList; j++)
               {
-              sprintf(optName, "%03u", j);
+              sprintf(optName, "%03d", j);
               this->AddOptionField( m_OptionVector[currentOption].name,
                                     optName, STRING );
               }
@@ -2172,7 +2172,6 @@ METAIO_STL::string MetaCommand::TypeToString(TypeEnumType type)
       return "file";
     case ENUM:
       return "enum";
-    case CHAR:
     default:
       return "not defined";
     }
diff --git a/Utilities/MetaIO/vtkmetaio/metaContour.h b/Utilities/MetaIO/vtkmetaio/metaContour.h
index 92b4ce1..83a6ded 100644
--- a/Utilities/MetaIO/vtkmetaio/metaContour.h
+++ b/Utilities/MetaIO/vtkmetaio/metaContour.h
@@ -72,7 +72,7 @@ public:
   ~ContourInterpolatedPnt()
     {
     delete []m_X;
-    }
+    };
 
   unsigned int m_Dim;
   float* m_X;
diff --git a/Utilities/MetaIO/vtkmetaio/metaDTITube.cxx b/Utilities/MetaIO/vtkmetaio/metaDTITube.cxx
index 491693e..0055df9 100644
--- a/Utilities/MetaIO/vtkmetaio/metaDTITube.cxx
+++ b/Utilities/MetaIO/vtkmetaio/metaDTITube.cxx
@@ -476,7 +476,6 @@ M_Read(void)
                 << METAIO_STREAM::endl;
       METAIO_STREAM::cout << "   ideal = " << readSize
                 << " : actual = " << gc << METAIO_STREAM::endl;
-      delete [] _data;
       return false;
       }
 
diff --git a/Utilities/MetaIO/vtkmetaio/metaEvent.h b/Utilities/MetaIO/vtkmetaio/metaEvent.h
index 0f2f814..91b90c3 100644
--- a/Utilities/MetaIO/vtkmetaio/metaEvent.h
+++ b/Utilities/MetaIO/vtkmetaio/metaEvent.h
@@ -35,19 +35,19 @@ class METAIO_EXPORT MetaEvent
 
 public:
 
-  MetaEvent(){m_Level = -1;}
-  virtual ~MetaEvent(){}
+  MetaEvent(){m_Level = -1;};
+  virtual ~MetaEvent(){};
 
   virtual void SetCurrentIteration(unsigned int n) {m_CurrentIteration = n;}
   virtual void StartReading(unsigned int n)
     {
     m_NumberOfIterations = n;
     m_Level++;
-    }
+    };
   virtual void StopReading()
     {
     m_Level--;
-    }
+    };
 
 protected:
 
diff --git a/Utilities/MetaIO/vtkmetaio/metaImageUtils.cxx b/Utilities/MetaIO/vtkmetaio/metaImageUtils.cxx
index 8a07e51..48189f5 100644
--- a/Utilities/MetaIO/vtkmetaio/metaImageUtils.cxx
+++ b/Utilities/MetaIO/vtkmetaio/metaImageUtils.cxx
@@ -17,7 +17,7 @@
 #endif
 
 
-#include "metaImageUtils.h"
+#include "metaImageTypes.h"
 #include <string.h>
 
 #if (METAIO_USE_NAMESPACE)
diff --git a/Utilities/MetaIO/vtkmetaio/metaLandmark.cxx b/Utilities/MetaIO/vtkmetaio/metaLandmark.cxx
index b718519..3ef0a2e 100644
--- a/Utilities/MetaIO/vtkmetaio/metaLandmark.cxx
+++ b/Utilities/MetaIO/vtkmetaio/metaLandmark.cxx
@@ -45,7 +45,7 @@ LandmarkPnt::
 ~LandmarkPnt()
 {
   delete []m_X;
-}
+};
 
 //
 // MedImage Constructors
@@ -340,7 +340,6 @@ M_Read(void)
                 << METAIO_STREAM::endl;
       METAIO_STREAM::cout << "   ideal = " << readSize << " : actual = " << gc << METAIO_STREAM::endl;
       delete [] _data;
-      delete [] posDim;
       return false;
     }
 
diff --git a/Utilities/MetaIO/vtkmetaio/metaMesh.cxx b/Utilities/MetaIO/vtkmetaio/metaMesh.cxx
index b9b476c..50199c3 100644
--- a/Utilities/MetaIO/vtkmetaio/metaMesh.cxx
+++ b/Utilities/MetaIO/vtkmetaio/metaMesh.cxx
@@ -1053,7 +1053,6 @@ M_Read(void)
               << METAIO_STREAM::endl;
     METAIO_STREAM::cout << "   ideal = " << cellDataSize << " : actual = " << gcCell << METAIO_STREAM::endl;
     delete [] _data;
-    delete [] _celldata;
     return false;
     }
 
diff --git a/Utilities/MetaIO/vtkmetaio/metaMesh.h b/Utilities/MetaIO/vtkmetaio/metaMesh.h
index 9e03e31..eca0681 100644
--- a/Utilities/MetaIO/vtkmetaio/metaMesh.h
+++ b/Utilities/MetaIO/vtkmetaio/metaMesh.h
@@ -105,7 +105,7 @@ public:
     }
   ~MeshCellLink()
     {
-    }
+    };
 
   int m_Id; // id of the cell link
   METAIO_STL::list<int> m_Links;
@@ -122,7 +122,7 @@ public:
     }
   virtual ~MeshDataBase()
     {
-    }
+    };
 
   virtual void Write( METAIO_STREAM::ofstream* stream) = 0;
   virtual unsigned int GetSize(void) = 0;
@@ -143,7 +143,7 @@ class METAIO_EXPORT MeshData : public MeshDataBase
 public:
 
   MeshData() {m_Id=-1;}
-  ~MeshData() {}
+  ~MeshData() {};
 
   virtual MET_ValueEnumType GetMetaType()
     {
diff --git a/Utilities/MetaIO/vtkmetaio/metaOutput.cxx b/Utilities/MetaIO/vtkmetaio/metaOutput.cxx
index 4523c82..96d390b 100644
--- a/Utilities/MetaIO/vtkmetaio/metaOutput.cxx
+++ b/Utilities/MetaIO/vtkmetaio/metaOutput.cxx
@@ -386,7 +386,6 @@ METAIO_STL::string MetaOutput::TypeToString(TypeEnumType type)
       return "flag";
     case BOOL:
       return "boolean";
-    case CHAR:
     default:
       return "not defined";
     }
@@ -495,7 +494,7 @@ METAIO_STL::string MetaOutput::GenerateXML(const char* filename)
       if((*itOutput).value.size()>1)
         {
         char* val = new char[10];
-        sprintf(val,"%u",index);
+        sprintf(val,"%d",index);
         buffer += val;
         delete [] val;
         }
@@ -577,7 +576,7 @@ void MetaOutput::Write()
     FieldVector::const_iterator itEnd = m_FieldVector.end();
     while(it != itEnd)
       {
-      if(dynamic_cast<MetaFileOutputStream*>(*itStream))
+      if(typeid(*(*itStream)) == typeid(MetaFileOutputStream))
         {
         METAIO_STL::string filename = ((MetaFileOutputStream*)(*itStream))
                                       ->GetFileName().c_str();
diff --git a/Utilities/MetaIO/vtkmetaio/metaOutput.h b/Utilities/MetaIO/vtkmetaio/metaOutput.h
index 2691fcc..0886ed3 100644
--- a/Utilities/MetaIO/vtkmetaio/metaOutput.h
+++ b/Utilities/MetaIO/vtkmetaio/metaOutput.h
@@ -11,8 +11,8 @@
 ============================================================================*/
 #include "metaTypes.h"
 
-#ifndef metaOutput_h
-#define metaOutput_h
+#ifndef __MetaOutput_H_
+#define __MetaOutput_H_
 
 #ifdef _MSC_VER
 #pragma warning ( disable : 4786 )
@@ -34,7 +34,7 @@ class MetaOutputStream
   public:
 
     MetaOutputStream();
-    virtual ~MetaOutputStream() {}
+    virtual ~MetaOutputStream() {};
 
     void                     SetName(const char* name);
     METAIO_STL::string       GetName() const;
@@ -70,7 +70,7 @@ class MetaFileOutputStream : public MetaOutputStream
   public:
 
     MetaFileOutputStream(const char* name);
-    virtual ~MetaFileOutputStream() {}
+    virtual ~MetaFileOutputStream() {};
 
     bool Open();
     bool Close();
diff --git a/Utilities/MetaIO/vtkmetaio/metaTubeGraph.h b/Utilities/MetaIO/vtkmetaio/metaTubeGraph.h
index 4ddb793..4875fb6 100644
--- a/Utilities/MetaIO/vtkmetaio/metaTubeGraph.h
+++ b/Utilities/MetaIO/vtkmetaio/metaTubeGraph.h
@@ -54,7 +54,7 @@ public:
   ~TubeGraphPnt()
   {
     delete [] m_T;
-  }
+  };
 
   unsigned int m_Dim;
   int    m_GraphNode;
diff --git a/Utilities/MetaIO/vtkmetaio/metaUtils.cxx b/Utilities/MetaIO/vtkmetaio/metaUtils.cxx
index 01b67e5..beb0bd2 100644
--- a/Utilities/MetaIO/vtkmetaio/metaUtils.cxx
+++ b/Utilities/MetaIO/vtkmetaio/metaUtils.cxx
@@ -317,8 +317,6 @@ bool MET_ValueToDouble(MET_ValueEnumType _type, const void *_data,
     case MET_STRING:
       *_value = atof(&(((const MET_CHAR_TYPE *)_data)[_index]));
       return true;
-    case MET_NONE:
-    case MET_OTHER:
     default:
       *_value = 0;
       return false;
@@ -385,8 +383,6 @@ bool MET_DoubleToValue(double _value,
     case MET_STRING:
       sprintf(&(((MET_CHAR_TYPE *)_data)[_index]), "%f", _value);
       return true;
-    case MET_NONE:
-    case MET_OTHER:
     default:
       return false;
     }
@@ -467,8 +463,6 @@ bool MET_ValueToValue(MET_ValueEnumType _fromType, const void *_fromData,
     case MET_STRING:
       sprintf(&(((MET_CHAR_TYPE *)_toData)[_index]), "%f", tf);
       return true;
-    case MET_NONE:
-    case MET_OTHER:
     default:
       return false;
     }
@@ -1679,8 +1673,6 @@ bool MET_WriteFieldToFile(METAIO_STREAM::ostream & _fp, const char *_fieldName,
         f.value[i] = (double)((const MET_FLOAT_TYPE *)_v)[i];
         }
       break;
-    case MET_NONE:
-    case MET_OTHER:
     default:
       break;
     }
diff --git a/Utilities/MetaIO/vtkmetaio/tests/CMakeLists.txt b/Utilities/MetaIO/vtkmetaio/tests/CMakeLists.txt
new file mode 100644
index 0000000..cd8f4b9
--- /dev/null
+++ b/Utilities/MetaIO/vtkmetaio/tests/CMakeLists.txt
@@ -0,0 +1,47 @@
+SET( testMeta1Utils_SRCS testMeta1Utils.cxx )
+ADD_EXECUTABLE( testMeta1Utils ${testMeta1Utils_SRCS} )
+TARGET_LINK_LIBRARIES( testMeta1Utils ${METAIO_NAMESPACE} ${ZLIB_LIBRARIES})
+
+SET( testMeta2Object_SRCS testMeta2Object.cxx )
+ADD_EXECUTABLE( testMeta2Object ${testMeta2Object_SRCS} )
+TARGET_LINK_LIBRARIES( testMeta2Object ${METAIO_NAMESPACE} ${ZLIB_LIBRARIES})
+
+SET( testMeta3Image_SRCS testMeta3Image.cxx )
+ADD_EXECUTABLE( testMeta3Image ${testMeta3Image_SRCS} )
+TARGET_LINK_LIBRARIES( testMeta3Image ${METAIO_NAMESPACE} ${ZLIB_LIBRARIES})
+
+SET( testMeta4Tube_SRCS testMeta4Tube.cxx )
+ADD_EXECUTABLE( testMeta4Tube ${testMeta4Tube_SRCS} )
+TARGET_LINK_LIBRARIES( testMeta4Tube ${METAIO_NAMESPACE} ${ZLIB_LIBRARIES})
+
+SET( testMeta5Blob_SRCS testMeta5Blob.cxx )
+ADD_EXECUTABLE( testMeta5Blob ${testMeta5Blob_SRCS} )
+TARGET_LINK_LIBRARIES( testMeta5Blob ${METAIO_NAMESPACE} ${ZLIB_LIBRARIES})
+
+SET( testMeta6Surface_SRCS testMeta6Surface.cxx )
+ADD_EXECUTABLE( testMeta6Surface ${testMeta6Surface_SRCS} )
+TARGET_LINK_LIBRARIES( testMeta6Surface ${METAIO_NAMESPACE} ${ZLIB_LIBRARIES})
+
+SET( testMeta7Line_SRCS testMeta7Line.cxx )
+ADD_EXECUTABLE( testMeta7Line ${testMeta7Line_SRCS} )
+TARGET_LINK_LIBRARIES( testMeta7Line ${METAIO_NAMESPACE} ${ZLIB_LIBRARIES})
+
+SET( testMeta8Scene_SRCS testMeta8Scene.cxx )
+ADD_EXECUTABLE( testMeta8Scene ${testMeta8Scene_SRCS} )
+TARGET_LINK_LIBRARIES( testMeta8Scene ${METAIO_NAMESPACE} ${ZLIB_LIBRARIES})
+
+SET( testMeta9Landmark_SRCS testMeta9Landmark.cxx )
+ADD_EXECUTABLE( testMeta9Landmark ${testMeta9Landmark_SRCS} )
+TARGET_LINK_LIBRARIES( testMeta9Landmark ${METAIO_NAMESPACE} ${ZLIB_LIBRARIES})
+
+SET( testMeta10Contour_SRCS testMeta10Contour.cxx )
+ADD_EXECUTABLE( testMeta10Contour ${testMeta10Contour_SRCS} )
+TARGET_LINK_LIBRARIES( testMeta10Contour ${METAIO_NAMESPACE} ${ZLIB_LIBRARIES})
+
+SET( testMeta11Form_SRCS testMeta11Form.cxx )
+ADD_EXECUTABLE( testMeta11Form ${testMeta11Form_SRCS} )
+TARGET_LINK_LIBRARIES( testMeta11Form ${METAIO_NAMESPACE} ${ZLIB_LIBRARIES})
+
+SET( testMeta12Array_SRCS testMeta12Array.cxx )
+ADD_EXECUTABLE( testMeta12Array ${testMeta12Array_SRCS} )
+TARGET_LINK_LIBRARIES( testMeta12Array ${METAIO_NAMESPACE} ${ZLIB_LIBRARIES})
diff --git a/Utilities/MetaIO/vtkmetaio/tests/testMeta10Contour.cxx b/Utilities/MetaIO/vtkmetaio/tests/testMeta10Contour.cxx
new file mode 100644
index 0000000..3e963b6
--- /dev/null
+++ b/Utilities/MetaIO/vtkmetaio/tests/testMeta10Contour.cxx
@@ -0,0 +1,97 @@
+#include <stdio.h>
+#include <ctype.h>
+#include <metaContour.h>
+
+int main(int, char * [])
+{
+  METAIO_STREAM::cout << "Creating test file ..." << METAIO_STREAM::endl;
+  MetaContour Contour(3);
+  Contour.ID(0);
+  Contour.Name("First Contour");
+  ContourControlPnt* pnt;
+
+  METAIO_STREAM::cout << "Allocating points..." << METAIO_STREAM::endl;
+  unsigned int i;
+  for(i=0;i<10;i++)
+  {
+    pnt = new ContourControlPnt(3);
+    pnt->m_Id = i;
+    pnt->m_XPicked[0]=0;
+    pnt->m_XPicked[1]=1;
+    pnt->m_XPicked[2]=2;
+    pnt->m_X[0]=(float)0.2;
+    pnt->m_X[1]=(float)i;
+    pnt->m_X[2]=(float)i;
+    Contour.GetControlPoints().push_back(pnt);
+  }
+
+  Contour.Interpolation(MET_EXPLICIT_INTERPOLATION);
+
+  ContourInterpolatedPnt* pntI;
+  for(i=0;i<5;i++)
+  {
+    pntI = new ContourInterpolatedPnt(3);
+    pntI->m_Id = i;
+    pntI->m_X[0]=(float)0.2;
+    pntI->m_X[1]=(float)i;
+    pntI->m_X[2]=(float)i;
+    Contour.GetInterpolatedPoints().push_back(pntI);
+  }
+
+  METAIO_STREAM::cout << "Writing test file ..." << METAIO_STREAM::endl;
+  Contour.BinaryData(true);
+  Contour.Write("C:/Julien/Contours.meta");
+
+  METAIO_STREAM::cout << "  done" << METAIO_STREAM::endl;
+
+  METAIO_STREAM::cout << "Reading test file ..." << METAIO_STREAM::endl;
+  Contour.Read("C:/Julien/Contours.meta");
+
+  METAIO_STREAM::cout << "  done" << METAIO_STREAM::endl;
+
+  Contour.PrintInfo();
+
+  METAIO_STREAM::cout << "Accessing pointlist..." << METAIO_STREAM::endl;
+
+  MetaContour::ControlPointListType plist =  Contour.GetControlPoints();
+  MetaContour::ControlPointListType::const_iterator it = plist.begin();
+
+  while(it != plist.end())
+  {
+    METAIO_STREAM::cout << (*it)->m_Id << " ";
+    unsigned int d;
+    for(d = 0; d < 3; d++)
+      {
+      METAIO_STREAM::cout << (*it)->m_X[d] << " ";
+      }
+    for(d = 0; d < 3; d++)
+      {
+      METAIO_STREAM::cout << (*it)->m_XPicked[d] << " ";
+      }
+    for(d = 0; d < 3; d++)
+      {
+      METAIO_STREAM::cout << (*it)->m_V[d] << " ";
+      }
+    METAIO_STREAM::cout << METAIO_STREAM::endl;
+    it++;
+  }
+
+
+  MetaContour::InterpolatedPointListType ilist =  Contour.GetInterpolatedPoints();
+  MetaContour::InterpolatedPointListType::const_iterator iti = ilist.begin();
+
+  while(iti != ilist.end())
+    {
+    METAIO_STREAM::cout << (*iti)->m_Id << " ";
+    for(unsigned int d = 0; d < 3; d++)
+      {
+      METAIO_STREAM::cout << (*iti)->m_X[d] << " ";
+      }
+
+    METAIO_STREAM::cout << METAIO_STREAM::endl;
+    iti++;
+    }
+
+  METAIO_STREAM::cout << "done" << METAIO_STREAM::endl;
+  return 0;
+}
diff --git a/Utilities/MetaIO/vtkmetaio/tests/testMeta11Form.cxx b/Utilities/MetaIO/vtkmetaio/tests/testMeta11Form.cxx
new file mode 100644
index 0000000..cb42476
--- /dev/null
+++ b/Utilities/MetaIO/vtkmetaio/tests/testMeta11Form.cxx
@@ -0,0 +1,93 @@
+#include <stdio.h>
+#include <fstream>
+#include <ctype.h>
+
+#include <metaForm.h>
+
+int main(int, char * [])
+  {
+  MetaForm tObj;
+
+  tObj.InitializeEssential();
+  tObj.FileName("testForm.txt");
+  tObj.Comment("TestForm");
+  tObj.FormTypeName("Form");
+
+  // Add user's defined fields
+  int myarray[3];
+  myarray[0]=1;
+  myarray[1]=2;
+  myarray[2]=3;
+  tObj.AddUserField("MyName", MET_STRING, strlen("Julien"), "Julien");
+  tObj.AddUserField("MyArray", MET_INT_ARRAY,3,myarray);
+
+  int i;
+  float myMatrix[4];
+  for(i=0; i<4; i++)
+    {
+    myMatrix[i] = (float)i;
+    }
+  tObj.AddUserField("MyMatrix", MET_FLOAT_MATRIX,2,myMatrix);
+
+  tObj.PrintInfo();
+  tObj.Write();
+
+  tObj.Clear();
+  tObj.ClearUserFields();
+
+  tObj.AddUserField("MyName", MET_STRING, strlen("default"), "default");
+  tObj.AddUserField("MyArray", MET_INT_ARRAY, 3, myarray);
+  tObj.AddUserField("MyMatrix", MET_FLOAT_MATRIX, 2, myMatrix);
+
+  METAIO_STREAM::cout << "Read: " << METAIO_STREAM::endl;
+  tObj.Read();
+  METAIO_STREAM::cout << "PrintInfo: " << METAIO_STREAM::endl;
+  tObj.PrintInfo();
+
+  METAIO_STREAM::cout << "Check fields: " << METAIO_STREAM::endl;
+  char* name = static_cast<char*>(tObj.GetUserField("MyName"));
+  if(!strcmp(name,"Julien"))
+  {
+    METAIO_STREAM::cout << "MyName: FAIL" << METAIO_STREAM::endl;
+    return 0;
+  }
+  METAIO_STREAM::cout << "MyName: " << name << METAIO_STREAM::endl;
+
+  int* array = static_cast<int*>(tObj.GetUserField("MyArray"));
+
+  for(i=0;i<3;i++)
+  {
+    if(array[i] != i+1)
+    {
+      METAIO_STREAM::cout << "MyArray: FAIL" << METAIO_STREAM::endl;
+      return 0;
+    }
+  }
+  METAIO_STREAM::cout << "MyArray: PASS" << METAIO_STREAM::endl;
+
+  float* matrix = static_cast<float*>(tObj.GetUserField("MyMatrix"));
+  for(i=0; i<4; i++)
+  {
+    if(matrix[i] != i)
+    {
+      METAIO_STREAM::cout << "MyMatrix: FAIL" << METAIO_STREAM::endl;
+    }
+  }
+  METAIO_STREAM::cout << "MyMatrix: PASS" << METAIO_STREAM::endl;
+
+  METAIO_STREAM::cout << "PASSED!" << METAIO_STREAM::endl;
+
+  tObj.Clear();
+  tObj.ClearUserFields();
+
+  tObj.FileName("testObject2.txt");
+  tObj.InitializeEssential();
+  tObj.PrintInfo();
+  tObj.Write();
+  tObj.Clear();
+
+  tObj.Read();
+  tObj.PrintInfo();
+
+  return 1;
+  }
diff --git a/Utilities/MetaIO/vtkmetaio/tests/testMeta12Array.cxx b/Utilities/MetaIO/vtkmetaio/tests/testMeta12Array.cxx
new file mode 100644
index 0000000..533f02a
--- /dev/null
+++ b/Utilities/MetaIO/vtkmetaio/tests/testMeta12Array.cxx
@@ -0,0 +1,46 @@
+#include <stdio.h>
+#include <fstream>
+#include <ctype.h>
+
+#include <metaArray.h>
+
+int main(int, char * [])
+  {
+  MetaArray tObj;
+
+  tObj.InitializeEssential(10, MET_DOUBLE, 1, NULL, true);
+  tObj.FileName("testArray.mvh");
+  tObj.Comment("TestArray");
+  tObj.FormTypeName("Array");
+
+  tObj.Length(10);
+  tObj.ElementType(MET_DOUBLE);
+  tObj.BinaryData(false);
+
+  int i;
+  for(i=0; i<10; i++)
+    {
+    tObj.ElementData(i, i*3.1415926);
+    }
+  tObj.PrintInfo();
+  tObj.Write();
+
+  tObj.BinaryData(true);
+  tObj.FileName("testArray.mva");
+  tObj.PrintInfo();
+  tObj.Write();
+
+  MetaArray tObj_ascii, tObj_binary;
+  tObj_ascii.FileName("testArray.mvh");
+  tObj_binary.FileName("testArray.mva");
+
+  tObj_ascii.Read();
+  tObj_binary.Read();
+
+  tObj_ascii.PrintInfo();
+  tObj_binary.PrintInfo();
+
+  METAIO_STREAM::cout << "PASSED!" << METAIO_STREAM::endl;
+
+  return 1;
+  }
diff --git a/Utilities/MetaIO/vtkmetaio/tests/testMeta1Utils.cxx b/Utilities/MetaIO/vtkmetaio/tests/testMeta1Utils.cxx
new file mode 100644
index 0000000..f93502d
--- /dev/null
+++ b/Utilities/MetaIO/vtkmetaio/tests/testMeta1Utils.cxx
@@ -0,0 +1,228 @@
+#include <stdio.h>
+#include <fstream>
+#include <ctype.h>
+
+
+#include <metaUtils.h>
+
+int main(int, char * [])
+  {
+
+  if(MET_SystemByteOrderMSB())
+    {
+    METAIO_STREAM::cout << "MET_SYSTEM_BYTE_ORDER_MSB = TRUE" << METAIO_STREAM::endl;
+    }
+  else
+    {
+    METAIO_STREAM::cout << "MET_SYSTEM_BYTE_ORDER_MSB = FALSE" << METAIO_STREAM::endl;
+    }
+  unsigned short x = 256;
+  METAIO_STREAM::cout << "MET_ByteSwapShort: ";
+  if(MET_ByteOrderSwapShort(x) != 1)
+    METAIO_STREAM::cout << "FAILED: 256->" << MET_ByteOrderSwapShort(x) << METAIO_STREAM::endl;
+  else
+    METAIO_STREAM::cout << "PASSED" << METAIO_STREAM::endl;
+  x = 1;
+  METAIO_STREAM::cout << "MET_ByteSwapShort: ";
+  if(MET_ByteOrderSwapShort(x) != 256)
+    METAIO_STREAM::cout << "FAILED: 1->" << MET_ByteOrderSwapShort(x) << METAIO_STREAM::endl;
+  else
+    METAIO_STREAM::cout << "PASSED" << METAIO_STREAM::endl;
+
+  MET_ValueEnumType metType = MET_USHORT;
+  MET_ValueEnumType tmpMetType = MET_USHORT;
+  char tmpString[80];
+  sprintf(tmpString, "MET_USHORT");
+  METAIO_STREAM::cout << "MET_StringToType: ";
+  MET_StringToType(tmpString, &tmpMetType);
+  if(tmpMetType != metType)
+    METAIO_STREAM::cout << "FAILED" << METAIO_STREAM::endl;
+  else
+    METAIO_STREAM::cout << "PASSED" << METAIO_STREAM::endl;
+
+  METAIO_STREAM::cout << "MET_TypeToString: ";
+  MET_TypeToString(MET_USHORT, tmpString);
+  if(strcmp(tmpString, "MET_USHORT"))
+    METAIO_STREAM::cout << "FAILED" << METAIO_STREAM::endl;
+  else
+    METAIO_STREAM::cout << "PASSED" << METAIO_STREAM::endl;
+
+  int n;
+  METAIO_STREAM::cout << "MET_SizeOfType: ";
+  MET_SizeOfType(MET_USHORT, &n);
+  if(2 != n)
+    METAIO_STREAM::cout << "FAILED" << METAIO_STREAM::endl;
+  else
+    METAIO_STREAM::cout << "PASSED" << METAIO_STREAM::endl;
+
+  char **wordArray;
+  MET_StringToWordArray("This is a test", &n, &wordArray);
+  METAIO_STREAM::cout << "MET_StringToWordArray: N: ";
+  if(n != 4)
+    METAIO_STREAM::cout << "FAILED" << METAIO_STREAM::endl;
+  else
+    METAIO_STREAM::cout << "PASSED" << METAIO_STREAM::endl;
+  METAIO_STREAM::cout << "MET_StringToWordArray: 1: ";
+  if(strcmp(wordArray[0], "This"))
+    METAIO_STREAM::cout << "FAILED" << METAIO_STREAM::endl;
+  else
+    METAIO_STREAM::cout << "PASSED" << METAIO_STREAM::endl;
+  METAIO_STREAM::cout << "MET_StringToWordArray: 2: ";
+  if(strcmp(wordArray[1], "is"))
+    METAIO_STREAM::cout << "FAILED" << METAIO_STREAM::endl;
+  else
+    METAIO_STREAM::cout << "PASSED" << METAIO_STREAM::endl;
+  METAIO_STREAM::cout << "MET_StringToWordArray: 3: ";
+  if(strcmp(wordArray[2], "a"))
+    METAIO_STREAM::cout << "FAILED" << METAIO_STREAM::endl;
+  else
+    METAIO_STREAM::cout << "PASSED" << METAIO_STREAM::endl;
+  METAIO_STREAM::cout << "MET_StringToWordArray: 4: ";
+  if(strcmp(wordArray[3], "test"))
+    METAIO_STREAM::cout << "FAILED" << METAIO_STREAM::endl;
+  else
+    METAIO_STREAM::cout << "PASSED" << METAIO_STREAM::endl;
+
+  char fName[80];
+  sprintf(fName, "this/is/a/test.com");
+
+  METAIO_STREAM::cout << "MET_GetFilePathTest: ";
+  MET_GetFilePath(fName, tmpString);
+  if(strcmp(tmpString, "this/is/a/"))
+    METAIO_STREAM::cout << "FAILED" << METAIO_STREAM::endl;
+  else
+    METAIO_STREAM::cout << "PASSED" << METAIO_STREAM::endl;
+
+  int tmpI;
+  METAIO_STREAM::cout << "MET_GetFileSuffixPtr: ";
+  MET_GetFileSuffixPtr(fName, &tmpI);
+  if(fName[tmpI] != 'c')
+    {
+    METAIO_STREAM::cout << "FAILED" << METAIO_STREAM::endl;
+    METAIO_STREAM::cout << &(fName[tmpI]) << METAIO_STREAM::endl;
+    }
+  else
+    METAIO_STREAM::cout << "PASSED" << METAIO_STREAM::endl;
+
+  METAIO_STREAM::cout << "MET_SetFileSuffix: ";
+  MET_SetFileSuffix(fName, ".net");
+  if(strcmp(fName, "this/is/a/test.net"))
+    METAIO_STREAM::cout << "FAILED" << METAIO_STREAM::endl;
+  else
+    METAIO_STREAM::cout << "PASSED" << METAIO_STREAM::endl;
+
+  METAIO_STREAM::ofstream fout;
+  fout.open("testMetaFileUtils.txt", METAIO_STREAM::ios::out);
+
+  MET_FieldRecordType * mF;
+  METAIO_STL::vector<MET_FieldRecordType *> mFields;
+
+  mF = new MET_FieldRecordType;
+  MET_InitWriteField(mF, "NDims", MET_UCHAR, 2);
+  mFields.push_back(mF);
+
+  float vTmp[10];
+  vTmp[0] = 0.5;
+  vTmp[1] = 0.75;
+  mF = new MET_FieldRecordType;
+  MET_InitWriteField(mF, "ElementSize", MET_FLOAT_ARRAY, 2, vTmp);
+  mFields.push_back(mF);
+
+  char s[80];
+  strcpy(s, "X-AXIS Y-AXIS");
+  mF = new MET_FieldRecordType;
+  MET_InitWriteField(mF, "DirNames", MET_STRING, strlen(s), s);
+  mFields.push_back(mF);
+
+  mF = new MET_FieldRecordType;
+  MET_InitWriteField(mF, "END", MET_NONE);
+  mF->terminateRead = true;
+  mFields.push_back(mF);
+
+  MET_Write(fout, &mFields);
+
+  MET_WriteFieldToFile(fout, "Beyond", MET_STRING, 4, "True");
+  MET_WriteFieldToFile(fout, "Extra", MET_USHORT, 1);
+
+  fout.flush();
+
+  METAIO_STL::vector<MET_FieldRecordType *>::iterator fieldIter;
+  for(fieldIter=mFields.begin(); fieldIter!=mFields.end(); fieldIter++)
+    delete *fieldIter;
+  mFields.clear();
+
+  //
+  //
+  //
+  METAIO_STREAM::ifstream fin;
+  fin.open("testMetaFileUtils.txt", METAIO_STREAM::ios::in);
+
+  mF = new MET_FieldRecordType;
+  MET_InitReadField(mF, "NDims", MET_INT);
+  mFields.push_back(mF);
+
+  mF = new MET_FieldRecordType;
+  MET_InitReadField(mF, "ElementSize", MET_FLOAT_ARRAY, true, 0);
+  mFields.push_back(mF);
+
+  mF = new MET_FieldRecordType;
+  MET_InitReadField(mF, "DirNames", MET_STRING);
+  mFields.push_back(mF);
+
+  mF = new MET_FieldRecordType;
+  MET_InitReadField(mF, "END", MET_NONE);
+  mF->terminateRead = true;
+  mFields.push_back(mF);
+
+  METAIO_STREAM::cout << "MET_Read: ";
+  if(!MET_Read(fin, &mFields))
+    METAIO_STREAM::cout << "FAILED" << METAIO_STREAM::endl;
+  else
+    METAIO_STREAM::cout << "PASSED" << METAIO_STREAM::endl;
+
+  fieldIter = mFields.begin();
+  int nDims = 0;
+  if((*fieldIter)->defined)
+    {
+    nDims = (int)((*fieldIter)->value[0]);
+    if(nDims != 2)
+      METAIO_STREAM::cout << "nDims not equal to 2" << METAIO_STREAM::endl;
+    else
+      METAIO_STREAM::cout << "nDims: Passed" << METAIO_STREAM::endl;
+    }
+  else
+    METAIO_STREAM::cout << "nDims not defined" << METAIO_STREAM::endl;
+
+  float eSize[2];
+  fieldIter++;
+  if((*fieldIter)->defined)
+    {
+    eSize[0] = (*fieldIter)->value[0];
+    eSize[1] = (*fieldIter)->value[1];
+    if(eSize[0] != 0.5 || eSize[1] != 0.75)
+      METAIO_STREAM::cout << "ElementSizes are wrong: " << eSize[0] << ", " << eSize[1] << METAIO_STREAM::endl;
+    else
+      METAIO_STREAM::cout << "ElementSizes: Passed" << METAIO_STREAM::endl;
+    }
+  else
+    METAIO_STREAM::cout << "ElementSize not defined" << METAIO_STREAM::endl;
+
+  int nNames;
+  char **names;
+  fieldIter++;
+  if((*fieldIter)->defined)
+    {
+    MET_StringToWordArray((char *)((*fieldIter)->value), &nNames, &names);
+    if(nNames != 2)
+      METAIO_STREAM::cout << "nNames wrong : " << nNames << METAIO_STREAM::endl;
+    else
+      if(strcmp(names[0], "X-AXIS") || strcmp(names[1], "Y-AXIS"))
+        METAIO_STREAM::cout << "names wrong : _" << names[0] << "_, _" << names[1] << "_" << METAIO_STREAM::endl;
+      else
+        METAIO_STREAM::cout << "Names: Passed" << METAIO_STREAM::endl;
+    }
+  else
+    METAIO_STREAM::cout << "DirNames not defined" << METAIO_STREAM::endl;
+
+  return 1;
+  }
diff --git a/Utilities/MetaIO/vtkmetaio/tests/testMeta2Object.cxx b/Utilities/MetaIO/vtkmetaio/tests/testMeta2Object.cxx
new file mode 100644
index 0000000..e9fe251
--- /dev/null
+++ b/Utilities/MetaIO/vtkmetaio/tests/testMeta2Object.cxx
@@ -0,0 +1,132 @@
+#include <stdio.h>
+#include <fstream>
+#include <ctype.h>
+
+#include <metaObject.h>
+
+int main(int, char * [])
+  {
+  MetaObject tObj;
+
+  tObj.InitializeEssential(3);
+  tObj.FileName("testObject.txt");
+  tObj.Comment("TestObject");
+  tObj.ObjectTypeName("Object");
+  tObj.ObjectSubTypeName("MinorObject");
+  tObj.Position(0, 1);
+  tObj.Position(1, 2);
+  tObj.Position(2, 3);
+  double orient[9];
+  int i;
+  for(i=0; i<9; i++)
+    {
+    orient[i] = 0;
+    }
+  orient[0] = 1;
+  orient[5] = 1;
+  orient[7] = 1;
+  tObj.Orientation(orient);
+  tObj.ElementSpacing(0, 1);
+  tObj.ElementSpacing(1, 2);
+  tObj.ElementSpacing(2, 1);
+
+  // Add user's defined fields
+  int myarray[3];
+  myarray[0]=1;
+  myarray[1]=2;
+  myarray[2]=3;
+  tObj.AddUserField("MyName", MET_STRING, strlen("Julien"), "Julien");
+  tObj.AddUserField("MyArray", MET_INT_ARRAY,3,myarray);
+
+  float myMatrix[4];
+  for(i=0; i<4; i++)
+    {
+    myMatrix[i] = i;
+    }
+  tObj.AddUserField("MyMatrix", MET_FLOAT_MATRIX,2,myMatrix);
+
+  tObj.PrintInfo();
+  tObj.Write();
+
+  tObj.Clear();
+  tObj.ClearUserFields();
+
+  tObj.AddUserField("MyName", MET_STRING);
+  tObj.AddUserField("MyArray", MET_INT_ARRAY,3);
+  tObj.AddUserField("MyMatrix", MET_FLOAT_MATRIX,2);
+
+  tObj.Read();
+  tObj.PrintInfo();
+
+  char* name = static_cast<char*>(tObj.GetUserField("MyName"));
+  if(strcmp(name,"Julien"))
+  {
+    METAIO_STREAM::cout << "MyName: FAIL" << METAIO_STREAM::endl;
+    return 0;
+  }
+
+  int* array = static_cast<int*>(tObj.GetUserField("MyArray"));
+
+  for(i=0;i<3;i++)
+  {
+    if(array[i] != i+1)
+    {
+      METAIO_STREAM::cout << "MyArray: FAIL" << METAIO_STREAM::endl;
+      return 0;
+    }
+  }
+
+  float* matrix = static_cast<float*>(tObj.GetUserField("MyMatrix"));
+  for(i=0; i<4; i++)
+  {
+    if(matrix[i] != i)
+    {
+      METAIO_STREAM::cout << "MyMatrix: FAIL" << METAIO_STREAM::endl;
+    }
+  }
+
+  METAIO_STREAM::cout << "PASSED!" << METAIO_STREAM::endl;
+
+  tObj.Clear();
+  tObj.ClearUserFields();
+
+  tObj.FileName("testObject2.txt");
+  tObj.InitializeEssential(2);
+  tObj.Position(0, 4);
+  tObj.ElementSpacing(0,2);
+  tObj.PrintInfo();
+  tObj.Write();
+  tObj.Clear();
+
+  tObj.Read();
+  tObj.PrintInfo();
+  if(tObj.NDims() != 2)
+    {
+    METAIO_STREAM::cout << "NDims: FAIL" << METAIO_STREAM::endl;
+    }
+  else
+    {
+    METAIO_STREAM::cout << "NDims: PASS" << METAIO_STREAM::endl;
+    }
+
+  int zero = 0;
+  if(tObj.Position(zero) != 4)
+    {
+    METAIO_STREAM::cout << "Position: FAIL :" << tObj.Position(zero) << METAIO_STREAM::endl;
+    }
+  else
+    {
+    METAIO_STREAM::cout << "Position: PASS" << METAIO_STREAM::endl;
+    }
+
+  if(tObj.ElementSpacing(zero) != 2)
+    {
+    METAIO_STREAM::cout << "ElementSpacing: FAIL: " << tObj.ElementSpacing(zero) << METAIO_STREAM::endl;
+    }
+  else
+    {
+    METAIO_STREAM::cout << "ElementSpacing: PASS" << METAIO_STREAM::endl;
+    }
+
+  return 1;
+  }
diff --git a/Utilities/MetaIO/vtkmetaio/tests/testMeta3Image.cxx b/Utilities/MetaIO/vtkmetaio/tests/testMeta3Image.cxx
new file mode 100644
index 0000000..ae7a4b5
--- /dev/null
+++ b/Utilities/MetaIO/vtkmetaio/tests/testMeta3Image.cxx
@@ -0,0 +1,39 @@
+#include <stdio.h>
+#include <ctype.h>
+#include <metaImage.h>
+
+int main(int, char * [])
+  {
+
+  MetaImage tIm(8, 8, 1, 2, MET_CHAR);
+
+  int i;
+  for(i=0; i<64; i++)
+    tIm.ElementData(i, i);
+
+  for(i=0; i<64; i++)
+    {
+    if(i != tIm.ElementData(i))
+      {
+      METAIO_STREAM::cout << "Assigned Element Values Maintained: FAIL" << METAIO_STREAM::endl;
+      return 0;
+      }
+    }
+
+  tIm.Write("test.mha");
+  tIm.PrintInfo();
+
+  MetaImage tIm2("test.mha");
+  tIm2.PrintInfo();
+  for(i=0; i<64; i++)
+    {
+    if(i != tIm.ElementData(i))
+      {
+      METAIO_STREAM::cout << "Read Element Values: FAIL" << METAIO_STREAM::endl;
+      return 0;
+      }
+    }
+
+
+  return 1;
+  }
diff --git a/Utilities/MetaIO/vtkmetaio/tests/testMeta4Tube.cxx b/Utilities/MetaIO/vtkmetaio/tests/testMeta4Tube.cxx
new file mode 100644
index 0000000..9e5f373
--- /dev/null
+++ b/Utilities/MetaIO/vtkmetaio/tests/testMeta4Tube.cxx
@@ -0,0 +1,97 @@
+#include <stdio.h>
+#include <iostream>
+#include <ctype.h>
+#include <metaTube.h>
+#include <metaScene.h>
+#include <metaEllipse.h>
+
+int main(int, char * [])
+{
+
+  METAIO_STREAM::cout << "Initializing scene ..." << METAIO_STREAM::endl;
+  MetaScene myScene = MetaScene(3);
+
+  METAIO_STREAM::cout << "Creating test file ..." << METAIO_STREAM::endl;
+
+  //MetaTubeNet* tubenet = new MetaTubeNet();
+
+  // add two tube to the list of tubenet
+  METAIO_STREAM::cout << "  Creating first tube ..." << METAIO_STREAM::endl;
+  MetaTube* tube1 = new MetaTube(3);
+  tube1->ID(0);
+  TubePnt* pnt;
+
+  unsigned int i;
+  for(i=0;i<10;i++)
+  {
+    pnt = new TubePnt(3);
+    pnt->m_X[0]=i;pnt->m_X[1]=i;pnt->m_X[2]=i;
+    pnt->m_R=i;
+    tube1->GetPoints().push_back(pnt);
+  }
+
+  METAIO_STREAM::cout << "  Creating second tube ..." << METAIO_STREAM::endl;
+  MetaTube* tube2 = new MetaTube(3);
+  tube2->ID(1);
+  for(i=0;i<5;i++)
+  {
+    pnt = new TubePnt(3);
+    pnt->m_X[0]=i;pnt->m_X[1]=i;pnt->m_X[2]=i;
+    pnt->m_R=i;
+    tube2->GetPoints().push_back(pnt);
+  }
+
+  // Add an ellipse
+  METAIO_STREAM::cout << "  Creating ellipse ..." << METAIO_STREAM::endl;
+  MetaEllipse* ellipse = new MetaEllipse();
+  METAIO_STREAM::cout << "    Initializing ellipse ..." << METAIO_STREAM::endl;
+  ellipse->InitializeEssential(3);
+  METAIO_STREAM::cout << "    Setting radius ..." << METAIO_STREAM::endl;
+  ellipse->Radius(1,2,3);
+
+  myScene.AddObject(tube1);
+  myScene.AddObject(tube2);
+  myScene.AddObject(ellipse);
+
+  myScene.Write("test.scn");
+
+  METAIO_STREAM::cout << "done" << METAIO_STREAM::endl;
+  METAIO_STREAM::cout << "Reading test file ..." << METAIO_STREAM::endl;
+
+  // Read the result
+  MetaScene myScene2 = MetaScene();
+  myScene2.InitializeEssential(3);
+
+  METAIO_STREAM::cout << "  ... reading scene " << METAIO_STREAM::endl;
+  myScene2.Read("test.scn");
+  METAIO_STREAM::cout << "  ... read scene " << METAIO_STREAM::endl;
+
+  typedef  MetaScene::ObjectListType ListType;
+  ListType * list = myScene2.GetObjectList();
+  ListType::iterator it = list->begin();
+
+  METAIO_STREAM::cout << "  ... beginning loop " << METAIO_STREAM::endl;
+  for(i=0;i< list->size();i++)
+  {
+
+    (*it)->PrintInfo();
+    if(!strncmp((*it)->ObjectTypeName(),"Tube",4))
+    {
+      typedef MetaTube::PointListType ListType;
+      MetaTube* tube = static_cast<MetaTube*>(*it);
+      ListType::iterator it2 = tube->GetPoints().begin();
+
+      for(unsigned int j=0;j< tube->GetPoints().size();j++)
+      {
+        METAIO_STREAM::cout << (*it2)->m_X[0]
+        << " " << (*it2)->m_X[1] << " " << (*it2)->m_X[2] << METAIO_STREAM::endl;
+        it2++;
+      }
+    }
+
+    it++;
+  }
+
+  METAIO_STREAM::cout << "done" << METAIO_STREAM::endl;
+  return 1;
+}
diff --git a/Utilities/MetaIO/vtkmetaio/tests/testMeta5Blob.cxx b/Utilities/MetaIO/vtkmetaio/tests/testMeta5Blob.cxx
new file mode 100644
index 0000000..4a3fd54
--- /dev/null
+++ b/Utilities/MetaIO/vtkmetaio/tests/testMeta5Blob.cxx
@@ -0,0 +1,55 @@
+#include <stdio.h>
+#include <ctype.h>
+#include <metaBlob.h>
+
+int main(int, char * [])
+{
+
+  METAIO_STREAM::cout << "Creating test file ..." << METAIO_STREAM::endl;
+  MetaBlob blob(3);
+  blob.ID(0);
+  BlobPnt* pnt;
+
+  METAIO_STREAM::cout << "Allocating points..." << METAIO_STREAM::endl;
+  unsigned int i;
+  for(i=0;i<10;i++)
+  {
+    pnt = new BlobPnt(3);
+    pnt->m_X[0]=(float)0.2;pnt->m_X[1]=i;pnt->m_X[2]=i;
+    blob.GetPoints().push_back(pnt);
+  }
+
+  METAIO_STREAM::cout << "Writing test file ..." << METAIO_STREAM::endl;
+
+  blob.BinaryData(true);
+  blob.ElementType(MET_FLOAT);
+  blob.Write("myCNC.meta");
+
+  METAIO_STREAM::cout << "  done" << METAIO_STREAM::endl;
+
+  METAIO_STREAM::cout << "Reading test file ..." << METAIO_STREAM::endl;
+  blob.Read("myCNC.meta");
+
+  METAIO_STREAM::cout << "  done" << METAIO_STREAM::endl;
+
+  blob.PrintInfo();
+
+  METAIO_STREAM::cout << "Accessing pointlist..." << METAIO_STREAM::endl;
+
+  MetaBlob::PointListType plist =  blob.GetPoints();
+  MetaBlob::PointListType::const_iterator it = plist.begin();
+
+  while(it != plist.end())
+  {
+    for(unsigned int d = 0; d < 3; d++)
+    {
+      METAIO_STREAM::cout << (*it)->m_X[d] << " ";
+    }
+
+    METAIO_STREAM::cout << METAIO_STREAM::endl;
+    it++;
+  }
+
+  METAIO_STREAM::cout << "done" << METAIO_STREAM::endl;
+  return 1;
+}
diff --git a/Utilities/MetaIO/vtkmetaio/tests/testMeta6Surface.cxx b/Utilities/MetaIO/vtkmetaio/tests/testMeta6Surface.cxx
new file mode 100644
index 0000000..4e7bad1
--- /dev/null
+++ b/Utilities/MetaIO/vtkmetaio/tests/testMeta6Surface.cxx
@@ -0,0 +1,90 @@
+#include <stdio.h>
+#include <ctype.h>
+#include <metaSurface.h>
+
+int main(int, char * [])
+{
+
+  METAIO_STREAM::cout << "Creating test file ...";
+  MetaSurface* surface = new MetaSurface(3);
+  surface->ID(0);
+  SurfacePnt* pnt;
+
+  unsigned int i;
+  for(i=0;i<10;i++)
+  {
+    pnt = new SurfacePnt(3);
+    pnt->m_X[0]=(float)0.2;
+    pnt->m_X[1]=i;
+    pnt->m_X[2]=i;
+    pnt->m_V[0]=(float)0.8;
+    pnt->m_V[1]=i;
+    pnt->m_V[2]=i;
+    surface->GetPoints().push_back(pnt);
+  }
+
+
+  METAIO_STREAM::cout << "Writing ASCII test file ...";
+
+  surface->Write("mySurface.meta");
+
+  METAIO_STREAM::cout << "done" << METAIO_STREAM::endl;
+  METAIO_STREAM::cout << "Reading ASCII test file ...";
+
+  surface->Clear();
+  surface->Read("mySurface.meta");
+  surface->PrintInfo();
+
+  MetaSurface::PointListType list =  surface->GetPoints();
+  MetaSurface::PointListType::const_iterator it = list.begin();
+
+  unsigned int d=0;
+  while(it != list.end())
+  {
+
+    for(d = 0; d < 3; d++)
+    {
+      METAIO_STREAM::cout << (*it)->m_X[d] << " ";
+    }
+    METAIO_STREAM::cout << METAIO_STREAM::endl;
+    for(d = 0; d < 3; d++)
+    {
+      METAIO_STREAM::cout << (*it)->m_V[d] << " ";
+    }
+    METAIO_STREAM::cout << METAIO_STREAM::endl;
+    it++;
+  }
+
+  METAIO_STREAM::cout << "Writing Binary test file ...";
+  surface->BinaryData(true);
+  surface->ElementType(MET_FLOAT);
+  surface->Write("mySurface.meta");
+
+  METAIO_STREAM::cout << "done" << METAIO_STREAM::endl;
+  METAIO_STREAM::cout << "Reading Binary test file ...";
+
+  surface->Clear();
+  surface->Read("mySurface.meta");
+  surface->PrintInfo();
+
+  MetaSurface::PointListType list2 =  surface->GetPoints();
+  it = list2.begin();
+
+  while(it != list2.end())
+  {
+    for(d = 0; d < 3; d++)
+    {
+      METAIO_STREAM::cout << (*it)->m_X[d] << " ";
+    }
+    METAIO_STREAM::cout << METAIO_STREAM::endl;
+    for(d = 0; d < 3; d++)
+    {
+      METAIO_STREAM::cout << (*it)->m_V[d] << " ";
+    }
+    METAIO_STREAM::cout << METAIO_STREAM::endl;
+    it++;
+  }
+
+  METAIO_STREAM::cout << "done" << METAIO_STREAM::endl;
+  return 1;
+}
diff --git a/Utilities/MetaIO/vtkmetaio/tests/testMeta7Line.cxx b/Utilities/MetaIO/vtkmetaio/tests/testMeta7Line.cxx
new file mode 100644
index 0000000..4e4e963
--- /dev/null
+++ b/Utilities/MetaIO/vtkmetaio/tests/testMeta7Line.cxx
@@ -0,0 +1,68 @@
+#include <stdio.h>
+#include <ctype.h>
+#include <metaLine.h>
+
+int main(int, char * [])
+{
+
+  METAIO_STREAM::cout << "Creating test file ...";
+  MetaLine* Line = new MetaLine(3);
+  Line->ID(0);
+  LinePnt* pnt;
+
+  unsigned int i;
+  for(i=0;i<10;i++)
+  {
+    pnt = new LinePnt(3);
+    pnt->m_X[0]=(float)0.2;pnt->m_X[1]=i;pnt->m_X[2]=i;
+    pnt->m_V[0][0]=(float)0.3;pnt->m_V[0][1]=i;pnt->m_V[0][2]=i;
+    pnt->m_V[1][0]=(float)0.4;pnt->m_V[1][1]=i+1;pnt->m_V[1][2]=i+1;
+    Line->GetPoints().push_back(pnt);
+  }
+
+  METAIO_STREAM::cout << "Writing test file ...";
+
+  Line->BinaryData(true);
+
+  Line->Write("myLine.meta");
+
+  METAIO_STREAM::cout << "done" << METAIO_STREAM::endl;
+  METAIO_STREAM::cout << "Reading test file ...";
+
+  Line->Clear();
+  Line->Read("myLine.meta");
+
+  Line->PrintInfo();
+
+  MetaLine::PointListType list =  Line->GetPoints();
+  MetaLine::PointListType::const_iterator it = list.begin();
+
+  i=0;
+  while(it != list.end())
+  {
+    METAIO_STREAM::cout << "Point #" << i++ << ":" << METAIO_STREAM::endl;
+    METAIO_STREAM::cout << "position = ";
+    unsigned int d=0;
+    for(d = 0; d < 3; d++)
+    {
+      METAIO_STREAM::cout << (*it)->m_X[d] << " ";
+    }
+    METAIO_STREAM::cout << METAIO_STREAM::endl;
+    METAIO_STREAM::cout << "First normal = ";
+    for(d = 0; d < 3; d++)
+    {
+      METAIO_STREAM::cout << (*it)->m_V[0][d] << " ";
+    }
+    METAIO_STREAM::cout << METAIO_STREAM::endl;
+    METAIO_STREAM::cout << "Second normal = ";
+    for(d = 0; d < 3; d++)
+    {
+      METAIO_STREAM::cout << (*it)->m_V[1][d] << " ";
+    }
+    METAIO_STREAM::cout << METAIO_STREAM::endl;
+    it++;
+  }
+
+  METAIO_STREAM::cout << "done" << METAIO_STREAM::endl;
+  return 1;
+}
diff --git a/Utilities/MetaIO/vtkmetaio/tests/testMeta8Scene.cxx b/Utilities/MetaIO/vtkmetaio/tests/testMeta8Scene.cxx
new file mode 100644
index 0000000..9fd7f34
--- /dev/null
+++ b/Utilities/MetaIO/vtkmetaio/tests/testMeta8Scene.cxx
@@ -0,0 +1,85 @@
+#include <stdio.h>
+#include <ctype.h>
+#include <metaScene.h>
+#include <metaGroup.h>
+#include <metaEllipse.h>
+
+int main(int, char * [])
+{
+
+  METAIO_STREAM::cout << "Creating test scene ..." << METAIO_STREAM::endl;
+  MetaScene * s = new MetaScene(3);
+
+  MetaEllipse * e1 = new MetaEllipse(3);
+  e1->ID(0);
+  e1->Radius(3);
+
+  MetaEllipse * e2 = new MetaEllipse(3);
+  e2->ID(1);
+  e2->Radius(4);
+
+  MetaGroup * g1 = new MetaGroup(3);
+  g1->ID(2);
+
+  e1->ParentID(2);
+  e2->ParentID(2);
+
+  s->AddObject(g1);
+  s->AddObject(e1);
+  s->AddObject(e2);
+
+  METAIO_STREAM::cout << "...[ok]" << METAIO_STREAM::endl;
+
+  METAIO_STREAM::cout << "Writing test file ..." << METAIO_STREAM::endl;
+
+  s->Write("scene.scn");
+
+  METAIO_STREAM::cout << "...[ok]" << METAIO_STREAM::endl;
+
+  METAIO_STREAM::cout << "Clearing the scene..." << METAIO_STREAM::endl;
+  s->Clear();
+  METAIO_STREAM::cout << "...[ok]" << METAIO_STREAM::endl;
+
+  METAIO_STREAM::cout << "Reading test file ..." << METAIO_STREAM::endl;
+
+  s->Read("scene.scn");
+
+  if(s->NObjects() != 3)
+    {
+    METAIO_STREAM::cout << "Number of obejcts: " << s->NObjects()
+              << " != 3...[FAILED]" << METAIO_STREAM::endl;
+    return 0;
+    }
+
+  METAIO_STREAM::cout << "...[ok]" << METAIO_STREAM::endl;
+
+  s->Clear();
+
+  METAIO_STREAM::cout << "Writing single object..." << METAIO_STREAM::endl;
+
+  e1 = new MetaEllipse(3);
+  e1->ID(0);
+  e1->Radius(3);
+  e1->Write("ellipse.elp");
+
+  METAIO_STREAM::cout << "[OK]" << METAIO_STREAM::endl;
+
+  s->Clear();
+
+  METAIO_STREAM::cout << "Reading test file ..." << METAIO_STREAM::endl;
+
+  s->Read("ellipse.elp");
+
+  if(s->NObjects() != 1)
+    {
+    METAIO_STREAM::cout << "Number of obejcts: " << s->NObjects()
+              << " != 1...[FAILED]" << METAIO_STREAM::endl;
+    return 0;
+    }
+
+  METAIO_STREAM::cout << "[OK]" << METAIO_STREAM::endl;
+
+  // (*(s->GetObjectList()->begin()))->PrintInfo();
+
+  return 1;
+}
diff --git a/Utilities/MetaIO/vtkmetaio/tests/testMeta9Landmark.cxx b/Utilities/MetaIO/vtkmetaio/tests/testMeta9Landmark.cxx
new file mode 100644
index 0000000..4060f8e
--- /dev/null
+++ b/Utilities/MetaIO/vtkmetaio/tests/testMeta9Landmark.cxx
@@ -0,0 +1,55 @@
+#include <stdio.h>
+#include <ctype.h>
+#include <metaLandmark.h>
+
+int main(int , char * [])
+{
+
+  METAIO_STREAM::cout << "Creating test file ..." << METAIO_STREAM::endl;
+  MetaLandmark Landmark(3);
+  Landmark.ID(0);
+  LandmarkPnt* pnt;
+
+  METAIO_STREAM::cout << "Allocating points..." << METAIO_STREAM::endl;
+  unsigned int i;
+  for(i=0;i<10;i++)
+  {
+    pnt = new LandmarkPnt(3);
+    pnt->m_X[0]=(float)0.2;pnt->m_X[1]=i;pnt->m_X[2]=i;
+    Landmark.GetPoints().push_back(pnt);
+  }
+
+  METAIO_STREAM::cout << "Writing test file ..." << METAIO_STREAM::endl;
+
+  Landmark.BinaryData(true);
+  Landmark.ElementType(MET_FLOAT);
+  Landmark.Write("Landmarks.meta");
+
+  METAIO_STREAM::cout << "  done" << METAIO_STREAM::endl;
+
+  METAIO_STREAM::cout << "Reading test file ..." << METAIO_STREAM::endl;
+  Landmark.Read("Landmarks.meta");
+
+  METAIO_STREAM::cout << "  done" << METAIO_STREAM::endl;
+
+  Landmark.PrintInfo();
+
+  METAIO_STREAM::cout << "Accessing pointlist..." << METAIO_STREAM::endl;
+
+  MetaLandmark::PointListType plist =  Landmark.GetPoints();
+  MetaLandmark::PointListType::const_iterator it = plist.begin();
+
+  while(it != plist.end())
+  {
+    for(unsigned int d = 0; d < 3; d++)
+    {
+      METAIO_STREAM::cout << (*it)->m_X[d] << " ";
+    }
+
+    METAIO_STREAM::cout << METAIO_STREAM::endl;
+    it++;
+  }
+
+  METAIO_STREAM::cout << "done" << METAIO_STREAM::endl;
+  return 0;
+}
diff --git a/Utilities/Python/vtkPython.h b/Utilities/Python/vtkPython.h
index b1ef2f8..17c3b02 100644
--- a/Utilities/Python/vtkPython.h
+++ b/Utilities/Python/vtkPython.h
@@ -50,7 +50,7 @@
 # include <time.h>
 # include <wchar.h>
 # undef _DEBUG
-# if defined(_MSC_VER)
+# if defined(_MSC_VER) && _MSC_VER >= 1400
 #  define _CRT_NOFORCE_MANIFEST 1
 # endif
 #endif
@@ -72,16 +72,8 @@ they are system headers.  Do NOT add any #undef lines here.  */
 # pragma warning (push, 1)
 #endif
 
-#if defined(_MSC_VER) && _MSC_VER >= 1800
-#define HAVE_ROUND
-#endif
-
 #include <Python.h>
 
-#if defined(_MSC_VER) && _MSC_VER >= 1800
-#undef HAVE_ROUND
-#endif
-
 #if defined(_MSC_VER)
 # pragma warning (pop)
 #endif
diff --git a/Utilities/PythonInterpreter/vtkPythonInterpreter.cxx b/Utilities/PythonInterpreter/vtkPythonInterpreter.cxx
index 6ac7178..72cffea 100644
--- a/Utilities/PythonInterpreter/vtkPythonInterpreter.cxx
+++ b/Utilities/PythonInterpreter/vtkPythonInterpreter.cxx
@@ -229,7 +229,7 @@ int vtkPythonInterpreter::PyMain(int argc, char** argv)
 }
 
 //----------------------------------------------------------------------------
-int vtkPythonInterpreter::RunSimpleString(const char* script)
+void vtkPythonInterpreter::RunSimpleString(const char* script)
 {
   vtkPythonInterpreter::Initialize(1);
   vtkPythonInterpreter::ConsoleBuffering = true;
@@ -240,7 +240,7 @@ int vtkPythonInterpreter::RunSimpleString(const char* script)
   buffer.erase(std::remove(buffer.begin(), buffer.end(), '\r'), buffer.end());
 
   // The cast is necessary because PyRun_SimpleString() hasn't always been const-correct
-  int pyReturn = PyRun_SimpleString(const_cast<char*>(buffer.c_str()));
+  PyRun_SimpleString(const_cast<char*>(buffer.c_str()));
   vtkPythonInterpreter::ConsoleBuffering = false;
   if (! vtkPythonInterpreter::StdErrBuffer.empty())
     {
@@ -254,8 +254,6 @@ int vtkPythonInterpreter::RunSimpleString(const char* script)
                          vtkPythonInterpreter::StdOutBuffer.c_str()));
     vtkPythonInterpreter::StdOutBuffer.clear();
     }
-
-  return pyReturn;
 }
 
 //----------------------------------------------------------------------------
@@ -287,7 +285,6 @@ void vtkPythonInterpreter::WriteStdOut(const char* txt)
 //----------------------------------------------------------------------------
 void vtkPythonInterpreter::FlushStdOut()
 {
-    cout.flush();
 }
 
 //----------------------------------------------------------------------------
@@ -307,7 +304,6 @@ void vtkPythonInterpreter::WriteStdErr(const char* txt)
 //----------------------------------------------------------------------------
 void vtkPythonInterpreter::FlushStdErr()
 {
-    cerr.flush();
 }
 
 //----------------------------------------------------------------------------
diff --git a/Utilities/PythonInterpreter/vtkPythonInterpreter.h b/Utilities/PythonInterpreter/vtkPythonInterpreter.h
index e8b9d74..6c88fce 100644
--- a/Utilities/PythonInterpreter/vtkPythonInterpreter.h
+++ b/Utilities/PythonInterpreter/vtkPythonInterpreter.h
@@ -94,8 +94,7 @@ public:
   // is provided to overcome an issue with the Python interpreter with handling
   // of DOS line endings.
   // This will initialize Python if not already initialized.
-  // Returns 0 on success or -1 if a python exception was raised.
-  static int RunSimpleString(const char* script);
+  static void RunSimpleString(const char* script);
 
   // Description:
   // Prepends the path to the sys.path variable. If Python has been
diff --git a/Utilities/PythonInterpreter/vtkPythonStdStreamCaptureHelper.h b/Utilities/PythonInterpreter/vtkPythonStdStreamCaptureHelper.h
index 1c43cf5..43000d3 100644
--- a/Utilities/PythonInterpreter/vtkPythonStdStreamCaptureHelper.h
+++ b/Utilities/PythonInterpreter/vtkPythonStdStreamCaptureHelper.h
@@ -54,24 +54,17 @@ struct vtkPythonStdStreamCaptureHelper
     {
     return vtkPythonInterpreter::ReadStdin();
     }
-
-  void Close()
-    {
-    this->Flush();
-    }
 };
 
 static PyObject* vtkWrite(PyObject* self, PyObject* args);
 static PyObject* vtkRead(PyObject* self, PyObject* args);
 static PyObject* vtkFlush(PyObject* self, PyObject* args);
-static PyObject* vtkClose(PyObject* self, PyObject* args);
 
 // const_cast since older versions of python are not const correct.
 static PyMethodDef vtkPythonStdStreamCaptureHelperMethods[] = {
     {const_cast<char*>("write"), vtkWrite, METH_VARARGS, const_cast<char*>("Dump message")},
     {const_cast<char*>("readline"), vtkRead, METH_VARARGS, const_cast<char*>("Read input line")},
     {const_cast<char*>("flush"), vtkFlush, METH_VARARGS, const_cast<char*>("Flush")},
-    {const_cast<char*>("close"), vtkClose, METH_VARARGS, const_cast<char*>("Close")},
     {0, 0, 0, 0}
 };
 
@@ -198,23 +191,6 @@ static PyObject* vtkFlush(PyObject* self, PyObject* args)
   return Py_BuildValue(const_cast<char*>(""));
 }
 
-static PyObject* vtkClose(PyObject* self, PyObject* args)
-{
-  (void)args;
-  if(!self || !PyObject_TypeCheck(self, &vtkPythonStdStreamCaptureHelperType))
-    {
-    return 0;
-    }
-
-  vtkPythonStdStreamCaptureHelper* wrapper =
-    reinterpret_cast<vtkPythonStdStreamCaptureHelper*>(self);
-  if (wrapper)
-    {
-    wrapper->Close();
-    }
-  return Py_BuildValue(const_cast<char*>(""));
-}
-
 static vtkPythonStdStreamCaptureHelper* NewPythonStdStreamCaptureHelper(bool for_stderr=false)
 {
   if(PyType_Ready(&vtkPythonStdStreamCaptureHelperType) < 0)
diff --git a/Utilities/Scripts/SetupExternalData.sh b/Utilities/Scripts/SetupExternalData.sh
index 72d6ba8..b7edc0c 100755
--- a/Utilities/Scripts/SetupExternalData.sh
+++ b/Utilities/Scripts/SetupExternalData.sh
@@ -65,7 +65,7 @@ select a default for VTK_DATA_STORE [n/h/s]: ' ans &&
       /*) ;;
       [A-Za-z]:[/\\]*) ;;
       '') ans='' ;;
-      *) echo; echo "Invalid response '$ans'"; echo; ans='?' ;;
+      *) echo; echo "Invalid response '$ans'!"; echo; ans='?' ;;
     esac
   done
   eval "$1='$ans'"
@@ -119,7 +119,7 @@ select a default for VTK_DATA_EXCLUDE_FROM_ALL [d/n/y]: ' ans &&
       n|N|no|off) ans='OFF' ;;
       y|Y|yes|on) ans='ON' ;;
       '') ans='' ;;
-      *) echo; echo "Invalid response '$ans'"; echo; ans='?' ;;
+      *) echo; echo "Invalid response '$ans'!"; echo; ans='?' ;;
     esac
   done
   eval "$1='$ans'"
diff --git a/Utilities/Scripts/SetupGitAliases.sh b/Utilities/Scripts/SetupGitAliases.sh
index 87a4510..2775845 100755
--- a/Utilities/Scripts/SetupGitAliases.sh
+++ b/Utilities/Scripts/SetupGitAliases.sh
@@ -3,21 +3,17 @@
 echo "Setting up useful Git aliases..." &&
 
 # General aliases that could be global
-git config alias.pullall '!bash -c "git pull && git submodule update --init"' &&
+git config alias.pullall "!bash -c \"git pull && git submodule update --init\"" &&
 git config alias.prepush 'log --graph --stat origin/master..' &&
 
 # Staging aliases
-stage_disabled="VTK no longer uses the topic stage. Please use GitLab." &&
-git config alias.stage-cmd '!sh -c "echo '"${stage_disabled}"'"' &&
-git config alias.stage-push '!sh -c "echo '"${stage_disabled}"'"' &&
-git config alias.stage-branch '!sh -c "echo '"${stage_disabled}"'"' &&
-git config alias.stage-merge '!sh -c "echo '"${stage_disabled}"'"' &&
+stage_deprecated="The stage aliases have been deprecated. Please use Gerrit." &&
+git config alias.stage-cmd "!sh -c \"echo ${stage_deprecated}\"" &&
+git config alias.stage-push "!sh -c \"echo ${stage_deprecated}\"" &&
+git config alias.stage-branch "!sh -c \"echo ${stage_deprecated}\"" &&
+git config alias.stage-merge "!sh -c \"echo ${stage_deprecated}\"" &&
 
-# Gerrit aliases
-gerrit_disabled="VTK no longer uses Gerrit. Please use GitLab." &&
-git config alias.gerrit-push '!sh -c "echo '"${gerrit_disabled}"'"' &&
-
-# Alias to push the current topic branch to GitLab
-git config alias.gitlab-push '!bash Utilities/GitSetup/git-gitlab-push' &&
+# Alias to push the current topic branch to Gerrit
+git config alias.gerrit-push "!bash Utilities/Scripts/git-gerrit-push" &&
 
 true
diff --git a/Utilities/Scripts/git-gerrit-push b/Utilities/Scripts/git-gerrit-push
index 8180f3e..ab11e5c 100755
--- a/Utilities/Scripts/git-gerrit-push
+++ b/Utilities/Scripts/git-gerrit-push
@@ -1,3 +1,166 @@
 #!/usr/bin/env bash
-echo 'VTK no longer uses Gerrit. Please use GitLab.'
-exit 1
+
+USAGE="[<remote>] [--no-topic] [--no-data] [--keep-data] [--dry-run] [--]"
+OPTIONS_SPEC=
+SUBDIRECTORY_OK=Yes
+. "$(git --exec-path)/git-sh-setup"
+
+egrep-q() {
+  egrep "$@" >/dev/null 2>/dev/null
+}
+
+data_commit() {
+  # Get data refs.  Skip if none.
+  test $# != 0 || return 0
+  state=$(git for-each-ref "$@") || return
+  test -n "$state" || return 0
+
+  # Convert each data ref to an index entry.
+  index=$(
+    echo "$state" |
+    while read obj type refname; do
+      # Take blobs with valid ref names.
+      name="${refname#refs/data/}"
+      if echo "$type,$name" | egrep-q '^blob,[A-Za-z0-9-]+/[0-9A-Fa-f]+$'; then
+        # Place the blob at the path named by the ref.
+        echo "100644 $obj 0	$name"
+      else
+        # Warn about unprocessed refs.
+        echo "unknown $refname" 1>&2
+      fi
+    done
+  ) || return
+  test -n "$index" || return 0
+
+  # Convert the index into a tree.
+  tree=$(
+    GIT_INDEX_FILE="$GIT_DIR/tmp-index.$$.$RANDOM" &&
+    export GIT_INDEX_FILE &&
+    trap "rm -f '$GIT_INDEX_FILE'" EXIT &&
+    rm -f "$GIT_INDEX_FILE" &&
+    echo "$index" | git update-index --index-info &&
+    git write-tree
+  ) &&
+
+  # Store the tree in a commit object.
+  echo 'data' | git commit-tree "$tree"
+}
+
+data_remove() {
+  test -z "$dry_run" || return 0
+  git ls-tree -r "$1" |
+  while read mode type obj name; do
+    # Remove ref only if it still has the data we expected.
+    git update-ref -d "refs/data/$name" "$obj" 2>/dev/null || true
+  done
+}
+
+data_report_and_remove() {
+  if test -n "$keep_data"; then
+    action="kept"
+  else
+    action="removed"
+    data_remove "$1" || true
+  fi &&
+  echo "Pushed refs/data and $action local copy:" &&
+  git ls-tree --name-only -r "$1" | sed "s/^/  /"
+}
+
+data_push_refspec() {
+  echo "$1:refs/data/commits/$1"
+}
+
+data_refs() {
+  git rev-list "$@" |
+  git diff-tree --no-commit-id --root -c -r --diff-filter=AM --stdin |
+  egrep '\.(md5)$' |
+  #     read :srcmode dstmode srcobj dstobj status file
+  while read  _       _       _      obj    _      file; do
+    # Identify the hash algorithm used.
+    case "$file" in
+      *.md5) algo=MD5 ; validate="^[0-9a-fA-F]{32}$" ;;
+      *) continue ;;
+    esac
+
+    # Load and validate the hash.
+    if hash=$(git cat-file blob $obj 2>/dev/null) &&
+        echo "$hash" | egrep-q "$validate"; then
+      echo "refs/data/$algo/$hash"
+    fi
+  done
+}
+
+#-----------------------------------------------------------------------------
+
+remote=''
+refspecs=''
+keep_data=''
+no_topic=''
+no_data=''
+dry_run=''
+
+# Parse command line options.
+while test $# != 0; do
+  case "$1" in
+    --keep-data) keep_data=1 ;;
+    --no-topic)  no_topic=1 ;;
+    --no-data)   no_data=1 ;;
+    --dry-run)   dry_run=--dry-run ;;
+    --) shift; break ;;
+    -*) usage ;;
+    *) test -z "$remote" || usage ; remote="$1" ;;
+  esac
+  shift
+done
+test $# = 0 || usage
+
+# Default remote.
+test -n "$remote" || remote="gerrit"
+
+if test -z "$no_topic"; then
+  # Identify and validate the topic branch name.
+  head="$(git symbolic-ref HEAD)" && topic="${head#refs/heads/}" || topic=''
+  if test -z "$topic" -o "$topic" = "master"; then
+    die 'Please name your topic:
+  git checkout -b descriptive-name'
+  fi
+  # The topic branch will be pushed by name.
+  refspecs="HEAD:refs/for/master/$topic $refspecs"
+fi
+
+# Fetch the current upstream master branch head.
+# This helps computation of a minimal pack to push.
+echo "Fetching $remote master"
+fetch_out=$(git fetch "$remote" master 2>&1) || die "$fetch_out"
+master=$(git rev-parse FETCH_HEAD) || exit
+
+if test -z "$no_data"; then
+  # Create a commit containing the data to push.
+  data_refs=$(data_refs $master..) &&
+  data=$(data_commit $data_refs) || die 'Failed to create data commit'
+  if test -n "$data"; then
+    refspecs="$(data_push_refspec "$data") $refspecs"
+  fi
+else
+  data=''
+fi
+
+# Exit early if we have nothing to push.
+if test -z "$refspecs"; then
+  echo 'Nothing to push!'
+  exit 0
+fi
+
+# Push.  Save output and exit code.
+echo "Pushing to $remote"
+push_stdout=$(git push --porcelain $dry_run "$remote" $refspecs); push_exit=$?
+echo "$push_stdout"
+
+# Check if data were pushed successfully.
+if test -n "$data" &&
+   echo "$push_stdout" | egrep-q "^[*=+]	$data"; then
+  data_report_and_remove "$data"
+fi
+
+# Reproduce the push exit code.
+exit $push_exit
diff --git a/Utilities/SetupForDevelopment.sh b/Utilities/SetupForDevelopment.sh
index 64fe7b9..9af3f8c 100755
--- a/Utilities/SetupForDevelopment.sh
+++ b/Utilities/SetupForDevelopment.sh
@@ -4,10 +4,8 @@ cd "${BASH_SOURCE%/*}/.." &&
 Utilities/GitSetup/setup-user && echo &&
 Utilities/GitSetup/setup-hooks && echo &&
 Utilities/Scripts/SetupGitAliases.sh && echo &&
-(Utilities/GitSetup/setup-upstream ||
- echo 'Failed to setup origin.  Run this again to retry.') && echo &&
-(Utilities/GitSetup/setup-gitlab ||
- echo 'Failed to setup GitLab.  Run this again to retry.') && echo &&
+(Utilities/GitSetup/setup-gerrit ||
+ echo 'Failed to setup Gerrit.  Run this again to retry.') && echo &&
 Utilities/Scripts/SetupExternalData.sh && echo &&
 Utilities/GitSetup/tips
 
@@ -15,10 +13,6 @@ Utilities/GitSetup/tips
 git config rebase.stat true
 git config branch.master.rebase true
 
-# Disable Gerrit hook explicitly so the commit-msg hook will
-# not complain even if some gerrit remotes are still configured.
-git config hooks.GerritId false
-
 # Record the version of this setup so Scripts/pre-commit can check it.
-SetupForDevelopment_VERSION=2
+SetupForDevelopment_VERSION=1
 git config hooks.SetupForDevelopment ${SetupForDevelopment_VERSION}
diff --git a/Utilities/vtkTclTest2Py/vtkConvertTclTestToPy.cmake b/Utilities/vtkTclTest2Py/vtkConvertTclTestToPy.cmake
new file mode 100644
index 0000000..c5348ed
--- /dev/null
+++ b/Utilities/vtkTclTest2Py/vtkConvertTclTestToPy.cmake
@@ -0,0 +1,74 @@
+# Macro to convert tcl tests to python and add those tests.
+# Assumes VTK_WRAP_PYTHON is on and PYTHON_EXECUTABLE is defined.
+MACRO (CONVERT_TCL_TEST_TO_PY tcl_tests kit_name)
+  IF(NOT "${${tcl_tests}}" STREQUAL "")
+    SET (input_dir ${VTK_SOURCE_DIR}/${kit_name}/Testing/Tcl)
+    SET (output_dir ${VTK_BINARY_DIR}/${kit_name}/Testing/Python)
+    SET (target_name ${kit_name}PythonTests)
+
+    SET(CMD ${PYTHON_EXECUTABLE})
+    SET (CONVERTED_TESTS)
+    SET (CONVERTER_SCRIPT "${VTK_BINARY_DIR}/Utilities/vtkTclTest2Py/vtkTclToPyConvertor.py")
+    SET (TESTS_TO_CONVERT)
+    SET (CONVERSIONLIST)
+
+    FOREACH(test ${${tcl_tests}})
+      SET(input "${input_dir}/${test}.tcl")
+      SET(output "${output_dir}/${test}.py")
+
+      SET (CONVERTED_TESTS ${CONVERTED_TESTS} "${output}")
+      SET (CONVERSIONLIST ${CONVERSIONLIST} "${input};${output}")
+      SET (TESTS_TO_CONVERT ${TESTS_TO_CONVERT} "${input}")
+
+      #Add the py test.
+      IF (${VTK_DATA_ROOT})
+        ADD_TEST(${test}Python ${VTK_PYTHON_EXE}
+          ${VTK_BINARY_DIR}/Utilities/vtkTclTest2Py/rtImageTest.py
+          ${output}
+          -D ${VTK_DATA_ROOT}
+          -T ${VTK_TEST_OUTPUT_DIR}
+          -V Baseline/${kit_name}/${test}.png
+          -A "${VTK_BINARY_DIR}/Utilities/vtkTclTest2Py"
+          -A "${VTK_LIBRARY_DIR}"
+          )
+      ELSE ()
+        ADD_TEST(${test}Python ${VTK_PYTHON_EXE}
+          ${VTK_BINARY_DIR}/Utilities/vtkTclTest2Py/rtImageTest.py
+          ${output}
+          -T ${VTK_TEST_OUTPUT_DIR}
+          -V Baseline/${kit_name}/${test}.png
+          -A "${VTK_BINARY_DIR}/Utilities/vtkTclTest2Py"
+          -A "${VTK_LIBRARY_DIR}"
+          )
+      ENDIF ()
+    ENDFOREACH()
+
+    CONFIGURE_FILE(
+      ${VTK_SOURCE_DIR}/Utilities/vtkTclTest2Py/vtkTestsToConvert.in
+      ${output_dir}/vtkTestsToConvert
+      @ONLY
+      )
+
+    ADD_CUSTOM_COMMAND(
+      OUTPUT "${output_dir}/conversion_complete"
+      COMMAND ${CMD}
+      ARGS ${CONVERTER_SCRIPT}
+      -l "${output_dir}/vtkTestsToConvert"
+      -t "${output_dir}/conversion_complete"
+      -A "${VTK_BINARY_DIR}/Utilities/vtkTclTest2Py"
+      -A "${VTK_BINARY_DIR}/Wrapping/Python"
+      -A "${VTK_LIBRARY_DIR}"
+      DEPENDS ${TESTS_TO_CONVERT}
+      ${output_dir}/vtkTestsToConvert
+      ${CONVERTER_SCRIPT}
+      COMMENT "Converting Tcl test"
+      )
+    ADD_CUSTOM_TARGET(${target_name} ALL DEPENDS
+      "${output_dir}/conversion_complete")
+
+    ADD_DEPENDENCIES(${target_name} vtktcltest2py_pyc)
+
+    # TODO: add explicit dependency between the vtk{Name}Kit.cmake files and the
+    # the test conversion.
+  ENDIF()
+ENDMACRO ()
diff --git a/Views/Core/vtkView.cxx b/Views/Core/vtkView.cxx
index eae55d3..4b532b8 100644
--- a/Views/Core/vtkView.cxx
+++ b/Views/Core/vtkView.cxx
@@ -184,7 +184,7 @@ vtkDataRepresentation* vtkView::SetRepresentationFromInputConnection(vtkAlgorith
 //----------------------------------------------------------------------------
 void vtkView::AddRepresentation(vtkDataRepresentation* rep)
 {
-  if (rep != NULL && !this->IsRepresentationPresent(rep))
+  if (!this->IsRepresentationPresent(rep))
     {
     if (rep->AddToView(this))
       {
diff --git a/Views/Infovis/Testing/Cxx/CMakeLists.txt b/Views/Infovis/Testing/Cxx/CMakeLists.txt
index 85349ab..1a648b7 100644
--- a/Views/Infovis/Testing/Cxx/CMakeLists.txt
+++ b/Views/Infovis/Testing/Cxx/CMakeLists.txt
@@ -1,14 +1,7 @@
-if(VTK_RENDERING_BACKEND STREQUAL "OpenGL2")
-  set(extra_opengl2_tests
-    # the following produce incorrect results in OpenGL
-    TestConeLayoutStrategy.cxx
-    )
-endif()
-
 vtk_add_test_cxx(${vtk-module}CxxTests tests
-  ${extra_opengl2_tests}
   TestCoincidentGraphLayoutView.cxx
   TestColumnTree.cxx
+  TestConeLayoutStrategy.cxx
   TestDendrogramItem.cxx
   TestGraphLayoutView.cxx
   TestHeatmapCategoryLegend.cxx
diff --git a/Views/Infovis/Testing/Data/Baseline/TestCoincidentGraphLayoutView.png.md5 b/Views/Infovis/Testing/Data/Baseline/TestCoincidentGraphLayoutView.png.md5
index e0d4456..93a241b 100644
--- a/Views/Infovis/Testing/Data/Baseline/TestCoincidentGraphLayoutView.png.md5
+++ b/Views/Infovis/Testing/Data/Baseline/TestCoincidentGraphLayoutView.png.md5
@@ -1 +1 @@
-1e57d319deb1b3542bc78aca68a9e877
+33daab90a05054167e71fbfa1d4e4580
diff --git a/Views/Infovis/Testing/Data/Baseline/TestColumnTree.png.md5 b/Views/Infovis/Testing/Data/Baseline/TestColumnTree.png.md5
index 2796c71..19b517f 100644
--- a/Views/Infovis/Testing/Data/Baseline/TestColumnTree.png.md5
+++ b/Views/Infovis/Testing/Data/Baseline/TestColumnTree.png.md5
@@ -1 +1 @@
-3786c828329f6c4cfb7dfa1d86c61421
+0d5c16b63e6da0d539268329b87ddd51
diff --git a/Views/Infovis/Testing/Data/Baseline/TestConeLayoutStrategy.png.md5 b/Views/Infovis/Testing/Data/Baseline/TestConeLayoutStrategy.png.md5
index 99a065c..d6d79bd 100644
--- a/Views/Infovis/Testing/Data/Baseline/TestConeLayoutStrategy.png.md5
+++ b/Views/Infovis/Testing/Data/Baseline/TestConeLayoutStrategy.png.md5
@@ -1 +1 @@
-dcedd666812674f4fe4829c3ebc4edc3
+e3e1f31b6d238602055f7f58dac034a3
diff --git a/Views/Infovis/Testing/Data/Baseline/TestConeLayoutStrategy_1.png.md5 b/Views/Infovis/Testing/Data/Baseline/TestConeLayoutStrategy_1.png.md5
index 7c2ecad..e84987a 100644
--- a/Views/Infovis/Testing/Data/Baseline/TestConeLayoutStrategy_1.png.md5
+++ b/Views/Infovis/Testing/Data/Baseline/TestConeLayoutStrategy_1.png.md5
@@ -1 +1 @@
-82c3ae482e46494ed58910ad790ba452
+f6d17a2c78fdbd24340dca2bff8914c6
diff --git a/Views/Infovis/Testing/Data/Baseline/TestConeLayoutStrategy_2.png.md5 b/Views/Infovis/Testing/Data/Baseline/TestConeLayoutStrategy_2.png.md5
new file mode 100644
index 0000000..aca10b0
--- /dev/null
+++ b/Views/Infovis/Testing/Data/Baseline/TestConeLayoutStrategy_2.png.md5
@@ -0,0 +1 @@
+4d66a2d1151a5bd77b1134eb9838822c
diff --git a/Views/Infovis/Testing/Data/Baseline/TestDendrogramItem.png.md5 b/Views/Infovis/Testing/Data/Baseline/TestDendrogramItem.png.md5
index 6ac84f5..6927ea7 100644
--- a/Views/Infovis/Testing/Data/Baseline/TestDendrogramItem.png.md5
+++ b/Views/Infovis/Testing/Data/Baseline/TestDendrogramItem.png.md5
@@ -1 +1 @@
-91f16ab9a1f0262d4654e399668b26ff
+142adb34c8192d5c184cb04eca3b59da
diff --git a/Views/Infovis/Testing/Data/Baseline/TestDendrogramItem_1.png.md5 b/Views/Infovis/Testing/Data/Baseline/TestDendrogramItem_1.png.md5
deleted file mode 100644
index fb4453d..0000000
--- a/Views/Infovis/Testing/Data/Baseline/TestDendrogramItem_1.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-7566224920f311cace36f8741f7a1180
diff --git a/Views/Infovis/Testing/Data/Baseline/TestGraphLayoutView.png.md5 b/Views/Infovis/Testing/Data/Baseline/TestGraphLayoutView.png.md5
index d832e14..53bd2ff 100644
--- a/Views/Infovis/Testing/Data/Baseline/TestGraphLayoutView.png.md5
+++ b/Views/Infovis/Testing/Data/Baseline/TestGraphLayoutView.png.md5
@@ -1 +1 @@
-657c5e78352f4d8b1eaa8de3f9653ce6
+f6ba0d03972acf7da46f584df0bc5701
diff --git a/Views/Infovis/Testing/Data/Baseline/TestHeatmapCategoryLegend.png.md5 b/Views/Infovis/Testing/Data/Baseline/TestHeatmapCategoryLegend.png.md5
index ee8b19e..6533139 100644
--- a/Views/Infovis/Testing/Data/Baseline/TestHeatmapCategoryLegend.png.md5
+++ b/Views/Infovis/Testing/Data/Baseline/TestHeatmapCategoryLegend.png.md5
@@ -1 +1 @@
-40da8554326f1e0e8198f9d2da46fcb0
+5e5f1fb61d8e3d907c5788bb8553253e
diff --git a/Views/Infovis/Testing/Data/Baseline/TestHeatmapItem.png.md5 b/Views/Infovis/Testing/Data/Baseline/TestHeatmapItem.png.md5
index fff7052..19c5229 100644
--- a/Views/Infovis/Testing/Data/Baseline/TestHeatmapItem.png.md5
+++ b/Views/Infovis/Testing/Data/Baseline/TestHeatmapItem.png.md5
@@ -1 +1 @@
-e5dbf8cc8c15c3b715a2461a73c63ec3
+cadc41b117b96aa790814a3f2f565835
diff --git a/Views/Infovis/Testing/Data/Baseline/TestHeatmapScalarLegend.png.md5 b/Views/Infovis/Testing/Data/Baseline/TestHeatmapScalarLegend.png.md5
index 4b63c99..d35ff5d 100644
--- a/Views/Infovis/Testing/Data/Baseline/TestHeatmapScalarLegend.png.md5
+++ b/Views/Infovis/Testing/Data/Baseline/TestHeatmapScalarLegend.png.md5
@@ -1 +1 @@
-bcab65ffdddcf6b07f66f6a2b2d5fbdf
+239d831ba3e70489d43cd823035395e7
diff --git a/Views/Infovis/Testing/Data/Baseline/TestHierarchicalGraphView.png.md5 b/Views/Infovis/Testing/Data/Baseline/TestHierarchicalGraphView.png.md5
index 8a3a720..f1f3fcc 100644
--- a/Views/Infovis/Testing/Data/Baseline/TestHierarchicalGraphView.png.md5
+++ b/Views/Infovis/Testing/Data/Baseline/TestHierarchicalGraphView.png.md5
@@ -1 +1 @@
-d20eb70b491a1aacbcbc70eb5770f15c
+40f1e078cef00e6445214403cc4f8c48
diff --git a/Views/Infovis/Testing/Data/Baseline/TestIcicleView.png.md5 b/Views/Infovis/Testing/Data/Baseline/TestIcicleView.png.md5
index 1128d7e..0d4cd03 100644
--- a/Views/Infovis/Testing/Data/Baseline/TestIcicleView.png.md5
+++ b/Views/Infovis/Testing/Data/Baseline/TestIcicleView.png.md5
@@ -1 +1 @@
-759b5df2fb4ef7447ad6b0ac02707be1
+25e4ee407be4f741ff235c67a5a5caa4
diff --git a/Views/Infovis/Testing/Data/Baseline/TestIcicleView_1.png.md5 b/Views/Infovis/Testing/Data/Baseline/TestIcicleView_1.png.md5
new file mode 100644
index 0000000..ac68d87
--- /dev/null
+++ b/Views/Infovis/Testing/Data/Baseline/TestIcicleView_1.png.md5
@@ -0,0 +1 @@
+79e73858ae946e4103e135a9a2db7c77
diff --git a/Views/Infovis/Testing/Data/Baseline/TestIcicleView_2.png.md5 b/Views/Infovis/Testing/Data/Baseline/TestIcicleView_2.png.md5
new file mode 100644
index 0000000..c9618bd
--- /dev/null
+++ b/Views/Infovis/Testing/Data/Baseline/TestIcicleView_2.png.md5
@@ -0,0 +1 @@
+3e4ff89a6370c341563b05d48731df1b
diff --git a/Views/Infovis/Testing/Data/Baseline/TestIcicleView_3.png.md5 b/Views/Infovis/Testing/Data/Baseline/TestIcicleView_3.png.md5
new file mode 100644
index 0000000..ef2782a
--- /dev/null
+++ b/Views/Infovis/Testing/Data/Baseline/TestIcicleView_3.png.md5
@@ -0,0 +1 @@
+52ed72ac0fde5076a505b2a4151ab416
diff --git a/Views/Infovis/Testing/Data/Baseline/TestIcicleView_4.png.md5 b/Views/Infovis/Testing/Data/Baseline/TestIcicleView_4.png.md5
new file mode 100644
index 0000000..6a7cf17
--- /dev/null
+++ b/Views/Infovis/Testing/Data/Baseline/TestIcicleView_4.png.md5
@@ -0,0 +1 @@
+69461bf9b8ac7092819f20f887af9158
diff --git a/Views/Infovis/Testing/Data/Baseline/TestIcicleView_5.png.md5 b/Views/Infovis/Testing/Data/Baseline/TestIcicleView_5.png.md5
new file mode 100644
index 0000000..98c301d
--- /dev/null
+++ b/Views/Infovis/Testing/Data/Baseline/TestIcicleView_5.png.md5
@@ -0,0 +1 @@
+2df1df764604e62b0228901f42b5090c
diff --git a/Views/Infovis/Testing/Data/Baseline/TestNetworkViews.png.md5 b/Views/Infovis/Testing/Data/Baseline/TestNetworkViews.png.md5
index 07a93a6..50ca8bb 100644
--- a/Views/Infovis/Testing/Data/Baseline/TestNetworkViews.png.md5
+++ b/Views/Infovis/Testing/Data/Baseline/TestNetworkViews.png.md5
@@ -1 +1 @@
-61eedffc56d63c8c50d8387d7ad0c670
+fda2c1313dbdd6948fcb4d56aa0ad518
diff --git a/Views/Infovis/Testing/Data/Baseline/TestParallelCoordinatesView.png.md5 b/Views/Infovis/Testing/Data/Baseline/TestParallelCoordinatesView.png.md5
index f0bc238..b2a9446 100644
--- a/Views/Infovis/Testing/Data/Baseline/TestParallelCoordinatesView.png.md5
+++ b/Views/Infovis/Testing/Data/Baseline/TestParallelCoordinatesView.png.md5
@@ -1 +1 @@
-7a2159150d8a6ef37db06affa929b2c1
+3c7ec97b31fc69be990d84cd031dcb8d
diff --git a/Views/Infovis/Testing/Data/Baseline/TestParallelCoordinatesView_1.png.md5 b/Views/Infovis/Testing/Data/Baseline/TestParallelCoordinatesView_1.png.md5
deleted file mode 100644
index 1890350..0000000
--- a/Views/Infovis/Testing/Data/Baseline/TestParallelCoordinatesView_1.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-eaa7d738a968bb9393252bbba26ea5c6
diff --git a/Views/Infovis/Testing/Data/Baseline/TestParallelCoordinatesView_2.png.md5 b/Views/Infovis/Testing/Data/Baseline/TestParallelCoordinatesView_2.png.md5
deleted file mode 100644
index 500fe14..0000000
--- a/Views/Infovis/Testing/Data/Baseline/TestParallelCoordinatesView_2.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-81c8d5be8e823133170e11b7951aa50c
diff --git a/Views/Infovis/Testing/Data/Baseline/TestSpanTreeLayoutStrategy.png.md5 b/Views/Infovis/Testing/Data/Baseline/TestSpanTreeLayoutStrategy.png.md5
index c393e1d..b1c66cc 100644
--- a/Views/Infovis/Testing/Data/Baseline/TestSpanTreeLayoutStrategy.png.md5
+++ b/Views/Infovis/Testing/Data/Baseline/TestSpanTreeLayoutStrategy.png.md5
@@ -1 +1 @@
-33ea58df307218060394798c815773e3
+860760a45e30224e4fb16b0ced855458
diff --git a/Views/Infovis/Testing/Data/Baseline/TestTanglegramItem.png.md5 b/Views/Infovis/Testing/Data/Baseline/TestTanglegramItem.png.md5
index d0d9ad7..7810d61 100644
--- a/Views/Infovis/Testing/Data/Baseline/TestTanglegramItem.png.md5
+++ b/Views/Infovis/Testing/Data/Baseline/TestTanglegramItem.png.md5
@@ -1 +1 @@
-c033114c7a9af92e6cd4b39dfad9b94d
+5548784a3f7181bc7c04c239180deac7
diff --git a/Views/Infovis/Testing/Data/Baseline/TestTanglegramItem_1.png.md5 b/Views/Infovis/Testing/Data/Baseline/TestTanglegramItem_1.png.md5
deleted file mode 100644
index b436594..0000000
--- a/Views/Infovis/Testing/Data/Baseline/TestTanglegramItem_1.png.md5
+++ /dev/null
@@ -1 +0,0 @@
-36a2f198a1a1e3d59c464b2071ae8bbf
diff --git a/Views/Infovis/Testing/Data/Baseline/TestTreeHeatmapAutoCollapse.png.md5 b/Views/Infovis/Testing/Data/Baseline/TestTreeHeatmapAutoCollapse.png.md5
index 2d087d7..471c0d5 100644
--- a/Views/Infovis/Testing/Data/Baseline/TestTreeHeatmapAutoCollapse.png.md5
+++ b/Views/Infovis/Testing/Data/Baseline/TestTreeHeatmapAutoCollapse.png.md5
@@ -1 +1 @@
-b3086a3d02f1de3cf30bbc6f283fca81
+d1ffa41cd988a64cfccf48f4daa4cb0a
diff --git a/Views/Infovis/Testing/Data/Baseline/TestTreeHeatmapItem.png.md5 b/Views/Infovis/Testing/Data/Baseline/TestTreeHeatmapItem.png.md5
index 3d5f4b6..4d7a976 100644
--- a/Views/Infovis/Testing/Data/Baseline/TestTreeHeatmapItem.png.md5
+++ b/Views/Infovis/Testing/Data/Baseline/TestTreeHeatmapItem.png.md5
@@ -1 +1 @@
-4a9557c36492f9e10f6410b4e31366c7
+c7dd8c6992c367f078617aa914750897
diff --git a/Views/Infovis/Testing/Data/Baseline/TestTreeMapView.png.md5 b/Views/Infovis/Testing/Data/Baseline/TestTreeMapView.png.md5
index ac89d43..eb893e1 100644
--- a/Views/Infovis/Testing/Data/Baseline/TestTreeMapView.png.md5
+++ b/Views/Infovis/Testing/Data/Baseline/TestTreeMapView.png.md5
@@ -1 +1 @@
-721473c6c00b0ccbced17b2d1ee8210d
+5850bf6330d8b55c9957642671ba34fe
diff --git a/Views/Infovis/Testing/Data/Baseline/TestTreeMapView_1.png.md5 b/Views/Infovis/Testing/Data/Baseline/TestTreeMapView_1.png.md5
new file mode 100644
index 0000000..8a24f80
--- /dev/null
+++ b/Views/Infovis/Testing/Data/Baseline/TestTreeMapView_1.png.md5
@@ -0,0 +1 @@
+59c64f1f578ef1129928e95cf17ac934
diff --git a/Views/Infovis/Testing/Data/Baseline/TestTreeMapView_2.png.md5 b/Views/Infovis/Testing/Data/Baseline/TestTreeMapView_2.png.md5
new file mode 100644
index 0000000..fa87613
--- /dev/null
+++ b/Views/Infovis/Testing/Data/Baseline/TestTreeMapView_2.png.md5
@@ -0,0 +1 @@
+ef441137e3ef90d350aaa53a55b44ee4
diff --git a/Views/Infovis/Testing/Data/Baseline/TestTreeMapView_3.png.md5 b/Views/Infovis/Testing/Data/Baseline/TestTreeMapView_3.png.md5
new file mode 100644
index 0000000..fa87613
--- /dev/null
+++ b/Views/Infovis/Testing/Data/Baseline/TestTreeMapView_3.png.md5
@@ -0,0 +1 @@
+ef441137e3ef90d350aaa53a55b44ee4
diff --git a/Views/Infovis/Testing/Data/Baseline/TestTreeRingView.png.md5 b/Views/Infovis/Testing/Data/Baseline/TestTreeRingView.png.md5
index a542714..4582f04 100644
--- a/Views/Infovis/Testing/Data/Baseline/TestTreeRingView.png.md5
+++ b/Views/Infovis/Testing/Data/Baseline/TestTreeRingView.png.md5
@@ -1 +1 @@
-1d0017d41fd423b046b5e649506e4fd5
+5238766c9e244d69b4aa526d78f04fce
diff --git a/Views/Infovis/Testing/Data/Baseline/TestTreeRingView_1.png.md5 b/Views/Infovis/Testing/Data/Baseline/TestTreeRingView_1.png.md5
new file mode 100644
index 0000000..421052e
--- /dev/null
+++ b/Views/Infovis/Testing/Data/Baseline/TestTreeRingView_1.png.md5
@@ -0,0 +1 @@
+26af24721d31323e258cf075b5550d8f
diff --git a/Views/Infovis/module.cmake b/Views/Infovis/module.cmake
index 822439d..edeb27b 100644
--- a/Views/Infovis/module.cmake
+++ b/Views/Infovis/module.cmake
@@ -17,6 +17,7 @@ vtk_module(vtkViewsInfovis
     vtkTestingRendering
     vtkIOInfovis
     vtkIOSQL
+    vtkRenderingFreeType${VTK_RENDERING_BACKEND}
     vtkRenderingContext${VTK_RENDERING_BACKEND}
     vtkViewsContext2D
   )
diff --git a/Views/Infovis/vtkSCurveSpline.cxx b/Views/Infovis/vtkSCurveSpline.cxx
index cb2ce19..9aabe70 100644
--- a/Views/Infovis/vtkSCurveSpline.cxx
+++ b/Views/Infovis/vtkSCurveSpline.cxx
@@ -124,7 +124,10 @@ void vtkSCurveSpline::Compute ()
   // copy the independent variables. Note that if the spline
   // is closed the first and last point are assumed repeated -
   // so we add and extra point
-  delete [] this->Intervals;
+  if (this->Intervals)
+    {
+    delete [] this->Intervals;
+    }
 
   if ( !this->Closed )
     {
@@ -139,7 +142,10 @@ void vtkSCurveSpline::Compute ()
     //    work = new double[size];
 
     // allocate memory for coefficients
-    delete [] this->Coefficients;
+    if (this->Coefficients)
+      {
+      delete [] this->Coefficients;
+      }
     this->Coefficients = new double [3*size];
 
     // allocate memory for dependent variables
@@ -188,7 +194,10 @@ void vtkSCurveSpline::Compute ()
     //    work = new double[size];
 
     // allocate memory for coefficients
-    delete [] this->Coefficients;
+    if (this->Coefficients)
+      {
+      delete [] this->Coefficients;
+      }
     //this->Coefficients = new double [4*size];
     this->Coefficients = new double [3*size];
 
diff --git a/Views/Infovis/vtkTreeHeatmapItem.cxx b/Views/Infovis/vtkTreeHeatmapItem.cxx
index 3697c12..10fb166 100644
--- a/Views/Infovis/vtkTreeHeatmapItem.cxx
+++ b/Views/Infovis/vtkTreeHeatmapItem.cxx
@@ -162,7 +162,7 @@ void vtkTreeHeatmapItem::SetColumnTree(vtkTree *tree)
     }
 
   if (this->Orientation == vtkDendrogramItem::LEFT_TO_RIGHT ||
-      this->Orientation == vtkDendrogramItem::RIGHT_TO_LEFT)
+      this->Orientation == vtkDendrogramItem::LEFT_TO_RIGHT)
     {
     this->ColumnDendrogram->SetOrientation(vtkDendrogramItem::UP_TO_DOWN);
     }
diff --git a/Views/Qt/CMakeLists.txt b/Views/Qt/CMakeLists.txt
index a356788..0bbe21d 100644
--- a/Views/Qt/CMakeLists.txt
+++ b/Views/Qt/CMakeLists.txt
@@ -20,7 +20,7 @@ set(MocHeaders
   )
 
 if(VTK_QT_VERSION VERSION_GREATER "4")
-  find_package(Qt5 COMPONENTS Widgets REQUIRED QUIET)
+  find_package(Qt5Widgets REQUIRED QUIET)
   include_directories(${Qt5Widgets_INCLUDE_DIRS})
   add_definitions(${Qt5Widgets_DEFINITIONS})
 
diff --git a/Views/Qt/vtkQtAnnotationView.cxx b/Views/Qt/vtkQtAnnotationView.cxx
index 7f57925..d096bb9 100644
--- a/Views/Qt/vtkQtAnnotationView.cxx
+++ b/Views/Qt/vtkQtAnnotationView.cxx
@@ -80,7 +80,10 @@ vtkQtAnnotationView::vtkQtAnnotationView()
 //----------------------------------------------------------------------------
 vtkQtAnnotationView::~vtkQtAnnotationView()
 {
-  delete this->View;
+  if(this->View)
+    {
+    delete this->View;
+    }
   delete this->Adapter;
 }
 
diff --git a/Views/Qt/vtkQtListView.cxx b/Views/Qt/vtkQtListView.cxx
index c7dbc3b..edd78fc 100644
--- a/Views/Qt/vtkQtListView.cxx
+++ b/Views/Qt/vtkQtListView.cxx
@@ -99,7 +99,10 @@ vtkQtListView::vtkQtListView()
 //----------------------------------------------------------------------------
 vtkQtListView::~vtkQtListView()
 {
-  delete this->ListView;
+  if(this->ListView)
+    {
+    delete this->ListView;
+    }
   delete this->TableAdapter;
 }
 
diff --git a/Views/Qt/vtkQtRecordView.cxx b/Views/Qt/vtkQtRecordView.cxx
index 0c4ade2..a77b171 100644
--- a/Views/Qt/vtkQtRecordView.cxx
+++ b/Views/Qt/vtkQtRecordView.cxx
@@ -55,7 +55,10 @@ vtkQtRecordView::vtkQtRecordView()
 //----------------------------------------------------------------------------
 vtkQtRecordView::~vtkQtRecordView()
 {
-  delete this->TextWidget;
+  if(this->TextWidget)
+    {
+    delete this->TextWidget;
+    }
 }
 
 //----------------------------------------------------------------------------
diff --git a/Views/Qt/vtkQtTableRepresentation.cxx b/Views/Qt/vtkQtTableRepresentation.cxx
index 4939eda..dd4ac02 100644
--- a/Views/Qt/vtkQtTableRepresentation.cxx
+++ b/Views/Qt/vtkQtTableRepresentation.cxx
@@ -66,7 +66,10 @@ vtkQtTableRepresentation::vtkQtTableRepresentation()
 
 vtkQtTableRepresentation::~vtkQtTableRepresentation()
 {
-  delete this->ModelAdapter;
+  if (this->ModelAdapter)
+    {
+    delete this->ModelAdapter;
+    }
   this->ColorTable->UnRegister(this);
   this->SeriesColors->UnRegister(this);
   this->SetKeyColumnInternal(NULL);
diff --git a/Views/Qt/vtkQtTableView.cxx b/Views/Qt/vtkQtTableView.cxx
index 1ef1f59..d091ad8 100644
--- a/Views/Qt/vtkQtTableView.cxx
+++ b/Views/Qt/vtkQtTableView.cxx
@@ -100,7 +100,10 @@ vtkQtTableView::vtkQtTableView()
 //----------------------------------------------------------------------------
 vtkQtTableView::~vtkQtTableView()
 {
-  delete this->TableView;
+  if(this->TableView)
+    {
+    delete this->TableView;
+    }
   delete this->TableAdapter;
   delete this->TableSorter;
   this->SetColumnName(0);
diff --git a/Views/Qt/vtkQtTreeView.cxx b/Views/Qt/vtkQtTreeView.cxx
index 25501dc..0fe6c31 100644
--- a/Views/Qt/vtkQtTreeView.cxx
+++ b/Views/Qt/vtkQtTreeView.cxx
@@ -123,11 +123,26 @@ vtkQtTreeView::vtkQtTreeView()
 //----------------------------------------------------------------------------
 vtkQtTreeView::~vtkQtTreeView()
 {
-  delete this->TreeView;
-  delete this->ColumnView;
-  delete this->Layout;
-  delete this->Widget;
-  delete this->SelectionModel;
+  if(this->TreeView)
+    {
+    delete this->TreeView;
+    }
+  if(this->ColumnView)
+    {
+    delete this->ColumnView;
+    }
+  if(this->Layout)
+    {
+    delete this->Layout;
+    }
+  if(this->Widget)
+    {
+    delete this->Widget;
+    }
+  if(this->SelectionModel)
+    {
+    delete this->SelectionModel;
+    }
   delete this->TreeAdapter;
   delete this->TreeFilter;
 }
diff --git a/Wrapping/Java/CMakeLists.txt b/Wrapping/Java/CMakeLists.txt
index 0016ac8..a19f75f 100644
--- a/Wrapping/Java/CMakeLists.txt
+++ b/Wrapping/Java/CMakeLists.txt
@@ -324,34 +324,22 @@ mark_as_advanced(VTK_JAVA_SOURCE_VERSION)
 set(VTK_JAVA_TARGET_VERSION "1.5" CACHE STRING "javac target version")
 mark_as_advanced(VTK_JAVA_TARGET_VERSION)
 
-# On machines with long paths to VTK (or windows where the command line length
-# is short), we cannot just list all the java files on the command line.  So
-# we put them in a response file and give that to javac
-# FIXME - Ideally we should make this run every build, but this is not well
-#          supported right now...
-add_custom_command(
-  OUTPUT ${VTK_BINARY_DIR}/java/javac_stamp.rsp
-  DEPENDS ${VTK_JAVA_SOURCE_FILES}
-  COMMAND ${CMAKE_COMMAND}
-          -DVTK_JAVA_SWT_COMPONENT=${VTK_JAVA_SWT_COMPONENT}
-          -DVTK_JAVA_JOGL_COMPONENT=${VTK_JAVA_JOGL_COMPONENT}
-          -DVTK_BINARY_DIR=${VTK_BINARY_DIR}
-          -DRSP_FILENAME=${VTK_BINARY_DIR}/java/javac_stamp.rsp
-          -P ${CMAKE_CURRENT_SOURCE_DIR}/MakeJavacResponseFile.cmake
-  COMMENT "Creating javac response file"
-  )
-
 # Compile the Java classes
 add_custom_command(
   OUTPUT ${VTK_BINARY_DIR}/java/javac_stamp.txt
-  DEPENDS ${VTK_BINARY_DIR}/java/javac_stamp.rsp ${VTK_JAVA_SOURCE_FILES}
+  DEPENDS ${VTK_JAVA_SOURCE_FILES}
   COMMAND ${JAVA_COMPILE} ${JAVAC_OPTIONS}
           -source ${VTK_JAVA_SOURCE_VERSION}
           -target ${VTK_JAVA_TARGET_VERSION}
           -classpath ${JAVA_COMPILATION_CLASSPATH}
           -sourcepath ${VTK_SOURCE_DIR}/Wrapping/Java/
           -d ${VTK_BINARY_DIR}/java
-          @${VTK_BINARY_DIR}/java/javac_stamp.rsp
+          ${VTK_BINARY_DIR}/java/vtk/*.java
+          ${VTK_BINARY_DIR}/java/vtk/rendering/*.java
+          ${VTK_BINARY_DIR}/java/vtk/rendering/awt/*.java
+          ${VTK_BINARY_DIR}/java/vtk/sample/*.java
+          ${SWT_FILES}
+          ${JOGL_FILES}
   COMMAND ${CMAKE_COMMAND} -E touch ${VTK_BINARY_DIR}/java/javac_stamp.txt
   COMMENT "Compiling Java Classes"
   )
diff --git a/Wrapping/Java/MakeJavacResponseFile.cmake b/Wrapping/Java/MakeJavacResponseFile.cmake
deleted file mode 100644
index e0c3751..0000000
--- a/Wrapping/Java/MakeJavacResponseFile.cmake
+++ /dev/null
@@ -1,29 +0,0 @@
-cmake_minimum_required(VERSION 2.8.8)
-
-file(GLOB vtk_java_files "${VTK_BINARY_DIR}/java/vtk/*.java")
-file(GLOB vtk_java_rendering_files "${VTK_BINARY_DIR}/java/vtk/rendering/*.java")
-file(GLOB vtk_java_rendering_awt_files "${VTK_BINARY_DIR}/java/vtk/rendering/awt/*.java")
-file(GLOB vtk_java_sample_files "${VTK_BINARY_DIR}/java/vtk/sample/*.java")
-
-set(all_vtk_java_files vtk_java_files vtk_java_rendering_files vtk_java_rendering_awt_files vtk_java_sample_files)
-
-if(VTK_JAVA_SWT_COMPONENT)
-  file(GLOB vtk_java_swt_files "${VTK_BINARY_DIR}/java/vtk/rendering/swt/*.java")
-  list(APPEND all_vtk_java_files vtk_java_swt_files)
-endif()
-
-if(VTK_JAVA_JOGL_COMPONENT)
-  file(GLOB vtk_java_jogl_files "${VTK_BINARY_DIR}/java/vtk/rendering/jogl/*.java")
-  list(APPEND vtk_java_jogl_files "${VTK_BINARY_DIR}/java/vtk/sample/rendering/JoglConeRendering.java")
-  list(APPEND all_vtk_java_files vtk_java_jogl_files)
-endif()
-
-set(CMAKE_CONFIGURABLE_FILE_CONTENT)
-foreach( java_file IN LISTS ${all_vtk_java_files} )
-  set(CMAKE_CONFIGURABLE_FILE_CONTENT "${CMAKE_CONFIGURABLE_FILE_CONTENT}\"${java_file}\"\n")
-endforeach()
-
-configure_file(
-  "${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in"
-  "${RSP_FILENAME}"
-  @ONLY)
diff --git a/Wrapping/Python/CMakeLists.txt b/Wrapping/Python/CMakeLists.txt
index d50e716..3e70d3b 100644
--- a/Wrapping/Python/CMakeLists.txt
+++ b/Wrapping/Python/CMakeLists.txt
@@ -1,23 +1,3 @@
-if (WIN32)
-  if (building_vtkpythonrc)
-    # XXX: With long paths, this command line can get too long because of all
-    # the include directories required for vtkpython to work. The thing is that
-    # CMake's RC rule in Ninja does not support response files, so the path can
-    # end up way too long. Since this doesn't need those include paths, act as
-    # if it is in a separate directory to avoid all the include_directories
-    # used here.
-    add_library(vtkpythonrc STATIC dummy.cxx vtkpython.rc)
-    return()
-  elseif (CMAKE_GENERATOR MATCHES "Visual Studio")
-    set(extra_srcs vtkpython.rc)
-  else ()
-    set(building_vtkpythonrc TRUE)
-    set(extra_links vtkpythonrc)
-    # Make a separate directory scope for building vtkpythonrc.
-    add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/vtkpythonrc")
-  endif ()
-endif ()
-
 # This is where we actually wrap the modules that have requested it.
 include(vtkPythonWrapping)
 
@@ -73,11 +53,7 @@ vtk_write_python_modules_header_for_wrapped_modules(
 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/vtkPythonAppInitConfigure.h.in
   ${CMAKE_CURRENT_BINARY_DIR}/vtkPythonAppInitConfigure.h)
 
-add_executable(vtkpython vtkPythonAppInit.cxx ${extra_srcs})
-
-if (WIN32)
-  target_link_libraries(vtkpython ${extra_links})
-endif ()
+add_executable(vtkpython vtkPythonAppInit.cxx vtkpython.rc)
 
 unset(VTKPYTHON_LINK_FLAGS)
 unset(VTKPYTHON_LINK_LIBS)
@@ -195,17 +171,12 @@ if(PYTHON_EXECUTABLE)
   foreach(module ${VTK_PYTHON_MODULES})
     set(VTK_PYTHON_IMPORT_ALL "${VTK_PYTHON_IMPORT_ALL}from ${module} import *\n")
     configure_file(vtk/module.py.in vtk/${module}.py @ONLY)
-    list(APPEND VTK_PYTHON_FILES
-      "${CMAKE_CURRENT_BINARY_DIR}/vtk/${module}.py")
   endforeach()
   configure_file(vtk/__init__.py.in vtk/__init__.py @ONLY)
-  list(APPEND VTK_PYTHON_FILES
-    "${CMAKE_CURRENT_BINARY_DIR}/vtk/__init__.py")
 
 # vtk.util package
   list(APPEND VTK_PYTHON_FILES
     vtk/util/__init__
-    vtk/util/_argparse
     vtk/util/vtkMethodParser
     vtk/util/misc
     vtk/util/vtkConstants
@@ -270,22 +241,18 @@ if(PYTHON_EXECUTABLE)
   unset(VTK_PYTHON_SOURCE_FILES)
   unset(VTK_PYTHON_OUTPUT_FILES)
   foreach(file ${VTK_PYTHON_FILES})
-    if (NOT IS_ABSOLUTE "${file}")
-      set(src "${CMAKE_CURRENT_BINARY_DIR}/${file}.py")
-      list(APPEND VTK_PYTHON_SOURCE_FILES "${src}")
-    endif ()
+    set(src "${CMAKE_CURRENT_BINARY_DIR}/${file}.py")
+    set(VTK_PYTHON_SOURCE_FILES ${VTK_PYTHON_SOURCE_FILES} ${src})
   endforeach()
 
   if(NOT "${VTK_BINARY_DIR}" MATCHES "^${VTK_SOURCE_DIR}$")
     foreach(file ${VTK_PYTHON_FILES})
-      if (NOT IS_ABSOLUTE "${file}")
-        set(src "${CMAKE_CURRENT_SOURCE_DIR}/${file}.py")
-        set(tgt "${CMAKE_CURRENT_BINARY_DIR}/${file}.py")
-        add_custom_command(DEPENDS ${src}
-          COMMAND ${CMAKE_COMMAND} -E copy ${src} ${tgt}
-          OUTPUT ${tgt}
-          COMMENT "source copy")
-      endif ()
+      set(src "${CMAKE_CURRENT_SOURCE_DIR}/${file}.py")
+      set(tgt "${CMAKE_CURRENT_BINARY_DIR}/${file}.py")
+      add_custom_command(DEPENDS ${src}
+        COMMAND ${CMAKE_COMMAND} -E copy ${src} ${tgt}
+        OUTPUT ${tgt}
+        COMMENT "source copy")
     endforeach()
   endif()
 
diff --git a/Wrapping/Python/dummy.cxx b/Wrapping/Python/dummy.cxx
deleted file mode 100644
index 3f693e0..0000000
--- a/Wrapping/Python/dummy.cxx
+++ /dev/null
@@ -1,4 +0,0 @@
-int dummy(int a)
-{
-  return a;
-}
diff --git a/Wrapping/Python/vtk/test/Testing.py b/Wrapping/Python/vtk/test/Testing.py
index 86532fc..d2651f5 100644
--- a/Wrapping/Python/vtk/test/Testing.py
+++ b/Wrapping/Python/vtk/test/Testing.py
@@ -255,12 +255,7 @@ def compareImage(renwin, img_fname, threshold=10):
     w2if.ReadFrontBufferOff()
     w2if.SetInput(renwin)
     w2if.Update()
-    try:
-        compareImageWithSavedImage(w2if, img_fname, threshold)
-    except RuntimeError:
-        w2if.ReadFrontBufferOn()
-        compareImageWithSavedImage(w2if, img_fname, threshold)
-    return
+    return compareImageWithSavedImage(w2if, img_fname, threshold)
 
 
 def _printCDashImageError(img_err, err_index, img_base):
diff --git a/Wrapping/Python/vtk/util/_argparse.py b/Wrapping/Python/vtk/util/_argparse.py
deleted file mode 100644
index 30bae57..0000000
--- a/Wrapping/Python/vtk/util/_argparse.py
+++ /dev/null
@@ -1,2361 +0,0 @@
-# Author: Steven J. Bethard <steven.bethard at gmail.com>.
-
-"""Command-line parsing library
-
-This module is an optparse-inspired command-line parsing library that:
-
-    - handles both optional and positional arguments
-    - produces highly informative usage messages
-    - supports parsers that dispatch to sub-parsers
-
-The following is a simple usage example that sums integers from the
-command-line and writes the result to a file::
-
-    parser = argparse.ArgumentParser(
-        description='sum the integers at the command line')
-    parser.add_argument(
-        'integers', metavar='int', nargs='+', type=int,
-        help='an integer to be summed')
-    parser.add_argument(
-        '--log', default=sys.stdout, type=argparse.FileType('w'),
-        help='the file where the sum should be written')
-    args = parser.parse_args()
-    args.log.write('%s' % sum(args.integers))
-    args.log.close()
-
-The module contains the following public classes:
-
-    - ArgumentParser -- The main entry point for command-line parsing. As the
-        example above shows, the add_argument() method is used to populate
-        the parser with actions for optional and positional arguments. Then
-        the parse_args() method is invoked to convert the args at the
-        command-line into an object with attributes.
-
-    - ArgumentError -- The exception raised by ArgumentParser objects when
-        there are errors with the parser's actions. Errors raised while
-        parsing the command-line are caught by ArgumentParser and emitted
-        as command-line messages.
-
-    - FileType -- A factory for defining types of files to be created. As the
-        example above shows, instances of FileType are typically passed as
-        the type= argument of add_argument() calls.
-
-    - Action -- The base class for parser actions. Typically actions are
-        selected by passing strings like 'store_true' or 'append_const' to
-        the action= argument of add_argument(). However, for greater
-        customization of ArgumentParser actions, subclasses of Action may
-        be defined and passed as the action= argument.
-
-    - HelpFormatter, RawDescriptionHelpFormatter, RawTextHelpFormatter,
-        ArgumentDefaultsHelpFormatter -- Formatter classes which
-        may be passed as the formatter_class= argument to the
-        ArgumentParser constructor. HelpFormatter is the default,
-        RawDescriptionHelpFormatter and RawTextHelpFormatter tell the parser
-        not to change the formatting for help text, and
-        ArgumentDefaultsHelpFormatter adds information about argument defaults
-        to the help.
-
-All other classes in this module are considered implementation details.
-(Also note that HelpFormatter and RawDescriptionHelpFormatter are only
-considered public as object names -- the API of the formatter objects is
-still considered an implementation detail.)
-"""
-
-__version__ = '1.1'
-__all__ = [
-    'ArgumentParser',
-    'ArgumentError',
-    'ArgumentTypeError',
-    'FileType',
-    'HelpFormatter',
-    'ArgumentDefaultsHelpFormatter',
-    'RawDescriptionHelpFormatter',
-    'RawTextHelpFormatter',
-    'Namespace',
-    'Action',
-    'ONE_OR_MORE',
-    'OPTIONAL',
-    'PARSER',
-    'REMAINDER',
-    'SUPPRESS',
-    'ZERO_OR_MORE',
-]
-
-
-import collections as _collections
-import copy as _copy
-import os as _os
-import re as _re
-import sys as _sys
-import textwrap as _textwrap
-
-from gettext import gettext as _
-
-
-def _callable(obj):
-    return hasattr(obj, '__call__') or hasattr(obj, '__bases__')
-
-
-SUPPRESS = '==SUPPRESS=='
-
-OPTIONAL = '?'
-ZERO_OR_MORE = '*'
-ONE_OR_MORE = '+'
-PARSER = 'A...'
-REMAINDER = '...'
-_UNRECOGNIZED_ARGS_ATTR = '_unrecognized_args'
-
-# =============================
-# Utility functions and classes
-# =============================
-
-class _AttributeHolder(object):
-    """Abstract base class that provides __repr__.
-
-    The __repr__ method returns a string in the format::
-        ClassName(attr=name, attr=name, ...)
-    The attributes are determined either by a class-level attribute,
-    '_kwarg_names', or by inspecting the instance __dict__.
-    """
-
-    def __repr__(self):
-        type_name = type(self).__name__
-        arg_strings = []
-        for arg in self._get_args():
-            arg_strings.append(repr(arg))
-        for name, value in self._get_kwargs():
-            arg_strings.append('%s=%r' % (name, value))
-        return '%s(%s)' % (type_name, ', '.join(arg_strings))
-
-    def _get_kwargs(self):
-        return sorted(self.__dict__.items())
-
-    def _get_args(self):
-        return []
-
-
-def _ensure_value(namespace, name, value):
-    if getattr(namespace, name, None) is None:
-        setattr(namespace, name, value)
-    return getattr(namespace, name)
-
-
-# ===============
-# Formatting Help
-# ===============
-
-class HelpFormatter(object):
-    """Formatter for generating usage messages and argument help strings.
-
-    Only the name of this class is considered a public API. All the methods
-    provided by the class are considered an implementation detail.
-    """
-
-    def __init__(self,
-                 prog,
-                 indent_increment=2,
-                 max_help_position=24,
-                 width=None):
-
-        # default setting for width
-        if width is None:
-            try:
-                width = int(_os.environ['COLUMNS'])
-            except (KeyError, ValueError):
-                width = 80
-            width -= 2
-
-        self._prog = prog
-        self._indent_increment = indent_increment
-        self._max_help_position = max_help_position
-        self._width = width
-
-        self._current_indent = 0
-        self._level = 0
-        self._action_max_length = 0
-
-        self._root_section = self._Section(self, None)
-        self._current_section = self._root_section
-
-        self._whitespace_matcher = _re.compile(r'\s+')
-        self._long_break_matcher = _re.compile(r'\n\n\n+')
-
-    # ===============================
-    # Section and indentation methods
-    # ===============================
-    def _indent(self):
-        self._current_indent += self._indent_increment
-        self._level += 1
-
-    def _dedent(self):
-        self._current_indent -= self._indent_increment
-        assert self._current_indent >= 0, 'Indent decreased below 0.'
-        self._level -= 1
-
-    class _Section(object):
-
-        def __init__(self, formatter, parent, heading=None):
-            self.formatter = formatter
-            self.parent = parent
-            self.heading = heading
-            self.items = []
-
-        def format_help(self):
-            # format the indented section
-            if self.parent is not None:
-                self.formatter._indent()
-            join = self.formatter._join_parts
-            for func, args in self.items:
-                func(*args)
-            item_help = join([func(*args) for func, args in self.items])
-            if self.parent is not None:
-                self.formatter._dedent()
-
-            # return nothing if the section was empty
-            if not item_help:
-                return ''
-
-            # add the heading if the section was non-empty
-            if self.heading is not SUPPRESS and self.heading is not None:
-                current_indent = self.formatter._current_indent
-                heading = '%*s%s:\n' % (current_indent, '', self.heading)
-            else:
-                heading = ''
-
-            # join the section-initial newline, the heading and the help
-            return join(['\n', heading, item_help, '\n'])
-
-    def _add_item(self, func, args):
-        self._current_section.items.append((func, args))
-
-    # ========================
-    # Message building methods
-    # ========================
-    def start_section(self, heading):
-        self._indent()
-        section = self._Section(self, self._current_section, heading)
-        self._add_item(section.format_help, [])
-        self._current_section = section
-
-    def end_section(self):
-        self._current_section = self._current_section.parent
-        self._dedent()
-
-    def add_text(self, text):
-        if text is not SUPPRESS and text is not None:
-            self._add_item(self._format_text, [text])
-
-    def add_usage(self, usage, actions, groups, prefix=None):
-        if usage is not SUPPRESS:
-            args = usage, actions, groups, prefix
-            self._add_item(self._format_usage, args)
-
-    def add_argument(self, action):
-        if action.help is not SUPPRESS:
-
-            # find all invocations
-            get_invocation = self._format_action_invocation
-            invocations = [get_invocation(action)]
-            for subaction in self._iter_indented_subactions(action):
-                invocations.append(get_invocation(subaction))
-
-            # update the maximum item length
-            invocation_length = max([len(s) for s in invocations])
-            action_length = invocation_length + self._current_indent
-            self._action_max_length = max(self._action_max_length,
-                                          action_length)
-
-            # add the item to the list
-            self._add_item(self._format_action, [action])
-
-    def add_arguments(self, actions):
-        for action in actions:
-            self.add_argument(action)
-
-    # =======================
-    # Help-formatting methods
-    # =======================
-    def format_help(self):
-        help = self._root_section.format_help()
-        if help:
-            help = self._long_break_matcher.sub('\n\n', help)
-            help = help.strip('\n') + '\n'
-        return help
-
-    def _join_parts(self, part_strings):
-        return ''.join([part
-                        for part in part_strings
-                        if part and part is not SUPPRESS])
-
-    def _format_usage(self, usage, actions, groups, prefix):
-        if prefix is None:
-            prefix = _('usage: ')
-
-        # if usage is specified, use that
-        if usage is not None:
-            usage = usage % dict(prog=self._prog)
-
-        # if no optionals or positionals are available, usage is just prog
-        elif usage is None and not actions:
-            usage = '%(prog)s' % dict(prog=self._prog)
-
-        # if optionals and positionals are available, calculate usage
-        elif usage is None:
-            prog = '%(prog)s' % dict(prog=self._prog)
-
-            # split optionals from positionals
-            optionals = []
-            positionals = []
-            for action in actions:
-                if action.option_strings:
-                    optionals.append(action)
-                else:
-                    positionals.append(action)
-
-            # build full usage string
-            format = self._format_actions_usage
-            action_usage = format(optionals + positionals, groups)
-            usage = ' '.join([s for s in [prog, action_usage] if s])
-
-            # wrap the usage parts if it's too long
-            text_width = self._width - self._current_indent
-            if len(prefix) + len(usage) > text_width:
-
-                # break usage into wrappable parts
-                part_regexp = r'\(.*?\)+|\[.*?\]+|\S+'
-                opt_usage = format(optionals, groups)
-                pos_usage = format(positionals, groups)
-                opt_parts = _re.findall(part_regexp, opt_usage)
-                pos_parts = _re.findall(part_regexp, pos_usage)
-                assert ' '.join(opt_parts) == opt_usage
-                assert ' '.join(pos_parts) == pos_usage
-
-                # helper for wrapping lines
-                def get_lines(parts, indent, prefix=None):
-                    lines = []
-                    line = []
-                    if prefix is not None:
-                        line_len = len(prefix) - 1
-                    else:
-                        line_len = len(indent) - 1
-                    for part in parts:
-                        if line_len + 1 + len(part) > text_width:
-                            lines.append(indent + ' '.join(line))
-                            line = []
-                            line_len = len(indent) - 1
-                        line.append(part)
-                        line_len += len(part) + 1
-                    if line:
-                        lines.append(indent + ' '.join(line))
-                    if prefix is not None:
-                        lines[0] = lines[0][len(indent):]
-                    return lines
-
-                # if prog is short, follow it with optionals or positionals
-                if len(prefix) + len(prog) <= 0.75 * text_width:
-                    indent = ' ' * (len(prefix) + len(prog) + 1)
-                    if opt_parts:
-                        lines = get_lines([prog] + opt_parts, indent, prefix)
-                        lines.extend(get_lines(pos_parts, indent))
-                    elif pos_parts:
-                        lines = get_lines([prog] + pos_parts, indent, prefix)
-                    else:
-                        lines = [prog]
-
-                # if prog is long, put it on its own line
-                else:
-                    indent = ' ' * len(prefix)
-                    parts = opt_parts + pos_parts
-                    lines = get_lines(parts, indent)
-                    if len(lines) > 1:
-                        lines = []
-                        lines.extend(get_lines(opt_parts, indent))
-                        lines.extend(get_lines(pos_parts, indent))
-                    lines = [prog] + lines
-
-                # join lines into usage
-                usage = '\n'.join(lines)
-
-        # prefix with 'usage:'
-        return '%s%s\n\n' % (prefix, usage)
-
-    def _format_actions_usage(self, actions, groups):
-        # find group indices and identify actions in groups
-        group_actions = set()
-        inserts = {}
-        for group in groups:
-            try:
-                start = actions.index(group._group_actions[0])
-            except ValueError:
-                continue
-            else:
-                end = start + len(group._group_actions)
-                if actions[start:end] == group._group_actions:
-                    for action in group._group_actions:
-                        group_actions.add(action)
-                    if not group.required:
-                        if start in inserts:
-                            inserts[start] += ' ['
-                        else:
-                            inserts[start] = '['
-                        inserts[end] = ']'
-                    else:
-                        if start in inserts:
-                            inserts[start] += ' ('
-                        else:
-                            inserts[start] = '('
-                        inserts[end] = ')'
-                    for i in range(start + 1, end):
-                        inserts[i] = '|'
-
-        # collect all actions format strings
-        parts = []
-        for i, action in enumerate(actions):
-
-            # suppressed arguments are marked with None
-            # remove | separators for suppressed arguments
-            if action.help is SUPPRESS:
-                parts.append(None)
-                if inserts.get(i) == '|':
-                    inserts.pop(i)
-                elif inserts.get(i + 1) == '|':
-                    inserts.pop(i + 1)
-
-            # produce all arg strings
-            elif not action.option_strings:
-                part = self._format_args(action, action.dest)
-
-                # if it's in a group, strip the outer []
-                if action in group_actions:
-                    if part[0] == '[' and part[-1] == ']':
-                        part = part[1:-1]
-
-                # add the action string to the list
-                parts.append(part)
-
-            # produce the first way to invoke the option in brackets
-            else:
-                option_string = action.option_strings[0]
-
-                # if the Optional doesn't take a value, format is:
-                #    -s or --long
-                if action.nargs == 0:
-                    part = '%s' % option_string
-
-                # if the Optional takes a value, format is:
-                #    -s ARGS or --long ARGS
-                else:
-                    default = action.dest.upper()
-                    args_string = self._format_args(action, default)
-                    part = '%s %s' % (option_string, args_string)
-
-                # make it look optional if it's not required or in a group
-                if not action.required and action not in group_actions:
-                    part = '[%s]' % part
-
-                # add the action string to the list
-                parts.append(part)
-
-        # insert things at the necessary indices
-        for i in sorted(inserts, reverse=True):
-            parts[i:i] = [inserts[i]]
-
-        # join all the action items with spaces
-        text = ' '.join([item for item in parts if item is not None])
-
-        # clean up separators for mutually exclusive groups
-        open = r'[\[(]'
-        close = r'[\])]'
-        text = _re.sub(r'(%s) ' % open, r'\1', text)
-        text = _re.sub(r' (%s)' % close, r'\1', text)
-        text = _re.sub(r'%s *%s' % (open, close), r'', text)
-        text = _re.sub(r'\(([^|]*)\)', r'\1', text)
-        text = text.strip()
-
-        # return the text
-        return text
-
-    def _format_text(self, text):
-        if '%(prog)' in text:
-            text = text % dict(prog=self._prog)
-        text_width = self._width - self._current_indent
-        indent = ' ' * self._current_indent
-        return self._fill_text(text, text_width, indent) + '\n\n'
-
-    def _format_action(self, action):
-        # determine the required width and the entry label
-        help_position = min(self._action_max_length + 2,
-                            self._max_help_position)
-        help_width = self._width - help_position
-        action_width = help_position - self._current_indent - 2
-        action_header = self._format_action_invocation(action)
-
-        # ho nelp; start on same line and add a final newline
-        if not action.help:
-            tup = self._current_indent, '', action_header
-            action_header = '%*s%s\n' % tup
-
-        # short action name; start on the same line and pad two spaces
-        elif len(action_header) <= action_width:
-            tup = self._current_indent, '', action_width, action_header
-            action_header = '%*s%-*s  ' % tup
-            indent_first = 0
-
-        # long action name; start on the next line
-        else:
-            tup = self._current_indent, '', action_header
-            action_header = '%*s%s\n' % tup
-            indent_first = help_position
-
-        # collect the pieces of the action help
-        parts = [action_header]
-
-        # if there was help for the action, add lines of help text
-        if action.help:
-            help_text = self._expand_help(action)
-            help_lines = self._split_lines(help_text, help_width)
-            parts.append('%*s%s\n' % (indent_first, '', help_lines[0]))
-            for line in help_lines[1:]:
-                parts.append('%*s%s\n' % (help_position, '', line))
-
-        # or add a newline if the description doesn't end with one
-        elif not action_header.endswith('\n'):
-            parts.append('\n')
-
-        # if there are any sub-actions, add their help as well
-        for subaction in self._iter_indented_subactions(action):
-            parts.append(self._format_action(subaction))
-
-        # return a single string
-        return self._join_parts(parts)
-
-    def _format_action_invocation(self, action):
-        if not action.option_strings:
-            metavar, = self._metavar_formatter(action, action.dest)(1)
-            return metavar
-
-        else:
-            parts = []
-
-            # if the Optional doesn't take a value, format is:
-            #    -s, --long
-            if action.nargs == 0:
-                parts.extend(action.option_strings)
-
-            # if the Optional takes a value, format is:
-            #    -s ARGS, --long ARGS
-            else:
-                default = action.dest.upper()
-                args_string = self._format_args(action, default)
-                for option_string in action.option_strings:
-                    parts.append('%s %s' % (option_string, args_string))
-
-            return ', '.join(parts)
-
-    def _metavar_formatter(self, action, default_metavar):
-        if action.metavar is not None:
-            result = action.metavar
-        elif action.choices is not None:
-            choice_strs = [str(choice) for choice in action.choices]
-            result = '{%s}' % ','.join(choice_strs)
-        else:
-            result = default_metavar
-
-        def format(tuple_size):
-            if isinstance(result, tuple):
-                return result
-            else:
-                return (result, ) * tuple_size
-        return format
-
-    def _format_args(self, action, default_metavar):
-        get_metavar = self._metavar_formatter(action, default_metavar)
-        if action.nargs is None:
-            result = '%s' % get_metavar(1)
-        elif action.nargs == OPTIONAL:
-            result = '[%s]' % get_metavar(1)
-        elif action.nargs == ZERO_OR_MORE:
-            result = '[%s [%s ...]]' % get_metavar(2)
-        elif action.nargs == ONE_OR_MORE:
-            result = '%s [%s ...]' % get_metavar(2)
-        elif action.nargs == REMAINDER:
-            result = '...'
-        elif action.nargs == PARSER:
-            result = '%s ...' % get_metavar(1)
-        else:
-            formats = ['%s' for _ in range(action.nargs)]
-            result = ' '.join(formats) % get_metavar(action.nargs)
-        return result
-
-    def _expand_help(self, action):
-        params = dict(vars(action), prog=self._prog)
-        for name in list(params):
-            if params[name] is SUPPRESS:
-                del params[name]
-        for name in list(params):
-            if hasattr(params[name], '__name__'):
-                params[name] = params[name].__name__
-        if params.get('choices') is not None:
-            choices_str = ', '.join([str(c) for c in params['choices']])
-            params['choices'] = choices_str
-        return self._get_help_string(action) % params
-
-    def _iter_indented_subactions(self, action):
-        try:
-            get_subactions = action._get_subactions
-        except AttributeError:
-            pass
-        else:
-            self._indent()
-            for subaction in get_subactions():
-                yield subaction
-            self._dedent()
-
-    def _split_lines(self, text, width):
-        text = self._whitespace_matcher.sub(' ', text).strip()
-        return _textwrap.wrap(text, width)
-
-    def _fill_text(self, text, width, indent):
-        text = self._whitespace_matcher.sub(' ', text).strip()
-        return _textwrap.fill(text, width, initial_indent=indent,
-                                           subsequent_indent=indent)
-
-    def _get_help_string(self, action):
-        return action.help
-
-
-class RawDescriptionHelpFormatter(HelpFormatter):
-    """Help message formatter which retains any formatting in descriptions.
-
-    Only the name of this class is considered a public API. All the methods
-    provided by the class are considered an implementation detail.
-    """
-
-    def _fill_text(self, text, width, indent):
-        return ''.join([indent + line for line in text.splitlines(True)])
-
-
-class RawTextHelpFormatter(RawDescriptionHelpFormatter):
-    """Help message formatter which retains formatting of all help text.
-
-    Only the name of this class is considered a public API. All the methods
-    provided by the class are considered an implementation detail.
-    """
-
-    def _split_lines(self, text, width):
-        return text.splitlines()
-
-
-class ArgumentDefaultsHelpFormatter(HelpFormatter):
-    """Help message formatter which adds default values to argument help.
-
-    Only the name of this class is considered a public API. All the methods
-    provided by the class are considered an implementation detail.
-    """
-
-    def _get_help_string(self, action):
-        help = action.help
-        if '%(default)' not in action.help:
-            if action.default is not SUPPRESS:
-                defaulting_nargs = [OPTIONAL, ZERO_OR_MORE]
-                if action.option_strings or action.nargs in defaulting_nargs:
-                    help += ' (default: %(default)s)'
-        return help
-
-
-# =====================
-# Options and Arguments
-# =====================
-
-def _get_action_name(argument):
-    if argument is None:
-        return None
-    elif argument.option_strings:
-        return  '/'.join(argument.option_strings)
-    elif argument.metavar not in (None, SUPPRESS):
-        return argument.metavar
-    elif argument.dest not in (None, SUPPRESS):
-        return argument.dest
-    else:
-        return None
-
-
-class ArgumentError(Exception):
-    """An error from creating or using an argument (optional or positional).
-
-    The string value of this exception is the message, augmented with
-    information about the argument that caused it.
-    """
-
-    def __init__(self, argument, message):
-        self.argument_name = _get_action_name(argument)
-        self.message = message
-
-    def __str__(self):
-        if self.argument_name is None:
-            format = '%(message)s'
-        else:
-            format = 'argument %(argument_name)s: %(message)s'
-        return format % dict(message=self.message,
-                             argument_name=self.argument_name)
-
-
-class ArgumentTypeError(Exception):
-    """An error from trying to convert a command line string to a type."""
-    pass
-
-
-# ==============
-# Action classes
-# ==============
-
-class Action(_AttributeHolder):
-    """Information about how to convert command line strings to Python objects.
-
-    Action objects are used by an ArgumentParser to represent the information
-    needed to parse a single argument from one or more strings from the
-    command line. The keyword arguments to the Action constructor are also
-    all attributes of Action instances.
-
-    Keyword Arguments:
-
-        - option_strings -- A list of command-line option strings which
-            should be associated with this action.
-
-        - dest -- The name of the attribute to hold the created object(s)
-
-        - nargs -- The number of command-line arguments that should be
-            consumed. By default, one argument will be consumed and a single
-            value will be produced.  Other values include:
-                - N (an integer) consumes N arguments (and produces a list)
-                - '?' consumes zero or one arguments
-                - '*' consumes zero or more arguments (and produces a list)
-                - '+' consumes one or more arguments (and produces a list)
-            Note that the difference between the default and nargs=1 is that
-            with the default, a single value will be produced, while with
-            nargs=1, a list containing a single value will be produced.
-
-        - const -- The value to be produced if the option is specified and the
-            option uses an action that takes no values.
-
-        - default -- The value to be produced if the option is not specified.
-
-        - type -- A callable that accepts a single string argument, and
-            returns the converted value.  The standard Python types str, int,
-            float, and complex are useful examples of such callables.  If None,
-            str is used.
-
-        - choices -- A container of values that should be allowed. If not None,
-            after a command-line argument has been converted to the appropriate
-            type, an exception will be raised if it is not a member of this
-            collection.
-
-        - required -- True if the action must always be specified at the
-            command line. This is only meaningful for optional command-line
-            arguments.
-
-        - help -- The help string describing the argument.
-
-        - metavar -- The name to be used for the option's argument with the
-            help string. If None, the 'dest' value will be used as the name.
-    """
-
-    def __init__(self,
-                 option_strings,
-                 dest,
-                 nargs=None,
-                 const=None,
-                 default=None,
-                 type=None,
-                 choices=None,
-                 required=False,
-                 help=None,
-                 metavar=None):
-        self.option_strings = option_strings
-        self.dest = dest
-        self.nargs = nargs
-        self.const = const
-        self.default = default
-        self.type = type
-        self.choices = choices
-        self.required = required
-        self.help = help
-        self.metavar = metavar
-
-    def _get_kwargs(self):
-        names = [
-            'option_strings',
-            'dest',
-            'nargs',
-            'const',
-            'default',
-            'type',
-            'choices',
-            'help',
-            'metavar',
-        ]
-        return [(name, getattr(self, name)) for name in names]
-
-    def __call__(self, parser, namespace, values, option_string=None):
-        raise NotImplementedError(_('.__call__() not defined'))
-
-
-class _StoreAction(Action):
-
-    def __init__(self,
-                 option_strings,
-                 dest,
-                 nargs=None,
-                 const=None,
-                 default=None,
-                 type=None,
-                 choices=None,
-                 required=False,
-                 help=None,
-                 metavar=None):
-        if nargs == 0:
-            raise ValueError('nargs for store actions must be > 0; if you '
-                             'have nothing to store, actions such as store '
-                             'true or store const may be more appropriate')
-        if const is not None and nargs != OPTIONAL:
-            raise ValueError('nargs must be %r to supply const' % OPTIONAL)
-        super(_StoreAction, self).__init__(
-            option_strings=option_strings,
-            dest=dest,
-            nargs=nargs,
-            const=const,
-            default=default,
-            type=type,
-            choices=choices,
-            required=required,
-            help=help,
-            metavar=metavar)
-
-    def __call__(self, parser, namespace, values, option_string=None):
-        setattr(namespace, self.dest, values)
-
-
-class _StoreConstAction(Action):
-
-    def __init__(self,
-                 option_strings,
-                 dest,
-                 const,
-                 default=None,
-                 required=False,
-                 help=None,
-                 metavar=None):
-        super(_StoreConstAction, self).__init__(
-            option_strings=option_strings,
-            dest=dest,
-            nargs=0,
-            const=const,
-            default=default,
-            required=required,
-            help=help)
-
-    def __call__(self, parser, namespace, values, option_string=None):
-        setattr(namespace, self.dest, self.const)
-
-
-class _StoreTrueAction(_StoreConstAction):
-
-    def __init__(self,
-                 option_strings,
-                 dest,
-                 default=False,
-                 required=False,
-                 help=None):
-        super(_StoreTrueAction, self).__init__(
-            option_strings=option_strings,
-            dest=dest,
-            const=True,
-            default=default,
-            required=required,
-            help=help)
-
-
-class _StoreFalseAction(_StoreConstAction):
-
-    def __init__(self,
-                 option_strings,
-                 dest,
-                 default=True,
-                 required=False,
-                 help=None):
-        super(_StoreFalseAction, self).__init__(
-            option_strings=option_strings,
-            dest=dest,
-            const=False,
-            default=default,
-            required=required,
-            help=help)
-
-
-class _AppendAction(Action):
-
-    def __init__(self,
-                 option_strings,
-                 dest,
-                 nargs=None,
-                 const=None,
-                 default=None,
-                 type=None,
-                 choices=None,
-                 required=False,
-                 help=None,
-                 metavar=None):
-        if nargs == 0:
-            raise ValueError('nargs for append actions must be > 0; if arg '
-                             'strings are not supplying the value to append, '
-                             'the append const action may be more appropriate')
-        if const is not None and nargs != OPTIONAL:
-            raise ValueError('nargs must be %r to supply const' % OPTIONAL)
-        super(_AppendAction, self).__init__(
-            option_strings=option_strings,
-            dest=dest,
-            nargs=nargs,
-            const=const,
-            default=default,
-            type=type,
-            choices=choices,
-            required=required,
-            help=help,
-            metavar=metavar)
-
-    def __call__(self, parser, namespace, values, option_string=None):
-        items = _copy.copy(_ensure_value(namespace, self.dest, []))
-        items.append(values)
-        setattr(namespace, self.dest, items)
-
-
-class _AppendConstAction(Action):
-
-    def __init__(self,
-                 option_strings,
-                 dest,
-                 const,
-                 default=None,
-                 required=False,
-                 help=None,
-                 metavar=None):
-        super(_AppendConstAction, self).__init__(
-            option_strings=option_strings,
-            dest=dest,
-            nargs=0,
-            const=const,
-            default=default,
-            required=required,
-            help=help,
-            metavar=metavar)
-
-    def __call__(self, parser, namespace, values, option_string=None):
-        items = _copy.copy(_ensure_value(namespace, self.dest, []))
-        items.append(self.const)
-        setattr(namespace, self.dest, items)
-
-
-class _CountAction(Action):
-
-    def __init__(self,
-                 option_strings,
-                 dest,
-                 default=None,
-                 required=False,
-                 help=None):
-        super(_CountAction, self).__init__(
-            option_strings=option_strings,
-            dest=dest,
-            nargs=0,
-            default=default,
-            required=required,
-            help=help)
-
-    def __call__(self, parser, namespace, values, option_string=None):
-        new_count = _ensure_value(namespace, self.dest, 0) + 1
-        setattr(namespace, self.dest, new_count)
-
-
-class _HelpAction(Action):
-
-    def __init__(self,
-                 option_strings,
-                 dest=SUPPRESS,
-                 default=SUPPRESS,
-                 help=None):
-        super(_HelpAction, self).__init__(
-            option_strings=option_strings,
-            dest=dest,
-            default=default,
-            nargs=0,
-            help=help)
-
-    def __call__(self, parser, namespace, values, option_string=None):
-        parser.print_help()
-        parser.exit()
-
-
-class _VersionAction(Action):
-
-    def __init__(self,
-                 option_strings,
-                 version=None,
-                 dest=SUPPRESS,
-                 default=SUPPRESS,
-                 help="show program's version number and exit"):
-        super(_VersionAction, self).__init__(
-            option_strings=option_strings,
-            dest=dest,
-            default=default,
-            nargs=0,
-            help=help)
-        self.version = version
-
-    def __call__(self, parser, namespace, values, option_string=None):
-        version = self.version
-        if version is None:
-            version = parser.version
-        formatter = parser._get_formatter()
-        formatter.add_text(version)
-        parser.exit(message=formatter.format_help())
-
-
-class _SubParsersAction(Action):
-
-    class _ChoicesPseudoAction(Action):
-
-        def __init__(self, name, help):
-            sup = super(_SubParsersAction._ChoicesPseudoAction, self)
-            sup.__init__(option_strings=[], dest=name, help=help)
-
-    def __init__(self,
-                 option_strings,
-                 prog,
-                 parser_class,
-                 dest=SUPPRESS,
-                 help=None,
-                 metavar=None):
-
-        self._prog_prefix = prog
-        self._parser_class = parser_class
-        self._name_parser_map = _collections.OrderedDict()
-        self._choices_actions = []
-
-        super(_SubParsersAction, self).__init__(
-            option_strings=option_strings,
-            dest=dest,
-            nargs=PARSER,
-            choices=self._name_parser_map,
-            help=help,
-            metavar=metavar)
-
-    def add_parser(self, name, **kwargs):
-        # set prog from the existing prefix
-        if kwargs.get('prog') is None:
-            kwargs['prog'] = '%s %s' % (self._prog_prefix, name)
-
-        # create a pseudo-action to hold the choice help
-        if 'help' in kwargs:
-            help = kwargs.pop('help')
-            choice_action = self._ChoicesPseudoAction(name, help)
-            self._choices_actions.append(choice_action)
-
-        # create the parser and add it to the map
-        parser = self._parser_class(**kwargs)
-        self._name_parser_map[name] = parser
-        return parser
-
-    def _get_subactions(self):
-        return self._choices_actions
-
-    def __call__(self, parser, namespace, values, option_string=None):
-        parser_name = values[0]
-        arg_strings = values[1:]
-
-        # set the parser name if requested
-        if self.dest is not SUPPRESS:
-            setattr(namespace, self.dest, parser_name)
-
-        # select the parser
-        try:
-            parser = self._name_parser_map[parser_name]
-        except KeyError:
-            tup = parser_name, ', '.join(self._name_parser_map)
-            msg = _('unknown parser %r (choices: %s)') % tup
-            raise ArgumentError(self, msg)
-
-        # parse all the remaining options into the namespace
-        # store any unrecognized options on the object, so that the top
-        # level parser can decide what to do with them
-        namespace, arg_strings = parser.parse_known_args(arg_strings, namespace)
-        if arg_strings:
-            vars(namespace).setdefault(_UNRECOGNIZED_ARGS_ATTR, [])
-            getattr(namespace, _UNRECOGNIZED_ARGS_ATTR).extend(arg_strings)
-
-
-# ==============
-# Type classes
-# ==============
-
-class FileType(object):
-    """Factory for creating file object types
-
-    Instances of FileType are typically passed as type= arguments to the
-    ArgumentParser add_argument() method.
-
-    Keyword Arguments:
-        - mode -- A string indicating how the file is to be opened. Accepts the
-            same values as the builtin open() function.
-        - bufsize -- The file's desired buffer size. Accepts the same values as
-            the builtin open() function.
-    """
-
-    def __init__(self, mode='r', bufsize=-1):
-        self._mode = mode
-        self._bufsize = bufsize
-
-    def __call__(self, string):
-        # the special argument "-" means sys.std{in,out}
-        if string == '-':
-            if 'r' in self._mode:
-                return _sys.stdin
-            elif 'w' in self._mode:
-                return _sys.stdout
-            else:
-                msg = _('argument "-" with mode %r') % self._mode
-                raise ValueError(msg)
-
-        # all other arguments are used as file names
-        try:
-            return open(string, self._mode, self._bufsize)
-        except IOError as e:
-            message = _("can't open '%s': %s")
-            raise ArgumentTypeError(message % (string, e))
-
-    def __repr__(self):
-        args = self._mode, self._bufsize
-        args_str = ', '.join(repr(arg) for arg in args if arg != -1)
-        return '%s(%s)' % (type(self).__name__, args_str)
-
-# ===========================
-# Optional and Positional Parsing
-# ===========================
-
-class Namespace(_AttributeHolder):
-    """Simple object for storing attributes.
-
-    Implements equality by attribute names and values, and provides a simple
-    string representation.
-    """
-
-    def __init__(self, **kwargs):
-        for name in kwargs:
-            setattr(self, name, kwargs[name])
-
-    __hash__ = None
-
-    def __eq__(self, other):
-        return vars(self) == vars(other)
-
-    def __ne__(self, other):
-        return not (self == other)
-
-    def __contains__(self, key):
-        return key in self.__dict__
-
-
-class _ActionsContainer(object):
-
-    def __init__(self,
-                 description,
-                 prefix_chars,
-                 argument_default,
-                 conflict_handler):
-        super(_ActionsContainer, self).__init__()
-
-        self.description = description
-        self.argument_default = argument_default
-        self.prefix_chars = prefix_chars
-        self.conflict_handler = conflict_handler
-
-        # set up registries
-        self._registries = {}
-
-        # register actions
-        self.register('action', None, _StoreAction)
-        self.register('action', 'store', _StoreAction)
-        self.register('action', 'store_const', _StoreConstAction)
-        self.register('action', 'store_true', _StoreTrueAction)
-        self.register('action', 'store_false', _StoreFalseAction)
-        self.register('action', 'append', _AppendAction)
-        self.register('action', 'append_const', _AppendConstAction)
-        self.register('action', 'count', _CountAction)
-        self.register('action', 'help', _HelpAction)
-        self.register('action', 'version', _VersionAction)
-        self.register('action', 'parsers', _SubParsersAction)
-
-        # raise an exception if the conflict handler is invalid
-        self._get_handler()
-
-        # action storage
-        self._actions = []
-        self._option_string_actions = {}
-
-        # groups
-        self._action_groups = []
-        self._mutually_exclusive_groups = []
-
-        # defaults storage
-        self._defaults = {}
-
-        # determines whether an "option" looks like a negative number
-        self._negative_number_matcher = _re.compile(r'^-\d+$|^-\d*\.\d+$')
-
-        # whether or not there are any optionals that look like negative
-        # numbers -- uses a list so it can be shared and edited
-        self._has_negative_number_optionals = []
-
-    # ====================
-    # Registration methods
-    # ====================
-    def register(self, registry_name, value, object):
-        registry = self._registries.setdefault(registry_name, {})
-        registry[value] = object
-
-    def _registry_get(self, registry_name, value, default=None):
-        return self._registries[registry_name].get(value, default)
-
-    # ==================================
-    # Namespace default accessor methods
-    # ==================================
-    def set_defaults(self, **kwargs):
-        self._defaults.update(kwargs)
-
-        # if these defaults match any existing arguments, replace
-        # the previous default on the object with the new one
-        for action in self._actions:
-            if action.dest in kwargs:
-                action.default = kwargs[action.dest]
-
-    def get_default(self, dest):
-        for action in self._actions:
-            if action.dest == dest and action.default is not None:
-                return action.default
-        return self._defaults.get(dest, None)
-
-
-    # =======================
-    # Adding argument actions
-    # =======================
-    def add_argument(self, *args, **kwargs):
-        """
-        add_argument(dest, ..., name=value, ...)
-        add_argument(option_string, option_string, ..., name=value, ...)
-        """
-
-        # if no positional args are supplied or only one is supplied and
-        # it doesn't look like an option string, parse a positional
-        # argument
-        chars = self.prefix_chars
-        if not args or len(args) == 1 and args[0][0] not in chars:
-            if args and 'dest' in kwargs:
-                raise ValueError('dest supplied twice for positional argument')
-            kwargs = self._get_positional_kwargs(*args, **kwargs)
-
-        # otherwise, we're adding an optional argument
-        else:
-            kwargs = self._get_optional_kwargs(*args, **kwargs)
-
-        # if no default was supplied, use the parser-level default
-        if 'default' not in kwargs:
-            dest = kwargs['dest']
-            if dest in self._defaults:
-                kwargs['default'] = self._defaults[dest]
-            elif self.argument_default is not None:
-                kwargs['default'] = self.argument_default
-
-        # create the action object, and add it to the parser
-        action_class = self._pop_action_class(kwargs)
-        if not _callable(action_class):
-            raise ValueError('unknown action "%s"' % (action_class,))
-        action = action_class(**kwargs)
-
-        # raise an error if the action type is not callable
-        type_func = self._registry_get('type', action.type, action.type)
-        if not _callable(type_func):
-            raise ValueError('%r is not callable' % (type_func,))
-
-        # raise an error if the metavar does not match the type
-        if hasattr(self, "_get_formatter"):
-            try:
-                self._get_formatter()._format_args(action, None)
-            except TypeError:
-                raise ValueError("length of metavar tuple does not match nargs")
-
-        return self._add_action(action)
-
-    def add_argument_group(self, *args, **kwargs):
-        group = _ArgumentGroup(self, *args, **kwargs)
-        self._action_groups.append(group)
-        return group
-
-    def add_mutually_exclusive_group(self, **kwargs):
-        group = _MutuallyExclusiveGroup(self, **kwargs)
-        self._mutually_exclusive_groups.append(group)
-        return group
-
-    def _add_action(self, action):
-        # resolve any conflicts
-        self._check_conflict(action)
-
-        # add to actions list
-        self._actions.append(action)
-        action.container = self
-
-        # index the action by any option strings it has
-        for option_string in action.option_strings:
-            self._option_string_actions[option_string] = action
-
-        # set the flag if any option strings look like negative numbers
-        for option_string in action.option_strings:
-            if self._negative_number_matcher.match(option_string):
-                if not self._has_negative_number_optionals:
-                    self._has_negative_number_optionals.append(True)
-
-        # return the created action
-        return action
-
-    def _remove_action(self, action):
-        self._actions.remove(action)
-
-    def _add_container_actions(self, container):
-        # collect groups by titles
-        title_group_map = {}
-        for group in self._action_groups:
-            if group.title in title_group_map:
-                msg = _('cannot merge actions - two groups are named %r')
-                raise ValueError(msg % (group.title))
-            title_group_map[group.title] = group
-
-        # map each action to its group
-        group_map = {}
-        for group in container._action_groups:
-
-            # if a group with the title exists, use that, otherwise
-            # create a new group matching the container's group
-            if group.title not in title_group_map:
-                title_group_map[group.title] = self.add_argument_group(
-                    title=group.title,
-                    description=group.description,
-                    conflict_handler=group.conflict_handler)
-
-            # map the actions to their new group
-            for action in group._group_actions:
-                group_map[action] = title_group_map[group.title]
-
-        # add container's mutually exclusive groups
-        # NOTE: if add_mutually_exclusive_group ever gains title= and
-        # description= then this code will need to be expanded as above
-        for group in container._mutually_exclusive_groups:
-            mutex_group = self.add_mutually_exclusive_group(
-                required=group.required)
-
-            # map the actions to their new mutex group
-            for action in group._group_actions:
-                group_map[action] = mutex_group
-
-        # add all actions to this container or their group
-        for action in container._actions:
-            group_map.get(action, self)._add_action(action)
-
-    def _get_positional_kwargs(self, dest, **kwargs):
-        # make sure required is not specified
-        if 'required' in kwargs:
-            msg = _("'required' is an invalid argument for positionals")
-            raise TypeError(msg)
-
-        # mark positional arguments as required if at least one is
-        # always required
-        if kwargs.get('nargs') not in [OPTIONAL, ZERO_OR_MORE]:
-            kwargs['required'] = True
-        if kwargs.get('nargs') == ZERO_OR_MORE and 'default' not in kwargs:
-            kwargs['required'] = True
-
-        # return the keyword arguments with no option strings
-        return dict(kwargs, dest=dest, option_strings=[])
-
-    def _get_optional_kwargs(self, *args, **kwargs):
-        # determine short and long option strings
-        option_strings = []
-        long_option_strings = []
-        for option_string in args:
-            # error on strings that don't start with an appropriate prefix
-            if not option_string[0] in self.prefix_chars:
-                msg = _('invalid option string %r: '
-                        'must start with a character %r')
-                tup = option_string, self.prefix_chars
-                raise ValueError(msg % tup)
-
-            # strings starting with two prefix characters are long options
-            option_strings.append(option_string)
-            if option_string[0] in self.prefix_chars:
-                if len(option_string) > 1:
-                    if option_string[1] in self.prefix_chars:
-                        long_option_strings.append(option_string)
-
-        # infer destination, '--foo-bar' -> 'foo_bar' and '-x' -> 'x'
-        dest = kwargs.pop('dest', None)
-        if dest is None:
-            if long_option_strings:
-                dest_option_string = long_option_strings[0]
-            else:
-                dest_option_string = option_strings[0]
-            dest = dest_option_string.lstrip(self.prefix_chars)
-            if not dest:
-                msg = _('dest= is required for options like %r')
-                raise ValueError(msg % option_string)
-            dest = dest.replace('-', '_')
-
-        # return the updated keyword arguments
-        return dict(kwargs, dest=dest, option_strings=option_strings)
-
-    def _pop_action_class(self, kwargs, default=None):
-        action = kwargs.pop('action', default)
-        return self._registry_get('action', action, action)
-
-    def _get_handler(self):
-        # determine function from conflict handler string
-        handler_func_name = '_handle_conflict_%s' % self.conflict_handler
-        try:
-            return getattr(self, handler_func_name)
-        except AttributeError:
-            msg = _('invalid conflict_resolution value: %r')
-            raise ValueError(msg % self.conflict_handler)
-
-    def _check_conflict(self, action):
-
-        # find all options that conflict with this option
-        confl_optionals = []
-        for option_string in action.option_strings:
-            if option_string in self._option_string_actions:
-                confl_optional = self._option_string_actions[option_string]
-                confl_optionals.append((option_string, confl_optional))
-
-        # resolve any conflicts
-        if confl_optionals:
-            conflict_handler = self._get_handler()
-            conflict_handler(action, confl_optionals)
-
-    def _handle_conflict_error(self, action, conflicting_actions):
-        message = _('conflicting option string(s): %s')
-        conflict_string = ', '.join([option_string
-                                     for option_string, action
-                                     in conflicting_actions])
-        raise ArgumentError(action, message % conflict_string)
-
-    def _handle_conflict_resolve(self, action, conflicting_actions):
-
-        # remove all conflicting options
-        for option_string, action in conflicting_actions:
-
-            # remove the conflicting option
-            action.option_strings.remove(option_string)
-            self._option_string_actions.pop(option_string, None)
-
-            # if the option now has no option string, remove it from the
-            # container holding it
-            if not action.option_strings:
-                action.container._remove_action(action)
-
-
-class _ArgumentGroup(_ActionsContainer):
-
-    def __init__(self, container, title=None, description=None, **kwargs):
-        # add any missing keyword arguments by checking the container
-        update = kwargs.setdefault
-        update('conflict_handler', container.conflict_handler)
-        update('prefix_chars', container.prefix_chars)
-        update('argument_default', container.argument_default)
-        super_init = super(_ArgumentGroup, self).__init__
-        super_init(description=description, **kwargs)
-
-        # group attributes
-        self.title = title
-        self._group_actions = []
-
-        # share most attributes with the container
-        self._registries = container._registries
-        self._actions = container._actions
-        self._option_string_actions = container._option_string_actions
-        self._defaults = container._defaults
-        self._has_negative_number_optionals = \
-            container._has_negative_number_optionals
-        self._mutually_exclusive_groups = container._mutually_exclusive_groups
-
-    def _add_action(self, action):
-        action = super(_ArgumentGroup, self)._add_action(action)
-        self._group_actions.append(action)
-        return action
-
-    def _remove_action(self, action):
-        super(_ArgumentGroup, self)._remove_action(action)
-        self._group_actions.remove(action)
-
-
-class _MutuallyExclusiveGroup(_ArgumentGroup):
-
-    def __init__(self, container, required=False):
-        super(_MutuallyExclusiveGroup, self).__init__(container)
-        self.required = required
-        self._container = container
-
-    def _add_action(self, action):
-        if action.required:
-            msg = _('mutually exclusive arguments must be optional')
-            raise ValueError(msg)
-        action = self._container._add_action(action)
-        self._group_actions.append(action)
-        return action
-
-    def _remove_action(self, action):
-        self._container._remove_action(action)
-        self._group_actions.remove(action)
-
-
-class ArgumentParser(_AttributeHolder, _ActionsContainer):
-    """Object for parsing command line strings into Python objects.
-
-    Keyword Arguments:
-        - prog -- The name of the program (default: sys.argv[0])
-        - usage -- A usage message (default: auto-generated from arguments)
-        - description -- A description of what the program does
-        - epilog -- Text following the argument descriptions
-        - parents -- Parsers whose arguments should be copied into this one
-        - formatter_class -- HelpFormatter class for printing help messages
-        - prefix_chars -- Characters that prefix optional arguments
-        - fromfile_prefix_chars -- Characters that prefix files containing
-            additional arguments
-        - argument_default -- The default value for all arguments
-        - conflict_handler -- String indicating how to handle conflicts
-        - add_help -- Add a -h/-help option
-    """
-
-    def __init__(self,
-                 prog=None,
-                 usage=None,
-                 description=None,
-                 epilog=None,
-                 version=None,
-                 parents=[],
-                 formatter_class=HelpFormatter,
-                 prefix_chars='-',
-                 fromfile_prefix_chars=None,
-                 argument_default=None,
-                 conflict_handler='error',
-                 add_help=True):
-
-        if version is not None:
-            import warnings
-            warnings.warn(
-                """The "version" argument to ArgumentParser is deprecated. """
-                """Please use """
-                """"add_argument(..., action='version', version="N", ...)" """
-                """instead""", DeprecationWarning)
-
-        superinit = super(ArgumentParser, self).__init__
-        superinit(description=description,
-                  prefix_chars=prefix_chars,
-                  argument_default=argument_default,
-                  conflict_handler=conflict_handler)
-
-        # default setting for prog
-        if prog is None:
-            prog = _os.path.basename(_sys.argv[0])
-
-        self.prog = prog
-        self.usage = usage
-        self.epilog = epilog
-        self.version = version
-        self.formatter_class = formatter_class
-        self.fromfile_prefix_chars = fromfile_prefix_chars
-        self.add_help = add_help
-
-        add_group = self.add_argument_group
-        self._positionals = add_group(_('positional arguments'))
-        self._optionals = add_group(_('optional arguments'))
-        self._subparsers = None
-
-        # register types
-        def identity(string):
-            return string
-        self.register('type', None, identity)
-
-        # add help and version arguments if necessary
-        # (using explicit default to override global argument_default)
-        default_prefix = '-' if '-' in prefix_chars else prefix_chars[0]
-        if self.add_help:
-            self.add_argument(
-                default_prefix+'h', default_prefix*2+'help',
-                action='help', default=SUPPRESS,
-                help=_('show this help message and exit'))
-        if self.version:
-            self.add_argument(
-                default_prefix+'v', default_prefix*2+'version',
-                action='version', default=SUPPRESS,
-                version=self.version,
-                help=_("show program's version number and exit"))
-
-        # add parent arguments and defaults
-        for parent in parents:
-            self._add_container_actions(parent)
-            try:
-                defaults = parent._defaults
-            except AttributeError:
-                pass
-            else:
-                self._defaults.update(defaults)
-
-    # =======================
-    # Pretty __repr__ methods
-    # =======================
-    def _get_kwargs(self):
-        names = [
-            'prog',
-            'usage',
-            'description',
-            'version',
-            'formatter_class',
-            'conflict_handler',
-            'add_help',
-        ]
-        return [(name, getattr(self, name)) for name in names]
-
-    # ==================================
-    # Optional/Positional adding methods
-    # ==================================
-    def add_subparsers(self, **kwargs):
-        if self._subparsers is not None:
-            self.error(_('cannot have multiple subparser arguments'))
-
-        # add the parser class to the arguments if it's not present
-        kwargs.setdefault('parser_class', type(self))
-
-        if 'title' in kwargs or 'description' in kwargs:
-            title = _(kwargs.pop('title', 'subcommands'))
-            description = _(kwargs.pop('description', None))
-            self._subparsers = self.add_argument_group(title, description)
-        else:
-            self._subparsers = self._positionals
-
-        # prog defaults to the usage message of this parser, skipping
-        # optional arguments and with no "usage:" prefix
-        if kwargs.get('prog') is None:
-            formatter = self._get_formatter()
-            positionals = self._get_positional_actions()
-            groups = self._mutually_exclusive_groups
-            formatter.add_usage(self.usage, positionals, groups, '')
-            kwargs['prog'] = formatter.format_help().strip()
-
-        # create the parsers action and add it to the positionals list
-        parsers_class = self._pop_action_class(kwargs, 'parsers')
-        action = parsers_class(option_strings=[], **kwargs)
-        self._subparsers._add_action(action)
-
-        # return the created parsers action
-        return action
-
-    def _add_action(self, action):
-        if action.option_strings:
-            self._optionals._add_action(action)
-        else:
-            self._positionals._add_action(action)
-        return action
-
-    def _get_optional_actions(self):
-        return [action
-                for action in self._actions
-                if action.option_strings]
-
-    def _get_positional_actions(self):
-        return [action
-                for action in self._actions
-                if not action.option_strings]
-
-    # =====================================
-    # Command line argument parsing methods
-    # =====================================
-    def parse_args(self, args=None, namespace=None):
-        args, argv = self.parse_known_args(args, namespace)
-        if argv:
-            msg = _('unrecognized arguments: %s')
-            self.error(msg % ' '.join(argv))
-        return args
-
-    def parse_known_args(self, args=None, namespace=None):
-        if args is None:
-            # args default to the system args
-            args = _sys.argv[1:]
-        else:
-            # make sure that args are mutable
-            args = list(args)
-
-        # default Namespace built from parser defaults
-        if namespace is None:
-            namespace = Namespace()
-
-        # add any action defaults that aren't present
-        for action in self._actions:
-            if action.dest is not SUPPRESS:
-                if not hasattr(namespace, action.dest):
-                    if action.default is not SUPPRESS:
-                        setattr(namespace, action.dest, action.default)
-
-        # add any parser defaults that aren't present
-        for dest in self._defaults:
-            if not hasattr(namespace, dest):
-                setattr(namespace, dest, self._defaults[dest])
-
-        # parse the arguments and exit if there are any errors
-        try:
-            namespace, args = self._parse_known_args(args, namespace)
-            if hasattr(namespace, _UNRECOGNIZED_ARGS_ATTR):
-                args.extend(getattr(namespace, _UNRECOGNIZED_ARGS_ATTR))
-                delattr(namespace, _UNRECOGNIZED_ARGS_ATTR)
-            return namespace, args
-        except ArgumentError:
-            err = _sys.exc_info()[1]
-            self.error(str(err))
-
-    def _parse_known_args(self, arg_strings, namespace):
-        # replace arg strings that are file references
-        if self.fromfile_prefix_chars is not None:
-            arg_strings = self._read_args_from_files(arg_strings)
-
-        # map all mutually exclusive arguments to the other arguments
-        # they can't occur with
-        action_conflicts = {}
-        for mutex_group in self._mutually_exclusive_groups:
-            group_actions = mutex_group._group_actions
-            for i, mutex_action in enumerate(mutex_group._group_actions):
-                conflicts = action_conflicts.setdefault(mutex_action, [])
-                conflicts.extend(group_actions[:i])
-                conflicts.extend(group_actions[i + 1:])
-
-        # find all option indices, and determine the arg_string_pattern
-        # which has an 'O' if there is an option at an index,
-        # an 'A' if there is an argument, or a '-' if there is a '--'
-        option_string_indices = {}
-        arg_string_pattern_parts = []
-        arg_strings_iter = iter(arg_strings)
-        for i, arg_string in enumerate(arg_strings_iter):
-
-            # all args after -- are non-options
-            if arg_string == '--':
-                arg_string_pattern_parts.append('-')
-                for arg_string in arg_strings_iter:
-                    arg_string_pattern_parts.append('A')
-
-            # otherwise, add the arg to the arg strings
-            # and note the index if it was an option
-            else:
-                option_tuple = self._parse_optional(arg_string)
-                if option_tuple is None:
-                    pattern = 'A'
-                else:
-                    option_string_indices[i] = option_tuple
-                    pattern = 'O'
-                arg_string_pattern_parts.append(pattern)
-
-        # join the pieces together to form the pattern
-        arg_strings_pattern = ''.join(arg_string_pattern_parts)
-
-        # converts arg strings to the appropriate and then takes the action
-        seen_actions = set()
-        seen_non_default_actions = set()
-
-        def take_action(action, argument_strings, option_string=None):
-            seen_actions.add(action)
-            argument_values = self._get_values(action, argument_strings)
-
-            # error if this argument is not allowed with other previously
-            # seen arguments, assuming that actions that use the default
-            # value don't really count as "present"
-            if argument_values is not action.default:
-                seen_non_default_actions.add(action)
-                for conflict_action in action_conflicts.get(action, []):
-                    if conflict_action in seen_non_default_actions:
-                        msg = _('not allowed with argument %s')
-                        action_name = _get_action_name(conflict_action)
-                        raise ArgumentError(action, msg % action_name)
-
-            # take the action if we didn't receive a SUPPRESS value
-            # (e.g. from a default)
-            if argument_values is not SUPPRESS:
-                action(self, namespace, argument_values, option_string)
-
-        # function to convert arg_strings into an optional action
-        def consume_optional(start_index):
-
-            # get the optional identified at this index
-            option_tuple = option_string_indices[start_index]
-            action, option_string, explicit_arg = option_tuple
-
-            # identify additional optionals in the same arg string
-            # (e.g. -xyz is the same as -x -y -z if no args are required)
-            match_argument = self._match_argument
-            action_tuples = []
-            while True:
-
-                # if we found no optional action, skip it
-                if action is None:
-                    extras.append(arg_strings[start_index])
-                    return start_index + 1
-
-                # if there is an explicit argument, try to match the
-                # optional's string arguments to only this
-                if explicit_arg is not None:
-                    arg_count = match_argument(action, 'A')
-
-                    # if the action is a single-dash option and takes no
-                    # arguments, try to parse more single-dash options out
-                    # of the tail of the option string
-                    chars = self.prefix_chars
-                    if arg_count == 0 and option_string[1] not in chars:
-                        action_tuples.append((action, [], option_string))
-                        char = option_string[0]
-                        option_string = char + explicit_arg[0]
-                        new_explicit_arg = explicit_arg[1:] or None
-                        optionals_map = self._option_string_actions
-                        if option_string in optionals_map:
-                            action = optionals_map[option_string]
-                            explicit_arg = new_explicit_arg
-                        else:
-                            msg = _('ignored explicit argument %r')
-                            raise ArgumentError(action, msg % explicit_arg)
-
-                    # if the action expect exactly one argument, we've
-                    # successfully matched the option; exit the loop
-                    elif arg_count == 1:
-                        stop = start_index + 1
-                        args = [explicit_arg]
-                        action_tuples.append((action, args, option_string))
-                        break
-
-                    # error if a double-dash option did not use the
-                    # explicit argument
-                    else:
-                        msg = _('ignored explicit argument %r')
-                        raise ArgumentError(action, msg % explicit_arg)
-
-                # if there is no explicit argument, try to match the
-                # optional's string arguments with the following strings
-                # if successful, exit the loop
-                else:
-                    start = start_index + 1
-                    selected_patterns = arg_strings_pattern[start:]
-                    arg_count = match_argument(action, selected_patterns)
-                    stop = start + arg_count
-                    args = arg_strings[start:stop]
-                    action_tuples.append((action, args, option_string))
-                    break
-
-            # add the Optional to the list and return the index at which
-            # the Optional's string args stopped
-            assert action_tuples
-            for action, args, option_string in action_tuples:
-                take_action(action, args, option_string)
-            return stop
-
-        # the list of Positionals left to be parsed; this is modified
-        # by consume_positionals()
-        positionals = self._get_positional_actions()
-
-        # function to convert arg_strings into positional actions
-        def consume_positionals(start_index):
-            # match as many Positionals as possible
-            match_partial = self._match_arguments_partial
-            selected_pattern = arg_strings_pattern[start_index:]
-            arg_counts = match_partial(positionals, selected_pattern)
-
-            # slice off the appropriate arg strings for each Positional
-            # and add the Positional and its args to the list
-            for action, arg_count in zip(positionals, arg_counts):
-                args = arg_strings[start_index: start_index + arg_count]
-                start_index += arg_count
-                take_action(action, args)
-
-            # slice off the Positionals that we just parsed and return the
-            # index at which the Positionals' string args stopped
-            positionals[:] = positionals[len(arg_counts):]
-            return start_index
-
-        # consume Positionals and Optionals alternately, until we have
-        # passed the last option string
-        extras = []
-        start_index = 0
-        if option_string_indices:
-            max_option_string_index = max(option_string_indices)
-        else:
-            max_option_string_index = -1
-        while start_index <= max_option_string_index:
-
-            # consume any Positionals preceding the next option
-            next_option_string_index = min([
-                index
-                for index in option_string_indices
-                if index >= start_index])
-            if start_index != next_option_string_index:
-                positionals_end_index = consume_positionals(start_index)
-
-                # only try to parse the next optional if we didn't consume
-                # the option string during the positionals parsing
-                if positionals_end_index > start_index:
-                    start_index = positionals_end_index
-                    continue
-                else:
-                    start_index = positionals_end_index
-
-            # if we consumed all the positionals we could and we're not
-            # at the index of an option string, there were extra arguments
-            if start_index not in option_string_indices:
-                strings = arg_strings[start_index:next_option_string_index]
-                extras.extend(strings)
-                start_index = next_option_string_index
-
-            # consume the next optional and any arguments for it
-            start_index = consume_optional(start_index)
-
-        # consume any positionals following the last Optional
-        stop_index = consume_positionals(start_index)
-
-        # if we didn't consume all the argument strings, there were extras
-        extras.extend(arg_strings[stop_index:])
-
-        # if we didn't use all the Positional objects, there were too few
-        # arg strings supplied.
-        if positionals:
-            self.error(_('too few arguments'))
-
-        # make sure all required actions were present, and convert defaults.
-        for action in self._actions:
-            if action not in seen_actions:
-                if action.required:
-                    name = _get_action_name(action)
-                    self.error(_('argument %s is required') % name)
-                else:
-                    # Convert action default now instead of doing it before
-                    # parsing arguments to avoid calling convert functions
-                    # twice (which may fail) if the argument was given, but
-                    # only if it was defined already in the namespace
-                    if (action.default is not None and
-                            isinstance(action.default, basestring) and
-                            hasattr(namespace, action.dest) and
-                            action.default is getattr(namespace, action.dest)):
-                        setattr(namespace, action.dest,
-                                self._get_value(action, action.default))
-
-        # make sure all required groups had one option present
-        for group in self._mutually_exclusive_groups:
-            if group.required:
-                for action in group._group_actions:
-                    if action in seen_non_default_actions:
-                        break
-
-                # if no actions were used, report the error
-                else:
-                    names = [_get_action_name(action)
-                             for action in group._group_actions
-                             if action.help is not SUPPRESS]
-                    msg = _('one of the arguments %s is required')
-                    self.error(msg % ' '.join(names))
-
-        # return the updated namespace and the extra arguments
-        return namespace, extras
-
-    def _read_args_from_files(self, arg_strings):
-        # expand arguments referencing files
-        new_arg_strings = []
-        for arg_string in arg_strings:
-
-            # for regular arguments, just add them back into the list
-            if not arg_string or arg_string[0] not in self.fromfile_prefix_chars:
-                new_arg_strings.append(arg_string)
-
-            # replace arguments referencing files with the file content
-            else:
-                try:
-                    args_file = open(arg_string[1:])
-                    try:
-                        arg_strings = []
-                        for arg_line in args_file.read().splitlines():
-                            for arg in self.convert_arg_line_to_args(arg_line):
-                                arg_strings.append(arg)
-                        arg_strings = self._read_args_from_files(arg_strings)
-                        new_arg_strings.extend(arg_strings)
-                    finally:
-                        args_file.close()
-                except IOError:
-                    err = _sys.exc_info()[1]
-                    self.error(str(err))
-
-        # return the modified argument list
-        return new_arg_strings
-
-    def convert_arg_line_to_args(self, arg_line):
-        return [arg_line]
-
-    def _match_argument(self, action, arg_strings_pattern):
-        # match the pattern for this action to the arg strings
-        nargs_pattern = self._get_nargs_pattern(action)
-        match = _re.match(nargs_pattern, arg_strings_pattern)
-
-        # raise an exception if we weren't able to find a match
-        if match is None:
-            nargs_errors = {
-                None: _('expected one argument'),
-                OPTIONAL: _('expected at most one argument'),
-                ONE_OR_MORE: _('expected at least one argument'),
-            }
-            default = _('expected %s argument(s)') % action.nargs
-            msg = nargs_errors.get(action.nargs, default)
-            raise ArgumentError(action, msg)
-
-        # return the number of arguments matched
-        return len(match.group(1))
-
-    def _match_arguments_partial(self, actions, arg_strings_pattern):
-        # progressively shorten the actions list by slicing off the
-        # final actions until we find a match
-        result = []
-        for i in range(len(actions), 0, -1):
-            actions_slice = actions[:i]
-            pattern = ''.join([self._get_nargs_pattern(action)
-                               for action in actions_slice])
-            match = _re.match(pattern, arg_strings_pattern)
-            if match is not None:
-                result.extend([len(string) for string in match.groups()])
-                break
-
-        # return the list of arg string counts
-        return result
-
-    def _parse_optional(self, arg_string):
-        # if it's an empty string, it was meant to be a positional
-        if not arg_string:
-            return None
-
-        # if it doesn't start with a prefix, it was meant to be positional
-        if not arg_string[0] in self.prefix_chars:
-            return None
-
-        # if the option string is present in the parser, return the action
-        if arg_string in self._option_string_actions:
-            action = self._option_string_actions[arg_string]
-            return action, arg_string, None
-
-        # if it's just a single character, it was meant to be positional
-        if len(arg_string) == 1:
-            return None
-
-        # if the option string before the "=" is present, return the action
-        if '=' in arg_string:
-            option_string, explicit_arg = arg_string.split('=', 1)
-            if option_string in self._option_string_actions:
-                action = self._option_string_actions[option_string]
-                return action, option_string, explicit_arg
-
-        # search through all possible prefixes of the option string
-        # and all actions in the parser for possible interpretations
-        option_tuples = self._get_option_tuples(arg_string)
-
-        # if multiple actions match, the option string was ambiguous
-        if len(option_tuples) > 1:
-            options = ', '.join([option_string
-                for action, option_string, explicit_arg in option_tuples])
-            tup = arg_string, options
-            self.error(_('ambiguous option: %s could match %s') % tup)
-
-        # if exactly one action matched, this segmentation is good,
-        # so return the parsed action
-        elif len(option_tuples) == 1:
-            option_tuple, = option_tuples
-            return option_tuple
-
-        # if it was not found as an option, but it looks like a negative
-        # number, it was meant to be positional
-        # unless there are negative-number-like options
-        if self._negative_number_matcher.match(arg_string):
-            if not self._has_negative_number_optionals:
-                return None
-
-        # if it contains a space, it was meant to be a positional
-        if ' ' in arg_string:
-            return None
-
-        # it was meant to be an optional but there is no such option
-        # in this parser (though it might be a valid option in a subparser)
-        return None, arg_string, None
-
-    def _get_option_tuples(self, option_string):
-        result = []
-
-        # option strings starting with two prefix characters are only
-        # split at the '='
-        chars = self.prefix_chars
-        if option_string[0] in chars and option_string[1] in chars:
-            if '=' in option_string:
-                option_prefix, explicit_arg = option_string.split('=', 1)
-            else:
-                option_prefix = option_string
-                explicit_arg = None
-            for option_string in self._option_string_actions:
-                if option_string.startswith(option_prefix):
-                    action = self._option_string_actions[option_string]
-                    tup = action, option_string, explicit_arg
-                    result.append(tup)
-
-        # single character options can be concatenated with their arguments
-        # but multiple character options always have to have their argument
-        # separate
-        elif option_string[0] in chars and option_string[1] not in chars:
-            option_prefix = option_string
-            explicit_arg = None
-            short_option_prefix = option_string[:2]
-            short_explicit_arg = option_string[2:]
-
-            for option_string in self._option_string_actions:
-                if option_string == short_option_prefix:
-                    action = self._option_string_actions[option_string]
-                    tup = action, option_string, short_explicit_arg
-                    result.append(tup)
-                elif option_string.startswith(option_prefix):
-                    action = self._option_string_actions[option_string]
-                    tup = action, option_string, explicit_arg
-                    result.append(tup)
-
-        # shouldn't ever get here
-        else:
-            self.error(_('unexpected option string: %s') % option_string)
-
-        # return the collected option tuples
-        return result
-
-    def _get_nargs_pattern(self, action):
-        # in all examples below, we have to allow for '--' args
-        # which are represented as '-' in the pattern
-        nargs = action.nargs
-
-        # the default (None) is assumed to be a single argument
-        if nargs is None:
-            nargs_pattern = '(-*A-*)'
-
-        # allow zero or one arguments
-        elif nargs == OPTIONAL:
-            nargs_pattern = '(-*A?-*)'
-
-        # allow zero or more arguments
-        elif nargs == ZERO_OR_MORE:
-            nargs_pattern = '(-*[A-]*)'
-
-        # allow one or more arguments
-        elif nargs == ONE_OR_MORE:
-            nargs_pattern = '(-*A[A-]*)'
-
-        # allow any number of options or arguments
-        elif nargs == REMAINDER:
-            nargs_pattern = '([-AO]*)'
-
-        # allow one argument followed by any number of options or arguments
-        elif nargs == PARSER:
-            nargs_pattern = '(-*A[-AO]*)'
-
-        # all others should be integers
-        else:
-            nargs_pattern = '(-*%s-*)' % '-*'.join('A' * nargs)
-
-        # if this is an optional action, -- is not allowed
-        if action.option_strings:
-            nargs_pattern = nargs_pattern.replace('-*', '')
-            nargs_pattern = nargs_pattern.replace('-', '')
-
-        # return the pattern
-        return nargs_pattern
-
-    # ========================
-    # Value conversion methods
-    # ========================
-    def _get_values(self, action, arg_strings):
-        # for everything but PARSER, REMAINDER args, strip out first '--'
-        if action.nargs not in [PARSER, REMAINDER]:
-            try:
-                arg_strings.remove('--')
-            except ValueError:
-                pass
-
-        # optional argument produces a default when not present
-        if not arg_strings and action.nargs == OPTIONAL:
-            if action.option_strings:
-                value = action.const
-            else:
-                value = action.default
-            if isinstance(value, basestring):
-                value = self._get_value(action, value)
-                self._check_value(action, value)
-
-        # when nargs='*' on a positional, if there were no command-line
-        # args, use the default if it is anything other than None
-        elif (not arg_strings and action.nargs == ZERO_OR_MORE and
-              not action.option_strings):
-            if action.default is not None:
-                value = action.default
-            else:
-                value = arg_strings
-            self._check_value(action, value)
-
-        # single argument or optional argument produces a single value
-        elif len(arg_strings) == 1 and action.nargs in [None, OPTIONAL]:
-            arg_string, = arg_strings
-            value = self._get_value(action, arg_string)
-            self._check_value(action, value)
-
-        # REMAINDER arguments convert all values, checking none
-        elif action.nargs == REMAINDER:
-            value = [self._get_value(action, v) for v in arg_strings]
-
-        # PARSER arguments convert all values, but check only the first
-        elif action.nargs == PARSER:
-            value = [self._get_value(action, v) for v in arg_strings]
-            self._check_value(action, value[0])
-
-        # all other types of nargs produce a list
-        else:
-            value = [self._get_value(action, v) for v in arg_strings]
-            for v in value:
-                self._check_value(action, v)
-
-        # return the converted value
-        return value
-
-    def _get_value(self, action, arg_string):
-        type_func = self._registry_get('type', action.type, action.type)
-        if not _callable(type_func):
-            msg = _('%r is not callable')
-            raise ArgumentError(action, msg % type_func)
-
-        # convert the value to the appropriate type
-        try:
-            result = type_func(arg_string)
-
-        # ArgumentTypeErrors indicate errors
-        except ArgumentTypeError:
-            name = getattr(action.type, '__name__', repr(action.type))
-            msg = str(_sys.exc_info()[1])
-            raise ArgumentError(action, msg)
-
-        # TypeErrors or ValueErrors also indicate errors
-        except (TypeError, ValueError):
-            name = getattr(action.type, '__name__', repr(action.type))
-            msg = _('invalid %s value: %r')
-            raise ArgumentError(action, msg % (name, arg_string))
-
-        # return the converted value
-        return result
-
-    def _check_value(self, action, value):
-        # converted value must be one of the choices (if specified)
-        if action.choices is not None and value not in action.choices:
-            tup = value, ', '.join(map(repr, action.choices))
-            msg = _('invalid choice: %r (choose from %s)') % tup
-            raise ArgumentError(action, msg)
-
-    # =======================
-    # Help-formatting methods
-    # =======================
-    def format_usage(self):
-        formatter = self._get_formatter()
-        formatter.add_usage(self.usage, self._actions,
-                            self._mutually_exclusive_groups)
-        return formatter.format_help()
-
-    def format_help(self):
-        formatter = self._get_formatter()
-
-        # usage
-        formatter.add_usage(self.usage, self._actions,
-                            self._mutually_exclusive_groups)
-
-        # description
-        formatter.add_text(self.description)
-
-        # positionals, optionals and user-defined groups
-        for action_group in self._action_groups:
-            formatter.start_section(action_group.title)
-            formatter.add_text(action_group.description)
-            formatter.add_arguments(action_group._group_actions)
-            formatter.end_section()
-
-        # epilog
-        formatter.add_text(self.epilog)
-
-        # determine help from format above
-        return formatter.format_help()
-
-    def format_version(self):
-        import warnings
-        warnings.warn(
-            'The format_version method is deprecated -- the "version" '
-            'argument to ArgumentParser is no longer supported.',
-            DeprecationWarning)
-        formatter = self._get_formatter()
-        formatter.add_text(self.version)
-        return formatter.format_help()
-
-    def _get_formatter(self):
-        return self.formatter_class(prog=self.prog)
-
-    # =====================
-    # Help-printing methods
-    # =====================
-    def print_usage(self, file=None):
-        if file is None:
-            file = _sys.stdout
-        self._print_message(self.format_usage(), file)
-
-    def print_help(self, file=None):
-        if file is None:
-            file = _sys.stdout
-        self._print_message(self.format_help(), file)
-
-    def print_version(self, file=None):
-        import warnings
-        warnings.warn(
-            'The print_version method is deprecated -- the "version" '
-            'argument to ArgumentParser is no longer supported.',
-            DeprecationWarning)
-        self._print_message(self.format_version(), file)
-
-    def _print_message(self, message, file=None):
-        if message:
-            if file is None:
-                file = _sys.stderr
-            file.write(message)
-
-    # ===============
-    # Exiting methods
-    # ===============
-    def exit(self, status=0, message=None):
-        if message:
-            self._print_message(message, _sys.stderr)
-        _sys.exit(status)
-
-    def error(self, message):
-        """error(message: string)
-
-        Prints a usage message incorporating the message to stderr and
-        exits.
-
-        If you override this in a subclass, it should not return -- it
-        should either exit or raise an exception.
-        """
-        self.print_usage(_sys.stderr)
-        self.exit(2, _('%s: error: %s\n') % (self.prog, message))
diff --git a/Wrapping/PythonCore/PyVTKMutableObject.cxx b/Wrapping/PythonCore/PyVTKMutableObject.cxx
index ac61dfd..cab587d 100644
--- a/Wrapping/PythonCore/PyVTKMutableObject.cxx
+++ b/Wrapping/PythonCore/PyVTKMutableObject.cxx
@@ -37,7 +37,7 @@ extern "C" { VTKWRAPPINGPYTHONCORE_EXPORT void PyVTKAddFile_mutable(PyObject *,
 
 //--------------------------------------------------------------------
 
-static const char *PyVTKMutableObject_Doc =
+const char *PyVTKMutableObject_Doc =
   "A mutable wrapper for immutable objects.\n\n"
   "This wrapper class is needed when a VTK method returns a value\n"
   "in an argument that has been passed by reference.  By calling\n"
diff --git a/Wrapping/PythonCore/PyVTKNamespace.cxx b/Wrapping/PythonCore/PyVTKNamespace.cxx
index b70f1d5..622bf1f 100644
--- a/Wrapping/PythonCore/PyVTKNamespace.cxx
+++ b/Wrapping/PythonCore/PyVTKNamespace.cxx
@@ -31,7 +31,7 @@
 
 //--------------------------------------------------------------------
 
-static const char *PyVTKNamespace_Doc =
+const char *PyVTKNamespace_Doc =
   "A python module that wraps a C++ namespace.\n";
 
 //--------------------------------------------------------------------
diff --git a/Wrapping/PythonCore/PyVTKObject.cxx b/Wrapping/PythonCore/PyVTKObject.cxx
index 426d4bf..060bce1 100644
--- a/Wrapping/PythonCore/PyVTKObject.cxx
+++ b/Wrapping/PythonCore/PyVTKObject.cxx
@@ -74,7 +74,7 @@ static PyObject *PyVTKObject_Repr(PyObject *op)
   char buf[255];
   sprintf(buf,"(%s)%p",
           PyString_AS_STRING(((PyVTKObject *)op)->vtk_class->vtk_name),
-          static_cast<void*>(op));
+          op);
 
   return PyString_FromString(buf);
 }
diff --git a/Wrapping/PythonCore/PyVTKTemplate.cxx b/Wrapping/PythonCore/PyVTKTemplate.cxx
index d06ba6f..678ce61 100644
--- a/Wrapping/PythonCore/PyVTKTemplate.cxx
+++ b/Wrapping/PythonCore/PyVTKTemplate.cxx
@@ -34,7 +34,7 @@
 
 //--------------------------------------------------------------------
 
-static const char *PyVTKTemplate_Doc =
+const char *PyVTKTemplate_Doc =
   "A container for instantiations of class and function templates.\n\n"
   "This is a dictionary for templates, provide the template args\n"
   "in square brackets to get the desired kind of class.\n";
diff --git a/Wrapping/PythonCore/vtkPythonOverload.cxx b/Wrapping/PythonCore/vtkPythonOverload.cxx
index e5c61da..7c63fbb 100644
--- a/Wrapping/PythonCore/vtkPythonOverload.cxx
+++ b/Wrapping/PythonCore/vtkPythonOverload.cxx
@@ -316,7 +316,6 @@ int vtkPythonOverload::CheckArg(
 
     case 'f':
       penalty = VTK_PYTHON_GOOD_MATCH;
-      VTK_FALLTHROUGH;
     case 'd':
       if (!PyFloat_Check(arg))
         {
diff --git a/Wrapping/PythonCore/vtkPythonUtil.cxx b/Wrapping/PythonCore/vtkPythonUtil.cxx
index bd79c09..897d7a5 100644
--- a/Wrapping/PythonCore/vtkPythonUtil.cxx
+++ b/Wrapping/PythonCore/vtkPythonUtil.cxx
@@ -65,7 +65,7 @@ public:
 // of the vtk/python garbage collection system, because it contains
 // exactly one pointer reference for each VTK object known to python)
 class vtkPythonObjectMap
-  : public std::map<vtkObjectBase*, std::pair<PyObject *, vtkAtomicInt32> >
+  : public std::map<vtkObjectBase*, std::pair<PyObject *, vtkAtomicInt<vtkTypeInt32> > >
 {
 public:
   ~vtkPythonObjectMap();
@@ -181,7 +181,7 @@ public:
 //--------------------------------------------------------------------
 // The singleton for vtkPythonUtil
 
-static vtkPythonUtil *vtkPythonMap = NULL;
+vtkPythonUtil *vtkPythonMap = NULL;
 
 // destructs the singleton when python exits
 void vtkPythonUtilDelete()
diff --git a/Wrapping/Tcl/vtkTclUtil.cxx b/Wrapping/Tcl/vtkTclUtil.cxx
index 768d899..3bf7e49 100644
--- a/Wrapping/Tcl/vtkTclUtil.cxx
+++ b/Wrapping/Tcl/vtkTclUtil.cxx
@@ -69,7 +69,7 @@ VTKTCL_EXPORT void vtkTclDeleteObjectFromHash(vtkObject *obj,
   vtkTclInterpStruct *is = vtkGetInterpStruct(as->Interp);
 
   // lookup the objects name
-  sprintf(temps,"%p",static_cast<void *>(obj));
+  sprintf(temps,"%p",obj);
   entry = Tcl_FindHashEntry(&is->PointerLookup,temps);
   if (entry)
     {
@@ -293,7 +293,7 @@ vtkTclGetObjectFromPointer(Tcl_Interp *interp, void *temp1,
     }
 
   /* first we must look up the pointer to see if it already exists */
-  sprintf(temps,"%p",static_cast<void *>(temp));
+  sprintf(temps,"%p",temp);
   if ((entry = Tcl_FindHashEntry(&is->PointerLookup,temps)))
     {
     if (is->DebugOn)
diff --git a/Wrapping/Tools/CMakeLists.txt b/Wrapping/Tools/CMakeLists.txt
index 519dc12..31272a9 100644
--- a/Wrapping/Tools/CMakeLists.txt
+++ b/Wrapping/Tools/CMakeLists.txt
@@ -17,7 +17,6 @@ set(VTK_PARSE_SOURCES
   vtkParseMain.c
   vtkParseExtras.c
   vtkParseMangle.c
-  vtkParseMerge.c
   vtkParseString.c
   vtkParseHierarchy.c
   vtkParsePreprocess.c
diff --git a/Wrapping/Tools/hints b/Wrapping/Tools/hints
index c36c49e..66addf9 100644
--- a/Wrapping/Tools/hints
+++ b/Wrapping/Tools/hints
@@ -17,8 +17,6 @@ vtkAnnotatedCubeActor                 GetBounds                         307  6
 vtkAssembly                           GetBounds                         307  6
 vtkAxesActor                          GetBounds                         307  6
 vtkAxisActor                          GetBounds                         307  6
-vtkBoundingBox                        GetMinPoint                       307  3
-vtkBoundingBox                        GetMaxPoint                       307  3
 vtkBox                                GetBounds                         307  6
 vtkBoxRepresentation                  GetBounds                         307  6
 vtkCamera                             GetOrientation                    307  3
@@ -47,7 +45,6 @@ vtkDataArray                          GetRange                          307  2
 vtkDataArray                          GetTuple2                         307  2
 vtkDataArray                          GetTuple3                         307  3
 vtkDataArray                          GetTuple4                         307  4
-vtkDataArray                          GetTuple6                         307  6
 vtkDataArray                          GetTuple9                         307  9
 vtkDataObject                         GetUpdateExtent                   304  6
 vtkDataObject                         GetWholeExtent                    304  6
@@ -158,17 +155,11 @@ vtkLookupTable                        GetColor                          307  3
 vtkLookupTable                        GetRange                          307  2
 vtkLookupTable                        GetTableValue                     307  4
 vtkMapper                             GetBounds                         307  6
-vtkMath                               HSVToRGB                          307  3
-vtkMath                               LabToRGB                          307  3
-vtkMath                               LabToXYZ                          307  3
-vtkMath                               RGBToHSV                          307  3
-vtkMath                               RGBToLab                          307  3
-vtkMath                               RGBToXYZ                          307  3
-vtkMath                               SolveCubic                        307  5
-vtkMath                               SolveLinear                       307  3
-vtkMath                               SolveQuadratic                    307  4
-vtkMath                               XYZToLab                          307  3
-vtkMath                               XYZToRGB                          307  3
+vtkMath                               HSVToRGB                          2307 3
+vtkMath                               RGBToHSV                          2307 3
+vtkMath                               SolveCubic                        2307 5
+vtkMath                               SolveLinear                       2307 3
+vtkMath                               SolveQuadratic                    2307 4
 vtkMatrix4x4                          MultiplyDoublePoint               307  4
 vtkMatrix4x4                          MultiplyFloatPoint                301  4
 vtkMatrix4x4                          MultiplyPoint                     301  4
diff --git a/Wrapping/Tools/vtkParse.tab.c b/Wrapping/Tools/vtkParse.tab.c
index 6a1c849..a1e8b71 100644
--- a/Wrapping/Tools/vtkParse.tab.c
+++ b/Wrapping/Tools/vtkParse.tab.c
@@ -146,7 +146,7 @@ to the more usual form y x; without parentheses.
 
 /* Borland and MSVC do not define __STDC__ properly. */
 #if !defined(__STDC__)
-# if defined(_MSC_VER) || defined(__BORLANDC__)
+# if (defined(_MSC_VER) && _MSC_VER >= 1200) || defined(__BORLANDC__)
 #  define __STDC__ 1
 # endif
 #endif
@@ -1562,7 +1562,8 @@ static YYSTYPE yyval_default;
 #endif
 
 #ifndef YY_ATTRIBUTE
-# if (defined __GNUC__)                                              \
+# if (defined __GNUC__                                               \
+      && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__)))  \
      || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
 #  define YY_ATTRIBUTE(Spec) __attribute__(Spec)
 # else
diff --git a/Wrapping/Tools/vtkParse.y b/Wrapping/Tools/vtkParse.y
index a935647..4f61d99 100644
--- a/Wrapping/Tools/vtkParse.y
+++ b/Wrapping/Tools/vtkParse.y
@@ -107,7 +107,7 @@ to the more usual form y x; without parentheses.
 
 /* Borland and MSVC do not define __STDC__ properly. */
 #if !defined(__STDC__)
-# if defined(_MSC_VER) || defined(__BORLANDC__)
+# if (defined(_MSC_VER) && _MSC_VER >= 1200) || defined(__BORLANDC__)
 #  define __STDC__ 1
 # endif
 #endif
diff --git a/Wrapping/Tools/vtkParseExtras.c b/Wrapping/Tools/vtkParseExtras.c
index 8e37b75..fd04c01 100644
--- a/Wrapping/Tools/vtkParseExtras.c
+++ b/Wrapping/Tools/vtkParseExtras.c
@@ -863,90 +863,55 @@ size_t vtkParse_ValueInfoFromString(
 }
 
 /* Generate a C++ declaration string from a ValueInfo struct */
-size_t vtkParse_ValueInfoToString(
-  ValueInfo *data, char *text, unsigned int flags)
+const char *vtkParse_ValueInfoToString(
+  ValueInfo *data, int *needs_free)
 {
   unsigned int pointer_bits = (data->Type & VTK_PARSE_POINTER_MASK);
-  unsigned int ref_bits = (data->Type & (VTK_PARSE_REF | VTK_PARSE_RVALUE));
+  unsigned int ref_bits = (data->Type & VTK_PARSE_REF);
   unsigned int qualifier_bits = (data->Type & VTK_PARSE_CONST);
   unsigned int reverse_bits = 0;
   unsigned int pointer_type = 0;
-  const char *tpname = data->Class;
-  int dimensions = data->NumberOfDimensions;
-  int pointer_dimensions = 0;
+  const char *classname = data->Class;
+  const char *name = data->Name;
+  char *text = NULL;
   size_t i = 0;
+  size_t l;
   int j = 0;
 
-  /* check if this is a type parameter for a template */
-  if (!tpname)
+  if (pointer_bits == 0 && ref_bits == 0 && qualifier_bits == 0 &&
+      name == NULL)
     {
-    tpname = "class";
-    }
-
-  /* don't shown anything that isn't in the flags */
-  ref_bits &= flags;
-  qualifier_bits &= flags;
-
-  /* if this is to be a return value, [] becomes * */
-  if ((flags & VTK_PARSE_ARRAY) == 0 &&
-      pointer_bits == VTK_PARSE_POINTER)
-    {
-    if (dimensions == 1)
+    if (needs_free)
       {
-      dimensions = 0;
+      *needs_free = 0;
       }
+    return classname;
     }
 
-  if (!data->Function && (qualifier_bits & VTK_PARSE_CONST) != 0)
+  /* compute the length of string to allocate */
+  l = 6; /* for const */
+  l += 4*7; /* for pointers */
+  l += 1; /* for ref */
+  l += strlen(classname) + 1; /* for type */
+  for (j = 0; j < data->NumberOfDimensions; j++)
     {
-    if (text)
-      {
-      strcpy(&text[i], "const ");
-      }
-    i += 6;
+    l += 2 + strlen(data->Dimensions[j]);
     }
+  l++; /* for NULL */
+  l += 4; /* for safety */
 
-  if (data->Function)
-    {
-    if (text)
-      {
-      i += vtkParse_FunctionInfoToString(
-        data->Function, &text[i], VTK_PARSE_RETURN_VALUE);
-      text[i++] = '(';
-      if (data->Function->Class)
-        {
-        strcpy(&text[i], data->Function->Class);
-        i += strlen(data->Function->Class);
-        text[i++] = ':';
-        text[i++] = ':';
-        }
-      }
-    else
-      {
-      i += vtkParse_FunctionInfoToString(
-        data->Function, NULL, VTK_PARSE_RETURN_VALUE);
-      i += 1;
-      if (data->Function->Class)
-        {
-        i += strlen(data->Function->Class);
-        i += 2;
-        }
-      }
-    }
-  else
+  text = (char *)malloc(l);
+
+  if ((qualifier_bits & VTK_PARSE_CONST) != 0)
     {
-    if (text)
-      {
-      strcpy(&text[i], tpname);
-      }
-    i += strlen(tpname);
-    if (text)
-      {
-      text[i] = ' ';
-      }
-    i++;
+    strcpy(&text[i], "const ");
+    i += 6;
     }
 
+  strcpy(&text[i], classname);
+  i += strlen(classname);
+  text[i++] = ' ';
+
   while (pointer_bits != 0)
     {
     reverse_bits <<= 2;
@@ -958,444 +923,57 @@ size_t vtkParse_ValueInfoToString(
     {
     pointer_type = (reverse_bits & VTK_PARSE_POINTER_LOWMASK);
     if (pointer_type == VTK_PARSE_ARRAY ||
-        (reverse_bits == VTK_PARSE_POINTER && dimensions > 0))
+        (reverse_bits == VTK_PARSE_POINTER &&
+         data->NumberOfDimensions > 0))
       {
-      if ((flags & VTK_PARSE_ARRAY) == 0)
-        {
-        pointer_dimensions = 1;
-        if (text)
-          {
-          text[i] = '(';
-          text[i+1] = '*';
-          }
-        i += 2;
-        }
       break;
       }
     else if (pointer_type == VTK_PARSE_POINTER)
       {
-      if (text)
-        {
-        text[i] = '*';
-        }
-      i++;
+      text[i++] = '*';
       }
     else if (pointer_type == VTK_PARSE_CONST_POINTER)
       {
-      if (text)
-        {
-        strcpy(&text[i], "*const ");
-        }
+      strcpy(&text[i], "*const ");
       i += 7;
       }
 
     reverse_bits = ((reverse_bits >> 2) & VTK_PARSE_POINTER_MASK);
     }
 
-  if ((ref_bits & VTK_PARSE_REF) != 0)
+  if (ref_bits)
     {
-    if ((ref_bits & VTK_PARSE_RVALUE) != 0)
-      {
-      if (text)
-        {
-        text[i] = '&';
-        }
-      i++;
-      }
-    if (text)
-      {
-      text[i] = '&';
-      }
-    i++;
+    text[i++] = '&';
     }
 
-  if (data->Name && (flags & VTK_PARSE_NAMES) != 0)
-    {
-    if (text)
-      {
-      strcpy(&text[i], data->Name);
-      }
-    i += strlen(data->Name);
-    if (data->Value && (flags & VTK_PARSE_VALUES) != 0)
-      {
-      if (text)
-        {
-        text[i] = '=';
-        }
-      i++;
-      if (text)
-        {
-        strcpy(&text[i], data->Value);
-        }
-      i += strlen(data->Value);
-      }
-    }
-
-  for (j = 0; j < pointer_dimensions; j++)
+  if (name)
     {
-    if (text)
-      {
-      text[i] = ')';
-      }
-    i++;
+    strcpy(&text[i], name);
+    i += strlen(name);
     }
 
-  for (j = pointer_dimensions; j < dimensions; j++)
+  for (j = 0; j < data->NumberOfDimensions; j++)
     {
-    if (text)
-      {
-      text[i] = '[';
-      }
-    i++;
+    text[i++] = '[';
     if (data->Dimensions[j])
       {
-      if (text)
-        {
-        strcpy(&text[i], data->Dimensions[j]);
-        }
+      strcpy(&text[i], data->Dimensions[j]);
       i += strlen(data->Dimensions[j]);
       }
-    if (text)
-      {
-      text[i] = ']';
-      }
-    i++;
-    }
-
-  if (data->Function)
-    {
-    if (text)
-      {
-      text[i++] = ')';
-      i += vtkParse_FunctionInfoToString(
-        data->Function, &text[i],
-        VTK_PARSE_CONST | VTK_PARSE_PARAMETER_LIST);
-      }
-    else
-      {
-      i++;
-      i += vtkParse_FunctionInfoToString(
-        data->Function, NULL,
-        VTK_PARSE_CONST | VTK_PARSE_PARAMETER_LIST);
-      }
-    }
-
-  if (text)
-    {
-    text[i] = '\0';
-    }
-
-  return i;
-}
-
-/* Generate a template declaration string */
-size_t vtkParse_TemplateInfoToString(
-  TemplateInfo *data, char *text, unsigned int flags)
-{
-  int i;
-  size_t k = 0;
-
-  if (text)
-    {
-    strcpy(&text[k], "template<");
-    }
-  k += 9;
-  for (i = 0; i < data->NumberOfParameters; i++)
-    {
-    if (i != 0)
-      {
-      if (text)
-        {
-        text[k] = ',';
-        text[k+1] = ' ';
-        }
-      k += 2;
-      }
-    if (text)
-      {
-      k += vtkParse_ValueInfoToString(data->Parameters[i], &text[k], flags);
-      while (k > 0 && text[k-1] == ' ')
-        {
-        k--;
-        }
-      }
-    else
-      {
-      k += vtkParse_ValueInfoToString(data->Parameters[i], NULL, flags);
-      }
-    }
-  if (text)
-    {
-    text[k] = '>';
-    text[k+1] = '\0';
-    }
-  k++;
-
-  return k;
-}
-
-/* generate a function signature for a FunctionInfo struct */
-size_t vtkParse_FunctionInfoToString(
-  FunctionInfo *func, char *text, unsigned int flags)
-{
-  int i;
-  size_t k = 0;
-
-  if (func->Template && (flags & VTK_PARSE_TEMPLATES) != 0)
-    {
-    if (text)
-      {
-      k += vtkParse_TemplateInfoToString(func->Template, &text[k], flags);
-      text[k++] = ' ';
-      }
-    else
-      {
-      k += vtkParse_TemplateInfoToString(func->Template, NULL, flags);
-      k++;
-      }
+    text[i++] = ']';
     }
 
-  if (func->IsStatic && (flags & VTK_PARSE_STATIC) != 0)
-    {
-    if (text)
-      {
-      strcpy(&text[k], "static ");
-      }
-    k += 7;
-    }
-  if (func->IsVirtual && (flags & VTK_PARSE_VIRTUAL) != 0)
-    {
-    if (text)
-      {
-      strcpy(&text[k], "virtual ");
-      }
-    k += 8;
-    }
-  if (func->IsExplicit && (flags & VTK_PARSE_EXPLICIT) != 0)
-    {
-    if (text)
-      {
-      strcpy(&text[k], "explicit ");
-      }
-    k += 9;
-    }
+  text[i] = '\0';
 
-  if (func->ReturnValue && (flags & VTK_PARSE_RETURN_VALUE) != 0)
-    {
-    if (text)
-      {
-      k += vtkParse_ValueInfoToString(
-        func->ReturnValue, &text[k],
-        VTK_PARSE_EVERYTHING ^ (VTK_PARSE_ARRAY | VTK_PARSE_NAMES));
-      }
-    else
-      {
-      k += vtkParse_ValueInfoToString(
-        func->ReturnValue, NULL,
-        VTK_PARSE_EVERYTHING ^ (VTK_PARSE_ARRAY | VTK_PARSE_NAMES));
-      }
-    }
+  /* make sure enough space was allocated */
+  assert(i < l);
 
-  if ((flags & VTK_PARSE_RETURN_VALUE) != 0 &&
-      (flags & VTK_PARSE_PARAMETER_LIST) != 0)
-    {
-    if (func->Name)
-      {
-      if (text)
-        {
-        strcpy(&text[k], func->Name);
-        }
-      k += strlen(func->Name);
-      }
-    else
-      {
-      if (text)
-        {
-        text[k++] = '(';
-        if (func->Class)
-          {
-          strcpy(&text[k], func->Class);
-          k += strlen(func->Class);
-          text[k++] = ':';
-          text[k++] = ':';
-          }
-        text[k++] = '*';
-        text[k++] = ')';
-        }
-      else
-        {
-        k++;
-        if (func->Class)
-          {
-          k += strlen(func->Class);
-          k += 2;
-          }
-        k += 2;
-        }
-      }
-    }
-  if ((flags & VTK_PARSE_PARAMETER_LIST) != 0)
+  if (needs_free)
     {
-    if (text)
-      {
-      text[k] = '(';
-      }
-    k++;
-    for (i = 0; i < func->NumberOfParameters; i++)
-      {
-      if (i != 0)
-        {
-        if (text)
-          {
-          text[k] = ',';
-          text[k+1] = ' ';
-          }
-        k += 2;
-        }
-      if (text)
-        {
-        k += vtkParse_ValueInfoToString(
-          func->Parameters[i], &text[k],
-          (VTK_PARSE_EVERYTHING ^ (VTK_PARSE_NAMES | VTK_PARSE_VALUES)) |
-          (flags & (VTK_PARSE_NAMES | VTK_PARSE_VALUES)));
-        while (k > 0 && text[k-1] == ' ')
-          {
-          k--;
-          }
-        }
-      else
-        {
-        k += vtkParse_ValueInfoToString(
-          func->Parameters[i], NULL,
-          (VTK_PARSE_EVERYTHING ^ (VTK_PARSE_NAMES | VTK_PARSE_VALUES)) |
-          (flags & (VTK_PARSE_NAMES | VTK_PARSE_VALUES)));
-        }
-      }
-    if (text)
-      {
-      text[k] = ')';
-      }
-    k++;
-    }
-  if (func->IsConst && (flags & VTK_PARSE_CONST) != 0)
-    {
-    if (text)
-      {
-      strcpy(&text[k], " const");
-      }
-    k += 6;
-    }
-  if (func->IsFinal && (flags & VTK_PARSE_TRAILERS) != 0)
-    {
-    if (text)
-      {
-      strcpy(&text[k], " final");
-      }
-    k += 6;
-    }
-  if (func->IsPureVirtual && (flags & VTK_PARSE_TRAILERS) != 0)
-    {
-    if (text)
-      {
-      strcpy(&text[k], " = 0");
-      }
-    k += 4;
-    }
-  if (text)
-    {
-    text[k] = '\0';
-    }
-
-  return k;
-}
-
-/* Compare two functions */
-int vtkParse_CompareFunctionSignature(
-  const FunctionInfo *func1, const FunctionInfo *func2)
-{
-  ValueInfo *p1;
-  ValueInfo *p2;
-  int j;
-  int k;
-  int match = 0;
-
-  /* uninstantiated templates cannot be compared */
-  if (func1->Template || func2->Template)
-    {
-    return 0;
-    }
-
-  /* check the parameters */
-  if (func2->NumberOfParameters == func1->NumberOfParameters)
-    {
-    for (k = 0; k < func2->NumberOfParameters; k++)
-      {
-      p1 = func1->Parameters[k];
-      p2 = func2->Parameters[k];
-      if (p2->Type != p1->Type || strcmp(p2->Class, p1->Class) != 0)
-        {
-        break;
-        }
-      if (p1->Function && p2->Function)
-        {
-        if (vtkParse_CompareFunctionSignature(p1->Function, p2->Function) < 7)
-          {
-          break;
-          }
-        }
-      if (p1->NumberOfDimensions > 1 || p2->NumberOfDimensions > 1)
-        {
-        if (p1->NumberOfDimensions != p2->NumberOfDimensions)
-          {
-          break;
-          }
-        for (j = 1; j < p1->NumberOfDimensions; j++)
-          {
-          if (strcmp(p1->Dimensions[j], p2->Dimensions[j]) != 0)
-            {
-            break;
-            }
-          }
-        }
-      }
-    if (k == func2->NumberOfParameters)
-      {
-      match = 1;
-      }
-    }
-
-  /* check the return value */
-  if (match && func1->ReturnValue && func2->ReturnValue)
-    {
-    p1 = func1->ReturnValue;
-    p2 = func2->ReturnValue;
-    if (p2->Type == p1->Type && strcmp(p2->Class, p1->Class) == 0)
-      {
-      if (p1->Function && p2->Function)
-        {
-        if (vtkParse_CompareFunctionSignature(p1->Function, p2->Function) < 7)
-          {
-          match |= 2;
-          }
-        }
-      else
-        {
-        match |= 2;
-        }
-      }
-    }
-
-  /* check the class */
-  if (match &&
-      func1->Class && func2->Class && strcmp(func1->Class, func2->Class) == 0)
-    {
-    if (func1->IsConst == func2->IsConst)
-      {
-      match |= 4;
-      }
+    *needs_free = 1;
     }
 
-  return match;
+  return text;
 }
 
 /* Search and replace, return the initial string if no replacements
diff --git a/Wrapping/Tools/vtkParseExtras.h b/Wrapping/Tools/vtkParseExtras.h
index 0ad23ff..3f3dcec 100644
--- a/Wrapping/Tools/vtkParseExtras.h
+++ b/Wrapping/Tools/vtkParseExtras.h
@@ -29,16 +29,6 @@
 #include "vtkParseData.h"
 #include <stddef.h>
 
-/* Flags for selecting what info to print for declarations */
-#define VTK_PARSE_NAMES          0x00000010
-#define VTK_PARSE_VALUES         0x00000020
-#define VTK_PARSE_RETURN_VALUE   0x00000040
-#define VTK_PARSE_PARAMETER_LIST 0x00000080
-#define VTK_PARSE_SPECIFIERS     0x00FF0000
-#define VTK_PARSE_TRAILERS       0x0F000000
-#define VTK_PARSE_TEMPLATES      0xF0000000
-#define VTK_PARSE_EVERYTHING     0xFFFFFFFF
-
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -93,55 +83,12 @@ size_t vtkParse_ValueInfoFromString(
   ValueInfo *val, StringCache *cache, const char *text);
 
 /**
- * Generate a C++ declaration string from a ValueInfo struct.
- *
- * The resulting string can represent a parameter declaration, a variable
- * or type declaration, or a function return value.  To use this function,
- * you should call it twice: first, call it with "text" set to NULL, and
- * it will return a lower bound on the length of the string that will be
- * produced.  Next, allocate at least length+1 bytes for the string, and
- * and call it again with "text" set to the allocated string.  The number
- * of bytes written to the string (not including the terminating null) will
- * be returned.
- *
- * The flags provide a mask that controls what information will be included,
- * for example VTK_PARSE_CONST|VTK_PARSE_VOLATILE is needed to include the
- * 'const' or 'volatile' qualifiers.  Use VTK_PARSE_EVERYTHING to generate
- * the entire declaration for a variable or parameter.
- */
-size_t vtkParse_ValueInfoToString(
-  ValueInfo *data, char *text, unsigned int flags);
-
-/**
- * Generate a C++ function signature from a FunctionInfo struct.
- *
- * See vtkParse_ValueInfoToString() for basic usage.  The flags can be set
- * to VTK_PARSE_RETURN_VALUE to print only the return value for the function,
- * or VTK_PARSE_PARAMETER_LIST to print only the parameter list.
- */
-size_t vtkParse_FunctionInfoToString(
-  FunctionInfo *func, char *text, unsigned int flags);
-
-/**
- * Generate a C++ template declaration from a TemplateInfo struct.
- *
- * See vtkParse_ValueInfoToString() for basic usage.
- */
-size_t vtkParse_TemplateInfoToString(
-  TemplateInfo *func, char *text, unsigned int flags);
-
-/**
- * Compare two C++ functions to see if they have the same signature.
- *
- * The following are the possible return values.  Any non-zero return value
- * means that the parameters match.  If the 2nd bit is also set, then the
- * function return value also matches.  If the 3rd bit is set, then the
- * parameters match and both methods are members of the same class, and
- * the constness of the functions match.  This means that the signatures
- * are not identical unless the return value is 7 or higher (.
+ * Generate a declaration string from a ValueInfo struct.  If the
+ * "nf" arg is set, the returned string must be freed.
+ * Only simple text strings are supported, e.g. "const T **".
+ * The variable or typedef name, if present, is ignored.
  */
-int vtkParse_CompareFunctionSignature(
-  const FunctionInfo *func1, const FunctionInfo *func2);
+const char *vtkParse_ValueInfoToString(ValueInfo *val, int *nf);
 
 /**
  * Expand a typedef within a variable, parameter, or typedef declaration.
diff --git a/Wrapping/Tools/vtkParseHierarchy.c b/Wrapping/Tools/vtkParseHierarchy.c
index e405345..d7b9efa 100644
--- a/Wrapping/Tools/vtkParseHierarchy.c
+++ b/Wrapping/Tools/vtkParseHierarchy.c
@@ -519,17 +519,15 @@ HierarchyInfo *vtkParseHierarchy_ReadFile(const char *filename)
       }
     }
 
-  free(line);
-
   if (!feof(fp))
     {
     vtkParseHierarchy_Free(info);
     info = NULL;
     }
-  else
-    {
-    sort_hierarchy_entries(info);
-    }
+
+  free(line);
+
+  sort_hierarchy_entries(info);
 
   fclose(fp);
 
diff --git a/Wrapping/Tools/vtkParseJava.c b/Wrapping/Tools/vtkParseJava.c
index 41a6b94..b1afa98 100644
--- a/Wrapping/Tools/vtkParseJava.c
+++ b/Wrapping/Tools/vtkParseJava.c
@@ -19,7 +19,6 @@
 #include "vtkParse.h"
 #include "vtkParseMain.h"
 #include "vtkParseHierarchy.h"
-#include "vtkWrap.h"
 
 HierarchyInfo *hierarchyInfo = NULL;
 StringCache *stringCache = NULL;
@@ -862,11 +861,6 @@ int main(int argc, char *argv[])
   if (options->HierarchyFileName)
     {
     hierarchyInfo = vtkParseHierarchy_ReadFile(options->HierarchyFileName);
-    if (hierarchyInfo)
-      {
-      /* resolve using declarations within the header files */
-      vtkWrap_ApplyUsingDeclarations(data, file_info, hierarchyInfo);
-      }
     }
 
   fprintf(fp,"// java wrapper for %s object\n//\n",data->Name);
diff --git a/Wrapping/Tools/vtkParseMerge.c b/Wrapping/Tools/vtkParseMerge.c
deleted file mode 100644
index f8494a3..0000000
--- a/Wrapping/Tools/vtkParseMerge.c
+++ /dev/null
@@ -1,767 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkParseMerge.h
-
-  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.
-
-=========================================================================*/
-/*-------------------------------------------------------------------------
-  Copyright (c) 2010,2015 David Gobbi
-
-  Contributed to the VisualizationToolkit by the author in March 2015
-  under the terms of the Visualization Toolkit 2015 copyright.
--------------------------------------------------------------------------*/
-
-#include "vtkParse.h"
-#include "vtkParseMain.h"
-#include "vtkParseMerge.h"
-#include "vtkParseData.h"
-#include "vtkParseExtras.h"
-#include <string.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <ctype.h>
-
-/* add a class to the MergeInfo */
-int vtkParseMerge_PushClass(MergeInfo *info, const char *classname)
-{
-  int n = info->NumberOfClasses;
-  int m = 0;
-  int i;
-  const char **classnames;
-  char *cp;
-
-  /* if class is already there, return its index */
-  for (i = 0; i < n; i++)
-    {
-    if (strcmp(info->ClassNames[i], classname) == 0)
-      {
-      return i;
-      }
-    }
-
-  /* if no elements yet, reserve four slots */
-  if (n == 0)
-    {
-    m = 4;
-    }
-  /* else double the slots whenever size is a power of two */
-  if (n >= 4 && (n & (n-1)) == 0)
-    {
-    m = (n << 1);
-    }
-
-  if (m)
-    {
-    classnames = (const char **)malloc(m*sizeof(const char *));
-    if (n)
-      {
-      for (i = 0; i < n; i++)
-        {
-        classnames[i] = info->ClassNames[i];
-        }
-      free((char **)info->ClassNames);
-      }
-    info->ClassNames = classnames;
-    }
-
-  info->NumberOfClasses = n+1;
-  cp = (char *)malloc(strlen(classname)+1);
-  strcpy(cp, classname);
-  info->ClassNames[n] = cp;
-
-  return n;
-}
-
-/* add a function to the MergeInfo */
-int vtkParseMerge_PushFunction(MergeInfo *info, int depth)
-{
-  int n = info->NumberOfFunctions;
-  int m = 0;
-  int i;
-  int *overrides;
-  int **classes;
-
-  /* if no elements yet, reserve four slots */
-  if (n == 0)
-    {
-    m = 4;
-    }
-  /* else double the slots whenever size is a power of two */
-  else if (n >= 4 && (n & (n-1)) == 0)
-    {
-    m = (n << 1);
-    }
-
-  if (m)
-    {
-    overrides = (int *)malloc(m*sizeof(int));
-    classes = (int **)malloc(m*sizeof(int *));
-    if (n)
-      {
-      for (i = 0; i < n; i++)
-        {
-        overrides[i] = info->NumberOfOverrides[i];
-        classes[i] = info->OverrideClasses[i];
-        }
-      free(info->NumberOfOverrides);
-      free(info->OverrideClasses);
-      }
-    info->NumberOfOverrides = overrides;
-    info->OverrideClasses = classes;
-    }
-
-  info->NumberOfFunctions = n+1;
-  info->NumberOfOverrides[n] = 1;
-  info->OverrideClasses[n] = (int *)malloc(sizeof(int));
-  info->OverrideClasses[n][0] = depth;
-
-  return n;
-}
-
-/* add an override to to the specified function */
-int vtkParseMerge_PushOverride(
-  MergeInfo *info, int i, int depth)
-{
-  int n = info->NumberOfOverrides[i];
-  int m = 0;
-  int j;
-  int *classes;
-
-  /* Make sure it hasn't already been pushed */
-  for (j = 0; j < info->NumberOfOverrides[i]; j++)
-    {
-    if (info->OverrideClasses[i][j] == depth)
-      {
-      return i;
-      }
-    }
-
-  /* if n is a power of two */
-  if ((n & (n-1)) == 0)
-    {
-    m = (n << 1);
-    classes = (int *)malloc(m*sizeof(int));
-    for (j = 0; j < n; j++)
-      {
-      classes[j] = info->OverrideClasses[i][j];
-      }
-    free(info->OverrideClasses[i]);
-    info->OverrideClasses[i] = classes;
-    }
-
-  info->NumberOfOverrides[i] = n+1;
-  info->OverrideClasses[i][n] = depth;
-
-  return n;
-}
-
-/* return an initialized MergeInfo */
-MergeInfo *vtkParseMerge_CreateMergeInfo(ClassInfo *classInfo)
-{
-  int i, n;
-  MergeInfo *info = (MergeInfo *)malloc(sizeof(MergeInfo));
-  info->NumberOfClasses = 0;
-  info->NumberOfFunctions = 0;
-
-  vtkParseMerge_PushClass(info, classInfo->Name);
-  n = classInfo->NumberOfFunctions;
-  for (i = 0; i < n; i++)
-    {
-    vtkParseMerge_PushFunction(info, 0);
-    }
-
-  return info;
-}
-
-/* free the MergeInfo */
-void vtkParseMerge_FreeMergeInfo(MergeInfo *info)
-{
-  int i, n;
-
-  n = info->NumberOfClasses;
-  for (i = 0; i < n; i++)
-    {
-    free((char *)info->ClassNames[i]);
-    }
-  free((char **)info->ClassNames);
-
-  n = info->NumberOfFunctions;
-  for (i = 0; i < n; i++)
-    {
-    free(info->OverrideClasses[i]);
-    }
-  if (n)
-    {
-    free(info->NumberOfOverrides);
-    free(info->OverrideClasses);
-    }
-
-  free(info);
-}
-
-/* merge a function */
-static void merge_function(FunctionInfo *merge, const FunctionInfo *func)
-{
-  if (func->IsVirtual)
-    {
-    merge->IsVirtual = 1;
-    }
-
-  if (func->Comment && !merge->Comment)
-    {
-    merge->Comment = func->Comment;
-    }
-}
-
-/* try to resolve "Using" declarations with the given class. */
-void vtkParseMerge_MergeUsing(
-  FileInfo *finfo, MergeInfo *info, ClassInfo *merge,
-  const ClassInfo *super, int depth)
-{
-  int i, j, k, ii, n, m;
-  char *cp;
-  size_t l;
-  int match;
-  UsingInfo *u;
-  UsingInfo *v;
-  FunctionInfo *func;
-  FunctionInfo *f2;
-  ValueInfo *param;
-  const char *lastval;
-  int is_constructor;
-
-  /* if scope matches, rename scope to "Superclass", */
-  /* this will cause any inherited scopes to match */
-  match = 0;
-  for (ii = 0; ii < merge->NumberOfUsings; ii++)
-    {
-    u = merge->Usings[ii];
-    if (u->Scope)
-      {
-      match = 1;
-      if (strcmp(u->Scope, super->Name) == 0)
-        {
-        u->Scope = "Superclass";
-        }
-      }
-    }
-  if (!match)
-    {
-    /* nothing to do! */
-    return;
-    }
-
-  m = merge->NumberOfFunctions;
-  n = super->NumberOfFunctions;
-  for (i = 0; i < n; i++)
-    {
-    func = super->Functions[i];
-
-    if (!func->Name)
-      {
-      continue;
-      }
-
-    /* destructors cannot be used */
-    if (func->Name[0] == '~' && strcmp(&func->Name[1], super->Name) == 0)
-      {
-      continue;
-      }
-
-    /* constructors can be used, with limitations */
-    is_constructor = 0;
-    if (strcmp(func->Name, super->Name) == 0)
-      {
-      is_constructor = 1;
-      if (func->Template)
-        {
-        /* templated constructors cannot be "used" */
-        continue;
-        }
-      }
-
-    /* check that the function is being "used" */
-    u = NULL;
-    for (ii = 0; ii < merge->NumberOfUsings; ii++)
-      {
-      v = merge->Usings[ii];
-      if (v->Scope && strcmp(v->Scope, "Superclass") == 0)
-        {
-        if (v->Name && strcmp(v->Name, func->Name) == 0)
-          {
-          u = v;
-          break;
-          }
-        }
-      }
-    if (!u)
-      {
-      continue;
-      }
-
-    /* look for override of this signature */
-    match = 0;
-    for (j = 0; j < m; j++)
-      {
-      f2 = merge->Functions[j];
-      if (f2->Name &&
-          ((is_constructor && strcmp(f2->Name, merge->Name) == 0) ||
-           (!is_constructor && strcmp(f2->Name, func->Name) == 0)))
-        {
-        if (vtkParse_CompareFunctionSignature(func, f2) != 0)
-          {
-          match = 1;
-          break;
-          }
-        }
-      }
-    if (!match)
-      {
-      /* copy into the merge */
-      if (is_constructor)
-        {
-        /* constructors require special default argument handling, there
-         * is a different used constructor for each arg with a default */
-        for (j = func->NumberOfParameters; j > 0; j--)
-          {
-          param = func->Parameters[0];
-          if (j == 1 && param->Class &&
-              strcmp(param->Class, super->Name) == 0 &&
-              (param->Type & VTK_PARSE_POINTER_MASK) == 0)
-            {
-            /* it is a copy constructor, it will not be "used" */
-            continue;
-            }
-          f2 = (FunctionInfo *)malloc(sizeof(FunctionInfo));
-          vtkParse_InitFunction(f2);
-          f2->Access = u->Access;
-          f2->Name = merge->Name;
-          f2->Class = merge->Name;
-          f2->Comment = func->Comment;
-          f2->IsExplicit = func->IsExplicit;
-          l = vtkParse_FunctionInfoToString(f2, NULL, VTK_PARSE_EVERYTHING);
-          cp = vtkParse_NewString(finfo->Strings, l);
-          vtkParse_FunctionInfoToString(f2, cp, VTK_PARSE_EVERYTHING);
-          f2->Signature = cp;
-          lastval = NULL;
-          for (k = 0; k < j; k++)
-            {
-            param = (ValueInfo *)malloc(sizeof(ValueInfo));
-            vtkParse_CopyValue(param, func->Parameters[k]);
-            lastval = param->Value;
-            param->Value = NULL; /* clear default parameter value */
-            vtkParse_AddParameterToFunction(f2, param);
-            }
-          vtkParse_AddFunctionToClass(merge, f2);
-          if (info)
-            {
-            vtkParseMerge_PushFunction(info, depth);
-            }
-          if (lastval == NULL)
-            {
-            /* continue if last parameter had a default value */
-            break;
-            }
-          }
-        }
-      else
-        {
-        /* non-constructor methods are simple */
-        f2 = (FunctionInfo *)malloc(sizeof(FunctionInfo));
-        vtkParse_CopyFunction(f2, func);
-        f2->Access = u->Access;
-        f2->Class = merge->Name;
-        vtkParse_AddFunctionToClass(merge, f2);
-        if (info)
-          {
-          vtkParseMerge_PushFunction(info, depth);
-          }
-        }
-      }
-    }
-
-  /* remove any using declarations that were satisfied */
-  for (i = 0; i < merge->NumberOfUsings; i++)
-    {
-    u = merge->Usings[i];
-    if (u->Scope && strcmp(u->Scope, "Superclass") == 0)
-      {
-      match = 0;
-      for (j = 0; j < super->NumberOfUsings && !match; j++)
-        {
-        v = super->Usings[j];
-        if (v->Name && u->Name && strcmp(u->Name, v->Name) == 0)
-          {
-          /* get the new scope so that recursion will occur */
-          u->Scope = v->Scope;
-          match = 1;
-          }
-        }
-      for (j = 0; j < super->NumberOfFunctions && !match; j++)
-        {
-        func = super->Functions[j];
-        if (u->Name && func->Name && strcmp(func->Name, u->Name) == 0)
-          {
-          /* ignore this "using" from now on */
-          merge->Usings[i]->Name = NULL;
-          merge->Usings[i]->Scope = NULL;
-          match = 1;
-          }
-        }
-      }
-    }
-}
-
-/* add "super" methods to the merge */
-int vtkParseMerge_Merge(
-  FileInfo *finfo, MergeInfo *info, ClassInfo *merge, ClassInfo *super)
-{
-  int i, j, ii, n, m, depth;
-  int match;
-  FunctionInfo *func;
-  FunctionInfo *f1;
-  FunctionInfo *f2;
-
-  depth = vtkParseMerge_PushClass(info, super->Name);
-
-  vtkParseMerge_MergeUsing(finfo, info, merge, super, depth);
-
-  m = merge->NumberOfFunctions;
-  n = super->NumberOfFunctions;
-  for (i = 0; i < n; i++)
-    {
-    func = super->Functions[i];
-
-    if (!func || !func->Name)
-      {
-      continue;
-      }
-
-    /* constructors and destructors are not inherited */
-    if ((strcmp(func->Name, super->Name) == 0) ||
-        (func->Name[0] == '~' &&
-         strcmp(&func->Name[1], super->Name) == 0))
-      {
-      continue;
-      }
-
-    /* check for overridden functions */
-    match = 0;
-    for (j = 0; j < m; j++)
-      {
-      f2 = merge->Functions[j];
-      if (f2->Name && strcmp(f2->Name, func->Name) == 0)
-        {
-        match = 1;
-        break;
-        }
-      }
-
-    /* find all superclass methods with this name */
-    for (ii = i; ii < n; ii++)
-      {
-      f1 = super->Functions[ii];
-      if (f1 && f1->Name && strcmp(f1->Name, func->Name) == 0)
-        {
-        if (match)
-          {
-          /* look for override of this signature */
-          for (j = 0; j < m; j++)
-            {
-            f2 = merge->Functions[j];
-            if (f2->Name && strcmp(f2->Name, f1->Name) == 0)
-              {
-              if (vtkParse_CompareFunctionSignature(f1, f2) != 0)
-                {
-                merge_function(f2, func);
-                vtkParseMerge_PushOverride(info, j, depth);
-                }
-              }
-            }
-          }
-        else /* no match */
-          {
-          /* copy into the merge */
-          vtkParse_AddFunctionToClass(merge, f1);
-          vtkParseMerge_PushFunction(info, depth);
-          m++;
-          }
-        /* remove from future consideration */
-        super->Functions[ii] = NULL;
-        }
-      }
-    }
-
-  /* remove all used methods from the superclass */
-  j = 0;
-  for (i = 0; i < n; i++)
-    {
-    if (i != j && super->Functions[i] != NULL)
-      {
-      super->Functions[j++] = super->Functions[i];
-      }
-    }
-  super->NumberOfFunctions = j;
-
-  return depth;
-}
-
-/* Recursive suproutine to add the methods of "classname" and all its
- * superclasses to "merge" */
-void vtkParseMerge_MergeHelper(
-  FileInfo *finfo, const NamespaceInfo *data, const HierarchyInfo *hinfo,
-  const char *classname, FILE *hintfile, MergeInfo *info, ClassInfo *merge)
-{
-  FILE *fp = NULL;
-  ClassInfo *cinfo = NULL;
-  ClassInfo *new_cinfo = NULL;
-  HierarchyEntry *entry = NULL;
-  char *new_classname = NULL;
-  const char **template_args = NULL;
-  int template_arg_count = 0;
-  const char *nspacename = NULL;
-  const char *header;
-  const char *filename;
-  int i, j, n, m;
-  int recurse;
-
-  /* Note: this method does not deal with scoping yet.
-   * "classname" might be a scoped name, in which case the
-   * part before the colon indicates the class or namespace
-   * (or combination thereof) where the class resides.
-   * Each containing namespace or class for the "merge"
-   * must be searched, taking the "using" directives that
-   * have been applied into account. */
-
-  /* get extra class info from the hierarchy file */
-  nspacename = data->Name;
-  if (nspacename && classname[0] != ':')
-    {
-    size_t l1 = strlen(nspacename);
-    size_t l2 = strlen(classname);
-    char *ncp = (char *)malloc(l1 + l2 + 3);
-    strcpy(ncp, data->Name);
-    ncp[l1] = ':';
-    ncp[l1 + 1] = ':';
-    strcpy(&ncp[l1+2], classname);
-    entry = vtkParseHierarchy_FindEntry(hinfo, ncp);
-    free(ncp);
-    }
-  if (!entry && classname[0] == ':' && classname[1] == ':')
-    {
-    entry = vtkParseHierarchy_FindEntry(hinfo, &classname[2]);
-    }
-  if (!entry)
-    {
-    entry = vtkParseHierarchy_FindEntry(hinfo, classname);
-    }
-
-  if (entry && entry->NumberOfTemplateParameters > 0)
-    {
-    /* extract the template arguments */
-    template_arg_count = (int)entry->NumberOfTemplateParameters;
-    vtkParse_DecomposeTemplatedType(
-      classname, &classname, template_arg_count, &template_args,
-      entry->TemplateDefaults);
-    }
-
-  /* find out if "classname" is in the current namespace */
-  n = data->NumberOfClasses;
-  for (i = 0; i < n; i++)
-    {
-    if (strcmp(data->Classes[i]->Name, classname) == 0)
-      {
-      cinfo = data->Classes[i];
-      break;
-      }
-    }
-
-  if (n > 0 && !cinfo)
-    {
-    if (!entry)
-      {
-      if (new_classname)
-        {
-        free(new_classname);
-        }
-      return;
-      }
-    header = entry->HeaderFile;
-    if (!header)
-      {
-      if (hintfile) { fclose(hintfile); }
-      fprintf(stderr, "Null header file for class %s!\n", classname);
-      exit(1);
-      }
-
-    filename = vtkParse_FindIncludeFile(header);
-    if (!filename)
-      {
-      if (hintfile) { fclose(hintfile); }
-      fprintf(stderr, "Couldn't locate header file %s\n", header);
-      exit(1);
-      }
-
-    fp = fopen(filename, "r");
-    if (!fp)
-      {
-      if (hintfile) { fclose(hintfile); }
-      fprintf(stderr, "Couldn't open header file %s\n", header);
-      exit(1);
-      }
-
-    finfo = vtkParse_ParseFile(filename, fp, stderr);
-    fclose(fp);
-
-    if (!finfo)
-      {
-      if (hintfile) { fclose(hintfile); }
-      exit(1);
-      }
-
-    if (hintfile)
-      {
-      rewind(hintfile);
-      vtkParse_ReadHints(finfo, hintfile, stderr);
-      }
-
-    data = finfo->Contents;
-    if (nspacename)
-      {
-      m = data->NumberOfNamespaces;
-      for (j = 0; j < m; j++)
-        {
-        NamespaceInfo *ni = data->Namespaces[j];
-        if (ni->Name && strcmp(ni->Name, nspacename) == 0)
-          {
-          n = ni->NumberOfClasses;
-          for (i = 0; i < n; i++)
-            {
-            if (strcmp(ni->Classes[i]->Name, classname) == 0)
-              {
-              cinfo = ni->Classes[i];
-              data = ni;
-              break;
-              }
-            }
-          if (i < n)
-            {
-            break;
-            }
-          }
-        }
-      }
-    else
-      {
-      n = data->NumberOfClasses;
-      for (i = 0; i < n; i++)
-        {
-        if (strcmp(data->Classes[i]->Name, classname) == 0)
-          {
-          cinfo = data->Classes[i];
-          break;
-          }
-        }
-      }
-    }
-
-  if (cinfo)
-    {
-    if (template_args)
-      {
-      new_cinfo = (ClassInfo *)malloc(sizeof(ClassInfo));
-      vtkParse_CopyClass(new_cinfo, cinfo);
-      vtkParse_InstantiateClassTemplate(
-        new_cinfo, finfo->Strings, template_arg_count, template_args);
-      cinfo = new_cinfo;
-      }
-
-    recurse = 0;
-    if (info)
-      {
-      vtkParseMerge_Merge(finfo, info, merge, cinfo);
-      recurse = 1;
-      }
-    else
-      {
-      vtkParseMerge_MergeUsing(finfo, info, merge, cinfo, 0);
-      n = merge->NumberOfUsings;
-      for (i = 0; i < n; i++)
-        {
-        if (merge->Usings[i]->Name)
-          {
-          recurse = 1;
-          break;
-          }
-        }
-      }
-    if (recurse)
-      {
-      n = cinfo->NumberOfSuperClasses;
-      for (i = 0; i < n; i++)
-        {
-        vtkParseMerge_MergeHelper(finfo, data, hinfo, cinfo->SuperClasses[i],
-                                  hintfile, info, merge);
-        }
-      }
-    }
-
-  if (template_arg_count > 0)
-    {
-    vtkParse_FreeTemplateDecomposition(
-      classname, template_arg_count, template_args);
-    }
-}
-
-/* Merge the methods from the superclasses */
-MergeInfo *vtkParseMerge_MergeSuperClasses(
-  FileInfo *finfo, NamespaceInfo *data, ClassInfo *classInfo)
-{
-  FILE *hintfile = NULL;
-  HierarchyInfo *hinfo = NULL;
-  MergeInfo *info = NULL;
-  OptionInfo *oinfo = NULL;
-  int i, n;
-
-  oinfo = vtkParse_GetCommandLineOptions();
-
-  if (oinfo->HierarchyFileName)
-    {
-    hinfo = vtkParseHierarchy_ReadFile(oinfo->HierarchyFileName);
-
-    if (oinfo->HintFileName)
-      {
-      hintfile = fopen(oinfo->HintFileName, "r");
-      }
-
-    info = vtkParseMerge_CreateMergeInfo(classInfo);
-
-    n = classInfo->NumberOfSuperClasses;
-    for (i = 0; i < n; i++)
-      {
-      vtkParseMerge_MergeHelper(finfo, data, hinfo,
-                                classInfo->SuperClasses[i],
-                                hintfile, info, classInfo);
-      }
-
-    if (hintfile)
-      {
-      fclose(hintfile);
-      }
-    }
-
-  if (hinfo)
-    {
-    vtkParseHierarchy_Free(hinfo);
-    }
-
-  return info;
-}
diff --git a/Wrapping/Tools/vtkParseMerge.h b/Wrapping/Tools/vtkParseMerge.h
deleted file mode 100644
index e06ab69..0000000
--- a/Wrapping/Tools/vtkParseMerge.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*=========================================================================
-
-  Program:   Visualization Toolkit
-  Module:    vtkParseMerge.h
-
-  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.
-
-=========================================================================*/
-/*-------------------------------------------------------------------------
-  Copyright (c) 2010,2015 David Gobbi
-
-  Contributed to the VisualizationToolkit by the author in March 2015
-  under the terms of the Visualization Toolkit 2015 copyright.
--------------------------------------------------------------------------*/
-
-/**
- This file contains utility functions for merging together the
- methods for a class with those inherited from all superclasses.
-*/
-
-#ifndef VTK_PARSE_MERGE_H
-#define VTK_PARSE_MERGE_H
-
-#include "vtkParseData.h"
-#include "vtkParseHierarchy.h"
-
-/**
- * This struct is meant to supplement ClassInfo, it gives information
- * about which class (or classes) each method was inherited from
- */
-typedef struct _MergeInfo
-{
-  int   NumberOfClasses;    /* number of classes in geneology */
-  const char **ClassNames;         /* class name */
-  int   NumberOfFunctions;  /* must match FunctionInfo */
-  int  *NumberOfOverrides; /* n classes that define this function */
-  int **OverrideClasses;  /* class for the override */
-} MergeInfo;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * Merge all inherited methods into the ClassInfo.
- * This will find and parse the header files for all the superclasses,
- * and recursively add all inherited superclass methods into one ClassInfo.
- * The returned MergeInfo object provides information about which class
- * each inherited method was inherited from.
- */
-MergeInfo *vtkParseMerge_MergeSuperClasses(
-  FileInfo *finfo, NamespaceInfo *data, ClassInfo *classInfo);
-
-/**
- * Free the MergeInfo object.
- */
-void vtkParseMerge_FreeMergeInfo(MergeInfo *info);
-
-/**
- * Recursive suproutine to inherit methods from "classname".
- * The class named by "classname" should be a superclass of the ClassInfo.
- * If the MergeInfo is not provided (if it is NULL), then the only methods
- * that are brought into the class are ones that are explicitly named
- * by using declarations.  The hintfile can also be NULL, if there is
- * no hints file.
- */
-void vtkParseMerge_MergeHelper(
-  FileInfo *finfo, const NamespaceInfo *data, const HierarchyInfo *hinfo,
-  const char *classname, FILE *hintfile, MergeInfo *info, ClassInfo *merge);
-
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
-
-#endif
diff --git a/Wrapping/Tools/vtkParsePreprocess.c b/Wrapping/Tools/vtkParsePreprocess.c
index 1efd295..574281f 100644
--- a/Wrapping/Tools/vtkParsePreprocess.c
+++ b/Wrapping/Tools/vtkParsePreprocess.c
@@ -397,6 +397,7 @@ static int preproc_evaluate_char(
       else if (*cp == 'f') { *val = '\f'; }
       else if (*cp == 'n') { *val = '\n'; }
       else if (*cp == 'r') { *val = '\r'; }
+      else if (*cp == 'b') { *val = '\b'; }
       else if (*cp == 't') { *val = '\t'; }
       else if (*cp == 'v') { *val = '\v'; }
       else if (*cp == '\'') { *val = '\''; }
@@ -421,6 +422,7 @@ static int preproc_evaluate_char(
 #endif
       return VTK_PARSE_SYNTAX_ERROR;
       }
+    cp++;
     *is_unsigned = 0;
     return VTK_PARSE_OK;
     }
diff --git a/Wrapping/Tools/vtkWrap.c b/Wrapping/Tools/vtkWrap.c
index fbf2b12..06f1eee 100644
--- a/Wrapping/Tools/vtkWrap.c
+++ b/Wrapping/Tools/vtkWrap.c
@@ -16,7 +16,6 @@
 #include "vtkWrap.h"
 #include "vtkParseData.h"
 #include "vtkParseExtras.h"
-#include "vtkParseMerge.h"
 #include "vtkParseString.h"
 #include <stdlib.h>
 #include <string.h>
@@ -453,9 +452,8 @@ int vtkWrap_IsVTKObjectBaseType(
       }
     }
 
-  /* fallback if no HierarchyInfo, but skip smart pointers */
-  if (strncmp("vtk", classname, 3) == 0 &&
-      strncmp("vtkSmartPointer", classname, 15) != 0)
+  /* fallback if no HierarchyInfo */
+  if (strncmp("vtk", classname, 3) == 0)
     {
     return 1;
     }
@@ -846,34 +844,6 @@ void vtkWrap_ExpandTypedefs(
     }
 }
 
-/* -------------------------------------------------------------------- */
-/* Merge superclass methods according to using declarations */
-void vtkWrap_ApplyUsingDeclarations(
-  ClassInfo *data, FileInfo *finfo, HierarchyInfo *hinfo)
-{
-  int i, n;
-
-  /* first, check if there are any declarations to apply */
-  n = data->NumberOfUsings;
-  for (i = 0; i < n; i++)
-    {
-    if (data->Usings[i]->Name)
-      {
-      break;
-      }
-    }
-  /* if using declarations found, read superclass headers */
-  if (i < n)
-    {
-    n = data->NumberOfSuperClasses;
-    for (i = 0; i < n; i++)
-      {
-      vtkParseMerge_MergeHelper(
-        finfo, finfo->Contents, hinfo, data->SuperClasses[i],
-        NULL, NULL, data);
-      }
-    }
-}
 
 /* -------------------------------------------------------------------- */
 /* get the type name */
diff --git a/Wrapping/Tools/vtkWrap.h b/Wrapping/Tools/vtkWrap.h
index 4260184..ef679e0 100644
--- a/Wrapping/Tools/vtkWrap.h
+++ b/Wrapping/Tools/vtkWrap.h
@@ -164,15 +164,6 @@ void vtkWrap_ExpandTypedefs(
   ClassInfo *data, FileInfo *finfo, HierarchyInfo *hinfo);
 
 /**
- * Apply any using declarations that appear in the class.
- * If any using declarations appear in the class that refer to superclass
- * methods, the superclass header file will be parsed and the used methods
- * will be brought into the class.
- */
-void vtkWrap_ApplyUsingDeclarations(
-  ClassInfo *data, FileInfo *finfo, HierarchyInfo *hinfo);
-
-/**
  * Apply any hints about array sizes, e.g. hint that the
  * GetNumberOfComponents() method gives the tuple size.
  */
diff --git a/Wrapping/Tools/vtkWrapHierarchy.c b/Wrapping/Tools/vtkWrapHierarchy.c
index 4a62842..d571f00 100644
--- a/Wrapping/Tools/vtkWrapHierarchy.c
+++ b/Wrapping/Tools/vtkWrapHierarchy.c
@@ -718,7 +718,6 @@ static int vtkWrapHierarchy_CompareHierarchyFile(FILE *fp, char *lines[])
       if (!line)
         {
         free(oldline);
-        free(matched);
         return 0;
         }
       if (!fgets(&line[n], (int)(maxlen-n), fp)) { break; }
diff --git a/Wrapping/Tools/vtkWrapJava.c b/Wrapping/Tools/vtkWrapJava.c
index 8700500..23eb6a0 100644
--- a/Wrapping/Tools/vtkWrapJava.c
+++ b/Wrapping/Tools/vtkWrapJava.c
@@ -1282,11 +1282,6 @@ int main(int argc, char *argv[])
   if (options->HierarchyFileName)
     {
     hierarchyInfo = vtkParseHierarchy_ReadFile(options->HierarchyFileName);
-    if (hierarchyInfo)
-      {
-      /* resolve using declarations within the header files */
-      vtkWrap_ApplyUsingDeclarations(data, file_info, hierarchyInfo);
-      }
     }
 
   fprintf(fp,"// java wrapper for %s object\n//\n",data->Name);
diff --git a/Wrapping/Tools/vtkWrapPython.c b/Wrapping/Tools/vtkWrapPython.c
index 7e0c4a5..c1ed2a5 100644
--- a/Wrapping/Tools/vtkWrapPython.c
+++ b/Wrapping/Tools/vtkWrapPython.c
@@ -473,10 +473,6 @@ int main(int argc, char *argv[])
     {
     for (i = 0; i < contents->NumberOfClasses; i++)
       {
-      vtkWrap_ApplyUsingDeclarations(contents->Classes[i], file_info, hinfo);
-      }
-    for (i = 0; i < contents->NumberOfClasses; i++)
-      {
       vtkWrap_ExpandTypedefs(contents->Classes[i], file_info, hinfo);
       }
     }
diff --git a/Wrapping/Tools/vtkWrapPythonMethod.c b/Wrapping/Tools/vtkWrapPythonMethod.c
index 23d7e28..ab10b59 100644
--- a/Wrapping/Tools/vtkWrapPythonMethod.c
+++ b/Wrapping/Tools/vtkWrapPythonMethod.c
@@ -937,11 +937,11 @@ static void vtkWrapPython_FreeAllocatedArrays(
     if (arg->CountHint || vtkWrap_IsPODPointer(arg))
       {
       fprintf(fp,
-              "  if (temp%d != small%d)\n"
+              "  if (temp%d && temp%d != small%d)\n"
               "    {\n"
               "    delete [] temp%d;\n"
               "    }\n",
-              i, i, i);
+              i, i, i, i);
       j = 1;
       }
     }
diff --git a/Wrapping/Tools/vtkWrapPythonMethodDef.c b/Wrapping/Tools/vtkWrapPythonMethodDef.c
index 84726b6..4978fcb 100644
--- a/Wrapping/Tools/vtkWrapPythonMethodDef.c
+++ b/Wrapping/Tools/vtkWrapPythonMethodDef.c
@@ -762,7 +762,7 @@ static void vtkWrapPython_CustomMethods(
             "  if (op && ap.CheckArgCount(1) &&\n"
             "      ap.GetValue(temp0))\n"
             "    {\n"
-            "    sprintf(tempr, \"Addr=%%p\", static_cast<void*>(op));\n"
+            "    sprintf(tempr, \"Addr=%%p\", op);\n"
             "\n"
             "    result = ap.BuildValue(tempr);\n"
             "    }\n"
diff --git a/Wrapping/Tools/vtkWrapPythonTemplate.c b/Wrapping/Tools/vtkWrapPythonTemplate.c
index 5746f97..3b747a7 100644
--- a/Wrapping/Tools/vtkWrapPythonTemplate.c
+++ b/Wrapping/Tools/vtkWrapPythonTemplate.c
@@ -224,7 +224,7 @@ size_t vtkWrapPython_PyTemplateName(const char *name, char *pname)
   j = i;
 
   m = 1;
-  while (i < n && m != 0 && name[i] != '>')
+  while (name[i] != '>' && i < n && m != 0)
     {
     if (name[i] >= '0' && name[i] <= '9')
       {
diff --git a/Wrapping/Tools/vtkWrapPythonType.c b/Wrapping/Tools/vtkWrapPythonType.c
index 62d80d0..a4e7026 100644
--- a/Wrapping/Tools/vtkWrapPythonType.c
+++ b/Wrapping/Tools/vtkWrapPythonType.c
@@ -93,7 +93,10 @@ static void vtkWrapPython_NewDeleteProtocol(
     "static void Py%s_Delete(PyObject *self)\n"
     "{\n"
     "  PyVTKSpecialObject *obj = (PyVTKSpecialObject *)self;\n"
-    "  delete static_cast<%s *>(obj->vtk_ptr);\n"
+    "  if (obj->vtk_ptr)\n"
+    "    {\n"
+    "    delete static_cast<%s *>(obj->vtk_ptr);\n"
+    "    }\n"
     "#if PY_MAJOR_VERSION >= 2\n"
     "  PyObject_Del(self);\n"
     "#else\n"
diff --git a/Wrapping/Tools/vtkWrapTcl.c b/Wrapping/Tools/vtkWrapTcl.c
index cea69a5..faceb9b 100644
--- a/Wrapping/Tools/vtkWrapTcl.c
+++ b/Wrapping/Tools/vtkWrapTcl.c
@@ -1127,11 +1127,6 @@ int main(int argc, char *argv[])
   if (options->HierarchyFileName)
     {
     hierarchyInfo = vtkParseHierarchy_ReadFile(options->HierarchyFileName);
-    if (hierarchyInfo)
-      {
-      /* resolve using declarations within the header files */
-      vtkWrap_ApplyUsingDeclarations(data, file_info, hierarchyInfo);
-      }
     }
 
   fprintf(fp,"// tcl wrapper for %s object\n//\n",data->Name);
diff --git a/Wrapping/Tools/vtkWrapText.c b/Wrapping/Tools/vtkWrapText.c
index aae309d..d95f28a 100644
--- a/Wrapping/Tools/vtkWrapText.c
+++ b/Wrapping/Tools/vtkWrapText.c
@@ -659,7 +659,7 @@ const char *vtkWrapText_FormatComment(
         l = i+1;
         if (cp[l] == '/') { l++; }
         while ((cp[l] >= 'a' && cp[l] <= 'z') ||
-               (cp[l] >= 'A' && cp[l] <= 'Z')) { l++; }
+               (cp[l] >= 'a' && cp[l] <= 'z')) { l++; }
         if (cp[l] == '>')
           {
           if (cp[i+1] == 'p' || cp[i+1] == 'P' ||
diff --git a/debian/changelog b/debian/changelog
index 7ccbe63..c5c98da 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,15 +1,3 @@
-vtk6 (6.3.0+dfsg1-1) UNRELEASED; urgency=medium
-
-  * [b864c36] Remove all patches to prepare for update to 6.3.0
-  * [4641342] d/watch: Correct repackage suffix
-  * [e7e6dfa] Imported Upstream version 6.3.0+dfsg1
-  * [1033ba0] Update patchset for new version
-  * [b1828b6] * New upstream version 6.3.0, Closes: #805010
-              * Move native java modules into new -jni package 
-              * Enable use of system proj4, Closes: #750184
-
- -- Gert Wollny <gw.fossdev at gmail.com>  Tue, 05 Apr 2016 11:00:55 +0000
-
 vtk6 (6.2.0+dfsg1-11.1) unstable; urgency=medium
 
   * Non-maintainer upload.
diff --git a/debian/control b/debian/control
index 5192166..ef37f8e 100644
--- a/debian/control
+++ b/debian/control
@@ -41,8 +41,7 @@ Build-Depends: chrpath,
                libogg-dev,
                libosmesa6-dev,
                libpng-dev,
-	       libpq-dev,
-	       libproj-dev,  
+               libpq-dev,
                libqt5opengl5-dev,
                libqt5webkit5-dev,
                libsqlite3-dev,
@@ -105,12 +104,11 @@ Depends: libavcodec-dev,
          libogg-dev,
          libpng-dev,
          libpq-dev,
-	 libproj-dev, 
          libpython-dev,
          libswscale-dev,
          libtheora-dev,
          libtiff-dev,
-         libvtk6.3 (= ${binary:Version}),
+         libvtk6.2 (= ${binary:Version}),
          libvtk6-java (= ${binary:Version}),
          libx11-dev,
          libxft-dev,
@@ -149,8 +147,8 @@ Depends: libvtk6-dev (= ${binary:Version}),
          qttools5-private-dev,
          libqt5opengl5-dev,
          libqt5webkit5-dev
-Breaks: libvtk6-dev (<< 6.3.0+dfsg1)
-Replaces: libvtk6-dev (<< 6.3.0+dfsg1)
+Breaks: libvtk6-dev (<< 6.2.0+dfsg1-4)
+Replaces: libvtk6-dev (<< 6.2.0+dfsg1-4)
 Description: VTK header files, containing Qt files
  The Visualization Toolkit (VTK) is an open-source software system
  for 3D computer graphics, image processing, and visualization.
@@ -158,7 +156,7 @@ Description: VTK header files, containing Qt files
  This package provides the VTK header files required to compile
  C++ programs that use VTK to do 3D visualisation. Qt files
 
-Package: libvtk6.3
+Package: libvtk6.2
 Architecture: any
 Section: libs
 Depends: ${misc:Depends},
@@ -176,7 +174,7 @@ Description: VTK libraries
  This package provides the shared libraries needed to run C++ programs
  that use VTK.
 
-Package: libvtk6.3-qt
+Package: libvtk6.2-qt
 Architecture: any
 Section: libs
 Depends: ${misc:Depends},
@@ -190,25 +188,9 @@ Description: VTK libraries, Qt files
  This package provides the shared libraries needed to run C++ programs
  that use VTK. Qt files
 
-Package: libvtk6-jni
-Architecture: any
-Depends:
- ${java:Depends},
- ${misc:Depends},
- ${shlibs:Depends}
-Breaks: libvtk6-java (<< 6.3.0+dfsg1-1)
-Section: java
-Description: Visualization Toolkit - A high level 3D visualization library - java
- The Visualization Toolkit (VTK) is an object oriented, high level
- library that allows one to easily write C++ programs, Tcl, Python and
- Java scripts that do 3D visualization.
- .
- This package provides the VTK Java language support.
-
 Package: libvtk6-java
 Architecture: any
 Depends:
- libvtk6-jni (= ${binary:Version}),
  ${java:Depends},
  ${misc:Depends},
  ${shlibs:Depends}
@@ -228,8 +210,8 @@ Description: Visualization Toolkit - A high level 3D visualization library - jav
 Package: python-vtk6
 Architecture: any
 Section: python
-Depends: libvtk6.3 (= ${binary:Version}),
-	 libvtk6.3-qt (= ${binary:Version}),
+Depends: libvtk6.2 (= ${binary:Version}),
+	 libvtk6.2-qt (= ${binary:Version}),
 	 python-autobahn,
          python-mpi4py,
          python-six,
@@ -251,8 +233,8 @@ Description: Python bindings for VTK
 Package: tcl-vtk6
 Architecture: any
 Section: interpreters
-Depends: libvtk6.3 (= ${binary:Version}),
-	 libvtk6.3-qt (= ${binary:Version}),
+Depends: libvtk6.2 (= ${binary:Version}),
+	 libvtk6.2-qt (= ${binary:Version}),
          ${misc:Depends},
          ${shlibs:Depends}
 Suggests: vtk6-doc,
@@ -267,7 +249,7 @@ Description: Tcl bindings for VTK
 Package: vtk6
 Architecture: any
 Section: interpreters
-Depends: libvtk6.3 (= ${binary:Version}),
+Depends: libvtk6.2 (= ${binary:Version}),
          ${misc:Depends},
          ${shlibs:Depends}
 Suggests: vtk6-doc,
diff --git a/debian/libvtk6-dev.install b/debian/libvtk6-dev.install
index bd5aa5d..fae6068 100644
--- a/debian/libvtk6-dev.install
+++ b/debian/libvtk6-dev.install
@@ -2,26 +2,26 @@
 # to get paraview debian/build properly on top of vtk we now add this as a symlink 
 # in the python-vtk6 package 
 # /usr/lib/*/python2.7/site-packages/vtk/*
-CMake/TopologicalSort.cmake usr/lib/cmake/vtk-6.3/
-CMake/exportheader.cmake.in usr/lib/cmake/vtk-6.3/
-CMake/vtkGroups.cmake usr/lib/cmake/vtk-6.3/
-CMake/vtkTesting*.cmake	usr/lib/cmake/vtk-6.3/
-Common/Core/vtkPointAccumulator.hxx usr/include/vtk-6.3/
-Common/DataModel/vtkMarchingCubesTriangleCases.h usr/include/vtk-6.3/
-Filters/Statistics/vtkStatisticsAlgorithmPrivate.h usr/include/vtk-6.3/
-IO/Import/vtk3DS.h usr/include/vtk-6.3/
-Testing/Core/vtkTestDriver.h usr/include/vtk-6.3
-Testing/Core/vtkTestUtilities.h usr/include/vtk-6.3/
-Testing/Core/vtkTesting*.h usr/include/vtk-6.3
-Testing/Rendering/vtkRegressionTestImage.h usr/include/vtk-6.3/
-Testing/Rendering/vtkTesting*.h usr/include/vtk-6.3
-ThirdParty/ftgl/src/FTGL.h usr/include/vtk-6.3/
-Wrapping/Java/JavaDependencies.cmake.in usr/lib/cmake/vtk-6.3/
-debian/build/ThirdParty/ftgl/vtkftglConfig.h usr/include/vtk-6.3/
-debian/build/ThirdParty/netcdf/vtk_netcdf.h usr/include/vtk-6.3/
-debian/build/ThirdParty/netcdf/vtk_netcdfcpp.h usr/include/vtk-6.3/
-debian/build/lib/cmake/vtk-6.3/Modules/*-Headers.cmake	usr/lib/cmake/vtk-6.3/Modules/
-usr/include/vtk-6.3                    usr/include
+CMake/TopologicalSort.cmake usr/lib/cmake/vtk-6.2/
+CMake/exportheader.cmake.in usr/lib/cmake/vtk-6.2/
+CMake/vtkGroups.cmake usr/lib/cmake/vtk-6.2/
+CMake/vtkTesting*.cmake	usr/lib/cmake/vtk-6.2/
+Common/Core/vtkPointAccumulator.hxx usr/include/vtk-6.2/
+Common/DataModel/vtkMarchingCubesCases.h usr/include/vtk-6.2/
+Filters/Statistics/vtkStatisticsAlgorithmPrivate.h usr/include/vtk-6.2/
+IO/Import/vtk3DS.h usr/include/vtk-6.2/
+Testing/Core/vtkTestDriver.h usr/include/vtk-6.2
+Testing/Core/vtkTestUtilities.h usr/include/vtk-6.2/
+Testing/Core/vtkTesting*.h usr/include/vtk-6.2
+Testing/Rendering/vtkRegressionTestImage.h usr/include/vtk-6.2/
+Testing/Rendering/vtkTesting*.h usr/include/vtk-6.2
+ThirdParty/ftgl/src/FTGL.h usr/include/vtk-6.2/
+Wrapping/Java/JavaDependencies.cmake.in usr/lib/cmake/vtk-6.2/
+debian/build/ThirdParty/ftgl/vtkftglConfig.h usr/include/vtk-6.2/
+debian/build/ThirdParty/netcdf/vtk_netcdf.h usr/include/vtk-6.2/
+debian/build/ThirdParty/netcdf/vtk_netcdfcpp.h usr/include/vtk-6.2/
+debian/build/lib/cmake/vtk-6.2/Modules/*-Headers.cmake	usr/lib/cmake/vtk-6.2/Modules/
+usr/include/vtk-6.2                    usr/include
 usr/lib/*/*.so
-usr/lib/cmake/vtk-6.3
-usr/share/doc/vtk-6.3/doxygen/* /usr/share/vtk-6.3/doxygen/
+usr/lib/cmake/vtk-6.2
+usr/share/doc/vtk-6.2/doxygen/* /usr/share/vtk-6.2/doxygen/
diff --git a/debian/libvtk6-java.install b/debian/libvtk6-java.install
index 0f158c0..405c0d3 100644
--- a/debian/libvtk6-java.install
+++ b/debian/libvtk6-java.install
@@ -1,5 +1,5 @@
-usr/bin/vtkParseJava-6.3                    usr/bin
-usr/bin/vtkWrapJava-6.3                     usr/bin
+usr/bin/vtkParseJava-6.2                    usr/bin
+usr/bin/vtkWrapJava-6.2                     usr/bin
 usr/lib/*/vtk6.jar                          usr/share/java
-
+usr/lib/*/jni/                      
 
diff --git a/debian/libvtk6-jni.install b/debian/libvtk6-jni.install
deleted file mode 100644
index 249b773..0000000
--- a/debian/libvtk6-jni.install
+++ /dev/null
@@ -1 +0,0 @@
-usr/lib/*/jni/
\ No newline at end of file
diff --git a/debian/libvtk6-jni.lintian-overrides b/debian/libvtk6-jni.lintian-overrides
deleted file mode 100644
index 2307559..0000000
--- a/debian/libvtk6-jni.lintian-overrides
+++ /dev/null
@@ -1,3 +0,0 @@
-
-#
-libvtk6-jni: hardening-no-relro
diff --git a/debian/libvtk6-qt-dev.install b/debian/libvtk6-qt-dev.install
index 2c81ec4..1d6b20a 100644
--- a/debian/libvtk6-qt-dev.install
+++ b/debian/libvtk6-qt-dev.install
@@ -1,6 +1,6 @@
 # remove Python files here and privide a symlink in the python package 
 # usr/lib/*/python2.7/site-packages/vtk/*Qt*
 usr/lib/*/*Qt*.so
-usr/lib/cmake/vtk-6.3/Modules/*Qt*
-usr/include/vtk-6.3/*Qt*
-usr/include/vtk-6.3/Q*
+usr/lib/cmake/vtk-6.2/Modules/*Qt*
+usr/include/vtk-6.2/*Qt*
+usr/include/vtk-6.2/Q*
diff --git a/debian/libvtk6.3-qt.install b/debian/libvtk6.2-qt.install
similarity index 100%
rename from debian/libvtk6.3-qt.install
rename to debian/libvtk6.2-qt.install
diff --git a/debian/libvtk6.2-qt.lintian-overrides b/debian/libvtk6.2-qt.lintian-overrides
new file mode 100644
index 0000000..2c1318d
--- /dev/null
+++ b/debian/libvtk6.2-qt.lintian-overrides
@@ -0,0 +1,3 @@
+libvtk6.2-qt: hardening-no-relro
+libvtk6.2-qt: package-name-doesnt-match-sonames
+
diff --git a/debian/libvtk6.3.install b/debian/libvtk6.2.install
similarity index 100%
rename from debian/libvtk6.3.install
rename to debian/libvtk6.2.install
diff --git a/debian/libvtk6.2.lintian-overrides b/debian/libvtk6.2.lintian-overrides
new file mode 100644
index 0000000..ec6de0e
--- /dev/null
+++ b/debian/libvtk6.2.lintian-overrides
@@ -0,0 +1,5 @@
+libvtk6.2: package-name-doesnt-match-sonames
+libvtk6.2: hardening-no-relro
+# Will be discussed with upstream to have an opportunity to set USE_SYSTEM_lib
+
+libvtk6.2: embedded-library
diff --git a/debian/libvtk6.3-qt.lintian-overrides b/debian/libvtk6.3-qt.lintian-overrides
deleted file mode 100644
index 9d8522a..0000000
--- a/debian/libvtk6.3-qt.lintian-overrides
+++ /dev/null
@@ -1,3 +0,0 @@
-libvtk6.3-qt: hardening-no-relro
-libvtk6.3-qt: package-name-doesnt-match-sonames
-
diff --git a/debian/libvtk6.3.lintian-overrides b/debian/libvtk6.3.lintian-overrides
deleted file mode 100644
index 3810c82..0000000
--- a/debian/libvtk6.3.lintian-overrides
+++ /dev/null
@@ -1,5 +0,0 @@
-libvtk6.3: package-name-doesnt-match-sonames
-libvtk6.3: hardening-no-relro
-# Will be discussed with upstream to have an opportunity to set USE_SYSTEM_lib
-
-libvtk6.3: embedded-library
diff --git a/debian/patches/104_fix_gcc_version_6.patch b/debian/patches/104_fix_gcc_version_6.patch
index 7982e50..390152c 100644
--- a/debian/patches/104_fix_gcc_version_6.patch
+++ b/debian/patches/104_fix_gcc_version_6.patch
@@ -2,8 +2,8 @@ Description: Fix to be able to compile with gcc-6
 Author: Gerardo Malazdrewicz <gerardo at malazdrewicz.com.ar>
 Bug: https://bugs.debian.org/812296
 
---- a/CMake/GenerateExportHeader.cmake
-+++ b/CMake/GenerateExportHeader.cmake
+--- a/CMake/GenerateExportHeader.cmake	2016-02-10 23:14:42.395094043 -0400
++++ b/CMake/GenerateExportHeader.cmake	2016-02-10 23:10:16.756787993 -0400
 @@ -166,7 +166,7 @@
      execute_process(COMMAND ${CMAKE_C_COMPILER} ARGS --version
        OUTPUT_VARIABLE _gcc_version_info
@@ -13,9 +13,9 @@ Bug: https://bugs.debian.org/812296
        _gcc_version "${_gcc_version_info}")
      # gcc on mac just reports: "gcc (GCC) 3.3 20030304 ..." without the
      # patch level, handle this here:
---- a/CMake/vtkCompilerExtras.cmake
-+++ b/CMake/vtkCompilerExtras.cmake
-@@ -32,7 +32,7 @@
+--- a/CMake/vtkCompilerExtras.cmake	2016-02-10 23:14:47.587139148 -0400
++++ b/CMake/vtkCompilerExtras.cmake	2016-02-10 23:07:47.667495203 -0400
+@@ -27,7 +27,7 @@
      OUTPUT_VARIABLE _gcc_version_info
      ERROR_VARIABLE _gcc_version_info)
  
diff --git a/debian/patches/105_unforce_embedded_glew.patch b/debian/patches/105_unforce_embedded_glew.patch
deleted file mode 100644
index be7d9b7..0000000
--- a/debian/patches/105_unforce_embedded_glew.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-Description: Remove the FORCE from the use_system_glew=off option
- The embedded version of GLEW seems to be older than the version
- provided by Debian, so I assume that the fixes have been applied. 
-Author: Gert Wollny <gw.fossdev at gmail.com> 
-
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -207,7 +207,7 @@
- endif()
- 
- # default to not using the system GLEW as ours has fixes in it right now
--set(VTK_USE_SYSTEM_GLEW OFF CACHE BOOL "do not use a system glew" FORCE)
-+set(VTK_USE_SYSTEM_GLEW OFF CACHE BOOL "do not use a system glew" ON)
- 
- set(VTK_BUILD_SHARED_LIBS ${BUILD_SHARED_LIBS})
- 
diff --git a/debian/patches/10_allpatches.patch b/debian/patches/10_allpatches.patch
index 788f74c..16d7b78 100644
--- a/debian/patches/10_allpatches.patch
+++ b/debian/patches/10_allpatches.patch
@@ -30,6 +30,18 @@ Forwarded: <no|not-needed|url proving that it has been forwarded>
 Reviewed-By: <name and email of someone who approved the patch>
 Last-Update: <YYYY-MM-DD>
 
+Index: VTK-6.2.0/Utilities/Doxygen/doxyfile.in
+===================================================================
+--- VTK-6.2.0.orig/Utilities/Doxygen/doxyfile.in
++++ VTK-6.2.0/Utilities/Doxygen/doxyfile.in
+@@ -22,6 +22,7 @@ PDF_HYPERLINKS       = YES
+ 
+ HAVE_DOT             = @HAVE_DOT_YESNO@
+ DOT_PATH             = "@DOT_PATH@"
++DOT_IMAGE_FORMAT     = svg
+ CLASS_GRAPH          = YES
+ COLLABORATION_GRAPH  = YES
+ TEMPLATE_RELATIONS   = YES
 Index: VTK-6.2.0/Wrapping/Tcl/vtkTkAppInit.cxx
 ===================================================================
 --- VTK-6.2.0.orig/Wrapping/Tcl/vtkTkAppInit.cxx
diff --git a/debian/patches/30_matplotlib.patch b/debian/patches/30_matplotlib.patch
index 3e1e54f..d2e45d7 100644
--- a/debian/patches/30_matplotlib.patch
+++ b/debian/patches/30_matplotlib.patch
@@ -1,13 +1,15 @@
---- a/Rendering/Matplotlib/vtkMatplotlibMathTextUtilities.h
-+++ b/Rendering/Matplotlib/vtkMatplotlibMathTextUtilities.h
-@@ -143,6 +143,10 @@
-   // is called internally when matplotlib rendering is first needed and is used
-   // to implement IsAvailable.
-   static Availability CheckMPLAvailability();
+Index: VTK-6.2.0/Rendering/Matplotlib/vtkMatplotlibMathTextUtilities.h
+===================================================================
+--- VTK-6.2.0.orig/Rendering/Matplotlib/vtkMatplotlibMathTextUtilities.h
++++ VTK-6.2.0/Rendering/Matplotlib/vtkMatplotlibMathTextUtilities.h
+@@ -132,6 +132,10 @@ protected:
+   // Function used to check MPL availability and update MPLMathTextAvailable.
+   // This will do tests only the first time this method is called.
+   static void CheckMPLAvailability();
 +  static void DisableMPL()
 +    {
 +    MPLMathTextAvailable = UNAVAILABLE;
 +    };
  
-   // Description:
-   // Cache the availability of matplotlib in the current python session.
+ private:
+   vtkMatplotlibMathTextUtilities(const vtkMatplotlibMathTextUtilities&); // Not implemented.
diff --git a/debian/patches/40_use_system_sqlite.patch b/debian/patches/40_use_system_sqlite.patch
index f3e4b06..f0e3222 100644
--- a/debian/patches/40_use_system_sqlite.patch
+++ b/debian/patches/40_use_system_sqlite.patch
@@ -3,8 +3,10 @@ Author: Anton Gladky <gladk at debian.org>
 Bug-Debian: http://bugs.debian.org/750183
 Last-Update: 2014-06-03
 
---- a/IO/SQL/vtkSQLiteDatabase.cxx
-+++ b/IO/SQL/vtkSQLiteDatabase.cxx
+Index: VTK-6.2.0/IO/SQL/vtkSQLiteDatabase.cxx
+===================================================================
+--- VTK-6.2.0.orig/IO/SQL/vtkSQLiteDatabase.cxx
++++ VTK-6.2.0/IO/SQL/vtkSQLiteDatabase.cxx
 @@ -29,7 +29,7 @@
  #include <vtksys/ios/fstream>
  #include <vtksys/ios/sstream>
@@ -14,7 +16,7 @@ Last-Update: 2014-06-03
  
  vtkStandardNewMacro(vtkSQLiteDatabase);
  
-@@ -307,15 +307,15 @@
+@@ -307,15 +307,15 @@ bool vtkSQLiteDatabase::Open(const char*
        }
      }
  
@@ -34,7 +36,7 @@ Last-Update: 2014-06-03
      return false;
      }
    else
-@@ -334,8 +334,8 @@
+@@ -334,8 +334,8 @@ void vtkSQLiteDatabase::Close()
      }
    else
      {
@@ -45,7 +47,7 @@ Last-Update: 2014-06-03
        {
        vtkWarningMacro(<< "Close(): SQLite returned result code " << result);
        }
-@@ -374,7 +374,7 @@
+@@ -374,7 +374,7 @@ vtkStringArray * vtkSQLiteDatabase::GetT
    if (!status)
      {
      vtkErrorMacro(<< "GetTables(): Database returned error: "
@@ -54,7 +56,7 @@ Last-Update: 2014-06-03
      query->Delete();
      return this->Tables;
      }
-@@ -403,7 +403,7 @@
+@@ -403,7 +403,7 @@ vtkStringArray * vtkSQLiteDatabase::GetR
    if (!status)
      {
      vtkErrorMacro(<< "GetRecord(" << table << "): Database returned error: "
@@ -63,7 +65,7 @@ Last-Update: 2014-06-03
      query->Delete();
      return NULL;
      }
-@@ -467,10 +467,10 @@
+@@ -467,10 +467,10 @@ bool vtkSQLiteDatabase::ParseURL(const c
  // ----------------------------------------------------------------------
  bool vtkSQLiteDatabase::HasError()
  {
@@ -76,8 +78,10 @@ Last-Update: 2014-06-03
 -  return vtk_sqlite3_errmsg(this->SQLiteInstance);
 +  return sqlite3_errmsg(this->SQLiteInstance);
  }
---- a/IO/SQL/vtkSQLiteQuery.cxx
-+++ b/IO/SQL/vtkSQLiteQuery.cxx
+Index: VTK-6.2.0/IO/SQL/vtkSQLiteQuery.cxx
+===================================================================
+--- VTK-6.2.0.orig/IO/SQL/vtkSQLiteQuery.cxx
++++ VTK-6.2.0/IO/SQL/vtkSQLiteQuery.cxx
 @@ -25,7 +25,7 @@
  #include "vtkVariant.h"
  #include "vtkVariantArray.h"
@@ -87,7 +91,7 @@ Last-Update: 2014-06-03
  
  #include <cassert>
  
-@@ -43,7 +43,7 @@
+@@ -43,7 +43,7 @@ vtkSQLiteQuery::vtkSQLiteQuery()
  {
    this->Statement = NULL;
    this->InitialFetch = true;
@@ -96,7 +100,7 @@ Last-Update: 2014-06-03
    this->LastErrorText = NULL;
    this->TransactionInProgress = false;
  }
-@@ -61,7 +61,7 @@
+@@ -61,7 +61,7 @@ vtkSQLiteQuery::~vtkSQLiteQuery()
      {
      if (this->Database != NULL)
        {
@@ -105,7 +109,7 @@ Last-Update: 2014-06-03
        this->Statement = NULL;
        }
      }
-@@ -128,8 +128,8 @@
+@@ -131,8 +131,8 @@ bool vtkSQLiteQuery::SetQuery(const char
    if (this->Statement)
      {
      vtkDebugMacro(<<"Finalizing old statement");
@@ -116,7 +120,7 @@ Last-Update: 2014-06-03
        {
        vtkWarningMacro(<<"SetQuery(): Finalize returned unexpected code "
                        << finalizeStatus);
-@@ -148,19 +148,19 @@
+@@ -151,19 +151,19 @@ bool vtkSQLiteQuery::SetQuery(const char
        return false;
        }
  
@@ -141,7 +145,7 @@ Last-Update: 2014-06-03
                      << this->GetLastErrorText()
                      << " on statement: '"
                      << this->Query << "'");
-@@ -191,31 +191,31 @@
+@@ -194,31 +194,31 @@ bool vtkSQLiteQuery::Execute()
      }
    else
      {
@@ -180,7 +184,7 @@ Last-Update: 2014-06-03
                    << this->GetLastErrorText());
      this->Active = false;
      return false;
-@@ -236,7 +236,7 @@
+@@ -239,7 +239,7 @@ int vtkSQLiteQuery::GetNumberOfFields()
      }
    else
      {
@@ -189,7 +193,7 @@ Last-Update: 2014-06-03
      }
  }
  
-@@ -256,7 +256,7 @@
+@@ -259,7 +259,7 @@ const char * vtkSQLiteQuery::GetFieldNam
      }
    else
      {
@@ -198,7 +202,7 @@ Last-Update: 2014-06-03
      }
  }
  
-@@ -276,22 +276,22 @@
+@@ -279,22 +279,22 @@ int vtkSQLiteQuery::GetFieldType(int col
      }
    else
      {
@@ -228,7 +232,7 @@ Last-Update: 2014-06-03
                      <<" from SQLite.");
        return VTK_VOID;
        }
-@@ -312,7 +312,7 @@
+@@ -315,7 +315,7 @@ bool vtkSQLiteQuery::NextRow()
      {
      vtkDebugMacro(<<"NextRow(): Initial fetch being handled.");
      this->InitialFetch = false;
@@ -237,7 +241,7 @@ Last-Update: 2014-06-03
        {
        return false;
        }
-@@ -323,12 +323,12 @@
+@@ -326,12 +326,12 @@ bool vtkSQLiteQuery::NextRow()
      }
    else
      {
@@ -253,7 +257,7 @@ Last-Update: 2014-06-03
        {
        return true;
        }
-@@ -336,8 +336,8 @@
+@@ -339,8 +339,8 @@ bool vtkSQLiteQuery::NextRow()
        {
        vtkSQLiteDatabase *dbContainer = vtkSQLiteDatabase::SafeDownCast( this->Database );
        assert(dbContainer != NULL);
@@ -264,7 +268,7 @@ Last-Update: 2014-06-03
        vtkErrorMacro(<<"NextRow(): Database returned error code "
                      << result << " with the following message: "
                      << this->GetLastErrorText());
-@@ -363,33 +363,33 @@
+@@ -366,33 +366,33 @@ vtkVariant vtkSQLiteQuery::DataValue(vtk
      }
    else
      {
@@ -309,7 +313,7 @@ Last-Update: 2014-06-03
        default:
          return vtkVariant();
        }
-@@ -420,11 +420,11 @@
+@@ -423,11 +423,11 @@ bool vtkSQLiteQuery::BeginTransaction()
    vtkSQLiteDatabase *dbContainer = vtkSQLiteDatabase::SafeDownCast( this->Database );
    assert(dbContainer != NULL);
  
@@ -324,7 +328,7 @@ Last-Update: 2014-06-03
      {
      this->TransactionInProgress = true;
      this->SetLastErrorText(NULL);
-@@ -448,7 +448,7 @@
+@@ -451,7 +451,7 @@ bool vtkSQLiteQuery::CommitTransaction()
  {
    if (this->Statement)
      {
@@ -333,7 +337,7 @@ Last-Update: 2014-06-03
      this->Statement = NULL;
      }
  
-@@ -460,11 +460,11 @@
+@@ -463,11 +463,11 @@ bool vtkSQLiteQuery::CommitTransaction()
  
    vtkSQLiteDatabase *dbContainer = vtkSQLiteDatabase::SafeDownCast( this->Database );
    assert(dbContainer != NULL);
@@ -348,7 +352,7 @@ Last-Update: 2014-06-03
      {
      this->TransactionInProgress = false;
      this->SetLastErrorText(NULL);
-@@ -496,11 +496,11 @@
+@@ -499,11 +499,11 @@ bool vtkSQLiteQuery::RollbackTransaction
  
    vtkSQLiteDatabase *dbContainer = vtkSQLiteDatabase::SafeDownCast( this->Database );
    assert(dbContainer != NULL);
@@ -363,7 +367,7 @@ Last-Update: 2014-06-03
      {
      this->TransactionInProgress = false;
      this->SetLastErrorText(NULL);
-@@ -644,11 +644,11 @@
+@@ -647,11 +647,11 @@ bool vtkSQLiteQuery::BindIntegerParamete
    if (this->Active)
      {
      this->Active = false;
@@ -378,7 +382,7 @@ Last-Update: 2014-06-03
      {
      vtksys_ios::ostringstream errormessage;
      errormessage << "sqlite_bind_int returned error: " << status;
-@@ -673,11 +673,11 @@
+@@ -676,11 +676,11 @@ bool vtkSQLiteQuery::BindInt64Parameter(
    if (this->Active)
      {
      this->Active = false;
@@ -393,7 +397,7 @@ Last-Update: 2014-06-03
      {
      vtksys_ios::ostringstream errormessage;
      errormessage << "sqlite_bind_int64 returned error: " << status;
-@@ -702,12 +702,12 @@
+@@ -705,12 +705,12 @@ bool vtkSQLiteQuery::BindDoubleParameter
    if (this->Active)
      {
      this->Active = false;
@@ -409,7 +413,7 @@ Last-Update: 2014-06-03
      {
      vtksys_ios::ostringstream errormessage;
      errormessage << "sqlite_bind_double returned error: " << status;
-@@ -731,12 +731,12 @@
+@@ -734,12 +734,12 @@ bool vtkSQLiteQuery::BindStringParameter
    if (this->Active)
      {
      this->Active = false;
@@ -425,7 +429,7 @@ Last-Update: 2014-06-03
      {
      vtksys_ios::ostringstream errormessage;
      errormessage << "sqlite_bind_text returned error: " << status;
-@@ -760,17 +760,17 @@
+@@ -763,17 +763,17 @@ bool vtkSQLiteQuery::BindBlobParameter(i
    if (this->Active)
      {
      this->Active = false;
@@ -447,7 +451,7 @@ Last-Update: 2014-06-03
      {
      vtksys_ios::ostringstream errormessage;
      errormessage << "sqlite_bind_blob returned error: " << status;
-@@ -794,12 +794,12 @@
+@@ -797,12 +797,12 @@ bool vtkSQLiteQuery::ClearParameterBindi
    if (this->Active)
      {
      this->Active = false;
@@ -463,8 +467,10 @@ Last-Update: 2014-06-03
      {
      vtksys_ios::ostringstream errormessage;
      errormessage << "sqlite_clear_bindings returned error: " << status;
---- a/IO/SQL/vtkSQLiteQuery.h
-+++ b/IO/SQL/vtkSQLiteQuery.h
+Index: VTK-6.2.0/IO/SQL/vtkSQLiteQuery.h
+===================================================================
+--- VTK-6.2.0.orig/IO/SQL/vtkSQLiteQuery.h
++++ VTK-6.2.0/IO/SQL/vtkSQLiteQuery.h
 @@ -47,7 +47,7 @@
  class vtkSQLiteDatabase;
  class vtkVariant;
@@ -474,7 +480,7 @@ Last-Update: 2014-06-03
  
  class VTKIOSQL_EXPORT vtkSQLiteQuery : public vtkSQLQuery
  {
-@@ -155,7 +155,7 @@
+@@ -155,7 +155,7 @@ private:
    vtkSQLiteQuery(const vtkSQLiteQuery &); // Not implemented.
    void operator=(const vtkSQLiteQuery &); // Not implemented.
  
@@ -483,16 +489,20 @@ Last-Update: 2014-06-03
    bool InitialFetch;
    int InitialFetchResult;
    char *LastErrorText;
---- a/ThirdParty/sqlite/CMakeLists.txt
-+++ b/ThirdParty/sqlite/CMakeLists.txt
+Index: VTK-6.2.0/ThirdParty/sqlite/CMakeLists.txt
+===================================================================
+--- VTK-6.2.0.orig/ThirdParty/sqlite/CMakeLists.txt
++++ VTK-6.2.0/ThirdParty/sqlite/CMakeLists.txt
 @@ -1,4 +1,3 @@
  set(vtksqlite_THIRD_PARTY 1)
 -set(vtksqlite_LIBRARIES vtksqlite)
 +set(vtksqlite_LIBRARIES sqlite3)
  vtk_module_export_info()
 -add_subdirectory(vtksqlite)
---- a/IO/SQL/vtkSQLiteDatabase.h
-+++ b/IO/SQL/vtkSQLiteDatabase.h
+Index: VTK-6.2.0/IO/SQL/vtkSQLiteDatabase.h
+===================================================================
+--- VTK-6.2.0.orig/IO/SQL/vtkSQLiteDatabase.h
++++ VTK-6.2.0/IO/SQL/vtkSQLiteDatabase.h
 @@ -49,7 +49,7 @@
  class vtkSQLQuery;
  class vtkSQLiteQuery;
@@ -502,7 +512,7 @@ Last-Update: 2014-06-03
  
  class VTKIOSQL_EXPORT vtkSQLiteDatabase : public vtkSQLDatabase
  {
-@@ -147,7 +147,7 @@
+@@ -147,7 +147,7 @@ protected:
    virtual bool ParseURL(const char* url);
  
  private:
diff --git a/debian/patches/60_use_system_mpi4py.patch b/debian/patches/60_use_system_mpi4py.patch
index b0bfbb0..f4810a2 100644
--- a/debian/patches/60_use_system_mpi4py.patch
+++ b/debian/patches/60_use_system_mpi4py.patch
@@ -2,9 +2,9 @@ Description: use system mpi4py
 Author: Anton Gladky <gladk at debian.org>
 Last-Update: 2015-03-24
 
---- a/Parallel/MPI4Py/CMakeLists.txt
-+++ b/Parallel/MPI4Py/CMakeLists.txt
-@@ -18,7 +18,7 @@
+--- vtk6-6.2.0.orig/Parallel/MPI4Py/CMakeLists.txt
++++ vtk6-6.2.0/Parallel/MPI4Py/CMakeLists.txt
+@@ -17,7 +17,7 @@ if(VTK_USE_SYSTEM_MPI4PY)
      mark_as_advanced(MPI4PY_INCLUDE_DIR)
    endif()
  else()
@@ -13,9 +13,9 @@ Last-Update: 2015-03-24
  endif()
  include_directories("${MPI4PY_INCLUDE_DIR}")
  
---- a/Parallel/MPI4Py/module.cmake
-+++ b/Parallel/MPI4Py/module.cmake
-@@ -5,8 +5,6 @@
+--- vtk6-6.2.0.orig/Parallel/MPI4Py/module.cmake
++++ vtk6-6.2.0/Parallel/MPI4Py/module.cmake
+@@ -5,8 +5,6 @@ if (VTK_WRAP_PYTHON)
      DEPENDS
        vtkParallelMPI
        vtkPython
diff --git a/debian/patches/70_fix_ftbfs_gcc49.patch b/debian/patches/70_fix_ftbfs_gcc49.patch
index 5923b1c..e1dd6ec 100644
--- a/debian/patches/70_fix_ftbfs_gcc49.patch
+++ b/debian/patches/70_fix_ftbfs_gcc49.patch
@@ -4,9 +4,11 @@ Bug-Debian: http://bugs.debian.org/746923
 Forwarded: https://github.com/Kitware/VTK/pull/7
 Last-Update: 2014-05-30
 
---- a/Filters/ParallelMPI/vtkDistributedDataFilter.cxx
-+++ b/Filters/ParallelMPI/vtkDistributedDataFilter.cxx
-@@ -1112,7 +1112,10 @@
+Index: VTK-6.2.0/Filters/ParallelMPI/vtkDistributedDataFilter.cxx
+===================================================================
+--- VTK-6.2.0.orig/Filters/ParallelMPI/vtkDistributedDataFilter.cxx
++++ VTK-6.2.0/Filters/ParallelMPI/vtkDistributedDataFilter.cxx
+@@ -1079,7 +1079,10 @@ vtkDataSet *vtkDistributedDataFilter::Te
    vtkIdType cellsPerNode = numTotalCells / nprocs;
  
    vtkIdList **sendCells = new vtkIdList * [ nprocs ];
@@ -18,7 +20,7 @@ Last-Update: 2014-05-30
  
    if (numConsumers == nprocs - 1)
      {
-@@ -1597,7 +1600,9 @@
+@@ -1564,7 +1567,9 @@ vtkFloatArray **
    // Exchange int arrays
  
    float **recvArrays = new float * [nprocs];
@@ -29,7 +31,7 @@ Last-Update: 2014-05-30
  
    if (sendSize[me] > 0)  // sent myself an array
      {
-@@ -1719,7 +1724,9 @@
+@@ -1686,7 +1691,9 @@ vtkIdTypeArray **
    // Exchange int arrays
  
    vtkIdType **recvArrays = new vtkIdType * [nprocs];
@@ -40,7 +42,7 @@ Last-Update: 2014-05-30
  
    if (sendSize[me] > 0)  // sent myself an array
      {
-@@ -2788,7 +2795,9 @@
+@@ -2789,7 +2796,9 @@ void vtkDistributedDataFilter::AddConsta
  
    unsigned char *vals = new unsigned char [npoints];
  
@@ -51,7 +53,7 @@ Last-Update: 2014-05-30
  
    vtkUnsignedCharArray *Array = vtkUnsignedCharArray::New();
    Array->SetName(arrayName);
-@@ -2808,7 +2817,9 @@
+@@ -2809,7 +2818,9 @@ void vtkDistributedDataFilter::AddConsta
  
    unsigned char *vals = new unsigned char [ncells];
  
@@ -62,7 +64,7 @@ Last-Update: 2014-05-30
  
    vtkUnsignedCharArray *Array = vtkUnsignedCharArray::New();
    Array->SetName(arrayName);
-@@ -3007,7 +3018,9 @@
+@@ -3008,7 +3019,9 @@ int vtkDistributedDataFilter::AssignGlob
    vtkIdType nGridPoints = grid->GetNumberOfPoints();
  
    vtkIdType *numPointsOutside = new vtkIdType [nprocs];
@@ -73,7 +75,7 @@ Last-Update: 2014-05-30
  
    vtkIdTypeArray *globalIds = vtkIdTypeArray::New();
    globalIds->SetNumberOfValues(nGridPoints);
-@@ -3089,10 +3102,16 @@
+@@ -3090,10 +3103,16 @@ int vtkDistributedDataFilter::AssignGlob
    // global ID back?
  
    vtkFloatArray **ptarrayOut = new vtkFloatArray * [nprocs];
@@ -92,7 +94,7 @@ Last-Update: 2014-05-30
  
    vtkIdType *next = new vtkIdType [nprocs];
    vtkIdType *next3 = new vtkIdType [nprocs];
-@@ -3267,7 +3286,9 @@
+@@ -3268,7 +3287,9 @@ vtkIdTypeArray **vtkDistributedDataFilte
      {
      // There are no cells in my assigned region
  
@@ -103,7 +105,7 @@ Last-Update: 2014-05-30
  
      return gids;
      }
-@@ -3472,7 +3493,10 @@
+@@ -3473,7 +3494,10 @@ vtkIdTypeArray **vtkDistributedDataFilte
    std::multimap<int, int>::iterator mapIt;
  
    vtkIdTypeArray **processList = new vtkIdTypeArray * [nprocs];
@@ -115,7 +117,7 @@ Last-Update: 2014-05-30
  
    for (int i=0; i<nprocs; i++)
      {
-@@ -3562,7 +3586,9 @@
+@@ -3563,7 +3587,9 @@ vtkIdTypeArray **vtkDistributedDataFilte
    vtkIdType numPoints = grid->GetNumberOfPoints();
  
    vtkIdTypeArray **ghostPtIds = new vtkIdTypeArray * [nprocs];
diff --git a/debian/patches/80_fix_arm_compilation.patch b/debian/patches/80_fix_arm_compilation.patch
index d4583df..62b1fe0 100644
--- a/debian/patches/80_fix_arm_compilation.patch
+++ b/debian/patches/80_fix_arm_compilation.patch
@@ -5,9 +5,9 @@ Author: Anton Gladky <gladk at debian.org>
 Bug-Debian: https://bugs.debian.org/793304
 Last-Update: 2015-07-29
 
---- a/Examples/Infovis/Cxx/CMakeLists.txt
-+++ b/Examples/Infovis/Cxx/CMakeLists.txt
-@@ -26,11 +26,6 @@
+--- vtk6-6.2.0+dfsg1.orig/Examples/Infovis/Cxx/CMakeLists.txt
++++ vtk6-6.2.0+dfsg1/Examples/Infovis/Cxx/CMakeLists.txt
+@@ -26,11 +26,6 @@ if(vtkViewsInfovis_LOADED)
  endif()
  
  # If Qt is enabled include the QT based examples
diff --git a/debian/patches/95_ffmpeg_2.9.patch b/debian/patches/95_ffmpeg_2.9.patch
index 0da599c..e2394ba 100644
--- a/debian/patches/95_ffmpeg_2.9.patch
+++ b/debian/patches/95_ffmpeg_2.9.patch
@@ -2,9 +2,9 @@ Description: Replace deprecated FFmpeg API
 Author: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
 Last-Update: <2015-11-02>
 
---- a/CMake/vtkTestFFMPEG.cmake
-+++ b/CMake/vtkTestFFMPEG.cmake
-@@ -32,8 +32,8 @@
+--- vtk6-6.2.0+dfsg1.orig/CMake/vtkTestFFMPEG.cmake
++++ vtk6-6.2.0+dfsg1/CMake/vtkTestFFMPEG.cmake
+@@ -32,8 +32,8 @@ if(FFMPEG_INCLUDE_DIR)
  #include <${FFMEG_CODEC_HEADER_PATH}/avcodec.h>
  int main()
  {
@@ -15,9 +15,9 @@ Last-Update: <2015-11-02>
                0, 0);
    return 0;
  }\n")
---- a/IO/FFMPEG/vtkFFMPEGWriter.cxx
-+++ b/IO/FFMPEG/vtkFFMPEGWriter.cxx
-@@ -191,11 +191,11 @@
+--- vtk6-6.2.0+dfsg1.orig/IO/FFMPEG/vtkFFMPEGWriter.cxx
++++ vtk6-6.2.0+dfsg1/IO/FFMPEG/vtkFFMPEGWriter.cxx
+@@ -189,11 +189,11 @@ int vtkFFMPEGWriterInternal::Start()
    c->height = this->Dim[1];
    if (this->Writer->GetCompression())
      {
@@ -31,7 +31,7 @@ Last-Update: <2015-11-02>
      }
  
    //to do playback at actual recorded rate, this will need more work see also below
-@@ -274,13 +274,13 @@
+@@ -272,13 +272,13 @@ int vtkFFMPEGWriterInternal::Start()
  #endif
  
    //for the output of the writer's input...
@@ -47,7 +47,7 @@ Last-Update: <2015-11-02>
    unsigned char *rgb = (unsigned char *)av_malloc(sizeof(unsigned char) * RGBsize);
    if (!rgb)
      {
-@@ -288,10 +288,10 @@
+@@ -286,10 +286,10 @@ int vtkFFMPEGWriterInternal::Start()
      return 0;
      }
    //The rgb buffer should get deleted when this->rgbInput is.
@@ -60,7 +60,7 @@ Last-Update: <2015-11-02>
    if (!this->yuvOutput)
      {
      vtkGenericWarningMacro (<< "Could not make yuvOutput avframe." );
-@@ -349,12 +349,12 @@
+@@ -347,12 +347,12 @@ int vtkFFMPEGWriterInternal::Write(vtkIm
    //convert that to YUV for input to the codec
  #ifdef VTK_FFMPEG_HAS_IMG_CONVERT
    img_convert((AVPicture *)this->yuvOutput, cc->pix_fmt,
@@ -75,7 +75,7 @@ Last-Update: <2015-11-02>
      cc->width, cc->height, cc->pix_fmt,
      SWS_BICUBIC, NULL, NULL, NULL);
  
-@@ -447,14 +447,14 @@
+@@ -445,14 +445,14 @@ void vtkFFMPEGWriterInternal::End()
    if (this->yuvOutput)
      {
      av_free(this->yuvOutput->data[0]);
diff --git a/debian/patches/96_concurrent_vtkLookupTableMapData_fix.patch b/debian/patches/96_concurrent_vtkLookupTableMapData_fix.patch
new file mode 100644
index 0000000..242b2f3
--- /dev/null
+++ b/debian/patches/96_concurrent_vtkLookupTableMapData_fix.patch
@@ -0,0 +1,198 @@
+Description: Fix crash in function called from multiple threads
+ vtkLookupTableMapData() was not thread safe and could lead to
+ crashes when accessed from multiple threads. Added a mutex around
+ the logic to determine if the color table size needed to be
+ increased.
+ .
+ Added a multi-threaded test that crashes on occasion prior
+ to this patch, but does not crash with this patch applied.
+Author: Cory Quammen <cory.quammen at kitware.com>
+Last-Update: 2016-01-31
+Bug: http://www.vtk.org/Bug/view.php?id=15365
+
+diff --git a/Common/Core/Testing/Cxx/CMakeLists.txt b/Common/Core/Testing/Cxx/CMakeLists.txt
+--- a/Common/Core/Testing/Cxx/CMakeLists.txt
++++ b/Common/Core/Testing/Cxx/CMakeLists.txt
+@@ -32,6 +32,7 @@ vtk_add_test_cxx(${vtk-module}CxxTests tests
+   TestGarbageCollector.cxx
+   # TestInstantiator.cxx # Have not enabled instantiators.
+   TestLookupTable.cxx
++  TestLookupTableThreaded.cxx
+   TestMath.cxx
+   TestMinimalStandardRandomSequence.cxx
+   TestNew.cxx
+diff --git a/Common/Core/Testing/Cxx/TestLookupTableThreaded.cxx b/Common/Core/Testing/Cxx/TestLookupTableThreaded.cxx
+new file mode 100644
+index 0000000..4330609
+--- /dev/null
++++ b/Common/Core/Testing/Cxx/TestLookupTableThreaded.cxx
+@@ -0,0 +1,57 @@
++/*=========================================================================
++
++  Program:   Visualization Toolkit
++  Module:    TestLookupTableThreaded.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 "vtkLookupTable.h"
++#include "vtkMultiThreader.h"
++#include "vtkNew.h"
++
++namespace {
++
++vtkLookupTable * lut;
++
++VTK_THREAD_RETURN_TYPE ThreadedMethod(void *)
++{
++  int numberOfValues = 25;
++  double* input = new double[numberOfValues];
++  unsigned char* output = new unsigned char[4*numberOfValues];
++  int inputType = VTK_DOUBLE;
++  int inputIncrement = 1;
++  int outputFormat = VTK_RGBA;
++
++  lut->MapScalarsThroughTable2(input, output, inputType, numberOfValues,
++                               inputIncrement, outputFormat);
++
++  delete[] input;
++  delete[] output;
++
++  return VTK_THREAD_RETURN_VALUE;
++}
++
++} // end anonymous namespace
++
++int TestLookupTableThreaded(int, char* [])
++{
++  lut = vtkLookupTable::New();
++  lut->SetNumberOfTableValues( 1024 );
++
++  vtkNew<vtkMultiThreader> threader;
++  threader->SetSingleMethod( ThreadedMethod, NULL );
++  threader->SetNumberOfThreads( 4 );
++  threader->SingleMethodExecute();
++
++  lut->Delete();
++
++  return EXIT_SUCCESS;
++}
+diff --git a/Common/Core/vtkLookupTable.cxx b/Common/Core/vtkLookupTable.cxx
+index 53d9663..2d90054 100644
+--- a/Common/Core/vtkLookupTable.cxx
++++ b/Common/Core/vtkLookupTable.cxx
+@@ -18,6 +18,7 @@
+ #include "vtkBitArray.h"
+ #include "vtkMath.h"
+ #include "vtkMathConfigure.h"
++#include "vtkMutexLock.h"
+ #include "vtkObjectFactory.h"
+ #include "vtkStringArray.h"
+ #include "vtkVariantArray.h"
+@@ -81,6 +82,8 @@ vtkLookupTable::vtkLookupTable(int sze, int ext)
+   this->Scale = VTK_SCALE_LINEAR;
+ 
+   this->OpaqueFlag=1;
++
++  this->ResizeMutex = vtkSimpleMutexLock::New();
+ }
+ 
+ //----------------------------------------------------------------------------
+@@ -88,6 +91,7 @@ vtkLookupTable::~vtkLookupTable()
+ {
+   this->Table->UnRegister( this );
+   this->Table = NULL;
++  this->ResizeMutex->Delete();
+ }
+ 
+ //----------------------------------------------------------------------------
+@@ -641,8 +645,8 @@ namespace {
+ 
+ //----------------------------------------------------------------------------
+ template<class T>
+-void vtkLookupTableMapData(vtkLookupTable *self, T *input,
+-                           unsigned char *output, int length,
++void vtkLookupTableMapData(vtkLookupTable *self, vtkSimpleMutexLock *mutex,
++                           T *input, unsigned char *output, int length,
+                            int inIncr, int outFormat, TableParameters & p)
+ {
+   int i = length;
+@@ -654,14 +658,24 @@ void vtkLookupTableMapData(vtkLookupTable *self, T *input,
+   // end. When this function is called repeatedly with the same size
+   // lookup table, memory reallocation will be done only one the first
+   // call if at all.
++
+   vtkUnsignedCharArray* lookupTable = self->GetTable();
+   vtkIdType numberOfColors = lookupTable->GetNumberOfTuples();
+   vtkIdType neededSize = (numberOfColors + vtkLookupTable::NUMBER_OF_SPECIAL_COLORS) *
+     lookupTable->GetNumberOfComponents();
++
++  // Since this involves a potential array resize and this function
++  // might be accessed concurently from more than one thread, we need a
++  // mutex here. This shouldn't affect performance much if this function
++  // is used to map many input values, but if it is called repeatedly
++  // with short input arrays, performance may be much worse.
++  mutex->Lock();
+   if (lookupTable->GetSize() < neededSize)
+     {
+     lookupTable->Resize(numberOfColors + vtkLookupTable::NUMBER_OF_SPECIAL_COLORS);
+     }
++  mutex->Unlock();
++
+   unsigned char* table = lookupTable->GetPointer(0);
+ 
+   // Writing directly to the memory location instead of adding them
+@@ -1159,7 +1173,7 @@ void vtkLookupTable::MapScalarsThroughTable2(void *input,
+           {
+           newInput->SetValue(i, bitArray->GetValue(id));
+           }
+-        vtkLookupTableMapData(this,
++        vtkLookupTableMapData(this, this->ResizeMutex,
+                               static_cast<unsigned char*>(newInput->GetPointer(0)),
+                               output, numberOfValues,
+                               inputIncrement, outputFormat, p);
+@@ -1169,7 +1183,7 @@ void vtkLookupTable::MapScalarsThroughTable2(void *input,
+         break;
+ 
+       vtkTemplateMacro(
+-        vtkLookupTableMapData(this,static_cast<VTK_TT*>(input),output,
++        vtkLookupTableMapData(this, this->ResizeMutex, static_cast<VTK_TT*>(input),output,
+                               numberOfValues, inputIncrement, outputFormat, p)
+         );
+       default:
+diff --git a/Common/Core/vtkLookupTable.h b/Common/Core/vtkLookupTable.h
+index f233c85..d0401df 100644
+--- a/Common/Core/vtkLookupTable.h
++++ b/Common/Core/vtkLookupTable.h
+@@ -56,6 +56,8 @@
+ 
+ #include "vtkUnsignedCharArray.h" // Needed for inline method
+ 
++class vtkSimpleMutexLock;
++
+ #define VTK_RAMP_LINEAR 0
+ #define VTK_RAMP_SCURVE 1
+ #define VTK_RAMP_SQRT 2
+@@ -359,6 +361,8 @@ protected:
+   int OpaqueFlag;
+   vtkTimeStamp OpaqueFlagBuildTime;
+ 
++  vtkSimpleMutexLock* ResizeMutex;
++
+ private:
+   vtkLookupTable(const vtkLookupTable&);  // Not implemented.
+   void operator=(const vtkLookupTable&);  // Not implemented.
+@@ -373,6 +377,3 @@ inline unsigned char *vtkLookupTable::WritePointer(const vtkIdType id,
+ }
+ 
+ #endif
+-
+-
+-
diff --git a/debian/patches/97_fix_latex_doxygen.patch b/debian/patches/97_fix_latex_doxygen.patch
index 2767429..9cf5c2b 100644
--- a/debian/patches/97_fix_latex_doxygen.patch
+++ b/debian/patches/97_fix_latex_doxygen.patch
@@ -4,7 +4,7 @@ Last-Update: 2016-02-02
 Forwardedd: no
 --- a/Common/Core/vtkAbstractArray.h
 +++ b/Common/Core/vtkAbstractArray.h
-@@ -384,7 +384,7 @@
+@@ -381,7 +381,7 @@
    // prominence P, we sample N values, with N = f(T; P, U).
    // We want f to be sublinear in T in order to interactively handle large
    // arrays; in practice, we can make f independent of T:
@@ -15,7 +15,7 @@ Forwardedd: no
    // 1 out of every 1000 samples with a confidence of 0.999999 (= 1 - 1e6).
 --- a/Common/Core/vtkMath.h
 +++ b/Common/Core/vtkMath.h
-@@ -661,14 +661,14 @@
+@@ -669,14 +669,14 @@
    // The output is provided by overwriting the input A with a matrix of the same size as
    // A containing all of the information about L and U. If the output matrix is
    // \f$ A* = \left( \begin{array}{cc}
diff --git a/debian/patches/series b/debian/patches/series
index 5d6041f..389a453 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -8,9 +8,9 @@
 80_fix_arm_compilation.patch
 90_gdal-2.0.patch
 95_ffmpeg_2.9.patch
+96_concurrent_vtkLookupTableMapData_fix.patch
 97_fix_latex_doxygen.patch
 100_javac-heap.patch
 101_java_install_path.patch
-102_enable_system_proj4_lib.patch
+#102_enable_system_proj4_lib.patch
 104_fix_gcc_version_6.patch
-105_unforce_embedded_glew.patch
diff --git a/debian/python-vtk6.install b/debian/python-vtk6.install
index b7aae62..1623c46 100644
--- a/debian/python-vtk6.install
+++ b/debian/python-vtk6.install
@@ -1,8 +1,8 @@
 debian/build/bin/pvtk				 usr/bin
 debian/build/bin/pvtkpython	 usr/bin
 debian/build/bin/vtk6python	 usr/bin
-usr/bin/vtkWrapPython-6.3
-usr/bin/vtkWrapPythonInit-6.3
+usr/bin/vtkWrapPython-6.2
+usr/bin/vtkWrapPythonInit-6.2
 usr/lib/*/python2.7/site-packages/vtk usr/lib/python2.7/dist-packages
 usr/lib/*/libvtkRenderingPythonTkWidgets.so usr/lib/python2.7/dist-packages/vtk/
 
diff --git a/debian/rules b/debian/rules
index e968ffb..19c6646 100755
--- a/debian/rules
+++ b/debian/rules
@@ -25,7 +25,7 @@ extra_flags +=  \
 	-DVTK_USE_SYSTEM_HDF5=ON \
         -DHDF5_PREFER_PARALLEL=ON \
 	-DVTK_USE_SYSTEM_JPEG=ON \
-	-DVTK_USE_SYSTEM_LIBPROJ4=ON \
+	-DVTK_USE_SYSTEM_LIBPROJ4=OFF \
 	-DVTK_USE_SYSTEM_LIBXML2=ON \
 	-DVTK_USE_SYSTEM_OGGTHEORA=ON \
 	-DVTK_USE_SYSTEM_PNG=ON \
@@ -74,30 +74,29 @@ override_dh_auto_build:
 	find $(BUILDDIR)/Utilities/Doxygen/doc/html/ -name "*.md5" | xargs rm -f
 
 override_dh_auto_install:
-	pwd
 	dh_auto_install -X.pyc -X.pyo
 	# Modify vtkWrapJava.cmake to properly upload JavaDependencies.cmake.in	from $VTK_DIR
-	perl -pi -e "s|{dir}/JavaDependencies.cmake.in\"|{VTK_DIR}/JavaDependencies.cmake.in\"|" debian/tmp/usr/lib/cmake/vtk-6.3/vtkWrapJava.cmake
+	perl -pi -e "s|{dir}/JavaDependencies.cmake.in\"|{VTK_DIR}/JavaDependencies.cmake.in\"|" debian/tmp/usr/lib/cmake/vtk-6.2/vtkWrapJava.cmake
 	# Correct headers for paraview
 	perl -pi.bak -e "s|cxx|include|g" ThirdParty/netcdf/vtk_netcdfcpp.h
 	mv $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/vtk.jar $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/vtk6.jar
 	mv $(CURDIR)/debian/build/bin/vtkpython $(CURDIR)/debian/build/bin/vtk6python
-	sed -i -e "s/FATAL_ERROR/STATUS/g" $(CURDIR)/debian/tmp/usr/lib/cmake/vtk-6.3/VTKTargets.cmake
+	sed -i -e "s/FATAL_ERROR/STATUS/g" $(CURDIR)/debian/tmp/usr/lib/cmake/vtk-6.2/VTKTargets.cmake
 	chrpath -d $(CURDIR)/debian/build/bin/vtk6python
 	chrpath -d $(CURDIR)/debian/build/bin/pvtk
 	chrpath -d $(CURDIR)/debian/build/bin/pvtkpython
 	mv $(CURDIR)/debian/tmp/usr/bin/vtk $(CURDIR)/debian/tmp/usr/bin/vtk6
 	find $(CURDIR)/debian/tmp/ -name "*.pyc" | xargs rm -f
 	find $(CURDIR)/debian/tmp/ -name "*.pyo" | xargs rm -f
-	sed -i -e "9 a\ append libPath /${DEB_HOST_MULTIARCH}" $(CURDIR)/debian/tmp/usr/lib/tcltk/vtk-6.3/pkgIndex.tcl
+	sed -i -e "9 a\ append libPath /${DEB_HOST_MULTIARCH}" $(CURDIR)/debian/tmp/usr/lib/tcltk/vtk-6.2/pkgIndex.tcl
 
 override_dh_install-arch:
 	dh_install -a
 	find $(CURDIR)/debian/libvtk6-dev/ -name "*Qt*" -exec rm {} \;
-	find $(CURDIR)/debian/libvtk6.3/ -name "*Qt*" -exec rm {} \;
+	find $(CURDIR)/debian/libvtk6.2/ -name "*Qt*" -exec rm {} \;
 	find $(CURDIR)/debian/libvtk6-dev/ -name "libvtkRenderingPythonTkWidgets.so" -exec rm {} \;
 	find $(CURDIR)/debian/libvtk6-dev/usr/include/ -name "Q*" -exec rm {} \;
-	chmod 755 $(CURDIR)/debian/libvtk6-dev/usr/share/vtk-6.3/doxygen/*.pl
+	chmod 755 $(CURDIR)/debian/libvtk6-dev/usr/share/vtk-6.2/doxygen/*.pl
 	rm -rf $(CURDIR)/debian/libvtk6-doc/usr/share/doc/vtk6-doc/html/_formulas.log
 	mkdir -p  $(CURDIR)/debian/python-vtk6/usr/lib/$(DEB_HOST_MULTIARCH)/python2.7/site-packages/ && \
           cd $(CURDIR)/debian/python-vtk6/usr/lib/$(DEB_HOST_MULTIARCH)/python2.7/site-packages/ && \
diff --git a/debian/tcl-vtk6.install b/debian/tcl-vtk6.install
index 0697969..5f84238 100644
--- a/debian/tcl-vtk6.install
+++ b/debian/tcl-vtk6.install
@@ -1,3 +1,3 @@
-usr/bin/vtkWrapTcl-6.3
-usr/bin/vtkWrapTclInit-6.3
+usr/bin/vtkWrapTcl-6.2
+usr/bin/vtkWrapTclInit-6.2
 usr/lib/tcltk
diff --git a/debian/vtk6-doc.docs b/debian/vtk6-doc.docs
index f1ced18..ec7d98d 100644
--- a/debian/vtk6-doc.docs
+++ b/debian/vtk6-doc.docs
@@ -1,2 +1,2 @@
-debian/tmp/usr/share/doc/vtk-6.3/doxygen
+debian/tmp/usr/share/doc/vtk-6.2/doxygen
 debian/build/Utilities/Doxygen/doc/html
diff --git a/debian/vtk6.install b/debian/vtk6.install
index f1918be..906d296 100644
--- a/debian/vtk6.install
+++ b/debian/vtk6.install
@@ -1,6 +1,6 @@
 usr/bin/vtk6
-usr/bin/vtkEncodeString-6.3
-usr/bin/vtkHashSource-6.3
-usr/bin/vtkParseOGLExt-6.3
-usr/bin/vtkWrapHierarchy-6.3
-usr/lib/libvtkWrappingTools-6.3.a
+usr/bin/vtkEncodeString-6.2
+usr/bin/vtkHashSource-6.2
+usr/bin/vtkParseOGLExt-6.2
+usr/bin/vtkWrapHierarchy-6.2
+usr/lib/libvtkWrappingTools-6.2.a
diff --git a/debian/watch b/debian/watch
index f0dd9de..b81b084 100644
--- a/debian/watch
+++ b/debian/watch
@@ -1,3 +1,3 @@
 version=3
-opts=repacksuffix=+dfsg1,uversionmangle=s/(\d)[_\.\-\+]?((RC|rc|pre|dev|beta|alpha|b|a)\d*)$/$1~$2/,dversionmangle=s/\+(debian|dfsg|ds|deb)\d*$// \
+opts=repacksuffix=+dfsg,uversionmangle=s/(\d)[_\.\-\+]?((RC|rc|pre|dev|beta|alpha|b|a)\d*)$/$1~$2/,dversionmangle=s/\+(debian|dfsg|ds|deb)\d*$// \
 https://github.com/Kitware/VTK/tags .*/v?(6\.\d\S*)\.(?:tgz|tbz2|txz|tar\.(?:gz|bz2|xz))

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/vtk6.git



More information about the debian-science-commits mailing list