DGtal  0.9.2
L1LengthEstimator.h
1 
17 #pragma once
18 
34 #if defined(L1LengthEstimator_RECURSES)
35 #error Recursive header files inclusion detected in L1LengthEstimator.h
36 #else // defined(L1LengthEstimator_RECURSES)
37 
38 #define L1LengthEstimator_RECURSES
39 
40 #if !defined L1LengthEstimator_h
41 
42 #define L1LengthEstimator_h
43 
45 // Inclusions
46 #include <iostream>
47 #include "DGtal/base/Common.h"
48 #include "DGtal/base/Circulator.h"
50 
51 namespace DGtal
52 {
53 
55  // template class L1LengthEstimator
66  template <typename TConstIterator>
68  {
69  // ----------------------- Standard services ------------------------------
70  public:
71 
72 
74  typedef TConstIterator ConstIterator;
75 
76  typedef double Quantity;
77 
78 
83 
84 
89 
90 
91  // ----------------------- Interface --------------------------------------
92  public:
93 
101  void init( const double h, const ConstIterator& itb, const ConstIterator& ite);
102 
103 
111  Quantity eval( ) const;
112 
113 
118  void selfDisplay ( std::ostream & out ) const;
119 
124  bool isValid() const;
125 
126  // ------------------------- Private Datas --------------------------------
127  private:
128 
130  double myH;
131 
133  ConstIterator myBeginIt;
134  ConstIterator myEndIt;
135 
138 
139 
140  private:
141 
147  L1LengthEstimator ( const L1LengthEstimator & other );
148 
156 
157  // ------------------------- Internals ------------------------------------
158  private:
159 
160  }; // end of class L1LengthEstimator
161 
162 
169  template <typename T>
170  std::ostream&
171  operator<< ( std::ostream & out, const L1LengthEstimator<T> & object );
172 
173 } // namespace DGtal
174 
175 
177 // Includes inline functions.
178 #include "DGtal/geometry/curves/estimation/L1LengthEstimator.ih"
179 
180 // //
182 
183 #endif // !defined L1LengthEstimator_h
184 
185 #undef L1LengthEstimator_RECURSES
186 #endif // else defined(L1LengthEstimator_RECURSES)
bool myIsInitBefore
Boolean to make sure that init() has been called before eval().
Quantity eval() const
void init(const double h, const ConstIterator &itb, const ConstIterator &ite)
DGtal is the top-level namespace which contains all DGtal functions and types.
ConstIterator myBeginIt
Copy of the range.
Aim: a simple model of CGlobalCurveEstimator that compute the length of a curve using the l_1 metric ...
void selfDisplay(std::ostream &out) const
L1LengthEstimator & operator=(const L1LengthEstimator &other)