DGtal 1.3.0
Loading...
Searching...
No Matches
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
57namespace 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
150
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
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: Smart or simple const pointer on T. It can be a smart pointer based on reference counts or a sim...
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
GaussDigitizer & operator=(const GaussDigitizer &other)
const Point & getUpperBound() const
Point floor(const RealPoint &p) const
Orientation orientation(const Point &p) const
void attach(ConstAlias< EuclideanShape > shape)
const PointEmbedder & pointEmbedder() const
const Point & getLowerBound() const
RealVector gridSteps() const
Point myLowerPoint
Digital lowest point.
Space::Vector Vector
void selfDisplay(std::ostream &out) 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.
Aim: Parallelepidec region of a digital space, model of a 'CDomain'.
TEuclideanRing Component
Type for Vector elements.
Definition: PointVector.h:614
Aim: A simple point embedder where grid steps are given for each axis. Note that the real point (0,...
TInteger Integer
Arithmetic ring induced by (+,-,*) and Integer numbers.
Definition: SpaceND.h:102
PointVector< dim, Integer > Point
Points in DGtal::SpaceND.
Definition: SpaceND.h:110
DGtal is the top-level namespace which contains all DGtal functions and types.
std::ostream & operator<<(std::ostream &out, const ClosedIntegerHalfPlane< TSpace > &object)
Orientation
Definition: Common.h:142
Aim: characterizes models of digital oriented shapes. For example, models should provide an orientati...