Sun Microsystems 800-1256-04 — Sun Microsystems 800-1256-04 SunCGI Reference Manual PDF (EN)

34 SunCGI Reference Manual 0 typedef struct Cint x; Cint y; Ccoor; typedef struct Ccoor *ptlist; Cint n; Ccoorlist; The element ptlist is really a pointer to an array of type Ccoor which contains the n coordinates of the points defining the primitive. The style, color, and other features of lines, markers, and fill patterns used by geometrical output primitives are set by the attribute functions described in Chapter 4. The polygons generated by SunCGI may or may not be closed. SunCGI automatically assumes the polygon is closed for the purpose of filling. However, a polygon must be explicitly closed in order to get all of its edges drawn, so take care to generate explicitly closed polygons.

The rectangle function impli- citly generates closed objects. 8 SunCGI has two classes of conical primitives: circular and elliptical. Each class has functions for drawing solid objects, arcs, and closed arcs. Drawing of conical primitives is regulated by the same attributes that regulate the drawing of polygons and polylines. 0 Polyline Cerror polyline(polycoors) Ccoorlist *polycoors; /* list of points*/ polyline draws lines between the points specified by the ptlist element of polycoors. polyline does not draw a line between the first and last element of the point list To generate a closed polyline, the last point on the list must have the same coordinates as the first point on the list.

The style, color, and width of the lines are set by the polyline_bundle_index, line_type, line_color,line_widthandline_width_specification_mode functions. If a line segment of a polyline has a length of zero, the line is not drawn. To draw a point, use the circle function. If you specify a polyline that has less than two points, an error is generated. Similarly, if the number of points specified is greater than the maximum number of points (MAXPTS) an error is generated. Errors ENOTVSAC [4] CGI not in proper state: CGI shall be in state VSAC. ENMPTSTL [60] Number of points is too large. EPLMTWPT [61] polylines must have at least two points.

Disjoint Polyline 8 A closed portion of a closed figure boundary will not be drawn if it exceeds a clipping boundary. 0 Version C of 17 March 1986