updated wxMVCTree, VTK, and the demo

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4629 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
1999-11-19 05:34:40 +00:00
parent 5008c64c32
commit e395c057a3
6 changed files with 386 additions and 238 deletions

View File

@@ -109,49 +109,50 @@ class wxVTKRenderWindow(wxWindow):
## testcode is now in the demo ##
if __name__ == '__main__':
class TestFrame(wxFrame):
def __init__(self, parent):
wxFrame.__init__(self, parent, -1, "VTK Test", size=(450,450))
## if __name__ == '__main__':
## class TestFrame(wxFrame):
## def __init__(self, parent):
## wxFrame.__init__(self, parent, -1, "VTK Test", size=(450,450))
rw = wxVTKRenderWindow(self, -1)
## rw = wxVTKRenderWindow(self, -1)
# Get the render window
renWin = rw.GetRenderWindow()
## # Get the render window
## renWin = rw.GetRenderWindow()
# Next, do the VTK stuff
ren = vtkRenderer()
renWin.AddRenderer(ren)
cone = vtkConeSource()
cone.SetResolution(80)
coneMapper = vtkPolyDataMapper()
coneMapper.SetInput(cone.GetOutput())
coneActor = vtkActor()
coneActor.SetMapper(coneMapper)
ren.AddActor(coneActor)
coneMapper.GetLookupTable().Build()
## # Next, do the VTK stuff
## ren = vtkRenderer()
## renWin.AddRenderer(ren)
## cone = vtkConeSource()
## cone.SetResolution(80)
## coneMapper = vtkPolyDataMapper()
## coneMapper.SetInput(cone.GetOutput())
## coneActor = vtkActor()
## coneActor.SetMapper(coneMapper)
## ren.AddActor(coneActor)
## coneMapper.GetLookupTable().Build()
# Create a scalar bar
scalarBar = 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)
## # Create a scalar bar
## scalarBar = 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)
class TestApp(wxApp):
def OnInit(self):
f = TestFrame(None)
self.SetTopWindow(f)
f.Show(true)
return true
## class TestApp(wxApp):
## def OnInit(self):
## f = TestFrame(None)
## self.SetTopWindow(f)
## f.Show(true)
## return true
app = TestApp(0)
app.MainLoop()
## app = TestApp(0)
## app.MainLoop()