LuciadCPillar 2023.1.04
luciad::TouchPinchRotateEvent Class Reference

Implementation of luciad::IInputEvent representing a 2 pointers gesture. More...

#include <luciad/input/touch/TouchEvents.h>

Inheritance diagram for luciad::TouchPinchRotateEvent:
luciad::IInputEvent

Public Member Functions

luciad::Angle getCurrentAngle () const
 
Coordinate getCurrentCenterLocation () const
 
double getCurrentDistance () const
 
luciad::Angle getInitialAngle () const
 
Coordinate getInitialCenterLocation () const
 
double getInitialDistance () const
 
std::optional< luciad::AnglegetPreviousAngle () const
 
std::optional< CoordinategetPreviousCenterLocation () const
 
std::optional< double > getPreviousDistance () const
 
EventStatus getStatus () const
 
- Public Member Functions inherited from luciad::IInputEvent
virtual ~IInputEvent ()=default
 

Static Public Member Functions

static std::shared_ptr< TouchPinchRotateEventcreateEvent (Coordinate initialCenterLocation, double initialDistance, luciad::Angle initialAngle, Coordinate currentCenterLocation, double currentDistance, luciad::Angle currentAngle, Coordinate previousCenterLocation, double previousDistance, luciad::Angle previousAngle, EventStatus status)
 Creates a two pointer event. More...
 
static std::shared_ptr< TouchPinchRotateEventcreateStartEvent (Coordinate initialCenterLocation, double initialDistance, luciad::Angle initialAngle, Coordinate currentCenterLocation, double currentDistance, luciad::Angle currentAngle)
 Creates the first TouchPinchRotateEvent of a gesture. More...
 

Detailed Description

Implementation of luciad::IInputEvent representing a 2 pointers gesture.

This class aggregates information related to pinch and rotation in the same event.

Since
2022.0

Member Function Documentation

◆ createEvent()

static std::shared_ptr< TouchPinchRotateEvent > luciad::TouchPinchRotateEvent::createEvent ( Coordinate  initialCenterLocation,
double  initialDistance,
luciad::Angle  initialAngle,
Coordinate  currentCenterLocation,
double  currentDistance,
luciad::Angle  currentAngle,
Coordinate  previousCenterLocation,
double  previousDistance,
luciad::Angle  previousAngle,
EventStatus  status 
)
inlinestatic

Creates a two pointer event.

The initial values refer to the situation at the beginning of the gesture (i.e. before any gesture detection).

Parameters
initialCenterLocationThe center location at the beginning of the gesture, defined in device independent pixels.
initialDistanceThe distance between the pointers at the beginning of the gesture, defined in device independent pixels.
initialAngleThe absolute angle between the two pointers at the beginning of the gesture.
currentCenterLocationThe current center location, defined in device independent pixels.
currentDistanceThe current distance between the pointers, defined in device independent pixels.
currentAngleThe absolute angle between the two pointers.
previousCenterLocationThe center location from the previous event of the gesture, defined in device independent pixels.
previousDistanceThe distance between the pointers from the previous event of the gesture, defined in device independent pixels.
previousAngleThe absolute angle between the two pointers from the previous event of the gesture.
statusThe status of the gesture.

◆ createStartEvent()

static std::shared_ptr< TouchPinchRotateEvent > luciad::TouchPinchRotateEvent::createStartEvent ( Coordinate  initialCenterLocation,
double  initialDistance,
luciad::Angle  initialAngle,
Coordinate  currentCenterLocation,
double  currentDistance,
luciad::Angle  currentAngle 
)
inlinestatic

Creates the first TouchPinchRotateEvent of a gesture.

The initial values refer to the situation at the beginning of the gesture (i.e. before any gesture detection). The current ones contain the values after the gesture detection is done.

Parameters
initialCenterLocationThe center location at the beginning of the gesture, defined in device independent pixels.
initialDistanceThe distance between the pointers at the beginning of the gesture, defined in device independent pixels.
initialAngleThe absolute angle between the two pointers at the beginning of the gesture.
currentCenterLocationThe current center location, defined in device independent pixels.
currentDistanceThe current distance between the pointers, defined in device independent pixels.
currentAngleThe absolute angle between the two pointers. The status of the created event is EventStatus::Start. The information relative to the previous event are std::nullopt.

◆ getCurrentAngle()

luciad::Angle luciad::TouchPinchRotateEvent::getCurrentAngle ( ) const
inline
Returns
the absolute angle between the two touch points. It is measured in degrees and counter-clockwise positive.

◆ getCurrentCenterLocation()

Coordinate luciad::TouchPinchRotateEvent::getCurrentCenterLocation ( ) const
inline
Returns
the location of the current center between the 2 touch points in device independent pixels.

◆ getCurrentDistance()

double luciad::TouchPinchRotateEvent::getCurrentDistance ( ) const
inline
Returns
the current span between touch points in device independent pixels.

◆ getInitialAngle()

luciad::Angle luciad::TouchPinchRotateEvent::getInitialAngle ( ) const
inline
Returns
the absolute angle between the two touch points at the beginning of the gesture. It is defined as the angle between the horizontal of the screen and the line connecting the two pointers. It is measured in degrees and counter-clockwise positive. An angle of 0 refers to the position where the first point is located to the left (west, left on the screen) of the other point.

◆ getInitialCenterLocation()

Coordinate luciad::TouchPinchRotateEvent::getInitialCenterLocation ( ) const
inline
Returns
the location of the center between the 2 starting touch point locations in device independent pixels.

◆ getInitialDistance()

double luciad::TouchPinchRotateEvent::getInitialDistance ( ) const
inline
Returns
the span between the initial touch point positions in device independent pixels.

◆ getPreviousAngle()

std::optional< luciad::Angle > luciad::TouchPinchRotateEvent::getPreviousAngle ( ) const
inline
Returns
the absolute angle between the two touch points from the previous event of this gesture. It is measured in degrees and counter-clockwise positive. returns std::nullopt if this is the first event of the gesture (i.e. when the status is EventStatus::Start).

◆ getPreviousCenterLocation()

std::optional< Coordinate > luciad::TouchPinchRotateEvent::getPreviousCenterLocation ( ) const
inline
Returns
the location of the center between the 2 touch points in device independent pixels from the previous event of this gesture. returns std::nullopt if this is the first event of the gesture (i.e. when the status is EventStatus::Start).

◆ getPreviousDistance()

std::optional< double > luciad::TouchPinchRotateEvent::getPreviousDistance ( ) const
inline
Returns
the span between touch points in device independent pixels from the previous event of this gesture returns std::nullopt if this is the first event of the gesture (i.e. when the status is EventStatus::Start).

◆ getStatus()

EventStatus luciad::TouchPinchRotateEvent::getStatus ( ) const
inline
Returns
the status of the event.