21 #ifndef otbPolyLineImageConstIterator_hxx
22 #define otbPolyLineImageConstIterator_hxx
32 template <
class TImage,
class TPath>
34 : m_InternalImageIterator(const_cast<
ImageType*>(imagePtr), imagePtr->GetLargestPossibleRegion().GetIndex(), imagePtr->GetLargestPossibleRegion().GetIndex())
40 for (
unsigned int i = 0; i < ImageType::ImageDimension; ++i)
49 for (
unsigned int i = 0; i < ImageType::ImageDimension; ++i)
61 template <
class TImage,
class TPath>
70 template <
class TImage,
class TPath>
73 m_InternalVertexIterator = m_Path->GetVertexList()->Begin();
75 for (
unsigned int i = 0; i < ImageType::ImageDimension; ++i)
77 source[i] =
static_cast<unsigned int>(std::floor(m_InternalVertexIterator.Value()[i] + 0.5));
79 ++m_InternalVertexIterator;
80 if (m_InternalVertexIterator != m_Path->GetVertexList()->End())
83 for (
unsigned int i = 0; i < ImageType::ImageDimension; ++i)
85 target[i] =
static_cast<unsigned int>(std::floor(m_InternalVertexIterator.Value()[i] + 0.5));
95 template <
class TImage,
class TPath>
99 ++m_InternalImageIterator;
100 if (m_InternalImageIterator.IsAtEnd())
102 if (m_InternalVertexIterator != m_Path->GetVertexList()->End())
105 for (
unsigned int i = 0; i < ImageType::ImageDimension; ++i)
107 source[i] =
static_cast<unsigned int>(std::floor(m_InternalVertexIterator.Value()[i] + 0.5));
110 ++m_InternalVertexIterator;
111 if (m_InternalVertexIterator != m_Path->GetVertexList()->End())
114 for (
unsigned int i = 0; i < ImageType::ImageDimension; ++i)
116 target[i] =
static_cast<unsigned int>(std::floor(m_InternalVertexIterator.Value()[i] + 0.5));
120 ++m_InternalImageIterator;