Orfeo Toolbox  4.0
itkXMLFilterWatcher.h
Go to the documentation of this file.
1 /*=========================================================================
2  *
3  * Copyright Insight Software Consortium
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0.txt
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  *=========================================================================*/
18 #ifndef __itkXMLFilterWatcher_h
19 #define __itkXMLFilterWatcher_h
20 
21 #include "itkSimpleFilterWatcher.h"
22 
23 namespace itk
24 {
32 {
33 public:
34  XMLFilterWatcher(ProcessObject *o, const char *comment = ""):
35  SimpleFilterWatcher(o, comment) {}
36 
37 protected:
38 
40  virtual void ShowProgress()
41  {
42  if ( this->GetProcess() )
43  {
44  int steps = this->GetSteps();
45  steps++;
46  this->SetSteps(steps);
47  if ( !this->GetQuiet() )
48  {
49  std::cout << "<filter-progress>"
50  << this->GetProcess()->GetProgress()
51  << "</filter-progress>"
52  << std::endl;
53  std::cout << std::flush;
54  }
55  }
56  }
57 
59  virtual void StartFilter()
60  {
61  this->SetSteps(0);
62  this->SetIterations(0);
63  this->GetTimeProbe().Start();
64  if ( !this->GetQuiet() )
65  {
66  std::cout << "<filter-start>"
67  << std::endl;
68  std::cout << "<filter-name>"
69  << ( this->GetProcess()
70  ? this->GetProcess()->GetNameOfClass() : "None" )
71  << "</filter-name>"
72  << std::endl;
73  std::cout << "<filter-comment>"
74  << " \"" << this->GetComment() << "\" "
75  << "</filter-comment>"
76  << std::endl;
77  std::cout << "</filter-start>"
78  << std::endl;
79  std::cout << std::flush;
80  }
81  }
82 
84  virtual void EndFilter()
85  {
86  }
87 };
88 } // end namespace itk
89 
90 #endif

Generated at Sat Mar 8 2014 15:48:30 for Orfeo Toolbox with doxygen 1.8.3.1