XMLPrintVisitor
sofa::simulation::XMLPrintVisitor
Visitor
Abstract (AI generated)
The `XMLPrintVisitor` traverses and prints a SOFA scene graph in XML format, facilitating debugging, visualization, and exporting of simulation data structures.
Metadata
- module
- Sofa.framework.Simulation.Core
- namespace
- sofa::simulation
- include
- sofa/simulation/XMLPrintVisitor.h
- inherits
-
- Visitor
- description
The XMLPrintVisitor in the SOFA framework is primarily designed for scene graph traversal and outputting simulation data in an XML format. It does not directly contribute to any governing equations or operators related to Finite Element Method (FEM) simulations such as the mass matrix $M$
, stiffness matrix $K$
, internal force vector $f_{int}$, residual vector $R$, etc. Instead, its role is focused on providing a human-readable representation of the simulation state and structure.
Governing Equations or Operators
- No Direct Contribution: The
XMLPrintVisitordoes not implement any governing equations or operators from FEM simulations such as mass matrix $M$, stiffness matrix $K$, internal force vector $f_{int}$, residual vector $R$.
Constitutive or Kinematic Laws Involved
- No Direct Contribution: The
XMLPrintVisitordoes not involve any constitutive laws (e.g., strain measures, stress tensors, hyperelastic potentials) or kinematic laws (e.g., deformation gradients, displacements). It is purely for outputting simulation data in XML format.
Role in the Global FEM Pipeline
- No Direct Contribution: The
XMLPrintVisitordoes not participate directly in assembly, time integration, nonlinear solve, linear solve, constraint handling, or mapping. Its role is entirely in post-processing and visualization of the scene graph.
Numerical Methods or Discretization Choices
- No Direct Contribution: The
XMLPrintVisitordoes not implement any numerical methods or discretization choices related to FEM simulations.
Fit into Broader Variational / Lagrangian Mechanics Framework
- No Direct Contribution: The
XMLPrintVisitoris an auxiliary component that facilitates the output of simulation data in a structured format (XML) and thus does not contribute directly to the variational or Lagrangian mechanics framework. It ensures that the structure and state of the SOFA scene graph are represented correctly for debugging, visualization, or export purposes.
Methods
void
processObject
(T obj)
void
processObjects
(Seq & list)
void
processBaseObject
(sofa::core::objectmodel::BaseObject * obj)
Result
processNodeTopDown
(simulation::Node * node)
virtual
void
processNodeBottomUp
(simulation::Node * node)
virtual
int
getLevel
()
void
setLevel
(int l)
bool
treeTraversal
(TreeTraversalRepetition & repeat)
virtual
{
"name": "XMLPrintVisitor",
"namespace": "sofa::simulation",
"module": "Sofa.framework.Simulation.Core",
"include": "sofa/simulation/XMLPrintVisitor.h",
"doc": "",
"inherits": [
"Visitor"
],
"templates": [],
"data_fields": [],
"links": [],
"methods": [
{
"name": "processObject",
"return_type": "void",
"params": [
{
"name": "obj",
"type": "T"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "processObjects",
"return_type": "void",
"params": [
{
"name": "list",
"type": "Seq &"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "processBaseObject",
"return_type": "void",
"params": [
{
"name": "obj",
"type": "sofa::core::objectmodel::BaseObject *"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "processNodeTopDown",
"return_type": "Result",
"params": [
{
"name": "node",
"type": "simulation::Node *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "processNodeBottomUp",
"return_type": "void",
"params": [
{
"name": "node",
"type": "simulation::Node *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getLevel",
"return_type": "int",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "setLevel",
"return_type": "void",
"params": [
{
"name": "l",
"type": "int"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "treeTraversal",
"return_type": "bool",
"params": [
{
"name": "repeat",
"type": "TreeTraversalRepetition &"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
}
],
"description": "The `XMLPrintVisitor` is part of the SOFA framework's Simulation Core module, which handles simulation and scene management. It inherits from the Visitor class and its primary purpose is to traverse and print a SOFA scene graph in XML format. This visitor processes objects, nodes, and sequences within the scene graph, encoding special characters for proper XML representation.\n\n### Role and Purpose\n- **Role**: The `XMLPrintVisitor` is used to convert the hierarchical structure of a SOFA simulation into an XML representation that can be easily read or exported. It traverses through the scene's nodes and objects, printing them in a structured format.\n- **Purpose**: This component facilitates debugging, visualization, and exporting of the simulation state by generating human-readable XML output from complex simulation data structures.\n\n### Interactions with Other Components\n- **Visitor Interface**: The `XMLPrintVisitor` implements methods defined by the Visitor interface (`processNodeTopDown`, `processNodeBottomUp`, `treeTraversal`) to enable it to traverse and process different components of a SOFA scene graph. It interacts with Nodes, BaseObjects, and sequences of objects.\n- **Node Processing**: Methods like `processObject`, `processBaseObject`, and `processObjects` are used to handle specific types of simulation entities such as individual objects or collections of objects within nodes.\n\n### Practical Usage Guidance\n- **Initialization**: An instance of `XMLPrintVisitor` is initialized with a reference to an output stream (`std::ostream`) where the XML will be printed. The level of indentation can be controlled using `getLevel()` and `setLevel()` methods.\n- **Traversal Methods**: Key methods such as `processNodeTopDown`, `processNodeBottomUp`, and `treeTraversal` enable traversal through the scene graph. These methods handle the top-down (pre-order) and bottom-up (post-order) processing of nodes to ensure correct hierarchical representation in XML.",
"maths": "The `XMLPrintVisitor` in the SOFA framework is primarily designed for scene graph traversal and outputting simulation data in an XML format. It does not directly contribute to any governing equations or operators related to Finite Element Method (FEM) simulations such as the mass matrix \\(M\\), stiffness matrix \\(K\\), internal force vector \\(f_{int}\\), residual vector \\(R\\), etc. Instead, its role is focused on providing a human-readable representation of the simulation state and structure.\n\n### Governing Equations or Operators\n- **No Direct Contribution**: The `XMLPrintVisitor` does not implement any governing equations or operators from FEM simulations such as mass matrix \\(M\\), stiffness matrix \\(K\\), internal force vector \\(f_{int}\\), residual vector \\(R\\).\n\n### Constitutive or Kinematic Laws Involved\n- **No Direct Contribution**: The `XMLPrintVisitor` does not involve any constitutive laws (e.g., strain measures, stress tensors, hyperelastic potentials) or kinematic laws (e.g., deformation gradients, displacements). It is purely for outputting simulation data in XML format.\n\n### Role in the Global FEM Pipeline\n- **No Direct Contribution**: The `XMLPrintVisitor` does not participate directly in assembly, time integration, nonlinear solve, linear solve, constraint handling, or mapping. Its role is entirely in post-processing and visualization of the scene graph.\n\n### Numerical Methods or Discretization Choices\n- **No Direct Contribution**: The `XMLPrintVisitor` does not implement any numerical methods or discretization choices related to FEM simulations.\n\n### Fit into Broader Variational / Lagrangian Mechanics Framework\n- **No Direct Contribution**: The `XMLPrintVisitor` is an auxiliary component that facilitates the output of simulation data in a structured format (XML) and thus does not contribute directly to the variational or Lagrangian mechanics framework. It ensures that the structure and state of the SOFA scene graph are represented correctly for debugging, visualization, or export purposes.",
"abstract": "The `XMLPrintVisitor` traverses and prints a SOFA scene graph in XML format, facilitating debugging, visualization, and exporting of simulation data structures.",
"sheet": "# XMLPrintVisitor\n\n## Overview\nThe `XMLPrintVisitor` is part of the SOFA framework's Simulation Core module. It inherits from the Visitor class and its primary role is to traverse a SOFA scene graph and print it in an XML format. This component facilitates debugging, visualization, and exporting by generating human-readable XML output.\n\n## Dependencies and Connections\nThe `XMLPrintVisitor` interacts with various components of the SOFA scene graph, including Nodes, BaseObjects, and sequences of objects. It implements methods defined by the Visitor interface (`processNodeTopDown`, `processNodeBottomUp`, `treeTraversal`) to enable traversal through the scene's nodes and objects.\n\n## Practical Notes\nAn instance of `XMLPrintVisitor` is initialized with a reference to an output stream where the XML will be printed. The level of indentation can be controlled using `getLevel()` and `setLevel()` methods. Key traversal methods such as `processNodeTopDown`, `processNodeBottomUp`, and `treeTraversal` enable top-down (pre-order) and bottom-up (post-order) processing to ensure correct hierarchical representation in XML."
}