SOFA API  6a688117
Open source framework for multi-physics simuation
sofa::gui::qt::QGraphStatWidget Class Reference

#include <QGraphStatWidget.h>

Inheritance diagram for sofa::gui::qt::QGraphStatWidget:

Detailed Description

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

Protected Attributes

unsigned _numberOfCurves
 
simulation::Node_node
 
std::vector< double_XHistory
 X-axis values (by default take the node time) More...
 
std::vector< std::vector< double > > _YHistory
 Y-axis values, one for each curve (_numberOfCurves) More...
 
QwtPlot * _graph
 
std::vector< QwtPlotCurve * > _curves
 resized to _numberOfCurves More...
 

Public Member Functions

 QGraphStatWidget (QWidget *parent, simulation::Node *node, const QString &title, unsigned numberOfCurves)
 
virtual ~QGraphStatWidget ()
 
virtual void step ()
 the only function that should be overloaded More...
 
void updateVisualization ()
 

Protected Member Functions

void setCurve (unsigned index, const QString &name, const QColor &color)
 set the index-th curve (index must be < _numberOfCurves) More...
 

Attribute details

std::vector< QwtPlotCurve* > sofa::gui::qt::QGraphStatWidget::_curves
protected

resized to _numberOfCurves

QwtPlot* sofa::gui::qt::QGraphStatWidget::_graph
protected
simulation::Node* sofa::gui::qt::QGraphStatWidget::_node
protected
unsigned sofa::gui::qt::QGraphStatWidget::_numberOfCurves
protected
std::vector< double > sofa::gui::qt::QGraphStatWidget::_XHistory
protected

X-axis values (by default take the node time)

std::vector< std::vector< double > > sofa::gui::qt::QGraphStatWidget::_YHistory
protected

Y-axis values, one for each curve (_numberOfCurves)

Constructor details

sofa::gui::qt::QGraphStatWidget::QGraphStatWidget ( QWidget parent,
simulation::Node node,
const QString &  title,
unsigned  numberOfCurves 
)
sofa::gui::qt::QGraphStatWidget::~QGraphStatWidget ( )
virtual

Function details

void sofa::gui::qt::QGraphStatWidget::setCurve ( unsigned  index,
const QString &  name,
const QColor &  color 
)
protected

set the index-th curve (index must be < _numberOfCurves)

void sofa::gui::qt::QGraphStatWidget::step ( )
virtual

the only function that should be overloaded

Reimplemented in sofa::gui::qt::QEnergyStatWidget, and sofa::gui::qt::QMomentumStatWidget.

void sofa::gui::qt::QGraphStatWidget::updateVisualization ( )