[vtkusers] updating a scene
David.Pont at ForestResearch.co.nz
David.Pont at ForestResearch.co.nz
Tue Jul 29 17:27:04 EDT 2003
Hi Luke,
I have made vis apps where I add actors in response to user events (GUI,
button, checkbox etc). If the user later 'turns them off' I set
VisibilityOff, and if they later 'turn them back on' I set VisibilityOn.
So at the beginning there is a small set of initial actors added, the user
can cause others to be added, the total number of actors can only increase,
but I do not have to create them all up front.
At startup I declare all actors and set them to NULL. On a request to 'turn
on' an actor if it is NULL I build the pipeline and add the actor.
Dave Pont
Luke J West
<ljw at soc.soton To: Jeff Lee <jeff at cdnorthamerica.com>
.ac.uk> cc: vtkusers at vtk.org
Sent by: Subject: Re: [vtkusers] updating a scene
vtkusers-admin
@vtk.org
30/07/2003
02:01
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
_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at: <
http://public.kitware.com/cgi-bin/vtkfaq>
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers
More information about the vtkusers
mailing list