[vtkusers] Isolines : retrieve geometry after filtering
Kent Eschenberg
eschenbe at psc.edu
Mon Nov 26 10:56:23 EST 2007
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