Back

VisualVisitor

sofa::simulation::VisualVisitor
Visitor
Abstract (AI generated)

`VisualVisitor` processes visual models within the SOFA simulation scene graph for operations such as drawing, updating visuals, initializing visual components, and computing bounding boxes.

Metadata
module
Sofa.framework.Simulation.Core
namespace
sofa::simulation
include
sofa/simulation/VisualVisitor.h
inherits
  • Visitor
description

The VisualVisitor is a visitor component in the SOFA framework designed to handle visualization-related operations within the simulation scene graph. It does not contribute directly to any governing equations or operators related to FEM, such as mass matrix $M$, stiffness matrix $K$, internal force $f_{int}$, residual $R$, etc. Instead, its primary role is to interact with visual models and apply various visualization-related tasks during the simulation loop.

Key Roles in the FEM Pipeline:

  • Visualization Processing: The VisualVisitor processes visual models and related objects within the scene graph for operations such as drawing, updating visuals, initializing visual components, and computing bounding boxes. It is not directly involved in the mathematical or physical aspects of the simulation pipeline but rather focuses on rendering and graphical representation.

Numerical Methods or Discretization Choices:

  • The VisualVisitor does not encode any numerical methods related to FEM discretization or time integration schemes. Its primary function is to traverse nodes and apply visualization-specific operations, which are not mathematical in nature.

Role within the Broader Variational / Lagrangian Mechanics Framework:

  • Non-Mathematical Component: The VisualVisitor does not contribute to the variational or Lagrangian mechanics framework directly. It is a tool for visualizing and rendering simulation results, which are derived from the underlying mathematical models but do not themselves involve any physical laws or constitutive relations.

Methods Implemented:

  • processNodeTopDown: Traverses nodes in a top-down manner to apply visualization operations.
  • fwdProcessVisualStyle and bwdProcessVisualStyle: Update visual styles before and after drawing, respectively.
  • processVisualModel: Handles specific actions on visual models based on the derived visitor class (e.g., drawing, updating, initializing).

Summary:

While VisualVisitor is an essential component for rendering simulation results in SOFA, it does not contribute to the mathematical or physical aspects of FEM simulations. Its role is purely related to visualization and graphical representation.

