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. <br>
<br>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.<br>
<br>So, am I missing something in attempting to use SetLayerNumber? Is there a better or preferred way of setting "depth" for vtkActor2Ds?<br><br clear="all"><br>-- <br>Regards,<br>Murali Dhanakoti<br>