Open CASCADE Technology  7.3.0
Public Member Functions | Data Fields
V3d_SpotLight Class Reference

Creation and modification of a spot. The attenuation factor F determines the illumination of a surface: More...

#include <V3d_SpotLight.hxx>

Inheritance diagram for V3d_SpotLight:
Inheritance graph
[legend]

Public Member Functions

 V3d_SpotLight (const gp_Pnt &thePos, const V3d_TypeOfOrientation theDirection=V3d_XnegYnegZpos, const Quantity_Color &theColor=Quantity_NOC_WHITE)
 Creates a light source of the Spot type in the viewer with default attenuation factors (1.0, 0.0), concentration factor 1.0 and spot angle 30 degrees. More...
 
 V3d_SpotLight (const gp_Pnt &thePos, const gp_Dir &theDirection, const Quantity_Color &theColor=Quantity_NOC_WHITE)
 Creates a light source of the Spot type in the viewer with default attenuation factors (1.0, 0.0), concentration factor 1.0 and spot angle 30 degrees. More...
 
void SetDirection (V3d_TypeOfOrientation theOrientation)
 Defines the direction of the light source according to a predefined directional vector. More...
 
 Standard_DEPRECATED ("This constructor is deprecated - the light source should be added to V3d_Viewer explicitly by method V3d_Viewer::AddLight()") 1 V3d_SpotLight(const Handle< V3d_Viewer > &theViewer
 
 Standard_DEPRECATED ("This constructor is deprecated - the light source should be added to V3d_Viewer explicitly by method V3d_Viewer::AddLight()") 1 V3d_SpotLight(const Handle< V3d_Viewer > &theViewer
 theXt, theYt, theZt : Coordinate of light source Target. theXp, theYp, theZp : Coordinate of light source Position. More...
 
- Public Member Functions inherited from Graphic3d_CLight
 Graphic3d_CLight (Graphic3d_TypeOfLightSource theType)
 Empty constructor, which should be followed by light source properties configuration. More...
 
Graphic3d_TypeOfLightSource Type () const
 Returns the Type of the Light, cannot be changed after object construction. More...
 
const TCollection_AsciiStringName () const
 Returns light source name; empty string by default. More...
 
void SetName (const TCollection_AsciiString &theName)
 Sets light source name. More...
 
const Quantity_ColorColor () const
 Returns the color of the light source; WHITE by default. More...
 
void SetColor (const Quantity_Color &theColor)
 Defines the color of a light source by giving the basic color. More...
 
Standard_Boolean IsEnabled () const
 Check that the light source is turned on; TRUE by default. This flag affects all occurrences of light sources, where it was registered and activated; so that it is possible defining an active light in View which is actually in disabled state. More...
 
void SetEnabled (Standard_Boolean theIsOn)
 Change enabled state of the light state. This call does not remove or deactivate light source in Views/Viewers; instead it turns it OFF so that it just have no effect. More...
 
Standard_Boolean IsHeadlight () const
 Returns true if the light is a headlight; FALSE by default. Headlight flag means that light position/direction are defined not in a World coordinate system, but relative to the camera orientation. More...
 
Standard_Boolean Headlight () const
 Alias for IsHeadlight(). More...
 
void SetHeadlight (Standard_Boolean theValue)
 Setup headlight flag. More...
 
const gp_PntPosition () const
 Returns location of positional/spot light; (0, 0, 0) by default. More...
 
void SetPosition (const gp_Pnt &thePosition)
 Setup location of positional/spot light. More...
 
void Position (Standard_Real &theX, Standard_Real &theY, Standard_Real &theZ) const
 Returns location of positional/spot light. More...
 
void SetPosition (Standard_Real theX, Standard_Real theY, Standard_Real theZ)
 Setup location of positional/spot light. More...
 
Standard_ShortReal ConstAttenuation () const
 Returns constant attenuation factor of positional/spot light source; 1.0f by default. Distance attenuation factors of reducing positional/spot light intensity depending on the distance from its position: More...
 
Standard_ShortReal LinearAttenuation () const
 Returns linear attenuation factor of positional/spot light source; 0.0 by default. Distance attenuation factors of reducing positional/spot light intensity depending on the distance from its position: More...
 
void Attenuation (Standard_Real &theConstAttenuation, Standard_Real &theLinearAttenuation) const
 Returns the attenuation factors. More...
 
void SetAttenuation (Standard_ShortReal theConstAttenuation, Standard_ShortReal theLinearAttenuation)
 Defines the coefficients of attenuation; values should be >= 0.0 and their summ should not be equal to 0. More...
 
gp_Dir Direction () const
 Returns direction of directional/spot light. More...
 
void SetDirection (const gp_Dir &theDir)
 Sets direction of directional/spot light. More...
 
void Direction (Standard_Real &theVx, Standard_Real &theVy, Standard_Real &theVz) const
 Returns the theVx, theVy, theVz direction of the light source. More...
 
void SetDirection (Standard_Real theVx, Standard_Real theVy, Standard_Real theVz)
 Sets direction of directional/spot light. More...
 
Standard_ShortReal Angle () const
 Returns an angle in radians of the cone created by the spot; 30 degrees by default. More...
 
void SetAngle (Standard_ShortReal theAngle)
 Angle in radians of the cone created by the spot, should be within range (0.0, M_PI). More...
 
Standard_ShortReal Concentration () const
 Returns intensity distribution of the spot light, within [0.0, 1.0] range; 1.0 by default. This coefficient should be converted into spotlight exponent within [0.0, 128.0] range: More...
 
void SetConcentration (Standard_ShortReal theConcentration)
 Defines the coefficient of concentration; value should be within range [0.0, 1.0]. More...
 
Standard_ShortReal Intensity () const
 Returns the intensity of light source; 1.0 by default. More...
 
void SetIntensity (Standard_ShortReal theValue)
 Modifies the intensity of light source, which should be > 0.0. More...
 
Standard_ShortReal Smoothness () const
 Returns the smoothness of light source (either smoothing angle for directional light or smoothing radius in case of positional light); 0.0 by default. More...
 
void SetSmoothRadius (Standard_ShortReal theValue)
 Modifies the smoothing radius of positional/spot light; should be >= 0.0. More...
 
void SetSmoothAngle (Standard_ShortReal theValue)
 Modifies the smoothing angle (in radians) of directional light source; should be within range [0.0, M_PI/2]. More...
 
const TCollection_AsciiStringGetId () const
 
const Graphic3d_Vec4PackedParams () const
 Packed light parameters. More...
 
const Graphic3d_Vec4PackedColor () const
 Returns the color of the light source with dummy Alpha component, which should be ignored. More...
 
const Graphic3d_Vec4PackedDirection () const
 Returns direction of directional/spot light. More...
 
Standard_Size Revision () const
 
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor. More...
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing. More...
 
Standard_Transientoperator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter. More...
 
virtual ~Standard_Transient ()
 Destructor must be virtual. More...
 
virtual void Delete () const
 Memory deallocator for transient classes. More...
 
virtual const opencascade::handle< Standard_Type > & DynamicType () const
 Returns a type descriptor about this object. More...
 
Standard_Boolean IsInstance (const opencascade::handle< Standard_Type > &theType) const
 Returns a true value if this is an instance of Type. More...
 
Standard_Boolean IsInstance (const Standard_CString theTypeName) const
 Returns a true value if this is an instance of TypeName. More...
 
Standard_Boolean IsKind (const opencascade::handle< Standard_Type > &theType) const
 Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More...
 
Standard_Boolean IsKind (const Standard_CString theTypeName) const
 Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More...
 
Standard_TransientThis () const
 Returns non-const pointer to this object (like const_cast). For protection against creating handle to objects allocated in stack or call from constructor, it will raise exception Standard_ProgramError if reference counter is zero. More...
 
Standard_Integer GetRefCount () const
 Get the reference counter of this object. More...
 
void IncrementRefCounter () const
 Increments the reference counter of this object. More...
 
Standard_Integer DecrementRefCounter () const
 Decrements the reference counter of this object; returns the decremented value. More...
 

Data Fields

const Standard_Real theX
 
const Standard_Real const Standard_Real theY
 
const Standard_Real const Standard_Real const Standard_Real theZ
 
const Standard_Real const Standard_Real const Standard_Real const V3d_TypeOfOrientation theDirection = V3d_XnegYnegZpos
 
const Standard_Real const Standard_Real const Standard_Real const V3d_TypeOfOrientation const Quantity_ColortheColor = Quantity_NOC_WHITE
 
const Standard_Real const Standard_Real const Standard_Real const V3d_TypeOfOrientation const Quantity_Color const Standard_Real theConstAttenuation = 1.0
 
const Standard_Real const Standard_Real const Standard_Real const V3d_TypeOfOrientation const Quantity_Color const Standard_Real const Standard_Real theLinearAttenuation = 0.0
 
const Standard_Real const Standard_Real const Standard_Real const V3d_TypeOfOrientation const Quantity_Color const Standard_Real const Standard_Real const Standard_Real theConcentration = 1.0
 
const Standard_Real const Standard_Real const Standard_Real const V3d_TypeOfOrientation const Quantity_Color const Standard_Real const Standard_Real const Standard_Real const Standard_Real theAngle = 0.523599)
 
const Standard_Real theXt
 
const Standard_Real const Standard_Real theYt
 
const Standard_Real const Standard_Real const Standard_Real theZt
 
const Standard_Real const Standard_Real const Standard_Real const Standard_Real theXp
 
const Standard_Real const Standard_Real const Standard_Real const Standard_Real const Standard_Real theYp
 
const Standard_Real const Standard_Real const Standard_Real const Standard_Real const Standard_Real const Standard_Real theZp
 
const Standard_Real const Standard_Real const Standard_Real const Standard_Real const Standard_Real const Standard_Real const Quantity_ColortheColor = Quantity_NOC_WHITE
 
const Standard_Real const Standard_Real const Standard_Real const Standard_Real const Standard_Real const Standard_Real const Quantity_Color const Standard_Real theConstAttenuation = 1.0
 
const Standard_Real const Standard_Real const Standard_Real const Standard_Real const Standard_Real const Standard_Real const Quantity_Color const Standard_Real const Standard_Real theLinearAttenuation = 0.0
 
const Standard_Real const Standard_Real const Standard_Real const Standard_Real const Standard_Real const Standard_Real const Quantity_Color const Standard_Real const Standard_Real const Standard_Real theConcentration = 1.0
 
const Standard_Real const Standard_Real const Standard_Real const Standard_Real const Standard_Real const Standard_Real const Quantity_Color const Standard_Real const Standard_Real const Standard_Real const Standard_Real theAngle = 0.523599)
 

