Blue Brain BioExplorer
core::LightManager Class Reference

Manages light sources in a scene. More...

#include <LightManager.h>

Inheritance diagram for core::LightManager:
Collaboration diagram for core::LightManager:

Public Member Functions

PLATFORM_API size_t addLight (LightPtr light)
 addLight Attaches a light source to the scene. More...
 
PLATFORM_API void removeLight (const size_t id)
 removeLight Removes a light source from the scene for a given ID. More...
 
PLATFORM_API void removeLight (LightPtr light)
 removeLight Removes a light source from the scene. More...
 
PLATFORM_API LightPtr getLight (const size_t id)
 getLight Gets a light source from the scene for a given ID. Note: If changing the light then call markModified to propagate the changes. More...
 
PLATFORM_API const std::map< size_t, LightPtr > & getLights () const
 getLights Gets all light sources currently managed by the LightManager object. More...
 
PLATFORM_API void clearLights ()
 clearLights Removes all light sources managed by the LightManager object. More...
 
- Public Member Functions inherited from core::BaseObject
 BaseObject ()=default
 
virtual ~BaseObject ()=default
 
 BaseObject (const BaseObject &)
 
BaseObjectoperator= (const BaseObject &rhs)
 
bool isModified () const
 
void resetModified ()
 
void markModified (const bool triggerCallback=true)
 
void onModified (const ModifiedCallback &callback)
 
void clearModifiedCallback ()
 

Additional Inherited Members

- Public Types inherited from core::BaseObject
using ModifiedCallback = std::function< void(const BaseObject &)>
 
- Protected Member Functions inherited from core::BaseObject
template<typename T >
void _updateValue (T &member, const T &newValue, const bool triggerCallback=true)
 
template<class T >
bool _isEqual (const T &a, const T &b, typename std::enable_if< std::is_floating_point< T >::value >::type *=0)
 
template<class T >
bool _isEqual (const T &a, const T &b, typename std::enable_if<!std::is_floating_point< T >::value >::type *=0)
 

Detailed Description

Manages light sources in a scene.

A LightManager object is responsible for managing light sources in a scene. It provides methods to add, remove, retrieve, and clear light sources.

Definition at line 40 of file LightManager.h.

Member Function Documentation

◆ addLight()

size_t core::LightManager::addLight ( LightPtr  light)

addLight Attaches a light source to the scene.

Parameters
lightPointer to an object representing the light source.
Returns
The ID assigned to the new light source.

Definition at line 30 of file LightManager.cpp.

◆ clearLights()

void core::LightManager::clearLights ( )

clearLights Removes all light sources managed by the LightManager object.

Definition at line 97 of file LightManager.cpp.

◆ getLight()

LightPtr core::LightManager::getLight ( const size_t  id)

getLight Gets a light source from the scene for a given ID. Note: If changing the light then call markModified to propagate the changes.

Parameters
idID of the light to retrieve.
Returns
Pointer to the requested light source, or nullptr if not found.

Definition at line 83 of file LightManager.cpp.

◆ getLights()

const std::map< size_t, LightPtr > & core::LightManager::getLights ( ) const

getLights Gets all light sources currently managed by the LightManager object.

Returns
Immutable list of all light sources and their IDs.

Definition at line 92 of file LightManager.cpp.

◆ removeLight() [1/2]

void core::LightManager::removeLight ( const size_t  id)

removeLight Removes a light source from the scene for a given ID.

Parameters
idID of the light source to be removed.

Definition at line 51 of file LightManager.cpp.

◆ removeLight() [2/2]

void core::LightManager::removeLight ( LightPtr  light)

removeLight Removes a light source from the scene.

Parameters
lightPointer to the light source to be removed.

Definition at line 69 of file LightManager.cpp.


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