DGtal 1.3.0
Loading...
Searching...
No Matches
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)
35#define DigitalSetInserter_RECURSES
36
37#if !defined DigitalSetInserter_h
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
50namespace 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)
Aim: this output iterator class is designed to allow algorithms to insert points in the digital set....
DigitalSetInserter< TDigitalSet > & operator*()
DigitalSetInserter< TDigitalSet > & operator++()
BOOST_CONCEPT_ASSERT((concepts::CDigitalSet< TDigitalSet >))
DigitalSetInserter< TDigitalSet > & operator=(typename TDigitalSet::Point aPoint)
DigitalSetInserter(TDigitalSet &aSet)
DGtal is the top-level namespace which contains all DGtal functions and types.
Aim: Represents a set of points within the given domain. This set of points is modifiable by the user...
Definition: CDigitalSet.h:141
const Point aPoint(3, 4)