Design: 04.02.05.03/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 edge
            index

CHARACTERISTICS: ynny

OPERATOR SCRIPT:

STRUCTURE NETWORK INHERITANCE FOR EDGE INDEX: This screen
displays several left-right pairs of triangles.  Make sure that
all pairs except one have matching edge flags, edgetypes,
edgewidths, 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

*** *** ***   inheritance for edge index   *** *** ***

use <inquire edge facilities> to determine:
  numet  = number of edgetypes
  numew  = number of available edge-widths
  nomew  = nominal edge-width (DC)
  minew,maxew = minimum,maximum edge-width (DC)

set edge flag
edflg[1..5] = ON
if (numet = 1) edflg(3) = OFF

get edgetype values:
ledtyp = list of 5 (possible repeated) selected edgetypes

get alternative edgewidth values:

altew1 should not exceed .05 (WC) to avoid overlap - distance
  between edges will be 1/15 = .06666
altew1 = min(max scale factor, factor equivalent to .05 in WC)
altew2 = min scale factor

if default (1.0) is near altew1 or altew2, set alternate so as to
maximize the smallest gap among altew1, altew2, and 1.0:

avg1 = (altew1 + 1) / 2
avg2 = (altew2 + 1) / 2
if (abs(altew1-1) < abs(avg2-1)) then
   altew1 = avg2
elseif (abs(altew2-1) < abs(avg1-1)) then
   altew2 = avg1
endif

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

set up bundles 1-5

   bundle
   index   edge flag  edgetype    edgewidth    color index
   ------  ---------  --------    ---------    -----------
     1     edflg(1)    ledtyp(1)     1.0        colind(1)
     2     edflg(2)    ledtyp(2)     altew1     colind(2)
     3     edflg(3)    ledtyp(3)     altew2     colind(3)
     4     edflg(4)    ledtyp(4)     altew1     colind(4)
     5     edflg(5)    ledtyp(5)     altew2     colind(5)

randomize location of edges
set up CSS as described above

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

display 14 pairs of triangles, using bundles 1-5

TEST: #SR 3 5 6 8 9
      "The edge index should be saved and restored by
       <execute structure> during traversal."

OPQA/STRUCTURE NETWORK INHERITANCE FOR EDGE INDEX:
  which pair of triangles does NOT match?
pass/fail depending on response = position of edge 14

END PROGRAM 13