|
LuciadCPillar 2026.1
|
Controls the light that is used to shade a map in 3D. More...
#include <luciad/maps/effects/LightEffect.h>
Public Member Functions | |
| LightEffect (const LightEffect &)=delete | |
| const std::shared_ptr< LightModel > & | getModel () const |
| Returns the light model. | |
| bool | isEnabled () const |
| Returns whether lighting is enabled. | |
| LightEffect & | operator= (const LightEffect &)=delete |
| void | setEnabled (bool enabled) |
| Sets whether lighting is enabled. | |
| void | setModel (std::shared_ptr< LightModel > model) |
| Sets the light model. | |
Controls the light that is used to shade a map in 3D.
You cannot create a LightEffect. Instead, retrieve it from GraphicsEffects::getLight.
A map has exactly one light, described by an immutable luciad::LightModel: a luciad::HeadlightModel, luciad::DirectionalLightModel or luciad::SunlightModel. Read the active light with getModel and change it by building a new light and passing it to setModel.
By default a map uses a luciad::HeadlightModel, meaning 3D assets are shaded even when the application configures no light explicitly. Disable lighting with setEnabled; the configured light is kept and restored when the effect is enabled again.
|
delete |
| const std::shared_ptr< LightModel > & luciad::LightEffect::getModel | ( | ) | const |
Returns the light model.
| bool luciad::LightEffect::isEnabled | ( | ) | const |
Returns whether lighting is enabled.
|
delete |
| void luciad::LightEffect::setEnabled | ( | bool | enabled | ) |
Sets whether lighting is enabled.
Disabling it turns off lighting on the map while keeping the configured light, which is restored when lighting is enabled again. The default is true.
| enabled | true to enable lighting or false to disable it. |
| void luciad::LightEffect::setModel | ( | std::shared_ptr< LightModel > | model | ) |
Sets the light model.
The default is a luciad::HeadlightModel with default parameters.
| model | the light model. |
| luciad::NullArgumentException | when the model is a nullptr value. |