Previous Next Up Title Contents Index Functions Index Top Library

7
Graphic Attributes
of Structures


This chapter discusses all PHIGURE functions used to define graphic attributes in a structure generated by PHIGURE. These attributes are identical to those concerned by the PHIGS standard, e.g. polyline colour, text colour, mark size, etc. These PHIGURE functions are therefore complementary to those already existing in the PHIGS standard. Each of these functions opens a given structure, and inserts, at a given label in the structure, an element corresponding to the desired attribute. If an element of the same type already exists after the label in the structure, the new element will replace the existing element. An example: setting colour attributes. Let us suppose that PHIGURE creates a structure, whose identifier is STRID, representing a set of arrows, a box and a text. We shall assume that each arrow is made up of a polyline and a fill area representing its point, and that the box is formed by a polyline. Finally, we shall assume that the organization of the structure is as follows: LABEL -1

list of polyline primitives of the lines of the arrows

LABEL -2

liste of fill area primitives of the head of each arrow

LABEL -3

polyline primitive of the box

LABEL -4

text primitive of the text

If we want to assign colour index 2 to the lines of the arrows, colour index 6 to the boxes, colour index 7 to the head of the arrows and colour index 3 to the text, we can use the following sequence after creating the structure STRID: tset_line_colr_ind (STRID, -1, 2); /* colour index 2 for the lines of the arrows */

tset_line_colr_ind (STRID, -3, 6); /* colour index 6 for the box */

tset_int_colr_ind (STRID, -2, 7); /* colour index 7 for the head of the arrows */

tset_text_colr_ind (STRID, -4, 3); /* colour index 3 for the text */

Since a primitive attribute is valid for all the primitives which follow in the structure until a new value of this attribute appears, the same colours are obtained by the following calls: tset_line_colr_ind (STRID, -1, 2); /* colour index 2 for the lines of the arrows */

tset_line_colr_ind (STRID, -3, 6); /* colour index 6 for the box */

tset_int_colr_ind (STRID, -1, 7); /* colour index 7 for the head of the arrows */

tset_text_colr_ind (STRID, -1, 3); /* colour index 3 for the text */ As PHIGURE structure begins by label 0 (see [section]creation of the scene), the label -1 reference in the last example can be changed by label 0 reference : the same colours are obtained by the following calls : tset_line_colr_ind (STRID, 0, 2); /* colour index 2 for the lines of the arrows */

tset_line_colr_ind (STRID, -3, 6); /* colour index 6 for the box */

tset_int_colr_ind (STRID, 0, 7); /* colour index 7 for the points of the arrows */

tset_text_colr_ind (STRID, 0, 3); /* colour index 3 for the text */ If the colour of the box should also be colour 2, there is no need to call tset_line_colr_ind twice.


Previous Next Up Title Contents Index Functions Index Top Library