VR-Forces 4.5 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Classes | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
makVrv::DtJoystickFunctionEnableHandler Class Reference

Handler that will manage the objects that are taken control of for joystick controls and process the events to apply to them via the joystickFunctionFired() pure method. More...

Inheritance diagram for makVrv::DtJoystickFunctionEnableHandler:
Inheritance graph
[legend]

Classes

struct  ControlStatus
 Control processors that are keeping track of current values by function group and function. More...
struct  ControlStruct

Public Member Functions

 DtJoystickFunctionEnableHandler (DtDe &)
 CTOR.
virtual ~DtJoystickFunctionEnableHandler ()
 DTOR.
virtual bool gameControllerEvent (DtGenericControllerEvent *)
 Return true to handle the event and not allow other events to handle.
virtual void tick (bool sentEvents)
 Called after game controller events are processed in any given tick.
virtual void gameControllerDeviceRemoved (int)
 Called when a game controller device is removed.
virtual void gameControllerDeviceAdded (int)
 Called when a game controller device is added.
virtual bool enableJoystickFunctions (const std::string &configuration, const std::set< std::string > &functionalGroups, std::set< std::string > &enabled)
 Enables the joystick function for handling via this handler, if not already enabled.
virtual bool disableJoystickFunctions (const std::set< std::string > &functionalGroups, std::set< std::string > &disabled)
 Disables the joystick functions, if enabled.
virtual std::set< std::string > controlledFunctionGroups () const
 Function groups currently controlled.
virtual bool canFunctionGroupBeAssigned (const std::string &functionGroup) const
 Returns true if this function group is not already in control of something.
virtual bool eventActive (DtGenericControllerEvent *sdlEvent) const
 Returns true if this event is active in any game processor.
virtual bool canProcessEvent (DtGenericControllerEvent *sdlEvent) const
 Returns true if the event can be processed by any of the game processors.
virtual bool anyFunctionGroupsActive () const
 Returns true if there are any function groups active.
virtual void releaseAllControllerInformation ()
 Releases control of all used configuration and function groups.
- Public Member Functions inherited from makVrv::DtGameControllerEventHandler
 DtGameControllerEventHandler ()
virtual ~DtGameControllerEventHandler ()

Protected Types

typedef std::vector
< ControlStatus
ControlStatusVector
 Devices that are controlled and their current status.
typedef std::map< std::string,
ControlStatusVector
ControlStatusMap
 By function group.
typedef std::map< int,
ControlStatusMap
ControlledDevices
typedef boost::unordered_map
< std::string, ControlStruct
InControlOf
 Configurations that are controlled and their current switch status.
typedef std::map< int,
std::map< int, int > > 
LastJoystickAxisValue
typedef boost::unordered_map
< DtGameControlProcessor
*, std::pair< ControlStatus,
DtGenericControllerEvent * > > 
RepeatQueue
 Queue of funcutons that wish to get a repeat of an event if that event is not triggered (such as a button press)

Protected Member Functions

virtual bool filterGameControllerEvent (DtGenericControllerEvent *)
 Return true to filter this Game controller Event.
virtual bool isFunctionGroupActive (const std::string &configuration, const std::string &) const
 Returns true if this function group is active. This will return true if any function within the group is active.
virtual void activateFunctionGroup (const std::string &configuration, const std::string &)
 Will activate all functions within the function group.
virtual void deactivateFunctionGroup (const std::string &configuration, const std::string &)
 Will deactivate all functions within the function group.
virtual void switchControlOfFunction (const std::string &configuration, const std::string &functionGroup)
virtual void noQueuedEvents ()
 Called when there were events but now there are no longer queued events.
virtual void gameControlInformationAdded (const std::string &configuration, const std::string &functionGroup, const std::string &function, const DtGameControlInformation &i)
 Called when game controller information is added or updated for the given configuration, function group and function.
virtual bool joystickFunctionFired (const std::string &functionGroup, const std::string &function, double value, bool repeat, bool valueChanged)=0
 Called when a game control processor fires off.

Protected Attributes

ControlledDevices myControlledDevices
InControlOf myInControlOf
DtJoystickManagermyJoystickManager
DtSignalConnectionManager myConnections
LastJoystickAxisValue myLastJoystickAxisValue
RepeatQueue myRepeatQueue
DtDemyDe

Detailed Description

Handler that will manage the objects that are taken control of for joystick controls and process the events to apply to them via the joystickFunctionFired() pure method.

Member Typedef Documentation

Devices that are controlled and their current status.

By function group.

typedef boost::unordered_map<std::string, ControlStruct> makVrv::DtJoystickFunctionEnableHandler::InControlOf
protected

Configurations that are controlled and their current switch status.

Queue of funcutons that wish to get a repeat of an event if that event is not triggered (such as a button press)

Constructor & Destructor Documentation

makVrv::DtJoystickFunctionEnableHandler::DtJoystickFunctionEnableHandler ( DtDe )

CTOR.

virtual makVrv::DtJoystickFunctionEnableHandler::~DtJoystickFunctionEnableHandler ( )
virtual

DTOR.

Member Function Documentation

virtual bool makVrv::DtJoystickFunctionEnableHandler::gameControllerEvent ( DtGenericControllerEvent )
virtual

Return true to handle the event and not allow other events to handle.

Implements makVrv::DtGameControllerEventHandler.

virtual void makVrv::DtJoystickFunctionEnableHandler::tick ( bool  sentEvents)
virtual

Called after game controller events are processed in any given tick.

