VisIt VTK Modifications OLD

VisIt's VTK Build

The VisIt team maintains its own version of VTK - a derivative of VTK 5.0.0

This was done to:

  • Allow us to quickly incorporate critical bug fixes
  • Allow us to exclude components not used by VisIt
  • Shield us from disruptive API changes

The current VTK tarball is vtk-5.0.0.c.tar.gz

We maintain this vtk version in the VisIt repo @ third_party/vtk/

This directory contains the following subdirectories:

Directory Purpose
scripts/ Holds helper script for creating a vtk source tarball.
src/ Holds the current (analogous to our "trunk") version of vtk.
tags/ Tags for important versions of the source tree (the original vtk-5.0.0 and the vtk-5.0.0c release)
tarballs/ Holds the source tarballs for tag versions. (Note: these are merely here for convenience)

Previously changes to the original vtk source were stored in the src/vtk directory. Also many of these changes remove linking rules for Linux, these should not be necessary and we hope to resolve these issues as part of the CMake port of VisIt's build system.

Detailed Changes

VTK/CMakeLists.txt

  • Added ability to disable some Visual Studio Warnings
 # Disable deprecation warnings for standard C and STL functions in VS2005
 # and later
 IF(CMAKE_COMPILER_2005)
   ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
   ADD_DEFINITIONS(-D_SCL_SECURE_NO_DEPRECATE)
 ENDIF(CMAKE_COMPILER_2005) 
  • Commented out the Exodus Build Step
 *** 817,829 ****
   #-----------------------------------------------------------------------------
   # Dispatch the build into the proper subdirectories.
 
 ! # VisIt doesn't need to build vtk's Exodus reader
 ! #SET(VTK_HAS_EXODUS)
 ! #IF("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" GREATER 1.8)
 ! #  SET(VTK_HAS_EXODUS 1)
 ! #ELSE("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" GREATER 1.8)
 ! #  MESSAGE(STATUS "CMake older than 2.0 detected. NetCDF will be disabled")
 ! #ENDIF("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" GREATER 1.8)
 
   # Utility libraries and executables.
   SUBDIRS(Wrapping Utilities)
 --- 817,829 ----
   #-----------------------------------------------------------------------------
   # Dispatch the build into the proper subdirectories.
 
 ! 
 ! SET(VTK_HAS_EXODUS)
 ! IF("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" GREATER 1.8)
 !   SET(VTK_HAS_EXODUS 1)
 ! ELSE("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" GREATER 1.8)
 !   MESSAGE(STATUS "CMake older than 2.0 detected. NetCDF will be disabled")
 ! ENDIF("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" GREATER 1.8)
 
   # Utility libraries and executables.
   SUBDIRS(Wrapping Utilities)
 ***************
  • Removed build of vtkWidgets Library
 ***************
 *** 196,202 ****
     SET(VTK_KITS ${VTK_KITS} RENDERING)
     SET(VTK_KITS ${VTK_KITS} VOLUMERENDERING)
     SET(VTK_KITS ${VTK_KITS} HYBRID)
 !   #SET(VTK_KITS ${VTK_KITS} WIDGETS) # VisIt doesn't use the Widgets ToolKit
   ENDIF(VTK_USE_RENDERING)
   IF(VTK_USE_PARALLEL)
     SET(VTK_KITS ${VTK_KITS} PARALLEL)
 --- 196,202 ----
     SET(VTK_KITS ${VTK_KITS} RENDERING)
     SET(VTK_KITS ${VTK_KITS} VOLUMERENDERING)
     SET(VTK_KITS ${VTK_KITS} HYBRID)
 !   SET(VTK_KITS ${VTK_KITS} WIDGETS)
   ENDIF(VTK_USE_RENDERING)
   IF(VTK_USE_PARALLEL)
     SET(VTK_KITS ${VTK_KITS} PARALLEL)
 ***************
 *** 841,847 ****
     SUBDIRS(Rendering)
     SUBDIRS(VolumeRendering)
     SUBDIRS(Hybrid)
 !   #SUBDIRS(Widgets) # VisIt doesn't use the Widgets ToolKit
   ENDIF(VTK_USE_RENDERING)
   IF(VTK_USE_PARALLEL)
     SUBDIRS(Parallel)
 --- 841,847 ----
     SUBDIRS(Rendering)
     SUBDIRS(VolumeRendering)
     SUBDIRS(Hybrid)
 !   SUBDIRS(Widgets)
   ENDIF(VTK_USE_RENDERING)
   IF(VTK_USE_PARALLEL)
     SUBDIRS(Parallel)
 ***************
 *** 872,878 ****
       SUBDIRS(Rendering/Testing)
       SUBDIRS(VolumeRendering/Testing)
       SUBDIRS(Hybrid/Testing)
 !     #SUBDIRS(Widgets/Testing) # VisIt doesn't use the Widgets ToolKit
     ENDIF(VTK_USE_RENDERING)
     IF(VTK_USE_PARALLEL)
       SUBDIRS(Parallel/Testing)
 --- 872,878 ----
       SUBDIRS(Rendering/Testing)
       SUBDIRS(VolumeRendering/Testing)
       SUBDIRS(Hybrid/Testing)
 !     SUBDIRS(Widgets/Testing)
     ENDIF(VTK_USE_RENDERING)
     IF(VTK_USE_PARALLEL)
       SUBDIRS(Parallel/Testing)
 ***************
 *** 1352,1358 ****
       INSTALL_FILES(${VTK_INSTALL_INCLUDE_DIR} .h vtkRenderingInstantiator)
       INSTALL_FILES(${VTK_INSTALL_INCLUDE_DIR} .h vtkVolumeRenderingInstantiator)
       INSTALL_FILES(${VTK_INSTALL_INCLUDE_DIR} .h vtkHybridInstantiator)
 +     # VisIt doesn't use the Widgets ToolKit
 !     #INSTALL_FILES(${VTK_INSTALL_INCLUDE_DIR} .h vtkWidgetsInstantiator) 
     ENDIF(VTK_USE_RENDERING)
     IF(VTK_USE_PARALLEL)
       INSTALL_FILES(${VTK_INSTALL_INCLUDE_DIR} .h vtkParallelInstantiator)
 --- 1352,1358 ----
       INSTALL_FILES(${VTK_INSTALL_INCLUDE_DIR} .h vtkRenderingInstantiator)
       INSTALL_FILES(${VTK_INSTALL_INCLUDE_DIR} .h vtkVolumeRenderingInstantiator)
       INSTALL_FILES(${VTK_INSTALL_INCLUDE_DIR} .h vtkHybridInstantiator)
 !   INSTALL_FILES(${VTK_INSTALL_INCLUDE_DIR} .h vtkWidgetsInstantiator)
     ENDIF(VTK_USE_RENDERING)
     IF(VTK_USE_PARALLEL)
       INSTALL_FILES(${VTK_INSTALL_INCLUDE_DIR} .h vtkParallelInstantiator)
 ***************

