Design: 04.02.05.02/P13

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 13: Network inheritance and initialization of interior
            index

CHARACTERISTICS: ynny

OPERATOR SCRIPT:

STRUCTURE NETWORK INHERITANCE FOR INTERIOR INDEX: This screen
displays several left-right pairs of interiors.  Make sure that
all pairs except one have matching interior styles, interior
style index (if applicable) and colors.  Identify the
non-matching pair.

DESIGN:

All test cases use same basic structure network for testing
inheritance.  Five (distinct if possible) values for the
attribute to be tested are set up and propagated throughout the
network.  The first value is the system default from the PDT.
Note that structure #104 is executed by both #103 and #101.
Actual results are displayed on the left, expected results
on the right, with the 14th deliberately made incorrect.

default = val#1
  |                  102
  |                 /  prim 2
  |               /    attr = val#3   val#3
  V        val#1/      exec 103---------------103
101           /        prim 8                   prim 3
  prim 1    /                                   attr = val#4
  exec 102/                                     prim 4
  prim 9                                        exec 104\
  attr = val#2                                  prim 7    \ val#4
  prim 10                                                   \
  transform             val#2                                 \
  exec 104-----------------------------------------------------104
  un-transform                                                   prim 5/11
  prim 13                                                        attr = val#5
  prim 14                                                        prim 6/12
  exec 105---------->105
                       expected values


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

*** *** ***   inheritance for interior index *** *** ***

call DISCOL to try to get 5 distinct foreground colors,
  returning fcol = actual number of foreground colors
colind(1:5) = [1,2,3,4,5]
if (fcol < 5) then
   copy 1st valid part of list to tail of list
endif

istydx = interior style index (will be reset if have HATCH)
istydx(1:5) = [1,2,3,4,5]

use <inquire interior facilities> to determine:
  naints = number of available interior styles
  got(HOLLOW:EMPTY) = true/false = which interior styles are available

initialize lints = HOLLOW, EMPTY, HOLLOW, HOLLOW, HOLLOW
                 = list of interior styles

check which styles are available besides HOLLOW and EMPTY
  and reset lints(3:5) accordingly

nxtval = 3
if got(solid) then
   fill lints(nxtval:5) with solid
   nxtval = nxtval + 1
endif

if got(hatch) then
   fill lints(nxtval:5) with hatch
   set istydx(nxtval:5) to distinct hatch indexes
   nxtval = nxtval + 1
endif

if got(pattern) then
   fill lints(nxtval:5) with pattern
   set patterns nxtval-5 to distinct values
endif

set up bundles 1-5:

   bundle
   index     interior style  int style index    color index
   ------    --------------  ---------------    -----------
     1       lints(1)         istydx(1)         colind(1)
     2       lints(2)         istydx(2)         colind(2)
     3       lints(3)         istydx(3)         colind(3)
     4       lints(4)         istydx(4)         colind(4)
     5       lints(5)         istydx(5)         colind(5)

randomize location of interiors
set up CSS as described above
set all ASFs to BUNDLED

display 14 pairs of interiors, using bundles 1-5

TEST: #SR 3 4 6 7 9 10
      "The interior index should be saved and restored by
       <execute structure> during traversal."

OPQA/STRUCTURE NETWORK INHERITANCE FOR INTERIOR INDEX:
  which pair of interiors does NOT match?
pass/fail depending on (response = position of interior 14)

END PROGRAM 13