[vtkusers] vtkFlRenderWindowInteractor issues

Charl P. Botha c.p.botha at its.tudelft.nl
Thu Jan 30 04:03:31 EST 2003


Hi Wahid,

On Thu, 2003-01-30 at 05:15, Wahid Alizada wrote:
> Whenever I issue a renWindow->Render() a new window
> pops up with my visualization, instead of the animation sequence occuring
> in the vtkFlRenderWindowInteractor window. Once the sequence is done, both
> the new window and the vtkFlRenderWindow window are non-interactive.
> 

I would recommend writing a few small FLTK examples first.  It seems
that you've misunderstood the event-driven programming nature of this
toolkit (and most others).  You change the azimuth of your camera 45
times before the FLTK event loop (Fl::run()) has even begun.  The
application only really starts when the event loop begins.  

You will have to create some GUI control and associate a callback to
it.  The callback will be triggered when pressing the button DURING the
fltk event loop.  In this callback, you can perform your camera
manipulations.

> 
> I don't know why this behavior is occuring.
> ///////////////////////////////////////////////////
> ///////////////////////////////////////////////////
> // my addition
>    for( int i = 0; i < 45; i++)
>      {
>        ren->GetActiveCamera()->Azimuth(i);
>               renWindow->Render();
>      }
> // end of my addition
> ////////////////////////////////////////////////
> /////////////////////////////////////////////////
> /////////////////////////////////////////////////
>    // We can now delete all our references to the VTK pipeline (except for
>    // our reference to the vtkFlRenderWindowInteractor) as the objects
>    // themselves will stick around until we dereference fl_vtk_window
>    ren->Delete();
>    renWindow->Delete();
>    cone->Delete();
>    coneMapper->Delete();
>    coneActor->Delete();
> 
>    // this is the standard way of "starting" a fltk application
>    int fl_ret = Fl::run();

-- 
charl p. botha http://cpbotha.net/ http://visualisation.tudelft.nl/



More information about the vtkusers mailing list