OCC Main Page | Visualization | Toolkits | Packages | Class Hierarchy | Data Structures | File List | Data Fields | Globals

Visualization
TKV3d
Visual3d


Visual3d_Light Class Reference

This class defines and updates light sources.
There is no limit to the number of light sources defined.
Only the number of active sources is limited.
.

#include <Visual3d_Light.hxx>


Public Member Functions

Standard_EXPORT Visual3d_Light ()
 Creates a light from default values.
Light sources are created in a visualiser
and are activated in one of its views.
.
Standard_EXPORT Visual3d_Light (const Quantity_Color &Color)
 Creates an AMBIENT light source.
Light sources are created in a visualiser
and are activated in one of its views.
.
Standard_EXPORT Visual3d_Light (const Quantity_Color &Color, const Graphic3d_Vector &Direction, const Standard_Boolean Headlight=Standard_False)
 Creates a DIRECTIONAL light source.
Light sources are created in a visualiser
and are activated in one of its views.
Warning: Raises LightDefinitionError if <direction> is null.
.
Standard_EXPORT Visual3d_Light (const Quantity_Color &Color, const Graphic3d_Vertex &Position, const Standard_Real Fact1, const Standard_Real Fact2)
 Creates a POSITIONAL light source.
Light sources are created in a visualiser
and are activated in one of its views.
Warning: Raises LightDefinitionError
if <fact1> and <fact2> are null.
if <fact1> is a negative value or greater than 1.0.
if <fact2> is a negative value or greater than 1.0.
.
Standard_EXPORT Visual3d_Light (const Quantity_Color &Color, const Graphic3d_Vertex &Position, const Graphic3d_Vector &Direction, const Standard_Real Concentration, const Standard_Real Fact1, const Standard_Real Fact2, const Standard_Real AngleCone)
 Creates a SPOT light source.
Light sources are created in a visualiser
and are activated in one of its views.
<concentration> specifies the intensity distribution of
the light.
<anglecone> specifies the angle (radians) of the cone
created by the spot.
the global attenuation is equal :
1 / (Fact1 + Fact2 * (norm(ObjectPosition - LightPosition)))
Warning: Raises LightDefinitionError
if <direction> is null.
if <concentration> is a negative value or greater than 1.0.
if <fact1> and <fact2> are null.
if <fact1> is a negative value or greater than 1.0.
if <fact2> is a negative value or greater than 1.0.
if <anglecone> is a negative value or greater than PI/2.
.
Standard_EXPORT void SetAngle (const Standard_Real AngleCone)
 Modifies the angle (radians) of the cone created by the spot.
Works only on TOLS_SPOT lights.
Category: Methods to modify the class definition
Warning: Raises LightDefinitionError
if the type of the light is not TOLS_SPOT.
if <anglecone> is a negative value or greater than PI/2.
.
Standard_EXPORT void SetAttenuation1 (const Standard_Real Fact1)
 Modifies the attenuation factor of the light.
Works only on the TOLS_POSITIONAL and TOLS_SPOT lights.
Category: Methods to modify the class definition
Warning: Raises LightDefinitionError
if the type of the light is not TOLS_SPOT or TOLS_POSITIONAL.
if <fact1> is a negative value or greater than 1.0.
.
Standard_EXPORT void SetAttenuation2 (const Standard_Real Fact2)
 Modifies the attenuation factor of the light.
Works only on the TOLS_POSITIONAL and TOLS_SPOT lights.
Category: Methods to modify the class definition
Warning: Raises LightDefinitionError
if the type of the light is not TOLS_POSITIONAL or TOLS_SPOT.
if <fact2> is a negative value or greater than 1.0..
.
Standard_EXPORT void SetColor (const Quantity_Color &Color)
 Modifies the colour of the light.
.
Standard_EXPORT void SetConcentration (const Standard_Real Concentration)
 Modifies the intensity distribution of the light.
Works only on the TOLS_SPOT lights.
Category: Methods to modify the class definition
Warning: Raises LightDefinitionError
if the type of the light is not TOLS_SPOT.
if <concentration> is a negative value or greater than 1.0.
.
Standard_EXPORT void SetDirection (const Graphic3d_Vector &Direction)
 Modifies the light direction.
Works only on the TOLS_DIRECTIONAL and TOLS_SPOT lights.
Default z
Category: Methods to modify the class definition
Warning: Raises LightDefinitionError
if the type of the light is not TOLS_DIRECTIONAL
or TOLS_SPOT.
if <direction> is null.
.
Standard_EXPORT void SetPosition (const Graphic3d_Vertex &Position)
 Modifies the position of the light.
Works only on the TOLS_POSITIONAL and TOLS_SPOT lights.
Category: Methods to modify the class definition
Warning: Raises LightDefinitionError
if the type of the light is not TOLS_POSITIONAL or TOLS_SPOT.
.
Standard_EXPORT Standard_Boolean Headlight () const
 Returns the headlight state of the light <me>
.
Standard_EXPORT Quantity_Color Color () const
 Returns the colour of the light <me>.
.
Standard_EXPORT Visual3d_TypeOfLightSource LightType () const
 Returns the light type of <me>.
.
Standard_EXPORT void Values (Quantity_Color &Color) const
 Returns the definition of <me> if <me> is
