Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ generalized_drawing_primitive_-9(3P) — PHIGS 1.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

GENERALIZED DRAWING PRIMITIVE -9(3P)  —  SUNPHIGS LIBRARY

NAME

GENERALIZED DRAWING PRIMITIVE -9 − create a 2D GDP elliptical arc

SYNOPSIS

C Syntax

void
pgdp ( num_points, points, gdp_id, gdp_data )
Pintnum_points;number of points
Ppoint∗points;array of points
Pintgdp_id;gdp function identifier
Pgdprec∗gdp_data;data record pointer

FORTRAN Syntax

SUBROUTINE pgdp ( N, PXA, PYA, PRIMID, LDR, DATREC )
INTEGERNnumber of points (>= 0)
REALPXA(∗), PYA(∗)coordinates of points (MC)
INTEGERPRIMIDGDP identifier
INTEGERLDRdimension of data record array
CHARACTER∗80DATREC(LDR) data record

Required PHIGS Operating States

(PHOP, ∗, STOP, ∗)

DESCRIPTION

Purpose

GENERALIZED DRAWING PRIMITIVE -9 creates the elliptical arc element. 

C Input Parameters

num_points
The number of points passed in the points parameter.

pointsA pointer to a list num_points long of Ppoint structures containing x and y values in Modelling Coordinates (MC).  Ppoint is defined in phigs.h as:

typedef struct {
Pfloatx;/∗ x coordinate ∗/
Pfloaty;/∗ y coordinate ∗/
} Ppoint;

gdp_id
The function identifier for this generalized drawing primitive is PUGDP_ELLP_ARC, which is defined in phigs.h to be -9. 

gdp_data
A pointer to a Pgdprec union, ugdp9_datarec, containing the information needed to perform the function specified by gdp_id.  Pugdp0009rec is defined in phigs.h as:

typedef struct {
Ppointcenter;/∗ center point ∗/
Pvectormajor;/∗ major axis ∗/
Pvectorminor;/∗ minor axis ∗/
Pfloatst_ang;/∗ start angle ∗/
Pfloatend_ang;/∗ end angle ∗/
} Pugdp0009rec;           /∗ elliptical arc ∗/

The center component specifies the center of the elliptical arc.  It is a structure containing x and y coordinates specified in MC.  The major component specifies the length and direction of the major axis relative to the center point.  The minor component specifies the minor axis.  The st_ang component specifies the start angle of the elliptical arc.  The end_ang component specifies the end angle of the elliptical arc.  The horizontal and vertical axes of the Ellipse Local Coordinate (ELC) system are defined by the major and minor axes.  The angles are specified in radians in a counter-clockwise direction with the ELC positive xaxis as the origin. 

FORTRAN Input Parameters

NNumber of points passed in the PXA and PYA arrays. 

PXAAn array of N real values containing x coordinates in MC. 

PYAAn array of N real values containing y coordinates in MC. 

PRIMID
The function identifier for this generalized drawing primitive is PUGDPELLPARC, which is defined in phigs77.h to be -9. 

LDRThe dimension of DATREC (returned by the PACK DATA RECORD subroutine). 

DATREC
A  GDP data record packed by the PACK DATA RECORD subroutine containing the information needed to perform the function specified by PRIMID. 

The arguments passed to PACK DATA RECORD when PRIMID = PUGDPELLPARC should be as follows:

ILThe number of integers = 0. 

RLThe number of real values = 8. 

RAContains an array of RL real values.  Element 1 is the x coordinate of the center of the elliptical arc in MC.  Element 2 is the y coordinate of the center of the elliptical arc in MC.  Element 3 is the x component of the ellipse major axis in MC.  Element 4 is the y component of the ellipse major axis in MC.  Element 5 is the x component of the ellipse minor axis in MC.  Element 6 is the y component of the ellipse minor axis in MC.  Element 7 is the start angle of the elliptical arc in radians.  Element 8 is the end angle of the elliptical arc in radians. 

SLThe number of strings = 0. 

Execution

An elliptical arc is a curve defined by a center point, a major axis, a minor axis, a start angle, and an end angle.  The Ellipse Local Coordinate (ELC) system is located at the center point on the z = 0 plane. The horizontal and vertical axes of CLC are defined by the major and minor axes repectively.  The current values of all polyline attributes will be applied to the elliptical arc when it is drawn.  The elliptical arc is rendered according to the current curve approximation criteria. 

The center point and major and minor axes of the elliptical arc are specified in MC.  The start and end angle are specified in radians in a counter-clockwise direction with the CLC positive x axis as the origin.  At traversal, the circular arc in MC is transformed by the current local and global modelling transformations, the view representation selected by the current view index, and the workstation transformation current on the workstation to which the structure is posted.  An elliptical arc greater than 360 degrees is drawn as a hollow ellipse. 

The array of points passed to this subroutine in addition to the GDP data record is not used by the elliptical arc GDP. 

Attributes Applied

The attributes listed below are used to display the GENERALIZED DRAWING PRIMITIVE -9 structure element. The Aspect Source Flags (ASFs) tell where to access the output display attributes.  These attributes can come directly from the traversal state list, or they can be accessed indirectly, using the appropriate index in the traversal state list and the corresponding bundled representation in the workstation state list. 

polyline colourpolyline colour index ASF
linewidth scale factorlinewidth scale factor ASF
linetypelinetype ASF
polyline shading methodpolyline shading method ASF
curve approximation criteriacurve approximation criteria ASF
polyline index
depth cue index
name set

ERRORS

005Ignoring function, function requires state (PHOP, ∗, STOP, ∗)

SEE ALSO

GENERALIZED DRAWING PRIMITIVE (3P)
SET CURVE APPROXIMATION CRITERIA (3P+)
See Line Attributes in Index

Sun Release 4.0  —  Last change:  27 July 1989

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