Open CASCADE Technology 7.8.2.dev
Graphic3d_LightSet Class Reference

Class defining the set of light sources. More...

#include <Graphic3d_LightSet.hxx>

Inheritance diagram for Graphic3d_LightSet:

Data Structures

class  Iterator
 Iterator through light sources. More...
 

Public Types

enum  IterationFilter {
  IterationFilter_None = 0x0000 , IterationFilter_ExcludeAmbient = 0x0002 , IterationFilter_ExcludeDisabled = 0x0004 , IterationFilter_ExcludeNoShadow = 0x0008 ,
  IterationFilter_ExcludeDisabledAndAmbient = IterationFilter_ExcludeAmbient | IterationFilter_ExcludeDisabled , IterationFilter_ActiveShadowCasters = IterationFilter_ExcludeDisabledAndAmbient | IterationFilter_ExcludeNoShadow
}
 Iteration filter flags. More...
 
- Public Types inherited from Standard_Transient
typedef void base_type
 Returns a type descriptor about this object.
 

Public Member Functions

 Graphic3d_LightSet ()
 Empty constructor.
 
Standard_Integer Lower () const
 Return lower light index.
 
Standard_Integer Upper () const
 Return upper light index.
 
Standard_Boolean IsEmpty () const
 Return TRUE if lights list is empty.
 
Standard_Integer Extent () const
 Return number of light sources.
 
const Handle< Graphic3d_CLight > & Value (Standard_Integer theIndex) const
 Return the light source for specified index within range [Lower(), Upper()].
 
Standard_Boolean Contains (const Handle< Graphic3d_CLight > &theLight) const
 Return TRUE if light source is defined in this set.
 
Standard_Boolean Add (const Handle< Graphic3d_CLight > &theLight)
 Append new light source.
 
Standard_Boolean Remove (const Handle< Graphic3d_CLight > &theLight)
 Remove light source.
 
Standard_Integer NbLightsOfType (Graphic3d_TypeOfLightSource theType) const
 Returns total amount of lights of specified type.
 
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor.
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing.
 
Standard_Transientoperator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter.
 
virtual ~Standard_Transient ()
 Destructor must be virtual.
 
virtual const opencascade::handle< Standard_Type > & DynamicType () const
 Returns a type descriptor about this object.
 
Standard_Boolean IsInstance (const opencascade::handle< Standard_Type > &theType) const
 Returns a true value if this is an instance of Type.
 
Standard_Boolean IsInstance (const Standard_CString theTypeName) const
 Returns a true value if this is an instance of TypeName.
 
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.
 
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.
 
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.
 
Standard_Integer GetRefCount () const noexcept
 Get the reference counter of this object.
 
void IncrementRefCounter () noexcept
 Increments the reference counter of this object.
 
Standard_Integer DecrementRefCounter () noexcept
 Decrements the reference counter of this object; returns the decremented value.
 
virtual void Delete () const
 Memory deallocator for transient classes.
 

cached state of lights set updated by UpdateRevision()

NCollection_IndexedDataMap< Handle< Graphic3d_CLight >, Standard_SizemyLights
 list of light sources with their cached state (revision)
 
Graphic3d_Vec4 myAmbient
 cached value of cumulative ambient color
 
TCollection_AsciiString myKeyEnabledLong
 key identifying the list of enabled light sources by their type
 
TCollection_AsciiString myKeyEnabledShort
 key identifying the list of enabled light sources by the number of sources of each type
 
Standard_Integer myLightTypes [Graphic3d_TypeOfLightSource_NB]
 counters per each light source type defined in the list
 
Standard_Integer myLightTypesEnabled [Graphic3d_TypeOfLightSource_NB]
 counters per each light source type enabled in the list
 
Standard_Integer myNbEnabled
 number of enabled light sources, excluding ambient
 
Standard_Integer myNbCastShadows
 number of enabled light sources casting shadows
 
Standard_Size myRevision
 current revision of light source set
 
Standard_Size myCacheRevision
 revision of cached state
 
Standard_Size UpdateRevision ()
 Update light sources revision.
 
Standard_Size Revision () const
 Return light sources revision.
 
Standard_Integer NbEnabled () const
 Returns total amount of enabled lights EXCLUDING ambient.
 
Standard_Integer NbEnabledLightsOfType (Graphic3d_TypeOfLightSource theType) const
 Returns total amount of enabled lights of specified type.
 
Standard_Integer NbCastShadows () const
 Returns total amount of enabled lights castings shadows.
 
const Graphic3d_Vec4AmbientColor () const
 Returns cumulative ambient color, which is computed as sum of all enabled ambient light sources. Values are NOT clamped (can be greater than 1.0f) and alpha component is fixed to 1.0f.
 
const TCollection_AsciiStringKeyEnabledLong () const
 Returns a string defining a list of enabled light sources as concatenation of letters 'd' (Directional), 'p' (Point), 's' (Spot) depending on the type of light source in the list. Example: "dppp".
 
const TCollection_AsciiStringKeyEnabledShort () const
 Returns a string defining a list of enabled light sources as concatenation of letters 'd' (Directional), 'p' (Point), 's' (Spot) depending on the type of light source in the list, specified only once. Example: "dp".
 

Additional Inherited Members

- Static Public Member Functions inherited from Standard_Transient
static constexpr const char * get_type_name ()
 Returns a type descriptor about this object.
 
static const opencascade::handle< Standard_Type > & get_type_descriptor ()
 Returns type descriptor of Standard_Transient class.
 

Detailed Description

Class defining the set of light sources.

Member Enumeration Documentation

