KWStyle - itkCorrespondenceDataStructureIterator.h
 
Matrix View
Description

1 /*=========================================================================
2
3   Program:   Insight Segmentation & Registration Toolkit
4   Module:    $RCSfile: itkCorrespondenceDataStructureIterator.h.html,v $
5   Language:  C++
6   Date:      $Date: 2006/01/17 19:15:34 $
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 __itkCorrespondenceDataStructureIterator_h
18 #define __itkCorrespondenceDataStructureIterator_h
19
20 namespace itk
21 {
22
23 /** \class CorrespondenceDataStructureIterator
24 LEN  * \brief An iterator designed to easily traverse an itkCorrespondenceDataStructure.
25  * 
26  * \ingroup 
27  */
28 template<class TStructureType>
29 class CorrespondenceDataStructureIterator {
30 public:
31   /** Standard class typedefs. */
32   typedef CorrespondenceDataStructureIterator Self;
33
34   /** Get the dimension (size) of the index. */
35   static unsigned int GetIteratorDimension() 
36 IND **{return TStructureType::dim;}
37
38   /** Is the iterator at the end of the region? */
39   bool IsAtEnd();
40
41   /** Walk forward one index. (prefix) */
42   void operator++(){GoToNext();}
43
44   /** Walk forward one index. (postfix) */
45   void operator++(int){GoToNext();}
46
47 LEN   /** Goes to the next corresponding node clique in the structure, moving on to the next base node clique if necessary. */
48   void GoToNext();
49
50   /** Goes to the next base node clique. */
51   void GoToNextBaseGroup();
52
53   /** Resets the iterator. */
54   void Reset();
55   
56   /** Constructor */
57   CorrespondenceDataStructureIterator(TStructureType *StructurePtr);
58
59   /** Destructor */
60   virtual ~CorrespondenceDataStructureIterator();
61
62   typedef typename TStructureType::CorrespondingListType CorrespondingListType;
63 TDA   typedef typename TStructureType::ItemType ItemType;
64   typedef typename TStructureType::SecondaryNodeListType SecondaryNodeListType;
65 TDA   typedef typename TStructureType::NodeListType NodeListType;
66
67   typedef typename CorrespondingListType::iterator CorrespondingListIterator;
68   typedef typename SecondaryNodeListType::iterator SecondaryNodeListIterator;
69 TDA   typedef typename NodeListType::iterator NodeListIterator;
70
71   /** Get m_CorrespondingListPointer.  */
72 LEN   CorrespondingListType * GetCorrespondingListPointer(){return m_CorrespondingListPointer;}
73
74   CorrespondingListIterator m_CorrespondingListIterator;
75   SecondaryNodeListIterator m_SecondaryListIterator;
76   typename  TStructureType::NodeListType::iterator m_NodeListIterator;
77
78 protected:
79
80   /** Is the iterator at the end of its walk? */
81   bool m_IsAtEnd;
82   TStructureType * m_Structure;
83   ItemType * m_CorrespondingNodePointer;
84   CorrespondingListType * m_CorrespondingListPointer;
85   SecondaryNodeListType * m_SecondaryListPointer;
86   NodeListType * m_NodeListPointer;
87 };
88
89 // end namespace itk
90
91 #ifndef ITK_MANUAL_INSTANTIATION
92 #include "itkCorrespondenceDataStructureIterator.txx"
93 #endif
94
95 #endif 
96

Generated by KWStyle 1.0b on Tuesday January,17 at 02:14:04PM
© Kitware Inc.