VTK/vtkMarcos.cmake

  • Only call the linker on Windows and OSX

VTK/CMake/

VTK/CMake/KitCommonBlock.cmake

  • Only call linker on Windows or OSX
  ***************
  *** 22,28 ****
                    "${Kit_TCL_EXTRA_CMDS}")
      ADD_LIBRARY(vtk${KIT}TCL ${KitTCL_SRCS} ${Kit_TCL_EXTRA_SRCS})
      SET(KIT_LIBRARY_TARGETS ${KIT_LIBRARY_TARGETS} vtk${KIT}TCL)
  !   TARGET_LINK_LIBRARIES (vtk${KIT}TCL vtk${KIT} ${KIT_TCL_LIBS})
      IF(NOT VTK_INSTALL_NO_LIBRARIES)
        INSTALL_TARGETS(${VTK_INSTALL_LIB_DIR} vtk${KIT}TCL)
      ENDIF(NOT VTK_INSTALL_NO_LIBRARIES)
  --- 22,30 ----
                    "${Kit_TCL_EXTRA_CMDS}")
      ADD_LIBRARY(vtk${KIT}TCL ${KitTCL_SRCS} ${Kit_TCL_EXTRA_SRCS})
      SET(KIT_LIBRARY_TARGETS ${KIT_LIBRARY_TARGETS} vtk${KIT}TCL)
  !   IF(APPLE OR WIN32)
  !     TARGET_LINK_LIBRARIES (vtk${KIT}TCL vtk${KIT} ${KIT_TCL_LIBS})
  !   ENDIF(APPLE OR WIN32)
      IF(NOT VTK_INSTALL_NO_LIBRARIES)
        INSTALL_TARGETS(${VTK_INSTALL_LIB_DIR} vtk${KIT}TCL)
      ENDIF(NOT VTK_INSTALL_NO_LIBRARIES)
  ***************
  *** 42,48 ****
      # can link to this but it is not directly loaded dynamically as a
      # module.
      ADD_LIBRARY(vtk${KIT}PythonD ${KitPython_SRCS} ${Kit_PYTHON_EXTRA_SRCS})
  !   TARGET_LINK_LIBRARIES(vtk${KIT}PythonD vtk${KIT} ${KIT_PYTHON_LIBS})
      IF(NOT VTK_INSTALL_NO_LIBRARIES)
        INSTALL_TARGETS(${VTK_INSTALL_LIB_DIR} vtk${KIT}PythonD)
      ENDIF(NOT VTK_INSTALL_NO_LIBRARIES)
  --- 44,52 ----
      # can link to this but it is not directly loaded dynamically as a
      # module.
      ADD_LIBRARY(vtk${KIT}PythonD ${KitPython_SRCS} ${Kit_PYTHON_EXTRA_SRCS})
  !   IF(APPLE OR WIN32)
  !     TARGET_LINK_LIBRARIES(vtk${KIT}PythonD vtk${KIT} ${KIT_PYTHON_LIBS})
  !   ENDIF(APPLE OR WIN32)
      IF(NOT VTK_INSTALL_NO_LIBRARIES)
        INSTALL_TARGETS(${VTK_INSTALL_LIB_DIR} vtk${KIT}PythonD)
      ENDIF(NOT VTK_INSTALL_NO_LIBRARIES)
  ***************
  *** 68,74 ****
      # Create a python module that can be loaded dynamically.  It links to
      # the shared library containing the wrappers for this kit.
      ADD_LIBRARY(vtk${KIT}Python MODULE vtk${KIT}PythonInit.cxx)
  !   TARGET_LINK_LIBRARIES(vtk${KIT}Python vtk${KIT}PythonD)
    ENDIF (VTK_WRAP_PYTHON)
    # if we are wrapping into Java then add the library and extra
  --- 72,80 ----
      # Create a python module that can be loaded dynamically.  It links to
      # the shared library containing the wrappers for this kit.
      ADD_LIBRARY(vtk${KIT}Python MODULE vtk${KIT}PythonInit.cxx)
  !   IF(APPLE OR WIN32)
  !     TARGET_LINK_LIBRARIES(vtk${KIT}Python vtk${KIT}PythonD)
  !   ENDIF(APPLE OR WIN32)
    ENDIF (VTK_WRAP_PYTHON)
    # if we are wrapping into Java then add the library and extra
  ***************
  *** 78,84 ****
      VTK_WRAP_JAVA3(vtk${KIT}Java KitJava_SRCS "${Kit_SRCS}")
      ADD_LIBRARY(vtk${KIT}Java SHARED ${KitJava_SRCS} ${Kit_JAVA_EXTRA_SRCS})
      SET(KIT_LIBRARY_TARGETS ${KIT_LIBRARY_TARGETS} vtk${KIT}Java)
  !   TARGET_LINK_LIBRARIES(vtk${KIT}Java vtk${KIT} ${KIT_JAVA_LIBS})
      IF(NOT VTK_INSTALL_NO_LIBRARIES)
        INSTALL_TARGETS(${VTK_INSTALL_LIB_DIR} vtk${KIT}Java)
      ENDIF(NOT VTK_INSTALL_NO_LIBRARIES)
  --- 84,92 ----
      VTK_WRAP_JAVA3(vtk${KIT}Java KitJava_SRCS "${Kit_SRCS}")
      ADD_LIBRARY(vtk${KIT}Java SHARED ${KitJava_SRCS} ${Kit_JAVA_EXTRA_SRCS})
      SET(KIT_LIBRARY_TARGETS ${KIT_LIBRARY_TARGETS} vtk${KIT}Java)
  !   IF(APPLE OR WIN32)
  !     TARGET_LINK_LIBRARIES(vtk${KIT}Java vtk${KIT} ${KIT_JAVA_LIBS})
  !   ENDIF(APPLE OR WIN32)
      IF(NOT VTK_INSTALL_NO_LIBRARIES)
        INSTALL_TARGETS(${VTK_INSTALL_LIB_DIR} vtk${KIT}Java)
      ENDIF(NOT VTK_INSTALL_NO_LIBRARIES)
  ***************
  *** 87,93 ****
      ENDIF(KIT_JAVA_DEPS)
    ENDIF (VTK_WRAP_JAVA)
  ! TARGET_LINK_LIBRARIES(vtk${KIT} ${KIT_LIBS})
    IF(NOT VTK_INSTALL_NO_LIBRARIES)
      INSTALL_TARGETS(${VTK_INSTALL_LIB_DIR} vtk${KIT})
  --- 95,103 ----
      ENDIF(KIT_JAVA_DEPS)
    ENDIF (VTK_WRAP_JAVA)
  ! IF(APPLE OR WIN32)
  !   TARGET_LINK_LIBRARIES(vtk${KIT} ${KIT_LIBS})
  ! ENDIF(APPLE OR WIN32)
    IF(NOT VTK_INSTALL_NO_LIBRARIES)
      INSTALL_TARGETS(${VTK_INSTALL_LIB_DIR} vtk${KIT})


