HapticDeviceEvent
The `HapticDeviceEvent` is an event class in the SOFA framework that notifies about interactions with haptic devices. It inherits from the base `Event` class and provides information about the device's position, orientation, button states, and unique identifier. This component interacts with other components in SOFA through its API methods, which allow querying the state of a haptic device such as position (`getPosX`, `getPosY`, `getPosZ`, `getPosition`), orientation (`getOrientation`), button status (`getButtonState`, `getButton`), and device ID (`getDeviceId`). It also supports checking event type via static methods like `checkEventType`. Practical usage involves using the provided methods to retrieve haptic device data during a simulation or interaction process. The class is designed for integration with SOFA's scene graph architecture, enabling real-time feedback in simulations involving haptic devices.
- abstract
- The `HapticDeviceEvent` provides information about interactions with haptic devices, including their position, orientation, button states, and unique identifiers.
- sheet
- # HapticDeviceEvent **Overview** The `HapticDeviceEvent` is an event class in the SOFA framework that notifies about interactions with haptic devices. It inherits from the base `Event` class and provides methods to retrieve the state of a haptic device, including its position (`getPosX`, `getPosY`, `getPosZ`, `getPosition`), orientation (`getOrientation`), button status (`getButtonState`, `getButton`), and unique identifier (`getDeviceId`). **Parameters and Data** - **Position**: Represents the 3D coordinates of the haptic device in space, returned as a `sofa::type::Vec3`. Methods include: - `getPosX()`: Returns the X coordinate. - `getPosY()`: Returns the Y coordinate. - `getPosZ()`: Returns the Z coordinate. - `getPosition()`: Returns a vector `[X, Y, Z]` representing the position of the device. - **Orientation**: Represents the orientation of the haptic device as a quaternion (`sofa::type::Quat<SReal>`). Method: - `getOrientation()` - **Button State**: Represents the state of buttons on the haptic device using an 8-bit bitmask, where each bit corresponds to a button. Methods include: - `getButtonState()`: Returns the bitmask representing the current state of all buttons. - `getButton(int id)`: Checks whether a specific button is pressed by using bitwise operations on the bitmask. - **Device Identifier**: A unique identifier for the haptic device, returned as an `unsigned int`. Method: - `getDeviceId()` **Dependencies and Connections** The `HapticDeviceEvent` integrates into SOFA's scene graph architecture to enable real-time retrieval of haptic device data during simulations. It interacts with other components in the framework that require haptic feedback.
- description
- The `HapticDeviceEvent` is an event class in the SOFA framework that notifies about interactions with haptic devices. It inherits from the base `Event` class and provides information about the device's position, orientation, button states, and unique identifier. This component interacts with other components in SOFA through its API methods, which allow querying the state of a haptic device such as position (`getPosX`, `getPosY`, `getPosZ`, `getPosition`), orientation (`getOrientation`), button status (`getButtonState`, `getButton`), and device ID (`getDeviceId`). It also supports checking event type via static methods like `checkEventType`. Practical usage involves using the provided methods to retrieve haptic device data during a simulation or interaction process. The class is designed for integration with SOFA's scene graph architecture, enabling real-time feedback in simulations involving haptic devices.
- maths
- The `HapticDeviceEvent` is an event class in the SOFA framework that provides information about interactions with haptic devices. It does not directly involve mathematical or physical models but rather serves as a conduit for retrieving state data from haptic devices during simulations. ### Class Overview - **Inheritance**: Inherited from `sofa::core::objectmodel::Event` - **Purpose**: To notify about interactions with haptic devices and provide the current state of the device, including position, orientation, button states, and unique identifier. ### Attributes 1. **Position** (`m_position`): Represents the 3D coordinates of the haptic device in space. The coordinates are returned as a `sofa::type::Vec3`, which is an array-like structure for three real numbers (X, Y, Z). - Methods: - `getPosX()`: Returns the X coordinate. - `getPosY()`: Returns the Y coordinate. - `getPosZ()`: Returns the Z coordinate. - `getPosition()`: Returns a vector `[X, Y, Z]` representing the position of the device. 2. **Orientation** (`m_orientation`): Represents the orientation of the haptic device as a quaternion (a four-dimensional number). The quaternion is returned as `sofa::type::Quat<SReal>`, where `SReal` denotes a real scalar type used in SOFA. - Method: `getOrientation()` 3. **Button State** (`m_buttonState`): Represents the state of buttons on the haptic device using an 8-bit bitmask, where each bit corresponds to a button (up to 8 buttons can be tracked). - Methods: - `getButtonState()`: Returns the bitmask representing the current state of all buttons. - `getButton(int id)`: Checks whether a specific button is pressed by using bitwise operations on the bitmask. The method checks if the bit corresponding to the given ID is set (1) or not (0). 4. **Device Identifier** (`m_deviceId`): A unique identifier for the haptic device, returned as an `unsigned int`. - Method: `getDeviceId()` ### Constructor and Destructor - **Constructor**: Initializes the event with a given device ID, position vector, orientation quaternion, and button state bitmask. ```cpp HapticDeviceEvent(const unsigned int id, const sofa::type::Vec3& position, const sofa::type::Quat<SReal>& orientation, const unsigned char button); ``` - **Destructor**: Performs any necessary cleanup operations when the event is destroyed. ```cpp ~HapticDeviceEvent(); ``` ### Usage in Simulation The `HapticDeviceEvent` class is designed to be used in conjunction with other components of the SOFA framework, particularly within interactive simulations where real-time feedback from haptic devices is required. The methods provided allow querying the state of a haptic device during simulation steps or interaction processes. ### Integration with Scene Graph Architecture The `HapticDeviceEvent` integrates seamlessly into SOFA's scene graph architecture, enabling efficient retrieval and processing of haptic device data in real-time applications.
{
"name": "HapticDeviceEvent",
"main": {
"name": "HapticDeviceEvent",
"namespace": "sofa::core::objectmodel",
"module": "Sofa.framework.Core",
"include": "sofa/core/objectmodel/HapticDeviceEvent.h",
"doc": "This event notifies about haptic device interaction.",
"inherits": [
"Event"
],
"templates": [],
"data_fields": [],
"links": [],
"methods": [
{
"name": "getEventTypeIndex",
"return_type": "int",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "checkEventType",
"return_type": "bool",
"params": [
{
"name": "event",
"type": "const Event *"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": true,
"access": "public"
},
{
"name": "getPosX",
"return_type": "SReal",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getPosY",
"return_type": "SReal",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getPosZ",
"return_type": "SReal",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getPosition",
"return_type": "sofa::type::Vec3",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getOrientation",
"return_type": "sofa::type::Quat<SReal>",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getButtonState",
"return_type": "unsigned char",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getButton",
"return_type": "bool",
"params": [
{
"name": "id",
"type": "const int"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getDeviceId",
"return_type": "unsigned int",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "GetClassName",
"return_type": "const char *",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": true,
"access": "public"
}
]
},
"desc": {
"description": "The `HapticDeviceEvent` is an event class in the SOFA framework that notifies about interactions with haptic devices. It inherits from the base `Event` class and provides information about the device's position, orientation, button states, and unique identifier.\n\nThis component interacts with other components in SOFA through its API methods, which allow querying the state of a haptic device such as position (`getPosX`, `getPosY`, `getPosZ`, `getPosition`), orientation (`getOrientation`), button status (`getButtonState`, `getButton`), and device ID (`getDeviceId`). It also supports checking event type via static methods like `checkEventType`.\n\nPractical usage involves using the provided methods to retrieve haptic device data during a simulation or interaction process. The class is designed for integration with SOFA's scene graph architecture, enabling real-time feedback in simulations involving haptic devices."
},
"maths": {
"maths": "The `HapticDeviceEvent` is an event class in the SOFA framework that provides information about interactions with haptic devices. It does not directly involve mathematical or physical models but rather serves as a conduit for retrieving state data from haptic devices during simulations.\n\n### Class Overview\n- **Inheritance**: Inherited from `sofa::core::objectmodel::Event`\n- **Purpose**: To notify about interactions with haptic devices and provide the current state of the device, including position, orientation, button states, and unique identifier.\n\n### Attributes\n1. **Position** (`m_position`): Represents the 3D coordinates of the haptic device in space. The coordinates are returned as a `sofa::type::Vec3`, which is an array-like structure for three real numbers (X, Y, Z).\n - Methods:\n - `getPosX()`: Returns the X coordinate.\n - `getPosY()`: Returns the Y coordinate.\n - `getPosZ()`: Returns the Z coordinate.\n - `getPosition()`: Returns a vector `[X, Y, Z]` representing the position of the device.\n\n2. **Orientation** (`m_orientation`): Represents the orientation of the haptic device as a quaternion (a four-dimensional number). The quaternion is returned as `sofa::type::Quat<SReal>`, where `SReal` denotes a real scalar type used in SOFA.\n - Method: `getOrientation()`\n\n3. **Button State** (`m_buttonState`): Represents the state of buttons on the haptic device using an 8-bit bitmask, where each bit corresponds to a button (up to 8 buttons can be tracked).\n - Methods:\n - `getButtonState()`: Returns the bitmask representing the current state of all buttons.\n - `getButton(int id)`: Checks whether a specific button is pressed by using bitwise operations on the bitmask. The method checks if the bit corresponding to the given ID is set (1) or not (0).\n\n4. **Device Identifier** (`m_deviceId`): A unique identifier for the haptic device, returned as an `unsigned int`.\n - Method: `getDeviceId()`\n\n### Constructor and Destructor\n- **Constructor**: Initializes the event with a given device ID, position vector, orientation quaternion, and button state bitmask.\n ```cpp\n HapticDeviceEvent(const unsigned int id, const sofa::type::Vec3& position, const sofa::type::Quat<SReal>& orientation, const unsigned char button);\n ```\n- **Destructor**: Performs any necessary cleanup operations when the event is destroyed.\n ```cpp\n ~HapticDeviceEvent();\n ```\n\n### Usage in Simulation\nThe `HapticDeviceEvent` class is designed to be used in conjunction with other components of the SOFA framework, particularly within interactive simulations where real-time feedback from haptic devices is required. The methods provided allow querying the state of a haptic device during simulation steps or interaction processes.\n\n### Integration with Scene Graph Architecture\nThe `HapticDeviceEvent` integrates seamlessly into SOFA's scene graph architecture, enabling efficient retrieval and processing of haptic device data in real-time applications."
},
"summary": {
"abstract": "The `HapticDeviceEvent` provides information about interactions with haptic devices, including their position, orientation, button states, and unique identifiers.",
"sheet": "# HapticDeviceEvent\n\n**Overview**\n\nThe `HapticDeviceEvent` is an event class in the SOFA framework that notifies about interactions with haptic devices. It inherits from the base `Event` class and provides methods to retrieve the state of a haptic device, including its position (`getPosX`, `getPosY`, `getPosZ`, `getPosition`), orientation (`getOrientation`), button status (`getButtonState`, `getButton`), and unique identifier (`getDeviceId`).\n\n**Parameters and Data**\n\n- **Position**: Represents the 3D coordinates of the haptic device in space, returned as a `sofa::type::Vec3`. Methods include:\n - `getPosX()`: Returns the X coordinate.\n - `getPosY()`: Returns the Y coordinate.\n - `getPosZ()`: Returns the Z coordinate.\n - `getPosition()`: Returns a vector `[X, Y, Z]` representing the position of the device.\n\n- **Orientation**: Represents the orientation of the haptic device as a quaternion (`sofa::type::Quat<SReal>`). Method:\n - `getOrientation()`\n\n- **Button State**: Represents the state of buttons on the haptic device using an 8-bit bitmask, where each bit corresponds to a button. Methods include:\n - `getButtonState()`: Returns the bitmask representing the current state of all buttons.\n - `getButton(int id)`: Checks whether a specific button is pressed by using bitwise operations on the bitmask.\n\n- **Device Identifier**: A unique identifier for the haptic device, returned as an `unsigned int`. Method:\n - `getDeviceId()`\n\n**Dependencies and Connections**\n\nThe `HapticDeviceEvent` integrates into SOFA's scene graph architecture to enable real-time retrieval of haptic device data during simulations. It interacts with other components in the framework that require haptic feedback."
}
}