Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ gsccnv(3) — AIX/RT 2.2.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

gsccnv

Purpose

     Converts a circular arc or full circle into a polyline.

C Syntax

     int gsccnv_ (cx, cy, cr, bx, by, ex, ey, len, x, y, pre)

     int *cx, *cy, *cr, *bx, *by, *ex, *ey, *len, *x, *y, *pre;

FORTRAN Syntax

     INTEGER function gsccnv (cx, cy, cr, bx, by, ex, ey, len, x, y, pre)

     INTEGER cx, cy, cr, bx, by, ex, ey, len, x(*), y(*), pre

Pascal Syntax

     FUNCTION gsccnv_ (

     VAR cx, cy, cr, bx, by, ex, ey, len: INTEGER;
     VAR x, y: ARRAY [1..k| of INTEGER;
     VAR pre: INTEGER
     ): INTEGER [PUBLIC|;

Description

     The  gsccnv subroutine  converts a  counterclockwise cir-
     cular arc definition into an array of vertices.  The list
     of vertices can then be used  to draw a circular arc with
     the gspoly subroutine or to  fill a circular 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, and rectan-
     gles with rounded corners.

     When beginning and ending  points are identical, the list
     of vertices contains  the full circle, which  can then be
     drawn or filled.

     Parameters

     cx, cy    Define  the coordinates  of the  center of  the
               circle.

     cr        Defines the  radius of  the circle,  which must
               not be equal to zero.

               If  cr is  negative, it  is automatically  con-
               verted to a positive value  for use by the sub-
               routine.

     bx, by    Define the  coordinates of the  beginning point
               of the arc.

     ex, ey    Define the  coordinates of the ending  point of
               the arc.

     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, but not less than 65.

     x, y      Define, as coordinate arrays, the vertices that
               represent  the  circular  shape when  drawn  or
               filled.

     pre       Defines  precision level,  which specifies  the
               maximum  number of  line segments  that can  be
               generated  for a  full circle.   The number  of
               line segments actually generated depends on the
               size of the circle.

               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 radius will always start and end
     exactly at the specified points.

     If the beginning and ending  points are identical, a full
     circle of the specified radius 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