WinClip TCL UTILITIES USER MANUAL WinClip
SYNOPSIS
Turns on an off clipping in a graphics window
PACKAGE
TCLGPH
NAME
WinClip
USAGE
WinClip  wnID CmD
INPUT DEFINITIONS
wnID - The id of the window where clipping is to be activated or deactivated.
CmD - The clipping command. This must be one of:
0 or OFF - Clipping is turned off
1 or ON - Clipping occurs on the window boundary.
2 or AT - Clipping occurs at the window boundary (one pixel before the actual boundary).
RETURN DEFINITION
NONE
DESCRIPTION
WinClip turns on and off clipping within the window wnID. When CmD is set of OFF lines can extend beyond the window limits, but not outside of the canvas. With CmD set to ON, all lines are clipped at the window boundary. With CmD set to AT, all lines are clipped one pixel inside the window boundary.
ERRORS
None Generated
C BACKING
No
EXAMPLE(S)
EXAMPLE 1:Examples of clipping usage. Red lines and box are drawn with clipping set to OFF, yellow lines and box are drawn with clipping set to ON, and green lines and box are drawn with clipping set to AT.
# 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.2 0.2 0.0 0.8 0.8 0.0 -6.0 -6.0 0.0 6.0 6.0 0.0

# OUTLINE the window in purple

PlotColor HOLD $GphInfo(Purple) OFF
Box 0 -6.0 -6.0 0.0 6.0 6.0 0.0 

# RED Line and box with clipping off

PlotColor HOLD $GphInfo(Red) OFF
Line 0 -7.0 0.0 0.0 7.0 0.0 0.0 
Box  0  3.0 3.0 0.0 7.0 7.0 0.0 

# GREEN line and box clipping 1 pixel inside the window boundary.  Lines
#   extend up to but not on the purple boundary.

WinClip 0 AT
PlotColor HOLD $GphInfo(Green) OFF
Line 0 -7.0 1.0 0.0 7.0 1.0 0.0 
Box  0  -3.0 -3.0 0.0 -7.0 -7.0 0.0 

# Yellow line and box clipping at the window boundary.  Lines extend onto 
#   the purple boundary but don't cross it.

WinClip 0 ON
PlotColor HOLD $GphInfo(Yellow) OFF
Line 0 -7.0 -1.0 0.0 7.0 -1.0 0.0 
Box  0  3.0 -3.0 0.0 7.0 -7.0 0.0 
      
Feb 27, 2007