#----------------------------------------------------------------------
+def MakeCone(vtkwin):
+ cone = vtk.vtkConeSource()
+ cone.SetResolution(80)
+ coneMapper = vtk.vtkPolyDataMapper()
+ coneMapper.SetInput(cone.GetOutput())
+ coneActor = vtk.vtkActor()
+ coneActor.SetMapper(coneMapper)
+
+ ren = vtk.vtkRenderer()
+ vtkwin.GetRenderWindow().AddRenderer(ren)
+ ren.AddActor(coneActor)
+
+
+#----------------------------------------------------------------------
+
def runTest(frame, nb, log):
if haveVTK:
- f = wxFrame(frame, -1, "wxVTKRenderWindow", size=(450, 300))
+ f = wxFrame(frame, -1, "wxVTKRenderWindow", size=(450, 300),
+ style=wxDEFAULT_FRAME_STYLE|wxNO_FULL_REPAINT_ON_RESIZE)
win = vtk.wxVTKRenderWindow(f, -1)
-
- # Get the render window
- renWin = win.GetRenderWindow()
-
- # Next, do the VTK stuff
- ren = vtk.vtkRenderer()
- renWin.AddRenderer(ren)
- cone = vtk.vtkConeSource()
- cone.SetResolution(80)
- coneMapper = vtk.vtkPolyDataMapper()
- coneMapper.SetInput(cone.GetOutput())
- coneActor = vtk.vtkActor()
- coneActor.SetMapper(coneMapper)
- ren.AddActor(coneActor)
- coneMapper.GetLookupTable().Build()
-
- # Create a scalar bar
- scalarBar = vtk.vtkScalarBarActor()
- scalarBar.SetLookupTable(coneMapper.GetLookupTable())
- scalarBar.SetTitle("Temperature")
- scalarBar.GetPositionCoordinate().SetCoordinateSystemToNormalizedViewport()
- scalarBar.GetPositionCoordinate().SetValue(0.1, 0.01)
- scalarBar.SetOrientationToHorizontal()
- scalarBar.SetWidth(0.8)
- scalarBar.SetHeight(0.17)
- ren.AddActor2D(scalarBar)
+ MakeCone(win)
f.Show(true)
frame.otherWin = f