[vtkusers] Python vtk extend mapper

David Gobbi david.gobbi at gmail.com
Mon Jul 21 15:05:42 EDT 2014


Hi Nil,

Overriding virtual C++ methods in Python doesn't work.
See the "Subclassing a VTK class" section of the following:

http://vtk.org/gitweb?p=VTK.git;a=blob;f=Wrapping/Python/README_WRAP.txt

Extending filters, mappers, and sources via python requires
the use of special "programmable" base classes like the
vtkProgrammableSource and vtkProgrammableFilter.  There
is no "vtkProgrammableMapper" base class, however.

 - David



On Mon, Jul 21, 2014 at 12:37 PM, Nil Goyette <nil.goyette at imeka.ca> wrote:

>  Hi all, Is it possible to extend a mapper in Python VTK? I did a simple
> test, extending vtkPolyDataMapper, overriding RenderPiece with a "1/0"
> statement and a call to the real RenderPiece, and replacing in my code the
> real mapper with this fake mapper. It did nothing. It still draws what it
> was drawing before my test without failing. I did the same in a C++ project
> and it's working perfectly. I also tested extending
> vtkOpenGLPolyDataMapper, just in case. Still nothing.
>
> So, is there any restrictions to overriding vtk classes in Python VTK?
> Thanks for your time.
>
> --
>    [image: 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/20140721/ee32f324/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/20140721/ee32f324/attachment.png>


More information about the vtkusers mailing list