LuciadCPillar 2023.1.02
luciad::IPointEditAction Class Referenceabstract

Abstraction of an action that is executed based on a Point. More...

#include <luciad/edit/handles/IPointEditAction.h>

Public Member Functions

virtual ~IPointEditAction ()=default
 
virtual void execute (const std::shared_ptr< Point > &location, ChangeStatus changeStatus)=0
 Performs the action. More...
 
virtual void execute (const std::shared_ptr< Point > &location, EventStatus eventStatus, ChangeStatus changeStatus)=0
 Performs the part of the action that corresponds to the given EventStatus. More...
 

Static Public Member Functions

static std::shared_ptr< IPointEditActioncreate (std::function< void(const std::shared_ptr< Point > &, ChangeStatus)> function)
 Creates a default IPointEditAction instance that always delegates the IPointEditAction::execute methods to the given function, regardless of the EventStatus that may or may not be provided. More...
 

Detailed Description

Abstraction of an action that is executed based on a Point.

Examples of this action are:

This class is used by PointEditHandle.

Since
2020.1

Constructor & Destructor Documentation

◆ ~IPointEditAction()

virtual luciad::IPointEditAction::~IPointEditAction ( )
virtualdefault

Member Function Documentation

◆ create()

static std::shared_ptr< IPointEditAction > luciad::IPointEditAction::create ( std::function< void(const std::shared_ptr< Point > &, ChangeStatus)>  function)
static

Creates a default IPointEditAction instance that always delegates the IPointEditAction::execute methods to the given function, regardless of the EventStatus that may or may not be provided.

This is a convenience method that allows you to reduce boiler plate code using lambdas.

Parameters
functionthe function that is called by IPointEditAction::execute
Returns
an IPointEditAction instance based on the given function.

◆ execute() [1/2]

virtual void luciad::IPointEditAction::execute ( const std::shared_ptr< Point > &  location,
ChangeStatus  changeStatus 
)
pure virtual

Performs the action.

Parameters
locationthe Point location that is used to perform the action
changeStatusthe status of the action. Can be used to distinguish between intermediate changes and a finished change.

◆ execute() [2/2]

virtual void luciad::IPointEditAction::execute ( const std::shared_ptr< Point > &  location,
EventStatus  eventStatus,
ChangeStatus  changeStatus 
)
pure virtual

Performs the part of the action that corresponds to the given EventStatus.

Parameters
locationthe Point location that is used to perform the action
eventStatusUsed to indicate that an action has started, is in progress, or has ended. This can for example be used by edit handles that apply the action on drag events. It is guaranteed that a sequence of calls to this method will contain at least 1 Start, and 1 End call.
changeStatusthe status of the action. Can be used to distinguish between intermediate changes and a finished change.