LuciadCPillar 2026.1.02
Loading...
Searching...
No Matches
luciad::LineOfSightLayer Class Referencefinal

A layer for feature models containing line-of-sight (LOS) features. More...

#include <luciad/layers/los/LineOfSightLayer.h>

Inheritance diagram for luciad::LineOfSightLayer:
luciad::Layer

Classes

class  Builder
 Builder for creating a luciad::LineOfSightLayer for a luciad::IFeatureModel with line-of-sight features. More...

Public Member Functions

 ~LineOfSightLayer () override
void addObserver (std::shared_ptr< ILayerObserver > layerObserver) override
 Adds an observer that allows to receive change events from this layer.
Builder asBuilder () const
 Returns a new builder based on this layer instance.
const LineOfSightStyle & getLineOfSightStyle () const
 Returns the line-of-sight style used for painting this layer.
const std::shared_ptr< IFeatureModel > & getModel () const
 Returns the layer's model, which provides the line-of-sight features to be presented.
const std::string & getTitle () const override
 Returns the layer's title.
bool isBusy () const override
 Returns whether this layer is busy loading data, rendering, loading attributions, or anything else.
bool isVisible () const override
 Returns whether this layer is visible.
void removeObserver (const std::shared_ptr< ILayerObserver > &layerObserver) override
 Removes the given observer.
void setLineOfSightStyle (LineOfSightStyle losStyle)
 Sets the line-of-sight style used for painting this layer.
void setTitle (std::string title) override
 Sets the layer's title.
void setVisible (bool visible) override
 Sets whether this layer is visible.
Public Member Functions inherited from luciad::Layer
 Layer ()
 Default constructor.
virtual ~Layer ()=default
virtual LayerId getId () const
 Returns the layer's unique id.

Static Public Member Functions

static Builder newBuilder ()
 Returns the new builder for creating a LineOfSightLayer.
static const std::string & propertyLineOfSightStyle ()
 Property name for the LayerEvent that is fired as a result of changing the layer's style.
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.
static const std::string & propertyTitle ()
 Property name for the LayerEvent that is fired as a result of changing the layer's title.
static const std::string & propertyVisible ()
 Property name for the LayerEvent that is fired as a result of changing the layer's visible flag.

Detailed Description

A layer for feature models containing line-of-sight (LOS) features.

Such a feature represents an observer with some additional properties which together define a line-of-sight coverage.

Use luciad::LineOfSightLayer::newBuilder to create a line-of-sight layer instance.

See also
luciad::LineOfSightFeature
Since
2025.0

Constructor & Destructor Documentation

◆ ~LineOfSightLayer()

luciad::LineOfSightLayer::~LineOfSightLayer ( )
override

Member Function Documentation

◆ addObserver()

void luciad::LineOfSightLayer::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::LineOfSightLayer::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

◆ getLineOfSightStyle()

const LineOfSightStyle & luciad::LineOfSightLayer::getLineOfSightStyle ( ) const

Returns the line-of-sight style used for painting this layer.

Returns
the style of this layer.

◆ getModel()

const std::shared_ptr< IFeatureModel > & luciad::LineOfSightLayer::getModel ( ) const

Returns the layer's model, which provides the line-of-sight features to be presented.

Such a feature represents an observer with some additional properties which together define a line-of-sight coverage.

Returns
the layer's model, which provides the line-of-sight features to be presented.
See also
luciad::LineOfSightFeature

◆ getTitle()

const std::string & luciad::LineOfSightLayer::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::LineOfSightLayer::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::LineOfSightLayer::isVisible ( ) const
overridevirtual

Returns whether this layer is visible.

Returns
whether this layer is visible.

Implements luciad::Layer.

◆ newBuilder()

Builder luciad::LineOfSightLayer::newBuilder ( )
static

Returns the new builder for creating a LineOfSightLayer.

Returns
the new builder for creating a LineOfSightLayer.

◆ propertyLineOfSightStyle()

const std::string & luciad::LineOfSightLayer::propertyLineOfSightStyle ( )
static

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

See also
setLineOfSightStyle

◆ removeObserver()

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

◆ setLineOfSightStyle()

void luciad::LineOfSightLayer::setLineOfSightStyle ( LineOfSightStyle losStyle)

Sets the line-of-sight style used for painting this layer.

If the new line-of-sight style is different from the old one, a LayerEvent is delivered to the observers with the property name propertyLineOfSightStyle.

Parameters
losStylethe new line-of-sight style.

◆ setTitle()

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