Open CASCADE Technology  7.3.0
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
OpenGl_FrameStats Class Reference

Class storing the frame statistics. More...

#include <OpenGl_FrameStats.hxx>

Inheritance diagram for OpenGl_FrameStats:
Inheritance graph
[legend]

Public Types

enum  Counter {
  Counter_NbLayers = 0, Counter_NbLayersNotCulled, Counter_NbStructs, Counter_NbStructsNotCulled,
  Counter_NbGroupsNotCulled, Counter_NbElemsNotCulled, Counter_NbElemsFillNotCulled, Counter_NbElemsLineNotCulled,
  Counter_NbElemsPointNotCulled, Counter_NbElemsTextNotCulled, Counter_NbTrianglesNotCulled, Counter_NbPointsNotCulled,
  Counter_EstimatedBytesGeom, Counter_EstimatedBytesFbos, Counter_EstimatedBytesTextures
}
 Stats counter. More...
 
enum  { Counter_NB = Counter_EstimatedBytesTextures + 1 }
 
- Public Types inherited from Standard_Transient
typedef void base_type
 Returns a type descriptor about this object. More...
 

Public Member Functions

 OpenGl_FrameStats ()
 Default constructor. More...
 
virtual ~OpenGl_FrameStats ()
 Destructor. More...
 
Standard_Real UpdateInterval () const
 Returns interval in seconds for updating meters across several frames; 1 second by default. More...
 
void SetUpdateInterval (Standard_Real theInterval)
 Sets interval in seconds for updating values. More...
 
Standard_Boolean IsLongLineFormat () const
 Prefer longer lines over more greater of lines. More...
 
void SetLongLineFormat (Standard_Boolean theValue)
 Set if format should prefer longer lines over greater number of lines. More...
 
virtual void FrameStart (const Handle< OpenGl_Workspace > &theWorkspace=Handle< OpenGl_Workspace >())
 Frame redraw started. More...
 
virtual void FrameEnd (const Handle< OpenGl_Workspace > &theWorkspace=Handle< OpenGl_Workspace >())
 Frame redraw finished. More...
 
virtual TCollection_AsciiString FormatStats (Graphic3d_RenderingParams::PerfCounters theFlags) const
 Returns formatted string. More...
 
Standard_Real FrameDuration () const
 Returns duration of the last frame in seconds. More...
 
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. More...
 
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). More...
 
Standard_Size CounterValue (OpenGl_FrameStats::Counter theCounter) const
 Returns value of specified counter, cached between stats updates. Should NOT be called between ::FrameStart() and ::FrameEnd() calls. More...
 
Standard_Boolean HasCulledLayers () const
 Returns TRUE if some Layers have been culled. More...
 
Standard_Boolean HasCulledStructs () const
 Returns TRUE if some structures have been culled. More...
 
virtual Standard_Boolean IsEqual (const Handle< OpenGl_FrameStats > &theOther) const
 Returns TRUE if this stats are equal to another. More...
 
virtual void CopyFrom (const Handle< OpenGl_FrameStats > &theOther)
 Copy stats values from another instance. More...
 
Standard_SizeChangeCounter (OpenGl_FrameStats::Counter theCounter)
 Returns value of specified counter for modification, should be called between ::FrameStart() and ::FrameEnd() calls. More...
 
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor. More...
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing. More...
 
Standard_Transientoperator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter. More...
 
virtual ~Standard_Transient ()
 Destructor must be virtual. More...
 
virtual void Delete () const
 Memory deallocator for transient classes. More...
 
virtual const opencascade::handle< Standard_Type > & DynamicType () const
 Returns a type descriptor about this object. More...
 
Standard_Boolean IsInstance (const opencascade::handle< Standard_Type > &theType) const
 Returns a true value if this is an instance of Type. More...
 
Standard_Boolean IsInstance (const Standard_CString theTypeName) const
 Returns a true value if this is an instance of TypeName. More...
 
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. More...
 
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. More...
 
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. More...
 
Standard_Integer GetRefCount () const
 Get the reference counter of this object. More...
 
