LuciadCPillar C# 2023.1.06
Luciad.Edit.Handles.IEditHandle Interface Reference

An edit handle is a visual element on the Map that can react to events to perform an edit operation. More...

Inheritance diagram for Luciad.Edit.Handles.IEditHandle:
Luciad.Edit.Handles.PointEditHandle Luciad.Edit.Handles.TranslateEditHandle

Public Member Functions

void AddEditStateObserver (Luciad.Utils.IInvalidationCallback observer)
 Adds an observer that is called when the edit state of this handle has changed. More...
 
Luciad.Edit.Handles.EditHandleState GetEditState ()
 
Luciad.Maps.? MouseCursor GetMouseCursor ()
 
Luciad.Controllers.EventResult OnEvent (Luciad.Input.IInputEvent inputEvent, Luciad.Edit.Features.FeatureEditContext context)
 Handles the given event, and returns if the event was consumed or not. More...
 
void Paint (Luciad.Layers.Features.FeatureCanvas canvas, Luciad.Edit.Features.FeatureEditContext context)
 Paints this handle on the given canvas. More...
 
void RemoveEditStateObserver (Luciad.Utils.IInvalidationCallback observer)
 Removes the given observer. More...
 
void SetInvalidationCallback (Luciad.Utils.IInvalidationCallback invalidationCallback)
 Sets the callback for the handle to call when its visual representation or cursor has changed. More...
 

Detailed Description

An edit handle is a visual element on the Map that can react to events to perform an edit operation.

Edit handles are used in the context of a luciad::IEditHandles. IEditHandles implementations are responsible for providing and updating edit handles during editing. IEditHandles implementations typically allow to replace/customize/remove handles. Edit handles can have one of 3 states. This state determines: the order in which the Editor passes events to handles the order in which the Editor gets the mouse cursor from a handle how a handle can paint itself. Highlighted or Active handles are typically painted differently than Inactive handles.

The edit handle is responsible for deciding when it needs to be repainted. For that purpose, it is given an IInvalidationCallback, see setInvalidationCallback. This invalidation callback must be called whenever the handle needs to be repainted. Concrete implementations of this interface have specific behavior. For example: PointEditHandle: allows you to move a point to a new location, or apply an action to a point location, insert a new point in a Polyline for example. This handle typically paints itself as an IIcon. TranslateEditHandle: allows you to translate a Geometry to a new location. This handle typically doesn't paint itself, because the Geometry to be moved is already painted.

2020.1

Warning
C# documentation translation is incomplete. You can find more information in the C++ documentation for luciad::IEditHandle.

Member Function Documentation

◆ AddEditStateObserver()

void Luciad.Edit.Handles.IEditHandle.AddEditStateObserver ( Luciad.Utils.IInvalidationCallback  observer)

Adds an observer that is called when the edit state of this handle has changed.

Adding the same observer twice is forbidden, and will cause an exception to be thrown.

observer

an observer

InvalidArgumentException

when the observer was already added.

2023.1

Warning
C# documentation translation is incomplete. You can find more information in the C++ documentation for luciad::IEditHandle::addEditStateObserver.

Implemented in Luciad.Edit.Handles.PointEditHandle, and Luciad.Edit.Handles.TranslateEditHandle.

◆ GetEditState()

Luciad.Edit.Handles.EditHandleState Luciad.Edit.Handles.IEditHandle.GetEditState ( )

the current state of this handle.

Warning
C# documentation translation is incomplete. You can find more information in the C++ documentation for luciad::IEditHandle::getEditState.

Implemented in Luciad.Edit.Handles.PointEditHandle, and Luciad.Edit.Handles.TranslateEditHandle.

◆ GetMouseCursor()

Luciad.Maps.MouseCursor Luciad.Edit.Handles.IEditHandle.GetMouseCursor ( )

the current mouse cursor that should be displayed for this handle. This method typically returns a value when this handle is highlighted or active. If not, std::nullopt can be returned.

Warning
C# documentation translation is incomplete. You can find more information in the C++ documentation for luciad::IEditHandle::getMouseCursor.

Implemented in Luciad.Edit.Handles.PointEditHandle, and Luciad.Edit.Handles.TranslateEditHandle.

◆ OnEvent()

Luciad.Controllers.EventResult Luciad.Edit.Handles.IEditHandle.OnEvent ( Luciad.Input.IInputEvent  inputEvent,
Luciad.Edit.Features.FeatureEditContext  context 
)

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

While handling events, IEditHandles can mark themselves as highlighted or as Active. Related to event handling, the main effect of this is that highlighted or active handles get a higher priority compared to other handles: they get the chance to consume events first. See EditHandleState

inputEvent

the event to handle, cannot be nullptr

context

the context, cannot be nullptr

if the event was consumed or not

NullArgumentException

when nullptr is passed.

Warning
C# documentation translation is incomplete. You can find more information in the C++ documentation for luciad::IEditHandle::onEvent.

Implemented in Luciad.Edit.Handles.PointEditHandle, and Luciad.Edit.Handles.TranslateEditHandle.

◆ Paint()

void Luciad.Edit.Handles.IEditHandle.Paint ( Luciad.Layers.Features.FeatureCanvas  canvas,
Luciad.Edit.Features.FeatureEditContext  context 
)

Paints this handle on the given canvas.

This method is called when the handle's IEditHandles fires an EditHandlesEvent containing this handle, when the handle is newly added or removed for example. the handle triggers a new paint call itself by calling its invalidation callback.

This method only gets called on the UI thread, so there is no need for additional synchronization.

canvas

the canvas on which this handle gets painted.

context

the context, cannot be nullptr

Warning
C# documentation translation is incomplete. You can find more information in the C++ documentation for luciad::IEditHandle::paint.

Implemented in Luciad.Edit.Handles.PointEditHandle, and Luciad.Edit.Handles.TranslateEditHandle.

◆ RemoveEditStateObserver()

void Luciad.Edit.Handles.IEditHandle.RemoveEditStateObserver ( Luciad.Utils.IInvalidationCallback  observer)

Removes the given observer.

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

observer

an observer

InvalidArgumentException

when the observer is not known.

2023.1

Warning
C# documentation translation is incomplete. You can find more information in the C++ documentation for luciad::IEditHandle::removeEditStateObserver.

Implemented in Luciad.Edit.Handles.PointEditHandle, and Luciad.Edit.Handles.TranslateEditHandle.

◆ SetInvalidationCallback()

void Luciad.Edit.Handles.IEditHandle.SetInvalidationCallback ( Luciad.Utils.IInvalidationCallback  invalidationCallback)

Sets the callback for the handle to call when its visual representation or cursor has changed.

Calling this callback triggers a new call to this handle's paint method.

invalidationCallback

the callback for the handle to call when its visual representation has changed

Warning
C# documentation translation is incomplete. You can find more information in the C++ documentation for luciad::IEditHandle::setInvalidationCallback.

Implemented in Luciad.Edit.Handles.PointEditHandle, and Luciad.Edit.Handles.TranslateEditHandle.