![]() |
MAK Legion API Documentation
|
The control manager is responsible for creating and adding controls to the simulation database. More...
Collaboration diagram for Legion::ControlManager:Classes | |
| struct | CallbackData |
Public Member Functions | |
| template<typename CONTROL_TYPE > | |
| CONTROL_TYPE | createControl () |
| create an control of a given type. The type must be registered with the control manager prior to creating it. More... | |
| virtual ControlManagerHandle | handle () const |
| virtual UInt32 | addControl (const ControlInstance &iControl) |
| Adds a control to distribute to the control manager. This control must have been created by createControl(). More... | |
| virtual ControlType | registerControlType (const ControlDescriptor ®) |
| Register control type so as to be able to access controls (add/peek/get) More... | |
| virtual ParameterId | parameterId (ControlType controlType, const std::string ¶meterName) |
| Look up the parameter ID of a parameter of a control. More... | |
| template<typename CONTROL_TYPE > | |
| UInt32 | addControlCallback (Callback< void(Span< CONTROL_TYPE > &)> cb) |
| Adds a callback function for an interested control type. More... | |
| template<typename CONTROL_TYPE > | |
| bool | removeControlCallback (UInt32 handle) |
| Remove a callback using the handle that was returned when it the callback was added. More... | |
| template<typename CONTROL_TYPE > | |
| const std::vector< CONTROL_TYPE > | getControls () |
| Get controls for this frame/next frames. More... | |
| template<typename CONTROL_TYPE > | |
| const std::vector< CONTROL_TYPE > | peekControls () |
| Peek controls for this frame/next frames. More... | |
Protected Member Functions | |
| ControlManager (ControlManagerHandle handle) | |
| Constructor. More... | |
| virtual | ~ControlManager () |
| Destructor. More... | |
| virtual void | addInterest (const ControlType controlTypeId) |
| virtual void | removeInterest (const ControlType controlTypeId) |
Static Protected Member Functions | |
| static void | callback (void *usr, ControlHandle *controls, UInt32 count) |
Protected Attributes | |
| UInt32 | myNextCallbackHandle |
| std::vector< CallbackData * > | myCallbackData |
| ControlManagerHandle | myHandle |
Friends | |
| class | SimulationDatabase |
The control manager is responsible for creating and adding controls to the simulation database.
The control manager is used to register new controls, create controls, add them to the database, and dispatch controls to application code that registered callbacks. The user can get the control manager from the Simulation Database.
|
protected |
Constructor.
|
protectedvirtual |
Destructor.
|
virtual |
Adds a control to distribute to the control manager. This control must have been created by createControl().
| UInt32 Legion::ControlManager::addControlCallback | ( | Callback< void(Span< CONTROL_TYPE > &)> | cb | ) |
Adds a callback function for an interested control type.
So it can be notified whenever the type of controls are received This returns a handle for the callback, which is used to unregister the callback.
References addInterest(), callback(), Legion::ControlManager::CallbackData::convertAndExecute, Legion::ControlManager::CallbackData::handle, legion_controlManager_addCallback(), myCallbackData, and myHandle.
Referenced by Clutter::SimEngine::SimEngine().
|
protectedvirtual |
Referenced by addControlCallback().
|
staticprotected |
Referenced by addControlCallback(), and removeControlCallback().
| CONTROL_TYPE Legion::ControlManager::createControl | ( | ) |
create an control of a given type. The type must be registered with the control manager prior to creating it.
References handle(), legion_controlManager_createControl(), and myHandle.
| const std::vector< CONTROL_TYPE > Legion::ControlManager::getControls | ( | ) |
Get controls for this frame/next frames.
References legion_controlManager_getControls(), and myHandle.
|
virtual |
Referenced by createControl().
|
virtual |
Look up the parameter ID of a parameter of a control.
| const std::vector< CONTROL_TYPE > Legion::ControlManager::peekControls | ( | ) |
Peek controls for this frame/next frames.
References legion_controlManager_peekControls(), and myHandle.
|
virtual |
Register control type so as to be able to access controls (add/peek/get)
| bool Legion::ControlManager::removeControlCallback | ( | UInt32 | handle | ) |
Remove a callback using the handle that was returned when it the callback was added.
This removes the interest of type of controls.
References callback(), legion_controlManager_removeCallback(), myCallbackData, myHandle, and removeInterest().
Referenced by Clutter::SimEngine::~SimEngine().
|
protectedvirtual |
Referenced by removeControlCallback().
|
friend |
|
protected |
Referenced by addControlCallback(), and removeControlCallback().
|
protected |
Referenced by addControlCallback(), createControl(), getControls(), peekControls(), and removeControlCallback().
|
protected |