Additional Inherited Members

- Public Types inherited from Standard_Transient
typedef void base_type
 Returns a type descriptor about this object. More...
 
- Static Public Member Functions inherited from Standard_Transient
static const char * get_type_name ()
 Returns a type descriptor about this object. More...
 
static const opencascade::handle< Standard_Type > & get_type_descriptor ()
 Returns type descriptor of Standard_Transient class. More...
 
- Protected Member Functions inherited from V3d_PositionLight
 V3d_PositionLight (Graphic3d_TypeOfLightSource theType, const Handle< V3d_Viewer > &theViewer)
 Protected constructor. More...
 
- Protected Attributes inherited from Graphic3d_CLight
TCollection_AsciiString myId
 resource id More...
 
TCollection_AsciiString myName
 user given name More...
 
gp_Pnt myPosition
 light position More...
 
Quantity_ColorRGBA myColor
 light color More...
 
Graphic3d_Vec4 myDirection
 direction of directional/spot light More...
 
Graphic3d_Vec4 myParams
 packed light parameters More...
 
Standard_ShortReal mySmoothness
 radius for point light or cone angle for directional light More...
 
Standard_ShortReal myIntensity
 intensity multiplier for light More...
 
const Graphic3d_TypeOfLightSource myType
 Graphic3d_TypeOfLightSource enumeration. More...
 
