[vtkusers] updating a scene

Luke J West ljw at soc.soton.ac.uk
Tue Jul 29 10:01:32 EDT 2003


Sorry, I was not at all clear...

I have written my own InteractorStyle and am responding to user events from in
there without any trouble. (OnMouseMove, etc.) I can interactively spit out
diagnostic text in a console window, and it's at that point I do my adding and
removing of actors, but the changes are not reflected visibly. I've had a look
at the contents of the ActorCollection object in the Renderer, and it is
behaving as expected to the Add/Remove calls, but the rendered scene does not,
even after I call the Render() method of everything I have a handle to. (i.e.
renderWindow, renderWindowInteractor)

I just discovered I can use visibilityOn/Off in response to the events i'm
capturing and have found that it works, but to use that strategy I would need to
know up front the actors I want visualise which, as you can imagine, is very
limiting.

thanks very for your comments, jeff - any other ideas?

luke

Quoting Jeff Lee <jeff at cdnorthamerica.com>:

> once you invoke rwi->Start(), your app enters an event loop in which 
> case there is no way to change the scene externally (other than 
> attaching a UserEvent observer i.e. the 'u' kepress would invoke your 
> user method which could add/remove actors... very limited except for 
> quick&dirty pipeline vis) until you break the loop (terminate the app).  
> your other alternative would be to have your own application-level loop 
> for capturing events and manually pass the events to the rwi.  you can 
> look at something like vtkQt to see how its done.
> -Jeff
> 
> Luke J West wrote:
> 
> >Thanks for that reply, Jeff,
> >
> >does anybody know of an example that demonstrates "turning actors on and
> off"
> >
> >If I change my scene using _renderer->AddActor(...) or ->RemoveActor(...)
> after
> >rwi->Start(...) and ->Initialize(...) the scene remains unchanged on
> invocation
> >of either renderWindow->Render() and/or rwi->Render() in any order.
> >
> >I have three Renderers but only one RenderWindow.
> >
> >Perhaps there something else I need to do?
> >
> >thanks,
> >
> >luke
> >
> >  
> >
> >>_renderWindow->Render();
> >>
> >>Luke J West wrote:
> >>
> >>    
> >>
> >>>Hi - should be an easy one...
> >>>
> >>>if I have changed a scene with ->AddActor and ->RemoveActor on a
> >>>      
> >>>
> >>vtkRenderer,
> >>    
> >>
> >>>what method do I call on what object to reflect the changes on my
> >>>      
> >>>
> >>screenobject)
> >>    
> >>
> >>>thanks,
> >>>
> >>>      
> >>>
> 
> 


Luke J West : Research Assistant : e-Science
--------------------------------------------
Rm. 566/12, School of Ocean & Earth Sciences
Southampton Oceanography Centre, Southampton
SO14 3ZH  United Kingdom
--------------------------------------------
Tel: +44 23 8059 4801  Fax: +44 23 8059 3052
Mob: +44 79 6107 4783




More information about the vtkusers mailing list