◆ IterationFilter

Iteration filter flags.

Enumerator
IterationFilter_None 

no filter

IterationFilter_ExcludeAmbient 

exclude ambient light sources

IterationFilter_ExcludeDisabled 

exclude disabled light sources

IterationFilter_ExcludeNoShadow 

exclude light sources not casting shadow

IterationFilter_ExcludeDisabledAndAmbient 
IterationFilter_ActiveShadowCasters 

Constructor & Destructor Documentation

◆ Graphic3d_LightSet()

Graphic3d_LightSet::Graphic3d_LightSet ( )

Empty constructor.

Member Function Documentation

◆ Add()

Standard_Boolean Graphic3d_LightSet::Add ( const Handle< Graphic3d_CLight > & theLight)

Append new light source.

◆ AmbientColor()

const Graphic3d_Vec4 & Graphic3d_LightSet::AmbientColor ( ) const
inline

Returns cumulative ambient color, which is computed as sum of all enabled ambient light sources. Values are NOT clamped (can be greater than 1.0f) and alpha component is fixed to 1.0f.

See also
UpdateRevision()

◆ Contains()

Standard_Boolean Graphic3d_LightSet::Contains ( const Handle< Graphic3d_CLight > & theLight) const
inline

Return TRUE if light source is defined in this set.

◆ Extent()

Standard_Integer Graphic3d_LightSet::Extent ( ) const
inline

Return number of light sources.

◆ IsEmpty()

Standard_Boolean Graphic3d_LightSet::IsEmpty ( ) const
inline

Return TRUE if lights list is empty.

◆ KeyEnabledLong()

const TCollection_AsciiString & Graphic3d_LightSet::KeyEnabledLong ( ) const
inline

Returns a string defining a list of enabled light sources as concatenation of letters 'd' (Directional), 'p' (Point), 's' (Spot) depending on the type of light source in the list. Example: "dppp".

See also
UpdateRevision()

◆ KeyEnabledShort()

const TCollection_AsciiString & Graphic3d_LightSet::KeyEnabledShort ( ) const
inline

Returns a string defining a list of enabled light sources as concatenation of letters 'd' (Directional), 'p' (Point), 's' (Spot) depending on the type of light source in the list, specified only once. Example: "dp".

See also
UpdateRevision()

◆ Lower()

Standard_Integer Graphic3d_LightSet::Lower ( ) const
inline

Return lower light index.

◆ NbCastShadows()

Standard_Integer Graphic3d_LightSet::NbCastShadows ( ) const
inline

Returns total amount of enabled lights castings shadows.

See also
UpdateRevision()

◆ NbEnabled()

Standard_Integer Graphic3d_LightSet::NbEnabled ( ) const
inline

Returns total amount of enabled lights EXCLUDING ambient.

See also
UpdateRevision()

◆ NbEnabledLightsOfType()

Standard_Integer Graphic3d_LightSet::NbEnabledLightsOfType ( Graphic3d_TypeOfLightSource theType) const
inline

Returns total amount of enabled lights of specified type.

See also
UpdateRevision()

◆ NbLightsOfType()

Standard_Integer Graphic3d_LightSet::NbLightsOfType ( Graphic3d_TypeOfLightSource theType) const
inline

Returns total amount of lights of specified type.

◆ Remove()

Standard_Boolean Graphic3d_LightSet::Remove ( const Handle< Graphic3d_CLight > & theLight)

Remove light source.

◆ Revision()

Standard_Size Graphic3d_LightSet::Revision ( ) const
inline

Return light sources revision.

See also
UpdateRevision()

◆ UpdateRevision()

Standard_Size Graphic3d_LightSet::UpdateRevision ( )

Update light sources revision.

◆ Upper()

Standard_Integer Graphic3d_LightSet::Upper ( ) const
inline

Return upper light index.

◆ Value()

const Handle< Graphic3d_CLight > & Graphic3d_LightSet::Value ( Standard_Integer theIndex) const
inline

Return the light source for specified index within range [Lower(), Upper()].

Field Documentation

◆ myAmbient

Graphic3d_Vec4 Graphic3d_LightSet::myAmbient
protected

cached value of cumulative ambient color

◆ myCacheRevision

Standard_Size Graphic3d_LightSet::myCacheRevision
protected

revision of cached state

◆ myKeyEnabledLong

TCollection_AsciiString Graphic3d_LightSet::myKeyEnabledLong
protected

key identifying the list of enabled light sources by their type

◆ myKeyEnabledShort

TCollection_AsciiString Graphic3d_LightSet::myKeyEnabledShort
protected

key identifying the list of enabled light sources by the number of sources of each type

◆ myLights

NCollection_IndexedDataMap< Handle< Graphic3d_CLight > , Standard_Size> Graphic3d_LightSet::myLights
protected

list of light sources with their cached state (revision)

◆ myLightTypes

Standard_Integer Graphic3d_LightSet::myLightTypes[Graphic3d_TypeOfLightSource_NB]
protected

counters per each light source type defined in the list

◆ myLightTypesEnabled

Standard_Integer Graphic3d_LightSet::myLightTypesEnabled[Graphic3d_TypeOfLightSource_NB]
protected

counters per each light source type enabled in the list

◆ myNbCastShadows

Standard_Integer Graphic3d_LightSet::myNbCastShadows
protected

number of enabled light sources casting shadows

◆ myNbEnabled

Standard_Integer Graphic3d_LightSet::myNbEnabled
protected

number of enabled light sources, excluding ambient

◆ myRevision

Standard_Size Graphic3d_LightSet::myRevision
protected

current revision of light source set


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