SqWindow TCL UTILITIES USER MANUAL SqWindow
SYNOPSIS
Open a square graphics window
PACKAGE
TCLGPH
NAME
SqWindow
USAGE
SqWindow  wnID rX rY rZ rL sX1 sY1 sZ1 sX2 sY2 sZ2 {Pix}
INPUT DEFINITIONS
wnID - The window iD.
rX - Depending on the setting of the global variable WinInfo(wnID,posFmt) this is either the center X position of the window or the upper or lower X edge. Refer to the table in the DISCUSSION section below. Note for setting purposes the graphics canvas runs from 0.0 to 1.0 in X.
rY - Depending on the setting of the global variable WinInfo(wnID,posFmt) this is either the center Y position of the window or the left or right Y edge. Refer to the table in the DISCUSSION section below. Note for setting purposes the graphics canvas runs from 0.0 to 1.0 in Y.
rZ - Depending on the setting of the global variable WinInfo(wnID,posFmt) this is either the center Z position of the window or the nearer or deeper Z edge. Refer to the table in the DISCUSSION section below. This value is ignored in the TK driver but possibly not in the VTK driver.
rL - The length of the window edge. Depending on the setting of the global variable WinInfo(wnID,posFmt) this can be measured either along the canvas X or Y axis.
sX1 - The value associated with the lower edge of the window.
sY1 - The value associated with the left edge of the window.
sZ1 - The value associated with the nearer edge of the window. This value is ignored in the TK driver but may not be in the VTK driver.
sX2 - The value associated with the upper edge of the window.
sY2 - The value associated with the right edge of the window.
sZ2 - The value associated with the deeper edge of the window. This value is ignored in the TK driver but may not be in the VTK driver.
Pix - Optional input variable which allows the window edges to be scaled from 0 to the number of screen pixels across the window. The default value is N which keeps the scaling set to the user selected values. To scale either the X or the Y axis alone in pixels set Pix to X or Y respectively. To scale both set Pix to XY.
RETURN DEFINITION
NONE
DESCRIPTION
SqWindow opens a graphics window on the current canvas. The position of the window depends on the setting of the global variable WinInfo(wnID,posFmt). The settings and their effects are summerized in the table below.
WinInfo(wnID,posFmt)
Setting rX, rY, rZ rL
0 Lower left-hand corner of the window. Length is measured along the X axis of the canvas.
1 Lower left-hand corner of the window. Length is measured along the Y axis of the canvas.
2 Center of the window. Window extends a distance rL/2.0 on either side of the center. Length is measured along the Y axis of the canvas.
Scaling limits along the X and Y window axes are specified by (sX1, sY1, sZ1) and (sX2, sY2, sZ2). The scaling is defaulted to being LINEAR within the open procedure which can be later changed to LOG through the SetAxis procedure.
The window actually has two pair of X and Y axes. The bottom X and left Y window axis are designated the PRIMARY window axes and the top X and right Y are designated the SECONDARY window axes. SqWindow assigns both sets of axes the same limits. These can be changed (both the limits and the scaling) independently through SetAxis.
Graphics plotted in the window will be output against the currently active axes. This is defaulted to the PRIMARY axis when the window is opened but can be changed through the routine ActiveAxes to be any pair of the X,Y axes.
There is an internal check to make sure that the window does not exceed the canvas. When this occurs the window length is shortened to make it it fit.
In an environment where there are multiple canvas's open, the graphics window is only correctly scaled on the canvas under which it was open. It will also be correctly scaled on all other canvas's which have the same pixel dimensions as the canvas under which it was created.
ERRORS
None Generated
C BACKING
No
EXAMPLE(S)
EXAMPLE 1:Establish 6 graphics windows on a canvas and outline them. The windows illustrate the six WinInfo(wnID,posFmt) possibilities.
# 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 SWAP

# ESTABLISH 6 graphics windows on the canvas, one rectangular and
#   two square windows

set WinInfo(0,posFmt) 0
SqWindow  0 0.5 0.5 0.0 0.3 -8. 0. 0. 8.0 8. 0.
set WinInfo(1,posFmt) 1
SqWindow  1 0.5 0.5 0.0 0.3 -8. 0. 0. 8.0 8. 0.
set WinInfo(2,posFmt) 2
SqWindow  2 0.5 0.5 0.0 0.3 -8. 0. 0. 8.0 8. 0.
set WinInfo(3,posFmt) 3
SqWindow  3 0.5 0.5 0.0 0.3 -8. 0. 0. 8.0 8. 0.
set WinInfo(4,posFmt) 4
SqWindow  4 0.5 0.5 0.0 0.3 -8. 0. 0. 8.0 8. 0.
set WinInfo(5,posFmt) 5
SqWindow  5 0.5 0.5 0.0 0.3 -8. 0. 0. 8.0 8. 0.

# OUTLINE the graphics windows in different colors.

PlotColor HOLD $GphInfo(White) HOLD
Box 0 -8.0 0.0 0.0 8.0 8.0 0.0
PlotColor HOLD $GphInfo(Red) HOLD
Box 1 -8.0 0.0 0.0 8.0 8.0 0.0
PlotColor HOLD $GphInfo(Green) HOLD
Box 2 -8.0 0.0 0.0 8.0 8.0 0.0
PlotColor HOLD $GphInfo(Cyan) HOLD
Box 3 -8.0 0.0 0.0 8.0 8.0 0.0
PlotColor HOLD $GphInfo(Blue) HOLD
Box 4 -8.0 0.0 0.0 8.0 8.0 0.0
PlotColor HOLD $GphInfo(Purple) HOLD
Box 5 -8.0 0.0 0.0 8.0 8.0 0.0

TexT bW0 0.5 0.5 0.0 center X $GphInfo(White)
      
Feb 22, 2007