Open CASCADE Technology 6.6.0
Public Member Functions
V3d_PositionalLight Class Reference

Creation and modification of an isolated
light source.

#include <V3d_PositionalLight.hxx>

Inheritance diagram for V3d_PositionalLight:
Inheritance graph
[legend]

Public Member Functions

 V3d_PositionalLight (const Handle< V3d_Viewer > &VM, const V3d_Coordinate X, const V3d_Coordinate Y, const V3d_Coordinate Z, const Quantity_NameOfColor Color=Quantity_NOC_WHITE, const Quantity_Coefficient Attenuation1=1.0, const Quantity_Coefficient Attenuation2=0.0)
 Creates an isolated light source X,Y,Z in the viewer.
It is also defined by the color Color and
two attenuation factors Attenuation1, Attenuation2.
The resulting attenuation factor determining the
illumination of a surface depends on the following
formula :
F = 1/(A1 + A2*Length)
A1,A2 being the two factors of attenuation
Length is the distance of the isolated source
from the surface.
//! Warning! raises BadValue from V3d
if one of the attenuation coefficients is not between 0 et 1.

 V3d_PositionalLight (const Handle< V3d_Viewer > &VM, const V3d_Coordinate Xt, const V3d_Coordinate Yt, const V3d_Coordinate Zt, const V3d_Coordinate Xp, const V3d_Coordinate Yp, const V3d_Coordinate Zp, const Quantity_NameOfColor Color=Quantity_NOC_WHITE, const Quantity_Coefficient Attenuation1=1.0, const Quantity_Coefficient Attenuation2=0.0)
 Creates a light source of the Positional type
in the viewer.
Xt,Yt,Zt : Coordinate of Target light source.
Xp,Yp,Zp : Coordinate of Position light source.
The light source is also defined by the color Color
and two attenuation factors Attenuation1,
Attenuation2 that determine the illumination of a
surface using the following formula :
F = 1/(A1 + A2*Length) where:

virtual void SetPosition (const V3d_Coordinate X, const V3d_Coordinate Y, const V3d_Coordinate Z)
 Defines the position of the light source.

void SetAttenuation (const Quantity_Coefficient A1, const Quantity_Coefficient A2)
 Defines the attenuation factors.
Warning: raises BadValue from V3d
if one of the attenuation coefficients is not between 0 et 1.

void Display (const Handle< V3d_View > &aView, const V3d_TypeOfRepresentation Representation)
 Display the graphic structure of light source
in the choosen view. We have three type of representation

void Position (V3d_Coordinate &X, V3d_Coordinate &Y, V3d_Coordinate &Z) const
 Returns the position of the light source.

void Attenuation (Quantity_Coefficient &A1, Quantity_Coefficient &A2) const
 Returns the attenuation factors A1,A2 of the light
source used at construction time.


Constructor & Destructor Documentation

V3d_PositionalLight::V3d_PositionalLight ( const Handle< V3d_Viewer > &  VM,
const V3d_Coordinate  X,
const V3d_Coordinate  Y,
const V3d_Coordinate  Z,
const Quantity_NameOfColor  Color = Quantity_NOC_WHITE,
const Quantity_Coefficient  Attenuation1 = 1.0,
const Quantity_Coefficient  Attenuation2 = 0.0 
)
V3d_PositionalLight::V3d_PositionalLight ( const Handle< V3d_Viewer > &  VM,
const V3d_Coordinate  Xt,
const V3d_Coordinate  Yt,
const V3d_Coordinate  Zt,
const V3d_Coordinate  Xp,
const V3d_Coordinate  Yp,
const V3d_Coordinate  Zp,
const Quantity_NameOfColor  Color = Quantity_NOC_WHITE,
const Quantity_Coefficient  Attenuation1 = 1.0,
const Quantity_Coefficient  Attenuation2 = 0.0 
)
  • A1,A2 are the two attenuation factors, and
  • Length is the distance from the isolated source.
    //! Warning! raises BadValue from V3d
    if one of the attenuation coefficients is not between 0 et 1.

Member Function Documentation

void V3d_PositionalLight::Attenuation ( Quantity_Coefficient A1,
Quantity_Coefficient A2 
) const
void V3d_PositionalLight::Display ( const Handle< V3d_View > &  aView,
const V3d_TypeOfRepresentation  Representation 
) [virtual]
  • SIMPLE : Only the light source is displayed.
  • PARTIAL : The light source and the light space are
    displayed.
  • COMPLETE : The light source, the light space and the
    radius of light space are displayed.
    We can choose the "SAMELAST" as parameter of representation
    In this case the graphic structure representation will be
    the last displayed.

Reimplemented from V3d_PositionLight.

void V3d_PositionalLight::Position ( V3d_Coordinate X,
V3d_Coordinate Y,
V3d_Coordinate Z 
) const [virtual]

Implements V3d_PositionLight.

void V3d_PositionalLight::SetAttenuation ( const Quantity_Coefficient  A1,
const Quantity_Coefficient  A2 
)
virtual void V3d_PositionalLight::SetPosition ( const V3d_Coordinate  X,
const V3d_Coordinate  Y,
const V3d_Coordinate  Z 
) [virtual]

Implements V3d_PositionLight.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines