Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkProgressAccumulator.h

Go to the documentation of this file.
00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkProgressAccumulator.h,v $ 00005 Language: C++ 00006 Date: $Date: 2003/09/10 14:29:23 $ 00007 Version: $Revision: 1.9 $ 00008 00009 Copyright (c) Insight Software Consortium. All rights reserved. 00010 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 #ifndef __itkProgressAccumulator_h_ 00018 #define __itkProgressAccumulator_h_ 00019 00020 #include "itkCommand.h" 00021 #include "itkObject.h" 00022 #include "itkProcessObject.h" 00023 #include <vector> 00024 00025 namespace itk { 00026 00039 class ITKCommon_EXPORT ProgressAccumulator : public Object 00040 { 00041 public: 00043 typedef ProgressAccumulator Self; 00044 typedef Object Superclass; 00045 typedef SmartPointer<Self> Pointer; 00046 typedef SmartPointer<const Self> ConstPointer; 00047 00049 typedef ProcessObject GenericFilterType; 00050 typedef GenericFilterType::Pointer GenericFilterPointer; 00051 00053 itkNewMacro(Self); 00054 00056 itkTypeMacro(ProgressAccumulator,Object); 00057 00059 itkGetMacro(AccumulatedProgress,float); 00060 00062 itkSetObjectMacro(MiniPipelineFilter,ProcessObject); 00063 00065 itkGetConstObjectMacro(MiniPipelineFilter,ProcessObject); 00066 00071 void RegisterInternalFilter(GenericFilterType *filter, float weight); 00072 00076 void UnregisterAllFilters(); 00077 00083 void ResetProgress(); 00084 void ResetFilterProgressAndKeepAccumulatedProgress(); 00085 00086 protected: 00087 ProgressAccumulator(); 00088 virtual ~ProgressAccumulator(); 00089 void PrintSelf(std::ostream &s, Indent indent) const; 00090 00091 private: 00093 typedef MemberCommand< Self > CommandType; 00094 typedef CommandType::Pointer CommandPointer; 00095 00097 struct FilterRecord 00098 { 00099 // Pointer to the filter 00100 GenericFilterPointer Filter; 00101 00102 // The weight of the filter in total progress of the mini-pipeline 00103 float Weight; 00104 00105 // The tags for adding/removing observers to mini-pipeline filter 00106 unsigned long ProgressObserverTag; 00107 unsigned long IterationObserverTag; 00108 00109 // The progress accumulated by the filter since last Reset() 00110 float Progress; 00111 }; 00112 00114 void ReportProgress(Object * object, const EventObject & event); 00115 00117 GenericFilterPointer m_MiniPipelineFilter; 00118 00120 typedef std::vector<struct FilterRecord> FilterRecordVector; 00121 00123 float m_AccumulatedProgress; 00124 00126 float m_BaseAccumulatedProgress; 00127 00132 FilterRecordVector m_FilterRecord; 00133 00135 CommandPointer m_CallbackCommand; 00136 }; 00137 00138 } // End namespace itk 00139 00140 #endif // __itkProgressAccumulator_h_ 00141

Generated at Sun Apr 1 02:41:25 2007 for ITK by doxygen 1.3.8 written by Dimitri van Heesch, © 1997-2000