GENERALIZED DRAWING PRIMITIVE 3 -8(3P) — SUNPHIGS LIBRARY
NAME
GENERALIZED DRAWING PRIMITIVE 3 -8 − create 3D GDP ellipse 3
SYNOPSIS
C Syntax
void
pgdp3 ( num_points, points, gdp3_id, gdp_data )
Pintnum_points;number of points
Ppoint3∗points;array of points
Pintgdp3_id;gdp function identifier
Pgdprec3∗gdp_data;data record pointer
FORTRAN Syntax
SUBROUTINE pgdp3 ( N, PXA, PYA, PZA, PRIMID, LDR, DATREC )
INTEGERNnumber of points (>= 0)
REALPXA(∗), PYA(∗), PZA(∗) coordinates of points (MC)
INTEGERPRIMIDGDP 3 identifier
INTEGERLDRdimension of data record array
CHARACTER∗80DATREC(LDR) data record
Required PHIGS Operating States
(PHOP, ∗, STOP, ∗)
DESCRIPTION
Purpose
GENERALIZED DRAWING PRIMITIVE 3 -8 creates the 3D ellipse 3 GDP structure element.
C Input Parameters
num_points
Number of points passed in the points parameter.
pointsA pointer to a list num_points long of Ppoint3 structures containing x, y, and z values in Modelling Coordinates (MC). Ppoint3 is defined in phigs.h as:
typedef struct {
Pfloatx;/∗ x coordinate ∗/
Pfloaty;/∗ y coordinate ∗/
Pfloatz;/∗ z coordinate ∗/
} Ppoint3;
gdp3_id
The function identifier for this generalized drawing primitive is PUGDP_ELLIPSE3, which is defined in phigs.h to be -8.
gdp_data
A pointer to a Pgdprec3 union, ugdp8_datarec, containing the information needed to perform the function specified by gdp_id. Pugdp0008rec3 is defined in phigs.h as:
typedef struct {
Ppoint3center;/∗ center point ∗/
Pvector3major;/∗ major axis ∗/
Pvector3minor;/∗ minor axis ∗/
} Pugdp0008rec3; /∗ ellipse 3 ∗/
The center component specifies the center of the ellipse 3. It is a structure containing x, y, and z coordinates specified in MC. The major component specifies the length and direction of the major axis relative to the center point. It is a Pvector3 structure defined in phigs.h as:
typedef struct {
Pfloatx;/∗ x magnitude ∗/
Pfloaty;/∗ y magnitude ∗/
Pfloatz;/∗ z magnitude ∗/
} Pvector3;
The minor component specifies the minor axis of the ellipse 3. The x and y magnitudes of the major and minor axes of the ellipse 3 are specified in MC. The horizontal and vertical axes of the Ellipse Local Coordinate (ELC) system are defined by the major and minor axes.
FORTRAN Input Parameters
NNumber of points passed in the PXA, PYA, and PZA arrays.
PXAAn array of N real values containing x coordinates in MC.
PYAAn array of N real values containing y coordinates in MC.
PZAAn array of N real values containing z coordinates in MC.
PRIMID
The function identifier for this generalized drawing primitive is PUGDPELLP3, which is defined in phigs77.h to be -8.
LDRThe dimension of DATREC (returned by the PACK DATA RECORD subroutine).
DATREC
A GDP 3 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 = PUGDPELLP3 should be as follows:
ILThe number of integers = 0.
RLThe number of real values = 9.
RAContains array of RL real values. Element 1 is the x coordinate of the center of the ellipse 3 in MC. Element 2 is the y coordinate of the center of the ellipse 3 in MC. Element 3 is the z coordinate of the center of the ellipse 3 in MC. Element 4 is the x component of the ellipse 3 major axis in MC. Element 5 is the y component of the ellipse 3 major axis in MC. Element 6 is the z component of the ellipse 3 major axis in MC. Element 7 is the x component of the ellipse 3 minor axis in MC. Element 8 is the y component of the ellipse 3 minor axis in MC. Element 9 is the z component of the ellipse 3 minor axis in MC.
SLThe number of strings = 0.
Execution
An ellipse 3 is a planar area defined by a center point, a major axis, and a minor axis. Let P be the center point defined in the MC, and U and V be the major and minor axes respectively. The plane on which the ellipse 3 lies is a plane that contains P and is perpendicular to U x V. The origin of the ELC system is located at the center point. The horizontal and vertical axes of the Circle Local Coordinate (CLC) system are defined by the major and minor axes. The positive x axis of the ELC system is parallel to U. Let T be a vector perpendicular to U in the ellipse 3 plane. If T.V is positive, then the positive y axis is parallel to T; otherwise, the positive y axis is opposite to T. In the event that the magnitudes of both axes are zero, the ellipse 3 is displayed as a dot (.) at the center point. In the event that the magnitude of only one of the axes is zero, the ellipse 3 is displayed as a line of correct magnitude along the other axis. If the major and minor axes fail to define the local coordinate system (i.e. the vectors are parallel and non-zero), a minor axis perpendicular to the major axis with the correct magnitude is used to display the ellipse 3. The current values of all fill area set attributes will be applied to the ellipse 3 when it is drawn. The ellipse 3 is rendered according to the current curve approximation criteria.
The center point and major and minor axes are specified in MC. At traversal, the ellipse 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.
The array of points passed to this subroutine in addition to the GDP data record is not used by the ellipse 3 GDP.
Attributes Applied
The attributes listed below are used to display the GENERALIZED DRAWING PRIMITIVE 3 -8 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.
interior colourinterior colour index ASF
back interior colourback interior colour ASF
interior styleinterior style ASF
back interior styleback interior style ASF
interior style indexinterior style index ASF
back interior style indexback interior style index ASF
interior shading methodinterior shading method ASF
back interior shading methodback interior shading method ASF
interior reflectance equation interior reflectance equation ASF
back interior reflectance equationback interior reflectance equation ASF
area propertiesarea properties ASF
back area propertiesback area properties ASF
interior index
edge colouredge colour index ASF
edge flagedge flag ASF
edgetypeedgetype ASF
edgewidth scale factoredgewidth scale factor ASF
edge index
face distinguishing mode
face culling mode
depth cue index
light source state
name set
ERRORS
005Ignoring function, function requires state (PHOP, ∗, STOP, ∗)
SEE ALSO
GENERALIZED DRAWING PRIMITIVE 3 (3P)
SET CURVE APPROXIMATION CRITERIA (3P+)
See Edge Attributes in Index
See Interior Attributes in Index
Sun Release 4.0 — Last change: 27 July 1989