DGtal 1.4.2
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{
67
69
70 // ----------------------- Standard services ------------------------------
71 public:
72
73 using iterator_category = std::output_iterator_tag;
74 using value_type = void;
75 using difference_type = void;
76 using pointer = void;
77 using reference = void;
78
83 explicit DigitalSetInserter (TDigitalSet& aSet)
84 : mySet(&aSet) {}
85
86 // ----------------------- Interface --------------------------------------
87 public:
88
94 { mySet->insert(aPoint); return *this; }
95
114
115
116 // ------------------------- Private Datas --------------------------------
117 private:
121 TDigitalSet* mySet;
122
123 }; // end of class DigitalSetInserter
124
125}
127// Includes inline functions.
128//#include "DGtal/images/DigitalSetInserter.ih"
129
130//
132
133#endif // !defined DigitalSetInserter_h
134
135#undef DigitalSetInserter_RECURSES
136#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++()
std::output_iterator_tag iterator_category
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...
const Point aPoint(3, 4)