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

The manager for owning key maps. More...

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

Public Types

enum  FunctionCategory {
  Movement, Rotation, Orbit, Camera,
  Attachment, Gain, Rendering, Display,
  Miscellaneous, UserDefined = 100
}
typedef std::map
< FunctionCategory, DtUnicode
FunctionCategories
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 DtKeyMapcreateKeyMap (const std::string &mapName, bool silent=false)
 create and return a key map
virtual DtKeyMapcloneKeyMap (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 DtKeyMapfindKeyMap (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.
DtKeyMaploadKeyMapFromFile (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 DtSettingsBackupsettingsBackup (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 KeyMapCatalogkeyMapCatalog () const
 get the catalog of key maps maintained by this manager
virtual const CategoryMapcategoryMap () const
virtual const CategoryMapbinaryCategoryMap () const
const BinaryFunctionNameMapbinaryDownMap () const
 Get the map of binary functions to associated down functions.
const BinaryFunctionNameMapbinaryUpMap () 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.
virtual void addFunctionCategory (FunctionCategory, const DtUnicode &functionCategoryName)
 Adds a new function category into the key map system.
virtual DtUnicode functionCategoryName (FunctionCategory) const
 Returns the text for the particular category or "Unknown" if not present.
virtual const FunctionCategoriesfunctionCategories () const
 Returns current map of function categories.
DtDede ()
 Returns the de associated with the manager.
- Public Member Functions inherited from makVrv::DtVirtualBaseClass
 DtVirtualBaseClass ()
 Do nothing constructor.
virtual ~DtVirtualBaseClass ()
 Virtual do nothing destructor.

Static Public Member Functions

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

Protected Member Functions

 DtKeyMapManager (DtDe &de)
 CTOR.
void invokeKeyFunctions (const DtKeyFunctionNameList &funcsToUse)
virtual DtKeyMapSettingsBackupcreateBackupFor (const std::string &, const std::string &factoryFile="")
 Creates a backup object, if does not exist, for the given key map object caller is then responsible for calling back up on the resulting object.

Protected Attributes

DtDemyDe
std::string myCurrentMap
KeyMapCatalog myKeyMapCatalog
KeyFunctionMap myKeyFunctionMap
BinaryFunctionNameMap myBinaryKeyFunctionUpMap
BinaryFunctionNameMap myBinaryKeyFunctionDownMap
CategoryMap myCategoryMap
CategoryMap myBinaryCategoryMap
BackupMap myBackupObjects
FunctionCategories myFunctionCategories

Friends

class DtKeyMapBackupAsync

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 
UserDefined 

Constructor & Destructor Documentation

virtual makVrv::DtKeyMapManager::~DtKeyMapManager ( )
virtual

virtual DTOR

makVrv::DtKeyMapManager::DtKeyMapManager ( DtDe de)
protected

CTOR.

Member Function Documentation

static DtKeyMapManager& makVrv::DtKeyMapManager::instance ( DtDe de)
static

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

bool makVrv::DtKeyMapManager::saveKeyMap ( const DtKeyMap keyMap) const

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
const BinaryFunctionNameMap& makVrv::DtKeyMapManager::binaryDownMap ( ) const

Get the map of binary functions to associated down functions.

const BinaryFunctionNameMap& makVrv::DtKeyMapManager::binaryUpMap ( ) const

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.

virtual void makVrv::DtKeyMapManager::addFunctionCategory ( FunctionCategory  ,
const DtUnicode functionCategoryName 
)
virtual

Adds a new function category into the key map system.

These function categories can be used to classify keymap functions and extend the functions available. These functions will appear on the key mapping widget. To add new functions use the UserDefined function category as a base. Adding existing function categories will simply rename the exising categories

virtual DtUnicode makVrv::DtKeyMapManager::functionCategoryName ( FunctionCategory  ) const
virtual

Returns the text for the particular category or "Unknown" if not present.

virtual const FunctionCategories& makVrv::DtKeyMapManager::functionCategories ( ) const
virtual

Returns current map of function categories.

DtDe& makVrv::DtKeyMapManager::de ( )

Returns the de associated with the manager.

Used by DtKeyMap to get at the signaler to signal when key bindings have changed

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

Creates a backup object, if does not exist, for the given key map object caller is then responsible for calling back up on the resulting object.

Friends And Related Function Documentation

friend class DtKeyMapBackupAsync
friend

Member Data Documentation

DtDe& makVrv::DtKeyMapManager::myDe
protected
std::string makVrv::DtKeyMapManager::myCurrentMap
protected
KeyMapCatalog makVrv::DtKeyMapManager::myKeyMapCatalog
protected
KeyFunctionMap makVrv::DtKeyMapManager::myKeyFunctionMap
protected
BinaryFunctionNameMap makVrv::DtKeyMapManager::myBinaryKeyFunctionUpMap
protected
BinaryFunctionNameMap makVrv::DtKeyMapManager::myBinaryKeyFunctionDownMap
protected
CategoryMap makVrv::DtKeyMapManager::myCategoryMap
protected
CategoryMap makVrv::DtKeyMapManager::myBinaryCategoryMap
protected
BackupMap makVrv::DtKeyMapManager::myBackupObjects
protected
FunctionCategories makVrv::DtKeyMapManager::myFunctionCategories
protected

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

Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (www.mak.com)