DGtal  1.5.beta
Linearizer.h
1 
17 #pragma once
18 
29 #if defined(Linearizer_RECURSES)
30 #error Recursive header files inclusion detected in Linearizer.h
31 #else // defined(Linearizer_RECURSES)
33 #define Linearizer_RECURSES
34 
35 #if !defined Linearizer_h
37 #define Linearizer_h
38 
40 // Inclusions
41 #include <DGtal/kernel/domains/HyperRectDomain.h> // Only for specialization purpose.
43 
44 namespace DGtal
45 {
46 
48 
54  struct RowMajorStorage {};
55 
61  struct ColMajorStorage {};
62 
64 
74  template <
75  typename TDomain,
76  typename TStorageOrder = ColMajorStorage
77  >
78  struct Linearizer;
79 
103  template <
104  typename TSpace,
105  typename TStorageOrder
106  >
107  struct Linearizer< HyperRectDomain<TSpace>, TStorageOrder >
108  {
109  // Usefull typedefs
111  typedef typename TSpace::Point Point;
112  typedef Point Extent;
113  typedef typename TSpace::Size Size;
114 
122  static inline
123  Size getIndex( Point aPoint, Point const& aLowerBound, Extent const& anExtent );
124 
133  static inline
134  Size getIndex( Point aPoint, Extent const& anExtent );
135 
142  static inline
143  Size getIndex( Point aPoint, Domain const& aDomain );
144 
152  static inline
153  Point getPoint( Size anIndex, Point const& aLowerBound, Extent const& anExtent );
154 
163  static inline
164  Point getPoint( Size anIndex, Extent const& anExtent );
165 
172  static inline
173  Point getPoint( Size anIndex, Domain const& aDomain );
174 
175  }; // end of class Linearizer
176 
177 } // namespace DGtal
178 
179 
181 // Includes inline functions.
182 #include "DGtal/kernel/domains/Linearizer.ih"
183 
184 // //
186 
187 #endif // !defined Linearizer_h
188 
189 #undef Linearizer_RECURSES
190 #endif // else defined(Linearizer_RECURSES)
191 
Aim: Parallelepidec region of a digital space, model of a 'CDomain'.
DGtal is the top-level namespace which contains all DGtal functions and types.
Tag (empty structure) specifying a col-major storage order.
Definition: Linearizer.h:61
static Point getPoint(Size anIndex, Domain const &aDomain)
static Point getPoint(Size anIndex, Extent const &anExtent)
static Size getIndex(Point aPoint, Point const &aLowerBound, Extent const &anExtent)
static Point getPoint(Size anIndex, Point const &aLowerBound, Extent const &anExtent)
static Size getIndex(Point aPoint, Extent const &anExtent)
HyperRectDomain< TSpace > Domain
The domain type.
Definition: Linearizer.h:110
static Size getIndex(Point aPoint, Domain const &aDomain)
Aim: Linearization and de-linearization interface for domains.
Definition: Linearizer.h:78
Tag (empty structure) specifying a row-major storage order.
Definition: Linearizer.h:54
MyPointD Point
Definition: testClone2.cpp:383
HalfEdgeDataStructure::Size Size
const Point aPoint(3, 4)