Design: 04.02.05.02/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:

INTERIOR STYLES: This screen should display examples of the
available interior styles actually supported by the
implementation.  You should not consider whether the mandatory
styles (hollow and empty) are present, but simply whether each
interior style is recognizable from the verbal description.
Enter a list of integers which identify the interior styles in
the same order as they appear in the prompt.

REGISTERED HATCH STYLES: This screen displays a sample of
supported registered hatch styles (at most 8).  For each
displayed interior, look up its hatch style identifier in the ISO
register and verify that the actual appearance of the hatch style
agrees with the ISO specification.

IMPLEMENTOR DEFINED HATCH STYLES: This screen displays a sample
of implementor defined hatch styles (at most 8).  For each
displayed interior, look up its hatch style identifier in the
implementor's documentation and verify that the actual appearance
of the hatch style agrees with the specification.

UNSUPPORTED HATCH STYLES: This screen should display several
interiors with a hatch style that corresponds to interior style
index (hatch index) 1; and one interior with a different hatch
style. Identify the interior with the different hatch style.

DEFINED PATTERNS: All interiors but one are crawn with the same
pattern. Identify the single interior drawn in the a different
pattern style. NOTE: this tests the indices into the pattern
table (similar to color).

UNDEFINED PATTERNS: This screen should display several interiors
with a pattern that corresponds to interior style index (pattern
index) 1; and one interior with a different pattern. Identify the
area with the different pattern.

DEFINED INTERIOR COLOR INDICES: All interiors but one are drawn
in the background color.  Identify the interior drawn in the
default foreground color.

UNDEFINED INTERIOR COLOR INDICES: A star is drawn with several
triangular interiors beneath it.  Normally, all of these will be
the same color as the star.  Count up and report the number of
triangles which match the star in color.

DESIGN:

set all ASFs to BUNDLED
set pattern size to .03,.03

use <inquire interior facilities> to determine:
  nalis  = number of available (and legal) interior styles
  lavis  = list of available interior styles
  numhs  = number of available hatch styles
  lavrhs = list of available registered (non-mandatory) hatch styles
  lavihs = list of available implementor-defined hatch styles
           (may be derived directly from hatch style value, if reported
            number of hatch styles < 0)

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

*** *** ***   interior style   *** *** ***

Use default background color=0, foreground=1

for ix = 1, nalis
   <set interior representation>:
      index                = ix
      interior style       = ixth entry in lavis
      interior style index = 1
      color                = 1
next ix

Display in random order bundles 1 thru nalis

TEST: #SR 3 5 6 7 35 36
      "The available interior styles should be recognizable from
       their standard description."

OPQA/INTERIOR STYLES: List, in order, the numeric labels for
  interior styles: hollow, solid, hatch, pattern, empty.

pass/fail depending on (all displayed interior styles correctly
                        identified)

*** *** ***   interior style index - HATCH   *** *** ***

if (HATCH not available) then
   message: hatch style not supported, skip tests
   goto end_hatch
endif

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

numdis = min(regdx, 8, szbt)
hatdis = numdis entries, randomly chosen from lavrhs

for ix = 1, numdis
   <set interior representation>:
      index     = ix
      interior style  = HATCH
      hatch index     = ixth entry in hatdis
      color     = 1
next ix

display in order and label bundles 1 thru numdis

TEST: #SR 3 5 6 7 35 39 40 47 48
      "The registered hatch styles (> 0) should agree with
       their registered description."

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

neg_type:

impdx = size of lavihs
if impdx < 1 goto unsupport_style

numdis = min(impdx, 8, szbt)
hatdis = numdis entries, randomly chosen from lavihs

for ix = 1, numdis
   <set interior representation>:
      index     = ix
      interior style = HATCH
      hatch index    = ixth entry in hatdis
      color     = 1
next ix

display in order and label bundles 1 thru numdis

TEST: #SR 3 5 6 7 35 39 40 47 49
      "Implementor-defined hatch styles (< 1) should agree with the
       descriptions supplied by the implementor."

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

unsupport_style:

if (hatch index 1 not available) then
   message: No index #1, skip test of unsupported hatch style
   goto end_hatch
endif
lunsup = list of (mostly) unsupported hatch styles contains:
   a negative unsupported type, if available (< minimum in lavihs)
   0, if not in lavihs
   a positive unsupported type (> maximum in lavrhs)
   1, (horizontal hatch)
   a supported type, other than 1 (should be at least 2 others)

for ix = 1, (size of lunsup)
   <set interior representation>:
      index = ix
      interior style = HATCH
      hatch index    = lunsup(ix)
      color index    = 1
next ix

Display in random order bundles 1 thru (size of lunsup)

TEST: #SR 3 5 6 7 35 39 41
      "Unavailable hatch styles should be displayed as hatch style
       1."

OPQA/UNSUPPORTED HATCH STYLES: Which hatch style is not the
  horizontal hatch style of index #1?
pass/fail depending on (the non-hatch style 1 selected)

end_hatch:

*** *** ***   interior style index - PATTERN   *** *** ***

if (PATTERN not available) then
   message: skip tests, pattern not available
   goto end_pattern
endif

TEST: #SR 3 4 5 6 7 35 39 40
      "A defined pattern index should cause the addressed entry in
       the pattern table to be used when rendering an interior
       filled with pattern interior style."

Set 5 patterns (use index 1-5): 4 identical and a random one
  different

for ix = 1, 5
   <set interior representation>:
      index = ix
      interior style = PATTERN
      pattern index  = ix
      color index    = 1
next ix

display in order and label bundles 1 thru 5

OPQA/DEFINED PATTERNS: Which pattern is different?
pass/fail depending on (response = different pattern selected )


lunsup = list of (mostly) unsupported pattern indices contains:
   3 undefined pattern indices
   1, (reset to checkerboard)
   defined pattern #5 (set different from 1)

for ix = 1, 5
   <set interior representation>:
      index = ix
      interior style = PATTERN
      pattern index  = lunsup(ix)
      color index    = 1
next ix

Display in random order bundles 1 thru 5

TEST: #SR 3 5 6 7 35 39 41
      "Unavailable patterns should be displayed as pattern 1."

OPQA/UNDEFINED PATTERNS: Which pattern is different?
pass/fail depending on (response = bundle with defined index #5)

end_pattern:


*** *** ***   interior color index   *** *** ***

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

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 interiors to be drawn = min(8, szcolt, szbt)
facol  = random permutation of #0,#1, and numdis-2 random choices
         from entries #2 to #szcolt-1
visdx = from facol, 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 facol(ix) in color table to bckcol
   <set interior representation>:
      index          = ix
      interior style = select among available interiors, but not
                       EMPTY or PATTERN
      interior style index = 1
      color          = facol(ix)
next ix

set entry facol(visdx) in color table to forcol

Display bundles 1 thru numdis using circular fill areas, and
  label them

OPQA/DEFINED INTERIOR COLOR INDICES: Which circle is visible?
pass/fail depending on (response = interior colored by visdx)

end_def_col:

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

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 lines 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 3 bundles 1 thru 3 with color index = u1,u2,u3
set up explct bundles with color index=1

display in random order bundles #1 thru explct+3, using triangles

OPQA/UNDEFINED INTERIOR COLOR INDICES: How many triangles are the
  same color as the star?
pass/fail depending on (response = 3+explct)

END PROGRAM 12