LuciadCPillar 2023.1.03
luciad::Creator Class Referencefinal

This class allows you to interactively create Features on the Map. More...

#include <luciad/create/Creator.h>

Classes

class  Builder
 Builder for the Creator class. More...
 

Public Member Functions

 ~Creator ()
 
void addObserver (std::shared_ptr< ICreatorObserver > observer)
 Adds an observer that is called when a Feature was created and added to the model, or when feature creation failed. More...
 
std::shared_ptr< FeatureLayergetPreviewLayer () const
 
EventResult onEvent (const std::shared_ptr< IInputEvent > &inputEvent)
 Handles the given event, and returns if the event was handled or not. More...
 
void removeObserver (const std::shared_ptr< ICreatorObserver > &observer)
 Removes the given observer. More...
 

Static Public Member Functions

static Builder newBuilder ()
 Returns a new builder for creating a Creator. More...
 

Detailed Description

This class allows you to interactively create Features on the Map.

A Creator should only be used once, i.e. to create a single Feature. Afterwards, it can be discarded.

Since
2020.1

Constructor & Destructor Documentation

◆ ~Creator()

luciad::Creator::~Creator ( )

Member Function Documentation

◆ addObserver()

void luciad::Creator::addObserver ( std::shared_ptr< ICreatorObserver observer)

Adds an observer that is called when a Feature was created and added to the model, or when feature creation failed.

Parameters
observeran observer
Exceptions
luciad::InvalidArgumentExceptionwhen the observer was already added.
luciad::NullArgumentExceptionwhen the observer is nullptr.

◆ getPreviewLayer()

std::shared_ptr< FeatureLayer > luciad::Creator::getPreviewLayer ( ) const
Returns
a layer that can paint a preview of the Feature that is being created.

◆ newBuilder()

static Builder luciad::Creator::newBuilder ( )
static

Returns a new builder for creating a Creator.

Returns
a new builder for creating a Creator.

◆ onEvent()

EventResult luciad::Creator::onEvent ( const std::shared_ptr< IInputEvent > &  inputEvent)

Handles the given event, and returns if the event was handled or not.

Parameters
inputEventan event, cannot be nullptr.
Returns
if the event was consumed or not
Exceptions
NullArgumentExceptionwhen the input event is nullptr.

◆ removeObserver()

void luciad::Creator::removeObserver ( const std::shared_ptr< ICreatorObserver > &  observer)

Removes the given observer.

If the given callback was never added, an exception is thrown.

Parameters
observeran observer.
Exceptions
luciad::InvalidArgumentExceptionwhen the observer is not known.
luciad::NullArgumentExceptionwhen the observer is nullptr.