a light source of the TOLS_AMBIENT type.
Category: Inquire methods
Warning: Raises LightDefinitionError
if the type of the light is not TOLS_AMBIENT.
.
Standard_EXPORT void Values (Quantity_Color &Color, Graphic3d_Vector &Direction) const
 Returns the definition of <me> if <me> is
a light source of the TOLS_DIRECTIONAL type.
Category: Inquire methods
Warning: Raises LightDefinitionError
if the type of the light is not TOLS_DIRECTIONAL.
.
Standard_EXPORT void Values (Quantity_Color &Color, Graphic3d_Vertex &Position, Standard_Real &Fact1, Standard_Real &Fact2) const
 Returns the definition of <me> if <me> is
a light source of the TOLS_POSITIONAL type.
Category: Inquire methods
Warning: Raises LightDefinitionError
if the type of the light is not TOLS_POSITIONAL.
.
Standard_EXPORT void Values (Quantity_Color &Color, Graphic3d_Vertex &Position, Graphic3d_Vector &Direction, Standard_Real &Concentration, Standard_Real &Fact1, Standard_Real &Fact2, Standard_Real &AngleCone) const
 Returns the definition of <me> if <me> is
a light source of the TOLS_SPOT type.
Category: Inquire methods
Warning: Raises LightDefinitionError
if the type of the light is not TOLS_SPOT.
.
Standard_EXPORT const Handle (Standard_Type)&DynamicType() const

Static Public Member Functions

static Standard_EXPORT Standard_Integer Limit ()
 Maximum number of activatable light sources.
.

Private Member Functions

Standard_EXPORT Standard_Integer Identification () const
 Returns the light identification.
.

Static Private Member Functions

static Standard_EXPORT Standard_Boolean IsValid (const Standard_Real AAngle)
 Returns True if <aangle> is a valid
spot light spread angle.
.

Private Attributes

Visual3d_TypeOfLightSource MyType
Graphic3d_CLight MyCLight


Constructor & Destructor Documentation

Standard_EXPORT Visual3d_Light::Visual3d_Light  ) 
 

Standard_EXPORT Visual3d_Light::Visual3d_Light const Quantity_Color &  Color  ) 
 

Standard_EXPORT Visual3d_Light::Visual3d_Light const Quantity_Color &  Color,
const Graphic3d_Vector Direction,
const Standard_Boolean  Headlight = Standard_False
 

Standard_EXPORT Visual3d_Light::Visual3d_Light const Quantity_Color &  Color,
const Graphic3d_Vertex Position,
const Standard_Real  Fact1,
const Standard_Real  Fact2
 

Standard_EXPORT Visual3d_Light::Visual3d_Light const Quantity_Color &  Color,
const Graphic3d_Vertex Position,
const Graphic3d_Vector Direction,
const Standard_Real  Concentration,
const Standard_Real  Fact1,
const Standard_Real  Fact2,
const Standard_Real  AngleCone
 


Member Function Documentation

Standard_EXPORT Quantity_Color Visual3d_Light::Color  )  const
 

Standard_EXPORT const Visual3d_Light::Handle Standard_Type   )  const
 

Standard_EXPORT Standard_Boolean Visual3d_Light::Headlight  )  const
 

Standard_EXPORT Standard_Integer Visual3d_Light::Identification  )  const [private]
 

static Standard_EXPORT Standard_Boolean Visual3d_Light::IsValid const Standard_Real  AAngle  )  [static, private]
 

Standard_EXPORT Visual3d_TypeOfLightSource Visual3d_Light::LightType  )  const
 

static Standard_EXPORT Standard_Integer Visual3d_Light::Limit  )  [static]
 

Standard_EXPORT void Visual3d_Light::SetAngle const Standard_Real  AngleCone  ) 
 

Standard_EXPORT void Visual3d_Light::SetAttenuation1 const Standard_Real  Fact1  ) 
 

Standard_EXPORT void Visual3d_Light::SetAttenuation2 const Standard_Real  Fact2  ) 
 

Standard_EXPORT void Visual3d_Light::SetColor const Quantity_Color &  Color  ) 
 

Standard_EXPORT void Visual3d_Light::SetConcentration const Standard_Real  Concentration  ) 
 

Standard_EXPORT void Visual3d_Light::SetDirection const Graphic3d_Vector Direction  ) 
 

Standard_EXPORT void Visual3d_Light::SetPosition const Graphic3d_Vertex Position  ) 
 

Standard_EXPORT void Visual3d_Light::Values Quantity_Color &  Color,
Graphic3d_Vertex Position,
Graphic3d_Vector Direction,
Standard_Real &  Concentration,
Standard_Real &  Fact1,
Standard_Real &  Fact2,
Standard_Real &  AngleCone
const
 

Standard_EXPORT void Visual3d_Light::Values Quantity_Color &  Color,
Graphic3d_Vertex Position,
Standard_Real &  Fact1,
Standard_Real &  Fact2
const
 

Standard_EXPORT void Visual3d_Light::Values Quantity_Color &  Color,
Graphic3d_Vector Direction
const
 

Standard_EXPORT void Visual3d_Light::Values Quantity_Color &  Color  )  const
 


Field Documentation

Graphic3d_CLight Visual3d_Light::MyCLight [private]
 

Visual3d_TypeOfLightSource Visual3d_Light::MyType [private]
 


The documentation for this class was generated from the following file:
Generated on Mon Aug 25 13:56:28 2008 for OpenCASCADE by  doxygen 1.4.1