Back

QGraphStatWidget

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

Base class to make graphes in the stat tab of the node widget TODO add gnuplot export

Abstract (AI generated)

`QGraphStatWidget` is a base class for creating graphs in the statistics tab of node widgets within SOFA, enabling visualization of simulation data over time.

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

The QGraphStatWidget is a base class within the SOFA framework that provides visualization functionalities for creating and displaying graphs in the statistics tab of node widgets. This component does not directly contribute to the mathematical or physical aspects of FEM simulation. Instead, it focuses on the graphical representation and monitoring of simulation data over time through various visualizations.

The primary purpose of QGraphStatWidget is to enable users to visualize and track simulation metrics such as displacement, velocity, internal forces, energy, etc., in a graphical format. It does not implement any governing equations, constitutive laws, or numerical methods related to FEM simulation directly. Instead, it serves as an interface for displaying data that could be derived from the results of FEM simulations.

The component provides several protected methods:
- setCurve(index, name, color): This method is used to define and manage curves within the graph, where each curve can have a unique identifier (index), label (name), and visual representation (color).
- updateYAxisBounds(value): This function updates the bounds of the y-axis based on the provided value, ensuring that all data points are visible within the plot.
- flushSeries(): This method is used to refresh or clear the current series data in the graph, facilitating dynamic updates during a simulation run.

Public virtual methods such as step() and stepImpl() are designed to be overridden by derived classes. These methods allow for specific graphing behaviors to be implemented, enabling customization of how data is visualized over time within the SOFA framework.

In summary, QGraphStatWidget does not contribute directly to the mathematical or physical modeling aspects of FEM simulations. It acts as a graphical interface component for displaying simulation results and metrics in a user-friendly manner.

Methods
const QMetaObject * metaObject () virtual
void * qt_metacast (const char * ) virtual
int qt_metacall (QMetaObject::Call , int , void ** ) virtual
QString tr (const char * s, const char * c, int n)
void step () virtual
void stepImpl () virtual
void setCurve (unsigned int index, const QString & name, const QColor & color)
void updateYAxisBounds (SReal value)
void flushSeries ()
{
  "name": "QGraphStatWidget",
  "namespace": "sofa::qt",
  "module": "sofa.qt.QGraphStatWidget.cpp",
  "include": "sofa/qt/QGraphStatWidget.h",
  "doc": "Base class to make graphes in the stat tab of the node widget\nTODO add gnuplot export",
  "inherits": [],
  "templates": [],
  "data_fields": [],
  "links": [],
  "methods": [
    {
      "name": "metaObject",
      "return_type": "const QMetaObject *",
      "params": [],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "qt_metacast",
      "return_type": "void *",
      "params": [
        {
          "name": "",
          "type": "const char *"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "qt_metacall",
      "return_type": "int",
      "params": [
        {
          "name": "",
          "type": "QMetaObject::Call"
        },
        {
          "name": "",
          "type": "int"
        },
        {
          "name": "",
          "type": "void **"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "tr",
      "return_type": "QString",
      "params": [
        {
          "name": "s",
          "type": "const char *"
        },
        {
          "name": "c",
          "type": "const char *"
        },
        {
          "name": "n",
          "type": "int"
        }
      ],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": true,
      "access": "public"
    },
    {
      "name": "step",
      "return_type": "void",
      "params": [],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "stepImpl",
      "return_type": "void",
      "params": [],
      "is_virtual": true,
      "is_pure_virtual": true,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "setCurve",
      "return_type": "void",
      "params": [
        {
          "name": "index",
          "type": "unsigned int"
        },
        {
          "name": "name",
          "type": "const QString &"
        },
        {
          "name": "color",
          "type": "const QColor &"
        }
      ],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "protected"
    },
    {
      "name": "updateYAxisBounds",
      "return_type": "void",
      "params": [
        {
          "name": "value",
          "type": "SReal"
        }
      ],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "protected"
    },
    {
      "name": "flushSeries",
      "return_type": "void",
      "params": [],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "protected"
    }
  ],
  "description": "The `QGraphStatWidget` is a base class within the SOFA framework designed to facilitate the creation and display of graphs in the statistics tab of node widgets. This component supports visualization functionalities, allowing users to monitor simulation data over time through graphical representations.\n\nIt provides protected methods such as `setCurve`, `updateYAxisBounds`, and `flushSeries` for managing curves, updating axis bounds, and flushing series data respectively. The class also includes public virtual methods like `step` and `stepImpl` that are intended to be overridden by derived classes to implement specific graphing behaviors.\n\nThe component does not explicitly inherit from other SOFA components but is part of the Qt integration within SOFA, indicating its role in providing graphical user interface (GUI) functionalities. It leverages Qt's meta-object system through virtual methods like `metaObject`, `qt_metacast`, and `qt_metacall` to enable dynamic type information and signal-slot mechanisms.\n\nPractical usage of this component involves creating derived classes that implement the graphing logic, setting up curves with specific names and colors using `setCurve`, updating axis bounds dynamically with `updateYAxisBounds`, and flushing data series as needed. The TODO comment in its documentation suggests potential future enhancements such as adding Gnuplot export functionality.",
  "maths": "The `QGraphStatWidget` is a base class within the SOFA framework that provides visualization functionalities for creating and displaying graphs in the statistics tab of node widgets. This component does not directly contribute to the mathematical or physical aspects of FEM simulation. Instead, it focuses on the graphical representation and monitoring of simulation data over time through various visualizations.\n\nThe primary purpose of `QGraphStatWidget` is to enable users to visualize and track simulation metrics such as displacement, velocity, internal forces, energy, etc., in a graphical format. It does not implement any governing equations, constitutive laws, or numerical methods related to FEM simulation directly. Instead, it serves as an interface for displaying data that could be derived from the results of FEM simulations.\n\nThe component provides several protected methods:\n- `setCurve(index, name, color)`: This method is used to define and manage curves within the graph, where each curve can have a unique identifier (`index`), label (`name`), and visual representation (`color`).\n- `updateYAxisBounds(value)`: This function updates the bounds of the y-axis based on the provided value, ensuring that all data points are visible within the plot.\n- `flushSeries()`: This method is used to refresh or clear the current series data in the graph, facilitating dynamic updates during a simulation run.\n\nPublic virtual methods such as `step()` and `stepImpl()` are designed to be overridden by derived classes. These methods allow for specific graphing behaviors to be implemented, enabling customization of how data is visualized over time within the SOFA framework.\n\nIn summary, `QGraphStatWidget` does not contribute directly to the mathematical or physical modeling aspects of FEM simulations. It acts as a graphical interface component for displaying simulation results and metrics in a user-friendly manner.",
  "abstract": "`QGraphStatWidget` is a base class for creating graphs in the statistics tab of node widgets within SOFA, enabling visualization of simulation data over time.",
  "sheet": "# QGraphStatWidget\n\n## Overview\n`QGraphStatWidget` serves as a base class to facilitate the creation and display of graphs in the statistics tab of node widgets within the SOFA framework. It supports visualization functionalities, allowing users to monitor simulation data over time through graphical representations.\n\n## Parameters and Data\nThis component does not expose any significant Data fields or parameters that control its behavior."
}