#include <OgreHapticsSystem.h>
Public Types | |
typedef std::vector< DynLib * > | PluginLibList |
typedef std::vector< Plugin * > | PluginInstanceList |
Public Member Functions | |
System (const String &pluginsFileName="HapticsPlugins.cfg", const String &configFileName="OgreHaptics.cfg", const String &logFileName="OgreHaptics.log") | |
Constructor. | |
virtual | ~System () |
Virtual destructor. | |
Device * | initialise (bool autoCreateDevice) |
Initialises the system. | |
void | shutdown (void) |
Shuts down the system manually. | |
bool | isInitialised (void) const |
Returns whether the system is initialised or not. | |
void | saveConfig (void) |
Saves the details of the current configuration. | |
bool | restoreConfig (void) |
Restores configuration from previously saved settings. | |
bool | showConfigDialog (void) |
Displays a dialog asking the user to choose config settings. | |
void | setConfigSettings (const DeviceInitInfo &configSettings) |
Sets the configuration settings which will be used for automatically creating a device during initialisation. | |
const DeviceInitInfo & | getConfigSettings (void) const |
Returns the configuration settings used for automatically creating a device during initialisation. | |
bool | setOption (const String &key, const void *value) |
Method for setting a specific option of the system. | |
bool | getOption (const String &key, void *value) |
Gets the specified option for the System. | |
Log * | getLog (void) |
Returns a pointer to the log used by OgreHaptics. | |
void | logMessage (const String &message, LogMessageLevel lml=LML_NORMAL, bool maskDebug=false) |
Log a message to the log used by OgreHaptics. | |
Log::Stream | logStream (LogMessageLevel lml=LML_NORMAL, bool maskDebug=false) |
Get a stream on the log used by OgreHaptics. | |
void | loadPlugin (const String &pluginName) |
Manually load a Plugin contained in a DLL / DSO. | |
void | unloadPlugin (const String &pluginName) |
Manually unloads a Plugin contained in a DLL / DSO. | |
void | installPlugin (Plugin *plugin) |
Install a new Plugin. | |
void | uninstallPlugin (Plugin *plugin) |
Uninstall an existing plugin. | |
const PluginInstanceList & | getInstalledPlugins () const |
Gets a read-only list of the currently installed plugins. | |
void | addRenderSystem (RenderSystem *newRend) |
Adds a new rendering subsystem to the list of available rendering systems. | |
RenderSystem * | getRenderSystemByName (const String &name) |
Retrieve a pointer to the rendering system by the given name or by the name of the API the RenderSystem supports. | |
RenderSystemList * | getAvailableRenderSystems (void) |
Retrieve a list of the available render systems. | |
const DeviceInfoList & | getAvailableNamedDevices (void) const |
Obtains an iterator over all haptics devices available on the users system supported through loaded Plugins. | |
unsigned int | getNumConnectedDevices (void) |
Returns the total number of available devices on all registered render systems. | |
Device * | createDevice (const String &name, const DeviceInitInfo &initInfo) |
Creates a new named Device. | |
Device * | createDevice (const String &name, unsigned int index, DeviceInitInfo &initInfo) |
Creates a new named Device. | |
Device * | getDevice (const String &name) |
Retrieves a pointer to a named Device. | |
void | destroyDevice (const String &name) |
Destroys a named device. | |
void | destroyDevice (Device *device) |
Destroys the given Device. | |
void | destroyAllDevices (void) |
Removes and destroys all devices created through the registered rendering systems. | |
ConstDeviceIterator | getDeviceIterator (void) const |
Returns a specialised Ogre::ConstDeviceIterator on all devices created by all registered rendering systems. | |
void | startSchedulers (unsigned long rate=1000, bool autoEnableDevices=true) |
Starts all schedulers used to manage the haptic threads of all registered render systems. | |
void | stopSchedulers (void) |
Stops the schedulers used by the registered rendering systems. | |
void | update (void) |
Updates all devices managed by the registered render systems. | |
void | _oneTimePostDeviceCreate (void) |
Operation for one time task to be performed after device creation. | |
Static Public Member Functions | |
static System & | getSingleton (void) |
Override standard Ogre::Singleton retrieval. | |
static System * | getSingletonPtr (void) |
Override standard Ogre::Singleton retrieval. | |
Protected Member Functions | |
void | loadPlugins (const String &pluginsFileName="HapticsPlugins.cfg") |
Method reads a plugins configuration file and instantiates all plugins. | |
void | initialisePlugins (void) |
Initialise all loaded plugins - allows plugins to perform actions once the system has been initialised. | |
void | shutdownPlugins (void) |
Shuts down all loaded plugins - allows things to be tidied up whilst all plugins are still loaded. | |
void | unloadPlugins (void) |
Unloads all loaded plugins. | |
Protected Attributes | |
OGREHAPTICS_AUTO_MUTEX bool | mIsInitialised |
Private mutex, not allowed to lock from outside. | |
bool | mFirstTimePostDeviceCreate |
Is the initialisation of subsystems done after the first device. | |
String | mConfigFileName |
Name of the haptics configuration file to be used. | |
DeviceInitInfo | mConfigSettings |
DeviceInfo structure holding information about the device to create. | |
PluginLibList | mPluginLibs |
List of Plugin DLLs loaded. | |
PluginInstanceList | mPlugins |
List of Plugin instances registered. |
It is the first class that must be instantiated and the last class that must be cleaned up.
Definition at line 80 of file OgreHapticsSystem.h.
typedef std::vector<DynLib*> OgreHaptics::System::PluginLibList |
Definition at line 300 of file OgreHapticsSystem.h.
typedef std::vector<Plugin*> OgreHaptics::System::PluginInstanceList |
Definition at line 301 of file OgreHapticsSystem.h.
OgreHaptics::System::System | ( | const String & | pluginsFileName = "HapticsPlugins.cfg" , |
|
const String & | configFileName = "OgreHaptics.cfg" , |
|||
const String & | logFileName = "OgreHaptics.log" | |||
) |
Constructor.
pluginsFileName | The file that contains plugins information, defaults to 'HapticsPlugins.cfg'. | |
configFileName | The file the contains configuration settings for creating and setting up a device instance. | |
logFileName | The logfile to be used by OgreHaptics, defaults to 'OgreHaptics.log'. If this is left blank, the default log of OGRE will be used for logging. |
virtual OgreHaptics::System::~System | ( | ) | [virtual] |
Virtual destructor.
static System& OgreHaptics::System::getSingleton | ( | void | ) | [static] |
Override standard Ogre::Singleton retrieval.
static System* OgreHaptics::System::getSingletonPtr | ( | void | ) | [static] |
Override standard Ogre::Singleton retrieval.
Device* OgreHaptics::System::initialise | ( | bool | autoCreateDevice | ) |
Initialises the system.
autoCreateDevice | If set to true, a device will be created automatically. To make use of this, System::setConfigSettings must have been called first. |
NULL
otherwise. void OgreHaptics::System::shutdown | ( | void | ) |
Shuts down the system manually.
bool OgreHaptics::System::isInitialised | ( | void | ) | const |
Returns whether the system is initialised or not.
Definition at line 152 of file OgreHapticsSystem.h.
void OgreHaptics::System::saveConfig | ( | void | ) |
Saves the details of the current configuration.
bool OgreHaptics::System::restoreConfig | ( | void | ) |
Restores configuration from previously saved settings.
true
if a valid configuration was found, false
otherwise. bool OgreHaptics::System::showConfigDialog | ( | void | ) |
Displays a dialog asking the user to choose config settings.
true
will be returned false
otherwise. void OgreHaptics::System::setConfigSettings | ( | const DeviceInitInfo & | configSettings | ) |
Sets the configuration settings which will be used for automatically creating a device during initialisation.
const DeviceInitInfo& OgreHaptics::System::getConfigSettings | ( | void | ) | const |
Returns the configuration settings used for automatically creating a device during initialisation.
Definition at line 193 of file OgreHapticsSystem.h.
bool OgreHaptics::System::setOption | ( | const String & | key, | |
const void * | value | |||
) |
Method for setting a specific option of the system.
These options are usually specific to the platform the system is running on.
key | The name of the option to set | |
value | A pointer to the value |
true
if the option was successfully set, false
otherwise. bool OgreHaptics::System::getOption | ( | const String & | key, | |
void * | value | |||
) |
Gets the specified option for the System.
true
if the option was successfully retrieved, false
otherwise. Log* OgreHaptics::System::getLog | ( | void | ) |
Returns a pointer to the log used by OgreHaptics.
Definition at line 251 of file OgreHapticsSystem.h.
void OgreHaptics::System::logMessage | ( | const String & | message, | |
LogMessageLevel | lml = LML_NORMAL , |
|||
bool | maskDebug = false | |||
) |
Log a message to the log used by OgreHaptics.
Log::Stream OgreHaptics::System::logStream | ( | LogMessageLevel | lml = LML_NORMAL , |
|
bool | maskDebug = false | |||
) |
Get a stream on the log used by OgreHaptics.
void OgreHaptics::System::loadPlugin | ( | const String & | pluginName | ) |
Manually load a Plugin contained in a DLL / DSO.
pluginName | Name of the plugin library to load |
Ogre::Exception | if dllStartPlugin has not been implemented. |
void OgreHaptics::System::unloadPlugin | ( | const String & | pluginName | ) |
Manually unloads a Plugin contained in a DLL / DSO.
pluginName | Name of the plugin library to unload |
void OgreHaptics::System::installPlugin | ( | Plugin * | plugin | ) |
Install a new Plugin.
void OgreHaptics::System::uninstallPlugin | ( | Plugin * | plugin | ) |
Uninstall an existing plugin.
const PluginInstanceList& OgreHaptics::System::getInstalledPlugins | ( | ) | const |
Gets a read-only list of the currently installed plugins.
Definition at line 304 of file OgreHapticsSystem.h.
void OgreHaptics::System::addRenderSystem | ( | RenderSystem * | newRend | ) |
Adds a new rendering subsystem to the list of available rendering systems.
RenderSystem* OgreHaptics::System::getRenderSystemByName | ( | const String & | name | ) |
Retrieve a pointer to the rendering system by the given name or by the name of the API the RenderSystem supports.
name | Name of the rendering system intend to retrieve. |
NULL
if no found. RenderSystemList* OgreHaptics::System::getAvailableRenderSystems | ( | void | ) |
Retrieve a list of the available render systems.
const DeviceInfoList& OgreHaptics::System::getAvailableNamedDevices | ( | void | ) | const |
Obtains an iterator over all haptics devices available on the users system supported through loaded Plugins.
Ogre::Exception |
unsigned int OgreHaptics::System::getNumConnectedDevices | ( | void | ) |
Returns the total number of available devices on all registered render systems.
Device* OgreHaptics::System::createDevice | ( | const String & | name, | |
const DeviceInitInfo & | initInfo | |||
) |
Creates a new named Device.
name | The name of the Device to create. | |
initInfo | Structure holding initialisation data, such as the underlying API to use for instantation and the name to be used for initialisation. |
A | DuplicateItemException if a device with the initName or index specified already exists. |
Device* OgreHaptics::System::createDevice | ( | const String & | name, | |
unsigned int | index, | |||
DeviceInitInfo & | initInfo | |||
) |
Creates a new named Device.
name | The name of the Device to create. | |
index | The zero-based API specific index to identify the device to instantiate. | |
initInfo | Structure holding initialisation data, such as the underlying API to use for instantation and the name to be used for initialisation. The initName property of this structure will be ignored and modified to reflect the actual initName used. |
A | DuplicateItemException if a device with the initName or index specified already exists. |
Device* OgreHaptics::System::getDevice | ( | const String & | name | ) |
Retrieves a pointer to a named Device.
name | The name of the device to retrieve. |
ItemNotFoundException | if no Device could be found. |
void OgreHaptics::System::destroyDevice | ( | const String & | name | ) |
Destroys a named device.
name | The name of the device to be destroyed. |
void OgreHaptics::System::destroyAllDevices | ( | void | ) |
Removes and destroys all devices created through the registered rendering systems.
ConstDeviceIterator OgreHaptics::System::getDeviceIterator | ( | void | ) | const |
Returns a specialised Ogre::ConstDeviceIterator on all devices created by all registered rendering systems.
void OgreHaptics::System::startSchedulers | ( | unsigned long | rate = 1000 , |
|
bool | autoEnableDevices = true | |||
) |
Starts all schedulers used to manage the haptic threads of all registered render systems.
true
all devices managed by the rendering systems will be enabled, including those that have been disabled manually. An update frequency of 1 kHz is typical for most haptic applications. rate | The rate of the scheduler in Hertz. | |
autoEnableDevices | Specifies whether or not the devices should be enabled automatically. |
An | Exception if a scheduler has already been started. |
void OgreHaptics::System::stopSchedulers | ( | void | ) |
void OgreHaptics::System::update | ( | void | ) |
void OgreHaptics::System::_oneTimePostDeviceCreate | ( | void | ) |
Operation for one time task to be performed after device creation.
void OgreHaptics::System::loadPlugins | ( | const String & | pluginsFileName = "HapticsPlugins.cfg" |
) | [protected] |
Method reads a plugins configuration file and instantiates all plugins.
pluginsFileName | The name of the file that contains plugin information, defaults to 'HapticsPlugins.cfg'. |
void OgreHaptics::System::initialisePlugins | ( | void | ) | [protected] |
Initialise all loaded plugins - allows plugins to perform actions once the system has been initialised.
void OgreHaptics::System::shutdownPlugins | ( | void | ) | [protected] |
Shuts down all loaded plugins - allows things to be tidied up whilst all plugins are still loaded.
void OgreHaptics::System::unloadPlugins | ( | void | ) | [protected] |
Unloads all loaded plugins.
OGREHAPTICS_AUTO_MUTEX bool OgreHaptics::System::mIsInitialised [protected] |
Private mutex, not allowed to lock from outside.
Are we initialised yet?
Definition at line 473 of file OgreHapticsSystem.h.
bool OgreHaptics::System::mFirstTimePostDeviceCreate [protected] |
Is the initialisation of subsystems done after the first device.
has been created?
Definition at line 476 of file OgreHapticsSystem.h.
String OgreHaptics::System::mConfigFileName [protected] |
Name of the haptics configuration file to be used.
Definition at line 478 of file OgreHapticsSystem.h.
DeviceInitInfo OgreHaptics::System::mConfigSettings [protected] |
DeviceInfo structure holding information about the device to create.
Definition at line 480 of file OgreHapticsSystem.h.
PluginLibList OgreHaptics::System::mPluginLibs [protected] |
PluginInstanceList OgreHaptics::System::mPlugins [protected] |
Last modified Tue Jan 6 22:31:27 2009