[vtkusers] Real-time polydata filtering

Nil Goyette nil.goyette at imeka.ca
Wed Aug 29 10:33:16 EDT 2018


Hi all,

We decided to port our old vtk application to vtk8 and I have some 
questions concerning the jump to OpenGL2+. We load a streamlines file 
(tck/trk/fib/vtk), which is simply a list of lines in 3D [1], to view it 
with an image, compute some stats on it, etc. We also need to filter the 
polydata when the user moves a box over it. Only the line passing in the 
box should be drawn. [2]

I already have a working version without modifying any vtk file, but 
it's slow.
- I keep the raw unmodified polydata somewhere because all filtering 
should start from the original version
- I create a new polydata that will be used for drawing. I use the raw 
point and a new vtkCellArray for lines that I want to draw.
- Each time the user moves the box, I create a new vtkCellArray, fill it 
with the right cells and call SetLines().

This is quite slow even with only 4000 lines and I'm not sure why. Is 
the mapper sending all the points data again even if I only modified the 
lines data? Can this method ever be fast? If you have other ideas that 
require a modification to the mapper, it's not a problem, I can do it, I 
just don't know where to start because I don't know much about OpenGL.

Nil Goyette

[1] https://i.imgur.com/krzBvJV.png<https://i.imgur.com/krzBvJV.png>
[2] I already asked this question 3 months ago but I didn't get any 
answer. For more information 
http://vtk.1045678.n5.nabble.com/Filtered-polydata-td5747327.html

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://public.kitware.com/pipermail/vtkusers/attachments/20180829/5a77216d/attachment.html>


More information about the vtkusers mailing list