RelSqWindow TCL UTILITIES USER MANUAL RelSqWindow
SYNOPSIS
Open a square graphics window within an graphics window
PACKAGE
TCLGPH
NAME
RelSqWindow
USAGE
RelSqWindow  wnID rwnID rX rY rZ rL sX1 sY1 sZ1 sX2 sY2 sZ2 {Pix}
INPUT DEFINITIONS
wnID - The window iD.
rwnID - The iD of the window that the new window is being created in.
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. In addition if the global variable WinInfo(wnID,corFmt) is 0 (its default value) this postion is measured from the parent window absolute scaling (0.0 to 1.0 left to right) otherwise if set to 1 its measured from the relative window scaling .
rY - Depending on the setting of the global variable WinInfo(wnID,posFmt) this is either the center Y position of the window or the upper or lower Y edge. Refer to the table in the DISCUSSION section below. In addition if the global variable WinInfo(wnID,corFmt) is 0 (its default value) this postion is measured from the parent window absolute scaling (0.0 to 1.0 left to right) otherwise if set to 1 its measured from the relative window scaling .
rZ - Depending on the setting of the global variable WinInfo(wnID,posFmt) this is either the center Y position of the window or the upper or lower Y edge. Refer to the table in the DISCUSSION section below. In addition if the global variable WinInfo(wnID,corFmt) is 0 (its default value) this postion is measured from the parent window absolute scaling (0.0 to 1.0 near to far) otherwise if set to 1 its measured from the relative window scaling. 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. If the global variable WinInfo(wnID,corFmt) is 0 (its default value) the length postion is measured against the parent window absolute scaling (0.0 to 1.0 left to right, top to botton) otherwise if set to 1 its measured from the relative window scaling.
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
RelSqWindow opens a square graphics window within an already opened window. The window will be square even if the parent window is retangular. The input postion coordinates (rX, rY, rZ) and length rL are measured from either the parent window absolute axis scaling or the window relative axis scaling depending on whether the global variable WinInfo(wnID,corFmt) is set to 0 or 1 respectively. The default value for WinInfo(wnID,corFmt) is 0 and the windows absolute axis scaling is from 0 to 1 left to right and bottom to top.
The positioning of the window within the parent 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. RelSqWindow 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

GenWindow  9 0.0 0.0 0.0 1.0 1.0 0.0 -5.0 -5.0 0.0 5.0 5.0 0.0 

# ESTABLISH 3 graphics windows using the parent absolute axis for
#   scaling.  The windows are created using different positioning
#   formats.

set WinInfo(0,posFmt) 3
RelSqWindow  0 9 0.2 0.2 0.0 0.3 -8. -8. 0. 8.0 8. 0.
set WinInfo(1,posFmt) 0
RelSqWindow  1 9 0.4 0.3 0.0 0.2 -8. -8. 0. 8.0 8. 0.
set WinInfo(2,posFmt) 4
RelSqWindow  2 9 0.94 0.4 0.0 0.3 -8. -8. 0. 8.0 8. 0.

# Fill the 3 windows.

PlotColor HOLD $GphInfo(White) $GphInfo(White)
Box 0 -8.0 -8.0 0.0 8.0 8.0 0.0
PlotColor HOLD $GphInfo(Red) $GphInfo(Red)
Box 1 -8.0 -8.0 0.0 8.0 8.0 0.0
PlotColor HOLD $GphInfo(Green) $GphInfo(Green)
Box 2 -8.0 -8.0 0.0 8.0 8.0 0.0

# ESTABLISH 3 graphics windows using the parent relative axis for
#   scaling.  The windows are created using different positioning
#   formats.

set WinInfo(3,posFmt) 2
set WinInfo(3,corFmt) 1
RelSqWindow  3 9 -4.0 3.0 0.0 1.0 -8. -8. 0. 8.0 8. 0.
set WinInfo(4,posFmt) 1
set WinInfo(4,corFmt) 1
RelSqWindow  4 9 2.0 1.0 0.0 3.0 -8. -8. 0. 8.0 8. 0.
set WinInfo(5,posFmt) 4
set WinInfo(5,corFmt) 1
RelSqWindow  5 9 0.0 3.0 0.0 2.0 -8. -8. 0. 8.0 8. 0.

# Outline the 3 windows.

PlotColor HOLD $GphInfo(Cyan) OFF
Box 3 -8.0 -8.0 0.0 8.0 8.0 0.0
PlotColor HOLD $GphInfo(Blue) OFF
Box 4 -8.0 -8.0 0.0 8.0 8.0 0.0
PlotColor HOLD $GphInfo(Purple) OFF
Box 5 -8.0 -8.0 0.0 8.0 8.0 0.0
      
Feb 22, 2007