Design: 02.03.03/P01

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 1: Basic spatial search for 2-D primitives

CHARACTERISTICS: nnnn

OPERATOR SCRIPT: passive test.

DESIGN:

All ISS's from start of root (101,0), no modelling clipping,
null filter lists, search ceiling = 1.

*** *** *** ***   polymarker   *** *** *** ***

Build structure 101:
  1.  polymarker: (11,1), (12,2), (13,2), (22.3, 2.3)
  2.  polymarker: (21,1), (22,2), (23,2)

TEST: #SR 1 2 4 5 6 7 9 10 11
      "The points of a qualifying two-dimensional polymarker
       should be found by a two-dimensional spatial search."

<incremental spatial search> with
   search reference point = 22.1, 2.1
   search distance        = 0.2
pass/fail depending on (no error and found path = (101,2))

TEST: #SR 1 2 4 5 6 7 9 10 11
      "The points of a qualifying two-dimensional polymarker
       should be found by a two-dimensional spatial search,
       even when the search distance is zero."

<incremental spatial search> with
   search reference point = 22, 2
   search distance        = 0.0
pass/fail depending on (no error and found path = (101,2))

TEST: #SR 2 4 5 6 7 9 10 11
      "The points of a qualifying two-dimensional polymarker
       should be found by a three-dimensional spatial search."

<incremental spatial search 3> with
   search reference point = 22.1, 2.1, -0.1
   search distance        = 0.2
pass/fail depending on (no error and found path = (101,2))


*** *** *** ***   polyline   *** *** *** ***

Build structure 101:
  1.  polyline: (11,1), (12,2), (13,2), (21.5, 1.7)
  2.  polyline: (21,1), (22,2), (23,2)

TEST: #SR 1 2 4 5 6 7 9 10 12
      "The line segments of a qualifying two-dimensional polyline
       should be found by a two-dimensional spatial search."

<incremental spatial search> with
   search reference point = 21.5, 1.5
   search distance        = 0.1
pass/fail depending on (no error and found path = (101,2))

TEST: #SR 2 4 5 6 7 9 10 12
      "The line segments of a qualifying two-dimensional polyline
       should be found by a three-dimensional spatial search."

<incremental spatial search 3> with
   search reference point = 21.5, 1.5, 0.1
   search distance        = 0.11
pass/fail depending on (no error and found path = (101,2))

TEST: #SR 2 4 5 6 7 9 10 12
      "The line segments of a qualifying two-dimensional polyline
       should be found by a three-dimensional spatial search,
       even when the search distance is negative."

<incremental spatial search 3> with
   search reference point = 23, 2, 0
   search distance        = -33.3
pass/fail depending on (no error and found path = (101,2))


*** *** *** ***   fill area   *** *** *** ***

Build structure 101:
  1.  fill area: (20.5, 1), (21.5, 2), (21.5, 1)
  2.  fill area: (21,   1), (22,   2), (22,   1)

TEST: #SR 1 2 4 5 6 7 9 10 13
      "The interior of a qualifying two-dimensional fill area
       should be found by a two-dimensional spatial search."

<incremental spatial search> with
   search reference point = 21.7, 1.3
   search distance        = 0.1
pass/fail depending on (no error and found path = (101,2))

TEST: #SR 2 4 5 6 7 9 10 13
      "The interior of a qualifying two-dimensional fill area
       should be found by a three-dimensional spatial search."

<incremental spatial search 3> with
   search reference point = 21.7, 1.3, 0.1
   search distance        = 0.11
pass/fail depending on (no error and found path = (101,2))


*** *** *** ***   fill area set   *** *** *** ***

Build structure 101:
  1.  fill area set: (1,0), (0,1), (1,2)  / (3,2), (4,1), (3,0)
  2.  fill area set: (11,2), (13,2), (13,0), (11,0)  /
                     ( 1,2), ( 3,2), ( 3,0), ( 1,0)

TEST: #SR 1 2 4 5 6 7 9 10 14
      "The interiors of a qualifying two-dimensional fill area
       set should be found by a two-dimensional spatial search."

