DGtal
2.2.0
Toggle main menu visibility
Loading...
Searching...
No Matches
ImageContainerBySTLMap.h
1
16
17
#pragma once
18
36
37
#if defined(ImageContainerBySTLMap_RECURSES)
38
#error Recursive header files inclusion detected in ImageContainerBySTLMap.h
39
#else
// defined(ImageContainerBySTLMap_RECURSES)
41
#define ImageContainerBySTLMap_RECURSES
42
43
#if !defined ImageContainerBySTLMap_h
45
#define ImageContainerBySTLMap_h
46
48
// Inclusions
49
#include <iostream>
50
#include <map>
51
52
#include "DGtal/base/Common.h"
53
#include "DGtal/base/BasicFunctors.h"
54
#include "DGtal/base/CowPtr.h"
55
#include "DGtal/base/Clone.h"
56
#include "DGtal/images/DefaultConstImageRange.h"
57
#include "DGtal/images/DefaultImageRange.h"
58
#include "DGtal/images/SetValueIterator.h"
59
#include "DGtal/base/CLabel.h"
60
#include "DGtal/kernel/domains/CDomain.h"
61
63
64
#ifdef _MSC_VER
65
#pragma warning(disable : 4290)
66
#endif
67
68
namespace
DGtal
69
{
70
72
// class ImageContainerBySTLMap
94
95
template
<
typename
TDomain,
typename
TValue>
96
class
ImageContainerBySTLMap
:
97
public
std::map<typename TDomain::Point, TValue >
98
{
99
100
public
:
101
102
typedef
ImageContainerBySTLMap<TDomain,TValue>
Self
;
103
typedef
std::map<typename TDomain::Point, TValue >
Parent
;
104
typedef
Parent
Container
;
105
107
BOOST_CONCEPT_ASSERT
((
concepts::CDomain<TDomain>
));
108
typedef
TDomain
Domain
;
109
typedef
typename
Domain::Point
Point
;
110
typedef
typename
Domain::Vector
Vector
;
111
typedef
typename
Domain::Integer
Integer
;
112
typedef
typename
Domain::Size
Size
;
113
typedef
typename
Domain::Dimension
Dimension
;
114
typedef
Point
Vertex
;
115
116
// Pointer to the (const) Domain given at construction.
117
typedef
CowPtr< const Domain >
DomainPtr
;
118
120
static
const
typename
Domain::Dimension
dimension
;
121
123
BOOST_CONCEPT_ASSERT
((
concepts::CLabel<TValue>
));
124
typedef
TValue
Value
;
125
typedef
DefaultConstImageRange<Self>
ConstRange
;
126
typedef
DefaultImageRange<Self>
Range
;
127
129
typedef
SetValueIterator<Self>
OutputIterator
;
130
132
private
:
133
137
DomainPtr
myDomainPtr
;
138
140
Value
myDefaultValue
;
141
143
144
public
:
145
155
ImageContainerBySTLMap
(
Clone<const Domain>
aDomain,
const
Value
& aValue = 0);
156
162
ImageContainerBySTLMap
(
const
ImageContainerBySTLMap
& other);
163
170
ImageContainerBySTLMap
&
operator=
(
const
ImageContainerBySTLMap
& other);
171
176
~ImageContainerBySTLMap
();
177
178
180
190
Value
operator()
(
const
Point
&
aPoint
)
const
;
191
200
void
setValue
(
const
Point
&
aPoint
,
const
Value
&aValue);
201
202
206
const
Domain
&
domain
()
const
;
207
212
ConstRange
constRange
()
const
;
213
218
Range
range
();
219
224
const
Container
&
container
()
const
{
return
static_cast<
Parent
>
(*this); };
229
Container
&
container
() {
return
static_cast<
Parent
>
(*this); };
230
235
void
selfDisplay
( std::ostream & out )
const
;
236
237
241
bool
isValid
()
const
;
242
246
std::string
className
()
const
;
247
248
250
typedef
typename
std::map<Point,Value>::iterator
Iterator
;
251
typedef
typename
std::map<Point,Value>::const_iterator
ConstIterator
;
252
typedef
typename
std::map<Point,Value>::reverse_iterator
ReverseIterator
;
253
typedef
typename
std::map<Point,Value>::const_reverse_iterator
ConstReverseIterator
;
254
260
OutputIterator
outputIterator
();
261
262
263
};
264
271
template
<
typename
TDomain,
typename
TValue>
272
inline
273
std::ostream&
274
operator<<
( std::ostream & out,
275
const
ImageContainerBySTLMap<TDomain,TValue>
&
object
)
276
{
277
object
.selfDisplay ( out );
278
return
out;
279
}
280
281
282
}
// namespace DGtal
283
284
286
// Includes inline functions
287
#include "DGtal/images/ImageContainerBySTLMap.ih"
288
// //
290
291
#endif
// !defined ImageContainerBySTLMap_h
292
293
#undef ImageContainerBySTLMap_RECURSES
294
#endif
// else defined(ImageContainerBySTLMap_RECURSES)
DGtal::Clone
Aim: This class encapsulates its parameter class to indicate that the given parameter is required to ...
Definition
Clone.h:266
DGtal::CowPtr< const Domain >
DGtal::DefaultConstImageRange
Aim: model of CConstBidirectionalRangeFromPoint that adapts the domain of an image in order to iterat...
Definition
DefaultConstImageRange.h:78
DGtal::DefaultImageRange
Aim: model of CConstBidirectionalRangeFromPoint and CBidirectionalRangeWithWritableIteratorFromPoint ...
Definition
DefaultImageRange.h:78
DGtal::HyperRectDomain< Space >::Vector
Space::Vector Vector
Definition
HyperRectDomain.h:115
DGtal::HyperRectDomain< Space >::Size
Space::Size Size
Definition
HyperRectDomain.h:117
DGtal::HyperRectDomain< Space >::Integer
Space::Integer Integer
Definition
HyperRectDomain.h:114
DGtal::HyperRectDomain< Space >::Dimension
Space::Dimension Dimension
Definition
HyperRectDomain.h:116
DGtal::HyperRectDomain< Space >::Point
Space::Point Point
Definition
HyperRectDomain.h:113
DGtal::ImageContainerBySTLMap
Definition
ImageContainerBySTLMap.h:98
DGtal::ImageContainerBySTLMap::Size
Domain::Size Size
Definition
ImageContainerBySTLMap.h:112
DGtal::ImageContainerBySTLMap::Dimension
Domain::Dimension Dimension
Definition
ImageContainerBySTLMap.h:113
DGtal::ImageContainerBySTLMap::ImageContainerBySTLMap
ImageContainerBySTLMap(Clone< const Domain > aDomain, const Value &aValue=0)
DGtal::ImageContainerBySTLMap::constRange
ConstRange constRange() const
DGtal::ImageContainerBySTLMap::OutputIterator
SetValueIterator< Self > OutputIterator
output iterator
Definition
ImageContainerBySTLMap.h:129
DGtal::ImageContainerBySTLMap::container
const Container & container() const
Definition
ImageContainerBySTLMap.h:224
DGtal::ImageContainerBySTLMap::Iterator
std::map< Point, Value >::iterator Iterator
built-in iterators
Definition
ImageContainerBySTLMap.h:250
DGtal::ImageContainerBySTLMap::Range
DefaultImageRange< Self > Range
Definition
ImageContainerBySTLMap.h:126
DGtal::ImageContainerBySTLMap::domain
const Domain & domain() const
DGtal::ImageContainerBySTLMap::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((concepts::CDomain< TDomain >))
domain
DGtal::ImageContainerBySTLMap< Z2i::Domain, DGtal::int32_t >::myDefaultValue
Value myDefaultValue
Definition
ImageContainerBySTLMap.h:140
DGtal::ImageContainerBySTLMap::operator=
ImageContainerBySTLMap & operator=(const ImageContainerBySTLMap &other)
DGtal::ImageContainerBySTLMap::Integer
Domain::Integer Integer
Definition
ImageContainerBySTLMap.h:111
DGtal::ImageContainerBySTLMap::ConstReverseIterator
std::map< Point, Value >::const_reverse_iterator ConstReverseIterator
Definition
ImageContainerBySTLMap.h:253
DGtal::ImageContainerBySTLMap::selfDisplay
void selfDisplay(std::ostream &out) const
DGtal::ImageContainerBySTLMap::DomainPtr
CowPtr< const Domain > DomainPtr
Definition
ImageContainerBySTLMap.h:117
DGtal::ImageContainerBySTLMap::isValid
bool isValid() const
DGtal::ImageContainerBySTLMap::operator()
Value operator()(const Point &aPoint) const
DGtal::ImageContainerBySTLMap::Parent
std::map< typename TDomain::Point, TValue > Parent
Definition
ImageContainerBySTLMap.h:103
DGtal::ImageContainerBySTLMap::ReverseIterator
std::map< Point, Value >::reverse_iterator ReverseIterator
Definition
ImageContainerBySTLMap.h:252
DGtal::ImageContainerBySTLMap::Domain
TDomain Domain
Definition
ImageContainerBySTLMap.h:108
DGtal::ImageContainerBySTLMap::range
Range range()
DGtal::ImageContainerBySTLMap::className
std::string className() const
DGtal::ImageContainerBySTLMap::Value
TValue Value
Definition
ImageContainerBySTLMap.h:124
DGtal::ImageContainerBySTLMap::setValue
void setValue(const Point &aPoint, const Value &aValue)
DGtal::ImageContainerBySTLMap::ConstRange
DefaultConstImageRange< Self > ConstRange
Definition
ImageContainerBySTLMap.h:125
DGtal::ImageContainerBySTLMap::Container
Parent Container
Definition
ImageContainerBySTLMap.h:104
DGtal::ImageContainerBySTLMap::~ImageContainerBySTLMap
~ImageContainerBySTLMap()
DGtal::ImageContainerBySTLMap::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((concepts::CLabel< TValue >))
range of values
DGtal::ImageContainerBySTLMap::Vector
Domain::Vector Vector
Definition
ImageContainerBySTLMap.h:110
DGtal::ImageContainerBySTLMap< Z2i::Domain, DGtal::int32_t >::dimension
static const Domain::Dimension dimension
Definition
ImageContainerBySTLMap.h:120
DGtal::ImageContainerBySTLMap::Self
ImageContainerBySTLMap< TDomain, TValue > Self
Definition
ImageContainerBySTLMap.h:102
DGtal::ImageContainerBySTLMap::ConstIterator
std::map< Point, Value >::const_iterator ConstIterator
Definition
ImageContainerBySTLMap.h:251
DGtal::ImageContainerBySTLMap::Vertex
Point Vertex
Definition
ImageContainerBySTLMap.h:114
DGtal::ImageContainerBySTLMap::ImageContainerBySTLMap
ImageContainerBySTLMap(const ImageContainerBySTLMap &other)
DGtal::ImageContainerBySTLMap::outputIterator
OutputIterator outputIterator()
DGtal::ImageContainerBySTLMap< Z2i::Domain, DGtal::int32_t >::myDomainPtr
DomainPtr myDomainPtr
Definition
ImageContainerBySTLMap.h:137
DGtal::ImageContainerBySTLMap::container
Container & container()
Definition
ImageContainerBySTLMap.h:229
DGtal::ImageContainerBySTLMap::Point
Domain::Point Point
Definition
ImageContainerBySTLMap.h:109
DGtal::SetValueIterator
Aim: implements an output iterator, which is able to write values in an underlying image,...
Definition
SetValueIterator.h:68
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition
ClosedIntegerHalfPlane.h:49
DGtal::operator<<
std::ostream & operator<<(std::ostream &out, const ClosedIntegerHalfPlane< TSpace > &object)
DGtal::concepts::CDomain
Aim: This concept represents a digital domain, i.e. a non mutable subset of points of the given digit...
Definition
CDomain.h:130
DGtal::concepts::CLabel
Aim: Define the concept of DGtal labels. Models of CLabel can be default-constructible,...
Definition
CLabel.h:93
aPoint
const Point aPoint(3, 4)
src
DGtal
images
ImageContainerBySTLMap.h
Generated on
for DGtal by
1.18.0