Last updated

API / geotoolkit3d / tool / SliderMoveTool / SliderMoveTool

Class: SliderMoveTool

tool.SliderMoveTool.SliderMoveTool

This class offers the ability to drag an object across the scene.

Internally it computes the distance dragged considering the Plot as a two dimension slider (horizontal/vertical).
Calling code should provide the function that convert this 2D displacement in an actual 'move'.

Hierarchy

Table of contents

Constructors
Methods

Contents

Constructors

new SliderMoveTool(options)

new SliderMoveTool(options)

Parameters

Name Type
optionsOptions

Overrides

AbstractMoveTool.constructor

Methods

addMoveListener

addMoveListener(callback): SliderMoveTool

Adds a listener that will be triggered each time this tool 'move' occurs.

Parameters

Name Type Description
callbackListenerCallbackThe function that will be called

Returns

SliderMoveTool

this

Inherited from

AbstractMoveTool.addMoveListener


dispose

dispose(): void

Function to clean up the references from this tool.

Returns

void

Overrides

AbstractMoveTool.dispose


getClassName

getClassName(): string

Returns

string

Inherited from

AbstractMoveTool.getClassName


getName

getName(): string

Returns the tool name.

Returns

string

The tool's name

Inherited from

AbstractMoveTool.getName


getOptions

getOptions(): Required<Options>

Get abstract gesture tool options

Returns

Required<Options>

options

Overrides

AbstractMoveTool.getOptions


getPlot

getPlot(): Plot

Get the plot of this Tool.

Returns

Plot

Inherited from

AbstractMoveTool.getPlot


hasEventListener

hasEventListener(type, callback?): boolean

Check if a list of event listeners for this type contains this listener

Parameters

Name Type Description
typestringtype of event or property
Optional callbackFunctionto be called, if null, check if any callback is registered

Returns

boolean

Inherited from

AbstractMoveTool.hasEventListener


isArmed

isArmed(): boolean

Return if this tool is 'armed'.
The tool actions are disabled when not armed.
A tool can either be armed at all time, or only when a specific key is pressed. To set/unset the arming key, please see this tool option 'armingkey', via .setOptions().

Returns

boolean

Inherited from

AbstractMoveTool.isArmed


isDisposed

isDisposed(): boolean

Returns whether this object has been disposed

Returns

boolean

Inherited from

AbstractMoveTool.isDisposed


isSilent

isSilent(): boolean

Return true if the event dispatcher doesn't notify any events

Returns

boolean

Inherited from

AbstractMoveTool.isSilent


isTouchEvent

isTouchEvent(eventArgs): boolean

return true if the event is a touch event and false otherwise.

Parameters

Name Type Description
eventArgsEvent | EventArgscontains info of the event

Returns

boolean

Inherited from

AbstractMoveTool.isTouchEvent


notify

notify<E>(type, source, args?): SliderMoveTool

Notify listeners

Type parameters

NameType
Eextends string

Parameters

Name Type Description
typeEevent types
sourceAbstractToolof the event
Optional argsEventMap[E]arguments of the event

Returns

SliderMoveTool

this

Inherited from

AbstractMoveTool.notify


off

off<E>(type?, callback?): SliderMoveTool

Detach listener on event. Calling .off() with no arguments removes all attached listeners. Calling .off(type) with no callback removes all attached listeners for specific type.

Type parameters

NameType
Eextends string

Parameters

Name Type Description
Optional typeEtype of the event
Optional callback(eventType: E, sender: SliderMoveTool, args: EventMap[E]) => voidfunction to be called

Returns

SliderMoveTool

this

Inherited from

AbstractMoveTool.off


on

on<E>(type, callback): SliderMoveTool

Attach listener on event that will be called whenever the specified event is delivered to the target

If the callback function is already in the list of event listeners for this target, the function is not added a second time.

If a particular anonymous function is in the list of event listeners registered for a certain target, and then later in the code, an identical anonymous function is given in an "on" call, the second function will also be added to the list of event listeners for that target.

Type parameters

NameType
Eextends string

Parameters

Name Type Description
typeEtype of event or property
callback(eventType: E, sender: SliderMoveTool, args: EventMap[E]) => voidto be called

Returns

SliderMoveTool

this

Inherited from

AbstractMoveTool.on


onContext

onContext(event): void

Called when a 'context' event has occurred

Parameters

Name Type Description
eventPointerEventthe native event with plot coordinates added

Returns

void

Inherited from

AbstractMoveTool.onContext


onCursorMove

onCursorMove(event): void

Called when a 'onCursorMove' event has occurred

