Visual3DText
sofa::component::visual::Visual3DText
VisualModel
Doc (from source)
Display 3D camera-oriented text. Draw camera-oriented (billboard) 3D text
Abstract (AI generated)
The `Visual3DText` component in SOFA displays camera-oriented (billboard) 3D text within a simulation scene, providing textual annotations that remain readable from any viewer perspective.
Metadata
- module
- Sofa.Component.Visual
- namespace
- sofa::component::visual
- include
- sofa/component/visual/Visual3DText.h
- inherits
-
- VisualModel
- description
The Visual3DText component in the SOFA framework is primarily a visualization tool, designed to display camera-oriented (billboard) 3D text within a simulation scene. It does not directly contribute to any governing equations or operators related to the physical mechanics of deformable systems. Instead, it serves as an element for visual representation and annotation within the simulation environment.
Governing Equations and Operators:
- No Physical Governing Equations: The
Visual3DTextcomponent does not implement or contribute to any governing equations such as mass matrix $M$, stiffness matrix $K$, internal force $f_{int}$, residual $R$, etc. It is purely a visual element and does not participate in the mechanical simulation pipeline.
Constitutive or Kinematic Laws:
- No Constitutive Laws: There are no constitutive laws involved, as this component does not model any material behavior or stress-strain relationships.
- No Kinematic Laws: Similarly, there are no kinematic laws involved because
Visual3DTextis not responsible for describing motion or deformation of physical bodies in the simulation.
Role in Global FEM Pipeline:
- Assembly Phase: The component does not participate in assembling global mass and force matrices, nor does it contribute to element operators like internal forces or stiffness terms.
- Time Integration:
Visual3DTextis unrelated to time integration schemes such as implicit Euler or Newmark methods. - Nonlinear Resolution: It does not take part in nonlinear resolution procedures such as Newton-Raphson iterations or linearization steps.
- Linear Resolution: The component is not involved in solving linear systems, whether through iterative solvers like Conjugate Gradient or direct factorizations.
Numerical Methods and Discretization:
- Rendering Process:
Visual3DTextuses thecore::visual::VisualParamsinterface to render text at a specified position (d_position) with given scale (d_scale) and color (d_color). It does not involve any discretization methods typical of FEM, such as shape functions or numerical integration. - Depth Test: The component can perform depth testing based on the
d_depthTestflag to control visibility in complex scenes.
Variational / Lagrangian Mechanics Framework:
- No Contribution:
Visual3DTextdoes not fit into the broader variational / Lagrangian mechanics framework as it is purely a visualization component and has no role in the mechanical simulation of deformable bodies or their motion.
Data Fields
| Name | Type | Default | Help |
|---|---|---|---|
d_position |
type::Vec3 | |
3d position |
d_scale |
float | |
text scale |
d_color |
sofa::type::RGBAColor | |
text color. (default=[1.0,1.0,1.0,1.0]) |
d_depthTest |
bool | |
perform depth test |
Methods
void
init
()
virtual
void
reinit
()
virtual
void
doDrawVisual
(const core::visual::VisualParams * vparams)
virtual
void
drawTransparent
(const core::visual::VisualParams * vparams)
virtual
{
"name": "Visual3DText",
"namespace": "sofa::component::visual",
"module": "Sofa.Component.Visual",
"include": "sofa/component/visual/Visual3DText.h",
"doc": "Display 3D camera-oriented text.\n\nDraw camera-oriented (billboard) 3D text",
"inherits": [
"VisualModel"
],
"templates": [],
"data_fields": [
{
"name": "d_position",
"type": "type::Vec3",
"xmlname": "position",
"help": "3d position"
},
{
"name": "d_scale",
"type": "float",
"xmlname": "scale",
"help": "text scale"
},
{
"name": "d_color",
"type": "sofa::type::RGBAColor",
"xmlname": "color",
"help": "text color. (default=[1.0,1.0,1.0,1.0])"
},
{
"name": "d_depthTest",
"type": "bool",
"xmlname": "depthTest",
"help": "perform depth test"
}
],
"links": [],
"methods": [
{
"name": "init",
"return_type": "void",
"params": [],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "reinit",
"return_type": "void",
"params": [],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "doDrawVisual",
"return_type": "void",
"params": [
{
"name": "vparams",
"type": "const core::visual::VisualParams *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "drawTransparent",
"return_type": "void",
"params": [
{
"name": "vparams",
"type": "const core::visual::VisualParams *"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
}
],
"description": "The `Visual3DText` component in the SOFA framework is designed to display camera-oriented (billboard) 3D text within a simulation scene. It inherits from `VisualModel`, which indicates its role as a visual representation element. The primary purpose of this component is to provide textual information that remains oriented towards the camera, ensuring readability regardless of the viewer's perspective.\n\n### Interactions with Other Components:\n- **`core::visual::VisualParams`**: This interface provides drawing tools and parameters used by `doDrawVisual()` and `drawTransparent()`. These methods handle the actual rendering of the text on screen. \n- **Inheritance from `VisualModel`**: By inheriting from this class, `Visual3DText` integrates seamlessly into SOFA's visual pipeline, allowing for synchronized updates with other visual elements.\n\n### Data Fields:\n- **Position (`d_position`, type::Vec3)**: Specifies the 3D position of the text in the simulation space.\n- **Scale (`d_scale`, float)**: Controls the size of the displayed text relative to its default scale.\n- **Color (`d_color`, sofa::type::RGBAColor)**: Determines the color of the text with an alpha channel for transparency (default is white).\n- **Depth Test (`d_depthTest`, bool)**: A flag indicating whether depth testing should be performed, affecting how the text interacts visually with other 3D objects in terms of occlusion.\n\n### Usage Guidance:\nThe `Visual3DText` component is useful for adding textual annotations or labels to a simulation scene. It can be configured via its data fields to position and style the text appropriately. The methods like `doDrawVisual()` and `drawTransparent()` ensure that the text is rendered correctly based on the provided parameters, and the depth testing feature allows for controlled visibility in complex scenes.",
"maths": "The `Visual3DText` component in the SOFA framework is primarily a visualization tool, designed to display camera-oriented (billboard) 3D text within a simulation scene. It does not directly contribute to any governing equations or operators related to the physical mechanics of deformable systems. Instead, it serves as an element for visual representation and annotation within the simulation environment.\n\n### Governing Equations and Operators:\n- **No Physical Governing Equations**: The `Visual3DText` component does not implement or contribute to any governing equations such as mass matrix \\(M\\), stiffness matrix \\(K\\), internal force \\(f_{int}\\), residual \\(R\\), etc. It is purely a visual element and does not participate in the mechanical simulation pipeline.\n\n### Constitutive or Kinematic Laws:\n- **No Constitutive Laws**: There are no constitutive laws involved, as this component does not model any material behavior or stress-strain relationships.\n- **No Kinematic Laws**: Similarly, there are no kinematic laws involved because `Visual3DText` is not responsible for describing motion or deformation of physical bodies in the simulation.\n\n### Role in Global FEM Pipeline:\n- **Assembly Phase**: The component does not participate in assembling global mass and force matrices, nor does it contribute to element operators like internal forces or stiffness terms. \n- **Time Integration**: `Visual3DText` is unrelated to time integration schemes such as implicit Euler or Newmark methods.\n- **Nonlinear Resolution**: It does not take part in nonlinear resolution procedures such as Newton-Raphson iterations or linearization steps.\n- **Linear Resolution**: The component is not involved in solving linear systems, whether through iterative solvers like Conjugate Gradient or direct factorizations. \n\n### Numerical Methods and Discretization:\n- **Rendering Process**: `Visual3DText` uses the `core::visual::VisualParams` interface to render text at a specified position (`d_position`) with given scale (`d_scale`) and color (`d_color`). It does not involve any discretization methods typical of FEM, such as shape functions or numerical integration.\n- **Depth Test**: The component can perform depth testing based on the `d_depthTest` flag to control visibility in complex scenes.\n\n### Variational / Lagrangian Mechanics Framework:\n- **No Contribution**: `Visual3DText` does not fit into the broader variational / Lagrangian mechanics framework as it is purely a visualization component and has no role in the mechanical simulation of deformable bodies or their motion.\n",
"abstract": "The `Visual3DText` component in SOFA displays camera-oriented (billboard) 3D text within a simulation scene, providing textual annotations that remain readable from any viewer perspective.",
"sheet": "# Visual3DText\n\n## Overview\n\nThe `Visual3DText` component is a visualization tool designed to display camera-oriented (billboard) 3D text within the SOFA simulation environment. It inherits from `VisualModel`, ensuring seamless integration into the visual pipeline and synchronized updates with other visual elements.\n\n## Parameters and Data\n\n- **Position (`d_position`, type::Vec3)**: Specifies the 3D position of the text in the simulation space.\n- **Scale (`d_scale`, float)**: Controls the size of the displayed text relative to its default scale.\n- **Color (`d_color`, sofa::type::RGBAColor)**: Determines the color of the text with an alpha channel for transparency (default is white).\n- **Depth Test (`d_depthTest`, bool)**: A flag indicating whether depth testing should be performed, affecting how the text interacts visually with other 3D objects in terms of occlusion.\n\n## Practical Notes\n\nThe `Visual3DText` component is useful for adding textual annotations or labels to a simulation scene. The depth test feature allows for controlled visibility in complex scenes where occlusions need to be managed."
}