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

DtObserverModeManager is responsible for loading and saving observer modes, and providing a mechanism to look up observer mode information by observer mode ID. More...

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

List of all members.

Public Types

typedef std::map< int,
DtObserverMode
ObserverModes
 Type returned when retrieving all observer modes.

Public Member Functions

virtual ~DtObserverModeManager ()
 DTOR.
const ObserverModesobserverModes () const
 Accessor for the map of observer modes.
int numberOfObserverModes () const
 get the number of Observer Modes
virtual int createObserverMode (const std::string &stringKey, const std::string &displayName)
 Add a observer mode.
virtual int createIntKey (const std::string &stringKey)
 Get a key without adding the observer to the manager.
virtual void removeObserverMode (int mode)
 Remove a observer mode.
int lookupObserverModeIntKey (std::string stringKey) const
 Looks up the int key for the observer mode with the given name.
const std::string * findObserverModeStringKey (int intKey) const
 Find the observer mode string for a int key.
bool getObserverModeById (int intKey, DtObserverMode &result) const
 Get a observer mode.
bool getObserverModeByName (const std::string &observerModeName, DtObserverMode &result)
 Gets a reference to the observer mode with the given name.
std::string name (int intKey) const
 Get the observer mode's display name.
void setName (int intKey, const std::string &name)
 Set the observer mode's display name.
int modelSet (int intKey) const
 get the model set for the specified mode
void setModelSet (int intKey, int modelSet)
 This specifies the model set for the indicated observer mode.
std::string keyMap (int intKey) const
 get the key map for the specified mode
void setKeyMap (int intKey, const std::string &keyMap)
 This specifies the key map for the indicated observer mode.
void setIs2D (int intKey, bool trueOrFalse)
 Set if the observer mode is 2D or not (3D)
bool is2D (int intKey) const
 Get if the observer mode is 2D.
void setGainPrecision (int intKey, int precision)
 Set the observer mode's gain precision.
int gainPrecision (int intKey) const
 Get the observer mode's gain precision.
void setModelScaleFactor (int intKey, double modelScaleFactor)
 Set the observer mode's model scale factor.
double modelScaleFactor (int intKey) const
 Get the observer mode's model scale factor.
void setModelScaleType (int intKey, DtObserverObject::ScaleType modelScaleType)
 Set the observer mode's model scale type.
DtObserverObject::ScaleType modelScaleType (int intKey) const
 Get the observer mode's model scale type.
void setMaxModelScaleFactor (int intKey, double maxModelScaleFactor)
 Set the observer mode's max XR model scale factor.
double maxModelScaleFactor (int intKey) const
 Get the observer mode's max XR model scale factor.
void setMaxLinearModelScaleFactor (int intKey, double maxLinearModelScaleFactor)
 Set the observer mode's max Linear model scale factor.
double maxLinearModelScaleFactor (int intKey) const
 Get the observer mode's max XR model scale factor.
void setOrbitSpeedGain (int intKey, int gain)
 Set the default orbit speed gain.
int orbitSpeedGain (int intKey) const
 Get the default orbit speed gain.
void setLinearScaledSpeedGain (int intKey, int gain)
 Set the default linear scaled speed gain.
int linearScaledSpeedGain (int intKey) const
 Get the default linear scaled speed gain.
void setLinearUnscaledSpeedGain (int intKey, int gain)
 Set the default linear unscaled speed gain.
int linearUnscaledSpeedGain (int intKey) const
 Get the default linear unscaled speed gain.
void setRotationSpeedGain (int intKey, int gain)
 Get and set the default rotation speed gain.
int rotationSpeedGain (int intKey) const
 Get and set the default rotation speed gain.
void setObserverSetting (int intKey, int settingKey, bool val)
 Set whether the given observer setting is enabled or not.
bool observerSetting (int intKey, int settingKey) const
 Get whether the given observer setting is enabled for not.
Setting Persistence Methods
virtual void loadDefaultSettings (bool loadOnlyDefaultSettings)
 Load the default settings.
virtual void loadDefaultSettings (bool loadOnlyDefaultSettings, bool merge)
 Load the default settings and merge if necessary.
virtual void importSettings (const std::string &filepath, bool merge)
 Import settings from the file and merge if necessary.
virtual void exportObserverMode (int intKey, const std::string &filepath) const
 Export the specified observer mode to the named file.
virtual void setFromRecord (const makArchives::DtObserverModesRecord &record)
 Use the settings from the given settings record.
