DGtal  1.3.beta
PlaneProbingParallelepipedEstimator.h
1 
17 #pragma once
18 
31 #if defined(PlaneProbingParallelepipedEstimator_RECURSES)
32 #error Recursive header files inclusion detected in PlaneProbingParallelepipedEstimator.h
33 #else // defined(PlaneProbingParallelepipedEstimator_RECURSES)
34 
35 #define PlaneProbingParallelepipedEstimator_RECURSES
36 
37 #if !defined PlaneProbingParallelepipedEstimator_h
38 
39 #define PlaneProbingParallelepipedEstimator_h
40 
42 // Inclusions
43 #include <iostream>
44 #include "DGtal/base/Common.h"
45 #include "DGtal/geometry/helpers/PlaneProbingEstimatorHelper.h"
46 #include "DGtal/geometry/surfaces/estimation/PlaneProbingTetrahedronEstimator.h"
47 #include "DGtal/kernel/CPointPredicate.h"
49 
50 namespace DGtal
51 {
52 
54  // template class PlaneProbingParallelepipedEstimator
61  template <typename TPredicate, ProbingMode mode>
63  {
65 
66  // ----------------------- Public types ------------------------------
67  public:
68  class NotAbovePredicate;
70  using Predicate = TPredicate;
71  using Point = typename Predicate::Point;
72  using Vector = Point;
73  using Integer = typename Predicate::Integer;
80 
82  {
83  public:
84 
85  using Point = typename Self::Point;
86  using Integer = typename Self::Integer;
87 
95  NotAbovePredicate (Predicate const& aPredicate, Integer const& aBound, Self* aParallelepipedEstimator);
96 
103 
110  bool inPlane (Point const& aPoint) const;
111 
118  bool operator() (Point const& aPoint) const;
119 
120  private:
121  const Predicate* myPredicate = nullptr;
128  Point q () const;
129  };
130 
131 
132  // ----------------------- Standard services ------------------------------
133  public:
138 
148  Predicate const& aPredicate, Integer const& aBound);
149 
154 
160 
166 
173 
180 
181  // ----------------------- Plane Probing services ------------------------------
182  public:
187  Vector m (int aIndex) const;
188 
192  Point q () const;
193 
197  Point getOrigin () const;
198 
202  int getState () const;
203 
207  bool isSeparating () const;
208 
217  bool advance (std::vector<PointOnProbingRay> const& aNeighbors);
218 
224  bool advance ();
225 
232  Quantity compute (std::vector<PointOnProbingRay> const& aNeighbors);
233 
239  Quantity compute ();
240 
244  HexagonState hexagonState () const;
245 
249  Vector getNormal() const;
250 
254  std::pair<Vector, Vector> getBasis () const;
255 
259  bool isReduced () const;
260 
264  bool isInReverseState () const;
265 
266  // ----------------------- Interface --------------------------------------
267  public:
268 
273  void selfDisplay ( std::ostream & out ) const;
274 
280  bool isValid() const;
281 
282  // ------------------------- Protected Datas ------------------------------
283  protected:
284 
285  // ------------------------- Private Datas --------------------------------
286  private:
287 
288  // ------------------------- Hidden services ------------------------------
289  protected:
290 
291  // ------------------------- Internals ------------------------------------
292  private:
302  std::vector<UpdateOperation> geometricalDecomposition (UpdateOperation const& aOp) const;
303 
310  bool translateIf (UpdateOperation const& aOp);
311 
317  bool inPlane (Point const& aPoint) const;
318 
319  }; // end of class PlaneProbingParallelepipedEstimator
320 
321 
328  template <typename TPredicate, ProbingMode mode>
329  std::ostream&
330  operator<< ( std::ostream & out, const PlaneProbingParallelepipedEstimator<TPredicate, mode> & object );
331 
332 } // namespace DGtal
333 
334 
336 // Includes inline functions.
337 #include "DGtal/geometry/surfaces/estimation/PlaneProbingParallelepipedEstimator.ih"
338 
339 // //
341 
342 #endif // !defined PlaneProbingParallelepipedEstimator_h
343 
344 #undef PlaneProbingParallelepipedEstimator_RECURSES
345 #endif // else defined(PlaneProbingParallelepipedEstimator_RECURSES)
DGtal::PlaneProbingParallelepipedEstimator
Aim:
Definition: PlaneProbingParallelepipedEstimator.h:62
DGtal::PlaneProbingTetrahedronEstimator< NotAbovePredicate, mode >::Quantity
Vector Quantity
Definition: PlaneProbingTetrahedronEstimator.h:121
DGtal::PlaneProbingTetrahedronEstimator< NotAbovePredicate, mode >::HexagonState
typename Neighborhood::HexagonState HexagonState
Definition: PlaneProbingTetrahedronEstimator.h:122
DGtal::PlaneProbingParallelepipedEstimator::getOrigin
Point getOrigin() const
DGtal::PlaneProbingParallelepipedEstimator::NotAbovePredicate::Point
typename Self::Point Point
Definition: PlaneProbingParallelepipedEstimator.h:85
DGtal::PlaneProbingParallelepipedEstimator::myTetrahedronEstimator
TetrahedronEstimator myTetrahedronEstimator
Definition: PlaneProbingParallelepipedEstimator.h:294
DGtal::PlaneProbingParallelepipedEstimator::Triangle
typename TetrahedronEstimator::Triangle Triangle
Definition: PlaneProbingParallelepipedEstimator.h:75
DGtal::PlaneProbingParallelepipedEstimator::NotAbovePredicate::operator()
bool operator()(Point const &aPoint) const
DGtal::PlaneProbingParallelepipedEstimator::NotAbovePredicate
Definition: PlaneProbingParallelepipedEstimator.h:81
DGtal::PlaneProbingParallelepipedEstimator::isSeparating
bool isSeparating() const
aPoint
const Point aPoint(3, 4)
DGtal::PlaneProbingParallelepipedEstimator::getBasis
std::pair< Vector, Vector > getBasis() const
DGtal::PlaneProbingParallelepipedEstimator::getNormal
Vector getNormal() const
DGtal::PlaneProbingTetrahedronEstimator< NotAbovePredicate, mode >::Triangle
typename Neighborhood::Triangle Triangle
Definition: PlaneProbingTetrahedronEstimator.h:117
DGtal::PlaneProbingParallelepipedEstimator::myNotAbovePredicate
NotAbovePredicate myNotAbovePredicate
Definition: PlaneProbingParallelepipedEstimator.h:293
DGtal::PlaneProbingParallelepipedEstimator::Predicate
TPredicate Predicate
Definition: PlaneProbingParallelepipedEstimator.h:70
DGtal::PlaneProbingParallelepipedEstimator::UpdateOperation
typename TetrahedronEstimator::UpdateOperation UpdateOperation
Definition: PlaneProbingParallelepipedEstimator.h:78
DGtal::PlaneProbingParallelepipedEstimator::compute
Quantity compute()
DGtal::PlaneProbingParallelepipedEstimator::Integer
typename Predicate::Integer Integer
Definition: PlaneProbingParallelepipedEstimator.h:73
DGtal::operator<<
std::ostream & operator<<(std::ostream &out, const ATu0v1< TKSpace, TLinearAlgebra > &object)
DGtal::PlaneProbingParallelepipedEstimator::HexagonState
typename TetrahedronEstimator::HexagonState HexagonState
Definition: PlaneProbingParallelepipedEstimator.h:79
DGtal::PlaneProbingParallelepipedEstimator::PlaneProbingParallelepipedEstimator
PlaneProbingParallelepipedEstimator()=delete
DGtal::PlaneProbingTetrahedronEstimator< NotAbovePredicate, mode >::UpdateOperation
typename Neighborhood::UpdateOperation UpdateOperation
Definition: PlaneProbingTetrahedronEstimator.h:123
DGtal::PlaneProbingParallelepipedEstimator::isInReverseState
bool isInReverseState() const
DGtal::PlaneProbingParallelepipedEstimator::NotAbovePredicate::myBound
Integer myBound
Definition: PlaneProbingParallelepipedEstimator.h:122
DGtal::PlaneProbingParallelepipedEstimator::getState
int getState() const
DGtal::PlaneProbingParallelepipedEstimator::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((concepts::CPointPredicate< TPredicate >))
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
DGtal::PlaneProbingParallelepipedEstimator::advance
bool advance()
DGtal::PlaneProbingParallelepipedEstimator::m
Vector m(int aIndex) const
DGtal::PlaneProbingParallelepipedEstimator::NotAbovePredicate::q
Point q() const
DGtal::PlaneProbingParallelepipedEstimator::NotAbovePredicate::myPredicate
const Predicate * myPredicate
Definition: PlaneProbingParallelepipedEstimator.h:121
DGtal::PlaneProbingParallelepipedEstimator::NotAbovePredicate::NotAbovePredicate
NotAbovePredicate(Predicate const &aPredicate, Integer const &aBound, Self *aParallelepipedEstimator)
DGtal::PlaneProbingParallelepipedEstimator::translateIf
bool translateIf(UpdateOperation const &aOp)
DGtal::PlaneProbingParallelepipedEstimator::NotAbovePredicate::operator=
NotAbovePredicate & operator=(const NotAbovePredicate &other)
DGtal::PlaneProbingParallelepipedEstimator::myIsInReverseState
bool myIsInReverseState
Definition: PlaneProbingParallelepipedEstimator.h:295
DGtal::PlaneProbingParallelepipedEstimator::q
Point q() const
DGtal::PlaneProbingParallelepipedEstimator::Quantity
typename TetrahedronEstimator::Quantity Quantity
Definition: PlaneProbingParallelepipedEstimator.h:77
DGtal::PlaneProbingParallelepipedEstimator::inPlane
bool inPlane(Point const &aPoint) const
DGtal::PlaneProbingParallelepipedEstimator::selfDisplay
void selfDisplay(std::ostream &out) const
Integer
Point::Coordinate Integer
Definition: examplePlaneProbingParallelepipedEstimator.cpp:44
DGtal::PlaneProbingParallelepipedEstimator::PointOnProbingRay
typename TetrahedronEstimator::PointOnProbingRay PointOnProbingRay
Definition: PlaneProbingParallelepipedEstimator.h:76
DGtal::PlaneProbingParallelepipedEstimator::isReduced
bool isReduced() const
DGtal::PlaneProbingParallelepipedEstimator::NotAbovePredicate::Integer
typename Self::Integer Integer
Definition: PlaneProbingParallelepipedEstimator.h:86
DGtal::PlaneProbingParallelepipedEstimator::Vector
Point Vector
Definition: PlaneProbingParallelepipedEstimator.h:72
DGtal::PlaneProbingTetrahedronEstimator< NotAbovePredicate, mode >
DGtal::PlaneProbingParallelepipedEstimator::hexagonState
HexagonState hexagonState() const
DGtal::PlaneProbingTetrahedronEstimator< NotAbovePredicate, mode >::PointOnProbingRay
typename Neighborhood::PointOnProbingRay PointOnProbingRay
Definition: PlaneProbingTetrahedronEstimator.h:119
DGtal::PlaneProbingParallelepipedEstimator::NotAbovePredicate::myParallelpipedEstimator
Self * myParallelpipedEstimator
Definition: PlaneProbingParallelepipedEstimator.h:123
DGtal::PlaneProbingParallelepipedEstimator::isValid
bool isValid() const
DGtal::concepts::CPointPredicate
Aim: Defines a predicate on a point.
Definition: CPointPredicate.h:80
DGtal::PlaneProbingParallelepipedEstimator::geometricalDecomposition
std::vector< UpdateOperation > geometricalDecomposition(UpdateOperation const &aOp) const
DGtal::PlaneProbingParallelepipedEstimator::NotAbovePredicate::inPlane
bool inPlane(Point const &aPoint) const
DGtal::PlaneProbingParallelepipedEstimator::Point
typename Predicate::Point Point
Definition: PlaneProbingParallelepipedEstimator.h:71
Point
MyPointD Point
Definition: testClone2.cpp:383
DGtal::PlaneProbingParallelepipedEstimator::operator=
PlaneProbingParallelepipedEstimator & operator=(const PlaneProbingParallelepipedEstimator &other)=delete
DGtal::PlaneProbingParallelepipedEstimator::~PlaneProbingParallelepipedEstimator
~PlaneProbingParallelepipedEstimator()=default