DGtal  1.5.beta
MaximalSegmentSliceEstimation.h
1 
17 #pragma once
18 
31 #if defined(MaximalSegmentSliceEstimation_RECURSES)
32 #error Recursive header files inclusion detected in MaximalSegmentSliceEstimation.h
33 #else // defined(MaximalSegmentSliceEstimation_RECURSES)
35 #define MaximalSegmentSliceEstimation_RECURSES
36 
37 #if !defined MaximalSegmentSliceEstimation_h
39 #define MaximalSegmentSliceEstimation_h
40 
42 // Inclusions
43 #include <iostream>
44 #include <vector>
45 #include "DGtal/base/Common.h"
46 #include "DGtal/geometry/surfaces/ArithmeticalDSSComputerOnSurfels.h"
47 #include "DGtal/topology/DigitalSurface2DSlice.h"
48 #include "DGtal/topology/CDigitalSurfaceContainer.h"
50 
51 namespace DGtal
52 {
53 
55  // template class MaximalSegmentSliceEstimation
64  template <typename TSurface>
66  {
68 
69  // ----------------------- Public types ------------------------------
70  public:
71  using Surface = TSurface;
74  using Scalar = double;
75 
76  // -------------------------------------- other types ----------------------------
77  using KSpace = typename Surface::KSpace;
78  using SCell = typename KSpace::SCell;
79  using Cell = typename KSpace::Cell;
80  using Point = typename Surface::Point;
81  using Vector = Point;
82  using Integer = typename Point::Coordinate;
83  using Space = typename KSpace::Space;
84  using RealPoint = typename Space::RealPoint;
86 
87  // ----------------------- model of CDigitalSurfaceLocalEstimator ----------------
88  using Surfel = typename Surface::Surfel;
90 
91  // ----------------------- Private types ------------------------------
92  private:
95  using Container = std::deque<SCell>;
96  using Iterator = typename Container::const_iterator;
98 
99  // ----------------------- Standard services ------------------------------
100  public:
105 
112 
117 
123 
130 
131  // ----------------- model of CSurfelLocalEstimator -----------------------
132  public:
140  template < typename SurfelConstIterator >
141  void init (Scalar const& h, SurfelConstIterator itb, SurfelConstIterator ite);
142 
149  template < typename SurfelConstIterator >
150  Quantity eval (SurfelConstIterator it) const;
151 
160  template < typename SurfelConstIterator, typename OutputIterator >
161  OutputIterator eval (SurfelConstIterator itb, SurfelConstIterator ite, OutputIterator out) const;
162 
166  Scalar h () const;
167 
168  // --------------- model of CDigitalSurfaceLocalEstimator ------------------
169  public:
170  void attach (ConstAlias<Surface> aSurface);
171 
172  // ----------------------- Interface --------------------------------------
173  public:
174 
179  void selfDisplay ( std::ostream & out ) const;
180 
185  bool isValid() const;
186 
187  // ------------------------- Protected Datas ------------------------------
188  protected:
189 
190  // ------------------------- Private Datas --------------------------------
191  private:
195  // ------------------------- Hidden services ------------------------------
196  protected:
197 
198  // ------------------------- Internals ------------------------------------
199  private:
205  KSpace const& space () const;
206 
215  std::pair<Point2, Point2> getExtremalPoints (SurfaceSlice const& aSlice,
216  Dimension const& aProjectDir1, Dimension const& aProjectDir2) const;
217 
222  Vector trivialNormal (Surfel const& aSurfel) const;
223  }; // end of class MaximalSegmentSliceEstimation
224 
225 
232  template <typename TSurface>
233  std::ostream&
234  operator<< ( std::ostream & out, const MaximalSegmentSliceEstimation<TSurface> & object );
235 
236 } // namespace DGtal
237 
238 
240 // Includes inline functions.
241 #include "DGtal/geometry/surfaces/estimation/MaximalSegmentSliceEstimation.ih"
242 
243 // //
245 
246 #endif // !defined MaximalSegmentSliceEstimation_h
247 
248 #undef MaximalSegmentSliceEstimation_RECURSES
249 #endif // else defined(MaximalSegmentSliceEstimation_RECURSES)
Aim: This class is a wrapper around ArithmeticalDSS that is devoted to the dynamic recognition of dig...
Aim: This class encapsulates its parameter class so that to indicate to the user that the object/poin...
Definition: ConstAlias.h:187
Aim: Represents a 2-dimensional slice in a DigitalSurface. In a sense, it is a 4-connected contour,...
DigitalSurfaceContainer::DigitalSurfaceTracker DigitalSurfaceTracker
std::pair< Point2, Point2 > getExtremalPoints(SurfaceSlice const &aSlice, Dimension const &aProjectDir1, Dimension const &aProjectDir2) const
Quantity eval(SurfelConstIterator it) const
void init(Scalar const &h, SurfelConstIterator itb, SurfelConstIterator ite)
Vector trivialNormal(Surfel const &aSurfel) const
OutputIterator eval(SurfelConstIterator itb, SurfelConstIterator ite, OutputIterator out) const
typename Container::const_iterator Iterator
BOOST_CONCEPT_ASSERT((concepts::CDigitalSurfaceContainer< typename TSurface::DigitalSurfaceContainer >))
void attach(ConstAlias< Surface > aSurface)
typename Surface::DigitalSurfaceTracker Tracker
MaximalSegmentSliceEstimation & operator=(const MaximalSegmentSliceEstimation &other)
CountedConstPtrOrConstPtr< Surface > mySurface
MaximalSegmentSliceEstimation(ConstAlias< Surface > aSurface)
void selfDisplay(std::ostream &out) const
MaximalSegmentSliceEstimation(const MaximalSegmentSliceEstimation &other)
Z3i::SCell SCell
DGtal is the top-level namespace which contains all DGtal functions and types.
std::ostream & operator<<(std::ostream &out, const ATu0v1< TKSpace, TLinearAlgebra > &object)
DGtal::uint32_t Dimension
Definition: Common.h:136
Aim: The digital surface container concept describes a minimal set of inner types and methods so as t...
MyPointD Point
Definition: testClone2.cpp:383
KSpace::Cell Cell
PointVector< 3, double > RealPoint