Performance problem when picking very large polydatas with vtkVisibleCellSelector
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
I'm drawing a polydata that contains about 1 million of triangles. I want to select some triangles, I use vtkVisibleCellSelector. Actually VTK works as follow :
First rendering : Compiling the display list for each actors. (for 1M triangles it takes about 8-10 seconds in my computer). Call the display lists (it takes under 1 second). Time to render : about 10 seconds.
Second rendering : Call the display lists (it takes under 1 second). Time to render : under 1 second.
etc.
Picking : Rendering the actors modifying the coloring to make pick color. It takes 0 seconds if the rectangle selection is very little and maximum about 2 seconds if the rectangle contains the entire object.
Rendering after a picking : It recompiles the display lists because the polydatas have been changed when picking.
So in the point of view of the user when he makes a rubberband selection (even if the selection is very little) it tooks : 0-2 seconds to pick + 7 seconds to recompile the display list + 1 second to render so it takes more than 8 seconds to make a picking !
I made a patch that disable the recompilation of the display lists after a picking so instead of taking 8 seconds it takes only 2 seconds for a little selection and 4-5 seconds for a big selection.
So more the scene drawing is complex more the picking take times. With my fix, the time is in function of the size of the selection and is more than two times faster than the actual picking of VTK. And for a point picking (like selection one cell), this patch permits to vtkVisibleCellSelector to be more efficient than vtkCellPicker ! On 1M triangle a cell picking using vtkVisibleCellSelector take about 1-2 seconds and a vtkCellPicker take about 3 seconds on my computer.