All Frameworks  Class Hierarchy  This Framework  Previous  Next  Indexes

VisualizationBase Class CAT3DLightSourceRep

System.IUnknown
  |
  +---System.IDispatch
    |
    +---System.CATBaseUnknown
      |
      +---VisualizationBase.CATRep
        |
        +---VisualizationBase.CAT3DRep
          |
          +---CAT3DLightSourceRep
 

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


public class CAT3DLightSourceRep

Class to create light source representations.
Role: A light source representation indicates the position and orientation of lights in the viewer. A light source representation can be of two different types :

  1. LS_INFINITE infinitely distant like the sun,
  2. LS_SPOT spotlight with a cutoff angle between 0 and 90 degrees, or equal to 180 degrees (lightbulb equivalent)
A light source representation can be of two differents modes :
  1. Local attached to the viewpoint
  2. Global attached to the model
By default, one light source is created and activated. A viewer can handle a maximum of eight light source representations.


Constructor and Destructor Index


o CAT3DLightSourceRep()
Constructs an empty light source graphic representation.
o CAT3DLightSourceRep(CAT3DLightSourceRep&)
Copy constructor.
o CAT3DLightSourceRep(CATLightSourceType,CATLightSourceMode,CATMathPointf&,CATMathDirectionf&,float)
Constructs the representation of a light source.
o ~CAT3DLightSourceRep()

Method Index


o GetAttenuationParameters(float&,float&,float&)
Retrieves the attenuation parameters of the light source representation.
o GetColorParameters(float**,float**,float**)
Retrieves the color components of the light source representation.
o GetLocationParameters(CATMathPointf&,CATMathDirectionf&)
Retrieves the location and direction of a light source representation.
o GetMode(CATLightSourceMode&)
Retrieves the mode of the light source.
o GetSpotLightParameters(float&,float&)
Retrieves the specific parameters of a spotlight source representation.
o GetType(CATLightSourceType&)
Retrieves the type of the light source.
o SetAttenuationParameters(float,float,float)
Sets the attenuation parameters of the light source representation.
o SetColorParameters(float*,float*,float*)
Sets the color components of the light source representation.
o SetLocationParameters(CATMathPointf&,CATMathDirectionf&)
Sets the location and direction of a light source representation.
o SetMode(CATLightSourceMode)
Sets the mode of the light source representation.
o SetSpotLightParameters(float,float)
Sets the specific parameters of a spotlight source representation.
o SetType(CATLightSourceType)
Sets the type of the light source representation.
o operator =(CAT3DLightSourceRep&)
Assignement operator.

Constructor and Destructor


o CAT3DLightSourceRep
public CAT3DLightSourceRep()
Constructs an empty light source graphic representation.
o CAT3DLightSourceRep
public CAT3DLightSourceRep( const CAT3DLightSourceRep& iLightSourceRep)
Copy constructor.
Parameters:
iLightSourceRep
The light source representation to be duplicated
o CAT3DLightSourceRep
public CAT3DLightSourceRep( const CATLightSourceType iType,
const CATLightSourceMode iMode,
const CATMathPointf& iOrigin,
const CATMathDirectionf& iDirection,
const float iSpotAngle= 180.f)
Constructs the representation of a light source.
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.
Legal Values: in the range [0,90] or 180.
Default Value: 180. This constructs an equivalent to a lightbulb.
o ~CAT3DLightSourceRep
public virtual ~CAT3DLightSourceRep()

Methods


o GetAttenuationParameters
public void GetAttenuationParameters(float& oConstant,
float& oLinear,
float& oQuadratic) const
Retrieves the attenuation parameters of the light source representation.
Parameters:
oConstant
The constant factor of the attenuation function.
oLinear
The light factor of the attenuation function.
oQuadratic
The quadratic factor of the attenuation function.
o GetColorParameters
public void GetColorParameters( const float** oAmbient,
const float** oDiffuse,
const float** oSpecular) const
Retrieves the color components of the light source representation. 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 GetLocationParameters
public void GetLocationParameters(CATMathPointf& oOrigin,
CATMathDirectionf& oDirection) const
Retrieves the location and direction of a light source representation.
Parameters:
oOrigin
The point where the light source is located. This parameter has no meaning for LS_INFINITE>/tt> light source representations.
oDirection
The direction of the light source.
o GetMode
public void GetMode(CATLightSourceMode& oMode)
Retrieves the mode of the light source.
Parameters:
oMode
The mode of the light source representation.
o GetSpotLightParameters
public void GetSpotLightParameters(float& oSpotAngle,
float& oSpotExponent) const
Retrieves the specific parameters of a spotlight source representation. This method has no meaning for LS_INFINITE light source representations.
Parameters:
oSpotAngle
The half-angle aperture of the cone of the spotlight.
oSpotExponent
The exponent value used for specular component calculations.
o GetType
public void GetType(CATLightSourceType& oType)
Retrieves the type of the light source.
Parameters:
oType
The type of the light source representation.
o SetAttenuationParameters
public void SetAttenuationParameters( const float iConstant,
const float iLinear,
const float iQuadratic)
Sets the attenuation parameters of the light source representation.
Parameters:
iConstant
The constant parameter of the attenuation function
iLinear
The light parameter of the attenuation function
iQuadratic
The quadratic parameter of the attenuation function
o SetColorParameters
public void SetColorParameters( const float* iAmbient,
const float* iDiffuse,
const float* iSpecular)
Sets the color components of the light source representation. All float values are in [0,1].
Parameters:
iAmbient
Red, green, blue and alpha values of ambient component (array of four floats).
iDiffuse
Red, green, blue and alpha values of diffuse component (array of four floats).
iSpecular
Red, green, blue and alpha values of specular component (array of four floats).
o SetLocationParameters
public void SetLocationParameters( const CATMathPointf& iOrigin,
const CATMathDirectionf& iDirection)
Sets the location and direction of a light source representation. This method has no meaning for LS_INFINITE light source representations.
Parameters:
iOrigin
The point where the light source is located. This parameter has no meaning for LS_INFINITE light source representations.
iDirection
The direction of the light source.
o SetMode
public void SetMode( const CATLightSourceMode iMode)
Sets the mode of the light source representation.
Parameters:
iMode
The mode of the light source representation.
o SetSpotLightParameters
public void SetSpotLightParameters( const float iSpotAngle,
const float iSpotExponent)
Sets the specific parameters of a spotlight source representation.
Parameters:
iSpotAngle
The half-angle aperture of the cone of the spotlight.
iSpotExponent
The exponent value used for specular component calculations.
o SetType
public void SetType( const CATLightSourceType iType)
Sets the type of the light source representation.
Parameters:
iType
The type of the light source representation.
o operator =
public CAT3DLightSourceRep & operator =( const CAT3DLightSourceRep& iLightSourceRep)
Assignement operator.
Parameters:
iLightSourceRep
The light source representation to be copied

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

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