Open CASCADE Technology 7.8.0
Public Member Functions | Protected Member Functions
OpenGl_FrameStats Class Reference

Class storing the frame statistics. More...

#include <OpenGl_FrameStats.hxx>

Inheritance diagram for OpenGl_FrameStats:
Inheritance graph
[legend]

Public Member Functions

 OpenGl_FrameStats ()
 Default constructor.
 
virtual ~OpenGl_FrameStats ()
 Destructor.
 
virtual bool IsFrameUpdated (Handle< OpenGl_FrameStats > &thePrev) const
 Copy stats values into another instance (create new instance, if not exists). The main use of this method is to track changes in statistics (e.g. in conjunction with IsEqual() method).
 
- Public Member Functions inherited from Graphic3d_FrameStats
 Graphic3d_FrameStats ()
 Default constructor.
 
virtual ~Graphic3d_FrameStats ()
 Destructor.
 
Standard_Real UpdateInterval () const
 Returns interval in seconds for updating meters across several frames; 1 second by default.
 
void SetUpdateInterval (Standard_Real theInterval)
 Sets interval in seconds for updating values.
 
Standard_Boolean IsLongLineFormat () const
 Prefer longer lines over more greater of lines.
 
void SetLongLineFormat (Standard_Boolean theValue)
 Set if format should prefer longer lines over greater number of lines.
 
virtual void FrameStart (const Handle< Graphic3d_CView > &theView, bool theIsImmediateOnly)
 Frame redraw started.
 
virtual void FrameEnd (const Handle< Graphic3d_CView > &theView, bool theIsImmediateOnly)
 Frame redraw finished.
 
virtual TCollection_AsciiString FormatStats (Graphic3d_RenderingParams::PerfCounters theFlags) const
 Returns formatted string.
 
virtual void FormatStats (TColStd_IndexedDataMapOfStringString &theDict, Graphic3d_RenderingParams::PerfCounters theFlags) const
 Fill in the dictionary with formatted statistic info.
 
Standard_Real FrameDuration () const
 Returns duration of the last frame in seconds.
 
Standard_Real FrameRate () const
 Returns FPS (frames per seconds, elapsed time). This number indicates an actual frame rate averaged for several frames within UpdateInterval() duration, basing on a real elapsed time between updates.
 
Standard_Real FrameRateCpu () const
 Returns CPU FPS (frames per seconds, CPU time). This number indicates a PREDICTED frame rate, basing on CPU elapsed time between updates and NOT real elapsed time (which might include periods of CPU inactivity). Number is expected to be greater then actual frame rate returned by FrameRate(). Values significantly greater actual frame rate indicate that rendering is limited by GPU performance (CPU is stalled in-between), while values around actual frame rate indicate rendering being limited by CPU performance (GPU is stalled in-between).
 
Standard_Size CounterValue (Graphic3d_FrameStatsCounter theCounter) const
 Returns value of specified counter, cached between stats updates. Should NOT be called between FrameStart() and FrameEnd() calls.
 
Standard_Real TimerValue (Graphic3d_FrameStatsTimer theTimer) const
 Returns value of specified timer for modification, should be called between FrameStart() and FrameEnd() calls. Should NOT be called between FrameStart() and FrameEnd() calls.
 
Standard_Boolean HasCulledLayers () const
 Returns TRUE if some Layers have been culled.
 
Standard_Boolean HasCulledStructs () const
 Returns TRUE if some structures have been culled.
 
const Graphic3d_FrameStatsDataLastDataFrame () const
 Returns last data frame, cached between stats updates. Should NOT be called between FrameStart() and FrameEnd() calls.
 
Standard_Integer LastDataFrameIndex () const
 Returns last data frame index.
 
const NCollection_Array1< Graphic3d_FrameStatsData > & DataFrames () const
 Returns data frames.
 
NCollection_Array1< Graphic3d_FrameStatsData > & ChangeDataFrames ()
 Returns data frames.
 
Standard_SizeChangeCounter (Graphic3d_FrameStatsCounter theCounter)
 Returns value of specified counter for modification, should be called between FrameStart() and FrameEnd() calls.
 
Standard_RealChangeTimer (Graphic3d_FrameStatsTimer theTimer)
 Returns value of specified timer for modification, should be called between FrameStart() and FrameEnd() calls.
 
Graphic3d_FrameStatsDataTmpActiveDataFrame ()
 Returns currently filling data frame for modification, should be called between FrameStart() and FrameEnd() calls.
 
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor.
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing.
 
Standard_Transientoperator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter.
 
