LuciadCPillar 2023.1.04
|
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... | |
RotateEventHandler & | operator= (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... | |
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.
luciad::RotateEventHandler::RotateEventHandler | ( | ) |
Creates a new instance.
luciad::RotateEventHandler::~RotateEventHandler | ( | ) |
|
delete |
bool luciad::RotateEventHandler::isPitchEnabled | ( | ) | const |
bool luciad::RotateEventHandler::isYawEnabled | ( | ) | const |
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
.
dragEvent | a drag event. Cannot be nullptr . |
map | the map. Cannot be nullptr . |
luciad::NullArgumentException | when passing nullptr for the map or the event. |
|
delete |
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
.
pitchEnabled | the desired state of the flag. |
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
.
yawEnabled | the desired state of the flag. |