DGtal  0.6.devel
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
VoronoiMap.h
1 
17 #pragma once
18 
34 #if defined(VoronoiMap_RECURSES)
35 #error Recursive header files inclusion detected in VoronoiMap.h
36 #else // defined(VoronoiMap_RECURSES)
37 
38 #define VoronoiMap_RECURSES
39 
40 #if !defined VoronoiMap_h
41 
42 #define VoronoiMap_h
43 
45 // Inclusions
46 #include <iostream>
47 #include <vector>
48 #include "DGtal/base/Common.h"
49 #include "DGtal/images/ImageContainerBySTLVector.h"
50 #include "DGtal/kernel/CPointPredicate.h"
51 
52 #include "DGtal/geometry/volumes/distance/SeparableMetricHelper.h"
53 #include "DGtal/kernel/domains/HyperRectDomain.h"
55 
56 namespace DGtal
57 {
58 
60  // template class VoronoiMap
106  template < typename TSpace,
107  typename TPointPredicate,
108  DGtal::uint32_t p>
110  {
111 
112  public:
115 
117  BOOST_STATIC_ASSERT ((boost::is_same< typename TSpace::Point,
118  typename TPointPredicate::Point >::value ));
119 
121  typedef TSpace Space;
122 
124  typedef TPointPredicate PointPredicate;
125 
128 
131 
132  typedef typename Space::Vector Vector;
133  typedef typename Space::Point Point;
134  typedef typename Space::Dimension Dimension;
135  typedef typename Space::Size Size;
136  typedef typename Space::Point::Coordinate Abscissa;
137 
140 
144 
148  VoronoiMap(const Domain & aDomain,
149  const PointPredicate & predicate);
150 
154  ~VoronoiMap();
155 
156  public:
157 
166  OutputImage compute ( ) ;
167 
168 
169  // ------------------- Private functions ------------------------
170  private:
171 
178  void computeOtherSteps(OutputImage & output,
179  const Dimension dim) const;
192  void computeOtherStep1D (OutputImage & output,
193  const Point &row,
194  const Size dim,
195  std::vector<Point> &Sites) const;
196 
197  // ------------------- protected methods ------------------------
198  protected:
199 
204  VoronoiMap();
205 
206 
207  // ------------------- Private members ------------------------
208  private:
209 
212 
214  const Domain & myDomain;
215 
218 
221 
224 
227 
228 
229  }; // end of class VoronoiMap
230 
231 } // namespace DGtal
232 
233 
235 // Includes inline functions.
236 #include "DGtal/geometry/volumes/distance/VoronoiMap.ih"
237 
238 // //
240 
241 #endif // !defined VoronoiMap_h
242 
243 #undef VoronoiMap_RECURSES
244 #endif // else defined(VoronoiMap_RECURSES)