ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkCorrespondenceDataStructureIterator.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkCorrespondenceDataStructureIterator_h
00019 #define __itkCorrespondenceDataStructureIterator_h
00020 
00021 namespace itk
00022 {
00029 template< class TStructureType >
00030 class CorrespondenceDataStructureIterator
00031 {
00032 public:
00034   typedef CorrespondenceDataStructureIterator Self;
00035 
00037   static unsigned int GetIteratorDimension()
00038   {
00039     return TStructureType::dim;
00040   }
00041 
00043   bool IsAtEnd();
00044 
00046   void operator++(){ GoToNext(); }
00047 
00049   void operator++(int){ GoToNext(); }
00050 
00053   void GoToNext();
00054 
00056   void GoToNextBaseGroup();
00057 
00059   void Reset();
00060 
00062   CorrespondenceDataStructureIterator(TStructureType *StructurePtr);
00063 
00065   virtual ~CorrespondenceDataStructureIterator();
00066 
00067   typedef typename TStructureType::CorrespondingListType CorrespondingListType;
00068   typedef typename TStructureType::ItemType              ItemType;
00069   typedef typename TStructureType::SecondaryNodeListType SecondaryNodeListType;
00070   typedef typename TStructureType::NodeListType          NodeListType;
00071 
00072   typedef typename CorrespondingListType::iterator CorrespondingListIterator;
00073   typedef typename SecondaryNodeListType::iterator SecondaryNodeListIterator;
00074   typedef typename NodeListType::iterator          NodeListIterator;
00075 
00077   CorrespondingListType * GetCorrespondingListPointer()
00078   {
00079     return m_CorrespondingListPointer;
00080   }
00081 
00082   CorrespondingListIterator m_CorrespondingListIterator;
00083   SecondaryNodeListIterator m_SecondaryListIterator;
00084 
00085   typename TStructureType::NodeListType::iterator m_NodeListIterator;
00086 protected:
00087 
00089   bool                   m_IsAtEnd;
00090   TStructureType *       m_Structure;
00091   ItemType *             m_CorrespondingNodePointer;
00092   CorrespondingListType *m_CorrespondingListPointer;
00093   SecondaryNodeListType *m_SecondaryListPointer;
00094   NodeListType *         m_NodeListPointer;
00095 };
00096 } // end namespace itk
00097 
00098 #ifndef ITK_MANUAL_INSTANTIATION
00099 #include "itkCorrespondenceDataStructureIterator.hxx"
00100 #endif
00101 
00102 #endif
00103