If sentEvents is true some game controller event was sent this tick

Reimplemented from makVrv::DtGameControllerEventHandler.

virtual void makVrv::DtJoystickFunctionEnableHandler::gameControllerDeviceRemoved ( int  )
virtual

Called when a game controller device is removed.

Reimplemented from makVrv::DtGameControllerEventHandler.

Reimplemented in makVrf::DtVrfGuiJoystickControlHandler.

virtual void makVrv::DtJoystickFunctionEnableHandler::gameControllerDeviceAdded ( int  )
virtual

Called when a game controller device is added.

Reimplemented from makVrv::DtGameControllerEventHandler.

virtual bool makVrv::DtJoystickFunctionEnableHandler::enableJoystickFunctions ( const std::string &  configuration,
const std::set< std::string > &  functionalGroups,
std::set< std::string > &  enabled 
)
virtual

Enables the joystick function for handling via this handler, if not already enabled.

If not already, will increase lock count of joystick manager for changes. The last parameter will contain the list of functions enabled

virtual bool makVrv::DtJoystickFunctionEnableHandler::disableJoystickFunctions ( const std::set< std::string > &  functionalGroups,
std::set< std::string > &  disabled 
)
virtual

Disables the joystick functions, if enabled.

If no functions are controlled will decrease lock count on joystick manager. If no function groups are given all controlled groups are cleared

virtual std::set<std::string> makVrv::DtJoystickFunctionEnableHandler::controlledFunctionGroups ( ) const
virtual

Function groups currently controlled.

virtual bool makVrv::DtJoystickFunctionEnableHandler::canFunctionGroupBeAssigned ( const std::string &  functionGroup) const
virtual

Returns true if this function group is not already in control of something.

virtual bool makVrv::DtJoystickFunctionEnableHandler::eventActive ( DtGenericControllerEvent sdlEvent) const
virtual

Returns true if this event is active in any game processor.

virtual bool makVrv::DtJoystickFunctionEnableHandler::canProcessEvent ( DtGenericControllerEvent sdlEvent) const
virtual

Returns true if the event can be processed by any of the game processors.

Reimplemented from makVrv::DtGameControllerEventHandler.

virtual bool makVrv::DtJoystickFunctionEnableHandler::anyFunctionGroupsActive ( ) const
virtual

Returns true if there are any function groups active.

virtual void makVrv::DtJoystickFunctionEnableHandler::releaseAllControllerInformation ( )
virtual

Releases control of all used configuration and function groups.

virtual bool makVrv::DtJoystickFunctionEnableHandler::filterGameControllerEvent ( DtGenericControllerEvent )
protectedvirtual

Return true to filter this Game controller Event.

Reimplemented from makVrv::DtGameControllerEventHandler.

virtual bool makVrv::DtJoystickFunctionEnableHandler::isFunctionGroupActive ( const std::string &  configuration,
const std::string &   
) const
protectedvirtual

Returns true if this function group is active. This will return true if any function within the group is active.

virtual void makVrv::DtJoystickFunctionEnableHandler::activateFunctionGroup ( const std::string &  configuration,
const std::string &   
)
protectedvirtual

Will activate all functions within the function group.

virtual void makVrv::DtJoystickFunctionEnableHandler::deactivateFunctionGroup ( const std::string &  configuration,
const std::string &   
)
protectedvirtual

Will deactivate all functions within the function group.

virtual void makVrv::DtJoystickFunctionEnableHandler::switchControlOfFunction ( const std::string &  configuration,
const std::string &  functionGroup 
)
protectedvirtual
virtual void makVrv::DtJoystickFunctionEnableHandler::noQueuedEvents ( )
protectedvirtual

Called when there were events but now there are no longer queued events.

Reimplemented from makVrv::DtGameControllerEventHandler.

virtual void makVrv::DtJoystickFunctionEnableHandler::gameControlInformationAdded ( const std::string &  configuration,
const std::string &  functionGroup,
const std::string &  function,
const DtGameControlInformation i 
)
protectedvirtual

Called when game controller information is added or updated for the given configuration, function group and function.

Update game control information if controlled

Reimplemented from makVrv::DtGameControllerEventHandler.

virtual bool makVrv::DtJoystickFunctionEnableHandler::joystickFunctionFired ( const std::string &  functionGroup,
const std::string &  function,
double  value,
bool  repeat,
bool  valueChanged 
)
protectedpure virtual

Called when a game control processor fires off.

Implement this to do something with the given function group, function and value of the processor. Return false to continue to look for another handler which might implement this event. Value changed will be true if the value has changed from the last period

Implemented in makVrf::DtVrfGuiJoystickControlHandler, and makVrv::DtJoystickObserverControl.

Member Data Documentation

ControlledDevices makVrv::DtJoystickFunctionEnableHandler::myControlledDevices
protected
InControlOf makVrv::DtJoystickFunctionEnableHandler::myInControlOf
protected
DtJoystickManager& makVrv::DtJoystickFunctionEnableHandler::myJoystickManager
protected
DtSignalConnectionManager makVrv::DtJoystickFunctionEnableHandler::myConnections
protected
LastJoystickAxisValue makVrv::DtJoystickFunctionEnableHandler::myLastJoystickAxisValue
protected
RepeatQueue makVrv::DtJoystickFunctionEnableHandler::myRepeatQueue
protected
DtDe& makVrv::DtJoystickFunctionEnableHandler::myDe
protected

The documentation for this class was generated from the following file:

Document ID: Generated on Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (www.mak.com)