[vtkusers] vtk, MFC , interaction

lydia coin lydia_coin3d at yahoo.fr
Thu Jan 30 06:30:59 EST 2003


Hi, 
I posted a message to describe a problem but  didn't get any help 
In my application, I need to display 2d medical images ( in 3 oientations) using MFC view and inventor (coin3d) API. 
in the fourth view, I need to display the 3D model and interact with it. 
I create a  CMDIChildWnd (like for the 3 windows of coin3d) and add a view to it like in CvtkSdiview. at the display time, it displays the sphere of the vtksdi example but if I move the window, the sphere disappear ( no active rendering) and there is no mouse interaction . 
If I create another  CMDIChildWnd frame with the same methods and add the same view, it works for both windows. Both windows display the sphere and both windows accept mouse interaction 
Can you tell me what's wrong? 
thanks in advance  
 "Charl P. Botha" <c.p.botha at its.tudelft.nl> wrote: 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/
_______________________________________________
This is the private VTK discussion list. 
Please keep messages on-topic. Check the FAQ at: 
Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers


---------------------------------
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Testez le nouveau Yahoo! Mail
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20030130/4483931b/attachment.htm>


More information about the vtkusers mailing list