DGtal  1.0.0
DigitalSurface2DSlice.h
1 
17 #pragma once
18 
31 #if defined(DigitalSurface2DSlice_RECURSES)
32 #error Recursive header files inclusion detected in DigitalSurface2DSlice.h
33 #else // defined(DigitalSurface2DSlice_RECURSES)
34 
35 #define DigitalSurface2DSlice_RECURSES
36 
37 #if !defined DigitalSurface2DSlice_h
38 
39 #define DigitalSurface2DSlice_h
40 
42 // Inclusions
43 #include <iostream>
44 #include <deque>
45 #include "DGtal/base/Common.h"
46 #include "DGtal/base/Circulator.h"
47 #include "DGtal/topology/CDigitalSurfaceTracker.h"
49 
50 namespace DGtal
51 {
52 
54  // template class DigitalSurface2DSlice
91  template <typename TDigitalSurfaceTracker>
93  {
94  public:
95  typedef TDigitalSurfaceTracker DigitalSurfaceTracker;
97 
99  typedef typename DigitalSurfaceTracker::DigitalSurfaceContainer DigitalSurfaceContainer;
101  typedef typename DigitalSurfaceContainer::Surfel Surfel;
102  typedef typename DigitalSurfaceContainer::Size Size;
104 
105  typedef std::deque<Surfel> Storage;
106  typedef typename Storage::const_iterator ConstIterator;
107  typedef typename Storage::const_reverse_iterator ConstReverseIterator;
110 
111 
112  // ----------------------- Standard services ------------------------------
113  public:
114 
119 
140 
160  bool init( DigitalSurfaceTracker* tracker, Dimension i );
161 
163  Size size() const;
164 
166  bool isClosed() const;
167 
171  ConstIterator start() const;
172 
178 
182  ConstCirculator cstart() const;
183 
189 
190  // ------------------------- iterator services ----------------------------
191  public:
192 
197  ConstIterator begin() const;
198 
203  ConstIterator end() const;
204 
210 
215  ConstReverseIterator rend() const;
216 
221  ConstCirculator c() const;
222 
227  ConstReverseCirculator rc() const;
228 
229  // ----------------------- Interface --------------------------------------
230  public:
231 
236  void selfDisplay ( std::ostream & out ) const;
237 
242  bool isValid() const;
243 
244  // ------------------------- Protected Datas ------------------------------
245  private:
246  // ------------------------- Private Datas --------------------------------
247  private:
249  std::deque<Surfel> mySurfels;
255  // ------------------------- Hidden services ------------------------------
256  protected:
257 
263 
264  private:
265 
272 
280 
281  // ------------------------- Internals ------------------------------------
282  private:
283 
284  }; // end of class DigitalSurface2DSlice
285 
286 
293  template <typename TDigitalSurfaceTracker>
294  std::ostream&
295  operator<< ( std::ostream & out, const DigitalSurface2DSlice<TDigitalSurfaceTracker> & object );
296 
297 } // namespace DGtal
298 
299 
301 // Includes inline functions.
302 #include "DGtal/topology/DigitalSurface2DSlice.ih"
303 
304 // //
306 
307 #endif // !defined DigitalSurface2DSlice_h
308 
309 #undef DigitalSurface2DSlice_RECURSES
310 #endif // else defined(DigitalSurface2DSlice_RECURSES)
bool myIsClosed
Tells if the slice is closed (true) or open (false).
DigitalSurface2DSlice & operator=(const DigitalSurface2DSlice &other)
bool init(DigitalSurfaceTracker *tracker, Dimension i)
DGtal::uint32_t Dimension
Definition: Common.h:127
ConstCirculator cstart() const
Aim: Represents a set of n-1-cells in a nD space, together with adjacency relation between these cell...
Circulator< ConstReverseIterator > ConstReverseCirculator
DigitalSurfaceContainer::KSpace KSpace
DigitalSurface< DigitalSurfaceContainer > TheDigitalSurface
Storage::const_iterator ConstIterator
ConstCirculator c() const
ConstIterator start() const
ConstReverseCirculator rcstart() const
std::ostream & operator<<(std::ostream &out, const ClosedIntegerHalfPlane< TSpace > &object)
Aim: Represents a 2-dimensional slice in a DigitalSurface. In a sense, it is a 4-connected contour,...
DigitalSurfaceContainer::Surfel Surfel
void selfDisplay(std::ostream &out) const
Z3i::KSpace KSpace
Aim: Provides an adapter for classical iterators that can iterate through the underlying data structu...
Definition: Circulator.h:85
std::deque< Surfel > mySurfels
The container that stores the surfels of this slice.
DGtal is the top-level namespace which contains all DGtal functions and types.
ConstReverseIterator rstart() const
DigitalSurfaceTracker::DigitalSurfaceContainer DigitalSurfaceContainer
TDigitalSurfaceTracker DigitalSurfaceTracker
DigitalSurface2DSlice< DigitalSurfaceTracker > Self
BOOST_CONCEPT_ASSERT((concepts::CDigitalSurfaceTracker< DigitalSurfaceTracker >))
ConstIterator begin() const
ConstReverseIterator rbegin() const
DigitalSurfaceContainer::Size Size
ConstReverseIterator rend() const
Storage::const_reverse_iterator ConstReverseIterator
Size size() const
The number of surfels of this slice.
ConstReverseCirculator rc() const
Circulator< ConstIterator > ConstCirculator
ConstIterator end() const