Converting Figures to Examples¶
There is an ongoing effort to convert the examples in the VTK Book into VTKExamples.
- Follow the procedure ForDevelopers to contribute examples.
- Download a copy of the VTK Book.
- Look at the VTKBookFigures page and look for examples that have not been converted. These examples will not have a link to source code.
- Go to your VTK source checkout. Run the script getDeletedFile.sh, found in
src/Adminfolder, with the name of the source file (e.g. walkCow.tcl) in the figure example to be converted. This script will create a source file in the current directory and also report the URL for the original repo location of the example.
- Pick a source directory to contain the new example. Look at the Chapter heading in the book to guide where to put the new example.
- Convert the source tcl code or old C++ code to C++ code that will compile and run with the current VTK API. Follow the guidelines for coding C++ examples.
- If the figure example name is short, e.g. bluntStr we suggest giving it a more descriptive name e.g. BluntStreamlines. Notice the first letter is uppercase.
- Edit the VTKBookFigures page as follows:
- In the first column of the table, add a link from the Figure to the source code.
- In the second column of the table, add the VTK classes that are illustrated by the example.
- In the third column, cut and paste the caption from the VTK Book.
- If there is a source file mentioned in the caption, make link to the original code URL printed by the getDeletedFile.sh script.