LuciadCPillar 2023.1.04
luciad::FeatureModelBuilder Class Referencefinal

Helps the creation of a IFeatureModel given a list of features, a model metadata, a feature model metadata and optionally a bounds. More...

#include <luciad/models/features/FeatureModelBuilder.h>

Public Member Functions

 FeatureModelBuilder (const FeatureModelBuilder &other)
 
 FeatureModelBuilder (FeatureModelBuilder &&other) noexcept
 
 ~FeatureModelBuilder ()
 
FeatureModelBuilderbounds (std::shared_ptr< Bounds > bounds)
 Sets the bounds of the feature model. More...
 
std::shared_ptr< IFeatureModelbuild ()
 Creates a new in-memory IFeatureModel instance, based on the given model metadata, feature model metadata and the list of features. More...
 
FeatureModelBuildereditable (bool editable)
 Sets whether the model should be editable or not. More...
 
FeatureModelBuilderfeatureModelMetadata (FeatureModelMetadata featureModelMetadata)
 Sets the FeatureModelMetadata of the feature model. More...
 
FeatureModelBuilderfeatures (std::vector< Feature > features)
 Sets the features of the feature model. More...
 
FeatureModelBuildermodelMetadata (ModelMetadata modelMetadata)
 Sets the ModelMetadata of the feature model. More...
 
FeatureModelBuilderoperator= (FeatureModelBuilder other) noexcept
 

Static Public Member Functions

static FeatureModelBuilder newBuilder ()
 Returns the builder class for creation of the IFeatureModel. More...
 

Detailed Description

Helps the creation of a IFeatureModel given a list of features, a model metadata, a feature model metadata and optionally a bounds.

Constructor & Destructor Documentation

◆ ~FeatureModelBuilder()

luciad::FeatureModelBuilder::~FeatureModelBuilder ( )

◆ FeatureModelBuilder() [1/2]

luciad::FeatureModelBuilder::FeatureModelBuilder ( const FeatureModelBuilder other)

◆ FeatureModelBuilder() [2/2]

luciad::FeatureModelBuilder::FeatureModelBuilder ( FeatureModelBuilder &&  other)
noexcept

Member Function Documentation

◆ bounds()

FeatureModelBuilder & luciad::FeatureModelBuilder::bounds ( std::shared_ptr< Bounds bounds)

Sets the bounds of the feature model.

Calling this function is optional.

If no bounds are provided, the model will attempt to derive the bounds by itself. It does so by calculating the union of the geometries of its features, as specified by Feature#findGeometry.

Parameters
boundsThe model bounds. Cannot be nullptr.
Returns
this
Exceptions
luciad::NullArgumentExceptionwhen passing nullptr.

◆ build()

std::shared_ptr< IFeatureModel > luciad::FeatureModelBuilder::build ( )

Creates a new in-memory IFeatureModel instance, based on the given model metadata, feature model metadata and the list of features.

Depending on whether the editable flag was set, it is possible to add/remove or update the features of this model after it has been created.

Returns
An in-memory IFeatureModel instance.
Exceptions
LogicExceptionIf not all mandatory parameters are set.

◆ editable()

FeatureModelBuilder & luciad::FeatureModelBuilder::editable ( bool  editable)

Sets whether the model should be editable or not.

An editable model exposes an IFeatureModelUpdater, through which you can add, remove or update the model's features. Calling this function is optional. By default, this value is false.

Parameters
editablewhether the model should be editable or not.
Returns
this
Since
2020.1

◆ featureModelMetadata()

FeatureModelBuilder & luciad::FeatureModelBuilder::featureModelMetadata ( FeatureModelMetadata  featureModelMetadata)

Sets the FeatureModelMetadata of the feature model.

Calling this function is mandatory.

Parameters
featureModelMetadataThe model feature model metadata.
Returns
this

◆ features()

FeatureModelBuilder & luciad::FeatureModelBuilder::features ( std::vector< Feature features)

Sets the features of the feature model.

Calling this function is optional.

The given features may or may not have an id assigned. If an id is missing, an id will be assigned to them by the resulting model.

Parameters
featuresThe model features.
Returns
this

◆ modelMetadata()

FeatureModelBuilder & luciad::FeatureModelBuilder::modelMetadata ( ModelMetadata  modelMetadata)

Sets the ModelMetadata of the feature model.

Calling this function is mandatory.

Parameters
modelMetadataThe model metadata.
Returns
this

◆ newBuilder()

static FeatureModelBuilder luciad::FeatureModelBuilder::newBuilder ( )
static

Returns the builder class for creation of the IFeatureModel.

Returns
the builder class for creation of the IFeatureModel.

◆ operator=()

FeatureModelBuilder & luciad::FeatureModelBuilder::operator= ( FeatureModelBuilder  other)
noexcept