Standard_Size myRevision
 modification counter More...
 
Standard_Boolean myIsHeadlight
 flag to mark head light More...
 
Standard_Boolean myIsEnabled
 enabled state More...
 

Detailed Description

Creation and modification of a spot. The attenuation factor F determines the illumination of a surface:

F = 1/(ConstAttenuation() + LinearAttenuation() * Distance)

Where Distance is the distance from the source to the surface. The default values (1.0, 0.0) correspond to a minimum of attenuation. The concentration factor determines the dispersion of the light on the surface, the default value (1.0) corresponds to a minimum of dispersion.

Constructor & Destructor Documentation

◆ V3d_SpotLight() [1/2]

V3d_SpotLight::V3d_SpotLight ( const gp_Pnt thePos,
const V3d_TypeOfOrientation  theDirection = V3d_XnegYnegZpos,
const Quantity_Color theColor = Quantity_NOC_WHITE 
)

Creates a light source of the Spot type in the viewer with default attenuation factors (1.0, 0.0), concentration factor 1.0 and spot angle 30 degrees.

◆ V3d_SpotLight() [2/2]

V3d_SpotLight::V3d_SpotLight ( const gp_Pnt thePos,
const gp_Dir theDirection,
const Quantity_Color theColor = Quantity_NOC_WHITE 
)

Creates a light source of the Spot type in the viewer with default attenuation factors (1.0, 0.0), concentration factor 1.0 and spot angle 30 degrees.

