[vtkusers] How to use the docs efficiently as a newbie to vtk?
lynx.abraxas at freenet.de
lynx.abraxas at freenet.de
Fri Dec 18 14:22:23 EST 2009
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
More information about the vtkusers
mailing list