LuciadCPillar 2023.1.04
luciad::FeatureCreator Class Referencefinal

This class can create feature instances, based on a geometry. More...

#include <luciad/create/features/FeatureCreator.h>

Inheritance diagram for luciad::FeatureCreator:
luciad::IFeatureCreator

Public Member Functions

 FeatureCreator (Feature initialFeature, std::shared_ptr< IGeometryCreator > geometryCreator)
 Creates a new FeatureCreator. More...
 
 ~FeatureCreator () override
 
EventResult onEvent (const std::shared_ptr< IInputEvent > &inputEvent, const std::shared_ptr< FeatureCreateContext > &context) override
 Handles the given event, and returns if the event was handled or not. More...
 
void start (std::shared_ptr< IFeatureCreateCallback > callback, const std::shared_ptr< FeatureCreateContext > &context) override
 This method is called to start creation. More...
 
- Public Member Functions inherited from luciad::IFeatureCreator
virtual ~IFeatureCreator ()=default
 
virtual EventResult onEvent (const std::shared_ptr< IInputEvent > &inputEvent, const std::shared_ptr< FeatureCreateContext > &context)=0
 Handles the given event, and returns if the event was handled or not. More...
 
virtual void start (std::shared_ptr< IFeatureCreateCallback > callback, const std::shared_ptr< FeatureCreateContext > &context)=0
 This method is called to start creation. More...
 

Detailed Description

This class can create feature instances, based on a geometry.

This creator will

This initial Feature must contain the following:

  • (optional) an id. In many cases, models are responsible to assign the id to newly added features. In this case, the Feature must not contain an id. Other models however, allow newly added features to already have an id. In that case, this Feature must have an id.
  • all necessary property values that are needed to correctly apply a geometry on a Feature

This creator doesn't consume any events itself, but it delegates the events to the wrapped geometry creator instance.

Since
2020.1
See also
Creator

Constructor & Destructor Documentation

◆ FeatureCreator()

luciad::FeatureCreator::FeatureCreator ( Feature  initialFeature,
std::shared_ptr< IGeometryCreator geometryCreator 
)

Creates a new FeatureCreator.

Parameters
initialFeaturethe initial feature
geometryCreatorthe delegate geometry creator to use, cannot be nullptr.
Exceptions
NullArgumentExceptionwhen the geometry creator is nullptr.

◆ ~FeatureCreator()

luciad::FeatureCreator::~FeatureCreator ( )
override

Member Function Documentation

◆ onEvent()

EventResult luciad::FeatureCreator::onEvent ( const std::shared_ptr< IInputEvent > &  inputEvent,
const std::shared_ptr< FeatureCreateContext > &  context 
)
overridevirtual

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

Parameters
contextthe creation context, cannot be nullptr
inputEventan event, cannot be nullptr
Returns
if the event was consumed or not
Exceptions
NullArgumentExceptionwhen nullptr is passed.

Implements luciad::IFeatureCreator.

◆ start()

void luciad::FeatureCreator::start ( std::shared_ptr< IFeatureCreateCallback callback,
const std::shared_ptr< FeatureCreateContext > &  context 
)
overridevirtual

This method is called to start creation.

After this call, IFeatureCreator::onEvent can be called.

When a IFeatureCreator was started, it can not be started again until it has stopped. Implementations of this method are encouraged to throw an exception in that case to signal a programming error by the caller of this method.

Parameters
contextthe creation context, cannot be nullptr
callbackthe callback to signal feature changes, and whether creation for the feature has finished, cannot be nullptr.
Exceptions
NullArgumentExceptionwhen nullptr is passed.

Implements luciad::IFeatureCreator.