Back

MouseEvent

sofa::core::objectmodel::MouseEvent
Event
Doc (from source)

MouseEvent Class Implements an Event that notifies about a Mouse Interaction.

Abstract (AI generated)

`MouseEvent` handles and propagates mouse interaction events within SOFA simulations, providing methods to retrieve state, position, and wheel delta information.

Metadata
module
Sofa.framework.Core
namespace
sofa::core::objectmodel
include
sofa/core/objectmodel/MouseEvent.h
inherits
  • Event
description

The MouseEvent class in the SOFA framework does not directly implement or contribute to any governing equations, operators, constitutive laws, kinematic laws, or numerical methods typically associated with the Finite Element Method (FEM). Its primary role is to handle and propagate mouse interaction events within the simulation environment. The class encapsulates information about various states of the mouse such as button presses/releases, wheel movements, and position coordinates. This information can be used by other components in SOFA to modify the behavior or state of the simulation based on user input.

Mathematical and Physical Description: **
-
Governing Equations/Operators: None; MouseEvent does not contribute to any physical models, constitutive relations, stiffness matrices, internal forces, residuals, etc. It is purely an event handling mechanism.
-
Constitutive or Kinematic Laws Involved: None; the class does not encode any material properties, strain measures, stress tensors, hyperelastic potentials, damping models, or constraint Jacobians.
-
Role in FEM Pipeline: The MouseEvent class plays no direct role in assembly, time integration, nonlinear solve, linear solve, constraint handling, or mappings. It is a utility for handling user input events and does not participate in the numerical simulation process itself.
-
Numerical Methods or Discretization Choices Encoded: None; there are no discretization schemes or numerical methods implemented within this class as it pertains to event handling rather than simulation algorithms.
-
Fit into Variational/Lagrangian Mechanics Framework:** The MouseEvent class does not fit into the variational or Lagrangian mechanics framework. It serves a purely input/output role, facilitating communication between user interactions and other components in the SOFA system.

In summary, MouseEvent is an event handling utility within SOFA that manages mouse interaction data but has no direct involvement in the mathematical or physical aspects of FEM simulations.

Methods
int getEventTypeIndex ()
bool checkEventType (const Event * event)
int getPosX ()
int getPosY ()
int getWheelDelta ()
State getState ()
const char * GetClassName ()
{
  "name": "MouseEvent",
  "namespace": "sofa::core::objectmodel",
  "module": "Sofa.framework.Core",
  "include": "sofa/core/objectmodel/MouseEvent.h",
  "doc": "MouseEvent Class\nImplements an Event that notifies about a Mouse 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": "int",
      "params": [],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "getPosY",
      "return_type": "int",
      "params": [],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "getWheelDelta",
      "return_type": "int",
      "params": [],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "getState",
      "return_type": "State",
      "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"
    }
  ],
  "description": "The `MouseEvent` class in SOFA is designed to handle mouse interaction events within the simulation environment. It inherits from the `Event` class, which serves as a base for all event types in SOFA. This class implements specific functionality related to different states and positions of the mouse during interactions with the simulation.\n\n**Role and Purpose:**\nThe primary role of `MouseEvent` is to notify other components within the SOFA ecosystem about mouse-related actions such as button presses, releases, and wheel movements. It encapsulates information about the state (e.g., left-click pressed or released), position coordinates (`getPosX`, `getPosY`), and wheel delta (`getWheelDelta`). This class helps in translating user input into meaningful simulation events.\n\n**Interactions with Other Components:**\nThe `MouseEvent` interacts primarily through its inherited methods from the `Event` class, as well as through specific mouse state and position information. It can be used by other components that need to react to mouse interactions, such as visualization or haptics modules, to modify the simulation behavior accordingly.\n\n**Practical Usage Guidance:**\nThe main data fields provided are:\n- `m_state`: Represents the current state of the mouse (e.g., button press/release).\n- `m_wheelDelta`: Represents the delta value for mouse wheel movements.\n- `m_posX` and `m_posY`: Represent the x and y coordinates of the mouse position.\n\nMethods like `getPosX`, `getPosY`, `getWheelDelta`, and `getState` are used to retrieve these values. The class also includes a static method `GetClassName()` that returns the name of the class as a string.\n\nThe `checkEventType` function is a utility for checking if an event matches the mouse event type, helping in filtering events within larger event handling systems.",
  "maths": "The `MouseEvent` class in the SOFA framework does not directly implement or contribute to any governing equations, operators, constitutive laws, kinematic laws, or numerical methods typically associated with the Finite Element Method (FEM). Its primary role is to handle and propagate mouse interaction events within the simulation environment. The class encapsulates information about various states of the mouse such as button presses/releases, wheel movements, and position coordinates. This information can be used by other components in SOFA to modify the behavior or state of the simulation based on user input.\n\n**Mathematical and Physical Description: **\n- **Governing Equations/Operators:** None; `MouseEvent` does not contribute to any physical models, constitutive relations, stiffness matrices, internal forces, residuals, etc. It is purely an event handling mechanism.\n- **Constitutive or Kinematic Laws Involved:** None; the class does not encode any material properties, strain measures, stress tensors, hyperelastic potentials, damping models, or constraint Jacobians.\n- **Role in FEM Pipeline:** The `MouseEvent` class plays no direct role in assembly, time integration, nonlinear solve, linear solve, constraint handling, or mappings. It is a utility for handling user input events and does not participate in the numerical simulation process itself.\n- **Numerical Methods or Discretization Choices Encoded:** None; there are no discretization schemes or numerical methods implemented within this class as it pertains to event handling rather than simulation algorithms.\n- **Fit into Variational/Lagrangian Mechanics Framework:** The `MouseEvent` class does not fit into the variational or Lagrangian mechanics framework. It serves a purely input/output role, facilitating communication between user interactions and other components in the SOFA system.\n\nIn summary, `MouseEvent` is an event handling utility within SOFA that manages mouse interaction data but has no direct involvement in the mathematical or physical aspects of FEM simulations.",
  "abstract": "`MouseEvent` handles and propagates mouse interaction events within SOFA simulations, providing methods to retrieve state, position, and wheel delta information.",
  "sheet": "\n# MouseEvent\n\n**Overview**\nThe `MouseEvent` class in SOFA is designed to handle mouse interaction events. It inherits from the base `Event` class and provides functionality for retrieving mouse states such as button presses/releases, positions (`getPosX`, `getPosY`), and wheel movements (`getWheelDelta`). This class facilitates communication between user input and other components within the simulation environment.\n\n**Parameters and Data**\nThe significant data fields exposed by this component are:\n- **m_state**: Represents the current state of the mouse (e.g., button press/release).\n- **m_wheelDelta**: Represents the delta value for mouse wheel movements.\n- **m_posX**, **m_posY**: Represent the x and y coordinates of the mouse position.\n\n**Dependencies and Connections**\nThe `MouseEvent` class interacts with other components that need to react to mouse interactions, such as visualization or haptics modules. It provides methods for retrieving mouse state and position information, which can be used by these components to modify simulation behavior accordingly."
}