[vtkusers] C++ exemples !

Kevin Wright krw at viz-solutions.com
Tue Dec 17 12:46:47 EST 2002


> > Look, VTK works with 4 different languages.  Its not right to expect
> > them to give examples with each and every language in the book.  Think
> > of the poor trees.  If you really want C++ examples look at the
> > source, there are a few.  If these aren't enough translate them from
> > Tcl and mail them to the vtk list.
>
>Exactly!  Tcl/Tk is trivially easy to learn compared to C++, and
>if you already know C++ it will take you under an hour to learn
>most of what you need to know to translate Tcl to C++.

Its not even really a question of learning Tcl.  Sebastien, if you
look at the start of the User's Guide (pg 38 in my version),
there's a small section on converting between the syntax of the
different languages.  Its really quite straight forward.
For example:

[anActor GetProperty] SetColor $red $green $blue

in Tcl, converts to

anActor->GetProperty()->SetColor(red,green,blue);

in C++

You won't be able to blindly type an example from the book into your
C++ compiler, but with even a basic understanding of the VTK
pipeline, converting it to C++ should be a trivial exercise.

If you want an actual example or two, as Prahbu mentioned,
there are some to be downloaded (and probably on the disk that
came with your book?)

Kevin.




More information about the vtkusers mailing list