Design: 04.02.05.03/P12

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 12: Appearance of bundled attributes

CHARACTERISTICS: ynny

OPERATOR SCRIPT:

EDGE FLAG INDICATOR: This screen should display several
rectangles with edges and several without edges.  Identify the
rectangles with visible edges.

STANDARD EDGETYPES: This screen should display examples of each
of the edgetypes actually supported by the implementation. You
should not consider whether the mandatory edgetype (1) is
present, but simply whether each edgetype is recognizable from
the verbal description.  Enter a list of integers which identify
the edgetypes in the same order as they appear in the prompt.

REGISTERED EDGETYPES: This screen displays a sample of supported
registered edgetypes (at most 8).  For each displayed edge, look
up its edgetype identifier in the ISO register and verify that
the actual appearance of the edge agrees with the ISO
specification.

IMPLEMENTOR DEFINED EDGETYPES: This screen displays a sample of
implementor defined edgetypes (at most 8).  For each displayed
edge, look up its edgetype identifier in the implementor's
documentation and verify that the actual appearance of the edge
agrees with the specification.

VARIOUS EDGEWIDTH SCALE FACTORS: Several numbered pairs of
rectangles are drawn.  Compare the edgewidth for each pair. One
pair should have the same width for both members.  Although the
program tries to line up the bottom of the rectangles, there is
no requirement that they be aligned, so judge only according to
width.

POSITIVE EDGEWIDTH BELOW MINIMUM: as above, for VARIOUS EDGEWIDTH
SCALE FACTORS.

NEGATIVE EDGEWIDTH: as above, for VARIOUS EDGEWIDTH SCALE
FACTORS.

POSITIVE EDGEWIDTH ABOVE MAXIMUM: as above, for VARIOUS EDGEWIDTH
SCALE FACTORS.

DEFINED EDGE COLOR INDICES: All the edges of the triangles but
one are drawn in the background color.  Identify the single
triangle with its edges drawn in the default foreground color.

UNDEFINED EDGE COLOR INDICES: A star is drawn with several
rectangles beneath it.  Normally, all of these will have edges
the same color as the star.  Count up and report the number of
rectangles with edges that match the star in color.

DESIGN:

set all ASFs to BUNDLED
set interior style attribute ASFs to INDIVIDUAL
   set interior style = EMPTY, interior color index = 1

use <inquire edge facilities> to determine:
  numet  = number of available edgetypes
  lavset = list of available standard edgetypes
  lavret = list of available registered edgetypes
  laviet = list of available implementor-defined edgetypes
           (may be derived directly from edgetype value, if reported
            number of edgetypes < 0)
  numew  = number of available edge-widths
  nomew  = nominal edge-width (DC)
  minew,maxew = minimum,maximum edge-width (DC)

use <inquire workstation state table lengths> to determine:
   szbt = size of edge bundle table

*** *** ***   edge flag indicator   *** *** ***

filon  = number of areas to be drawn with edge flag ON =
         random number 1 to 8
for ix = 1, 8
   if (ix <= filon) then
      <set edge representation> #ix:
         edgeflag  = ON
         edgetype  = SOLID
         edgewidth = 1.0
         color     = 1
   else
      <set edge representation> #ix:
         edgeflag  = OFF
         edgetype  = SOLID
         edgewidth = 1.0
         color     = 1
   endif
next ix

display in random order bundles 1-8

TEST: #SR 3 4 5 6 30 31
      "The edge of a polygonal area should be visible when the
       edge flag is ON and not visible when the edge flag is
       OFF."

OPQA/EDGE FLAG INDICATOR: which triangles have visible edges?
pass/fail depending on (all displayed areas with visible edges
   correctly identified)

*** *** ***   edgetype   *** *** ***

Use default background color=0, foreground=1

stddx = size of lavset

for ix = 1, stddx
   <set edge representation>:
      index     = ix
      edgeflag  = ON
      edgetype  = ixth entry in lavset
      edgewidth = 1.0
      color     = 1
next ix

Display in random order bundles 1 thru stddx

TEST: #SR 3 4 5 6 38 39
      "The standard edgetypes should be recognizable from
       their standard description."

OPQA/STANDARD EDGETYPES: List, in order, the numeric labels for
  edgetypes: solid, dotted, dashed, dotted-dashed.

pass/fail depending on (all displayed edgetypes correctly identified)

regdx = size of lavret
if regdx < 1 skip to neg_type

numdis = min(regdx, 8, szbt)
lindis = numdis entries, randomly chosen from lavret

for ix = 1, numdis
   <set edge representation>:
      index     = ix
      edgeflag  = ON
      edgetype  = ixth entry in lindis
      edgewidth = 1.0
      color     = 1
next ix

display in order and label bundles 1 thru numdis

TEST: #SR 3 4 5 6 38 40
      "The registered edgetypes (> 4) should agree
       with their registered description."

OPQA/REGISTERED EDGETYPES: Is each edgetype
  depicted according to its numeric identifier's specification in
  the ISO register?
pass/fail depending on (operator responds "yes")

neg_type:

impdx = size of laviet
if impdx < 1 goto end_edgetype

numdis = min(impdx, 8, szbt)
lindis = numdis entries, randomly chosen from laviet

for ix = 1, numdis
   <set edge representation>:
      index     = ix
      edgeflag  = ON
      edgetype  = ixth entry in lindis
      edgewidth = 1.0
      color     = 1
next ix

