[vtkusers] animation loop and interaction

Akshay Sthapit sthapit at yahoo.com
Fri Aug 20 03:31:11 EDT 2004


Hi Sean

I have no idea how to implement a repeating timer? callback.  Can you
give some more details, or point me towards some literature/examples? 
This would be extremely helpful.

Thanks!
Akshay

--- Sean McInerney <seanm at nmr.mgh.harvard.edu> wrote:

> If you use a repeating timout callback, you shouldn't need separate
> threads.
> 
> -Sean
> 
> Akshay Sthapit wrote:
> > Hi Alex
> > 
> > What I have done is to add an observer to renderer -
> > 
> > renderer->AddObserver(vtkCommand::StartEvent, myVtkCB);
> > 
> > That way it keeps updating the scene (via a "callback") at a rate
> which
> > you can control, and all you have to do is manipulate ("interact")
> the
> > actors in another thread, and tadaa you got animation.
> > 
> > Here's my vtkCB class -
> > 
> > class vtkCB : public vtkCommand {//Callback to update at every
> graphics
> > loop
> > 	public:
> > 		static vtkCB *New() {
> > 			return new vtkCB; 
> > 		}
> > 		virtual void Execute(vtkObject *caller, unsigned long, void*
> > callData) {
> > 			graphicsInterface->refresh();
> > 		}
> > 		void setup(GraphicsInterface *graphicsInterface) {
> > 			this->graphicsInterface = graphicsInterface;
> > 		}
> > 	private:
> > 			GraphicsInterface *graphicsInterface;
> > };
> > 
> > Hope this helps.
> > 
> > Akshay
> > 
> > 
> > --- Alexandre Popelard <apopelar at enserg.fr> wrote:
> > 
> > 
> >>Hi,
> >>
> >>I have developed a little volume animation under c++ using a simple
> >>loop.
> >>I would now want to be able to interact with the volume during the 
> >>animation. But if I use vtkRenderWindowInteractor and start(), it
> >>stops the 
> >>main animation loop.
> >>If you have any ideas or examples on how to do that, please let me
> >>know.
> >>
> >>Thanks,
> >>Alex
> >>_______________________________________________
> >>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
> >>
> > 
> > 
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam protection around 
> > http://mail.yahoo.com 
> > _______________________________________________
> > 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
> > 
> 



	
		
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail 



More information about the vtkusers mailing list