[vtkusers] Still a Bug in vtkWin32OpenGLRenderWindow ?? -> Solution

John Platt jcplatt at lineone.net
Tue Mar 2 15:05:38 EST 2004


Hi Ingo,

I am not sure why CVtkMDIView::WindowProc() is required in the sample.
The original sample appears to run quite happily on 4.5.0 without this
override.

My understanding is that by setting the parent Id of the render window
to the CView derived window :

	this->renWin->SetParentId(this->m_hWnd);

causes 

	this->iren->Initialize();

to create a new window (registered class vtkOpenGL) and subclass the
WndProc() with vtkHandleMessage() (provided
this->iren->InstallMessageProcOff() has not been used). 

By this logic, CVtkMDIView::WindowProc() only gets chance to handle
messages before the vtk window is shown.

The situation is of course different if instead of setting the parent
Id, the window Id is specified :

	this->renWin->SetWindowId(this->m_hWnd);

It would be useful to be aware of the advantages/disadvantages of the
two approaches and which is the preferred method.

John.

-----Original Message-----
From: vtkusers-admin at vtk.org [mailto:vtkusers-admin at vtk.org] On Behalf
Of de Boer Ingo
Sent: 02 March 2004 15:39
To: vtkusers
Cc: de Boer Ingo
Subject: [vtkusers] Still a Bug in vtkWin32OpenGLRenderWindow ?? ->
Solution


Hi all,

find attached some modifications for the MFC_MDI sample.
This is all based on VTK 4.4.0 release!
I guess, this is more conform and more clear. I also changed
the message handling. Therefore, I needed to change 3 lines
in vtkWin32RenderWindowInteractor.cxx. Maybe some off you should
check these changes with Borland, Cygwin, etc...

Due to these changes, the OnSize(), OnEraseBkgnd() could be
deleted. The members are all deleted in OnDestroy() now.
Sizing, background and generell painting is done by VTK.
The pipeline is created once in OnInitialUpdate().

If these changes go to the CVS, there should be some
changes made to MFC_SDI also! Maybe also the 'SampleMFC'
should be removed because the 'vtkMDI' and 'vtkSDI' sample
says it all ??

greets
  Ingo

---
Dr.-Ing. Ingo H. de Boer

Polytec GmbH
Polytec-Platz 1-7, 76337 Waldbronn, Germany
phone: ++49 7243 604 106
fax  : ++49 7243 604 255





More information about the vtkusers mailing list