virtual ~Standard_Transient ()
 Destructor must be virtual.
 
virtual const opencascade::handle< Standard_Type > & DynamicType () const
 Returns a type descriptor about this object.
 
Standard_Boolean IsInstance (const opencascade::handle< Standard_Type > &theType) const
 Returns a true value if this is an instance of Type.
 
Standard_Boolean IsInstance (const Standard_CString theTypeName) const
 Returns a true value if this is an instance of TypeName.
 
Standard_Boolean IsKind (const opencascade::handle< Standard_Type > &theType) const
 Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism.
 
Standard_Boolean IsKind (const Standard_CString theTypeName) const
 Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism.
 
Standard_TransientThis () const
 Returns non-const pointer to this object (like const_cast). For protection against creating handle to objects allocated in stack or call from constructor, it will raise exception Standard_ProgramError if reference counter is zero.
 
Standard_Integer GetRefCount () const noexcept
 Get the reference counter of this object.
 
void IncrementRefCounter () noexcept
 Increments the reference counter of this object.
 
Standard_Integer DecrementRefCounter () noexcept
 Decrements the reference counter of this object; returns the decremented value.
 
virtual void Delete () const
 Memory deallocator for transient classes.
 

Protected Member Functions

virtual void updateStatistics (const Handle< Graphic3d_CView > &theView, bool theIsImmediateOnly) override
 Method to collect statistics from the View; called by FrameEnd().
 
virtual void updateStructures (Standard_Integer theViewId, const NCollection_IndexedMap< const Graphic3d_CStructure * > &theStructures, Standard_Boolean theToCountElems, Standard_Boolean theToCountTris, Standard_Boolean theToCountMem)
 Updates counters for structures.
 

Additional Inherited Members

- Public Types inherited from Standard_Transient
typedef void base_type
 Returns a type descriptor about this object.
 
- Static Public Member Functions inherited from Standard_Transient
static constexpr const charget_type_name ()
 Returns a type descriptor about this object.
 
static const opencascade::handle< Standard_Type > & get_type_descriptor ()
 Returns type descriptor of Standard_Transient class.
 
- Protected Attributes inherited from Graphic3d_FrameStats
OSD_Timer myFpsTimer
 timer for FPS measurements
 
Standard_Real myFrameStartTime
 time at the beginning of frame redraw
 
Standard_Real myFrameDuration
 frame duration
 
Standard_Real myUpdateInterval
 interval to update meters
 
Standard_Size myFpsFrameCount
 FPS counter (within short measurement time slice)
 
NCollection_Array1< Graphic3d_FrameStatsDatamyCounters
 data frames history
 
Graphic3d_FrameStatsDataTmp myCountersTmp
 data frame values filled to be filled between FrameStart() and FrameEnd() calls
 
Graphic3d_FrameStatsData myCountersMax
 data frame values with absolute maximum values in the history
 
Standard_Integer myLastFrameIndex
 last data frame index
 
Standard_Boolean myIsLongLineFormat
 prefer longer lines over greater number of lines
 

Detailed Description

Class storing the frame statistics.

Constructor & Destructor Documentation

◆ OpenGl_FrameStats()

OpenGl_FrameStats::OpenGl_FrameStats ( )

Default constructor.

◆ ~OpenGl_FrameStats()

virtual OpenGl_FrameStats::~OpenGl_FrameStats ( )
virtual

Destructor.

Member Function Documentation

◆ IsFrameUpdated()

virtual bool OpenGl_FrameStats::IsFrameUpdated ( Handle< OpenGl_FrameStats > &  thePrev) const
virtual

Copy stats values into another instance (create new instance, if not exists). The main use of this method is to track changes in statistics (e.g. in conjunction with IsEqual() method).

Returns
TRUE if frame data has been changed so that the presentation should be updated

◆ updateStatistics()

virtual void OpenGl_FrameStats::updateStatistics ( const Handle< Graphic3d_CView > &  theView,
bool  theIsImmediateOnly 
)
overrideprotectedvirtual

Method to collect statistics from the View; called by FrameEnd().

Implements Graphic3d_FrameStats.

◆ updateStructures()

virtual void OpenGl_FrameStats::updateStructures ( Standard_Integer  theViewId,
const NCollection_IndexedMap< const Graphic3d_CStructure * > &  theStructures,
Standard_Boolean  theToCountElems,
Standard_Boolean  theToCountTris,
Standard_Boolean  theToCountMem 
)
protectedvirtual

Updates counters for structures.


The documentation for this class was generated from the following file: