LineStyle TCL UTILITIES USER MANUAL LineStyle
SYNOPSIS
Set current line characteristics
PACKAGE
TCLGPH
NAME
LineStyle
USAGE
LineStyle  { Width } { aEnds } { aShape } { Style }
INPUT DEFINITIONS
In addition to the above hard coded patterns, lsytle may also contain a user defined line style.
Width - An optional input which specifies the line width in pixels. Default is 0 which will produce the minimum line width.
lStyle - An optional input which specifies the current line style. This can also set in the PlotColor procedure. The default value is SOLID. The recognized inputs are:
SOLID - Solid line
DASH1 - Short dashes, short gaps
DASH2 - Medium short dashes, short gaps
DASH3 - Medium long dashes, short gaps
DASH4 - Long dashes, short gaps
SPDASH1 - Short dashes, medium gaps
SPDASH2 - Medium short dashes, medium gaps
SPDASH3 - Medium long dashes, medium gaps
SPDASH4 - Long dashes, medium gaps
DASHDOT1 - Medium short dash, dot; short gaps
DASHDOT2 - Medium long dash, dot; short gaps
DASHDOT3 - Long dash, dot; short gaps
DASH2DOT1 - Medium short dash, dot, dot; short gaps
DASH2DOT2 - Medium long dash, dot, dot; short gaps
DASH2DOT3 - Long dash, dot, dot; short gaps
DASHSPDOT1 - Medium short dash, dot; medium gaps
DASHSPDOT2 - Medium long dash, dot; medium gaps
DASHSPDOT3 - Long dash, dot; medium gaps
HOLD - Hold on to current line pattern.
aEnds - An optional input which specifies if and where arrows should be added to the line ends. The default value is "" which is the same as none but results without the specification being added to the line command. The input must be either none, first, last or both for no arrows on the lines, arrow on the leading point point of the line, arrow on the ending point of the line or arrows on both points of the line repectively.
aShape - An optional input which is used only when aEnds is not none> or "". The input specifies how the arrow is to be formed. The default is "" which used the generic settings in Tk. To set the characteristics yourself the input must be "{o l w}" where l is the arrow length, w the arrow witdh, and o is the overlap distance of the arrow and the line. All values are in pixels.
RETURN DEFINITION
NONE
DESCRIPTION
LineStyle sets the current line characteristics. This includes the line thinckness, the linestyle, and whether the lines should be terminated at one or both ends with arrows. Invoking LineStyle with no inputs will set the default linestyle; solid lines, minimum width, and no arrows.
There are several available line styles which can be used or you you can create your own. This is done by passing in a string of the form "{???}" where ??? is a series of characters made up from [. , - _ sp] (where sp is a space). In the series . represents a dot or small dash, , is a medium small dash, - is a medium large dash, _ is a large dash, and space is a space. The line style made up of the sequence "{_..}" is series of long dashes followed by two dots.
lColor is the current line color. With the exception of text, all output will be drawn with this color. The color is given as a value between 0 and 255 which is an offset into the color look up table. The elements White, Red, Yellow, Green, Cyan, Blue, Purple, and Black in the global variable can be used to specify colors. The names however are specific to the RainBow color table. With the exception of Black and White using them with other color tables may give colors which do not match the names.
Arrow heads may be put on either or both ends of a line or line segment. The arrow heads can have witdth, length, and position on the end of the line specified through aShape
ERRORS
None Generated
C BACKING
No
EXAMPLE(S)
EXAMPLE 1: Show line styles and examples of filled polygons.
# 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

# SET the text size to 10

TextProp 10 HOLD HOLD

# Line color to white

PlotColor HOLD $GphInfo(White) HOLD

# OUTPUT lines of different line styles and thicknesses and label them

LineStyle 1 DASH1
Line 0  -6.0 5.0 0.0 2.5 5.0 0.0
TexT 0 3.0 5.0 0.0 right DASH1 $GphInfo(White) 

LineStyle 1 DASH2
Line 0  -6.0 4.5 0.0 2.5 4.5 0.0
TexT 0 3.0 4.5 0.0 right DASH2 $GphInfo(White) 

LineStyle 1 DASH1
Line 0  -6.0 4.0 0.0 2.5 4.0 0.0
TexT 0 3.0 4.0 0.0 right DASH3 $GphInfo(White) 

