Back

ViewerSetting

sofa::component::setting::ViewerSetting
ConfigurationSetting
Doc (from source)

Configuration for the Viewer of your application. Class for the configuration of viewer settings.

Abstract (AI generated)

`ViewerSetting` configures visualization settings in SOFA simulations, including resolution, fullscreen mode, camera modes, object picking methods, and visual options for selected objects.

Metadata
module
Sofa.Component.Setting
namespace
sofa::component::setting
include
sofa/component/setting/ViewerSetting.h
inherits
  • ConfigurationSetting
description

The ViewerSetting component in the SOFA framework is primarily responsible for configuring various settings related to the visualization environment. This includes parameters such as resolution, fullscreen mode, camera modes, object picking methods, and visual settings for selected objects. However, it does not directly contribute to the governing equations or numerical methods used in finite element simulations. Therefore, from a mathematical and physical perspective, ViewerSetting is largely an I/O and GUI component with no direct role in the FEM pipeline or variational mechanics framework.

Mathematical Content

  • Governing Equations/Operators: None. The ViewerSetting does not implement any governing equations related to mass matrix M, stiffness matrix K, internal force $f_{int}$, residual R, etc.

Constitutive/Kinematic Laws Involved

  • Strain Measures, Stress Tensors, Hyperelastic Potentials, Damping Models: None. The component does not involve any constitutive or kinematic laws relevant to the deformation and motion of materials.

Role in the Global FEM Pipeline

  • Assembly, Time Integration, Nonlinear Solve, Linear Solve, Constraint Handling, Mapping: None. ViewerSetting is not involved in these aspects of the simulation process.

Numerical Methods or Discretization Choices

  • The component does not encode any numerical methods or discretization choices related to FEM simulations.

Integration into Variational/Lagrangian Mechanics Framework

  • Variational / Lagrangian Mechanics: None. ViewerSetting does not fit into the broader variational or Lagrangian mechanics framework as it is purely concerned with visualization settings and user interface configuration.
