DGtal  1.5.beta
PlaneProbingR1Neighborhood.h
1 
17 #pragma once
18 
31 #if defined(PlaneProbingR1Neighborhood_RECURSES)
32 #error Recursive header files inclusion detected in PlaneProbingR1Neighborhood.h
33 #else // defined(PlaneProbingR1Neighborhood_RECURSES)
35 #define PlaneProbingR1Neighborhood_RECURSES
36 
37 #if !defined PlaneProbingR1Neighborhood_h
39 #define PlaneProbingR1Neighborhood_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/PlaneProbingRNeighborhood.h"
47 #include "DGtal/kernel/CPointPredicate.h"
49 
50 namespace DGtal
51 {
52 
54  // template class PlaneProbingR1Neighborhood
62  template <typename TPredicate>
64  {
66 
67  // ----------------------- Public types ------------------------------
68  public:
69  using Predicate = TPredicate;
70  using Point = typename TPredicate::Point;
73  using Integer = typename Point::Coordinate;
75 
77 
78  // ----------------------- Standard services ------------------------------
79  public:
84 
92  PlaneProbingR1Neighborhood(Predicate const& aPredicate, Point const& aQ, Triangle const& aM);
93 
98 
104 
110 
117 
124 
125  // ----------------------- Plane Probing services ------------------------------
126  public:
127  virtual HexagonState hexagonState () override;
128 
129  // ----------------------- Interface --------------------------------------
130  public:
131 
136  void selfDisplay ( std::ostream & out ) const;
137 
142  bool isValid() const;
143 
144  // ------------------------- Protected Datas ------------------------------
145  protected:
146 
147  // ------------------------- Private Datas --------------------------------
148  private:
149  mutable std::array<bool, 6> myState;
151  // ------------------------- Hidden services ------------------------------
152  protected:
153 
154  // ------------------------- Internals ------------------------------------
155  private:
159  int getNeighborhoodCode () const;
160 
165  std::pair<PointOnProbingRay, PointOnProbingRay> candidateRay (Index const& index) const;
166 
172  std::vector<PointOnProbingRay> intersectSphereRay (PointOnProbingRay const& aPoint, PointOnProbingRay const& aRay) const;
173 
183  std::vector<PointOnProbingRay> const& aLst) const;
184 
190 
196 
201  PointOnProbingRay closestRayPoint (std::pair<PointOnProbingRay, PointOnProbingRay> const& aRayPoint) const;
202 
203  }; // end of class PlaneProbingR1Neighborhood
204 
205 
212  template <typename TPredicate>
213  std::ostream&
214  operator<< ( std::ostream & out, const PlaneProbingR1Neighborhood<TPredicate> & object );
215 
216 } // namespace DGtal
217 
218 
220 // Includes inline functions.
221 #include "DGtal/geometry/surfaces/estimation/PlaneProbingR1Neighborhood.ih"
222 
223 // //
225 
226 #endif // !defined PlaneProbingR1Neighborhood_h
227 
228 #undef PlaneProbingR1Neighborhood_RECURSES
229 #endif // else defined(PlaneProbingR1Neighborhood_RECURSES)
typename Point::Coordinate Integer
Aim: Represent a way to probe the R-neighborhood, with the R1 optimization, see for details.
PointOnProbingRay closestRayPoint(std::pair< PointOnProbingRay, PointOnProbingRay > const &aRayPoint) const
void selfDisplay(std::ostream &out) const
virtual HexagonState hexagonState() override
PlaneProbingR1Neighborhood & operator=(const PlaneProbingR1Neighborhood &other)=delete
std::vector< PointOnProbingRay > intersectSphereRay(PointOnProbingRay const &aPoint, PointOnProbingRay const &aRay) const
PlaneProbingR1Neighborhood(PlaneProbingR1Neighborhood &&other)=delete
BOOST_CONCEPT_ASSERT((concepts::CPointPredicate< TPredicate >))
PointOnProbingRay closestPointOnRayConstant(PointOnProbingRay const &aRay) const
PlaneProbingR1Neighborhood(const PlaneProbingR1Neighborhood &other)=delete
PointOnProbingRay closestPointOnRayLinear(PointOnProbingRay const &aRay) const
bool isValidIntersectSphereRay(PointOnProbingRay const &aPoint, PointOnProbingRay const &aRay, std::vector< PointOnProbingRay > const &aLst) const
PlaneProbingR1Neighborhood(Predicate const &aPredicate, Point const &aQ, Triangle const &aM)
std::pair< PointOnProbingRay, PointOnProbingRay > candidateRay(Index const &index) const
Aim: Represent a way to probe the R-neighborhood.
typename PlaneProbingNeighborhood< TPredicate >::PointOnProbingRay PointOnProbingRay
typename PlaneProbingNeighborhood< TPredicate >::HexagonState HexagonState
typename PlaneProbingNeighborhood< TPredicate >::Triangle Triangle
A ray consists of a permutation and an integer index (position on the ray). For a triplet of vector...
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)