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

itkXMLFilterWatcher.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkXMLFilterWatcher.h,v $
00005   Language:  C++
00006   Date:      $Date: 2006/06/09 20:58:16 $
00007   Version:   $Revision: 1.2.2.1 $
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 __itkXMLFilterWatcher_h
00018 #define __itkXMLFilterWatcher_h
00019 
00020 #include "itkSimpleFilterWatcher.h"
00021 
00022 namespace itk
00023 {
00024 
00030 class XMLFilterWatcher: public SimpleFilterWatcher
00031 {
00032 public:
00033   XMLFilterWatcher(itk::ProcessObject* o, const char *comment="")
00034     : SimpleFilterWatcher(o, comment) {};
00035 
00036 protected:
00037 
00039 virtual void ShowProgress()
00040 {
00041   if (m_Process)
00042     {
00043     m_Steps++;
00044     if (!m_Quiet)
00045       {
00046       std::cout << "<filter-progress>"
00047                 << m_Process->GetProgress()
00048                 << "</filter-progress>"
00049                 << std::endl;
00050       std::cout << std::flush;
00051       }
00052     }
00053 }
00055 
00057 virtual void StartFilter()
00058 {
00059   m_Steps = 0;
00060   m_Iterations = 0;
00061   m_TimeProbe.Start();
00062   if (!m_Quiet)
00063     {
00064     std::cout << "<filter-start>"
00065               << std::endl;
00066     std::cout << "<filter-name>"
00067               << (m_Process.GetPointer()
00068                   ? m_Process->GetNameOfClass() : "None")
00069               << "</filter-name>"
00070               << std::endl;
00071     std::cout << "<filter-comment>"
00072               << " \"" << m_Comment << "\" "
00073               << "</filter-comment>"
00074               << std::endl;
00075     std::cout << "</filter-start>"
00076               << std::endl;
00077     std::cout << std::flush;
00078     }
00079 }
00081 
00083 virtual void EndFilter()
00084 {
00085   m_TimeProbe.Stop();
00086   if (!m_Quiet)
00087     {
00088     std::cout << "<filter-end>"
00089               << std::endl;
00090     std::cout << "<filter-name>"
00091               << (m_Process.GetPointer()
00092                   ? m_Process->GetNameOfClass() : "None")
00093               << "</filter-name>"
00094               << std::endl;
00095     std::cout << "<filter-time>"
00096               << m_TimeProbe.GetMeanTime()
00097               << "</filter-time>"
00098               << std::endl;
00099     std::cout << "</filter-end>";
00100     std::cout << std::flush;
00101     }
00102 }
00104 
00105 };
00106 
00107 } // end namespace itk
00108 
00109 #endif
00110 

Generated at Fri Sep 8 04:25:52 2006 for ITK by doxygen 1.4.7 written by Dimitri van Heesch, © 1997-2000