#######################################################################
# First we include the VTK Tcl packages which will make available
# all of the vtk commands to Tcl.
# 
package require vtk
package require vtkinteraction

#######################################################################
# Create a PLOT3D reader and load the data.
#
vtkPLOT3DReader pl3d
    pl3d SetXYZFileName "$VTK_DATA_ROOT/Data/combxyz.bin"
    pl3d SetQFileName "$VTK_DATA_ROOT/Data/combq.bin"
    pl3d SetScalarFunctionNumber 100
    pl3d SetVectorFunctionNumber 202
    pl3d Update
#######################################################################
# Create an xy-plot using the output of the 3 probe filters as input.
# The x-values we are plotting are the underlying point data values.
vtkXYPlotActor xyplot
     xyplot AddInput [pl3d GetOutput]	 
    [xyplot GetPositionCoordinate] SetValue 0.0 0.0 0
    [xyplot GetPosition2Coordinate] SetValue 1.0 0.33 0;#relative to Position
    xyplot SetXValuesToValue
    xyplot SetXValuesToIndex
    xyplot SetNumberOfXLabels 10
    xyplot SetTitle "Pressure vs. Point Id"
    xyplot SetXTitle "Probe Length"
    xyplot SetYTitle "P"
    xyplot PlotPointsOn
    [xyplot GetProperty] SetColor 0 0 1
    [xyplot GetProperty] SetPointSize 3
#######################################################################
# Create the Renderers, RenderWindow, and RenderWindowInteractor.
#
vtkRenderer ren1
vtkRenderWindow renWin
    renWin AddRenderer ren1
vtkRenderWindowInteractor iren
    iren SetRenderWindow renWin
#######################################################################
# Set the background and viewport of the second renderer.  Add the xy-plot
# actors to the renderer.  Set the size of the render window.
ren1 SetBackground 1 1 1
ren1 AddActor2D xyplot
renWin SetSize 500 250
#######################################################################
# Set up the camera parameters.
set cam1 [ren1 GetActiveCamera]
    $cam1 SetClippingRange 3.95297 100
    $cam1 SetFocalPoint 8.88908 0.595038 29.3342
    $cam1 SetPosition -12.3332 31.7479 41.2387
    $cam1 SetViewUp 0.060772 -0.319905 0.945498
iren Initialize
#######################################################################
# Set the user method (bound to key 'u')
#
iren AddObserver UserEvent {wm deiconify .vtkInteract}
#######################################################################
# Withdraw the default tk window.
wm withdraw .

