SOFA API  1c8b807d
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:

  • plotting 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 AdvancedTimer 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 AdvancedTimer::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...
 
struct  CheckedSeries
 

Protected Attributes

QChart * m_chart
 Pointer to the chart Data. More...
 
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...
 
QLineSeriesm_series
 Series of step duration in ms to be plot on the graph. size =. More...
 
QLineSeriesm_selectionSeries
 Series of selection substep duration in ms to be plot on the graph. size =. More...
 
std::unordered_map< std::string, CheckedSeriesm_checkedSeries
 
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 AdvancedTimer recording. More...
 
void pushStepData ()
 main method to iterate on the AdvancedTimer 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...
 
QTreeWidgetItem * addTreeItem (AnimationSubStepData *subStep)
 Method to add new QTreeWidgetItem item inside the QTreeWidget using the data from. More...
 
QTreeWidgetItem * addTreeItem (const AnimationStepData *step)
 

Signals

void closeWindow (bool)
 

Public Slots

void closeEvent (QCloseEvent *) override
 
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...
 
void expandRootNodeOnly () const
 

Attribute details

◆ m_axisY

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

Pointer to Y Axis.

◆ m_bufferSize

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

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

◆ m_chart

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

Pointer to the chart Data.

◆ m_chartView

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

Pointer to the.

See also
ProfilerChartView class to handle chart drawing/selection

◆ m_checkedSeries

std::unordered_map<std::string, CheckedSeries> sofa::gui::qt::SofaWindowProfiler::m_checkedSeries
protected

◆ m_fpsMaxAxis

SReal sofa::gui::qt::SofaWindowProfiler::m_fpsMaxAxis
protected

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

◆ m_maxFps

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

Bigger step encountered in ms.

◆ m_profilingData

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

◆ m_selectedParentStep

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

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

◆ m_selectedStep

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

Name of the substep selected in the Tree.

◆ m_selectionSeries

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

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

See also
m_bufferSize

◆ m_series

QLineSeries* sofa::gui::qt::SofaWindowProfiler::m_series
protected

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

See also
m_bufferSize

◆ m_step

int sofa::gui::qt::SofaWindowProfiler::m_step
protected

Current animation step internally recorded.

Constructor details

◆ SofaWindowProfiler()

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

Function details

◆ activateATimer()

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

method called when window is shown to activate AdvancedTimer recording.

◆ addTreeItem() [1/2]

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

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

See also
AnimationSubStepData

◆ addTreeItem() [2/2]

QTreeWidgetItem * sofa::gui::qt::SofaWindowProfiler::addTreeItem ( const AnimationStepData step)
protected

◆ closeEvent

void sofa::gui::qt::SofaWindowProfiler::closeEvent ( QCloseEvent *  )
inlineoverrideslot

◆ closeWindow

void sofa::gui::qt::SofaWindowProfiler::closeWindow ( bool  )
signal

◆ createChart()

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

Method called at creation to init the chart.

◆ createTreeView()

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

Method called at creation to init the QTreeWidget.

◆ expandRootNodeOnly

void sofa::gui::qt::SofaWindowProfiler::expandRootNodeOnly ( ) const
slot

◆ onStepSelected

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

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

◆ pushStepData()

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

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

◆ resetGraph()

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

Method to clear all Data and reset graph.

◆ updateChart()

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

Method called at each iteration to update the chart.

◆ updateFromSelectedStep

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

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

◆ updateSummaryLabels

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

Method called when a given.

Parameters
stepis triggered to update summary information

◆ updateTree

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

Method called when a given.

Parameters
stepis triggered to update the QTreeView