LineStyle 1 DASH4 
Line 0  -6.0 3.5 0.0 2.5 3.5 0.0
TexT 0 3.0 3.5 0.0 right DASH4 $GphInfo(White) 

LineStyle 2 SPDASH1
Line 0  -6.0 3.0 0.0 2.5 3.0 0.0
TexT 0 3.0 3.0 0.0 right SPDASH1 $GphInfo(Red) 

LineStyle 2 SPDASH2
Line 0  -6.0 2.5 0.0 2.5 2.5 0.0
TexT 0 3.0 2.5 0.0 right SPDASH2 $GphInfo(Red) 

LineStyle 2 SPDASH3
Line 0  -6.0 2.0 0.0 2.5 2.0 0.0
TexT 0 3.0 2.0 0.0 right SPDASH3 $GphInfo(Red) 

LineStyle 2 SPDASH4 
Line 0  -6.0 1.5 0.0 2.5 1.5 0.0
TexT 0 3.0 1.5 0.0 right SPDASH4 $GphInfo(Red) 

LineStyle 3 DASHDOT1
Line 0  -6.0 1.0 0.0 2.5 1.0 0.0
TexT 0 3.0 1.0 0.0 right DASHDOT1 $GphInfo(Green) 

LineStyle 3 DASHDOT2
Line 0  -6.0 0.5 0.0 2.5 0.5 0.0
TexT 0 3.0 0.5 0.0 right DASHDOT2 $GphInfo(Green) 

LineStyle 3 DASHDOT3
Line 0  -6.0 0.0 0.0 2.5 0.0 0.0
TexT 0 3.0 0.0 0.0 right DASHDOT3 $GphInfo(Green) 

LineStyle 4 DASH2DOT1
Line 0  -6.0 -0.5 0.0 2.5 -0.5 0.0
TexT 0 3.0 -0.5 0.0 right DASH2DOT1 $GphInfo(Cyan) 

LineStyle 4 DASH2DOT2
Line 0  -6.0 -1.0 0.0 2.5 -1.0 0.0
TexT 0 3.0 -1.0 0.0 right DASH2DOT2 $GphInfo(Cyan) 

LineStyle 4 DASH2DOT3
Line 0  -6.0 -1.5 0.0 2.5 -1.5 0.0
TexT 0 3.0 -1.5 0.0 right DASH2DOT3 $GphInfo(Cyan) 

LineStyle 5 DASHSPDOT1
Line 0  -6.0 -2.0 0.0 2.5 -2.0 0.0
TexT 0 3.0 -2.0 0.0 right DASHSPDOT1 $GphInfo(Blue) 

LineStyle 5 DASHSPDOT2
Line 0  -6.0 -2.5 0.0 2.5 -2.5 0.0
TexT 0 3.0 -2.5 0.0 right DASHSPDOT2 $GphInfo(Blue) 

LineStyle 5 DASHSPDOT3
Line 0  -6.0 -3.0 0.0 2.5 -3.0 0.0
TexT 0 3.0 -3.0 0.0 right DASHSPDOT3 $GphInfo(Blue) 

LineStyle 6 "{_....}"
Line 0  -6.0 -3.5 0.0 2.5 -3.5 0.0
TexT 0 3.0 -3.5 0.0 right "USER DEFINED" $GphInfo(Yellow) 

# DRAW some lines with arrows in yellow 

PlotColor HOLD $GphInfo(Yellow) OFF

LineStyle 1 SOLID both
Line 0  -5.0 -4.5 0.0 -1.0 -4.5 0.0

LineStyle 1 HOLD first
Line 0  -5.0 -5.0 0.0 -1.0 -5.0 0.0

LineStyle 1 HOLD last 
Line 0  -5.0 -5.5 0.0 -1.0 -5.5 0.0

LineStyle 1 SOLID both "{3 10 8}"
Line 0  1.0 -4.5 0.0 5.0 -4.5 0.0

LineStyle 1 HOLD first "{8 18 4}"
Line 0  1.0 -5.0 0.0 5.0 -5.0 0.0

LineStyle 1 HOLD last "{20 14 4}"
Line 0  1.0 -5.5 0.0 5.0 -5.5 0.0
      
Feb 15, 2007