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