ITK
4.2.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
111
#define itkEventMacro(classname, super) \
112
113
\
117
#define itkEventMacro(classname, super) \
118
class ITK_ABI_EXPORT classname:public super \
119
{ \
120
public: \
121
typedef classname Self; \
122
typedef super Superclass; \
123
classname() {} \
124
virtual ~classname() {} \
125
virtual const char *GetEventName() const { return #classname; } \
126
virtual bool CheckEvent(const::itk::EventObject * e) const \
127
{ return ( dynamic_cast< const Self * >( e ) != NULL ); } \
128
virtual::itk::EventObject *MakeObject() const \
129
{ return new Self; } \
130
classname(const Self &s):super(s){}; \
131
private: \
132
void operator=(const Self &); \
133
};
134
135
139
itkEventMacro
(
NoEvent
,
EventObject
)
140
itkEventMacro
(
AnyEvent
,
EventObject
)
141
itkEventMacro
(
DeleteEvent
, AnyEvent)
142
itkEventMacro
(
StartEvent
, AnyEvent)
143
itkEventMacro
(
EndEvent
, AnyEvent)
144
itkEventMacro
(
ProgressEvent
, AnyEvent)
145
itkEventMacro
(
ExitEvent
, AnyEvent)
146
itkEventMacro
(
AbortEvent
, AnyEvent)
147
itkEventMacro
(
ModifiedEvent
, AnyEvent)
148
itkEventMacro
(
InitializeEvent
, AnyEvent)
149
itkEventMacro
(
IterationEvent
, AnyEvent)
150
itkEventMacro
(
PickEvent
, AnyEvent)
151
itkEventMacro
(
StartPickEvent
, PickEvent)
152
itkEventMacro
(
EndPickEvent
, PickEvent)
153
itkEventMacro
(
AbortCheckEvent
, PickEvent)
154
itkEventMacro
(
FunctionEvaluationIterationEvent
, IterationEvent)
155
itkEventMacro
(
GradientEvaluationIterationEvent
, IterationEvent)
156
itkEventMacro
(
FunctionAndGradientEvaluationIterationEvent
, IterationEvent)
157
158
itkEventMacro
(
UserEvent
, AnyEvent)
159
}
// end namespace itk
160
161
#endif
162
Generated on Tue Jul 10 2012 23:24:21 for ITK by
1.8.1