SOFA API  c76874b7
Open source framework for multi-physics simuation
sofa::gui::qt::SofaWindowProfiler Class Reference

#include <SofaWindowProfiler.h>

The SofaWindowProfiler class This class is a QDialog widget to display information recorded by AdvancedTimer mechanism At each step, info will be gathered from the AdvancedTimer using class sofa::helper::StepData Info will be displayed by: More...

Inheritance diagram for sofa::gui::qt::SofaWindowProfiler:

Detailed Description

The SofaWindowProfiler class This class is a QDialog widget to display information recorded by AdvancedTimer mechanism At each step, info will be gathered from the AdvancedTimer using class sofa::helper::StepData Info will be displayed by:

  • ploting the step duration into a graph
  • Showing information duration/step number
  • Showing all substep of an animation step with their own duration in ms and the corresponding percentage over the whole step.

Classes

class  AnimationStepData
 The AnimationStepData internal class to store all info of a animation step recorded by advanceTimer Data stored/computed will be the step number, and the total time in ms of the step. All Data will then be stored inside a tree of. More...
 
class  AnimationSubStepData
 The AnimationSubStepData Internal class to store data for each step of the animation. Correspond to one AdvanceTimer::begin/end Data stored/computed will be step name, its time in ms and the corresponding % inside the whole step. the total ms and percentage it represent if this step has substeps. Buffer of AnimationSubStepData corresponding to its children substeps. More...
 

Protected Attributes

QtCharts::QChart * m_chart
 Pointer to the chart Data. More...
 
QtCharts::QValueAxis * m_axisY
 Pointer to Y Axis. More...
 
ProfilerChartViewm_chartView
 Pointer to the. More...
 
int m_step
 Current animation step internally recorded. More...
 
unsigned int m_bufferSize
 Size of the buffer data stored. (i.e number of stepData info stored) More...
 
SReal m_maxFps
 Bigger step encountered in ms. More...
 
SReal m_fpsMaxAxis
 Current Y max value of the graph (max ms encountered x1.1) More...
 
std::deque< AnimationStepData * > m_profilingData
 Buffer of. More...
 
QtCharts::QLineSeries * m_series
 Serie of step duration in ms to be plot on the graph. size =. More...
 
QtCharts::QLineSeries * m_selectionSeries
 Serie of selection substep duration in ms to be plot on the graph. size =. More...
 
std::string m_selectedStep
 Name of the substep selected in the Tree. More...
 
std::string m_selectedParentStep
 Name of the parent of the substep selected in the Tree. More...
 

Public Member Functions

 SofaWindowProfiler (QWidget *parent)
 
void activateATimer (bool activate)
 method called when window is shown to activate advanceTimer recording. More...
 
void pushStepData ()
 main method to iterate on the advanceTimer Data and update the info in the widgets More...
 
void resetGraph ()
 Method to clear all Data and reset graph. More...
 

Protected Member Functions

void createChart ()
 Method called at creation to init the chart. More...
 
void createTreeView ()
 Method called at creation to init the QTreeWidget. More...
 
void updateChart ()
 Method called at each iteration to update the chart. More...
 
void addTreeItem (AnimationSubStepData *subStep, QTreeWidgetItem *parent)
 Method to add new QTreeWidgetItem item inside the QTreeWidget using the data from. More...
 

Signals

void closeWindow (bool)
 

Public Slots

void closeEvent (QCloseEvent *)
 
void updateFromSelectedStep (int step)
 Method to update all widgets from select absisse on the graph. More...
 
void updateSummaryLabels (int step)
 Method called when a given. More...
 
void updateTree (int step)
 Method called when a given. More...
 
void onStepSelected (QTreeWidgetItem *item, int column)
 Method called when a QTreeWidgetItem is selected in the Tree view. More...
 

Attribute details

QtCharts::QValueAxis* sofa::gui::qt::SofaWindowProfiler::m_axisY
protected

Pointer to Y Axis.

unsigned int sofa::gui::qt::SofaWindowProfiler::m_bufferSize
protected

Size of the buffer data stored. (i.e number of stepData info stored)

QtCharts::QChart* sofa::gui::qt::SofaWindowProfiler::m_chart
protected

Pointer to the chart Data.

ProfilerChartView* sofa::gui::qt::SofaWindowProfiler::m_chartView
protected

Pointer to the.

See also
ProfilerChartView class to handle chart drawing/selection
SReal sofa::gui::qt::SofaWindowProfiler::m_fpsMaxAxis
protected

Current Y max value of the graph (max ms encountered x1.1)

SReal sofa::gui::qt::SofaWindowProfiler::m_maxFps
protected

Bigger step encountered in ms.

std::deque<AnimationStepData*> sofa::gui::qt::SofaWindowProfiler::m_profilingData
protected

Buffer of.

See also
AnimationStepData (data for each step), deque size correspond to
m_bufferSize
std::string sofa::gui::qt::SofaWindowProfiler::m_selectedParentStep
protected

Name of the parent of the substep selected in the Tree.

std::string sofa::gui::qt::SofaWindowProfiler::m_selectedStep
protected

Name of the substep selected in the Tree.

QtCharts::QLineSeries* sofa::gui::qt::SofaWindowProfiler::m_selectionSeries
protected

Serie of selection substep duration in ms to be plot on the graph. size =.

See also
m_bufferSize
QtCharts::QLineSeries* sofa::gui::qt::SofaWindowProfiler::m_series
protected

Serie of step duration in ms to be plot on the graph. size =.

See also
m_bufferSize
int sofa::gui::qt::SofaWindowProfiler::m_step
protected

Current animation step internally recorded.

Constructor details

sofa::gui::qt::SofaWindowProfiler::SofaWindowProfiler ( QWidget parent)

Function details

void sofa::gui::qt::SofaWindowProfiler::activateATimer ( bool  activate)

method called when window is shown to activate advanceTimer recording.

void sofa::gui::qt::SofaWindowProfiler::addTreeItem ( AnimationSubStepData subStep,
QTreeWidgetItem *  parent 
)
protected

Method to add new QTreeWidgetItem item inside the QTreeWidget using the data from.

See also
AnimationSubStepData
void sofa::gui::qt::SofaWindowProfiler::closeEvent ( QCloseEvent *  )
inlineslot
void sofa::gui::qt::SofaWindowProfiler::closeWindow ( bool  )
signal
void sofa::gui::qt::SofaWindowProfiler::createChart ( )
protected

Method called at creation to init the chart.

void sofa::gui::qt::SofaWindowProfiler::createTreeView ( )
protected

Method called at creation to init the QTreeWidget.

void sofa::gui::qt::SofaWindowProfiler::onStepSelected ( QTreeWidgetItem *  item,
int  column 
)
slot

Method called when a QTreeWidgetItem is selected in the Tree view.

void sofa::gui::qt::SofaWindowProfiler::pushStepData ( )

main method to iterate on the advanceTimer Data and update the info in the widgets

void sofa::gui::qt::SofaWindowProfiler::resetGraph ( )

Method to clear all Data and reset graph.

void sofa::gui::qt::SofaWindowProfiler::updateChart ( )
protected

Method called at each iteration to update the chart.

void sofa::gui::qt::SofaWindowProfiler::updateFromSelectedStep ( int  step)
slot

Method to update all widgets from select absisse on the graph.

void sofa::gui::qt::SofaWindowProfiler::updateSummaryLabels ( int  step)
slot

Method called when a given.

Parameters
stepis triggered to update summary information
void sofa::gui::qt::SofaWindowProfiler::updateTree ( int  step)
slot

Method called when a given.

Parameters
stepis triggered to update the QTreeView