[vtkusers] vtk actor inheritance

Simon DROUIN sdrouin at bic.mni.mcgill.ca
Wed May 5 09:55:57 EDT 2004


Wiebke Timm wrote:

> Hm, I use vtk with qt and tried to derive a factory like it's 
> described  in the book. But my actors aren't shown either. I'm not 
> sure if I have  to derive from vtkActor or vtkOpenGLActor either...

One thing is for sure, you have to derive from vtkOpenGLActor or 
vtkMesaActor, otherwise you will need to reimplement all the rendering 
methods and maybe some others. And if you want something generic, you 
will probably need to derive one class from vtkOpenGLActor, another one 
from vtkMesaActor and use a factory to instanciate the one that 
corresponds to your rendering system.

One way I see to make it easier in vtk to derive from actor classes is 
to make vtkActor a wrapper for another class that really does the job 
(say vtkActorInternal ). vtkActorInternal would have 2 child classes 
vtkOpenGLActorInternal and vtkMesaActorInternal. That way it would be 
pretty easy to derive from vtkActor.

For now, you can probably achieve the same result if you derive from 
vtkAssembly and put your actor inside the vtkAssembly?

-s




More information about the vtkusers mailing list