Orfeo Toolbox  3.16
itkProgressAccumulator.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Insight Segmentation & Registration Toolkit
4  Module: $RCSfile: itkProgressAccumulator.h,v $
5  Language: C++
6  Date: $Date: 2009-04-25 12:24:12 $
7  Version: $Revision: 1.12 $
8 
9  Copyright (c) Insight Software Consortium. All rights reserved.
10  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
11 
12  This software is distributed WITHOUT ANY WARRANTY; without even
13  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14  PURPOSE. See the above copyright notices for more information.
15 
16 =========================================================================*/
17 #ifndef __itkProgressAccumulator_h
18 #define __itkProgressAccumulator_h
19 
20 #include "itkCommand.h"
21 #include "itkObject.h"
22 #include "itkProcessObject.h"
23 #include <vector>
24 
25 namespace itk {
26 
40 {
41 public:
44  typedef Object Superclass;
47 
51 
53  itkNewMacro(Self);
54 
56  itkTypeMacro(ProgressAccumulator,Object);
57 
59  itkGetConstMacro(AccumulatedProgress,float);
60 
62  itkSetObjectMacro(MiniPipelineFilter,ProcessObject);
63 
65  itkGetConstObjectMacro(MiniPipelineFilter,ProcessObject);
66 
71  void RegisterInternalFilter(GenericFilterType *filter, float weight);
72 
76  void UnregisterAllFilters();
77 
83  void ResetProgress();
84  void ResetFilterProgressAndKeepAccumulatedProgress();
85 
86 protected:
88  virtual ~ProgressAccumulator();
89  void PrintSelf(std::ostream &s, Indent indent) const;
90 
91 private:
95 
97  struct FilterRecord
98  {
99  // Pointer to the filter
101 
102  // The weight of the filter in total progress of the mini-pipeline
103  float Weight;
104 
105  // The tags for adding/removing observers to mini-pipeline filter
106  unsigned long ProgressObserverTag;
107  unsigned long IterationObserverTag;
108 
109  // The progress accumulated by the filter since last Reset()
110  float Progress;
111  };
112 
114  void ReportProgress(Object * object, const EventObject & event);
115 
118 
120  typedef std::vector<struct FilterRecord> FilterRecordVector;
121 
124 
127 
133 
136 };
137 
138 } // End namespace itk
139 
140 #endif // __itkProgressAccumulator_h_

Generated at Sun Feb 3 2013 00:00:03 for Orfeo Toolbox with doxygen 1.8.1.1