DGtal  1.5.beta
examplePlaneProbingParallelepipedEstimator.cpp File Reference
#include <iostream>
#include "ConfigExamples.h"
#include "DGtal/helpers/StdDefs.h"
#include "DGtal/base/Common.h"
#include "DGtal/geometry/surfaces/DigitalPlanePredicate.h"
#include "DGtal/geometry/surfaces/estimation/PlaneProbingParallelepipedEstimator.h"
Include dependency graph for examplePlaneProbingParallelepipedEstimator.cpp:

Go to the source code of this file.

Typedefs

using DigitalPlane = DigitalPlanePredicate< Z3i::Space >
 
using Point = DigitalPlane::Vector
 
using Integer = Point::Coordinate
 
using Vector = DigitalPlane::Point
 
using Estimator = PlaneProbingParallelepipedEstimator< DigitalPlane, ProbingMode::R1 >
 

Functions

int main (int argc, const char **argv)
 

Detailed Description

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Author
Jocelyn Meyron (jocel.nosp@m.yn.m.nosp@m.eyron.nosp@m.@lir.nosp@m.is.cn.nosp@m.rs.f.nosp@m.r ) Laboratoire d'InfoRmatique en Image et Systemes d'information - LIRIS (CNRS, UMR 5205), CNRS, France
Date
2020/12/09

An example file that shows how to construct and use a DGtal::PlaneProbingParallelepipedEstimator on an analytical digital plane.

This file is part of the DGtal library.

Definition in file examplePlaneProbingParallelepipedEstimator.cpp.

Typedef Documentation

◆ DigitalPlane

◆ Estimator

◆ Integer

◆ Point

◆ Vector

Function Documentation

◆ main()

int main ( int  argc,
const char **  argv 
)

Definition at line 50 of file examplePlaneProbingParallelepipedEstimator.cpp.

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 }
Aim: Representing digital planes, which are digitizations of Euclidean planes, as point predicates.
DigitalPlane::Point Vector
DigitalPlane::Vector Point
MyPointD Point
Definition: testClone2.cpp:383

References DGtal::PlaneProbingParallelepipedEstimator< TPredicate, mode >::advance(), DGtal::PlaneProbingParallelepipedEstimator< TPredicate, mode >::getNormal(), DGtal::PlaneProbingParallelepipedEstimator< TPredicate, mode >::getState(), DGtal::PlaneProbingParallelepipedEstimator< TPredicate, mode >::isInReverseState(), and DGtal::PlaneProbingParallelepipedEstimator< TPredicate, mode >::m().