Orfeo Toolbox  4.0
otbRCC8OutEdgeIterator.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 __otbRCC8OutEdgeIterator_txx
19 #define __otbRCC8OutEdgeIterator_txx
20 
21 #include "otbRCC8OutEdgeIterator.h"
22 
23 namespace otb
24 {
26 template <class TGraph>
29 {
30  m_Graph = GraphType::New();
31  tie(m_Iter, m_End) = out_edges(0, *m_Graph->GetGraph());
32 }
36 template <class TGraph>
39 {
40  m_Iter = iter.m_Iter;
41  m_Graph = iter.m_Graph;
42  m_VertexIndex = iter.m_VertexIndex;
43  m_End = iter.m_End;
44 }
48 template <class TGraph>
51 {
52  m_Graph = graph;
53  m_VertexIndex = vertex;
54  tie(m_Iter, m_End) = out_edges(vertex, *m_Graph->GetGraph());
55 }
60 template <class TGraph>
62 ::RCC8ValueType
65 {
66  return (*m_Graph->GetGraph())[*m_Iter]->GetValue();
67 }
72 template <class TGraph>
74 ::VertexPointerType
77 {
78  return (*m_Graph->GetGraph())[target(*m_Iter, (*m_Graph->GetGraph()))];
79 }
84 template <class TGraph>
86 ::VertexDescriptorType
89 {
90  IndexMapType index = get(boost::vertex_index, (*m_Graph->GetGraph()));
91  return index[target(*m_Iter, (*m_Graph->GetGraph()))];
92 }
97 template <class TGraph>
98 bool
101 {
102  return (m_Iter == m_End);
103 }
107 template <class TGraph>
108 void
111 {
112  tie(m_Iter, m_End) = out_edges(m_VertexIndex, *m_Graph->GetGraph());
113 }
117 template <class TGraph>
119 ::Self&
122  {
123  ++m_Iter;
124  return *this;
125  }
129 template <class TGraph>
131 ::Self&
134  {
135  --m_Iter;
136  return *this;
137  }
141 template <class TGraph>
143 ::Self&
146  {
147  m_Iter = m_Iter + i;
148  return *this;
149  }
153 template <class TGraph>
155 ::Self&
158  {
159  m_Iter = m_Iter - i;
160  return *this;
161  }
165 template <class TGraph>
166 bool
168 ::operator != (const Self &iter)
169  {
170  return (m_Iter != iter.m_Iter);
171  }
175 template <class TGraph>
176 bool
178 ::operator == (const Self &iter)
179  {
180  return (m_Iter == iter.m_Iter);
181  }
185 template <class TGraph>
187 ::Self&
189 ::operator = (const Self &iter)
190  {
191  m_Iter = iter.m_Iter;
192  return *this;
193  }
194 } // End namespace otb
195 #endif

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