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
shapes
fromPoints
Point2ShapePredicate.ih
1
30
31
#include <cstdlib>
33
35
// IMPLEMENTATION of inline methods.
37
39
// ----------------------- Standard services ------------------------------
40
41
42
template
<
typename
TSurface,
bool
isUpward,
bool
isClosed>
43
inline
44
DGtal::Point2ShapePredicate<TSurface,isUpward,isClosed>::~Point2ShapePredicate
()
45
{
46
}
47
48
template
<
typename
TSurface,
bool
isUpward,
bool
isClosed>
49
inline
50
DGtal::Point2ShapePredicate<TSurface,isUpward,isClosed>::Point2ShapePredicate
(
51
const
TSurface& aSurface):
52
myS(aSurface)
53
{
54
}
55
60
template
<
typename
TSurface,
bool
isUpward,
bool
isClosed>
61
inline
62
DGtal::Point2ShapePredicate<TSurface,isUpward,isClosed>::Point2ShapePredicate
(
63
const
Point2ShapePredicate
& other):
64
myS(other.myS)
65
{
66
}
67
68
69
template
<
typename
TSurface,
bool
isUpward,
bool
isClosed>
70
inline
71
bool
72
DGtal::Point2ShapePredicate<TSurface,isUpward,isClosed>
73
::operator()
(
const
Point
& p)
const
74
{
75
DGtal::Point2ShapePredicateComparator
<
76
Distance
,
77
isUpward,
78
isClosed> theComparator;
79
80
return
theComparator(myS.signedDistance(p),0);
81
}
82
83
84
86
// Interface - public :
87
88
template
<
typename
TSurface,
bool
isUpward,
bool
isClosed>
89
inline
90
void
91
DGtal::Point2ShapePredicate<TSurface,isUpward,isClosed>
92
::selfDisplay
( std::ostream & out )
const
93
{
94
out <<
"[Point2ShapePredicate] :\n"
;
95
myS.
selfDisplay
(out);
96
out <<
"\n"
;
97
std::string orientation = (isUpward)?
98
"upward oriented"
:
"downward oriented"
;
99
std::string closure = (isClosed)?
100
"closed"
:
"open"
;
101
out <<
"("
<< orientation <<
", "
<< closure <<
")\n"
;
102
103
}
104
106
// Implementation of inline functions //
107
108
template
<
typename
TSurface,
bool
isUpward,
bool
isClosed>
109
inline
110
std::ostream&
111
DGtal::operator<<
( std::ostream & out,
112
const
Point2ShapePredicate<TSurface,isUpward,isClosed>
&
object
)
113
{
114
object
.selfDisplay( out );
115
return
out;
116
}
117
Generated on Wed Dec 19 2012 19:10:32 for DGtal by
1.8.1.1