Orfeo Toolbox  4.0
otbFilterWatcherBase.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ORFEO Toolbox
4  Language: C++
5  Date: $Date$
6  Version: $Revision$
7 
8 
9  Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
10  See OTBCopyright.txt for details.
11 
12  Some parts of this code are derived from ITK. See ITKCopyright.txt
13  for details.
14 
15 
16  This software is distributed WITHOUT ANY WARRANTY; without even
17  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
18  PURPOSE. See the above copyright notices for more information.
19 
20 =========================================================================*/
21 #ifndef __otbFilterWatcherBase_h
22 #define __otbFilterWatcherBase_h
23 
24 #include "itkCommand.h"
25 #include "itkProcessObject.h"
26 #include "itkTimeProbe.h"
27 
28 namespace otb
29 {
30 
41 class /*ITK_EXPORT*/ FilterWatcherBase
42 {
43 public:
44 
48  const char *comment = "");
49 
52 
55 
57  void operator =(const FilterWatcherBase&);
58 
60  virtual ~FilterWatcherBase();
61 
62  const char *GetNameOfClass()
63  {
64  return (m_Process.GetPointer() ? m_Process->GetNameOfClass() : "None");
65  }
66 
70  {
71  return m_Process.GetPointer();
72  }
73 
75  std::string GetComment()
76  {
77  return m_Comment;
78  }
79 
82  {
83  return m_TimeProbe;
84  }
85 
86 protected:
87 
89  virtual void ShowProgressCallback()
90  {
91  this->ShowProgress();
92  }
93 
95  virtual void StartFilterCallback()
96  {
97  if (!m_Started)
98  {
99  this->StartFilter();
100  m_Started = true;
101  }
102  }
103 
105  virtual void EndFilterCallback()
106  {
107  if (!m_Ended)
108  {
109  this->EndFilter();
110  m_Ended = true;
111  }
112  }
113 
115  virtual void ShowProgress() = 0;
116 
118  virtual void StartFilter() = 0;
119 
121  virtual void EndFilter() = 0;
122 
125 
127  std::string m_Comment;
128 
131 
134 
137 
140 
143 
145  unsigned long m_StartTag;
146 
148  unsigned long m_EndTag;
149 
151  unsigned long m_ProgressTag;
152 
155  bool m_Started;
156 
159  bool m_Ended;
160 
161 private:
162 
163 };
164 
165 } // end namespace otb
166 
167 #endif

Generated at Sat Mar 8 2014 15:55:44 for Orfeo Toolbox with doxygen 1.8.3.1