#include <OgreHapticsRenderSystem.h>
Public Member Functions | |
RenderSystem () | |
Default constructor. | |
virtual | ~RenderSystem () |
Virtual destructor. | |
virtual const String & | getName (void) const =0 |
Returns the name of the rendering system. | |
virtual const String & | getDefaultDeviceInitName (void) const =0 |
Returns the name used for initialisation of the default device. | |
virtual const DeviceInfoList & | getAvailableNamedDevices (void)=0 |
Obtains a list of DeviceInfo entries describing all haptics devices available by a specific name on the users system supported through this RenderSystem. | |
virtual unsigned int | getNumConnectedDevices (void)=0 |
Returns the number of devices connected to the users machine. | |
Device * | _createDevice (const String &name, System *system, const DeviceInitInfo &info) |
Creates a new Device instance. | |
Device * | _createDevice (const String &name, unsigned int index, System *system, DeviceInitInfo &info) |
void | _destroyDevice (Device *device) |
Removes and destroys an instance of the Device class (internal use only). | |
virtual bool | setOption (const String &key, const void *value) |
Method for setting a specific option of the rendering system. | |
virtual bool | getOption (const String &key, void *value) |
Gets the specified option for the System. | |
virtual void | startScheduler (unsigned long rate=1000, bool autoEnableDevices=true)=0 |
Starts the scheduler used for managing the haptic thread of the rendering system. | |
virtual void | stopScheduler (bool autoDisableDevices=true)=0 |
Stops the scheduler used by the rendering system. | |
bool | isSchedulerStarted (void) const |
Returns whether the scheduler of the haptics rendering system has been started or not. | |
unsigned long | getSetSchedulerRate (void) const |
Returns the rate of the scheduler as set in startScheduler. | |
Timer * | getTimer (void) const |
Returns a pointer to the timer used by the rendering system. | |
virtual void | _scheduleSynchronousCallback (SchedulerCallback callback, void *params)=0 |
Schedules a synchronous callback to be executed from the haptic thread. | |
virtual short | _scheduleAsynchronousCallback (SchedulerCallback callback, void *params)=0 |
Scheduls an asynchronous callback to be executed from the haptic thread. | |
virtual void | _unscheduleAsynchronousCallback (short id)=0 |
Unschedules a previously scheduled asynchronous callback. | |
virtual String | getErrorDescription (long errorNumber) const =0 |
Returns a description of an error code. | |
Protected Member Functions | |
virtual Device * | createDeviceImpl (const String &name, const DeviceInitInfo &initInfo)=0 |
Internal implementation of create method. | |
virtual Device * | createDeviceImpl (const String &name, unsigned int index, const DeviceInitInfo &initInfo)=0 |
Internal implementation of create method. | |
virtual String | getInitNameByIndex (unsigned int index)=0 |
Internal method to obtain the initialisation name based on the given zero-based index. | |
virtual void | initConfigOptions (DeviceInitInfo &info)=0 |
virtual void | _notifyThreadAffinityChanged (void)=0 |
Notifies devices created through a subclass of the RenderSystem class the thread affinity mask has been changed. | |
Protected Attributes | |
Timer * | mTimer |
Pointer to the timer used for timings in this rendering system. | |
bool | mIsSchedulerStarted |
Has the scheduler of the haptics rendering system been started? | |
unsigned long | mSetSchedulerRate |
The scheduler rate as set when started. | |
bool | mAvailableDevicesDirty |
Has the list of available devices been build? | |
DeviceInfoList | mAvailableDevices |
List of available devices. | |
DeviceMap | mDevices |
List of devices created through the rendering system. | |
DWORD | mThreadAffinityMask |
The thread affinity mask used by the scheduler of the rendering system. | |
Static Protected Attributes | |
static short | msNextAsynchronousCallbackID |
The next callback ID. |
Definition at line 49 of file OgreHapticsRenderSystem.h.
OgreHaptics::RenderSystem::RenderSystem | ( | ) |
Default constructor.
virtual OgreHaptics::RenderSystem::~RenderSystem | ( | ) | [virtual] |
Virtual destructor.
virtual const String& OgreHaptics::RenderSystem::getName | ( | void | ) | const [pure virtual] |
Returns the name of the rendering system.
virtual const String& OgreHaptics::RenderSystem::getDefaultDeviceInitName | ( | void | ) | const [pure virtual] |
Returns the name used for initialisation of the default device.
virtual const DeviceInfoList& OgreHaptics::RenderSystem::getAvailableNamedDevices | ( | void | ) | [pure virtual] |
Obtains a list of DeviceInfo entries describing all haptics devices available by a specific name on the users system supported through this RenderSystem.
virtual unsigned int OgreHaptics::RenderSystem::getNumConnectedDevices | ( | void | ) | [pure virtual] |
Returns the number of devices connected to the users machine.
Device* OgreHaptics::RenderSystem::_createDevice | ( | const String & | name, | |
System * | system, | |||
const DeviceInitInfo & | info | |||
) |
Creates a new Device instance.
info | A DeviceInfo struct, which is obtained through getAvailableNamedDevices, specifying the parameters needed for the creation and initialisation of the device. | |
index | The index of the device to initialise. Will override the initName of the info struct if larger than 0. |
A | DuplicateItemException if a device with the initName or index specified already exists. |
Device* OgreHaptics::RenderSystem::_createDevice | ( | const String & | name, | |
unsigned int | index, | |||
System * | system, | |||
DeviceInitInfo & | info | |||
) |
void OgreHaptics::RenderSystem::_destroyDevice | ( | Device * | device | ) |
Removes and destroys an instance of the Device class (internal use only).
virtual bool OgreHaptics::RenderSystem::setOption | ( | const String & | key, | |
const void * | value | |||
) | [virtual] |
Method for setting a specific option of the rendering 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. virtual bool OgreHaptics::RenderSystem::getOption | ( | const String & | key, | |
void * | value | |||
) | [virtual] |
Gets the specified option for the System.
true
if the option was successfully retrieved, false
otherwise. virtual void OgreHaptics::RenderSystem::startScheduler | ( | unsigned long | rate = 1000 , |
|
bool | autoEnableDevices = true | |||
) | [pure virtual] |
Starts the scheduler used for managing the haptic thread of the rendering system.
true
all devices managed by the rendering system 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 the scheduler has already been started |
virtual void OgreHaptics::RenderSystem::stopScheduler | ( | bool | autoDisableDevices = true |
) | [pure virtual] |
Stops the scheduler used by the rendering system.
true
all devices managed by the rendering system will be disabled. This ensures they are not enabled automatically when the scheduler is restarted with autoEnableDevices = false
. autoDisableDevices | Specifies whether or not the devices should be disabled automatically. |
bool OgreHaptics::RenderSystem::isSchedulerStarted | ( | void | ) | const |
Returns whether the scheduler of the haptics rendering system has been started or not.
Definition at line 209 of file OgreHapticsRenderSystem.h.
unsigned long OgreHaptics::RenderSystem::getSetSchedulerRate | ( | void | ) | const |
Returns the rate of the scheduler as set in startScheduler.
0
will be returned. Definition at line 218 of file OgreHapticsRenderSystem.h.
Timer* OgreHaptics::RenderSystem::getTimer | ( | void | ) | const |
Returns a pointer to the timer used by the rendering system.
Definition at line 221 of file OgreHapticsRenderSystem.h.
virtual void OgreHaptics::RenderSystem::_scheduleSynchronousCallback | ( | SchedulerCallback | callback, | |
void * | params | |||
) | [pure virtual] |
Schedules a synchronous callback to be executed from the haptic thread.
callback | The function callback. | |
params | A pointer to parameter(s) to be passed to the callback. |
An | HapticAPIException if the scheduling of the callback fails. |
virtual short OgreHaptics::RenderSystem::_scheduleAsynchronousCallback | ( | SchedulerCallback | callback, | |
void * | params | |||
) | [pure virtual] |
Scheduls an asynchronous callback to be executed from the haptic thread.
callback | The function callback. | |
params | A pointer to parameter(s) to be passed to the callback. |
An | HapticAPIException if the scheduling of the callback fails. |
virtual void OgreHaptics::RenderSystem::_unscheduleAsynchronousCallback | ( | short | id | ) | [pure virtual] |
Unschedules a previously scheduled asynchronous callback.
id | The id of the asynchronous callback handle to be removed. |
An | HapticsAPIException if the unscheduling of the callback fails. |
virtual String OgreHaptics::RenderSystem::getErrorDescription | ( | long | errorNumber | ) | const [pure virtual] |
Returns a description of an error code.
virtual Device* OgreHaptics::RenderSystem::createDeviceImpl | ( | const String & | name, | |
const DeviceInitInfo & | initInfo | |||
) | [protected, pure virtual] |
Internal implementation of create method.
virtual Device* OgreHaptics::RenderSystem::createDeviceImpl | ( | const String & | name, | |
unsigned int | index, | |||
const DeviceInitInfo & | initInfo | |||
) | [protected, pure virtual] |
Internal implementation of create method.
virtual String OgreHaptics::RenderSystem::getInitNameByIndex | ( | unsigned int | index | ) | [protected, pure virtual] |
Internal method to obtain the initialisation name based on the given zero-based index.
virtual void OgreHaptics::RenderSystem::initConfigOptions | ( | DeviceInitInfo & | info | ) | [protected, pure virtual] |
virtual void OgreHaptics::RenderSystem::_notifyThreadAffinityChanged | ( | void | ) | [protected, pure virtual] |
Notifies devices created through a subclass of the RenderSystem class the thread affinity mask has been changed.
short OgreHaptics::RenderSystem::msNextAsynchronousCallbackID [static, protected] |
The next callback ID.
Subclasses must increment this when a new asychronous callback is scheduled.
Definition at line 268 of file OgreHapticsRenderSystem.h.
Timer* OgreHaptics::RenderSystem::mTimer [protected] |
Pointer to the timer used for timings in this rendering system.
Definition at line 271 of file OgreHapticsRenderSystem.h.
bool OgreHaptics::RenderSystem::mIsSchedulerStarted [protected] |
Has the scheduler of the haptics rendering system been started?
Definition at line 273 of file OgreHapticsRenderSystem.h.
unsigned long OgreHaptics::RenderSystem::mSetSchedulerRate [protected] |
bool OgreHaptics::RenderSystem::mAvailableDevicesDirty [protected] |
Has the list of available devices been build?
Definition at line 277 of file OgreHapticsRenderSystem.h.
DeviceMap OgreHaptics::RenderSystem::mDevices [protected] |
List of devices created through the rendering system.
Used for updating and auto starting devices.
Definition at line 282 of file OgreHapticsRenderSystem.h.
DWORD OgreHaptics::RenderSystem::mThreadAffinityMask [protected] |
The thread affinity mask used by the scheduler of the rendering system.
Definition at line 300 of file OgreHapticsRenderSystem.h.
Last modified Tue Jan 6 22:31:27 2009