VTK  9.2.6
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
35#ifndef vtkExecutionTimer_h
36#define vtkExecutionTimer_h
37
38#include "vtkFiltersCoreModule.h" // For export macro
39#include "vtkObject.h"
40
41class vtkAlgorithm;
43
44class VTKFILTERSCORE_EXPORT vtkExecutionTimer : public vtkObject
45{
46public:
48 void PrintSelf(ostream& os, vtkIndent indent) override;
49
55
57
63 void SetFilter(vtkAlgorithm* filter);
64 vtkGetObjectMacro(Filter, vtkAlgorithm);
66
68
73 vtkGetMacro(ElapsedCPUTime, double);
75
77
82 vtkGetMacro(ElapsedWallClockTime, double);
84
85protected:
88
89 // This is the observer that will catch StartEvent and hand off to
90 // EventRelay
92
93 // This is the filter that will be timed
95
96 // These are where we keep track of the timestamps for start/end
98 double CPUEndTime;
99
102
105
107
113 void StopTimer();
115
120 virtual void TimerFinished();
121
127 static void EventRelay(
128 vtkObject* caller, unsigned long eventId, void* clientData, void* callData);
129
130private:
131 vtkExecutionTimer(const vtkExecutionTimer&) = delete;
132 void operator=(const vtkExecutionTimer&) = delete;
133};
134
135#endif
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:63
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:40
abstract base class for most VTK objects
Definition: vtkObject.h:63