DGtal
2.2.0
Toggle main menu visibility
Loading...
Searching...
No Matches
PlaneProbingNeighborhood.h
1
16
17
#pragma once
18
30
31
#if defined(PlaneProbingNeighborhood_RECURSES)
32
#error Recursive header files inclusion detected in PlaneProbingNeighborhood.h
33
#else
// defined(PlaneProbingNeighborhood_RECURSES)
35
#define PlaneProbingNeighborhood_RECURSES
36
37
#if !defined PlaneProbingNeighborhood_h
39
#define PlaneProbingNeighborhood_h
40
42
// Inclusions
43
#include <cassert>
44
#include <iostream>
45
#include <vector>
46
#include "DGtal/base/Common.h"
47
#include "DGtal/geometry/helpers/PlaneProbingEstimatorHelper.h"
48
#include "DGtal/kernel/CPointPredicate.h"
50
51
namespace
DGtal
52
{
53
55
// template class PlaneProbingNeighborhood
64
template
<
typename
TPredicate>
65
class
PlaneProbingNeighborhood
66
{
67
BOOST_CONCEPT_ASSERT
((
concepts::CPointPredicate<TPredicate>
));
68
69
// ----------------------- Public types ------------------------------
70
public
:
71
using
Predicate
= TPredicate;
72
using
Point
=
typename
Predicate::Point;
73
using
Vector
=
Point
;
74
using
Integer
=
typename
Point::Coordinate;
75
using
Triangle
= std::array<Vector, 3>;
76
using
Index
= std::size_t;
77
using
PointOnProbingRay
=
detail::PointOnProbingRay<Integer,Index>
;
78
82
enum class
HexagonState
83
{
84
Empty,
85
NonConvex,
86
NonPlanar,
87
Planar,
88
};
89
97
struct
UpdateOperation
98
{
99
std::array<Index, 3>
sigma
;
100
std::array<Integer, 3>
coeffs
;
101
};
102
103
// ----------------------- Standard services ------------------------------
104
public
:
108
PlaneProbingNeighborhood
() =
delete
;
109
117
PlaneProbingNeighborhood
(
Predicate
const
& aPredicate,
Point
const
& aQ,
Triangle
const
& aM);
118
122
virtual
~PlaneProbingNeighborhood
();
123
128
PlaneProbingNeighborhood
(
const
PlaneProbingNeighborhood
& other ) =
delete
;
129
134
PlaneProbingNeighborhood
(
PlaneProbingNeighborhood
&& other ) =
delete
;
135
141
PlaneProbingNeighborhood
&
operator=
(
const
PlaneProbingNeighborhood
& other ) =
delete
;
142
148
PlaneProbingNeighborhood
&
operator=
(
PlaneProbingNeighborhood
&& other ) =
delete
;
149
150
// ----------------------- Plane Probing services ------------------------------
151
public
:
152
/*
153
* @param aNeighbors a list of rays to filter the candidates (if empty, there is no filtering).
154
*/
155
void
setNeighbors
(std::vector<PointOnProbingRay>
const
& aNeighbors);
156
163
virtual
HexagonState
hexagonState
() = 0;
164
170
virtual
UpdateOperation
closestCandidate
();
171
178
UpdateOperation
getOperation
(
PointOnProbingRay
const
& aClosest)
const
;
179
186
HexagonState
classify
(std::array<bool, 6>
const
& aState)
const
;
187
188
// ----------------------- Interface --------------------------------------
189
public
:
190
195
void
selfDisplay
( std::ostream & out )
const
;
196
201
bool
isValid
()
const
;
202
203
// ------------------------- Protected Data ------------------------------
204
protected
:
205
Predicate
const
&
myPredicate
;
206
Point
const
&
myQ
;
207
Triangle
const
&
myM
;
208
std::vector<PointOnProbingRay>
myCandidates
;
209
210
static
const
PointOnProbingRay
myNeighborhood
[6];
211
std::vector<PointOnProbingRay>
myNeighbors
;
212
213
// ------------------------- Private Data --------------------------------
214
private
:
215
216
// ------------------------- Hidden services ------------------------------
217
protected
:
225
template
<
class
TPo
int
Adapter>
226
TPointAdapter
closestPointInList
(std::vector<TPointAdapter>
const
& aPoints)
const
;
227
235
bool
isNeighbor
(
PointOnProbingRay
const
& aRay)
const
;
236
245
bool
isSmallest
(
Point
const
& aX,
Point
const
& aY)
const
;
246
255
template
<
class
TPo
int
Adapter>
256
Point
relativePoint
(TPointAdapter
const
&
aPoint
)
const
;
257
266
template
<
class
TPo
int
Adapter>
267
Point
absolutePoint
(TPointAdapter
const
&
aPoint
)
const
;
268
269
// ------------------------- Internals ------------------------------------
270
private
:
271
272
};
// end of class PlaneProbingNeighborhood
273
274
281
template
<
typename
TPredicate>
282
std::ostream&
283
operator<<
( std::ostream & out,
const
PlaneProbingNeighborhood<TPredicate>
&
object
);
284
285
}
// namespace DGtal
286
287
289
// Includes inline functions.
290
#include "DGtal/geometry/surfaces/estimation/PlaneProbingNeighborhood.ih"
291
292
// //
294
295
#endif
// !defined PlaneProbingNeighborhood_h
296
297
#undef PlaneProbingNeighborhood_RECURSES
298
#endif
// else defined(PlaneProbingNeighborhood_RECURSES)
DGtal::PlaneProbingNeighborhood
Aim: A base virtual class that represents a way to probe a neighborhood, used in the plane probing ba...
Definition
PlaneProbingNeighborhood.h:66
DGtal::PlaneProbingNeighborhood::hexagonState
virtual HexagonState hexagonState()=0
DGtal::PlaneProbingNeighborhood::myPredicate
Predicate const & myPredicate
Definition
PlaneProbingNeighborhood.h:205
DGtal::PlaneProbingNeighborhood::closestCandidate
virtual UpdateOperation closestCandidate()
DGtal::PlaneProbingNeighborhood::PointOnProbingRay
detail::PointOnProbingRay< Integer, Index > PointOnProbingRay
Definition
PlaneProbingNeighborhood.h:77
DGtal::PlaneProbingNeighborhood::operator=
PlaneProbingNeighborhood & operator=(const PlaneProbingNeighborhood &other)=delete
DGtal::PlaneProbingNeighborhood::Vector
Point Vector
Definition
PlaneProbingNeighborhood.h:73
DGtal::PlaneProbingNeighborhood::Triangle
std::array< Vector, 3 > Triangle
Definition
PlaneProbingNeighborhood.h:75
DGtal::PlaneProbingNeighborhood::PlaneProbingNeighborhood
PlaneProbingNeighborhood()=delete
DGtal::PlaneProbingNeighborhood::selfDisplay
void selfDisplay(std::ostream &out) const
DGtal::PlaneProbingNeighborhood::getOperation
UpdateOperation getOperation(PointOnProbingRay const &aClosest) const
DGtal::PlaneProbingNeighborhood::relativePoint
Point relativePoint(TPointAdapter const &aPoint) const
DGtal::PlaneProbingNeighborhood::isValid
bool isValid() const
DGtal::PlaneProbingNeighborhood::Point
typename Predicate::Point Point
Definition
PlaneProbingNeighborhood.h:72
DGtal::PlaneProbingNeighborhood::myCandidates
std::vector< PointOnProbingRay > myCandidates
Definition
PlaneProbingNeighborhood.h:208
DGtal::PlaneProbingNeighborhood::PlaneProbingNeighborhood
PlaneProbingNeighborhood(PlaneProbingNeighborhood &&other)=delete
DGtal::PlaneProbingNeighborhood::isSmallest
bool isSmallest(Point const &aX, Point const &aY) const
DGtal::PlaneProbingNeighborhood::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((concepts::CPointPredicate< TPredicate >))
DGtal::PlaneProbingNeighborhood::~PlaneProbingNeighborhood
virtual ~PlaneProbingNeighborhood()
DGtal::PlaneProbingNeighborhood::HexagonState
HexagonState
Definition
PlaneProbingNeighborhood.h:83
DGtal::PlaneProbingNeighborhood::PlaneProbingNeighborhood
PlaneProbingNeighborhood(const PlaneProbingNeighborhood &other)=delete
DGtal::PlaneProbingNeighborhood::Predicate
TPredicate Predicate
Definition
PlaneProbingNeighborhood.h:71
DGtal::PlaneProbingNeighborhood::absolutePoint
Point absolutePoint(TPointAdapter const &aPoint) const
DGtal::PlaneProbingNeighborhood::classify
HexagonState classify(std::array< bool, 6 > const &aState) const
DGtal::PlaneProbingNeighborhood::PlaneProbingNeighborhood
PlaneProbingNeighborhood(Predicate const &aPredicate, Point const &aQ, Triangle const &aM)
DGtal::PlaneProbingNeighborhood::closestPointInList
TPointAdapter closestPointInList(std::vector< TPointAdapter > const &aPoints) const
DGtal::PlaneProbingNeighborhood::myQ
Point const & myQ
Definition
PlaneProbingNeighborhood.h:206
DGtal::PlaneProbingNeighborhood::isNeighbor
bool isNeighbor(PointOnProbingRay const &aRay) const
DGtal::PlaneProbingNeighborhood::myNeighbors
std::vector< PointOnProbingRay > myNeighbors
Definition
PlaneProbingNeighborhood.h:211
DGtal::PlaneProbingNeighborhood::Index
std::size_t Index
Definition
PlaneProbingNeighborhood.h:76
DGtal::PlaneProbingNeighborhood::setNeighbors
void setNeighbors(std::vector< PointOnProbingRay > const &aNeighbors)
DGtal::PlaneProbingNeighborhood::myNeighborhood
static const PointOnProbingRay myNeighborhood[6]
Definition
PlaneProbingNeighborhood.h:210
DGtal::PlaneProbingNeighborhood::myM
Triangle const & myM
Definition
PlaneProbingNeighborhood.h:207
DGtal::PlaneProbingNeighborhood::Integer
typename Point::Coordinate Integer
Definition
PlaneProbingNeighborhood.h:74
DGtal::detail::PointOnProbingRay
A ray consists of a permutation and an integer index (position on the ray). For a triplet of vector...
Definition
PlaneProbingEstimatorHelper.h:113
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::PlaneProbingNeighborhood::UpdateOperation
Definition
PlaneProbingNeighborhood.h:98
DGtal::PlaneProbingNeighborhood::UpdateOperation::coeffs
std::array< Integer, 3 > coeffs
Definition
PlaneProbingNeighborhood.h:100
DGtal::PlaneProbingNeighborhood::UpdateOperation::sigma
std::array< Index, 3 > sigma
Definition
PlaneProbingNeighborhood.h:99
DGtal::concepts::CPointPredicate
Aim: Defines a predicate on a point.
Definition
CPointPredicate.h:81
aPoint
const Point aPoint(3, 4)
src
DGtal
geometry
surfaces
estimation
PlaneProbingNeighborhood.h
Generated on
for DGtal by
1.18.0