Sun Microsystems 800-1256-04 — Sun Microsystems 800-1256-04 SunCGI Reference Manual PDF

40 SunCGI Reference Manual 0 #include main() /* draws four quadrants in different colors*/ { Ccoor cl; Cint name, radius; Cvwsurf device; cl.x = 16000; /*center*/ cl.y = 16000; NORMAL_VWSURF(device, CGPIXWINDD); radius= 8000; /*radius*/ open_cgi () ; open_vws(&name, &device); interior_style(SOLIDI, OFF); fill_color(l); /* color of quadrant 1 */ circular_arc_center_close(&cl, 24000, 16000, 16000, 24000, radius, PIE); fill_color(2); /* color of quadrant 2 */ circular_arc_center_close(&cl, 16000, 24000, 8000, 16000, radius, PIE); fill_color (3); /* co.lor of.

quadrant 3 * / circular_arc_center_close(&cl, 8000, 16000, 16000, 8000, radius, PIE); fill_color(4); /* color of quadrant 4 */ circular_arc_center_close(&cl, 16000, 8000, 24000, 16000, radius, PIE); 0 sleep(lO); close_vws(narne); close_cgi (); Figure 3-2 Example Program with Four Circle Quadrants in Different Colors Errors ENOTVSAC [4] CGI not in proper state: CGI shall be in state VSAC. EARCPNCI (64] Arc points do not lie on circle. Circular Arc 3pt Cerror circular_arc_3pt(cl, c2, c3) Ccoor *cl, *c2, *c3; /* starting, intermediate and ending points*/ circular_arc_3pt draws a circular arc starting at point cl and ending at point c3 which is guaranteed to pass through point c2 .

The line attributes func- tions described in Section 4.2 detennine the appearance of the circular _arc_ 3pt function. If the circular arc is textured (for example, O dotted) then the intennediate point may not be displayed. However, if the arc is · solid, the intennediate point is always drawn. If the three points are colinear, a Version C of 17 March 1986