[vtkusers] how to override my own mapper

Marcus D. Hanwell marcus.hanwell at kitware.com
Mon Sep 29 19:58:45 EDT 2014


On Mon, Sep 29, 2014 at 5:10 PM, Ahmet Doğan <isimtic at gmail.com> wrote:
> I have written my own mapper it compiles but it cant override it is almost
> same with polydatamapper how can I override with vtkopenglpolydatamapper(in
> opengl2)?
>
The simplest way is to simply create a new instance of your mapper, i.e.

vtkNew<vtkMyOpenGL2PolyDataMapper> mapper;

You can than set this as the mapper on your actor without worrying
about the object factory mechanism. Otherwise you must remove the
override for the VTK supplied mapper, and set your own. I don't know
of a good example right now, but I will try and add something to the
wiki that shows how to do this when I get a chance (or if you figure
it out, please add an example).

Marcus


More information about the vtkusers mailing list