<incremental spatial search> with
   search reference point = 2, 1
   search distance        = 0.1
pass/fail depending on (no error and found path = (101,2))

TEST: #SR 2 4 5 6 7 9 10 14
      "The interiors of a qualifying two-dimensional fill area
       set should be found by a three-dimensional spatial search."

<incremental spatial search 3> with
   search reference point = 2, 1, 0.1
   search distance        = 0.11
pass/fail depending on (no error and found path = (101,2))

Build structure 101:
  1.  fill area set: (1,4), (4,1), (4,4) / (3,6), (6,3), (3,3)
  2.  fill area set: (3.4,3.4), (3.4,3.6), (3.6,3.6), (3.6,3.4)
TEST: #SR 1 2 4 5 6 7 9 10 14
      "The interior of a qualifying two-dimensional fill area
       set should be found by a two-dimensional spatial search,
       but sub-areas overlapping an even number of times should
       not be found."

<incremental spatial search> with
   search reference point = 3.5,3.5
   search distance        = 0.1
pass/fail depending on (no error and found path = (101,2))

*** *** *** ***   text   *** *** *** ***

Build structure 101:
  1.  set character height = 1.0
  2.  set text alignment   = (LEFT, BOTTOM)
  3.  text: "Viva PHIGS!" at 5,0
  4.  text: "Viva PHIGS!" at 5,5

TEST: #SR 1 2 4 5 6 7 9 10 15
      "The text extent rectangle of a qualifying two-dimensional
       text primitive should be found by a two-dimensional
       spatial search."

<incremental spatial search> with
   search reference point = 4.9, 5.5
   search distance        = 0.3
pass/fail depending on (no error and found path = (101,4))

TEST: #SR 2 4 5 6 7 9 10 15
      "The text extent rectangle of a qualifying two-dimensional
       text primitive should be found by a three-dimensional
       spatial search."

<incremental spatial search 3> with
   search reference point = 4.9, 5.5, -0.1
   search distance        = 0.3
pass/fail depending on (no error and found path = (101,4))


*** *** *** ***   annotation text   *** *** *** ***

Build structure 101:
  1.  set annotation text character height = 1.0
  2.  set annotation text alignment        = (LEFT, BOTTOM)
  3.  annotation text relative: "Viva PHIGS!" at 5,0 with offset = 0,0
  4.  annotation text relative: "Viva PHIGS!" at 5,5 with offset = 0,0

TEST: #SR 1 2 4 5 6 7 9 10 16
      "The annotation reference point of a qualifying
       two-dimensional annotation text should be found by a
       two-dimensional spatial search."

<incremental spatial search> with
   search reference point = 5,3
   search distance        = 2.5
pass/fail depending on (no error and found path = (101,4))

TEST: #SR 2 4 5 6 7 9 10 16
      "The annotation reference point of a qualifying
       two-dimensional annotation text should be found by a
       three-dimensional spatial search."

<incremental spatial search 3> with
   search reference point = 5,3,1
   search distance        = 2.5
pass/fail depending on (no error and found path = (101,4))


*** *** *** ***   cell array   *** *** *** ***

colia = color index array =  1 0 1
                             0 1 1

Build structure 101:
  1.  cell array: colia between corners (0,0) and (2,2)
  2.  cell array: colia between corners (1,1) and (3,3)

TEST: #SR 1 2 4 5 6 7 9 10 17
      "The parallelogram of a qualifying two-dimensional cell
       array should be found by a two-dimensional spatial
       search."

<incremental spatial search> with
   search reference point = 2, 2.5
   search distance        = 0.1
pass/fail depending on (no error and found path = (101,2))

TEST: #SR 2 4 5 6 7 9 10 17
      "The parallelogram of a qualifying two-dimensional cell
       array should be found by a three-dimensional spatial
       search."

<incremental spatial search 3> with
   search reference point = 2, 2.5, 0.1
   search distance        = 0.11
pass/fail depending on (no error and found path = (101,2))

END PROGRAM 1