LuciadCPillar 2023.1.04
luciad::FeatureLayer::Builder Class Referencefinal

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

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

Public Member Functions

 Builder (Builder &&other) noexcept
 
 Builder (const Builder &other)
 
 ~Builder ()
 
std::shared_ptr< FeatureLayerbuild () const
 Returns a new layer, based on the properties set on this builder. More...
 
Buildereditable (bool editable)
 Sets whether the layer should be editable initially. More...
 
BuildereditConfiguration (std::shared_ptr< IFeatureEditConfiguration > editConfiguration)
 Enables editing capabilities using the given IFeatureEditConfiguration. More...
 
BuildereditCreateGeometryProvider (std::shared_ptr< IFeatureGeometryProvider > geometryProvider)
 Provides the edit/create geometry provider for a Feature. More...
 
Builderlabeled (bool labeled)
 Sets whether the layer should display labels initially. More...
 
BuilderloadingStrategy (FeatureLayerLoadingStrategy loadingStrategy)
 Sets the FeatureLayerLoadingStrategy to use. More...
 
Buildermodel (std::shared_ptr< IFeatureModel > model)
 Sets the feature model of the layer. More...
 
Builderoperator= (Builder other) noexcept
 
Builderpainter (std::shared_ptr< IFeaturePainter > featurePainter)
 Sets the IFeaturePainter to use. More...
 
Builderqueryable (bool queryable)
 Sets whether the features in this layer can be returned in the Map::queryFeatures method. More...
 
BuilderqueryConfiguration (std::shared_ptr< FeatureQueryConfiguration > configuration)
 Sets the query configuration to use. More...
 
Buildertitle (std::string title)
 Sets the title to use for the layer. More...
 
Buildervisible (bool visible)
 Sets whether the layer should be visible initially. More...
 

Detailed Description

Constructor & Destructor Documentation

◆ Builder() [1/2]

luciad::FeatureLayer::Builder::Builder ( const Builder other)

◆ Builder() [2/2]

luciad::FeatureLayer::Builder::Builder ( Builder &&  other)
noexcept

◆ ~Builder()

luciad::FeatureLayer::Builder::~Builder ( )

Member Function Documentation

◆ build()

std::shared_ptr< FeatureLayer > luciad::FeatureLayer::Builder::build ( ) const

Returns a new layer, based on the properties set on this builder.

Returns
a new layer, based on the properties set on this builder.
Exceptions
luciad::LogicExceptionIf not all mandatory parameters are set. If no painter is set and the feature model contains at least one feature data type without a geometry.

◆ editable()

Builder & luciad::FeatureLayer::Builder::editable ( bool  editable)

Sets whether the layer should be editable initially.

When an edit configuration is set, the default is true. When no edit configuration is set, the default is false.

When this method is called with true as parameter, and no edit configuration is edit set, a default edit configuration will be used. This default configuration enables editing for all features, using a default handles provider.

Refer to editConfiguration for enabling editing capabilities.

Parameters
editablethe edit capability.
Returns
this builder.
See also
FeatureLayer::setEditable for more info.
Since
2020.1

◆ editConfiguration()

Builder & luciad::FeatureLayer::Builder::editConfiguration ( std::shared_ptr< IFeatureEditConfiguration editConfiguration)

Enables editing capabilities using the given IFeatureEditConfiguration.

If not set, editing will not be supported, and FeatureLayer::getEditConfiguration will return nullptr. If set, editing will be enabled by default.

Additional configuration for editing can be done using:

Parameters
editConfigurationthe feature edit configuration used to edit the feature model. Cannot be nullptr.
Returns
this builder.
Since
2020.1
Exceptions
luciad::NullArgumentExceptionwhen the given edit configuration is nullptr

◆ editCreateGeometryProvider()

Builder & luciad::FeatureLayer::Builder::editCreateGeometryProvider ( std::shared_ptr< IFeatureGeometryProvider geometryProvider)

Provides the edit/create geometry provider for a Feature.

This geometry provider determines using which geometry a Feature can be edited or created, and how to apply this geometry back on the Feature. This implementation is for example used by FeatureHandlesProvider, and by Creator.

Calling this method is optional. When this method is not called, a default implementation will be used. This default implementation assumes that

Parameters
geometryProviderthe edit geometry provider for the current Feature. Cannot be nullptr.
Returns
this
Since
2020.1
Exceptions
luciad::NullArgumentExceptionwhen the given geometry provider is nullptr

◆ labeled()

Builder & luciad::FeatureLayer::Builder::labeled ( bool  labeled)

Sets whether the layer should display labels initially.

The default is true.

Returns
this builder.
Parameters
labeledwhether the layer should display labels initially.
See also
FeatureLayer::setLabeled
Since
2020.2

◆ loadingStrategy()

Builder & luciad::FeatureLayer::Builder::loadingStrategy ( FeatureLayerLoadingStrategy  loadingStrategy)

Sets the FeatureLayerLoadingStrategy to use.

This method is optional. If a loading strategy is not explicitly configured, the LoadSpatially strategy is used. It tries to use the LoadSpatially strategy first. If that strategy is not supported for the layer's model, the LoadEverything strategy is used as fallback.

Parameters
loadingStrategythe loading strategy to use.
Returns
this builder
Since
2023.0.02

◆ model()

Builder & luciad::FeatureLayer::Builder::model ( std::shared_ptr< IFeatureModel model)

Sets the feature model of the layer.

Calling this function is mandatory.

Parameters
modelthe feature model of the layer. Cannot be nullptr.
Returns
this builder.
Exceptions
luciad::NullArgumentExceptionwhen the given model is nullptr.

◆ operator=()

Builder & luciad::FeatureLayer::Builder::operator= ( Builder  other)
noexcept

◆ painter()

Builder & luciad::FeatureLayer::Builder::painter ( std::shared_ptr< IFeaturePainter featurePainter)

Sets the IFeaturePainter to use.

If not set, a default painter will be used. The default painter relies on the feature model having all of its feature data types containing a geometry annotation.

Parameters
featurePainterthe feature painter used to paint the feature model. Cannot be nullptr.
Returns
this builder.
Exceptions
luciad::NullArgumentExceptionwhen the given feature painter is nullptr

◆ queryable()

Builder & luciad::FeatureLayer::Builder::queryable ( bool  queryable)

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

The default is true.

Parameters
queryablewhether the features in this layer can be returned in the Map::queryFeatures method.
Returns
this builder
See also
FeatureLayer::setQueryable
Since
2023.1

◆ queryConfiguration()

Builder & luciad::FeatureLayer::Builder::queryConfiguration ( std::shared_ptr< FeatureQueryConfiguration configuration)

Sets the query configuration to use.

The query configuration determines which features to load based on the current map's scale. If not set, a default configuration will be used that always loads all features.

Parameters
configurationthe query configuration. Cannot be nullptr.
Returns
this builder
Exceptions
luciad::NullArgumentExceptionwhen the given query configuration is nullptr

◆ title()

Builder & luciad::FeatureLayer::Builder::title ( std::string  title)

Sets the title to use for the layer.

If not set, the title from the ModelMetadata is used.

Parameters
titlethe title for the layer.
Returns
this builder.

◆ visible()

Builder & luciad::FeatureLayer::Builder::visible ( bool  visible)

Sets whether the layer should be visible initially.

Default is true.

Parameters
visiblethe visibility.
Returns
this builder.