X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f6bcfd974ef26faf6f91a62cac09827e09463fd1..9df06f5b696cde13b1220ae6ec60dc6f32d2ab6f:/wxPython/demo/wxVTKRenderWindow.py diff --git a/wxPython/demo/wxVTKRenderWindow.py b/wxPython/demo/wxVTKRenderWindow.py index df1a710d0f..520f50b2aa 100644 --- a/wxPython/demo/wxVTKRenderWindow.py +++ b/wxPython/demo/wxVTKRenderWindow.py @@ -8,36 +8,27 @@ except ImportError: #---------------------------------------------------------------------- +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