SOFA API  1a4bb3e7
Open source framework for multi-physics simuation
sofa::gui::qt::ProfilerChartView Class Reference

#include <SofaWindowProfiler.h>

The ProfilerChartView class is a overide of QtCharts::QChartView to be able to catch mouse selection and update all widgets of. More...

Inheritance diagram for sofa::gui::qt::ProfilerChartView:

Detailed Description

The ProfilerChartView class is a overide of QtCharts::QChartView to be able to catch mouse selection and update all widgets of.

See also
SofaWindowProfiler Will also overide drawForeground to draw a line to show the selected step.

Protected Attributes

int m_bufferSize
 copy of the serie size to check if selection is not out of bound More...
 
QPointF m_lineSelect
 2D point of the line to draw the selection More...
 
QPointF m_lineOrigin
 
int m_pointSelected
 Step number selected on the graph. -1 if none. More...
 
int m_maxY
 Stored value of the Y axis max. More...
 

Public Member Functions

 ProfilerChartView (QChart *chart, QWidget *parent, int bufferSize)
 
void updateYMax (int y)
 method to update the max value of the Y axis (for line rendering). More...
 

Protected Member Functions

virtual void mousePressEvent (QMouseEvent *event)
 Overide to catch mouse selection on the graph. More...
 
virtual void drawForeground (QPainter *painter, const QRectF &rect)
 Overide to draw line at the step selected. More...
 

Signals

void pointSelected (int)
 signal emited when a step has been selected on the graph More...
 

Public Slots

void updateSelection (int x)
 method to update the selection on the graph. More...
 

Attribute details

◆ m_bufferSize

int sofa::gui::qt::ProfilerChartView::m_bufferSize
protected

copy of the serie size to check if selection is not out of bound

◆ m_lineOrigin

QPointF sofa::gui::qt::ProfilerChartView::m_lineOrigin
protected

◆ m_lineSelect

QPointF sofa::gui::qt::ProfilerChartView::m_lineSelect
protected

2D point of the line to draw the selection

◆ m_maxY

int sofa::gui::qt::ProfilerChartView::m_maxY
protected

Stored value of the Y axis max.

◆ m_pointSelected

int sofa::gui::qt::ProfilerChartView::m_pointSelected
protected

Step number selected on the graph. -1 if none.

Constructor details

◆ ProfilerChartView()

sofa::gui::qt::ProfilerChartView::ProfilerChartView ( QChart *  chart,
QWidget parent,
int  bufferSize 
)

Function details

◆ drawForeground()

void sofa::gui::qt::ProfilerChartView::drawForeground ( QPainter *  painter,
const QRectF &  rect 
)
protectedvirtual

Overide to draw line at the step selected.

◆ mousePressEvent()

void sofa::gui::qt::ProfilerChartView::mousePressEvent ( QMouseEvent *  event)
protectedvirtual

Overide to catch mouse selection on the graph.

◆ pointSelected

void sofa::gui::qt::ProfilerChartView::pointSelected ( int  )
signal

signal emited when a step has been selected on the graph

Parameters
intis the step number

◆ updateSelection

void sofa::gui::qt::ProfilerChartView::updateSelection ( int  x)
slot

method to update the selection on the graph.

◆ updateYMax()

void sofa::gui::qt::ProfilerChartView::updateYMax ( int  y)
inline

method to update the max value of the Y axis (for line rendering).