Member Function Documentation

◆ SetDirection()

void V3d_SpotLight::SetDirection ( V3d_TypeOfOrientation  theOrientation)

Defines the direction of the light source according to a predefined directional vector.

◆ Standard_DEPRECATED() [1/2]

V3d_SpotLight::Standard_DEPRECATED ( "This constructor is deprecated - the light source should be added to V3d_Viewer explicitly by method V3d_Viewer::AddLight()"  ) const &

◆ Standard_DEPRECATED() [2/2]

V3d_SpotLight::Standard_DEPRECATED ( "This constructor is deprecated - the light source should be added to V3d_Viewer explicitly by method V3d_Viewer::AddLight()"  ) const &

theXt, theYt, theZt : Coordinate of light source Target. theXp, theYp, theZp : Coordinate of light source Position.

Field Documentation

◆ theAngle [1/2]

const Standard_Real const Standard_Real const Standard_Real const V3d_TypeOfOrientation const Quantity_Color const Standard_Real const Standard_Real const Standard_Real const Standard_Real V3d_SpotLight::theAngle = 0.523599)

◆ theAngle [2/2]

const Standard_Real const Standard_Real const Standard_Real const Standard_Real const Standard_Real const Standard_Real const Quantity_Color const Standard_Real const Standard_Real const Standard_Real const Standard_Real V3d_SpotLight::theAngle = 0.523599)

◆ theColor [1/2]

const Standard_Real const Standard_Real const Standard_Real const V3d_TypeOfOrientation const Quantity_Color& V3d_SpotLight::theColor = Quantity_NOC_WHITE

◆ theColor [2/2]

const Standard_Real const Standard_Real const Standard_Real const Standard_Real const Standard_Real const Standard_Real const Quantity_Color& V3d_SpotLight::theColor = Quantity_NOC_WHITE

◆ theConcentration [1/2]

const Standard_Real const Standard_Real const Standard_Real const V3d_TypeOfOrientation const Quantity_Color const Standard_Real const Standard_Real const Standard_Real V3d_SpotLight::theConcentration = 1.0

◆ theConcentration [2/2]

const Standard_Real const Standard_Real const Standard_Real const Standard_Real const Standard_Real const Standard_Real const Quantity_Color const Standard_Real const Standard_Real const Standard_Real V3d_SpotLight::theConcentration = 1.0

◆ theConstAttenuation [1/2]

const Standard_Real const Standard_Real const Standard_Real const V3d_TypeOfOrientation const Quantity_Color const Standard_Real V3d_SpotLight::theConstAttenuation = 1.0

◆ theConstAttenuation [2/2]

const Standard_Real const Standard_Real const Standard_Real const Standard_Real const Standard_Real const Standard_Real const Quantity_Color const Standard_Real V3d_SpotLight::theConstAttenuation = 1.0

◆ theDirection

const Standard_Real const Standard_Real const Standard_Real const V3d_TypeOfOrientation V3d_SpotLight::theDirection = V3d_XnegYnegZpos

◆ theLinearAttenuation [1/2]

const Standard_Real const Standard_Real const Standard_Real const V3d_TypeOfOrientation const Quantity_Color const Standard_Real const Standard_Real V3d_SpotLight::theLinearAttenuation = 0.0

◆ theLinearAttenuation [2/2]

const Standard_Real const Standard_Real const Standard_Real const Standard_Real const Standard_Real const Standard_Real const Quantity_Color const Standard_Real const Standard_Real V3d_SpotLight::theLinearAttenuation = 0.0

◆ theX

const Standard_Real V3d_SpotLight::theX

◆ theXp

const Standard_Real const Standard_Real const Standard_Real const Standard_Real V3d_SpotLight::theXp

◆ theXt

const Standard_Real V3d_SpotLight::theXt

◆ theY

const Standard_Real const Standard_Real V3d_SpotLight::theY

◆ theYp

const Standard_Real const Standard_Real const Standard_Real const Standard_Real const Standard_Real V3d_SpotLight::theYp

◆ theYt

const Standard_Real const Standard_Real V3d_SpotLight::theYt

◆ theZ

const Standard_Real const Standard_Real const Standard_Real V3d_SpotLight::theZ

◆ theZp

const Standard_Real const Standard_Real const Standard_Real const Standard_Real const Standard_Real const Standard_Real V3d_SpotLight::theZp

◆ theZt

const Standard_Real const Standard_Real const Standard_Real V3d_SpotLight::theZt

The documentation for this class was generated from the following file: