[vtkusers] inheritance and object factories

Charl P. Botha c.p.botha at its.tudelft.nl
Thu Jul 26 06:19:45 EDT 2001


Dear VTK users,

Usually, when one instantiates a vtkActor (with the New()) method), the
vtkGraphicsFactory is queried and then returns a more applicable actor (e.g.
vtkOpenGLActor or vtkMesaActor).  This usually is very handy.

Hoewever, what should one do if one wants to override one or two methods in
a vtkActor, but still retain this functionality?  I.e. if I derive a new
class from vtkActor and instantiate that, the OpenGL modelview
transformations in vtkOpenGLActor will never be used, as my new child class
only has access to the methods in vtkActor.  Alternatively, I could derive a
new subclass of each of the vtkActor specialisations, but that seems awkward.

What is the recommended action here?

Regards,

-- 
charl p. botha      | computer graphics and cad/cam 
http://cpbotha.net/ | http://www.cg.its.tudelft.nl/




More information about the vtkusers mailing list