00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkConditionalConstIterator_h
00018 #define __itkConditionalConstIterator_h
00019
00020 #include "itkIndex.h"
00021
00022 namespace itk
00023 {
00024
00037 template<class TImage>
00038 class ConditionalConstIterator {
00039 public:
00041 typedef ConditionalConstIterator Self;
00042
00047 itkStaticConstMacro(NDimension, unsigned int, TImage::ImageDimension);
00048
00050 typedef typename TImage::IndexType IndexType;
00051
00053 typedef typename TImage::SizeType SizeType;
00054
00056 typedef typename TImage::RegionType RegionType;
00057
00059 typedef TImage ImageType;
00060
00062 typedef typename TImage::InternalPixelType InternalPixelType;
00063
00065 typedef typename TImage::PixelType PixelType;
00066
00068 virtual bool IsPixelIncluded(const IndexType & index) const = 0;
00069
00072 Self &operator=(const Self& it)
00073 {
00074 m_Image = it.m_Image;
00075 m_Region = it.m_Region;
00076 return *this;
00077 }
00078
00080 static unsigned int GetIteratorDimension()
00081 {return TImage::ImageDimension;}
00082
00084 virtual const IndexType GetIndex() = 0;
00085
00087 virtual const PixelType & Get(void) const = 0;
00088
00090 virtual bool IsAtEnd() = 0;
00091
00093 virtual void operator++() = 0;
00094
00096 ConditionalConstIterator();
00097
00099 virtual ~ConditionalConstIterator();
00100
00101 protected:
00103
00104 typename ImageType::ConstWeakPointer m_Image;
00105
00107 RegionType m_Region;
00108
00110 bool m_IsAtEnd;
00111 };
00112
00113 }
00114
00115 #ifndef ITK_MANUAL_INSTANTIATION
00116 #include "itkConditionalConstIterator.txx"
00117 #endif
00118
00119 #endif