[vtkusers] How to use the docs efficiently as a newbie to vtk?

Jérôme jerome.velut at gmail.com
Fri Dec 18 16:55:02 EST 2009


Hi,

My 2 cents:
- VTK is a Visualization Toolkit, and when I was a newbie on VTK, I found it
very easy to *use* as a visualization toolkit. Python or C++, no problem: I
opened, processed and rendered it in a short time. To be honest, I had more
problems to learn about CMake, but because of my computing science skills.

This point brings me to lynx's first sentence, about cell normals. If you
want to visualize it, you went into the smart way: Find in the doc
everything related to Normal, and you got it! After that, a quick look to
the website will teach you about glyph that is able to create vectors
related to your normals, and then you can render your normal field.

However, it seems that you want to do more than that. I mean, you want to
'manipulate' your normals, am I right? In this case, you become a VTK
developer, in the sense that you need to write your own vtkAlgorithm that
will process the data object that has been set as input (SetInput...) and
will produce what you want as output (GetOutput). But for that, you have to
learn about:
- VTK pipelining procedure,
- VTK data structures and process objects
- Reading the doc *and* the sources!

David D. did a lot of adds on the wiki (examples), they are an huge amount
of tutorials, shared codes, presentations that will help you, for sure.
IMHO, VTK is one of the most documented open library that I am using.

Jerome

2009/12/18 David Doria <daviddoria+vtk at gmail.com<daviddoria%2Bvtk at gmail.com>
>

> On Fri, Dec 18, 2009 at 2:22 PM,  <lynx.abraxas at freenet.de> wrote:
> > Hello vtk programmers!
> >
> >
> > I  just  tried to figure out how I could have managed to get normals of a
> mesh
> > without any examples. Since then I feel very lost...
> > Concider one is a newbie to vtk and somehow one got  an  instance  of  a
>  mesh
> > (vtkPolyData).
> > Now I want to get a list of all the cell normals so I'd do as follows:
> >
> > - Search in the class index (
> http://www.vtk.org/doc/nightly/html/classes.html)
> > for anything containing normal; I'd find vtkPolyDataNormals
> > - There I get to know it does what I need (if I select correct switches)
> > - I've learned that the result is in .GetOutput() which isn't mentioned
>  there
> > so I look in the superclass (vtkPolyDataAlgorithm)
> > -  In  vtkPolyDataAlgorithm  I  find  GetOutput()  which  yiels an
> instance of
> > vtkPolyData
> >
> > --There I have the first disappointment: The output is not the normals...
> >
> > - So I go to vtkPolyData: There I  don't  find  anything  having  to  do
>  with
> > normals so I go to the super class again (vtkPointSet)...
> > - In vtkPointSet nothing so up to vtkDataSet
> > - In vtkDataSet I find GetCellData()
> >
> > --It  needs  some  abstract thinking to see that its result leads closer
> to my
> > normals...
> >
> > - Having some vtkCellData I go on to vtkCellData Class Reference
> > - Nothing about normals there so I go up to vtkDataSetAttributes
> > - Finally I find GetNormals(); it returns vtkDataArray
> >
> > --Now I wonder: What is vtkDataArray???
> >
> > - I go vtkDataArray Class Reference: Seems to hold any kind of data
> array...
> >
> > --How then do I know what data type is in the array that GetNormals()
> returns?
> > Is  it  char, int, float, double...? In the exampe
> vtkFloatArray::SafeDownCast
> > is used. Why not vtkDoubleArray::SafeDownCast? How would I know it's not
>  some
> > integer?  (I  know  for normals that wouldn't make much sense but else
> where I
> > might not be able to exclude this so easily)
> >
> >
> > Well, now, after showing my way through the labyrinth, my big question:
> > Is this the way You all go if You can't find an example for Your problem?
> > Can all this  be done much easier?
> > Since I know a bit of blenders API I  must  say  there  the  way  through
>  the
> > labyrinth is much more straight forward.
> >
> > Just  getting  to  my  own  simple  vtk-program  by plugging parts of
> examples
> > together makes me feel very clumsy and lost. How to improve in this?
> >
> >
> > Thaks for any help and advice on this.
> > Lynx
>
> Lynx,
>
> On such a big system like this it is very tough. Hence my big push for
> lots of examples! When you become VERY dedicated to VTK it gets a bit
> easier, but the learning curve, as you've seen,  is pretty steep. I've
> tried to bring it to everyone's attention that it is likely that a
> LARGE majority of users do not want to put in this much effort, they
> just want to use an occasional tool or two from the toolkit (if anyone
> has any actual statistics or something, please correct me, but from my
> small sample of experience it is what I'd wager). This is where the
> examples are most helpful.
>
> The "List of all members" link on each class page has been a big help
> for me. I used to go up the hierarchy one class at a time as you
> mentioned, but this link shows you all of the possible functions that
> can be called on a class. Even with that, it's still hard to sort
> through the data types, etc. I'd say the best thing to do is help with
> the examples and documentation so that we can alleviate this issue for
> the next generation of VTKers. As you do this, you'll get the hang of
> it :)
>
> David D.
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20091218/829eb7a7/attachment.htm>


More information about the vtkusers mailing list