Back

Event

The `Event` class in SOFA is the base class for all events that are received by objects within the framework. Its primary role is to propagate event notifications through the simulation pipeline until an object handles it. When an instance of Event is created, its status is initialized as not handled (`m_handled = false`). This status can be updated using `setHandled()` once the event has been processed and does not need further propagation. The method `isHandled()` checks whether the event has already been handled. `Event` provides a mechanism for identifying different types of events through the methods `getEventTypeIndex()` and `checkEventType()`, which use a unique type index to quickly compare event types. Additionally, `GetClassName()` returns the class name from an instance, aiding in polymorphic behavior within SOFA. The method `getEventTypeCount()` provides the total number of available event types within the framework. This component interacts with other components by facilitating communication and coordination through events, ensuring that specific actions or notifications are correctly propagated to relevant parts of the simulation.

abstract
The `Event` class manages event notifications within SOFA, propagating them through the simulation pipeline until they are handled by a relevant object.
sheet
# Event **Overview** The `Event` class is the base class for all events received by objects in the SOFA framework. It facilitates communication and coordination between different components of the simulation by propagating event notifications until an object handles them. **Parameters and Data** The significant attributes and methods exposed by the `Event` component are: - **m_handled**: A boolean attribute indicating whether the event has been handled (`true`) or is still propagating (`false`). - `setHandled()`: Marks the event as handled. - `isHandled()`: Returns the current status of the event (handled or not). **Type Identification**: - `getEventTypeIndex()`: Provides a unique index for each type of event, facilitating efficient comparisons and identification within the framework. - `checkEventType(const Event* event)`: Static method to check if an event belongs to a specific type using its unique index. **Polymorphic Behavior**: - `GetClassName()`: Returns the class name from an instance, aiding in polymorphism and dynamic dispatch within SOFA.
description
The `Event` class in SOFA is the base class for all events that are received by objects within the framework. Its primary role is to propagate event notifications through the simulation pipeline until an object handles it. When an instance of Event is created, its status is initialized as not handled (`m_handled = false`). This status can be updated using `setHandled()` once the event has been processed and does not need further propagation. The method `isHandled()` checks whether the event has already been handled. `Event` provides a mechanism for identifying different types of events through the methods `getEventTypeIndex()` and `checkEventType()`, which use a unique type index to quickly compare event types. Additionally, `GetClassName()` returns the class name from an instance, aiding in polymorphic behavior within SOFA. The method `getEventTypeCount()` provides the total number of available event types within the framework. This component interacts with other components by facilitating communication and coordination through events, ensuring that specific actions or notifications are correctly propagated to relevant parts of the simulation.
maths
The `Event` class in the SOFA framework is a foundational element for managing communication between different components within the simulation pipeline. It does not directly contribute to any specific mathematical or physical models; instead, it serves as an abstract mechanism to propagate notifications and coordinate actions among various objects. ### Mathematical Description: - **Role**: The `Event` class is used to handle event notifications that are propagated through the simulation pipeline until they are processed by a relevant object. It does not involve any specific mathematical operations or transformations related to physical models, such as forces, displacements, or material properties. - **Attributes and Methods**: - **m_handled**: A boolean attribute that indicates whether an event has been handled (`true`) or is still propagating (`false`). - `setHandled()`: Marks the event as handled by setting `m_handled` to true. - `isHandled()`: Returns the current status of the event (whether it has been handled). - **Type Identification**: - `getEventTypeIndex()`: Provides a unique index for each type of event, facilitating efficient comparisons and identification within the framework. - `checkEventType(const Event* event)`: Static method to check if an event belongs to a specific type using its unique index. - **Polymorphic Behavior**: - `GetClassName()`: Returns the class name from an instance, aiding in polymorphism and dynamic dispatch within SOFA. ### Physical Description: - The `Event` class does not directly influence any physical aspects of the simulation. Instead, it is a critical component for ensuring that different parts of the simulation framework can communicate effectively with each other by propagating events. This ensures that actions or notifications are correctly processed and handled within the context of the overall simulation. ### Interaction with Simulation Pipeline: - The `Event` class facilitates coordination between components in the simulation pipeline, ensuring that necessary actions (such as force application, boundary condition updates, etc.) are communicated and executed appropriately. By propagating events until they are handled, it ensures that relevant parts of the framework respond to specific conditions or user inputs. ### Summary: - The `Event` class is an essential part of SOFA's event-driven architecture, enabling effective communication between different components within the simulation environment without directly participating in mathematical or physical modeling.
{
  "name": "Event",
  "main": {
    "name": "Event",
    "namespace": "sofa::core::objectmodel",
    "module": "Sofa.framework.Core",
    "include": "sofa/core/objectmodel/Event.h",
    "doc": "Base class for all events received by the objects.\nWhen created, the status is initialized as not handled. It is then propagated along the objects until it is handled.\n@author Francois Faure",
    "inherits": [],
    "templates": [],
    "data_fields": [],
    "links": [],
    "methods": [
      {
        "name": "setHandled",
        "return_type": "void",
        "params": [],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "isHandled",
        "return_type": "bool",
        "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"
      },
      {
        "name": "getEventTypeIndex",
        "return_type": "int",
        "params": [],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getEventTypeCount",
        "return_type": "int",
        "params": [],
        "is_virtual": false,
        "is_pure_virtual": false,
        "is_static": true,
        "access": "public"
      }
    ]
  },
  "desc": {
    "description": "The `Event` class in SOFA is the base class for all events that are received by objects within the framework. Its primary role is to propagate event notifications through the simulation pipeline until an object handles it. When an instance of Event is created, its status is initialized as not handled (`m_handled = false`). This status can be updated using `setHandled()` once the event has been processed and does not need further propagation. The method `isHandled()` checks whether the event has already been handled.\n\n`Event` provides a mechanism for identifying different types of events through the methods `getEventTypeIndex()` and `checkEventType()`, which use a unique type index to quickly compare event types. Additionally, `GetClassName()` returns the class name from an instance, aiding in polymorphic behavior within SOFA. The method `getEventTypeCount()` provides the total number of available event types within the framework.\n\nThis component interacts with other components by facilitating communication and coordination through events, ensuring that specific actions or notifications are correctly propagated to relevant parts of the simulation."
  },
  "maths": {
    "maths": "The `Event` class in the SOFA framework is a foundational element for managing communication between different components within the simulation pipeline. It does not directly contribute to any specific mathematical or physical models; instead, it serves as an abstract mechanism to propagate notifications and coordinate actions among various objects.\n\n### Mathematical Description:\n- **Role**: The `Event` class is used to handle event notifications that are propagated through the simulation pipeline until they are processed by a relevant object. It does not involve any specific mathematical operations or transformations related to physical models, such as forces, displacements, or material properties.\n\n- **Attributes and Methods**:\n  - **m_handled**: A boolean attribute that indicates whether an event has been handled (`true`) or is still propagating (`false`).\n    - `setHandled()`: Marks the event as handled by setting `m_handled` to true.\n    - `isHandled()`: Returns the current status of the event (whether it has been handled).\n\n  - **Type Identification**:\n    - `getEventTypeIndex()`: Provides a unique index for each type of event, facilitating efficient comparisons and identification within the framework.\n    - `checkEventType(const Event* event)`: Static method to check if an event belongs to a specific type using its unique index.\n\n  - **Polymorphic Behavior**:\n    - `GetClassName()`: Returns the class name from an instance, aiding in polymorphism and dynamic dispatch within SOFA.\n\n### Physical Description:\n- The `Event` class does not directly influence any physical aspects of the simulation. Instead, it is a critical component for ensuring that different parts of the simulation framework can communicate effectively with each other by propagating events. This ensures that actions or notifications are correctly processed and handled within the context of the overall simulation.\n\n### Interaction with Simulation Pipeline:\n- The `Event` class facilitates coordination between components in the simulation pipeline, ensuring that necessary actions (such as force application, boundary condition updates, etc.) are communicated and executed appropriately. By propagating events until they are handled, it ensures that relevant parts of the framework respond to specific conditions or user inputs.\n\n### Summary:\n- The `Event` class is an essential part of SOFA's event-driven architecture, enabling effective communication between different components within the simulation environment without directly participating in mathematical or physical modeling."
  },
  "summary": {
    "abstract": "The `Event` class manages event notifications within SOFA, propagating them through the simulation pipeline until they are handled by a relevant object.",
    "sheet": "# Event\n\n**Overview**\nThe `Event` class is the base class for all events received by objects in the SOFA framework. It facilitates communication and coordination between different components of the simulation by propagating event notifications until an object handles them.\n\n**Parameters and Data**\nThe significant attributes and methods exposed by the `Event` component are:\n- **m_handled**: A boolean attribute indicating whether the event has been handled (`true`) or is still propagating (`false`).\n  - `setHandled()`: Marks the event as handled.\n  - `isHandled()`: Returns the current status of the event (handled or not).\n\n**Type Identification**:\n- `getEventTypeIndex()`: Provides a unique index for each type of event, facilitating efficient comparisons and identification within the framework.\n- `checkEventType(const Event* event)`: Static method to check if an event belongs to a specific type using its unique index.\n\n**Polymorphic Behavior**:\n- `GetClassName()`: Returns the class name from an instance, aiding in polymorphism and dynamic dispatch within SOFA."
  }
}