Orfeo Toolbox  3.16
itkTreeChangeEvent.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Insight Segmentation & Registration Toolkit
4  Module: $RCSfile: itkTreeChangeEvent.h,v $
5  Language: C++
6  Date: $Date: 2009-03-03 15:10:32 $
7  Version: $Revision: 1.4 $
8 
9  Copyright (c) Insight Software Consortium. All rights reserved.
10  See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
11 
12  This software is distributed WITHOUT ANY WARRANTY; without even
13  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14  PURPOSE. See the above copyright notices for more information.
15 
16 =========================================================================*/
17 #ifndef __itkTreeChangeEvent_h
18 #define __itkTreeChangeEvent_h
19 
20 #include "itkMacro.h"
21 #include <itkEventObject.h>
22 #include <itkTreeIteratorBase.h>
23 
24 namespace itk
25 {
26 
31 template <class TTreeType>
33 {
34 public:
35 
39 
42  {
44  }
45 
48  {
49  m_ChangePosition = &position;
50  }
51 
53  virtual ~TreeChangeEvent() {}
54 
56  virtual const char * GetEventName() const
57  {
58  return "TreeChangeEvent";
59  }
60 
62  virtual bool CheckEvent(const ::itk::EventObject* e) const
63  {
64  return dynamic_cast<const Self*>(e);
65  }
66 
68  virtual ::itk::EventObject* MakeObject() const
69  {
70  return new Self( *m_ChangePosition );
71  }
72 
75  {
76  return *m_ChangePosition;
77  }
78 
79  TreeChangeEvent(const Self&s) : itk::ModifiedEvent(s) {};
80 
81 protected:
82 
84 
85 private:
86  void operator=(const Self&);
87 
88 };
89 
93 template <class TTreeType>
94 class TreeNodeChangeEvent : public TreeChangeEvent<TTreeType>
95 {
96 public:
99 
101 
103  TreeChangeEvent<TTreeType>(position) {}
104 
105  virtual const char * GetEventName() const
106  {
107  return "TreeNodeChangeEvent";
108  }
109 
110  virtual bool CheckEvent(const ::itk::EventObject* e) const
111  {
112  return dynamic_cast<const Self*>(e);
113  }
114 
115  virtual ::itk::EventObject* MakeObject() const
116  {
117  return new Self( *this->m_ChangePosition );
118  }
119 
120  TreeNodeChangeEvent(const Self&s) : TreeChangeEvent<TTreeType>(s) {}
121 private:
122  void operator=(const Self&);
123 
124 };
125 
130 template <class TTreeType>
131 class TreeAddEvent : public TreeChangeEvent<TTreeType>
132 {
133 public:
134 
136  typedef TreeAddEvent Self;
138 
141 
144  TreeChangeEvent<TTreeType>(position) {}
145 
147  virtual const char * GetEventName() const
148  {
149  return "TreeAddEvent";
150  }
151 
153  virtual bool CheckEvent(const ::itk::EventObject* e) const
154  {
155  return dynamic_cast<const Self*>(e);
156  }
157 
159  virtual ::itk::EventObject* MakeObject() const
160  {
161  return new Self( *this->m_ChangePosition );
162  }
163 
164  TreeAddEvent(const Self&s) : TreeChangeEvent<TTreeType>(s) {}
165 private:
166  void operator=(const Self&);
167 
168 };
169 
170 
175 template <class TTreeType>
176 class TreeRemoveEvent : public TreeChangeEvent<TTreeType>
177 {
178 public:
179 
183 
186 
189  TreeChangeEvent<TTreeType>(position) {}
190 
192  virtual const char * GetEventName() const
193  {
194  return "TreeRemoveEvent";
195  }
196 
198  virtual bool CheckEvent(const ::itk::EventObject* e) const
199  {
200  return dynamic_cast<const Self*>(e);
201  }
202 
204  virtual ::itk::EventObject* MakeObject() const
205  {
206  return new Self( *this->m_ChangePosition );
207  }
208 
209  TreeRemoveEvent(const Self&s) : TreeChangeEvent<TTreeType>(s) {}
210 
211 private:
212  void operator=(const Self&);
213 };
214 
218 template <class TTreeType>
219 class TreePruneEvent : public TreeRemoveEvent<TTreeType>
220 {
221 public:
224 
227 
230  TreeRemoveEvent<TTreeType>(position) {}
231 
233  virtual const char * GetEventName() const
234  {
235  return "TreePruneEvent";
236  }
237 
239  virtual bool CheckEvent(const ::itk::EventObject* e) const
240  {
241  return dynamic_cast<const Self*>(e);
242  }
243 
245  virtual ::itk::EventObject* MakeObject() const
246  {
247  return new Self( *this->m_ChangePosition );
248  }
249 
250  TreePruneEvent(const Self& s) : TreeRemoveEvent<TTreeType>(s) {}
251 private:
252  void operator=(const Self&);
253 };
254 
255 } // namespace itk
256 
257 #endif

Generated at Sun Feb 3 2013 00:10:23 for Orfeo Toolbox with doxygen 1.8.1.1