LuciadCPillar 2023.1.04
luciad::HoverEventHandler Class Referencefinal

Handler that translates hover gesture events to a hovering operation. More...

#include <luciad/controllers/HoverEventHandler.h>

Public Member Functions

 HoverEventHandler ()
 Creates a new instance. More...
 
 HoverEventHandler (const HoverEventHandler &other)=delete
 
 ~HoverEventHandler ()
 
size_t getMargin () const noexcept
 Returns the margin used to detect if a feature is considered under the cursor or not. More...
 
EventResult onMouseMoveEvent (const std::shared_ptr< MouseMoveEvent > &moveEvent, const std::shared_ptr< Map > &map)
 Changes the luciad::FeatureState::hover() state of features located under the mouse position. More...
 
HoverEventHandleroperator= (const HoverEventHandler &other)=delete
 
void setMargin (size_t margin)
 Sets the margin used to detect if a feature is considered under the cursor or not. More...
 

Detailed Description

Handler that translates hover gesture events to a hovering operation.

Features under the cursor will have their luciad::FeatureState::hover() state updated.

Since
2020.1

Constructor & Destructor Documentation

◆ HoverEventHandler() [1/2]

luciad::HoverEventHandler::HoverEventHandler ( )

Creates a new instance.

◆ ~HoverEventHandler()

luciad::HoverEventHandler::~HoverEventHandler ( )

◆ HoverEventHandler() [2/2]

luciad::HoverEventHandler::HoverEventHandler ( const HoverEventHandler other)
delete

Member Function Documentation

◆ getMargin()

size_t luciad::HoverEventHandler::getMargin ( ) const
noexcept

Returns the margin used to detect if a feature is considered under the cursor or not.

The default value is 5 pixels.

Returns
the margin used to detect if a feature is considered under the cursor or not.

◆ onMouseMoveEvent()

EventResult luciad::HoverEventHandler::onMouseMoveEvent ( const std::shared_ptr< MouseMoveEvent > &  moveEvent,
const std::shared_ptr< Map > &  map 
)

Changes the luciad::FeatureState::hover() state of features located under the mouse position.

Parameters
moveEventa move event. Cannot be nullptr.
mapthe map. Cannot be nullptr.
Returns
whether the move event is consumed or not. Always EventResult::Consumed.
Exceptions
luciad::NullArgumentExceptionwhen passing nullptr for the map or the event.
See also
luciad::HoverEventHandler::setMargin for the margin applied to the mouse position to detect which features are considered.

◆ operator=()

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

◆ setMargin()

void luciad::HoverEventHandler::setMargin ( size_t  margin)

Sets the margin used to detect if a feature is considered under the cursor or not.

This margin is expressed in device independent pixels. By default, the margin is 5 pixels.

Parameters
marginthe margin, defined in device independent pixels.