PQLSR(3g) — Subroutines
Name
PQLSR − Returns light source type information.
Operating States: PHOP, WSOP, ∗, ∗
PHIGS PLUS function
Old Syntax
DQLSR (WKID, LSI, MLDR, TYPE, ERRIND, LSTYPE, LDR, DATREC)
Argument Data Type Access Description
---------------------------------------------------------------------------
WKID Integer Read Workstation identifier
LSI Integer Read Light source index
MLDR Integer Read Length of data record
TYPE Integer Read Type of values to return
ERRIND Integer Write Error indicator
LSTYPE Integer Write Light source type
LDR Integer Write Number of array elements used in
DATREC
DATREC(MLDR) Character ∗80 Write Data record
---------------------------------------------------------------------------
New Syntax
PQLSR (WKID, LSI, TYPE, MLDR, ERRIND, LSTYP, LDR, DATREC)
Argument Data Type Access Description
---------------------------------------------------------------------------
WKID Integer Read Workstation identifier
LSI Integer Read Light source index
TYPE Integer Read Type of values to return
MLDR Integer Read Length of data record
ERRIND Integer Write Error indicator
LSTYP Integer Write Light source type
LDR Integer Write Number of array elements used in
DATREC
DATREC(MLDR) Character ∗80 Write Data record
---------------------------------------------------------------------------
Constants
Defined Argument Constant Description
---------------------------------------------------------------------------
TYPE PSET Use the exact state list values.
PREALI Use the values approximated by the
graphics handler.
LSTYP PAMB Ambient light.
PDIRE Infinite (directional) light.
PPOSI Positional light.
PSPOT Spot light.
---------------------------------------------------------------------------
Description
PQLSR queries the workstation state list and returns the light source type and a data record that describes the light source.
Data Record Information
If LSTYP is PAMB, the data record format is as follows:
INTEGER IL = 2 Number of integer values
INTEGER IA(1) = Color type
INTEGER RL = ∗ Actual data of the color values as required by CT
RA() =
SL = 0
LSTR = ()
STR = ()
If the color type is PINDIR:
IA(2) = Color index
If the color type is PRGB, PCIE, PHSV, or PHLS:
IA(2) = Number of color value components (NCC)
RA = Elements 1 through NCC contain the color values
If LSTYP is PDIRE, the data record format is as follows:
INTEGER IL = 2 Number of integer values
INTEGER IA(1) = Color type
INTEGER RL = 3+∗
REAL RA(1) = x-value of the direction vector, in
world coordinates
REAL RA(2) = y-value of the direction vector, in
world coordinates
REAL RA(3) = z-value of the direction vector, in
world coordinates
SL = 0
LSTR = ()
STR = ()
If the color type is PINDIR:
IA(2) = Color index
If the color type is PRGB, PCIE, PHSV, or PHLS:
IA(2) = Number of color value components (NCC)
RA = Elements 4 through 3+NCC contain the color values
If LSTYP is PPOSI, the data record format is as follows:
INTEGER IL = 2 Number of integer values
INTEGER IA(1) = Color type
INTEGER RL = 5+∗ Number of real values
REAL RA(1) = x-value of the direction vector, in
world coordinates
REAL RA(2) = y-value of the direction vector, in
world coordinates
REAL RA(3) = z-value of the direction vector, in
world coordinates
REAL RA(4) = Attenuation coefficient 1
REAL RA(5) = Attenuation coefficient 2
SL = 0
LSTR = ()
STR = ()
If the color type is PINDIR:
IA(2) = Color index
If the color type is PRGB, PCIE, PHSV, or PHLS:
IA(2) = Number of color value components (NCC)
RA = Elements 6 through 5+NCC contain the color values
If LSTYP is PSPOT, the data record format is as follows:
INTEGER IL = 2 Number of integer values
INTEGER IA(1) = Color type
INTEGER RL = 10+∗ Number of real values
REAL RA(1) = x-coordinate of the light source position,
in world coordinates
REAL RA(2) = y-coordinate of the light source position,
in world coordinates
REAL RA(3) = z-coordinate of the light source position,
in world coordinates
REAL RA(4) = x-value of the light source direction,
in world coordinates
REAL RA(5) = y-value of the light source direction,
in world coordinates
REAL RA(6) = z-value of the light source direction,
in world coordinates
REAL RA(7) = Concentration exponent
REAL RA(8) = Attenuation coefficient 1
REAL RA(9) = Attenuation coefficient 2
REAL RA(10) = Spread angle, in radians
SL = 0
LSTR = ()
STR = ()
If the color type is PINDIR:
IA(2) = Color index
If the color type is PRGB, PCIE, PHSV, or PHLS:
IA(2) = Number of color value components (NCC)
RA = Elements 11 through 10+NCC contain the color values
See Also
PQLSF
PQELSI
PQPLSR
PSLSR
PSLSS