[vtkusers] How to get a certain actor and render

David Doria daviddoria at gmail.com
Wed Nov 3 08:04:42 EDT 2010


On Wed, Nov 3, 2010 at 3:36 AM, Rockydut <Rockydut at gmail.com> wrote:

>
> Assume there are many renders in the m_pRenderWindow (which is a type of
> vtkWin32OpenGLRenderWindow). And the order of these renders is uncertainty.
> For example, we name these renders render1, render2, render3......, the
> order in pRenderWindow  maybe render2, render1, render3, also maybe
> render1,
> render3, render2...
> So, How can I get a certain render. I know there is a method named
> GetFirstRender and GetNextRenderWindow in vtkRenderWindowCollection,
> However, I'm not sure which render getting from GetNextRenderWindow is what
> I want.
> The same for the vtkActor. I can travel all the actor from
> vtkActorCollection::GetNextActor. However, I'm not sure which actor is what
> I want.
>

You should (must) know the address of the renderer you are looking for. When
you are going through the list with GetNextActor (which returns an address),
you can simply compare it to the address you are looking for:

if(renderer->GetNextActor() == queryActor)

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20101103/76bd280d/attachment.htm>


More information about the vtkusers mailing list