DGtal  0.9.2
FPLengthEstimator.h
1 
17 #pragma once
18 
37 #if defined(FPLengthEstimator_RECURSES)
38 #error Recursive header files inclusion detected in FPLengthEstimator.h
39 #else // defined(FPLengthEstimator_RECURSES)
40 
41 #define FPLengthEstimator_RECURSES
42 
43 #if !defined FPLengthEstimator_h
44 
45 #define FPLengthEstimator_h
46 
48 // Inclusions
49 #include <iostream>
50 #include "DGtal/base/Common.h"
51 #include "DGtal/geometry/curves/FP.h"
53 
54 namespace DGtal
55 {
56 
58  // template class FPLengthEstimator
68  template <typename TConstIterator>
70  {
71  // ----------------------- Standard services ------------------------------
72  public:
73 
74 
76  typedef TConstIterator ConstIterator;
77 
78  typedef double Quantity;
79 
81  typedef typename FaithfulPolygon::Point Point;
82  typedef typename FaithfulPolygon::Vector Vector;
83 
88 
89 
94 
95 
96  // ----------------------- Interface --------------------------------------
97  public:
98 
107  void init( const double h, const ConstIterator& itb, const ConstIterator& ite, const bool& isClosed);
108 
109 
117  Quantity eval( ) const;
118 
119 
124  void selfDisplay ( std::ostream & out ) const;
125 
130  bool isValid() const;
131 
132  // ------------------------- Private Datas --------------------------------
133  private:
134 
136  double myH;
137 
139  std::vector<Point> myRep;
140 
143 
144  private:
145 
151  FPLengthEstimator ( const FPLengthEstimator & other );
152 
160 
161  // ------------------------- Internals ------------------------------------
162  private:
163 
164  }; // end of class FPLengthEstimator
165 
166 
173  template <typename T>
174  std::ostream&
175  operator<< ( std::ostream & out, const FPLengthEstimator<T> & object );
176 
177 } // namespace DGtal
178 
179 
181 // Includes inline functions.
182 #include "DGtal/geometry/curves/estimation/FPLengthEstimator.ih"
183 
184 // //
186 
187 #endif // !defined FPLengthEstimator_h
188 
189 #undef FPLengthEstimator_RECURSES
190 #endif // else defined(FPLengthEstimator_RECURSES)
FPLengthEstimator & operator=(const FPLengthEstimator &other)
bool myIsInitBefore
Boolean to make sure that init() has been called before eval().
void selfDisplay(std::ostream &out) const
Aim: Implements basic operations that will be used in Point and Vector classes.
Definition: PointVector.h:141
FaithfulPolygon::Point Point
Aim: a model of CGlobalCurveEstimator that computes the length of a digital curve using its FP (faith...
FaithfulPolygon::Vector Vector
Quantity eval() const
std::vector< Point > myRep
polygonal representation of the input
DGtal is the top-level namespace which contains all DGtal functions and types.
Aim: Computes the faithful polygon (FP) of a range of 4/8-connected 2D Points.
Definition: FP.h:292
void init(const double h, const ConstIterator &itb, const ConstIterator &ite, const bool &isClosed)
FP< ConstIterator, int, 4 > FaithfulPolygon