LuciadCPillar C# 2023.1.04
|
An IController implementation interprets received events and triggers an action on the map. More...
Public Member Functions | |
Luciad.Layers.LayerList | GetLayerList () |
Returns the layer list used by the controller if it needs to provide visual component to the map following user interactions. More... | |
void | OnActivate (Luciad.Maps.Map map) |
Used by the map to signal that this controller can start interaction with the map. More... | |
void | OnDeactivate (Luciad.Maps.Map map) |
Used by the map to signal that this controller is no longer the active controller of a map. More... | |
void | OnEvent (Luciad.Input.IInputEvent inputEvent) |
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. 2020.1
Luciad.Layers.LayerList Luciad.Controllers.IController.GetLayerList | ( | ) |
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. The LayerList must not be nullptr.
luciad::IController::onActivate
void Luciad.Controllers.IController.OnActivate | ( | Luciad.Maps.Map | map | ) |
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. make sure to either store this shared pointer as a weak pointer or clean the local reference when luciad::IController::onDeactivate is called.
void Luciad.Controllers.IController.OnDeactivate | ( | Luciad.Maps.Map | map | ) |
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.
void Luciad.Controllers.IController.OnEvent | ( | Luciad.Input.IInputEvent | inputEvent | ) |
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.
a casting of the luciad::IInputEvent will be necessary to access its fields.