DGtal  1.3.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)
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/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 
103  GaussDigitizer();
104 
110  GaussDigitizer & operator= ( const GaussDigitizer & other );
111 
115  void attach( ConstAlias<EuclideanShape> shape );
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 
222  Vector resolution() const;
223 
227  RealVector gridSteps() const;
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)
DGtal::GaussDigitizer::Point
Space::Point Point
Definition: GaussDigitizer.h:85
DGtal::GaussDigitizer
Aim: A class for computing the Gauss digitization of some Euclidean shape, i.e. its intersection with...
Definition: GaussDigitizer.h:79
DGtal::GaussDigitizer::getDomain
Domain getDomain() const
DGtal::GaussDigitizer::RealPoint
Space::RealPoint RealPoint
Definition: GaussDigitizer.h:87
DGtal::GaussDigitizer::orientation
Orientation orientation(const Point &p) const
Definition: GaussDigitizer.h:194
DGtal::ConstAlias
Aim: This class encapsulates its parameter class so that to indicate to the user that the object/poin...
Definition: ConstAlias.h:186
DGtal::HyperRectDomain< Space >
DGtal::GaussDigitizer::operator=
GaussDigitizer & operator=(const GaussDigitizer &other)
DGtal::GaussDigitizer::getUpperBound
const Point & getUpperBound() const
DGtal::GaussDigitizer::GaussDigitizer
GaussDigitizer()
DGtal::GaussDigitizer::Space
TSpace Space
Definition: GaussDigitizer.h:83
DGtal::GaussDigitizer::resolution
Vector resolution() const
DGtal::GaussDigitizer::Vector
Space::Vector Vector
Definition: GaussDigitizer.h:86
DGtal::GaussDigitizer::selfDisplay
void selfDisplay(std::ostream &out) const
DGtal::GaussDigitizer::~GaussDigitizer
~GaussDigitizer()
DGtal::GaussDigitizer::pointEmbedder
const PointEmbedder & pointEmbedder() const
DGtal::GaussDigitizer::attach
void attach(ConstAlias< EuclideanShape > shape)
DGtal::GaussDigitizer::isValid
bool isValid() const
DGtal::GaussDigitizer::EuclideanShape
TEuclideanShape EuclideanShape
Definition: GaussDigitizer.h:89
DGtal::RegularPointEmbedder< Space >
DGtal::GaussDigitizer::myPointEmbedder
RegularPointEmbedder< Space > myPointEmbedder
The embedder.
Definition: GaussDigitizer.h:251
DGtal::GaussDigitizer::ceil
Point ceil(const RealPoint &p) const
DGtal::PointVector::Component
TEuclideanRing Component
Type for Vector elements.
Definition: PointVector.h:614
DGtal::operator<<
std::ostream & operator<<(std::ostream &out, const ATu0v1< TKSpace, TLinearAlgebra > &object)
DGtal::GaussDigitizer::init
void init(const RealPoint &xLow, const RealPoint &xUp, typename RealVector::Component gridStep)
DGtal::GaussDigitizer::Domain
HyperRectDomain< Space > Domain
Definition: GaussDigitizer.h:90
DGtal::Orientation
Orientation
Definition: Common.h:142
DGtal::CountedConstPtrOrConstPtr< EuclideanShape >
DGtal::concepts::CEuclideanOrientedShape
Aim: characterizes models of digital oriented shapes. For example, models should provide an orientati...
Definition: CEuclideanOrientedShape.h:91
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
DGtal::GaussDigitizer::floor
Point floor(const RealPoint &p) const
DGtal::GaussDigitizer::operator()
bool operator()(const Point &p) const
Vector
FreemanChain< int >::Vector Vector
Definition: testCombinDSS.cpp:60
DGtal::GaussDigitizer::myEShape
CountedConstPtrOrConstPtr< EuclideanShape > myEShape
The referenced shape or 0 if not initialized.
Definition: GaussDigitizer.h:248
DGtal::GaussDigitizer::round
Point round(const RealPoint &p) const
DGtal::GaussDigitizer::PointEmbedder
RegularPointEmbedder< Space > PointEmbedder
Definition: GaussDigitizer.h:91
DGtal::GaussDigitizer::embed
RealPoint embed(const Point &p) const
DGtal::PointVector< dim, Integer >
DGtal::GaussDigitizer::myUpperPoint
Point myUpperPoint
Digital uppest point.
Definition: GaussDigitizer.h:257
Point
MyPointD Point
Definition: testClone2.cpp:383
DGtal::SpaceND::Integer
TInteger Integer
Arithmetic ring induced by (+,-,*) and Integer numbers.
Definition: SpaceND.h:102
DGtal::GaussDigitizer::Integer
Space::Integer Integer
Definition: GaussDigitizer.h:84
DGtal::GaussDigitizer::getLowerBound
const Point & getLowerBound() const
DGtal::GaussDigitizer::RealVector
Space::RealPoint RealVector
Definition: GaussDigitizer.h:88
DGtal::GaussDigitizer::gridSteps
RealVector gridSteps() const
DGtal::GaussDigitizer::myLowerPoint
Point myLowerPoint
Digital lowest point.
Definition: GaussDigitizer.h:254
DGtal::GaussDigitizer::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((concepts::CEuclideanOrientedShape< TEuclideanShape >))