[vtkusers] Removing al actors from a Renderer (I get multiple XYPlots in one renderer)

Nico Vermaas vermaas at astron.nl
Fri Apr 4 01:57:55 EST 2003


Hi,

I want to draw and update an XYPlotActor, but when I draw a new one (by
addingAddActor2D(xyplot)) then the old one just also stays in there. So
I need to delete the old one first. 

I tried this... and I do get the right count that increases every time
I add an actor. But the Removing part  does not work.

vtkActorCollection *actors = vtkActorCollection::New();
int NumberOfActors = renderer->VisibleActorCount();

actors=this->renderer->GetActors();
for (int i=0; i<NumberOfActors; i++) {
   this->renderer->RemoveActor(actors->GetNextActor());
}

actors->Delete();


Q: How do I delete all actors from a renderer?

Nico




More information about the vtkusers mailing list