virtual void setFromRecord (const makArchives::DtObserverModesRecord &record, bool merge)
 Sets or merges the current settings with the given settings record.
virtual void setObserverModeFromRecord (const makArchives::DtObserverModesRecord &record, int intKey)
 Use the observer mode settings from the given record.
virtual void getRecord (makArchives::DtObserverModesRecord &record) const
 Populate the given record with the current settings.

Static Public Member Functions

static DtObserverModeManagerinstance (DtDe &de)
 Get an instance used to emit, or to connect.

Public Attributes

boost::signal< void(int)> observerModeKeyMapChanged
 signal that the indicated observer mode's key map changed
boost::signal< void(int)> observerModeModelSetChanged
 signal that the indicated observer mode's model set changed
boost::signal< void(int)> observerModeIs2DChanged
boost::signal< void(int)> observerModeNameChanged
 signal that the indicated observer mode's name changed
boost::signal< void(int, int,
bool)> 
observerModeSettingChanged
 signal that the indicated observer mode's setting changed
boost::signal< void(int)> observerModeGainPrecisionChanged
 brief signal that the indicated observer mode's gain precision changed
boost::signal< void(int)> observerModeOrbitSpeedGainChanged
 brief signal that the indicated observer mode's orbit speed changed
boost::signal< void(int)> observerModeRotationSpeedGainChanged
 brief signal that the indicated observer mode's rotation speed changed
boost::signal< void(int)> observerModeLinearScaledSpeedGainChanged
 brief signal that the indicated observer mode's scaled linear speed changed
boost::signal< void(int)> observerModeLinearUnscaledSpeedGainChanged
 brief signal that the indicated observer mode's scaled linear speed changed
boost::signal< void(int)> observerModeModelScaleFactorChanged
 brief signal that the indicated observer mode's model scale factor changed
boost::signal< void(int)> observerModeModelScaleTypeChanged
 brief signal that the indicated observer mode's model scale type changed
boost::signal< void(int)> observerModeMaxModelScaleFactorChanged
 brief signal that the indicated observer mode's max XR model scale factor changed
boost::signal< void(int)> observerModeMaxLinearModelScaleFactorChanged
 brief signal that the indicated observer mode's max linear model scale factor changed
boost::signal< void(int)> observerModeAdded
 signal that the indicated observer mode was added
boost::signal< void(int)> observerModeToBeRemoved
 signal that the indicated observer mode is about to be removed

Protected Types

typedef std::map< std::string,
int > 
ObserverModesMap
 Map type for mapping observer mode names to integer keys.

Protected Member Functions

 DtObserverModeManager (DtDe &)
 CTOR.
DtObserverModegetObserverModePtr (int intKey)
 Accessor for a pointer to the observer mode with the given key.
virtual void addObserverMode (const DtObserverMode &mode)
 Add an already filled out mode (such as one read from a file)
virtual void clear ()
 delete all the current visual modes

Protected Attributes

DtStringKeyConvertermyStringKeyConverter
ObserverModes myObserverModes
ObserverModesMap myObserverModesMap

Friends

class DtObserverModeManagerCreator
 Befriend the creator class so the manager can be instantiated properly.
template<typename ManagerClass >
ManagerClass & defaultManagerInstanceFunction (DtDe &, bool)
 Befriend the manager instance functions for instance retreival/creation.
template<typename ManagerClass >
void defaultManagerRegisterInstanceFunction (DtDe &, ManagerClass *)
 Befriend the manager instance functions for instance retreival/creation.

Detailed Description

DtObserverModeManager is responsible for loading and saving observer modes, and providing a mechanism to look up observer mode information by observer mode ID.


Member Typedef Documentation

Type returned when retrieving all observer modes.

typedef std::map<std::string,int> makVrv::DtObserverModeManager::ObserverModesMap [protected]

Map type for mapping observer mode names to integer keys.


Constructor & Destructor Documentation

DTOR.

CTOR.


Member Function Documentation

Get an instance used to emit, or to connect.

Accessor for the map of observer modes.

See also:
DtObserverModeManager::ObserverModes

get the number of Observer Modes

virtual int makVrv::DtObserverModeManager::createObserverMode ( const std::string &  stringKey,
const std::string &  displayName 
) [virtual]

Add a observer mode.

An intKey will be assigned. The user can then set the key map and model set to use. Returns the intKey assigned

virtual int makVrv::DtObserverModeManager::createIntKey ( const std::string &  stringKey) [virtual]

Get a key without adding the observer to the manager.