Parameters

Name Type Description
eventCustomPointerEventthe native event with plot coordinates added

Returns

void

Inherited from

AbstractMoveTool.onCursorMove


onDoubleClick

onDoubleClick(event): void

Called when a 'doubleclick' event has occurred

Parameters

Name Type Description
eventCustomPointerEventthe native event with plot coordinates added

Returns

void

Inherited from

AbstractMoveTool.onDoubleClick


onDoubleTap

onDoubleTap(event): void

Called when a 'onDoubleTap' event has occurred

Parameters

Name Type Description
eventCustomPointerEventthe native event with plot coordinates added

Returns

void

Inherited from

AbstractMoveTool.onDoubleTap


onDrag

onDrag(event): void

Called when a 'onDrag' event has occurred

Parameters

Name Type Description
eventCustomPointerEventthe native event with plot coordinates added

Returns

void

Inherited from

AbstractMoveTool.onDrag


onDragEnd

onDragEnd(event): void

Called when a 'onDragEnd' event has occurred

Parameters

Name Type Description
eventCustomPointerEventthe native event with plot coordinates added

Returns

void

Inherited from

AbstractMoveTool.onDragEnd


onDragStart

onDragStart(event): void

Called when a 'onDragStart' event has occurred

Parameters

Name Type Description
eventCustomPointerEventthe native event with plot coordinates added

Returns

void

Inherited from

AbstractMoveTool.onDragStart


onKey

onKey(event): void

Called when a 'onKey' event has occurred

Parameters

Name Type Description
eventKeyboardEventthe native event with plot coordinates added

Returns

void

Inherited from

AbstractMoveTool.onKey


onKeyDown

onKeyDown(event): void

Called when a 'keydown' event has occurred

Parameters

Name Type Description
eventKeyboardEventthe native event with plot coordinates added

Returns

void

Inherited from

AbstractMoveTool.onKeyDown


onKeyEnd

onKeyEnd(event): void

Called when a 'onKeyEnd' event has occurred

Parameters

Name Type Description
eventKeyboardEventthe native event with plot coordinates added

Returns

void

Inherited from

AbstractMoveTool.onKeyEnd


onKeyStart

onKeyStart(event): void

Called when a 'onKeyStart' event has occurred

Parameters

Name Type Description
eventKeyboardEventthe native event with plot coordinates added

Returns

void

Inherited from

AbstractMoveTool.onKeyStart


onKeyUp

onKeyUp(event): void

Called when a 'keyup' event has occurred

Parameters

Name Type Description
eventKeyboardEventthe native event with plot coordinates added

Returns

void

Inherited from

AbstractMoveTool.onKeyUp


onMouseDown

onMouseDown(event): void

Called when a 'mousedown' event has occurred

Parameters

Name Type Description
eventCustomPointerEventthe native event with plot coordinates added

Returns

void

Inherited from

AbstractMoveTool.onMouseDown


onMouseMove

onMouseMove(event): void

Called when a 'mousemove' event has occurred

Parameters

Name Type Description
eventCustomPointerEventthe native event with plot coordinates added

Returns

void

Inherited from

AbstractMoveTool.onMouseMove


onMouseOut

onMouseOut(event): void

Called when a 'mouseout' event has occurred

Parameters

Name Type Description
eventCustomPointerEventthe native event with plot coordinates added

Returns

void

Inherited from

AbstractMoveTool.onMouseOut


onMouseUp

onMouseUp(event): void

Called when a 'mouseup' event has occurred

Parameters

Name Type Description
eventCustomPointerEventthe native event with plot coordinates added

Returns

void

Inherited from

AbstractMoveTool.onMouseUp


onMouseWheel

onMouseWheel(event): void

Called when a 'mousewheel' event has occurred

Parameters

Name Type Description
eventWheelEventthe native event with plot coordinates added

Returns

void

Inherited from

AbstractMoveTool.onMouseWheel


onPick

onPick(event): void

Called when a 'onPick' event has occurred

Parameters

Name Type Description
eventCustomPointerEventthe native event with plot coordinates added

Returns

void

Inherited from

AbstractMoveTool.onPick


onPinch

onPinch(event): void

Called when a 'onPinch' event has occurred

Parameters

Name Type Description
eventMovePointerEventthe native event with plot coordinates added

Returns

void

Inherited from

AbstractMoveTool.onPinch


onPinchEnd

onPinchEnd(event): void

Called when a 'onPinchEnd' event has occurred

Parameters

Name Type Description
eventCustomPointerEventthe native event with plot coordinates added

Returns

