DGtal  1.4.2
CanonicEmbedder.h
1 
17 #pragma once
18 
31 #if defined(CanonicEmbedder_RECURSES)
32 #error Recursive header files inclusion detected in CanonicEmbedder.h
33 #else // defined(CanonicEmbedder_RECURSES)
35 #define CanonicEmbedder_RECURSES
36 
37 #if !defined CanonicEmbedder_h
39 #define CanonicEmbedder_h
40 
42 // Inclusions
43 #include <iostream>
44 #include "DGtal/base/Common.h"
45 #include "DGtal/kernel/CSpace.h"
47 
48 namespace DGtal
49 {
50 
52 // class CanonicEmbedder
63  template <typename TSpace>
65  {
66  public:
69 
70  typedef TSpace Space;
71  typedef typename Space::Integer Integer;
72  typedef typename Space::Point Point;
73  typedef typename Space::Vector Vector;
74  typedef typename Space::RealPoint RealPoint;
75  typedef Point Argument;
76  typedef RealPoint Value;
77 
78  // ----------------------- Standard services ------------------------------
79  public:
80 
84  virtual ~CanonicEmbedder(){};
85 
86 
91  Point floor( const RealPoint & p ) const;
92 
97  Point ceil( const RealPoint & p ) const;
98 
105  Point round( const RealPoint & p ) const;
106 
114  virtual RealPoint embed( const Point & dp ) const;
115 
123  virtual RealPoint operator()( const Point & dp ) const;
124 
125 
126 
127  // ----------------------- Interface --------------------------------------
128 public:
129 
134  void selfDisplay ( std::ostream & out ) const;
135 
140  bool isValid() const;
141 
142  // ------------------------- Protected Datas ------------------------------
143 private:
144  // ------------------------- Private Datas --------------------------------
145 private:
146 
147  // ------------------------- Hidden services ------------------------------
148 protected:
149 
150 
151  // ------------------------- Internals ------------------------------------
152 private:
153 
154 }; // end of class CanonicEmbedder
155 
156 
163  template <typename TSpace>
164  std::ostream&
165  operator<< ( std::ostream & out, const CanonicEmbedder<TSpace> & object );
166 
167 
168 } // namespace DGtal
169 
170 
172 // Includes inline functions.
173 #include "DGtal/kernel/CanonicEmbedder.ih"
174 
175 
176 // //
178 
179 #endif // !defined CanonicEmbedder_h
180 
181 #undef CanonicEmbedder_RECURSES
182 #endif // else defined(CanonicEmbedder_RECURSES)
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)
Aim: A trivial embedder for digital points, which corresponds to the canonic injection of Zn into Rn.
Space::Integer Integer
Point round(const RealPoint &p) const
void selfDisplay(std::ostream &out) const
virtual RealPoint embed(const Point &dp) const
virtual RealPoint operator()(const Point &dp) const
Point ceil(const RealPoint &p) const
BOOST_CONCEPT_ASSERT((concepts::CSpace< TSpace >))
Space::RealPoint RealPoint
CanonicEmbedder< TSpace > Self
Point floor(const RealPoint &p) const
Aim: Defines the concept describing a digital space, ie a cartesian product of integer lines.
Definition: CSpace.h:106