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.
This README is written for VTK version 4.2 and greater. For more information, additional resources, and the FAQ see the web page at http://www.vtk.org
Copyright (c) 1993-2003 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.
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 http://www.kitware.com/products/vtktextbook.html The VTK User's Guide (VTK 4.2 Edition) Kitware, Inc., ISBN 1-930934-08-4 http://www.kitware.com/products/vtkguide.htmlOn-line Doxygen man pages are also available at http://www.vtk.org/doc/nightly/html/
The following instructions only apply to UNIX systems. First we will give you the quick and dirty way to build VTK. Begin by telling Cmake what C and C++ compilers you will be using. This can avoid many build problems. On most systems you can pass this information to CMake in the following way:
env CXX=/your/C++/compiler CC=/your/c/compiler cmakeotherwise you must set the CXX and CC environment variables and then run ccmake (or cmake -i).
If you will be using C++ as your development language (no Tcl/Tk, Python or Java support):
1) untar the src files 2) untar the data files 3) cd VTK 4) cmake -i (run cmake in wizard mode, where you have to answer questions about the build) or 4) ccmake (run the terminal based interface to cmake where you interactively change build options) 5) if necessary change build options 6) makeNote that this will create the binaries (i.e., object code, libraries, and executables) in the same directory as the source code. You can also build VTK out of source in a separate directory (this is particularly convenient when building VTK on multiple architectures). Instead of running CMake from the VTK directory, create a new directory with enough disk space (not in the VTK tree) such as vtk-solaris. cd into this directory and then run CMake similar to the following example:
ls /home/joe_user vtk vtk-solaris vtk-sgi cd vtk-solaris ccmake /home/joe_user/VTK or cmake -i /home/joe_user/VTKThis will create makefiles in the vtk-solaris directory. Then you can run make in vtk-solaris to compile VTK. Repeate this process for each architecture you wish to build.
If you want to build the Tcl-based VTK interpreter then you will need to have Tcl and Tk (8.2 or newer). Look to http://www.scriptics.com for information about getting Tcl and Tk. To turn on Tcl wrapping, set VTK_WRAP_TCL to ON during the configuration process (as a post-build step, you might want to check the Wrapping/Tcl/README file). You will then have to set the values for Tcl/Tk include directories and libraries.
If you want to use VTK from Python you will need to have Python installed. To turn on Python wrapping, set VTK_WRAP_PYTHON to ON during the configuration process and then set the values for the Python related directories and libraries. If you want to use Tkinter with VTK-Python then you should also turn on Tcl wrapping by setting VTK_WRAP_TCL to ON. Make sure that the Tcl/Tk libraries that you set correspond to the same version used by Tkinter. Note that the VTK-Python modules are not installed by default via 'make install'. The Wrapping/Python/README.txt file documents the installation procedure and the VTK-Python modules.
The build process for Cygwin is almost exactly the same as the UNIX build process (see previous section)
If you will be using C++ as your development language (no Tcl/Tk, Python or Java support):
1) untar the src files 2) untar the data files 3) cd VTK 4) cmake -i (run cmake in wizard mode, where you have to answer questions about the build) or 4) ccmake (run the terminal based interface to cmake where you interactively change build options) 5) if necessary change build options 6) makeFor Tcl/Tk support, you have to install the cygwin sources for Tcl/Tk, then set the following options:
TK_INCLUDE_PATH /usr/src/tcltk-20001125-1/tk/generic/ TK_INTERNAL_PATH /usr/src/tcltk-20001125-1/tk/win/ TK_XLIB_PATH /usr/src/tcltk-20001125-1/tk/xlib
The PC build process uses the CMake GUI CMakeSetup. Then you use the compiler make utility to compile as follows.
1) Install the VTK 4.2 distribution by unzipping into the appropriate directory. 2) Execute CMakeSetup. This will pop-up a little GUI that allows you to tailor the build. It then starts building .dsw and .dsp files for Microsoft, or makefiles for Borland. You'll have to tell CMakeSetup where you've placed your VTK source code, and where to build the object code and dll's (we'll call it "vtkbin"). 3) When CMakeSetup completes, start up msdev and load VTK.dsw. Select ALL_BUILD project, and build it.We recommend a 300MByte minimum swap size or you'll have trouble during the link phase.
1) Download the data at ftp://public.kitware.com/pub/vtk/VTKData.tgz 2) Checkout the data from CVS using the folling commands: cvs -d :pserver:anonymous@public.kitware.com:/vtk/cvsroot login (respond with password vtk) cvs -d :pserver:anonymous@public.kitware.com:/vtk/cvsroot checkout VTKData
vtk mace.tclNote 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.
If you have enabled Python Wrapping you should read the instructions located in the Wrapping/Python/README.txt file.
1) Create a new directory called VTK/Local. 2) Create a file called LocalUserOptions.cmake in VTK/. In that file, add the command "SUBDIRS(Local)". This will add the Local directory to the build. 3) Create the .cxx and .h file for the new class in VTK/Local. Make sure that you use VTK conventions to insure that the wrapping occurs correctly. Complex code may break the wrapper parser; use //BTX and //ETX around the code to fix this. 4) Create a CMakeLists.txt in VTK/Local. You can model it after a CMakeList.txt file found in another directory (like VTK/IO/CMakeLists.txt). 5) Rerun ccmake (Unix) or CMakeSetup.exe (Windows). 6) Then make/gmake (Unix) or msdev (Windows).
Commercial support contracts are available from Kitware at http://www.kitware.com/products/vtksupport.html.
Kitware also provides consulting services. Read more at http://www.kitware.com/products/consult.html.
Training is also available from Kitware. See http://www.kitware.com/products/vtktrain.html.