LuciadCPillar 2023.1.04
luciad::MilitarySymbolFeatureCreator Class Referencefinal

Creates new symbology features. More...

#include <luciad/symbology/military/MilitarySymbolFeatureCreator.h>

Inheritance diagram for luciad::MilitarySymbolFeatureCreator:
luciad::IFeatureCreator

Public Member Functions

 MilitarySymbolFeatureCreator (const Feature &initialFeature)
 Creates a new MilitarySymbolFeatureCreator that uses the given initial Feature. More...
 
 MilitarySymbolFeatureCreator (const std::shared_ptr< MilitarySymbol > &initialSymbol)
 Creates a new MilitarySymbolFeatureCreator that creates a Feature for the given symbol. More...
 
 ~MilitarySymbolFeatureCreator () 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

Creates new symbology features.

This feature creator will

Example

// set up a Creator for the feature and its geometry.
auto symbol = MilitarySymbol::create(standard, "G*G*GPAR--****X");
auto featureCreator = std::make_shared<MilitarySymbolFeatureCreator>(symbol);
// wire creation to the controller (here we're using DefaultController)
defaultController->setCreator(Creator::newBuilder().layer(layer).map(map).featureCreator(featureCreator).build());
static Builder newBuilder()
Returns a new builder for creating a Creator.
static std::shared_ptr< MilitarySymbol > create(MilitarySymbology::Standard standard, std::string sidc)
Creates an returns a military symbol with the given standard and SIDC.
@ MilStd2525b
Constant for MIL-STD 2525 revision B, change 2.
Since
2020.1
See also
Creator

Constructor & Destructor Documentation

◆ MilitarySymbolFeatureCreator() [1/2]

luciad::MilitarySymbolFeatureCreator::MilitarySymbolFeatureCreator ( const std::shared_ptr< MilitarySymbol > &  initialSymbol)
explicit

Creates a new MilitarySymbolFeatureCreator that creates a Feature for the given symbol.

Parameters
initialSymbolthe initial symbol.

◆ MilitarySymbolFeatureCreator() [2/2]

luciad::MilitarySymbolFeatureCreator::MilitarySymbolFeatureCreator ( const Feature initialFeature)
explicit

Creates a new MilitarySymbolFeatureCreator that uses the given initial Feature.

Parameters
initialFeaturethe initial Feature. It should have a valid symbol code and symbology.

◆ ~MilitarySymbolFeatureCreator()

luciad::MilitarySymbolFeatureCreator::~MilitarySymbolFeatureCreator ( )
override

Member Function Documentation

◆ onEvent()

EventResult luciad::MilitarySymbolFeatureCreator::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::MilitarySymbolFeatureCreator::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.