LuciadCPillar 2023.1.04
luciad::FeatureLayer Class Referencefinal

A layer for feature models. More...

#include <luciad/layers/features/FeatureLayer.h>

Inheritance diagram for luciad::FeatureLayer:
luciad::Layer

Classes

class  Builder
 Builder for the luciad::FeatureLayer class. More...
 

Public Member Functions

 ~FeatureLayer () override
 
void addObserver (std::shared_ptr< ILayerObserver > layerObserver) override
 Adds an observer that allows to receive change events from this layer. More...
 
std::shared_ptr< IFeatureEditConfigurationgetEditConfiguration () const
 Returns if editing is supported and how editing is configured. More...
 
std::shared_ptr< IFeatureGeometryProvidergetEditCreateGeometryProvider () const
 
FeatureLayerLoadingStrategy getLoadingStrategy () const
 
const std::shared_ptr< IFeatureModel > & getModel () const
 
const std::shared_ptr< IFeaturePainter > & getPainter () const
 
const std::shared_ptr< FeatureQueryConfiguration > & getQueryConfiguration () const
 
const std::string & getTitle () const override
 Returns the layer's title. More...
 
bool isEditable () const
 Returns whether this layer is editable. More...
 
bool isLabeled () const
 
bool isQueryable () const
 
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 setEditable (bool editable)
 Sets whether this layer is editable. More...
 
void setLabeled (bool labeled)
 Sets whether the layer should display labels. More...
 
void setPainter (std::shared_ptr< IFeaturePainter > featurePainter)
 Sets the new IFeaturePainter to use. More...
 
void setQueryable (bool queryable)
 Sets whether the features of this layer can be returned in the Map::queryFeatures method. 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 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 a new builder for creating a FeatureLayer. More...
 
static const std::string & propertyEditable ()
 Returns the property name for the LayerEvent that is fired as a result of changing the layer's editable flag. More...
 
static const std::string & propertyLabeled ()
 Returns the property name for the LayerEvent that is fired as a result of changing the layer's labeled flag. More...
 
static const std::string & propertyPainter ()
 Returns the property name for the LayerEvent that is fired as a result of changing the layer's IFeaturePainter. More...
 
static const std::string & propertyQueryable ()
 Returns the property name for the LayerEvent that is fired as a result of changing the layer's queryable flag. 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 feature models.

Use luciad::FeatureLayer::newBuilder to create a feature layer instance.

Constructor & Destructor Documentation

◆ ~FeatureLayer()

luciad::FeatureLayer::~FeatureLayer ( )
override

Member Function Documentation

◆ addObserver()

void luciad::FeatureLayer::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.

◆ getEditConfiguration()

std::shared_ptr< IFeatureEditConfiguration > luciad::FeatureLayer::getEditConfiguration ( ) const

Returns if editing is supported and how editing is configured.

Whether or not the layer can be edited by the user is controlled using setEditable.

Returns
an IFeatureEditConfiguration for the IFeatureModel of this layer, or nullptr if editing is not supported.
See also
FeatureLayer::Builder::editConfiguration
Since
2020.1

◆ getEditCreateGeometryProvider()

std::shared_ptr< IFeatureGeometryProvider > luciad::FeatureLayer::getEditCreateGeometryProvider ( ) const
Returns
the edit/create geometry provider for a Feature.
See also
FeatureLayer::Builder::editCreateGeometryProvider
Since
2020.1

◆ getLoadingStrategy()

FeatureLayerLoadingStrategy luciad::FeatureLayer::getLoadingStrategy ( ) const
Returns
the loading strategy that is used.
See also
FeatureLayer::Builder::loadingStrategy
Since
2023.0.02

◆ getModel()

const std::shared_ptr< IFeatureModel > & luciad::FeatureLayer::getModel ( ) const
Returns
this layer's model, which provides the features to present.

◆ getPainter()

const std::shared_ptr< IFeaturePainter > & luciad::FeatureLayer::getPainter ( ) const
Returns
this layer's painter, which determines how the features are presented.

◆ getQueryConfiguration()

const std::shared_ptr< FeatureQueryConfiguration > & luciad::FeatureLayer::getQueryConfiguration ( ) const
Returns
this layer's query configuration, which specifies which feature to present at different map scales.

◆ getTitle()

const std::string & luciad::FeatureLayer::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.

◆ isEditable()

bool luciad::FeatureLayer::isEditable ( ) const

