DGtal  0.9.4.1
GaussDigitizer.h
1
17 #pragma once
18
34 #if defined(GaussDigitizer_RECURSES)
35 #error Recursive header files inclusion detected in GaussDigitizer.h
36 #else // defined(GaussDigitizer_RECURSES)
37
38 #define GaussDigitizer_RECURSES
39
40 #if !defined GaussDigitizer_h
41
42 #define GaussDigitizer_h
43
45 // Inclusions
46 #include <iostream>
47 #include "DGtal/base/Common.h"
48 #include "DGtal/kernel/domains/HyperRectDomain.h"
49 #include "DGtal/kernel/RegularPointEmbedder.h"
50 #include "DGtal/shapes/CEuclideanOrientedShape.h"
51 #include "DGtal/shapes/CEuclideanBoundedShape.h"
52
54
55 namespace DGtal
56 {
57
59  // template class GaussDigitizer
76  template <typename TSpace, typename TEuclideanShape>
78  {
79  // ----------------------- Standard services ------------------------------
80  public:
81  typedef TSpace Space;
82  typedef typename Space::Integer Integer;
83  typedef typename Space::Point Point;
84  typedef typename Space::Vector Vector;
85  typedef typename Space::RealPoint RealPoint;
86  typedef typename Space::RealPoint RealVector;
87  typedef TEuclideanShape EuclideanShape;
90
92
97
101  GaussDigitizer();
102
108  GaussDigitizer & operator= ( const GaussDigitizer & other );
109
113  void attach( const EuclideanShape & shape );
114
127  void init( const RealPoint & xLow, const RealPoint & xUp,
128  typename RealVector::Component gridStep );
129
141  void init( const RealPoint & xLow, const RealPoint & xUp,
142  const RealVector & gridSteps );
143
147  const PointEmbedder & pointEmbedder() const;
148
153  Domain getDomain() const;
154
159  Point floor( const RealPoint & p ) const;
160
165  Point ceil( const RealPoint & p ) const;
166
173  Point round( const RealPoint & p ) const;
174
182  RealPoint embed( const Point & p ) const;
183
192  Orientation orientation(const Point &p) const
193  {
194  return myEShape->orientation(embed(p));
195  }
196
203  bool operator()( const Point & p ) const;
204
209  const Point & getLowerBound() const;
210
215  const Point & getUpperBound() const;
216
220  Vector resolution() const;
221
225  RealVector gridSteps() const;
226
227
228  // ----------------------- Interface --------------------------------------
229  public:
230
235  void selfDisplay ( std::ostream & out ) const;
236
241  bool isValid() const;
242
243  // ------------------------- Protected Datas ------------------------------
244  protected:
247
250
253
256  // ------------------------- Private Datas --------------------------------
257  private:
258
259  // ------------------------- Hidden services ------------------------------
260  private:
261
262  // ------------------------- Internals ------------------------------------
263  private:
264
265  }; // end of class GaussDigitizer
266
267
274  template <typename TSpace, typename TEuclideanShape>
275  std::ostream&
276  operator<< ( std::ostream & out,
278
279 } // namespace DGtal
280
281
283 // Includes inline functions.
284 #include "DGtal/shapes/GaussDigitizer.ih"
285
286 // //
288
289 #endif // !defined GaussDigitizer_h
290
291 #undef GaussDigitizer_RECURSES
292 #endif // else defined(GaussDigitizer_RECURSES)
Space::RealPoint RealPoint
Point myLowerPoint
Digital lowest point.
bool isValid() const
const Point & getLowerBound() const
void selfDisplay(std::ostream &out) const
const Point & getUpperBound() const
RegularPointEmbedder< Space > myPointEmbedder
The embedder.
Orientation orientation(const Point &p) const
Point ceil(const RealPoint &p) const
void attach(const EuclideanShape &shape)
Orientation
Definition: Common.h:125
HyperRectDomain< Space > Domain
const PointEmbedder & pointEmbedder() const
const EuclideanShape * myEShape
The referenced shape or 0 if not initialized.
TEuclideanShape EuclideanShape
void init(const RealPoint &xLow, const RealPoint &xUp, typename RealVector::Component gridStep)
Aim: A class for computing the Gauss digitization of some Euclidean shape, i.e. its intersection with...
std::ostream & operator<<(std::ostream &out, const ClosedIntegerHalfPlane< TSpace > &object)
TInteger Integer
Arithmetic ring induced by (+,-,*) and Integer numbers.
Definition: SpaceND.h:102
Point floor(const RealPoint &p) const
Aim: characterizes models of digital oriented shapes. For example, models should provide an orientati...
DGtal is the top-level namespace which contains all DGtal functions and types.
MyPointD Point
Definition: testClone2.cpp:383
Point myUpperPoint
Digital uppest point.
bool operator()(const Point &p) const
RealPoint embed(const Point &p) const
FreemanChain< int >::Vector Vector
Point round(const RealPoint &p) const
RegularPointEmbedder< Space > PointEmbedder
RealVector gridSteps() const
BOOST_CONCEPT_ASSERT((concepts::CEuclideanOrientedShape< TEuclideanShape >))
Space::Integer Integer
Domain getDomain() const
Space::RealPoint RealVector
GaussDigitizer & operator=(const GaussDigitizer &other)
Vector resolution() const
TEuclideanRing Component
Type for Vector elements.
Definition: PointVector.h:155
Space::Vector Vector