DGtal  0.9.2
MLPLengthEstimator.h
1 
17 #pragma once
18 
37 #if defined(MLPLengthEstimator_RECURSES)
38 #error Recursive header files inclusion detected in MLPLengthEstimator.h
39 #else // defined(MLPLengthEstimator_RECURSES)
40 
41 #define MLPLengthEstimator_RECURSES
42 
43 #if !defined MLPLengthEstimator_h
44 
45 #define MLPLengthEstimator_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 MLPLengthEstimator
68  template <typename TConstIterator>
70  {
71  // ----------------------- Standard services ------------------------------
72  public:
73 
74 
76  typedef TConstIterator ConstIterator;
77 
78  typedef double Quantity;
79 
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  MLPLengthEstimator ( const MLPLengthEstimator & other );
152 
160 
161  // ------------------------- Internals ------------------------------------
162  private:
163 
164  }; // end of class MLPLengthEstimator
165 
166 
173  template <typename T>
174  std::ostream&
175  operator<< ( std::ostream & out, const MLPLengthEstimator<T> & object );
176 
177 } // namespace DGtal
178 
179 
181 // Includes inline functions.
182 #include "DGtal/geometry/curves/estimation/MLPLengthEstimator.ih"
183 
184 // //
186 
187 #endif // !defined MLPLengthEstimator_h
188 
189 #undef MLPLengthEstimator_RECURSES
190 #endif // else defined(MLPLengthEstimator_RECURSES)
std::vector< Point > myRep
polygonal representation of the input
FaithfulPolygon::RealPoint Point
Aim: Implements basic operations that will be used in Point and Vector classes.
Definition: PointVector.h:141
void selfDisplay(std::ostream &out) const
Aim: a model of CGlobalCurveEstimator that computes the length of a digital curve using its MLP (give...
void init(const double h, const ConstIterator &itb, const ConstIterator &ite, const bool &isClosed)
MLPLengthEstimator & operator=(const MLPLengthEstimator &other)
Quantity eval() const
FP< ConstIterator, int, 4 > FaithfulPolygon
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
FaithfulPolygon::RealVector Vector
bool myIsInitBefore
Boolean to make sure that init() has been called before eval().