]> git.saurik.com Git - wxWidgets.git/blame_incremental - wxPython/demo/wxVTKRenderWindow.py
dismiss the popup when an unprocessed key is pressed
[wxWidgets.git] / wxPython / demo / wxVTKRenderWindow.py
... / ...
CommitLineData
1
2from wxPython.wx import *
3try:
4 from wxPython.lib import vtk
5 haveVTK = true
6except ImportError:
7 haveVTK = false
8
9#----------------------------------------------------------------------
10
11def MakeCone(vtkwin):
12 cone = vtk.vtkConeSource()
13 cone.SetResolution(80)
14 coneMapper = vtk.vtkPolyDataMapper()
15 coneMapper.SetInput(cone.GetOutput())
16 coneActor = vtk.vtkActor()
17 coneActor.SetMapper(coneMapper)
18
19 ren = vtk.vtkRenderer()
20 vtkwin.GetRenderWindow().AddRenderer(ren)
21 ren.AddActor(coneActor)
22
23
24#----------------------------------------------------------------------
25
26def runTest(frame, nb, log):
27 if haveVTK:
28 f = wxFrame(frame, -1, "wxVTKRenderWindow", size=(450, 300),
29 style=wxDEFAULT_FRAME_STYLE|wxNO_FULL_REPAINT_ON_RESIZE)
30 win = vtk.wxVTKRenderWindow(f, -1)
31 MakeCone(win)
32
33 f.Show(true)
34 frame.otherWin = f
35 return None
36
37
38 else:
39 wxMessageBox("Unable to import VTK, which is a required component\n"
40 "of this demo. You need to download and install the\n"
41 "Python extension module for VTK from http://www.kitware.com/",
42 "Import Error")
43 return None
44
45#----------------------------------------------------------------------
46
47
48overview = """\
49wxVTKRenderWindow is a wrapper around the vtkRenderWindow from the
50VTK Visualization Toolkit. The VTK Python extensions are required,
51they can be obtained from http://www.kitware.com/ where you can also
52find some nifty pictures and stuff.
53
54"""