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
ExplicitDigitalSurface.h
1
17
#pragma once
18
31
#if defined(ExplicitDigitalSurface_RECURSES)
32
#error Recursive header files inclusion detected in ExplicitDigitalSurface.h
33
#else // defined(ExplicitDigitalSurface_RECURSES)
34
35
#define ExplicitDigitalSurface_RECURSES
36
37
#if !defined ExplicitDigitalSurface_h
38
39
#define ExplicitDigitalSurface_h
40
42
// Inclusions
43
#include <iostream>
44
#include <vector>
45
#include "DGtal/base/Common.h"
46
#include "DGtal/topology/CSurfelPredicate.h"
47
#include "DGtal/topology/Topology.h"
48
#include "DGtal/topology/SurfelAdjacency.h"
49
#include "DGtal/topology/SurfelNeighborhood.h"
51
52
namespace
DGtal
53
{
54
56
// template class ExplicitDigitalSurface
79
template
<
typename
TKSpace,
typename
TSurfelPredicate>
80
class
ExplicitDigitalSurface
81
{
82
public
:
83
87
class
Tracker
88
{
89
public
:
90
// -------------------- associated types --------------------
91
typedef
Tracker
Self
;
92
typedef
ExplicitDigitalSurface<TKSpace,TSurfelPredicate>
93
DigitalSurfaceContainer
;
94
typedef
typename
TKSpace::SCell
Surfel
;
95
96
// -------------------- inner types --------------------
97
typedef
TKSpace
KSpace
;
98
typedef
SurfelNeighborhood<KSpace>
Neighborhood
;
99
100
public
:
106
Tracker
(
const
DigitalSurfaceContainer
& aSurface,
107
const
Surfel
& s );
108
113
Tracker
(
const
Tracker
& other );
114
118
~Tracker
();
119
121
const
DigitalSurfaceContainer
&
surface
()
const
;
123
const
Surfel
&
current
()
const
;
125
Dimension
orthDir
()
const
;
126
132
void
move
(
const
Surfel
& s );
133
150
uint8_t
adjacent
(
Surfel
& s,
Dimension
d,
bool
pos )
const
;
151
152
private
:
155
const
DigitalSurfaceContainer
&
mySurface
;
158
Neighborhood
myNeighborhood
;
159
160
};
161
162
// ----------------------- associated types ------------------------------
163
public
:
164
typedef
ExplicitDigitalSurface<TKSpace,TSurfelPredicate>
Self
;
166
typedef
TKSpace
KSpace
;
168
typedef
typename
KSpace::SCell
Surfel
;
170
typedef
typename
KSpace::Size
Size
;
171
// Model of CSurfelPredicate
172
typedef
TSurfelPredicate
SurfelPredicate
;
173
174
// BOOST_CONCEPT_ASSERT(( CCellularGridSpaceND< KSpace > ));
175
BOOST_CONCEPT_ASSERT
((
CSurfelPredicate< SurfelPredicate >
));
176
177
// -------------------- specific types ------------------------------
178
typedef
typename
std::vector<Surfel>
SurfelStorage
;
179
typedef
typename
SurfelStorage::const_iterator
SurfelConstIterator
;
180
typedef
typename
KSpace::Space
Space
;
181
typedef
typename
KSpace::Point
Point
;
182
typedef
Tracker
DigitalSurfaceTracker
;
183
184
// ----------------------- other types ------------------------------
185
public
:
186
typedef
SurfelAdjacency<KSpace::dimension>
Adjacency
;
187
typedef
typename
KSpace::Cell
Cell
;
188
typedef
typename
KSpace::SCell
SCell
;
189
typedef
typename
KSpace::CellSet
CellSet
;
190
typedef
typename
KSpace::SCellSet
SCellSet
;
191
192
// ----------------------- Standard services ------------------------------
193
public
:
194
198
~ExplicitDigitalSurface
();
199
208
ExplicitDigitalSurface
(
const
ExplicitDigitalSurface
& other );
209
229
ExplicitDigitalSurface
(
const
KSpace
& aKSpace,
230
const
SurfelPredicate
& aSP,
231
const
Adjacency
& adj,
232
const
Surfel
& s,
233
bool
closed =
false
);
234
236
const
Adjacency
&
surfelAdjacency
()
const
;
238
Adjacency
&
surfelAdjacency
();
240
const
SurfelPredicate
&
surfelPredicate
()
const
;
241
242
// --------- CDigitalSurfaceContainer realization -------------------------
243
public
:
244
246
const
KSpace
&
space
()
const
;
251
bool
isInside
(
const
Surfel
& s )
const
;
252
255
SurfelConstIterator
begin
()
const
;
256
259
SurfelConstIterator
end
()
const
;
260
263
Size
nbSurfels
()
const
;
264
267
bool
empty
()
const
;
268
274
DigitalSurfaceTracker
*
newTracker
(
const
Surfel
& s )
const
;
275
279
Connectedness
connectedness
()
const
;
280
281
// ----------------------- Interface --------------------------------------
282
public
:
283
288
void
selfDisplay
( std::ostream & out )
const
;
289
294
bool
isValid
()
const
;
295
296
// ------------------------- Protected Datas ------------------------------
297
private
:
298
// ------------------------- Private Datas --------------------------------
299
private
:
301
const
KSpace
&
myKSpace
;
303
const
SurfelPredicate
&
mySurfelPredicate
;
305
Adjacency
mySurfelAdjacency
;
307
SurfelStorage
mySurfels
;
308
309
// ------------------------- Hidden services ------------------------------
310
protected
:
321
void
computeSurfels
(
const
Surfel
& p,
322
bool
closed );
323
324
325
private
:
326
333
ExplicitDigitalSurface
&
operator=
(
const
ExplicitDigitalSurface
& other );
334
335
// ------------------------- Internals ------------------------------------
336
private
:
337
338
};
// end of class ExplicitDigitalSurface
339
340
353
template
<
typename
TKSpace,
typename
TSurfelPredicate>
354
std::ostream&
355
operator<<
( std::ostream & out,
356
const
ExplicitDigitalSurface<TKSpace, TSurfelPredicate>
&
object
);
357
358
}
// namespace DGtal
359
360
362
// Includes inline functions.
363
#include "DGtal/topology/ExplicitDigitalSurface.ih"
364
365
// //
367
368
#endif // !defined ExplicitDigitalSurface_h
369
370
#undef ExplicitDigitalSurface_RECURSES
371
#endif // else defined(ExplicitDigitalSurface_RECURSES)
Generated on Wed Dec 19 2012 19:10:23 for DGtal by
1.8.1.1