[vtkusers] PolyDataMapper Painter

Nil Goyette nil.goyette at imeka.ca
Fri Aug 15 16:14:36 EDT 2014


Hi all,

I'm working with brain fibers (lines in a vtkPolyData) and I need to 
filter some fibers as fast as I can. Creating a new vtkPolyData or any 
trick like that is out of the question; I tested and it's too slow. I 
concluded that creating any kind of of data will always be too slow.

I successfully modified the vtkPolyDataMapper to draw only a specified 
set of cells. It's working perfectly, in real-time. I tried to do the 
same with the 2D views (I'm working in MITK, but the vtkPolyDataMapper 
is the important part here) and I discovered something dark and complex: 
the painter. I read some articles [1, 2] to understand it what's going 
on. I think I get it, but I still have a question for you.

I want to create my own vtkLinesPainter (mostly to add a 
std::set<vtkIdType>* and rewrite vtkDrawPrimsMacro). This is easy 
enough, but how do I plug this class with the rest of the Painter 
architecture? Who will tell vtk to use my class instead of the standard one?

Moreover, is there a reason why the 3D mapper is defined in the "normal" 
mapper files (vtkPolyDataMapper and vtkOpenGLPolyDataMapper) and the 2D 
mapper use a Painter concept? For example, vtkDrawPrimsMacro is in the 
Mapper and in the Painter. Is it a WIP?

Thanks for your help. Have a nice day.

[1] http://www.paraview.org/ParaView/index.php/VTK_Painters
[2] http://www.vtk.org/Wiki/VTK/Painters

-- 
Logo Imeka <http://imeka.ca/> 	Nil Goyette, M.Sc.
www.imeka.ca <http://imeka.ca/>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20140815/8ba0e985/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Imeka.png
Type: image/png
Size: 6630 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20140815/8ba0e985/attachment.png>


More information about the vtkusers mailing list