LuciadCPillar C# 2024.0.04
Luciad.Edit.Handles.TranslateEditHandle Class Reference

This handle allows you to translate a feature by translating its geometry using ITranslateEditAction. More...

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

Public Member Functions

 TranslateEditHandle (Luciad.Geodesy.CoordinateReference reference, Luciad.Edit.Features.FeatureEditContext context)
 Creates a new translate handle that allows you to drag around a feature or geometry horizontally. More...
 
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.EditActionBinder AddOnDragAction (Luciad.Edit.Handles.ITranslateEditAction action)
 Adds an action that will be triggered when dragging. More...
 
void Dispose ()
 
Luciad.Edit.Handles.EditHandleState GetEditState ()
 Returns the current state of this handle. More...
 
Luciad.Maps.? MouseCursor GetMouseCursor ()
 Returns the current mouse cursor that should be displayed for this handle. More...
 
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...
 
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 ()
 Returns the current state of this handle. More...
 
Luciad.Maps.? MouseCursor GetMouseCursor ()
 Returns the current mouse cursor that should be displayed for this handle. More...
 
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...
 

Properties

Luciad.Layers.Styles.ComplexStrokes.ComplexStrokeLineStyle ShadowComplexStrokeLineStyle [get, set]
 The complex stroke line style that is used for shadow lines. More...
 
Luciad.Layers.Styles.FillStyle ShadowFillStyle [get, set]
 The fill style that is used when a shadow version of a geometry is painted. More...
 
Luciad.Geometries.Geometry ShadowGeometry [get]
 The current shadow geometry of this handle, or null. More...
 
Luciad.Utils.Observable< Luciad.Geometries.GeometryShadowGeometryProvider [get, set]
 The shadow geometry provider of this handle. More...
 
Luciad.Drawing.IIcon ShadowIcon [get, set]
 The icon that is used when a shadow version of a geometry is painted. More...
 
Luciad.Layers.Styles.LineStyle ShadowLineStyle [get, set]
 The line style that is used for shadow lines. More...
 
int ZOrder [get, set]
 The Z-order that is used for this handle's paint calls to the FeatureCanvas. More...
 

Detailed Description

This handle allows you to translate a feature by translating its geometry using ITranslateEditAction.

This handle can operate in 2 modes: 1) Feature mode: the handle is highlighted and can be interacted with when the feature is touched.

  • the handle does not paint anything. It depends on the original Feature being painted.
  • you can drag the feature
  • the EditHandleState and cursor are changed accordingly

2) Shadow geometry mode: this mode is enabled when a shadow geometry provider is configured that provides a non-null shadow geometry. A shadow geometry is a Draped version of a geometry. In that case the handle is highlighted and can be interacted with when that shadow geometry is touched.

  • the handle paints a shadow geometry
  • you can drag the shadow instead of the feature
  • the EditHandleState and cursor are changed accordingly

If the shadow geometry provider returns null, Feature mode is enabled.

This handle uses drag events to call ITranslateEditAction.Translate.

Since
2020.1

Constructor & Destructor Documentation

◆ TranslateEditHandle()

Luciad.Edit.Handles.TranslateEditHandle.TranslateEditHandle ( Luciad.Geodesy.CoordinateReference  reference,
Luciad.Edit.Features.FeatureEditContext  context 
)
inline

Creates a new translate handle that allows you to drag around a feature or geometry horizontally.

Parameters
referencethe coordinate reference in which the translation will occur, cannot be null
contextthe context, cannot be null

Member Function Documentation

◆ AddEditStateObserver()

void Luciad.Edit.Handles.TranslateEditHandle.AddEditStateObserver ( Luciad.Utils.IInvalidationCallback  observer)
inline

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.

Parameters
observeran observer
Exceptions
System.ArgumentExceptionwhen the observer was already added.
Since
2023.1

Implements Luciad.Edit.Handles.IEditHandle.

◆ AddOnDragAction()

Luciad.Edit.Handles.EditActionBinder Luciad.Edit.Handles.TranslateEditHandle.AddOnDragAction ( Luciad.Edit.Handles.ITranslateEditAction  action)
inline

Adds an action that will be triggered when dragging.

For every drag event, the following method call will be triggered:

Parameters
actionthe action to be performed on drag, cannot be null.
Returns
an object on which you can specify more options or requirements regarding the given on-drag action, such as the mouse buttons that need to be pressed for the action to be executed.

◆ Dispose()

void Luciad.Edit.Handles.TranslateEditHandle.Dispose ( )
inline

◆ GetEditState()

Luciad.Edit.Handles.EditHandleState Luciad.Edit.Handles.TranslateEditHandle.GetEditState ( )
inline

Returns the current state of this handle.

Returns
the current state of this handle.

Implements Luciad.Edit.Handles.IEditHandle.

◆ GetMouseCursor()

Luciad.Maps.? MouseCursor Luciad.Edit.Handles.TranslateEditHandle.GetMouseCursor ( )
inline

Returns 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, null can be returned.

Returns
the current mouse cursor that should be displayed for this handle.

