Design: 04.01.01/P02
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 2: Appearance of polylines
CHARACTERISTICS: ynny
OPERATOR SCRIPT:
DEGENERATE POLYLINES: Some of the 6 labelled squares contain
a single point polyline, others contain a visible primitive
(including a single dot polylmarker). Identify all the squares
in which no primitive is visible.
TWO-POINT POLYLINES: All the squares should contain a single line
segment. All but one should have their endpoints accurately
circled by a polymarker. Identify the line segment which is not
accurately marked.
MULTI-POINT POLYLINES: All the squares should contain a pentagon
with one side missing. Identify the pentagon whose missing side
is different from that of the others.
GEOMETRY OF 3D POLYLINES: All the squares should contain a
polyline with multiple line segments. All but one should have
their vertices accurately circled by a polymarker. Identify the
polyline which is not accurately marked.
GEOMETRY OF 2D POLYLINES: Same as GEOMETRY OF 3D POLYLINES,
above.
DESIGN:
set polymarker scale factor to reasonable size = 0.02 in WC
Divide screen up into 6 square labelled areas for all tests
sider = list of 6 sides from which cube may be viewed =
front,back,left,right,top,bottom
TEST: #SR 1 4 7
"A <polyline> or <polyline 3> primitive with fewer than two
points should have no visual effect."
ran6 = random order for 1-6
numemp = number of empty squares = random from 2 to 4
for ix = 1 to 6
this = ran6(ix)
if (this > numemp+1) then
draw a single dot polymarker in area #ix
elseif (this = numemp+1) then
draw a single cross polymarker in area #ix
elseif (this = numemp) then
draw a single point 2D polyline in area #ix
else
draw a single point 3D polyline in area #ix
endif
next ix
OPQA/DEGENERATE POLYLINES: List all the empty squares (caution:
some squares may contain a dot-polymarker).
pass/fail depending on:
(operator identifies the squares with single point polylines)
TEST: #SR 1 4 7
"A <polyline> or <polyline 3> primitive with two points
should be rendered as a single straight line segment
connecting those points."
ngsq = no-good square = random integer from 1 to 6
for ix = 1 to 6
rotate to view from sider(ix)
if (ix <= 2) then
draw two-point 2D polyline in square #ix (OK viewed from
front or back only)
else
draw two-point 3D polyline in square #ix
endif
if (ix = ngsq) then
use 2D circle polymarker to mark expected vertices inaccurately
else
use 2D circle polymarker to mark expected vertices correctly
endif
next ix
OPQA/TWO-POINT POLYLINES: Which square contains something other
than a single line segment with circled endpoints?
pass/fail depending on: (operator identifies square #ngsq)
TEST: #SR 1 4 7
"A <polyline> or <polyline 3> primitive with a list of more
than two points should be rendered by connecting each pair
of adjacent points by a single straight line segment."
opensd = side of pentagon to leave open = random from 1 to 5
ran6 = random order for 1-6
for ix = 1 to 6
this = ran6(ix)
if (this <= 2) then
draw 2D pentagon with open side = opensd, using one
polyline for each segment
elseif (this <= 5) then
draw 3D pentagon with open side = opensd, using one
polyline for whole figure
else
draw 2D pentagon with open side not= opensd
endif
next ix
OPQA/MULTI-POINT POLYLINES: Which pentagon is open on a different side?
pass/fail depending on:
(operator identifies square with open side not= opensd)
TEST: #SR 1 4 7
"The appearance of a <polyline 3> primitive should reflect
its 3D geometry after being transformed."
ngsq = no-good square = random integer from 1 to 6
generate 3D list of points, visually distinct from any side for
3D polyline
for ix = 1 to 6
rotate to view from sider(ix)
display the 3D polyline in square #ix
calculate expected position of vertices
if (ix = ngsq) then
distort expected vertices
endif
use 2D circle polymarker to mark expected vertices
next ix
OPQA/GEOMETRY OF 3D POLYLINES: Which polyline does NOT have
all its vertices circled?
pass/fail depending on:
(operator identifies square #ngsq)
TEST: #SR 1 4 7
"The appearance of a <polyline> primitive should reflect
its 2D geometry after being transformed."
ngsq = no-good square = random integer from 1 to 6
generate non-linear 2D list of points distinct from any side for
2D polyline
for ix = 1 to 6
rotate 45 degrees around x and y axis into unit cube to show
z-values
rotate to view from sider(ix)
display the 2D polyline in square #ix
calculate expected position of vertices
if (ix = ngsq) then
distort expected vertices
endif
use 2D circle polymarker to mark expected vertices
next ix
OPQA/GEOMETRY OF 2D POLYLINES: Which polyline does NOT have
all its vertices circled?
pass/fail depending on:
(operator identifies square #ngsq)
END PROGRAM 2