Below is a step-by-step example of how to compile and run a VTK application at Tansaction Lab
1. Some important paths:
Vtk2.0 is installed at :
f : \vtk20
VC++ 4.0 is at:
f : \MSDEV
2. Visual C++ 4.0 can be run from the menu:
Start->Utils ->programming->Visual C++ 4.0
If there is no Utils menu , you can run : F:\MSDEV\BIN\MSDEV (use
explore)
3. After entering your account, you can copy the following example source code into your account:
f: \vtk20\vtk\graphics\examplesCxx\VisQuad.cxx
4. Run Visual
C++ 4.0 . Open your source file :
H:/cse564/cse564_*/VisQuad.cxx
from the "file " menu. The under "Build " menu , select
"build VisQuad.exe ". In
the following pop up window press "Yes " ( It will create workspace
for your project ).
5. Set path for include file and library:
Under " tools " , select "options ", select "Directories"
.
Under the "show directories for :" select "include files ".
Then add
f:\MSDEV\INCLUDE
f:\vtk20\common
f:\vtk20\graphics
Under the "show directories for :" select "library files ". Then add :
f:\MSDEV\LIB
6. Go to "Build " , select "Setting ". then select "link" tab. In the "Object/Library modules " catagory add:
vtkdll.lib
7 . Go to "Build ",
select "Build VisQuad.exe "
This time everything should be OK
8. Go to "Build", select "Execute cone3.exe "
Some contouring surface of quadric function should appear in your screen.
9. Check out the interactive commands : left mouse button to rotate, "w" to wireframe, "e" to quit the program
Now try to answer following questiones :
Define the user function in a way that the
quadric parameters and the isovalue can be changed into this function.
In
this function define a menu (using printf)
that enables commands to be entered by the user (using scanf). The
commands should allow changing all the 10
quadric coefficients , the number of isosurface and the isovalues.
They
should also show the old value
before changing.
Special attention should be taken to pass the
parameters to the user function. By convention the only parameter
allowed is a ``void'' pointer. A convenient
way to solve this problem is grouping all needed pointers and data into
a
``struct'' and pass a pointer to this structure.
The dataset is at : f: \VolVis\VolVis.2.1\data\SLC\tran\neghip.slc
The dataset can be loaded into VTK pipeline by VtkSLCReader.
Compile and run
your code. You should get something like Plate 15 of the Textbook
(P.277)
You should submit a source code and
an exexutable file for every part :
part 1 : VisQuad.cxx VisQuad.exe
Answer.txt ( for two questiones )
part 2 : UserMethod.cxx UserMethod.exe
part 3 : Contour.cxx Contour.exe
http://bulky.aecom.yu.edu/vtk/atoz.html
The home page of VTK is at :