vtkmodules.wx.wxVTKRenderWindowInteractor#

A VTK RenderWindowInteractor widget for wxPython.

Find wxPython info at http://wxPython.org

Created by Prabhu Ramachandran, April 2002 Based on wxVTKRenderWindow.py

Fixes and updates by Charl P. Botha 2003-2008

Updated to new wx namespace and some cleaning up by Andrea Gavana, December 2006

Module Contents#

Classes#

EventTimer

Simple wx.Timer class.

wxVTKRenderWindowInteractor

A wxRenderWindow for wxPython. Use GetRenderWindow() to get the vtkRenderWindow. Create with the keyword stereo=1 in order to generate a stereo-capable window.

Functions#

wxVTKRenderWindowInteractorConeExample

Like it says, just a simple example

Data#

API#

vtkmodules.wx.wxVTKRenderWindowInteractor.baseClass#

None

vtkmodules.wx.wxVTKRenderWindowInteractor._useCapture#

None

class vtkmodules.wx.wxVTKRenderWindowInteractor.EventTimer(iren)#

Bases: wx.Timer

Simple wx.Timer class.

Initialization

Default class constructor. @param iren: current render window

Notify()#

The timer has expired.

class vtkmodules.wx.wxVTKRenderWindowInteractor.wxVTKRenderWindowInteractor(parent, ID, *args, **kw)#

Bases: vtkmodules.wx.wxVTKRenderWindowInteractor.baseClass

A wxRenderWindow for wxPython. Use GetRenderWindow() to get the vtkRenderWindow. Create with the keyword stereo=1 in order to generate a stereo-capable window.

Initialization

Default class constructor. @param parent: parent window @param ID: window id @param **kw: wxPython keywords (position, size, style) plus the ‘stereo’ keyword

USE_STEREO#

False

BindEvents()#

Binds all the necessary events for navigation, sizing, drawing.

__getattr__(attr)#

Makes the object behave like a vtkGenericRenderWindowInteractor.

CreateTimer(obj, evt)#

Creates a timer.

DestroyTimer(obj, evt)#

The timer is a one shot timer so will expire automatically.

_CursorChangedEvent(obj, evt)#

Change the wx cursor if the renderwindow’s cursor was changed.

CursorChangedEvent(obj, evt)#

Called when the CursorChangedEvent fires on the render window.

HideCursor()#

Hides the cursor.

ShowCursor()#

Shows the cursor.

GetDisplayId()#

Function to get X11 Display ID from WX and return it in a format that can be used by VTK Python.

We query the X11 Display with a new call that was added in wxPython 2.6.0.1. The call returns a SWIG object which we can query for the address and subsequently turn into an old-style SWIG-mangled string representation to pass to VTK.

OnMouseCaptureLost(event)#

This is signalled when we lose mouse capture due to an external event, such as when a dialog box is shown. See the wx documentation.

OnPaint(event)#

Handles the wx.EVT_PAINT event for wxVTKRenderWindowInteractor.

OnSize(event)#

Handles the wx.EVT_SIZE event for wxVTKRenderWindowInteractor.

OnMotion(event)#

Handles the wx.EVT_MOTION event for wxVTKRenderWindowInteractor.

OnEnter(event)#

Handles the wx.EVT_ENTER_WINDOW event for wxVTKRenderWindowInteractor.

OnLeave(event)#

Handles the wx.EVT_LEAVE_WINDOW event for wxVTKRenderWindowInteractor.

OnButtonDown(event)#

Handles the wx.EVT_LEFT/RIGHT/MIDDLE_DOWN events for wxVTKRenderWindowInteractor.

OnButtonUp(event)#

Handles the wx.EVT_LEFT/RIGHT/MIDDLE_UP events for wxVTKRenderWindowInteractor.

OnMouseWheel(event)#

Handles the wx.EVT_MOUSEWHEEL event for wxVTKRenderWindowInteractor.

OnKeyDown(event)#

Handles the wx.EVT_KEY_DOWN event for wxVTKRenderWindowInteractor.

OnKeyUp(event)#

Handles the wx.EVT_KEY_UP event for wxVTKRenderWindowInteractor.

GetRenderWindow()#

Returns the render window (vtkRenderWindow).

Render()#

Actually renders the VTK scene on screen.

SetRenderWhenDisabled(newValue)#

Change value of __RenderWhenDisabled ivar.

If __RenderWhenDisabled is false (the default), this widget will not call Render() on the RenderWindow if the top level frame (i.e. the containing frame) has been disabled.

This prevents recursive rendering during wx.SafeYield() calls. wx.SafeYield() can be called during the ProgressMethod() callback of a VTK object to have progress bars and other GUI elements updated - it does this by disabling all windows (disallowing user-input to prevent re-entrancy of code) and then handling all outstanding GUI events.

However, this often triggers an OnPaint() method for wxVTKRWIs, resulting in a Render(), resulting in Update() being called whilst still in progress.

vtkmodules.wx.wxVTKRenderWindowInteractor.wxVTKRenderWindowInteractorConeExample()#

Like it says, just a simple example