Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ gsecnv(3) — AIX/RT 2.2.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

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 ellip-
     tical 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 con-
     catenated 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 non-zero  major and  minor
               axes of the ellipse.

     ang       Defines the off-axis angle  of the ellipse.  If
               ang is zero,  the major axis is  the x-axis and
               the minor axis is the y-axis.  A positive value
               rotates the  ellipse counterclockwise;  a nega-
               tive  value rotates  it clockwise.   All values
               are in degrees and modulo 360.

     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 Y pre + 1.

               All  other precision  values  are reserved  and
               must not  be used, as their  results are unpre-
               dictable.  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 speci-
     fied 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  set to
     zero.  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.

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026