<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2719.2200" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV>I believe I might have found two bugs in the class wxVTKRenderWindow<BR>as
encountered in VTK/Wrapping/Python/vtk/wx/wxVTKRenderWindow.py.<BR>I am working
on Windows 2000 with the VTKNightly dated 10/02/2002.<BR><BR> - At launch
of the script wxVTKRenderWindow.py, a window appears, but<BR>
nothing is displayed inside. Things become correct when I resize
the<BR> window. (This was also reported by Chandra Shekhar,
see<BR> <A
href="http://public.kitware.com/pipermail/vtkusers/2002-October/013700.html">http://public.kitware.com/pipermail/vtkusers/2002-October/013700.html</A>)<BR>
I could fix this problem, by changing the line 164 by
:<BR>
try:<BR>
size = parent.GetSize()<BR>
except:<BR>
size = wxDefaultSize<BR> The try/except is used to protect the call
to parent.<BR> <BR> - When the script wxVTKRenderWindow.py is launched
and when killing<BR> the window (by clicking on the window close
button, the one with a<BR> cross at the upper right), I get the
following error message in <BR> the Python console
:<BR> runtime error
R6025<BR> - Pure virtual
function call<BR> This odd/bad behavior desapears when I add the
line :<BR>
widget.GetRenderWindow().RemoveRenderer(ren)<BR> at the end of test
script, just after the line containing the<BR> "MainLoop" function.
But I think that the problem is in the class<BR> wxVTKRenderWindow :
Renderers might be refered to after they have<BR> allready been
deleted/gced.<BR> To address this problem one could handle the
proper deconnection<BR> of the RenderWindow from it's renderer[s] by
adding a destructor<BR> to the wxVTKRenderWindow class. The
following does the job for me:<BR><BR> def
__del__(self):<BR> renderers =
self._RenderWindow.GetRenderers()<BR>
numRenderers =
renderers.GetNumberOfItems()<BR>
self._CurrentRenderer = None<BR>
renderers.InitTraversal()<BR> for i in
range(0,numRenderers):<BR>
self.GetRenderWindow().RemoveRenderer(renderers.GetNextItem())<BR><BR>
<BR>Thanks for considering those problems.<BR>Greetings<BR></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Benoit Regrain<BR>Ingénieur d'étude CNRS
(Creatis)<BR>email : <A
href="mailto:regrain@creatis.insa-lyon.fr">regrain@creatis.insa-lyon.fr</A><BR>INSA
- Bâtiment Blaise Pascal<BR>7 avenue Jean Capelle<BR>69621 Villeurbanne
Cedex<BR></FONT></DIV></BODY></HTML>