DGtal  1.2.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)
35 #define DigitalSurface2DSlice_RECURSES
36 
37 #if !defined DigitalSurface2DSlice_h
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/DigitalSurface.h"
48 #include "DGtal/topology/CDigitalSurfaceTracker.h"
50 
51 namespace DGtal
52 {
53 
55  // template class DigitalSurface2DSlice
92  template <typename TDigitalSurfaceTracker>
94  {
95  public:
96  typedef TDigitalSurfaceTracker DigitalSurfaceTracker;
98 
100  typedef typename DigitalSurfaceTracker::DigitalSurfaceContainer DigitalSurfaceContainer;
105 
106  typedef std::deque<Surfel> Storage;
107  typedef typename Storage::const_iterator ConstIterator;
108  typedef typename Storage::const_reverse_iterator ConstReverseIterator;
111 
112 
113  // ----------------------- Standard services ------------------------------
114  public:
115 
120 
141 
161  bool init( DigitalSurfaceTracker* tracker, Dimension i );
162 
164  Size size() const;
165 
167  bool isClosed() const;
168 
173 
179 
184 
190 
191  // ------------------------- iterator services ----------------------------
192  public:
193 
199 
205 
211 
217 
223 
229 
230  // ----------------------- Interface --------------------------------------
231  public:
232 
237  void selfDisplay ( std::ostream & out ) const;
238 
243  bool isValid() const;
244 
245  // ------------------------- Protected Datas ------------------------------
246  private:
247  // ------------------------- Private Datas --------------------------------
248  private:
250  std::deque<Surfel> mySurfels;
256  // ------------------------- Hidden services ------------------------------
257  protected:
258 
264 
265  private:
266 
273 
281 
282  // ------------------------- Internals ------------------------------------
283  private:
284 
285  }; // end of class DigitalSurface2DSlice
286 
287 
294  template <typename TDigitalSurfaceTracker>
295  std::ostream&
296  operator<< ( std::ostream & out, const DigitalSurface2DSlice<TDigitalSurfaceTracker> & object );
297 
298 } // namespace DGtal
299 
300 
302 // Includes inline functions.
303 #include "DGtal/topology/DigitalSurface2DSlice.ih"
304 
305 // //
307 
308 #endif // !defined DigitalSurface2DSlice_h
309 
310 #undef DigitalSurface2DSlice_RECURSES
311 #endif // else defined(DigitalSurface2DSlice_RECURSES)
Aim: Provides an adapter for classical iterators that can iterate through the underlying data structu...
Definition: Circulator.h:86
Aim: Represents a 2-dimensional slice in a DigitalSurface. In a sense, it is a 4-connected contour,...
ConstCirculator cstart() const
ConstIterator begin() const
Size size() const
The number of surfels of this slice.
DigitalSurfaceContainer::KSpace KSpace
void selfDisplay(std::ostream &out) const
DigitalSurface2DSlice< DigitalSurfaceTracker > Self
ConstReverseIterator rbegin() const
DigitalSurfaceContainer::Size Size
TDigitalSurfaceTracker DigitalSurfaceTracker
ConstIterator start() const
Storage::const_reverse_iterator ConstReverseIterator
Circulator< ConstReverseIterator > ConstReverseCirculator
ConstReverseCirculator rc() const
ConstCirculator c() const
ConstIterator end() const
ConstReverseCirculator rcstart() const
Circulator< ConstIterator > ConstCirculator
DigitalSurfaceTracker::DigitalSurfaceContainer DigitalSurfaceContainer
DigitalSurface2DSlice & operator=(const DigitalSurface2DSlice &other)
bool init(DigitalSurfaceTracker *tracker, Dimension i)
BOOST_CONCEPT_ASSERT((concepts::CDigitalSurfaceTracker< DigitalSurfaceTracker >))
DigitalSurface< DigitalSurfaceContainer > TheDigitalSurface
std::deque< Surfel > mySurfels
The container that stores the surfels of this slice.
DigitalSurfaceContainer::Surfel Surfel
bool myIsClosed
Tells if the slice is closed (true) or open (false).
ConstReverseIterator rend() const
Storage::const_iterator ConstIterator
DigitalSurface2DSlice(const DigitalSurface2DSlice &other)
DigitalSurface2DSlice(DigitalSurfaceTracker *tracker, Dimension i)
ConstReverseIterator rstart() const
Aim: Represents a set of n-1-cells in a nD space, together with adjacency relation between these cell...
DGtal is the top-level namespace which contains all DGtal functions and types.
std::ostream & operator<<(std::ostream &out, const ClosedIntegerHalfPlane< TSpace > &object)
DGtal::uint32_t Dimension
Definition: Common.h:137
HalfEdgeDataStructure::Size Size