QuantLib/VtkIntegration

This is the page for discussion of research integrating QuantLib with Vtk

VTK First Example
The VTK source code comes with a multitude of examples, including a tutorial in the scripting language of your choice (currently supported are Tcl, Python and Java). They are located in the Examples directory that can be downloaded with the source code distribution.

Assuming you are interested in something a little bit more elaborate, you can download here a very simple example that uses Tkinter to produce the viewer shown below:

Below is the entire source code used to produce this output. In my opinion, the main contribution of the script in terms of learning to use VTK is the organization of the code and the integration with Tkinter (which can take a little while to figure out). Other than that, it is quite easy to see that the actual VTK code is very thin. You can test the code yourself by using the input surface provided here.

Building VTK with Python support
When downloading the Windows binaries for VTK, for example, the only scripting language that is automatically supported is Tcl (the same happens under MacOS, to the best of my knowledge). To enable Python support, you have to enable the appropriate settings when building VTK with cmake. Namely, you have to enable VTK_WRAP_PYTHON. This also means you will have to build shared libraries, but the cmake process will kindly guide you through it.

Once built, you can learn more on how to actually use VTK through Python reading the VTK/Wrapping/Python/README.txt.