#include <LightManager.h>
Public Member Functions | |
std::vector< Light > | GetAllLights (LightGroup type=LightGroup::None) const |
std::vector< Color > | GetColor (std::vector< Light > &lights) const |
Color | GetColor (LightId id) const |
std::vector< float > | GetIntensity (std::vector< Light > &lights) const |
float | GetIntensity (LightId id) const |
std::vector< LightGroup > | GetLightGroup (std::vector< Light > &lights) const |
LightGroup | GetLightGroup (LightId id) const |
std::vector< LightState > | GetLightState (std::vector< Light > &lights) const |
LightState | GetLightState (LightId id) const |
std::vector< Light > | GetTurnedOffLights (LightGroup type=LightGroup::None) const |
std::vector< Light > | GetTurnedOnLights (LightGroup type=LightGroup::None) const |
std::vector< bool > | IsActive (std::vector< Light > &lights) const |
bool | IsActive (LightId id) const |
LightManager () | |
LightManager (const LightManager &other) | |
void | SetActive (std::vector< Light > &lights, std::vector< bool > &active) |
void | SetActive (LightId id, bool active) |
void | SetColor (std::vector< Light > &lights, Color color) |
void | SetColor (std::vector< Light > &lights, std::vector< Color > &colors) |
void | SetColor (LightId id, Color color) |
void | SetDayNightCycle (const bool active) |
void | SetEpisode (detail::WeakEpisodeProxy episode) |
void | SetIntensity (std::vector< Light > &lights, float intensity) |
void | SetIntensity (std::vector< Light > &lights, std::vector< float > &intensities) |
void | SetIntensity (LightId id, float intensity) |
void | SetLightGroup (std::vector< Light > &lights, LightGroup group) |
void | SetLightGroup (std::vector< Light > &lights, std::vector< LightGroup > &groups) |
void | SetLightGroup (LightId id, LightGroup group) |
void | SetLightState (std::vector< Light > &lights, LightState state) |
void | SetLightState (std::vector< Light > &lights, std::vector< LightState > &states) |
void | SetLightState (LightId id, const LightState &new_state) |
void | SetLightStateNoLock (LightId id, const LightState &new_state) |
void | TurnOff (std::vector< Light > &lights) |
void | TurnOn (std::vector< Light > &lights) |
~LightManager () | |
Private Types | |
using | LightGroup = rpc::LightState::LightGroup |
Private Member Functions | |
void | ApplyChanges () |
void | QueryLightsStateToServer () |
const LightState & | RetrieveLightState (LightId id) const |
void | UpdateServerLightsState (bool discard_client=false) |
Private Attributes | |
bool | _dirty = false |
detail::WeakEpisodeProxy | _episode |
std::unordered_map< LightId, Light > | _lights |
std::unordered_map< LightId, LightState > | _lights_changes |
std::unordered_map< LightId, LightState > | _lights_state |
std::mutex | _mutex |
size_t | _on_light_update_register_id = 0 |
size_t | _on_tick_register_id = 0 |
LightState | _state |
Definition at line 25 of file LightManager.h.
|
private |
Definition at line 28 of file LightManager.h.
|
inline |
Definition at line 32 of file LightManager.h.
References ~LightManager().
carla::client::LightManager::~LightManager | ( | ) |
Definition at line 17 of file LightManager.cpp.
References _episode, _on_light_update_register_id, and UpdateServerLightsState().
Referenced by LightManager().
|
inline |
Definition at line 36 of file LightManager.h.
References _dirty, _episode, _lights, _lights_changes, _lights_state, _on_light_update_register_id, _on_tick_register_id, ApplyChanges(), GetAllLights(), GetColor(), GetIntensity(), GetLightGroup(), GetLightState(), GetTurnedOffLights(), GetTurnedOnLights(), IsActive(), carla::rpc::LightState::None, QueryLightsStateToServer(), RetrieveLightState(), SetActive(), SetColor(), SetDayNightCycle(), SetEpisode(), SetIntensity(), SetLightGroup(), SetLightState(), SetLightStateNoLock(), TurnOff(), TurnOn(), and UpdateServerLightsState().
|
private |
Definition at line 323 of file LightManager.cpp.
References _lights_changes, _mutex, and SetLightStateNoLock().
Referenced by LightManager(), and SetEpisode().
std::vector< Light > carla::client::LightManager::GetAllLights | ( | LightGroup | type = LightGroup::None | ) | const |
Definition at line 43 of file LightManager.cpp.
References _lights, _lights_state, and carla::rpc::LightState::None.
Referenced by LightManager().
Definition at line 127 of file LightManager.cpp.
Referenced by LightManager().
Definition at line 198 of file LightManager.cpp.
References carla::client::LightState::_color, and RetrieveLightState().
std::vector< float > carla::client::LightManager::GetIntensity | ( | std::vector< Light > & | lights | ) | const |
Definition at line 148 of file LightManager.cpp.
Referenced by LightManager().
float carla::client::LightManager::GetIntensity | ( | LightId | id | ) | const |
Definition at line 202 of file LightManager.cpp.
References carla::client::LightState::_intensity, and RetrieveLightState().
std::vector< LightGroup > carla::client::LightManager::GetLightGroup | ( | std::vector< Light > & | lights | ) | const |
Definition at line 169 of file LightManager.cpp.
Referenced by LightManager().
LightGroup carla::client::LightManager::GetLightGroup | ( | LightId | id | ) | const |
Definition at line 210 of file LightManager.cpp.
References carla::client::LightState::_group, and RetrieveLightState().
std::vector< LightState > carla::client::LightManager::GetLightState | ( | std::vector< Light > & | lights | ) | const |
Definition at line 190 of file LightManager.cpp.
References RetrieveLightState().
Referenced by LightManager().
LightState carla::client::LightManager::GetLightState | ( | LightId | id | ) | const |
Definition at line 206 of file LightManager.cpp.
References RetrieveLightState().
std::vector< Light > carla::client::LightManager::GetTurnedOffLights | ( | LightGroup | type = LightGroup::None | ) | const |
Definition at line 99 of file LightManager.cpp.
References carla::client::LightState::_active, carla::client::LightState::_group, _lights, _lights_state, and carla::rpc::LightState::None.
Referenced by LightManager().
std::vector< Light > carla::client::LightManager::GetTurnedOnLights | ( | LightGroup | type = LightGroup::None | ) | const |
Definition at line 84 of file LightManager.cpp.
References carla::client::LightState::_active, carla::client::LightState::_group, _lights, _lights_state, and carla::rpc::LightState::None.
Referenced by LightManager().
std::vector< bool > carla::client::LightManager::IsActive | ( | std::vector< Light > & | lights | ) | const |
Definition at line 76 of file LightManager.cpp.
Referenced by LightManager().
bool carla::client::LightManager::IsActive | ( | LightId | id | ) | const |
Definition at line 214 of file LightManager.cpp.
References carla::client::LightState::_active, and RetrieveLightState().
|
private |
Definition at line 273 of file LightManager.cpp.
References _episode, _lights, _lights_state, and _mutex.
Referenced by LightManager(), and SetEpisode().
|
private |
Definition at line 264 of file LightManager.cpp.
References _lights_state, _state, and carla::log_warning().
Referenced by GetColor(), GetIntensity(), GetLightGroup(), GetLightState(), IsActive(), LightManager(), SetActive(), SetColor(), SetIntensity(), SetLightGroup(), SetLightState(), and SetLightStateNoLock().
void carla::client::LightManager::SetActive | ( | std::vector< Light > & | lights, |
std::vector< bool > & | active | ||
) |
Definition at line 69 of file LightManager.cpp.
Referenced by LightManager(), TurnOff(), and TurnOn().
void carla::client::LightManager::SetActive | ( | LightId | id, |
bool | active | ||
) |
Definition at line 218 of file LightManager.cpp.
References carla::client::LightState::_active, _dirty, _lights_changes, _mutex, and RetrieveLightState().
Definition at line 114 of file LightManager.cpp.
Referenced by LightManager(), and SetColor().
void carla::client::LightManager::SetColor | ( | std::vector< Light > & | lights, |
std::vector< Color > & | colors | ||
) |
Definition at line 120 of file LightManager.cpp.
References SetColor().
Definition at line 226 of file LightManager.cpp.
References carla::client::LightState::_color, _dirty, _lights_changes, _mutex, and RetrieveLightState().
void carla::client::LightManager::SetDayNightCycle | ( | const bool | active | ) |
Definition at line 330 of file LightManager.cpp.
References _episode.
Referenced by LightManager().
void carla::client::LightManager::SetEpisode | ( | detail::WeakEpisodeProxy | episode | ) |
Definition at line 25 of file LightManager.cpp.
References _episode, _on_light_update_register_id, _on_tick_register_id, ApplyChanges(), QueryLightsStateToServer(), and UpdateServerLightsState().
Referenced by LightManager().
void carla::client::LightManager::SetIntensity | ( | std::vector< Light > & | lights, |
float | intensity | ||
) |
Definition at line 135 of file LightManager.cpp.
Referenced by LightManager(), and SetIntensity().
void carla::client::LightManager::SetIntensity | ( | std::vector< Light > & | lights, |
std::vector< float > & | intensities | ||
) |
Definition at line 141 of file LightManager.cpp.
References SetIntensity().
void carla::client::LightManager::SetIntensity | ( | LightId | id, |
float | intensity | ||
) |
Definition at line 234 of file LightManager.cpp.
References _dirty, carla::client::LightState::_intensity, _lights_changes, _mutex, and RetrieveLightState().
void carla::client::LightManager::SetLightGroup | ( | std::vector< Light > & | lights, |
LightGroup | group | ||
) |
Definition at line 156 of file LightManager.cpp.
Referenced by LightManager(), and SetLightGroup().
void carla::client::LightManager::SetLightGroup | ( | std::vector< Light > & | lights, |
std::vector< LightGroup > & | groups | ||
) |
Definition at line 162 of file LightManager.cpp.
References SetLightGroup().
void carla::client::LightManager::SetLightGroup | ( | LightId | id, |
LightGroup | group | ||
) |
Definition at line 256 of file LightManager.cpp.
References _dirty, carla::client::LightState::_group, _lights_changes, _mutex, and RetrieveLightState().
void carla::client::LightManager::SetLightState | ( | std::vector< Light > & | lights, |
LightState | state | ||
) |
Definition at line 177 of file LightManager.cpp.
Referenced by LightManager(), and SetLightState().
void carla::client::LightManager::SetLightState | ( | std::vector< Light > & | lights, |
std::vector< LightState > & | states | ||
) |
Definition at line 183 of file LightManager.cpp.
References SetLightState().
void carla::client::LightManager::SetLightState | ( | LightId | id, |
const LightState & | new_state | ||
) |
Definition at line 242 of file LightManager.cpp.
References _dirty, _lights_changes, _mutex, and RetrieveLightState().
void carla::client::LightManager::SetLightStateNoLock | ( | LightId | id, |
const LightState & | new_state | ||
) |
Definition at line 250 of file LightManager.cpp.
References _lights_changes, and RetrieveLightState().
Referenced by ApplyChanges(), and LightManager().
void carla::client::LightManager::TurnOff | ( | std::vector< Light > & | lights | ) |
Definition at line 63 of file LightManager.cpp.
References SetActive().
Referenced by LightManager().
void carla::client::LightManager::TurnOn | ( | std::vector< Light > & | lights | ) |
Definition at line 57 of file LightManager.cpp.
References SetActive().
Referenced by LightManager().
|
private |
Definition at line 296 of file LightManager.cpp.
References _dirty, _episode, carla::rpc::LightState::_id, _lights, _lights_changes, and _mutex.
Referenced by LightManager(), SetEpisode(), and ~LightManager().
|
private |
Definition at line 109 of file LightManager.h.
Referenced by LightManager(), SetActive(), SetColor(), SetIntensity(), SetLightGroup(), SetLightState(), and UpdateServerLightsState().
|
private |
Definition at line 102 of file LightManager.h.
Referenced by LightManager(), QueryLightsStateToServer(), SetDayNightCycle(), SetEpisode(), UpdateServerLightsState(), and ~LightManager().
Definition at line 100 of file LightManager.h.
Referenced by GetAllLights(), GetTurnedOffLights(), GetTurnedOnLights(), LightManager(), QueryLightsStateToServer(), and UpdateServerLightsState().
|
private |
Definition at line 99 of file LightManager.h.
Referenced by ApplyChanges(), LightManager(), SetActive(), SetColor(), SetIntensity(), SetLightGroup(), SetLightState(), SetLightStateNoLock(), and UpdateServerLightsState().
|
private |
Definition at line 98 of file LightManager.h.
Referenced by GetAllLights(), GetTurnedOffLights(), GetTurnedOnLights(), LightManager(), QueryLightsStateToServer(), and RetrieveLightState().
|
private |
Definition at line 104 of file LightManager.h.
Referenced by ApplyChanges(), QueryLightsStateToServer(), SetActive(), SetColor(), SetIntensity(), SetLightGroup(), SetLightState(), and UpdateServerLightsState().
|
private |
Definition at line 108 of file LightManager.h.
Referenced by LightManager(), SetEpisode(), and ~LightManager().
|
private |
Definition at line 107 of file LightManager.h.
Referenced by LightManager(), and SetEpisode().
|
private |
Definition at line 106 of file LightManager.h.
Referenced by RetrieveLightState().