Methods
void processVisualModel (simulation::Node * node, core::visual::VisualModel * vm) virtual
void fwdProcessVisualStyle (simulation::Node * node, core::visual::BaseVisualStyle * vm) virtual
void bwdProcessVisualStyle (simulation::Node * node, core::visual::BaseVisualStyle * vm) virtual
void processObject (simulation::Node * , core::objectmodel::BaseObject * ) virtual
Result processNodeTopDown (simulation::Node * node) virtual
const char * getCategoryName () virtual
bool treeTraversal (TreeTraversalRepetition & repeat) virtual
{
  "name": "VisualVisitor",
  "namespace": "sofa::simulation",
  "module": "Sofa.framework.Simulation.Core",
  "include": "sofa/simulation/VisualVisitor.h",
  "doc": "",
  "inherits": [
    "Visitor"
  ],
  "templates": [],
  "data_fields": [],
  "links": [],
  "methods": [
    {
      "name": "processVisualModel",
      "return_type": "void",
      "params": [
        {
          "name": "node",
          "type": "simulation::Node *"
        },
        {
          "name": "vm",
          "type": "core::visual::VisualModel *"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": true,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "fwdProcessVisualStyle",
      "return_type": "void",
      "params": [
        {
          "name": "node",
          "type": "simulation::Node *"
        },
        {
          "name": "vm",
          "type": "core::visual::BaseVisualStyle *"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "bwdProcessVisualStyle",
      "return_type": "void",
      "params": [
        {
          "name": "node",
          "type": "simulation::Node *"
        },
        {
          "name": "vm",
          "type": "core::visual::BaseVisualStyle *"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "processObject",
      "return_type": "void",
      "params": [
        {
          "name": "",
          "type": "simulation::Node *"
        },
        {
          "name": "",
          "type": "core::objectmodel::BaseObject *"
        }
      ],
      "is_virtual": true,
      "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": "getCategoryName",
      "return_type": "const char *",
      "params": [],
      "is_virtual": true,
      "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 `VisualVisitor` is a visitor component in the SOFA framework, inheriting from the `Visitor` class and located in the `sofa::simulation` namespace. It processes visual models within the simulation scene graph to handle visualization-related operations such as drawing, updating, and computing bounding boxes for objects. \n\nThe component interacts with other SOFA components through its API methods, primarily by traversing nodes and processing `VisualModel`, `BaseVisualStyle`, and general `BaseObject` instances. The method `processVisualModel` is a pure virtual function that must be implemented in derived classes to define the specific actions performed on visual models.\n\nDerived visitors like `VisualDrawVisitor`, `VisualUpdateVisitor`, `VisualInitVisitor`, and `VisualComputeBBoxVisitor` provide concrete implementations for different visualization tasks. These visitors are responsible for drawing objects, updating visuals, initializing visual components, and computing bounding boxes, respectively. The component uses the `core::visual::VisualParams` object to configure and control these operations.\n\nPractical usage involves creating specific instances of derived visitor classes and applying them to simulation nodes using the SOFA scene graph traversal mechanisms.",
  "maths": "The `VisualVisitor` is a visitor component in the SOFA framework designed to handle visualization-related operations within the simulation scene graph. It does not contribute directly to any governing equations or operators related to FEM, such as mass matrix \\(M\\), stiffness matrix \\(K\\), internal force \\(f_{int}\\), residual \\(R\\), etc. Instead, its primary role is to interact with visual models and apply various visualization-related tasks during the simulation loop.\n\n### Key Roles in the FEM Pipeline:\n- **Visualization Processing**: The `VisualVisitor` processes visual models and related objects within the scene graph for operations such as drawing, updating visuals, initializing visual components, and computing bounding boxes. It is not directly involved in the mathematical or physical aspects of the simulation pipeline but rather focuses on rendering and graphical representation.\n\n### Numerical Methods or Discretization Choices:\n- The `VisualVisitor` does not encode any numerical methods related to FEM discretization or time integration schemes. Its primary function is to traverse nodes and apply visualization-specific operations, which are not mathematical in nature.\n\n### Role within the Broader Variational / Lagrangian Mechanics Framework:\n- **Non-Mathematical Component**: The `VisualVisitor` does not contribute to the variational or Lagrangian mechanics framework directly. It is a tool for visualizing and rendering simulation results, which are derived from the underlying mathematical models but do not themselves involve any physical laws or constitutive relations.\n\n### Methods Implemented:\n- **processNodeTopDown**: Traverses nodes in a top-down manner to apply visualization operations.\n- **fwdProcessVisualStyle** and **bwdProcessVisualStyle**: Update visual styles before and after drawing, respectively.\n- **processVisualModel**: Handles specific actions on visual models based on the derived visitor class (e.g., drawing, updating, initializing).\n\n### Summary:\nWhile `VisualVisitor` is an essential component for rendering simulation results in SOFA, it does not contribute to the mathematical or physical aspects of FEM simulations. Its role is purely related to visualization and graphical representation.",
  "abstract": "`VisualVisitor` processes visual models within the SOFA simulation scene graph for operations such as drawing, updating visuals, initializing visual components, and computing bounding boxes.",
  "sheet": "# VisualVisitor\n\n## Overview\nThe `VisualVisitor` is a visitor component in the SOFA framework that handles visualization-related operations within the simulation scene graph. It processes visual models (`core::visual::VisualModel`) and applies various visualization tasks such as drawing, updating visuals, initializing visual components, and computing bounding boxes.\n\n## Parameters and Data\nThe `VisualVisitor` does not expose any significant data fields or parameters that control its behavior directly. Its functionality is defined through the methods it implements in derived classes.\n\n## Dependencies and Connections\nThe `VisualVisitor` interacts with other SOFA components primarily by traversing nodes (`simulation::Node`) and processing visual models, styles, and general objects within the scene graph. It relies on derived visitor classes to implement specific visualization tasks such as drawing, updating visuals, initializing visual components, and computing bounding boxes.\n\n## Practical Notes\nThe `VisualVisitor` is a pure virtual class that must be implemented in derived classes to define specific actions performed on visual models. Derived visitors like `VisualDrawVisitor`, `VisualUpdateVisitor`, `VisualInitVisitor`, and `VisualComputeBBoxVisitor` provide concrete implementations for different visualization tasks."
}