DGtal  1.5.beta
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)
38 #define GaussDigitizer_RECURSES
39 
40 #if !defined GaussDigitizer_h
42 #define GaussDigitizer_h
43 
45 // Inclusions
46 #include <iostream>
47 #include "DGtal/base/Common.h"
48 #include "DGtal/base/ConstAlias.h"
49 #include "DGtal/base/CountedConstPtrOrConstPtr.h"
50 #include "DGtal/kernel/domains/HyperRectDomain.h"
51 #include "DGtal/kernel/RegularPointEmbedder.h"
52 #include "DGtal/shapes/CEuclideanOrientedShape.h"
53 #include "DGtal/shapes/CEuclideanBoundedShape.h"
54 
56 
57 namespace DGtal
58 {
59 
61  // template class GaussDigitizer
78  template <typename TSpace, typename TEuclideanShape>
80  {
81  // ----------------------- Standard services ------------------------------
82  public:
83  typedef TSpace Space;
84  typedef typename Space::Integer Integer;
85  typedef typename Space::Point Point;
86  typedef typename Space::Vector Vector;
87  typedef typename Space::RealPoint RealPoint;
88  typedef typename Space::RealPoint RealVector;
89  typedef TEuclideanShape EuclideanShape;
92 
94 
99 
104 
111 
116 
129  void init( const RealPoint & xLow, const RealPoint & xUp,
130  typename RealVector::Component gridStep );
131 
143  void init( const RealPoint & xLow, const RealPoint & xUp,
144  const RealVector & gridSteps );
145 
149  const PointEmbedder & pointEmbedder() const;
150 
155  Domain getDomain() const;
156 
161  Point floor( const RealPoint & p ) const;
162 
167  Point ceil( const RealPoint & p ) const;
168 
175  Point round( const RealPoint & p ) const;
176 
184  RealPoint embed( const Point & p ) const;
185 
194  Orientation orientation(const Point &p) const
195  {
196  return myEShape->orientation(embed(p));
197  }
198 
205  bool operator()( const Point & p ) const;
206 
211  const Point & getLowerBound() const;
212 
217  const Point & getUpperBound() const;
218 
223 
228 
229 
230  // ----------------------- Interface --------------------------------------
231  public:
232 
237  void selfDisplay ( std::ostream & out ) const;
238 
243  bool isValid() const;
244 
245  // ------------------------- Protected Datas ------------------------------
246  protected:
249 
252 
255 
258  // ------------------------- Private Datas --------------------------------
259  private:
260 
261  // ------------------------- Hidden services ------------------------------
262  private:
263 
264  // ------------------------- Internals ------------------------------------
265  private:
266 
267  }; // end of class GaussDigitizer
268 
269 
276  template <typename TSpace, typename TEuclideanShape>
277  std::ostream&
278  operator<< ( std::ostream & out,
280 
281 } // namespace DGtal
282 
283 
285 // Includes inline functions.
286 #include "DGtal/shapes/GaussDigitizer.ih"
287 
288 // //
290 
291 #endif // !defined GaussDigitizer_h
292 
293 #undef GaussDigitizer_RECURSES
294 #endif // else defined(GaussDigitizer_RECURSES)
Aim: This class encapsulates its parameter class so that to indicate to the user that the object/poin...
Definition: ConstAlias.h:187
Aim: A class for computing the Gauss digitization of some Euclidean shape, i.e. its intersection with...
HyperRectDomain< Space > Domain
Vector resolution() const
TEuclideanShape EuclideanShape
Point myUpperPoint
Digital uppest point.
RegularPointEmbedder< Space > PointEmbedder
const Point & getLowerBound() const
Point floor(const RealPoint &p) const
Orientation orientation(const Point &p) const
void attach(ConstAlias< EuclideanShape > shape)
const PointEmbedder & pointEmbedder() const
RealVector gridSteps() const
Point myLowerPoint
Digital lowest point.
GaussDigitizer & operator=(const GaussDigitizer &other)
Space::Vector Vector
void selfDisplay(std::ostream &out) const
const Point & getUpperBound() const
bool operator()(const Point &p) const
BOOST_CONCEPT_ASSERT((concepts::CEuclideanOrientedShape< TEuclideanShape >))
Point round(const RealPoint &p) const
Point ceil(const RealPoint &p) const
void init(const RealPoint &xLow, const RealPoint &xUp, typename RealVector::Component gridStep)
Space::Integer Integer
Domain getDomain() const
CountedConstPtrOrConstPtr< EuclideanShape > myEShape
The referenced shape or 0 if not initialized.
RealPoint embed(const Point &p) const
Space::RealPoint RealVector
Space::RealPoint RealPoint
void init(const RealPoint &xLow, const RealPoint &xUp, const RealVector &gridSteps)
bool isValid() const
RegularPointEmbedder< Space > myPointEmbedder
The embedder.
TEuclideanRing Component
Type for Vector elements.
Definition: PointVector.h:614
TInteger Integer
Arithmetic ring induced by (+,-,*) and Integer numbers.
Definition: SpaceND.h:102
DGtal is the top-level namespace which contains all DGtal functions and types.
std::ostream & operator<<(std::ostream &out, const ATu0v1< TKSpace, TLinearAlgebra > &object)
Orientation
Definition: Common.h:141
Aim: characterizes models of digital oriented shapes. For example, models should provide an orientati...