Back

VisualLoop

sofa::core::visual::VisualLoop
VisualModel
Abstract (AI generated)

`VisualLoop` manages visualization steps in SOFA simulations, including initialization, updates, context updates, rendering, and bounding box computation.

Metadata
module
Sofa.framework.Core
namespace
sofa::core::visual
include
sofa/core/visual/VisualLoop.h
inherits
  • VisualModel
description

The VisualLoop component in the SOFA framework is primarily responsible for managing visualization steps within the simulation scene. It does not directly contribute to the governing equations or operators typically associated with finite element methods (FEM), such as mass matrix $M$, stiffness matrix $K$, internal force $f_{int}$, residual $R$, etc. Instead, its role is focused on the rendering and visualization of the simulation results.

Governing Equations or Operators

  • Mass Matrix $M$: Not applicable.
  • Stiffness Matrix $K$: Not applicable.
  • Internal Force $f_{int}$: Not applicable.
  • Residual $R$: Not applicable.

Constitutive or Kinematic Laws Involved

  • Strain Measures: Not applicable.
  • Stress Tensors: Not applicable.
  • Hyperelastic Potentials: Not applicable.
  • Damping Models: Not applicable.
  • Constraint Jacobians: Not applicable.

Role in the Global FEM Pipeline

The VisualLoop component plays a role in the visualization aspect of the simulation, which is separate from the core FEM pipeline. Its primary responsibilities include:
- Initialization (initStep): Initializes textures and other visual elements.
- Update (updateStep): Updates the visual models by triggering mappings that transform mechanical data into visual representations.
- Context Update (updateContextStep): Ensures context updates are performed if necessary, such as when root flags are modified.
- Rendering (drawStep): Renders the scene based on the current visual parameters and configurations.
- Bounding Box Computation (computeBBoxStep): Computes the bounding box of the scene for visibility checks and other rendering optimizations.

Numerical Methods or Discretization Choices

The VisualLoop does not encode any numerical methods or discretization choices that are typically associated with FEM. Instead, it focuses on visual representation and rendering, which involve operations such as texture mapping, shading, and scene graph management.

Fit into the Broader Variational / Lagrangian Mechanics Framework

The VisualLoop does not contribute directly to the variational or Lagrangian mechanics framework used in FEM simulations. Its role is ancillary, providing a means to visualize the results of these physical simulations. The component ensures that visual data is properly managed and rendered, allowing users to observe and interact with the simulation output.

In summary, VisualLoop is a visualization management component in SOFA, designed to handle rendering steps but does not participate in the core mathematical or physical computations typical of FEM-based mechanical simulations.