void IncrementRefCounter () const
 Increments the reference counter of this object. More...
 
Standard_Integer DecrementRefCounter () const
 Decrements the reference counter of this object; returns the decremented value. More...
 

Protected Member Functions

virtual void updateStructures (Standard_Integer theViewId, const OpenGl_IndexedMapOfStructure &theStructures, Standard_Boolean theToCountElems, Standard_Boolean theToCountTris, Standard_Boolean theToCountMem)
 Updates counters for structures. More...
 

Protected Attributes

OSD_Timer myFpsTimer
 timer for FPS measurements More...
 
Standard_Real myFrameStartTime
 time at the beginning of frame redraw More...
 
Standard_Real myFrameDuration
 frame duration More...
 
Standard_Real myFps
 FPS meter (frames per seconds, elapsed time) More...
 
Standard_Real myFpsCpu
 CPU FPS meter (frames per seconds, CPU time) More...
 
Standard_Real myUpdateInterval
 interval to update meters More...
 
Standard_Size myFpsFrameCount
 FPS counter (within short measurement time slice) More...
 
Standard_Size myCounters [Counter_NB]
 counter values cached between updates More...
 
Standard_Size myCountersTmp [Counter_NB]
 counter values filled during More...
 
Standard_Boolean myIsLongLineFormat
 prefer longer lines over greater number of lines More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Standard_Transient
static const char * get_type_name ()
 Returns a type descriptor about this object. More...
 
static const opencascade::handle< Standard_Type > & get_type_descriptor ()
 Returns type descriptor of Standard_Transient class. More...
 

Detailed Description

Class storing the frame statistics.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
Counter_NB 

◆ Counter

Stats counter.

Enumerator
Counter_NbLayers 

number of ZLayers

Counter_NbLayersNotCulled 

number of not culled ZLayers

Counter_NbStructs 

number of defined OpenGl_Structure

Counter_NbStructsNotCulled 

number of not culled OpenGl_Structure

Counter_NbGroupsNotCulled 

number of not culled OpenGl_Group

Counter_NbElemsNotCulled 

number of not culled OpenGl_Element

Counter_NbElemsFillNotCulled 

number of not culled OpenGl_PrimitiveArray drawing triangles

Counter_NbElemsLineNotCulled 

number of not culled OpenGl_PrimitiveArray drawing lines

Counter_NbElemsPointNotCulled 

number of not culled OpenGl_PrimitiveArray drawing points

Counter_NbElemsTextNotCulled 

number of not culled OpenGl_Text

Counter_NbTrianglesNotCulled 

number of not culled (as structure) triangles

Counter_NbPointsNotCulled 

number of not culled (as structure) points

Counter_EstimatedBytesGeom 

estimated GPU memory used for geometry

Counter_EstimatedBytesFbos 

estimated GPU memory used for FBOs

Counter_EstimatedBytesTextures 

estimated GPU memory used for textures

Constructor & Destructor Documentation

◆ OpenGl_FrameStats()

OpenGl_FrameStats::OpenGl_FrameStats ( )

Default constructor.

◆ ~OpenGl_FrameStats()

virtual OpenGl_FrameStats::~OpenGl_FrameStats ( )
virtual

Destructor.

Member Function Documentation

◆ ChangeCounter()

Standard_Size& OpenGl_FrameStats::ChangeCounter ( OpenGl_FrameStats::Counter  theCounter)
inline

Returns value of specified counter for modification, should be called between ::FrameStart() and ::FrameEnd() calls.

◆ CopyFrom()

virtual void OpenGl_FrameStats::CopyFrom ( const Handle< OpenGl_FrameStats > &  theOther)
inlinevirtual

Copy stats values from another instance.

◆ CounterValue()

Standard_Size OpenGl_FrameStats::CounterValue ( OpenGl_FrameStats::Counter  theCounter) const
inline

Returns value of specified counter, cached between stats updates. Should NOT be called between ::FrameStart() and ::FrameEnd() calls.

◆ FormatStats()

