I created a planeWidget to cut the volume. However the volume was disappeared when I rotate the window to a angle by mouse.
def clipPlane(obj, event):
obj.GetPlane(clippingPlane)
#planeWidget.GetPlane(clippingPlane)
volumMapper.AddClippingPlane(clippingPlane)
renWin.Render()
ren.SetBackground(0.5, 0, 0.0)
style = vtk.vtkInteractorStyleTrackballCamera()
style.SetDefaultRenderer(ren)
iren.SetInteractorStyle(style)
renWin.GetInteractor().SetInteractorStyle(style)
clippingPlane = vtk.vtkPlane()
planeWidget.SetInteractor(iren)
planeWidget.SetProp3D(volume)
planeWidget.SetPlaceFactor(1.25)
planeWidget.SetResolution(5)#//That is, set the number of meshes
planeWidget.NormalToZAxisOn()#//Initial normal direction parallel to Z axis
planeWidget.SetRepresentationToWireframe()#//Planes display as mesh properties
planeWidget.SetCenter(volume.GetCenter())#//Set plane coordinates
planeWidget.PlaceWidget()#//Lay the plane
planeWidget.GetHandleProperty().SetOpacity(0)
planeWidget.On()#//Display plane
planeWidget.AddObserver("InteractionEvent", clipPlane)