VTK/Filtering/

VTK/Filtering/vtkWedge.cxx
  • Fixed EvaluatePosition Portion of VTK Bug #3225
VTK/Filtering/vtkInformation.cxx
  • Added init of values array
 vtkInformationInternals()
   {
     this->ComputeHashKey(33);
     this->Keys = new vtkInformationKey* [this->TableSize];
     this->Values = new vtkObjectBase* [this->TableSize];
     int i;
     for (i = 0; i < this->TableSize; ++i)
       {
       this->Keys[i] = 0;
       this->Values[i] = 0;
       }
   }
 
 vtkInformationInternals(int size)
   {
     assert(size < 65000 && "information cannot grow to more than 65000 entries");
     this->ComputeHashKey(size);
     this->Keys = new vtkInformationKey* [this->TableSize];
     this->Values = new vtkObjectBase* [this->TableSize];
     int i;
     for (i = 0; i < this->TableSize; ++i)
       {
       this->Keys[i] = 0;
       this->Values[i] = 0;
       }
   }


VTK/Hybrid/CMakeLists.txt

  • Skip building several filters that VisIt does not use:
 # The following filters are not being built since VisIt doesn't use them.
 #
 # vtk3DSImporter.cxx
 # vtkArcPlotter.cxx
 # vtkAnnotatedCubeActor.cxx
 # vtkAxesActor.cxx
 # vtkCaptionActor2D.cxx
 # vtkCornerAnnotation.cxx
 # vtkCubeAxesActor2D.cxx
 # vtkEarthSource.cxx
 # vtkFacetReader.cxx
 # vtkGreedyTerrainDecimation.cxx
 # vtkGridTransform.cxx
 # vtkImageToPolyDataFilter.cxx
 # vtkImplicitModeller.cxx
 # vtkIterativeClosestPointTransform.cxx
 # vtkLandmarkTransform.cxx
 # vtkLegendBoxActor.cxx
 # vtkPCAAnalysisFilter.cxx
 # vtkPolyDataToImageStencil.cxx
 # vtkProcrustesAlignmentFilter.cxx
 # vtkProjectedTerrainPath.cxx
 # vtkRIBExporter.cxx
 # vtkRIBLight.cxx
 # vtkRIBProperty.cxx
 # vtkRenderLargeImage.cxx
 # vtkThinPlateSplineTransform.cxx
 # vtkTransformToGrid.cxx
 # vtkVRMLImporter.cxx
 # vtkVideoSource.cxx
 # vtkWeightedTransformFilter.cxx
 # vtkXYPlotActor.cxx

