Design: 04.02.02.01/P04
This is an abstract, language-independent design. Grim
details may be found in the
corresponding source code.
You may return to the
documentation
for the module containing this program design, or to the
entire hierarchical table of
topics covered by the PVT.
PROGRAM 4: Network inheritance and initialization
CHARACTERISTICS: ynny
OPERATOR SCRIPT:
STRUCTURE NETWORK INHERITANCE FOR MARKER TYPE AND MARKER SIZE: This
screen displays several left-right pairs of polymarkers. Make sure
that all pairs except one have matching marker types and marker sizes.
Identify the non-matching pair.
STRUCTURE NETWORK INHERITANCE FOR POLYMARKER COLOR INDEX: This
screen displays several left-right pairs of polymarkers. Make sure
that all pairs except one have matching colors. For monochrome
workstations, both the background and foreground colors must be
used, and so several markers will be drawn in the background color.
Identify the non-matching pair.
DESIGN:
*** *** *** inheritance for marker type and marker size *** *** ***
from dialog common:
qvis = minimum distinguishable length in DC-units
nolap = scale factor equivalent to .05 in WC
(should not exceed .05 to avoid overlap - distance between lines
will be 1/15 = .06666)
get alternative marker size scale factor values:
altmw1 = min(max scale factor, nolap)
altmw2 = qvis / (nominal marker size)
if default (1.0) is near altmw1 or altmw2, set alternate so as to
maximize the smallest gap among altmw1, altmw2, and 1.0:
avg1 = (altmw1 + 1) / 2
avg2 = (altmw2 + 1) / 2
if (abs(altmw1-1) < abs(avg2-1)) then
altmw1 = avg2
elseif (abs(altmw2-1) < abs(avg1-1)) then
altmw2 = avg1
endif
set up PERM to randomize position of polymarkers
set up CSS:
Structure network #101 draws actual results in random order on
left side of picture. Structure #105 draws expected results in
same random order on right side of picture, except for polymarker
14 which is deliberately drawn with different (i.e. incorrect)
attributes. This should be the only non-matching pair in the picture.
structure #101
polymarker 1 (order within traversal)
execute 102
polymarker 9
change-attributes: marker type=2, marker size=altmw1 (do not use type=1)
polymarker 10
set local transformation to make markers 11,12 distinguishable
from 5,6
execute 104
re-set local transformation to identity
polymarker 13
polymarker 14
execute 105
structure #102
polymarker 2
change-attributes: marker type =5, marker size=altmw2
execute 103
polymarker 8
structure #103
polymarker 3
change-attributes: marker type=4, marker size=altmw1
polymarker 4
execute 104
polymarker 7
structure #104
polymarker 5 / 11
change-attributes: marker type=2, marker size=altmw2
polymarker 6 / 12
Expected attributes (except #14, whose actual marker type should be 2):
structure #105
polymarker markertype markersize-scale
---------- --------- ----------------
01 3 1.0
02 3 1.0
03 5 altmw2
04 4 altmw1
05 4 altmw1
06 2 altmw2
07 4 altmw1
08 5 altmw2
09 3 1.0
10 2 altmw1
11 2 altmw1
12 2 altmw2
13 2 altmw1
14 4 altmw1
TEST: #SR 3 5 6 11 12 14 15 18 19
"The marker type and marker size attributes for the polymarker
primitive should be saved and restored by <execute
structure> during traversal."
OPQA/STRUCTURE NETWORK INHERITANCE FOR MARKER TYPE AND MARKER SIZE:
which pair of markers does NOT match?
pass/fail depending on response = position of polymarker 14
*** *** *** inheritance for polymarker color index *** *** ***
call DISCOL to try to get 5 distinct foreground colors,
returning fcol = actual number of foreground colors
if fcol = 1 (monochrome) then
fcol = 2
colind[0..1] = circular list of indices = [1,0]
else
colind[0..fcol-1] = circular list of indices = [1,..,fcol]
endif
set up PERM to randomize position of polymarkers
cbase = 0
set up CSS:
Structure network #101 draws actual results in random order on
left side of picture. Structure #105 draws expected results in
same random order on right side of picture, except for polymarker
14 which is deliberately drawn with different (i.e. incorrect)
attributes. This should be the only non-matching pair in the picture.
structure #101
set markertype = 3
set markersize = nolap (= .05 in WC)
polymarker 1 (order within traversal)
execute 102
polymarker 9
increment cbase
change-attributes: use colind(cbase mod fcol) for next color index
polymarker 10
set local transformation to make markers 11,12 distinguishable
from 5,6
execute 104
re-set local transformation to identity
polymarker 13
polymarker 14
execute 105
structure #102
polymarker 2
increment cbase
change-attributes: use colind(cbase mod fcol) for next color index
execute 103
polymarker 8
structure #103
polymarker 3
increment cbase
change-attributes: use colind(cbase mod fcol) for next color index
polymarker 4
execute 104
polymarker 7
structure #104
polymarker 5 / 11
increment cbase
change-attributes: use colind(cbase mod fcol) for next color index
polymarker 6 / 12
Expected attributes (except #14, whose actual color should be
same as #13):
color index = colind(cbase mod fcol)
structure #105
polymarker cbase polymarker cbase
---------- ----- ---------- -----
01 0 08 2
02 0 09 0
03 2 10 1
04 3 11 1
05 3 12 4
06 4 13 1
07 3 14 2
TEST: #SR 3 21 22 24 25
"The polymarker color index attribute for the polymarker
primitive should be saved and restored by <execute
structure> during traversal."
OPQA/STRUCTURE NETWORK INHERITANCE FOR POLYMARKER COLOR INDEX:
which pair of markers does NOT match?
pass/fail depending on response = position of polymarker 14
END PROGRAM 4