INQUIRE PREDEFINED LIGHT SOURCE REPRESENTATION(3P+) — MISC. REFERENCE MANUAL PAGES
NAME
INQUIRE PREDEFINED LIGHT SOURCE REPRESENTATION − inquire a predefined light source representation
SYNOPSIS
C Syntax
void
pinqpredlightsrcrep ( wstype, index, error_ind, bundle )
Pwstypewstype;workstation type
Pintindex;predefined light source index
Pint∗error_ind;OUT error indicator
Plightsrcbundl∗bundle;OUT light source representation
FORTRAN Syntax
SUBROUTINE pqplsr ( WKTYPE, ILS, MLDR, ERRIND, LSTYPE, LDR, DATREC )
INTEGERWKTYPEworkstation type
INTEGERILSindex into predefined light source list
INTEGERMLDRdimension of data record array
INTEGERERRINDOUT error indicator
INTEGERLSTYPEOUT light source type
INTEGERLDROUT actual size of the data record
CHARACTER∗80(∗)DATREC(LDR) OUT data record
Required PHIGS Operating States
(PHOP, ∗, ∗, ∗)
DESCRIPTION
Purpose
INQUIRE PREDEFINED LIGHT SOURCE REPRESENTATION inquires an entry in the predefined light source table of a specified workstation type’s workstation description table.
This is a SunPHIGS Extension function based on PHIGS+ and is not part of the PHIGS standard.
C Input Parameters
All of the following data types are predefined in phigs.h.
wstypeThe workstation type.
indexIndex of the predefined entry to be returned.
C Output Parameters
error_ind
A pointer to the location to store the error number of any error detected by this function.
bundleA pointer to the location in which to return the light source representation. The Plightsrcbundl data structure contains values needed to define the specified type of light source representation. Plightsrcbundl is defined as:
typedef struct {
Pinttype;/∗ light source type ∗/
Plightsrcrecrec;/∗ light source data record ∗/
} Plightsrcbundl;
Plightsrcrec is defined as:
typedef union {
Pamblightsrcrecambient;
Pdirlightsrcrecdirectional;
Pposlightsrcrecpositional;
Pspotlightsrcrecspot;
} Plightsrcrec;
Pamblightsrcrec is defined as:
typedef struct {
Pgcolrcolour;/∗ light source colour ∗/
} Pamblightsrcrec;
Pgcolr is defined as:
typedef struct {
Pint type;/∗ indirect, RGB, CIE, HSV, HLS ∗/
union {
Pintindex;/∗ colour table index ∗/
struct {
Pfloatx;/∗ red, hue, etc. ∗/
Pfloaty;/∗ green, saturation, lightness, etc. ∗/
Pfloatz;/∗ blue, value, saturation, etc. ∗/
} general;
} val;
} Pgcolr;
Pdirlightsrcrec is defined as:
typedef struct {
Pgcolrcolour;/∗ light source colour ∗/
Pvector3dir;/∗ light source direction ∗/
} Pdirlightsrcrec;
Pgcolr is defined above. Pvector3 is defined as:
typedef struct {
Pfloatx;/∗ x magnitude ∗/
Pfloaty;/∗ y magnitude ∗/
Pfloatz;/∗ z magnitude ∗/
} Pvector3;
Pposlightsrcrec is defined as:
typedef struct {
Pgcolrcolour;/∗ light source colour ∗/
Ppoint3pos;/∗ light source position ∗/
Pfloatcoef[2];/∗ attenuation coefficients ∗/
} Pposlightsrcrec;
Pgcolr is defined above.
Ppoint3 is defined as:
typedef struct {
Pfloatx;/∗ x coordinate ∗/
Pfloaty;/∗ y coordinate ∗/
Pfloatz;/∗ z coordinate ∗/
} Ppoint3;
Pspotlightsrcrec is defined as:
typedef struct {
Pgcolrcolour;/∗ light source colour ∗/
Ppoint3pos;/∗ light source position ∗/
Pvector3dir;/∗ light source direction ∗/
Pfloatexp;/∗ concentration exponent ∗/
Pfloatcoef[2];/∗ attenuation coefficients ∗/
Pfloatangle;/∗ spread angle ∗/
} Pspotlightsrcrec;
Pgcolr, Ppoint3, and Pvector3 are defined above.
FORTRAN Input Parameters
WKTYPE
The workstation type for which the predefined light source representation is being inquired.
ILSThe index of the predefined entry to be returned.
MLDR
The dimension of the data record array, DATREC.
FORTRAN Output Parameters
ERRIND
A pointer to the location to store the error number of any error detected by this function.
LSTYPE
The light source type.
LDRThe actual size, in elements, returned in the data record.
DATREC(LDR)
The data record which must be unpacked by UNPACK DATA RECORD. The contents depend on the light source type. See SET LIGHT SOURCE REPRESENTATION for a description of its contents.
Execution
If the inquired information is available, the error indicator is returned as zero and values are returned in the output parameters.
See SET LIGHT SOURCE REPRESENTATION for the defined data record formats that may be returned in the data record parameter.
If the inquired information is not available, the values returned in the output parameters are undefined and the error indicator is set to one of the following error numbers to indicate the reason for nonavailability.
Since this is an inquiry function, ERROR HANDLING is not invoked when an error is detected by this function.
ERRORS
002Ignoring function, function requires state (PHOP,∗,∗,∗)
051Ignoring function, this information unavailable for this workstation type
052Ignoring function, workstation type not recognized by the implementation
062Ignoring function, this information is not available for this MO workstation type
102Ignoring function, specified representation has not been predefined on this workstation
614Ignoring function, the general interior index is less than one
SEE ALSO
SET LIGHT SOURCE REPRESENTATION (3P+)
SET LIGHT SOURCE STATE (3P+)
INQUIRE LIST OF LIGHT SOURCE INDICES (3P+)
INQUIRE LIGHT SOURCE REPRESENTATION (3P+)
INQUIRE LIGHT SOURCE FACILITIES (3P+)
Sun Release 4.0 — Last change: 7 July 1989