[vtkusers] SetLayerNumber of vtkActor2D

dave.demarle at kitware.com dave.demarle at kitware.com
Thu Feb 4 02:39:11 EST 2010


I think you are looking for vtkRenderer's layer number. Put each actor in its own renderer, and use the renderers' stacking order in the same way that you are now trying to use the actors'.

-----Original Message-----

From:  Murali Dhanakoti <murali.dhanakoti at gmail.com>
Subj:  [vtkusers] SetLayerNumber of vtkActor2D
Date:  Wed Feb 3, 2010 11:10 pm
Size:  1K
To:  vtkusers at vtk.org

I have a bunch of overlapping vtkActor2Ds and Im 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 doesnt 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 vtkActor2Ds 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 actor2ds layer numbers are used is in vtkActor2DCollections 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
   --- message truncated ---




More information about the vtkusers mailing list