LuciadCPillar 2023.1.04
|
Handler that translates click gesture events to a select operation. More...
#include <luciad/controllers/SelectEventHandler.h>
Public Member Functions | |
SelectEventHandler (const SelectEventHandler &other)=delete | |
SelectEventHandler (SelectMode selectMode) | |
Creates a new event handler that uses the given select mode. More... | |
~SelectEventHandler () | |
size_t | getMargin () const noexcept |
Returns the margin used to detect if a feature is considered under the mouse cursor or not. More... | |
std::shared_ptr< ISelectionCandidateChooser > | getSelectionCandidateChooser () const |
Returns the selection candidate chooser that is used to choose which features need to be selected when there are multiple selection candidates. More... | |
size_t | getTouchMargin () const noexcept |
Returns the margin used to detect if a feature is considered under a touch point or not. More... | |
EventResult | onClickEvent (const std::shared_ptr< ClickEvent > &clickEvent, const std::shared_ptr< Map > &map) |
Changes the luciad::FeatureState::selected() state of features located under the event location directly or delegates the selection to the handler if it has been set. More... | |
EventResult | onTouchLongPressEvent (const std::shared_ptr< TouchLongPressEvent > &touchLongPressEvent, const std::shared_ptr< Map > &map) |
Changes the luciad::FeatureState::selected() state of features located under the event location directly or delegates the selection to the handler if it has been set. More... | |
SelectEventHandler & | operator= (const SelectEventHandler &other)=delete |
void | setMargin (size_t margin) noexcept |
Sets the margin used to detect if a feature is considered under the mouse cursor or not. More... | |
void | setSelectionCandidateChooser (std::shared_ptr< ISelectionCandidateChooser > selectionCandidateChooser) |
void | setTouchMargin (size_t margin) noexcept |
Sets the margin used to detect if a feature is considered under a touch point or not. More... | |
Handler that translates click gesture events to a select operation.
The select mode can be configured using the luciad::SelectMode
enumeration.
|
explicit |
Creates a new event handler that uses the given select mode.
selectMode | the mode. |
luciad::SelectEventHandler::~SelectEventHandler | ( | ) |
|
delete |
|
noexcept |
Returns the margin used to detect if a feature is considered under the mouse cursor or not.
std::shared_ptr< ISelectionCandidateChooser > luciad::SelectEventHandler::getSelectionCandidateChooser | ( | ) | const |
Returns the selection candidate chooser that is used to choose which features need to be selected when there are multiple selection candidates.
|
noexcept |
Returns the margin used to detect if a feature is considered under a touch point or not.
EventResult luciad::SelectEventHandler::onClickEvent | ( | const std::shared_ptr< ClickEvent > & | clickEvent, |
const std::shared_ptr< Map > & | map | ||
) |
Changes the luciad::FeatureState::selected()
state of features located under the event location directly or delegates the selection to the handler
if it has been set.
This allows the display of a context menu when multiple features are below the cursor, for example.
clickEvent | a click event. Cannot be nullptr . |
map | the map. Cannot be nullptr . |
amount of clicks
is different than 1. luciad::NullArgumentException | when passing nullptr for the map or the event. |
setMargin
and {luciad::SelectEventHandler::setTouchMargin setTouchMargin} for the margin applied to the mouse cursor or touch point position to detect which features are considered. EventResult luciad::SelectEventHandler::onTouchLongPressEvent | ( | const std::shared_ptr< TouchLongPressEvent > & | touchLongPressEvent, |
const std::shared_ptr< Map > & | map | ||
) |
Changes the luciad::FeatureState::selected()
state of features located under the event location directly or delegates the selection to the handler
if it has been set.
This allows the display of a context menu when multiple features are below the cursor, for example.
touchLongPressEvent | a touch long press event. |
map | the map. |
luciad::NullArgumentException | when passing nullptr . |
setTouchMargin
for the margin applied to the touch point position to detect which features are considered.
|
delete |
|
noexcept |
Sets the margin used to detect if a feature is considered under the mouse cursor or not.
By default, the margin is 1 pixel.
margin | the margin, expressed in device independent pixels |
void luciad::SelectEventHandler::setSelectionCandidateChooser | ( | std::shared_ptr< ISelectionCandidateChooser > | selectionCandidateChooser | ) |
|
noexcept |
Sets the margin used to detect if a feature is considered under a touch point or not.
By default, the margin is 5 pixels.
margin | the margin, expressed in device independent pixels |