VTK/Rendering/

VTK/Rendering/CMakeLists.txt

  • Logic correcting includes for glXGetProcAddressARB
  • Changed to mangled mesa logic to only compile vtkXMesaRenderWindow.cxx if we are using X
  • Change lib linking command to include conditional for Windows & Apple for vtkRenderingPythonTkWidgets

From:

  TARGET_LINK_LIBRARIES (vtkRenderingPythonTkWidgets
                         vtk${KIT}
                         ${VTK_TK_LIBRARIES})

To:

  IF(APPLE OR WIN32)
     YARGET_LINK_LIBRARIES (vtkRenderingPythonTkWidgets
                            vtk${KIT}
                            ${VTK_TK_LIBRARIES})
  ENDIF(APPLE OR WIN32)
  • Change lib linking command to include conditional for Windows & Apple for the Rendering Kit

From:

  IF(VTK_USE_X)
    TARGET_LINK_LIBRARIES(vtk${KIT} -lXt ${X11_LIBRARIES})

To:

  IF(VTK_USE_X)
    IF(APPLE OR WIN32)
      TARGET_LINK_LIBRARIES(vtk${KIT} -lXt ${X11_LIBRARIES})
    ENDIF(APPLE OR WIN32)
  ENDIF(VTK_USE_X)

