Region scissoring is controlled by the BSC parameter of the routine RGPRM (*2.5).The user can define a NULL file (a file containing only NULL routines) (*7.6) and interpret it as containing (X,Y) pairs of points defining a closed boundary.
If BSC = 3.0, the arguments of RGLIM are interpreted as:
XMINfile name YMINfile number XMAX,YMAX ignored
and any line is cut into many sections by the boundary defined in the file.For example:
Z = ANAME('FRED') STDF (Z) NULL (2.0) NULL (4.0) NULL (6.0) NULL (4.0) NULL (6.0) NULL (8.0) FIDF (1.0)
defines a NULL file.
RGLIM (3.0,Z,1.0,0.0,0.0) RGPRM (3.0,0.0,3.0,1.0,0.0,0.0)
defines region 3 as a triangular region whose boundary is defined in file FRED. Lines drawn in region 3 would be scissored by the triangle such that only the parts of the lines inside would be visible. The maximum number of (X,Y) pairs is 50 - ie, only 100 NULL commands in the file.
Note that any conversion specified in this region is likely to make use of the XMIN,YMIN,XMAX,YMAX values. Care is therefore required and it may be preferable not to specify a conversion for such a region (see later).
The user can specify his own scissoring routines. If BSC has a value greater than or equal to 10.0, lines will be scissored by:
NWCLPL (Xs,YS,JV,NOVEC,R) and NWCLPP (X,Y,IV,R)
Both these routines are provided as dummies and can be replaced by the user to set his own visibility. The arguments are as follows:
line segment 1 is XS(1),YS(1) to XS(2),YS(2) with visibility JV(1) line segment 2 is XS(2),YS(2) to XS(3),YS(3) with visibility JV(2) line segment 3 is XS(3),YS(3) to XS(4),YS(4) with visibility JV(3) line segment 4 is XS(4),YS(4) to XS(5),YS(5) with visibility JV(4) line segment 5 is XS(5),YS(5) to XS(6),YS(6) with visibility JV(5) with NOVEC = 5
R(1) region number 2 XM1N RGLIM settings 3 YMIN 4 XMAX 5 YMAX 6 next region in chain RGPLIM settings 7 XPMIN 8 YPMIN 9 XPMAX 10 YPMAX 11 CNV conversion type RGPRM settings 12 BSC scissor type 13 XMI internal visibility 14 XMO external visibility 15 SWOUTP device selection for this region 16 XCNV X,Y conversion factors used in 17 YCNV standard conversion routines
The following additional values of CNV (RGPRM argument) have been defined (*2.3):
CNV = 3.0 No conversion required CNV = 4.0 X log conversion Y linear conversion CNV = 5.0 X linear conversion Y log conversion CNV = 6.0 X,Y log conversion CNV = 7.0 Shear conversion
The linear conversion formula is as defined in the manual. The log conversion formula is:
X' = XPMIN + (ALOG (X/MIN) * (XPMAX-XPMIN)) / ALOG(XMAX/XMIN)
where ALOG is the log function, XPMAX,XPMIN are arguments in RGPLIM and XMAX,XMIN are arguments in RGLIM.
The shear conversion formula is:
X' = X + (Y-YPMIN)*TAN(YPMAX) Y' = Y + (X-XPMIN)*TAN(XPMAX)
Use of a shear region with software characters can give an approximate italic effect.
The user can specify his own conversion. If CNV has a value greater than or equal to 10.0, coordinates will be converted by:
NWCNV(X,Y,R)
where X,Y is the point to be converted, and R(17) defines the region parameters, as specified under user-defined scissoring. The user can replace the system version by his own. The current system version gives no conversion.
Region scissoring and conversion is quite expensive and should only be specified when really necessary. It is possible to avoid any conversion by:
CNV = 3.0
(RGPRM argument, *2.3), which would be useful if a region is only being used to scissor lines. Scissoring can be suppressed by setting both the visibility parameters XMI, XMO (RGPRM arguments, *2.5) to 1.0. Thus:
RGPRM(3.0,3.0,0.0,1.0,1.0,0.0)
would effectively make region 3 useless! Therefore, either scissoring or conversion, but not both, may be suppressed. Scissoring can be suppressed if the user is confident that the whole picture is within the region.
(RGLIM routine)
The regions are given the limits:
(R,0.0,0.0,1023.0,1023.0)
except for regions 0, 1 and 2 which are:
(R,0.0,0.0,16383.0,16383.0) (R,0.0,0.0,119.0,119.0) (R,0.0,0.0,1023.0,779.0)
These are the FR80, lineprinter, graphical, and Tektronix co-ordinate systems respectively.
(RGPRM routine)
Most regions are given the following parameters:
(R,0.0,0.0,1.0,1.0,0.0)
that is, standard conversion, standard shape (rectangular), current line visibility inside and outside the region is preserved, no devices are using this region as their basic output region.
Regions 0, 1 and 2 have SWOUTP set to 35, 8 and 64 respectively, that is, Region 0 is the basic output region for the FR80, Region 1 is set as the basic output region for lineprinter graphical output and Region 2 for Tektronix output. Line visibility outside these 3 regions is switched off.
These defaults can be overridden by subsequent calls of RGPRM, BASE, VISOR, etc.
(RGPLIM and REGION routines)
No regions are chained together initially. Region zero is selected as the current region.
Note: Users are advised to use the routines described in section 2.2 of the SPROGS Supplement and section 4.1 of FR80 User Note 6 to replace the use of STSPR and DVOUT.