LuciadCPillar 2026.1
Loading...
Searching...
No Matches
luciad::LightEffect Class Referencefinal

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.

Detailed Description

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.

Since
2026.1

Constructor & Destructor Documentation

◆ LightEffect()

luciad::LightEffect::LightEffect ( const LightEffect & )
delete

Member Function Documentation

◆ getModel()

const std::shared_ptr< LightModel > & luciad::LightEffect::getModel ( ) const

Returns the light model.

Returns
the light model.

◆ isEnabled()

bool luciad::LightEffect::isEnabled ( ) const

Returns whether lighting is enabled.

Returns
whether lighting is enabled.

◆ operator=()

LightEffect & luciad::LightEffect::operator= ( const LightEffect & )
delete

◆ setEnabled()

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.

Parameters
enabledtrue to enable lighting or false to disable it.

◆ setModel()

void luciad::LightEffect::setModel ( std::shared_ptr< LightModel > model)

Sets the light model.

The default is a luciad::HeadlightModel with default parameters.

Parameters
modelthe light model.
Exceptions
luciad::NullArgumentExceptionwhen the model is a nullptr value.