All Frameworks  Class Hierarchy  This Framework  Indexes   

VisualizationBase Class CAT3DLightSourceGP

Usage: you must use this class as is. You should never derive it.


public class CAT3DLightSourceGP

Class to create light source graphic primitives.
Role: A light source graphic primitive indicates the position and orientation of lights in the viewer. A light source can be of two different types :
LS_INFINITE infinitely distant like the sun, LS_SPOT spotlight with a cutoff angle between 0 and 90 degrees, or equal to 180 degrees (lightbulb equivalent) A light source can be of two differents modes :
Local attached to the viewpoint Global attached to the model By default, one light source is created and activated. A viewer can handle a maximum of eight light source graphic primitives. To add a light source, prefer adding a CAT3DLightSourceRep.


Constructor and Destructor Index


o CAT3DLightSourceGP()
Constructs an empty light source graphic primitive of type LS_INFINITE.
o CAT3DLightSourceGP(CATLightSourceType,CATLightSourceMode,CATMathPointf&,CATMathDirectionf&,float,float,float,float,float)
Constructs a light source graphic primitive.

Method Index


o GetColor(float*[4],float*[4],float*[4])
Retrieves the color components of the light source.
o Get(CATLightSourceType&,CATLightSourceMode&,CATMathPointf&,CATMathDirectionf&,float*,float*,float*,float*,float*)
Retrieves the parameters of a light source.
o SetColor(float[4],float[4],float[4])
Sets the color components of the light source.

Constructor and Destructor


o CAT3DLightSourceGP
public CAT3DLightSourceGP()
Constructs an empty light source graphic primitive of type LS_INFINITE.
o CAT3DLightSourceGP
public CAT3DLightSourceGP( iType,
iMode,
const iOrigin,
const iDirection,
const iSpotAngle= 180.f,
const iSpotExponent= 0.f,
const iConstantAttenuation= 1.f,
const iLinearAttenuation= 0.f,
const iQuadraticAttenuation= 0.f)
Constructs a light source graphic primitive.
Parameters:
iType
The type of the light source.
iMode
The mode of the light source.
iOrigin
The location of the light source.
iDirection
The direction of the light source.
iSpotAngle
The cutoff angle of a spotlight.
iSpotExponent
value used for specular component calculations
iConstantAttenuation
The constant factor of the attenuation equation.
iLinearAttenuation
The linear factor of the attenuation equation.
iQuadraticAttenuation
The quadraric factor of the attenuation equation.

Methods


o GetColor
public GetColor( const oAmbient,
const oDiffuse,
const oSpecular)
Retrieves the color components of the light source. All float values are in [0,1].
Parameters:
oAmbient
Red, green, blue and alpha values of ambient component.
oDiffuse
Red, green, blue and alpha values of diffuse component.
oSpecular
Red, green, blue and alpha values of specular component.
o Get
public Get( iType,
oMode,
oOrigin,
oDirection,
oSpotAngle,
oSpotExponent,
oConstantAttenuation,
oLinearAttenuation,
oQuadraticAttenuation)
Retrieves the parameters of a light source.
Parameters:
iType
The type of the light source.
oMode
The mode of the light source.
oOrigin
The point where the light source is located. This parameter has no meaning for LS_INFINITE light sources.
oDirection
The direction of the light source.
oSpotAngle
The half-angle aperture of the cone of the spotlight.
oSpotExponent
The exponent value used for specular component calculations.
oConstantAttenuation
The constant factor of the attenuation function.
oLinearAttenuation
The light factor of the attenuation function.
oQuadraticAttenuation
The quadratic factor of the attenuation function.
o SetColor
public SetColor( const iAmbient,
const iDiffuse,
const iSpecular)
Sets the color components of the light source. All float values are in [0,1].
Parameters:
iAmbient
Red, green, blue and alpha values of ambient component.
iDiffuse
Red, green, blue and alpha values of diffuse component.
iSpecular
Red, green, blue and alpha values of specular component.

This object is included in the file: CAT3DLightSourceGP.h
If needed, your Imakefile.mk should include the module: CATViz

Copyright © 2003, Dassault Systèmes. All rights reserved.