LuciadCPillar 2024.0.02
|
An IController implementation interprets received events and triggers an action on the map. More...
#include <luciad/controllers/IController.h>
Public Member Functions | |
virtual | ~IController ()=default |
virtual std::shared_ptr< LayerList > | getLayerList () const =0 |
Returns the layer list used by the controller if it needs to provide visual component to the map following user interactions. More... | |
virtual void | onActivate (std::shared_ptr< Map > map)=0 |
Used by the map to signal that this controller can start interaction with the map. More... | |
virtual void | onDeactivate (std::shared_ptr< Map > map)=0 |
Used by the map to signal that this controller is no longer the active controller of a map. More... | |
virtual void | onEvent (const std::shared_ptr< IInputEvent > &inputEvent)=0 |
Entry point of the controller. More... | |
An IController implementation interprets received events and triggers an action on the map.
It receives toolkit-independent events (luciad::IInputEvent
) and has a luciad::LayerList
for controller-specific visualization.
The IController receives high level event (via luciad::IController::onEvent
) from a provider like a luciad::MouseGestureRecognizer
and is responsible to create gesture handlers, such a luciad::PanEventHandler
or a fully custom one.
You can optionally bind a luciad::MouseGestureRecognizer
or a luciad::TouchGestureRecognizer
to your controller. You can find example code for this in this tutorial. The tutorial shows how this is done in C++ and for Qt, but the same principle can be applied to other UI frameworks as well.
You can use your own binding code using the following code :
If you need to add visual components to the map to respond to user interactions, your controller can implement the luciad::IController::getLayerList
method. You use it to return a luciad::LayerList
to visualize controller-specific information such as handles.
For more information on controllers in LuciadCPillar, refer to the related guide and article.
|
virtualdefault |
|
pure virtual |
Returns the layer list used by the controller if it needs to provide visual component to the map following user interactions.
The map captures the initial composition of this list when the controller is activated and will listen to its future composition updates.
This layer list is independent from the map layer list and will always be displayed on top.
nullptr
.
|
pure virtual |
Used by the map to signal that this controller can start interaction with the map.
Is called when the controller is activated on a map using luciad::Map::setController
. Once this method is called, you can use the map to create map-dependent objects.
luciad::IController::onDeactivate
is called.
|
pure virtual |
Used by the map to signal that this controller is no longer the active controller of a map.
Is called when the controller is deactivated on a map luciad::Map::setController
or when the map is destroyed. The controller should clean all references to the map when this method is invoked.
|
pure virtual |
Entry point of the controller.
This method is typically called by the callback of a luciad::MouseGestureRecognizer
or a luciad::TouchGestureRecognizer
.
inputEvent | : a high level event. |
luciad::IInputEvent
will be necessary to access its fields.