DGtal  1.3.beta
TiledImageBidirectionalConstRangeFromPoint.h
1 
17 #pragma once
18 
33 #if defined(TiledImageBidirectionalConstRangeFromPoint_RECURSES)
34 #error Recursive header files inclusion detected in TiledImageBidirectionalConstRangeFromPoint.h
35 #else // defined(TiledImageBidirectionalConstRangeFromPoint_RECURSES)
36 
37 #define TiledImageBidirectionalConstRangeFromPoint_RECURSES
38 
39 #if !defined TiledImageBidirectionalConstRangeFromPoint_h
40 
41 #define TiledImageBidirectionalConstRangeFromPoint_h
42 
44 // Inclusions
45 #include "DGtal/base/BasicFunctors.h"
46 #include "DGtal/base/Circulator.h"
47 #include "DGtal/base/ConstIteratorAdapter.h"
48 #include "DGtal/base/CConstBidirectionalRangeFromPoint.h"
49 #include "boost/concept_check.hpp"
51 
52 namespace DGtal
53 {
54 
55 
57  // class TiledImageBidirectionalConstRangeFromPoint
59 
69  template <typename TTiledImage>
70 
72  {
73 
75 
76  // ------------------------- inner types --------------------------------
77 
78  public:
79 
80  typedef TTiledImage TiledImage;
81 
82  typedef typename TiledImage::Point Point;
83 
85  typedef std::reverse_iterator<ConstIterator> ConstReverseIterator;
86 
88  typedef std::reverse_iterator<ConstCirculator> ConstReverseCirculator;
89 
90  // ------------------------- standard services --------------------------------
91 
97  : myti ( ti ) {}
98 
104  : myti ( other.myti ) {}
105 
112  {
113  if ( this != &other )
114  {
115  myti = other.myti;
116  }
117 
118  return *this;
119  }
120 
125 
130  bool isValid() const
131  {
132  return true;
133  }
134 
135  // ------------------------- display --------------------------------
140  void selfDisplay ( std::ostream & out ) const
141  {
143  out << "[TiledImageBidirectionalConstRangeFromPoint]" << std::endl;
144  out << "\t";
145  std::copy ( myti->begin(), myti->end(), std::ostream_iterator<Value> ( out, ", " ) );
146  out << std::endl;
147  }
148 
152  std::string className() const
153  {
154  return "TiledImageBidirectionalConstRangeFromPoint";
155  }
156 
157 
158  // ------------------------- private data --------------------------------
159 
160  private:
161 
162  const TTiledImage *myti;
163 
164  // ------------------------- iterator services --------------------------------
165 
166  public:
167 
173  {
174  return ConstIterator ( myti->begin() );
175  }
176 
181  ConstIterator begin ( const Point &aPoint ) const
182  {
183  return ConstIterator ( myti->begin(aPoint) );
184  }
185 
191  {
192  return ConstIterator ( myti->end() );
193  }
194 
200  {
201  return ConstReverseIterator ( this->end() );
202  }
203 
208  ConstReverseIterator rbegin ( const Point &aPoint ) const
209  {
210  return ConstReverseIterator ( myti->rbegin(aPoint) );
211  }
212 
218  {
219  return ConstReverseIterator ( this->begin() );
220  }
221 
226  ConstCirculator c() const
227  {
228  return ConstCirculator ( this->begin(), this->begin(), this->end() );
229  }
230 
235  ConstReverseCirculator rc() const
236  {
237  return ConstReverseCirculator ( this->c() );
238  }
239 
240  }; //end class TiledImageBidirectionalConstRangeFromPoint
241 
242 } // namespace DGtal
243 
245 
246 
247 #endif // !defined TiledImageBidirectionalConstRangeFromPoint_h
248 
249 #undef TiledImageBidirectionalConstRangeFromPoint_RECURSES
250 #endif // else defined(TiledImageBidirectionalConstRangeFromPoint_RECURSES)
DGtal::TiledImageBidirectionalConstRangeFromPoint::TiledImage
TTiledImage TiledImage
Definition: TiledImageBidirectionalConstRangeFromPoint.h:80
DGtal::Circulator
Aim: Provides an adapter for classical iterators that can iterate through the underlying data structu...
Definition: Circulator.h:85
DGtal::TiledImageBidirectionalConstRangeFromPoint::TiledImageBidirectionalConstRangeFromPoint
TiledImageBidirectionalConstRangeFromPoint(const TiledImage *ti)
Definition: TiledImageBidirectionalConstRangeFromPoint.h:96
aPoint
const Point aPoint(3, 4)
DGtal::TiledImageBidirectionalConstRangeFromPoint
Aim: model of CConstBidirectionalRangeFromPoint that adapts a TiledImage range of elements bounded by...
Definition: TiledImageBidirectionalConstRangeFromPoint.h:71
DGtal::TiledImageBidirectionalConstRangeFromPoint::ConstReverseIterator
std::reverse_iterator< ConstIterator > ConstReverseIterator
Definition: TiledImageBidirectionalConstRangeFromPoint.h:85
DGtal::TiledImageBidirectionalConstRangeFromPoint::operator=
TiledImageBidirectionalConstRangeFromPoint & operator=(const TiledImageBidirectionalConstRangeFromPoint &other)
Definition: TiledImageBidirectionalConstRangeFromPoint.h:111
DGtal::TiledImageBidirectionalConstRangeFromPoint::ConstCirculator
Circulator< ConstIterator > ConstCirculator
Definition: TiledImageBidirectionalConstRangeFromPoint.h:87
DGtal::TiledImageBidirectionalConstRangeFromPoint::rc
ConstReverseCirculator rc() const
Definition: TiledImageBidirectionalConstRangeFromPoint.h:235
DGtal::TiledImageBidirectionalConstRangeFromPoint::c
ConstCirculator c() const
Definition: TiledImageBidirectionalConstRangeFromPoint.h:226
DGtal::TiledImageBidirectionalConstRangeFromPoint::begin
ConstIterator begin(const Point &aPoint) const
Definition: TiledImageBidirectionalConstRangeFromPoint.h:181
DGtal::TiledImageBidirectionalConstRangeFromPoint::end
ConstIterator end() const
Definition: TiledImageBidirectionalConstRangeFromPoint.h:190
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
DGtal::TiledImageBidirectionalConstRangeFromPoint::Point
TiledImage::Point Point
Definition: TiledImageBidirectionalConstRangeFromPoint.h:82
DGtal::TiledImageBidirectionalConstRangeFromPoint::begin
ConstIterator begin() const
Definition: TiledImageBidirectionalConstRangeFromPoint.h:172
boost::BidirectionalIterator
Go to http://www.sgi.com/tech/stl/BidirectionalIterator.html.
Definition: Boost.dox:42
DGtal::TiledImageBidirectionalConstRangeFromPoint::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((boost::BidirectionalIterator< typename TTiledImage::ConstIterator >))
DGtal::TiledImageBidirectionalConstRangeFromPoint::rend
ConstReverseIterator rend() const
Definition: TiledImageBidirectionalConstRangeFromPoint.h:217
DGtal::TiledImageBidirectionalConstRangeFromPoint::className
std::string className() const
Definition: TiledImageBidirectionalConstRangeFromPoint.h:152
DGtal::TiledImageBidirectionalConstRangeFromPoint::selfDisplay
void selfDisplay(std::ostream &out) const
Definition: TiledImageBidirectionalConstRangeFromPoint.h:140
DGtal::PointVector< dim, Integer >
DGtal::TiledImageBidirectionalConstRangeFromPoint::~TiledImageBidirectionalConstRangeFromPoint
~TiledImageBidirectionalConstRangeFromPoint()
Definition: TiledImageBidirectionalConstRangeFromPoint.h:124
DGtal::TiledImageBidirectionalConstRangeFromPoint::TiledImageBidirectionalConstRangeFromPoint
TiledImageBidirectionalConstRangeFromPoint(const TiledImageBidirectionalConstRangeFromPoint &other)
Definition: TiledImageBidirectionalConstRangeFromPoint.h:103
DGtal::TiledImageBidirectionalConstRangeFromPoint::ConstIterator
TiledImage::ConstIterator ConstIterator
Definition: TiledImageBidirectionalConstRangeFromPoint.h:84
DGtal::TiledImageBidirectionalConstRangeFromPoint::isValid
bool isValid() const
Definition: TiledImageBidirectionalConstRangeFromPoint.h:130
DGtal::TiledImageBidirectionalConstRangeFromPoint::ConstReverseCirculator
std::reverse_iterator< ConstCirculator > ConstReverseCirculator
Definition: TiledImageBidirectionalConstRangeFromPoint.h:88
DGtal::TiledImageBidirectionalConstRangeFromPoint::rbegin
ConstReverseIterator rbegin(const Point &aPoint) const
Definition: TiledImageBidirectionalConstRangeFromPoint.h:208
DGtal::TiledImageBidirectionalConstRangeFromPoint::myti
const TTiledImage * myti
Definition: TiledImageBidirectionalConstRangeFromPoint.h:162
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::TiledImageBidirectionalConstRangeFromPoint::rbegin
ConstReverseIterator rbegin() const
Definition: TiledImageBidirectionalConstRangeFromPoint.h:199