Implements Luciad.Edit.Handles.IEditHandle.

◆ OnEvent()

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

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

Parameters
inputEventthe event to handle, cannot be null
contextthe context, cannot be null
Returns
if the event was consumed or not
Exceptions
System.ArgumentNullExceptionwhen null is passed.

Implements Luciad.Edit.Handles.IEditHandle.

◆ Paint()

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

Paints this handle on the given canvas.

This method is called when

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

Parameters
canvasthe canvas on which this handle gets painted.
contextthe context, cannot be null

Implements Luciad.Edit.Handles.IEditHandle.

◆ RemoveEditStateObserver()

void Luciad.Edit.Handles.TranslateEditHandle.RemoveEditStateObserver ( Luciad.Utils.IInvalidationCallback  observer)
inline

Removes the given observer.

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

Parameters
observeran observer
Exceptions
System.ArgumentExceptionwhen the observer is not known.
Since
2023.1

Implements Luciad.Edit.Handles.IEditHandle.

◆ SetInvalidationCallback()

void Luciad.Edit.Handles.TranslateEditHandle.SetInvalidationCallback ( Luciad.Utils.IInvalidationCallback  invalidationCallback)
inline

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.

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

Implements Luciad.Edit.Handles.IEditHandle.

Property Documentation

◆ ShadowComplexStrokeLineStyle

Luciad.Layers.Styles.ComplexStrokes.ComplexStrokeLineStyle Luciad.Edit.Handles.TranslateEditHandle.ShadowComplexStrokeLineStyle
getset

The complex stroke line style that is used for shadow lines.

[get]

Returns the complex stroke line style that is used for shadow lines. This method is linked to the ShadowLineStyle method:

  • if both of them return null, no shadow line is painted
  • if one of them is not null, that shadow line style is used
  • it's not possible for both methods to return a non null value: they are mutually exclusive

[set]

Sets the complex stroke line style that is used for shadow lines. Only one shadow line style can be set, if this function is called with a non null value when a ComplexStrokeLineStyle has already been set, it will be overwritten.

Since
2023.1

◆ ShadowFillStyle

Luciad.Layers.Styles.FillStyle Luciad.Edit.Handles.TranslateEditHandle.ShadowFillStyle
getset

The fill style that is used when a shadow version of a geometry is painted.

[get]

Returns the fill style that is used when a shadow version of a geometry is painted.

[set]

Sets the fill style that is used when a shadow version of a geometry is painted. Setting this to null means the shadow version of the geometry won't have a fill style.

◆ ShadowGeometry

Luciad.Geometries.Geometry Luciad.Edit.Handles.TranslateEditHandle.ShadowGeometry
get

The current shadow geometry of this handle, or null.

[get]

Returns the current shadow geometry of this handle, or null.

See also
ShadowGeometryProvider

◆ ShadowGeometryProvider

Luciad.Utils.Observable<Luciad.Geometries.Geometry> Luciad.Edit.Handles.TranslateEditHandle.ShadowGeometryProvider
getset

The shadow geometry provider of this handle.

[get]

Returns the shadow geometry provider of this handle. Can be null.

[set]

Sets the shadow geometry provider of this handle. When this provider (or the geometry it returned) is null, Feature mode is enabled for this handle. See TranslateEditHandle for more information.

◆ ShadowIcon

Luciad.Drawing.IIcon Luciad.Edit.Handles.TranslateEditHandle.ShadowIcon
getset

The icon that is used when a shadow version of a geometry is painted.

[get]

Returns the icon that is used when a shadow version of a geometry is painted.

[set]

Sets the icon that is used when a shadow version of a geometry is painted.

◆ ShadowLineStyle

Luciad.Layers.Styles.LineStyle Luciad.Edit.Handles.TranslateEditHandle.ShadowLineStyle
getset

The line style that is used for shadow lines.

[get]

Returns the line style that is used for shadow lines. This method is linked to the ShadowComplexStrokeLineStyle method:

  • if both of them return null, no shadow line is painted
  • if one of them is not null, that shadow line style is used
  • it's not possible for both methods to return a non null value: they are mutually exclusive

[set]

Sets the line style that is used for shadow lines. Only one shadow line style can be set, if this function is called with a non null value when a ComplexStrokeLineStyle has already been set, it will be overwritten.

◆ ZOrder

int Luciad.Edit.Handles.TranslateEditHandle.ZOrder
getset

The Z-order that is used for this handle's paint calls to the FeatureCanvas.

[get]

Returns the Z-order that is used for this handle's paint calls to the FeatureCanvas.

[set]

Sets the Z-order that is used for this handle's paint calls to the FeatureCanvas. This Z-order determines which handles are painted on top when multiple handles overlap. Edit handles with a higher Z-order are painted on top of handles with a lower Z-order. Note: Highlighted edit handles are always painted above regular handles, and active handles are always painted above highlighted handles.

Must be between [-1000,1000]. The default value is 0.

See also
ZOrder.
FeatureCanvas draw commands. For example FeatureCanvas.IconDrawCommand.ZOrder.