<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> pointWidget = vtk . vtkPointWidget ( ) <EOL> pointWidget . SetInput ( pl3d . GetOutput ( ) ) <EOL> pointWidget . AllOff ( ) <EOL> pointWidget . PlaceWidget ( ) <EOL> point = vtk . vtkPolyData ( ) <EOL> pointWidget . GetPolyData ( point ) <EOL> probe = vtk . vtkProbeFilter ( ) <EOL> probe . SetInput ( point ) <EOL> probe . SetSource ( pl3d . GetOutput ( ) ) <EOL> cone = vtk . vtkConeSource ( ) <EOL> cone . SetResolution ( <NUM_LIT:16> ) <EOL> inspector = vtk . vtkDataSetInspector ( ) <EOL> inspector . SetInputConnection ( pl3d . GetOutputPort ( ) ) <EOL> pythoncalc = vtk . PythonCalc ( ) <EOL> pythoncalc . value1 ( inspector . GetLength ( ) ) <EOL> pythoncalc . value2 ( <NUM_LIT:0.1> ) <EOL> pythoncalc . op ( '<STR_LIT:*>' ) <EOL> glyph = vtk . vtkGlyph3D ( ) <EOL> glyph . SetInputConnection ( probe . GetOutputPort ( ) ) <EOL> glyph . SetSource ( cone . GetOutput ( ) ) <EOL> glyph . SetVectorModeToUseVector ( ) <EOL> glyph . SetScaleModeToDataScalingOff ( ) <EOL> glyph . SetScaleFactor ( pythoncalc . value ( ) ) <EOL> glyphMapper = vtk . vtkPolyDataMapper ( ) <EOL> glyphMapper . SetInputConnection ( glyph . GetOutputPort ( ) ) <EOL> glyphActor = vtk . vtkActor ( ) <EOL> glyphActor . SetMapper ( glyphMapper ) <EOL> glyphActor . VisibilityOff ( ) <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> ren = vtk . vtkRenderer ( ) <EOL> renWin = vtk . vtkRenderWindow ( ) <EOL> renWin . AddRenderer ( ren ) <EOL> iren = vtk . vtkRenderWindowInteractor ( ) <EOL> iren . SetRenderWindow ( renWin ) <EOL> def BeginInteraction ( obj , event ) : <EOL> global point , glyphActor <EOL> obj . GetPolyData ( point ) <EOL> glyphActor . VisibilityOn ( ) <EOL> def ProbeData ( obj , event ) : <EOL> obj . GetPolyData ( point ) <EOL> pointWidget . SetInteractor ( iren ) <EOL> pointWidget . AddObserver ( "<STR_LIT>" , BeginInteraction ) <EOL> pointWidget . AddObserver ( "<STR_LIT>" , BeginInteraction ) <EOL> pointWidget . AddObserver ( "<STR_LIT>" , ProbeData ) <EOL> ren . AddActor ( outlineActor ) <EOL> ren . AddActor ( glyphActor ) <EOL> ren . SetBackground ( <NUM_LIT:1> , <NUM_LIT:1> , <NUM_LIT:1> ) <EOL> renWin . SetSize ( <NUM_LIT> , <NUM_LIT> ) <EOL> ren . SetBackground ( <NUM_LIT:0.1> , <NUM_LIT> , <NUM_LIT> ) <EOL> cam1 = ren . GetActiveCamera ( ) <EOL> cam1 . SetClippingRange ( <NUM_LIT> , <NUM_LIT:50> ) <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>
