LuciadCPillar C# 2024.1.04
Luciad.Controllers.ZoomEventHandler Class Reference

Handler that translates scroll or click gesture events to a zoom operation. More...

Inheritance diagram for Luciad.Controllers.ZoomEventHandler:

Public Member Functions

 ZoomEventHandler ()
 Creates a new zoom event handler. More...
 
void Dispose ()
 
override bool Equals (object obj)
 
override int GetHashCode ()
 
EventResult OnClickEvent (Luciad.Input.ClickEvent clickEvent, Luciad.Maps.Map map, bool zoomIn, double zoomSpeed=1.0)
 Zooms towards or from the mouse position of a click. More...
 
EventResult OnScrollEvent (Luciad.Input.ScrollEvent scrollEvent, Luciad.Maps.Map map, double zoomSpeed=1.0, bool invertZoomDirection=false)
 Applies a zoom towards or from the mouse position using the wheel uses the given zoom speed, with 1 being the default zoom speed. More...
 

Detailed Description

Handler that translates scroll or click gesture events to a zoom operation.

This is a reusable code block that a controller designer can use in its implementation.

Since
2020.1

Constructor & Destructor Documentation

◆ ZoomEventHandler()

Luciad.Controllers.ZoomEventHandler.ZoomEventHandler ( )
inline

Creates a new zoom event handler.

Member Function Documentation

◆ Dispose()

void Luciad.Controllers.ZoomEventHandler.Dispose ( )
inline

◆ Equals()

override bool Luciad.Controllers.ZoomEventHandler.Equals ( object  obj)
inline

◆ GetHashCode()

override int Luciad.Controllers.ZoomEventHandler.GetHashCode ( )
inline

◆ OnClickEvent()

EventResult Luciad.Controllers.ZoomEventHandler.OnClickEvent ( Luciad.Input.ClickEvent  clickEvent,
Luciad.Maps.Map  map,
bool  zoomIn,
double  zoomSpeed = 1.0 
)
inline

Zooms towards or from the mouse position of a click.

Parameters
clickEventa click event, cannot be null.
mapthe map, cannot be null.
zoomIntrue if zooming in, false otherwise.
zoomSpeedthe zoom speed. Must be a number greater than 0. Default value is 1.0.
Returns
whether the click event is consumed or not. Always EventResult.Consumed.
Exceptions
System.ArgumentNullExceptionwhen passing null for the map or the event.

◆ OnScrollEvent()

EventResult Luciad.Controllers.ZoomEventHandler.OnScrollEvent ( Luciad.Input.ScrollEvent  scrollEvent,
Luciad.Maps.Map  map,
double  zoomSpeed = 1.0,
bool  invertZoomDirection = false 
)
inline

Applies a zoom towards or from the mouse position using the wheel uses the given zoom speed, with 1 being the default zoom speed.

For example: 0.5 zooms twice as slow, 2 zooms twice as much. The direction of the scroll is used to determine the direction of this action.

Parameters
scrollEventa scroll event, cannot be null.
mapthe map, cannot be null.
zoomSpeedthe zoom speed. Must be a number greater than 0. Default value is 1.0.
invertZoomDirectionto invert the zoom direction. By default, this method will zoom in when the verticals scrolling delta is positive, and zoom out when it is negative
Returns
whether the scroll event is consumed or not. Always EventResult.Consumed.
Exceptions
System.ArgumentNullExceptionwhen passing null for the map or the event.