display in order and label bundles 1 thru numdis

TEST: #SR 3 4 5 6 38 41
      "Implementor-defined edgetypes (< 1) should agree with the
       descriptions supplied by the implementor."

OPQA/IMPLEMENTOR DEFINED EDGETYPES: Is each edgetype depicted
  according to its numeric identifier's specification in the
  implementor documentation?
pass/fail depending on (operator responds "yes")

end_edgetype:

*** *** ***   edge-width   *** *** ***

from dialog common:
  wcpdc  = WC unit / DC unit
  qvis   = minimum distinguishable length in DC-units

Are there at least two visually distinguishable edge-widths?
if (numew = 1)              or
   (maxew <= 1.02 * minew)  or
   (maxew-minew < qvis)    then
   only one distinguishable:
   tstew1 = first edgewidth to be tested = maxew
   tstew2 =  last edgewidth to be tested = tstew1
   mult = 2
else
   tstew1 = first edgewidth to be tested = minew
   tstew2 =  last edgewidth to be tested = maxew
   if (numew = 0) then
      continuous range of edgewidths available - take 4 geometric steps
      mult = 0.9999 * ((tstew2/tstew1) ** 0.25)
   else
      discrete set of edgewidths available - test min/max only
      mult = 0.9999 * (tstew2/tstew1)
   endif
endif

numpas = 0 = number of tests passed so far
thisew = tstew1

loop thru various edgewidths
next_ew:
OPQA/VARIOUS EDGEWIDTH SCALE FACTORS: invoke SHEDBW subroutine to
  test bundle with requested edge width = thisew
                    expected edge width = thisew
if abort indicated
   if (numpas < 2) then
      message about edgewidth too big for the screen
      goto min_max_coerce
   else
      goto do_test_msg
   endif
elseif failure indicated
   numpas = 0
   goto do_test_msg
endif

numpas = numpas+1
set up for next edgewidth to be tested:
thisew = thisew * mult
if thisew <= tstew2 goto next_ew

do_test_msg:

TEST: #SR 3 4 5 6 45 46 47
      "Available edgewidth scale factors should control the
       realized thickness of a edge."
pass/fail depending on (numpas > 0)

min_max_coerce:

TEST: #SR 3 4 5 6 45 46 48
      "A requested positive edgewidth scale factor below the
       minimum available should be realized as the minimum."
OPQA/POSITIVE EDGEWIDTH BELOW MINIMUM: invoke subroutine SHEDBW
  to test bundle with requested edge width = minew/2
                       expected edge width = minew
pass/fail depending on return code from SHEDBW

TEST: #SR 3 4 5 6 45 46 48
      "A requested negative edgewidth scale factor should be
       realized as the minimum."
OPQA/NEGATIVE EDGEWIDTH: invoke subroutine SHEDBW to test
  bundle with requested edge width = -maxew-100
               expected edge width = minew
pass/fail depending on return code from SHEDBW

OPQA/POSITIVE EDGEWIDTH ABOVE MAXIMUM: invoke subroutine SHEDBW
  to test requested edge width = maxew*2
           expected edge width = maxew
if abort indicated
   message about edge width too big for the screen
else
   TEST: #SR 3 4 5 6 45 46 48
         "A requested edgewidth scale factor above the maximum
          available should be realized as the maximum."
   pass/fail depending on return code from SHEDBW
endif

*** *** ***   edge color index   *** *** ***

TEST: #SR 3 4 5 6 49 50 51
      "A defined edge color index should cause the addressed
       entry in the color table to be used when rendering a
       edge."

bckcol = background color = realized color spec for entry #0
forcol = foreground color = realized color spec for entry #1

szcolt = maximum size of color table (including entry #0)
numdis = number of edges to be drawn = min(8, szcolt, szbt)
edcol  = random permutation of #0,#1, and numdis-2 random choices
         from entries #2 to #szcolt-1
visdx = from edcol, randomly select an entry to be made visible
        but not the one that contains 0, since this may not be
        re-settable.

for ix = 1 to numdis
   set entry edcol(ix) in color table to bckcol
   <set edge representation>:
      index     = ix
      edgeflag  = ON
      edgetype  = 1
      edgewidth = 1.0
      color     = edcol(ix)
next ix

set entry edcol(visdx) in color table to forcol

Display bundles 1 thru numdis and label them

OPQA/DEFINED EDGE COLOR INDICES: which triangle is visible?
pass/fail depending on
          (response = triangle with edge colored by visdx)

end_def_col:

TEST: #SR 3 4 5 6 49 50 52
      "An undefined edge color index should cause entry number 1
       in the color table to be used when rendering an edge."

set entry #1 in color table opposite from BCKCOL
set entry #1 different from FORCOL - make sure undefined default
  to *current* color-rep of #1, not just a predefined color.

explct = number of explicit edges of color #1 = random integer
   from 0 to min(4, szbt-3)
u1,u2,u3 = 3 undefined, positive color indices - all greater
  than maximum defined entry in color table

draw star with color #1

set up bundles 1 thru 3 to:
        edgeflag = ON, edgetype=1, width=1, color index= undf(1,2,3)
set up bundles 4 thru (explct+3) to:
        edgeflag = ON, edgetype=1, width=1, color index=1

display in random order bundles #1 thru explct+3

OPQA/UNDEFINED EDGE COLOR INDICES: how many rectangles have edges
  the same color as the star?
pass/fail depending on response = 3+explct

END PROGRAM 12