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
CDigitalSurfaceContainer.h
1
17
#pragma once
18
31
#if defined(CDigitalSurfaceContainer_RECURSES)
32
#error Recursive header files inclusion detected in CDigitalSurfaceContainer.h
33
#else // defined(CDigitalSurfaceContainer_RECURSES)
34
35
#define CDigitalSurfaceContainer_RECURSES
36
37
#if !defined CDigitalSurfaceContainer_h
38
39
#define CDigitalSurfaceContainer_h
40
42
// Inclusions
43
#include <iostream>
44
#include "DGtal/base/Common.h"
45
#include "DGtal/topology/Topology.h"
46
#include "DGtal/topology/CCellularGridSpaceND.h"
47
#include "DGtal/topology/CDigitalSurfaceTracker.h"
49
50
namespace
DGtal
51
{
52
54
// class CDigitalSurfaceContainer
182
template
<
typename
T>
183
struct
CDigitalSurfaceContainer
: boost::CopyConstructible<T>
184
{
185
// ----------------------- Concept checks ------------------------------
186
public
:
187
typedef
typename
T::KSpace
KSpace
;
188
typedef
typename
T::Surfel
Surfel
;
189
typedef
typename
T::SurfelConstIterator
SurfelConstIterator
;
190
typedef
typename
T::DigitalSurfaceTracker
DigitalSurfaceTracker
;
191
typedef
typename
T::Size
Size
;
192
193
BOOST_CONCEPT_ASSERT
(( boost_concepts::SinglePassIteratorConcept<SurfelConstIterator> ));
194
BOOST_CONCEPT_ASSERT
((
CCellularGridSpaceND<KSpace>
));
195
BOOST_CONCEPT_ASSERT
((
CDigitalSurfaceTracker<DigitalSurfaceTracker>
));
196
197
// 2. then check the presence of data members, operators and methods with
198
BOOST_CONCEPT_USAGE
(
CDigitalSurfaceContainer
)
199
{
200
// check const methods.
201
checkConstConstraints
();
202
}
203
void
checkConstConstraints
()
const
204
{
205
// x.space() const, returns a const KSpace &
206
ConceptUtils::sameType
(
myKSpace
,
myX
.space() );
207
// x.isInside( Surfel ) const, returns bool.
208
ConceptUtils::sameType
(
myBool
,
myX
.isInside(
mySurfel
) );
209
// x.begin() const, returns SurfelConstIterator
210
ConceptUtils::sameType
(
mySurfelCIt
,
myX
.begin() );
211
// x.end() const, returns SurfelConstIterator
212
ConceptUtils::sameType
(
mySurfelCIt
,
myX
.end() );
213
// x.newTracker( Surfel ) const, returns DigitalSurfaceTracker*
214
ConceptUtils::sameType
(
myPtrTracker
,
myX
.newTracker(
mySurfel
) );
215
// x.connectedness() const, returns Connectedness
216
ConceptUtils::sameType
(
myConnectedness
,
myX
.connectedness() );
217
// x.nbSurfels() const, returns Connectedness
218
ConceptUtils::sameType
(
mySize
,
myX
.nbSurfels() );
219
// x.empty() const, returns bool
220
ConceptUtils::sameType
(
myBool
,
myX
.empty() );
221
}
222
// ------------------------- Private Datas --------------------------------
223
private
:
224
T
myX
;
// do not require T to be default constructible.
225
KSpace
myKSpace
;
226
Surfel
mySurfel
;
227
bool
myBool
;
228
SurfelConstIterator
mySurfelCIt
;
229
DigitalSurfaceTracker
*
myPtrTracker
;
230
Connectedness
myConnectedness
;
231
Size
mySize
;
232
// ------------------------- Internals ------------------------------------
233
private
:
234
235
};
// end of concept CDigitalSurfaceContainer
236
237
}
// namespace DGtal
238
239
// //
241
242
#endif // !defined CDigitalSurfaceContainer_h
243
244
#undef CDigitalSurfaceContainer_RECURSES
245
#endif // else defined(CDigitalSurfaceContainer_RECURSES)
Generated on Wed Dec 19 2012 19:10:20 for DGtal by
1.8.1.1