Orfeo Toolbox
3.16
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
OTB
Code
Common
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
47
FilterWatcherBase
(
itk::ProcessObject
* process,
48
const
char
*comment =
""
);
49
51
FilterWatcherBase
();
52
54
FilterWatcherBase
(
const
FilterWatcherBase
&);
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
69
itk::ProcessObject
*
GetProcess
()
70
{
71
return
m_Process
.
GetPointer
();
72
}
73
75
std::string
GetComment
()
76
{
77
return
m_Comment
;
78
}
79
81
itk::TimeProbe
&
GetTimeProbe
()
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
124
itk::TimeProbe
m_TimeProbe
;
125
127
std::string
m_Comment
;
128
130
itk::ProcessObject::Pointer
m_Process
;
131
133
typedef
itk::SimpleMemberCommand<FilterWatcherBase>
CommandType
;
134
136
CommandType::Pointer
m_StartFilterCommand
;
137
139
CommandType::Pointer
m_EndFilterCommand
;
140
142
CommandType::Pointer
m_ProgressFilterCommand
;
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 Sun Feb 3 2013 00:22:42 for
Orfeo Toolbox
with
doxygen 1.8.1.1