LuciadCPillar 2024.0.04
luciad::ITranslateEditAction Class Referenceabstract

A translate action performs a translation of a geometry or feature. More...

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

Public Member Functions

virtual ~ITranslateEditAction ()=default
 
virtual void translate (Coordinate translation, EventStatus translateStatus, ChangeStatus changeStatus)=0
 Performs a translation. More...
 

Static Public Member Functions

static std::shared_ptr< ITranslateEditActioncreate (std::function< void(Coordinate, EventStatus, ChangeStatus)> function)
 Creates a default ITranslateEditAction instance that always delegates the ITranslateEditAction::translate methods to the given function. More...
 

Detailed Description

A translate action performs a translation of a geometry or feature.

This translation is non-incremental. For example when translating a Geometry, this means that consecutive calls to the ITranslateEditAction::translate method should be applied to the same initial geometry. So consecutive calls should not apply a translation on the result of the previous translation.

You can distinguish between different stages of the translation using the translation status parameter. It allows to make a distinction between the start and end of the translation, and intermediate updates.

Since
2020.1

Constructor & Destructor Documentation

◆ ~ITranslateEditAction()

virtual luciad::ITranslateEditAction::~ITranslateEditAction ( )
virtualdefault

Member Function Documentation

◆ create()

static std::shared_ptr< ITranslateEditAction > luciad::ITranslateEditAction::create ( std::function< void(Coordinate, EventStatus, ChangeStatus)>  function)
static

Creates a default ITranslateEditAction instance that always delegates the ITranslateEditAction::translate methods to the given function.

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

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

◆ translate()

virtual void luciad::ITranslateEditAction::translate ( Coordinate  translation,
EventStatus  translateStatus,
ChangeStatus  changeStatus 
)
pure virtual

Performs a translation.

Parameters
translationthe translation to perform
translateStatusUsed to indicate that a translation has started, is in progress, or has ended. This parameter is useful to determine on which object a change needs to be applied. For example when translation starts, this action should determine an 'initial state' on which the next (update and end) translate calls will be applied. This initial state can be discarded after EventStatus::End has been passed. It is guaranteed that a translate sequence will contain at least 1 Start, and 1 End call.
changeStatusthe status of the change. Can be used to distinguish between intermediate changes and a keypoint change.