VTK/Rendering/vtkCamera.cxx

  • Changes to reset corner case views to the previous value, instead of a minimum or default value.

VTK/Rendering/vtkFreeTypeUtilities.cxx

  • Add support for horizontal and vertical font orientations.

VTK/Rendering/vtkGraphicsFactory.cxx

  • Only include the XMesa Render Window if we are using X
  ***************
  *** 68,75 ****
  --- 68,77 ----
    #include "vtkMesaPolyDataMapper.h"
    #include "vtkMesaRenderer.h"
    #include "vtkMesaTexture.h"
  + #if defined (VTK_USE_X)
    #include "vtkXMesaRenderWindow.h"
    #endif
  + #endif

VTK/Rendering/vtkImagining.cxx

  • Add ability to use mesa mappers if mangled mesa is used.
  ***************
  *** 166,179 ****
  --- 166,197 ----
        {
        if(strcmp(vtkclassname, "vtkTextMapper") == 0)
          {
  + #if defined(VTK_USE_MANGLED_MESA)
  +       if ( vtkImagingFactory::UseMesaClasses )
  +         {
  +         return vtkMesaFreeTypeTextMapper::New();
  +         }
  + #endif
          return vtkOpenGLFreeTypeTextMapper::New();
          }
        if(strcmp(vtkclassname, "vtkImageMapper") == 0)
          {
  + #if defined(VTK_USE_MANGLED_MESA)
  +       if ( vtkImagingFactory::UseMesaClasses )
  +         {
  +         return vtkMesaImageMapper::New();
  +         }
  + #endif
          return vtkOpenGLImageMapper::New();
          }
        if(strcmp(vtkclassname, "vtkPolyDataMapper2D") == 0)
          {
  + #if defined(VTK_USE_MANGLED_MESA)
  +       if ( vtkImagingFactory::UseMesaClasses )
  +         {
  +         return vtkMesaPolyDataMapper2D::New();
  +         }
  + #endif
          return vtkOpenGLPolyDataMapper2D::New();
          }
        }

VTK/Rendering/vtkMesaRenderWindow.cxx

  • Include vtkMesaRenderWindow.h instead of vtkXMesaRenderWindow.h

VTK/Rendering/vtkOpenGLFreeTypeTextMapper.cxx

  • Add support for horizontal and vertical font orientations.


VTK/Utilities

OutputWindowProcess

