All Frameworks  Class Hierarchy  This Framework  Previous  Next  Indexes

VisualizationBase Class CAT3DLightSourceGP

System.IUnknown
  |
  +---System.IDispatch
    |
    +---System.CATBaseUnknown
      |
      +---VisualizationBase.CATGraphicPrimitive
        |
        +---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 Get(CATLightSourceType&,CATLightSourceMode&,CATMathPointf&,CATMathDirectionf&,float*,float*,float*,float*,float*)
Retrieves the parameters of a light source.
o GetColor(float*[4],float*[4],float*[4])
Retrieves the color components of the 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(CATLightSourceType iType,
CATLightSourceMode iMode,
const CATMathPointf& iOrigin,
const CATMathDirectionf& iDirection,
const float iSpotAngle= 180.f,
const float iSpotExponent= 0.f,
const float iConstantAttenuation= 1.f,
const float iLinearAttenuation= 0.f,
const float 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 Get
public inline void Get(CATLightSourceType& iType,
CATLightSourceMode& oMode,
CATMathPointf& oOrigin,
CATMathDirectionf& oDirection,
float* oSpotAngle,
float* oSpotExponent,
float* oConstantAttenuation,
float* oLinearAttenuation,
float* 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 GetColor
public inline void GetColor( const float*[4] oAmbient,
const float*[4] oDiffuse,
const float*[4] 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 SetColor
public inline void SetColor( const float[4] iAmbient,
const float[4] iDiffuse,
const float[4] 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.