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
kernel
BasicPointPredicates.h
1
17
#pragma once
18
35
#if defined(BasicPointPredicates_RECURSES)
36
#error Recursive header files inclusion detected in BasicPointPredicates.h
37
#else // defined(BasicPointPredicates_RECURSES)
38
39
#define BasicPointPredicates_RECURSES
40
41
#if !defined BasicPointPredicates_h
42
43
#define BasicPointPredicates_h
44
46
// Inclusions
47
#include <iostream>
48
#include "DGtal/base/Common.h"
49
#include "DGtal/base/BasicBoolFunctions.h"
50
#include "DGtal/base/CUnaryFunctor.h"
51
#include "DGtal/kernel/CPointFunctor.h"
52
#include "DGtal/kernel/CPointPredicate.h"
54
55
namespace
DGtal
56
{
57
59
// template class ConstantPointPredicate
67
template
<
typename
TPo
int
,
bool
bool
Cst>
68
struct
ConstantPointPredicate
69
{
70
typedef
TPoint
Point
;
71
76
bool
operator()
(
const
Point
& p )
const
;
77
78
};
// end of class ConstantPointPredicates
79
81
// template class TruePointPredicate
88
template
<
typename
TPo
int
>
89
struct
TruePointPredicate
:
public
ConstantPointPredicate
<TPoint,true>
90
{
91
typedef
TPoint
Point
;
92
};
93
95
// template class FalsePointPredicate
102
template
<
typename
TPo
int
>
103
struct
FalsePointPredicate
:
public
ConstantPointPredicate
<TPoint,false>
104
{
105
typedef
TPoint
Point
;
106
};
107
109
// template class IsLowerPointPredicate
117
template
<
typename
TPo
int
>
118
struct
IsLowerPointPredicate
119
{
120
typedef
TPoint
Point
;
124
IsLowerPointPredicate
(
const
Point
& upperBound );
125
130
bool
operator()
(
const
Point
& p )
const
;
131
133
Point
myUpperBound
;
134
};
135
137
// template class IsUpperPointPredicate
145
template
<
typename
TPo
int
>
146
struct
IsUpperPointPredicate
147
{
148
typedef
TPoint
Point
;
152
IsUpperPointPredicate
(
const
Point
& lowerBound );
153
158
bool
operator()
(
const
Point
& p )
const
;
159
161
Point
myLowerBound
;
162
};
163
165
// template class IsWithinPointPredicate
172
template
<
typename
TPo
int
>
173
struct
IsWithinPointPredicate
174
{
175
typedef
TPoint
Point
;
179
IsWithinPointPredicate
(
const
Point
& lowerBound,
180
const
Point
& upperBound );
181
186
bool
operator()
(
const
Point
& p )
const
;
187
189
Point
myLowerBound
;
191
Point
myUpperBound
;
192
};
193
195
// template class NotPointPredicate
203
template
<
typename
TPo
int
Predicate>
204
struct
NotPointPredicate
205
{
206
typedef
TPointPredicate
PointPredicate
;
207
//BOOST_CONCEPT_ASSERT (( CPointPredicate<PointPredicate> ));
208
209
typedef
typename
PointPredicate::Point
Point
;
210
214
NotPointPredicate
(
const
PointPredicate
& pred );
215
220
bool
operator()
(
const
Point
& p )
const
;
221
223
const
PointPredicate
&
myPred
;
224
};
225
227
// template class EqualPointPredicate
235
template
<
typename
TPo
int
>
236
struct
EqualPointPredicate
237
{
238
typedef
TPoint
Point
;
239
243
EqualPointPredicate
(
const
Point
& aPoint );
244
249
bool
operator()
(
const
Point
& p )
const
;
250
252
Point
myPoint
;
253
};
254
256
// template class BinaryPointPredicate
266
template
<
typename
TPointPredicate1,
typename
TPointPredicate2,
267
typename
TBinaryFunctor =
BoolFunction2
>
268
struct
BinaryPointPredicate
269
{
270
typedef
TPointPredicate1
PointPredicate1
;
271
typedef
TPointPredicate2
PointPredicate2
;
272
typedef
typename
PointPredicate1::Point
Point
;
273
// should be the same.
274
BOOST_STATIC_ASSERT
((boost::is_same< Point, typename PointPredicate2::Point >::value));
275
//BOOST_CONCEPT_ASSERT (( CPointPredicate<PointPredicate1> ));
276
//BOOST_CONCEPT_ASSERT (( CPointPredicate<PointPredicate2> ));
277
278
typedef
typename
PointPredicate2::Point
Point2
;
279
287
BinaryPointPredicate
(
const
PointPredicate1
& pred1,
288
const
PointPredicate2
& pred2,
289
const
TBinaryFunctor & boolFunctor );
290
295
BinaryPointPredicate
(
const
BinaryPointPredicate
& other );
296
302
BinaryPointPredicate
&
operator=
(
const
BinaryPointPredicate
& other );
303
307
~BinaryPointPredicate
();
308
313
bool
operator()
(
const
Point
& p )
const
;
314
316
const
PointPredicate1
*
myPred1
;
318
const
PointPredicate2
*
myPred2
;
320
const
TBinaryFunctor*
myBoolFunctor
;
321
};
322
324
// template class PointFunctorPredicate
334
template
<
typename
TPo
int
Functor,
typename
TPredicate>
335
struct
PointFunctorPredicate
336
{
337
BOOST_CONCEPT_ASSERT
((
CPointFunctor< TPointFunctor >
));
338
BOOST_CONCEPT_ASSERT
((
CUnaryFunctor< TPredicate, typename TPointFunctor::Value, bool >
));
339
340
typedef
TPointFunctor
PointFunctor
;
341
typedef
TPredicate
Predicate
;
342
typedef
typename
PointFunctor::Point
Point
;
343
349
PointFunctorPredicate
(
const
PointFunctor
& aFun,
350
const
Predicate
& aPred );
351
356
PointFunctorPredicate
(
const
PointFunctorPredicate
& other );
357
363
PointFunctorPredicate
&
operator=
(
const
PointFunctorPredicate
& other );
364
368
~PointFunctorPredicate
();
369
374
bool
operator()
(
const
Point
& p )
const
;
375
377
const
PointFunctor
*
myFun
;
379
const
Predicate
*
myPred
;
380
};
381
382
}
// namespace DGtal
383
384
386
// Includes inline functions.
387
#include "DGtal/kernel/BasicPointPredicates.ih"
388
389
// //
391
392
#endif // !defined BasicPointPredicates_h
393
394
#undef BasicPointPredicates_RECURSES
395
#endif // else defined(BasicPointPredicates_RECURSES)
Generated on Wed Dec 19 2012 19:10:19 for DGtal by
1.8.1.1