ISO/IEC 9593-4:1991
(Main)Information technology — Computer graphics — Programmer's Hierarchical Interactive Graphics System (PHIGS) language bindings — Part 4: C
Information technology — Computer graphics — Programmer's Hierarchical Interactive Graphics System (PHIGS) language bindings — Part 4: C
Specifies a language independent nucleus of a graphics system. Specifies also a language dependent layer for the C language. Annexes A, B, C, D and E are for information only.
Technologies de l'information — Infographie — Interfaces langage avec PHIGS — Partie 4: C
General Information
Relations
Standards Content (Sample)
INTERNATIONAL
STANDARD
First edition
1991-12-15
~____-------------__---
-- ___^___ ___- -__-_ II____p
Information technology - Computer graphics -
Programmer’s Hierarchical Interactive Graphics
System (PHIGS) language bindings -
Part 4:
c
-. lnfographie
Technologies de I ‘informa tion - - Interfaces langage entre
un programm e d’applica ti on et son support graphique --
Partie 4: C
Reference number
ISOAEC 9593-4: 1991
(E)
---------------------- Page: 1 ----------------------
ISO/IEC 9593-4: 1991(E)
Foreword
Contents
1
1 scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2
.................................................................................................................................................
2 Normative references
3
............................................................................................................................
3 The C language binding of PHIGS
3
......................................................................................................................................................
3.1 Conformance
3
....................................................................................................................................
3.2 Functions versus macros
3
3.3 Character strings .
3
3.4 Function identifiers .
3
3.5 Registration .
3
..............................................................................................................................
3.6 Identifiers for graphics items
4
......................................................................................................................................................
3.7 Return values
4
........................................................................................................................................................
3.8 Header files
5
........................................................................................................................................
3.9 Memory management
5
..........................................................................................
3.9.1 Inquiry functions which return simple lists
5
......................................................................
3.9.2 Inquiry functions which return complex data structures
7
.......................................................................................................
3.9.3 Meaning of the size of an element
7
3.10 Inquiries returning structure elements .
7
3.11 Error handling .
7
Application defined error handlers .
3.11.1
7
3.11.2 Error codes .
8
3.11.3 C specific PHIGS errors .
8
........................................................................................................................
3.12 Storage of two-dimensional data
8
...............................................................................................................................
3.12.1 Storage of matrices
9
.......................................................................................................................
3.12.2 Storage of colour arrays
10
4 Tables .
10
..........................................................................................
4.1 Abbreviation policy for construction of identifiers
10
4.2 Table of abbreviations .
14
4.3 Function names .
14
.......................................................................................
4.3.1 List ordered alphabetically by bound name
20
.......................................................................
4.3.2 List ordered alphabetically by PHIGS function name
27
5 Type definitions .
27
5.1 Mapping of PHIGS data types .
27
........................................................................................................................
5.2 Environmental type definitions
28
.....................................................................................................
5.3 Implementation dependent type definitions
38
..................................................................................................
5.4 Implementation independent type definitions
73
6 Macro definitions .
73
6.1 Function identifiers .
76
6.2 Error codes .
83
6.3 Miscellaneous .
83
6.3.1 Linetypes .
83
6.3.2 Marker types .
83
6.3.3 Annotation styles .
83
6.3.4 Colour models .
83
6.3.5 Prompt and Echo Types .
84
.................................................................................................
6.3.6 Default parameters of OPEN PHIGS
84
6.3.7 Element enumeration .
0 ISO/IEC 1991
All rights reserved. No part of this publication may be reproduced or utilized in any form or by
any means, electronic or mechanical, including photocopying and microfilm, without permission
in writing from the publisher.
ISO/IEC Copyright Office a Case postale 56 l CH-1211 Geneve 20 l Switzerland
Printed in Switzerland
ii
---------------------- Page: 2 ----------------------
ISO/IEC 9593-4: 1991(E)
Foreword
85
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7 C PHIGS functions
85
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7.1 Notational conventions
85
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .~.
7.2 Control functions
87
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7.3 Output primitive functions
89
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*.
7.4 Attribute specification functions
89
7.4.1 Bundled attribute selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*.
90
7.4.2 Individual attribute selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
95
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7.4.3 Aspect source flag setting
95
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7.4.4 Workstation attribute table definition
96
Workstation filter definition . .*.
7.4.5
97
Colour model control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7.4.6
97
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7.4.7 HLHSR attributes
97
............................................................................................................
7.5 Transformation and clipping functions
97
7.5.1 Modelling transformations and clipping .
99
...................................................................................................................................
7.5.2 View operation
99
...............................................................................................................
7.5.3 Workstation transformation
100
.............................................................................................
7.5.4 Utility functions to support modelling
104
................................................................................................
7.5.5 Utility functions to support viewing
105
............................................................................................................................
7.6 Structure content functions
107
7.7 Structure manipulation functions .
108
7.8 Structure display functions .
108
7.9 Structure archiving functions .
111
7.10 Input functions .
111
....................................................................................................................
7.10.1 Pick identifier and filter
112
...........................................................................................................
7.10.2 Initialization of input devices
115
....................................................................................................
7.10.3 Setting the mode of input devices
116
....................................................................................................................
7.10.4 Request input functions
118
7.10.5 Sample input functions .
120
7.10.6 Event input functions .
122
7.11 Metafile functions .
123
7.12 Inquiry functions .
123
.....................................................................................
7.12.1 Inquiry functions for operating state values
123
7.12.2 Inquiry functions for PHIGS description table .
125
..............................................................................................
7.12.3 Inquiry functions for PHIGS state list
126
Inquiry functions for workstation state list .
7.12.4
137
.........................................................................
7.12.5 Inquiry functions for workstation description table
149
.............................................................................................
7.12.6 Inquiry function for structure state list
150
............................................................................................
7.12.7 Inquiry functions for structure content
153
7.12.8 Inquiry functions for error state list .
153
7.13 Error control .
154
...........................................................................................................................................
7.14 Special interfaces
154
....................................................................................................................
7.15 Binding defined utility functions
Annexes
155
........................................................................................
A Data types in compilation order and external functions
155
A. 1 Macro definitions .
166
A.2 Types in compilation order .
196
A.3 External functions .
248
B Example Programs .
248
B.l star .
251
B.2 iron . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*.
258
B.3 dyna star . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
264
show- line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
B .4
269
B.5 xfor& pline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
277
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
C Macros forshort function identifiers
. . .
ill
---------------------- Page: 3 ----------------------
ISO/IEC 9593-4: 1991(E)
Foreword
277
C. 1 Short function identifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*.
284
D Memory management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .~.
284
D. 1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
284
D.2 Functions that return simple lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .~. 285
D.2.1 Operationof ping list line inds
288
D.3 Functions that return complex data &uctur& . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
D.3.1 Operationof pcreate store
rep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .~.~. 291
D.3.2 Operationof pin
-
295
D.3.3 Operation of pdel store . - . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .*.*.*
-
297
E Function Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .~.
297
E.l List of functions ordered alphabetically by function name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
303
E.2 List of functions ordered alphabetically by bound name . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
iv
---------------------- Page: 4 ----------------------
ISO/IEC 9593=4:1991(E)
Foreword
IS0 (the International Organization for Standardization) and IEC (the International Electrotechnical Commission)
form the specialized system for worldwide standardization. National bodies that are members of IS0 or IEC
participate in the development of International Standards through technical committees established by the
respective organization to deal with particular fields of technical activity. IS0 and IEC technical committees
collaborate in fields of mutual interest. Other international organizations, governmental and non-governmental, in
liaison with IS0 and IEC, also take part in the work.
In the field of information technology, IS0 and IEC have established a joint technical committee, ISO/IEC JTC 1.
Draft International Standards adopted by the joint technical committee are circulated to national bodies for voting.
Publication as an International Standard requires approval by at least 75 % of the national bodies casting a vote.
International Standard ISO/IEC 9593-4 was prepared by Joint Technical Committee ISOIIEC JTC 1, Information
technology.
ISO/IEC 9593 consists of the following parts, under the general title Information technology - Computer
graphics - Programmer’s Hierarchical Interactive Graphics System (PHIGS) language bindings :
-Part 1: FORTRAN 77
-Part 3 : ADA
-Part4: C
Annexes A, B, C, D, and E of this part of ISO/IEC 9593 are for information only.
V
---------------------- Page: 5 ----------------------
ISO/IEC 9593=4:1991(E)
Introduction
The Programmer’s Hierarchical Interactive Graphics System (PHIGS), the functional description of which is given
in ISO/IEC 9592-1, is specified in a language independent manner and needs to be embedded in language dependent
layers (language bindings) for use with particular programming languages.
The purpose of this part of ISO/IEC 9593 is to define a standard binding for the C computer programming language.
---------------------- Page: 6 ----------------------
INTERNATIONAL STANDARD ISO/IEC 9593=4:1991(E)
Information technology - Computer graphics -
Programmer’s Hierarchical Interactive Graphics System
(PHIGS) language bindings,-
Part 4:
C
1 Scope
The Programmer’s Hierarchical Interactive Graphics System (PHIGS), ISO/IEC 9592-1, specifies a language
independent nucleus of a graphics system. For integration into a programming language, PHIGS is embedded in a
language dependent layer obeying the particular conventions of that language. This part of ISO/IEC 9593 specifies
such a language dependent layer for the C language.
1
---------------------- Page: 7 ----------------------
ISOIIEC 9593-4: 1991(E)
Normative references
2 Normative references
The following standards contain provisions which, through reference in this text, constitute provisions of this part of
ISO/IEC 9593. At the time of publication, the editions indicated were valid. All standards are subject to revision,
and parties to agreements based on this part of ISO/IEC 9593 are encouraged to investigate the possibility of apply-
ing the most recent editions of the standards indicated below. Members of IEC and IS0 maintain registers of
currently valid International Standards.
- Programmer’s Hierarchical Interactive
IS0 9592-l : 1989, Information processing systems - Computer graphics
Graphics System (PHIGS) - Part 1 :Functional description.
ISO/IEC 9899 : 1990, Programming Languages - C.
ISO/IEC TR 9973 : 1988, Information processing - Procedures for Registration of Graphical Items.
---------------------- Page: 8 ----------------------
ISO/IEC 9593=4:1991(E)
The C language binding of PHIGS
3 The C language binding of PHIGS
3.1 Conformance
This binding incorporates the rules of conformance defined in the PHIGS Standard (ISO/IEC 9592) for PHIGS
implementations, with those additional requirements specifically defined for C language implementations of PHIGS.
The following criteria are established for determining conformance of an implementation to this binding:
In order to conform, an implementation of the C binding of PHIGS shall implement ISO/IEC 9592-l. It shall
make visible all of the declarations in the C binding specified in this part of ISO/IEC 9593.
Thus, for example, the syntax of the function names shall be precisely as specified in this part of ISO/IEC
9593 and the parameters shall be of the data types stated in this part of ISO/IEC 9593.
3.2 Functions versus macros
An implementation may substitute macros for functions. However, the macros must be designed so that side-effects
work properly.
3.3 Character strings
The C language represents character strings as an array of characters terminated by the null character (i.e. ‘W’).
This means that the null character is not usable as a printable character.
3.4 Function identifiers
The C standard (ISO/IEC 9899) requires that compilers recognize internal identifiers which are distinct in at least 31
characters. That standard also requires that external identifiers (i.e. those seen by the linker) be recognized to a
minimum of six characters, independent of case.
In order to produce more readable C code, this part of ISO/IEC 9593 binds the PHIGS function names to identifiers
which can be longer than six characters but are less than 31 characters. Implementations which must run in environ-
ments which honour less than 3 1 characters in external identifiers must include a set of #defines in the header
file which equate the long identifiers defined in this part of ISO/IEC 9593 to a set of shorter identifiers which con-
form to the requirements of the implementation. An example of these shorter names can be found in annex C.
3.5 Registration
ISO/IEC 9592-l reserves certain value ranges for registration1 as graphical items. The registered graphical items
will be bound to the C programming language (and other programming languages). The binding of registered items
will be consistent with the bindings presented in this part of ISO/IEC 9593.
3.6 Identifiers for graphics items
ISO/IEC 9592-l provides a mechanism to extend its functionality by the use of the graphical items GENERALIZED
DRAWING PRIMITIVE, GENERALIZED DRAWING PRIMITIVE 3, GENERALIZED STRUCTURE ELE-
MENT and ESCAPE. These items are referenced via identifiers formed from the registration number of the item.
This binding specifies the format of the identifiers but it does not specify the registration of the identifiers. The
identifiers are used as arguments to the functions pgdp, pgdp3, pgse, and pescape and returned to the appli-
cationbythefunctions pinq_elem content and pinq_cur elem content.
- - -
1 For the purpose of this International Standard and according to the rules for the designation and operation of registration authorities in the
ISO/IEC JTCl procedures, the IS0 and IEC Councils have designated the National Institute of Standards and Technology (National Computer
Systems Laboratory), A-266 Technology Building, Gaithersburg, MD 20899, USA, to act as registration authority.
3
---------------------- Page: 9 ----------------------
ISO/IEC 95934 1991(E)
The C language binding of PHIGS
An implementation may also represent these items as separate functions, but this is not required.
The format of the identifiers for graphical items is
“PFFF Tn”
-
where:
FFF is the abbreviation of the PHIGS function name.
T is the type of the item, “R” for registered and “U” for unregistered.
n is the registration number (for unregistered items, the absolute value of the item number shall be used).
The formats for registered GENERALIZED DRAWING PRIMITIVE, GENERALIZED DRAWING PRIMITIVE
3, GENERALIZED STRUCTURE ELEMENT and ESCAPE graphical items are:
#define PGDP Rn n
( )
#define PGDP? Rn n
( 1
n
#define PGSE En ( 1
#define PESCiPE Rn
(n)
-
For example, the identifier for registered GENERALIZED DRAWING PRIMITIVE item 12 would be:
#define PGDP R12
(12)
-
The formats for unregistered GENERALIZED DRAWING PRIMITIVE, GENERALIZED DRAWING PRIMI-
TIVE 3, GENERALIZED STRUCTURE ELEMENT and ESCAPE graphical items are:
#define PGDP Un (-n)
#define PGDP? Un (4
#define PGSE in t-n)
#define PESCAPE Un (4
-
PRIMITIVE item -1 would be:
For example, the identifier for unregistered GENERALIZED DRAWING
#define PGDP Ul t-11
-
3.7 Return values
All PHIGS C functions return void.
3.8 Header files
C provides a mechanism to allow external files to be included in a compilation. The file phig
...
Questions, Comments and Discussion
Ask us and Technical Secretary will try to provide an answer. You can facilitate discussion about the standard in here.