VTK/Utilities/OutputWindowProcess/CMakeLists.txt

  • Only call linker on Windows or OSX (although this is a windows only program?)
  ***************
  *** 32,38 ****
      ADD_EXECUTABLE(vtkWin32OutputWindowProcess WIN32 vtkWin32OutputWindowProcess.c)
      GET_TARGET_PROPERTY(VTK_OWP_EXE vtkWin32OutputWindowProcess LOCATION)
      IF(NOT BORLAND)
  !     TARGET_LINK_LIBRARIES(vtkWin32OutputWindowProcess gdi32)
      ENDIF(NOT BORLAND)
      ADD_EXECUTABLE(vtkEncodeExecutable vtkEncodeExecutable.c)
  --- 32,40 ----
      ADD_EXECUTABLE(vtkWin32OutputWindowProcess WIN32 vtkWin32OutputWindowProcess.c)
      GET_TARGET_PROPERTY(VTK_OWP_EXE vtkWin32OutputWindowProcess LOCATION)
      IF(NOT BORLAND)
  !     IF(APPLE OR WIN32)
  !       TARGET_LINK_LIBRARIES(vtkWin32OutputWindowProcess gdi32)
  !     ENDIF(APPLE OR WIN32)
      ENDIF(NOT BORLAND)


FTGL Library

These files are in VisIt's source tree at src/vtk/ftgl, inconsistent with the original VTK source layout (Utilities/ftgl)

VTK/Utilities/ftgl/CMakeLists.txt

  • Add special case for Mangled Mesa on Windows
  IF(WIN32)
    IF (FTGL_SUPPORT_MANGLE_MESA)
      SET (VTKFTGL_LIBS "${VTKFTGL_LIBS};${MANGLED_MESA_LIBRARY}")
    ENDIF (FTGL_SUPPORT_MANGLE_MESA)
  ENDIF(WIN32)
  • Change lib linking command to include conditional for Windows & Apple

From:

  TARGET_LINK_LIBRARIES(vtkftgl ${VTKFTGL_LIBS})

To:

  IF(APPLE OR WIN32)
    TARGET_LINK_LIBRARIES(vtkftgl ${VTKFTGL_LIBS})
  ENDIF(APPLE OR WIN32)

The following source files were modified to add horizontal and vertical glyph support:

  • VTK/Utilities/ftgl/src/FTGlyph.h
  • VTK/Utilities/ftgl/src/FTGlyphContainer.{h,cpp}
  • VTK/Utilities/ftgl/src/FTPixmapGlyph.{h,cpp}
  • VTK/Utilities/ftgl/src/FTBitmapGlyph.{h,cpp}
  • VTK/Utilities/ftgl/src/FTFont.{h,cpp}

kwsys Library

VTK/Utilities/kwsys/CMakeLists.txt

  • Only call linker on Windows or OSX
  *** 591,604 ****
          testCommandLineArguments
          )
        ADD_EXECUTABLE(${test} ${test}.cxx)
  !     TARGET_LINK_LIBRARIES(${test} ${KWSYS_NAMESPACE})
      ENDFOREACH(test)
      # C tests
      FOREACH(test
          testProcess
          )
        ADD_EXECUTABLE(${test} ${test}.c)
  !     TARGET_LINK_LIBRARIES(${test} ${KWSYS_NAMESPACE}_c)
      ENDFOREACH(test)
      SET(EXEC_DIR "${CMAKE_CURRENT_BINARY_DIR}")
  --- 591,608 ----
          testCommandLineArguments
          )
        ADD_EXECUTABLE(${test} ${test}.cxx)
  !     IF(APPLE OR WIN32)
  !       TARGET_LINK_LIBRARIES(${test} ${KWSYS_NAMESPACE})
  !     ENDIF(APPLE OR WIN32)
      ENDFOREACH(test)
      # C tests
      FOREACH(test
          testProcess
          )
        ADD_EXECUTABLE(${test} ${test}.c)
  !     IF(APPLE OR WIN32)
  !       TARGET_LINK_LIBRARIES(${test} ${KWSYS_NAMESPACE}_c)
  !     ENDIF(APPLE OR WIN32)
      ENDFOREACH(test)

vtkexodus2 Library

VTK/Utilities/vtkexodus2/CMakeLists.txt

  • Only call linker on Windows or OSX
  ***************
  *** 49,55 ****
    ADD_LIBRARY(vtkexoIIc ${cbind_SRCS})
  ! TARGET_LINK_LIBRARIES(vtkexoIIc vtkNetCDF)
    # Apply user-defined properties to the library target.
    IF(VTK_LIBRARY_PROPERTIES)
  --- 49,57 ----
    ADD_LIBRARY(vtkexoIIc ${cbind_SRCS})
  ! IF(APPLE OR WIN32)
  !   TARGET_LINK_LIBRARIES(vtkexoIIc vtkNetCDF)
  ! ENDIF(APPLE OR WIN32)
    # Apply user-defined properties to the library target.
    IF(VTK_LIBRARY_PROPERTIES)


