Orfeo Toolbox  4.0
itkProgressAccumulator.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef __itkProgressAccumulator_h
19 #define __itkProgressAccumulator_h
20 
21 #include "itkCommand.h"
22 #include "itkProcessObject.h"
23 #include <vector>
24 
25 namespace itk
26 {
40 class ITKCommon_EXPORT ProgressAccumulator:public Object
41 {
42 public:
45  typedef Object Superclass;
48 
52 
54  itkNewMacro(Self);
55 
57  itkTypeMacro(ProgressAccumulator, Object);
58 
60  itkGetConstMacro(AccumulatedProgress, float);
61 
63  itkSetObjectMacro(MiniPipelineFilter, ProcessObject);
64 
66  itkGetModifiableObjectMacro(MiniPipelineFilter, ProcessObject);
67 
81  void RegisterInternalFilter(GenericFilterType *filter, float weight);
82 
86  void UnregisterAllFilters();
87 
94 #if ! defined ( ITK_FUTURE_LEGACY_REMOVE )
95  void ResetProgress();
96 #endif
97 
110 #if ! defined ( ITK_FUTURE_LEGACY_REMOVE )
111  void ResetFilterProgressAndKeepAccumulatedProgress();
112 #endif
113 
114 protected:
116  virtual ~ProgressAccumulator();
117  void PrintSelf(std::ostream & s, Indent indent) const;
118 
119 private:
123 
125  struct FilterRecord {
126  // Pointer to the filter
128 
129  // The weight of the filter in total progress of the mini-pipeline
130  float Weight;
131 
132  // The tags for adding/removing observers to mini-pipeline filter
133  unsigned long ProgressObserverTag;
134  unsigned long StartObserverTag;
135  };
136 
138  void ReportProgress(Object *object, const EventObject & event);
139 
142 
144  typedef std::vector< struct FilterRecord > FilterRecordVector;
145 
148 
151 
157 
160 };
161 } // End namespace itk
162 
163 #endif // __itkProgressAccumulator_h_

Generated at Sat Mar 8 2014 15:23:52 for Orfeo Toolbox with doxygen 1.8.3.1