#!/usr/bin/env python#This simple example shows how to do basic rendering and pipeline#creation.
importvtkclassMouseInteractorHighLightActor(vtk.vtkInteractorStyleTrackballCamera):def __init__(self, parent =None):
self.AddObserver("MouseMoveEvent", self.MouseMoveEvent)
self.AddObserver("MouseWheelForwardEvent", self.MouseWheelForwardEvent)
self.AddObserver("MouseWheelBackwardEvent", self.MouseWheelBackwardEvent)defMouseMoveEvent(self, obj, event):pass
defMouseWheelBackwardEvent(self, obj, event):pass
defMouseWheelForwardEvent(self, obj, event):pass
defmain():
colors=vtk.vtkNamedColors()#Set the background color.
bkg = map(lambda x: x / 255.0, [26, 51, 102, 255])
colors.SetColor("BkgColor", *bkg)#This creates a polygonal cylinder model with eight circumferential
#facets.
cylinder =vtk.vtkCylinderSou