Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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(ProcessObject* o, const char *comment="")
00034 : SimpleFilterWatcher(o, comment) {};
00035
00036 protected:
00037
00039 virtual void ShowProgress()
00040 {
00041 if (this->GetProcess())
00042 {
00043 int steps = this->GetSteps();
00044 steps++;
00045 this->SetSteps(steps);
00046 if (!this->GetQuiet())
00047 {
00048 std::cout << "<filter-progress>"
00049 << this->GetProcess()->GetProgress()
00050 << "</filter-progress>"
00051 << std::endl;
00052 std::cout << std::flush;
00053 }
00054 }
00055 }
00057
00059 virtual void StartFilter()
00060 {
00061 this->SetSteps(0);
00062 this->SetIterations(0);
00063 this->GetTimeProbe().Start();
00064 if (!this->GetQuiet())
00065 {
00066 std::cout << "<filter-start>"
00067 << std::endl;
00068 std::cout << "<filter-name>"
00069 << (this->GetProcess()
00070 ? this->GetProcess()->GetNameOfClass() : "None")
00071 << "</filter-name>"
00072 << std::endl;
00073 std::cout << "<filter-comment>"
00074 << " \"" << this->GetComment() << "\" "
00075 << "</filter-comment>"
00076 << std::endl;
00077 std::cout << "</filter-start>"
00078 << std::endl;
00079 std::cout << std::flush;
00080 }
00081 }
00083
00085 virtual void EndFilter()
00086 {
00087 #if 0
00088 this-GetTimeProbe().Stop();
00089 if (!this->GetQuiet())
00090 {
00091 std::cout << "<filter-end>"
00092 << std::endl;
00093 std::cout << "<filter-name>"
00094 << (this->GetProcess()
00095 ? this->GetProcess()->GetNameOfClass() : "None")
00096 << "</filter-name>"
00097 << std::endl;
00098 std::cout << "<filter-time>"
00099 << this->GetTimeProbe().GetMeanTime()
00100 << "</filter-time>"
00101 << std::endl;
00102 std::cout << "</filter-end>";
00103 std::cout << std::flush;
00104 }
00105 #endif
00106 }
00107 };
00109
00110 }
00111
00112 #endif
00113