This is used by DtObserverMode::setFromRecord, and not recommended for general use.

virtual void makVrv::DtObserverModeManager::removeObserverMode ( int  mode) [virtual]

Remove a observer mode.

int makVrv::DtObserverModeManager::lookupObserverModeIntKey ( std::string  stringKey) const

Looks up the int key for the observer mode with the given name.

Returns:
-1 if no observer mode with the given name exists.
const std::string* makVrv::DtObserverModeManager::findObserverModeStringKey ( int  intKey) const

Find the observer mode string for a int key.

Get a observer mode.

bool makVrv::DtObserverModeManager::getObserverModeByName ( const std::string &  observerModeName,
DtObserverMode result 
)

Gets a reference to the observer mode with the given name.

The return value indicates whether the result reference was populated with the requested observer mode. If false, the result has been untouched.

Returns:
whether the reference passed in was populated with the mode.
std::string makVrv::DtObserverModeManager::name ( int  intKey) const

Get the observer mode's display name.

void makVrv::DtObserverModeManager::setName ( int  intKey,
const std::string &  name 
)

Set the observer mode's display name.

int makVrv::DtObserverModeManager::modelSet ( int  intKey) const

get the model set for the specified mode

void makVrv::DtObserverModeManager::setModelSet ( int  intKey,
int  modelSet 
)

This specifies the model set for the indicated observer mode.

std::string makVrv::DtObserverModeManager::keyMap ( int  intKey) const

get the key map for the specified mode

void makVrv::DtObserverModeManager::setKeyMap ( int  intKey,
const std::string &  keyMap 
)

This specifies the key map for the indicated observer mode.

void makVrv::DtObserverModeManager::setIs2D ( int  intKey,
bool  trueOrFalse 
)

Set if the observer mode is 2D or not (3D)

Get if the observer mode is 2D.

void makVrv::DtObserverModeManager::setGainPrecision ( int  intKey,
int  precision 
)

Set the observer mode's gain precision.

Get the observer mode's gain precision.

void makVrv::DtObserverModeManager::setModelScaleFactor ( int  intKey,
double  modelScaleFactor 
)

Set the observer mode's model scale factor.

Get the observer mode's model scale factor.

Set the observer mode's model scale type.

Get the observer mode's model scale type.

void makVrv::DtObserverModeManager::setMaxModelScaleFactor ( int  intKey,
double  maxModelScaleFactor 
)

Set the observer mode's max XR model scale factor.

Get the observer mode's max XR model scale factor.

void makVrv::DtObserverModeManager::setMaxLinearModelScaleFactor ( int  intKey,
double  maxLinearModelScaleFactor 
)

Set the observer mode's max Linear model scale factor.

Get the observer mode's max XR model scale factor.

void makVrv::DtObserverModeManager::setOrbitSpeedGain ( int  intKey,
int  gain 
)

Set the default orbit speed gain.

Get the default orbit speed gain.

void makVrv::DtObserverModeManager::setLinearScaledSpeedGain ( int  intKey,
int  gain 
)

Set the default linear scaled speed gain.

Get the default linear scaled speed gain.

void makVrv::DtObserverModeManager::setLinearUnscaledSpeedGain ( int  intKey,
int  gain 
)

Set the default linear unscaled speed gain.

Get the default linear unscaled speed gain.

void makVrv::DtObserverModeManager::setRotationSpeedGain ( int  intKey,
int  gain 
)

Get and set the default rotation speed gain.

Get and set the default rotation speed gain.

void makVrv::DtObserverModeManager::setObserverSetting ( int  intKey,
int  settingKey,
bool  val 
)

Set whether the given observer setting is enabled or not.

Parameters:
intKeythe key for the observer mode the setting belongs to.
settingKeythe key for the setting to be set.
valthe new enabled state for the setting.
bool makVrv::DtObserverModeManager::observerSetting ( int  intKey,
int  settingKey 
) const

Get whether the given observer setting is enabled for not.

Parameters:
intKeythe key for the observer mode the setting belongs to.
settingKeythe key for the setting to retrieve the state for.
Returns:
whether the given setting is enabled or not.
virtual void makVrv::DtObserverModeManager::loadDefaultSettings ( bool  loadOnlyDefaultSettings) [virtual]

Load the default settings.

Reimplemented from makVrv::DtCommonBaseSettingsManager< makArchives::DtObserverModesRecord >.

virtual void makVrv::DtObserverModeManager::loadDefaultSettings ( bool  loadOnlyDefaultSettings,
bool  merge 
) [virtual]

