[vtkusers] actorCollection=vtkRenderer->GetActors() not returning vtkImageActors?

Mark Gooding mark.gooding at gmail.com
Thu Aug 31 09:57:03 EDT 2006


Hi all,

I'm trying to remove all the actors from a scene, so I'm using

vtkRenderer->GetActors()

to return and actor collection. I step through this doing

vtkRenderer->RemoveActor(actorCollection->GetLastActor());

This removes all vtkActors that I added to the scene, but not the
vtkImageActors. Is there a way that I can remove all vtkImageActors
too? I can remove the image actors if I use a direct pointer to each
one, i.e.

vtkRenderer->RemoveActor(pointertoactor1)

but I would like to be able just to cycle through whatever is left and
remove it without eplicitly naming it. Any suggestions?

Interestingly the GetVisibleActorCount() returns the total number of
actors regardless of type. Seems slightly inconsisted that GetActors()
only returns one type.

Cheers,

Mark



More information about the vtkusers mailing list