LuciadCPillar 2025.0.03
luciad::RasterLayer Class Referencefinal

A layer for raster models. More...

#include <luciad/layers/rasters/RasterLayer.h>

Inheritance diagram for luciad::RasterLayer:
luciad::Layer

Classes

class  Builder
 Builder for creating a luciad::RasterLayer for a luciad::IRasterModel. More...
 

Public Member Functions

 ~RasterLayer () override
 
void addObserver (std::shared_ptr< ILayerObserver > layerObserver) override
 Adds an observer that allows to receive change events from this layer. More...
 
Builder asBuilder () const
 Returns a new builder based on this layer instance. More...
 
const std::optional< ComplexStrokeLineStyle > & getComplexStrokeLineStyle () const
 Returns the complex stroke line style used for painting this layer. More...
 
const std::optional< FillStyle > & getFillStyle () const
 Returns the fill style used for painting this layer. More...
 
RasterLayerType getLayerType () const
 Returns the type of this raster layer. More...
 
const std::optional< LineStyle > & getLineStyle () const
 Returns the line style used for painting this layer. More...
 
const std::shared_ptr< IRasterModel > & getModel () const
 Returns the layer's model, which provides the raster to be presented. More...
 
const RasterStylegetRasterStyle () const
 Returns the raster style used for painting this layer. More...
 
const std::string & getTitle () const override
 Returns the layer's title. More...
 
bool isBusy () const override
 Returns whether this layer is busy loading data, rendering, loading attributions, or anything else. More...
 
bool isVisible () const override
 Returns whether this layer is visible. More...
 
void removeObserver (const std::shared_ptr< ILayerObserver > &layerObserver) override
 Removes the given observer. More...
 
void setComplexStrokeLineStyle (std::optional< ComplexStrokeLineStyle > complexStrokeLineStyle)
 Sets a complex stroke as the line style used for painting this layer. More...
 
void setFillStyle (std::optional< FillStyle > fillStyle)
 Sets the fill style used for painting this layer. More...
 
void setLineStyle (std::optional< LineStyle > lineStyle)
 Sets the line style used for painting this layer. More...
 
void setRasterStyle (RasterStyle rasterStyle)
 Sets the raster style used for painting this layer. More...
 
void setTitle (std::string title) override
 Sets the layer's title. More...
 
void setVisible (bool visible) override
 Sets whether this layer is visible. More...
 
- Public Member Functions inherited from luciad::Layer
 Layer ()
 Default constructor. More...
 
virtual ~Layer ()=default
 
virtual void addObserver (std::shared_ptr< ILayerObserver > layerObserver)=0
 Adds an observer that allows to receive change events from this layer. More...
 
virtual LayerId getId () const
 Returns the layer's unique id. More...
 
virtual const std::string & getTitle () const =0
 Returns the layer's title. More...
 
virtual bool isBusy () const =0
 Returns whether this layer is busy loading data, rendering, loading attributions, or anything else. More...
 
virtual bool isVisible () const =0
 Returns whether this layer is visible. More...
 
virtual void removeObserver (const std::shared_ptr< ILayerObserver > &layerObserver)=0
 Removes the given observer. More...
 
virtual void setTitle (std::string title)=0
 Sets the layer's title. More...
 
virtual void setVisible (bool visible)=0
 Sets whether this layer is visible. More...
 

Static Public Member Functions

static Builder newBuilder ()
 Returns the new builder for creating a RasterLayer. More...
 
static const std::string & propertyComplexStrokeLineStyle ()
 Property name for the LayerEvent that is fired as a result of changing the layer's complex stroke line style. More...
 
static const std::string & propertyFillStyle ()
 Property name for the LayerEvent that is fired as a result of changing the layer's fill style. More...
 
static const std::string & propertyLineStyle ()
 Property name for the LayerEvent that is fired as a result of changing the layer's line style. More...
 
static const std::string & propertyRasterStyle ()
 Property name for the LayerEvent that is fired as a result of changing the layer's raster style. More...
 
