DGtal 1.3.0
Loading...
Searching...
No Matches
Measure.h
1
17#pragma once
18
34#if defined(Measure_RECURSES)
35#error Recursive header files inclusion detected in Measure.h
36#else // defined(Measure_RECURSES)
38#define Measure_RECURSES
39
40#if !defined Measure_h
42#define Measure_h
43
45// Inclusions
46#include <iostream>
47#include "DGtal/base/Common.h"
48#include "DGtal/kernel/sets/CDigitalSet.h"
49#include "DGtal/base/CowPtr.h"
50
52
53namespace DGtal
54{
55
57 // template class Measure
70 template< typename TSet >
71 class Measure
72 {
73 // ----------------------- Standard services ------------------------------
74 public:
75
76 typedef TSet Set;
77 typedef typename TSet::Domain Domain;
78
79 // Does not work
80 //BOOST_CONCEPT_ASSERT(( CDigitalSet<TSet> ));
81
82 typedef double Quantity;
83
88
93
100 void init(const double h, const Set &aSetPointer);
101
102
112 Quantity eval() const;
113
114
115 // ----------------------- Interface --------------------------------------
116 public:
117
122 void selfDisplay ( std::ostream & out ) const;
123
128 bool isValid() const;
129
130
131
132 // ------------------------- Hidden services ------------------------------
133 protected:
134
135 private:
136
142 Measure ( const Measure & other );
143
150 Measure & operator= ( const Measure & other );
151
152 // ------------------------- Internals ------------------------------------
153 private:
154
156 double myH;
157
159 typename Set::Size mySetSize;
160
163
164
165 }; // end of class Measure
166
167
174 template <typename T>
175 std::ostream&
176 operator<< ( std::ostream & out, const Measure<T> & object );
177
178} // namespace DGtal
179
180
182// Includes inline functions.
183#include "DGtal/geometry/volumes/estimation/Measure.ih"
184
185// //
187
188#endif // !defined Measure_h
189
190#undef Measure_RECURSES
191#endif // else defined(Measure_RECURSES)
Aim: Implements a simple measure computation (in the Lesbegue sens) of a set. In dimension 2,...
Definition: Measure.h:72
Measure & operator=(const Measure &other)
double myH
grid resolution parameter.
Definition: Measure.h:156
Quantity eval() const
Set::Size mySetSize
Copy of the set size.
Definition: Measure.h:159
double myIsInitBefore
Boolean to assert that the init() was called before the eval().
Definition: Measure.h:162
bool isValid() const
double Quantity
Definition: Measure.h:82
TSet::Domain Domain
Definition: Measure.h:77
void init(const double h, const Set &aSetPointer)
void selfDisplay(std::ostream &out) const
Measure(const Measure &other)
DGtal is the top-level namespace which contains all DGtal functions and types.
std::ostream & operator<<(std::ostream &out, const ClosedIntegerHalfPlane< TSpace > &object)