[IGSTK-Developers] View does not show in Widget

Andinet Enquobahrie andinet.enqu at kitware.com
Thu Jan 31 15:16:24 EST 2008


Patrick Cheng wrote:

> Hi Andinet,
>
> Take NeedleBiopsy for example, it has a .fl file which defines the 
> GUI. We need to move all the View object from its derived 
> NeedleBiopsy.h into the GUI. And added it to the widget in the 
> construction methods?

You can do that...

Take a look at all the updated examples.

For example OneViewAndTrackingUsinMcironTracker

The view is set to the widget inside the constructor in

OneViewAndTrackingGUI.fl

Or as in OneViewAndTrackingUsingWidget

Lines # 99-101

You can instantiate the view in the main program and then
set it to the widget before calling the show() method.

-Andinet




>
> Patrick
>
> Andinet Enquobahrie wrote:
>
>> Patrick,
>>
>> This is not an issue in the view class.
>>
>> You have to follow the correct sequence . You need to set the view 
>> inside the
>> widget before you invoke  the FLTK show() method.  That is the 
>> correct sequence.
>>
>> Otherwise, if you follow a different function sequence, you will get 
>> a different
>> behavior. For example, if you call RequestSetView after
>> the show() method, then the FLTK window will render first before  the
>> View RenderWindow is connected with the FLTK window. Because of that,
>> you will see the View rendered separate from the FLTK window.
>>
>> Sometimes even if you follow the correct sequence, the view might be 
>> rendered
>> outside the FLTK window due to OpenGL rendering timing issue. In 
>> those cases,
>> inserting artificial delay will help.
>>
>> -Andinet
>>
>>
>>
>>> Hi Andinet,
>>>
>>> I found there is an issue with the View class.
>>>
>>> Normally, in the testing code. We will call
>>>
>>> widget2D->RequestSetView( view2D );
>>>
>>> Before we finish creating the GUI.
>>>
>>> form->end();
>>> form->show();
>>>
>>> This works out pretty well.
>>>
>>>
>>> But if we move the RequestSetView call out of the GUI code, after 
>>> form->show. The render windows will not be contained in the widget.
>>>
>>> You can verify this by moving line 87 in
>>> igstkCoordinateReferenceSystemObjectWithViewTest
>>> Out of the GUI code.
>>>
>>> Thank you,
>>>
>>> Patrick
>>>
>>> _______________________________________________
>>> IGSTK-Developers mailing list
>>> IGSTK-Developers at public.kitware.com
>>> http://public.kitware.com/cgi-bin/mailman/listinfo/igstk-developers
>>>
>>
>>
>
>


-- 
==========================================================
Andinet A. Enquobahrie, PhD
R&D Engineer
Kitware Inc.

28 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-371-3971 x124
www.kitware.com





More information about the IGSTK-Developers mailing list