Open CASCADE Technology 7.8.0
|
Class defining the set of light sources. More...
#include <Graphic3d_LightSet.hxx>
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_Transient & | operator= (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_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. | |
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_Size > | myLights |
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_Vec4 & | 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 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. | |
Class defining the set of light sources.
Iteration filter flags.
Graphic3d_LightSet::Graphic3d_LightSet | ( | ) |
Empty constructor.
Standard_Boolean Graphic3d_LightSet::Add | ( | const Handle< Graphic3d_CLight > & | theLight | ) |
Append new light source.
|
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.
|
inline |
Return TRUE if light source is defined in this set.
|
inline |
Return number of light sources.
|
inline |
Return TRUE if lights list is empty.
|
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".
|
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".
|
inline |
Return lower light index.
|
inline |
Returns total amount of enabled lights castings shadows.
|
inline |
Returns total amount of enabled lights EXCLUDING ambient.
|
inline |
Returns total amount of enabled lights of specified type.
|
inline |
Returns total amount of lights of specified type.
Standard_Boolean Graphic3d_LightSet::Remove | ( | const Handle< Graphic3d_CLight > & | theLight | ) |
Remove light source.
|
inline |
Return light sources revision.
Standard_Size Graphic3d_LightSet::UpdateRevision | ( | ) |
Update light sources revision.
|
inline |
Return upper light index.
|
inline |
|
protected |
cached value of cumulative ambient color
|
protected |
revision of cached state
|
protected |
key identifying the list of enabled light sources by their type
|
protected |
key identifying the list of enabled light sources by the number of sources of each type
|
protected |
list of light sources with their cached state (revision)
|
protected |
counters per each light source type defined in the list
|
protected |
counters per each light source type enabled in the list
|
protected |
number of enabled light sources casting shadows
|
protected |
number of enabled light sources, excluding ambient
|
protected |
current revision of light source set