[vtkusers] Removing Actors
Amy Squillacote
ahs at cfdrc.com
Mon May 5 10:54:49 EDT 2008
Please keep the discussion on the vtkusers list rather than emailing me
directly. That way other people can contribute to the conversation, and
the discussion is archived.
By "re-rendering", I mean calling Render() on your vtkRenderWindow. (I'm
guessing that VTK3 in the code segment you sent is a vtkRenderWindow.)
- Amy
Renato Cesar Pompeu wrote:
> Do you mean VTK3->GetRenderer() ?
>
> I've tried:
>
> ...
> if (tbnCubo->Down) {
> VTK3->GetRenderer()->AddActor(cubo1);
> }
> else {
> VTK3->GetRenderer()->RemoveActor(cubo1);
> VTK3->GetRenderer()->RemoveViewProp(cubo1);
> VTK3->GetRenderer()->Clear();
> VTK3->GetRenderer();
> }
>
> cubo->Delete();
> cuboMapper->Delete();
> cubo1->Delete();
> VTK3->Invalidate();
>
>
> but the actor doesn't disappear from the scene when the button is up.
> If I put :
>
> VTK3->GetRenderer()->RemoveAllViewProps();
>
> then all the actors disappear from the scene.
>
>
>
> > Date: Mon, 5 May 2008 09:33:33 -0500
> > From: ahs at cfdrc.com
> > To: w_e_b_m_a_s_t_e_r_6_9 at hotmail.com
> > CC: rcpompeu at hotmail.com; vtkusers at public.kitware.com
> > Subject: Re: [vtkusers] Removing Actors
> >
> > Did you try re-rendering after you removed the actor?
> > - Amy
> >
> > Cameron Burnett wrote:
> > > Is the program actually entering the 'else' section?? Maybe
> > > tbnIniciar->Down is always true? If you're not sure then throw in a
> > > print statement to see if anything prints in that section.
> > >
> > > The RemoveActor function is the correct one to use. I am using
> that in
> > > the program that I'm working on at the moment.
> > >
> > > If that is not the problem, then it could be that something is still
> > > using the actor that you're trying to remove. That can be a problem
> > > when using the Delete function to remove it from memory, however I'm
> > > not sure if it can be a problem for RemoveActor as well.
> > >
> > > Hope that helps a bit,
> > > Cameron.
> > >
> > >
> > >
> > >
> ------------------------------------------------------------------------
> > > From: rcpompeu at hotmail.com
> > > To: vtkusers at public.kitware.com
> > > Date: Mon, 5 May 2008 13:45:11 +0000
> > > Subject: [vtkusers] Removing Actors
> > >
> > > Hello All,
> > >
> > > How do I remove an individual actor from the scene? My code does
> > > not work. Someone help me? Thanks.
> > >
> > > if (tbnIniciar->Down) {
> > > VTK3->GetRenderer()->AddActor(outlineActor);
> > > }
> > >
> > > else {
> > > VTK3->GetRenderer()->RemoveActor(outlineActor);
> > > VTK3->GetRenderer()->RemoveViewProp(outlineActor);
> > > VTK3->GetRenderer()->Clear();
> > > }
> > >
> > > VTK3->Invalidate();
> > >
> > >
> > >
> ------------------------------------------------------------------------
> > > Notícias direto do New York Times, gols do Lance, videocassetadas
> > > e muitos outros vídeos no MSN Videos! Confira já!
> > > <http://video.msn.com/?mkt=pt-br>
> > >
> > >
> > >
> ------------------------------------------------------------------------
> > > at CarPoint.com.au It's simple! Sell your car for just $30
> > >
> <http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fsecure%2Dau%2Eimrworldwide%2Ecom%2Fcgi%2Dbin%2Fa%2Fci%5F450304%2Fet%5F2%2Fcg%5F801459%2Fpi%5F1004813%2Fai%5F859641&_t=762955845&_r=tig_OCT07&_m=EXT>
>
> > >
> > >
> ------------------------------------------------------------------------
> > >
> > > _______________________________________________
> > > This is the private VTK discussion list.
> > > Please keep messages on-topic. Check the FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> > > Follow this link to subscribe/unsubscribe:
> > > http://www.vtk.org/mailman/listinfo/vtkusers
> > >
> >
> > --
> > Amy Squillacote Phone: (256) 726-4839
> > Computer Scientist Fax: (256) 726-4806
> > CFD Research Corporation Web: http://www.cfdrc.com
> > 215 Wynn Drive, Suite 501
> > Huntsville, AL 35805
> >
> >
>
>
> ------------------------------------------------------------------------
> Receba GRÁTIS as mensagens do Messenger no seu celular quando você
> estiver offline. Conheça o MSN Mobile! Crie já o seu!
> <http://mobile.live.com/signup/signup2.aspx?lc=pt-br>
--
Amy Squillacote Phone: (256) 726-4839
Computer Scientist Fax: (256) 726-4806
CFD Research Corporation Web: http://www.cfdrc.com
215 Wynn Drive, Suite 501
Huntsville, AL 35805
More information about the vtkusers
mailing list