Jump Over Left Menu
Chapter 13: Further Output
The main output primitives and their aspects were defined in Chapter 3. Three other primitives of less importance complete the set available. These are cell array, annotation text and generalized drawing primitive. Cell array is provided to allow images to be displayed with the other graphical output. Annotation text provides annotations to graphical objects where the transformations to the object are not required on the annotation. Finally, the generalized drawing primitive gives the ability to extend the basic set of output primitives.
13.2 CELL ARRAY
The functions provided are:
CELL ARRAY(PX, PY, QX, QY, DIMX, DIMY, ISC, ISR, DX, DY, COLIA) CELL ARRAY 3(CPXA, CPYA, CPZA, DIMX, DIMY, ISC, ISR, DX, DY, COLIA)
Cell array defines an image as an array of areas to be given specific colours from the colour table. The parameters up to DIMX define the complete area of the image. DX and DY define how many cells the image is to be broken up into in the X and Y-direction. The remaining parameters specify the entries in the array COLIA of dimension (DIMX, DIMY) to be used as the colour index values into the colour table. These specify the colours of the individual cells. Both primitives are planar primitives. The 2D version defines a rectangular array of cells in modelling coordinates on the Z=0 plane while the 3D version defines an array of parallelograms on an arbitrary plane. In both cases, modelling and viewing transformations are applied to the cells so that the grid of cells to be rendered can be quadrilaterals and the various clipping facilities will have been applied to these quadrilaterals.
In the 2D form, the points (PX, PY) and (QX, QY) specify the opposite corners of the rectangle. The cells are numbered with the one nearest (PX, PY) being (1,1) and the one nearest (QX, QY) being (DX, DY).
In the 3D form, the points (CPXA(I), CPYA(I), CPZA(I)) define the 3 adjacent corners of a parallelogram. The point P (I=1) is the equivalent of (PX, PY). The point R (I=2) is the point that defines the X-axis of the parallelogram which extends from P in the direction of R. The point S (I=3) defines the Y-axis of the parallelogram which extends from P in the direction of S. The fourth corner Q is defined as R+S-P. The points (PX, PY, PZ) and (QX, QY, QZ) define the opposite corners of the parallelogram. The cells are numbered as for the 2D case.
The remaining parameters allow a part of the COLIA array to be used to define the colour indices associated with the cells. The entries used start at the position COLIA(ISC, ISR). The colour of the (I, J)th cell is defined by the entry COLIA(ISC+I-l, ISR+J-l).
Cell array is unusual in that its geometric and rendering attributes are all provided within the function definition. Only the identification attributes are set globally.
13.3 ANNOTATION TEXT
Annotation text is provided to add labels associated with specific points in the object to be displayed. Normal text could be used for this purpose but, in this case, it would be possible for the text to be rotated through 90Â° making it visible only from the end on or the perspective transformations applied could make it difficult to read. Annotation text solves the problem by adding the text to the object after it has been viewed and its position in Normalized Projection Coordinate (NPC) space established. The functions provided are:
ANNOTATION TEXT RELATIVE(RPX, RPY, APX, APY, CHARS) ANNOTATION TEXT RELATIVE 3 (RPX, RPY, RPZ, APX, APY, APZ, CHARS)
The 2D version has the Z-values of the positions set to Z=0.
The reference point, RP, defines a point in modelling coordinates to be annotated. This is transformed and projected to produce an equivalent point, RPN, in NPC coordinates. If RPN is outside any of the clipping regions specified by the modelling, viewing, or workstation clips, nothing appears. If not, the annotation text appears at the point RPN+AP. That is, AP defines an offset from the point to be annotated. The annotation text appears with this point as its origin. The text is output in the Z=RPN+AP plane and so appears parallel to the display surface.
Annotation text has a similar set of geometric attributes to normal text (annotation text character height etc) with functions to set each individually. It shares a common text bundle table with normal text.
The attribute ANNOTATION STYLE specifies the visual effect. If set to 1, the annotation text is output by itself. If set to 2, a line is drawn from RPN to RPN+AP as well. This is rendered as though it was defined as a polyline. Other values of ANNOTATION STYLE are implementation dependent (see Section 3.2.3).
13.4 GENERALIZED DRAWING PRIMITIVE
The functions are:
GENERALIZED DRAWING PRIMITIVE (N, PXA, PYA, PRIMID, LDR, DATREC) GENERALIZED DRAWING PRIMITIVE 3 (N, PXA, PYA, PZA, PRIMID, LDR, DATREC)
The 2D form has the PZA values set to 0. The first set of parameters define N points (PXA(I), PYA(I), PZA(I)) as I goes from 1 to N and these are used in the definition of the generalized drawing primitive (GDP). Other non-positional information associated with the GDP is defined in the data record DATREC of length LDR. This is constructed in the same way as the data record for INITIALIZE VALUATOR described in Section 10.2.4.
PRIMID identifies which of the set of GDP or GDP 3 primitives is required. Little can be said about GDPs as they are implementation dependent. They are provided to allow special primitives such as circles, ellipses, arcs and curves to be defined and implemented. They are allowed to use any of the attributes of the other primitives. For example, a filled area with the points on the boundary defined as markers and some text displayed in the filled area could be defined as a GDP.
The only constraint on the GDP defined is that it must behave like the other primitives under transformation. The geometry of the primitive must be transformed by the modelling and viewing transformations. Consequently, a circle cannot be specified as a single point and a radius value in the data record as this would still remain a circle under transformation. It has to be specified by at least three points so that the appropriate transformations take place.