ITK
4.4.0
Insight Segmentation and Registration Toolkit
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
ITK
Modules
Core
Common
include
itkEventObject.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 __itkEventObject_h
19
#define __itkEventObject_h
20
21
#include "
itkIndent.h
"
22
23
namespace
itk
24
{
57
class
ITKCommon_EXPORT
EventObject
58
{
59
public
:
62
EventObject
() {}
63
64
EventObject
(
const
EventObject
&){}
65
67
virtual
~EventObject
() {}
68
71
virtual
EventObject
* MakeObject()
const
= 0;
72
76
virtual
void
Print(std::ostream & os)
const
;
77
79
virtual
const
char
* GetEventName(
void
)
const
= 0;
80
82
virtual
bool
CheckEvent(
const
EventObject
*)
const
= 0;
83
84
protected
:
89
virtual
void
PrintSelf(std::ostream & os,
Indent
indent)
const
;
90
91
virtual
void
PrintHeader(std::ostream & os,
Indent
indent)
const
;
92
93
virtual
void
PrintTrailer(std::ostream & os,
Indent
indent)
const
;
94
95
private
:
96
typedef
EventObject
*
EventFactoryFunction
( );
97
void
operator=(
const
EventObject
&);
98
};
99
101
inline
std::ostream &
operator<<
(std::ostream & os,
EventObject
&
e
)
102
{
103
( &
e
)->Print(os);
104
return
os;
105
}
107
108
109
#define ITKEvent_EXPORT ITKCommon_EXPORT
110
114
#define itkEventMacro(classname, super) \
115
116
\
120
#define itkEventMacro(classname, super) \
121
class ITKEvent_EXPORT classname:public super \
122
{ \
123
public: \
124
typedef classname Self; \
125
typedef super Superclass; \
126
classname() {} \
127
virtual ~classname() {} \
128
virtual const char *GetEventName() const { return #classname; } \
129
virtual bool CheckEvent(const::itk::EventObject * e) const \
130
{ return ( dynamic_cast< const Self * >( e ) != NULL ); } \
131
virtual::itk::EventObject *MakeObject() const \
132
{ return new Self; } \
133
classname(const Self &s):super(s){}; \
134
private: \
135
void operator=(const Self &); \
136
};
137
138
142
itkEventMacro
(
NoEvent
,
EventObject
)
143
itkEventMacro
(
AnyEvent
,
EventObject
)
144
itkEventMacro
(
DeleteEvent
, AnyEvent)
145
itkEventMacro
(
StartEvent
, AnyEvent)
146
itkEventMacro
(
EndEvent
, AnyEvent)
147
itkEventMacro
(
ProgressEvent
, AnyEvent)
148
itkEventMacro
(
ExitEvent
, AnyEvent)
149
itkEventMacro
(
AbortEvent
, AnyEvent)
150
itkEventMacro
(
ModifiedEvent
, AnyEvent)
151
itkEventMacro
(
InitializeEvent
, AnyEvent)
152
itkEventMacro
(
IterationEvent
, AnyEvent)
153
itkEventMacro
(
PickEvent
, AnyEvent)
154
itkEventMacro
(
StartPickEvent
, PickEvent)
155
itkEventMacro
(
EndPickEvent
, PickEvent)
156
itkEventMacro
(
AbortCheckEvent
, PickEvent)
157
itkEventMacro
(
FunctionEvaluationIterationEvent
, IterationEvent)
158
itkEventMacro
(
GradientEvaluationIterationEvent
, IterationEvent)
159
itkEventMacro
(
FunctionAndGradientEvaluationIterationEvent
, IterationEvent)
160
161
itkEventMacro
(
UserEvent
, AnyEvent)
162
163
#undef ITKEvent_EXPORT
164
#define ITKEvent_EXPORT ITK_ABI_EXPORT
165
166
}
// end namespace itk
167
168
#endif
169
Generated on Mon May 13 2013 00:48:58 for ITK by
1.8.3.1