Back

SimpleDataWidget

sofa::qt::SimpleDataWidget
Doc (from source)

This class manages the GUI of a BaseData, using the corresponding instance of data_widget_container

Abstract (AI generated)

The SimpleDataWidget class manages the graphical user interface representation for BaseData objects, facilitating real-time interaction with simulation parameters in a Qt-based environment.

Metadata
module
sofa.qt.SimpleDataWidget.cpp
namespace
sofa::qt
include
sofa/qt/SimpleDataWidget.h
description

The SimpleDataWidget class in the SOFA framework does not directly implement any governing equations, operators, constitutive or kinematic laws, nor does it play a role in the core FEM simulation pipeline such as assembly, time integration, nonlinear solve, linear solve, constraint handling, or mappings. It is purely an interface component for managing the GUI representation of BaseData objects.

Mathematical and Physical Description:

SimpleDataWidget serves as a graphical user interface (GUI) manager within the SOFA framework. Its primary function is to provide visual interaction capabilities for inspecting and modifying simulation parameters that are represented by instances of BaseData. This component does not contribute to any mathematical or physical formulations related to finite element analysis, constitutive laws, or numerical methods.

Key Methods:*
-
createWidgets: Creates GUI widgets to represent data fields.
-
setDataReadOnly/setReadOnly: Controls whether the widget can be edited by setting it as read-only or editable.
-
readFromData/writeToData: Updates the GUI based on the current state of BaseData and transfers changes back to corresponding data fields, respectively.
-
numColumnWidget**: Returns the number of columns needed for the layout of widgets.

These methods ensure that the GUI is synchronized with simulation parameters, enabling users to interact with simulation settings in real-time. However, they do not involve any mathematical or physical computations intrinsic to FEM simulations.

Methods
bool createWidgets () virtual
void setDataReadOnly (bool readOnly) virtual
void readFromData () virtual
void setReadOnly (bool readOnly) virtual
void writeToData () virtual
unsigned int numColumnWidget () virtual
{
  "name": "SimpleDataWidget",
  "namespace": "sofa::qt",
  "module": "sofa.qt.SimpleDataWidget.cpp",
  "include": "sofa/qt/SimpleDataWidget.h",
  "doc": "This class manages the GUI of a BaseData, using the corresponding instance of data_widget_container",
  "inherits": [],
  "templates": [],
  "data_fields": [],
  "links": [],
  "methods": [
    {
      "name": "createWidgets",
      "return_type": "bool",
      "params": [],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "setDataReadOnly",
      "return_type": "void",
      "params": [
        {
          "name": "readOnly",
          "type": "bool"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "readFromData",
      "return_type": "void",
      "params": [],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "setReadOnly",
      "return_type": "void",
      "params": [
        {
          "name": "readOnly",
          "type": "bool"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "writeToData",
      "return_type": "void",
      "params": [],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "numColumnWidget",
      "return_type": "unsigned int",
      "params": [],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    }
  ],
  "description": "The **SimpleDataWidget** class in the SOFA framework manages the graphical user interface (GUI) representation for a `BaseData` object, leveraging an instance of a data widget container to facilitate interactions. This component is part of the `sofa::qt` namespace and serves as an essential element for integrating GUI functionalities with simulation parameters within the Qt-based environment.\n\n**Role in SOFA Ecosystem:**\nThe primary purpose of **SimpleDataWidget** is to provide a visual interface for inspecting and modifying data fields that are crucial for simulations. It acts as a bridge between the underlying simulation logic (handled by `BaseData` objects) and the user, allowing for real-time interaction.\n\n**Interactions with Other Components:**\nThe class interacts with other SOFA components through several virtual methods:\n- **createWidgets**: Creates GUI widgets to represent data fields.\n- **setDataReadOnly**: Controls whether the widget can be edited by setting it as read-only or editable.\n- **readFromData**: Updates the GUI based on the current state of the `BaseData` object.\n- **setReadOnly**: Similar to `setDataReadOnly`, this method controls the editability of widgets.\n- **writeToData**: Transfers changes made in the GUI back to the corresponding data fields.\n- **numColumnWidget**: Returns the number of columns needed for widget layout.\n\nThese methods ensure that the GUI is synchronized with simulation parameters and vice versa, enabling seamless interaction between users and simulations.\n\n**Practical Usage Guidance:**\nThe `SimpleDataWidget` component is used to provide a visual interface for managing data within SOFA. It allows developers to easily create widgets for different types of data and control their behavior (e.g., read-only state). By leveraging these methods, users can customize the interaction with simulation parameters through the GUI.",
  "maths": "The **SimpleDataWidget** class in the SOFA framework does not directly implement any governing equations, operators, constitutive or kinematic laws, nor does it play a role in the core FEM simulation pipeline such as assembly, time integration, nonlinear solve, linear solve, constraint handling, or mappings. It is purely an interface component for managing the GUI representation of `BaseData` objects.\n\n### Mathematical and Physical Description:\n\n**SimpleDataWidget** serves as a graphical user interface (GUI) manager within the SOFA framework. Its primary function is to provide visual interaction capabilities for inspecting and modifying simulation parameters that are represented by instances of `BaseData`. This component does not contribute to any mathematical or physical formulations related to finite element analysis, constitutive laws, or numerical methods.\n\n**Key Methods:*\n- **createWidgets**: Creates GUI widgets to represent data fields.\n- **setDataReadOnly/setReadOnly**: Controls whether the widget can be edited by setting it as read-only or editable.\n- **readFromData/writeToData**: Updates the GUI based on the current state of `BaseData` and transfers changes back to corresponding data fields, respectively.\n- **numColumnWidget**: Returns the number of columns needed for the layout of widgets.\n\nThese methods ensure that the GUI is synchronized with simulation parameters, enabling users to interact with simulation settings in real-time. However, they do not involve any mathematical or physical computations intrinsic to FEM simulations.",
  "abstract": "The SimpleDataWidget class manages the graphical user interface representation for BaseData objects, facilitating real-time interaction with simulation parameters in a Qt-based environment.",
  "sheet": "# SimpleDataWidget\n\n## Overview\nThe **SimpleDataWidget** class in the SOFA framework is responsible for managing the GUI representation of `BaseData` objects. It provides methods to create widgets, control their read-only state, and synchronize data between the GUI and simulation parameters.\n\n## Dependencies and Connections\nThis component interacts with other SOFA components through several virtual methods:\n- **createWidgets**: Creates GUI widgets to represent data fields.\n- **setDataReadOnly/setReadOnly**: Controls whether the widget can be edited by setting it as read-only or editable.\n- **readFromData/writeToData**: Updates the GUI based on the current state of `BaseData` and transfers changes back to corresponding data fields, respectively.\n- **numColumnWidget**: Returns the number of columns needed for the layout of widgets."
}