- Static Public Member Functions inherited from luciad::Layer
static const std::string & propertyBusy ()
 Property name for the LayerEvent that is fired as a result of the layer's busy flag changing. More...
 
static const std::string & propertyTitle ()
 Property name for the LayerEvent that is fired as a result of changing the layer's title. More...
 
static const std::string & propertyVisible ()
 Property name for the LayerEvent that is fired as a result of changing the layer's visible flag. More...
 

Detailed Description

A layer for raster models.

Use luciad::RasterLayer::newBuilder to create a raster layer instance.

Constructor & Destructor Documentation

◆ ~RasterLayer()

luciad::RasterLayer::~RasterLayer ( )
override

Member Function Documentation

◆ addObserver()

void luciad::RasterLayer::addObserver ( std::shared_ptr< ILayerObserver layerObserver)
overridevirtual

Adds an observer that allows to receive change events from this layer.

Adding the same observer twice is forbidden, and will cause an exception to be thrown.

Parameters
layerObserveran observer.
Exceptions
luciad::InvalidArgumentExceptionwhen the observer was already added.
luciad::NullArgumentExceptionwhen the observer is nullptr.

Implements luciad::Layer.

◆ asBuilder()

Builder luciad::RasterLayer::asBuilder ( ) const

Returns a new builder based on this layer instance.

You can use this builder, for example, to create a copy of this layer.

Note that observers will not be transferred to a new layer.

Returns
a new builder based on this layer instance.
Since
2025.0

◆ getComplexStrokeLineStyle()

const std::optional< ComplexStrokeLineStyle > & luciad::RasterLayer::getComplexStrokeLineStyle ( ) const

Returns the complex stroke line style used for painting this layer.

Returns
the complex stroke line style of this layer.
Since
2025.0.03

◆ getFillStyle()

const std::optional< FillStyle > & luciad::RasterLayer::getFillStyle ( ) const

Returns the fill style used for painting this layer.

Returns
the fill style of this layer.
Since
2025.0.03

◆ getLayerType()

RasterLayerType luciad::RasterLayer::getLayerType ( ) const

Returns the type of this raster layer.

Returns
this layer type.
Since
2024.0

◆ getLineStyle()

const std::optional< LineStyle > & luciad::RasterLayer::getLineStyle ( ) const

Returns the line style used for painting this layer.

Returns
the line style of this layer.
Since
2025.0.03

◆ getModel()

const std::shared_ptr< IRasterModel > & luciad::RasterLayer::getModel ( ) const

Returns the layer's model, which provides the raster to be presented.

Returns
the layer's model, which provides the raster to be presented.

◆ getRasterStyle()

const RasterStyle & luciad::RasterLayer::getRasterStyle ( ) const

Returns the raster style used for painting this layer.

Returns
the raster style of this layer.
Since
2023.1

◆ getTitle()

const std::string & luciad::RasterLayer::getTitle ( ) const
overridevirtual

Returns the layer's title.

Should be suitable for presenting to the user.

Returns
the layer's title, should be suitable for presenting to the user.

Implements luciad::Layer.

◆ isBusy()

bool luciad::RasterLayer::isBusy ( ) const
overridevirtual

Returns whether this layer is busy loading data, rendering, loading attributions, or anything else.

When this property changes, a LayerEvent is delivered to the observers with the property name propertyBusy.

Note: when the map is moving around it can be that the layer is repeatedly loading new data, but does this fast enough that it is done by the time new data is needed, resulting in a repeatedly changing busyness state.

Returns
whether this layer is busy.
Since
2024.1

Implements luciad::Layer.

◆ isVisible()

bool luciad::RasterLayer::isVisible ( ) const
overridevirtual

Returns whether this layer is visible.

Returns
whether this layer is visible.

Implements luciad::Layer.

◆ newBuilder()

static Builder luciad::RasterLayer::newBuilder ( )
static

Returns the new builder for creating a RasterLayer.

Returns
the new builder for creating a RasterLayer.

