DGtal
2.2.0
Toggle main menu visibility
Loading...
Searching...
No Matches
examplePlaneProbingParallelepipedEstimator.cpp
Go to the documentation of this file.
1
16
29
31
#include <iostream>
32
#include "ConfigExamples.h"
33
#include "DGtal/helpers/StdDefs.h"
34
#include "DGtal/base/Common.h"
35
#include "DGtal/geometry/surfaces/DigitalPlanePredicate.h"
36
#include "DGtal/geometry/surfaces/estimation/PlaneProbingParallelepipedEstimator.h"
38
39
using namespace
std
;
40
using namespace
DGtal
;
41
42
using
DigitalPlane
=
DigitalPlanePredicate<Z3i::Space>
;
43
using
Point
=
DigitalPlane::Vector
;
44
using
Integer
= Point::Coordinate;
45
using
Vector
=
DigitalPlane::Point
;
46
using
Estimator
=
PlaneProbingParallelepipedEstimator<DigitalPlane, ProbingMode::R1>
;
47
49
50
int
main
(
int
argc,
const
char
** argv)
51
{
52
const
int
height = (argc > 1) ? std::atoi(argv[1]) : 2;
53
std::cout <<
"height="
<< height << std::endl;
54
55
Vector
n(2, 6, 15);
56
57
DigitalPlane
plane(n, -height, n.norm1());
58
Point
o(0, 0, 0);
59
Integer
bound = n.norm1() + 1;
60
std::array<Point, 3> m = {
Point
(1, 0, 0),
Point
(0, 1, 0),
Point
(0, 0, 1) };
61
Estimator
estimator(o, m, plane, bound);
62
63
int
it = 0;
64
while
(estimator.
advance
()) {
65
it++;
66
67
std::cout <<
"state="
<< estimator.
getState
() <<
", isInReverseState="
<< estimator.
isInReverseState
() << std::endl;
68
69
std::clog <<
"it = "
<< it <<
" "
70
<< estimator.
m
(0) <<
" "
<< estimator.
m
(1) <<
" "
<< estimator.
m
(2) <<
" "
71
<< estimator.
getNormal
() << std::endl;
72
}
73
74
ASSERT(estimator.
getNormal
() == n);
75
76
return
0;
77
}
78
// //
DGtal::DigitalPlanePredicate
Aim: Representing digital planes, which are digitizations of Euclidean planes, as point predicates.
Definition
DigitalPlanePredicate.h:73
DGtal::DigitalPlanePredicate< Z3i::Space >::Point
typename Space::Point Point
Definition
DigitalPlanePredicate.h:81
DGtal::DigitalPlanePredicate< Z3i::Space >::Vector
typename Space::Vector Vector
Definition
DigitalPlanePredicate.h:82
DGtal::PlaneProbingParallelepipedEstimator
Aim:
Definition
PlaneProbingParallelepipedEstimator.h:63
DGtal::PlaneProbingParallelepipedEstimator::isInReverseState
bool isInReverseState() const
DGtal::PlaneProbingParallelepipedEstimator::m
Vector m(int aIndex) const
DGtal::PlaneProbingParallelepipedEstimator::getNormal
Vector getNormal() const
DGtal::PlaneProbingParallelepipedEstimator::getState
int getState() const
DGtal::PlaneProbingParallelepipedEstimator::advance
bool advance(std::vector< PointOnProbingRay > const &aNeighbors)
DGtal::Point
DigitalPlane
DigitalPlanePredicate< Z3i::Space > DigitalPlane
Definition
examplePlaneProbingParallelepipedEstimator.cpp:42
Estimator
PlaneProbingParallelepipedEstimator< DigitalPlane, ProbingMode::R1 > Estimator
Definition
examplePlaneProbingParallelepipedEstimator.cpp:46
Integer
Point::Coordinate Integer
Definition
examplePlaneProbingParallelepipedEstimator.cpp:44
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
Definition
ClosedIntegerHalfPlane.h:49
std
STL namespace.
main
int main(int, char **)
Definition
testIntegerComputer.cpp:331
examples
geometry
surfaces
examplePlaneProbingParallelepipedEstimator.cpp
Generated on
for DGtal by
1.18.0