DGtal 1.4.0
Loading...
Searching...
No Matches
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)
37#define RegularPointEmbedder_RECURSES
38
39#if !defined RegularPointEmbedder_h
41#define RegularPointEmbedder_h
42
44// Inclusions
45#include <iostream>
46#include "DGtal/base/Common.h"
47#include "DGtal/kernel/CSpace.h"
48
50
51namespace 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;
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
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)
TEuclideanRing Component
Type for Vector elements.
Aim: A simple point embedder where grid steps are given for each axis. Note that the real point (0,...
RegularPointEmbedder & operator=(const RegularPointEmbedder &other)
RealPoint embed(const Point &p) const
void init(const RealVector &gridSteps)
Point floor(const RealPoint &p) const
Point ceil(const RealPoint &p) const
RealVector myGridSteps
The grid steps.
Point round(const RealPoint &p) const
void selfDisplay(std::ostream &out) const
RealPoint operator()(const Point &p) const
BOOST_CONCEPT_ASSERT((concepts::CSpace< TSpace >))
void init(typename RealVector::Component gridStep)
RealVector gridSteps() const
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 ClosedIntegerHalfPlane< TSpace > &object)
Aim: Defines the concept describing a digital space, ie a cartesian product of integer lines.
Definition CSpace.h:106