File: README.examples

package info (click to toggle)
vtk 5.0.2-4
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 51,080 kB
  • ctags: 67,442
  • sloc: cpp: 522,627; ansic: 221,292; tcl: 43,377; python: 14,072; perl: 3,102; java: 1,436; yacc: 1,033; sh: 469; lex: 248; makefile: 181; asm: 154
file content (65 lines) | stat: -rw-r--r-- 1,816 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
There are examples written in C++, Java, Python and Tcl.

The Java ones won't be of much use to Debian users until
the Debian vtk maintainer understands how to make Java packages.

They live under /usr/share/vtk
The example data is under /usr/share/VTKData
when the vtkdata package is installed.

The Python and Tcl examples have relative paths to
the data. You can either cd to the directory with
the example to run it, or most (all?) examples will
use the VTK_DATA_ROOT environment variable.

export VTK_DATA_ROOT=/usr/share/VTKData

     ***      ***       ***
For example, to compile the Cone4 Cxx example program yourself, try:

g++ -I/usr/include/vtk -o Cone /usr/share/vtk/Tutorial/Step1/Cxx/Cone.cxx /usr/lib/libvtkGraphics.so  /usr/lib/libvtkCommon.so -L /usr/X11R6/lib -lGL -lXt -lX11 /usr/lib/libvtkImaging.so /usr/lib/libvtkRendering.so

And then run it:

./Cone

     ***      ***       ***
CMake: VTK applications often use cmake. For an example try:

 $ mkdir ~/tmp
 $ cd ~/tmp
 $ cmake /usr/share/vtk/Tutorial/Step1/Cxx/
 $ make
 $ ./Cone

     ***      ***       ***
The Python ones are easy, just run (to pick one):

/usr/share/vtk/Tutorial/Step1/Python/Cone.py

VTK is build against python2.3. Try:
 $ python
 Python 2.3+ (#2, Aug 10 2003, 11:33:47) 
 [GCC 3.3.1 (Debian)] on linux2
 Type "help", "copyright", "credits" or "license" for more information.
 >>> import vtk
 >>> 

     ***      ***       ***
The Tcl examples:

vtk /usr/share/vtk/Tutorial/Step1/Tcl/Cone.tcl

VTK_DATA_ROOT=/usr/share/VTKData vtk /usr/share/vtk/IO/Tcl/flamingo.tcl

Some Tcl examples have relative paths built into the scripts, to
run them cd to the example directory first.

cd /usr/share/vtk/Rendering/Tcl
vtk keyBottle.tcl

VTK is built against tcl8.4, and extends it. Try:
 $ tclsh
 % package require vtk
 5.0
 %