RelWindow TCL UTILITIES USER MANUAL RelWindow
SYNOPSIS
Open a general graphics window within a graphics window
PACKAGE
TCLGPH
NAME
RelWindow
USAGE
RelWindow  wnID rwnID rX1 rY1 rZ1 rX2 rY2 rZ2 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.
rX1 - The position of the lower X edge of the window. If the global variable WinInfo(wnID,corFmt) is 0 (its default value) this 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 .
rY1 - The position of the left Y edge of the window. If the global variable WinInfo(wnID,corFmt) is 0 (its default value) this is measured from the parent window absolute scaling (0.0 to 1.0 bottom to top) otherwise if set to 1 its measured from the relative window scaling .
rZ1 - The position of the nearer Z edge of the window. If the global variable WinInfo(wnID,corFmt) is 0 (its default value) this is measured from the parent window absolute scaling otherwise if set to 1 its measured from the relative window scaling . This is ignored in the TK driver but possibly not in the VTK driver.
rX2 - The position of the upper X edge of the window. If the global variable WinInfo(wnID,corFmt) is 0 (its default value) this 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 .
rY1 - The position of the right Y edge of the window on the graphics canvas. The graphics canvas runs the window. If the global variable WinInfo(wnID,corFmt) is 0 (its default value) this is measured from the parent window absolute scaling (0.0 to 1.0 bottom to top) otherwise if set to 1 its measured from the relative window scaling .
rZ1 - The position of the deeper Z edge of the window. If the global variable WinInfo(wnID,corFmt) is 0 (its default value) this is measured from the parent window absolute scaling otherwise if set to 1 its measured from the relative window scaling . This is ignored in the TK driver but possibly not in the VTK driver.
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
RelWindow opens a rectangular graphics window within an already opened window. The window is bounded by the lower left-hand and upper right-hand corners (rX1, rY1, rZ1) and (rX2, rY2, rZ2) respectively. The coordinates are interpreted according to the setting of the global variable WinInfo(wnID,corFmt) whose default setting is 0. In its default setting the corner positions are measured from the absolute window coordinates of the parent window which run from 0.0 to 1.0 left to right and top to bottom. When the WinInfo(wnID,corFmt) is set to 1 the corner positions are measured from the relative scaling axis scaling of the parent window.
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. RelWindow 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.
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:Examples of 2 relative windows, one positioned acording to the parent window absolute axes scaling and one according to the parent window relative axes scaling.
# 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 but don't create a canvas

GraphicsOn TK ETones SWAP 

# SET the line color to red

PlotColor HOLD $GphInfo(Red) OFF

# OPEN a graphics window and outline it

GenWindow 0 .15 .15 0.0 .85 .85 0.0 0.0 0.0 0.0 10.0 10.0 0.0 
Box 0 0.0 0.0 0.0 10.0 10.0 0.0

# CHANGE the line color to green

PlotColor HOLD $GphInfo(Green) OFF

# OPEN a relative graphics window in window 0 and outline it. The window
#   position is determined using the abs0lute axis scaling in window 0

RelWindow 1 0 .25 .25 0.0 .75 .75 0.0 0.0 0.0 0.0 1.0 1.0 0.0 
Box 1 0.0 0.0 0.0 1.0 1.0 0.0

# SET corFmt so that window two uses the relative axis scaling in its
#   parent window to determine its position

set WinInfo(2,corFmt) 1

# CHANGE the line color to cyan

PlotColor HOLD $GphInfo(Cyan) OFF

# OPEN a relative graphics window in window 0 and outline it. The window
#   position is determined using the relative axis scaling in window 0

RelWindow 2 0 5.0 5.0 0.0 9.0 9.0 0.0 0.0 0.0 0.0 1.0 1.0 0.0 
Box 2 0.0 0.0 0.0 1.0 1.0 0.0
      
Feb 22, 2007