Methods
const VisualLoop * toVisualLoop () virtual
void initStep (sofa::core::visual::VisualParams * ) virtual
void updateStep (sofa::core::visual::VisualParams * ) virtual
void updateContextStep (sofa::core::visual::VisualParams * ) virtual
void drawStep (sofa::core::visual::VisualParams * ) virtual
void computeBBoxStep (sofa::core::visual::VisualParams * , SReal * , SReal * , bool ) virtual
bool insertInNode (objectmodel::BaseNode * node) virtual
bool removeInNode (objectmodel::BaseNode * node) virtual
{
  "name": "VisualLoop",
  "namespace": "sofa::core::visual",
  "module": "Sofa.framework.Core",
  "include": "sofa/core/visual/VisualLoop.h",
  "doc": "",
  "inherits": [
    "VisualModel"
  ],
  "templates": [],
  "data_fields": [],
  "links": [],
  "methods": [
    {
      "name": "toVisualLoop",
      "return_type": "const VisualLoop *",
      "params": [],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "initStep",
      "return_type": "void",
      "params": [
        {
          "name": "",
          "type": "sofa::core::visual::VisualParams *"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "updateStep",
      "return_type": "void",
      "params": [
        {
          "name": "",
          "type": "sofa::core::visual::VisualParams *"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "updateContextStep",
      "return_type": "void",
      "params": [
        {
          "name": "",
          "type": "sofa::core::visual::VisualParams *"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "drawStep",
      "return_type": "void",
      "params": [
        {
          "name": "",
          "type": "sofa::core::visual::VisualParams *"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "computeBBoxStep",
      "return_type": "void",
      "params": [
        {
          "name": "",
          "type": "sofa::core::visual::VisualParams *"
        },
        {
          "name": "",
          "type": "SReal *"
        },
        {
          "name": "",
          "type": "SReal *"
        },
        {
          "name": "",
          "type": "bool"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "insertInNode",
      "return_type": "bool",
      "params": [
        {
          "name": "node",
          "type": "objectmodel::BaseNode *"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "removeInNode",
      "return_type": "bool",
      "params": [
        {
          "name": "node",
          "type": "objectmodel::BaseNode *"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    }
  ],
  "description": "The `VisualLoop` component in the SOFA framework is responsible for managing steps related to drawing and rendering visual elements within the simulation scene. It inherits from `VisualModel`, indicating that it focuses on the visualization aspect of simulations. The primary role of `VisualLoop` is to handle initialization (`initStep`), update (`updateStep`), context updates (`updateContextStep`), and rendering (`drawStep`) steps, all of which are triggered with a `sofa::core::visual::VisualParams*` parameter for specific visual configurations.\n\n`VisualLoop` also provides methods to compute the bounding box of the scene (`computeBBoxStep`). It ensures that it can be inserted into or removed from a node in the SOFA scene graph using `insertInNode` and `removeInNode`. These methods facilitate the management of visualization components within the hierarchical structure of the simulation environment.\n\nThe component is designed to be unique within the root node of the scene, ensuring that visual visitors are managed correctly. The interactions with other components primarily involve receiving `VisualParams`, which provide necessary parameters for rendering and visualization.",
  "maths": "The `VisualLoop` component in the SOFA framework is primarily responsible for managing visualization steps within the simulation scene. It does not directly contribute to the governing equations or operators typically associated with finite element methods (FEM), such as mass matrix \\(M\\), stiffness matrix \\(K\\), internal force \\(f_{int}\\), residual \\(R\\), etc. Instead, its role is focused on the rendering and visualization of the simulation results.\n\n### Governing Equations or Operators\n- **Mass Matrix \\(M\\)**: Not applicable.\n- **Stiffness Matrix \\(K\\)**: Not applicable.\n- **Internal Force \\(f_{int}\\)**: Not applicable.\n- **Residual \\(R\\)**: Not applicable.\n\n### Constitutive or Kinematic Laws Involved\n- **Strain Measures**: Not applicable.\n- **Stress Tensors**: Not applicable.\n- **Hyperelastic Potentials**: Not applicable.\n- **Damping Models**: Not applicable.\n- **Constraint Jacobians**: Not applicable.\n\n### Role in the Global FEM Pipeline\nThe `VisualLoop` component plays a role in the visualization aspect of the simulation, which is separate from the core FEM pipeline. Its primary responsibilities include:\n- **Initialization (`initStep`)**: Initializes textures and other visual elements.\n- **Update (`updateStep`)**: Updates the visual models by triggering mappings that transform mechanical data into visual representations.\n- **Context Update (`updateContextStep`)**: Ensures context updates are performed if necessary, such as when root flags are modified.\n- **Rendering (`drawStep`)**: Renders the scene based on the current visual parameters and configurations.\n- **Bounding Box Computation (`computeBBoxStep`)**: Computes the bounding box of the scene for visibility checks and other rendering optimizations.\n\n### Numerical Methods or Discretization Choices\nThe `VisualLoop` does not encode any numerical methods or discretization choices that are typically associated with FEM. Instead, it focuses on visual representation and rendering, which involve operations such as texture mapping, shading, and scene graph management.\n\n### Fit into the Broader Variational / Lagrangian Mechanics Framework\nThe `VisualLoop` does not contribute directly to the variational or Lagrangian mechanics framework used in FEM simulations. Its role is ancillary, providing a means to visualize the results of these physical simulations. The component ensures that visual data is properly managed and rendered, allowing users to observe and interact with the simulation output.\n\nIn summary, `VisualLoop` is a visualization management component in SOFA, designed to handle rendering steps but does not participate in the core mathematical or physical computations typical of FEM-based mechanical simulations.",
  "abstract": "`VisualLoop` manages visualization steps in SOFA simulations, including initialization, updates, context updates, rendering, and bounding box computation.",
  "sheet": "# VisualLoop\n\n## Overview\nThe `VisualLoop` component is responsible for managing the visualization aspects of a simulation within the SOFA framework. It handles various stages such as initialization (`initStep`), updating visual models (`updateStep`), updating context (`updateContextStep`), rendering (`drawStep`), and computing bounding boxes (`computeBBoxStep`). This component ensures that visual data is properly managed and rendered, allowing users to observe and interact with the simulation output.\n\n## Dependencies and Connections\nThe `VisualLoop` typically requires a `sofa::core::visual::VisualParams*` object for specific visual configurations. It interacts with other components in the scene graph by being inserted into or removed from nodes using methods like `insertInNode` and `removeInNode`. These interactions facilitate the management of visualization components within the hierarchical structure of the simulation environment.\n\n## Practical Notes\nThe `VisualLoop` is designed to be unique within the root node of the scene, ensuring that visual visitors are managed correctly. Care should be taken when configuring `VisualParams` to ensure proper rendering and visualization. The component does not directly contribute to core mathematical or physical computations typical of FEM-based simulations but plays a crucial role in providing visual feedback."
}