DGtal  1.1.0
DigitalSetInserter.h
1 
17 #pragma once
18 
31 #if defined(DigitalSetInserter_RECURSES)
32 #error Recursive header files inclusion detected in DigitalSetInserter.h
33 #else // defined(DigitalSetInserter_RECURSES)
34 
35 #define DigitalSetInserter_RECURSES
36 
37 #if !defined DigitalSetInserter_h
38 
39 #define DigitalSetInserter_h
40 
42 // Inclusions
43 #include "DGtal/base/Common.h"
44 #include "DGtal/kernel/sets/CDigitalSet.h"
45 
46 #include <iostream>
47 
49 
50 namespace DGtal
51 {
52 
54  // template class DigitalSetInserter
64  template <typename TDigitalSet>
66  public std::iterator<std::output_iterator_tag,void,void,void,void>
67 {
68 
70 
71  // ----------------------- Standard services ------------------------------
72  public:
77  explicit DigitalSetInserter (TDigitalSet& aSet)
78  : mySet(&aSet) {}
79 
80  // ----------------------- Interface --------------------------------------
81  public:
82 
88  { mySet->insert(aPoint); return *this; }
89 
95  { return *this; }
101  { return *this; }
107  { return *this; }
108 
109 
110  // ------------------------- Private Datas --------------------------------
111  private:
115  TDigitalSet* mySet;
116 
117  }; // end of class DigitalSetInserter
118 
119 }
121 // Includes inline functions.
122 //#include "DGtal/images/DigitalSetInserter.ih"
123 
124 //
126 
127 #endif // !defined DigitalSetInserter_h
128 
129 #undef DigitalSetInserter_RECURSES
130 #endif // else defined(DigitalSetInserter_RECURSES)
DGtal::DigitalSetInserter::DigitalSetInserter
DigitalSetInserter(TDigitalSet &aSet)
Definition: DigitalSetInserter.h:77
DGtal::DigitalSetInserter::operator*
DigitalSetInserter< TDigitalSet > & operator*()
Definition: DigitalSetInserter.h:94
aPoint
const Point aPoint(3, 4)
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition: ClosedIntegerHalfPlane.h:49
DGtal::DigitalSetInserter::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((concepts::CDigitalSet< TDigitalSet >))
DGtal::DigitalSetInserter::operator=
DigitalSetInserter< TDigitalSet > & operator=(typename TDigitalSet::Point aPoint)
Definition: DigitalSetInserter.h:87
DGtal::DigitalSetInserter
Aim: this output iterator class is designed to allow algorithms to insert points in the digital set....
Definition: DigitalSetInserter.h:67
DGtal::concepts::CDigitalSet
Aim: Represents a set of points within the given domain. This set of points is modifiable by the user...
Definition: CDigitalSet.h:141
DGtal::DigitalSetInserter::mySet
TDigitalSet * mySet
Definition: DigitalSetInserter.h:115
Point
MyPointD Point
Definition: testClone2.cpp:383
DGtal::DigitalSetInserter::operator++
DigitalSetInserter< TDigitalSet > & operator++()
Definition: DigitalSetInserter.h:100