40#ifndef vtkRenderTimerLog_h
41#define vtkRenderTimerLog_h
44#include "vtkRenderingCoreModule.h"
54#define VTK_SCOPED_RENDER_EVENT(eventName, timer) VTK_SCOPED_RENDER_EVENT2(eventName, timer, _event)
61#define VTK_SCOPED_RENDER_EVENT2(eventName, timer, identifier) \
62 vtkRenderTimerLog::ScopedEventLogger identifier; \
65 std::ostringstream _eventNameStream; \
66 _eventNameStream << eventName; \
67 identifier = timer->StartScopedEvent(_eventNameStream.str()); \
71VTK_ABI_NAMESPACE_BEGIN
78 struct VTKRENDERINGCORE_EXPORT
Event
103 this->
Print(os, 0.f, threshMs, indent);
109 void Print(std::ostream& os,
float parentTime,
float threshMs,
vtkIndent indent);
113 struct VTKRENDERINGCORE_EXPORT
Frame
121 void Print(std::ostream& os,
float threshMs = 0.f);
167 virtual
void MarkFrame();
177 virtual
void MarkStartEvent(const
std::
string& name);
178 virtual
void MarkEndEvent();
184 virtual
bool FrameReady();
193 vtkSetMacro(LoggingEnabled,
bool);
194 vtkGetMacro(LoggingEnabled,
bool);
195 vtkBooleanMacro(LoggingEnabled,
bool);
203 vtkSetMacro(FrameLimit,
unsigned int);
204 vtkGetMacro(FrameLimit,
unsigned int);
210 virtual
void ReleaseGraphicsResources();
216 mutable
bool LoggingEnabled;
217 unsigned int FrameLimit;
a simple class to control print indentation
void Print(ostream &os)
Print an object to an ostream.
abstract base class for most VTK objects
Asynchronously measures GPU execution times for a series of events.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual bool IsSupported() VTK_FUTURE_CONST
Returns true if stream timings are implemented for the current graphics backend.
static vtkRenderTimerLog * New()
Container for a single timed event.
vtkTypeUInt64 EndTime
Times are in nanoseconds.
void Print(std::ostream &os, float parentTime, float threshMs, vtkIndent indent)
std::vector< Event > Events
Child events that occurred while this event was running.
float ElapsedTimeMilliseconds() const
void Print(std::ostream &os, float threshMs=0.f, vtkIndent indent=vtkIndent())
Print details of the event to a stream.
vtkTypeUInt64 StartTime
Times are in nanoseconds.
vtkTypeUInt64 ElapsedTimeNanoseconds() const
std::string Name
Event name.
float ElapsedTimeSeconds() const
Convenience methods to compute times.
Container for a frame's events.
std::vector< Event > Events
void Print(std::ostream &os, float threshMs=0.f)
Print details of all events in this frame to a stream.
RAII struct for logging events.
ScopedEventLogger(vtkRenderTimerLog *log)
ScopedEventLogger(ScopedEventLogger &&other) noexcept
ScopedEventLogger & operator=(ScopedEventLogger &&other) noexcept