MapLine TCL UTILITIES USER MANUAL MapLine
SYNOPSIS
Draw a line
PACKAGE
TCLGPH
NAME
MapLine
USAGE
MapLine  wnID Xa Ya Xb Yb {nP} {Tag}
INPUT DEFINITIONS
wnID - The iD of the window to output the mapline in.
Xa - The start longitude coordinate of the line. Valid range is -180 to 180 degrees.
Ya - The start latitude coordinate of the line. Valid range is -90 to 90 degrees.
Xb - The end longitude coordinate of the line. Valid range is -180 to 180 degrees.
Yb - The end latitude coordinate of the line. Valid range is -90 to 90 degrees.
nP - An optional variable which specifies now many segments to break the line up into. Default value is 0
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
MapLine draws a line between the points (Xa, Ya) and (Xb, Yb) in the color and linestyle set in the last call to PlotColor and LineStyle. The line is drawn as nP segments which allows it to obtain the required curvature in non-linear coordinate systems.
ERRORS
None Generated
C BACKING
No
EXAMPLE(S)
EXAMPLE 1:Examples of lines in two non-linear coordinate systems.
# INITIALIZE the default gui settings

GUIprefsRead

# SET a window size

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

# START graphics

GraphicsOn TK RainBow 

# OPEN a window

GenWindow  9 0.0 0.0 0.0 1.0 1.0 0.0 0.0 0.0 0.0 1.0 1.0 0.0

# OPEN a square relative window in the lower center of the canvas which
#    will use an orthographics coordinate system and a window covering 
#    the upper half of the canvas which will use a stereographic
#    coordinate system.

RelSqWindow 0 9 0.25 0. 0. .5 -1. -1. 0. 1. 1. 0.
RelWindow 1 9 0. .5 0. 1.0 1.0 0.0 -4.6 -2.3 0. 4.6 2.3 0.0

# SET coordinate system to orthographic and tilt the N pole down 20 degrees 

SetCorSys ORTHOGRAPHIC [list 0.0 20.0 0.2]

# INDICATE that plotting outline is in MAP coordinates

PLTinfoChg 0 ALL AXIS FORMAT MAP

# INDICATE that window 0 can be used as a plotting window

DefinePlot 0 0 -1 -1

# DRAW the orthographics plotting axes

PlotOutlines 0 [list "" 1.0 "" 1.0] [list NONE NONE BOTH BOTH]  

# DRAW a map line in red and give it some width so we can see it better

LineStyle 2
PlotColor HOLD $GphInfo(Red) OFF
MapLine 0 -75. -80. 75.0 80.0 90

LineStyle 1

# OUTLINE the stereographic coordinate system in the top window.

SetCorSys STEREOGRAPHIC [list 0.0 0.0 0.2]
PLTinfoChg 1 ALL AXIS FORMAT MAP
DefinePlot 1 1 -1 -1
PlotOutlines 1 [list "" 1.0 "" 1.0] [list NONE NONE BOTH BOTH]  

# DRAW the same mapline in red

LineStyle 2
PlotColor HOLD $GphInfo(Red) OFF
MapLine 1 -75. -80. 75.0 80.0 90

# DRAW another mapline in cyan

PlotColor HOLD $GphInfo(Green) OFF
MapLine 1 -180. -20. 180.0 20.0 90

# DRAW the same line as a line in yellow

PlotColor HOLD $GphInfo(Yellow) OFF
Line 1 -180. -20. 0.0 180.0 20.0 0.0

      
Feb 22, 2007