Data Fields
NameTypeDefaultHelp
d_resolution sofa::type::Vec<2, int> resolution of the Viewer
d_fullscreen bool Fullscreen mode
d_cameraMode sofa::helper::OptionsGroup Camera mode
d_objectPickingMethod sofa::helper::OptionsGroup The method used to pick objects
d_showSelectedNodeBoundingBox bool Show the bounding box of selected nodes
d_showSelectedObjectBoundingBox bool Show the bounding box when components selected
d_showSelectedObjectPositions bool Show the positions when a components with 'position' are selected
d_showSelectedObjectSurfaces bool Show the surfaces when components with surface topology are selected
d_showSelectedObjectVolumes bool Show the volumes when components with volume topology are selected
d_showSelectedObjectIndices bool Show the position's indices for components with positions are selected
d_selectedVisualScaling SReal Scale factor for the rendering of selected object
{
  "name": "ViewerSetting",
  "namespace": "sofa::component::setting",
  "module": "Sofa.Component.Setting",
  "include": "sofa/component/setting/ViewerSetting.h",
  "doc": "Configuration for the Viewer of your application.\n\nClass for the configuration of viewer settings.",
  "inherits": [
    "ConfigurationSetting"
  ],
  "templates": [],
  "data_fields": [
    {
      "name": "d_resolution",
      "type": "sofa::type::Vec<2, int>",
      "xmlname": "resolution",
      "help": "resolution of the Viewer"
    },
    {
      "name": "d_fullscreen",
      "type": "bool",
      "xmlname": "fullscreen",
      "help": "Fullscreen mode"
    },
    {
      "name": "d_cameraMode",
      "type": "sofa::helper::OptionsGroup",
      "xmlname": "Perspective",
      "help": "Camera mode"
    },
    {
      "name": "d_objectPickingMethod",
      "type": "sofa::helper::OptionsGroup",
      "xmlname": "Ray casting",
      "help": "The method used to pick objects"
    },
    {
      "name": "d_showSelectedNodeBoundingBox",
      "type": "bool",
      "xmlname": "showSelectedNodeBoundingBox",
      "help": "Show the bounding box of selected nodes"
    },
    {
      "name": "d_showSelectedObjectBoundingBox",
      "type": "bool",
      "xmlname": "showSelectedObjectBoundingBox",
      "help": "Show the bounding box when components selected"
    },
    {
      "name": "d_showSelectedObjectPositions",
      "type": "bool",
      "xmlname": "showSelectedObjectPositions",
      "help": "Show the positions when a components with 'position' are selected"
    },
    {
      "name": "d_showSelectedObjectSurfaces",
      "type": "bool",
      "xmlname": "showSelectedObjectSurfaces",
      "help": "Show the surfaces when components with surface topology are selected"
    },
    {
      "name": "d_showSelectedObjectVolumes",
      "type": "bool",
      "xmlname": "showSelectedObjectVolumes",
      "help": "Show the volumes when components with volume topology are selected"
    },
    {
      "name": "d_showSelectedObjectIndices",
      "type": "bool",
      "xmlname": "showSelectedObjectIndices",
      "help": "Show the position's indices for components with positions are selected"
    },
    {
      "name": "d_selectedVisualScaling",
      "type": "SReal",
      "xmlname": "showSelectedVisualScaling",
      "help": "Scale factor for the rendering of selected object"
    }
  ],
  "links": [],
  "methods": [],
  "description": "The `ViewerSetting` component in the SOFA framework is designed to configure various settings for the viewer, which is essential for visualizing simulations. This class inherits from `ConfigurationSetting`, indicating its role in setting up specific configurations for the visualization environment.\n\n### Interactions with Other Components\n- **Inheritance**: It inherits from `ConfigurationSetting`, suggesting it integrates with other configuration mechanisms within SOFA.\n- **Data Fields**: The component provides several data fields that can be configured through XML or programmatically. These include:\n  - Resolution of the Viewer (`resolution`).\n  - Fullscreen mode (`fullscreen`).\n  - Camera modes (Perspective vs. Orthographic) (`cameraMode`).\n  - Object picking methods (Ray casting vs. Selection Buffer) (`objectPickingMethod`).\n  - Options to show bounding boxes, positions, surfaces, volumes, and indices for selected nodes or objects.\n\n### Practical Usage Guidance\n- **Resolution**: Configures the resolution of the viewer window.\n- **Fullscreen Mode**: Enables or disables fullscreen mode.\n- **Camera Modes**: Allows switching between perspective and orthographic camera views.\n- **Object Picking Methods**: Provides options to pick objects via ray casting or selection buffer techniques.\n- **Visual Settings for Selected Objects**: Options to show bounding boxes, positions, surfaces, volumes, and indices for selected objects. Additionally, a scaling factor can be set for the rendering of selected objects.\n\n### Data Fields\n- `resolution`: The resolution of the viewer window (default: 800x600).\n- `fullscreen`: Enables or disables fullscreen mode (default: false).\n- `cameraMode`: Configures camera mode options such as Perspective and Orthographic (default: Perspective).\n- `objectPickingMethod`: Sets object picking method, either Ray casting or Selection Buffer (default: Ray casting).\n- Various boolean fields to control the display of bounding boxes, positions, surfaces, volumes, and indices for selected objects.\n- `selectedVisualScaling`: Scale factor for rendering selected objects (default: 0.02).",
  "maths": "The `ViewerSetting` component in the SOFA framework is primarily responsible for configuring various settings related to the visualization environment. This includes parameters such as resolution, fullscreen mode, camera modes, object picking methods, and visual settings for selected objects. However, it does not directly contribute to the governing equations or numerical methods used in finite element simulations. Therefore, from a mathematical and physical perspective, `ViewerSetting` is largely an I/O and GUI component with no direct role in the FEM pipeline or variational mechanics framework.\n\n### Mathematical Content\n- **Governing Equations/Operators**: None. The `ViewerSetting` does not implement any governing equations related to mass matrix M, stiffness matrix K, internal force \\(f_{int}\\), residual R, etc.\n\n### Constitutive/Kinematic Laws Involved\n- **Strain Measures, Stress Tensors, Hyperelastic Potentials, Damping Models**: None. The component does not involve any constitutive or kinematic laws relevant to the deformation and motion of materials.\n\n### Role in the Global FEM Pipeline\n- **Assembly**, **Time Integration**, **Nonlinear Solve**, **Linear Solve**, **Constraint Handling**, **Mapping**: None. `ViewerSetting` is not involved in these aspects of the simulation process.\n\n### Numerical Methods or Discretization Choices\n- The component does not encode any numerical methods or discretization choices related to FEM simulations.\n\n### Integration into Variational/Lagrangian Mechanics Framework\n- **Variational / Lagrangian Mechanics**: None. `ViewerSetting` does not fit into the broader variational or Lagrangian mechanics framework as it is purely concerned with visualization settings and user interface configuration.",
  "abstract": "`ViewerSetting` configures visualization settings in SOFA simulations, including resolution, fullscreen mode, camera modes, object picking methods, and visual options for selected objects.",
  "sheet": "# ViewerSetting\n\n## Overview\nThe `ViewerSetting` component is responsible for configuring various settings related to the viewer in SOFA simulations. It inherits from `ConfigurationSetting`, indicating its role in setting up specific configurations for the visualization environment.\n\n## Parameters and Data\n- **resolution**: The resolution of the viewer window (default: 800x600).\n- **fullscreen**: Enables or disables fullscreen mode (default: false).\n- **cameraMode**: Configures camera mode options such as Perspective and Orthographic (default: Perspective).\n- **objectPickingMethod**: Sets object picking method, either Ray casting or Selection Buffer (default: Ray casting).\n- **showSelectedNodeBoundingBox**: Shows the bounding box of selected nodes (default: false).\n- **showSelectedObjectBoundingBox**: Shows the bounding box when components are selected (default: false).\n- **showSelectedObjectPositions**: Shows the positions when a component with 'position' is selected (default: false).\n- **showSelectedObjectSurfaces**: Shows the surfaces when components with surface topology are selected (default: false).\n- **showSelectedObjectVolumes**: Shows the volumes when components with volume topology are selected (default: false).\n- **showSelectedObjectIndices**: Shows the position's indices for components with positions are selected (default: false).\n- **selectedVisualScaling**: Scale factor for rendering selected objects (default: 0.02).\n\n## Dependencies and Connections\n`ViewerSetting` is typically used in conjunction with other visualization-related components within the SOFA scene graph to configure the viewer settings appropriately."
}