[vtk-developers] Status of AddActor(), AddActor2D(), AddVolume() vs AddViewProp()

Sean McBride sean at rogue-research.com
Wed Aug 28 16:59:01 EDT 2013


On Wed, 28 Aug 2013 16:37:05 -0400, Bill Lorensen said:

>I think AddActor(), AddActor2D(), and AddVolume() are more descriptive than
>AddViewProp even though they are just wrappers.

Be that as it may, I think it's pretty weird for someone starting with VTK 6.

Class hierarchy reminder:

vtkObject -> vtkProp -> vtkProp3D -> vtkActor
vtkObject -> vtkProp -> vtkProp3D -> vtkVolume
vtkObject -> vtkProp -> vtkActor2D

The newer AddViewProp() takes a vtkProp*, which makes sense, as it works with all 3 types.

The older methods AddActor(), AddActor2D(), and AddVolume() strangely all also take a vtkProp*, that's pretty weird given their name.  ex: you'd think AddVolume() would take a vtkVolume*, no?  Why should it accept any vtkProp subclass?

It's also weird that AddActor() and AddVolume() come from vtkRenderer, while AddActor2D() comes from the superclass vtkViewPort.

How to explain all this to someone new to VTK 6?

It seems like cruft to me.  IMNSHO, using only AddViewProp() seems preferable, which is why I'd like to do the cleanup and eventually wrap the old three in VTK_LEGACY.

Cheers,

-- 
____________________________________________________________
Sean McBride, B. Eng                 sean at rogue-research.com
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montréal, Québec, Canada





More information about the vtk-developers mailing list