virtual TCollection_AsciiString OpenGl_FrameStats::FormatStats ( Graphic3d_RenderingParams::PerfCounters  theFlags) const
virtual

Returns formatted string.

◆ FrameDuration()

Standard_Real OpenGl_FrameStats::FrameDuration ( ) const
inline

Returns duration of the last frame in seconds.

◆ FrameEnd()

virtual void OpenGl_FrameStats::FrameEnd ( const Handle< OpenGl_Workspace > &  theWorkspace = HandleOpenGl_Workspace >())
virtual

Frame redraw finished.

◆ FrameRate()

Standard_Real OpenGl_FrameStats::FrameRate ( ) const
inline

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.

◆ FrameRateCpu()

Standard_Real OpenGl_FrameStats::FrameRateCpu ( ) const
inline

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).

◆ FrameStart()

virtual void OpenGl_FrameStats::FrameStart ( const Handle< OpenGl_Workspace > &  theWorkspace = HandleOpenGl_Workspace >())
virtual

Frame redraw started.

◆ HasCulledLayers()

Standard_Boolean OpenGl_FrameStats::HasCulledLayers ( ) const
inline

Returns TRUE if some Layers have been culled.

◆ HasCulledStructs()

Standard_Boolean OpenGl_FrameStats::HasCulledStructs ( ) const
inline

Returns TRUE if some structures have been culled.

◆ IsEqual()

virtual Standard_Boolean OpenGl_FrameStats::IsEqual ( const Handle< OpenGl_FrameStats > &  theOther) const
inlinevirtual

Returns TRUE if this stats are equal to another.

◆ IsLongLineFormat()

Standard_Boolean OpenGl_FrameStats::IsLongLineFormat ( ) const
inline

Prefer longer lines over more greater of lines.

◆ SetLongLineFormat()

void OpenGl_FrameStats::SetLongLineFormat ( Standard_Boolean  theValue)
inline

Set if format should prefer longer lines over greater number of lines.

◆ SetUpdateInterval()

void OpenGl_FrameStats::SetUpdateInterval ( Standard_Real  theInterval)
inline

Sets interval in seconds for updating values.

◆ UpdateInterval()

Standard_Real OpenGl_FrameStats::UpdateInterval ( ) const
inline

Returns interval in seconds for updating meters across several frames; 1 second by default.

◆ updateStructures()

virtual void OpenGl_FrameStats::updateStructures ( Standard_Integer  theViewId,
const OpenGl_IndexedMapOfStructure theStructures,
Standard_Boolean  theToCountElems,
Standard_Boolean  theToCountTris,
Standard_Boolean  theToCountMem 
)
protectedvirtual

Updates counters for structures.

Field Documentation

◆ myCounters

Standard_Size OpenGl_FrameStats::myCounters[Counter_NB]
protected

counter values cached between updates

◆ myCountersTmp

Standard_Size OpenGl_FrameStats::myCountersTmp[Counter_NB]
protected

counter values filled during

◆ myFps

Standard_Real OpenGl_FrameStats::myFps
protected

FPS meter (frames per seconds, elapsed time)

◆ myFpsCpu

Standard_Real OpenGl_FrameStats::myFpsCpu
protected

CPU FPS meter (frames per seconds, CPU time)

◆ myFpsFrameCount

Standard_Size OpenGl_FrameStats::myFpsFrameCount
protected

FPS counter (within short measurement time slice)

◆ myFpsTimer

OSD_Timer OpenGl_FrameStats::myFpsTimer
protected

timer for FPS measurements

◆ myFrameDuration

Standard_Real OpenGl_FrameStats::myFrameDuration
protected

frame duration

◆ myFrameStartTime

Standard_Real OpenGl_FrameStats::myFrameStartTime
protected

time at the beginning of frame redraw

◆ myIsLongLineFormat

Standard_Boolean OpenGl_FrameStats::myIsLongLineFormat
protected

prefer longer lines over greater number of lines

◆ myUpdateInterval

Standard_Real OpenGl_FrameStats::myUpdateInterval
protected

interval to update meters


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