Back

VisualTransform

sofa::component::visual::VisualTransform
VisualModel
Doc (from source)

Visually apply a (translation,rotation) transformation to visual elements rendering within a node or a sub-graph. Visually apply a (translation,rotation) transformation to visual elements rendering within a node or a sub-graph. This can be used to change where elements are rendered, but has no effect on the actual simulation. It can be used for example to correctly render forcefields applied to a mesh that is then transformed by a rigid DOF using DeformableOnRigidFrameMapping.

Abstract (AI generated)

The `VisualTransform` applies visual transformations (translation, rotation) to elements within a node or sub-graph without affecting simulation mechanics.

Metadata
module
Sofa.Component.Visual
namespace
sofa::component::visual
include
sofa/component/visual/VisualTransform.h
inherits
  • VisualModel
description

The VisualTransform component in the SOFA framework is designed for visual purposes only, with no impact on the simulation mechanics. It applies a (translation, rotation) transformation to visual elements rendering within a node or sub-graph. The transformations are purely visual and do not alter the actual physical behavior of the elements.

Governing Equations and Operators

The VisualTransform component does not contribute to any governing equations or operators that directly influence the simulation mechanics such as the mass matrix $M$, stiffness matrix $K$, internal force $f_{int}$, residual $R$, etc. Instead, it operates on visual parameters to modify how elements are rendered.

Constitutive and Kinematic Laws

There are no constitutive or kinematic laws involved in this component since its role is purely visual. The transformations applied are defined through a coordinate (Coord) object which represents the desired translation and rotation.

Role in the Global FEM Pipeline

In the broader context of the FEM simulation pipeline, VisualTransform plays no part in assembly, time integration, nonlinear solve, linear solve, constraint handling, or mapping. Its role is limited to modifying the visualization parameters without affecting any physical computations.

Numerical Methods and Discretization Choices

The component uses OpenGL matrix operations for applying transformations. Specifically, it utilizes pushMatrix and multMatrix methods from the visual drawing tool (drawTool) to apply the specified transformation to the rendering pipeline. The transformations are applied through a stack-based mechanism managed by the nbpush variable.

Integration into Variational / Lagrangian Mechanics Framework

Since VisualTransform is purely for visualization, it does not fit into the variational or Lagrangian mechanics framework. Its operation is decoupled from the physical simulation and only affects how visual elements are rendered to the user.

Data Fields
NameTypeDefaultHelp
d_transform Coord Transformation to apply
d_recursive bool True to apply transform to all nodes below
Methods
void fwdDraw (sofa::core::visual::VisualParams * vparams) virtual
void bwdDraw (sofa::core::visual::VisualParams * vparams) virtual
void draw (const sofa::core::visual::VisualParams * vparams) virtual
void doDrawVisual (const sofa::core::visual::VisualParams * vparams) virtual
void drawTransparent (const sofa::core::visual::VisualParams * vparams) virtual
void push (const sofa::core::visual::VisualParams * vparams)
void pop (const sofa::core::visual::VisualParams * vparams)
{
  "name": "VisualTransform",
  "namespace": "sofa::component::visual",
  "module": "Sofa.Component.Visual",
  "include": "sofa/component/visual/VisualTransform.h",
  "doc": "Visually apply a (translation,rotation) transformation to visual elements rendering within a node or a sub-graph.\n\nVisually apply a (translation,rotation) transformation to visual elements rendering within a node or a sub-graph.\nThis can be used to change where elements are rendered, but has no effect on the actual simulation.\nIt can be used for example to correctly render forcefields applied to a mesh that is then transformed by a rigid DOF using DeformableOnRigidFrameMapping.",
  "inherits": [
    "VisualModel"
  ],
  "templates": [],
  "data_fields": [
    {
      "name": "d_transform",
      "type": "Coord",
      "xmlname": "transform",
      "help": "Transformation to apply"
    },
    {
      "name": "d_recursive",
      "type": "bool",
      "xmlname": "recursive",
      "help": "True to apply transform to all nodes below"
    }
  ],
  "links": [],
  "methods": [
    {
      "name": "fwdDraw",
      "return_type": "void",
      "params": [
        {
          "name": "vparams",
          "type": "sofa::core::visual::VisualParams *"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "bwdDraw",
      "return_type": "void",
      "params": [
        {
          "name": "vparams",
          "type": "sofa::core::visual::VisualParams *"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "draw",
      "return_type": "void",
      "params": [
        {
          "name": "vparams",
          "type": "const sofa::core::visual::VisualParams *"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "doDrawVisual",
      "return_type": "void",
      "params": [
        {
          "name": "vparams",
          "type": "const sofa::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 sofa::core::visual::VisualParams *"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "push",
      "return_type": "void",
      "params": [
        {
          "name": "vparams",
          "type": "const sofa::core::visual::VisualParams *"
        }
      ],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "pop",
      "return_type": "void",
      "params": [
        {
          "name": "vparams",
          "type": "const sofa::core::visual::VisualParams *"
        }
      ],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    }
  ],
  "description": "The `VisualTransform` component is part of the SOFA framework's visual module and inherits from `sofa::core::visual::VisualModel`. Its role is to apply visual transformations (translation and rotation) to elements within a node or sub-graph, affecting how these elements are rendered but not altering their simulation behavior. This component does not influence the actual simulation mechanics and can be used for visualization purposes, such as correctly rendering force fields applied to meshes that undergo rigid body transformations.\n\nThe `VisualTransform` interacts with other visual components through methods like `fwdDraw`, `bwdDraw`, `draw`, `doDrawVisual`, and `drawTransparent`. These methods operate on `sofa::core::visual::VisualParams` objects, which manage the drawing parameters for visualization. The transformations are applied using OpenGL matrix operations.\n\nThe component has two main data fields:\n- **transform**: A coordinate (`Coord`) that specifies the transformation to be applied.\n- **recursive**: A boolean flag indicating whether the transformation should apply recursively to all nodes below in the scene graph.\n\nPractical usage involves setting these data fields appropriately and ensuring that `VisualTransform` is correctly positioned within the node hierarchy for desired visualization effects.",
  "maths": "The `VisualTransform` component in the SOFA framework is designed for visual purposes only, with no impact on the simulation mechanics. It applies a (translation, rotation) transformation to visual elements rendering within a node or sub-graph. The transformations are purely visual and do not alter the actual physical behavior of the elements.\n\n### Governing Equations and Operators\nThe `VisualTransform` component does not contribute to any governing equations or operators that directly influence the simulation mechanics such as the mass matrix $M$, stiffness matrix $K$, internal force $f_{int}$, residual $R$, etc. Instead, it operates on visual parameters to modify how elements are rendered.\n\n### Constitutive and Kinematic Laws\nThere are no constitutive or kinematic laws involved in this component since its role is purely visual. The transformations applied are defined through a coordinate (`Coord`) object which represents the desired translation and rotation.\n\n### Role in the Global FEM Pipeline\nIn the broader context of the FEM simulation pipeline, `VisualTransform` plays no part in assembly, time integration, nonlinear solve, linear solve, constraint handling, or mapping. Its role is limited to modifying the visualization parameters without affecting any physical computations.\n\n### Numerical Methods and Discretization Choices\nThe component uses OpenGL matrix operations for applying transformations. Specifically, it utilizes `pushMatrix` and `multMatrix` methods from the visual drawing tool (`drawTool`) to apply the specified transformation to the rendering pipeline. The transformations are applied through a stack-based mechanism managed by the `nbpush` variable.\n\n### Integration into Variational / Lagrangian Mechanics Framework\nSince `VisualTransform` is purely for visualization, it does not fit into the variational or Lagrangian mechanics framework. Its operation is decoupled from the physical simulation and only affects how visual elements are rendered to the user.",
  "abstract": "The `VisualTransform` applies visual transformations (translation, rotation) to elements within a node or sub-graph without affecting simulation mechanics.",
  "sheet": "# VisualTransform\n\n**Overview**\n\nThe `VisualTransform` component is part of the SOFA framework's visual module and inherits from `sofa::core::visual::VisualModel`. Its role is to apply visual transformations (translation and rotation) to elements within a node or sub-graph, affecting how these elements are rendered but not altering their simulation behavior. This component does not influence the actual simulation mechanics and can be used for visualization purposes.\n\n**Parameters and Data**\n\n- **transform**: A coordinate (`Coord`) that specifies the transformation to be applied.\n- **recursive**: A boolean flag indicating whether the transformation should apply recursively to all nodes below in the scene graph."
}