Design: 04.01.03/P02

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 2: Appearance of text primitives

CHARACTERISTICS: ynny

OPERATOR SCRIPT:

CHARACTER CONTENT: Two alphabetic text primitives are displayed
successively.  The operator must identify the sequence of
characters in each.

DEGENERATE TEXT DIRECTION VECTORS: Several lines of text are
displayed.  All but one should have a normal horizontal
orientation and similar size.  Identify the one line which is
askew.

TEXT DIRECTION VECTORS: Several boxes containing text are
displayed.  All but one should appear as a single text primitive.
Identify the one box containing overlapping primitives.

DESIGN:

default attributes:
font = 1
precision = STROKE
text alignment = CENTRE,HALF

throughout TDV = text direction vectors

*** *** *** ***   character content   *** *** *** ***

TEST: #SR 9
      "A displayed text primitive should contain the specified
       character string."

set character height = 0.05
set text font = 2
chstr = string of 5 randomly chosen upper-case letters

display <text 3> consisting of chstr:
  position = 0.5,0.5,0.5
  TDV = (1,0,0), (0,1,0)

OPQA/CHARACTER CONTENT: Enter the displayed character string.

if (operator response not= chstr) then
   fail
   goto end_char
endif

set text font = 1
chstr = string of 5 randomly chosen lower-case letters

display <text> consisting of chstr:
  position = 0.5,0.5

OPQA/CHARACTER CONTENT: Enter the displayed character string.
pass/fail depending on (operator response = chstr)

end_char:

*** *** *** ***   degenerate vectors   *** *** *** ***

TEST: #SR 9 10 11
      "The values (1,0,0) and (0,1,0) should be used as text
       direction vectors for all 2D text primitives and also when
       the explicit vectors of a 3D text primitive fail to define
       a plane."

In random order, display on 6 lines:

               1st vector   2nd vector
3D text "ABC"  (0,0,0)      (2,3,4)
3D text "ABC"  (0,0,0)      (0,0,0)
3D text "ABC"  (3,4,5)      (0,0,0)
3D text "ABC"  (1,-2,3)     (3,-6,9) (parallel vectors)
3D text "ABC"  (8,1,0)      (-1,8,0) (not horizontal)
2D text "ABC"   n.a.         n.a.

OPQA/DEGENERATE TEXT DIRECTION VECTORS: Which text line is
  different?
pass/fail depending on
  (operator response = line containing non-horizontal text)

*** *** *** ***   effect of text direction vectors   *** *** *** ***

TEST: #SR 9 10
      "A displayed text primitive should be rotated around the
       text position as specified by the first and second text
       direction vectors."

Divide screen up into 6 square labelled areas
ngsq = no-good square containing error = random from 1 to 6
chstr = "ABC"
zmid = 0.5

for ix = 1 to 6
   xmid,ymid = center of box #ix
   pick random rotation:
      rotx = random from -45.0 to 45.0 degrees
      roty = random from -45.0 to 45.0 degrees
      rotz = random from 0 to 360 degrees
   xf = transformation for rotation, centered at 0,0,0
   calculate equivalent TDVs:
   tdv1x,tdv1y,tdv1z = (1,0,0) transformed by xf
   tdv2x,tdv2y,tdv2z = (0,1,0) transformed by xf

   apply identity matrix as modelling transformation
   draw <text 3> chstr
      position: xmid,ymid,zmid
      TDV: tdv1,tdv2

   if (ix = ngsq) rotz = rotz + 5 degrees
   xf = transformation for rotx,roty,rotz,
        centered at xmid,ymid,0
        then shift by 0.5 in z-direction

   apply xf as modelling transformation
   if (ix <= 3) then
      draw <text 3> chstr
         position: xmid,ymid,0
         TDV: (1,0,0) (0,1,0)
   else
      draw <text> chstr
         position: xmid,ymid
   endif
next ix

OPQA/TEXT DIRECTION VECTORS: Which box contains overlapping text?
pass/fail depending on
  (operator response = box #ngsq)

END PROGRAM 2