DefaultVisualManagerLoop
Manager of the visual loop, created by default when the user does not define one in the scene. Default VisualManager Loop to be created when no VisualManager found on simulation::node.
The `DefaultVisualManagerLoop` manages the visual loop in SOFA simulations when no custom VisualManager is defined, handling initialization, updates, drawing, and bounding box calculations.
- module
- Sofa.framework.Simulation.Core
- namespace
- sofa::simulation
- include
- sofa/simulation/DefaultVisualManagerLoop.h
- inherits
-
- VisualLoop
- description
The DefaultVisualManagerLoop is a key component in the SOFA framework responsible for managing the visual loop when no custom VisualManager is defined by the user. It primarily interacts with the scene's rendering process and does not directly involve mathematical or physical models used in simulations like those found in mechanics, fluid dynamics, or other computational physics domains. Instead, it focuses on the visualization pipeline stages such as initialization, updates, drawing, and bounding box calculations.
Initialization (initStep)
- Purpose: Initializes textures and performs initial visual updates.
- Process: Triggers
VisualInitVisitorandVisualUpdateVisitorto set up the scene's visual elements and perform necessary initializations before rendering begins.
Updates (updateStep, updateContextStep)
- Purpose: Ensures that the visual models are updated according to the current state of the simulation or animation.
- Process:
updateStep()executesVisualUpdateVisitorto trigger updates on mappings and other visual components.updateContextStep()usesUpdateVisualContextVisitorto update contexts required for accurate rendering, especially if root flags are modified.
Drawing (drawStep)
- Purpose: Handles the actual rendering of the scene using either default or custom VisualManagers.
- Process:
- Checks if any custom
VisualManageris defined; if not, it usesVisualDrawVisitorfor both standard and transparent passes to render the scene. - If a
VisualManagerexists, it iterates through each manager, performing pre-draw, draw, and post-draw operations to ensure consistent rendering.
Bounding Box Calculation (computeBBoxStep)
- Purpose: Computes the bounding box of the entire scene for each step to facilitate efficient culling and other visualization optimizations.
- Process:
- Executes
VisualComputeBBoxVisitoron the specified node (l_node) to compute the minimum and maximum bounds of the scene elements. - Updates the bounding box coordinates based on whether initialization is required or not.
Interaction with Other Components
The component interacts primarily through its methods with other SOFA components, particularly by executing various visual visitors (like VisualInitVisitor, VisualUpdateVisitor, etc.) on a specified node (l_node). This ensures that all relevant visual updates and renderings are performed within the correct scene hierarchy.
In summary, while DefaultVisualManagerLoop does not involve direct mathematical or physical models, it plays an essential role in managing the visualization pipeline to ensure accurate and efficient rendering of scenes in SOFA simulations.
Links
| Name | Type | Help |
|---|---|---|
l_node |
Link to the scene's node where the rendering will take place |
Methods
void
init
()
virtual
void
initStep
(sofa::core::visual::VisualParams * vparams)
virtual
void
updateStep
(sofa::core::visual::VisualParams * vparams)
virtual
void
updateContextStep
(sofa::core::visual::VisualParams * vparams)
virtual
void
drawStep
(sofa::core::visual::VisualParams * vparams)
virtual
void
computeBBoxStep
(sofa::core::visual::VisualParams * vparams, SReal * minBBox, SReal * maxBBox, bool init)
virtual
{
"name": "DefaultVisualManagerLoop",
"namespace": "sofa::simulation",
"module": "Sofa.framework.Simulation.Core",
"include": "sofa/simulation/DefaultVisualManagerLoop.h",
"doc": "Manager of the visual loop, created by default when the user does not define one in the scene.\n\nDefault VisualManager Loop to be created when no VisualManager found on simulation::node.",
"inherits": [
"VisualLoop"
],
"templates": [],
"data_fields": [],
"links": [
{
"name": "l_node",
"target": "Node",
"kind": "single",
"xmlname": "targetNode",
"help": "Link to the scene's node where the rendering will take place"
}
],
"methods": [
{
"name": "init",
"return_type": "void",
"params": [],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "initStep",
"return_type": "void",
"params": [
{
"name": "vparams",
"type": "sofa::core::visual::VisualParams *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "updateStep",
"return_type": "void",
"params": [
{
"name": "vparams",
"type": "sofa::core::visual::VisualParams *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "updateContextStep",
"return_type": "void",
"params": [
{
"name": "vparams",
"type": "sofa::core::visual::VisualParams *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "drawStep",
"return_type": "void",
"params": [
{
"name": "vparams",
"type": "sofa::core::visual::VisualParams *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "computeBBoxStep",
"return_type": "void",
"params": [
{
"name": "vparams",
"type": "sofa::core::visual::VisualParams *"
},
{
"name": "minBBox",
"type": "SReal *"
},
{
"name": "maxBBox",
"type": "SReal *"
},
{
"name": "init",
"type": "bool"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
}
],
"description": "The `DefaultVisualManagerLoop` is a core component in the SOFA framework, specifically designed for managing the visual loop when no custom VisualManager is defined by the user. It inherits from the `sofa::core::visual::VisualLoop` class and plays a crucial role in the scene's rendering process.\n\nThis component provides several methods to handle different stages of the visualization pipeline:\n- **Initialization**: `initStep()` initializes textures and performs initial visual updates.\n- **Updates**: `updateStep()`, `updateContextStep()` are responsible for updating the visual models and contexts, respectively.\n- **Drawing**: `drawStep()` handles rendering the scene using either default or custom VisualManagers.\n- **Bounding Box Calculation**: `computeBBoxStep()` computes the bounding box of the scene for each step.\n\nThe component interacts with other SOFA components through its methods, particularly by executing various visual visitors on a specified node (`l_node`). The primary link in this context is to a `Node` where rendering takes place. This ensures that all relevant visual updates and renderings are performed within the correct scene hierarchy.",
"maths": "The `DefaultVisualManagerLoop` is a key component in the SOFA framework responsible for managing the visual loop when no custom VisualManager is defined by the user. It primarily interacts with the scene's rendering process and does not directly involve mathematical or physical models used in simulations like those found in mechanics, fluid dynamics, or other computational physics domains. Instead, it focuses on the visualization pipeline stages such as initialization, updates, drawing, and bounding box calculations.\n\n### Initialization (`initStep`)\n- **Purpose**: Initializes textures and performs initial visual updates.\n- **Process**: Triggers `VisualInitVisitor` and `VisualUpdateVisitor` to set up the scene's visual elements and perform necessary initializations before rendering begins.\n\n### Updates (`updateStep`, `updateContextStep`)\n- **Purpose**: Ensures that the visual models are updated according to the current state of the simulation or animation.\n- **Process**:\n - `updateStep()` executes `VisualUpdateVisitor` to trigger updates on mappings and other visual components.\n - `updateContextStep()` uses `UpdateVisualContextVisitor` to update contexts required for accurate rendering, especially if root flags are modified.\n\n### Drawing (`drawStep`)\n- **Purpose**: Handles the actual rendering of the scene using either default or custom VisualManagers.\n- **Process**:\n - Checks if any custom `VisualManager` is defined; if not, it uses `VisualDrawVisitor` for both standard and transparent passes to render the scene.\n - If a `VisualManager` exists, it iterates through each manager, performing pre-draw, draw, and post-draw operations to ensure consistent rendering.\n\n### Bounding Box Calculation (`computeBBoxStep`)\n- **Purpose**: Computes the bounding box of the entire scene for each step to facilitate efficient culling and other visualization optimizations.\n- **Process**:\n - Executes `VisualComputeBBoxVisitor` on the specified node (`l_node`) to compute the minimum and maximum bounds of the scene elements.\n - Updates the bounding box coordinates based on whether initialization is required or not.\n\n### Interaction with Other Components\nThe component interacts primarily through its methods with other SOFA components, particularly by executing various visual visitors (like `VisualInitVisitor`, `VisualUpdateVisitor`, etc.) on a specified node (`l_node`). This ensures that all relevant visual updates and renderings are performed within the correct scene hierarchy.\n\nIn summary, while `DefaultVisualManagerLoop` does not involve direct mathematical or physical models, it plays an essential role in managing the visualization pipeline to ensure accurate and efficient rendering of scenes in SOFA simulations.",
"abstract": "The `DefaultVisualManagerLoop` manages the visual loop in SOFA simulations when no custom VisualManager is defined, handling initialization, updates, drawing, and bounding box calculations.",
"sheet": "# DefaultVisualManagerLoop\n\n## Overview\n\nThe `DefaultVisualManagerLoop` is a core component in the SOFA framework that manages the visual loop when no custom VisualManager is defined by the user. It handles various stages of the visualization pipeline including initialization (`initStep`), updates (`updateStep`, `updateContextStep`), drawing (`drawStep`), and bounding box calculations (`computeBBoxStep`).\n\n## Parameters and Data\n\nThe component has a single significant data field:\n- **l_node**: Link to the scene's node where rendering will take place.\n\n## Dependencies and Connections\n\nThis component interacts with other SOFA components through its methods by executing various visual visitors (like `VisualInitVisitor`, `VisualUpdateVisitor`, etc.) on a specified node (`l_node`). This ensures that all relevant visual updates and renderings are performed within the correct scene hierarchy.\n\n## Practical Notes\n\nThe `DefaultVisualManagerLoop` is designed to be used when no custom VisualManager is defined. It handles the visualization pipeline stages efficiently, ensuring accurate and consistent rendering of scenes in SOFA simulations."
}