[vtkusers] MFC CWnd and VTK

Andrew J. P. Maclean a.maclean at acfr.usyd.edu.au
Sun Sep 1 19:35:27 EDT 2002

Many thanks for your good work John. It is really appreciated. The
examples were developed with the view to making it as simple as possible
for a user new to VTK and MFC to get an application up and running. So I
cut back on the GUI "sugar" a lot. 

Actually I still use the instructions when setting up a new project!

With respect to design issues under MFC:
1) You will find it a very good development environment. A hint: Pair
New(), Delete() for every object you create - simple ... but you will
get caught every time! Don't rely on automatic cleanup on exit.
2) It is very easy to add sliders etc. The problem is to ensure
pipelining executes correctly when you change a parameter. 
3) The technique mentioned here is more sophisticated because we are
using vtk to gather real-time data from sensors. I am now using
messaging and threading along with a "shared memory" class into which
data structures are deep copied for use by other threads. This seems to
work OK but you have to be very careful with respect to accessing the
data. I use the Boost thread library for threading and its mutexes. This
probably violates the pipelining dictum to some extent in vtk, and I
wish more objects could be deep copied. However MFC is message based and
this paradigm seems to work well. I don't know whether others use this
Andrew J. P. Maclean
Australian Centre for Field Robotics
The Rose Street Building J04
The University of Sydney  2006  NSW
Room:  106
Phone: +61 2 9351 3283
Fax:   +61 2 9351 7474


-----Original Message-----
From: John Biddiscombe [mailto:jbiddiscombe at skippingmouse.co.uk] 
Sent: Thursday, 29 August 2002 22:33
To: list-vtk-developers; vtkusers at public.kitware.com;
a.maclean at acfr.usyd.edu.au
Subject: Re: [vtkusers] MFC CWnd and VTK

Andrew, + developers + users,

I have checked in your MDI and SDI examples under the following tree


as subdirs.

Your project files didn't work on my setup due to heap error with MSVC
(/Zm option) and they have been removed. Instead, I have added
CMakeLists.txt files to the appropriate locations. This setup is tested
and produces working projects which compile and run under Visual Studio
7 dot NET.

If anyone reading can test under MSVC 6 and confirm that it works, it
would be appreciated.

TABS were converted to 2x<space>. Apologies for resulting style errors.
Your headers/disclaimers were replaced with the standard vtk text.

Many thanks for your demos. On a pesonal note - as an experienced vtk
user, but new to MSVC I'd like to see demos with buttons and sliders etc
that show how to design a complex gui that integrates with vtk. (eg
control the glyph sizes with a slider &etc) - No doubt this is not
really a vtk issue but rather one of familiarising oneself with the
development environment.

Thanks again

John B

More information about the vtkusers mailing list