Load the default settings and merge if necessary.

virtual void makVrv::DtObserverModeManager::importSettings ( const std::string &  filepath,
bool  merge 
) [virtual]

Import settings from the file and merge if necessary.

virtual void makVrv::DtObserverModeManager::exportObserverMode ( int  intKey,
const std::string &  filepath 
) const [virtual]

Export the specified observer mode to the named file.

Use the settings from the given settings record.

Implements makVrv::DtBaseSettingsManager< makArchives::DtObserverModesRecord >.

virtual void makVrv::DtObserverModeManager::setFromRecord ( const makArchives::DtObserverModesRecord record,
bool  merge 
) [virtual]

Sets or merges the current settings with the given settings record.

If the merge parameter is false, the settings are cleared then the record settings are added (essentially a regular set). If the merge parameter is true, the settings are merged with the current settings.

virtual void makVrv::DtObserverModeManager::setObserverModeFromRecord ( const makArchives::DtObserverModesRecord record,
int  intKey 
) [virtual]

Use the observer mode settings from the given record.

Populate the given record with the current settings.

Implements makVrv::DtBaseSettingsManager< makArchives::DtObserverModesRecord >.

Accessor for a pointer to the observer mode with the given key.

Returns:
a pointer to the observer mode, or NULL if there isn't one.
virtual void makVrv::DtObserverModeManager::addObserverMode ( const DtObserverMode mode) [protected, virtual]

Add an already filled out mode (such as one read from a file)

Note that if the mode already exists, it overwrites it.

virtual void makVrv::DtObserverModeManager::clear ( ) [protected, virtual]

delete all the current visual modes


Friends And Related Function Documentation

friend class DtObserverModeManagerCreator [friend]

Befriend the creator class so the manager can be instantiated properly.

template<typename ManagerClass >
ManagerClass& defaultManagerInstanceFunction ( DtDe de,
bool  allowedInSlave 
) [friend]

Befriend the manager instance functions for instance retreival/creation.

Befriend the manager instance functions for instance retreival/creation.

Manager requirements: 1) Static instance function 2) Protected DtSignalConnectionManager named myConnections. 3) Member functioned called loadDefaults which takes no arguments. and loads the default settings of the manager or factory from disk. 4) define defaultManagerInstanceFunction as friend. 5) define defaultManagerRegisterInstanceFunction as friend (see below). 5) Protected Constructor which only takes a DtDe reference.

 class Manager
 {
 public:
    static Manager& instance(DtDe& de);
    void loadDefaults();
 protected:
    template <typename ManagerClass>
    friend ManagerClass& defaultManagerInstanceFunction(DtDe& de, bool);
    template <typename ManagerClass>
    friend void defaultManagerRegisterInstanceFunction(DtDe& de, ManagerClass* mgr)
    Manager(DtDe&);
    DtSignalConnectionManager myConnections;
 };

Then simply in the implementation of instance call defaultManagerInstanceFunction with the de object and return the return value.

 Manager& Manager::instance(DtDe& de)
 {
    return defaultManagerInstanceFunction<Manager>(de);
 }
template<typename ManagerClass >
void defaultManagerRegisterInstanceFunction ( DtDe de,
ManagerClass *  mgr 
) [friend]

Befriend the manager instance functions for instance retreival/creation.

Befriend the manager instance functions for instance retreival/creation.

 static void Manager::registerInstance(DtDe& de, Manager* mgr)
 {
    defaultManagerRegisterInstanceFunction(de,mgr);
 }
 ...else where call.
 // Assuming class NewManager : public Manager
 Manager::registerInstance(de,new NewManager(de));

Member Data Documentation

signal that the indicated observer mode's key map changed

signal that the indicated observer mode's model set changed

signal that the indicated observer mode's name changed

signal that the indicated observer mode's setting changed

brief signal that the indicated observer mode's gain precision changed

brief signal that the indicated observer mode's orbit speed changed

brief signal that the indicated observer mode's rotation speed changed

brief signal that the indicated observer mode's scaled linear speed changed

brief signal that the indicated observer mode's scaled linear speed changed

brief signal that the indicated observer mode's model scale factor changed

brief signal that the indicated observer mode's model scale type changed

brief signal that the indicated observer mode's max XR model scale factor changed

brief signal that the indicated observer mode's max linear model scale factor changed

signal that the indicated observer mode was added

signal that the indicated observer mode is about to be removed


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)