Failed to update polydata - wxVTKRenderWindow.py

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Failed to update polydata - wxVTKRenderWindow.py

Kang Zhao
Hello,

I wanted to update polydata after Render().

In my test, I made some changes to the original wxVTKRenderWindow.py
(shipped with VTK python release), by adding a Keydown event ('x'),
which calls updatePolydata() to update the polydata
(wxVTKRenderWindow.srcdata). The function looks as follows.

def updatePolydata(self):
self.srcdata = vtk.vtkConeSource()
self.srcdata.SetResolution(32)
self.srcdata.Modified()
self.srcdata.Update()
self.Render()

I expected the new "Cone" will be drawn to the screen, but it didn't
happen.

Did I misunderstand anything about how to update the polydata and piplines?

Here is my testing environment:

OS: Windows 7 (64-bit)
Python: 2.7.7 (32 bit)
wxPython: wxPython2.8-win32-unicode-2.8.12.1-py27.exe
VTK: vtkpython-6.1.0-Windows-32bit.exe

My testing script is attached.

Thanks for your help in advance.

Kang


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/vtkusers

test_wxVTKRenderWindow.py (31K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Failed to update polydata - wxVTKRenderWindow.py

ftouvet
Did you check you enter the

if not self.GetUpdateRegion().IsEmpty() or self.__handle:

loop in the Render() method?