DGtal
0.6.devel
Main Page
Related Pages
Modules
Namespaces
Data Structures
Examples
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Groups
Pages
src
DGtal
geometry
volumes
distance
VoronoiMap.h
1
17
#pragma once
18
34
#if defined(VoronoiMap_RECURSES)
35
#error Recursive header files inclusion detected in VoronoiMap.h
36
#else // defined(VoronoiMap_RECURSES)
37
38
#define VoronoiMap_RECURSES
39
40
#if !defined VoronoiMap_h
41
42
#define VoronoiMap_h
43
45
// Inclusions
46
#include <iostream>
47
#include <vector>
48
#include "DGtal/base/Common.h"
49
#include "DGtal/images/ImageContainerBySTLVector.h"
50
#include "DGtal/kernel/CPointPredicate.h"
51
52
#include "DGtal/geometry/volumes/distance/SeparableMetricHelper.h"
53
#include "DGtal/kernel/domains/HyperRectDomain.h"
55
56
namespace
DGtal
57
{
58
60
// template class VoronoiMap
106
template
<
typename
TSpace,
107
typename
TPointPredicate,
108
DGtal::uint32_t
p>
109
class
VoronoiMap
110
{
111
112
public
:
113
BOOST_CONCEPT_ASSERT
((
CSpace< TSpace >
));
114
BOOST_CONCEPT_ASSERT
((
CPointPredicate<TPointPredicate>
));
115
117
BOOST_STATIC_ASSERT
((boost::is_same<
typename
TSpace::Point,
118
typename
TPointPredicate::Point >::value ));
119
121
typedef
TSpace
Space
;
122
124
typedef
TPointPredicate
PointPredicate
;
125
127
typedef
HyperRectDomain<Space>
Domain
;
128
130
typedef
DGtal::int64_t
IntegerLong
;
131
132
typedef
typename
Space::Vector
Vector
;
133
typedef
typename
Space::Point
Point
;
134
typedef
typename
Space::Dimension
Dimension
;
135
typedef
typename
Space::Size
Size
;
136
typedef
typename
Space::Point::Coordinate
Abscissa
;
137
139
typedef
SeparableMetricHelper< Point , IntegerLong , p >
SeparableMetric
;
140
142
typedef
ImageContainerBySTLVector
<
Domain
,
143
Point
>
OutputImage
;
144
148
VoronoiMap
(
const
Domain
& aDomain,
149
const
PointPredicate
& predicate);
150
154
~VoronoiMap
();
155
156
public
:
157
166
OutputImage
compute
( ) ;
167
168
169
// ------------------- Private functions ------------------------
170
private
:
171
178
void
computeOtherSteps
(
OutputImage
& output,
179
const
Dimension
dim)
const
;
192
void
computeOtherStep1D
(
OutputImage
& output,
193
const
Point
&row,
194
const
Size
dim,
195
std::vector<Point> &Sites)
const
;
196
197
// ------------------- protected methods ------------------------
198
protected
:
199
204
VoronoiMap
();
205
206
207
// ------------------- Private members ------------------------
208
private
:
209
211
SeparableMetric
myMetric
;
212
214
const
Domain
&
myDomain
;
215
217
const
PointPredicate
&
myPointPredicate
;
218
220
Point
myLowerBoundCopy
;
221
223
Point
myUpperBoundCopy
;
224
226
Point
myInfinity
;
227
228
229
};
// end of class VoronoiMap
230
231
}
// namespace DGtal
232
233
235
// Includes inline functions.
236
#include "DGtal/geometry/volumes/distance/VoronoiMap.ih"
237
238
// //
240
241
#endif // !defined VoronoiMap_h
242
243
#undef VoronoiMap_RECURSES
244
#endif // else defined(VoronoiMap_RECURSES)
Generated on Wed Dec 19 2012 19:10:43 for DGtal by
1.8.1.1