VTK
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 
34 #ifndef vtkExecutionTimer_h
35 #define vtkExecutionTimer_h
36 
37 #include "vtkObject.h"
38 #include "vtkFiltersCoreModule.h" // For export macro
39 
40 class vtkAlgorithm;
41 class vtkCallbackCommand;
42 
44 {
45 public:
46  vtkTypeMacro(vtkExecutionTimer, vtkObject);
47  void PrintSelf(ostream& os, vtkIndent indent);
48 
51  static vtkExecutionTimer* New();
52 
54 
58  void SetFilter(vtkAlgorithm* filter);
59  vtkGetObjectMacro(Filter, vtkAlgorithm);
61 
63 
66  vtkGetMacro(ElapsedCPUTime, double);
68 
70 
73  vtkGetMacro(ElapsedWallClockTime, double);
75 
76 protected:
79 
80  // This is the observer that will catch StartEvent and hand off to
81  // EventRelay
83 
84  // This is the filter that will be timed
86 
87  // These are where we keep track of the timestamps for start/end
88  double CPUStartTime;
89  double CPUEndTime;
90 
93 
96 
98 
101  void StartTimer();
102  void StopTimer();
104 
107  virtual void TimerFinished();
108 
112  static void EventRelay(vtkObject* caller, unsigned long eventId, void* clientData, void* callData);
113 
114 private:
115  vtkExecutionTimer(const vtkExecutionTimer&); // Not implemented.
116  void operator=(const vtkExecutionTimer&); // Not implemented.
117 
118 };
119 
120 #endif
abstract base class for most VTK objects
Definition: vtkObject.h:61
vtkCallbackCommand * Callback
#define VTKFILTERSCORE_EXPORT
supports function callbacks
Superclass for all sources, filters, and sinks in VTK.
Definition: vtkAlgorithm.h:61
vtkAlgorithm * Filter
virtual void PrintSelf(ostream &os, vtkIndent indent)
a simple class to control print indentation
Definition: vtkIndent.h:38
Time filter execution.
static vtkObject * New()