[vtkusers] SetLayerNumber of vtkActor2D

Murali Dhanakoti murali.dhanakoti at gmail.com
Wed Feb 3 23:10:10 EST 2010


I have a bunch of overlapping vtkActor2Ds and I'm trying to control which
actor gets rendered on top, and which goes below. I tried using
SetLayerNumber function of vtkActor2D to assign layer numbers assuming that
the numbers I set here would determine the order in which the actors are
drawn. The problem is SetLayerNumber function doesn't seem to have any
effect on the rendering order. The actors are always rendered in the order
they were added to the renderer with the latest actors getting rendered on
top of those that were added earlier.

I looked at vtkActor2D's source, and found that the member variable
LayerNumber is used very sparsely, not in any place that would suggest that
it is used to perform some type of ordering. Only other place where an
actor2d's layer numbers are used is in vtkActor2DCollection's AddItem and
Sort functions. But, these functions are not used by vtkRenderer or by its
parent vtkViewport. vtkViewport does contain a vtkActor2DCollection member,
but it is not used when you call its AddActor2D function.

So, am I missing something in attempting to use SetLayerNumber? Is there a
better or preferred way of setting "depth" for vtkActor2Ds?


-- 
Regards,
Murali Dhanakoti
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100203/250ca62c/attachment.htm>


More information about the vtkusers mailing list