[vtkusers] VTK CVS + wxPython...

Andrea Gavana andrea.gavana at polymtl.ca
Fri Jul 23 10:53:31 EDT 2004


Hello NG,

      I'm sorry to bother you again, but there is something really strange... if
I run my script WITHOUT embedding all the functions in a class (that means, by
running a script WITHOUT class or functions definitions, just a script), the
vtkOrientationMarkerWidget works, and it follows the camera. The rendering is
still slow, but this is less important.

      Moreover, I've tried to debug my script (with all function in a class),
and I see that the wxVTK window first appear when is called the function
windows.py, and more precisely here:

def SetSize(self, *_args, **_kwargs):
        val = windowsc.wxWindow_SetSize(self, *_args, **_kwargs)
        return val

But the windows is not interactive yet. Perfect. Next, the window becomes
interactive in wxVTKRWI, and more precisely here:

def OnSize(self,event):
        try:
            width, height = event.GetSize()
        except:
            width = event.GetSize().width
            height = event.GetSize().height
        self._Iren.SetSize(width, height)       <--- HERE
        self._Iren.ConfigureEvent()
        # this will check for __handle
        self.Render()

I can, at this point (in debug mode always), interact with the window without
problems, and also the vtkOrientationMarkerWidget works perfectly. If I
continue the debugging process, I reach the last lines of code:

app = ReadEclipseData()
app.MainLoop()

And the debugger loops infinitely in app.MainLoop(), that is perfect. The
vtkOrientationMarkerWidget works again without problems. At this point, I can
stop the debugger and work with my 3D grid, interact and so on. All this
happens when I set the breakpoints in the lines:

frame.SetSize((1000,900))
frame.Show(1)

that are the last lines of the last function in the class ReadEclipseData().
The same happens if I put the breakpoint in the lines (as above):

frame.SetSize((1000,900))
frame.Show(1)

And I DO NOT interact with the windows until the debugger has come to the
endless loop in app.MainLoop().

BUT, if I set a breakpoint in the line:

app.MainLoop()

The results are the same as before, the vtkOrientationMarkerWidget is frozen, it
does not follow the camera. ?????????????

Am I making some mistake in declaring my functions in the class? Or in calling
the class? Why if I set a breakpoint 2 lines before the app.MainLoop()
everything works and if I set it on app.MainLoop() it does not work?

???????

It is full of surprises this Python/VTK/wx...

Sorry to set again an attachment, I modified my script a little bit, and I put
it as attachment here. For those interested in a try, this should work with the
previous data that you can find here:

http://xoomer.virgilio.it/infinity77/MSE_22_SET.zip
http://xoomer.virgilio.it/infinity77/myproject.zip

Just replace the old Script2.py with the one attached here.

Thank you for every suggestions/pointers. Sorry for my infinite and probably
stupid questions.

Andrea.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Script2.py
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20040723/3c018db4/attachment.txt>


More information about the vtkusers mailing list