Line TCL UTILITIES USER MANUAL Line
SYNOPSIS
Draw a line
PACKAGE
TCLGPH
NAME
Line
USAGE
Line  wnID Xa Ya Za Xb Yb Zb {Tag}
INPUT DEFINITIONS
wnID - The iD of the window to output the line in.
Xa - The start X coordinate of the line.
Ya - The start Y coordinate of the line.
Za - The start Z coordinate of the line. This is unused with the TK graphics driver but perhaps not with the VTK driver.
Xb - The end X coordinate of the line.
Yb - The end Y coordinate of the line.
Zb - The end Z coordinate of the line. This is unused with the TK graphics driver but perhaps not with the VTK driver.
Tag - Optional input variable which allows the line to have the designated Tag attached to it. Tagged items can be selectively deleted from a canvas.
RETURN DEFINITION
NONE
DESCRIPTION
Line draws a line between the points (Xa, Ya, Za) and (Xb, Yb, Zb) in the color and linestyle set in the last call to PlotColor and LineStyle.
ERRORS
None Generated
C BACKING
No
EXAMPLE(S)
EXAMPLE 1:Examples of various lines.
# INITIALIZE the default gui settings

GUIprefsRead

# SET a window size

set GphInfo(xsScrL) 600
set GphInfo(ysScrL) 500
set GphInfo(xScrL) 600
set GphInfo(yScrL) 500

# START graphics

GraphicsOn TK RainBow 

# ESTABLISH a graphics window coverting the whole canvas 

GenWindow 0 0.0 0.0 0.0 1.0 1.0 1.0 -6.0 -6.0 0.0 6.0 6.0 0.0

# OUTPUT a white dashed line with arrows on both ends.

PlotColor HOLD $GphInfo(White) HOLD
LineStyle 0 DASH1 both 
Line 0 -3.0 4.0 0.0 3.0 4.0 0.0

# RESET the lines to have no arrows

LineStyle

# OUTPUT a series of colored lines 

set Xa -5.0 
set Xb  5.0 
set Y   3.5
for { set I 50 } { $I < 200 } { incr I 2 } {
   PlotColor SOLID $I HOLD
   Line 0 $Xa $Y 0.0 $Xb $Y 0.0
   set Xa [expr $Xa + 0.06]
   set Xb [expr $Xb - 0.06]
   set Y [expr $Y - 0.1]
}     
      
Feb 22, 2007