[Insight-users] VTK render window error?

Luis Ibanez luis.ibanez@kitware.com
Mon, 31 Mar 2003 22:36:04 -0500


Hi Samuel, Joris,


I'm not sure this is the same problem.

Joris is using MFC and doesn't seem to be
creating a pure OpenGL window at the same
time it has VTK windows.

The error looks like a conflict between the
vtkRenderWindowInteractor and the MFC
event loop.

Could you please post the error message that
you get ?


Thanks


   Luis


PS.
As you already pointed out, this is
totally unrelated with ITK...

------------------------------------------
Samuel Rodríguez Bescos wrote:
> Hello Joris,
> 
> I had the same problem and I asked to this list.
> 
> I post you the response of Luis Ibanez.
> 
> (Luis, I hope you don't mind.)
> 
> What I do is waiting for new versions of VTK but I haven't checked yet.
> 
> Regards,
> 
> Sam
> ----- Original Message -----
> From: "J Mst" <gave_edgar@hotmail.com>
> To: <insight-users@public.kitware.com>
> Sent: Monday, March 31, 2003 10:42 AM
> Subject: [Insight-users] VTK render window error?
> 
> 
> 
>>
>>
>>Hi all,
>>
>>I've a question about the renderwindow. I'm using ITK and VTK to show an
>>image. The image is first being prcessed with ITK and then it'll be shown
>>with VTK. I tried both the imageviewer and the renderwindow (with actors).
>>I'm all doing this in an VC++ MFC environment. I desinged it that the
> 
> window
> 
>>will be rendered when the user pushes the render-button.
>>
>>When I use the ordinary "vtkImageViewer", my program will compile just
> 
> fine
> 
>>but when I run the program and hit the render window, it gives me an
> 
> error.
> 
>>I can see the render window but trough the error, the program is stuck.
> 
> The
> 
>>same think happens when I use a renderwindow with the use of
> 
> actors/mappers
> 
>>(same principle).
>>
>>When I use a "vtkRenderWindowInteractor", the render window will show
> 
> just.
> 
>>In this case I added the command: renderwindowinteractor->Start().
>>
>>The problem seems solved, but it isn't. When I want to close the window,
>>it'll give me the same error as before. So I suspect it has something to
> 
> do
> 
>>with the return value or something. For clarity, this error occurs when
> 
> I'm
> 
>>programming in a MFC. The error/break can be seen below.(the arrow
> 
> indicates
> 
>>the place of the break)
>>
>>I couldn't find the problem as I looked through the mailing-list so.. Does
>>anyone here got a clue how to fix the problem?
>>
>>!! I know this is not an ITK question but I got no response at the VTK
>>!! mailing list.
>>
>>many thanks in advance.
>>
>>Joris
>>Medical Spectrum
>>Enschede, The Netherlands
>>
>>
>>--------------<SNIP>--------------------------------------------
>>void VTKImageExportBase::UpdateInformationCallbackFunction(void* userData)
>>{
>>  static_cast<VTKImageExportBase*>(userData)->
>>----->     UpdateInformationCallback();
>>}
>>
>>int VTKImageExportBase::PipelineModifiedCallbackFunction(void* userData)
>>{
>>  return static_cast<VTKImageExportBase*>(userData)->
>>    PipelineModifiedCallback();
>>
>>--------------<SNIP>--------------------------------------------
>>
>>
>>_________________________________________________________________
>>Hotmail en Messenger on the move
>>http://www.msn.nl/communicatie/smsdiensten/hotmailsmsv2/
>>
>>_______________________________________________
>>Insight-users mailing list
>>Insight-users@public.kitware.com
>>http://public.kitware.com/mailman/listinfo/insight-users
>>
>>
>> ------------------------------------------------------------------------
>>
>> Subject:
>> Re: [Insight-users] Problem with FLTK and VTK
>> From:
>> Luis Ibanez <luis.ibanez@kitware.com>
>> Date:
>> Wed, 12 Feb 2003 09:18:01 -0500
>> To:
>> Samuel Rodríguez Bescos <srodrigu@gbt.tfo.upm.es>
>>
>>
>>
>> Hi Samuel,
>>
>> This is due to a feature in VTK that prevented
>> applications from mixing OpenGL windows with
>> VTK managed windows.
>>
>> This has been fixed now in the VTK cvs repository.
>>
>> Basically VTK was caching the OpenGL context
>> and restoring it assuming that no other OpenGL
>> windows were used at the same time.
>>
>> Please update your VTK checkout and let us know
>> if you find further problems.
>>
>>
>>    Thanks
>>
>>
>>       Luis
>>
>>
>> ---
>>
>> PS. Now that...
>>
>> Why to use OpenGL directly when you can use VTK  :-)
>> You could use the vtkFlRenderWindowInteractor as
>> illustrated in ThinPlatesSplines example and do
>> all the visualization with VTK.
>>
>>
>> ------------------------------------------------
>>
>> Samuel Rodríguez Bescos wrote:
>> > Hello everybody,
>> >
>> >
>> >
>> > I'm developing a sgementation program using deformable models. I'm 
>> using
>> > in my program the FLTKImageViewer to visualize the initial image and 
>> the
>> > VTK  to visualize the final Mesh.
>> >
>> >
>> >
>> > The problem is that when the final Mesh is displayed in VTK. I can't 
>> use
>> > the window of the initial image in FLTK again. It doesn't respond.
>> >
>> >
>> >
>> > I think the problem is related with the functions:
>> >
>> >
>> >
>> >  Fl::run(); related with FLTK and the function
>> > "m_MeshRenderWindowInteractor->Start();"  used to interact with the
>> > final mesh in VTK .
>> >
>> >
>> >
>> > Has anybody any Idea? or what have I do to solve it?
>> >
>> >
>> >
>> > Thanks in Advance.
>> >
>> >
>> >
>> > Sam
>> >
>>
>>
>>
>>