Contact us Heritage collections Image license terms
HOME ACL ACD ICF SUS DCS G&A STARLINK Literature
Further reading □ OverviewContentsPrefaceNotation1. Introduction2. Structures3. Output primitives4. Attributes5. Networks6. 2D viewing7. 3D PHIGS8. Examples9. Input Classes10. Interaction11. Workstations12. Environment13. Further output14. Archives15. BindingsIndex
C&A INF CCD CISD Archives Contact us Heritage archives Image license terms

Search

   
ACDLiteratureBooksPHIGS
ACDLiteratureBooksPHIGS
ACL ACD C&A INF CCD CISD Archives
Further reading

OverviewContentsPrefaceNotation1. Introduction2. Structures3. Output primitives4. Attributes5. Networks6. 2D viewing7. 3D PHIGS8. Examples9. Input Classes10. Interaction11. Workstations12. Environment13. Further output14. Archives15. BindingsIndex

A Primer for PHIGS

F. R. A. Hopgood and D. A. Duce

Wiley, 1991

NOTATION

We have chosen to use the Fortran binding as the basis for the examples in this book. Clearly, the language binding has to comply with the constraints of the language standard itself. In the case of Fortran, this means that all identifiers, such as subroutine names, are limited to six characters. For example, to draw a polyline in PHIGS requires the function:

POLYLINE(point list)

to be executed. The Fortran language binding accesses this function by defining the subroutine:

SUBROUTINE PPL(N, XA, Y A)

where the two arrays XA(1 to N) and YA(1 to N) define the (X,Y) points that make up the point list in the PHIGS parameter. The POLYLINE name has been abbreviated to PPL. While this particular mnemonic may not be too difficult to remember and relate to the PHIGS function name, some names in the Fortran binding are much harder to remember. For example, the PHIGS function:

INQUIRE SET OF WORKSTATIONS TO WHICH POSTED

has the Fortran subroutine name PQWKPO!

We have compromised in this book by not using the Fortran binding exactly but instead have substituted the full PHIGS function name while retaining the Fortran parameters in the examples. We have also omitted the word CALL throughout. Thus the Fortran subroutine call:

      CALL PPL(N, XA, Y A)

has been written as:

      POLYLINE(N, XA, Y A)

in the examples.

The other liberties taken in the examples are to be imprecise as to whether particular parameters are REAL or INTEGER. For example:

      REAL X(5) 
      DATA X /0,1,2,3,4/ 
      POST STRUCTURE(WS, ABC, 0)

Strictly speaking, the DATA declaration should have REAL values defined and the third parameter in the POST STRUCTURE function should be a REAL number.

PHIGS also has a number of parameters which enumerate a number of possible options. In Fortran, these are mapped onto integer values from 0 upwards. In the examples, for clarity we have assumed a variable has been set up to have the correct value and the variable name is used instead. For example:

      SET LINETYPE(DOTTED)

should really be written as:

      INTEGER DOTTED 
      DOTTED = 3 
      CALL PSLN(DOTTED)

The PHIGS language binding does define a set of names for this purpose. However, these names conform to the Fortran restriction of 6 characters, and to avoid conflicts with variable names used in the application, they start with the letter P. In this book, we have used variable names with more obvious meanings in preference to the defined set and so do not always follow the constraint to 6 characters. The Fortran binding provides the constant PLDOT which could have been used instead of DOTTED. Some implementations provide an include file with these constants already set up.

Some details of the standard names used in implementations is given in Chapter 15.

⇑ Top of page
© Chilton Computing and UKRI Science and Technology Facilities Council webmaster@chilton-computing.org.uk
Our thanks to UKRI Science and Technology Facilities Council for hosting this site