BaseMultiMappingElement
The `BaseMultiMappingElement` is an abstract class within the SOFA framework that represents a base element for handling multi-mapping operations in simulation nodes. It inherits from `ObjectElement`, indicating its role in the XML-based representation and initialization of objects within the scene graph. This component provides methods to initialize a node (`initNode`) and update the scene graph (`updateSceneGraph`). The `initNode` method initializes the node by retrieving mappings between different state contexts, identifying ancestor nodes, and other input/output nodes. It then calls the virtual `updateSceneGraph` method to adjust the scene graph based on these mappings. The `updateSceneGraph` method is pure virtual, meaning it must be implemented in derived classes. This method takes a `BaseMapping` instance along with vectors of ancestor inputs, other inputs, and outputs, and updates the scene graph accordingly. The exact implementation details depend on specific use cases and are left to subclasses. In practical usage, `BaseMultiMappingElement` is used as an abstract base for more specialized mapping elements that need to handle multiple mappings between different parts of a simulation. It facilitates the dynamic updating of the scene graph in response to changes in the state contexts and mappings.
- abstract
- `BaseMultiMappingElement` is an abstract class that manages multi-mapping operations between different state contexts in SOFA simulations, facilitating the initialization of nodes and updating the scene graph.
- sheet
- # BaseMultiMappingElement ## Overview The `BaseMultiMappingElement` is an abstract class within the SOFA framework designed to handle multi-mapping operations between various state contexts. It inherits from `ObjectElement`, indicating its role in initializing simulation nodes and managing mappings within the scene graph. ## Dependencies and Connections This component typically requires derived classes that implement specific mapping functionalities. The `initNode` method initializes a node by retrieving mappings and identifying ancestor and other input/output nodes, while the `updateSceneGraph` method (pure virtual) must be implemented in derived classes to adjust the scene graph based on these mappings.
- description
- The `BaseMultiMappingElement` is an abstract class within the SOFA framework that represents a base element for handling multi-mapping operations in simulation nodes. It inherits from `ObjectElement`, indicating its role in the XML-based representation and initialization of objects within the scene graph. This component provides methods to initialize a node (`initNode`) and update the scene graph (`updateSceneGraph`). The `initNode` method initializes the node by retrieving mappings between different state contexts, identifying ancestor nodes, and other input/output nodes. It then calls the virtual `updateSceneGraph` method to adjust the scene graph based on these mappings. The `updateSceneGraph` method is pure virtual, meaning it must be implemented in derived classes. This method takes a `BaseMapping` instance along with vectors of ancestor inputs, other inputs, and outputs, and updates the scene graph accordingly. The exact implementation details depend on specific use cases and are left to subclasses. In practical usage, `BaseMultiMappingElement` is used as an abstract base for more specialized mapping elements that need to handle multiple mappings between different parts of a simulation. It facilitates the dynamic updating of the scene graph in response to changes in the state contexts and mappings.
- maths
- The `BaseMultiMappingElement` is an abstract class within the SOFA framework that plays a role in handling multi-mapping operations between different state contexts within the simulation nodes. It facilitates dynamic updating of the scene graph based on mappings defined between various parts of the simulation. ### Mathematical and Physical Description: #### Initialization (`initNode` Method): 1. **Retrieve Mappings:** The `initNode` method initializes a node by retrieving mappings (instances of `BaseMapping`) that connect different state contexts (`inputStates` and `outputStates`). These states are typically associated with various parts or components of the simulation. 2. **Identify Nodes:* - It identifies ancestor nodes by checking if a given node is an ancestor to another using the `hasAncestor()` method. - It categorizes input nodes into two groups: those that are ancestors and those that are not (`ancestorInputNodes` and `otherInputNodes`). 3. **Update Scene Graph:** After identifying all necessary nodes, it calls the virtual method `updateSceneGraph`, which must be implemented by derived classes to adjust the scene graph based on these mappings. #### Updating the Scene Graph (`updateSceneGraph` Method): 1. **Pure Virtual Function:* The `updateSceneGraph` method is pure virtual and must be implemented in derived classes. It takes a `BaseMapping`, vectors of ancestor inputs, other inputs, and outputs as parameters. 2. **Implementation Details:** - The exact implementation details depend on specific use cases. Derived classes implement this method to update the scene graph based on mappings between different state contexts, ensuring that the simulation maintains consistency and correctness during dynamic updates. #### Mathematical Representation: The `BaseMultiMappingElement` abstractly handles mappings that can be seen as transformations or relationships between states in a simulation. Mathematically, these mappings can be represented as functions or operators mapping from one set of states to another set of states. If we denote the input state contexts by \(S_{in} = \{s_1^{in}, s_2^{in}, ..., s_n^{in}\}\) and output state contexts by \(S_{out} = \{s_1^{out}, s_2^{out}, ..., s_m^{out}\}\), then the mapping operation can be represented as: \[ M: S_{in} \rightarrow S_{out} \] where \(M\) is a generic mapping function defined by `BaseMapping`. #### Physical Context: The mappings handled by `BaseMultiMappingElement` are crucial for maintaining consistency and correctness in the simulation. They ensure that changes or updates in one part of the simulation are correctly propagated to other parts, reflecting physical interactions accurately. In summary, while `BaseMultiMappingElement` itself does not perform specific mathematical operations, it provides a framework for handling mappings between different state contexts, ensuring the scene graph remains consistent and up-to-date. Derived classes implement these mappings based on their specific requirements, maintaining the integrity of the simulation.
{
"name": "BaseMultiMappingElement",
"main": {
"name": "BaseMultiMappingElement",
"namespace": "sofa::simulation::xml",
"module": "Sofa.framework.Simulation.Common",
"include": "sofa/simulation/common/xml/BaseMultiMappingElement.h",
"doc": "",
"inherits": [
"ObjectElement"
],
"templates": [],
"data_fields": [],
"links": [],
"methods": [
{
"name": "initNode",
"return_type": "bool",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "updateSceneGraph",
"return_type": "void",
"params": [
{
"name": "multiMapping",
"type": "sofa::core::BaseMapping *"
},
{
"name": "ancestorInputs",
"type": "const int &"
},
{
"name": "otherInputs",
"type": "int &"
},
{
"name": "outputs",
"type": "int &"
}
],
"is_virtual": true,
"is_pure_virtual": true,
"is_static": false,
"access": "protected"
}
]
},
"desc": {
"description": "The `BaseMultiMappingElement` is an abstract class within the SOFA framework that represents a base element for handling multi-mapping operations in simulation nodes. It inherits from `ObjectElement`, indicating its role in the XML-based representation and initialization of objects within the scene graph.\n\nThis component provides methods to initialize a node (`initNode`) and update the scene graph (`updateSceneGraph`). The `initNode` method initializes the node by retrieving mappings between different state contexts, identifying ancestor nodes, and other input/output nodes. It then calls the virtual `updateSceneGraph` method to adjust the scene graph based on these mappings.\n\nThe `updateSceneGraph` method is pure virtual, meaning it must be implemented in derived classes. This method takes a `BaseMapping` instance along with vectors of ancestor inputs, other inputs, and outputs, and updates the scene graph accordingly. The exact implementation details depend on specific use cases and are left to subclasses.\n\nIn practical usage, `BaseMultiMappingElement` is used as an abstract base for more specialized mapping elements that need to handle multiple mappings between different parts of a simulation. It facilitates the dynamic updating of the scene graph in response to changes in the state contexts and mappings."
},
"maths": {
"maths": "The `BaseMultiMappingElement` is an abstract class within the SOFA framework that plays a role in handling multi-mapping operations between different state contexts within the simulation nodes. It facilitates dynamic updating of the scene graph based on mappings defined between various parts of the simulation.\n\n### Mathematical and Physical Description:\n\n#### Initialization (`initNode` Method):\n1. **Retrieve Mappings:** The `initNode` method initializes a node by retrieving mappings (instances of `BaseMapping`) that connect different state contexts (`inputStates` and `outputStates`). These states are typically associated with various parts or components of the simulation.\n \n2. **Identify Nodes:*\n - It identifies ancestor nodes by checking if a given node is an ancestor to another using the `hasAncestor()` method.\n - It categorizes input nodes into two groups: those that are ancestors and those that are not (`ancestorInputNodes` and `otherInputNodes`).\n\n3. **Update Scene Graph:** After identifying all necessary nodes, it calls the virtual method `updateSceneGraph`, which must be implemented by derived classes to adjust the scene graph based on these mappings.\n\n#### Updating the Scene Graph (`updateSceneGraph` Method):\n1. **Pure Virtual Function:*\nThe `updateSceneGraph` method is pure virtual and must be implemented in derived classes. It takes a `BaseMapping`, vectors of ancestor inputs, other inputs, and outputs as parameters.\n\n2. **Implementation Details:**\n - The exact implementation details depend on specific use cases. Derived classes implement this method to update the scene graph based on mappings between different state contexts, ensuring that the simulation maintains consistency and correctness during dynamic updates.\n\n#### Mathematical Representation:\nThe `BaseMultiMappingElement` abstractly handles mappings that can be seen as transformations or relationships between states in a simulation. Mathematically, these mappings can be represented as functions or operators mapping from one set of states to another set of states.\n\nIf we denote the input state contexts by \\(S_{in} = \\{s_1^{in}, s_2^{in}, ..., s_n^{in}\\}\\) and output state contexts by \\(S_{out} = \\{s_1^{out}, s_2^{out}, ..., s_m^{out}\\}\\), then the mapping operation can be represented as:\n\\[ M: S_{in} \\rightarrow S_{out} \\]\nwhere \\(M\\) is a generic mapping function defined by `BaseMapping`.\n\n#### Physical Context:\nThe mappings handled by `BaseMultiMappingElement` are crucial for maintaining consistency and correctness in the simulation. They ensure that changes or updates in one part of the simulation are correctly propagated to other parts, reflecting physical interactions accurately.\n\nIn summary, while `BaseMultiMappingElement` itself does not perform specific mathematical operations, it provides a framework for handling mappings between different state contexts, ensuring the scene graph remains consistent and up-to-date. Derived classes implement these mappings based on their specific requirements, maintaining the integrity of the simulation."
},
"summary": {
"abstract": "`BaseMultiMappingElement` is an abstract class that manages multi-mapping operations between different state contexts in SOFA simulations, facilitating the initialization of nodes and updating the scene graph.",
"sheet": "# BaseMultiMappingElement\n\n## Overview\nThe `BaseMultiMappingElement` is an abstract class within the SOFA framework designed to handle multi-mapping operations between various state contexts. It inherits from `ObjectElement`, indicating its role in initializing simulation nodes and managing mappings within the scene graph.\n\n## Dependencies and Connections\nThis component typically requires derived classes that implement specific mapping functionalities. The `initNode` method initializes a node by retrieving mappings and identifying ancestor and other input/output nodes, while the `updateSceneGraph` method (pure virtual) must be implemented in derived classes to adjust the scene graph based on these mappings."
}
}