52 #ifndef vtkRenderTimerLog_h
53 #define vtkRenderTimerLog_h
56 #include "vtkRenderingCoreModule.h"
66 #define VTK_SCOPED_RENDER_EVENT(eventName, timer) VTK_SCOPED_RENDER_EVENT2(eventName, timer, _event)
73 #define VTK_SCOPED_RENDER_EVENT2(eventName, timer, identifier) \
74 vtkRenderTimerLog::ScopedEventLogger identifier; \
77 std::ostringstream _eventNameStream; \
78 _eventNameStream << eventName; \
79 identifier = timer->StartScopedEvent(_eventNameStream.str()); \
89 struct VTKRENDERINGCORE_EXPORT
Event
114 this->
Print(os, 0.f, threshMs, indent);
120 void Print(std::ostream& os,
float parentTime,
float threshMs,
vtkIndent indent);
124 struct VTKRENDERINGCORE_EXPORT
Frame
132 void Print(std::ostream& os,
float threshMs = 0.f);
205 vtkGetMacro(LoggingEnabled,
bool);
206 vtkBooleanMacro(LoggingEnabled,
bool);
215 vtkGetMacro(FrameLimit,
unsigned int);
225 ~vtkRenderTimerLog() override;
227 mutable
bool LoggingEnabled;
228 unsigned int FrameLimit;
231 vtkRenderTimerLog(const vtkRenderTimerLog&) = delete;
232 void operator=(const vtkRenderTimerLog&) = delete;
235 #endif // vtkRenderTimerLog_h
float ElapsedTimeMilliseconds() const
abstract base class for most VTK objects
std::vector< Event > Events
vtkTypeUInt64 EndTime
Times are in nanoseconds.
ScopedEventLogger(vtkRenderTimerLog *log)
void Print(const std::vector< T > &input, const std::string &name)
Print a vector with an associated name.
virtual void MarkFrame()
Call to mark the start of a new frame, or the end of an old one.
ScopedEventLogger StartScopedEvent(const std::string &name)
Create a RAII scoped event.
static vtkRenderTimerLog * New()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
a simple class to control print indentation
void Print(std::ostream &os, float threshMs=0.f, vtkIndent indent=vtkIndent())
Print details of the event to a stream.
Container for a frame's events.
virtual void MarkStartEvent(const std::string &name)
Mark the beginning or end of an event.
vtkTypeUInt64 ElapsedTimeNanoseconds() const
virtual void MarkEndEvent()
Mark the beginning or end of an event.
vtkTypeUInt64 StartTime
Times are in nanoseconds.
virtual bool IsSupported() VTK_FUTURE_CONST
Returns true if stream timings are implemented for the current graphics backend.
virtual bool FrameReady()
Returns true if there are any frames ready with complete timing info.
RAII struct for logging events.
virtual void ReleaseGraphicsResources()
Releases any resources allocated on the graphics device.
float ElapsedTimeSeconds() const
Convenience methods to compute times.
std::string Name
Event name.
virtual Frame PopFirstReadyFrame()
Retrieve the first available frame's timing info.
Container for a single timed event.
std::vector< Event > Events
Child events that occurred while this event was running.
Asynchronously measures GPU execution times for a series of events.