DGtal  1.5.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)
35 #define PlaneProbingParallelepipedEstimator_RECURSES
36 
37 #if !defined PlaneProbingParallelepipedEstimator_h
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 
240 
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)
NotAbovePredicate(Predicate const &aPredicate, Integer const &aBound, Self *aParallelepipedEstimator)
NotAbovePredicate & operator=(const NotAbovePredicate &other)
void selfDisplay(std::ostream &out) const
typename TetrahedronEstimator::HexagonState HexagonState
typename TetrahedronEstimator::UpdateOperation UpdateOperation
bool inPlane(Point const &aPoint) const
BOOST_CONCEPT_ASSERT((concepts::CPointPredicate< TPredicate >))
typename TetrahedronEstimator::PointOnProbingRay PointOnProbingRay
PlaneProbingParallelepipedEstimator(PlaneProbingParallelepipedEstimator &&other)=delete
PlaneProbingParallelepipedEstimator(Point const &aPoint, Triangle const &aM, Predicate const &aPredicate, Integer const &aBound)
PlaneProbingParallelepipedEstimator(const PlaneProbingParallelepipedEstimator &other)=delete
std::vector< UpdateOperation > geometricalDecomposition(UpdateOperation const &aOp) const
std::pair< Vector, Vector > getBasis() const
PlaneProbingParallelepipedEstimator & operator=(const PlaneProbingParallelepipedEstimator &other)=delete
bool advance(std::vector< PointOnProbingRay > const &aNeighbors)
Quantity compute(std::vector< PointOnProbingRay > const &aNeighbors)
bool translateIf(UpdateOperation const &aOp)
DGtal is the top-level namespace which contains all DGtal functions and types.
std::ostream & operator<<(std::ostream &out, const ATu0v1< TKSpace, TLinearAlgebra > &object)
Aim: Defines a predicate on a point.
MyPointD Point
Definition: testClone2.cpp:383
const Point aPoint(3, 4)