PNG Library

These files are in VisIt's source tree at src/vtk/png, inconsistent with the original VTK source layout (Utilities/vtkpng)

VTK/Utilities/vtkpng/CMakeLists.txt

  • Change lib linking command to include conditional for Windows & Apple

From:

TARGET_LINK_LIBRARIES(vtkpng ${VTK_ZLIB_LIBRARIES})

To:

IF(APPLE OR WIN32)
  TARGET_LINK_LIBRARIES(vtkpng ${VTK_ZLIB_LIBRARIES})
ENDIF(APPLE OR WIN32)

TIFF Library

These files are in VisIt's source tree at src/vtk/tiff, inconsistent with the original VTK source layout (Utilities/vtktiff)

VTK/Utilities/vtktiff/CMakeLists.txt

  • Change lib linking command to include conditional for Windows & Apple

From:

TARGET_LINK_LIBRARIES( vtktiff ${VTK_ZLIB_LIBRARIES} ${VTK_JPEG_LIBRARIES} )

To:

IF(APPLE OR WIN32)
  TARGET_LINK_LIBRARIES( vtktiff ${VTK_ZLIB_LIBRARIES} ${VTK_JPEG_LIBRARIES} )
ENDIF(APPLE OR WIN32)

Redundant Files

These files exist in VisIt's src/vtk directory, but have have not changed from their original versions:

  • VTK/Common/CMakeLists.txt
  • VTK/Common/vtkSystemIncludes.h
  • VTK/Filtering/CMakeLists.txt
  • VTK/Graphics/CMakeLists.txt
  • VTK/Imaging/CMakeLists.txt
  • VTK/IO/CMakeLists.txt
  • VTK/Rendering/vtkCamera.h
  • VTK/Rendering/vtkTextProperty.h
  • VTK/Rendering/vtkTextProperty.cxx
  • VTK/CMake/vtkTestExplicitInstantiation.cmake

Changes Required to build the VTK Python Wrappers

