DGtal  1.5.beta
TiledImageBidirectionalRangeFromPoint.h
1 
17 #pragma once
18 
33 #if defined(TiledImageBidirectionalRangeFromPoint_RECURSES)
34 #error Recursive header files inclusion detected in TiledImageBidirectionalRangeFromPoint.h
35 #else // defined(TiledImageBidirectionalRangeFromPoint_RECURSES)
37 #define TiledImageBidirectionalRangeFromPoint_RECURSES
38 
39 #if !defined TiledImageBidirectionalRangeFromPoint_h
41 #define TiledImageBidirectionalRangeFromPoint_h
42 
44 // Inclusions
45 #include "DGtal/base/BasicFunctors.h"
46 #include "DGtal/base/Circulator.h"
47 #include "DGtal/base/IteratorAdapter.h"
48 #include "DGtal/base/CBidirectionalRangeFromPoint.h"
49 #include "boost/concept_check.hpp"
51 
52 namespace DGtal
53 {
54 
55 
57  // class TiledImageBidirectionalRangeFromPoint
59 
69  template <typename TTiledImage>
70 
72  {
73 
76 
77  // ------------------------- inner types --------------------------------
78 
79  public:
80 
81  typedef TTiledImage TiledImage;
82 
83  typedef typename TiledImage::Point Point;
84 
87 
88  typedef std::reverse_iterator<Iterator> ReverseIterator;
89  typedef std::reverse_iterator<ConstIterator> ConstReverseIterator;
90 
92  typedef std::reverse_iterator<Iterator> ReverseOutputIterator;
93 
94  // typedef Circulator<Iterator> Circulator;
95  // typedef std::reverse_iterator<Circulator> ReverseCirculator;
96 
97  // ------------------------- standard services --------------------------------
98 
104  : myti ( ti ) {}
105 
111  : myti ( other.myti ) {}
112 
119  {
120  if ( this != &other )
121  {
122  myti = other.myti;
123  }
124 
125  return *this;
126  }
127 
132 
137  bool isValid() const
138  {
139  return true;
140  }
141 
142  // ------------------------- display --------------------------------
147  void selfDisplay ( std::ostream & out ) const
148  {
150  out << "[TiledImageBidirectionalRangeFromPoint]" << std::endl;
151  out << "\t";
152  std::copy ( myti->begin(), myti->end(), std::ostream_iterator<Value> ( out, ", " ) );
153  out << std::endl;
154  }
155 
159  std::string className() const
160  {
161  return "TiledImageBidirectionalRangeFromPoint";
162  }
163 
164 
165  // ------------------------- private data --------------------------------
166 
167  private:
168 
169  const TTiledImage *myti;
170 
171  // ------------------------- iterator services --------------------------------
172 
173  public:
174 
180  {
181  return Iterator ( myti->begin() );
182  }
183 
190  {
191  return Iterator ( myti->begin(aPoint) );
192  }
193 
199  {
200  return ConstIterator ( myti->begin() );
201  }
202 
208  ConstIterator begin ( const Point &aPoint ) const
209  {
210  return ConstIterator ( myti->begin(aPoint) );
211  }
212 
218  {
219  return Iterator ( myti->end() );
220  }
221 
227  {
228  return ConstIterator ( myti->end() );
229  }
230 
236  {
237  return OutputIterator ( myti->begin() );
238  }
239 
246  {
247  return OutputIterator ( myti->begin(aPoint) );
248  }
249 
255  {
256  return ReverseOutputIterator ( myti->begin() );
257  }
258 
265  {
266  return ReverseOutputIterator ( myti->begin(aPoint) );
267  }
268 
274  {
275  return ReverseIterator ( this->end() );
276  }
277 
283  ReverseIterator rbegin ( const Point &aPoint )
284  {
285  return ReverseIterator ( myti->rbegin(aPoint) );
286  }
287 
293  {
294  return ReverseIterator ( this->begin() );
295  }
296 
301  ConstReverseIterator rbegin() const
302  {
303  return ConstReverseIterator ( this->end() );
304  }
305 
311  ConstReverseIterator rbegin ( const Point &aPoint ) const
312  {
313  return ConstReverseIterator ( myti->rbegin(aPoint) );
314  }
315 
321  {
322  return ConstReverseIterator ( this->begin() );
323  }
324 
325  // /**
326  // * Circulator service.
327  // * @return a circulator
328  // */
329  // Circulator c() const
330  // {
331  // return Circulator ( this->begin(), this->begin(), this->end() );
332  // }
333 
334  // /**
335  // * Circulator service.
336  // * @return a reverse circulator
337  // */
338  // ReverseCirculator rc() const
339  // {
340  // return ReverseCirculator ( this->c() );
341  // }
342 
343  }; //end class TiledImageBidirectionalRangeFromPoint
344 
345 } // namespace DGtal
346 
348 
349 
350 #endif // !defined TiledImageBidirectionalRangeFromPoint_h
351 
352 #undef TiledImageBidirectionalRangeFromPoint_RECURSES
353 #endif // else defined(TiledImageBidirectionalRangeFromPoint_RECURSES)
Aim: model of CBidirectionalRangeFromPoint that adapts a TiledImage range of elements bounded by two ...
TiledImageBidirectionalRangeFromPoint & operator=(const TiledImageBidirectionalRangeFromPoint &other)
BOOST_CONCEPT_ASSERT((boost::BidirectionalIterator< typename TTiledImage::OutputIterator >))
BOOST_CONCEPT_ASSERT((boost::BidirectionalIterator< typename TTiledImage::ConstIterator >))
TiledImageBidirectionalRangeFromPoint(const TiledImageBidirectionalRangeFromPoint &other)
ConstReverseIterator rbegin(const Point &aPoint) const
ReverseOutputIterator routputIterator(const Point &aPoint)
DGtal is the top-level namespace which contains all DGtal functions and types.
Go to http://www.sgi.com/tech/stl/BidirectionalIterator.html.
Definition: Boost.dox:42
const Point aPoint(3, 4)