LuciadCPillar 2023.1.04
luciad::RotateEventHandler Class Referencefinal

Handler that translates drag gesture events to a rotate operation. More...

#include <luciad/controllers/RotateEventHandler.h>

Public Member Functions

 RotateEventHandler ()
 Creates a new instance. More...
 
 RotateEventHandler (const RotateEventHandler &other)=delete
 
 ~RotateEventHandler ()
 
bool isPitchEnabled () const
 
bool isYawEnabled () const
 
EventResult onDragEvent (const std::shared_ptr< DragEvent > &dragEvent, const std::shared_ptr< Map > &map)
 Rotates the map's camera following the drag direction. More...
 
RotateEventHandleroperator= (const RotateEventHandler &other)=delete
 
void setPitchEnabled (bool pitchEnabled)
 Allow the RotateEventHandler to change the pitch of the camera. More...
 
void setYawEnabled (bool yawEnabled)
 Allow the RotateEventHandler to change the yaw of the camera. More...
 

Detailed Description

Handler that translates drag gesture events to a rotate operation.

Rotation is done using a luciad::MapNavigator::RotateAction, please check this class documentation for more information on how the rotation is performed.

Since
2020.1

Constructor & Destructor Documentation

◆ RotateEventHandler() [1/2]

luciad::RotateEventHandler::RotateEventHandler ( )

Creates a new instance.

◆ ~RotateEventHandler()

luciad::RotateEventHandler::~RotateEventHandler ( )

◆ RotateEventHandler() [2/2]

luciad::RotateEventHandler::RotateEventHandler ( const RotateEventHandler other)
delete

Member Function Documentation

◆ isPitchEnabled()

bool luciad::RotateEventHandler::isPitchEnabled ( ) const
Returns
if the RotateEventHandler can change the pitch of the camera. The default value is true.
See also
setPitchEnabled
Since
2021.1

◆ isYawEnabled()

bool luciad::RotateEventHandler::isYawEnabled ( ) const
Returns
if the RotateEventHandler can change the yaw of the camera. The default value is true.
See also
setYawEnabled
Since
2021.1

◆ onDragEvent()

EventResult luciad::RotateEventHandler::onDragEvent ( const std::shared_ptr< DragEvent > &  dragEvent,
const std::shared_ptr< Map > &  map 
)

Rotates the map's camera following the drag direction.

The drag event is consumed only if the sequence of events is the following : a EventStatus::Start event, 0 or more EventStatus::InProgress event and finally a EventStatus::End event. If the sequence is not correct, this method returns EventResult::NotConsumed.

Parameters
dragEventa drag event. Cannot be nullptr.
mapthe map. Cannot be nullptr.
Returns
whether the drag event is consumed or not.
Exceptions
luciad::NullArgumentExceptionwhen passing nullptr for the map or the event.

◆ operator=()

RotateEventHandler & luciad::RotateEventHandler::operator= ( const RotateEventHandler other)
delete

◆ setPitchEnabled()

void luciad::RotateEventHandler::setPitchEnabled ( bool  pitchEnabled)

Allow the RotateEventHandler to change the pitch of the camera.

If true, that means that the vertical variations of the drag events locations are considered. This is useful only if the map is 3D.

Parameters
pitchEnabledthe desired state of the flag.
Since
2021.1

◆ setYawEnabled()

void luciad::RotateEventHandler::setYawEnabled ( bool  yawEnabled)

Allow the RotateEventHandler to change the yaw of the camera.

If true, that means that the horizontal variations of the drag events locations are considered. This is useful only if the map is 3D.

Parameters
yawEnabledthe desired state of the flag.
Since
2021.1