[vtkusers] Should I use one actor per renderer/renderwindow or can they share the same actor?

Bryn Lloyd lloyd at itis.ethz.ch
Wed Nov 2 05:09:35 EDT 2011


As mentioned it seems to work for simple actor/polydata mapper combinations.
But if this is not tested I will design my application differently, to use
individual mappers/actors for each window.

Thanks all for the replies!




> -----Original Message-----
> From: vtkusers-bounces at vtk.org [mailto:vtkusers-bounces at vtk.org] On
> Behalf Of David Gobbi
> Sent: Tuesday, November 01, 2011 6:30 PM
> To: Sebastien Jourdain
> Cc: vtk
> Subject: Re: [vtkusers] Should I use one actor per
> renderer/renderwindow or can they share the same actor?
> 
> Hi Sebastien,
> 
> Karthik has already given a couple valid reasons, e.g. timestamp
> checks between the renderer and the mapper, and resources that a
> mapper or property might tie to a particular OpenGL context.  There is
> a third reason I can give, and that is that there aren't regression
> tests (that I'm aware of, anyway) that verify that it works for the
> dozens of different mapper classes in VTK.  And anything that ain't
> tested might as well be broken.  A basic vtkActor/vtkPolyDataMapper
> with no texture and no shaders is the only prop that I would trust to
> add to more than one renderer.
> 
>  - David
> 
> 
> On Tue, Nov 1, 2011 at 10:52 AM, Sebastien Jourdain
> <sebastien.jourdain at kitware.com> wrote:
> > Humm,
> >
> > in fact, you can have many actors for a single mapper and there is no
> > reason why you can't put the same actor to several renderers.
> > I've done it many time without any issue. Although I was not using
> LODActors...
> >
> > Seb
> >
> > On Tue, Nov 1, 2011 at 12:15 PM, Karthik Krishnan
> > <karthik.krishnan at kitware.com> wrote:
> >> No you can't shallow copy.. each actor would need its own mapper.
> Mappers
> >> can certainly not be shared. I don't think you can share the
> vtkProperty's
> >> either, if you are using Shaders since will then consume graphic
> resources.
> >>
> >>
> >> On Tue, Nov 1, 2011 at 9:26 PM, Bryn Lloyd <lloyd at itis.ethz.ch>
> wrote:
> >>>
> >>> Hi again,
> >>>
> >>>
> >>>
> >>> Actually, could I copy an actor using ShallowCopy in order to
> create
> >>> separate actors for each renderer?
> >>>
> >>>
> >>>
> >>> Else, how can I transfer (or even synchronize) the actor parameters
> in a
> >>> simple but complete way? I am thinking of general vtkProp(s), not
> just
> >>> vtkActor.
> >>>
> >>>
> >>>
> >>> Thanks for any advice.
> >>>
> >>>
> >>>
> >>> --
> >>>
> >>> Bryn
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>> From: Karthik Krishnan [mailto:karthik.krishnan at kitware.com]
> >>> Sent: Tuesday, November 01, 2011 3:58 PM
> >>> To: Bryn Lloyd
> >>> Cc: vtk
> >>> Subject: Re: [vtkusers] Should I use one actor per
> renderer/renderwindow
> >>> or can they share the same actor?
> >>>
> >>>
> >>>
> >>> Even if it did work, it'd be quite fragile. I can imagine timestamp
> checks
> >>> going wrong (these are used in the mapper to rebuild the geometric
> >>> primitives etc).
> >>>
> >>>
> >>>
> >>> I can see LODActors getting messed up, when computing last render
> time
> >>> from a renderer, not realizing that its not the same renderer they
> rendered
> >>> on previously.
> >>>
> >>>
> >>>
> >>> Its best to create an actor per render window.
> >>>
> >>>
> >>>
> >>> --
> >>>
> >>> karthik
> >>>
> >>> On Tue, Nov 1, 2011 at 4:24 PM, Bryn Lloyd <lloyd at itis.ethz.ch>
> wrote:
> >>>
> >>> Hi
> >>>
> >>>
> >>>
> >>> I am working on an application with multiple render windows.
> >>>
> >>>
> >>>
> >>> Is it SAFE to use the same actor for each renderer/window, or
> should I
> >>> create an actor per renderer?
> >>>
> >>>
> >>>
> >>> BTW. Currently it is OK if I have the same parameters (color,
> visibility,
> >>> etc) in each renderer.
> >>>
> >>> Thanks for any suggestions
> >>>
> >>>
> >>>
> >>> Bryn
> >>>
> >>>
> >>>
> >>> _______________________________________________
> >>> 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
> >>>
> >>>
> >>
> >> _______________________________________________
> >> 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
> >>
> >>
> > _______________________________________________
> > 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
> >
> _______________________________________________
> 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