VR-Forces 4.0.4 Class Documentation
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
makVrv::DtKeyMapManager Class Reference

The manager for owning key maps. More...

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

List of all members.

Public Types

enum  FunctionCategory {
  Movement, Rotation, Orbit, Camera,
  Attachment, Gain, Rendering, Display,
  Miscellaneous
}
typedef std::map< std::string,
DtKeyMap * > 
KeyMapCatalog
typedef boost::function< void()> KeyFunction
typedef std::map< std::string,
KeyFunction > 
KeyFunctionMap
typedef std::map< std::string,
std::string > 
BinaryFunctionNameMap
typedef std::map< std::string,
DtSettingsBackup * > 
BackupMap
typedef std::list< std::string > CategoryList
 A list of all the functions in a given category.
typedef std::map
< FunctionCategory,
CategoryList * > 
CategoryMap
 A list of category lists.

Public Member Functions

virtual ~DtKeyMapManager ()
 virtual DTOR
virtual DtKeyMap * createKeyMap (const std::string &mapName, bool silent=false)
 create and return a key map
virtual DtKeyMap * cloneKeyMap (const std::string &mapName, const std::string &newMapName, bool silent=false)
 create and return a key map based on an existing key map
virtual void destroyKeyMap (const std::string &mapName, bool silent=false)
 Destroy a key map.
virtual DtKeyMap * findKeyMap (const std::string &mapName)
 look up a key map
bool saveKeyMap (const DtKeyMap &keyMap) const
 Saves the keymap to configuration directory based on key map name.
bool saveKeyMapToFile (const DtKeyMap &keyMap, const std::string &filename) const
 Save a key map to a file.
DtKeyMap * loadKeyMapFromFile (const std::string &filename, bool createBackup=false)
 Save a key map to a file.
virtual void setFromRecord (const std::string &keyMap, const makArchives::DtKeyMapRecord &rec)
 If key map exists, sets the key map from the record, else created a new one.
virtual DtSettingsBackup * settingsBackup (const std::string &keyMap) const
 Returns the settings backup for the specified key map.
virtual void categorizeKeyFunction (const std::string &functionName, FunctionCategory functionCategory)
 Add a key function to the specified category.
virtual void categorizeBinaryKeyFunction (const std::string &functionName, FunctionCategory functionCategory)
virtual void addKeyFunction (const std::string &functionName, const KeyFunction &function, FunctionCategory functionCategory, bool categorize=true)
 bind a function to string name that can be used in a key map (or binary function set)
KeyFunction findKeyFunction (const std::string &functionName) const
 look up the function bound to 'functionName'
void removeKeyFunction (const std::string &functionName)
 Removes a key function.
virtual const KeyMapCatalog & keyMapCatalog () const
 get the catalog of key maps maintained by this manager
virtual const CategoryMap & categoryMap () const
virtual const CategoryMap & binaryCategoryMap () const
const BinaryFunctionNameMap & binaryDownMap () const
 Get the map of binary functions to associated down functions.
const BinaryFunctionNameMap & binaryUpMap () const
 Get the map of binary functions to associated up functions.
virtual void addBinaryKeyFunction (const std::string &binaryName, const std::string &keyDownFunctionName, const KeyFunction &downFunction, const std::string &keyUpFuntionName, const KeyFunction &upFunction, FunctionCategory functionCategory)
 create a binary function set
virtual std::string lookupBinaryKeyFunctionName (DtKeyEvent::KeyEventType eventType, const std::string &binaryName) const
 find the function name bound to the up or down event (eventType) for a given binary function name
virtual bool processKeyEvent (const std::string &mapName, const DtKeyEvent &keyEvent)
 look up the map named, find the appropriate function(s) based on the keyEvent, and invoke
virtual void activateMap (const std::string &mapName)
 invoke the function(s) on a map's pre-function list
virtual void deactivateMap (const std::string &mapName)
 invoke the function(s) on a map's post-function list
virtual void setCurrentMap (const std::string &mapName)
virtual const std::string & currentMap () const
virtual void clear ()
 Clears all maps.

Static Public Member Functions

static DtKeyMapManager & instance (DtDe &de)
 Get an instance of the key map.

Protected Member Functions

 DtKeyMapManager (DtDe &de)
 CTOR.
void invokeKeyFunctions (const DtKeyFunctionNameList &funcsToUse)
virtual void createBackupFor (const std::string &, const std::string &factoryFile="")
 Creates a backup object, if does not exist, for the given key map object and backs it up.

Protected Attributes

DtDe & myDe
std::string myCurrentMap
KeyMapCatalog myKeyMapCatalog
KeyFunctionMap myKeyFunctionMap
BinaryFunctionNameMap myBinaryKeyFunctionUpMap
BinaryFunctionNameMap myBinaryKeyFunctionDownMap
CategoryMap myCategoryMap
CategoryMap myBinaryCategoryMap
BackupMap myBackupObjects

Detailed Description

The manager for owning key maps.

Examples

Member Typedef Documentation

typedef std::map<std::string, DtKeyMap*> makVrv::DtKeyMapManager::KeyMapCatalog
typedef boost::function< void ()> makVrv::DtKeyMapManager::KeyFunction
typedef std::map<std::string, KeyFunction> makVrv::DtKeyMapManager::KeyFunctionMap
typedef std::map<std::string, std::string> makVrv::DtKeyMapManager::BinaryFunctionNameMap
typedef std::map<std::string, DtSettingsBackup*> makVrv::DtKeyMapManager::BackupMap
typedef std::list<std::string> makVrv::DtKeyMapManager::CategoryList

