DGtal 1.3.0
Loading...
Searching...
No Matches
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
50namespace DGtal
51{
52
54 // template class PlaneProbingParallelepipedEstimator
61 template <typename TPredicate, ProbingMode mode>
63 {
65
66 // ----------------------- Public types ------------------------------
67 public:
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
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 & operator=(const NotAbovePredicate &other)
NotAbovePredicate(Predicate const &aPredicate, Integer const &aBound, Self *aParallelepipedEstimator)
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
std::vector< UpdateOperation > geometricalDecomposition(UpdateOperation const &aOp) const
PlaneProbingParallelepipedEstimator(PlaneProbingParallelepipedEstimator &&other)=delete
PlaneProbingParallelepipedEstimator(Point const &aPoint, Triangle const &aM, Predicate const &aPredicate, Integer const &aBound)
PlaneProbingParallelepipedEstimator(const PlaneProbingParallelepipedEstimator &other)=delete
PlaneProbingParallelepipedEstimator & operator=(const PlaneProbingParallelepipedEstimator &other)=delete
std::pair< Vector, Vector > getBasis() const
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 ClosedIntegerHalfPlane< TSpace > &object)
Aim: Defines a predicate on a point.
const Point aPoint(3, 4)