DGtal
2.2.0
Toggle main menu visibility
Loading...
Searching...
No Matches
PlaneProbingTetrahedronEstimator.h
1
16
17
#pragma once
18
30
31
#if defined(PlaneProbingTetrahedronEstimator_RECURSES)
32
#error Recursive header files inclusion detected in PlaneProbingTetrahedronEstimator.h
33
#else
// defined(PlaneProbingTetrahedronEstimator_RECURSES)
35
#define PlaneProbingTetrahedronEstimator_RECURSES
36
37
#if !defined PlaneProbingTetrahedronEstimator_h
39
#define PlaneProbingTetrahedronEstimator_h
40
42
// Inclusions
43
#include <iostream>
44
#include <vector>
45
#include "DGtal/base/Common.h"
46
#include "DGtal/geometry/helpers/PlaneProbingEstimatorHelper.h"
47
#include "DGtal/geometry/surfaces/estimation/PlaneProbingNeighborhood.h"
48
#include "DGtal/kernel/CPointPredicate.h"
50
51
namespace
DGtal
52
{
58
enum class
ProbingMode
59
{
60
H
,
61
R,
62
R1
,
63
L
,
64
};
65
73
inline
74
std::ostream&
operator<<
(std::ostream& aOs,
ProbingMode
const
& aMode)
75
{
76
switch
(aMode)
77
{
78
case
ProbingMode::H
:
79
aOs <<
"H"
;
80
break
;
81
82
case
ProbingMode::R
:
83
aOs <<
"R"
;
84
break
;
85
86
case
ProbingMode::R1
:
87
aOs <<
"R1"
;
88
break
;
89
90
case
ProbingMode::L
:
91
aOs <<
"L"
;
92
break
;
93
}
94
95
return
aOs;
96
}
97
99
// template class PlaneProbingTetrahedronEstimator
110
template
<
typename
TPredicate, ProbingMode mode = ProbingMode::H>
111
class
PlaneProbingTetrahedronEstimator
112
{
113
BOOST_CONCEPT_ASSERT
((
concepts::CPointPredicate<TPredicate>
));
114
115
// ----------------------- Public types ------------------------------
116
public
:
117
using
Self
=
PlaneProbingTetrahedronEstimator<TPredicate, mode>
;
118
using
Predicate
= TPredicate;
119
using
Point
=
typename
Predicate::Point;
120
using
Vector
=
Point
;
121
using
Neighborhood
=
PlaneProbingNeighborhood<TPredicate>
;
122
using
Triangle
=
typename
Neighborhood::Triangle
;
123
using
Integer
=
typename
Point::Coordinate;
124
using
PointOnProbingRay
=
typename
Neighborhood::PointOnProbingRay
;
125
using
Permutation
=
typename
PointOnProbingRay::Permutation;
126
using
Quantity
=
Vector
;
127
using
HexagonState
=
typename
Neighborhood::HexagonState
;
128
using
UpdateOperation
=
typename
Neighborhood::UpdateOperation
;
129
130
// ----------------------- Standard services ------------------------------
131
public
:
135
PlaneProbingTetrahedronEstimator
() =
delete
;
136
144
PlaneProbingTetrahedronEstimator
(
Point
const
&
aPoint
,
Triangle
const
& aM,
Predicate
const
& aPredicate);
145
149
~PlaneProbingTetrahedronEstimator
();
150
155
PlaneProbingTetrahedronEstimator
(
const
PlaneProbingTetrahedronEstimator
& other ) =
delete
;
156
161
PlaneProbingTetrahedronEstimator
(
PlaneProbingTetrahedronEstimator
&& other ) =
delete
;
162
168
PlaneProbingTetrahedronEstimator
&
operator=
(
const
PlaneProbingTetrahedronEstimator
& other ) =
delete
;
169
175
PlaneProbingTetrahedronEstimator
&
operator=
(
PlaneProbingTetrahedronEstimator
&& other ) =
delete
;
176
177
// ----------------------- Plane Probing services ------------------------------
178
public
:
183
Vector
const
&
m
(
int
aIndex)
const
;
184
188
Point
const
&
q
()
const
;
189
193
Point
getOrigin
()
const
;
194
198
Triangle
vertices
()
const
;
199
203
std::pair<Vector, Vector>
getBasis
()
const
;
204
208
bool
isReduced
()
const
;
209
213
Vector
getNormal
()
const
;
214
224
std::pair<bool, UpdateOperation>
advance
(std::vector<PointOnProbingRay>
const
& aNeighbors);
225
231
std::pair<bool, UpdateOperation>
advance
();
232
239
Quantity
compute
(std::vector<PointOnProbingRay>
const
& aNeighbors);
240
246
Quantity
compute
();
247
251
HexagonState
hexagonState
()
const
;
252
258
void
translateQ
(
Vector
const
& aTranslation);
259
264
void
translateQ
();
265
271
void
applyOperation
(
UpdateOperation
const
& aOp);
272
273
// ----------------------- Interface --------------------------------------
274
public
:
275
280
void
selfDisplay
( std::ostream & out )
const
;
285
bool
isValid
()
const
;
291
bool
isProjectedInside
(
Triangle
const
& aTriangle)
const
;
295
bool
isProjectedInside
()
const
;
301
bool
isInside
()
const
;
307
bool
isUnimodular
()
const
;
308
309
// ------------------------- Protected Data ------------------------------
310
protected
:
311
312
// ------------------------- Private Data --------------------------------
313
private
:
314
Triangle
myM
;
315
Predicate
const
&
myPredicate
;
316
Point
myS
;
317
Point
myQ
;
318
Neighborhood
*
myNeighborhood
=
nullptr
;
319
std::vector<UpdateOperation>
myOperations
;
320
321
// ------------------------- Hidden services ------------------------------
322
protected
:
323
324
// ------------------------- Internals ------------------------------------
325
private
:
331
void
update
(
UpdateOperation
const
& aOp);
332
333
};
// end of class PlaneProbingTetrahedronEstimator
334
335
342
template
<
typename
TPredicate, ProbingMode mode>
343
std::ostream&
344
operator<<
( std::ostream & out,
const
PlaneProbingTetrahedronEstimator<TPredicate, mode>
&
object
);
345
}
// namespace DGtal
346
347
349
// Includes inline functions.
350
#include "DGtal/geometry/surfaces/estimation/PlaneProbingTetrahedronEstimator.ih"
351
352
// //
354
355
#endif
// !defined PlaneProbingTetrahedronEstimator_h
356
357
#undef PlaneProbingTetrahedronEstimator_RECURSES
358
#endif
// else defined(PlaneProbingTetrahedronEstimator_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::PointOnProbingRay
detail::PointOnProbingRay< Integer, Index > PointOnProbingRay
Definition
PlaneProbingNeighborhood.h:77
DGtal::PlaneProbingNeighborhood::Triangle
std::array< Vector, 3 > Triangle
Definition
PlaneProbingNeighborhood.h:75
DGtal::PlaneProbingNeighborhood::HexagonState
HexagonState
Definition
PlaneProbingNeighborhood.h:83
DGtal::PlaneProbingTetrahedronEstimator
Aim: A class that locally estimates a normal on a digital set using only a predicate "does a point x ...
Definition
PlaneProbingTetrahedronEstimator.h:112
DGtal::PlaneProbingTetrahedronEstimator::isReduced
bool isReduced() const
DGtal::PlaneProbingTetrahedronEstimator< NotAbovePredicate, mode >::Quantity
Vector Quantity
Definition
PlaneProbingTetrahedronEstimator.h:126
DGtal::PlaneProbingTetrahedronEstimator::applyOperation
void applyOperation(UpdateOperation const &aOp)
DGtal::PlaneProbingTetrahedronEstimator::advance
std::pair< bool, UpdateOperation > advance(std::vector< PointOnProbingRay > const &aNeighbors)
DGtal::PlaneProbingTetrahedronEstimator::translateQ
void translateQ(Vector const &aTranslation)
DGtal::PlaneProbingTetrahedronEstimator::update
void update(UpdateOperation const &aOp)
DGtal::PlaneProbingTetrahedronEstimator::isUnimodular
bool isUnimodular() const
DGtal::PlaneProbingTetrahedronEstimator::isProjectedInside
bool isProjectedInside() const
DGtal::PlaneProbingTetrahedronEstimator::hexagonState
HexagonState hexagonState() const
DGtal::PlaneProbingTetrahedronEstimator::isProjectedInside
bool isProjectedInside(Triangle const &aTriangle) const
DGtal::PlaneProbingTetrahedronEstimator::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((concepts::CPointPredicate< TPredicate >))
DGtal::PlaneProbingTetrahedronEstimator< NotAbovePredicate, mode >::Neighborhood
PlaneProbingNeighborhood< NotAbovePredicate > Neighborhood
Definition
PlaneProbingTetrahedronEstimator.h:121
DGtal::PlaneProbingTetrahedronEstimator< NotAbovePredicate, mode >::Permutation
typename PointOnProbingRay::Permutation Permutation
Definition
PlaneProbingTetrahedronEstimator.h:125
DGtal::PlaneProbingTetrahedronEstimator< NotAbovePredicate, mode >::myOperations
std::vector< UpdateOperation > myOperations
Definition
PlaneProbingTetrahedronEstimator.h:319
DGtal::PlaneProbingTetrahedronEstimator< NotAbovePredicate, mode >::Triangle
typename Neighborhood::Triangle Triangle
Definition
PlaneProbingTetrahedronEstimator.h:122
DGtal::PlaneProbingTetrahedronEstimator< NotAbovePredicate, mode >::myNeighborhood
Neighborhood * myNeighborhood
Definition
PlaneProbingTetrahedronEstimator.h:318
DGtal::PlaneProbingTetrahedronEstimator::operator=
PlaneProbingTetrahedronEstimator & operator=(const PlaneProbingTetrahedronEstimator &other)=delete
DGtal::PlaneProbingTetrahedronEstimator< NotAbovePredicate, mode >::myS
Point myS
Definition
PlaneProbingTetrahedronEstimator.h:316
DGtal::PlaneProbingTetrahedronEstimator::getOrigin
Point getOrigin() const
DGtal::PlaneProbingTetrahedronEstimator::PlaneProbingTetrahedronEstimator
PlaneProbingTetrahedronEstimator(const PlaneProbingTetrahedronEstimator &other)=delete
DGtal::PlaneProbingTetrahedronEstimator::PlaneProbingTetrahedronEstimator
PlaneProbingTetrahedronEstimator(PlaneProbingTetrahedronEstimator &&other)=delete
DGtal::PlaneProbingTetrahedronEstimator::getNormal
Vector getNormal() const
DGtal::PlaneProbingTetrahedronEstimator::compute
Quantity compute()
DGtal::PlaneProbingTetrahedronEstimator::~PlaneProbingTetrahedronEstimator
~PlaneProbingTetrahedronEstimator()
DGtal::PlaneProbingTetrahedronEstimator< NotAbovePredicate, mode >::Point
typename Predicate::Point Point
Definition
PlaneProbingTetrahedronEstimator.h:119
DGtal::PlaneProbingTetrahedronEstimator< NotAbovePredicate, mode >::HexagonState
typename Neighborhood::HexagonState HexagonState
Definition
PlaneProbingTetrahedronEstimator.h:127
DGtal::PlaneProbingTetrahedronEstimator::advance
std::pair< bool, UpdateOperation > advance()
DGtal::PlaneProbingTetrahedronEstimator::isValid
bool isValid() const
DGtal::PlaneProbingTetrahedronEstimator::translateQ
void translateQ()
DGtal::PlaneProbingTetrahedronEstimator::q
Point const & q() const
DGtal::PlaneProbingTetrahedronEstimator::getBasis
std::pair< Vector, Vector > getBasis() const
DGtal::PlaneProbingTetrahedronEstimator< NotAbovePredicate, mode >::Integer
typename Point::Coordinate Integer
Definition
PlaneProbingTetrahedronEstimator.h:123
DGtal::PlaneProbingTetrahedronEstimator< NotAbovePredicate, mode >::UpdateOperation
typename Neighborhood::UpdateOperation UpdateOperation
Definition
PlaneProbingTetrahedronEstimator.h:128
DGtal::PlaneProbingTetrahedronEstimator< NotAbovePredicate, mode >::myPredicate
Predicate const & myPredicate
Definition
PlaneProbingTetrahedronEstimator.h:315
DGtal::PlaneProbingTetrahedronEstimator< NotAbovePredicate, mode >::Predicate
NotAbovePredicate Predicate
Definition
PlaneProbingTetrahedronEstimator.h:118
DGtal::PlaneProbingTetrahedronEstimator< NotAbovePredicate, mode >::Vector
Point Vector
Definition
PlaneProbingTetrahedronEstimator.h:120
DGtal::PlaneProbingTetrahedronEstimator< NotAbovePredicate, mode >::myQ
Point myQ
Definition
PlaneProbingTetrahedronEstimator.h:317
DGtal::PlaneProbingTetrahedronEstimator::m
Vector const & m(int aIndex) const
DGtal::PlaneProbingTetrahedronEstimator::selfDisplay
void selfDisplay(std::ostream &out) const
DGtal::PlaneProbingTetrahedronEstimator< NotAbovePredicate, mode >::Self
PlaneProbingTetrahedronEstimator< NotAbovePredicate, mode > Self
Definition
PlaneProbingTetrahedronEstimator.h:117
DGtal::PlaneProbingTetrahedronEstimator::vertices
Triangle vertices() const
DGtal::PlaneProbingTetrahedronEstimator::PlaneProbingTetrahedronEstimator
PlaneProbingTetrahedronEstimator()=delete
DGtal::PlaneProbingTetrahedronEstimator::isInside
bool isInside() const
DGtal::PlaneProbingTetrahedronEstimator::PlaneProbingTetrahedronEstimator
PlaneProbingTetrahedronEstimator(Point const &aPoint, Triangle const &aM, Predicate const &aPredicate)
DGtal::PlaneProbingTetrahedronEstimator::compute
Quantity compute(std::vector< PointOnProbingRay > const &aNeighbors)
DGtal::PlaneProbingTetrahedronEstimator< NotAbovePredicate, mode >::myM
Triangle myM
Definition
PlaneProbingTetrahedronEstimator.h:314
DGtal::PlaneProbingTetrahedronEstimator< NotAbovePredicate, mode >::PointOnProbingRay
typename Neighborhood::PointOnProbingRay PointOnProbingRay
Definition
PlaneProbingTetrahedronEstimator.h:124
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::ProbingMode
ProbingMode
Definition
PlaneProbingTetrahedronEstimator.h:59
DGtal::ProbingMode::H
@ H
Definition
PlaneProbingTetrahedronEstimator.h:60
DGtal::ProbingMode::R1
@ R1
Definition
PlaneProbingTetrahedronEstimator.h:62
DGtal::ProbingMode::L
@ L
Definition
PlaneProbingTetrahedronEstimator.h:63
DGtal::ProbingMode::R
@ R
Definition
PlaneProbingTetrahedronEstimator.h:61
DGtal::PlaneProbingNeighborhood::UpdateOperation
Definition
PlaneProbingNeighborhood.h:98
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
PlaneProbingTetrahedronEstimator.h
Generated on
for DGtal by
1.18.0