A list of all the functions in a given category.

A list of category lists.

The key is the first item in the Category list


Member Enumeration Documentation

Enumerator:
Movement 
Rotation 
Orbit 
Camera 
Attachment 
Gain 
Rendering 
Display 
Miscellaneous 

Constructor & Destructor Documentation

virtual DTOR

CTOR.


Member Function Documentation

Get an instance of the key map.

virtual DtKeyMap* makVrv::DtKeyMapManager::createKeyMap ( const std::string &  mapName,
bool  silent = false 
) [virtual]

create and return a key map

virtual DtKeyMap* makVrv::DtKeyMapManager::cloneKeyMap ( const std::string &  mapName,
const std::string &  newMapName,
bool  silent = false 
) [virtual]

create and return a key map based on an existing key map

virtual void makVrv::DtKeyMapManager::destroyKeyMap ( const std::string &  mapName,
bool  silent = false 
) [virtual]

Destroy a key map.

virtual DtKeyMap* makVrv::DtKeyMapManager::findKeyMap ( const std::string &  mapName) [virtual]

look up a key map

Saves the keymap to configuration directory based on key map name.

bool makVrv::DtKeyMapManager::saveKeyMapToFile ( const DtKeyMap &  keyMap,
const std::string &  filename 
) const

Save a key map to a file.

DtKeyMap* makVrv::DtKeyMapManager::loadKeyMapFromFile ( const std::string &  filename,
bool  createBackup = false 
)

Save a key map to a file.

virtual void makVrv::DtKeyMapManager::setFromRecord ( const std::string &  keyMap,
const makArchives::DtKeyMapRecord &  rec 
) [virtual]

If key map exists, sets the key map from the record, else created a new one.

Emits created or updated signal depending on which it is

virtual DtSettingsBackup* makVrv::DtKeyMapManager::settingsBackup ( const std::string &  keyMap) const [virtual]

Returns the settings backup for the specified key map.

virtual void makVrv::DtKeyMapManager::categorizeKeyFunction ( const std::string &  functionName,
FunctionCategory  functionCategory 
) [virtual]

Add a key function to the specified category.

To ensure that all key functions appear in at least one category, the addKeyFunction and addBinaryKeyFunction require a category argument. Use this function to add a key function to additional categories. Categories are used for filtering functions on the Edit Key Map dialog.

virtual void makVrv::DtKeyMapManager::categorizeBinaryKeyFunction ( const std::string &  functionName,
FunctionCategory  functionCategory 
) [virtual]
virtual void makVrv::DtKeyMapManager::addKeyFunction ( const std::string &  functionName,
const KeyFunction &  function,
FunctionCategory  functionCategory,
bool  categorize = true 
) [virtual]

bind a function to string name that can be used in a key map (or binary function set)

KeyFunction makVrv::DtKeyMapManager::findKeyFunction ( const std::string &  functionName) const

look up the function bound to 'functionName'

void makVrv::DtKeyMapManager::removeKeyFunction ( const std::string &  functionName)

Removes a key function.

virtual const KeyMapCatalog& makVrv::DtKeyMapManager::keyMapCatalog ( ) const [virtual]

get the catalog of key maps maintained by this manager

virtual const CategoryMap& makVrv::DtKeyMapManager::categoryMap ( ) const [virtual]
virtual const CategoryMap& makVrv::DtKeyMapManager::binaryCategoryMap ( ) const [virtual]

Get the map of binary functions to associated down functions.

Get the map of binary functions to associated up functions.

virtual void makVrv::DtKeyMapManager::addBinaryKeyFunction ( const std::string &  binaryName,
const std::string &  keyDownFunctionName,
const KeyFunction &  downFunction,
const std::string &  keyUpFuntionName,
const KeyFunction &  upFunction,
FunctionCategory  functionCategory 
) [virtual]

create a binary function set

A binary function set binds a name to a pair of functions and function names that can then be associated with a key's down and up events

virtual std::string makVrv::DtKeyMapManager::lookupBinaryKeyFunctionName ( DtKeyEvent::KeyEventType  eventType,
const std::string &  binaryName 
) const [virtual]

find the function name bound to the up or down event (eventType) for a given binary function name

virtual bool makVrv::DtKeyMapManager::processKeyEvent ( const std::string &  mapName,
const DtKeyEvent &  keyEvent 
) [virtual]

look up the map named, find the appropriate function(s) based on the keyEvent, and invoke

virtual void makVrv::DtKeyMapManager::activateMap ( const std::string &  mapName) [virtual]

invoke the function(s) on a map's pre-function list

virtual void makVrv::DtKeyMapManager::deactivateMap ( const std::string &  mapName) [virtual]

invoke the function(s) on a map's post-function list

virtual void makVrv::DtKeyMapManager::setCurrentMap ( const std::string &  mapName) [virtual]
virtual const std::string& makVrv::DtKeyMapManager::currentMap ( ) const [virtual]
virtual void makVrv::DtKeyMapManager::clear ( ) [virtual]

Clears all maps.

void makVrv::DtKeyMapManager::invokeKeyFunctions ( const DtKeyFunctionNameList &  funcsToUse) [protected]
virtual void makVrv::DtKeyMapManager::createBackupFor ( const std::string &  ,
const std::string &  factoryFile = "" 
) [protected, virtual]

Creates a backup object, if does not exist, for the given key map object and backs it up.


Member Data Documentation

std::string makVrv::DtKeyMapManager::myCurrentMap [protected]

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

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)