[vtkusers] SetLayerNumber of vtkActor2D
Karthik Krishnan
karthik.krishnan at kitware.com
Thu Feb 4 03:59:03 EST 2010
Yes ideally, you should use the vtkRenderer API. Its more general,
allows 3D props to be overlayed on top as well.
However adding way too many renderers (>> 2) on a single render window
is going to add of overhead, make picking harder etc.
One may also add all the actor2D's into an actor2Dcollection and add
the whole collection to your renderer. The actor2Dcollection
internally sorts the actor2D's by layer number to ensure that they are
rendered in the right order.
On Thu, Feb 4, 2010 at 2:39 AM, <dave.demarle at kitware.com> wrote:
> 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 ---
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
More information about the vtkusers
mailing list