void

Inherited from

AbstractMoveTool.onPinchEnd


onPinchStart

onPinchStart(event): void

Called when a 'onPinchStart' event has occurred

Parameters

Name Type Description
eventMovePointerEventthe native event with plot coordinates added

Returns

void

Inherited from

AbstractMoveTool.onPinchStart


onSlide

onSlide(event): void

Called when a 'onSlide' event has occurred

Parameters

Name Type Description
eventCustomPointerEventthe native event with plot coordinates added

Returns

void

Inherited from

AbstractMoveTool.onSlide


onSlideEnd

onSlideEnd(event): void

Called when a 'onSlideEnd' event has occurred

Parameters

Name Type Description
eventCustomPointerEventthe native event with plot coordinates added

Returns

void

Inherited from

AbstractMoveTool.onSlideEnd


onSlideStart

onSlideStart(event): void

Called when a 'onSlideStart' event has occurred

Parameters

Name Type Description
eventCustomPointerEventthe native event with plot coordinates added

Returns

void

Inherited from

AbstractMoveTool.onSlideStart


onTap

onTap(event): void

Called when a 'onTap' event has occurred

Parameters

Name Type Description
eventCustomPointerEventthe native event with plot coordinates added

Returns

void

Inherited from

AbstractMoveTool.onTap


onTouchEnd

onTouchEnd(event): void

Called when a 'touchend' event has occurred

Parameters

Name Type Description
eventCustomPointerEventthe native event with plot coordinates added

Returns

void

Inherited from

AbstractMoveTool.onTouchEnd


onTouchMove

onTouchMove(event): void

Called when a 'touchmove' event has occurred

Parameters

Name Type Description
eventCustomPointerEventthe native event with plot coordinates added

Returns

void

Inherited from

AbstractMoveTool.onTouchMove


onTouchStart

onTouchStart(event): void

Called when a 'touchstart' event has occurred

Parameters

Name Type Description
eventCustomPointerEventthe native event with plot coordinates added

Returns

void

Inherited from

AbstractMoveTool.onTouchStart


onVisibilityChanged

onVisibilityChanged(event): void

Called when a 'onVisibilityChanged' event has occurred

Parameters

Name Type Description
eventCustomPointerEventthe native event with plot coordinates added

Returns

void

Inherited from

AbstractMoveTool.onVisibilityChanged


onVisibilityGained

onVisibilityGained(event): void

Called when a 'onVisibilityGained' event has occurred

Parameters

Name Type Description
eventCustomPointerEventthe native event with plot coordinates added

Returns

void

Inherited from

AbstractMoveTool.onVisibilityGained


onVisibilityLost

onVisibilityLost(event): void

Called when a 'onVisibilityLost' event has occurred

Parameters

Name Type Description
eventCustomPointerEventthe native event with plot coordinates added

Returns

void

Inherited from

AbstractMoveTool.onVisibilityLost


removeSelectionListener

removeSelectionListener(callback): SliderMoveTool

Removes a listener

Parameters

Name Type Description
callbackListenerCallbackThe callback to remove

Returns

SliderMoveTool

this

Inherited from

AbstractMoveTool.removeSelectionListener


setMoveFunction

setMoveFunction(func): SliderMoveTool

Sets the function that should apply the computed 'move operation' to the targeted object.

Function parameters are:
{THREE.Object3D} object The object being moved
{THREE.Vector2} move The displacement in screen space to apply
{THREE.Vector2} initialPoint The initial point
Function should return 'true' to reset the reference point used for distance calculation

Parameters

Name Type Description
funcApplyMoveFunctionThe function

Returns

SliderMoveTool

this


setOptions

setOptions(options): SliderMoveTool

Set options, the given json will be merged with the object's state so that only the given options will be changed.

Parameters

Name Type Description
optionsOptionsSee AbstractMoveTool.setOptions for inherited options

Returns

SliderMoveTool

this

Overrides

AbstractMoveTool.setOptions


setSilent

setSilent(bool): SliderMoveTool

Set silent mode

Parameters

Name Type Description
boolbooleanflag to enable silent mode

Returns

SliderMoveTool

this

Inherited from

AbstractMoveTool.setSilent


setup

setup(deviceSupport): SliderMoveTool

This function allows tools to bind their events to the device support

Parameters

Name Type Description
deviceSupportAbstractDeviceSupportthe type of device we are attaching to

Returns

SliderMoveTool

Inherited from

AbstractMoveTool.setup


getClassName

Static getClassName(): string

Returns

string

Inherited from

AbstractMoveTool.getClassName