Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ generalized_drawing_primitive_3_-1(3P) — PHIGS 1.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

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

NAME

GENERALIZED DRAWING PRIMITIVE 3 -1 − create 3D GDP polyline set 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 -1 creates the 3D polyline set 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_POLYLINE_SET3, which is defined in phigs.h to be -1. 

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

typedef struct {
Pintn_sets;/∗ number of sets ∗/
Ppointlst3∗sets;/∗ list of sets ∗/
} Pugdp0001rec3;           /∗ polyline set ∗/

The n_sets component specifies the number of sets of 3D polylines in the polyline set 3. The sets component is a pointer to a list, n_sets long, of Ppointlst3 structures. Each Ppointlst3 structure defines one of the polylines in the set.  Ppointlst3 is defined in phigs.h as:

typedef struct {
Pintnumber;/∗ number of points in the list ∗/
Ppoint3∗points;/∗ pointer to list of points ∗/
} Ppointlst3;

The number component specifies the number of points used to define a polyline. The points component is a pointer to a list, number long, of Ppoint3 structures which contain the x, y, and z coordinates of each vertex of the polyline, in MC. 

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 PUGDPPLS3, which is defined in phigs77.h to be -1. 

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 = PUGDPPLS3 should be as follows:

ILThe number of point lists, or sets of polylines, to be specified. 

IAAn array of IL integers containing the end indices for each point list in the polyline set 3. 

RLThe number of real values = 3 ∗ IA(IL). 

RAAn array of RL real values containing the x, y and z coordinates of the polyline set 3.  Elements 1 through IA(IL) contain the x components of the polyline set 3.  Elements IA(IL) + 1 through 2 ∗ IA(IL) contain the y components of the polyline set 3.  Elements 2∗IA(IL) + 1 through 3 ∗ IA(IL) contain the z components of the polyline set 3. 

The first polyline in the set is defined by the x coordinates in RA from 1 to IA(1) and by the y coordinates in RA from IA(IL) + 1 to IA(IL) + IA(1) and by the z coordinates in RA from 2∗IA(IL) + 1 to 2∗IA(IL) + IA(1).  The second polyline in the set is defined by the x coordinates in RA from IA(1) + 1 to IA(2) and by the y coordinates in RA from IA(IL) + IA(1) + 1 to IA(IL) + IA(2) and by the z coordinates in RA from 2∗IA(IL) + IA(1) + 1 to 2∗IA(IL) + IA(2). 

SLThe number of strings = 0. 

Execution

A polyline set 3 is a set of unconnected polylines defined by a set of point sequences; each point sequence in the set generates connected line segments.  When the structure is traversed, the GDP 3 element draws the specified number of polylines using the points in the GDP 3 data record.  The current values of all polyline attributes will be applied to the polyline set when it is drawn. 

The points are specified in MC. These may be any coordinate units that are convenient to the application.  At traversal, these coordinates are 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 polyline set 3 GDP. 

Attributes Applied

The attributes listed below are used to display the GENERALIZED DRAWING PRIMITIVE 3 -1 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 3 (3P)
See Attributes, Line in Index

Sun Release 4.0  —  Last change: 27 July 1989

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