Orfeo Toolbox  4.0
itkTreeChangeEvent.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 __itkTreeChangeEvent_h
19 #define __itkTreeChangeEvent_h
20 
21 #include "itkMacro.h"
22 #include "itkEventObject.h"
23 #include "itkTreeIteratorBase.h"
24 
25 namespace itk
26 {
32 template< typename TTreeType >
34 {
35 public:
36 
40 
44  {}
45 
48 
50  virtual ~TreeChangeEvent() {}
51 
53  virtual const char * GetEventName() const { return "TreeChangeEvent"; }
54 
56  virtual bool CheckEvent(const::itk::EventObject *e) const { return (dynamic_cast< const Self * >( e ) != NULL); }
57 
59  virtual::itk::EventObject * MakeObject() const { return new Self(*m_ChangePosition); }
60 
63 
64  // cppcheck-suppress uninitVar
65  TreeChangeEvent(const Self & s):itk::ModifiedEvent(s) {}
66 
67 protected:
68 
70 
71 private:
72  void operator=(const Self &);
73 };
74 
80 template< typename TTreeType >
81 class TreeNodeChangeEvent:public TreeChangeEvent< TTreeType >
82 {
83 public:
86 
88 
90  TreeChangeEvent< TTreeType >(position) {}
91 
92  virtual const char * GetEventName() const { return "TreeNodeChangeEvent"; }
93 
94  virtual bool CheckEvent(const::itk::EventObject *e) const { return dynamic_cast< const Self * >( e ); }
95 
96  virtual::itk::EventObject * MakeObject() const { return new Self(*this->m_ChangePosition); }
97 
98  TreeNodeChangeEvent(const Self & s):TreeChangeEvent< TTreeType >(s) {}
99 
100 private:
101  void operator=(const Self &);
102 };
103 
108 template< typename TTreeType >
109 class TreeAddEvent:public TreeChangeEvent< TTreeType >
110 {
111 public:
112 
116 
119 
122  TreeChangeEvent< TTreeType >(position) {}
123 
125  virtual const char * GetEventName() const { return "TreeAddEvent"; }
126 
128  virtual bool CheckEvent(const::itk::EventObject *e) const { return (dynamic_cast< const Self * >( e ) != NULL); }
129 
131  virtual::itk::EventObject * MakeObject() const { return new Self(*this->m_ChangePosition); }
132 
133  TreeAddEvent(const Self & s):TreeChangeEvent< TTreeType >(s) {}
134 
135 private:
136  void operator=(const Self &);
137 };
138 
143 template< typename TTreeType >
144 class TreeRemoveEvent:public TreeChangeEvent< TTreeType >
145 {
146 public:
147 
151 
154 
157  TreeChangeEvent< TTreeType >(position) {}
158 
160  virtual const char * GetEventName() const { return "TreeRemoveEvent"; }
161 
163  virtual bool CheckEvent(const::itk::EventObject *e) const { return (dynamic_cast< const Self * >( e ) != NULL); }
164 
166  virtual::itk::EventObject * MakeObject() const { return new Self(*this->m_ChangePosition); }
167 
168  TreeRemoveEvent(const Self & s):TreeChangeEvent< TTreeType >(s) {}
169 
170 private:
171  void operator=(const Self &);
172 };
173 
179 template< typename TTreeType >
180 class TreePruneEvent:public TreeRemoveEvent< TTreeType >
181 {
182 public:
185 
187 
189  TreeRemoveEvent< TTreeType >(position) {}
190 
191  virtual const char * GetEventName() const { return "TreePruneEvent"; }
192 
193  virtual bool CheckEvent(const::itk::EventObject *e) const { return (dynamic_cast< const Self * >( e ) != NULL); }
194 
195  virtual::itk::EventObject * MakeObject() const { return new Self(*this->m_ChangePosition); }
196 
197  TreePruneEvent(const Self & s):TreeRemoveEvent< TTreeType >(s) {}
198 
199 private:
200  void operator=(const Self &);
201 };
202 } // namespace itk
203 
204 #endif

Generated at Sat Mar 8 2014 15:39:10 for Orfeo Toolbox with doxygen 1.8.3.1