[vtkusers] wtl/vtk

Tom Parker tparker at atlasbuilders.com
Wed Sep 28 10:31:46 EDT 2005


Hello All,

I'm trying to wrap VTK inside WTL to avoid using MFC. I'm just tired of MFC
and WTL is the fashionable new thing ;)

The attached example uses the Windows Template Library - (WTL Version 7.5
(build 5249) 9/6/05) and modified Win32Cone.cxx source code. All you need to
do to build is download wtl and add it to your include path (however you
like to do that). I've attached my source and cmakelists.txt file.

http://sourceforge.net/projects/wtl

I basically just copied the usage of vtkWin32OpenGLRenderWindow and
vtkWin32RenderWindowInteractor from the vtkMFCWindow.h and vtkMFCWindow.cxx
and the MFC example files. And I'm passing events into
vtkWin32RenderWindowInteractor in what I'm assuming is the proper fashion
but the events are not getting processed. I think the problem is with this
bit of code. You can uncomment the define to break the example.

	// setup the parent window
// #define USE_WTL_EVENTS TRUE
#ifdef USE_WTL_EVENTS
	this->pRenderWindow->SetWindowId(hwnd);
	this->pRenderWindow->SetParentId(hwnd);
#else
	this->pRenderWindow->SetParentId(hwnd);
#endif
	this->pInteractor = vtkWin32RenderWindowInteractor::New();
	this->pInteractor->SetRenderWindow(this->pRenderWindow);
#ifdef USE_WTL_EVENTS
	this->pInteractor->SetInstallMessageProc(0);
#endif
	this->pInteractor->Initialize();

I've moved things around and tried different combos of OnPaint and Render
calls with no joy since Monday morning and I'm officially frustrated, any
ideas would be greatly appreciated.

Thanks,
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: WTLApp.tar.gz
Type: application/x-gzip
Size: 2568 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20050928/beae0856/attachment.bin>


More information about the vtkusers mailing list