LuciadCPillar 2023.1.02
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...
 
const std::shared_ptr< IRasterModel > & getModel () const
 Gets this layer's model, which provides the raster to be presented. More...
 
const RasterStylegetRasterStyle () const
 Gets the raster style used for painting this layer. More...
 
const std::string & getTitle () const override
 
bool isVisible () const override
 
void removeObserver (const std::shared_ptr< ILayerObserver > &layerObserver) override
 Removes the given observer. More...
 
void setRasterStyle (RasterStyle rasterStyle)
 Changes the style of this layer. More...
 
void setTitle (std::string title) override
 Changes this layer's title. More...
 
void setVisible (bool visible) override
 Changes this layer's visibility. 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
 
virtual const std::string & getTitle () const =0
 
virtual bool isVisible () const =0
 
virtual void removeObserver (const std::shared_ptr< ILayerObserver > &layerObserver)=0
 Removes the given observer. More...
 
virtual void setTitle (std::string title)=0
 Changes this layer's title. More...
 
virtual void setVisible (bool visible)=0
 Changes this layer's visibility. More...
 

Static Public Member Functions

static Builder newBuilder ()
 Returns a new builder for creating a RasterLayer. More...
 
static const std::string & propertyRasterStyle ()
 Property name for the LayerEvent that is fired as a result of changing the layer's style. More...
 
- Static Public Member Functions inherited from luciad::Layer
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.

◆ getModel()

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

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

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

◆ getRasterStyle()

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

Gets the raster style used for painting this layer.

Returns
the style of this layer.
Since
2023.1

◆ getTitle()

const std::string & luciad::RasterLayer::getTitle ( ) const
overridevirtual
Returns
this layer's title, should be suitable for presenting to the user.

Implements luciad::Layer.

◆ isVisible()

bool luciad::RasterLayer::isVisible ( ) const
overridevirtual
Returns
whether this layer is visible.

Implements luciad::Layer.

◆ newBuilder()

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

Returns a new builder for creating a RasterLayer.

Returns
a new builder for creating a RasterLayer.

◆ 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 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.

◆ setRasterStyle()

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

Changes the style of 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

Changes this layer's title.

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

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.