Orfeo Toolbox  4.0
otbRCC8VertexIterator.txx
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ORFEO Toolbox
4  Language: C++
5  Date: $Date$
6  Version: $Revision$
7 
8 
9  Copyright (c) Centre National d'Etudes Spatiales. All rights reserved.
10  See OTBCopyright.txt for details.
11 
12 
13  This software is distributed WITHOUT ANY WARRANTY; without even
14  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  PURPOSE. See the above copyright notices for more information.
16 
17 =========================================================================*/
18 #ifndef __otbRCC8VertexIterator_txx
19 #define __otbRCC8VertexIterator_txx
20 
21 #include "otbRCC8VertexIterator.h"
22 
23 namespace otb
24 {
28 template <class TGraph>
31 {
32  m_Graph = GraphType::New();
33  tie(m_Iter, m_End) = vertices(*(m_Graph->GetGraph()));
34 }
38 template <class TGraph>
41 {
42  m_Iter = iter.m_Iter;
43  m_Graph = iter.m_Graph;
44  m_End = iter.m_End;
45 }
49 template <class TGraph>
51 ::RCC8VertexIterator(TGraph * graph)
52 {
53  m_Graph = graph;
54  tie(m_Iter, m_End) = vertices(*(m_Graph->GetGraph()));
55 }
60 template <class TGraph>
62 ::VertexPointerType
64 ::Get(void)
65 {
66  return (*(m_Graph->GetGraph()))[*m_Iter];
67 }
72 template <class TGraph>
73 void
76 {
77  (*(m_Graph->GetGraph()))[*m_Iter] = vertex;
78 }
83 template <class TGraph>
85 ::VertexDescriptorType
88 {
89  IndexMapType index = get(boost::vertex_index, (*m_Graph->GetGraph()));
90  return index[*m_Iter];
91 }
96 template <class TGraph>
97 bool
99 ::IsAtEnd(void)
100 {
101  return (m_Iter == m_End);
102 }
106 template <class TGraph>
107 void
110 {
111  tie(m_Iter, m_End) = vertices(*(m_Graph->GetGraph()));
112 }
116 template <class TGraph>
118 ::Self&
121  {
122  ++m_Iter;
123  return *this;
124  }
128 template <class TGraph>
130 ::Self&
133  {
134  --m_Iter;
135  return *this;
136  }
140 template <class TGraph>
142 ::Self&
145  {
146  m_Iter = m_Iter + i;
147  return *this;
148  }
152 template <class TGraph>
154 ::Self&
157  {
158  m_Iter = m_Iter - i;
159  return *this;
160  }
164 template <class TGraph>
165 bool
167 ::operator != (const Self &iter)
168  {
169  return (m_Iter != iter.m_Iter);
170  }
174 template <class TGraph>
175 bool
177 ::operator == (const Self &iter)
178  {
179  return (m_Iter == iter.m_Iter);
180  }
184 template <class TGraph>
186 ::Self&
188 ::operator = (const Self &iter)
189  {
190  m_Iter = iter.m_Iter;
191  return *this;
192  }
193 } // End namespace otb
194 #endif

Generated at Sat Mar 8 2014 16:15:17 for Orfeo Toolbox with doxygen 1.8.3.1