Back

DetachNodeEvent

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

Event indicating that a child node is being detached from the scene. Any reference to one of its descendant (such as active contacts) should be removed.

Abstract (AI generated)

`DetachNodeEvent` signifies a child node's detachment from the SOFA scene graph, ensuring that any references to its descendants are removed.

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

The DetachNodeEvent class in the SOFA framework is an event that signifies a child node is being detached from the scene graph. This event plays a critical role in maintaining the integrity and consistency of the simulation by ensuring that any references to descendants of the detaching node, such as active contacts or other dependencies, are removed appropriately.

*Role and Purpose:
The DetachNodeEvent inherits from the base Event class and is designed to notify the system about the detachment of a specific node. This notification is crucial for managing scene graph updates and ensuring that no dangling references remain in the simulation environment after a node has been detached.

*Interactions with Other Components:
The event interacts with other SOFA components through its methods such as getNode, which retrieves the BaseNode being detached, and contains, which checks if a specified BaseNode or BaseObject is within the detached subtree. These interactions are essential for correctly handling detachment and maintaining simulation integrity.

*Practical Usage Guidance:
The DetachNodeEvent should be triggered whenever a node needs to be removed from the scene graph. Users can check for its occurrence and take appropriate actions, such as invalidating references or updating contact information. The event's methods allow for querying the node being detached and checking if other nodes or objects are part of the detaching subtree.

*Data Fields:
The component has a protected field node that holds the BaseNode to be detached.

Methods
int getEventTypeIndex ()
bool checkEventType (const Event * event)
BaseNode * getNode ()
bool contains (BaseNode * n)
bool contains (BaseObject * o)
const char * GetClassName ()
{
  "name": "DetachNodeEvent",
  "namespace": "sofa::core::objectmodel",
  "module": "Sofa.framework.Core",
  "include": "sofa/core/objectmodel/DetachNodeEvent.h",
  "doc": "Event indicating that a child node is being detached from the scene.\n Any reference to one of its descendant (such as active contacts) should be removed.",
  "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": "getNode",
      "return_type": "BaseNode *",
      "params": [],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "contains",
      "return_type": "bool",
      "params": [
        {
          "name": "n",
          "type": "BaseNode *"
        }
      ],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "contains",
      "return_type": "bool",
      "params": [
        {
          "name": "o",
          "type": "BaseObject *"
        }
      ],
      "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 `DetachNodeEvent` class in the SOFA framework is an event that signifies a child node is being detached from the scene graph. This event plays a critical role in maintaining the integrity and consistency of the simulation by ensuring that any references to descendants of the detaching node, such as active contacts or other dependencies, are removed appropriately.\n\n**Role and Purpose:**\nThe `DetachNodeEvent` inherits from the base `Event` class and is designed to notify the system about the detachment of a specific node. This notification is crucial for managing scene graph updates and ensuring that no dangling references remain in the simulation environment after a node has been detached.\n\n**Interactions with Other Components:**\nThe event interacts with other SOFA components through its methods such as `getNode`, which retrieves the BaseNode being detached, and `contains`, which checks if a specified BaseNode or BaseObject is within the detached subtree. These interactions are essential for correctly handling detachment and maintaining simulation integrity.\n\n**Practical Usage Guidance:**\nThe `DetachNodeEvent` should be triggered whenever a node needs to be removed from the scene graph. Users can check for its occurrence and take appropriate actions, such as invalidating references or updating contact information. The event's methods allow for querying the node being detached and checking if other nodes or objects are part of the detaching subtree.\n\n**Data Fields:**\nThe component has a protected field `node` that holds the BaseNode to be detached.",
  "maths": "The `DetachNodeEvent` class in the SOFA framework is an event that signifies a child node is being detached from the scene graph. This event plays a critical role in maintaining the integrity and consistency of the simulation by ensuring that any references to descendants of the detaching node, such as active contacts or other dependencies, are removed appropriately.\n\n**Role and Purpose:*\nThe `DetachNodeEvent` inherits from the base `Event` class and is designed to notify the system about the detachment of a specific node. This notification is crucial for managing scene graph updates and ensuring that no dangling references remain in the simulation environment after a node has been detached.\n\n**Interactions with Other Components:*\nThe event interacts with other SOFA components through its methods such as `getNode`, which retrieves the BaseNode being detached, and `contains`, which checks if a specified BaseNode or BaseObject is within the detached subtree. These interactions are essential for correctly handling detachment and maintaining simulation integrity.\n\n**Practical Usage Guidance:*\nThe `DetachNodeEvent` should be triggered whenever a node needs to be removed from the scene graph. Users can check for its occurrence and take appropriate actions, such as invalidating references or updating contact information. The event's methods allow for querying the node being detached and checking if other nodes or objects are part of the detaching subtree.\n\n**Data Fields:*\nThe component has a protected field `node` that holds the BaseNode to be detached.",
  "abstract": "`DetachNodeEvent` signifies a child node's detachment from the SOFA scene graph, ensuring that any references to its descendants are removed.",
  "sheet": "# DetachNodeEvent\n\n**Overview:**\n`DetachNodeEvent` is an event class indicating that a child node is being detached from the scene graph. This ensures that all references to its descendants (such as active contacts) are appropriately removed, maintaining simulation integrity.\n\n**Dependencies and Connections:*\nThe `DetachNodeEvent` interacts with other SOFA components through methods like `getNode`, which retrieves the BaseNode being detached, and `contains`, which checks if a specified BaseNode or BaseObject is within the detached subtree. These interactions are essential for correctly handling detachment and maintaining simulation consistency.\n\n**Practical Notes:**\nThe event should be triggered whenever a node needs to be removed from the scene graph. Users can check for its occurrence and take appropriate actions, such as invalidating references or updating contact information."
}