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
topology
MetricAdjacency.h
1
17
#pragma once
18
31
#if defined(MetricAdjacency_RECURSES)
32
#error Recursive header files inclusion detected in MetricAdjacency.h
33
#else // defined(MetricAdjacency_RECURSES)
34
35
#define MetricAdjacency_RECURSES
36
37
#if !defined MetricAdjacency_h
38
39
#define MetricAdjacency_h
40
42
// Inclusions
43
#include <iostream>
44
#include <set>
45
#include <map>
46
#include "DGtal/base/Common.h"
47
#include "DGtal/kernel/CSpace.h"
48
#include "DGtal/kernel/SpaceND.h"
49
#include "DGtal/kernel/BasicPointPredicates.h"
51
52
namespace
DGtal
53
{
54
56
// template class MetricAdjacency
77
template
<
typename
TSpace,
Dimension
maxNorm1,
78
Dimension
dimension = TSpace::dimension >
79
class
MetricAdjacency
80
{
81
BOOST_CONCEPT_ASSERT
((
CSpace<TSpace>
));
82
// ----------------------- public types ------------------------------
83
public
:
84
// Required by CAdjacency
85
typedef
TSpace
Space
;
86
typedef
typename
Space::Point
Point
;
87
typedef
MetricAdjacency<Space, maxNorm1, dimension>
Adjacency
;
88
89
// Others
90
typedef
typename
Space::Vector
Vector
;
91
92
// Required by CUndirectedSimpleLocalGraph
93
typedef
Point
Vertex
;
94
typedef
typename
Space::Size
Size
;
95
typedef
std::set<Vertex>
VertexSet
;
// DigitalSet doesn't fit since MetricAdjacency has no domain
96
template
<
typename
Value>
struct
VertexMap
{
97
typedef
typename
std::map<Vertex, Value>
Type
;
98
};
99
100
// ----------------------- Standard services ------------------------------
101
public
:
102
107
MetricAdjacency
();
108
112
~MetricAdjacency
();
113
114
// ----------------------- Adjacency services -----------------------------
115
public
:
116
124
static
125
bool
isAdjacentTo
(
const
Point
& p1,
const
Point
& p2 );
126
134
static
135
bool
isProperlyAdjacentTo
(
const
Point
& p1,
const
Point
& p2 );
136
137
138
// ----------------------- Local graph services --------------------------
139
143
static
144
Size
bestCapacity
();
145
151
static
152
Size
degree
(
const
Vertex
& v );
153
165
template
<
typename
OutputIterator>
166
static
167
void
168
writeNeighbors
( OutputIterator &it ,
169
const
Vertex
& v );
170
187
template
<
typename
OutputIterator,
typename
VertexPredicate>
188
static
189
void
190
writeNeighbors
( OutputIterator &it ,
191
const
Vertex
& v,
192
const
VertexPredicate & pred);
193
194
// ----------------------- Interface --------------------------------------
195
public
:
196
201
static
202
void
selfDisplay
( std::ostream & out );
203
208
static
209
bool
isValid
();
210
211
// ------------------------- Protected Datas ------------------------------
212
private
:
213
// ------------------------- Private Datas --------------------------------
214
private
:
215
216
// ------------------------- Hidden services ------------------------------
217
protected
:
218
static
Size
computeCapacity
();
219
220
private
:
221
227
MetricAdjacency
(
const
MetricAdjacency
& other );
228
235
MetricAdjacency
&
operator=
(
const
MetricAdjacency
& other );
236
237
// ------------------------- Internals ------------------------------------
238
private
:
239
240
};
// end of class MetricAdjacency
241
248
template
<
typename
TSpace, Dimension maxNorm1>
249
std::ostream&
250
operator<<
( std::ostream & out,
251
const
MetricAdjacency
< TSpace,maxNorm1,
252
TSpace::dimension > &
object
);
253
254
}
// namespace DGtal
255
256
258
// Includes inline functions.
259
#include "DGtal/topology/MetricAdjacency.ih"
260
261
// //
263
264
#endif // !defined MetricAdjacency_h
265
266
#undef MetricAdjacency_RECURSES
267
#endif // else defined(MetricAdjacency_RECURSES)
Generated on Wed Dec 19 2012 19:10:29 for DGtal by
1.8.1.1