VTK  9.1.0
vtkExecutionTimer.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkAppendFilter.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10 This software is distributed WITHOUT ANY WARRANTY; without even
11 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12 PURPOSE. See the above copyright notice for more information.
13
14=========================================================================*/
15
32#ifndef vtkExecutionTimer_h
33#define vtkExecutionTimer_h
34
35#include "vtkFiltersCoreModule.h" // For export macro
36#include "vtkObject.h"
37
38class vtkAlgorithm;
40
41class VTKFILTERSCORE_EXPORT vtkExecutionTimer : public vtkObject
42{
43public:
45 void PrintSelf(ostream& os, vtkIndent indent) override;
46
52
54
60 void SetFilter(vtkAlgorithm* filter);
61 vtkGetObjectMacro(Filter, vtkAlgorithm);
63
65
70 vtkGetMacro(ElapsedCPUTime, double);
72
74
79 vtkGetMacro(ElapsedWallClockTime, double);
81
82protected:
85
86 // This is the observer that will catch StartEvent and hand off to
87 // EventRelay
89
90 // This is the filter that will be timed
92
93 // These are where we keep track of the timestamps for start/end
95 double CPUEndTime;
96
99
102
104
110 void StopTimer();
112
117 virtual void TimerFinished();
118
124 static void EventRelay(
125 vtkObject* caller, unsigned long eventId, void* clientData, void* callData);
126
127private:
128 vtkExecutionTimer(const vtkExecutionTimer&) = delete;
129 void operator=(const vtkExecutionTimer&) = delete;
130};
131
132#endif
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:123
supports function callbacks
Time filter execution.
~vtkExecutionTimer() override
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static void EventRelay(vtkObject *caller, unsigned long eventId, void *clientData, void *callData)
This is the callback that VTK will invoke when it sees StartEvent and EndEvent.
static vtkExecutionTimer * New()
Construct a new timer with no attached filter.
void SetFilter(vtkAlgorithm *filter)
Set/get the filter to be monitored.
vtkCallbackCommand * Callback
virtual void TimerFinished()
This is where you can do anything you want with the progress event.
vtkAlgorithm * Filter
void StopTimer()
Convenience functions – StartTimer clears out the elapsed times and records start times; StopTimer re...
void StartTimer()
Convenience functions – StartTimer clears out the elapsed times and records start times; StopTimer re...
a simple class to control print indentation
Definition: vtkIndent.h:113
abstract base class for most VTK objects
Definition: vtkObject.h:82