Back

ExportGnuplotVisitor

The `ExportGnuplotVisitor` is part of the SOFA framework's simulation module, designed to traverse and process nodes in the scene graph for exporting data to Gnuplot. This visitor inherits from the base `Visitor` class and interacts with other components by visiting each node and executing specific export functions related to mechanical states, interaction force fields, and mass properties. Its primary purpose is to facilitate the generation of Gnuplot files that can be used for visualizing simulation data outside SOFA. The component calls the `exportGnuplot` method on relevant components within a given node, passing time as an argument to capture state at specific moments during the simulation. This visitor is typically instantiated with execution parameters and a time value, indicating the point in time for which the export should be performed. It traverses nodes top-down (from parent to child) and continues processing subsequent nodes after visiting each one.

abstract
The `ExportGnuplotVisitor` traverses nodes in the scene graph to export simulation data related to forces, mechanical states, and masses into Gnuplot-compatible files for external visualization.
sheet
# ExportGnuplotVisitor ## Overview The `ExportGnuplotVisitor` is a visitor component that facilitates exporting simulation data from SOFA nodes in a Gnuplot-compatible format. It traverses the scene graph top-down, visiting each node and calling specific export functions on relevant components such as interaction force fields, mechanical states, and mass properties. ## Practical Notes The `ExportGnuplotVisitor` is typically instantiated with execution parameters and a time value to capture state at specific moments during the simulation. It ensures that data related to forces, mechanical states, and masses are exported for visualization using Gnuplot outside of SOFA.
description
The `ExportGnuplotVisitor` is part of the SOFA framework's simulation module, designed to traverse and process nodes in the scene graph for exporting data to Gnuplot. This visitor inherits from the base `Visitor` class and interacts with other components by visiting each node and executing specific export functions related to mechanical states, interaction force fields, and mass properties. Its primary purpose is to facilitate the generation of Gnuplot files that can be used for visualizing simulation data outside SOFA. The component calls the `exportGnuplot` method on relevant components within a given node, passing time as an argument to capture state at specific moments during the simulation. This visitor is typically instantiated with execution parameters and a time value, indicating the point in time for which the export should be performed. It traverses nodes top-down (from parent to child) and continues processing subsequent nodes after visiting each one.
maths
The `ExportGnuplotVisitor` is part of the SOFA framework's simulation module, designed to traverse and process nodes in the scene graph for exporting data to Gnuplot. This visitor does not directly involve any mathematical or physical equations related to mechanical states, interaction force fields, or mass properties; rather, it facilitates the generation of Gnuplot files that can be used for visualizing simulation data outside SOFA. ### Key Functions and Actions: 1. **Visitor Traversal**: - The visitor class `ExportGnuplotVisitor` inherits from the base `Visitor` class and is designed to traverse nodes in a top-down manner, visiting each node starting from the parent down to its children. - The method `processNodeTopDown` is overridden to define actions taken during this traversal. It checks if certain components (such as interaction force fields, mechanical states, or mass properties) exist within a given node and calls their respective `exportGnuplot` methods. 2. **Export Actions**: - For each node, the visitor checks whether an `interactionForceField`, `mechanicalState`, or `mass` component exists. If any of these components are present, it calls their `exportGnuplot` method, passing in the current simulation time (`m_time`) as a parameter. - This action ensures that data related to forces, mechanical states, and masses at each node is captured for Gnuplot visualization at specific moments during the simulation. ### Example Workflow: - When an `ExportGnuplotVisitor` instance is created with appropriate execution parameters (`eparams`) and a time value (`time`), it starts traversing nodes from the top of the scene graph. - For each node visited, if there are any interaction force fields present, their respective `exportGnuplot` method is called with the given simulation time. This method typically generates data files (e.g., in Gnuplot format) representing forces or interactions at that specific moment. - Similarly, if a mechanical state or mass component exists within a node, their `exportGnuplot` methods are also invoked to capture and export their respective states for visualization purposes. ### Summary: - The `ExportGnuplotVisitor` does not directly handle mathematical or physical equations but serves as an interface for exporting simulation data related to forces, mechanical states, and masses at specific time instances into a Gnuplot-compatible format. This enables users to visualize and analyze the simulation results outside of SOFA using Gnuplot.
{
  "name": "ExportGnuplotVisitor",
  "main": {
    "name": "ExportGnuplotVisitor",
    "namespace": "sofa::simulation",
    "module": "Sofa.framework.Simulation.Core",
    "include": "sofa/simulation/ExportGnuplotVisitor.h",
    "doc": "",
    "inherits": [
      "Visitor"
    ],
    "templates": [],
    "data_fields": [],
    "links": [],
    "methods": [
      {
        "name": "processNodeTopDown",
        "return_type": "Result",
        "params": [
          {
            "name": "node",
            "type": "simulation::Node *"
          }
        ],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      },
      {
        "name": "getCategoryName",
        "return_type": "const char *",
        "params": [],
        "is_virtual": true,
        "is_pure_virtual": false,
        "is_static": false,
        "access": "public"
      }
    ]
  },
  "desc": {
    "description": "The `ExportGnuplotVisitor` is part of the SOFA framework's simulation module, designed to traverse and process nodes in the scene graph for exporting data to Gnuplot. This visitor inherits from the base `Visitor` class and interacts with other components by visiting each node and executing specific export functions related to mechanical states, interaction force fields, and mass properties.\n\nIts primary purpose is to facilitate the generation of Gnuplot files that can be used for visualizing simulation data outside SOFA. The component calls the `exportGnuplot` method on relevant components within a given node, passing time as an argument to capture state at specific moments during the simulation.\n\nThis visitor is typically instantiated with execution parameters and a time value, indicating the point in time for which the export should be performed. It traverses nodes top-down (from parent to child) and continues processing subsequent nodes after visiting each one."
  },
  "maths": {
    "maths": "The `ExportGnuplotVisitor` is part of the SOFA framework's simulation module, designed to traverse and process nodes in the scene graph for exporting data to Gnuplot. This visitor does not directly involve any mathematical or physical equations related to mechanical states, interaction force fields, or mass properties; rather, it facilitates the generation of Gnuplot files that can be used for visualizing simulation data outside SOFA.\n\n### Key Functions and Actions:\n1. **Visitor Traversal**:\n   - The visitor class `ExportGnuplotVisitor` inherits from the base `Visitor` class and is designed to traverse nodes in a top-down manner, visiting each node starting from the parent down to its children.\n   - The method `processNodeTopDown` is overridden to define actions taken during this traversal. It checks if certain components (such as interaction force fields, mechanical states, or mass properties) exist within a given node and calls their respective `exportGnuplot` methods.\n\n2. **Export Actions**:\n   - For each node, the visitor checks whether an `interactionForceField`, `mechanicalState`, or `mass` component exists. If any of these components are present, it calls their `exportGnuplot` method, passing in the current simulation time (`m_time`) as a parameter.\n   - This action ensures that data related to forces, mechanical states, and masses at each node is captured for Gnuplot visualization at specific moments during the simulation.\n\n### Example Workflow:\n- When an `ExportGnuplotVisitor` instance is created with appropriate execution parameters (`eparams`) and a time value (`time`), it starts traversing nodes from the top of the scene graph.\n- For each node visited, if there are any interaction force fields present, their respective `exportGnuplot` method is called with the given simulation time. This method typically generates data files (e.g., in Gnuplot format) representing forces or interactions at that specific moment.\n- Similarly, if a mechanical state or mass component exists within a node, their `exportGnuplot` methods are also invoked to capture and export their respective states for visualization purposes.\n\n### Summary:\n- The `ExportGnuplotVisitor` does not directly handle mathematical or physical equations but serves as an interface for exporting simulation data related to forces, mechanical states, and masses at specific time instances into a Gnuplot-compatible format. This enables users to visualize and analyze the simulation results outside of SOFA using Gnuplot."
  },
  "summary": {
    "abstract": "The `ExportGnuplotVisitor` traverses nodes in the scene graph to export simulation data related to forces, mechanical states, and masses into Gnuplot-compatible files for external visualization.",
    "sheet": "# ExportGnuplotVisitor\n\n## Overview\n\nThe `ExportGnuplotVisitor` is a visitor component that facilitates exporting simulation data from SOFA nodes in a Gnuplot-compatible format. It traverses the scene graph top-down, visiting each node and calling specific export functions on relevant components such as interaction force fields, mechanical states, and mass properties.\n\n## Practical Notes\n\nThe `ExportGnuplotVisitor` is typically instantiated with execution parameters and a time value to capture state at specific moments during the simulation. It ensures that data related to forces, mechanical states, and masses are exported for visualization using Gnuplot outside of SOFA."
  }
}