BaseNode
Base class for simulation nodes. A Node is a class defining the main scene data structure of a simulation. It defined hierarchical relations between elements. Each node can have parent and child nodes (potentially defining a tree), as well as attached objects (the leaves of the tree). \author Jeremie Allard
`BaseNode` defines the hierarchical structure of a SOFA simulation by managing parent-child relationships and attaching objects such as solvers, force fields, and visual models to nodes.
- module
- Sofa.framework.Core
- namespace
- sofa::core::objectmodel
- include
- sofa/core/objectmodel/BaseNode.h
- inherits
-
- Base
- description
The provided code snippet is part of the Simulation Open Framework Application (SOFA) library, which is used for physics-based simulation in computer graphics and biomechanics. The ConfigurationSetting class in the SOFA framework does not directly contribute to the mathematical or physical aspects of the finite element method (FEM) pipeline. Instead, it serves as a base class for managing configuration settings within the SOFA simulation environment. The primary role of this component is to ensure that all configuration settings are treated as read-only once initialized. This behavior ensures consistency and prevents unintended modifications during runtime. class within the ConfigurationSetting include: namespace serves as a foundational context object that holds various components of a simulation such as mechanical states, topology, and other objects. This class implements methods to access these components through different means like direction (up or down) from the current context, by tag, or using a path string. The mathematical and physical descriptions are derived primarily from how this class interacts with the physics engine and manages dependencies between simulation entities.
Mathematical and Physical Description:
Generic Object Access:
The BaseContext class provides several methods for accessing objects within its hierarchical structure. These include generic template wrappers like T* get(SearchDirection dir = SearchUp) const, which allows retrieving an object of type T based on a search direction (up or down). The search direction is critical because it determines the traversal path through the simulation's graph, which can be thought of as a directed acyclic graph (DAG).
Topology and Mechanical States:
The class has methods such as setTopology(BaseObject*), getMechanicalState(), indicating that these entities are managed within this context. The topology represents the connectivity between elements in the simulation, which can be described mathematically using adjacency matrices or graphs. Each element’s state (position, velocity, acceleration) is part of the mechanical state and evolves over time based on physical laws such as Newton's equations.
Event Propagation:
The propagateEvent method demonstrates how events are handled within SOFA. Events can represent changes in state due to external forces or internal dynamics. The propagation mechanism involves distributing these changes across the simulation graph, which is often modeled using numerical methods for partial differential equations (PDEs) that govern physical interactions.
Graph Traversal and Search:
The class implements functionality to search through its hierarchy with methods such as hasAncestor, which checks if one context is an ancestor of another. This traversal is vital for maintaining consistency across the simulation, where changes in one part may affect other interconnected components. The graph structure allows for efficient management of dependencies between objects.
Tag-based Access:
The use of tags to identify specific objects or groups of objects within the context provides a flexible way to manage complex simulations with multiple interacting parts. Tags can be used to filter objects by type, state, or any other property that is relevant to the simulation.
Conclusion:
The BaseContext class plays an essential role in SOFA’s architecture by providing mechanisms for accessing and managing simulation components efficiently. The methods within this class are designed to work seamlessly with the underlying mathematical models of physical systems, ensuring accurate and consistent simulations across various contexts.
Methods
const BaseNode *
toBaseNode
()
virtual
Children
getChildren
()
virtual
Parents
getParents
()
virtual
int
getNbParents
()
BaseNode *
getFirstParent
()
virtual
BaseNode *
getRoot
()
virtual
void
addChild
(int node)
virtual
void
removeChild
(int node)
virtual
void
moveChild
(int node, int prev_parent)
virtual
void
moveChild
(int node)
virtual
bool
addObject
(int obj, TypeOfInsertion )
virtual
bool
removeObject
(int obj)
virtual
void
moveObject
(int obj)
virtual
bool
hasParent
(const BaseNode * node)
virtual
bool
hasAncestor
(const BaseNode * node)
virtual
void
detachFromGraph
()
virtual
BaseContext *
getContext
()
virtual
int
getPathName
()
int
getRootPath
()
Base *
findLinkDestClass
(const BaseClass * destType, const int & path, const BaseLink * link)
core::behavior::BaseAnimationLoop *
getAnimationLoop
()
virtual
core::behavior::OdeSolver *
getOdeSolver
()
virtual
core::collision::Pipeline *
getCollisionPipeline
()
virtual
core::visual::VisualLoop *
getVisualLoop
()
virtual
void
setObjectContext
(int obj)
void
clearObjectContext
(int obj)
void
addAnimationLoop
(core::behavior::BaseAnimationLoop * )
virtual
void
removeAnimationLoop
(core::behavior::BaseAnimationLoop * )
virtual
void
addVisualLoop
(core::visual::VisualLoop * )
virtual
void
removeVisualLoop
(core::visual::VisualLoop * )
virtual
void
addBehaviorModel
(core::BehaviorModel * )
virtual
void
removeBehaviorModel
(core::BehaviorModel * )
virtual
void
addMapping
(core::BaseMapping * )
virtual
void
removeMapping
(core::BaseMapping * )
virtual
void
addOdeSolver
(core::behavior::OdeSolver * )
virtual
void
removeOdeSolver
(core::behavior::OdeSolver * )
virtual
void
addConstraintSolver
(core::behavior::ConstraintSolver * )
virtual
void
removeConstraintSolver
(core::behavior::ConstraintSolver * )
virtual
void
addLinearSolver
(core::behavior::BaseLinearSolver * )
virtual
void
removeLinearSolver
(core::behavior::BaseLinearSolver * )
virtual
void
addTopology
(core::topology::Topology * )
virtual
void
removeTopology
(core::topology::Topology * )
virtual
void
addMeshTopology
(core::topology::BaseMeshTopology * )
virtual
void
removeMeshTopology
(core::topology::BaseMeshTopology * )
virtual
void
addTopologyObject
(core::topology::BaseTopologyObject * )
virtual
void
removeTopologyObject
(core::topology::BaseTopologyObject * )
virtual
void
addState
(core::BaseState * )
virtual
void
removeState
(core::BaseState * )
virtual
void
addMechanicalState
(core::behavior::BaseMechanicalState * )
virtual
void
removeMechanicalState
(core::behavior::BaseMechanicalState * )
virtual
void
addMechanicalMapping
(core::BaseMapping * )
virtual
void
removeMechanicalMapping
(core::BaseMapping * )
virtual
void
addMass
(core::behavior::BaseMass * )
virtual
void
removeMass
(core::behavior::BaseMass * )
virtual
void
addForceField
(core::behavior::BaseForceField * )
virtual
void
removeForceField
(core::behavior::BaseForceField * )
virtual
void
addInteractionForceField
(core::behavior::BaseInteractionForceField * )
virtual
void
removeInteractionForceField
(core::behavior::BaseInteractionForceField * )
virtual
void
addProjectiveConstraintSet
(core::behavior::BaseProjectiveConstraintSet * )
virtual
void
removeProjectiveConstraintSet
(core::behavior::BaseProjectiveConstraintSet * )
virtual
void
addConstraintSet
(core::behavior::BaseConstraintSet * )
virtual
void
removeConstraintSet
(core::behavior::BaseConstraintSet * )
virtual
void
addContextObject
(core::objectmodel::ContextObject * )
virtual
void
removeContextObject
(core::objectmodel::ContextObject * )
virtual
void
addConfigurationSetting
(core::objectmodel::ConfigurationSetting * )
virtual
void
removeConfigurationSetting
(core::objectmodel::ConfigurationSetting * )
virtual
void
addShader
(core::visual::Shader * )
virtual
void
removeShader
(core::visual::Shader * )
virtual
void
addVisualModel
(core::visual::VisualModel * )
virtual
void
removeVisualModel
(core::visual::VisualModel * )
virtual
void
addVisualStyle
(core::visual::BaseVisualStyle * )
virtual
void
removeVisualStyle
(core::visual::BaseVisualStyle * )
virtual
void
addVisualManager
(core::visual::VisualManager * )
virtual
void
removeVisualManager
(core::visual::VisualManager * )
virtual
void
addCollisionModel
(core::CollisionModel * )
virtual
void
removeCollisionModel
(core::CollisionModel * )
virtual
void
addCollisionPipeline
(core::collision::Pipeline * )
virtual
void
removeCollisionPipeline
(core::collision::Pipeline * )
virtual
{
"name": "BaseNode",
"namespace": "sofa::core::objectmodel",
"module": "Sofa.framework.Core",
"include": "sofa/core/objectmodel/BaseNode.h",
"doc": "Base class for simulation nodes.\n A Node is a class defining the main scene data structure of a simulation.\n It defined hierarchical relations between elements.\n Each node can have parent and child nodes (potentially defining a tree),\n as well as attached objects (the leaves of the tree).\n\\author Jeremie Allard",
"inherits": [
"Base"
],
"templates": [],
"data_fields": [],
"links": [],
"methods": [
{
"name": "toBaseNode",
"return_type": "const BaseNode *",
"params": [],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getChildren",
"return_type": "Children",
"params": [],
"is_virtual": true,
"is_pure_virtual": true,
"is_static": false,
"access": "public"
},
{
"name": "getParents",
"return_type": "Parents",
"params": [],
"is_virtual": true,
"is_pure_virtual": true,
"is_static": false,
"access": "public"
},
{
"name": "getNbParents",
"return_type": "int",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getFirstParent",
"return_type": "BaseNode *",
"params": [],
"is_virtual": true,
"is_pure_virtual": true,
"is_static": false,
"access": "public"
},
{
"name": "getRoot",
"return_type": "BaseNode *",
"params": [],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "addChild",
"return_type": "void",
"params": [
{
"name": "node",
"type": "int"
}
],
"is_virtual": true,
"is_pure_virtual": true,
"is_static": false,
"access": "public"
},
{
"name": "removeChild",
"return_type": "void",
"params": [
{
"name": "node",
"type": "int"
}
],
"is_virtual": true,
"is_pure_virtual": true,
"is_static": false,
"access": "public"
},
{
"name": "moveChild",
"return_type": "void",
"params": [
{
"name": "node",
"type": "int"
},
{
"name": "prev_parent",
"type": "int"
}
],
"is_virtual": true,
"is_pure_virtual": true,
"is_static": false,
"access": "public"
},
{
"name": "moveChild",
"return_type": "void",
"params": [
{
"name": "node",
"type": "int"
}
],
"is_virtual": true,
"is_pure_virtual": true,
"is_static": false,
"access": "public"
},
{
"name": "addObject",
"return_type": "bool",
"params": [
{
"name": "obj",
"type": "int"
},
{
"name": "",
"type": "TypeOfInsertion"
}
],
"is_virtual": true,
"is_pure_virtual": true,
"is_static": false,
"access": "public"
},
{
"name": "removeObject",
"return_type": "bool",
"params": [
{
"name": "obj",
"type": "int"
}
],
"is_virtual": true,
"is_pure_virtual": true,
"is_static": false,
"access": "public"
},
{
"name": "moveObject",
"return_type": "void",
"params": [
{
"name": "obj",
"type": "int"
}
],
"is_virtual": true,
"is_pure_virtual": true,
"is_static": false,
"access": "public"
},
{
"name": "hasParent",
"return_type": "bool",
"params": [
{
"name": "node",
"type": "const BaseNode *"
}
],
"is_virtual": true,
"is_pure_virtual": true,
"is_static": false,
"access": "public"
},
{
"name": "hasAncestor",
"return_type": "bool",
"params": [
{
"name": "node",
"type": "const BaseNode *"
}
],
"is_virtual": true,
"is_pure_virtual": true,
"is_static": false,
"access": "public"
},
{
"name": "detachFromGraph",
"return_type": "void",
"params": [],
"is_virtual": true,
"is_pure_virtual": true,
"is_static": false,
"access": "public"
},
{
"name": "getContext",
"return_type": "BaseContext *",
"params": [],
"is_virtual": true,
"is_pure_virtual": true,
"is_static": false,
"access": "public"
},
{
"name": "getPathName",
"return_type": "int",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getRootPath",
"return_type": "int",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "findLinkDestClass",
"return_type": "Base *",
"params": [
{
"name": "destType",
"type": "const BaseClass *"
},
{
"name": "path",
"type": "const int &"
},
{
"name": "link",
"type": "const BaseLink *"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getAnimationLoop",
"return_type": "core::behavior::BaseAnimationLoop *",
"params": [],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getOdeSolver",
"return_type": "core::behavior::OdeSolver *",
"params": [],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getCollisionPipeline",
"return_type": "core::collision::Pipeline *",
"params": [],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getVisualLoop",
"return_type": "core::visual::VisualLoop *",
"params": [],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "setObjectContext",
"return_type": "void",
"params": [
{
"name": "obj",
"type": "int"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "protected"
},
{
"name": "clearObjectContext",
"return_type": "void",
"params": [
{
"name": "obj",
"type": "int"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "protected"
},
{
"name": "addAnimationLoop",
"return_type": "void",
"params": [
{
"name": "",
"type": "core::behavior::BaseAnimationLoop *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "removeAnimationLoop",
"return_type": "void",
"params": [
{
"name": "",
"type": "core::behavior::BaseAnimationLoop *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "addVisualLoop",
"return_type": "void",
"params": [
{
"name": "",
"type": "core::visual::VisualLoop *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "removeVisualLoop",
"return_type": "void",
"params": [
{
"name": "",
"type": "core::visual::VisualLoop *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "addBehaviorModel",
"return_type": "void",
"params": [
{
"name": "",
"type": "core::BehaviorModel *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "removeBehaviorModel",
"return_type": "void",
"params": [
{
"name": "",
"type": "core::BehaviorModel *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "addMapping",
"return_type": "void",
"params": [
{
"name": "",
"type": "core::BaseMapping *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "removeMapping",
"return_type": "void",
"params": [
{
"name": "",
"type": "core::BaseMapping *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "addOdeSolver",
"return_type": "void",
"params": [
{
"name": "",
"type": "core::behavior::OdeSolver *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "removeOdeSolver",
"return_type": "void",
"params": [
{
"name": "",
"type": "core::behavior::OdeSolver *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "addConstraintSolver",
"return_type": "void",
"params": [
{
"name": "",
"type": "core::behavior::ConstraintSolver *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "removeConstraintSolver",
"return_type": "void",
"params": [
{
"name": "",
"type": "core::behavior::ConstraintSolver *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "addLinearSolver",
"return_type": "void",
"params": [
{
"name": "",
"type": "core::behavior::BaseLinearSolver *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "removeLinearSolver",
"return_type": "void",
"params": [
{
"name": "",
"type": "core::behavior::BaseLinearSolver *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "addTopology",
"return_type": "void",
"params": [
{
"name": "",
"type": "core::topology::Topology *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "removeTopology",
"return_type": "void",
"params": [
{
"name": "",
"type": "core::topology::Topology *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "addMeshTopology",
"return_type": "void",
"params": [
{
"name": "",
"type": "core::topology::BaseMeshTopology *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "removeMeshTopology",
"return_type": "void",
"params": [
{
"name": "",
"type": "core::topology::BaseMeshTopology *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "addTopologyObject",
"return_type": "void",
"params": [
{
"name": "",
"type": "core::topology::BaseTopologyObject *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "removeTopologyObject",
"return_type": "void",
"params": [
{
"name": "",
"type": "core::topology::BaseTopologyObject *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "addState",
"return_type": "void",
"params": [
{
"name": "",
"type": "core::BaseState *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "removeState",
"return_type": "void",
"params": [
{
"name": "",
"type": "core::BaseState *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "addMechanicalState",
"return_type": "void",
"params": [
{
"name": "",
"type": "core::behavior::BaseMechanicalState *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "removeMechanicalState",
"return_type": "void",
"params": [
{
"name": "",
"type": "core::behavior::BaseMechanicalState *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "addMechanicalMapping",
"return_type": "void",
"params": [
{
"name": "",
"type": "core::BaseMapping *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "removeMechanicalMapping",
"return_type": "void",
"params": [
{
"name": "",
"type": "core::BaseMapping *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "addMass",
"return_type": "void",
"params": [
{
"name": "",
"type": "core::behavior::BaseMass *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "removeMass",
"return_type": "void",
"params": [
{
"name": "",
"type": "core::behavior::BaseMass *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "addForceField",
"return_type": "void",
"params": [
{
"name": "",
"type": "core::behavior::BaseForceField *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "removeForceField",
"return_type": "void",
"params": [
{
"name": "",
"type": "core::behavior::BaseForceField *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "addInteractionForceField",
"return_type": "void",
"params": [
{
"name": "",
"type": "core::behavior::BaseInteractionForceField *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "removeInteractionForceField",
"return_type": "void",
"params": [
{
"name": "",
"type": "core::behavior::BaseInteractionForceField *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "addProjectiveConstraintSet",
"return_type": "void",
"params": [
{
"name": "",
"type": "core::behavior::BaseProjectiveConstraintSet *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "removeProjectiveConstraintSet",
"return_type": "void",
"params": [
{
"name": "",
"type": "core::behavior::BaseProjectiveConstraintSet *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "addConstraintSet",
"return_type": "void",
"params": [
{
"name": "",
"type": "core::behavior::BaseConstraintSet *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "removeConstraintSet",
"return_type": "void",
"params": [
{
"name": "",
"type": "core::behavior::BaseConstraintSet *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "addContextObject",
"return_type": "void",
"params": [
{
"name": "",
"type": "core::objectmodel::ContextObject *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "removeContextObject",
"return_type": "void",
"params": [
{
"name": "",
"type": "core::objectmodel::ContextObject *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "addConfigurationSetting",
"return_type": "void",
"params": [
{
"name": "",
"type": "core::objectmodel::ConfigurationSetting *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "removeConfigurationSetting",
"return_type": "void",
"params": [
{
"name": "",
"type": "core::objectmodel::ConfigurationSetting *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "addShader",
"return_type": "void",
"params": [
{
"name": "",
"type": "core::visual::Shader *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "removeShader",
"return_type": "void",
"params": [
{
"name": "",
"type": "core::visual::Shader *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "addVisualModel",
"return_type": "void",
"params": [
{
"name": "",
"type": "core::visual::VisualModel *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "removeVisualModel",
"return_type": "void",
"params": [
{
"name": "",
"type": "core::visual::VisualModel *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "addVisualStyle",
"return_type": "void",
"params": [
{
"name": "",
"type": "core::visual::BaseVisualStyle *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "removeVisualStyle",
"return_type": "void",
"params": [
{
"name": "",
"type": "core::visual::BaseVisualStyle *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "addVisualManager",
"return_type": "void",
"params": [
{
"name": "",
"type": "core::visual::VisualManager *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "removeVisualManager",
"return_type": "void",
"params": [
{
"name": "",
"type": "core::visual::VisualManager *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "addCollisionModel",
"return_type": "void",
"params": [
{
"name": "",
"type": "core::CollisionModel *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "removeCollisionModel",
"return_type": "void",
"params": [
{
"name": "",
"type": "core::CollisionModel *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "addCollisionPipeline",
"return_type": "void",
"params": [
{
"name": "",
"type": "core::collision::Pipeline *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "removeCollisionPipeline",
"return_type": "void",
"params": [
{
"name": "",
"type": "core::collision::Pipeline *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
}
],
"description": "The `BaseNode` class in the SOFA framework is central to defining the hierarchical scene data structure for simulations. Each node represents an element within the simulation and can have parent and child nodes, forming a tree-like structure. Nodes can also contain various objects that represent different aspects of the simulation, such as mechanical models, constraints, solvers, and visual components.\n\n`BaseNode` interacts with other SOFA components through several methods, allowing for hierarchical management (e.g., adding/removing children), attaching/detaching objects, managing context, and accessing specific algorithms like animation loops or collision pipelines. It provides a generic interface to manage these interactions without specifying concrete implementations, leaving that to derived classes.\n\nPractical usage of `BaseNode` involves constructing the scene graph by creating nodes, adding hierarchical relationships between them, and attaching simulation components such as solvers, visual models, and force fields. The component ensures consistency in context management across the attached objects, making it a foundational element for building complex simulations.",
"maths": "The `BaseNode` class in the SOFA framework is central to defining a hierarchical scene data structure for simulations. Each node represents an element within the simulation and can have parent and child nodes, forming a tree-like structure. This structure facilitates the organization of complex simulations into manageable parts. Here are some mathematical and physical descriptions of this component:\n\n### Hierarchical Structure\n- **Node Relationships:** The hierarchical relationship between `BaseNode` objects is represented by a directed graph where each node can have one or more parent nodes (multinode support) and zero or more child nodes.\n - \\( G = (V, E) \\), where \\( V \\) represents the set of nodes and \\( E \\) represents the set of edges that connect parent-child relationships. Each edge is directed from a parent node to its children.\n- **Traversal:** Traversals are essential for operations like scene graph traversal or state propagation. Pre-order, post-order, in-order traversals can be performed depending on whether you need to process parents first (pre-order) or children first (post-order).\n - For instance, a pre-order traversal ensures that each node is processed before its children.\n\n### Context Management and Consistency\n- **Context:** Each `BaseNode` has an associated context (`BaseContext`) which holds information relevant to all objects within the node. This can include global state variables, shared data structures, or configuration settings. The consistency of this context across nodes and their attached objects ensures coherent behavior in the simulation.\n - Context consistency is maintained by methods like `setObjectContext` and `clearObjectContext`, ensuring that every object within a node has access to its appropriate context.\n\n### Object Management\n- **Adding/Removing Objects:** Methods such as `addObject` and `removeObject` manage objects attached to each node. These objects can represent various physical entities, including mechanical models (e.g., mass, force fields), constraints, solvers, visual components, etc.\n - \\( O_i \\) represents an object of type \\( T \\). The operation `addObject(O_i)` adds the object to a sequence within the node and updates its context. Similarly, `removeObject(O_i)` removes it from the sequence and clears its context.\n\n### Specific Components Management\n- **Special Components:** There are specific methods for managing particular types of components (e.g., `BaseBehaviorModel`, `OdeSolver`, `ForceField`). Each method ensures that a component is added to or removed from a dedicated sequence within the node, maintaining their order and ensuring proper execution during simulation.\n - \\( S_{behavior} \\) represents the sequence for behavior models. The operation `addBehaviorModel(B_i)` adds behavior model \\( B_i \\) to \\( S_{behavior} \\).\n\n### Physical Interactions and Algorithms\n- **Physics Engine Integration:** SOFA integrates physical simulation components through methods like `getOdeSolver`, `getCollisionPipeline`, etc., which return pointers to the corresponding solver or pipeline used in the node. These solvers handle physical computations, such as solving systems of equations for mechanics.\n - \\( S_{ode} \\) represents an ODE solver object. The operation `getOdeSolver()` returns a pointer to \\( S_{ode} \\), ensuring that it can be utilized by other components within the node or its subnodes.\n\n### Scene Graph Navigation and Path Resolution\n- **Path Navigation:** Methods like `getPathName` and `getRootPath` allow for navigation through the scene graph and resolution of paths between nodes, facilitating operations such as linking objects across different parts of the simulation.\n - The path from a node to its root can be represented by a string that encodes the sequence of parent-child relationships: \\( P_{root} = (N_1 \\rightarrow N_2 \\rightarrow ... \\rightarrow N_n) \\).\n\n### Conclusion\nThe `BaseNode` class provides a robust framework for organizing and managing simulation components in SOFA. It enables hierarchical scene construction, context management, consistent object attachment/detachment, and integration with specific physical solvers and algorithms, thereby ensuring efficient and coherent simulations.",
"abstract": "`BaseNode` defines the hierarchical structure of a SOFA simulation by managing parent-child relationships and attaching objects such as solvers, force fields, and visual models to nodes.",
"sheet": "# BaseNode\n\n## Overview\nThe `BaseNode` class is central to defining the hierarchical scene data structure in SOFA simulations. It manages parent-child relationships between nodes and attaches various simulation components like mechanical models, constraints, solvers, and visual elements.\n\n## Dependencies and Connections\nEach node can have parent and child nodes, forming a tree-like hierarchy. `BaseNode` interacts with other SOFA components to manage objects within the scene graph, including adding/removing children, attaching/detaching simulation components, managing context, and accessing specific algorithms like animation loops or collision pipelines."
}