DGtal  1.4.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)
36 
37 #define TiledImageBidirectionalRangeFromPoint_RECURSES
38 
39 #if !defined TiledImageBidirectionalRangeFromPoint_h
40 
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)
DGtal::TiledImageBidirectionalRangeFromPoint::rend
ConstReverseIterator rend() const
Definition: TiledImageBidirectionalRangeFromPoint.h:320
DGtal::TiledImageBidirectionalRangeFromPoint::rbegin
ConstReverseIterator rbegin(const Point &aPoint) const
Definition: TiledImageBidirectionalRangeFromPoint.h:311
DGtal::TiledImageBidirectionalRangeFromPoint::TiledImageBidirectionalRangeFromPoint
TiledImageBidirectionalRangeFromPoint(const TiledImageBidirectionalRangeFromPoint &other)
Definition: TiledImageBidirectionalRangeFromPoint.h:110
DGtal::TiledImageBidirectionalRangeFromPoint::outputIterator
OutputIterator outputIterator()
Definition: TiledImageBidirectionalRangeFromPoint.h:235
DGtal::TiledImageBidirectionalRangeFromPoint::operator=
TiledImageBidirectionalRangeFromPoint & operator=(const TiledImageBidirectionalRangeFromPoint &other)
Definition: TiledImageBidirectionalRangeFromPoint.h:118
DGtal::TiledImageBidirectionalRangeFromPoint::routputIterator
ReverseOutputIterator routputIterator(const Point &aPoint)
Definition: TiledImageBidirectionalRangeFromPoint.h:264
DGtal::TiledImageBidirectionalRangeFromPoint::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((boost::BidirectionalIterator< typename TTiledImage::OutputIterator >))
DGtal::TiledImageBidirectionalRangeFromPoint::rbegin
ConstReverseIterator rbegin() const
Definition: TiledImageBidirectionalRangeFromPoint.h:301
DGtal::TiledImageBidirectionalRangeFromPoint::myti
const TTiledImage * myti
Definition: TiledImageBidirectionalRangeFromPoint.h:169
DGtal::TiledImageBidirectionalRangeFromPoint::begin
ConstIterator begin(const Point &aPoint) const
Definition: TiledImageBidirectionalRangeFromPoint.h:208
DGtal::TiledImageBidirectionalRangeFromPoint::className
std::string className() const
Definition: TiledImageBidirectionalRangeFromPoint.h:159
aPoint
const Point aPoint(3, 4)
DGtal::TiledImageBidirectionalRangeFromPoint::rend
ReverseIterator rend()
Definition: TiledImageBidirectionalRangeFromPoint.h:292
DGtal::TiledImageBidirectionalRangeFromPoint::Point
TiledImage::Point Point
Definition: TiledImageBidirectionalRangeFromPoint.h:83
DGtal::TiledImageBidirectionalRangeFromPoint::rbegin
ReverseIterator rbegin(const Point &aPoint)
Definition: TiledImageBidirectionalRangeFromPoint.h:283
DGtal::TiledImageBidirectionalRangeFromPoint::isValid
bool isValid() const
Definition: TiledImageBidirectionalRangeFromPoint.h:137
DGtal::TiledImageBidirectionalRangeFromPoint::rbegin
ReverseIterator rbegin()
Definition: TiledImageBidirectionalRangeFromPoint.h:273
DGtal::TiledImageBidirectionalRangeFromPoint::Iterator
TiledImage::OutputIterator Iterator
Definition: TiledImageBidirectionalRangeFromPoint.h:85
DGtal::TiledImageBidirectionalRangeFromPoint::outputIterator
OutputIterator outputIterator(const Point &aPoint)
Definition: TiledImageBidirectionalRangeFromPoint.h:245
DGtal::TiledImageBidirectionalRangeFromPoint::end
Iterator end()
Definition: TiledImageBidirectionalRangeFromPoint.h:217
DGtal::TiledImageBidirectionalRangeFromPoint::begin
Iterator begin()
Definition: TiledImageBidirectionalRangeFromPoint.h:179
DGtal::TiledImageBidirectionalRangeFromPoint::selfDisplay
void selfDisplay(std::ostream &out) const
Definition: TiledImageBidirectionalRangeFromPoint.h:147
DGtal::TiledImageBidirectionalRangeFromPoint::TiledImageBidirectionalRangeFromPoint
TiledImageBidirectionalRangeFromPoint(const TiledImage *ti)
Definition: TiledImageBidirectionalRangeFromPoint.h:103
DGtal::TiledImageBidirectionalRangeFromPoint::begin
ConstIterator begin() const
Definition: TiledImageBidirectionalRangeFromPoint.h:198
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
boost::BidirectionalIterator
Go to http://www.sgi.com/tech/stl/BidirectionalIterator.html.
Definition: Boost.dox:42
DGtal::TiledImageBidirectionalRangeFromPoint
Aim: model of CBidirectionalRangeFromPoint that adapts a TiledImage range of elements bounded by two ...
Definition: TiledImageBidirectionalRangeFromPoint.h:71
DGtal::TiledImageBidirectionalRangeFromPoint::TiledImage
TTiledImage TiledImage
Definition: TiledImageBidirectionalRangeFromPoint.h:81
DGtal::TiledImageBidirectionalRangeFromPoint::begin
Iterator begin(const Point &aPoint)
Definition: TiledImageBidirectionalRangeFromPoint.h:189
DGtal::TiledImageBidirectionalRangeFromPoint::OutputIterator
TiledImage::OutputIterator OutputIterator
Definition: TiledImageBidirectionalRangeFromPoint.h:91
DGtal::TiledImageBidirectionalRangeFromPoint::ReverseIterator
std::reverse_iterator< Iterator > ReverseIterator
Definition: TiledImageBidirectionalRangeFromPoint.h:88
DGtal::TiledImageBidirectionalRangeFromPoint::routputIterator
ReverseOutputIterator routputIterator()
Definition: TiledImageBidirectionalRangeFromPoint.h:254
DGtal::TiledImageBidirectionalRangeFromPoint::ConstIterator
TiledImage::ConstIterator ConstIterator
Definition: TiledImageBidirectionalRangeFromPoint.h:86
DGtal::PointVector< dim, Integer >
DGtal::TiledImageBidirectionalRangeFromPoint::~TiledImageBidirectionalRangeFromPoint
~TiledImageBidirectionalRangeFromPoint()
Definition: TiledImageBidirectionalRangeFromPoint.h:131
DGtal::TiledImageBidirectionalRangeFromPoint::end
ConstIterator end() const
Definition: TiledImageBidirectionalRangeFromPoint.h:226
DGtal::TiledImageBidirectionalRangeFromPoint::ReverseOutputIterator
std::reverse_iterator< Iterator > ReverseOutputIterator
Definition: TiledImageBidirectionalRangeFromPoint.h:92
DGtal::TiledImage::TiledIterator
Definition: TiledImage.h:232
DGtal::IteratorCirculatorTraits::Value
IC::value_type Value
Definition: IteratorCirculatorTraits.h:303
Value
double Value
Definition: testSimpleRandomAccessRangeFromPoint.cpp:38
DGtal::TiledImageBidirectionalRangeFromPoint::ConstReverseIterator
std::reverse_iterator< ConstIterator > ConstReverseIterator
Definition: TiledImageBidirectionalRangeFromPoint.h:89