DGtal  1.3.beta
RegularPointEmbedder.h
1 
17 #pragma once
18 
33 #if defined(RegularPointEmbedder_RECURSES)
34 #error Recursive header files inclusion detected in RegularPointEmbedder.h
35 #else // defined(RegularPointEmbedder_RECURSES)
36 
37 #define RegularPointEmbedder_RECURSES
38 
39 #if !defined RegularPointEmbedder_h
40 
41 #define RegularPointEmbedder_h
42 
44 // Inclusions
45 #include <iostream>
46 #include "DGtal/base/Common.h"
47 #include "DGtal/kernel/CSpace.h"
48 
50 
51 namespace DGtal
52 {
53 
55  // template class RegularPointEmbedder
67  template <typename TSpace>
69  {
71 
72  // ----------------------- Standard services ------------------------------
73  public:
74  typedef TSpace Space;
75  typedef typename Space::Point Point;
76  typedef typename Space::RealPoint RealPoint;
77  typedef Point Argument;
78  typedef RealPoint Value;
79 
80  typedef typename Space::Integer Integer;
81  typedef typename Space::RealVector RealVector;
82 
87 
92 
99 
107  void init( typename RealVector::Component gridStep );
108 
115  void init( const RealVector & gridSteps );
116 
121  Point floor( const RealPoint & p ) const;
122 
127  Point ceil( const RealPoint & p ) const;
128 
135  Point round( const RealPoint & p ) const;
136 
144  RealPoint embed( const Point & p ) const;
145 
153  RealPoint operator()( const Point & p ) const;
154 
155 
159  RealVector gridSteps() const;
160 
161 
162  // ----------------------- Interface --------------------------------------
163  public:
164 
169  void selfDisplay ( std::ostream & out ) const;
170 
175  bool isValid() const;
176 
177  // ------------------------- Protected Datas ------------------------------
178  protected:
181 
182  // ------------------------- Private Datas --------------------------------
183  private:
184 
185  // ------------------------- Hidden services ------------------------------
186  private:
187 
188  // ------------------------- Internals ------------------------------------
189  private:
190 
191  }; // end of class RegularPointEmbedder
192 
193 
200  template <typename TSpace>
201  std::ostream&
202  operator<< ( std::ostream & out,
203  const RegularPointEmbedder<TSpace> & object );
204 
205 } // namespace DGtal
206 
207 
209 // Includes inline functions.
210 #include "DGtal/kernel/RegularPointEmbedder.ih"
211 
212 // //
214 
215 #endif // !defined RegularPointEmbedder_h
216 
217 #undef RegularPointEmbedder_RECURSES
218 #endif // else defined(RegularPointEmbedder_RECURSES)
DGtal::RegularPointEmbedder::Value
RealPoint Value
Definition: RegularPointEmbedder.h:78
DGtal::concepts::CSpace
Aim: Defines the concept describing a digital space, ie a cartesian product of integer lines.
Definition: CSpace.h:105
DGtal::RegularPointEmbedder::selfDisplay
void selfDisplay(std::ostream &out) const
DGtal::RegularPointEmbedder::Point
Space::Point Point
Definition: RegularPointEmbedder.h:75
DGtal::RegularPointEmbedder::init
void init(typename RealVector::Component gridStep)
DGtal::RegularPointEmbedder::RealVector
Space::RealVector RealVector
Definition: RegularPointEmbedder.h:81
DGtal::RegularPointEmbedder::~RegularPointEmbedder
~RegularPointEmbedder()
DGtal::RegularPointEmbedder::Argument
Point Argument
Definition: RegularPointEmbedder.h:77
DGtal::RegularPointEmbedder
Aim: A simple point embedder where grid steps are given for each axis. Note that the real point (0,...
Definition: RegularPointEmbedder.h:68
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::RegularPointEmbedder::ceil
Point ceil(const RealPoint &p) const
DGtal::RegularPointEmbedder::Integer
Space::Integer Integer
Definition: RegularPointEmbedder.h:80
DGtal::RegularPointEmbedder::operator()
RealPoint operator()(const Point &p) const
DGtal
DGtal is the top-level namespace which contains all DGtal functions and types.
DGtal::RegularPointEmbedder::myGridSteps
RealVector myGridSteps
The grid steps.
Definition: RegularPointEmbedder.h:180
DGtal::RegularPointEmbedder::isValid
bool isValid() const
DGtal::RegularPointEmbedder::RealPoint
Space::RealPoint RealPoint
Definition: RegularPointEmbedder.h:76
DGtal::RegularPointEmbedder::BOOST_CONCEPT_ASSERT
BOOST_CONCEPT_ASSERT((concepts::CSpace< TSpace >))
DGtal::RegularPointEmbedder::floor
Point floor(const RealPoint &p) const
DGtal::PointVector< dim, Integer >
DGtal::RegularPointEmbedder::operator=
RegularPointEmbedder & operator=(const RegularPointEmbedder &other)
DGtal::RegularPointEmbedder::RegularPointEmbedder
RegularPointEmbedder()
DGtal::RegularPointEmbedder::gridSteps
RealVector gridSteps() const
DGtal::RegularPointEmbedder::embed
RealPoint embed(const Point &p) const
DGtal::RegularPointEmbedder::round
Point round(const RealPoint &p) const
DGtal::SpaceND::Integer
TInteger Integer
Arithmetic ring induced by (+,-,*) and Integer numbers.
Definition: SpaceND.h:102
DGtal::RegularPointEmbedder::Space
TSpace Space
Definition: RegularPointEmbedder.h:74