Orfeo Toolbox  3.16
itkXMLFilterWatcher.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Insight Segmentation & Registration Toolkit
4  Module: $RCSfile: itkXMLFilterWatcher.h,v $
5  Language: C++
6  Date: $Date: 2009-03-03 15:11:53 $
7  Version: $Revision: 1.6 $
8 
9  Copyright (c) Insight Software Consortium. All rights reserved.
10  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
11 
12  This software is distributed WITHOUT ANY WARRANTY; without even
13  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14  PURPOSE. See the above copyright notices for more information.
15 
16 =========================================================================*/
17 #ifndef __itkXMLFilterWatcher_h
18 #define __itkXMLFilterWatcher_h
19 
20 #include "itkSimpleFilterWatcher.h"
21 
22 namespace itk
23 {
24 
31 {
32 public:
33  XMLFilterWatcher(ProcessObject* o, const char *comment="")
34  : SimpleFilterWatcher(o, comment) {};
35 
36 protected:
37 
39  virtual void ShowProgress()
40  {
41  if (this->GetProcess())
42  {
43  int steps = this->GetSteps();
44  steps++;
45  this->SetSteps(steps);
46  if (!this->GetQuiet())
47  {
48  std::cout << "<filter-progress>"
49  << this->GetProcess()->GetProgress()
50  << "</filter-progress>"
51  << std::endl;
52  std::cout << std::flush;
53  }
54  }
55  }
56 
58  virtual void StartFilter()
59  {
60  this->SetSteps(0);
61  this->SetIterations(0);
62  this->GetTimeProbe().Start();
63  if (!this->GetQuiet())
64  {
65  std::cout << "<filter-start>"
66  << std::endl;
67  std::cout << "<filter-name>"
68  << (this->GetProcess()
69  ? this->GetProcess()->GetNameOfClass() : "None")
70  << "</filter-name>"
71  << std::endl;
72  std::cout << "<filter-comment>"
73  << " \"" << this->GetComment() << "\" "
74  << "</filter-comment>"
75  << std::endl;
76  std::cout << "</filter-start>"
77  << std::endl;
78  std::cout << std::flush;
79  }
80  }
81 
83  virtual void EndFilter()
84  {
85 #if 0
86  this-GetTimeProbe().Stop();
87  if (!this->GetQuiet())
88  {
89  std::cout << "<filter-end>"
90  << std::endl;
91  std::cout << "<filter-name>"
92  << (this->GetProcess()
93  ? this->GetProcess()->GetNameOfClass() : "None")
94  << "</filter-name>"
95  << std::endl;
96  std::cout << "<filter-time>"
97  << this->GetTimeProbe().GetMeanTime()
98  << "</filter-time>"
99  << std::endl;
100  std::cout << "</filter-end>";
101  std::cout << std::flush;
102  }
103 #endif
104  }
105 };
106 
107 } // end namespace itk
108 
109 #endif

Generated at Sun Feb 3 2013 00:15:23 for Orfeo Toolbox with doxygen 1.8.1.1