◆ propertyComplexStrokeLineStyle()

static const std::string & luciad::RasterLayer::propertyComplexStrokeLineStyle ( )
static

Property name for the LayerEvent that is fired as a result of changing the layer's complex stroke line style.

See also
setComplexStrokeLineStyle
Since
2025.0.03

◆ propertyFillStyle()

static const std::string & luciad::RasterLayer::propertyFillStyle ( )
static

Property name for the LayerEvent that is fired as a result of changing the layer's fill style.

See also
setFillStyle
Since
2025.0.03

◆ propertyLineStyle()

static const std::string & luciad::RasterLayer::propertyLineStyle ( )
static

Property name for the LayerEvent that is fired as a result of changing the layer's line style.

See also
setLineStyle
Since
2025.0.03

◆ propertyRasterStyle()

static const std::string & luciad::RasterLayer::propertyRasterStyle ( )
static

Property name for the LayerEvent that is fired as a result of changing the layer's raster style.

See also
setRasterStyle
Since
2023.1

◆ removeObserver()

void luciad::RasterLayer::removeObserver ( const std::shared_ptr< ILayerObserver > &  layerObserver)
overridevirtual

Removes the given observer.

If the given observer was never added, an exception is thrown.

Parameters
layerObserveran observer.
Exceptions
luciad::InvalidArgumentExceptionwhen the observer is not known.
luciad::NullArgumentExceptionwhen the observer is nullptr.

Implements luciad::Layer.

◆ setComplexStrokeLineStyle()

void luciad::RasterLayer::setComplexStrokeLineStyle ( std::optional< ComplexStrokeLineStyle complexStrokeLineStyle)

Sets a complex stroke as the line style used for painting this layer.

Only one line style can be set. If this function is called when a LineStyle has already been set, it will be overwritten.

After calling this, a LayerEvent is delivered to the observers with the property name PropertyComplexStrokeLineStyle. If a previous LineStyle was overwritten, a LayerEvent with the PropertyLineStyle property is also delivered.

Parameters
complexStrokeLineStylethe new complex stroke line style.
Since
2025.0.03

◆ setFillStyle()

void luciad::RasterLayer::setFillStyle ( std::optional< FillStyle fillStyle)

Sets the fill style used for painting this layer.

After calling this, a LayerEvent is delivered to the observers with the property name PropertyFillStyle.

Parameters
fillStylethe new fill style.
Since
2025.0.03

◆ setLineStyle()

void luciad::RasterLayer::setLineStyle ( std::optional< LineStyle lineStyle)

Sets the line style used for painting this layer.

Only one line style can be set. If this function is called when a ComplexStrokeLineStyle has already been set, it will be overwritten.

After calling this, a LayerEvent is delivered to the observers with the property name PropertyLineStyle. If a previous ComplexStrokeLineStyle was overwritten, a LayerEvent with the PropertyComplexStrokeLineStyle property is also delivered.

Parameters
lineStylethe new line style.
Since
2025.0.03

◆ setRasterStyle()

void luciad::RasterLayer::setRasterStyle ( RasterStyle  rasterStyle)

Sets the raster style used for painting this layer.

If the new raster style is different from the old one, a LayerEvent is delivered to the observers with the property name PropertyRasterStyle.

Parameters
rasterStylethe new raster style.
Since
2023.1

◆ setTitle()

void luciad::RasterLayer::setTitle ( std::string  title)
overridevirtual

Sets the layer's title.

Should be suitable for presenting to the user.

If the new title is indeed different from the old one, a LayerEvent is delivered to the observers with the property name PropertyTitle.

Parameters
titlethe new title.

Implements luciad::Layer.

◆ setVisible()

void luciad::RasterLayer::setVisible ( bool  visible)
overridevirtual

Sets whether this layer is visible.

Changes this layer's visibility. If the new visibility is different from the old one, a LayerEvent is delivered to the observers with the property name PropertyVisible.

Parameters
visiblethe new visibility.

Implements luciad::Layer.