DGtal
2.2.0
Toggle main menu visibility
Loading...
Searching...
No Matches
Point2ShapePredicate.h
1
16
17
#pragma once
18
30
31
#if defined(Point2ShapePredicate_RECURSES)
32
#error Recursive header files inclusion detected in Point2ShapePredicate.h
33
#else
// defined(Point2ShapePredicate_RECURSES)
35
#define Point2ShapePredicate_RECURSES
36
37
#if !defined Point2ShapePredicate_h
39
#define Point2ShapePredicate_h
40
42
// Inclusions
43
#include <iostream>
44
#include <functional>
45
46
#include "DGtal/base/Common.h"
48
49
// @since 0.8 In DGtal::functors
50
namespace
DGtal
{
51
namespace
functors
{
52
54
// template class Point2ShapePredicate
94
template
<
typename
TSurface,
bool
isUpward,
bool
isClosed>
95
class
Point2ShapePredicate
96
{
97
// ----------------------- Standard services ------------------------------
98
public
:
99
100
typedef
typename
TSurface::Point
Point
;
101
typedef
typename
TSurface::Distance
Distance
;
102
107
Point2ShapePredicate
(
const
TSurface& aSurface);
108
113
Point2ShapePredicate
(
const
Point2ShapePredicate
& other );
114
119
Point2ShapePredicate
&
operator=
(
const
Point2ShapePredicate
& other ) =
default
;
120
125
bool
operator()
(
const
Point
& p )
const
;
126
131
void
selfDisplay
( std::ostream & out )
const
;
132
133
137
~Point2ShapePredicate
();
138
139
140
// ------------------------- Protected Data ------------------------------
141
private
:
142
// ------------------------- Private Data --------------------------------
143
private
:
147
TSurface
myS
;
148
// ------------------------- Hidden services ------------------------------
149
protected
:
150
151
152
private
:
153
154
// ------------------------- Internals ------------------------------------
155
private
:
156
157
};
// end of class Point2ShapePredicate
158
160
// policy classes for Point2ShapePredicate
162
// template class Point2ShapePredicateComparator
176
template
<
typename
T,
bool
b1,
bool
b2>
177
struct
Point2ShapePredicateComparator
{
184
bool
operator()
(
const
T& q,
185
const
T& t)
const
{
186
std::less<T> c;
187
return
c(q,t);
188
}
189
};
190
199
template
<
typename
T>
200
struct
Point2ShapePredicateComparator
<T,false,false> {
207
bool
operator()
(
const
T& q,
208
const
T& t)
const
{
209
std::less<T> c;
210
return
c(q,t);
211
}
212
};
213
221
template
<
typename
T>
222
struct
Point2ShapePredicateComparator
<T,false,true> {
229
bool
operator()
(
const
T& q,
230
const
T& t)
const
{
231
std::less_equal<T> c;
232
return
c(q,t);
233
}
234
};
235
243
template
<
typename
T>
244
struct
Point2ShapePredicateComparator
<T,true,false> {
251
bool
operator()
(
const
T& q,
252
const
T& t)
const
{
253
std::greater<T> c;
254
return
c(q,t);
255
}
256
};
257
265
template
<
typename
T>
266
struct
Point2ShapePredicateComparator
<T,true,true> {
273
bool
operator()
(
const
T& q,
274
const
T& t)
const
{
275
std::greater_equal<T> c;
276
return
c(q,t);
277
}
278
};
279
280
}
// namespace functors
281
288
template
<
typename
TSurface,
bool
isUpward,
bool
isClosed>
289
inline
290
std::ostream&
291
operator<<
( std::ostream & out,
292
const
DGtal::functors::Point2ShapePredicate<TSurface,isUpward,isClosed>
&
object
);
293
294
}
// namespace DGtal
295
296
298
// Includes inline functions.
299
#include "DGtal/shapes/fromPoints/Point2ShapePredicate.ih"
300
301
// //
303
304
#endif
// !defined Point2ShapePredicate_h
305
306
#undef Point2ShapePredicate_RECURSES
307
#endif
// else defined(Point2ShapePredicate_RECURSES)
DGtal::functors::Point2ShapePredicate
Aim: Predicate returning 'true' iff a given point is in the 'interior' of a given shape,...
Definition
Point2ShapePredicate.h:96
DGtal::functors::Point2ShapePredicate< Circle, false, true >::myS
Circle myS
Definition
Point2ShapePredicate.h:147
DGtal::functors::Point2ShapePredicate::operator=
Point2ShapePredicate & operator=(const Point2ShapePredicate &other)=default
DGtal::functors::Point2ShapePredicate< Circle, false, true >::Point
Circle::Point Point
Definition
Point2ShapePredicate.h:100
DGtal::functors::Point2ShapePredicate::Point2ShapePredicate
Point2ShapePredicate(const Point2ShapePredicate &other)
DGtal::functors::Point2ShapePredicate< Circle, false, true >::Distance
Circle::Distance Distance
Definition
Point2ShapePredicate.h:101
DGtal::functors::Point2ShapePredicate::Point2ShapePredicate
Point2ShapePredicate(const TSurface &aSurface)
DGtal::functors::Point2ShapePredicate::selfDisplay
void selfDisplay(std::ostream &out) const
DGtal::functors::Point2ShapePredicate::~Point2ShapePredicate
~Point2ShapePredicate()
DGtal::functors::Point2ShapePredicate::operator()
bool operator()(const Point &p) const
DGtal::functors
functors namespace gathers all DGtal functors.
Definition
BasicBoolFunctors.h:49
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition
ClosedIntegerHalfPlane.h:49
DGtal::operator<<
std::ostream & operator<<(std::ostream &out, const ClosedIntegerHalfPlane< TSpace > &object)
DGtal::functors::Point2ShapePredicateComparator< T, false, false >::operator()
bool operator()(const T &q, const T &t) const
Definition
Point2ShapePredicate.h:207
DGtal::functors::Point2ShapePredicateComparator< T, false, true >::operator()
bool operator()(const T &q, const T &t) const
Definition
Point2ShapePredicate.h:229
DGtal::functors::Point2ShapePredicateComparator< T, true, false >::operator()
bool operator()(const T &q, const T &t) const
Definition
Point2ShapePredicate.h:251
DGtal::functors::Point2ShapePredicateComparator< T, true, true >::operator()
bool operator()(const T &q, const T &t) const
Definition
Point2ShapePredicate.h:273
DGtal::functors::Point2ShapePredicateComparator
Aim: A small struct with an operator that compares two values according to two bool template paramete...
Definition
Point2ShapePredicate.h:177
DGtal::functors::Point2ShapePredicateComparator::operator()
bool operator()(const T &q, const T &t) const
Definition
Point2ShapePredicate.h:184
src
DGtal
shapes
fromPoints
Point2ShapePredicate.h
Generated on
for DGtal by
1.18.0