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

itkIterationReporter.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkIterationReporter.h,v $
00005   Language:  C++
00006   Date:      $Date: 2002/09/27 00:01:25 $
00007   Version:   $Revision: 1.1 $
00008 
00009   Copyright (c) 2002 Insight 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 _itkIterationReporter_h
00018 #define _itkIterationReporter_h
00019 
00020 #include "itkProcessObject.h"
00021 
00022 namespace itk
00023 {
00024 
00054 class IterationReporter
00055 {
00056 public:
00058   IterationReporter(ProcessObject* filter, int threadId,
00059                    unsigned long stepsPerUpdate = 100);
00060   
00062   ~IterationReporter() {};
00063   
00065   void CompletedStep()
00066     {
00067     // Inline implementation for efficiency.
00068     // We don't need to test for thread id 0 here because the
00069     // constructor sets m_StepsBeforeUpdate to a value larger than
00070     // the number of pixels for threads other than 0.
00071     if(--m_StepsBeforeUpdate == 0)
00072       {
00073       m_StepsBeforeUpdate = m_StepsPerUpdate;
00074       m_Filter->InvokeEvent( IterationEvent() );
00075       }
00076     }
00077 protected:
00078   ProcessObject* m_Filter;
00079   int m_ThreadId;
00080   unsigned long m_StepsPerUpdate;
00081   unsigned long m_StepsBeforeUpdate;
00082 };
00083 
00084 } // end namespace itk
00085 
00086 #endif

Generated at Wed Mar 12 01:13:03 2003 for ITK by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2000