DGtal  0.9.2
Display2DFactory.h
1 
17 #pragma once
18 
31 #if defined(Display2DFactory_RECURSES)
32 #error Recursive header files inclusion detected in Display2DFactory.h
33 #else // defined(Display2DFactory_RECURSES)
34 
35 #define Display2DFactory_RECURSES
36 
37 #if !defined Display2DFactory_h
38 
39 #define Display2DFactory_h
40 
42 // Inclusions
43 
44 #include "DGtal/base/Common.h"
45 
46 #include "DGtal/kernel/sets/DigitalSetByAssociativeContainer.h"
47 #include "DGtal/kernel/sets/DigitalSetBySTLSet.h"
48 #include "DGtal/kernel/sets/DigitalSetBySTLVector.h"
49 
50 #include "DGtal/math/AngleLinearMinimizer.h"
51 #include "DGtal/geometry/curves/ArithmeticalDSS.h"
52 #include "DGtal/geometry/curves/ArithmeticalDSSComputer.h"
53 #include "DGtal/geometry/curves/AlphaThickSegmentComputer.h"
54 #include "DGtal/shapes/fromPoints/CircleFrom2Points.h"
55 #include "DGtal/shapes/fromPoints/CircleFrom3Points.h"
56 #include "DGtal/kernel/sets/DigitalSetBySTLSet.h"
57 #include "DGtal/kernel/sets/DigitalSetBySTLVector.h"
58 #include "DGtal/geometry/curves/GridCurve.h"
59 #include "DGtal/geometry/curves/FP.h"
60 #include "DGtal/geometry/curves/FreemanChain.h"
61 #include "DGtal/geometry/curves/StabbingLineComputer.h"
62 #include "DGtal/geometry/curves/StabbingCircleComputer.h"
63 #include "DGtal/geometry/curves/FrechetShortcut.h"
64 #include "DGtal/kernel/domains/HyperRectDomain.h"
65 #include "DGtal/images/ImageContainerByHashTree.h"
66 #include "DGtal/images/ImageContainerBySTLVector.h"
67 #include "DGtal/images/ImageAdapter.h"
68 #include "DGtal/topology/KhalimskySpaceND.h"
69 #include "DGtal/topology/KhalimskyPreSpaceND.h"
70 #include "DGtal/topology/Object.h"
71 #include "DGtal/topology/CubicalComplex.h"
72 #include "DGtal/kernel/PointVector.h"
73 #include "DGtal/geometry/tools/Preimage2D.h"
74 #include "DGtal/shapes/fromPoints/StraightLineFrom2Points.h"
75 #include "DGtal/arithmetic/LatticePolytope2D.h"
76 #include "DGtal/topology/CanonicSCellEmbedder.h"
77 #include "DGtal/dec/VectorField.h"
78 #include "DGtal/dec/KForm.h"
79 #include "DGtal/dec/DiscreteExteriorCalculus.h"
80 
81 #include "DGtal/helpers/StdDefs.h"
82 
84 
85 
86 namespace DGtal
87 {
88 
90 // struct Display2DFactory
96  {
97  public:
98 
99 template <Dimension dim, typename TInteger>
100 static
101 void
103 
104 template <Dimension dim, typename TInteger>
105 static
106 void
108 
109 // DiscreteExteriorCalculus
110 template <Dimension dimEmbedded, Dimension dimAmbient, typename TLinearAlgebraBackend, typename TInteger>
111 static
112 void
114 // DiscreteExteriorCalculus
115 
116 // KForm
117 template <typename TCalculus, DGtal::Order order, DGtal::Duality duality>
118 static
119 void
121 
122 template <typename TCalculus, DGtal::Order order, DGtal::Duality duality, typename TColorMap>
123 static
124 void
125 drawWithColorMap(DGtal::Board2D& board, const DGtal::KForm<TCalculus, order, duality>& kform, const TColorMap& colormap);
126 // KForm
127 
128 // VectorField
129 template <typename TCalculus, DGtal::Duality duality>
130 static
131 void
132 draw(DGtal::Board2D& board, const DGtal::VectorField<TCalculus, duality>& vector_field);
133 // VectorField
134 
135 // AngleLinearMinimizer
136 static void draw( DGtal::Board2D & board, const DGtal::AngleLinearMinimizer & );
137 // AngleLinearMinimizer
138 
139 // ArithmeticalDSS
140 template <typename TCoordinate, typename TInteger, unsigned short adjacency>
141  static void drawAsBoundingBox( DGtal::Board2D & aBoard,
143 
144 template <typename TCoordinate, typename TInteger, unsigned short adjacency>
145  static void drawAsDigitalPoints( DGtal::Board2D & aBoard,
147 
148 template <typename TCoordinate, typename TInteger, unsigned short adjacency>
150 // ArithmeticalDSS
151 
152 
153 // ArithmeticalDSSComputer
154 template <typename TIterator, typename TInteger, int connectivity>
155  static void drawAsBoundingBox( DGtal::Board2D & aBoard,
157 
158 template <typename TIterator, typename TInteger, int connectivity>
159  static void drawAsDigitalPoints( DGtal::Board2D & aBoard,
161 
162 template <typename TIterator, typename TInteger, int connectivity>
164 // ArithmeticalDSSComputer
165 
166 
167 // AlphaThickSegmentComputer
168 template < typename TInputPoint, typename TConstIterator>
169 static void drawAsBoundingBox( DGtal::Board2D & aBoard,
171 
172 template < typename TInputPoint, typename TConstIterator>
173 static void drawAsDigitalPoints( DGtal::Board2D & aBoard,
175 
176 template < typename TInputPoint, typename TConstIterator>
177  static void draw( DGtal::Board2D & aBoard,
179 // AlphaThickSegmentComputer
180 
181 
182 // CircleFrom2Points
183 template <typename TPoint>
184 static void draw(Board2D & aBoard, const DGtal::CircleFrom2Points<TPoint> & );
185 // CircleFrom2Points
186 
187 
188 // CircleFrom3Points
189 template <typename Point>
190 static void drawArc(Board2D & aBoard, const DGtal::CircleFrom3Points<Point> &, const Point &, const Point &, bool anOrientation = true);
191 
192 template <typename Point>
193 static void drawSector(Board2D & aBoard, const DGtal::CircleFrom3Points<Point> &, const Point &, const Point &, bool anOrientation = true);
194 
195 template <typename Point>
196 static void drawAnnulus(Board2D & aBoard, const DGtal::CircleFrom3Points<Point> &, const Point &, const Point &, bool anOrientation = true, const double& w = 1.0);
197 
198 template <typename Point>
199 static void draw(Board2D & aBoard, const DGtal::CircleFrom3Points<Point> &, const Point &, const Point &, bool anOrientation = true);
200 
201 template <typename TPoint>
202 static void draw(Board2D & aBoard, const DGtal::CircleFrom3Points<TPoint> & );
203 // CircleFrom3Points
204 
205 
206 // DigitalSetBySTLSet
207 template<typename Domain, typename Compare>
208 static void draw( DGtal::Board2D & board, const DGtal::DigitalSetBySTLSet<Domain, Compare> & );
209 // DigitalSetBySTLSet
210 
211 
212 // DigitalSetByAssociativeContainer
213 template<typename Domain, typename Container>
215 // DigitalSetByAssociativeContainer
216 
217 
218 // DigitalSetBySTLVector
219 template<typename Domain>
220 static void draw( DGtal::Board2D & board, const DGtal::DigitalSetBySTLVector<Domain> & );
221 // DigitalSetBySTLVector
222 
223 
224 // FP
225 template <typename TIterator, typename TInteger, int connectivity>
227 
228 template <typename TIterator, typename TInteger, int connectivity>
229  static void draw( DGtal::Board2D & board, const DGtal::FP<TIterator,TInteger,connectivity> & );
230 // FP
231 
232 
233 // FreemanChain
234 template <typename TInteger>
235 static void drawAsGrid( DGtal::Board2D & aBoard, const DGtal::FreemanChain<TInteger> & );
236 
237 template <typename TInteger>
238 static void drawAsInterGrid( DGtal::Board2D & aBoard, const DGtal::FreemanChain<TInteger> & );
239 
240 template <typename TInteger>
241 static void draw( DGtal::Board2D & aBoard, const DGtal::FreemanChain<TInteger> & );
242 // FreemanChain
243 
244 
245 // StabbingLineComputer
246 template <typename TConstIterator>
247 static void draw(DGtal::Board2D & aBoard, const DGtal::StabbingLineComputer<TConstIterator> & );
248 // StabbingLineComputer
249 
250 // StabbingCircleComputer
251 template <typename TConstIterator>
253 // StabbingCircleComputer
254 
255 
256 //FrechetShortcut
257 template <typename TIterator, typename TInteger>
258 static void draw(DGtal::Board2D & aBoard, const DGtal::FrechetShortcut<TIterator,TInteger> & );
259 //FrechetShortcut
260 
261 
262 // GridCurve
263 template <typename TKSpace>
264 static void draw( DGtal::Board2D & aBoard,
265  const GridCurve<TKSpace> & object );
266 template <typename TKSpace>
267 static void drawFill( DGtal::Board2D & aBoard, const GridCurve<TKSpace> & object );
268 // GridCurve
269 
270 // SCellsRange
271 template <typename TIterator, typename TSCell>
272 static void draw( DGtal::Board2D & aBoard,
274 // SCellsRange
275 
276 // PointsRange
277 template <typename TIterator, typename TKSpace>
278 static void draw( DGtal::Board2D & aBoard,
279  const ConstRangeAdapter<TIterator, functors::SCellToPoint<TKSpace>, typename TKSpace::Point> & object );
280 // PointsRange
281 
282 // MidPointsRange
283 template <typename TIterator, typename TKSpace>
284 static void draw( DGtal::Board2D & aBoard,
286  typename TKSpace::Space::RealPoint> & object );
287 // MidPointsRange
288 
289 // ArrowsRange
290 template <typename TIterator, typename TKSpace>
291 static void draw( DGtal::Board2D & aBoard,
293  std::pair<typename TKSpace::Point, typename TKSpace::Vector > > & object );
294 // ArrowsRange
295 
296 // InnerPointsRange
297 template <typename TIterator, typename TKSpace>
298 static void draw( DGtal::Board2D & aBoard,
300  typename TKSpace::Point > & object );
301 // InnerPointsRange
302 
303 // OuterPointsRange
304 template <typename TIterator, typename TKSpace>
305 static void draw( DGtal::Board2D & aBoard,
307  typename TKSpace::Point > & object );
308 // OuterPointsRange
309 
310 // IncidentPointsRange
311 template <typename TIterator, typename TKSpace>
312 static void draw( DGtal::Board2D & aBoard,
314  std::pair<typename TKSpace::Point, typename TKSpace::Point> > & object );
315 // IncidentPointsRange
316 
317 // HyperRectDomain
318 template<typename TSpace>
319 static void drawAsGrid( DGtal::Board2D & aboard, const DGtal::HyperRectDomain<TSpace> & );
320 
321 template<typename TSpace>
322 static void drawAsPaving( DGtal::Board2D & aboard, const DGtal::HyperRectDomain<TSpace> & );
323 
324 template<typename TSpace>
325 static void draw( DGtal::Board2D & board, const DGtal::HyperRectDomain<TSpace> & );
326 // HyperRectDomain
327 
328 
329 // ImageContainerByHashTree
330 template <typename C, typename Domain, typename Value, typename HashKey>
331 static void drawImageRecursive( DGtal::Board2D & aBoard,
333  HashKey key,
334  const double p[2],
335  const double len,
336  LibBoard::Board & board,
337  const C& cmap );
338 
339 template <typename C, typename Domain, typename Value, typename HashKey>
340 static void drawImageHashTree( Board2D & board,
342  const Value &, const Value & );
343 // ImageContainerByHashTree
344 
345 
346 // ImageContainerBySTLVector, ImageContainerByHashTree, Image and ImageAdapter...
347 // minV and maxV are bounds values of colormap
348 template <typename Colormap, typename Image>
349  static void drawImage( DGtal::Board2D & board,
350  const Image & i,
351  const typename Image::Value & minV,
352  const typename Image::Value & maxV );
353 // ImageContainerBySTLVector, ImageContainerByHashTree, Image and ImageAdapter...
354 
355 
356 // KhalimskyCell
357 template < Dimension dim, typename TInteger >
358  static void draw( DGtal::Board2D & board, const DGtal::KhalimskyCell<dim, TInteger> & );
359 // KhalimskyCell
360 
361 // KhalimskyPreCell
362 template < Dimension dim, typename TInteger >
363  static void draw( DGtal::Board2D & board, const DGtal::KhalimskyPreCell<dim, TInteger> & );
364 // KhalimskyPreCell
365 
366 // Object
367 template <typename TDigitalTopology, typename TDigitalSet>
369 
370 template <typename TDigitalTopology, typename TDigitalSet>
371  static void draw( DGtal::Board2D & board, const DGtal::Object<TDigitalTopology, TDigitalSet> & );
372 // Object
373 
374 
375 // CubicalComplex
376 template < typename TKSpace, typename TCellContainer >
378 // CubicalComplex
379 
380 
381 
382 // PointVector
383 template<Dimension dim, typename TComponent>
384  static void drawAsPaving( DGtal::Board2D & board, const DGtal::PointVector<dim,TComponent> & );
385 
386 template<Dimension dim, typename TComponent>
387  static void drawAsGrid( DGtal::Board2D & board, const DGtal::PointVector<dim,TComponent> & );
388 
389 template<Dimension dim, typename TComponent>
390  static void draw( DGtal::Board2D & board, const DGtal::PointVector<dim,TComponent> & );
391 
392 template<Dimension dim, typename TComponent>
393  static void draw( DGtal::Board2D & board,
396 // PointVector
397 
398 
399 // Preimage2D
400 template <typename Shape>
401 static void draw( DGtal::Board2D & aBoard, const DGtal::Preimage2D<Shape> & );
402 // Preimage2D
403 
404 
405 // SignedKhalimskyCell
406 template < Dimension dim, typename TInteger >
407  static void draw( DGtal::Board2D & board, const DGtal::SignedKhalimskyCell<dim, TInteger> & );
408 // SignedKhalimskyCell
409 
410 // SignedKhalimskyPreCell
411 template < Dimension dim, typename TInteger >
412  static void draw( DGtal::Board2D & board, const DGtal::SignedKhalimskyPreCell<dim, TInteger> & );
413 // SignedKhalimskyPreCell
414 
415 // StraightLineFrom2Points
416 template <typename TPoint>
417 static void draw(Board2D & aBoard, const DGtal::StraightLineFrom2Points<TPoint> & );
418 // StraightLineFrom2Points
419 
420 
421 //
422 
423 
424 static void draw( DGtal::Board2D & board, const DGtal::CustomStyle & );
425 static void draw( DGtal::Board2D & board, const DGtal::SetMode & );
426 
427 
434  template <typename TSpace, typename TSequence>
435  static
436  void draw( DGtal::Board2D & aBoard,
438 
439 
440  }; // end of struct Display2DFactory
441 
442 } // namespace DGtal
443 
444 
446 // Includes inline functions/methods
447 #include "DGtal/io/Display2DFactory.ih"
448 
449 // //
451 
452 #endif // !defined Display2DFactory_h
453 
454 #undef Display2DFactory_RECURSES
455 #endif // else defined(Display2DFactory_RECURSES)
Aim: An object (or digital object) represents a set in some digital space associated with a digital t...
Definition: Object.h:119
Aim: DiscreteExteriorCalculus represents a calculus in the dec package. This is the main structure in...
Aim: On-line computation Computation of the longest shortcut according to the Fr├ęchet distance for a ...
static void drawAsInterGrid(DGtal::Board2D &aBoard, const DGtal::FreemanChain< TInteger > &)
Aim: Computes the preimage of the 2D Euclidean shapes crossing a sequence of n straigth segments in O...
Definition: Preimage2D.h:93
Aim: implements association bewteen points lying in a digital domain and values.
Definition: Image.h:69
static void drawDECSignedKhalimskyCell(DGtal::Board2D &board, const DGtal::SignedKhalimskyCell< dim, TInteger > &cell)
static void drawAsGrid(DGtal::Board2D &aBoard, const DGtal::FreemanChain< TInteger > &)
Class for EPS, FIG or SVG drawings.
Definition: Board.h:35
Aim: Represents a straight line uniquely defined by two 2D points and that is able to return for any ...
static void drawArc(Board2D &aBoard, const DGtal::CircleFrom3Points< Point > &, const Point &, const Point &, bool anOrientation=true)
static void drawAsDigitalPoints(DGtal::Board2D &aBoard, const DGtal::ArithmeticalDSS< TCoordinate, TInteger, adjacency > &)
static void drawAsBoundingBox(DGtal::Board2D &aBoard, const DGtal::ArithmeticalDSS< TCoordinate, TInteger, adjacency > &)
Aim: Parallelepidec region of a digital space, model of a 'CDomain'.
static void drawImage(DGtal::Board2D &board, const Image &i, const typename Image::Value &minV, const typename Image::Value &maxV)
Aim: KForm represents discrete kforms in the dec package.
Definition: KForm.h:65
Factory for Display2D:
Aim: Implements basic operations that will be used in Point and Vector classes.
Definition: PointVector.h:141
Aim: On-line recognition of a digital straight segment (DSS) defined as a sequence of connected grid ...
Aim: This class is a wrapper around ArithmeticalDSS that is devoted to the dynamic recognition of dig...
Aim: On-line recognition of a digital circular arcs (DCA) defined as a sequence of connected grid edg...
Aim: transforms a signed cell into an arrow, ie. a pair point-vector.
static void draw(DGtal::Board2D &board, const DGtal::DiscreteExteriorCalculus< dimEmbedded, dimAmbient, TLinearAlgebraBackend, TInteger > &calculus)
Aim: transforms a scell into a point.
static void drawImageHashTree(Board2D &board, const DGtal::experimental::ImageContainerByHashTree< Domain, Value, HashKey > &, const Value &, const Value &)
Aim: This class represents an arbitrary cubical complex living in some Khalimsky space. Cubical complexes are sets of cells of different dimensions related together with incidence relations. Two cells in a cubical complex are incident if and only if they are incident in the surrounding Khalimsky space. In other words, cubical complexes are defined here as subsets of Khalimsky spaces.
Aim: This class represents a naive (resp. standard) digital straight segment (DSS), ie. the sequence of simply 8- (resp. 4-)connected digital points contained in a naive (resp. standard) digital straight line (DSL) between two points of it.
static void drawAsPaving(DGtal::Board2D &aboard, const DGtal::HyperRectDomain< TSpace > &)
Model of CImageContainer implementing the association key<->Value using a hash tree. This class provides a built-in iterator.
Aim: A trivial embedder for signed cell, which corresponds to the canonic injection of cell centroids...
DGtal is the top-level namespace which contains all DGtal functions and types.
Aim: A wrapper class around a STL associative container for storing sets of digital points within som...
Aim: transforms a signed cell c into a point corresponding to the signed cell of greater dimension th...
Aim: model of CConstBidirectionalRange that adapts any range of elements bounded by two iterators [it...
Aim: Computes the faithful polygon (FP) of a range of 4/8-connected 2D Points.
Definition: FP.h:292
static void drawFill(DGtal::Board2D &aBoard, const GridCurve< TKSpace > &object)
static void drawWithAdjacencies(DGtal::Board2D &aBoard, const DGtal::Object< TDigitalTopology, TDigitalSet > &)
Represents a signed cell in a cellular grid space by its Khalimsky coordinates and a boolean value...
static void drawAsPolygon(DGtal::Board2D &aBoard, const DGtal::FP< TIterator, TInteger, connectivity > &)
Aim: Used to minimize the angle variation between different angles while taking into accounts min and...
Aim: Realizes the concept CDigitalSet by using the STL container std::vector.
Modifier class in a Board2D stream. Useful to choose your own mode for a given class. Realizes the concept CDrawableWithBoard2D.
Definition: Board2D.h:247
static void drawAnnulus(Board2D &aBoard, const DGtal::CircleFrom3Points< Point > &, const Point &, const Point &, bool anOrientation=true, const double &w=1.0)
Aim: This class is devoted to the recognition of alpha thick segments as described in ...
Aim: Represents a circle that passes through a given point and that is thus uniquely defined by two o...
Aim: describes, in a cellular space of dimension n, a closed or open sequence of signed d-cells (or d...
Definition: GridCurve.h:172
static void drawSector(Board2D &aBoard, const DGtal::CircleFrom3Points< Point > &, const Point &, const Point &, bool anOrientation=true)
static void drawWithColorMap(DGtal::Board2D &board, const DGtal::KForm< TCalculus, order, duality > &kform, const TColorMap &colormap)
Represents an (unsigned) cell in a cellular grid space by its Khalimsky coordinates.
Aim: transforms a signed cell c into a point corresponding to the signed cell of greater dimension th...
Aim: Represents a 2D polytope, i.e. a convex polygon, in the two-dimensional digital plane...
Aim: VectorField represents a discrete vector field in the dec package. Vector field values are attac...
Definition: VectorField.h:66
Aim: A container class for storing sets of digital points within some given domain.
Aim: This class specializes a 'Board' class so as to display DGtal objects more naturally (with <<)...
Definition: Board2D.h:70
static void drawImageRecursive(DGtal::Board2D &aBoard, const DGtal::experimental::ImageContainerByHashTree< Domain, Value, HashKey > &i, HashKey key, const double p[2], const double len, LibBoard::Board &board, const C &cmap)
Aim: transforms a signed cell c into a pair of points corresponding to the signed cells of greater di...