GSECNV(3g,L) AIX Technical Reference GSECNV(3g,L) ------------------------------------------------------------------------------- gsecnv PURPOSE Converts an ellipse to a polyline. C SYNTAX int gsecnv_ (cx, cy, ma, mi, ang, bx, by, ex, ey, rot, len, x, y, pre) int *cx, *cy, *ma, *mi, *ang, *bx, *by, *ex, *ey, *rot, *len, *x, *y, *pre; FORTRAN SYNTAX INTEGER function gsecnv (cx, cy, ma, mi, ang, bx, by, ex, ey, rot, len, x, y, pre) INTEGER cx, cy, ma, mi, ang, bx, by, ex, ey, rot, len, x(*), y(*), pre PASCAL SYNTAX FUNCTION gsecnv_ ( VAR cx, cy, ma, mi, ang, bx, by, ex, ey, rot, len: INTEGER; VAR x, y: ARRAY [1..k] of INTEGER; VAR pre: INTEGER ): INTEGER [PUBLIC]; DESCRIPTION The gsecnv subroutine converts a counterclockwise elliptical arc definition into an array of vertices. The list of vertices can then be used to draw an elliptical arc with the gspoly subroutine or to fill an elliptical arc with the gsfply subroutine. In general, it can be concatenated with other list(s) of vertices to draw or fill more complex shapes, such as chord arcs, pie arcs, or rectangles with round corners. When the beginning and ending points are identical, the list of vertices contains the full ellipse, which can then be drawn or filled. Parameters cx, cy Define the coordinates of the center of the ellipse. ma, mi Define half of the nonzero major and minor axes of the ellipse. ang Defines the off-axis angle of the ellipse. If ang is 0, the major axis is the x-axis and the minor axis is the y-axis. A positive value rotates the ellipse counterclockwise; a negative value rotates it clockwise. All values are in degrees and modulo 360. Processed November 7, 1990 GSECNV(3g,L) 1 GSECNV(3g,L) AIX Technical Reference GSECNV(3g,L) bx, by Define the coordinates of the beginning point of the arc. ex, ey Define the coordinates of the ending point of the arc. rot Specifies whether the application must perform rotational transformation. Possible settings are: 0 The coordinates of the beginning and ending points passed by the application correspond to an arc of an orthogonal ellipse. No rotational transformation is performed, thus improving performance. 1 The beginning and ending points are transformed by the application and lie on the off-axis ellipse. All other values are reserved and must not be used, as they may produce unpredictable results. len Defines the number of points in the coordinate x and y arrays. It must be numerically at least one greater than the value contained in the precision parameter and greater than or equal to 65. x, y Define, as coordinate arrays, the vertices that represent the elliptical shape when drawn or filled. pre Defines precision level, which specifies the maximum number of line segments that can be generated for a full ellipse. The number of line segments actually generated depends on the size of the ellipse. There are four levels of precision that can be requested: o 64 (65 vertices) o 128 (129 vertices) o 256 (257 vertices) o 512 (513 vertices). Therefore, len => pre + 1. All other precision values are reserved and must not be used, as their results are unpredictable. The default value for pre is 64. The subroutine allows ample leniency toward the accuracy of the specification of the beginning and ending points. The arc of the specified angle always starts and ends exactly at the specified points. If the beginning and ending points are identical, a full ellipse of the specified angle is generated. When the subroutine is invoked, the length parameter must contain the maximum number of entries in the x and y arrays. If erroneous conditions arise, len is Processed November 7, 1990 GSECNV(3g,L) 2 GSECNV(3g,L) AIX Technical Reference GSECNV(3g,L) set to 0. Under normal conditions, len specifies the number of vertices returned by the subroutine in the x and y arrays. For Pascal, the application must declare the arrays passed as being fixed length and declare the routine as accepting arrays of that length; the k in the routine declaration must be a constant. RETURN VALUE GS_SUCC Successful. GS_CORD Invalid coordinate. GS_NCOR Invalid number of coordinates. Processed November 7, 1990 GSECNV(3g,L) 3