Skip to content

fix bugs&typo in VTK Example folder

Haocheng LIU requested to merge haocheng.liu/vtk:fixVTKExampleBugs into master

Hi, Currently I'm learning VTK via Example folder, and with the help of awesome Kitware colleagues around, i fixed some bugs and typos in the Example folder. ( Please correct me if I'm wrong.)

The reason why many examples fail is because VTK does not know which rendering core it should use. In VTK 6.X we can simply hack it by replace all find_package(....) in CMakeLists.txt with find_package(VTK REQUIRED), but with VTK 7.X, we need to replace the whole find_package paragraph with:

find_package(VTK REQUIRED COMPONENTS vtkCommonCore) 
find_package(VTK COMPONENTS 
   <needed packages name>
   vtkRendering${VTK_RENDERING_BACKEND})

The first find_package make sure that CMake know where to search for VTK packages, and the second find_package find the proper stuffs.

Typo in comment:

  • Examples/GUI/Python/CustomInteraction.py
  • Examples/Tutorial/Step1/Cxx/cone.cxx

Fixed examples:

  • Annotation
  • DataManipulation
  • ImageProcessing
  • Infovis
  • MOdelling
  • Multiblock
  • Rendering
  • Tutorial
  • VisualizationAlgorithms
  • VolumeRendering
  • Widgets

Malfunctional example:

  • Statistics example: SetInput is no longer a member function of class vtkDescriptiveStatistics, so maybe the example need to be rewritten.

Thanks!

Merge request reports