[vtkusers] Isolines : retrieve geometry after filtering

Pascal Guehl pascal.guehl at c-s.fr
Mon Nov 26 12:11:49 EST 2007


OK, sorry I thought I could ask this question in this usergroup...
I know VTK, I know the type of output and the methods I can apply on it. 
I've looked to the code of vtkStripper who can help me to do my stuff, 
but I just would like to know if there is already a filter which did 
this kind of thing...

Maybe, I haven't explain my real problem :

I have a 2D mesh on which I want to generate 5 or 10 isolines. Then, I 
have to display a label on each generated isoline (a label is just a 
billboard with a text : the scalar value of the isoline). The labels 
have to be at the "middle" of the isolines. But as I don't use the VTK 
graphics pipeline, but my own 3D engine, I need to retrieve the geometry 
of each generated isoline and compute the 3D position of the labels.

OK, so I return to the VTK code of vtkStripper...

Pascal


Kent Eschenberg a écrit :
> Hi Pascal,
>
> Your question is the sort you should be able to look up in the 
> documentation. Its a very reasonable question, and the sort that comes 
> up a lot, but its not appropriate to ask this group when you could 
> find the answer yourself.
>
> However, if you are a very new user, you might know where to start. 
> Here are a few pointers.
>
> First, you have to get the documentation. If you compile VTK from 
> source you can generate it automatically and store it locally. Or you 
> can go to public.ketware.com/VTK and go to the manual for your version 
> of VTK. In either case go to "Alphabetical List" so see all the VTK 
> classes.
>
> Second, start at the end of you pipeline. Look at the last class used 
> (I'll call it "filter"). Look it up in the manual and find its 
> "GetOutput" method. That will return a pointer to the VTK class 
> holding the results. Add a line to the end of your program that looks 
> something like
>
>    results = filter->GetOutput();
>
> where "results" is a pointer to the class your filter produces.
>
> From here on you need to dig into the manual for the class of "results".
>
> For contours, "results" will point to an instance of vtkPolyData which 
> has many methods to get information such as the number of lines. You 
> will need to loop over these, gather the information you want, and go 
> from there.
>
> Kent
> Pittsburgh Supercomputing Center
>
> Pascal Guehl wrote:
>> Hello,
>>
>> I don't use the VTK graphics pipeline to draw primitives, it's only 
>> for filtering data. After a vtkContourFilter, how can I retrieve each 
>> "complete" isoline geometry, not just segments ?
>> For instance, with one isovalue generated, I would like to have only 
>> one "poly line" for the isoline, but the result is a set of segments...
>> Is there a mean in VTK to retrieve those geometries ?
>>
>> Pascal
>
>




More information about the vtkusers mailing list