VTK/Wrapping/Python/CMakeLists.txt

  • Remove the build of the vtkpython executable b/c it will not link correctly
  • Remove all references to the Widgets Toolkit
 ***************
 *** 67,73 ****
       SET(KITS ${KITS} Parallel)
     ENDIF(VTK_USE_PARALLEL)
     IF (VTK_USE_RENDERING)
 !     #SET(KITS ${KITS} Widgets) # Remove Widgets ToolKit
       SET(KITS ${KITS} Hybrid)
       SET(KITS ${KITS} VolumeRendering)
       SET(KITS ${KITS} Rendering)
 --- 67,73 ----
       SET(KITS ${KITS} Parallel)
     ENDIF(VTK_USE_PARALLEL)
     IF (VTK_USE_RENDERING)
 !     SET(KITS ${KITS} Widgets)
       SET(KITS ${KITS} Hybrid)
       SET(KITS ${KITS} VolumeRendering)
       SET(KITS ${KITS} Rendering)
 ***************
 *** 83,95 ****
     TARGET_LINK_LIBRARIES(vtkpython vtkRendering)
     TARGET_LINK_LIBRARIES(vtkpython vtkVolumeRendering)
     TARGET_LINK_LIBRARIES(vtkpython vtkHybrid)
 !   #TARGET_LINK_LIBRARIES(vtkpython vtkWidgets) # Remove Widgets ToolKit
     SET (vtkpython_pyc_depends
         ${vtkpython_pyc_depends}
         vtkRenderingPython
         vtkVolumeRenderingPython
         vtkHybridPython
 !       #vtkWidgetsPython # Remove Widgets ToolKit
         )
   ENDIF (VTK_USE_RENDERING)
   
 --- 83,95 ----
     TARGET_LINK_LIBRARIES(vtkpython vtkRendering)
     TARGET_LINK_LIBRARIES(vtkpython vtkVolumeRendering)
     TARGET_LINK_LIBRARIES(vtkpython vtkHybrid)
 !   TARGET_LINK_LIBRARIES(vtkpython vtkWidgets)
     SET (vtkpython_pyc_depends
         ${vtkpython_pyc_depends}
         vtkRenderingPython
         vtkVolumeRenderingPython
         vtkHybridPython
 !       vtkWidgetsPython
         )
   ENDIF (VTK_USE_RENDERING)
 
 ***************
 *** 135,141 ****
       IF (VTK_USE_RENDERING)
         TARGET_LINK_LIBRARIES(pvtkpython vtkVolumeRendering)
         TARGET_LINK_LIBRARIES(pvtkpython vtkHybrid)
 !       #TARGET_LINK_LIBRARIES(pvtkpython vtkWidgets) # Remove Widgets ToolKit
       ENDIF (VTK_USE_RENDERING)
       IF(NOT VTK_INSTALL_NO_RUNTIME)
         INSTALL_TARGETS(${VTK_INSTALL_BIN_DIR} pvtkpython)
 --- 135,141 ----
       IF (VTK_USE_RENDERING)
         TARGET_LINK_LIBRARIES(pvtkpython vtkVolumeRendering)
         TARGET_LINK_LIBRARIES(pvtkpython vtkHybrid)
 !       TARGET_LINK_LIBRARIES(pvtkpython vtkWidgets)
       ENDIF (VTK_USE_RENDERING)
       IF(NOT VTK_INSTALL_NO_RUNTIME)
         INSTALL_TARGETS(${VTK_INSTALL_BIN_DIR} pvtkpython)
 ***************
 *** 185,191 ****
       vtk/rendering
       vtk/required
       vtk/volumerendering
 !     #vtk/widgets # Remove Widgets ToolKit from Python Wrappers
       )
 --- 185,191 ----
       vtk/rendering
       vtk/required
       vtk/volumerendering
 !     vtk/widgets
       )

VTK/Wrapping/Python/setup.py.in

  • Make sure the setup script will not install the wrappers for the Widgets Toolkit
 *** 46,54 ****
   # Construct the list of kit names to be installed.
   vtk_kit_names = ['Common', 'Filtering', 'IO', 'Graphics',
                    'GenericFiltering', 'Imaging']
 - # Removed "Widgets"
   if vtk_use_rendering:
 !     vtk_kit_names.extend(['Rendering', 'VolumeRendering', 'Hybrid'])
   if vtk_use_parallel:
       vtk_kit_names.extend(['Parallel'])
 
 --- 46,53 ----
   # Construct the list of kit names to be installed.
   vtk_kit_names = ['Common', 'Filtering', 'IO', 'Graphics',
                    'GenericFiltering', 'Imaging']
   if vtk_use_rendering:
 !     vtk_kit_names.extend(['Rendering', 'VolumeRendering', 'Hybrid', 'Widgets'])
   if vtk_use_parallel:
       vtk_kit_names.extend(['Parallel'])

VTK/Common/vtkPythonUtil.cxx

  • With python2.5 PyTypeObject->tp_doc must be used as a const char *
 *** 768,774 ****
       }
     if (strcmp(name, "__doc__") == 0)
       {
 !     char *doc = t->tp_doc;
       if (doc != NULL)
         {
         return PyString_FromString(doc);
 --- 768,774 ----
       }
     if (strcmp(name, "__doc__") == 0)
       {
 !     const char *doc = t->tp_doc;
       if (doc != NULL)
         {
         return PyString_FromString(doc);

Note: Because we have special linking rules that exclude linking between the vtk libraries when they are built, we have to make sure to explicitly link to the VTK Python Libraries in VisIt:

  • -lvtkCommonPython
  • -lvtkCommonPythonD
  • -lvtkFilteringPython
  • -lvtkFilteringPythonD
  • -lvtkGraphicsPython
  • -lvtkGraphicsPythonD
  • -lvtkHybridPython
  • -lvtkHybridPythonD
  • -lvtkIOPython
  • -lvtkIOPythonD
  • -lvtkImagingPython
  • -lvtkImagingPythonD
  • -lvtkRenderingPython
  • -lvtkRenderingPythonD