Returns whether this layer is editable.

A layer is editable if it has an IFeatureEditConfiguration and if the editable flag is set.

Returns
whether this layer is editable.
See also
setEditable
Since
2020.1

◆ isLabeled()

bool luciad::FeatureLayer::isLabeled ( ) const
Returns
if this layer currently displays labels.
Since
2020.2

◆ isQueryable()

bool luciad::FeatureLayer::isQueryable ( ) const
Returns
whether the features of this layer can be returned in the Map::queryFeatures method.
Since
2023.1

◆ isVisible()

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

Returns whether this layer is visible.

Returns
whether this layer is visible.

Implements luciad::Layer.

◆ newBuilder()

static Builder luciad::FeatureLayer::newBuilder ( )
static

Returns a new builder for creating a FeatureLayer.

Returns
a new builder for creating a FeatureLayer.

◆ propertyEditable()

static const std::string & luciad::FeatureLayer::propertyEditable ( )
static

Returns the property name for the LayerEvent that is fired as a result of changing the layer's editable flag.

Returns
the property name for the LayerEvent that is fired as a result of changing the layer's editable flag.
See also
setEditable

◆ propertyLabeled()

static const std::string & luciad::FeatureLayer::propertyLabeled ( )
static

Returns the property name for the LayerEvent that is fired as a result of changing the layer's labeled flag.

Returns
the property name for the LayerEvent that is fired as a result of changing the layer's labeled flag.
See also
setLabeled
Since
2020.2

◆ propertyPainter()

static const std::string & luciad::FeatureLayer::propertyPainter ( )
static

Returns the property name for the LayerEvent that is fired as a result of changing the layer's IFeaturePainter.

Returns
the property name for the LayerEvent that is fired as a result of changing the layer's IFeaturePainter.
See also
setPainter
Since
2023.1

◆ propertyQueryable()

static const std::string & luciad::FeatureLayer::propertyQueryable ( )
static

Returns the property name for the LayerEvent that is fired as a result of changing the layer's queryable flag.

Returns
the property name for the LayerEvent that is fired as a result of changing the layer's queryable flag.
See also
setQueryable
Since
2023.1

◆ removeObserver()

void luciad::FeatureLayer::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.

◆ setEditable()

void luciad::FeatureLayer::setEditable ( bool  editable)

Sets whether this layer is editable.

Sets whether or not the features of the layer can be edited by the user. If the new value is different from the old one, a LayerEvent is delivered to the observers with the property name FeatureLayer::propertyEditable.

This flag is checked by the Editor when receiving events from the IFeatureEditCandidateProvider in conjunction with the model's IFeatureModelUpdater and the layer's IFeatureEditConfiguration.

This flag is true by default. This flag has no effect if the layer does not contain an IFeatureEditConfiguration or if the model's IFeatureModelUpdater is missing.

Parameters
editablethe new value for this property
Since
2020.1

◆ setLabeled()

void luciad::FeatureLayer::setLabeled ( bool  labeled)

Sets whether the layer should display labels.

Note that in order for the layer to display labels, its IFeaturePainter should also call the FeatureCanvas::drawLabel method for its features. If not, no labels will be displayed, regardless of this setting.

Parameters
labeledtrue to enable labels.
Since
2020.2

◆ setPainter()

void luciad::FeatureLayer::setPainter ( std::shared_ptr< IFeaturePainter featurePainter)

Sets the new IFeaturePainter to use.

It will replace the IFeaturePainter that was set using the FeatureLayer::Builder::painter method, or if that method was not called, it will replace the default feature painter.

Limitation: This method currently only supports setting a new IFeaturePainter with the exact same level of details as the previous painter. If this is not the case, this method will throw an exception.

Parameters
featurePainterthe feature painter used to paint the feature model. Cannot be nullptr.
Exceptions
luciad::NullArgumentExceptionwhen the given feature painter is nullptr
luciad::InvalidArgumentExceptionwhen the new painter has different detail levels than the previous painter
Since
2023.1

◆ setQueryable()

void luciad::FeatureLayer::setQueryable ( bool  queryable)

Sets whether the features of this layer can be returned in the Map::queryFeatures method.

The default is true.

It is useful to set this property to false when:

Parameters
queryablewhether the features of this layer can be returned in the Map::queryFeatures method
Since
2023.1

◆ setTitle()

void luciad::FeatureLayer::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::FeatureLayer::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.