<s> import vtk <EOL> from vtk . util . misc import vtkGetDataRoot <EOL> VTK_DATA_ROOT = vtkGetDataRoot ( ) <EOL> pl3d = vtk . vtkPLOT3DReader ( ) <EOL> pl3d . SetXYZFileName ( VTK_DATA_ROOT + "<STR_LIT>" ) <EOL> pl3d . SetQFileName ( VTK_DATA_ROOT + "<STR_LIT>" ) <EOL> pl3d . SetScalarFunctionNumber ( <NUM_LIT:100> ) <EOL> pl3d . SetVectorFunctionNumber ( <NUM_LIT> ) <EOL> pl3d . Update ( ) <EOL> plane = vtk . vtkPlane ( ) <EOL> plane . SetOrigin ( pl3d . GetOutput ( ) . GetCenter ( ) ) <EOL> plane . SetNormal ( - <NUM_LIT> , <NUM_LIT:0> , <NUM_LIT> ) <EOL> planeCut = vtk . vtkCutter ( ) <EOL> planeCut . SetInputConnection ( pl3d . GetOutputPort ( ) ) <EOL> planeCut . SetCutFunction ( plane ) <EOL> cutMapper = vtk . vtkPolyDataMapper ( ) <EOL> cutMapper . SetInputConnection ( planeCut . GetOutputPort ( ) ) <EOL> cutMapper . SetScalarRange ( pl3d . GetOutput ( ) . GetPointData ( ) . GetScalars ( ) . GetRange ( ) ) <EOL> cutActor = vtk . vtkActor ( ) <EOL> cutActor . SetMapper ( cutMapper ) <EOL> compPlane = vtk . vtkStructuredGridGeometryFilter ( ) <EOL> compPlane . SetInputConnection ( pl3d . GetOutputPort ( ) ) <EOL> compPlane . SetExtent ( <NUM_LIT:0> , <NUM_LIT:100> , <NUM_LIT:0> , <NUM_LIT:100> , <NUM_LIT:9> , <NUM_LIT:9> ) <EOL> planeMapper = vtk . vtkPolyDataMapper ( ) <EOL> planeMapper . SetInputConnection ( compPlane . GetOutputPort ( ) ) <EOL> planeMapper . ScalarVisibilityOff ( ) <EOL> planeActor = vtk . vtkActor ( ) <EOL> planeActor . SetMapper ( planeMapper ) <EOL> planeActor . GetProperty ( ) . SetRepresentationToWireframe ( ) <EOL> planeActor . GetProperty ( ) . SetColor ( <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> ) <EOL> outline = vtk . vtkStructuredGridOutlineFilter ( ) <EOL> outline . SetInputConnection ( pl3d . GetOutputPort ( ) ) <EOL> outlineMapper = vtk . vtkPolyDataMapper ( ) <EOL> outlineMapper . SetInputConnection ( outline . GetOutputPort ( ) ) <EOL> outlineActor = vtk . vtkActor ( ) <EOL> outlineActor . SetMapper ( outlineMapper ) <EOL> outlineProp = outlineActor . GetProperty ( ) <EOL> outlineProp . SetColor ( <NUM_LIT:0> , <NUM_LIT:0> , <NUM_LIT:0> ) <EOL> ren = vtk . vtkRenderer ( ) <EOL> renWin = vtk . vtkRenderWindow ( ) <EOL> renWin . AddRenderer ( ren ) <EOL> iren = vtk . vtkRenderWindowInteractor ( ) <EOL> iren . SetRenderWindow ( renWin ) <EOL> ren . AddActor ( outlineActor ) <EOL> ren . AddActor ( planeActor ) <EOL> ren . AddActor ( cutActor ) <EOL> ren . SetBackground ( <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:1> ) <EOL> renWin . SetSize ( <NUM_LIT> , <NUM_LIT> ) <EOL> cam1 = ren . GetActiveCamera ( ) <EOL> cam1 . SetClippingRange ( <NUM_LIT> , <NUM_LIT> ) <EOL> cam1 . SetFocalPoint ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) <EOL> cam1 . SetPosition ( - <NUM_LIT> , - <NUM_LIT> , <NUM_LIT> ) <EOL> cam1 . SetViewUp ( <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ) <EOL> iren . Initialize ( ) <EOL> renWin . Render ( ) <EOL> iren . Start ( ) </s>
