OCCT 8.0.1
OCCT documentation

Search guides and API reference

Enter at least two characters.

    Open CASCADE Technology Reference Manual 8.0.1
    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_ActiveShadowCasters
    }
     Iteration filter flags. More...
    typedef void base_type
     Returns a type descriptor about this object.

    Public Member Functions

     Graphic3d_LightSet ()
     Empty constructor.
    int Lower () const
     Return lower light index.
    int Upper () const
     Return upper light index.
    bool IsEmpty () const
     Return TRUE if lights list is empty.
    int Extent () const
     Return number of light sources.
    const occ::handle< Graphic3d_CLight > & Value (int theIndex) const
     Return the light source for specified index within range [Lower(), Upper()].
    bool Contains (const occ::handle< Graphic3d_CLight > &theLight) const
     Return TRUE if light source is defined in this set.
    bool Add (const occ::handle< Graphic3d_CLight > &theLight)
     Append new light source.
    bool Remove (const occ::handle< Graphic3d_CLight > &theLight)
     Remove light source.
    int 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_Transient & operator= (const Standard_Transient &)
     Assignment operator, needed to avoid copying reference counter.
    virtual ~Standard_Transient ()=default
     Destructor must be virtual.
    virtual const opencascade::handle< Standard_Type > & DynamicType () const
     Returns a type descriptor about this object.
    bool IsInstance (const opencascade::handle< Standard_Type > &theType) const
     Returns a true value if this is an instance of Type.
    bool IsInstance (const char *const theTypeName) const
     Returns a true value if this is an instance of TypeName.
    bool 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.
    bool IsKind (const char *const 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_Transient * This () 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.
    int GetRefCount () const noexcept
     Get the reference counter of this object.
    void IncrementRefCounter () noexcept
     Increments the reference counter of this object. Uses relaxed memory ordering since incrementing only requires atomicity, not synchronization with other memory operations.
    int DecrementRefCounter () noexcept
     Decrements the reference counter of this object; returns the decremented value. Uses release ordering for the decrement to ensure all writes to the object are visible before the count reaches zero. An acquire fence is added only when the count reaches zero, ensuring proper synchronization before deletion. This is more efficient than using acq_rel for every decrement.
    virtual void Delete () const
     Memory deallocator for transient classes.

    cached state of lights set updated by UpdateRevision()

    NCollection_IndexedDataMap< occ::handle< Graphic3d_CLight >, size_t > myLights
     list of light sources with their cached state (revision)
    NCollection_Vec4< float > 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
    int myLightTypes [Graphic3d_TypeOfLightSource_NB]
     counters per each light source type defined in the list
    int myLightTypesEnabled [Graphic3d_TypeOfLightSource_NB]
     counters per each light source type enabled in the list
    int myNbEnabled
     number of enabled light sources, excluding ambient
    int myNbCastShadows
     number of enabled light sources casting shadows
    size_t myRevision
     current revision of light source set
    size_t myCacheRevision
     revision of cached state
    size_t UpdateRevision ()
     Update light sources revision.
    size_t Revision () const
     Return light sources revision.
    int NbEnabled () const
     Returns total amount of enabled lights EXCLUDING ambient.
    int NbEnabledLightsOfType (Graphic3d_TypeOfLightSource theType) const
     Returns total amount of enabled lights of specified type.
    int NbCastShadows () const
     Returns total amount of enabled lights castings shadows.
    const NCollection_Vec4< float > & AmbientColor () 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_AsciiString & KeyEnabledLong () 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_AsciiString & KeyEnabledShort () 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 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()

    bool Graphic3d_LightSet::Add ( const occ::handle< Graphic3d_CLight > & theLight)

    Append new light source.

    ◆ AmbientColor()

    const NCollection_Vec4< float > & 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()

    bool Graphic3d_LightSet::Contains ( const occ::handle< Graphic3d_CLight > & theLight) const
    inline

    Return TRUE if light source is defined in this set.

    ◆ Extent()

    int Graphic3d_LightSet::Extent ( ) const
    inline

    Return number of light sources.

    ◆ IsEmpty()

    bool 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()

    int Graphic3d_LightSet::Lower ( ) const
    inline

    Return lower light index.

    ◆ NbCastShadows()

    int Graphic3d_LightSet::NbCastShadows ( ) const
    inline

    Returns total amount of enabled lights castings shadows.

    See also
    UpdateRevision()

    ◆ NbEnabled()

    int Graphic3d_LightSet::NbEnabled ( ) const
    inline

    Returns total amount of enabled lights EXCLUDING ambient.

    See also
    UpdateRevision()

    ◆ NbEnabledLightsOfType()

    int Graphic3d_LightSet::NbEnabledLightsOfType ( Graphic3d_TypeOfLightSource theType) const
    inline

    Returns total amount of enabled lights of specified type.

    See also
    UpdateRevision()

    ◆ NbLightsOfType()

    int Graphic3d_LightSet::NbLightsOfType ( Graphic3d_TypeOfLightSource theType) const
    inline

    Returns total amount of lights of specified type.

    ◆ Remove()

    bool Graphic3d_LightSet::Remove ( const occ::handle< Graphic3d_CLight > & theLight)

    Remove light source.

    ◆ Revision()

    size_t Graphic3d_LightSet::Revision ( ) const
    inline

    Return light sources revision.

    See also
    UpdateRevision()

    ◆ UpdateRevision()

    size_t Graphic3d_LightSet::UpdateRevision ( )

    Update light sources revision.

    ◆ Upper()

    int Graphic3d_LightSet::Upper ( ) const
    inline

    Return upper light index.

    ◆ Value()

    const occ::handle< Graphic3d_CLight > & Graphic3d_LightSet::Value ( int theIndex) const
    inline

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

    Field Documentation

    ◆ myAmbient

    NCollection_Vec4<float> Graphic3d_LightSet::myAmbient
    protected

    cached value of cumulative ambient color

    ◆ myCacheRevision

    size_t 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<occ::handle<Graphic3d_CLight>, size_t> Graphic3d_LightSet::myLights
    protected

    list of light sources with their cached state (revision)

    ◆ myLightTypes

    int Graphic3d_LightSet::myLightTypes[Graphic3d_TypeOfLightSource_NB]
    protected

    counters per each light source type defined in the list

    ◆ myLightTypesEnabled

    int Graphic3d_LightSet::myLightTypesEnabled[Graphic3d_TypeOfLightSource_NB]
    protected

    counters per each light source type enabled in the list

    ◆ myNbCastShadows

    int Graphic3d_LightSet::myNbCastShadows
    protected

    number of enabled light sources casting shadows

    ◆ myNbEnabled

    int Graphic3d_LightSet::myNbEnabled
    protected

    number of enabled light sources, excluding ambient

    ◆ myRevision

    size_t Graphic3d_LightSet::myRevision
    protected

    current revision of light source set


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